Skip to content

Commit

Permalink
mm-tracepoint: fix documentation and examples
Browse files Browse the repository at this point in the history
We renamed the page-free mm tracepoints.

Signed-off-by: Konstantin Khlebnikov <[email protected]>
Cc: Mel Gorman <[email protected]>
Cc: KOSAKI Motohiro <[email protected]>
Reviewed-by: Minchan Kim <[email protected]>
Cc: Hugh Dickins <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
koct9i authored and torvalds committed Jan 11, 2012
1 parent b413d48 commit 90a5d5a
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 37 deletions.
40 changes: 20 additions & 20 deletions Documentation/trace/tracepoint-analysis.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,14 @@ By specifying the -a switch and analysing sleep, the system-wide events
for a duration of time can be examined.

$ perf stat -a \
-e kmem:mm_page_alloc -e kmem:mm_page_free_direct \
-e kmem:mm_pagevec_free \
-e kmem:mm_page_alloc -e kmem:mm_page_free \
-e kmem:mm_page_free_batched \
sleep 10
Performance counter stats for 'sleep 10':

9630 kmem:mm_page_alloc
2143 kmem:mm_page_free_direct
7424 kmem:mm_pagevec_free
2143 kmem:mm_page_free
7424 kmem:mm_page_free_batched

10.002577764 seconds time elapsed

Expand All @@ -119,15 +119,15 @@ basis using set_ftrace_pid.
Events can be activated and tracked for the duration of a process on a local
basis using PCL such as follows.

$ perf stat -e kmem:mm_page_alloc -e kmem:mm_page_free_direct \
-e kmem:mm_pagevec_free ./hackbench 10
$ perf stat -e kmem:mm_page_alloc -e kmem:mm_page_free \
-e kmem:mm_page_free_batched ./hackbench 10
Time: 0.909

Performance counter stats for './hackbench 10':

17803 kmem:mm_page_alloc
12398 kmem:mm_page_free_direct
4827 kmem:mm_pagevec_free
12398 kmem:mm_page_free
4827 kmem:mm_page_free_batched

0.973913387 seconds time elapsed

Expand All @@ -146,8 +146,8 @@ to know what the standard deviation is. By and large, this is left to the
performance analyst to do it by hand. In the event that the discrete event
occurrences are useful to the performance analyst, then perf can be used.

$ perf stat --repeat 5 -e kmem:mm_page_alloc -e kmem:mm_page_free_direct
-e kmem:mm_pagevec_free ./hackbench 10
$ perf stat --repeat 5 -e kmem:mm_page_alloc -e kmem:mm_page_free
-e kmem:mm_page_free_batched ./hackbench 10
Time: 0.890
Time: 0.895
Time: 0.915
Expand All @@ -157,8 +157,8 @@ occurrences are useful to the performance analyst, then perf can be used.
Performance counter stats for './hackbench 10' (5 runs):

16630 kmem:mm_page_alloc ( +- 3.542% )
11486 kmem:mm_page_free_direct ( +- 4.771% )
4730 kmem:mm_pagevec_free ( +- 2.325% )
11486 kmem:mm_page_free ( +- 4.771% )
4730 kmem:mm_page_free_batched ( +- 2.325% )

0.982653002 seconds time elapsed ( +- 1.448% )

Expand All @@ -168,15 +168,15 @@ aggregation of discrete events, then a script would need to be developed.
Using --repeat, it is also possible to view how events are fluctuating over
time on a system-wide basis using -a and sleep.

$ perf stat -e kmem:mm_page_alloc -e kmem:mm_page_free_direct \
-e kmem:mm_pagevec_free \
$ perf stat -e kmem:mm_page_alloc -e kmem:mm_page_free \
-e kmem:mm_page_free_batched \
-a --repeat 10 \
sleep 1
Performance counter stats for 'sleep 1' (10 runs):

1066 kmem:mm_page_alloc ( +- 26.148% )
182 kmem:mm_page_free_direct ( +- 5.464% )
890 kmem:mm_pagevec_free ( +- 30.079% )
182 kmem:mm_page_free ( +- 5.464% )
890 kmem:mm_page_free_batched ( +- 30.079% )

1.002251757 seconds time elapsed ( +- 0.005% )

Expand Down Expand Up @@ -220,8 +220,8 @@ were generating events within the kernel. To begin this sort of analysis, the
data must be recorded. At the time of writing, this required root:

$ perf record -c 1 \
-e kmem:mm_page_alloc -e kmem:mm_page_free_direct \
-e kmem:mm_pagevec_free \
-e kmem:mm_page_alloc -e kmem:mm_page_free \
-e kmem:mm_page_free_batched \
./hackbench 10
Time: 0.894
[ perf record: Captured and wrote 0.733 MB perf.data (~32010 samples) ]
Expand Down Expand Up @@ -260,8 +260,8 @@ noticed that X was generating an insane amount of page allocations so let's look
at it:

