@@ -1864,7 +1864,7 @@ A histogram can now be defined for the new synthetic event::
1864
1864
The above shows the latency "lat" in a power of 2 grouping.
1865
1865
1866
1866
Like 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::
1868
1868
1869
1869
# cat /sys/kernel/debug/tracing/events/synthetic/wakeup_latency/hist
1870
1870
@@ -1911,7 +1911,7 @@ output can be displayed by reading the event's 'hist' file.
1911
1911
1912
1912
1913
1913
The 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)::
1915
1915
1916
1916
# echo 'hist:keys=pid,prio,lat.buckets=10:sort=lat' >> \
1917
1917
/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).
1945
1945
1946
1946
To save stacktraces, create a synthetic event with a field of type "unsigned long[]"
1947
1947
or even just "long[]". For example, to see how long a task is blocked in an
1948
- uninterruptible state:
1948
+ uninterruptible state::
1949
1949
1950
1950
# cd /sys/kernel/tracing
1951
1951
# echo 's:block_lat pid_t pid; u64 delta; unsigned long[] stack;' > dynamic_events
@@ -1990,7 +1990,8 @@ uninterruptible state:
1990
1990
=> kthread+0xe9/0x110
1991
1991
=> ret_from_fork+0x2c/0x50
1992
1992
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::
1994
1995
1995
1996
# echo 'hist:delta.buckets=100,stack.stacktrace:sort=delta' > events/synthetic/block_lat/trigger
1996
1997
# cat events/synthetic/block_lat/hist
@@ -2183,11 +2184,11 @@ The following commonly-used handler.action pairs are available:
2183
2184
wakeup_new_test($testpid) if comm=="cyclictest"' >> \
2184
2185
/sys/kernel/debug/tracing/events/sched/sched_wakeup_new/trigger
2185
2186
2186
- Or, equivalently, using the 'trace' keyword syntax:
2187
+ Or, equivalently, using the 'trace' keyword syntax::
2187
2188
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
2191
2192
2192
2193
Creating and displaying a histogram based on those events is now
2193
2194
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:
2320
2321
resulting latency, stored in wakeup_lat, exceeds the current
2321
2322
maximum latency, a snapshot is taken. As part of the setup, all
2322
2323
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::
2324
2325
2325
- # echo 1 > /sys/kernel/debug/tracing/events/sched/enable
2326
+ # echo 1 > /sys/kernel/debug/tracing/events/sched/enable
2326
2327
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
2330
2331
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
2336
2337
2337
2338
When the histogram is displayed, for each bucket the max value
2338
2339
and the saved values corresponding to the max are displayed
2339
2340
following the rest of the fields.
2340
2341
2341
2342
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::
2343
2344
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
2348
2349
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
2352
2353
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
2356
2357
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 }
2360
2361
2361
- Totals:
2362
- Hits: 3508
2363
- Entries: 3
2364
- Dropped: 0
2362
+ Totals:
2363
+ Hits: 3508
2364
+ Entries: 3
2365
+ Dropped: 0
2365
2366
2366
2367
In the above case, the event that triggered the global maximum has
2367
2368
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:
2439
2440
$cwnd variable. If the value has changed, a snapshot is taken.
2440
2441
As part of the setup, all the scheduler and tcp events are also
2441
2442
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::
2443
2444
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
2446
2447
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
2451
2452
2452
2453
When the histogram is displayed, for each bucket the tracked value
2453
2454
and the saved values corresponding to that value are displayed
@@ -2470,10 +2471,10 @@ The following commonly-used handler.action pairs are available:
2470
2471
{ dport: 443 } hitcount: 211
2471
2472
changed: 10 snd_wnd: 26960 srtt: 17379 rcv_wnd: 28800
2472
2473
2473
- Snapshot taken (see tracing/snapshot). Details: :
2474
+ Snapshot taken (see tracing/snapshot). Details:
2474
2475
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 }
2477
2478
2478
2479
Totals:
2479
2480
Hits: 414
0 commit comments