@@ -35,7 +35,7 @@ Documentation written by Tom Zanussi
3535 in place of an explicit value field - this is simply a count of
3636 event hits. If 'values' isn't specified, an implicit 'hitcount'
3737 value will be automatically created and used as the only value.
38- Keys can be any field, or the special string 'stacktrace ', which
38+ Keys can be any field, or the special string 'common_stacktrace ', which
3939 will use the event's kernel stacktrace as the key. The keywords
4040 'keys' or 'key' can be used to specify keys, and the keywords
4141 'values', 'vals', or 'val' can be used to specify values. Compound
@@ -54,7 +54,7 @@ Documentation written by Tom Zanussi
5454 'compatible' if the fields named in the trigger share the same
5555 number and type of fields and those fields also have the same names.
5656 Note that any two events always share the compatible 'hitcount' and
57- 'stacktrace ' fields and can therefore be combined using those
57+ 'common_stacktrace ' fields and can therefore be combined using those
5858 fields, however pointless that may be.
5959
6060 'hist' triggers add a 'hist' file to each event's subdirectory.
@@ -547,9 +547,9 @@ Extended error information
547547 the hist trigger display symbolic call_sites, we can have the hist
548548 trigger additionally display the complete set of kernel stack traces
549549 that led to each call_site. To do that, we simply use the special
550- value 'stacktrace ' for the key parameter::
550+ value 'common_stacktrace ' for the key parameter::
551551
552- # echo 'hist:keys=stacktrace :values=bytes_req,bytes_alloc:sort=bytes_alloc' > \
552+ # echo 'hist:keys=common_stacktrace :values=bytes_req,bytes_alloc:sort=bytes_alloc' > \
553553 /sys/kernel/tracing/events/kmem/kmalloc/trigger
554554
555555 The above trigger will use the kernel stack trace in effect when an
@@ -561,9 +561,9 @@ Extended error information
561561 every callpath to a kmalloc for a kernel compile)::
562562
563563 # cat /sys/kernel/tracing/events/kmem/kmalloc/hist
564- # trigger info: hist:keys=stacktrace :vals=bytes_req,bytes_alloc:sort=bytes_alloc:size=2048 [active]
564+ # trigger info: hist:keys=common_stacktrace :vals=bytes_req,bytes_alloc:sort=bytes_alloc:size=2048 [active]
565565
566- { stacktrace :
566+ { common_stacktrace :
567567 __kmalloc_track_caller+0x10b/0x1a0
568568 kmemdup+0x20/0x50
569569 hidraw_report_event+0x8a/0x120 [hid]
@@ -581,7 +581,7 @@ Extended error information
581581 cpu_startup_entry+0x315/0x3e0
582582 rest_init+0x7c/0x80
583583 } hitcount: 3 bytes_req: 21 bytes_alloc: 24
584- { stacktrace :
584+ { common_stacktrace :
585585 __kmalloc_track_caller+0x10b/0x1a0
586586 kmemdup+0x20/0x50
587587 hidraw_report_event+0x8a/0x120 [hid]
@@ -596,7 +596,7 @@ Extended error information
596596 do_IRQ+0x5a/0xf0
597597 ret_from_intr+0x0/0x30
598598 } hitcount: 3 bytes_req: 21 bytes_alloc: 24
599- { stacktrace :
599+ { common_stacktrace :
600600 kmem_cache_alloc_trace+0xeb/0x150
601601 aa_alloc_task_context+0x27/0x40
602602 apparmor_cred_prepare+0x1f/0x50
@@ -608,15 +608,15 @@ Extended error information
608608 .
609609 .
610610 .
611- { stacktrace :
611+ { common_stacktrace :
612612 __kmalloc+0x11b/0x1b0
613613 i915_gem_execbuffer2+0x6c/0x2c0 [i915]
614614 drm_ioctl+0x349/0x670 [drm]
615615 do_vfs_ioctl+0x2f0/0x4f0
616616 SyS_ioctl+0x81/0xa0
617617 system_call_fastpath+0x12/0x6a
618618 } hitcount: 17726 bytes_req: 13944120 bytes_alloc: 19593808
619- { stacktrace :
619+ { common_stacktrace :
620620 __kmalloc+0x11b/0x1b0
621621 load_elf_phdrs+0x76/0xa0
622622 load_elf_binary+0x102/0x1650
@@ -625,7 +625,7 @@ Extended error information
625625 SyS_execve+0x3a/0x50
626626 return_from_execve+0x0/0x23
627627 } hitcount: 33348 bytes_req: 17152128 bytes_alloc: 20226048
628- { stacktrace :
628+ { common_stacktrace :
629629 kmem_cache_alloc_trace+0xeb/0x150
630630 apparmor_file_alloc_security+0x27/0x40
631631 security_file_alloc+0x16/0x20
@@ -636,7 +636,7 @@ Extended error information
636636 SyS_open+0x1e/0x20
637637 system_call_fastpath+0x12/0x6a
638638 } hitcount: 4766422 bytes_req: 9532844 bytes_alloc: 38131376
639- { stacktrace :
639+ { common_stacktrace :
640640 __kmalloc+0x11b/0x1b0
641641 seq_buf_alloc+0x1b/0x50
642642 seq_read+0x2cc/0x370
@@ -1026,7 +1026,7 @@ Extended error information
10261026 First we set up an initially paused stacktrace trigger on the
10271027 netif_receive_skb event::
10281028
1029- # echo 'hist:key=stacktrace :vals=len:pause' > \
1029+ # echo 'hist:key=common_stacktrace :vals=len:pause' > \
10301030 /sys/kernel/tracing/events/net/netif_receive_skb/trigger
10311031
10321032 Next, we set up an 'enable_hist' trigger on the sched_process_exec
@@ -1060,9 +1060,9 @@ Extended error information
10601060 $ wget https://www.kernel.org/pub/linux/kernel/v3.x/patch-3.19.xz
10611061
10621062 # cat /sys/kernel/tracing/events/net/netif_receive_skb/hist
1063- # trigger info: hist:keys=stacktrace :vals=len:sort=hitcount:size=2048 [paused]
1063+ # trigger info: hist:keys=common_stacktrace :vals=len:sort=hitcount:size=2048 [paused]
10641064
1065- { stacktrace :
1065+ { common_stacktrace :
10661066 __netif_receive_skb_core+0x46d/0x990
10671067 __netif_receive_skb+0x18/0x60
10681068 netif_receive_skb_internal+0x23/0x90
@@ -1079,7 +1079,7 @@ Extended error information
10791079 kthread+0xd2/0xf0
10801080 ret_from_fork+0x42/0x70
10811081 } hitcount: 85 len: 28884
1082- { stacktrace :
1082+ { common_stacktrace :
10831083 __netif_receive_skb_core+0x46d/0x990
10841084 __netif_receive_skb+0x18/0x60
10851085 netif_receive_skb_internal+0x23/0x90
@@ -1097,7 +1097,7 @@ Extended error information
10971097 irq_thread+0x11f/0x150
10981098 kthread+0xd2/0xf0
10991099 } hitcount: 98 len: 664329
1100- { stacktrace :
1100+ { common_stacktrace :
11011101 __netif_receive_skb_core+0x46d/0x990
11021102 __netif_receive_skb+0x18/0x60
11031103 process_backlog+0xa8/0x150
@@ -1115,7 +1115,7 @@ Extended error information
11151115 inet_sendmsg+0x64/0xa0
11161116 sock_sendmsg+0x3d/0x50
11171117 } hitcount: 115 len: 13030
1118- { stacktrace :
1118+ { common_stacktrace :
11191119 __netif_receive_skb_core+0x46d/0x990
11201120 __netif_receive_skb+0x18/0x60
11211121 netif_receive_skb_internal+0x23/0x90
@@ -1142,14 +1142,14 @@ Extended error information
11421142 into the histogram. In order to avoid having to set everything up
11431143 again, we can just clear the histogram first::
11441144
1145- # echo 'hist:key=stacktrace :vals=len:clear' >> \
1145+ # echo 'hist:key=common_stacktrace :vals=len:clear' >> \
11461146 /sys/kernel/tracing/events/net/netif_receive_skb/trigger
11471147
11481148 Just to verify that it is in fact cleared, here's what we now see in
11491149 the hist file::
11501150
11511151 # cat /sys/kernel/tracing/events/net/netif_receive_skb/hist
1152- # trigger info: hist:keys=stacktrace :vals=len:sort=hitcount:size=2048 [paused]
1152+ # trigger info: hist:keys=common_stacktrace :vals=len:sort=hitcount:size=2048 [paused]
11531153
11541154 Totals:
11551155 Hits: 0
@@ -1485,12 +1485,12 @@ Extended error information
14851485
14861486 And here's an example that shows how to combine histogram data from
14871487 any two events even if they don't share any 'compatible' fields
1488- other than 'hitcount' and 'stacktrace '. These commands create a
1488+ other than 'hitcount' and 'common_stacktrace '. These commands create a
14891489 couple of triggers named 'bar' using those fields::
14901490
1491- # echo 'hist:name=bar:key=stacktrace :val=hitcount' > \
1491+ # echo 'hist:name=bar:key=common_stacktrace :val=hitcount' > \
14921492 /sys/kernel/tracing/events/sched/sched_process_fork/trigger
1493- # echo 'hist:name=bar:key=stacktrace :val=hitcount' > \
1493+ # echo 'hist:name=bar:key=common_stacktrace :val=hitcount' > \
14941494 /sys/kernel/tracing/events/net/netif_rx/trigger
14951495
14961496 And displaying the output of either shows some interesting if
@@ -1501,16 +1501,16 @@ Extended error information
15011501
15021502 # event histogram
15031503 #
1504- # trigger info: hist:name=bar:keys=stacktrace :vals=hitcount:sort=hitcount:size=2048 [active]
1504+ # trigger info: hist:name=bar:keys=common_stacktrace :vals=hitcount:sort=hitcount:size=2048 [active]
15051505 #
15061506
1507- { stacktrace :
1507+ { common_stacktrace :
15081508 kernel_clone+0x18e/0x330
15091509 kernel_thread+0x29/0x30
15101510 kthreadd+0x154/0x1b0
15111511 ret_from_fork+0x3f/0x70
15121512 } hitcount: 1
1513- { stacktrace :
1513+ { common_stacktrace :
15141514 netif_rx_internal+0xb2/0xd0
15151515 netif_rx_ni+0x20/0x70
15161516 dev_loopback_xmit+0xaa/0xd0
@@ -1528,7 +1528,7 @@ Extended error information
15281528 call_cpuidle+0x3b/0x60
15291529 cpu_startup_entry+0x22d/0x310
15301530 } hitcount: 1
1531- { stacktrace :
1531+ { common_stacktrace :
15321532 netif_rx_internal+0xb2/0xd0
15331533 netif_rx_ni+0x20/0x70
15341534 dev_loopback_xmit+0xaa/0xd0
@@ -1543,7 +1543,7 @@ Extended error information
15431543 SyS_sendto+0xe/0x10
15441544 entry_SYSCALL_64_fastpath+0x12/0x6a
15451545 } hitcount: 2
1546- { stacktrace :
1546+ { common_stacktrace :
15471547 netif_rx_internal+0xb2/0xd0
15481548 netif_rx+0x1c/0x60
15491549 loopback_xmit+0x6c/0xb0
@@ -1561,7 +1561,7 @@ Extended error information
15611561 sock_sendmsg+0x38/0x50
15621562 ___sys_sendmsg+0x14e/0x270
15631563 } hitcount: 76
1564- { stacktrace :
1564+ { common_stacktrace :
15651565 netif_rx_internal+0xb2/0xd0
15661566 netif_rx+0x1c/0x60
15671567 loopback_xmit+0x6c/0xb0
@@ -1579,7 +1579,7 @@ Extended error information
15791579 sock_sendmsg+0x38/0x50
15801580 ___sys_sendmsg+0x269/0x270
15811581 } hitcount: 77
1582- { stacktrace :
1582+ { common_stacktrace :
15831583 netif_rx_internal+0xb2/0xd0
15841584 netif_rx+0x1c/0x60
15851585 loopback_xmit+0x6c/0xb0
@@ -1597,7 +1597,7 @@ Extended error information
15971597 sock_sendmsg+0x38/0x50
15981598 SYSC_sendto+0xef/0x170
15991599 } hitcount: 88
1600- { stacktrace :
1600+ { common_stacktrace :
16011601 kernel_clone+0x18e/0x330
16021602 SyS_clone+0x19/0x20
16031603 entry_SYSCALL_64_fastpath+0x12/0x6a
@@ -1949,7 +1949,7 @@ uninterruptible state::
19491949
19501950 # cd /sys/kernel/tracing
19511951 # echo 's:block_lat pid_t pid; u64 delta; unsigned long[] stack;' > dynamic_events
1952- # echo 'hist:keys=next_pid:ts=common_timestamp.usecs,st=stacktrace if prev_state == 2' >> events/sched/sched_switch/trigger
1952+ # echo 'hist:keys=next_pid:ts=common_timestamp.usecs,st=common_stacktrace if prev_state == 2' >> events/sched/sched_switch/trigger
19531953 # echo 'hist:keys=prev_pid:delta=common_timestamp.usecs-$ts,s=$st:onmax($delta).trace(block_lat,prev_pid,$delta,$s)' >> events/sched/sched_switch/trigger
19541954 # echo 1 > events/synthetic/block_lat/enable
19551955 # cat trace
0 commit comments