From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexander Aring Date: Fri, 3 Mar 2023 17:28:30 -0500 Subject: [Cluster-devel] [PATCH dlm-tool 13/14] dlm_controld: plock log lock state In-Reply-To: References: <20230302171441.1509914-13-aahringo@redhat.com> <20230303133845.801743-1-agruenba@redhat.com> <20230303155255.807862-1-agruenba@redhat.com> Message-ID: List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hi, On Fri, Mar 3, 2023 at 5:20?PM Alexander Aring wrote: > > Hi, > > On Fri, Mar 3, 2023 at 11:08?AM Andreas Gruenbacher wrote: > > > > On Fri, Mar 3, 2023 at 4:53?PM Andreas Gruenbacher wrote: > > > diff --git a/dlm_controld/plock.c b/dlm_controld/plock.c > > > index 39bdd1f6..588bcaaa 100644 > > > --- a/dlm_controld/plock.c > > > +++ b/dlm_controld/plock.c > > > @@ -8,6 +8,7 @@ > > > > > > #include "dlm_daemon.h" > > > #include > > > +#include > > > > > does this require an additional dependency? > > > > /* FIXME: remove this once everyone is using the version of > > > * dlm_plock.h which defines it */ > > > @@ -211,6 +212,11 @@ static uint64_t dt_usec(const struct timeval *start, const struct timeval *stop) > > > static void plock_print_start_waiter(const struct lockspace *ls, > > > struct lock_waiter *w) > > > { > > > + const struct dlm_plock_info *info = &w->info; > > > + > > > + DTRACE_PROBE7(dlm_controld, plock_wait_begin, info->number, w, info->start, > > > + info->end, info->nodeid, info->pid, info->owner); > > > + > > > log_plock(ls, "state waiter start %llx %p %llx-%llx %d/%u/%llx", > > > (unsigned long long)w->info.number, > > > w, > > > > An additional question I have about those events is which information > > to log. We need to be able to identify which inode the request is for > > (info->number), the locking range (info->start and info->end), whether > > it is read or write lock, and which context in the kernel the request > > refers to (this seems to be info->owner, but I'm not entirely sure > > about that). The pid may be interesting as well, but are w or > > w is always true for waiters, it's just stored there as the structure > is used in other places. It means if it's not a trylock or not. When > we have a waiter we always have no trylock, so w == 1. > I am sorry, I thought you meant the w field in "w->w". As I explain it below, I use it as a unique handle to make the "start", "end" event matching. Alex