diff options
author | Jiri Olsa <jolsa@redhat.com> | 2016-03-10 11:41:13 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-03-10 14:33:19 -0500 |
commit | e12b202f8fb9b62a3997cad8e93401f85293390c (patch) | |
tree | 8ed7cbbc22c6ff1fc4a7172aad162df1d8211abb /tools/perf/builtin-inject.c | |
parent | 9eb42dee2b11635174c74a7996934b6ca18f2179 (diff) |
perf jitdump: Build only on supported archs
Build jitdump only on architectures defined in util/genelf.h file, to avoid
breaking the build on such arches.
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Borislav Petkov <bp@suse.de>
Cc: Colin Ian King <colin.king@canonical.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Davidlohr Bueso <dbueso@suse.com>
Cc: He Kuang <hekuang@huawei.com>
Cc: Mel Gorman <mgorman@suse.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/20160310164113.GA11357@krava.redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-inject.c')
-rw-r--r-- | tools/perf/builtin-inject.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/tools/perf/builtin-inject.c b/tools/perf/builtin-inject.c index e219ed458d97..7fa68663ed72 100644 --- a/tools/perf/builtin-inject.c +++ b/tools/perf/builtin-inject.c | |||
@@ -73,7 +73,7 @@ static int perf_event__repipe_oe_synth(struct perf_tool *tool, | |||
73 | return perf_event__repipe_synth(tool, event); | 73 | return perf_event__repipe_synth(tool, event); |
74 | } | 74 | } |
75 | 75 | ||
76 | #if defined(HAVE_LIBELF_SUPPORT) && defined(HAVE_DWARF_SUPPORT) | 76 | #ifdef HAVE_JITDUMP |
77 | static int perf_event__drop_oe(struct perf_tool *tool __maybe_unused, | 77 | static int perf_event__drop_oe(struct perf_tool *tool __maybe_unused, |
78 | union perf_event *event __maybe_unused, | 78 | union perf_event *event __maybe_unused, |
79 | struct ordered_events *oe __maybe_unused) | 79 | struct ordered_events *oe __maybe_unused) |
@@ -245,7 +245,7 @@ static int perf_event__repipe_mmap(struct perf_tool *tool, | |||
245 | return err; | 245 | return err; |
246 | } | 246 | } |
247 | 247 | ||
248 | #if defined(HAVE_LIBELF_SUPPORT) && defined(HAVE_DWARF_SUPPORT) | 248 | #ifdef HAVE_JITDUMP |
249 | static int perf_event__jit_repipe_mmap(struct perf_tool *tool, | 249 | static int perf_event__jit_repipe_mmap(struct perf_tool *tool, |
250 | union perf_event *event, | 250 | union perf_event *event, |
251 | struct perf_sample *sample, | 251 | struct perf_sample *sample, |
@@ -283,7 +283,7 @@ static int perf_event__repipe_mmap2(struct perf_tool *tool, | |||
283 | return err; | 283 | return err; |
284 | } | 284 | } |
285 | 285 | ||
286 | #if defined(HAVE_LIBELF_SUPPORT) && defined(HAVE_DWARF_SUPPORT) | 286 | #ifdef HAVE_JITDUMP |
287 | static int perf_event__jit_repipe_mmap2(struct perf_tool *tool, | 287 | static int perf_event__jit_repipe_mmap2(struct perf_tool *tool, |
288 | union perf_event *event, | 288 | union perf_event *event, |
289 | struct perf_sample *sample, | 289 | struct perf_sample *sample, |
@@ -778,7 +778,9 @@ int cmd_inject(int argc, const char **argv, const char *prefix __maybe_unused) | |||
778 | OPT_BOOLEAN('s', "sched-stat", &inject.sched_stat, | 778 | OPT_BOOLEAN('s', "sched-stat", &inject.sched_stat, |
779 | "Merge sched-stat and sched-switch for getting events " | 779 | "Merge sched-stat and sched-switch for getting events " |
780 | "where and how long tasks slept"), | 780 | "where and how long tasks slept"), |
781 | #ifdef HAVE_JITDUMP | ||
781 | OPT_BOOLEAN('j', "jit", &inject.jit_mode, "merge jitdump files into perf.data file"), | 782 | OPT_BOOLEAN('j', "jit", &inject.jit_mode, "merge jitdump files into perf.data file"), |
783 | #endif | ||
782 | OPT_INCR('v', "verbose", &verbose, | 784 | OPT_INCR('v', "verbose", &verbose, |
783 | "be more verbose (show build ids, etc)"), | 785 | "be more verbose (show build ids, etc)"), |
784 | OPT_STRING(0, "kallsyms", &symbol_conf.kallsyms_name, "file", | 786 | OPT_STRING(0, "kallsyms", &symbol_conf.kallsyms_name, "file", |
@@ -795,7 +797,7 @@ int cmd_inject(int argc, const char **argv, const char *prefix __maybe_unused) | |||
795 | "perf inject [<options>]", | 797 | "perf inject [<options>]", |
796 | NULL | 798 | NULL |
797 | }; | 799 | }; |
798 | #if !defined(HAVE_LIBELF_SUPPORT) || !defined(HAVE_DWARF_SUPPORT) | 800 | #ifndef HAVE_JITDUMP |
799 | set_option_nobuild(options, 'j', "jit", "NO_LIBELF=1", true); | 801 | set_option_nobuild(options, 'j', "jit", "NO_LIBELF=1", true); |
800 | #endif | 802 | #endif |
801 | argc = parse_options(argc, argv, options, inject_usage, 0); | 803 | argc = parse_options(argc, argv, options, inject_usage, 0); |
@@ -833,7 +835,7 @@ int cmd_inject(int argc, const char **argv, const char *prefix __maybe_unused) | |||
833 | inject.tool.ordered_events = true; | 835 | inject.tool.ordered_events = true; |
834 | inject.tool.ordering_requires_timestamps = true; | 836 | inject.tool.ordering_requires_timestamps = true; |
835 | } | 837 | } |
836 | #if defined(HAVE_LIBELF_SUPPORT) && defined(HAVE_DWARF_SUPPORT) | 838 | #ifdef HAVE_JITDUMP |
837 | if (inject.jit_mode) { | 839 | if (inject.jit_mode) { |
838 | inject.tool.mmap2 = perf_event__jit_repipe_mmap2; | 840 | inject.tool.mmap2 = perf_event__jit_repipe_mmap2; |
839 | inject.tool.mmap = perf_event__jit_repipe_mmap; | 841 | inject.tool.mmap = perf_event__jit_repipe_mmap; |