Re: [PATCH dlm/next 3/5] fs: dlm: trace user space callbacks
From: Alexander Aring <aahringo@redhat.com>
Date: 2022-08-05 18:46:24
Hi, On Mon, Jul 25, 2022 at 4:38 PM Alexander Aring [off-list ref] wrote: ...
quoted hunk ↗ jump to hunk
--- 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)@@ -122,14 +123,16 @@ 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; + else + __entry->error = error;
I need to investigate why my user space block calls drop all weird error numbers... We need to assign this value for user space locks as well. I will remove the else branch and move the handling above to all other field assignments and if it's kernel lock there is a special handling which is different on kernel locks only... this handling is still required. - Alex