aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/util/lock-contention.h
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung@kernel.org>2022-08-02 12:10:02 -0700
committerArnaldo Carvalho de Melo <acme@redhat.com>2022-08-02 18:02:10 -0300
commit447ec4e5fa339b30537d899447e73a103edef6d8 (patch)
tree8bc9ecee24e13ec08f0c56077e119dd24b238049 /tools/perf/util/lock-contention.h
parent4ee3c4da8b1b9c225bd156a7909980e32f3b3153 (diff)
perf lock: Introduce struct lock_contention
The lock_contention struct is to carry related fields together and to minimize the change when we add new config options. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Cc: Blake Jones <blakejones@google.com> Cc: Boqun Feng <boqun.feng@gmail.com> Cc: Davidlohr Bueso <dave@stgolabs.net> Cc: Ian Rogers <irogers@google.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Song Liu <songliubraving@fb.com> Cc: Waiman Long <longman@redhat.com> Cc: Will Deacon <will@kernel.org> Link: https://lore.kernel.org/r/20220802191004.347740-1-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/lock-contention.h')
-rw-r--r--tools/perf/util/lock-contention.h17
1 files changed, 11 insertions, 6 deletions
diff --git a/tools/perf/util/lock-contention.h b/tools/perf/util/lock-contention.h
index 092c84441f9f..a0df5308cca4 100644
--- a/tools/perf/util/lock-contention.h
+++ b/tools/perf/util/lock-contention.h
@@ -107,18 +107,24 @@ struct evlist;
struct machine;
struct target;
+struct lock_contention {
+ struct evlist *evlist;
+ struct target *target;
+ struct machine *machine;
+ struct hlist_head *result;
+};
+
#ifdef HAVE_BPF_SKEL
-int lock_contention_prepare(struct evlist *evlist, struct target *target);
+int lock_contention_prepare(struct lock_contention *con);
int lock_contention_start(void);
int lock_contention_stop(void);
-int lock_contention_read(struct machine *machine, struct hlist_head *head);
+int lock_contention_read(struct lock_contention *con);
int lock_contention_finish(void);
#else /* !HAVE_BPF_SKEL */
-static inline int lock_contention_prepare(struct evlist *evlist __maybe_unused,
- struct target *target __maybe_unused)
+static inline int lock_contention_prepare(struct lock_contention *con __maybe_unused)
{
return 0;
}
@@ -127,8 +133,7 @@ static inline int lock_contention_start(void) { return 0; }
static inline int lock_contention_stop(void) { return 0; }
static inline int lock_contention_finish(void) { return 0; }
-static inline int lock_contention_read(struct machine *machine __maybe_unused,
- struct hlist_head *head __maybe_unused)
+static inline int lock_contention_read(struct lock_contention *con __maybe_unused)
{
return 0;
}