perf hists: Use own hpp_list for hierarchy mode
Now each hists has its own hpp lists in hierarchy. So instead of having a pointer to a single perf_hpp_fmt in a hist entry, make it point the hpp_list for its level. This will be used to support multiple sort keys in a single hierarchy level. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Wang Nan <wangnan0@huawei.com> Link: http://lkml.kernel.org/r/1457361308-514-3-git-send-email-namhyung@kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:

committed by
Ingo Molnar

parent
c3bc0c4368
commit
1b2dbbf41a
@@ -722,6 +722,7 @@ static int add_hierarchy_fmt(struct hists *hists, struct perf_hpp_fmt *fmt)
|
||||
struct perf_hpp_list_node *node = NULL;
|
||||
struct perf_hpp_fmt *fmt_copy;
|
||||
bool found = false;
|
||||
bool skip = perf_hpp__should_skip(fmt, hists);
|
||||
|
||||
list_for_each_entry(node, &hists->hpp_formats, list) {
|
||||
if (node->level == fmt->level) {
|
||||
@@ -735,6 +736,7 @@ static int add_hierarchy_fmt(struct hists *hists, struct perf_hpp_fmt *fmt)
|
||||
if (node == NULL)
|
||||
return -1;
|
||||
|
||||
node->skip = skip;
|
||||
node->level = fmt->level;
|
||||
perf_hpp_list__init(&node->hpp);
|
||||
|
||||
@@ -745,6 +747,9 @@ static int add_hierarchy_fmt(struct hists *hists, struct perf_hpp_fmt *fmt)
|
||||
if (fmt_copy == NULL)
|
||||
return -1;
|
||||
|
||||
if (!skip)
|
||||
node->skip = false;
|
||||
|
||||
list_add_tail(&fmt_copy->list, &node->hpp.fields);
|
||||
list_add_tail(&fmt_copy->sort_list, &node->hpp.sorts);
|
||||
|
||||
|
Reference in New Issue
Block a user