summaryrefslogtreecommitdiff
path: root/tools/perf/util
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2009-12-28 02:37:01 +0300
committerIngo Molnar <mingo@elte.hu>2009-12-28 11:03:33 +0300
commit27295592c22e71bbd38110c302da8dbb43912a60 (patch)
tree01442f9b788e3b0a01bc29e22a0e799e1c45c91d /tools/perf/util
parent4a58e61161074776aa34187ea369414ce4852394 (diff)
downloadlinux-27295592c22e71bbd38110c302da8dbb43912a60.tar.xz
perf session: Share the common trace sample_check routine as perf_session__has_traces
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Frédéric Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Paul Mackerras <paulus@samba.org> LKML-Reference: <1261957026-15580-5-git-send-email-acme@infradead.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/util')
-rw-r--r--tools/perf/util/session.c11
-rw-r--r--tools/perf/util/session.h2
2 files changed, 13 insertions, 0 deletions
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 736d4fda9272..60eab8b3ff34 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -393,3 +393,14 @@ done:
out_err:
return err;
}
+
+int perf_session__has_traces(struct perf_session *self)
+{
+ if (!(self->sample_type & PERF_SAMPLE_RAW)) {
+ pr_err("No trace sample to read. Did you call perf record "
+ "without -R?");
+ return -1;
+ }
+
+ return 0;
+}
diff --git a/tools/perf/util/session.h b/tools/perf/util/session.h
index 32eaa1bada06..a6951d2f700f 100644
--- a/tools/perf/util/session.h
+++ b/tools/perf/util/session.h
@@ -56,6 +56,8 @@ struct symbol **perf_session__resolve_callchain(struct perf_session *self,
struct ip_callchain *chain,
struct symbol **parent);
+int perf_session__has_traces(struct perf_session *self);
+
int perf_header__read_build_ids(int input, u64 offset, u64 file_size);
#endif /* __PERF_SESSION_H */