perf lock: Handle lock contention tracepoints
authorNamhyung Kim <namhyung@kernel.org>
Wed, 15 Jun 2022 16:32:20 +0000 (09:32 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 12 Jul 2022 12:55:37 +0000 (09:55 -0300)
commit3ae03f2650b8d87242906f6c160732bc9d991ca1
tree57169f3d9bf356840ed10ea98a30bb71282663c2
parent166a9764a38e37089088eb21f31cfcb6d5a0dde2
perf lock: Handle lock contention tracepoints

When the lock contention events are used, there's no tracking of
acquire and release.  So the state machine is simplified to use
UNINITIALIZED -> CONTENDED -> ACQUIRED only.

Note that CONTENDED state is re-entrant since mutex locks can hit two
or more consecutive contention_begin events for optimistic spinning
and sleep.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Ian Rogers <irogers@google.com>
Cc: Boqun Feng <boqun.feng@gmail.com>
Cc: Davidlohr Bueso <dave@stgolabs.net>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Waiman Long <longman@redhat.com>
Cc: Will Deacon <will@kernel.org>
Link: https://lore.kernel.org/r/20220615163222.1275500-6-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/builtin-lock.c