aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@redhat.com>2012-10-04 08:49:38 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2012-10-04 12:29:45 -0400
commit41724e4cf6c443d2dc575669b8555f0e2ae427a9 (patch)
treec9f7453fef649460c13378f356f59093f2f0d952 /tools/perf
parent5395a04841fcdd9220177f2c21353fe6d4cd0729 (diff)
perf tools: Removing hists pair argument from output path
The hists pointer is now part of the 'struct hist_entry'. And since the overhead and baseline columns are split now, there's no reason to pass it through the output path. Signed-off-by: Jiri Olsa <jolsa@redhat.com> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1349354994-17853-5-git-send-email-namhyung@kernel.org Signed-off-by: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf')
-rw-r--r--tools/perf/builtin-diff.c3
-rw-r--r--tools/perf/builtin-report.c2
-rw-r--r--tools/perf/builtin-top.c2
-rw-r--r--tools/perf/ui/hist.c9
-rw-r--r--tools/perf/ui/stdio/hist.c10
-rw-r--r--tools/perf/util/hist.h4
6 files changed, 13 insertions, 17 deletions
diff --git a/tools/perf/builtin-diff.c b/tools/perf/builtin-diff.c
index 5cb577a3c5b2..413c65a1ba39 100644
--- a/tools/perf/builtin-diff.c
+++ b/tools/perf/builtin-diff.c
@@ -214,8 +214,7 @@ static int __cmd_diff(void)
214 first = false; 214 first = false;
215 215
216 hists__match(&evsel_old->hists, &evsel->hists); 216 hists__match(&evsel_old->hists, &evsel->hists);
217 hists__fprintf(&evsel->hists, &evsel_old->hists, 217 hists__fprintf(&evsel->hists, true, 0, 0, stdout);
218 true, 0, 0, stdout);
219 } 218 }
220 219
221out_delete: 220out_delete:
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 6748cac919d1..95e7ea879b8a 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -320,7 +320,7 @@ static int perf_evlist__tty_browse_hists(struct perf_evlist *evlist,
320 const char *evname = perf_evsel__name(pos); 320 const char *evname = perf_evsel__name(pos);
321 321
322 hists__fprintf_nr_sample_events(hists, evname, stdout); 322 hists__fprintf_nr_sample_events(hists, evname, stdout);
323 hists__fprintf(hists, NULL, true, 0, 0, stdout); 323 hists__fprintf(hists, true, 0, 0, stdout);
324 fprintf(stdout, "\n\n"); 324 fprintf(stdout, "\n\n");
325 } 325 }
326 326
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index 357115874b77..ff6db8086805 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -316,7 +316,7 @@ static void perf_top__print_sym_table(struct perf_top *top)
316 hists__output_recalc_col_len(&top->sym_evsel->hists, 316 hists__output_recalc_col_len(&top->sym_evsel->hists,
317 top->winsize.ws_row - 3); 317 top->winsize.ws_row - 3);
318 putchar('\n'); 318 putchar('\n');
319 hists__fprintf(&top->sym_evsel->hists, NULL, false, 319 hists__fprintf(&top->sym_evsel->hists, false,
320 top->winsize.ws_row - 4 - printed, win_width, stdout); 320 top->winsize.ws_row - 4 - printed, win_width, stdout);
321} 321}
322 322
diff --git a/tools/perf/ui/hist.c b/tools/perf/ui/hist.c
index 532a60177c32..6b0138e5f332 100644
--- a/tools/perf/ui/hist.c
+++ b/tools/perf/ui/hist.c
@@ -228,16 +228,17 @@ static int hpp__width_delta(struct perf_hpp *hpp __maybe_unused)
228 228
229static int hpp__entry_delta(struct perf_hpp *hpp, struct hist_entry *he) 229static int hpp__entry_delta(struct perf_hpp *hpp, struct hist_entry *he)
230{ 230{
231 struct hists *pair_hists = hpp->ptr; 231 struct hist_entry *pair = he->pair;
232 struct hists *pair_hists = pair ? pair->hists : NULL;
232 u64 old_total, new_total; 233 u64 old_total, new_total;
233 double old_percent = 0, new_percent = 0; 234 double old_percent = 0, new_percent = 0;
234 double diff; 235 double diff;
235 const char *fmt = symbol_conf.field_sep ? "%s" : "%7.7s"; 236 const char *fmt = symbol_conf.field_sep ? "%s" : "%7.7s";
236 char buf[32] = " "; 237 char buf[32] = " ";
237 238
238 old_total = pair_hists->stats.total_period; 239 old_total = pair_hists ? pair_hists->stats.total_period : 0;
239 if (old_total > 0 && he->pair) 240 if (old_total > 0 && pair)
240 old_percent = 100.0 * he->pair->period / old_total; 241 old_percent = 100.0 * pair->period / old_total;
241 242
242 new_total = hpp->total_period; 243 new_total = hpp->total_period;
243 if (new_total > 0) 244 if (new_total > 0)
diff --git a/tools/perf/ui/stdio/hist.c b/tools/perf/ui/stdio/hist.c
index 0aa6776caba5..1340c93aa619 100644
--- a/tools/perf/ui/stdio/hist.c
+++ b/tools/perf/ui/stdio/hist.c
@@ -307,8 +307,7 @@ static size_t hist_entry__callchain_fprintf(struct hist_entry *he,
307} 307}
308 308
309static int hist_entry__fprintf(struct hist_entry *he, size_t size, 309static int hist_entry__fprintf(struct hist_entry *he, size_t size,
310 struct hists *hists, struct hists *pair_hists, 310 struct hists *hists, u64 total_period, FILE *fp)
311 u64 total_period, FILE *fp)
312{ 311{
313 char bf[512]; 312 char bf[512];
314 int ret; 313 int ret;
@@ -316,7 +315,6 @@ static int hist_entry__fprintf(struct hist_entry *he, size_t size,
316 .buf = bf, 315 .buf = bf,
317 .size = size, 316 .size = size,
318 .total_period = total_period, 317 .total_period = total_period,
319 .ptr = pair_hists,
320 }; 318 };
321 bool color = !symbol_conf.field_sep; 319 bool color = !symbol_conf.field_sep;
322 320
@@ -335,8 +333,7 @@ static int hist_entry__fprintf(struct hist_entry *he, size_t size,
335 return ret; 333 return ret;
336} 334}
337 335
338size_t hists__fprintf(struct hists *hists, struct hists *pair, 336size_t hists__fprintf(struct hists *hists, bool show_header, int max_rows,
339 bool show_header, int max_rows,
340 int max_cols, FILE *fp) 337 int max_cols, FILE *fp)
341{ 338{
342 struct sort_entry *se; 339 struct sort_entry *se;
@@ -351,7 +348,6 @@ size_t hists__fprintf(struct hists *hists, struct hists *pair,
351 struct perf_hpp dummy_hpp = { 348 struct perf_hpp dummy_hpp = {
352 .buf = bf, 349 .buf = bf,
353 .size = sizeof(bf), 350 .size = sizeof(bf),
354 .ptr = pair,
355 }; 351 };
356 bool first = true; 352 bool first = true;
357 353
@@ -453,7 +449,7 @@ print_entries:
453 if (h->filtered) 449 if (h->filtered)
454 continue; 450 continue;
455 451
456 ret += hist_entry__fprintf(h, max_cols, hists, pair, 452 ret += hist_entry__fprintf(h, max_cols, hists,
457 total_period, fp); 453 total_period, fp);
458 454
459 if (max_rows && ++nr_rows >= max_rows) 455 if (max_rows && ++nr_rows >= max_rows)
diff --git a/tools/perf/util/hist.h b/tools/perf/util/hist.h
index b1a2b9d9b658..b83a2268b5d2 100644
--- a/tools/perf/util/hist.h
+++ b/tools/perf/util/hist.h
@@ -98,8 +98,8 @@ void hists__output_recalc_col_len(struct hists *hists, int max_rows);
98void hists__inc_nr_events(struct hists *self, u32 type); 98void hists__inc_nr_events(struct hists *self, u32 type);
99size_t hists__fprintf_nr_events(struct hists *self, FILE *fp); 99size_t hists__fprintf_nr_events(struct hists *self, FILE *fp);
100 100
101size_t hists__fprintf(struct hists *self, struct hists *pair, 101size_t hists__fprintf(struct hists *self, bool show_header, int max_rows,
102 bool show_header, int max_rows, int max_cols, FILE *fp); 102 int max_cols, FILE *fp);
103 103
104int hist_entry__inc_addr_samples(struct hist_entry *self, int evidx, u64 addr); 104int hist_entry__inc_addr_samples(struct hist_entry *self, int evidx, u64 addr);
105int hist_entry__annotate(struct hist_entry *self, size_t privsize); 105int hist_entry__annotate(struct hist_entry *self, size_t privsize);