diff options
author | Jiri Olsa <jolsa@kernel.org> | 2016-08-27 05:40:23 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-10-21 09:31:56 -0400 |
commit | 2709b97dc2e250b5365629b99da5aa1cca7708f8 (patch) | |
tree | 3957f7997e314516606a47d4c1a226220429eabe /tools/perf | |
parent | 7ef2efaab4adeabaf0d6a71dfa5651edb517b503 (diff) |
perf c2c report: Add c2c related stats stdio output
Display c2c related configuration options/setup.
So far it's output of monitored events:
$ perf c2c report --stats
...
=================================================
c2c details
=================================================
Events : cpu/mem-loads,ldlat=50/pp
: cpu/mem-stores/pp
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Joe Mario <jmario@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/n/tip-ypz84f3a9fumyttrxurm458z@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf')
-rw-r--r-- | tools/perf/builtin-c2c.c | 33 |
1 files changed, 27 insertions, 6 deletions
diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c index f7b118b759cf..88d88eac53aa 100644 --- a/tools/perf/builtin-c2c.c +++ b/tools/perf/builtin-c2c.c | |||
@@ -13,6 +13,8 @@ | |||
13 | #include "tool.h" | 13 | #include "tool.h" |
14 | #include "data.h" | 14 | #include "data.h" |
15 | #include "sort.h" | 15 | #include "sort.h" |
16 | #include "evlist.h" | ||
17 | #include "evsel.h" | ||
16 | #include <asm/bug.h> | 18 | #include <asm/bug.h> |
17 | #include "ui/browsers/hists.h" | 19 | #include "ui/browsers/hists.h" |
18 | 20 | ||
@@ -1893,13 +1895,32 @@ static void print_pareto(FILE *out) | |||
1893 | } | 1895 | } |
1894 | } | 1896 | } |
1895 | 1897 | ||
1896 | static void perf_c2c__hists_fprintf(FILE *out) | 1898 | static void print_c2c_info(FILE *out, struct perf_session *session) |
1899 | { | ||
1900 | struct perf_evlist *evlist = session->evlist; | ||
1901 | struct perf_evsel *evsel; | ||
1902 | bool first = true; | ||
1903 | |||
1904 | fprintf(out, "=================================================\n"); | ||
1905 | fprintf(out, " c2c details \n"); | ||
1906 | fprintf(out, "=================================================\n"); | ||
1907 | |||
1908 | evlist__for_each_entry(evlist, evsel) { | ||
1909 | fprintf(out, "%-36s: %s\n", first ? " Events" : "", | ||
1910 | perf_evsel__name(evsel)); | ||
1911 | first = false; | ||
1912 | } | ||
1913 | } | ||
1914 | |||
1915 | static void perf_c2c__hists_fprintf(FILE *out, struct perf_session *session) | ||
1897 | { | 1916 | { |
1898 | setup_pager(); | 1917 | setup_pager(); |
1899 | 1918 | ||
1900 | print_c2c__display_stats(out); | 1919 | print_c2c__display_stats(out); |
1901 | fprintf(out, "\n"); | 1920 | fprintf(out, "\n"); |
1902 | print_shared_cacheline_info(out); | 1921 | print_shared_cacheline_info(out); |
1922 | fprintf(out, "\n"); | ||
1923 | print_c2c_info(out, session); | ||
1903 | 1924 | ||
1904 | if (c2c.stats_only) | 1925 | if (c2c.stats_only) |
1905 | return; | 1926 | return; |
@@ -2073,18 +2094,18 @@ out: | |||
2073 | return 0; | 2094 | return 0; |
2074 | } | 2095 | } |
2075 | 2096 | ||
2076 | static void perf_c2c_display(void) | 2097 | static void perf_c2c_display(struct perf_session *session) |
2077 | { | 2098 | { |
2078 | if (c2c.use_stdio) | 2099 | if (c2c.use_stdio) |
2079 | perf_c2c__hists_fprintf(stdout); | 2100 | perf_c2c__hists_fprintf(stdout, session); |
2080 | else | 2101 | else |
2081 | perf_c2c__hists_browse(&c2c.hists.hists); | 2102 | perf_c2c__hists_browse(&c2c.hists.hists); |
2082 | } | 2103 | } |
2083 | #else | 2104 | #else |
2084 | static void perf_c2c_display(void) | 2105 | static void perf_c2c_display(struct perf_session *session) |
2085 | { | 2106 | { |
2086 | use_browser = 0; | 2107 | use_browser = 0; |
2087 | perf_c2c__hists_fprintf(stdout); | 2108 | perf_c2c__hists_fprintf(stdout, session); |
2088 | } | 2109 | } |
2089 | #endif /* HAVE_SLANG_SUPPORT */ | 2110 | #endif /* HAVE_SLANG_SUPPORT */ |
2090 | 2111 | ||
@@ -2197,7 +2218,7 @@ static int perf_c2c__report(int argc, const char **argv) | |||
2197 | 2218 | ||
2198 | ui_quirks(); | 2219 | ui_quirks(); |
2199 | 2220 | ||
2200 | perf_c2c_display(); | 2221 | perf_c2c_display(session); |
2201 | 2222 | ||
2202 | out_session: | 2223 | out_session: |
2203 | perf_session__delete(session); | 2224 | perf_session__delete(session); |