From 9b80d1f946ee40923f7bf51c69cb3a6ac6097e4a Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo Date: Fri, 16 Mar 2018 10:39:24 -0300 Subject: perf annotate: Introduce annotation_line__filter() Out of the TUI logic that allows toggling the presentation of source code lines. Will be used in the upcoming --stdio2 mode. Cc: Adrian Hunter Cc: Andi Kleen Cc: David Ahern Cc: Jin Yao Cc: Jiri Olsa Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-g0ckz9ajy6unswrv2iy39mxk@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/annotate.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tools/perf/util') diff --git a/tools/perf/util/annotate.h b/tools/perf/util/annotate.h index 6fbb34b..165845d 100644 --- a/tools/perf/util/annotate.h +++ b/tools/perf/util/annotate.h @@ -215,6 +215,10 @@ static inline int annotation__pcnt_width(struct annotation *notes) return (notes->options->show_total_period ? 12 : 7) * notes->nr_events; } +static inline bool annotation_line__filter(struct annotation_line *al, struct annotation *notes) +{ + return notes->options->hide_src_code && al->offset == -1; +} void annotation__set_offsets(struct annotation *notes, s64 size); void annotation__compute_ipc(struct annotation *notes, size_t size); -- cgit v1.1