Skip to content

Commit

Permalink
perf hists: Rename total_session to total_period
Browse files Browse the repository at this point in the history
Nowadays we do it per evsel, not per session (that may have multiple
evsels), so rename it to avoid confusion.

Cc: David Ahern <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Stephane Eranian <[email protected]>
Link: http://lkml.kernel.org/n/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
  • Loading branch information
acmel committed Jan 6, 2012
1 parent 9e18342 commit 13d3ee5
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tools/perf/util/hist.c
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ void hists__output_recalc_col_len(struct hists *hists, int max_rows)
static int hist_entry__pcnt_snprintf(struct hist_entry *self, char *s,
size_t size, struct hists *pair_hists,
bool show_displacement, long displacement,
bool color, u64 session_total)
bool color, u64 total_period)
{
u64 period, total, period_sys, period_us, period_guest_sys, period_guest_us;
u64 nr_events;
Expand All @@ -754,7 +754,7 @@ static int hist_entry__pcnt_snprintf(struct hist_entry *self, char *s,
} else {
period = self->period;
nr_events = self->nr_events;
total = session_total;
total = total_period;
period_sys = self->period_sys;
period_us = self->period_us;
period_guest_sys = self->period_guest_sys;
Expand Down Expand Up @@ -812,8 +812,8 @@ static int hist_entry__pcnt_snprintf(struct hist_entry *self, char *s,

if (total > 0)
old_percent = (period * 100.0) / total;
if (session_total > 0)
new_percent = (self->period * 100.0) / session_total;
if (total_period > 0)
new_percent = (self->period * 100.0) / total_period;

diff = new_percent - old_percent;

Expand Down Expand Up @@ -864,7 +864,7 @@ int hist_entry__snprintf(struct hist_entry *he, char *s, size_t size,

int hist_entry__fprintf(struct hist_entry *he, size_t size, struct hists *hists,
struct hists *pair_hists, bool show_displacement,
long displacement, FILE *fp, u64 session_total)
long displacement, FILE *fp, u64 total_period)
{
char bf[512];
int ret;
Expand All @@ -874,14 +874,14 @@ int hist_entry__fprintf(struct hist_entry *he, size_t size, struct hists *hists,

ret = hist_entry__pcnt_snprintf(he, bf, size, pair_hists,
show_displacement, displacement,
true, session_total);
true, total_period);
hist_entry__snprintf(he, bf + ret, size - ret, hists);
return fprintf(fp, "%s\n", bf);
}

static size_t hist_entry__fprintf_callchain(struct hist_entry *self,
struct hists *hists, FILE *fp,
u64 session_total)
u64 total_period)
{
int left_margin = 0;

Expand All @@ -892,7 +892,7 @@ static size_t hist_entry__fprintf_callchain(struct hist_entry *self,
left_margin -= thread__comm_len(self->thread);
}

return hist_entry_callchain__fprintf(fp, self, session_total,
return hist_entry_callchain__fprintf(fp, self, total_period,
left_margin);
}

Expand Down

0 comments on commit 13d3ee5

Please sign in to comment.