diff options
author | Stanislav Fomichev <stfomichev@yandex-team.ru> | 2013-12-02 09:37:36 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-12-16 14:34:53 -0500 |
commit | c507999790438cde78b5618fa64daefd697035af (patch) | |
tree | 0ee428460b358e6cc362450622d9b8941db1feca /tools/perf/builtin-timechart.c | |
parent | 58b9a18ecd251cbd6e666ad792023ab77c7d100e (diff) |
perf timechart: Add support for topology
Add -t switch to sort CPUs topologically.
Signed-off-by: Stanislav Fomichev <stfomichev@yandex-team.ru>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Ramkumar Ramachandra <artagnon@gmail.com>
Link: http://lkml.kernel.org/r/1385995056-20158-5-git-send-email-stfomichev@yandex-team.ru
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-timechart.c')
-rw-r--r-- | tools/perf/builtin-timechart.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/tools/perf/builtin-timechart.c b/tools/perf/builtin-timechart.c index db9c4c172587..8bde57c5c908 100644 --- a/tools/perf/builtin-timechart.c +++ b/tools/perf/builtin-timechart.c | |||
@@ -58,7 +58,8 @@ struct timechart { | |||
58 | first_time, last_time; | 58 | first_time, last_time; |
59 | bool power_only, | 59 | bool power_only, |
60 | tasks_only, | 60 | tasks_only, |
61 | with_backtrace; | 61 | with_backtrace, |
62 | topology; | ||
62 | }; | 63 | }; |
63 | 64 | ||
64 | struct per_pidcomm; | 65 | struct per_pidcomm; |
@@ -1077,6 +1078,18 @@ static int process_header(struct perf_file_section *section __maybe_unused, | |||
1077 | case HEADER_NRCPUS: | 1078 | case HEADER_NRCPUS: |
1078 | tchart->numcpus = ph->env.nr_cpus_avail; | 1079 | tchart->numcpus = ph->env.nr_cpus_avail; |
1079 | break; | 1080 | break; |
1081 | |||
1082 | case HEADER_CPU_TOPOLOGY: | ||
1083 | if (!tchart->topology) | ||
1084 | break; | ||
1085 | |||
1086 | if (svg_build_topology_map(ph->env.sibling_cores, | ||
1087 | ph->env.nr_sibling_cores, | ||
1088 | ph->env.sibling_threads, | ||
1089 | ph->env.nr_sibling_threads)) | ||
1090 | fprintf(stderr, "problem building topology\n"); | ||
1091 | break; | ||
1092 | |||
1080 | default: | 1093 | default: |
1081 | break; | 1094 | break; |
1082 | } | 1095 | } |
@@ -1267,6 +1280,8 @@ int cmd_timechart(int argc, const char **argv, | |||
1267 | "Look for files with symbols relative to this directory"), | 1280 | "Look for files with symbols relative to this directory"), |
1268 | OPT_INTEGER('n', "proc-num", &tchart.proc_num, | 1281 | OPT_INTEGER('n', "proc-num", &tchart.proc_num, |
1269 | "min. number of tasks to print"), | 1282 | "min. number of tasks to print"), |
1283 | OPT_BOOLEAN('t', "topology", &tchart.topology, | ||
1284 | "sort CPUs according to topology"), | ||
1270 | OPT_END() | 1285 | OPT_END() |
1271 | }; | 1286 | }; |
1272 | const char * const timechart_usage[] = { | 1287 | const char * const timechart_usage[] = { |