[PATCH 2/4] perf tools: relate 'start' & 'end' to perf_session
From: Chenggang Qin
Date: Fri Nov 01 2013 - 05:29:45 EST
Copy the value to start and end to struct perf_session.
Cc: David Ahern <dsahern@xxxxxxxxx>
Cc: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>
Cc: Paul Mackerras <paulus@xxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxxxxx>
Cc: Arnaldo Carvalho de Melo <acme@xxxxxxxxxxxxxxxxxx>
Cc: Arjan van de Ven <arjan@xxxxxxxxxxxxxxx>
Cc: Namhyung Kim <namhyung@xxxxxxxxx>
Cc: Yanmin Zhang <yanmin.zhang@xxxxxxxxx>
Cc: Wu Fengguang <fengguang.wu@xxxxxxxxx>
Cc: Mike Galbraith <efault@xxxxxx>
Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
Signed-off-by: Chenggang Qin <chenggang.qcg@xxxxxxxxxx>
---
tools/perf/builtin-report.c | 5 +++++
tools/perf/util/session.c | 3 +++
tools/perf/util/session.h | 2 ++
3 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index e9e9d0a..d3c1c8a 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -889,6 +889,11 @@ repeat:
if (session == NULL)
return -ENOMEM;
+ if (tstart)
+ session->tstart = tstart * 1e6;
+ if (tend)
+ session->tend = tend * 1e6;
+
report.session = session;
has_br_stack = perf_header__has_feat(&session->header,
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 568b750..193bb6a 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -134,6 +134,9 @@ struct perf_session *perf_session__new(const char *filename, int mode,
INIT_LIST_HEAD(&self->ordered_samples.to_free);
machines__init(&self->machines);
+ self->tstart = 0;
+ self->tend = ULLONG_MAX;
+
if (mode == O_RDONLY) {
if (perf_session__open(self, force) < 0)
goto out_delete;
diff --git a/tools/perf/util/session.h b/tools/perf/util/session.h
index 04bf737..c9a6c27 100644
--- a/tools/perf/util/session.h
+++ b/tools/perf/util/session.h
@@ -37,6 +37,8 @@ struct perf_session {
int fd;
bool fd_pipe;
bool repipe;
+ u64 tstart;
+ u64 tend;
struct ordered_samples ordered_samples;
char filename[1];
};
--
1.7.8.rc2.5.g815b
--
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/