diff options
author | Stanislav Fomichev <stfomichev@yandex-team.ru> | 2014-06-26 12:14:24 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2014-06-26 15:00:45 -0400 |
commit | 0c82adcf141935b6312593a53f87342dbb12b704 (patch) | |
tree | fe3873ac1de8ca83788b15ee75c3df57973a6182 | |
parent | 07100877ea8fd9b2feabb4dd78f3322892f6bd77 (diff) |
perf trace: Add perf_event parameter to tracepoint_handler
It will be used by next pagefault tracing patches in the series.
Signed-off-by: Stanislav 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.ru
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r-- | tools/perf/builtin-trace.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index 5549cee61680..4a9e26b731fe 100644 --- a/tools/perf/builtin-trace.c +++ b/tools/perf/builtin-trace.c | |||
@@ -1538,6 +1538,7 @@ static size_t syscall__scnprintf_args(struct syscall *sc, char *bf, size_t size, | |||
1538 | } | 1538 | } |
1539 | 1539 | ||
1540 | typedef int (*tracepoint_handler)(struct trace *trace, struct perf_evsel *evsel, | 1540 | typedef int (*tracepoint_handler)(struct trace *trace, struct perf_evsel *evsel, |
1541 | union perf_event *event, | ||
1541 | struct perf_sample *sample); | 1542 | struct perf_sample *sample); |
1542 | 1543 | ||
1543 | static struct syscall *trace__syscall_info(struct trace *trace, | 1544 | static struct syscall *trace__syscall_info(struct trace *trace, |
@@ -1610,6 +1611,7 @@ static void thread__update_stats(struct thread_trace *ttrace, | |||
1610 | } | 1611 | } |
1611 | 1612 | ||
1612 | static int trace__sys_enter(struct trace *trace, struct perf_evsel *evsel, | 1613 | static int trace__sys_enter(struct trace *trace, struct perf_evsel *evsel, |
1614 | union perf_event *event __maybe_unused, | ||
1613 | struct perf_sample *sample) | 1615 | struct perf_sample *sample) |
1614 | { | 1616 | { |
1615 | char *msg; | 1617 | char *msg; |
@@ -1658,6 +1660,7 @@ static int trace__sys_enter(struct trace *trace, struct perf_evsel *evsel, | |||
1658 | } | 1660 | } |
1659 | 1661 | ||
1660 | static int trace__sys_exit(struct trace *trace, struct perf_evsel *evsel, | 1662 | static int trace__sys_exit(struct trace *trace, struct perf_evsel *evsel, |
1663 | union perf_event *event __maybe_unused, | ||
1661 | struct perf_sample *sample) | 1664 | struct perf_sample *sample) |
1662 | { | 1665 | { |
1663 | int ret; | 1666 | int ret; |
@@ -1735,6 +1738,7 @@ out: | |||
1735 | } | 1738 | } |
1736 | 1739 | ||
1737 | static int trace__vfs_getname(struct trace *trace, struct perf_evsel *evsel, | 1740 | static int trace__vfs_getname(struct trace *trace, struct perf_evsel *evsel, |
1741 | union perf_event *event __maybe_unused, | ||
1738 | struct perf_sample *sample) | 1742 | struct perf_sample *sample) |
1739 | { | 1743 | { |
1740 | trace->last_vfs_getname = perf_evsel__rawptr(evsel, sample, "pathname"); | 1744 | 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 | } | 1746 | } |
1743 | 1747 | ||
1744 | static int trace__sched_stat_runtime(struct trace *trace, struct perf_evsel *evsel, | 1748 | static int trace__sched_stat_runtime(struct trace *trace, struct perf_evsel *evsel, |
1749 | union perf_event *event __maybe_unused, | ||
1745 | struct perf_sample *sample) | 1750 | struct perf_sample *sample) |
1746 | { | 1751 | { |
1747 | u64 runtime = perf_evsel__intval(evsel, sample, "runtime"); | 1752 | u64 runtime = perf_evsel__intval(evsel, sample, "runtime"); |
@@ -1781,7 +1786,7 @@ static bool skip_sample(struct trace *trace, struct perf_sample *sample) | |||
1781 | } | 1786 | } |
1782 | 1787 | ||
1783 | static int trace__process_sample(struct perf_tool *tool, | 1788 | static int trace__process_sample(struct perf_tool *tool, |
1784 | union perf_event *event __maybe_unused, | 1789 | union perf_event *event, |
1785 | struct perf_sample *sample, | 1790 | struct perf_sample *sample, |
1786 | struct perf_evsel *evsel, | 1791 | struct perf_evsel *evsel, |
1787 | struct machine *machine __maybe_unused) | 1792 | struct machine *machine __maybe_unused) |
@@ -1799,7 +1804,7 @@ static int trace__process_sample(struct perf_tool *tool, | |||
1799 | 1804 | ||
1800 | if (handler) { | 1805 | if (handler) { |
1801 | ++trace->nr_events; | 1806 | ++trace->nr_events; |
1802 | handler(trace, evsel, sample); | 1807 | handler(trace, evsel, event, sample); |
1803 | } | 1808 | } |
1804 | 1809 | ||
1805 | return err; | 1810 | return err; |
@@ -1990,7 +1995,7 @@ again: | |||
1990 | } | 1995 | } |
1991 | 1996 | ||
1992 | handler = evsel->handler; | 1997 | handler = evsel->handler; |
1993 | handler(trace, evsel, &sample); | 1998 | handler(trace, evsel, event, &sample); |
1994 | next_event: | 1999 | next_event: |
1995 | perf_evlist__mmap_consume(evlist, i); | 2000 | perf_evlist__mmap_consume(evlist, i); |
1996 | 2001 | ||