mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-07-27 16:49:22 -04:00
perf lock: Only pass sample to handlers
The evsel is within the sample and so only the sample needs to be passed. Remove the parameter and fix call site. Signed-off-by: Ian Rogers <irogers@google.com> Acked-by: Namhyung Kim <namhyung@kernel.org> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Albert Ou <aou@eecs.berkeley.edu> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Alexandre Ghiti <alex@ghiti.fr> Cc: Andi Kleen <ak@linux.intel.com> Cc: Andrew Jones <ajones@ventanamicro.com> Cc: Anup Patel <anup@brainfault.org> Cc: Athira Rajeev <atrajeev@linux.ibm.com> Cc: Blake Jones <blakejones@google.com> Cc: Chen Ni <nichen@iscas.ac.cn> Cc: Chun-Tse Shao <ctshao@google.com> Cc: Dapeng Mi <dapeng1.mi@linux.intel.com> Cc: Derek Foreman <derek.foreman@collabora.com> Cc: Dmitriy Vyukov <dvyukov@google.com> Cc: Dr. David Alan Gilbert <linux@treblig.org> Cc: Howard Chu <howardchu95@gmail.com> Cc: Hrishikesh Suresh <hrishikesh123s@gmail.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: James Clark <james.clark@linaro.org> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Krzysztof Łopatowski <krzysztof.m.lopatowski@gmail.com> Cc: Leo Yan <leo.yan@arm.com> Cc: Palmer Dabbelt <palmer@dabbelt.com> Cc: Paul Walmsley <pjw@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Quan Zhou <zhouquan@iscas.ac.cn> Cc: Ravi Bangoria <ravi.bangoria@amd.com> Cc: Swapnil Sapkal <swapnil.sapkal@amd.com> Cc: Thomas Falcon <thomas.falcon@intel.com> Cc: Tianyou Li <tianyou.li@intel.com> Cc: Yujie Liu <yujie.liu@intel.com> Cc: tanze <tanze@kylinos.cn> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
committed by
Arnaldo Carvalho de Melo
parent
859e495970
commit
9d491ab9ed
@@ -473,28 +473,22 @@ static struct lock_stat *pop_from_result(void)
|
||||
|
||||
struct trace_lock_handler {
|
||||
/* it's used on CONFIG_LOCKDEP */
|
||||
int (*acquire_event)(struct evsel *evsel,
|
||||
struct perf_sample *sample);
|
||||
int (*acquire_event)(struct perf_sample *sample);
|
||||
|
||||
/* it's used on CONFIG_LOCKDEP && CONFIG_LOCK_STAT */
|
||||
int (*acquired_event)(struct evsel *evsel,
|
||||
struct perf_sample *sample);
|
||||
int (*acquired_event)(struct perf_sample *sample);
|
||||
|
||||
/* it's used on CONFIG_LOCKDEP && CONFIG_LOCK_STAT */
|
||||
int (*contended_event)(struct evsel *evsel,
|
||||
struct perf_sample *sample);
|
||||
int (*contended_event)(struct perf_sample *sample);
|
||||
|
||||
/* it's used on CONFIG_LOCKDEP */
|
||||
int (*release_event)(struct evsel *evsel,
|
||||
struct perf_sample *sample);
|
||||
int (*release_event)(struct perf_sample *sample);
|
||||
|
||||
/* it's used when CONFIG_LOCKDEP is off */
|
||||
int (*contention_begin_event)(struct evsel *evsel,
|
||||
struct perf_sample *sample);
|
||||
int (*contention_begin_event)(struct perf_sample *sample);
|
||||
|
||||
/* it's used when CONFIG_LOCKDEP is off */
|
||||
int (*contention_end_event)(struct evsel *evsel,
|
||||
struct perf_sample *sample);
|
||||
int (*contention_end_event)(struct perf_sample *sample);
|
||||
};
|
||||
|
||||
static struct lock_seq_stat *get_seq(struct thread_stat *ts, u64 addr)
|
||||
@@ -563,8 +557,7 @@ static int get_key_by_aggr_mode(u64 *key, u64 addr,
|
||||
return get_key_by_aggr_mode_simple(key, addr, sample->tid);
|
||||
}
|
||||
|
||||
static int report_lock_acquire_event(struct evsel *evsel __maybe_unused,
|
||||
struct perf_sample *sample)
|
||||
static int report_lock_acquire_event(struct perf_sample *sample)
|
||||
{
|
||||
struct lock_stat *ls;
|
||||
struct thread_stat *ts;
|
||||
@@ -638,8 +631,7 @@ static int report_lock_acquire_event(struct evsel *evsel __maybe_unused,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int report_lock_acquired_event(struct evsel *evsel __maybe_unused,
|
||||
struct perf_sample *sample)
|
||||
static int report_lock_acquired_event(struct perf_sample *sample)
|
||||
{
|
||||
struct lock_stat *ls;
|
||||
struct thread_stat *ts;
|
||||
@@ -704,8 +696,7 @@ static int report_lock_acquired_event(struct evsel *evsel __maybe_unused,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int report_lock_contended_event(struct evsel *evsel __maybe_unused,
|
||||
struct perf_sample *sample)
|
||||
static int report_lock_contended_event(struct perf_sample *sample)
|
||||
{
|
||||
struct lock_stat *ls;
|
||||
struct thread_stat *ts;
|
||||
@@ -762,8 +753,7 @@ static int report_lock_contended_event(struct evsel *evsel __maybe_unused,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int report_lock_release_event(struct evsel *evsel __maybe_unused,
|
||||
struct perf_sample *sample)
|
||||
static int report_lock_release_event(struct perf_sample *sample)
|
||||
{
|
||||
struct lock_stat *ls;
|
||||
struct thread_stat *ts;
|
||||
@@ -963,8 +953,7 @@ static u64 *get_callstack(struct perf_sample *sample, int max_stack)
|
||||
return callstack;
|
||||
}
|
||||
|
||||
static int report_lock_contention_begin_event(struct evsel *evsel __maybe_unused,
|
||||
struct perf_sample *sample)
|
||||
static int report_lock_contention_begin_event(struct perf_sample *sample)
|
||||
{
|
||||
struct lock_stat *ls;
|
||||
struct thread_stat *ts;
|
||||
@@ -1127,8 +1116,7 @@ static int report_lock_contention_begin_event(struct evsel *evsel __maybe_unused
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int report_lock_contention_end_event(struct evsel *evsel __maybe_unused,
|
||||
struct perf_sample *sample)
|
||||
static int report_lock_contention_end_event(struct perf_sample *sample)
|
||||
{
|
||||
struct lock_stat *ls;
|
||||
struct thread_stat *ts;
|
||||
@@ -1208,45 +1196,45 @@ static struct trace_lock_handler contention_lock_ops = {
|
||||
|
||||
static struct trace_lock_handler *trace_handler;
|
||||
|
||||
static int evsel__process_lock_acquire(struct evsel *evsel, struct perf_sample *sample)
|
||||
static int evsel__process_lock_acquire(struct perf_sample *sample)
|
||||
{
|
||||
if (trace_handler->acquire_event)
|
||||
return trace_handler->acquire_event(evsel, sample);
|
||||
return trace_handler->acquire_event(sample);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int evsel__process_lock_acquired(struct evsel *evsel, struct perf_sample *sample)
|
||||
static int evsel__process_lock_acquired(struct perf_sample *sample)
|
||||
{
|
||||
if (trace_handler->acquired_event)
|
||||
return trace_handler->acquired_event(evsel, sample);
|
||||
return trace_handler->acquired_event(sample);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int evsel__process_lock_contended(struct evsel *evsel, struct perf_sample *sample)
|
||||
static int evsel__process_lock_contended(struct perf_sample *sample)
|
||||
{
|
||||
if (trace_handler->contended_event)
|
||||
return trace_handler->contended_event(evsel, sample);
|
||||
return trace_handler->contended_event(sample);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int evsel__process_lock_release(struct evsel *evsel, struct perf_sample *sample)
|
||||
static int evsel__process_lock_release(struct perf_sample *sample)
|
||||
{
|
||||
if (trace_handler->release_event)
|
||||
return trace_handler->release_event(evsel, sample);
|
||||
return trace_handler->release_event(sample);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int evsel__process_contention_begin(struct evsel *evsel, struct perf_sample *sample)
|
||||
static int evsel__process_contention_begin(struct perf_sample *sample)
|
||||
{
|
||||
if (trace_handler->contention_begin_event)
|
||||
return trace_handler->contention_begin_event(evsel, sample);
|
||||
return trace_handler->contention_begin_event(sample);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int evsel__process_contention_end(struct evsel *evsel, struct perf_sample *sample)
|
||||
static int evsel__process_contention_end(struct perf_sample *sample)
|
||||
{
|
||||
if (trace_handler->contention_end_event)
|
||||
return trace_handler->contention_end_event(evsel, sample);
|
||||
return trace_handler->contention_end_event(sample);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1424,8 +1412,7 @@ static int process_event_update(const struct perf_tool *tool,
|
||||
return 0;
|
||||
}
|
||||
|
||||
typedef int (*tracepoint_handler)(struct evsel *evsel,
|
||||
struct perf_sample *sample);
|
||||
typedef int (*tracepoint_handler)(struct perf_sample *sample);
|
||||
|
||||
static int process_sample_event(const struct perf_tool *tool __maybe_unused,
|
||||
union perf_event *event,
|
||||
@@ -1445,7 +1432,7 @@ static int process_sample_event(const struct perf_tool *tool __maybe_unused,
|
||||
|
||||
if (evsel->handler != NULL) {
|
||||
tracepoint_handler f = evsel->handler;
|
||||
err = f(evsel, sample);
|
||||
err = f(sample);
|
||||
}
|
||||
|
||||
thread__put(thread);
|
||||
|
||||
Reference in New Issue
Block a user