summaryrefslogtreecommitdiff
path: root/tools/perf/builtin-inject.c
diff options
context:
space:
mode:
authorAdrian Hunter <adrian.hunter@intel.com>2015-04-30 14:37:27 (GMT)
committerArnaldo Carvalho de Melo <acme@redhat.com>2015-05-05 21:12:53 (GMT)
commite31f0d017ea19fce9f12f084e1c750a0e3b43680 (patch)
treec0bf2cf52a243fa048dc9e9245eff4de5897f84d /tools/perf/builtin-inject.c
parentcd10b289520577a56c5d369b9a2e7bbee5698a4b (diff)
downloadlinux-e31f0d017ea19fce9f12f084e1c750a0e3b43680.tar.xz
perf tools: Add build option NO_AUXTRACE to exclude AUX area tracing
Add build option NO_AUXTRACE to exclude compiling support for AUX area tracing. Support for both recording and processing is excluded and by implication any future additions such as Intel PT and Intel BTS will also not be compiled in with this option. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Acked-by: Jiri Olsa <jolsa@kernel.org> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1430404667-10593-5-git-send-email-adrian.hunter@intel.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.c53
1 files changed, 34 insertions, 19 deletions
diff --git a/tools/perf/builtin-inject.c b/tools/perf/builtin-inject.c
index cc905f1..7c7a7ee 100644
--- a/tools/perf/builtin-inject.c
+++ b/tools/perf/builtin-inject.c
@@ -53,25 +53,6 @@ static int output_bytes(struct perf_inject *inject, void *buf, size_t sz)
return 0;
}
-static int copy_bytes(struct perf_inject *inject, int fd, off_t size)
-{
- char buf[4096];
- ssize_t ssz;
- int ret;
-
- while (size > 0) {
- ssz = read(fd, buf, min(size, (off_t)sizeof(buf)));
- if (ssz < 0)
- return -errno;
- ret = output_bytes(inject, buf, ssz);
- if (ret)
- return ret;
- size -= ssz;
- }
-
- return 0;
-}
-
static int perf_event__repipe_synth(struct perf_tool *tool,
union perf_event *event)
{
@@ -114,6 +95,27 @@ static int perf_event__repipe_attr(struct perf_tool *tool,
return perf_event__repipe_synth(tool, event);
}
+#ifdef HAVE_AUXTRACE_SUPPORT
+
+static int copy_bytes(struct perf_inject *inject, int fd, off_t size)
+{
+ char buf[4096];
+ ssize_t ssz;
+ int ret;
+
+ while (size > 0) {
+ ssz = read(fd, buf, min(size, (off_t)sizeof(buf)));
+ if (ssz < 0)
+ return -errno;
+ ret = output_bytes(inject, buf, ssz);
+ if (ret)
+ return ret;
+ size -= ssz;
+ }
+
+ return 0;
+}
+
static s64 perf_event__repipe_auxtrace(struct perf_tool *tool,
union perf_event *event,
struct perf_session *session
@@ -153,6 +155,19 @@ static s64 perf_event__repipe_auxtrace(struct perf_tool *tool,
return event->auxtrace.size;
}
+#else
+
+static s64
+perf_event__repipe_auxtrace(struct perf_tool *tool __maybe_unused,
+ union perf_event *event __maybe_unused,
+ struct perf_session *session __maybe_unused)
+{
+ pr_err("AUX area tracing not supported\n");
+ return -EINVAL;
+}
+
+#endif
+
static int perf_event__repipe(struct perf_tool *tool,
union perf_event *event,
struct perf_sample *sample __maybe_unused,