diff options
author | Andi Kleen <ak@linux.intel.com> | 2015-07-18 11:24:47 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2015-08-06 15:31:39 -0400 |
commit | 98df858ed46ddaaf9be3573eb2b63b57a68c6af7 (patch) | |
tree | 9c96ebd8cff27be865a70a5d7ded60b309aaa847 | |
parent | 0e332f033a8216fa03792fde69882f66500848c7 (diff) |
perf report: Add flag for non ANY branch mode
Later patches need to cheaply check that the branch mode is in ANY. Add
a new function to check all event attrs and add a flag to the report
state, which is then initialized.
v2: Rename flag
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/1437233094-12844-3-git-send-email-andi@firstfloor.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r-- | tools/perf/builtin-report.c | 7 | ||||
-rw-r--r-- | tools/perf/util/evlist.c | 10 | ||||
-rw-r--r-- | tools/perf/util/evlist.h | 1 |
3 files changed, 18 insertions, 0 deletions
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index 95a47719aec3..3ba0e9737dc5 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c | |||
@@ -53,6 +53,7 @@ struct report { | |||
53 | bool mem_mode; | 53 | bool mem_mode; |
54 | bool header; | 54 | bool header; |
55 | bool header_only; | 55 | bool header_only; |
56 | bool nonany_branch_mode; | ||
56 | int max_stack; | 57 | int max_stack; |
57 | struct perf_read_values show_threads_values; | 58 | struct perf_read_values show_threads_values; |
58 | const char *pretty_printing_style; | 59 | const char *pretty_printing_style; |
@@ -258,6 +259,12 @@ static int report__setup_sample_type(struct report *rep) | |||
258 | else | 259 | else |
259 | callchain_param.record_mode = CALLCHAIN_FP; | 260 | callchain_param.record_mode = CALLCHAIN_FP; |
260 | } | 261 | } |
262 | |||
263 | /* ??? handle more cases than just ANY? */ | ||
264 | if (!(perf_evlist__combined_branch_type(session->evlist) & | ||
265 | PERF_SAMPLE_BRANCH_ANY)) | ||
266 | rep->nonany_branch_mode = true; | ||
267 | |||
261 | return 0; | 268 | return 0; |
262 | } | 269 | } |
263 | 270 | ||
diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c index 3b9f411a6b46..373f65b02545 100644 --- a/tools/perf/util/evlist.c +++ b/tools/perf/util/evlist.c | |||
@@ -1273,6 +1273,16 @@ u64 perf_evlist__combined_sample_type(struct perf_evlist *evlist) | |||
1273 | return __perf_evlist__combined_sample_type(evlist); | 1273 | return __perf_evlist__combined_sample_type(evlist); |
1274 | } | 1274 | } |
1275 | 1275 | ||
1276 | u64 perf_evlist__combined_branch_type(struct perf_evlist *evlist) | ||
1277 | { | ||
1278 | struct perf_evsel *evsel; | ||
1279 | u64 branch_type = 0; | ||
1280 | |||
1281 | evlist__for_each(evlist, evsel) | ||
1282 | branch_type |= evsel->attr.branch_sample_type; | ||
1283 | return branch_type; | ||
1284 | } | ||
1285 | |||
1276 | bool perf_evlist__valid_read_format(struct perf_evlist *evlist) | 1286 | bool perf_evlist__valid_read_format(struct perf_evlist *evlist) |
1277 | { | 1287 | { |
1278 | struct perf_evsel *first = perf_evlist__first(evlist), *pos = first; | 1288 | struct perf_evsel *first = perf_evlist__first(evlist), *pos = first; |
diff --git a/tools/perf/util/evlist.h b/tools/perf/util/evlist.h index a8930b68456b..397757063da1 100644 --- a/tools/perf/util/evlist.h +++ b/tools/perf/util/evlist.h | |||
@@ -165,6 +165,7 @@ void perf_evlist__set_leader(struct perf_evlist *evlist); | |||
165 | u64 perf_evlist__read_format(struct perf_evlist *evlist); | 165 | u64 perf_evlist__read_format(struct perf_evlist *evlist); |
166 | u64 __perf_evlist__combined_sample_type(struct perf_evlist *evlist); | 166 | u64 __perf_evlist__combined_sample_type(struct perf_evlist *evlist); |
167 | u64 perf_evlist__combined_sample_type(struct perf_evlist *evlist); | 167 | u64 perf_evlist__combined_sample_type(struct perf_evlist *evlist); |
168 | u64 perf_evlist__combined_branch_type(struct perf_evlist *evlist); | ||
168 | bool perf_evlist__sample_id_all(struct perf_evlist *evlist); | 169 | bool perf_evlist__sample_id_all(struct perf_evlist *evlist); |
169 | u16 perf_evlist__id_hdr_size(struct perf_evlist *evlist); | 170 | u16 perf_evlist__id_hdr_size(struct perf_evlist *evlist); |
170 | 171 | ||