perf hists: Factor out hists__reset_column_width()
The stdio and tui has same code to reset hpp format column width. Factor it out as a new function. Suggested-and-Acked-by: Jiri Olsa <jolsa@redhat.com> Signed-off-by: Namhyung Kim <namhyung@kernel.org> Cc: Andi Kleen <andi@firstfloor.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/20160920053025.13989-2-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
5ff3e7a224
commit
e3b60bc93d
@@ -699,6 +699,21 @@ void perf_hpp__reset_width(struct perf_hpp_fmt *fmt, struct hists *hists)
|
||||
}
|
||||
}
|
||||
|
||||
void hists__reset_column_width(struct hists *hists)
|
||||
{
|
||||
struct perf_hpp_fmt *fmt;
|
||||
struct perf_hpp_list_node *node;
|
||||
|
||||
hists__for_each_format(hists, fmt)
|
||||
perf_hpp__reset_width(fmt, hists);
|
||||
|
||||
/* hierarchy entries have their own hpp list */
|
||||
list_for_each_entry(node, &hists->hpp_formats, list) {
|
||||
perf_hpp_list__for_each_format(&node->hpp, fmt)
|
||||
perf_hpp__reset_width(fmt, hists);
|
||||
}
|
||||
}
|
||||
|
||||
void perf_hpp__set_user_width(const char *width_list_str)
|
||||
{
|
||||
struct perf_hpp_fmt *fmt;
|
||||
|
Reference in New Issue
Block a user