Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 25aa84e3 authored by Jiri Olsa's avatar Jiri Olsa Committed by Arnaldo Carvalho de Melo
Browse files

perf c2c report: Recalc width of global sort entries



Using resort callbacks to compute the columns' width.

Computing only the global ones, c2c entries have fixed width only.

Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
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-zyayvq2u3dzyf3y7i9jza0lw@git.kernel.org


Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent fc9c630e
Loading
Loading
Loading
Loading
+12 −0
Original line number Original line Diff line number Diff line
@@ -1728,11 +1728,21 @@ static inline int valid_hitm_or_store(struct hist_entry *he)
	return has_hitm || c2c_he->stats.store;
	return has_hitm || c2c_he->stats.store;
}
}


static void calc_width(struct hist_entry *he)
{
	struct c2c_hists *c2c_hists;

	c2c_hists = container_of(he->hists, struct c2c_hists, hists);
	hists__calc_col_len(&c2c_hists->hists, he);
}

static int filter_cb(struct hist_entry *he)
static int filter_cb(struct hist_entry *he)
{
{
	if (c2c.show_src && !he->srcline)
	if (c2c.show_src && !he->srcline)
		he->srcline = hist_entry__get_srcline(he);
		he->srcline = hist_entry__get_srcline(he);


	calc_width(he);

	if (!valid_hitm_or_store(he))
	if (!valid_hitm_or_store(he))
		he->filtered = HIST_FILTER__C2C;
		he->filtered = HIST_FILTER__C2C;


@@ -1748,6 +1758,8 @@ static int resort_cl_cb(struct hist_entry *he)
	c2c_he = container_of(he, struct c2c_hist_entry, he);
	c2c_he = container_of(he, struct c2c_hist_entry, he);
	c2c_hists = c2c_he->hists;
	c2c_hists = c2c_he->hists;


	calc_width(he);

	if (display && c2c_hists) {
	if (display && c2c_hists) {
		c2c_hists__reinit(c2c_hists, c2c.cl_output, c2c.cl_resort);
		c2c_hists__reinit(c2c_hists, c2c.cl_output, c2c.cl_resort);