$ perf record -c 1 -f \
-e kmem:mm_page_alloc -e kmem:mm_page_free_direct \
-e kmem:mm_pagevec_free \
-e kmem:mm_page_alloc -e kmem:mm_page_free \
-e kmem:mm_page_free_batched \
-p `pidof X`

This was interrupted after a few seconds and
Expand Down
34 changes: 17 additions & 17 deletions tools/perf/Documentation/examples.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ titan:~> perf list
kmem:kmem_cache_alloc_node [Tracepoint event]
kmem:kfree [Tracepoint event]
kmem:kmem_cache_free [Tracepoint event]
kmem:mm_page_free_direct [Tracepoint event]
kmem:mm_pagevec_free [Tracepoint event]
kmem:mm_page_free [Tracepoint event]
kmem:mm_page_free_batched [Tracepoint event]
kmem:mm_page_alloc [Tracepoint event]
kmem:mm_page_alloc_zone_locked [Tracepoint event]
kmem:mm_page_pcpu_drain [Tracepoint event]
Expand All @@ -29,24 +29,24 @@ measured. For example the page alloc/free properties of a 'hackbench
run' are:

titan:~> perf stat -e kmem:mm_page_pcpu_drain -e kmem:mm_page_alloc
-e kmem:mm_pagevec_free -e kmem:mm_page_free_direct ./hackbench 10
-e kmem:mm_page_free_batched -e kmem:mm_page_free ./hackbench 10
Time: 0.575

Performance counter stats for './hackbench 10':

13857 kmem:mm_page_pcpu_drain
27576 kmem:mm_page_alloc
6025 kmem:mm_pagevec_free
20934 kmem:mm_page_free_direct
6025 kmem:mm_page_free_batched
20934 kmem:mm_page_free

0.613972165 seconds time elapsed

You can observe the statistical properties as well, by using the
'repeat the workload N times' feature of perf stat:

titan:~> perf stat --repeat 5 -e kmem:mm_page_pcpu_drain -e
kmem:mm_page_alloc -e kmem:mm_pagevec_free -e
kmem:mm_page_free_direct ./hackbench 10
kmem:mm_page_alloc -e kmem:mm_page_free_batched -e
kmem:mm_page_free ./hackbench 10
Time: 0.627
Time: 0.644
Time: 0.564
Expand All @@ -57,8 +57,8 @@ You can observe the statistical properties as well, by using the

12920 kmem:mm_page_pcpu_drain ( +- 3.359% )
25035 kmem:mm_page_alloc ( +- 3.783% )
6104 kmem:mm_pagevec_free ( +- 0.934% )
18376 kmem:mm_page_free_direct ( +- 4.941% )
6104 kmem:mm_page_free_batched ( +- 0.934% )
18376 kmem:mm_page_free ( +- 4.941% )

0.643954516 seconds time elapsed ( +- 2.363% )

Expand Down Expand Up @@ -158,31 +158,31 @@ Or you can observe the whole system's page allocations for 10
seconds:

titan:~/git> perf stat -a -e kmem:mm_page_pcpu_drain -e
kmem:mm_page_alloc -e kmem:mm_pagevec_free -e
kmem:mm_page_free_direct sleep 10
kmem:mm_page_alloc -e kmem:mm_page_free_batched -e
kmem:mm_page_free sleep 10

Performance counter stats for 'sleep 10':

171585 kmem:mm_page_pcpu_drain
322114 kmem:mm_page_alloc
73623 kmem:mm_pagevec_free
254115 kmem:mm_page_free_direct
73623 kmem:mm_page_free_batched
254115 kmem:mm_page_free

10.000591410 seconds time elapsed

Or observe how fluctuating the page allocations are, via statistical
analysis done over ten 1-second intervals:

titan:~/git> perf stat --repeat 10 -a -e kmem:mm_page_pcpu_drain -e
kmem:mm_page_alloc -e kmem:mm_pagevec_free -e
kmem:mm_page_free_direct sleep 1
kmem:mm_page_alloc -e kmem:mm_page_free_batched -e
kmem:mm_page_free sleep 1

Performance counter stats for 'sleep 1' (10 runs):

17254 kmem:mm_page_pcpu_drain ( +- 3.709% )
34394 kmem:mm_page_alloc ( +- 4.617% )
7509 kmem:mm_pagevec_free ( +- 4.820% )
25653 kmem:mm_page_free_direct ( +- 3.672% )
7509 kmem:mm_page_free_batched ( +- 4.820% )
25653 kmem:mm_page_free ( +- 3.672% )

1.058135029 seconds time elapsed ( +- 3.089% )

Expand Down

0 comments on commit 90a5d5a

Please sign in to comment.