mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chenggang Qin <chenggang.qin@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Chenggang Qin <chenggang.qin@gmail.com>,
	David Ahern <dsahern@gmail.com>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Paul Mackerras <paulus@samba.org>, Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@ghostprotocols.net>,
	Arjan van de Ven <arjan@linux.intel.com>,
	Namhyung Kim <namhyung@gmail.com>,
	Yanmin Zhang <yanmin.zhang@intel.com>,
	Wu Fengguang <fengguang.wu@intel.com>,
	Mike Galbraith <efault@gmx.de>,
	Andrew Morton <akpm@linux-foundation.org>,
	Chenggang Qin <chenggang.qcg@taobao.com>
Subject: [PATCH 1/4] perf report: add parameter 'start' & 'end' to perf report
Date: Fri,  1 Nov 2013 17:29:03 +0800	[thread overview]
Message-ID: <1383298146-3860-2-git-send-email-chenggang.qin@gmail.com> (raw)
In-Reply-To: <1383298146-3860-1-git-send-email-chenggang.qin@gmail.com>

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

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 |    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


  reply	other threads:[~2013-11-01  9:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-01  9:29 [PATCH 0/4] perf report: add parameters 'start' & 'end' to specify analysis interval Chenggang Qin
2013-11-01  9:29 ` Chenggang Qin [this message]
2013-11-01  9:29 ` [PATCH 2/4] perf tools: relate 'start' & 'end' to perf_session Chenggang Qin
2013-11-02 22:34   ` David Ahern
     [not found]   ` <f31aa7c2-c31a-47f2-a051-a5bd44f4d07d@alibaba-inc.com>
2013-11-06 15:15     ` 答复:[PATCH " David Ahern
     [not found]     ` <6d5d4b79-c25a-4f12-984a-58b310dae2a5@alibaba-inc.com>
2013-11-07 15:55       ` 答复:答复:[PATCH " David Ahern
2013-11-01  9:29 ` [PATCH 3/4] perf tools: record min_timestamp of samples queue in ordered_samples Chenggang Qin
2013-11-02 22:33   ` David Ahern
2013-11-01  9:29 ` [PATCH 4/4] perf tools: add the feature to assign analysis interval to perf report Chenggang Qin
2013-11-01  9:47 ` [PATCH 0/4] perf report: add parameters 'start' & 'end' to specify analysis interval Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1383298146-3860-2-git-send-email-chenggang.qin@gmail.com \
    --to=chenggang.qin@gmail.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@ghostprotocols.net \
    --cc=akpm@linux-foundation.org \
    --cc=arjan@linux.intel.com \
    --cc=chenggang.qcg@taobao.com \
    --cc=dsahern@gmail.com \
    --cc=efault@gmx.de \
    --cc=fengguang.wu@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=namhyung@gmail.com \
    --cc=paulus@samba.org \
    --cc=yanmin.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®