Skip to contentSkip to conversation

perf sched timehist: Add pid and tid options

PATCH In review David Ahern 4 participants 5 messages Sep 1, 2017 – Sep 22, 2017 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf sched timehist: Add pid and tid options

Add options to only show event for specific pid(s) and tid(s).

---
 tools/perf/Documentation/perf-sched.txt | 8 ++++++++
 tools/perf/builtin-sched.c              | 4 ++++
 2 files changed, 12 insertions(+)
tools/perf/Documentation/perf-sched.txt +8 -0
index a092a2499e8f..55b67338548e 100644
@@ -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
tools/perf/builtin-sched.c +4 -0
index 322b4def8411..b7e8812ee80c 100644
@@ -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)
 	};
 
Signature · 1 line
2.1.4
#1 lore raw

Hi Arnaldo:

are you ok with this change?

Quoted 43 lines · David Ahern

Add options to only show event for specific pid(s) and tid(s).

---
 tools/perf/Documentation/perf-sched.txt | 8 ++++++++
 tools/perf/builtin-sched.c              | 4 ++++
 2 files changed, 12 insertions(+)
tools/perf/Documentation/perf-sched.txt +8 -0
index a092a2499e8f..55b67338548e 100644
@@ -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
tools/perf/builtin-sched.c +4 -0
index 322b4def8411..b7e8812ee80c 100644
@@ -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 lore raw

Em Thu, Sep 07, 2017 at 09:07:24AM -0600, David Ahern escreveu:

Quoted 3 lines

Hi Arnaldo:

are you ok with this change?

Yes, it is already merged in my perf/core branch.

- Arnaldo

Quoted 44 lines · David Ahern
Quoted 43 lines

Add options to only show event for specific pid(s) and tid(s).

---
 tools/perf/Documentation/perf-sched.txt | 8 ++++++++
 tools/perf/builtin-sched.c              | 4 ++++
 2 files changed, 12 insertions(+)
tools/perf/Documentation/perf-sched.txt +8 -0
index a092a2499e8f..55b67338548e 100644
@@ -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
tools/perf/builtin-sched.c +4 -0
index 322b4def8411..b7e8812ee80c 100644
@@ -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)
 	};
 
maintainer Acked-by on v1 1/1
#3 lore raw
In reply to David Ahern

Hi David,

Quoted 3 lines · David Ahern

Add options to only show event for specific pid(s) and tid(s).

Thanks,
Namhyung

Quoted 42 lines
---
 tools/perf/Documentation/perf-sched.txt | 8 ++++++++
 tools/perf/builtin-sched.c              | 4 ++++
 2 files changed, 12 insertions(+)
tools/perf/Documentation/perf-sched.txt +8 -0
index a092a2499e8f..55b67338548e 100644
@@ -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
tools/perf/builtin-sched.c +4 -1
index 322b4def8411..b7e8812ee80c 100644
@@ -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

Signature · 2 lines
Thanks,
Namhyung
#4 lore raw
In reply to David Ahern
perf sched timehist: Add pid and tid options
Commit-ID:  0f59d7a352c11712de0f226b46cb82775b4fcece
Gitweb:     http://git.kernel.org/tip/0f59d7a352c11712de0f226b46cb82775b4fcece
Author:     David Ahern <[email protected]>
AuthorDate: Fri, 1 Sep 2017 10:49:12 -0700
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Wed, 13 Sep 2017 09:49:12 -0300

perf sched timehist: Add pid and tid options

Add options to only show event for specific pid(s) and tid(s).

---
 tools/perf/Documentation/perf-sched.txt | 8 ++++++++
 tools/perf/builtin-sched.c              | 4 ++++
 2 files changed, 12 insertions(+)
tools/perf/Documentation/perf-sched.txt +8 -0
index a092a24..55b6733 100644
@@ -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
tools/perf/builtin-sched.c +4 -0
index 322b4de..b7e8812 100644
@@ -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)
 	};