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>
This commit is contained in:
committed by
Arnaldo Carvalho de Melo
parent
5395a04841
commit
41724e4cf6
@@ -214,8 +214,7 @@ static int __cmd_diff(void)
|
|||||||
first = false;
|
first = false;
|
||||||
|
|
||||||
hists__match(&evsel_old->hists, &evsel->hists);
|
hists__match(&evsel_old->hists, &evsel->hists);
|
||||||
hists__fprintf(&evsel->hists, &evsel_old->hists,
|
hists__fprintf(&evsel->hists, true, 0, 0, stdout);
|
||||||
true, 0, 0, stdout);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
out_delete:
|
out_delete:
|
||||||
|
|||||||
@@ -320,7 +320,7 @@ static int perf_evlist__tty_browse_hists(struct perf_evlist *evlist,
|
|||||||
const char *evname = perf_evsel__name(pos);
|
const char *evname = perf_evsel__name(pos);
|
||||||
|
|
||||||
hists__fprintf_nr_sample_events(hists, evname, stdout);
|
hists__fprintf_nr_sample_events(hists, evname, stdout);
|
||||||
hists__fprintf(hists, NULL, true, 0, 0, stdout);
|
hists__fprintf(hists, true, 0, 0, stdout);
|
||||||
fprintf(stdout, "\n\n");
|
fprintf(stdout, "\n\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -316,7 +316,7 @@ static void perf_top__print_sym_table(struct perf_top *top)
|
|||||||
hists__output_recalc_col_len(&top->sym_evsel->hists,
|
hists__output_recalc_col_len(&top->sym_evsel->hists,
|
||||||
top->winsize.ws_row - 3);
|
top->winsize.ws_row - 3);
|
||||||
putchar('\n');
|
putchar('\n');
|
||||||
hists__fprintf(&top->sym_evsel->hists, NULL, false,
|
hists__fprintf(&top->sym_evsel->hists, false,
|
||||||
top->winsize.ws_row - 4 - printed, win_width, stdout);
|
top->winsize.ws_row - 4 - printed, win_width, stdout);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -228,16 +228,17 @@ static int hpp__width_delta(struct perf_hpp *hpp __maybe_unused)
|
|||||||
|
|
||||||
static int hpp__entry_delta(struct perf_hpp *hpp, struct hist_entry *he)
|
static int hpp__entry_delta(struct perf_hpp *hpp, struct hist_entry *he)
|
||||||
{
|
{
|
||||||
struct hists *pair_hists = hpp->ptr;
|
struct hist_entry *pair = he->pair;
|
||||||
|
struct hists *pair_hists = pair ? pair->hists : NULL;
|
||||||
u64 old_total, new_total;
|
u64 old_total, new_total;
|
||||||
double old_percent = 0, new_percent = 0;
|
double old_percent = 0, new_percent = 0;
|
||||||
double diff;
|
double diff;
|
||||||
const char *fmt = symbol_conf.field_sep ? "%s" : "%7.7s";
|
const char *fmt = symbol_conf.field_sep ? "%s" : "%7.7s";
|
||||||
char buf[32] = " ";
|
char buf[32] = " ";
|
||||||
|
|
||||||
old_total = pair_hists->stats.total_period;
|
old_total = pair_hists ? pair_hists->stats.total_period : 0;
|
||||||
if (old_total > 0 && he->pair)
|
if (old_total > 0 && pair)
|
||||||
old_percent = 100.0 * he->pair->period / old_total;
|
old_percent = 100.0 * pair->period / old_total;
|
||||||
|
|
||||||
new_total = hpp->total_period;
|
new_total = hpp->total_period;
|
||||||
if (new_total > 0)
|
if (new_total > 0)
|
||||||
|
|||||||
@@ -307,8 +307,7 @@ static size_t hist_entry__callchain_fprintf(struct hist_entry *he,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int hist_entry__fprintf(struct hist_entry *he, size_t size,
|
static int hist_entry__fprintf(struct hist_entry *he, size_t size,
|
||||||
struct hists *hists, struct hists *pair_hists,
|
struct hists *hists, u64 total_period, FILE *fp)
|
||||||
u64 total_period, FILE *fp)
|
|
||||||
{
|
{
|
||||||
char bf[512];
|
char bf[512];
|
||||||
int ret;
|
int ret;
|
||||||
@@ -316,7 +315,6 @@ static int hist_entry__fprintf(struct hist_entry *he, size_t size,
|
|||||||
.buf = bf,
|
.buf = bf,
|
||||||
.size = size,
|
.size = size,
|
||||||
.total_period = total_period,
|
.total_period = total_period,
|
||||||
.ptr = pair_hists,
|
|
||||||
};
|
};
|
||||||
bool color = !symbol_conf.field_sep;
|
bool color = !symbol_conf.field_sep;
|
||||||
|
|
||||||
@@ -335,8 +333,7 @@ static int hist_entry__fprintf(struct hist_entry *he, size_t size,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t hists__fprintf(struct hists *hists, struct hists *pair,
|
size_t hists__fprintf(struct hists *hists, bool show_header, int max_rows,
|
||||||
bool show_header, int max_rows,
|
|
||||||
int max_cols, FILE *fp)
|
int max_cols, FILE *fp)
|
||||||
{
|
{
|
||||||
struct sort_entry *se;
|
struct sort_entry *se;
|
||||||
@@ -351,7 +348,6 @@ size_t hists__fprintf(struct hists *hists, struct hists *pair,
|
|||||||
struct perf_hpp dummy_hpp = {
|
struct perf_hpp dummy_hpp = {
|
||||||
.buf = bf,
|
.buf = bf,
|
||||||
.size = sizeof(bf),
|
.size = sizeof(bf),
|
||||||
.ptr = pair,
|
|
||||||
};
|
};
|
||||||
bool first = true;
|
bool first = true;
|
||||||
|
|
||||||
@@ -453,7 +449,7 @@ print_entries:
|
|||||||
if (h->filtered)
|
if (h->filtered)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
ret += hist_entry__fprintf(h, max_cols, hists, pair,
|
ret += hist_entry__fprintf(h, max_cols, hists,
|
||||||
total_period, fp);
|
total_period, fp);
|
||||||
|
|
||||||
if (max_rows && ++nr_rows >= max_rows)
|
if (max_rows && ++nr_rows >= max_rows)
|
||||||
|
|||||||
@@ -98,8 +98,8 @@ void hists__output_recalc_col_len(struct hists *hists, int max_rows);
|
|||||||
void hists__inc_nr_events(struct hists *self, u32 type);
|
void hists__inc_nr_events(struct hists *self, u32 type);
|
||||||
size_t hists__fprintf_nr_events(struct hists *self, FILE *fp);
|
size_t hists__fprintf_nr_events(struct hists *self, FILE *fp);
|
||||||
|
|
||||||
size_t hists__fprintf(struct hists *self, struct hists *pair,
|
size_t hists__fprintf(struct hists *self, bool show_header, int max_rows,
|
||||||
bool show_header, int max_rows, int max_cols, FILE *fp);
|
int max_cols, FILE *fp);
|
||||||
|
|
||||||
int hist_entry__inc_addr_samples(struct hist_entry *self, int evidx, u64 addr);
|
int hist_entry__inc_addr_samples(struct hist_entry *self, int evidx, u64 addr);
|
||||||
int hist_entry__annotate(struct hist_entry *self, size_t privsize);
|
int hist_entry__annotate(struct hist_entry *self, size_t privsize);
|
||||||
|
|||||||
Reference in New Issue
Block a user