[PATCH 1/4] perf report: add parameter 'start' & 'end' to perf report

From: Chenggang Qin
Date: Fri Nov 01 2013 - 05:29:35 EST


perf report --start time1 --end time2
The unit of time1 & time2 are millsecond.

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 | 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 majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/