perf report --start time1 --end time2 The unit of time1 & time2 are millsecond.
Cc: David Ahern <dsah...@gmail.com> Cc: Peter Zijlstra <a.p.zijls...@chello.nl> Cc: Paul Mackerras <pau...@samba.org> Cc: Ingo Molnar <mi...@redhat.com> Cc: Arnaldo Carvalho de Melo <a...@ghostprotocols.net> Cc: Arjan van de Ven <ar...@linux.intel.com> Cc: Namhyung Kim <namhy...@gmail.com> Cc: Yanmin Zhang <yanmin.zh...@intel.com> Cc: Wu Fengguang <fengguang...@intel.com> Cc: Mike Galbraith <efa...@gmx.de> Cc: Andrew Morton <a...@linux-foundation.org> Signed-off-by: Chenggang Qin <chenggang....@taobao.com> --- tools/perf/builtin-report.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index 72eae74..e9e9d0a 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c @@ -733,6 +733,7 @@ int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused) { struct perf_session *session; struct stat st; + u64 tstart = 0, tend = 0; bool has_br_stack = false; int branch_mode = -1; int ret = -1; @@ -843,6 +844,8 @@ int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused) OPT_BOOLEAN(0, "mem-mode", &report.mem_mode, "mem access profile"), OPT_CALLBACK(0, "percent-limit", &report, "percent", "Don't show entries under that percent", parse_percent_limit), + OPT_U64(0, "start", &tstart, "Start time of analysis interval. (Unit: ms)"), + OPT_U64(0, "end", &tend, "End time of analysis interval. (Unit: ms)"), OPT_END() }; @@ -850,6 +853,12 @@ int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused) argc = parse_options(argc, argv, options, report_usage, 0); + if (tend && tstart >= tend) { + fprintf(stderr, "start [%" PRIu64 "] is greater than end [%" + PRIu64 "].\n", tstart, tend); + return -1; + } + if (report.use_stdio) use_browser = 0; else if (report.use_tui) -- 1.7.8.rc2.5.g815b -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/