aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/trace
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation/trace')
-rw-r--r--Documentation/trace/events-kmem.txt12
-rw-r--r--Documentation/trace/events.txt2
-rw-r--r--Documentation/trace/postprocess/trace-pagealloc-postprocess.pl20
-rw-r--r--Documentation/trace/tracepoint-analysis.txt40
4 files changed, 36 insertions, 38 deletions
diff --git a/Documentation/trace/events-kmem.txt b/Documentation/trace/events-kmem.txt
index aa82ee4a5a87..194800410061 100644
--- a/Documentation/trace/events-kmem.txt
+++ b/Documentation/trace/events-kmem.txt
@@ -40,8 +40,8 @@ but the call_site can usually be used to extrapolate that information.
40================== 40==================
41mm_page_alloc page=%p pfn=%lu order=%d migratetype=%d gfp_flags=%s 41mm_page_alloc page=%p pfn=%lu order=%d migratetype=%d gfp_flags=%s
42mm_page_alloc_zone_locked page=%p pfn=%lu order=%u migratetype=%d cpu=%d percpu_refill=%d 42mm_page_alloc_zone_locked page=%p pfn=%lu order=%u migratetype=%d cpu=%d percpu_refill=%d
43mm_page_free_direct page=%p pfn=%lu order=%d 43mm_page_free page=%p pfn=%lu order=%d
44mm_pagevec_free page=%p pfn=%lu order=%d cold=%d 44mm_page_free_batched page=%p pfn=%lu order=%d cold=%d
45 45
46These four events deal with page allocation and freeing. mm_page_alloc is 46These four events deal with page allocation and freeing. mm_page_alloc is
47a simple indicator of page allocator activity. Pages may be allocated from 47a simple indicator of page allocator activity. Pages may be allocated from
@@ -53,13 +53,13 @@ amounts of activity imply high activity on the zone->lock. Taking this lock
53impairs performance by disabling interrupts, dirtying cache lines between 53impairs performance by disabling interrupts, dirtying cache lines between
54CPUs and serialising many CPUs. 54CPUs and serialising many CPUs.
55 55
56When a page is freed directly by the caller, the mm_page_free_direct event 56When a page is freed directly by the caller, the only mm_page_free event
57is triggered. Significant amounts of activity here could indicate that the 57is triggered. Significant amounts of activity here could indicate that the
58callers should be batching their activities. 58callers should be batching their activities.
59 59
60When pages are freed using a pagevec, the mm_pagevec_free is 60When pages are freed in batch, the also mm_page_free_batched is triggered.
61triggered. Broadly speaking, pages are taken off the LRU lock in bulk and 61Broadly speaking, pages are taken off the LRU lock in bulk and
62freed in batch with a pagevec. Significant amounts of activity here could 62freed in batch with a page list. Significant amounts of activity here could
63indicate that the system is under memory pressure and can also indicate 63indicate that the system is under memory pressure and can also indicate
64contention on the zone->lru_lock. 64contention on the zone->lru_lock.
65 65
diff --git a/Documentation/trace/events.txt b/Documentation/trace/events.txt
index b510564aac7e..bb24c2a0e870 100644
--- a/Documentation/trace/events.txt
+++ b/Documentation/trace/events.txt
@@ -191,8 +191,6 @@ And for string fields they are:
191 191
192Currently, only exact string matches are supported. 192Currently, only exact string matches are supported.
193 193
194Currently, the maximum number of predicates in a filter is 16.
195
1965.2 Setting filters 1945.2 Setting filters
197------------------- 195-------------------
198 196
diff --git a/Documentation/trace/postprocess/trace-pagealloc-postprocess.pl b/Documentation/trace/postprocess/trace-pagealloc-postprocess.pl
index 7df50e8cf4d9..0a120aae33ce 100644
--- a/Documentation/trace/postprocess/trace-pagealloc-postprocess.pl
+++ b/Documentation/trace/postprocess/trace-pagealloc-postprocess.pl
@@ -17,8 +17,8 @@ use Getopt::Long;
17 17
18# Tracepoint events 18# Tracepoint events
19use constant MM_PAGE_ALLOC => 1; 19use constant MM_PAGE_ALLOC => 1;
20use constant MM_PAGE_FREE_DIRECT => 2; 20use constant MM_PAGE_FREE => 2;
21use constant MM_PAGEVEC_FREE => 3; 21use constant MM_PAGE_FREE_BATCHED => 3;
22use constant MM_PAGE_PCPU_DRAIN => 4; 22use constant MM_PAGE_PCPU_DRAIN => 4;
23use constant MM_PAGE_ALLOC_ZONE_LOCKED => 5; 23use constant MM_PAGE_ALLOC_ZONE_LOCKED => 5;
24use constant MM_PAGE_ALLOC_EXTFRAG => 6; 24use constant MM_PAGE_ALLOC_EXTFRAG => 6;
@@ -223,10 +223,10 @@ EVENT_PROCESS:
223 # Perl Switch() sucks majorly 223 # Perl Switch() sucks majorly
224 if ($tracepoint eq "mm_page_alloc") { 224 if ($tracepoint eq "mm_page_alloc") {
225 $perprocesspid{$process_pid}->{MM_PAGE_ALLOC}++; 225 $perprocesspid{$process_pid}->{MM_PAGE_ALLOC}++;
226 } elsif ($tracepoint eq "mm_page_free_direct") { 226 } elsif ($tracepoint eq "mm_page_free") {
227 $perprocesspid{$process_pid}->{MM_PAGE_FREE_DIRECT}++; 227 $perprocesspid{$process_pid}->{MM_PAGE_FREE}++
228 } elsif ($tracepoint eq "mm_pagevec_free") { 228 } elsif ($tracepoint eq "mm_page_free_batched") {
229 $perprocesspid{$process_pid}->{MM_PAGEVEC_FREE}++; 229 $perprocesspid{$process_pid}->{MM_PAGE_FREE_BATCHED}++;
230 } elsif ($tracepoint eq "mm_page_pcpu_drain") { 230 } elsif ($tracepoint eq "mm_page_pcpu_drain") {
231 $perprocesspid{$process_pid}->{MM_PAGE_PCPU_DRAIN}++; 231 $perprocesspid{$process_pid}->{MM_PAGE_PCPU_DRAIN}++;
232 $perprocesspid{$process_pid}->{STATE_PCPU_PAGES_DRAINED}++; 232 $perprocesspid{$process_pid}->{STATE_PCPU_PAGES_DRAINED}++;
@@ -336,8 +336,8 @@ sub dump_stats {
336 $process_pid, 336 $process_pid,
337 $stats{$process_pid}->{MM_PAGE_ALLOC}, 337 $stats{$process_pid}->{MM_PAGE_ALLOC},
338 $stats{$process_pid}->{MM_PAGE_ALLOC_ZONE_LOCKED}, 338 $stats{$process_pid}->{MM_PAGE_ALLOC_ZONE_LOCKED},
339 $stats{$process_pid}->{MM_PAGE_FREE_DIRECT}, 339 $stats{$process_pid}->{MM_PAGE_FREE},
340 $stats{$process_pid}->{MM_PAGEVEC_FREE}, 340 $stats{$process_pid}->{MM_PAGE_FREE_BATCHED},
341 $stats{$process_pid}->{MM_PAGE_PCPU_DRAIN}, 341 $stats{$process_pid}->{MM_PAGE_PCPU_DRAIN},
342 $stats{$process_pid}->{HIGH_PCPU_DRAINS}, 342 $stats{$process_pid}->{HIGH_PCPU_DRAINS},
343 $stats{$process_pid}->{HIGH_PCPU_REFILLS}, 343 $stats{$process_pid}->{HIGH_PCPU_REFILLS},
@@ -364,8 +364,8 @@ sub aggregate_perprocesspid() {
364 364
365 $perprocess{$process}->{MM_PAGE_ALLOC} += $perprocesspid{$process_pid}->{MM_PAGE_ALLOC}; 365 $perprocess{$process}->{MM_PAGE_ALLOC} += $perprocesspid{$process_pid}->{MM_PAGE_ALLOC};
366 $perprocess{$process}->{MM_PAGE_ALLOC_ZONE_LOCKED} += $perprocesspid{$process_pid}->{MM_PAGE_ALLOC_ZONE_LOCKED}; 366 $perprocess{$process}->{MM_PAGE_ALLOC_ZONE_LOCKED} += $perprocesspid{$process_pid}->{MM_PAGE_ALLOC_ZONE_LOCKED};
367 $perprocess{$process}->{MM_PAGE_FREE_DIRECT} += $perprocesspid{$process_pid}->{MM_PAGE_FREE_DIRECT}; 367 $perprocess{$process}->{MM_PAGE_FREE} += $perprocesspid{$process_pid}->{MM_PAGE_FREE};
368 $perprocess{$process}->{MM_PAGEVEC_FREE} += $perprocesspid{$process_pid}->{MM_PAGEVEC_FREE}; 368 $perprocess{$process}->{MM_PAGE_FREE_BATCHED} += $perprocesspid{$process_pid}->{MM_PAGE_FREE_BATCHED};
369 $perprocess{$process}->{MM_PAGE_PCPU_DRAIN} += $perprocesspid{$process_pid}->{MM_PAGE_PCPU_DRAIN}; 369 $perprocess{$process}->{MM_PAGE_PCPU_DRAIN} += $perprocesspid{$process_pid}->{MM_PAGE_PCPU_DRAIN};
370 $perprocess{$process}->{HIGH_PCPU_DRAINS} += $perprocesspid{$process_pid}->{HIGH_PCPU_DRAINS}; 370 $perprocess{$process}->{HIGH_PCPU_DRAINS} += $perprocesspid{$process_pid}->{HIGH_PCPU_DRAINS};
371 $perprocess{$process}->{HIGH_PCPU_REFILLS} += $perprocesspid{$process_pid}->{HIGH_PCPU_REFILLS}; 371 $perprocess{$process}->{HIGH_PCPU_REFILLS} += $perprocesspid{$process_pid}->{HIGH_PCPU_REFILLS};
diff --git a/Documentation/trace/tracepoint-analysis.txt b/Documentation/trace/tracepoint-analysis.txt
index 87bee3c129ba..058cc6c9dc56 100644
--- a/Documentation/trace/tracepoint-analysis.txt
+++ b/Documentation/trace/tracepoint-analysis.txt
@@ -93,14 +93,14 @@ By specifying the -a switch and analysing sleep, the system-wide events
93for a duration of time can be examined. 93for a duration of time can be examined.
94 94
95 $ perf stat -a \ 95 $ perf stat -a \
96 -e kmem:mm_page_alloc -e kmem:mm_page_free_direct \ 96 -e kmem:mm_page_alloc -e kmem:mm_page_free \
97 -e kmem:mm_pagevec_free \ 97 -e kmem:mm_page_free_batched \
98 sleep 10 98 sleep 10
99 Performance counter stats for 'sleep 10': 99 Performance counter stats for 'sleep 10':
100 100
101 9630 kmem:mm_page_alloc 101 9630 kmem:mm_page_alloc
102 2143 kmem:mm_page_free_direct 102 2143 kmem:mm_page_free
103 7424 kmem:mm_pagevec_free 103 7424 kmem:mm_page_free_batched
104 104
105 10.002577764 seconds time elapsed 105 10.002577764 seconds time elapsed
106 106
@@ -119,15 +119,15 @@ basis using set_ftrace_pid.
119Events can be activated and tracked for the duration of a process on a local 119Events can be activated and tracked for the duration of a process on a local
120basis using PCL such as follows. 120basis using PCL such as follows.
121 121
122 $ perf stat -e kmem:mm_page_alloc -e kmem:mm_page_free_direct \ 122 $ perf stat -e kmem:mm_page_alloc -e kmem:mm_page_free \
123 -e kmem:mm_pagevec_free ./hackbench 10 123 -e kmem:mm_page_free_batched ./hackbench 10
124 Time: 0.909 124 Time: 0.909
125 125
126 Performance counter stats for './hackbench 10': 126 Performance counter stats for './hackbench 10':
127 127
128 17803 kmem:mm_page_alloc 128 17803 kmem:mm_page_alloc
129 12398 kmem:mm_page_free_direct 129 12398 kmem:mm_page_free
130 4827 kmem:mm_pagevec_free 130 4827 kmem:mm_page_free_batched
131 131
132 0.973913387 seconds time elapsed 132 0.973913387 seconds time elapsed
133 133
@@ -146,8 +146,8 @@ to know what the standard deviation is. By and large, this is left to the
146performance analyst to do it by hand. In the event that the discrete event 146performance analyst to do it by hand. In the event that the discrete event
147occurrences are useful to the performance analyst, then perf can be used. 147occurrences are useful to the performance analyst, then perf can be used.
148 148
149 $ perf stat --repeat 5 -e kmem:mm_page_alloc -e kmem:mm_page_free_direct 149 $ perf stat --repeat 5 -e kmem:mm_page_alloc -e kmem:mm_page_free
150 -e kmem:mm_pagevec_free ./hackbench 10 150 -e kmem:mm_page_free_batched ./hackbench 10
151 Time: 0.890 151 Time: 0.890
152 Time: 0.895 152 Time: 0.895
153 Time: 0.915 153 Time: 0.915
@@ -157,8 +157,8 @@ occurrences are useful to the performance analyst, then perf can be used.
157 Performance counter stats for './hackbench 10' (5 runs): 157 Performance counter stats for './hackbench 10' (5 runs):
158 158
159 16630 kmem:mm_page_alloc ( +- 3.542% ) 159 16630 kmem:mm_page_alloc ( +- 3.542% )
160 11486 kmem:mm_page_free_direct ( +- 4.771% ) 160 11486 kmem:mm_page_free ( +- 4.771% )
161 4730 kmem:mm_pagevec_free ( +- 2.325% ) 161 4730 kmem:mm_page_free_batched ( +- 2.325% )
162 162
163 0.982653002 seconds time elapsed ( +- 1.448% ) 163 0.982653002 seconds time elapsed ( +- 1.448% )
164 164
@@ -168,15 +168,15 @@ aggregation of discrete events, then a script would need to be developed.
168Using --repeat, it is also possible to view how events are fluctuating over 168Using --repeat, it is also possible to view how events are fluctuating over
169time on a system-wide basis using -a and sleep. 169time on a system-wide basis using -a and sleep.
170 170
171 $ perf stat -e kmem:mm_page_alloc -e kmem:mm_page_free_direct \ 171 $ perf stat -e kmem:mm_page_alloc -e kmem:mm_page_free \
172 -e kmem:mm_pagevec_free \ 172 -e kmem:mm_page_free_batched \
173 -a --repeat 10 \ 173 -a --repeat 10 \
174 sleep 1 174 sleep 1
175 Performance counter stats for 'sleep 1' (10 runs): 175 Performance counter stats for 'sleep 1' (10 runs):
176 176
177 1066 kmem:mm_page_alloc ( +- 26.148% ) 177 1066 kmem:mm_page_alloc ( +- 26.148% )
178 182 kmem:mm_page_free_direct ( +- 5.464% ) 178 182 kmem:mm_page_free ( +- 5.464% )
179 890 kmem:mm_pagevec_free ( +- 30.079% ) 179 890 kmem:mm_page_free_batched ( +- 30.079% )
180 180
181 1.002251757 seconds time elapsed ( +- 0.005% ) 181 1.002251757 seconds time elapsed ( +- 0.005% )
182 182
@@ -220,8 +220,8 @@ were generating events within the kernel. To begin this sort of analysis, the
220data must be recorded. At the time of writing, this required root: 220data must be recorded. At the time of writing, this required root:
221 221
222 $ perf record -c 1 \ 222 $ perf record -c 1 \
223 -e kmem:mm_page_alloc -e kmem:mm_page_free_direct \ 223 -e kmem:mm_page_alloc -e kmem:mm_page_free \
224 -e kmem:mm_pagevec_free \ 224 -e kmem:mm_page_free_batched \
225 ./hackbench 10 225 ./hackbench 10
226 Time: 0.894 226 Time: 0.894
227 [ perf record: Captured and wrote 0.733 MB perf.data (~32010 samples) ] 227 [ perf record: Captured and wrote 0.733 MB perf.data (~32010 samples) ]
@@ -260,8 +260,8 @@ noticed that X was generating an insane amount of page allocations so let's look
260at it: 260at it:
261 261
262 $ perf record -c 1 -f \ 262 $ perf record -c 1 -f \
263 -e kmem:mm_page_alloc -e kmem:mm_page_free_direct \ 263 -e kmem:mm_page_alloc -e kmem:mm_page_free \
264 -e kmem:mm_pagevec_free \ 264 -e kmem:mm_page_free_batched \
265 -p `pidof X` 265 -p `pidof X`
266 266
267This was interrupted after a few seconds and 267This was interrupted after a few seconds and