diff options
author | Alexander Aring <aahringo@redhat.com> | 2021-11-02 15:17:15 -0400 |
---|---|---|
committer | David Teigland <teigland@redhat.com> | 2021-11-02 14:39:20 -0500 |
commit | f1d3b8f91d965c4fd900ac5dd06240cc9df0c7a7 (patch) | |
tree | 5457b9004b866a1e7ffeb57ff011db5a5f353d81 /fs/dlm/ast.c | |
parent | 2f05ec4327ffaa34877de67fc5bb5eb3ab3767f0 (diff) | |
download | linux-f1d3b8f91d965c4fd900ac5dd06240cc9df0c7a7.tar.gz linux-f1d3b8f91d965c4fd900ac5dd06240cc9df0c7a7.tar.bz2 linux-f1d3b8f91d965c4fd900ac5dd06240cc9df0c7a7.zip |
fs: dlm: initial support for tracepoints
This patch adds initial support for dlm tracepoints. It will introduce
tracepoints to dlm main functionality dlm_lock()/dlm_unlock() and their
complete ast() callback or blocking bast() callback.
The lock/unlock functionality has a start and end tracepoint, this is
because there exists a race in case if would have a tracepoint at the
end position only the complete/blocking callbacks could occur before. To
work with eBPF tracing and using their lookup hash functionality there
could be problems that an entry was not inserted yet. However use the
start functionality for hash insert and check again in end functionality
if there was an dlm internal error so there is no ast callback. In further
it might also that locks with local masters will occur those callbacks
immediately so we must have such functionality.
I did not make everything accessible yet, although it seems eBPF can be
used to access a lot of internal datastructures if it's aware of the
struct definitions of the running kernel instance. We still can change
it, if you do eBPF experiments e.g. time measurements between lock and
callback functionality you can simple use the local lkb_id field as hash
value in combination with the lockspace id if you have multiple
lockspaces. Otherwise you can simple use trace-cmd for some functionality,
e.g. `trace-cmd record -e dlm` and `trace-cmd report` afterwards.
Signed-off-by: Alexander Aring <aahringo@redhat.com>
Signed-off-by: David Teigland <teigland@redhat.com>
Diffstat (limited to 'fs/dlm/ast.c')
-rw-r--r-- | fs/dlm/ast.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/dlm/ast.c b/fs/dlm/ast.c index 6600930497cc..27bae7d4a477 100644 --- a/fs/dlm/ast.c +++ b/fs/dlm/ast.c @@ -9,6 +9,8 @@ ******************************************************************************* ******************************************************************************/ +#include <trace/events/dlm.h> + #include "dlm_internal.h" #include "lock.h" #include "user.h" @@ -254,10 +256,12 @@ void dlm_callback_work(struct work_struct *work) continue; } else if (callbacks[i].flags & DLM_CB_BAST) { bastfn(lkb->lkb_astparam, callbacks[i].mode); + trace_dlm_bast(ls, lkb, callbacks[i].mode); } else if (callbacks[i].flags & DLM_CB_CAST) { lkb->lkb_lksb->sb_status = callbacks[i].sb_status; lkb->lkb_lksb->sb_flags = callbacks[i].sb_flags; castfn(lkb->lkb_astparam); + trace_dlm_ast(ls, lkb, lkb->lkb_lksb); } } |