diff options
author | Alexander Aring <aahringo@redhat.com> | 2022-08-15 15:43:24 -0400 |
---|---|---|
committer | David Teigland <teigland@redhat.com> | 2022-08-23 14:54:04 -0500 |
commit | 7a3de7324c2b1299a4f595bb6aa503c878ad7d75 (patch) | |
tree | bcdab8f6ae49a0352c1220a635a8654cb0173298 /include/trace/events/dlm.h | |
parent | 296d9d1e9890830bd149105cf0193c2cf7d5bc86 (diff) | |
download | lwn-7a3de7324c2b1299a4f595bb6aa503c878ad7d75.tar.gz lwn-7a3de7324c2b1299a4f595bb6aa503c878ad7d75.zip |
fs: dlm: trace user space callbacks
This patch adds trace callbacks for user locks. Unfortenately user locks
are handled in a different way than kernel locks in some cases. User
locks never call the dlm_lock()/dlm_unlock() kernel API and use the next
step internal API of dlm. Adding those traces from user API callers
should make it possible for dlm trace system to see lock handling for
user locks as well.
Signed-off-by: Alexander Aring <aahringo@redhat.com>
Signed-off-by: David Teigland <teigland@redhat.com>
Diffstat (limited to 'include/trace/events/dlm.h')
-rw-r--r-- | include/trace/events/dlm.h | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/include/trace/events/dlm.h b/include/trace/events/dlm.h index bad21222130e..18575206295f 100644 --- a/include/trace/events/dlm.h +++ b/include/trace/events/dlm.h @@ -92,9 +92,10 @@ TRACE_EVENT(dlm_lock_start, TRACE_EVENT(dlm_lock_end, TP_PROTO(struct dlm_ls *ls, struct dlm_lkb *lkb, void *name, - unsigned int namelen, int mode, __u32 flags, int error), + unsigned int namelen, int mode, __u32 flags, int error, + bool kernel_lock), - TP_ARGS(ls, lkb, name, namelen, mode, flags, error), + TP_ARGS(ls, lkb, name, namelen, mode, flags, error, kernel_lock), TP_STRUCT__entry( __field(__u32, ls_id) @@ -113,6 +114,7 @@ TRACE_EVENT(dlm_lock_end, __entry->lkb_id = lkb->lkb_id; __entry->mode = mode; __entry->flags = flags; + __entry->error = error; r = lkb->lkb_resource; if (r) @@ -122,14 +124,14 @@ TRACE_EVENT(dlm_lock_end, memcpy(__get_dynamic_array(res_name), name, __get_dynamic_array_len(res_name)); - /* return value will be zeroed in those cases by dlm_lock() - * we do it here again to not introduce more overhead if - * trace isn't running and error reflects the return value. - */ - if (error == -EAGAIN || error == -EDEADLK) - __entry->error = 0; - else - __entry->error = error; + if (kernel_lock) { + /* return value will be zeroed in those cases by dlm_lock() + * we do it here again to not introduce more overhead if + * trace isn't running and error reflects the return value. + */ + if (error == -EAGAIN || error == -EDEADLK) + __entry->error = 0; + } ), |