@@ -35,7 +35,7 @@ Documentation written by Tom Zanussi
35
35
in place of an explicit value field - this is simply a count of
36
36
event hits. If 'values' isn't specified, an implicit 'hitcount'
37
37
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
39
39
will use the event's kernel stacktrace as the key. The keywords
40
40
'keys' or 'key' can be used to specify keys, and the keywords
41
41
'values', 'vals', or 'val' can be used to specify values. Compound
@@ -54,7 +54,7 @@ Documentation written by Tom Zanussi
54
54
'compatible' if the fields named in the trigger share the same
55
55
number and type of fields and those fields also have the same names.
56
56
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
58
58
fields, however pointless that may be.
59
59
60
60
'hist' triggers add a 'hist' file to each event's subdirectory.
@@ -547,9 +547,9 @@ Extended error information
547
547
the hist trigger display symbolic call_sites, we can have the hist
548
548
trigger additionally display the complete set of kernel stack traces
549
549
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::
551
551
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' > \
553
553
/sys/kernel/tracing/events/kmem/kmalloc/trigger
554
554
555
555
The above trigger will use the kernel stack trace in effect when an
@@ -561,9 +561,9 @@ Extended error information
561
561
every callpath to a kmalloc for a kernel compile)::
562
562
563
563
# 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]
565
565
566
- { stacktrace :
566
+ { common_stacktrace :
567
567
__kmalloc_track_caller+0x10b/0x1a0
568
568
kmemdup+0x20/0x50
569
569
hidraw_report_event+0x8a/0x120 [hid]
@@ -581,7 +581,7 @@ Extended error information
581
581
cpu_startup_entry+0x315/0x3e0
582
582
rest_init+0x7c/0x80
583
583
} hitcount: 3 bytes_req: 21 bytes_alloc: 24
584
- { stacktrace :
584
+ { common_stacktrace :
585
585
__kmalloc_track_caller+0x10b/0x1a0
586
586
kmemdup+0x20/0x50
587
587
hidraw_report_event+0x8a/0x120 [hid]
@@ -596,7 +596,7 @@ Extended error information
596
596
do_IRQ+0x5a/0xf0
597
597
ret_from_intr+0x0/0x30
598
598
} hitcount: 3 bytes_req: 21 bytes_alloc: 24
599
- { stacktrace :
599
+ { common_stacktrace :
600
600
kmem_cache_alloc_trace+0xeb/0x150
601
601
aa_alloc_task_context+0x27/0x40
602
602
apparmor_cred_prepare+0x1f/0x50
@@ -608,15 +608,15 @@ Extended error information
608
608
.
609
609
.
610
610
.
611
- { stacktrace :
611
+ { common_stacktrace :
612
612
__kmalloc+0x11b/0x1b0
613
613
i915_gem_execbuffer2+0x6c/0x2c0 [i915]
614
614
drm_ioctl+0x349/0x670 [drm]
615
615
do_vfs_ioctl+0x2f0/0x4f0
616
616
SyS_ioctl+0x81/0xa0
617
617
system_call_fastpath+0x12/0x6a
618
618
} hitcount: 17726 bytes_req: 13944120 bytes_alloc: 19593808
619
- { stacktrace :
619
+ { common_stacktrace :
620
620
__kmalloc+0x11b/0x1b0
621
621
load_elf_phdrs+0x76/0xa0
622
622
load_elf_binary+0x102/0x1650
@@ -625,7 +625,7 @@ Extended error information
625
625
SyS_execve+0x3a/0x50
626
626
return_from_execve+0x0/0x23
627
627
} hitcount: 33348 bytes_req: 17152128 bytes_alloc: 20226048
628
- { stacktrace :
628
+ { common_stacktrace :
629
629
kmem_cache_alloc_trace+0xeb/0x150
630
630
apparmor_file_alloc_security+0x27/0x40
631
631
security_file_alloc+0x16/0x20
@@ -636,7 +636,7 @@ Extended error information
636
636
SyS_open+0x1e/0x20
637
637
system_call_fastpath+0x12/0x6a
638
638
} hitcount: 4766422 bytes_req: 9532844 bytes_alloc: 38131376
639
- { stacktrace :
639
+ { common_stacktrace :
640
640
__kmalloc+0x11b/0x1b0
641
641
seq_buf_alloc+0x1b/0x50
642
642
seq_read+0x2cc/0x370
@@ -1026,7 +1026,7 @@ Extended error information
1026
1026
First we set up an initially paused stacktrace trigger on the
1027
1027
netif_receive_skb event::
1028
1028
1029
- # echo 'hist:key=stacktrace :vals=len:pause' > \
1029
+ # echo 'hist:key=common_stacktrace :vals=len:pause' > \
1030
1030
/sys/kernel/tracing/events/net/netif_receive_skb/trigger
1031
1031
1032
1032
Next, we set up an 'enable_hist' trigger on the sched_process_exec
@@ -1060,9 +1060,9 @@ Extended error information
1060
1060
$ wget https://www.kernel.org/pub/linux/kernel/v3.x/patch-3.19.xz
1061
1061
1062
1062
# 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]
1064
1064
1065
- { stacktrace :
1065
+ { common_stacktrace :
1066
1066
__netif_receive_skb_core+0x46d/0x990
1067
1067
__netif_receive_skb+0x18/0x60
1068
1068
netif_receive_skb_internal+0x23/0x90
@@ -1079,7 +1079,7 @@ Extended error information
1079
1079
kthread+0xd2/0xf0
1080
1080
ret_from_fork+0x42/0x70
1081
1081
} hitcount: 85 len: 28884
1082
- { stacktrace :
1082
+ { common_stacktrace :
1083
1083
__netif_receive_skb_core+0x46d/0x990
1084
1084
__netif_receive_skb+0x18/0x60
1085
1085
netif_receive_skb_internal+0x23/0x90
@@ -1097,7 +1097,7 @@ Extended error information
1097
1097
irq_thread+0x11f/0x150
1098
1098
kthread+0xd2/0xf0
1099
1099
} hitcount: 98 len: 664329
1100
- { stacktrace :
1100
+ { common_stacktrace :
1101
1101
__netif_receive_skb_core+0x46d/0x990
1102
1102
__netif_receive_skb+0x18/0x60
1103
1103
process_backlog+0xa8/0x150
@@ -1115,7 +1115,7 @@ Extended error information
1115
1115
inet_sendmsg+0x64/0xa0
1116
1116
sock_sendmsg+0x3d/0x50
1117
1117
} hitcount: 115 len: 13030
1118
- { stacktrace :
1118
+ { common_stacktrace :
1119
1119
__netif_receive_skb_core+0x46d/0x990
1120
1120
__netif_receive_skb+0x18/0x60
1121
1121
netif_receive_skb_internal+0x23/0x90
@@ -1142,14 +1142,14 @@ Extended error information
1142
1142
into the histogram. In order to avoid having to set everything up
1143
1143
again, we can just clear the histogram first::
1144
1144
1145
- # echo 'hist:key=stacktrace :vals=len:clear' >> \
1145
+ # echo 'hist:key=common_stacktrace :vals=len:clear' >> \
1146
1146
/sys/kernel/tracing/events/net/netif_receive_skb/trigger
1147
1147
1148
1148
Just to verify that it is in fact cleared, here's what we now see in
1149
1149
the hist file::
1150
1150
1151
1151
# 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]
1153
1153
1154
1154
Totals:
1155
1155
Hits: 0
@@ -1485,12 +1485,12 @@ Extended error information
1485
1485
1486
1486
And here's an example that shows how to combine histogram data from
1487
1487
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
1489
1489
couple of triggers named 'bar' using those fields::
1490
1490
1491
- # echo 'hist:name=bar:key=stacktrace :val=hitcount' > \
1491
+ # echo 'hist:name=bar:key=common_stacktrace :val=hitcount' > \
1492
1492
/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' > \
1494
1494
/sys/kernel/tracing/events/net/netif_rx/trigger
1495
1495
1496
1496
And displaying the output of either shows some interesting if
@@ -1501,16 +1501,16 @@ Extended error information
1501
1501
1502
1502
# event histogram
1503
1503
#
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]
1505
1505
#
1506
1506
1507
- { stacktrace :
1507
+ { common_stacktrace :
1508
1508
kernel_clone+0x18e/0x330
1509
1509
kernel_thread+0x29/0x30
1510
1510
kthreadd+0x154/0x1b0
1511
1511
ret_from_fork+0x3f/0x70
1512
1512
} hitcount: 1
1513
- { stacktrace :
1513
+ { common_stacktrace :
1514
1514
netif_rx_internal+0xb2/0xd0
1515
1515
netif_rx_ni+0x20/0x70
1516
1516
dev_loopback_xmit+0xaa/0xd0
@@ -1528,7 +1528,7 @@ Extended error information
1528
1528
call_cpuidle+0x3b/0x60
1529
1529
cpu_startup_entry+0x22d/0x310
1530
1530
} hitcount: 1
1531
- { stacktrace :
1531
+ { common_stacktrace :
1532
1532
netif_rx_internal+0xb2/0xd0
1533
1533
netif_rx_ni+0x20/0x70
1534
1534
dev_loopback_xmit+0xaa/0xd0
@@ -1543,7 +1543,7 @@ Extended error information
1543
1543
SyS_sendto+0xe/0x10
1544
1544
entry_SYSCALL_64_fastpath+0x12/0x6a
1545
1545
} hitcount: 2
1546
- { stacktrace :
1546
+ { common_stacktrace :
1547
1547
netif_rx_internal+0xb2/0xd0
1548
1548
netif_rx+0x1c/0x60
1549
1549
loopback_xmit+0x6c/0xb0
@@ -1561,7 +1561,7 @@ Extended error information
1561
1561
sock_sendmsg+0x38/0x50
1562
1562
___sys_sendmsg+0x14e/0x270
1563
1563
} hitcount: 76
1564
- { stacktrace :
1564
+ { common_stacktrace :
1565
1565
netif_rx_internal+0xb2/0xd0
1566
1566
netif_rx+0x1c/0x60
1567
1567
loopback_xmit+0x6c/0xb0
@@ -1579,7 +1579,7 @@ Extended error information
1579
1579
sock_sendmsg+0x38/0x50
1580
1580
___sys_sendmsg+0x269/0x270
1581
1581
} hitcount: 77
1582
- { stacktrace :
1582
+ { common_stacktrace :
1583
1583
netif_rx_internal+0xb2/0xd0
1584
1584
netif_rx+0x1c/0x60
1585
1585
loopback_xmit+0x6c/0xb0
@@ -1597,7 +1597,7 @@ Extended error information
1597
1597
sock_sendmsg+0x38/0x50
1598
1598
SYSC_sendto+0xef/0x170
1599
1599
} hitcount: 88
1600
- { stacktrace :
1600
+ { common_stacktrace :
1601
1601
kernel_clone+0x18e/0x330
1602
1602
SyS_clone+0x19/0x20
1603
1603
entry_SYSCALL_64_fastpath+0x12/0x6a
@@ -1949,7 +1949,7 @@ 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
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
1953
1953
# 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
1954
1954
# echo 1 > events/synthetic/block_lat/enable
1955
1955
# cat trace
0 commit comments