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

Commit ff21cef6 authored by Namhyung Kim's avatar Namhyung Kim Committed by Arnaldo Carvalho de Melo
Browse files

perf diff: Introduce fmt_to_data_file() helper



The fmt_to_data_file() is to retrieve struct data__file from
perf_hpp_fmt which is embedded in diff_hpp_fmt.  It'll be used by sort
callback functions later.

Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
Acked-by: default avatarJiri Olsa <jolsa@kernel.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Kan Liang <kan.liang@intel.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1420677949-6719-5-git-send-email-namhyung@kernel.org


Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent ec3d07cb
Loading
Loading
Loading
Loading
+10 −2
Original line number Original line Diff line number Diff line
@@ -390,6 +390,15 @@ static void perf_evlist__collapse_resort(struct perf_evlist *evlist)
	}
	}
}
}


static struct data__file *fmt_to_data_file(struct perf_hpp_fmt *fmt)
{
	struct diff_hpp_fmt *dfmt = container_of(fmt, struct diff_hpp_fmt, fmt);
	void *ptr = dfmt - dfmt->idx;
	struct data__file *d = container_of(ptr, struct data__file, fmt);

	return d;
}

static struct hist_entry*
static struct hist_entry*
get_pair_data(struct hist_entry *he, struct data__file *d)
get_pair_data(struct hist_entry *he, struct data__file *d)
{
{
@@ -407,8 +416,7 @@ get_pair_data(struct hist_entry *he, struct data__file *d)
static struct hist_entry*
static struct hist_entry*
get_pair_fmt(struct hist_entry *he, struct diff_hpp_fmt *dfmt)
get_pair_fmt(struct hist_entry *he, struct diff_hpp_fmt *dfmt)
{
{
	void *ptr = dfmt - dfmt->idx;
	struct data__file *d = fmt_to_data_file(&dfmt->fmt);
	struct data__file *d = container_of(ptr, struct data__file, fmt);


	return get_pair_data(he, d);
	return get_pair_data(he, d);
}
}