aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-report.c
diff options
context:
space:
mode:
authorAndi Kleen <ak@linux.intel.com>2013-01-24 10:10:29 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2013-04-01 11:19:43 -0400
commit05484298cbfebbf8c8c55b000541a245bc286bec (patch)
tree1b1336957d96defc9e637faf14aebacb5b9b693a /tools/perf/builtin-report.c
parent2fe85427e3bf65d791700d065132772fc26e4d75 (diff)
perf tools: Add support for weight v7 (modified)
perf record has a new option -W that enables weightened sampling. Add sorting support in top/report for the average weight per sample and the total weight sum. This allows to both compare relative cost per event and the total cost over the measurement period. Add the necessary glue to perf report, record and the library. v2: Merge with new hist refactoring. v3: Fix manpage. Remove value check. Rename global_weight to weight and weight to local_weight. v4: Readd sort keys to manpage v5: Move weight to end v6: Move weight to template v7: Rename weight key. Original patch from Andi modified by Stephane Eranian <eranian@google.com> to include ONLY the weight supporting code and apply to pristine 3.8.0-rc4. Signed-off-by: Andi Kleen <ak@linux.intel.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung.kim@lge.com> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/1359040242-8269-6-git-send-email-eranian@google.com [ committer note: changed to cope with fc5871ed and the hists_link perf test entry ] Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-report.c')
-rw-r--r--tools/perf/builtin-report.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index b5ea26cc7eb1..e31f070abe2f 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -98,7 +98,7 @@ static int perf_report__add_branch_hist_entry(struct perf_tool *tool,
98 * and not events sampled. Thus we use a pseudo period of 1. 98 * and not events sampled. Thus we use a pseudo period of 1.
99 */ 99 */
100 he = __hists__add_branch_entry(&evsel->hists, al, parent, 100 he = __hists__add_branch_entry(&evsel->hists, al, parent,
101 &bi[i], 1); 101 &bi[i], 1, 1);
102 if (he) { 102 if (he) {
103 struct annotation *notes; 103 struct annotation *notes;
104 err = -ENOMEM; 104 err = -ENOMEM;
@@ -156,7 +156,8 @@ static int perf_evsel__add_hist_entry(struct perf_evsel *evsel,
156 return err; 156 return err;
157 } 157 }
158 158
159 he = __hists__add_entry(&evsel->hists, al, parent, sample->period); 159 he = __hists__add_entry(&evsel->hists, al, parent, sample->period,
160 sample->weight);
160 if (he == NULL) 161 if (he == NULL)
161 return -ENOMEM; 162 return -ENOMEM;
162 163
@@ -644,7 +645,8 @@ int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused)
644 "Use the stdio interface"), 645 "Use the stdio interface"),
645 OPT_STRING('s', "sort", &sort_order, "key[,key2...]", 646 OPT_STRING('s', "sort", &sort_order, "key[,key2...]",
646 "sort by key(s): pid, comm, dso, symbol, parent, cpu, srcline," 647 "sort by key(s): pid, comm, dso, symbol, parent, cpu, srcline,"
647 " dso_to, dso_from, symbol_to, symbol_from, mispredict"), 648 " dso_to, dso_from, symbol_to, symbol_from, mispredict,"
649 " weight, local_weight"),
648 OPT_BOOLEAN(0, "showcpuutilization", &symbol_conf.show_cpu_utilization, 650 OPT_BOOLEAN(0, "showcpuutilization", &symbol_conf.show_cpu_utilization,
649 "Show sample percentage for different cpu modes"), 651 "Show sample percentage for different cpu modes"),
650 OPT_STRING('p', "parent", &parent_pattern, "regex", 652 OPT_STRING('p', "parent", &parent_pattern, "regex",