From: David Ahern <dsahern@gmail.com>
To: namhyung@kernel.org, acme@redhat.com
Cc: linux-kernel@vger.kernel.org, David Ahern <dsahern@gmail.com>
Subject: [PATCH] perf sched timehist: Add pid and tid options
Date: Fri, 1 Sep 2017 10:49:12 -0700 [thread overview]
Message-ID: <1504288152-19690-1-git-send-email-dsahern@gmail.com> (raw)
Add options to only show event for specific pid(s) and tid(s).
Signed-off-by: David Ahern <dsahern@gmail.com>
---
tools/perf/Documentation/perf-sched.txt | 8 ++++++++
tools/perf/builtin-sched.c | 4 ++++
2 files changed, 12 insertions(+)
diff --git a/tools/perf/Documentation/perf-sched.txt b/tools/perf/Documentation/perf-sched.txt
index a092a2499e8f..55b67338548e 100644
--- a/tools/perf/Documentation/perf-sched.txt
+++ b/tools/perf/Documentation/perf-sched.txt
@@ -106,6 +106,14 @@ OPTIONS for 'perf sched timehist'
--max-stack::
Maximum number of functions to display in backtrace, default 5.
+-p=::
+--pid=::
+ Only show events for given process ID (comma separated list).
+
+-t=::
+--tid=::
+ Only show events for given thread ID (comma separated list).
+
-s::
--summary::
Show only a summary of scheduling by thread with min, max, and average
diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c
index 322b4def8411..b7e8812ee80c 100644
--- a/tools/perf/builtin-sched.c
+++ b/tools/perf/builtin-sched.c
@@ -3363,6 +3363,10 @@ int cmd_sched(int argc, const char **argv)
OPT_STRING(0, "time", &sched.time_str, "str",
"Time span for analysis (start,stop)"),
OPT_BOOLEAN(0, "state", &sched.show_state, "Show task state when sched-out"),
+ OPT_STRING('p', "pid", &symbol_conf.pid_list_str, "pid[,pid...]",
+ "analyze events only for given process id(s)"),
+ OPT_STRING('t', "tid", &symbol_conf.tid_list_str, "tid[,tid...]",
+ "analyze events only for given thread id(s)"),
OPT_PARENT(sched_options)
};
--
2.1.4
next reply other threads:[~2017-09-01 17:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-01 17:49 David Ahern [this message]
2017-09-07 15:07 ` [PATCH] perf sched timehist: Add pid and tid options David Ahern
2017-09-08 13:28 ` Arnaldo Carvalho de Melo
2017-09-07 15:17 ` Namhyung Kim
2017-09-22 16:28 ` [tip:perf/core] " tip-bot for David Ahern
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=1504288152-19690-1-git-send-email-dsahern@gmail.com \
--to=dsahern@gmail.com \
--cc=acme@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=namhyung@kernel.org \
/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