lkml.org 
[lkml]   [2015]   [May]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 5/3] perf report: Check attr.inherit_stat bit for --show-threads
Date
Check the evsel->attr.inherit_stat bit and show warning message if it's
missing and -T/--threads option was given:

$ perf report -T
Error: perf.data file has no per-thread stat data.
Did you run 'perf record' with -s option?

Suggested-by: David Ahern <dsahern@gmail.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
tools/perf/builtin-report.c | 13 +++++++++++++
1 file changed, 13 insertions(+)

diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 6ac2c7a01a63..ac2dc057cbc5 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -848,6 +848,19 @@ repeat:
stdout);
}

+ if (report.show_threads) {
+ struct perf_evsel *evsel;
+
+ evlist__for_each(session->evlist, evsel) {
+ if (!evsel->attr.inherit_stat) {
+ pr_err("Error: %s file has no per-thread stat data.\n"
+ " Did you run 'perf record' with -s option?\n",
+ input_name);
+ goto error;
+ }
+ }
+ }
+
/*
* Only in the TUI browser we are doing integrated annotation,
* so don't allocate extra space that won't be used in the stdio
--
2.4.0


\
 
 \ /
  Last update: 2015-05-11 16:01    [W:0.109 / U:161.800 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site