Commit a9c6e46c authored by Namhyung Kim's avatar Namhyung Kim Committed by Arnaldo Carvalho de Melo

perf tools: Add helper functions for some sort keys

The 'trace', 'srcline' and 'srcfile' sort keys updates hist entry's
field later.  With the hierarchy mode, those fields are passed to a
matching entry so it needs to identify the sort keys.
Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1456326830-30456-2-git-send-email-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 30372f04
...@@ -301,6 +301,9 @@ void perf_hpp__append_sort_keys(struct perf_hpp_list *list); ...@@ -301,6 +301,9 @@ void perf_hpp__append_sort_keys(struct perf_hpp_list *list);
bool perf_hpp__is_sort_entry(struct perf_hpp_fmt *format); bool perf_hpp__is_sort_entry(struct perf_hpp_fmt *format);
bool perf_hpp__is_dynamic_entry(struct perf_hpp_fmt *format); bool perf_hpp__is_dynamic_entry(struct perf_hpp_fmt *format);
bool perf_hpp__defined_dynamic_entry(struct perf_hpp_fmt *fmt, struct hists *hists); bool perf_hpp__defined_dynamic_entry(struct perf_hpp_fmt *fmt, struct hists *hists);
bool perf_hpp__is_trace_entry(struct perf_hpp_fmt *fmt);
bool perf_hpp__is_srcline_entry(struct perf_hpp_fmt *fmt);
bool perf_hpp__is_srcfile_entry(struct perf_hpp_fmt *fmt);
static inline bool perf_hpp__should_skip(struct perf_hpp_fmt *format, static inline bool perf_hpp__should_skip(struct perf_hpp_fmt *format,
struct hists *hists) struct hists *hists)
......
...@@ -1391,6 +1391,39 @@ bool perf_hpp__is_sort_entry(struct perf_hpp_fmt *format) ...@@ -1391,6 +1391,39 @@ bool perf_hpp__is_sort_entry(struct perf_hpp_fmt *format)
return format->header == __sort__hpp_header; return format->header == __sort__hpp_header;
} }
bool perf_hpp__is_trace_entry(struct perf_hpp_fmt *fmt)
{
struct hpp_sort_entry *hse;
if (!perf_hpp__is_sort_entry(fmt))
return false;
hse = container_of(fmt, struct hpp_sort_entry, hpp);
return hse->se == &sort_trace;
}
bool perf_hpp__is_srcline_entry(struct perf_hpp_fmt *fmt)
{
struct hpp_sort_entry *hse;
if (!perf_hpp__is_sort_entry(fmt))
return false;
hse = container_of(fmt, struct hpp_sort_entry, hpp);
return hse->se == &sort_srcline;
}
bool perf_hpp__is_srcfile_entry(struct perf_hpp_fmt *fmt)
{
struct hpp_sort_entry *hse;
if (!perf_hpp__is_sort_entry(fmt))
return false;
hse = container_of(fmt, struct hpp_sort_entry, hpp);
return hse->se == &sort_srcfile;
}
static bool __sort__hpp_equal(struct perf_hpp_fmt *a, struct perf_hpp_fmt *b) static bool __sort__hpp_equal(struct perf_hpp_fmt *a, struct perf_hpp_fmt *b)
{ {
struct hpp_sort_entry *hse_a; struct hpp_sort_entry *hse_a;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment