• Home
  • Raw
  • Download

Lines Matching full:trigger

15 2. Histogram Trigger Command
18 A histogram trigger command is an event trigger command that
24 The format of a hist trigger is as follows::
50 key. If a hist trigger is given a name using the 'name' parameter,
52 name, and trigger hits will update this common data. Only triggers
54 'compatible' if the fields named in the trigger share the same
63 attached to an event, there will be a table for each trigger in the
64 output. The table displayed for a named trigger will be the same as
99 trigger, read its current contents, and then turn it off::
102 /sys/kernel/debug/tracing/events/net/netif_rx/trigger
107 /sys/kernel/debug/tracing/events/net/netif_rx/trigger
109 The trigger file itself can be read to show the details of the
110 currently attached hist trigger. This information is also displayed
126 The 'pause' parameter can be used to pause an existing hist trigger
127 or to start a hist trigger but not log any events until told to do
129 hist trigger.
132 trigger and leave its current paused/active state.
136 existing trigger, rather than via the '>' operator, which will cause
137 the trigger to be removed through truncation.
143 hist trigger. Any number of enable_hist and disable_hist triggers
158 would be to first set up a paused hist trigger on some event,
163 /sys/kernel/debug/tracing/events/net/netif_receive_skb/trigger
166 /sys/kernel/debug/tracing/events/sched/sched_process_exec/trigger
169 /sys/kernel/debug/tracing/events/sched/sched_process_exit/trigger
171 The above sets up an initially paused hist trigger which is unpaused
173 which stops aggregating when the process exits and the hist trigger
183 keys or values in a hist trigger. These look like and behave as if
200 For some error conditions encountered when invoking a hist trigger
205 6.2 'hist' trigger examples
209 event. The fields that can be used for the hist trigger are listed
227 We'll start by creating a hist trigger that generates a simple table
232 /sys/kernel/debug/tracing/events/kmem/kmalloc/trigger
234 This tells the tracing system to create a 'hist' trigger using the
238 the hist trigger that for each unique entry (call_site) in the
247 # trigger info: hist:keys=call_site:vals=bytes_req:sort=hitcount:size=2048 [active]
281 specified in the trigger, followed by the value(s) also specified in
282 the trigger. At the beginning of the output is a line that displays
283 the trigger info, which can also be displayed by reading the
284 'trigger' file::
286 # cat /sys/kernel/debug/tracing/events/kmem/kmalloc/trigger
291 times the event trigger was hit, the 'Entries' field shows the total
299 which wasn't specified in the trigger. Also notice that in the
300 trigger info output, there's a parameter, 'sort=hitcount', which
301 wasn't specified in the trigger either. The reason for that is that
302 every trigger implicitly keeps a count of the total number of hits
313 To turn the hist trigger off, simply call up the trigger in the
317 /sys/kernel/debug/tracing/events/kmem/kmalloc/trigger
322 value, simply append '.hex' to the field name in the trigger::
325 /sys/kernel/debug/tracing/events/kmem/kmalloc/trigger
328 # trigger info: hist:keys=call_site.hex:vals=bytes_req:sort=hitcount:size=2048 [active]
367 trigger::
370 /sys/kernel/debug/tracing/events/kmem/kmalloc/trigger
373 # trigger info: hist:keys=call_site.sym:vals=bytes_req:sort=hitcount:size=2048 [active]
420 /sys/kernel/debug/tracing/events/kmem/kmalloc/trigger
423 …# trigger info: hist:keys=call_site.sym:vals=bytes_req:sort=bytes_req.descending:size=2048 [active]
461 /sys/kernel/debug/tracing/events/kmem/kmalloc/trigger
464 …# trigger info: hist:keys=call_site.sym-offset:vals=bytes_req:sort=bytes_req.descending:size=2048 …
500 /sys/kernel/debug/tracing/events/kmem/kmalloc/trigger
503 …# trigger info: hist:keys=call_site.sym:vals=bytes_req,bytes_alloc:sort=bytes_alloc.descending:siz…
537 the hist trigger display symbolic call_sites, we can have the hist
538 trigger additionally display the complete set of kernel stack traces
543 /sys/kernel/debug/tracing/events/kmem/kmalloc/trigger
545 The above trigger will use the kernel stack trace in effect when an
554 …# trigger info: hist:keys=stacktrace:vals=bytes_req,bytes_alloc:sort=bytes_alloc:size=2048 [active]
645 If you key a hist trigger on common_pid, in order for example to
652 /sys/kernel/debug/tracing/events/syscalls/sys_enter_read/trigger
655 … # trigger info: hist:keys=common_pid.execname:vals=count:sort=count.descending:size=2048 [active]
686 Similarly, if you key a hist trigger on syscall id, for example to
693 /sys/kernel/debug/tracing/events/raw_syscalls/sys_enter/trigger
696 # trigger info: hist:keys=id.syscall:vals=hitcount:sort=hitcount:size=2048 [active]
747 /sys/kernel/debug/tracing/events/raw_syscalls/sys_enter/trigger
750 …# trigger info: hist:keys=id.syscall,common_pid.execname:vals=hitcount:sort=id.syscall,hitcount:si…
797 /sys/kernel/debug/tracing/events/raw_syscalls/sys_enter/trigger
800 …# trigger info: hist:keys=id.syscall,common_pid.execname:vals=hitcount:sort=id.syscall,hitcount:si…
840 /sys/kernel/debug/tracing/events/syscalls/sys_enter_recvfrom/trigger
843 …# trigger info: hist:keys=common_pid.execname,size:vals=hitcount:sort=common_pid.execname,size:siz…
887 demonstrates how you can manually pause and continue a hist trigger.
893 /sys/kernel/debug/tracing/events/sched/sched_process_fork/trigger
896 # trigger info: hist:keys=child_comm:vals=hitcount:sort=hitcount:size=256 [active]
924 If we want to pause the hist trigger, we can simply append :pause to
925 the command that started the trigger. Notice that the trigger info
929 /sys/kernel/debug/tracing/events/sched/sched_process_fork/trigger
932 # trigger info: hist:keys=child_comm:vals=hitcount:sort=hitcount:size=256 [paused]
961 To manually continue having the trigger aggregate events, append
962 :cont instead. Notice that the trigger info displays as [active]
966 /sys/kernel/debug/tracing/events/sched/sched_process_fork/trigger
969 # trigger info: hist:keys=child_comm:vals=hitcount:sort=hitcount:size=256 [active]
998 The previous example showed how to start and stop a hist trigger by
999 appending 'pause' and 'continue' to the hist trigger command. A
1000 hist trigger can also be started in a paused state by initially
1001 starting the trigger with ':pause' appended. This allows you to
1002 start the trigger only when you're ready to start collecting data
1003 and not before. For example, you could start the trigger in a
1005 then pause the trigger again when done.
1008 it is possible to automatically start and stop a hist trigger based
1016 First we set up an initially paused stacktrace trigger on the
1020 /sys/kernel/debug/tracing/events/net/netif_receive_skb/trigger
1022 Next, we set up an 'enable_hist' trigger on the sched_process_exec
1024 this new trigger is that it will 'unpause' the hist trigger we just
1031 /sys/kernel/debug/tracing/events/sched/sched_process_exec/trigger
1039 /sys/kernel/debug/tracing/events/sched/sched_process_exit/trigger
1042 trigger filter matches 'comm==wget', the netif_receive_skb hist
1043 trigger is disabled.
1053 # trigger info: hist:keys=stacktrace:vals=len:sort=hitcount:size=2048 [paused]
1129 The 'clear' hist trigger param can be used to clear the hash table.
1136 /sys/kernel/debug/tracing/events/net/netif_receive_skb/trigger
1142 # trigger info: hist:keys=stacktrace:vals=len:sort=hitcount:size=2048 [paused]
1156 /sys/kernel/debug/tracing/events/sched/sched_process_exec/trigger
1159 /sys/kernel/debug/tracing/events/sched/sched_process_exit/trigger
1161 If you read the trigger files for the sched_process_exec and
1166 # cat /sys/kernel/debug/tracing/events/sched/sched_process_exec/trigger
1170 # cat /sys/kernel/debug/tracing/events/sched/sched_process_exit/trigger
1220 /sys/kernel/debug/tracing/events/net/netif_receive_skb/trigger
1222 /sys/kernel/debug/tracing/events/net/netif_receive_skb/trigger
1224 /sys/kernel/debug/tracing/events/net/netif_receive_skb/trigger
1226 /sys/kernel/debug/tracing/events/net/netif_receive_skb/trigger
1228 /sys/kernel/debug/tracing/events/net/netif_receive_skb/trigger
1232 nonsensical trigger. Note that in order to append multiple hist
1234 append them ('>' will also add the new hist trigger, but will remove
1244 … # trigger info: hist:keys=len:vals=hitcount,common_preempt_count:sort=hitcount:size=2048 [active]
1271 # trigger info: hist:keys=skbaddr.hex:vals=hitcount,len:sort=hitcount:size=2048 [active]
1308 …# trigger info: hist:keys=skbaddr.hex:vals=hitcount,len:sort=hitcount:size=2048 if len == 256 [act…
1320 …# trigger info: hist:keys=skbaddr.hex:vals=hitcount,len:sort=hitcount:size=2048 if len > 4096 [act…
1344 …# trigger info: hist:keys=skbaddr.hex:vals=hitcount,len:sort=hitcount:size=2048 if len < 0 [active]
1356 functions, but names can be used in a hist trigger on any event.
1361 /sys/kernel/debug/tracing/events/net/netif_receive_skb/trigger
1363 /sys/kernel/debug/tracing/events/net/netif_rx/trigger
1373 … # trigger info: hist:name=foo:keys=skbaddr.hex:vals=hitcount,len:sort=hitcount:size=2048 [active]
1425 … # trigger info: hist:name=foo:keys=skbaddr.hex:vals=hitcount,len:sort=hitcount:size=2048 [active]
1482 /sys/kernel/debug/tracing/events/sched/sched_process_fork/trigger
1484 /sys/kernel/debug/tracing/events/net/netif_rx/trigger
1494 # trigger info: hist:name=bar:keys=stacktrace:vals=hitcount:sort=hitcount:size=2048 [active]
1622 Normally, a hist trigger specification consists of a (possibly
1629 The inter-event hist trigger extension allows fields from multiple
1632 features have been added to the hist trigger support:
1672 trace clocks instead, using the "clock=XXX" hist trigger attribute,
1705 event/trigger
1720 # echo 'hist:timer_pid=common_pid:key=timer_pid ...' >> event/trigger
1726 # echo 'hist:keys=next_pid:ts1=common_timestamp ...' >> event/trigger
1733 event/trigger
1740 event/trigger
1746 # echo 'hist:keys=pid:ts0=common_timestamp:b=field1 ...' >> event/trigger
1753 # echo 'hist:keys=pid,prio:ts0=common_timestamp ...' >> event1/trigger
1754 # echo 'hist:keys=next_pid:wakeup_lat=common_timestamp-$ts0 ...' >> event2/trigger
1759 yet another variable, 'wakeup_lat'. The hist trigger below in turn
1763 # echo 'hist:key=pid:wakeupswitch_lat=$wakeup_lat+$switchtime_lat ...' >> event3/trigger
1768 Synthetic events are user-defined events generated from hist trigger
1821 trigger action' needs to be instantiated and bound to actual fields
1823 how that is done using hist trigger 'onmatch' action). Once that is
1829 /sys/kernel/debug/tracing/events/synthetic/wakeup_latency/trigger
1835 enable filter format hist id trigger
1840 2.2.3 Hist trigger 'handlers' and 'actions'
1843 A hist trigger 'action' is a function that's executed (in most cases
1846 When a histogram entry is added or updated, a hist trigger 'handler'
1850 Hist trigger handlers and actions are paired together in the general
1856 that handler.action pair between colons in the hist trigger
1862 trigger will fail with -EINVAL;
1891 list)' hist trigger action is invoked whenever an event matches
1944 The following hist trigger both defines the missing testpid
1952 /sys/kernel/debug/tracing/events/sched/sched_wakeup_new/trigger
1958 /sys/kernel/debug/tracing/events/sched/sched_wakeup_new/trigger
1965 /sys/kernel/debug/tracing/events/synthetic/wakeup_new_test/trigger
1987 /sys/kernel/debug/tracing/events/sched/sched_waking/trigger
1997 /sys/kernel/debug/tracing/events/sched/sched_switch/trigger
2003 /sys/kernel/debug/tracing/events/synthetic/wakeup_latency/trigger
2013 The 'onmax(var).save(field,...)' hist trigger action is invoked
2019 maximum for that hist trigger entry. This allows context from the
2035 /sys/kernel/debug/tracing/events/sched/sched_waking/trigger
2041 /sys/kernel/debug/tracing/events/sched/sched_switch/trigger
2066 The 'onmax(var).snapshot()' hist trigger action is invoked
2072 maximum for any hist trigger entry.
2097 /sys/kernel/debug/tracing/events/sched/sched_waking/trigger
2103 /sys/kernel/debug/tracing/events/sched/sched_switch/trigger
2175 The 'onchange(var).save(field,...)' hist trigger action is invoked
2181 hist trigger entry. This allows context from the event that
2188 The 'onchange(var).snapshot()' hist trigger action is invoked
2194 hist trigger entry.
2204 As an example the below defines a hist trigger on the tcp_probe
2218 /sys/kernel/debug/tracing/events/tcp/tcp_probe/trigger
2272 3. User space creating a trigger
2276 ring buffer. This can also act like an event, by writing into the trigger
2301 …o 'hist:keys=common_pid:ts0=common_timestamp.usecs if buf == "start"' > events/ftrace/print/trigger
2302 …tamp.usecs-$ts0:onmatch(ftrace.print).latency($lat) if buf == "end"' >> events/ftrace/print/trigger
2303 # echo 'hist:keys=lat,common_pid:sort=lat' > events/synthetic/latency/trigger
2332 # trigger info: hist:keys=lat,common_pid:vals=hitcount:sort=lat:size=2048 [active]
2632 # echo 'hist:keys=pid:ts0=common_timestamp.usecs' > events/sched/sched_waking/trigger
2633 …usecs-$ts0:onmatch(sched.sched_waking).latency($lat) if buf == "end"' > events/ftrace/print/trigger
2634 # echo 'hist:keys=lat,common_pid:sort=lat' > events/synthetic/latency/trigger
2645 # trigger info: hist:keys=lat,common_pid:vals=hitcount:sort=lat:size=2048 [active]