Messages in this thread Patch in this message |  | | From | Chenggang Qin <> | Subject | [PATCH 2/4] perf tools: relate 'start' & 'end' to perf_session | Date | Fri, 1 Nov 2013 17:29:04 +0800 |
| |
Copy the value to start and end to struct perf_session.
Cc: David Ahern <dsahern@gmail.com> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Paul Mackerras <paulus@samba.org> Cc: Ingo Molnar <mingo@redhat.com> Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net> Cc: Arjan van de Ven <arjan@linux.intel.com> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Yanmin Zhang <yanmin.zhang@intel.com> Cc: Wu Fengguang <fengguang.wu@intel.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Chenggang Qin <chenggang.qcg@taobao.com>
--- 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
|  |