diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2014-08-07 02:36:12 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2014-08-07 02:36:12 -0400 |
commit | 5e2aa2ed08e2e280121dc7cf5609c87d464f12ef (patch) | |
tree | ca7d7b1480285e3b617fecc5b41f0ce150a82c32 /Documentation/trace | |
parent | f62d14a8072b9756db36ba394e2b267470a40240 (diff) | |
parent | fc8104bc5a3f6f49d79f45f2706f79f77a9fb2ae (diff) |
Merge branch 'next' into for-linus
Prepare first round of input updates for 3.17.
Diffstat (limited to 'Documentation/trace')
-rw-r--r-- | Documentation/trace/events.txt | 2 | ||||
-rw-r--r-- | Documentation/trace/ftrace.txt | 26 | ||||
-rw-r--r-- | Documentation/trace/postprocess/trace-vmscan-postprocess.pl | 14 | ||||
-rw-r--r-- | Documentation/trace/tracepoints.txt | 24 |
4 files changed, 53 insertions, 13 deletions
diff --git a/Documentation/trace/events.txt b/Documentation/trace/events.txt index c94435df2037..75d25a1d6e42 100644 --- a/Documentation/trace/events.txt +++ b/Documentation/trace/events.txt | |||
@@ -443,7 +443,7 @@ The following commands are supported: | |||
443 | The following command creates a snapshot every time a block request | 443 | The following command creates a snapshot every time a block request |
444 | queue is unplugged with a depth > 1. If you were tracing a set of | 444 | queue is unplugged with a depth > 1. If you were tracing a set of |
445 | events or functions at the time, the snapshot trace buffer would | 445 | events or functions at the time, the snapshot trace buffer would |
446 | capture those events when the trigger event occured: | 446 | capture those events when the trigger event occurred: |
447 | 447 | ||
448 | # echo 'snapshot if nr_rq > 1' > \ | 448 | # echo 'snapshot if nr_rq > 1' > \ |
449 | /sys/kernel/debug/tracing/events/block/block_unplug/trigger | 449 | /sys/kernel/debug/tracing/events/block/block_unplug/trigger |
diff --git a/Documentation/trace/ftrace.txt b/Documentation/trace/ftrace.txt index bd365988e8d8..2479b2a0c77c 100644 --- a/Documentation/trace/ftrace.txt +++ b/Documentation/trace/ftrace.txt | |||
@@ -2003,6 +2003,32 @@ want, depending on your needs. | |||
2003 | 360.774530 | 1) 0.594 us | __phys_addr(); | 2003 | 360.774530 | 1) 0.594 us | __phys_addr(); |
2004 | 2004 | ||
2005 | 2005 | ||
2006 | The function name is always displayed after the closing bracket | ||
2007 | for a function if the start of that function is not in the | ||
2008 | trace buffer. | ||
2009 | |||
2010 | Display of the function name after the closing bracket may be | ||
2011 | enabled for functions whose start is in the trace buffer, | ||
2012 | allowing easier searching with grep for function durations. | ||
2013 | It is default disabled. | ||
2014 | |||
2015 | hide: echo nofuncgraph-tail > trace_options | ||
2016 | show: echo funcgraph-tail > trace_options | ||
2017 | |||
2018 | Example with nofuncgraph-tail (default): | ||
2019 | 0) | putname() { | ||
2020 | 0) | kmem_cache_free() { | ||
2021 | 0) 0.518 us | __phys_addr(); | ||
2022 | 0) 1.757 us | } | ||
2023 | 0) 2.861 us | } | ||
2024 | |||
2025 | Example with funcgraph-tail: | ||
2026 | 0) | putname() { | ||
2027 | 0) | kmem_cache_free() { | ||
2028 | 0) 0.518 us | __phys_addr(); | ||
2029 | 0) 1.757 us | } /* kmem_cache_free() */ | ||
2030 | 0) 2.861 us | } /* putname() */ | ||
2031 | |||
2006 | You can put some comments on specific functions by using | 2032 | You can put some comments on specific functions by using |
2007 | trace_printk() For example, if you want to put a comment inside | 2033 | trace_printk() For example, if you want to put a comment inside |
2008 | the __might_sleep() function, you just have to include | 2034 | the __might_sleep() function, you just have to include |
diff --git a/Documentation/trace/postprocess/trace-vmscan-postprocess.pl b/Documentation/trace/postprocess/trace-vmscan-postprocess.pl index 00e425faa2fd..78c9a7b2b58f 100644 --- a/Documentation/trace/postprocess/trace-vmscan-postprocess.pl +++ b/Documentation/trace/postprocess/trace-vmscan-postprocess.pl | |||
@@ -47,7 +47,6 @@ use constant HIGH_KSWAPD_REWAKEUP => 21; | |||
47 | use constant HIGH_NR_SCANNED => 22; | 47 | use constant HIGH_NR_SCANNED => 22; |
48 | use constant HIGH_NR_TAKEN => 23; | 48 | use constant HIGH_NR_TAKEN => 23; |
49 | use constant HIGH_NR_RECLAIMED => 24; | 49 | use constant HIGH_NR_RECLAIMED => 24; |
50 | use constant HIGH_NR_CONTIG_DIRTY => 25; | ||
51 | 50 | ||
52 | my %perprocesspid; | 51 | my %perprocesspid; |
53 | my %perprocess; | 52 | my %perprocess; |
@@ -105,7 +104,7 @@ my $regex_direct_end_default = 'nr_reclaimed=([0-9]*)'; | |||
105 | my $regex_kswapd_wake_default = 'nid=([0-9]*) order=([0-9]*)'; | 104 | my $regex_kswapd_wake_default = 'nid=([0-9]*) order=([0-9]*)'; |
106 | my $regex_kswapd_sleep_default = 'nid=([0-9]*)'; | 105 | my $regex_kswapd_sleep_default = 'nid=([0-9]*)'; |
107 | my $regex_wakeup_kswapd_default = 'nid=([0-9]*) zid=([0-9]*) order=([0-9]*)'; | 106 | my $regex_wakeup_kswapd_default = 'nid=([0-9]*) zid=([0-9]*) order=([0-9]*)'; |
108 | my $regex_lru_isolate_default = 'isolate_mode=([0-9]*) order=([0-9]*) nr_requested=([0-9]*) nr_scanned=([0-9]*) nr_taken=([0-9]*) contig_taken=([0-9]*) contig_dirty=([0-9]*) contig_failed=([0-9]*)'; | 107 | my $regex_lru_isolate_default = 'isolate_mode=([0-9]*) order=([0-9]*) nr_requested=([0-9]*) nr_scanned=([0-9]*) nr_taken=([0-9]*) file=([0-9]*)'; |
109 | my $regex_lru_shrink_inactive_default = 'nid=([0-9]*) zid=([0-9]*) nr_scanned=([0-9]*) nr_reclaimed=([0-9]*) priority=([0-9]*) flags=([A-Z_|]*)'; | 108 | my $regex_lru_shrink_inactive_default = 'nid=([0-9]*) zid=([0-9]*) nr_scanned=([0-9]*) nr_reclaimed=([0-9]*) priority=([0-9]*) flags=([A-Z_|]*)'; |
110 | my $regex_lru_shrink_active_default = 'lru=([A-Z_]*) nr_scanned=([0-9]*) nr_rotated=([0-9]*) priority=([0-9]*)'; | 109 | my $regex_lru_shrink_active_default = 'lru=([A-Z_]*) nr_scanned=([0-9]*) nr_rotated=([0-9]*) priority=([0-9]*)'; |
111 | my $regex_writepage_default = 'page=([0-9a-f]*) pfn=([0-9]*) flags=([A-Z_|]*)'; | 110 | my $regex_writepage_default = 'page=([0-9a-f]*) pfn=([0-9]*) flags=([A-Z_|]*)'; |
@@ -200,7 +199,7 @@ $regex_lru_isolate = generate_traceevent_regex( | |||
200 | $regex_lru_isolate_default, | 199 | $regex_lru_isolate_default, |
201 | "isolate_mode", "order", | 200 | "isolate_mode", "order", |
202 | "nr_requested", "nr_scanned", "nr_taken", | 201 | "nr_requested", "nr_scanned", "nr_taken", |
203 | "contig_taken", "contig_dirty", "contig_failed"); | 202 | "file"); |
204 | $regex_lru_shrink_inactive = generate_traceevent_regex( | 203 | $regex_lru_shrink_inactive = generate_traceevent_regex( |
205 | "vmscan/mm_vmscan_lru_shrink_inactive", | 204 | "vmscan/mm_vmscan_lru_shrink_inactive", |
206 | $regex_lru_shrink_inactive_default, | 205 | $regex_lru_shrink_inactive_default, |
@@ -375,7 +374,6 @@ EVENT_PROCESS: | |||
375 | } | 374 | } |
376 | my $isolate_mode = $1; | 375 | my $isolate_mode = $1; |
377 | my $nr_scanned = $4; | 376 | my $nr_scanned = $4; |
378 | my $nr_contig_dirty = $7; | ||
379 | 377 | ||
380 | # To closer match vmstat scanning statistics, only count isolate_both | 378 | # To closer match vmstat scanning statistics, only count isolate_both |
381 | # and isolate_inactive as scanning. isolate_active is rotation | 379 | # and isolate_inactive as scanning. isolate_active is rotation |
@@ -385,7 +383,6 @@ EVENT_PROCESS: | |||
385 | if ($isolate_mode != 2) { | 383 | if ($isolate_mode != 2) { |
386 | $perprocesspid{$process_pid}->{HIGH_NR_SCANNED} += $nr_scanned; | 384 | $perprocesspid{$process_pid}->{HIGH_NR_SCANNED} += $nr_scanned; |
387 | } | 385 | } |
388 | $perprocesspid{$process_pid}->{HIGH_NR_CONTIG_DIRTY} += $nr_contig_dirty; | ||
389 | } elsif ($tracepoint eq "mm_vmscan_lru_shrink_inactive") { | 386 | } elsif ($tracepoint eq "mm_vmscan_lru_shrink_inactive") { |
390 | $details = $6; | 387 | $details = $6; |
391 | if ($details !~ /$regex_lru_shrink_inactive/o) { | 388 | if ($details !~ /$regex_lru_shrink_inactive/o) { |
@@ -539,13 +536,6 @@ sub dump_stats { | |||
539 | } | 536 | } |
540 | } | 537 | } |
541 | } | 538 | } |
542 | if ($stats{$process_pid}->{HIGH_NR_CONTIG_DIRTY}) { | ||
543 | print " "; | ||
544 | my $count = $stats{$process_pid}->{HIGH_NR_CONTIG_DIRTY}; | ||
545 | if ($count != 0) { | ||
546 | print "contig-dirty=$count "; | ||
547 | } | ||
548 | } | ||
549 | 539 | ||
550 | print "\n"; | 540 | print "\n"; |
551 | } | 541 | } |
diff --git a/Documentation/trace/tracepoints.txt b/Documentation/trace/tracepoints.txt index 6b018b53177a..a3efac621c5a 100644 --- a/Documentation/trace/tracepoints.txt +++ b/Documentation/trace/tracepoints.txt | |||
@@ -115,6 +115,30 @@ If the tracepoint has to be used in kernel modules, an | |||
115 | EXPORT_TRACEPOINT_SYMBOL_GPL() or EXPORT_TRACEPOINT_SYMBOL() can be | 115 | EXPORT_TRACEPOINT_SYMBOL_GPL() or EXPORT_TRACEPOINT_SYMBOL() can be |
116 | used to export the defined tracepoints. | 116 | used to export the defined tracepoints. |
117 | 117 | ||
118 | If you need to do a bit of work for a tracepoint parameter, and | ||
119 | that work is only used for the tracepoint, that work can be encapsulated | ||
120 | within an if statement with the following: | ||
121 | |||
122 | if (trace_foo_bar_enabled()) { | ||
123 | int i; | ||
124 | int tot = 0; | ||
125 | |||
126 | for (i = 0; i < count; i++) | ||
127 | tot += calculate_nuggets(); | ||
128 | |||
129 | trace_foo_bar(tot); | ||
130 | } | ||
131 | |||
132 | All trace_<tracepoint>() calls have a matching trace_<tracepoint>_enabled() | ||
133 | function defined that returns true if the tracepoint is enabled and | ||
134 | false otherwise. The trace_<tracepoint>() should always be within the | ||
135 | block of the if (trace_<tracepoint>_enabled()) to prevent races between | ||
136 | the tracepoint being enabled and the check being seen. | ||
137 | |||
138 | The advantage of using the trace_<tracepoint>_enabled() is that it uses | ||
139 | the static_key of the tracepoint to allow the if statement to be implemented | ||
140 | with jump labels and avoid conditional branches. | ||
141 | |||
118 | Note: The convenience macro TRACE_EVENT provides an alternative way to | 142 | Note: The convenience macro TRACE_EVENT provides an alternative way to |
119 | define tracepoints. Check http://lwn.net/Articles/379903, | 143 | define tracepoints. Check http://lwn.net/Articles/379903, |
120 | http://lwn.net/Articles/381064 and http://lwn.net/Articles/383362 | 144 | http://lwn.net/Articles/381064 and http://lwn.net/Articles/383362 |