Re: [PATCH 2/5] perf lock: Add lock contention tracepoints record support
From: Namhyung Kim
Date: Thu Jun 02 2022 - 16:06:55 EST
Hi Ian,
On Wed, Jun 1, 2022 at 11:21 PM Ian Rogers <irogers@xxxxxxxxxx> wrote:
>
> On Tue, May 31, 2022 at 11:58 PM Namhyung Kim <namhyung@xxxxxxxxxx> wrote:
> >
> > When LOCKDEP and LOCK_STAT events are not available, it falls back to
> > record the new lock contention tracepoints.
> >
> > Signed-off-by: Namhyung Kim <namhyung@xxxxxxxxxx>
> > ---
> > tools/perf/builtin-lock.c | 70 +++++++++++++++++++++++++++++++++++----
> > 1 file changed, 63 insertions(+), 7 deletions(-)
> >
> > diff --git a/tools/perf/builtin-lock.c b/tools/perf/builtin-lock.c
> > index 23a33ac15e68..3e3320b8cede 100644
> > --- a/tools/perf/builtin-lock.c
> > +++ b/tools/perf/builtin-lock.c
> > @@ -495,6 +495,12 @@ struct trace_lock_handler {
> >
> > int (*release_event)(struct evsel *evsel,
> > struct perf_sample *sample);
> > +
> > + int (*contention_begin_event)(struct evsel *evsel,
> > + struct perf_sample *sample);
> > +
> > + int (*contention_end_event)(struct evsel *evsel,
> > + struct perf_sample *sample);
>
> Would it make sense to add a comment here about LOCKDEP and LOCK_STAT?
> It could be confusing if the handler isn't called on different
> kernels.
Sure, I'll add some comments here.
Thanks,
Namhyung