Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1378010 > unrolled thread
| Started by | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| First post | 2016-04-13 16:50 +0200 |
| Last post | 2016-04-13 20:30 +0200 |
| Articles | 3 — 2 participants |
Back to article view | Back to linux.kernel
[GIT PULL 00/11] perf/core improvements and fixes Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-04-13 16:50 +0200
[PATCH 09/11] perf sched map: Display only given cpus Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-04-13 16:50 +0200
Re: [GIT PULL 00/11] perf/core improvements and fixes Ingo Molnar <mingo@kernel.org> - 2016-04-13 20:30 +0200
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Date | 2016-04-13 16:50 +0200 |
| Subject | [GIT PULL 00/11] perf/core improvements and fixes |
| Message-ID | <rnuhb-2Hz-3@gated-at.bofh.it> |
Hi Ingo,
Please consider pulling,
- Arnaldo
The following changes since commit 31d50c551e30923b86a1b5b420920dd1927fa63b:
perf/x86/amd/uncore: Do not register a task ctx for uncore PMUs (2016-04-13 11:56:36 +0200)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-20160413
for you to fetch changes up to 59247e33ff494e3643cdff54b64bf72575052b76:
perf trace: Do not accept --no-syscalls together with -e (2016-04-13 10:11:52 -0300)
----------------------------------------------------------------
perf/core improvements and fixes:
User visible:
- Print callchains asked for events requested via 'perf trace --event' too:
(Arnaldo Carvalho de Melo)
# trace -e nanosleep --call dwarf --event sched:sched_switch/call-graph=fp/ usleep 1
0.346 (0.005 ms): usleep/24428 nanosleep(rqtp: 0x7fffa15a0540) ...
0.346 ( ): sched:sched_switch:usleep:24428 [120] S ==> swapper/3:0 [120])
__schedule+0xfe200402 ([kernel.kallsyms])
schedule+0xfe200035 ([kernel.kallsyms])
do_nanosleep+0xfe20006f ([kernel.kallsyms])
hrtimer_nanosleep+0xfe2000dc ([kernel.kallsyms])
sys_nanosleep+0xfe20007a ([kernel.kallsyms])
do_syscall_64+0xfe200062 ([kernel.kallsyms])
return_from_SYSCALL_64+0xfe200000 ([kernel.kallsyms])
__nanosleep+0xffff005b8d602010 (/usr/lib64/libc-2.22.so)
0.400 (0.059 ms): usleep/24428 ... [continued]: nanosleep()) = 0
__nanosleep+0x10 (/usr/lib64/libc-2.22.so)
usleep+0x34 (/usr/lib64/libc-2.22.so)
main+0x1eb (/usr/bin/usleep)
__libc_start_main+0xf0 (/usr/lib64/libc-2.22.so)
_start+0x29 (/usr/bin/usleep)
- Allow requesting that some CPUs or PIDs be highlighted in 'perf sched map' (Jiri Olsa)
- Compact 'perf sched map' to show just CPUs with activity, improving the output
in high core count systems (Jiri Olsa)
- Fix segfault with 'perf trace --no-syscalls -e syscall-names' by bailing out
such request, doesn't make sense to ask for no syscalls and then specify which
ones should be printed (Arnaldo Carvalho de Melo)
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
----------------------------------------------------------------
Arnaldo Carvalho de Melo (3):
perf trace: Support callchains for --event too
perf evsel: Move some methods from session.[ch] to evsel.[ch]
perf trace: Do not accept --no-syscalls together with -e
Jiri Olsa (8):
perf thread_map: Add has() method
perf cpu_map: Add has() method
perf sched: Add compact display option
perf sched: Use color_fprintf for output
perf thread_map: Make new_by_tid_str constructor public
perf sched map: Color given pids
perf sched map: Color given cpus
perf sched map: Display only given cpus
tools/perf/Documentation/perf-sched.txt | 16 +++
tools/perf/builtin-sched.c | 198 ++++++++++++++++++++++++++++++--
tools/perf/builtin-script.c | 14 +--
tools/perf/builtin-trace.c | 48 +++++---
tools/perf/util/cpumap.c | 12 ++
tools/perf/util/cpumap.h | 2 +
tools/perf/util/evsel.c | 131 +++++++++++++++++++++
tools/perf/util/evsel.h | 13 +++
tools/perf/util/session.c | 130 ---------------------
tools/perf/util/session.h | 13 ---
tools/perf/util/thread_map.c | 14 ++-
tools/perf/util/thread_map.h | 3 +
12 files changed, 416 insertions(+), 178 deletions(-)
[toc] | [next] | [standalone]
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Date | 2016-04-13 16:50 +0200 |
| Subject | [PATCH 09/11] perf sched map: Display only given cpus |
| Message-ID | <rnuhd-2Hz-39@gated-at.bofh.it> |
| In reply to | #1378010 |
From: Jiri Olsa <jolsa@kernel.org>
Introducing --cpus option that will display only given cpus. Could be
used together with color-cpus option.
$ perf sched map --cpus 0,1
*A0 309999.786924 secs A0 => rcu_sched:7
*. 309999.786930 secs
*B0 . 309999.786931 secs B0 => rcuos/2:25
B0 *A0 309999.786947 secs
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1460467771-26532-9-git-send-email-jolsa@kernel.org
[ Added entry to man page ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/Documentation/perf-sched.txt | 3 +++
tools/perf/builtin-sched.c | 23 +++++++++++++++++++++++
2 files changed, 26 insertions(+)
diff --git a/tools/perf/Documentation/perf-sched.txt b/tools/perf/Documentation/perf-sched.txt
index 58bff6cbc3f3..1cc08cc47ac5 100644
--- a/tools/perf/Documentation/perf-sched.txt
+++ b/tools/perf/Documentation/perf-sched.txt
@@ -57,6 +57,9 @@ OPTIONS for 'perf sched map'
Show only CPUs with activity. Helps visualizing on high core
count systems.
+--cpus::
+ Show just entries with activities for the given CPUs.
+
--color-cpus::
Highlight the given cpus.
diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c
index 7de04b297c14..afa057666c2a 100644
--- a/tools/perf/builtin-sched.c
+++ b/tools/perf/builtin-sched.c
@@ -135,6 +135,8 @@ struct perf_sched_map {
const char *color_pids_str;
struct cpu_map *color_cpus;
const char *color_cpus_str;
+ struct cpu_map *cpus;
+ const char *cpus_str;
};
struct perf_sched {
@@ -1469,6 +1471,9 @@ static int map_switch_event(struct perf_sched *sched, struct perf_evsel *evsel,
if (curr_thread && thread__has_color(curr_thread))
pid_color = COLOR_PIDS;
+ if (sched->map.cpus && !cpu_map__has(sched->map.cpus, cpu))
+ continue;
+
if (sched->map.color_cpus && cpu_map__has(sched->map.color_cpus, cpu))
cpu_color = COLOR_CPUS;
@@ -1483,6 +1488,9 @@ static int map_switch_event(struct perf_sched *sched, struct perf_evsel *evsel,
color_fprintf(stdout, color, " ");
}
+ if (sched->map.cpus && !cpu_map__has(sched->map.cpus, this_cpu))
+ goto out;
+
color_fprintf(stdout, color, " %12.6f secs ", (double)timestamp/1e9);
if (new_shortname) {
const char *pid_color = color;
@@ -1497,6 +1505,7 @@ static int map_switch_event(struct perf_sched *sched, struct perf_evsel *evsel,
if (sched->map.comp && new_cpu)
color_fprintf(stdout, color, " (CPU %d)", this_cpu);
+out:
color_fprintf(stdout, color, "\n");
thread__put(sched_in);
@@ -1756,6 +1765,8 @@ static int perf_sched__lat(struct perf_sched *sched)
static int setup_map_cpus(struct perf_sched *sched)
{
+ struct cpu_map *map;
+
sched->max_cpu = sysconf(_SC_NPROCESSORS_CONF);
if (sched->map.comp) {
@@ -1764,6 +1775,16 @@ static int setup_map_cpus(struct perf_sched *sched)
return -1;
}
+ if (!sched->map.cpus_str)
+ return 0;
+
+ map = cpu_map__new(sched->map.cpus_str);
+ if (!map) {
+ pr_err("failed to get cpus map from %s\n", sched->map.cpus_str);
+ return -1;
+ }
+
+ sched->map.cpus = map;
return 0;
}
@@ -1971,6 +1992,8 @@ int cmd_sched(int argc, const char **argv, const char *prefix __maybe_unused)
"highlight given pids in map"),
OPT_STRING(0, "color-cpus", &sched.map.color_cpus_str, "cpus",
"highlight given CPUs in map"),
+ OPT_STRING(0, "cpus", &sched.map.cpus_str, "cpus",
+ "display given CPUs in map"),
OPT_END()
};
const char * const latency_usage[] = {
--
2.5.5
[toc] | [prev] | [next] | [standalone]
| From | Ingo Molnar <mingo@kernel.org> |
|---|---|
| Date | 2016-04-13 20:30 +0200 |
| Message-ID | <rnxI5-5ve-5@gated-at.bofh.it> |
| In reply to | #1378010 |
* Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > Hi Ingo, > > Please consider pulling, > > - Arnaldo > > The following changes since commit 31d50c551e30923b86a1b5b420920dd1927fa63b: > > perf/x86/amd/uncore: Do not register a task ctx for uncore PMUs (2016-04-13 11:56:36 +0200) > > are available in the git repository at: > > git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-20160413 > > for you to fetch changes up to 59247e33ff494e3643cdff54b64bf72575052b76: > > perf trace: Do not accept --no-syscalls together with -e (2016-04-13 10:11:52 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes: > > User visible: > > - Print callchains asked for events requested via 'perf trace --event' too: > (Arnaldo Carvalho de Melo) > > # trace -e nanosleep --call dwarf --event sched:sched_switch/call-graph=fp/ usleep 1 > 0.346 (0.005 ms): usleep/24428 nanosleep(rqtp: 0x7fffa15a0540) ... > 0.346 ( ): sched:sched_switch:usleep:24428 [120] S ==> swapper/3:0 [120]) > __schedule+0xfe200402 ([kernel.kallsyms]) > schedule+0xfe200035 ([kernel.kallsyms]) > do_nanosleep+0xfe20006f ([kernel.kallsyms]) > hrtimer_nanosleep+0xfe2000dc ([kernel.kallsyms]) > sys_nanosleep+0xfe20007a ([kernel.kallsyms]) > do_syscall_64+0xfe200062 ([kernel.kallsyms]) > return_from_SYSCALL_64+0xfe200000 ([kernel.kallsyms]) > __nanosleep+0xffff005b8d602010 (/usr/lib64/libc-2.22.so) > 0.400 (0.059 ms): usleep/24428 ... [continued]: nanosleep()) = 0 > __nanosleep+0x10 (/usr/lib64/libc-2.22.so) > usleep+0x34 (/usr/lib64/libc-2.22.so) > main+0x1eb (/usr/bin/usleep) > __libc_start_main+0xf0 (/usr/lib64/libc-2.22.so) > _start+0x29 (/usr/bin/usleep) > > - Allow requesting that some CPUs or PIDs be highlighted in 'perf sched map' (Jiri Olsa) > > - Compact 'perf sched map' to show just CPUs with activity, improving the output > in high core count systems (Jiri Olsa) > > - Fix segfault with 'perf trace --no-syscalls -e syscall-names' by bailing out > such request, doesn't make sense to ask for no syscalls and then specify which > ones should be printed (Arnaldo Carvalho de Melo) > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > Arnaldo Carvalho de Melo (3): > perf trace: Support callchains for --event too > perf evsel: Move some methods from session.[ch] to evsel.[ch] > perf trace: Do not accept --no-syscalls together with -e > > Jiri Olsa (8): > perf thread_map: Add has() method > perf cpu_map: Add has() method > perf sched: Add compact display option > perf sched: Use color_fprintf for output > perf thread_map: Make new_by_tid_str constructor public > perf sched map: Color given pids > perf sched map: Color given cpus > perf sched map: Display only given cpus > > tools/perf/Documentation/perf-sched.txt | 16 +++ > tools/perf/builtin-sched.c | 198 ++++++++++++++++++++++++++++++-- > tools/perf/builtin-script.c | 14 +-- > tools/perf/builtin-trace.c | 48 +++++--- > tools/perf/util/cpumap.c | 12 ++ > tools/perf/util/cpumap.h | 2 + > tools/perf/util/evsel.c | 131 +++++++++++++++++++++ > tools/perf/util/evsel.h | 13 +++ > tools/perf/util/session.c | 130 --------------------- > tools/perf/util/session.h | 13 --- > tools/perf/util/thread_map.c | 14 ++- > tools/perf/util/thread_map.h | 3 + > 12 files changed, 416 insertions(+), 178 deletions(-) Pulled, thanks a lot Arnaldo! Ingo
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web