[PATCH v0 54/71] perf script: Always allow fields 'addr' and 'cpu' for itrace

From: Alexander Shishkin
Date: Wed Dec 11 2013 - 07:47:58 EST


From: Adrian Hunter <adrian.hunter@xxxxxxxxx>

If a file contains Instruction Tracing data then always allow
fields 'addr' and 'cpu' to be selected as options for perf
script. This is necessary because Instruction Trace decoding
may synthesize events with that information.

Signed-off-by: Adrian Hunter <adrian.hunter@xxxxxxxxx>
---
tools/perf/builtin-script.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index 96cdcd8..15f4941 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -190,6 +190,7 @@ static int perf_evsel__check_attr(struct perf_evsel *evsel,
}

if (PRINT_FIELD(ADDR) &&
+ !perf_header__has_feat(&session->header, HEADER_ITRACE) &&
perf_evsel__check_stype(evsel, PERF_SAMPLE_ADDR, "ADDR",
PERF_OUTPUT_ADDR))
return -EINVAL;
@@ -223,6 +224,7 @@ static int perf_evsel__check_attr(struct perf_evsel *evsel,
return -EINVAL;

if (PRINT_FIELD(CPU) &&
+ !perf_header__has_feat(&session->header, HEADER_ITRACE) &&
perf_evsel__check_stype(evsel, PERF_SAMPLE_CPU, "CPU",
PERF_OUTPUT_CPU))
return -EINVAL;
--
1.8.5.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/