aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/session.c
diff options
context:
space:
mode:
authorDavid Ahern <dsahern@gmail.com>2013-08-07 22:50:58 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2013-08-12 09:31:08 -0400
commit93ea01c29d4ed5a9fcf6d9a95bc584e54a420834 (patch)
treee3b3bbc8162d23c0fd47d5303274d31c9f8e4994 /tools/perf/util/session.c
parent307cbb92aa2bdc9eed7c74409ff4d5fc9135b4e2 (diff)
perf session: Change perf_session__has_traces to actually check for tracepoints
Any event can have RAW data attribute set. The intent of the function is to determine if the session has tracepoints, so check for the type of each event explicitly. Signed-off-by: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1375930261-77273-17-git-send-email-dsahern@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/session.c')
-rw-r--r--tools/perf/util/session.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 5a8996493d94..4d9028eef34a 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -1401,12 +1401,15 @@ int perf_session__process_events(struct perf_session *self,
1401 1401
1402bool perf_session__has_traces(struct perf_session *session, const char *msg) 1402bool perf_session__has_traces(struct perf_session *session, const char *msg)
1403{ 1403{
1404 if (!(perf_evlist__sample_type(session->evlist) & PERF_SAMPLE_RAW)) { 1404 struct perf_evsel *evsel;
1405 pr_err("No trace sample to read. Did you call 'perf %s'?\n", msg); 1405
1406 return false; 1406 list_for_each_entry(evsel, &session->evlist->entries, node) {
1407 if (evsel->attr.type == PERF_TYPE_TRACEPOINT)
1408 return true;
1407 } 1409 }
1408 1410
1409 return true; 1411 pr_err("No trace sample to read. Did you call 'perf %s'?\n", msg);
1412 return false;
1410} 1413}
1411 1414
1412int maps__set_kallsyms_ref_reloc_sym(struct map **maps, 1415int maps__set_kallsyms_ref_reloc_sym(struct map **maps,