diff options
author | Namhyung Kim <namhyung.kim@lge.com> | 2013-10-14 04:24:26 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2013-10-18 22:23:16 -0400 |
commit | 29ad23b00474c34e3b5040dda508c78d33a1a3eb (patch) | |
tree | f6969382cf228535853c8ea3b60056e58678b673 /kernel/trace/trace.h | |
parent | 6a10108bdbbfb66e5c431fd1056534e9717d34eb (diff) |
ftrace: Add set_graph_notrace filter
The set_graph_notrace filter is analogous to set_ftrace_notrace and
can be used for eliminating uninteresting part of function graph trace
output. It also works with set_graph_function nicely.
# cd /sys/kernel/debug/tracing/
# echo do_page_fault > set_graph_function
# perf ftrace live true
2) | do_page_fault() {
2) | __do_page_fault() {
2) 0.381 us | down_read_trylock();
2) 0.055 us | __might_sleep();
2) 0.696 us | find_vma();
2) | handle_mm_fault() {
2) | handle_pte_fault() {
2) | __do_fault() {
2) | filemap_fault() {
2) | find_get_page() {
2) 0.033 us | __rcu_read_lock();
2) 0.035 us | __rcu_read_unlock();
2) 1.696 us | }
2) 0.031 us | __might_sleep();
2) 2.831 us | }
2) | _raw_spin_lock() {
2) 0.046 us | add_preempt_count();
2) 0.841 us | }
2) 0.033 us | page_add_file_rmap();
2) | _raw_spin_unlock() {
2) 0.057 us | sub_preempt_count();
2) 0.568 us | }
2) | unlock_page() {
2) 0.084 us | page_waitqueue();
2) 0.126 us | __wake_up_bit();
2) 1.117 us | }
2) 7.729 us | }
2) 8.397 us | }
2) 8.956 us | }
2) 0.085 us | up_read();
2) + 12.745 us | }
2) + 13.401 us | }
...
# echo handle_mm_fault > set_graph_notrace
# perf ftrace live true
1) | do_page_fault() {
1) | __do_page_fault() {
1) 0.205 us | down_read_trylock();
1) 0.041 us | __might_sleep();
1) 0.344 us | find_vma();
1) 0.069 us | up_read();
1) 4.692 us | }
1) 5.311 us | }
...
Link: http://lkml.kernel.org/r/1381739066-7531-5-git-send-email-namhyung@kernel.org
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace/trace.h')
-rw-r--r-- | kernel/trace/trace.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h index 40211cef2796..d1cf5159bec0 100644 --- a/kernel/trace/trace.h +++ b/kernel/trace/trace.h | |||
@@ -732,6 +732,8 @@ extern void __trace_graph_return(struct trace_array *tr, | |||
732 | #define FTRACE_GRAPH_MAX_FUNCS 32 | 732 | #define FTRACE_GRAPH_MAX_FUNCS 32 |
733 | extern int ftrace_graph_count; | 733 | extern int ftrace_graph_count; |
734 | extern unsigned long ftrace_graph_funcs[FTRACE_GRAPH_MAX_FUNCS]; | 734 | extern unsigned long ftrace_graph_funcs[FTRACE_GRAPH_MAX_FUNCS]; |
735 | extern int ftrace_graph_notrace_count; | ||
736 | extern unsigned long ftrace_graph_notrace_funcs[FTRACE_GRAPH_MAX_FUNCS]; | ||
735 | 737 | ||
736 | static inline int ftrace_graph_addr(unsigned long addr) | 738 | static inline int ftrace_graph_addr(unsigned long addr) |
737 | { | 739 | { |
@@ -757,11 +759,31 @@ static inline int ftrace_graph_addr(unsigned long addr) | |||
757 | 759 | ||
758 | return 0; | 760 | return 0; |
759 | } | 761 | } |
762 | |||
763 | static inline int ftrace_graph_notrace_addr(unsigned long addr) | ||
764 | { | ||
765 | int i; | ||
766 | |||
767 | if (!ftrace_graph_notrace_count) | ||
768 | return 0; | ||
769 | |||
770 | for (i = 0; i < ftrace_graph_notrace_count; i++) { | ||
771 | if (addr == ftrace_graph_notrace_funcs[i]) | ||
772 | return 1; | ||
773 | } | ||
774 | |||
775 | return 0; | ||
776 | } | ||
760 | #else | 777 | #else |
761 | static inline int ftrace_graph_addr(unsigned long addr) | 778 | static inline int ftrace_graph_addr(unsigned long addr) |
762 | { | 779 | { |
763 | return 1; | 780 | return 1; |
764 | } | 781 | } |
782 | |||
783 | static inline int ftrace_graph_notrace_addr(unsigned long addr) | ||
784 | { | ||
785 | return 0; | ||
786 | } | ||
765 | #endif /* CONFIG_DYNAMIC_FTRACE */ | 787 | #endif /* CONFIG_DYNAMIC_FTRACE */ |
766 | #else /* CONFIG_FUNCTION_GRAPH_TRACER */ | 788 | #else /* CONFIG_FUNCTION_GRAPH_TRACER */ |
767 | static inline enum print_line_t | 789 | static inline enum print_line_t |