@@ -1864,7 +1864,7 @@ A histogram can now be defined for the new synthetic event::
18641864The above shows the latency "lat" in a power of 2 grouping.
18651865
18661866Like any other event, once a histogram is enabled for the event, the
1867- output can be displayed by reading the event's 'hist' file.
1867+ output can be displayed by reading the event's 'hist' file::
18681868
18691869 # cat /sys/kernel/debug/tracing/events/synthetic/wakeup_latency/hist
18701870
@@ -1911,7 +1911,7 @@ output can be displayed by reading the event's 'hist' file.
19111911
19121912
19131913The latency values can also be grouped linearly by a given size with
1914- the ".buckets" modifier and specify a size (in this case groups of 10).
1914+ the ".buckets" modifier and specify a size (in this case groups of 10)::
19151915
19161916 # echo 'hist:keys=pid,prio,lat.buckets=10:sort=lat' >> \
19171917 /sys/kernel/debug/tracing/events/synthetic/wakeup_latency/trigger
@@ -1945,7 +1945,7 @@ the ".buckets" modifier and specify a size (in this case groups of 10).
19451945
19461946To save stacktraces, create a synthetic event with a field of type "unsigned long[]"
19471947or even just "long[]". For example, to see how long a task is blocked in an
1948- uninterruptible state:
1948+ uninterruptible state::
19491949
19501950 # cd /sys/kernel/tracing
19511951 # echo 's:block_lat pid_t pid; u64 delta; unsigned long[] stack;' > dynamic_events
@@ -1990,7 +1990,8 @@ uninterruptible state:
19901990 => kthread+0xe9/0x110
19911991 => ret_from_fork+0x2c/0x50
19921992
1993- A synthetic event that has a stacktrace field may use it as a key in histogram:
1993+ A synthetic event that has a stacktrace field may use it as a key in
1994+ histogram::
19941995
19951996 # echo 'hist:delta.buckets=100,stack.stacktrace:sort=delta' > events/synthetic/block_lat/trigger
19961997 # cat events/synthetic/block_lat/hist
@@ -2183,11 +2184,11 @@ The following commonly-used handler.action pairs are available:
21832184 wakeup_new_test($testpid) if comm=="cyclictest"' >> \
21842185 /sys/kernel/debug/tracing/events/sched/sched_wakeup_new/trigger
21852186
2186- Or, equivalently, using the 'trace' keyword syntax:
2187+ Or, equivalently, using the 'trace' keyword syntax::
21872188
2188- # echo 'hist:keys=$testpid:testpid=pid: onmatch(sched.sched_wakeup_new).\
2189- trace(wakeup_new_test,$testpid) if comm=="cyclictest"' >> \
2190- /sys/kernel/debug/tracing/events/sched/sched_wakeup_new/trigger
2189+ # echo 'hist:keys=$testpid:testpid=pid:onmatch(sched.sched_wakeup_new).\
2190+ trace(wakeup_new_test,$testpid) if comm=="cyclictest"' >> \
2191+ /sys/kernel/debug/tracing/events/sched/sched_wakeup_new/trigger
21912192
21922193 Creating and displaying a histogram based on those events is now
21932194 just a matter of using the fields and new synthetic event in the
@@ -2320,48 +2321,48 @@ The following commonly-used handler.action pairs are available:
23202321 resulting latency, stored in wakeup_lat, exceeds the current
23212322 maximum latency, a snapshot is taken. As part of the setup, all
23222323 the scheduler events are also enabled, which are the events that
2323- will show up in the snapshot when it is taken at some point:
2324+ will show up in the snapshot when it is taken at some point::
23242325
2325- # echo 1 > /sys/kernel/debug/tracing/events/sched/enable
2326+ # echo 1 > /sys/kernel/debug/tracing/events/sched/enable
23262327
2327- # echo 'hist:keys=pid: ts0=common_timestamp.usecs \
2328- if comm=="cyclictest"' >> \
2329- /sys/kernel/debug/tracing/events/sched/sched_waking/trigger
2328+ # echo 'hist:keys=pid:ts0=common_timestamp.usecs \
2329+ if comm=="cyclictest"' >> \
2330+ /sys/kernel/debug/tracing/events/sched/sched_waking/trigger
23302331
2331- # echo 'hist:keys=next_pid: wakeup_lat=common_timestamp.usecs-$ts0: \
2332- onmax($wakeup_lat).save(next_prio,next_comm,prev_pid,prev_prio, \
2333- prev_comm):onmax($wakeup_lat).snapshot() \
2334- if next_comm=="cyclictest"' >> \
2335- /sys/kernel/debug/tracing/events/sched/sched_switch/trigger
2332+ # echo 'hist:keys=next_pid:wakeup_lat=common_timestamp.usecs-$ts0: \
2333+ onmax($wakeup_lat).save(next_prio,next_comm,prev_pid,prev_prio, \
2334+ prev_comm):onmax($wakeup_lat).snapshot() \
2335+ if next_comm=="cyclictest"' >> \
2336+ /sys/kernel/debug/tracing/events/sched/sched_switch/trigger
23362337
23372338 When the histogram is displayed, for each bucket the max value
23382339 and the saved values corresponding to the max are displayed
23392340 following the rest of the fields.
23402341
23412342 If a snapshot was taken, there is also a message indicating that,
2342- along with the value and event that triggered the global maximum:
2343+ along with the value and event that triggered the global maximum::
23432344
2344- # cat /sys/kernel/debug/tracing/events/sched/sched_switch/hist
2345- { next_pid: 2101 } hitcount: 200
2346- max: 52 next_prio: 120 next_comm: cyclictest \
2347- prev_pid: 0 prev_prio: 120 prev_comm: swapper/6
2345+ # cat /sys/kernel/debug/tracing/events/sched/sched_switch/hist
2346+ { next_pid: 2101 } hitcount: 200
2347+ max: 52 next_prio: 120 next_comm: cyclictest \
2348+ prev_pid: 0 prev_prio: 120 prev_comm: swapper/6
23482349
2349- { next_pid: 2103 } hitcount: 1326
2350- max: 572 next_prio: 19 next_comm: cyclictest \
2351- prev_pid: 0 prev_prio: 120 prev_comm: swapper/1
2350+ { next_pid: 2103 } hitcount: 1326
2351+ max: 572 next_prio: 19 next_comm: cyclictest \
2352+ prev_pid: 0 prev_prio: 120 prev_comm: swapper/1
23522353
2353- { next_pid: 2102 } hitcount: 1982 \
2354- max: 74 next_prio: 19 next_comm: cyclictest \
2355- prev_pid: 0 prev_prio: 120 prev_comm: swapper/5
2354+ { next_pid: 2102 } hitcount: 1982 \
2355+ max: 74 next_prio: 19 next_comm: cyclictest \
2356+ prev_pid: 0 prev_prio: 120 prev_comm: swapper/5
23562357
2357- Snapshot taken (see tracing/snapshot). Details:
2358- triggering value { onmax($wakeup_lat) }: 572 \
2359- triggered by event with key: { next_pid: 2103 }
2358+ Snapshot taken (see tracing/snapshot). Details:
2359+ triggering value { onmax($wakeup_lat) }: 572 \
2360+ triggered by event with key: { next_pid: 2103 }
23602361
2361- Totals:
2362- Hits: 3508
2363- Entries: 3
2364- Dropped: 0
2362+ Totals:
2363+ Hits: 3508
2364+ Entries: 3
2365+ Dropped: 0
23652366
23662367 In the above case, the event that triggered the global maximum has
23672368 the key with next_pid == 2103. If you look at the bucket that has
@@ -2439,15 +2440,15 @@ The following commonly-used handler.action pairs are available:
24392440 $cwnd variable. If the value has changed, a snapshot is taken.
24402441 As part of the setup, all the scheduler and tcp events are also
24412442 enabled, which are the events that will show up in the snapshot
2442- when it is taken at some point:
2443+ when it is taken at some point::
24432444
2444- # echo 1 > /sys/kernel/debug/tracing/events/sched/enable
2445- # echo 1 > /sys/kernel/debug/tracing/events/tcp/enable
2445+ # echo 1 > /sys/kernel/debug/tracing/events/sched/enable
2446+ # echo 1 > /sys/kernel/debug/tracing/events/tcp/enable
24462447
2447- # echo 'hist:keys=dport: cwnd=snd_cwnd: \
2448- onchange($cwnd).save(snd_wnd,srtt,rcv_wnd): \
2449- onchange($cwnd).snapshot()' >> \
2450- /sys/kernel/debug/tracing/events/tcp/tcp_probe/trigger
2448+ # echo 'hist:keys=dport:cwnd=snd_cwnd: \
2449+ onchange($cwnd).save(snd_wnd,srtt,rcv_wnd): \
2450+ onchange($cwnd).snapshot()' >> \
2451+ /sys/kernel/debug/tracing/events/tcp/tcp_probe/trigger
24512452
24522453 When the histogram is displayed, for each bucket the tracked value
24532454 and the saved values corresponding to that value are displayed
@@ -2470,10 +2471,10 @@ The following commonly-used handler.action pairs are available:
24702471 { dport: 443 } hitcount: 211
24712472 changed: 10 snd_wnd: 26960 srtt: 17379 rcv_wnd: 28800
24722473
2473- Snapshot taken (see tracing/snapshot). Details: :
2474+ Snapshot taken (see tracing/snapshot). Details:
24742475
2475- triggering value { onchange($cwnd) }: 10
2476- triggered by event with key: { dport: 80 }
2476+ triggering value { onchange($cwnd) }: 10
2477+ triggered by event with key: { dport: 80 }
24772478
24782479 Totals:
24792480 Hits: 414
0 commit comments