Commit 0c82adcf authored by Stanislav Fomichev's avatar Stanislav Fomichev Committed by Arnaldo Carvalho de Melo

perf trace: Add perf_event parameter to tracepoint_handler

It will be used by next pagefault tracing patches in the series.
Signed-off-by: default avatarStanislav Fomichev <stfomichev@yandex-team.ru>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1403799268-1367-2-git-send-email-stfomichev@yandex-team.ruSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 07100877
...@@ -1538,6 +1538,7 @@ static size_t syscall__scnprintf_args(struct syscall *sc, char *bf, size_t size, ...@@ -1538,6 +1538,7 @@ static size_t syscall__scnprintf_args(struct syscall *sc, char *bf, size_t size,
} }
typedef int (*tracepoint_handler)(struct trace *trace, struct perf_evsel *evsel, typedef int (*tracepoint_handler)(struct trace *trace, struct perf_evsel *evsel,
union perf_event *event,
struct perf_sample *sample); struct perf_sample *sample);
static struct syscall *trace__syscall_info(struct trace *trace, static struct syscall *trace__syscall_info(struct trace *trace,
...@@ -1610,6 +1611,7 @@ static void thread__update_stats(struct thread_trace *ttrace, ...@@ -1610,6 +1611,7 @@ static void thread__update_stats(struct thread_trace *ttrace,
} }
static int trace__sys_enter(struct trace *trace, struct perf_evsel *evsel, static int trace__sys_enter(struct trace *trace, struct perf_evsel *evsel,
union perf_event *event __maybe_unused,
struct perf_sample *sample) struct perf_sample *sample)
{ {
char *msg; char *msg;
...@@ -1658,6 +1660,7 @@ static int trace__sys_enter(struct trace *trace, struct perf_evsel *evsel, ...@@ -1658,6 +1660,7 @@ static int trace__sys_enter(struct trace *trace, struct perf_evsel *evsel,
} }
static int trace__sys_exit(struct trace *trace, struct perf_evsel *evsel, static int trace__sys_exit(struct trace *trace, struct perf_evsel *evsel,
union perf_event *event __maybe_unused,
struct perf_sample *sample) struct perf_sample *sample)
{ {
int ret; int ret;
...@@ -1735,6 +1738,7 @@ static int trace__sys_exit(struct trace *trace, struct perf_evsel *evsel, ...@@ -1735,6 +1738,7 @@ static int trace__sys_exit(struct trace *trace, struct perf_evsel *evsel,
} }
static int trace__vfs_getname(struct trace *trace, struct perf_evsel *evsel, static int trace__vfs_getname(struct trace *trace, struct perf_evsel *evsel,
union perf_event *event __maybe_unused,
struct perf_sample *sample) struct perf_sample *sample)
{ {
trace->last_vfs_getname = perf_evsel__rawptr(evsel, sample, "pathname"); trace->last_vfs_getname = perf_evsel__rawptr(evsel, sample, "pathname");
...@@ -1742,6 +1746,7 @@ static int trace__vfs_getname(struct trace *trace, struct perf_evsel *evsel, ...@@ -1742,6 +1746,7 @@ static int trace__vfs_getname(struct trace *trace, struct perf_evsel *evsel,
} }
static int trace__sched_stat_runtime(struct trace *trace, struct perf_evsel *evsel, static int trace__sched_stat_runtime(struct trace *trace, struct perf_evsel *evsel,
union perf_event *event __maybe_unused,
struct perf_sample *sample) struct perf_sample *sample)
{ {
u64 runtime = perf_evsel__intval(evsel, sample, "runtime"); u64 runtime = perf_evsel__intval(evsel, sample, "runtime");
...@@ -1781,7 +1786,7 @@ static bool skip_sample(struct trace *trace, struct perf_sample *sample) ...@@ -1781,7 +1786,7 @@ static bool skip_sample(struct trace *trace, struct perf_sample *sample)
} }
static int trace__process_sample(struct perf_tool *tool, static int trace__process_sample(struct perf_tool *tool,
union perf_event *event __maybe_unused, union perf_event *event,
struct perf_sample *sample, struct perf_sample *sample,
struct perf_evsel *evsel, struct perf_evsel *evsel,
struct machine *machine __maybe_unused) struct machine *machine __maybe_unused)
...@@ -1799,7 +1804,7 @@ static int trace__process_sample(struct perf_tool *tool, ...@@ -1799,7 +1804,7 @@ static int trace__process_sample(struct perf_tool *tool,
if (handler) { if (handler) {
++trace->nr_events; ++trace->nr_events;
handler(trace, evsel, sample); handler(trace, evsel, event, sample);
} }
return err; return err;
...@@ -1990,7 +1995,7 @@ static int trace__run(struct trace *trace, int argc, const char **argv) ...@@ -1990,7 +1995,7 @@ static int trace__run(struct trace *trace, int argc, const char **argv)
} }
handler = evsel->handler; handler = evsel->handler;
handler(trace, evsel, &sample); handler(trace, evsel, event, &sample);
next_event: next_event:
perf_evlist__mmap_consume(evlist, i); perf_evlist__mmap_consume(evlist, i);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment