SlideShare ist ein Scribd-Unternehmen logo
1 von 57
Downloaden Sie, um offline zu lesen
Brought to you by
New ways to find
latency in Linux using
tracing
Steven Rostedt
Open Source Engineer at VMware
©2021 VMware, Inc.
New ways to find
latency in Linux
using tracing
Steven Rostedt
Open Source Engineer
srostedt@vmware.com
twitter: @srostedt
What is ftrace?
●
Official tracer of the Linux Kernel
– Introduced in 2008
●
Came from the PREEMPT_RT patch set
– Initially focused on finding causes of latency
●
Has grows significantly since 2008
– Added new ways to find latency
– Does much more than find latency
The ftrace interface (the tracefs file system)
# mount -t tracefs nodev /sys/kernel/tracing
# ls /sys/kernel/tracing
available_events max_graph_depth snapshot
available_filter_functions options stack_max_size
available_tracers osnoise stack_trace
buffer_percent per_cpu stack_trace_filter
buffer_size_kb printk_formats synthetic_events
buffer_total_size_kb README timestamp_mode
current_tracer recursed_functions trace
dynamic_events saved_cmdlines trace_clock
dyn_ftrace_total_info saved_cmdlines_size trace_marker
enabled_functions saved_tgids trace_marker_raw
error_log set_event trace_options
eval_map set_event_notrace_pid trace_pipe
events set_event_pid trace_stat
free_buffer set_ftrace_filter tracing_cpumask
function_profile_enabled set_ftrace_notrace tracing_max_latency
hwlat_detector set_ftrace_notrace_pid tracing_on
instances set_ftrace_pid tracing_thresh
kprobe_events set_graph_function uprobe_events
kprobe_profile set_graph_notrace uprobe_profile
Introducing trace-cmd
Luckily today, we do not need to know all those files
●
trace-cmd is a front end interface to ftrace
●
It interfaces with the tracefs directory for you
https://www.trace-cmd.org
git clone git://git.kernel.org/pub/scm/utils/trace-cmd/trace-cmd.git
The Old Tracers
●
Wake up trace
– All tasks
– RT tasks
– Deadline Tasks
●
Preemption off tracers
– irqsoff tracer
– preemptoff tracer
– preemptirqsoff tracer
Wake up tracer
Task 1
Interrupt
Wake up Task 2 event
Task 2
Sched switch event
latency
Running wakeup_rt tracer
# trace-cmd start -p wakeup_rt
# trace-cmd show
# tracer: wakeup_rt
#
# wakeup_rt latency trace v1.1.5 on 5.10.52-test-rt47
# latency: 94 us, #211/211, CPU#4 | (M:preempt_rt VP:0, KP:0, SP:0 HP:0 #P:8)
# -----------------
# | task: rcuc/4-42 (uid:0 nice:0 policy:1 rt_prio:1)
# -----------------
#
# _--------=> CPU#
# / _-------=> irqs-off
# | / _------=> need-resched
# || / _-----=> need-resched-lazy
# ||| / _----=> hardirq/softirq
# |||| / _---=> preempt-depth
# ||||| / _--=> preempt-lazy-depth
# |||||| / _-=> migrate-disable
# ||||||| / delay
# cmd pid |||||||| time | caller
#  / ||||||||  | /
bash-1872 4dN.h5.. 1us+: 1872:120:R + [004] 42: 98:R rcuc/4
bash-1872 4dN.h5.. 30us : <stack trace>
=> __ftrace_trace_stack
=> probe_wakeup
=> ttwu_do_wakeup
=> try_to_wake_up
Running wakeup_rt tracer
=> invoke_rcu_core
=> rcu_sched_clock_irq
=> update_process_times
=> tick_sched_handle
=> tick_sched_timer
=> __hrtimer_run_queues
=> hrtimer_interrupt
=> __sysvec_apic_timer_interrupt
=> asm_call_irq_on_stack
=> sysvec_apic_timer_interrupt
=> asm_sysvec_apic_timer_interrupt
=> lock_acquire
=> _raw_spin_lock
=> shmem_get_inode
=> shmem_mknod
=> lookup_open.isra.0
=> path_openat
=> do_filp_open
=> do_sys_openat2
=> __x64_sys_openat
=> do_syscall_64
=> entry_SYSCALL_64_after_hwframe
bash-1872 4dN.h5.. 31us : 0
bash-1872 4dN.h4.. 32us : task_woken_rt ←ttwu_do_wakeup
bash-1872 4dN..2.. 87us : put_prev_entity <-put_prev_task_fair
bash-1872 4dN..2.. 87us : update_curr <-put_prev_entity
bash-1872 4dN..2.. 87us : __update_load_avg_se <-update_load_avg
bash-1872 4dN..2.. 87us : __update_load_avg_cfs_rq <-update_load_avg
Running wakeup_rt tracer
bash-1872 4dN..2.. 87us : pick_next_task_stop <-__schedule
bash-1872 4dN..2.. 87us : pick_next_task_dl <-__schedule
bash-1872 4dN..2.. 87us : pick_next_task_rt <-__schedule
bash-1872 4dN..2.. 88us : update_rt_rq_load_avg <-pick_next_task_rt
bash-1872 4d...3.. 88us : __schedule
bash-1872 4d...3.. 88us : 1872:120:R ==> [004] 42: 98:R rcuc/4
bash-1872 4d...3.. 94us : <stack trace>
=> __ftrace_trace_stack
=> probe_wakeup_sched_switch
=> __schedule
=> preempt_schedule_common
=> preempt_schedule_thunk
=> _raw_spin_unlock
=> shmem_get_inode
=> shmem_mknod
=> lookup_open.isra.0
=> path_openat
=> do_filp_open
=> do_sys_openat2
=> __x64_sys_openat
=> do_syscall_64
=> entry_SYSCALL_64_after_hwframe
Interrupt off tracer
Task
Interrupt
Irqs disabled
latency
Irqs enabled
Running preemptirqsoff tracer
# trace-cmd start -p preemptirqsoff
# trace-cmd show
# tracer: preemptirqsoff
#
# preemptirqsoff latency trace v1.1.5 on 5.14.0-rc4-test+
# --------------------------------------------------------------------
# latency: 2325 us, #3005/3005, CPU#1 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:8)
# -----------------
# | task: bash-48651 (uid:0 nice:0 policy:0 rt_prio:0)
# -----------------
# => started at: _raw_spin_lock
# => ended at: _raw_spin_unlock
#
#
# _------=> CPU#
# / _-----=> irqs-off
# | / _----=> need-resched
# || / _---=> hardirq/softirq
# ||| / _--=> preempt-depth
# |||| / delay
# cmd pid ||||| time | caller
#  / |||||  | /
trace-cm-48651 1...1 0us : _raw_spin_lock
trace-cm-48651 1...1 1us : do_raw_spin_trylock <-_raw_spin_lock
trace-cm-48651 1...1 1us : flush_tlb_batched_pending <-unmap_page_range
trace-cm-48651 1...1 2us : vm_normal_page <-unmap_page_range
trace-cm-48651 1...1 2us : page_remove_rmap <-unmap_page_range
Running preemptirqsoff tracer
[...]
trace-cm-48651 1...1 2313us : unlock_page_memcg <-unmap_page_range
trace-cm-48651 1...1 2314us : __rcu_read_unlock <-unlock_page_memcg
trace-cm-48651 1...1 2315us : __tlb_remove_page_size <-unmap_page_range
trace-cm-48651 1...1 2316us : vm_normal_page <-unmap_page_range
trace-cm-48651 1...1 2317us : page_remove_rmap <-unmap_page_range
trace-cm-48651 1...1 2318us : lock_page_memcg <-page_remove_rmap
trace-cm-48651 1...1 2318us : __rcu_read_lock <-lock_page_memcg
trace-cm-48651 1...1 2319us : unlock_page_memcg <-unmap_page_range
trace-cm-48651 1...1 2320us : __rcu_read_unlock <-unlock_page_memcg
trace-cm-48651 1...1 2321us : __tlb_remove_page_size <-unmap_page_range
trace-cm-48651 1...1 2322us : _raw_spin_unlock <-unmap_page_range
trace-cm-48651 1...1 2323us : do_raw_spin_unlock <-_raw_spin_unlock
trace-cm-48651 1...1 2324us : preempt_count_sub <-_raw_spin_unlock
trace-cm-48651 1...1 2325us : _raw_spin_unlock
trace-cm-48651 1...1 2327us+: tracer_preempt_on <-_raw_spin_unlock
trace-cm-48651 1...1 2343us : <stack trace>
=> unmap_page_range
=> unmap_vmas
=> exit_mmap
=> mmput
=> begin_new_exec
=> load_elf_binary
=> bprm_execve
=> do_execveat_common
=> __x64_sys_execve
=> do_syscall_64
=> entry_SYSCALL_64_after_hwframe
Running preemptirqsoff tracer
# trace-cmd start -p preemptirqsoff -d -O sym-offset
# trace-cmd show
# tracer: preemptirqsoff
[..]
# latency: 248 us, #4/4, CPU#6 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:8)
# -----------------
# | task: ksoftirqd/6-47 (uid:0 nice:0 policy:0 rt_prio:0)
# -----------------
# => started at: run_ksoftirqd
# => ended at: run_ksoftirqd
[..]
# cmd pid ||||| time | caller
#  / |||||  | /
<idle>-0 4d..1 1us!: cpuidle_enter_state+0xcf/0x410
kworker/-48096 4...1 242us : schedule+0x4d/0xe0 <-schedule+0x4d/0xe0
kworker/-48096 4...1 243us : tracer_preempt_on+0xf4/0x110 <-schedule+0x4d/0xe0
kworker/-48096 4...1 248us : <stack trace>
=> worker_thread+0xd4/0x3c0
=> kthread+0x155/0x180
=> ret_from_fork+0x22/0x30
Measuring Interrupt Latency
Task
Interrupt
latency
Measuring latency from interrupts
●
You can easily trace the latency from interrupts
– For x86:
# trace-cmd record -p function_graph -l handle_irq_event 
-l ‘*sysvec_*’ -e irq_handler_entry 
-e 'irq_vectors:*entry*'
Tracing Latency from Interrupts
# trace-cmd report -l --cpu 2
sleep-2513 [002] 2973.197184: funcgraph_entry: | __sysvec_apic_timer_interrupt() {
sleep-2513 [002] 2973.197186: local_timer_entry: vector=236
sleep-2513 [002] 2973.197196: funcgraph_exit: + 12.233 us | }
sleep-2513 [002] 2973.197206: funcgraph_entry: | __sysvec_irq_work() {
sleep-2513 [002] 2973.197207: irq_work_entry: vector=246
sleep-2513 [002] 2973.197207: funcgraph_exit: 1.405 us | }
<idle>-0 [002] 2973.198186: funcgraph_entry: | __sysvec_apic_timer_interrupt() {
<idle>-0 [002] 2973.198187: local_timer_entry: vector=236
<idle>-0 [002] 2973.198193: funcgraph_exit: 7.992 us | }
<idle>-0 [002] 2974.991721: funcgraph_entry: | handle_irq_event() {
<idle>-0 [002] 2974.991723: irq_handler_entry: irq=24 name=ahci[0000:00:1f.2]
<idle>-0 [002] 2974.991733: funcgraph_exit: + 13.158 us | }
<idle>-0 [002] 2977.039843: funcgraph_entry: | handle_irq_event() {
<idle>-0 [002] 2977.039845: irq_handler_entry: irq=24 name=ahci[0000:00:1f.2]
<idle>-0 [002] 2977.039855: funcgraph_exit: + 12.869 us | }
Problems with the latency tracers
●
No control over what tasks they trace
– They trace the highest priority process
– May not be the process you are interested in
●
Not flexible
– Has one use case
– General for the entire system
Tracing interrupt latency with function graph tracer
●
Does not have a “max latency”
– You see all the latency in a trace
– No way to record the max latency found
Introducing Synthetic Events
●
Can map two events into a single event
Introducing Synthetic Events
●
Can map two events into a single event
– sched_waking + sched_switch wakeup_latency
→
– irqs_disabled + irqs_enabled irqs_off_latency
→
– irq_enter_handler + irq_exit_handler irq_latency
→
Introducing Synthetic Events
●
Can map two events into a single event
– sched_waking + sched_switch wakeup_latency
→
– irqs_disabled + irqs_enabled irqs_off_latency
→
– irq_enter_handler + irq_exit_handler irq_latency
→
●
Have all the functionality as a normal event
Introducing Synthetic Events
●
Can map two events into a single event
– sched_waking + sched_switch wakeup_latency
→
– irqs_disabled + irqs_enabled irqs_off_latency
→
– irq_enter_handler + irq_exit_handler irq_latency
→
●
Have all the functionality as a normal event
– Can be filtered on
Introducing Synthetic Events
●
Can map two events into a single event
– sched_waking + sched_switch wakeup_latency
→
– irqs_disabled + irqs_enabled irqs_off_latency
→
– irq_enter_handler + irq_exit_handler irq_latency
→
●
Have all the functionality as a normal event
– Can be filtered on
– Can have triggers attached (like histograms)
Synthetic events
# echo 'wakeup_lat s32 pid; u64 delta;' > /sys/kernel/tracing/synthetic_events
# echo 'hist:keys=pid:__arg__1=pid,__arg__2=common_timestamp.usecs' > 
/sys/kernel/tracing/events/sched/sched_waking/trigger
# echo 'hist:keys=next_pid:pid=$__arg__1,’
‘delta=common_timestamp.usecs-$__arg__2:onmatch(sched.sched_waking)’
‘.trace(wakeup_lat,$pid,$delta) if next_comm == “cyclictest”' > 
/sys/kernel/tracing/events/sched/sched_switch/trigger
Synthetic events
# echo 'wakeup_lat s32 pid; u64 delta;' > /sys/kernel/tracing/synthetic_events
# echo 'hist:keys=pid:__arg__1=pid,__arg__2=common_timestamp.usecs' > 
/sys/kernel/tracing/events/sched/sched_waking/trigger
# echo 'hist:keys=next_pid:pid=$__arg__1,’
‘delta=common_timestamp.usecs-$__arg__2:onmatch(sched.sched_waking)’
‘.trace(wakeup_lat,$pid,$delta) if next_comm == “cyclictest”' > 
/sys/kernel/tracing/events/sched/sched_switch/trigger
Too Complex!
Introducing libtracefs
A library to interact with the tracefs file system
All functions have man pages
The tracefs_sql man page has the sqlhist program in it
https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git/
git clone git://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git
cd libtracefs
make sqlhist # builds from the man page!
Synthetic events
# sqlhist -e -n wakeup_lat 
‘SELECT start.pid, (end.TIMESTAMP_USECS - start.TIMESTAMP_USECS) AS delta FROM ’ 
‘sched_waking AS start JOIN sched_switch AS end ON start.pid = end.next_pid' 
‘WHERE end.next_pid = “cyclictest”’
Synthetic events
# sqlhist -e -n wakeup_lat 
‘SELECT start.pid, (end.TIMESTAMP_USECS - start.TIMESTAMP_USECS) AS delta FROM ’ 
‘sched_waking AS start JOIN sched_switch AS end ON start.pid = end.next_pid' 
‘WHERE end.next_pid = “cyclictest”’
Synthetic events
# sqlhist -e -n wakeup_lat 
‘SELECT start.pid, (end.TIMESTAMP_USECS - start.TIMESTAMP_USECS) AS delta FROM ’ 
‘sched_waking AS start JOIN sched_switch AS end ON start.pid = end.next_pid' 
‘WHERE end.next_pid = “cyclictest”’
Synthetic events
# sqlhist -e -n wakeup_lat 
‘SELECT start.pid, (end.TIMESTAMP_USECS - start.TIMESTAMP_USECS) AS delta FROM ’ 
‘sched_waking AS start JOIN sched_switch AS end ON start.pid = end.next_pid' 
‘WHERE end.next_pid = “cyclictest”’
Synthetic events
# sqlhist -e -n wakeup_lat 
‘SELECT start.pid, (end.TIMESTAMP_USECS - start.TIMESTAMP_USECS) AS delta FROM ’ 
‘sched_waking AS start JOIN sched_switch AS end ON start.pid = end.next_pid' 
‘WHERE end.next_pid = “cyclictest”’
Synthetic events
# sqlhist -e -n wakeup_lat 
‘SELECT start.pid, (end.TIMESTAMP_USECS - start.TIMESTAMP_USECS) AS delta FROM ’ 
‘sched_waking AS start JOIN sched_switch AS end ON start.pid = end.next_pid' 
‘WHERE end.next_pid = “cyclictest”’
Synthetic events
# sqlhist -e -n wakeup_lat 
‘SELECT start.pid, (end.TIMESTAMP_USECS - start.TIMESTAMP_USECS) AS delta FROM ’ 
‘sched_waking AS start JOIN sched_switch AS end ON start.pid = end.next_pid' 
‘WHERE end.next_pid = “cyclictest”’
Synthetic events
# sqlhist -e -n wakeup_lat 
‘SELECT start.pid, (end.TIMESTAMP_USECS - start.TIMESTAMP_USECS) AS delta FROM ’ 
‘sched_waking AS start JOIN sched_switch AS end ON start.pid = end.next_pid' 
‘WHERE end.next_pid = “cyclictest”’
Synthetic events
# sqlhist -e -n wakeup_lat 
‘SELECT start.pid, (end.TIMESTAMP_USECS - start.TIMESTAMP_USECS) AS delta FROM ’ 
‘sched_waking AS start JOIN sched_switch AS end ON start.pid = end.next_pid' 
‘WHERE end.next_pid = “cyclictest”’
cyclictest
A tool used by real-time developers to test wake up latency in the system
https://git.kernel.org/pub/scm/utils/rt-tests/rt-tests.git/
git clone git://git.kernel.org/pub/scm/utils/rt-tests/rt-tests.git
cd rt-tests
make cyclictest
Customize latency tracing
# sqlhist -e -n wakeup_lat -T -m lat 'SELECT end.next_comm AS comm, ’ 
‘(end.TIMESTAMP_USECS - start.TIMESTAMP_USECS) AS lat ’ 
‘FROM sched_waking AS start JOIN sched_switch AS end ’ 
‘ON start.pid = end.next_pid’ 
‘WHERE end.next_prio < 100 && end.next_comm == "cyclictest"'
# trace-cmd start -e all -e wakeup_lat -R stacktrace
# cyclictest -l 1000 -p80 -i250 -a -t -q -m -d 0 -b 1000 --tracemark
# trace-cmd show -s | tail -16
<idle>-0 [001] d..1 23454.902254: cpu_idle: state=0 cpu_id=1
<idle>-0 [002] d..2 23454.902254: sched_switch: prev_comm=swapper/2 prev_pid=0 prev_prio=120
prev_state=R ==> next_comm=cyclictest next_pid=12275 next_prio=19
<idle>-0 [002] d..4 23454.902256: wakeup_lat: next_comm=cyclictest lat=17
<idle>-0 [002] d..5 23454.902258: <stack trace>
=> trace_event_raw_event_synth
=> action_trace
=> event_hist_trigger
=> event_triggers_call
=> trace_event_buffer_commit
=> trace_event_raw_event_sched_switch
=> __traceiter_sched_switch
=> __schedule
=> schedule_idle
=> do_idle
=> cpu_startup_entry
=> secondary_startup_64_no_verify
Customize latency tracing
# sqlhist -e -n wakeup_lat -T -m lat 'SELECT end.next_comm AS comm, ’ 
‘(end.TIMESTAMP_USECS - start.TIMESTAMP_USECS) AS lat ’ 
‘FROM sched_waking AS start JOIN sched_switch AS end ’ 
‘ON start.pid = end.next_pid’ 
‘WHERE end.next_prio < 100 && end.next_comm == "cyclictest"'
# trace-cmd start -e all -e wakeup_lat -R stacktrace
# cyclictest -l 1000 -p80 -i250 -a -t -q -m -d 0 -b 1000 --tracemark
# trace-cmd show -s | tail -16
<idle>-0 [001] d..1 23454.902254: cpu_idle: state=0 cpu_id=1
<idle>-0 [002] d..2 23454.902254: sched_switch: prev_comm=swapper/2 prev_pid=0 prev_prio=120
prev_state=R ==> next_comm=cyclictest next_pid=12275 next_prio=19
<idle>-0 [002] d..4 23454.902256: wakeup_lat: next_comm=cyclictest lat=17
<idle>-0 [002] d..5 23454.902258: <stack trace>
=> trace_event_raw_event_synth
=> action_trace
=> event_hist_trigger
=> event_triggers_call
=> trace_event_buffer_commit
=> trace_event_raw_event_sched_switch
=> __traceiter_sched_switch
=> __schedule
=> schedule_idle
=> do_idle
=> cpu_startup_entry
=> secondary_startup_64_no_verify
Customize latency tracing
# sqlhist -e -n wakeup_lat -T -m lat 'SELECT end.next_comm AS comm, ’ 
‘(end.TIMESTAMP_USECS - start.TIMESTAMP_USECS) AS lat ’ 
‘FROM sched_waking AS start JOIN sched_switch AS end ’ 
‘ON start.pid = end.next_pid’ 
‘WHERE end.next_prio < 100 && end.next_comm == "cyclictest"'
# trace-cmd start -e all -e wakeup_lat -R stacktrace
# cyclictest -l 1000 -p80 -i250 -a -t -q -m -d 0 -b 1000 --tracemark
# trace-cmd show -s | tail -16
<idle>-0 [001] d..1 23454.902254: cpu_idle: state=0 cpu_id=1
<idle>-0 [002] d..2 23454.902254: sched_switch: prev_comm=swapper/2 prev_pid=0 prev_prio=120
prev_state=R ==> next_comm=cyclictest next_pid=12275 next_prio=19
<idle>-0 [002] d..4 23454.902256: wakeup_lat: next_comm=cyclictest lat=17
<idle>-0 [002] d..5 23454.902258: <stack trace>
=> trace_event_raw_event_synth
=> action_trace
=> event_hist_trigger
=> event_triggers_call
=> trace_event_buffer_commit
=> trace_event_raw_event_sched_switch
=> __traceiter_sched_switch
=> __schedule
=> schedule_idle
=> do_idle
=> cpu_startup_entry
=> secondary_startup_64_no_verify
Customize latency tracing
# sqlhist -e -n wakeup_lat -T -m lat 'SELECT end.next_comm AS comm, ’ 
‘(end.TIMESTAMP_USECS - start.TIMESTAMP_USECS) AS lat ’ 
‘FROM sched_waking AS start JOIN sched_switch AS end ’ 
‘ON start.pid = end.next_pid’ 
‘WHERE end.next_prio < 100 && end.next_comm == "cyclictest"'
# trace-cmd start -e all -e wakeup_lat -R stacktrace
# cyclictest -l 1000 -p80 -i250 -a -t -q -m -d 0 -b 1000 --tracemark
# trace-cmd show -s | tail -16
<idle>-0 [001] d..1 23454.902254: cpu_idle: state=0 cpu_id=1
<idle>-0 [002] d..2 23454.902254: sched_switch: prev_comm=swapper/2 prev_pid=0 prev_prio=120
prev_state=R ==> next_comm=cyclictest next_pid=12275 next_prio=19
<idle>-0 [002] d..4 23454.902256: wakeup_lat: next_comm=cyclictest lat=17
<idle>-0 [002] d..5 23454.902258: <stack trace>
=> trace_event_raw_event_synth
=> action_trace
=> event_hist_trigger
=> event_triggers_call
=> trace_event_buffer_commit
=> trace_event_raw_event_sched_switch
=> __traceiter_sched_switch
=> __schedule
=> schedule_idle
=> do_idle
=> cpu_startup_entry
=> secondary_startup_64_no_verify
Customize latency tracing
# sqlhist -e -n wakeup_lat -T -m lat 'SELECT end.next_comm AS comm, ’ 
‘(end.TIMESTAMP_USECS - start.TIMESTAMP_USECS) AS lat ’ 
‘FROM sched_waking AS start JOIN sched_switch AS end ’ 
‘ON start.pid = end.next_pid’ 
‘WHERE end.next_prio < 100 && end.next_comm == "cyclictest"'
# trace-cmd start -e all -e wakeup_lat -R stacktrace
# cyclictest -l 1000 -p80 -i250 -a -t -q -m -d 0 -b 1000 --tracemark
# trace-cmd show -s | tail -16
<idle>-0 [001] d..1 23454.902254: cpu_idle: state=0 cpu_id=1
<idle>-0 [002] d..2 23454.902254: sched_switch: prev_comm=swapper/2 prev_pid=0 prev_prio=120
prev_state=R ==> next_comm=cyclictest next_pid=12275 next_prio=19
<idle>-0 [002] d..4 23454.902256: wakeup_lat: next_comm=cyclictest lat=17
<idle>-0 [002] d..5 23454.902258: <stack trace>
=> trace_event_raw_event_synth
=> action_trace
=> event_hist_trigger
=> event_triggers_call
=> trace_event_buffer_commit
=> trace_event_raw_event_sched_switch
=> __traceiter_sched_switch
=> __schedule
=> schedule_idle
=> do_idle
=> cpu_startup_entry
=> secondary_startup_64_no_verify
Customize latency tracing
# sqlhist -e -n wakeup_lat -T -m lat 'SELECT end.next_comm AS comm, ’ 
‘(end.TIMESTAMP_USECS - start.TIMESTAMP_USECS) AS lat ’ 
‘FROM sched_waking AS start JOIN sched_switch AS end ’ 
‘ON start.pid = end.next_pid’ 
‘WHERE end.next_prio < 100 && end.next_comm == "cyclictest"'
# trace-cmd start -e all -e wakeup_lat -R stacktrace
# cyclictest -l 1000 -p80 -i250 -a -t -q -m -d 0 -b 1000 --tracemark
# trace-cmd show -s | tail -16
<idle>-0 [001] d..1 23454.902254: cpu_idle: state=0 cpu_id=1
<idle>-0 [002] d..2 23454.902254: sched_switch: prev_comm=swapper/2 prev_pid=0 prev_prio=120
prev_state=R ==> next_comm=cyclictest next_pid=12275 next_prio=19
<idle>-0 [002] d..4 23454.902256: wakeup_lat: next_comm=cyclictest lat=17
<idle>-0 [002] d..5 23454.902258: <stack trace>
=> trace_event_raw_event_synth
=> action_trace
=> event_hist_trigger
=> event_triggers_call
=> trace_event_buffer_commit
=> trace_event_raw_event_sched_switch
=> __traceiter_sched_switch
=> __schedule
=> schedule_idle
=> do_idle
=> cpu_startup_entry
=> secondary_startup_64_no_verify
Customize latency tracing
# sqlhist -e -n wakeup_lat -T -m lat 'SELECT end.next_comm AS comm, ’ 
‘(end.TIMESTAMP_USECS - start.TIMESTAMP_USECS) AS lat ’ 
‘FROM sched_waking AS start JOIN sched_switch AS end ’ 
‘ON start.pid = end.next_pid’ 
‘WHERE end.next_prio < 100 && end.next_comm == "cyclictest"'
# trace-cmd start -e all -e wakeup_lat -R stacktrace
# cyclictest -l 1000 -p80 -i250 -a -t -q -m -d 0 -b 1000 --tracemark
# trace-cmd show -s | tail -16
<idle>-0 [001] d..1 23454.902254: cpu_idle: state=0 cpu_id=1
<idle>-0 [002] d..2 23454.902254: sched_switch: prev_comm=swapper/2 prev_pid=0 prev_prio=120
prev_state=R ==> next_comm=cyclictest next_pid=12275 next_prio=19
<idle>-0 [002] d..4 23454.902256: wakeup_lat: next_comm=cyclictest lat=17
<idle>-0 [002] d..5 23454.902258: <stack trace>
=> trace_event_raw_event_synth
=> action_trace
=> event_hist_trigger
=> event_triggers_call
=> trace_event_buffer_commit
=> trace_event_raw_event_sched_switch
=> __traceiter_sched_switch
=> __schedule
=> schedule_idle
=> do_idle
=> cpu_startup_entry
=> secondary_startup_64_no_verify
Customize latency tracing
# sqlhist -e -n wakeup_lat -T -m lat 'SELECT end.next_comm AS comm, ’ 
‘(end.TIMESTAMP_USECS - start.TIMESTAMP_USECS) AS lat ’ 
‘FROM sched_waking AS start JOIN sched_switch AS end ’ 
‘ON start.pid = end.next_pid’ 
‘WHERE end.next_prio < 100 && end.next_comm == "cyclictest"'
# trace-cmd start -e all -e wakeup_lat -R stacktrace
# cyclictest -l 1000 -p80 -i250 -a -t -q -m -d 0 -b 1000 --tracemark
# trace-cmd show -s | tail -16
<idle>-0 [001] d..1 23454.902254: cpu_idle: state=0 cpu_id=1
<idle>-0 [002] d..2 23454.902254: sched_switch: prev_comm=swapper/2 prev_pid=0 prev_prio=120
prev_state=R ==> next_comm=cyclictest next_pid=12275 next_prio=19
<idle>-0 [002] d..4 23454.902256: wakeup_lat: next_comm=cyclictest lat=17
<idle>-0 [002] d..5 23454.902258: <stack trace>
=> trace_event_raw_event_synth
=> action_trace
=> event_hist_trigger
=> event_triggers_call
=> trace_event_buffer_commit
=> trace_event_raw_event_sched_switch
=> __traceiter_sched_switch
=> __schedule
=> schedule_idle
=> do_idle
=> cpu_startup_entry
=> secondary_startup_64_no_verify
Customize latency tracing
# sqlhist -e -n wakeup_lat -T -m lat 'SELECT end.next_comm AS comm, ’ 
‘(end.TIMESTAMP_USECS - start.TIMESTAMP_USECS) AS lat ’ 
‘FROM sched_waking AS start JOIN sched_switch AS end ’ 
‘ON start.pid = end.next_pid’ 
‘WHERE end.next_prio < 100 && end.next_comm == "cyclictest"'
# trace-cmd start -e all -e wakeup_lat -R stacktrace
# cyclictest -l 1000 -p80 -i250 -a -t -q -m -d 0 -b 1000 --tracemark
# trace-cmd show -s | tail -16
<idle>-0 [001] d..1 23454.902254: cpu_idle: state=0 cpu_id=1
<idle>-0 [002] d..2 23454.902254: sched_switch: prev_comm=swapper/2 prev_pid=0 prev_prio=120
prev_state=R ==> next_comm=cyclictest next_pid=12275 next_prio=19
<idle>-0 [002] d..4 23454.902256: wakeup_lat: next_comm=cyclictest lat=17
<idle>-0 [002] d..5 23454.902258: <stack trace>
=> trace_event_raw_event_synth
=> action_trace
=> event_hist_trigger
=> event_triggers_call
=> trace_event_buffer_commit
=> trace_event_raw_event_sched_switch
=> __traceiter_sched_switch
=> __schedule
=> schedule_idle
=> do_idle
=> cpu_startup_entry
=> secondary_startup_64_no_verify
Customize latency tracing
# sqlhist -e -n wakeup_lat -T -m lat 'SELECT end.next_comm AS comm, ’ 
‘(end.TIMESTAMP_USECS - start.TIMESTAMP_USECS) AS lat ’ 
‘FROM sched_waking AS start JOIN sched_switch AS end ’ 
‘ON start.pid = end.next_pid’ 
‘WHERE end.next_prio < 100 && end.next_comm == "cyclictest"'
# trace-cmd start -e all -e wakeup_lat -R stacktrace
# cyclictest -l 1000 -p80 -i250 -a -t -q -m -d 0 -b 1000 --tracemark
# trace-cmd show -s | tail -16
<idle>-0 [001] d..1 23454.902254: cpu_idle: state=0 cpu_id=1
<idle>-0 [002] d..2 23454.902254: sched_switch: prev_comm=swapper/2 prev_pid=0 prev_prio=120
prev_state=R ==> next_comm=cyclictest next_pid=12275 next_prio=19
<idle>-0 [002] d..4 23454.902256: wakeup_lat: next_comm=cyclictest lat=17
<idle>-0 [002] d..5 23454.902258: <stack trace>
=> trace_event_raw_event_synth
=> action_trace
=> event_hist_trigger
=> event_triggers_call
=> trace_event_buffer_commit
=> trace_event_raw_event_sched_switch
=> __traceiter_sched_switch
=> __schedule
=> schedule_idle
=> do_idle
=> cpu_startup_entry
=> secondary_startup_64_no_verify
Customize latency tracing
# sqlhist -e -n wakeup_lat -T -m lat 'SELECT end.next_comm AS comm, ’ 
‘(end.TIMESTAMP_USECS - start.TIMESTAMP_USECS) AS lat ’ 
‘FROM sched_waking AS start JOIN sched_switch AS end ’ 
‘ON start.pid = end.next_pid’ 
‘WHERE end.next_prio < 100 && end.next_comm == "cyclictest"'
# trace-cmd start -e all -e wakeup_lat -R stacktrace
# cyclictest -l 1000 -p80 -i250 -a -t -q -m -d 0 -b 1000 --tracemark
# trace-cmd show -s | tail -16
<idle>-0 [001] d..1 23454.902254: cpu_idle: state=0 cpu_id=1
<idle>-0 [002] d..2 23454.902254: sched_switch: prev_comm=swapper/2 prev_pid=0 prev_prio=120
prev_state=R ==> next_comm=cyclictest next_pid=12275 next_prio=19
<idle>-0 [002] d..4 23454.902256: wakeup_lat: next_comm=cyclictest lat=17
<idle>-0 [002] d..5 23454.902258: <stack trace>
=> trace_event_raw_event_synth
=> action_trace
=> event_hist_trigger
=> event_triggers_call
=> trace_event_buffer_commit
=> trace_event_raw_event_sched_switch
=> __traceiter_sched_switch
=> __schedule
=> schedule_idle
=> do_idle
=> cpu_startup_entry
=> secondary_startup_64_no_verify
Customize latency tracing
# sqlhist -e -n wakeup_lat -T -m lat 'SELECT end.next_comm AS comm, ’ 
‘(end.TIMESTAMP_USECS - start.TIMESTAMP_USECS) AS lat ’ 
‘FROM sched_waking AS start JOIN sched_switch AS end ’ 
‘ON start.pid = end.next_pid’ 
‘WHERE end.next_prio < 100 && end.next_comm == "cyclictest"'
# trace-cmd start -e all -e wakeup_lat -R stacktrace
# cyclictest -l 1000 -p80 -i250 -a -t -q -m -d 0 -b 1000 --tracemark
# trace-cmd show -s | tail -16
<idle>-0 [001] d..1 23454.902254: cpu_idle: state=0 cpu_id=1
<idle>-0 [002] d..2 23454.902254: sched_switch: prev_comm=swapper/2 prev_pid=0 prev_prio=120
prev_state=R ==> next_comm=cyclictest next_pid=12275 next_prio=19
<idle>-0 [002] d..4 23454.902256: wakeup_lat: next_comm=cyclictest lat=17
<idle>-0 [002] d..5 23454.902258: <stack trace>
=> trace_event_raw_event_synth
=> action_trace
=> event_hist_trigger
=> event_triggers_call
=> trace_event_buffer_commit
=> trace_event_raw_event_sched_switch
=> __traceiter_sched_switch
=> __schedule
=> schedule_idle
=> do_idle
=> cpu_startup_entry
=> secondary_startup_64_no_verify
Customize latency tracing
# trace-cmd extract -s
# trace-cmd report --cpu 2 | tail -30
<idle>-0 [001] d..1 23454.902254: cpu_idle: state=0 cpu_id=1
<idle>-0 [002] 23454.902239: sched_wakeup: cyclictest:12275 [19] CPU:002
<idle>-0 [002] 23454.902241: hrtimer_expire_exit: hrtimer=0xffffbbd68286fe60
<idle>-0 [002] 23454.902241: hrtimer_cancel: hrtimer=0xffffbbd6826efe70
<idle>-0 [002] 23454.902242: hrtimer_expire_entry: hrtimer=0xffffbbd6826efe70
<idle>-0 [002] 23454.902243: sched_waking: comm=cyclictest pid=12272
prio=120 target_cpu=002
<idle>-0 [002] 23454.902244: prandom_u32: ret=1102749734
<idle>-0 [002] 23454.902246: sched_wakeup: cyclictest:12272 [120] CPU:002
<idle>-0 [002] 23454.902247: hrtimer_expire_exit: hrtimer=0xffffbbd6826efe70
<idle>-0 [002] 23454.902248: write_msr: 6e0, value 4866ce957272
<idle>-0 [002] 23454.902249: local_timer_exit: vector=236
<idle>-0 [002] 23454.902250: cpu_idle: state=4294967295 cpu_id=2
<idle>-0 [002] 23454.902251: rcu_utilization: Start context switch
<idle>-0 [002] 23454.902252: rcu_utilization: End context switch
<idle>-0 [002] 23454.902253: prandom_u32: ret=3692516021
<idle>-0 [002] 23454.902254: sched_switch: swapper/2:0 [120] R ==>
cyclictest:12275 [19]
<idle>-0 [002] 23454.902256: wakeup_lat: next_comm=cyclictest lat=17
<idle>-0 [002] 23454.902258: kernel_stack: <stack trace >
=> trace_event_raw_event_synth (ffffffff8121a0db)
=> action_trace (ffffffff8121e9fb)
=> event_hist_trigger (ffffffff8121ca8d)
=> event_triggers_call (ffffffff81216c72)
[..]
Customize latency tracing
# trace-cmd extract -s
# trace-cmd report --cpu 2 | tail -30
<idle>-0 [001] d..1 23454.902254: cpu_idle: state=0 cpu_id=1
<idle>-0 [002] 23454.902239: sched_wakeup: cyclictest:12275 [19] CPU:002
<idle>-0 [002] 23454.902241: hrtimer_expire_exit: hrtimer=0xffffbbd68286fe60
<idle>-0 [002] 23454.902241: hrtimer_cancel: hrtimer=0xffffbbd6826efe70
<idle>-0 [002] 23454.902242: hrtimer_expire_entry: hrtimer=0xffffbbd6826efe70
<idle>-0 [002] 23454.902243: sched_waking: comm=cyclictest pid=12272
prio=120 target_cpu=002
<idle>-0 [002] 23454.902244: prandom_u32: ret=1102749734
<idle>-0 [002] 23454.902246: sched_wakeup: cyclictest:12272 [120] CPU:002
<idle>-0 [002] 23454.902247: hrtimer_expire_exit: hrtimer=0xffffbbd6826efe70
<idle>-0 [002] 23454.902248: write_msr: 6e0, value 4866ce957272
<idle>-0 [002] 23454.902249: local_timer_exit: vector=236
<idle>-0 [002] 23454.902250: cpu_idle: state=4294967295 cpu_id=2
<idle>-0 [002] 23454.902251: rcu_utilization: Start context switch
<idle>-0 [002] 23454.902252: rcu_utilization: End context switch
<idle>-0 [002] 23454.902253: prandom_u32: ret=3692516021
<idle>-0 [002] 23454.902254: sched_switch: swapper/2:0 [120] R ==>
cyclictest:12275 [19]
<idle>-0 [002] 23454.902256: wakeup_lat: next_comm=cyclictest lat=17
<idle>-0 [002] 23454.902258: kernel_stack: <stack trace >
=> trace_event_raw_event_synth (ffffffff8121a0db)
=> action_trace (ffffffff8121e9fb)
=> event_hist_trigger (ffffffff8121ca8d)
=> event_triggers_call (ffffffff81216c72)
[..]
Customize latency tracing
# trace-cmd extract -s
# trace-cmd report --cpu 2 | tail -30
<idle>-0 [001] d..1 23454.902254: cpu_idle: state=0 cpu_id=1
<idle>-0 [002] 23454.902239: sched_wakeup: cyclictest:12275 [19] CPU:002
<idle>-0 [002] 23454.902241: hrtimer_expire_exit: hrtimer=0xffffbbd68286fe60
<idle>-0 [002] 23454.902241: hrtimer_cancel: hrtimer=0xffffbbd6826efe70
<idle>-0 [002] 23454.902242: hrtimer_expire_entry: hrtimer=0xffffbbd6826efe70
<idle>-0 [002] 23454.902243: sched_waking: comm=cyclictest pid=12272
prio=120 target_cpu=002
<idle>-0 [002] 23454.902244: prandom_u32: ret=1102749734
<idle>-0 [002] 23454.902246: sched_wakeup: cyclictest:12272 [120] CPU:002
<idle>-0 [002] 23454.902247: hrtimer_expire_exit: hrtimer=0xffffbbd6826efe70
<idle>-0 [002] 23454.902248: write_msr: 6e0, value 4866ce957272
<idle>-0 [002] 23454.902249: local_timer_exit: vector=236
<idle>-0 [002] 23454.902250: cpu_idle: state=4294967295 cpu_id=2
<idle>-0 [002] 23454.902251: rcu_utilization: Start context switch
<idle>-0 [002] 23454.902252: rcu_utilization: End context switch
<idle>-0 [002] 23454.902253: prandom_u32: ret=3692516021
<idle>-0 [002] 23454.902254: sched_switch: swapper/2:0 [120] R ==>
cyclictest:12275 [19]
<idle>-0 [002] 23454.902256: wakeup_lat: next_comm=cyclictest lat=17
<idle>-0 [002] 23454.902258: kernel_stack: <stack trace >
=> trace_event_raw_event_synth (ffffffff8121a0db)
=> action_trace (ffffffff8121e9fb)
=> event_hist_trigger (ffffffff8121ca8d)
=> event_triggers_call (ffffffff81216c72)
[..]
Customize latency tracing
# trace-cmd extract -s
# trace-cmd report --cpu 2 | tail -30
<idle>-0 [001] d..1 23454.902254: cpu_idle: state=0 cpu_id=1
<idle>-0 [002] 23454.902239: sched_wakeup: cyclictest:12275 [19] CPU:002
<idle>-0 [002] 23454.902241: hrtimer_expire_exit: hrtimer=0xffffbbd68286fe60
<idle>-0 [002] 23454.902241: hrtimer_cancel: hrtimer=0xffffbbd6826efe70
<idle>-0 [002] 23454.902242: hrtimer_expire_entry: hrtimer=0xffffbbd6826efe70
<idle>-0 [002] 23454.902243: sched_waking: comm=cyclictest pid=12272
prio=120 target_cpu=002
<idle>-0 [002] 23454.902244: prandom_u32: ret=1102749734
<idle>-0 [002] 23454.902246: sched_wakeup: cyclictest:12272 [120] CPU:002
<idle>-0 [002] 23454.902247: hrtimer_expire_exit: hrtimer=0xffffbbd6826efe70
<idle>-0 [002] 23454.902248: write_msr: 6e0, value 4866ce957272
<idle>-0 [002] 23454.902249: local_timer_exit: vector=236
<idle>-0 [002] 23454.902250: cpu_idle: state=4294967295 cpu_id=2
<idle>-0 [002] 23454.902251: rcu_utilization: Start context switch
<idle>-0 [002] 23454.902252: rcu_utilization: End context switch
<idle>-0 [002] 23454.902253: prandom_u32: ret=3692516021
<idle>-0 [002] 23454.902254: sched_switch: swapper/2:0 [120] R ==>
cyclictest:12275 [19]
<idle>-0 [002] 23454.902256: wakeup_lat: next_comm=cyclictest lat=17
<idle>-0 [002] 23454.902258: kernel_stack: <stack trace >
=> trace_event_raw_event_synth (ffffffff8121a0db)
=> action_trace (ffffffff8121e9fb)
=> event_hist_trigger (ffffffff8121ca8d)
=> event_triggers_call (ffffffff81216c72)
[..]
Customize latency tracing
# trace-cmd extract -s
# trace-cmd report --cpu 2 | tail -30
<idle>-0 [001] d..1 23454.902254: cpu_idle: state=0 cpu_id=1
<idle>-0 [002] 23454.902239: sched_wakeup: cyclictest:12275 [19] CPU:002
<idle>-0 [002] 23454.902241: hrtimer_expire_exit: hrtimer=0xffffbbd68286fe60
<idle>-0 [002] 23454.902241: hrtimer_cancel: hrtimer=0xffffbbd6826efe70
<idle>-0 [002] 23454.902242: hrtimer_expire_entry: hrtimer=0xffffbbd6826efe70
<idle>-0 [002] 23454.902243: sched_waking: comm=cyclictest pid=12272
prio=120 target_cpu=002
<idle>-0 [002] 23454.902244: prandom_u32: ret=1102749734
<idle>-0 [002] 23454.902246: sched_wakeup: cyclictest:12272 [120] CPU:002
<idle>-0 [002] 23454.902247: hrtimer_expire_exit: hrtimer=0xffffbbd6826efe70
<idle>-0 [002] 23454.902248: write_msr: 6e0, value 4866ce957272
<idle>-0 [002] 23454.902249: local_timer_exit: vector=236
<idle>-0 [002] 23454.902250: cpu_idle: state=4294967295 cpu_id=2
<idle>-0 [002] 23454.902251: rcu_utilization: Start context switch
<idle>-0 [002] 23454.902252: rcu_utilization: End context switch
<idle>-0 [002] 23454.902253: prandom_u32: ret=3692516021
<idle>-0 [002] 23454.902254: sched_switch: swapper/2:0 [120] R ==>
cyclictest:12275 [19]
<idle>-0 [002] 23454.902256: wakeup_lat: next_comm=cyclictest lat=17
<idle>-0 [002] 23454.902258: kernel_stack: <stack trace >
=> trace_event_raw_event_synth (ffffffff8121a0db)
=> action_trace (ffffffff8121e9fb)
=> event_hist_trigger (ffffffff8121ca8d)
=> event_triggers_call (ffffffff81216c72)
[..]
Customize latency tracing
# trace-cmd extract -s
# trace-cmd report --cpu 2 | tail -30
<idle>-0 [001] d..1 23454.902254: cpu_idle: state=0 cpu_id=1
<idle>-0 [002] 23454.902239: sched_wakeup: cyclictest:12275 [19] CPU:002
<idle>-0 [002] 23454.902241: hrtimer_expire_exit: hrtimer=0xffffbbd68286fe60
<idle>-0 [002] 23454.902241: hrtimer_cancel: hrtimer=0xffffbbd6826efe70
<idle>-0 [002] 23454.902242: hrtimer_expire_entry: hrtimer=0xffffbbd6826efe70
<idle>-0 [002] 23454.902243: sched_waking: comm=cyclictest pid=12272
prio=120 target_cpu=002
<idle>-0 [002] 23454.902244: prandom_u32: ret=1102749734
<idle>-0 [002] 23454.902246: sched_wakeup: cyclictest:12272 [120] CPU:002
<idle>-0 [002] 23454.902247: hrtimer_expire_exit: hrtimer=0xffffbbd6826efe70
<idle>-0 [002] 23454.902248: write_msr: 6e0, value 4866ce957272
<idle>-0 [002] 23454.902249: local_timer_exit: vector=236
<idle>-0 [002] 23454.902250: cpu_idle: state=4294967295 cpu_id=2
<idle>-0 [002] 23454.902251: rcu_utilization: Start context switch
<idle>-0 [002] 23454.902252: rcu_utilization: End context switch
<idle>-0 [002] 23454.902253: prandom_u32: ret=3692516021
<idle>-0 [002] 23454.902254: sched_switch: swapper/2:0 [120] R ==>
cyclictest:12275 [19]
<idle>-0 [002] 23454.902256: wakeup_lat: next_comm=cyclictest lat=17
<idle>-0 [002] 23454.902258: kernel_stack: <stack trace >
=> trace_event_raw_event_synth (ffffffff8121a0db)
=> action_trace (ffffffff8121e9fb)
=> event_hist_trigger (ffffffff8121ca8d)
=> event_triggers_call (ffffffff81216c72)
[..]
Customize latency tracing
# trace-cmd extract -s
# trace-cmd report --cpu 2 | tail -30
<idle>-0 [001] d..1 23454.902254: cpu_idle: state=0 cpu_id=1
<idle>-0 [002] 23454.902239: sched_wakeup: cyclictest:12275 [19] CPU:002
<idle>-0 [002] 23454.902241: hrtimer_expire_exit: hrtimer=0xffffbbd68286fe60
<idle>-0 [002] 23454.902241: hrtimer_cancel: hrtimer=0xffffbbd6826efe70
<idle>-0 [002] 23454.902242: hrtimer_expire_entry: hrtimer=0xffffbbd6826efe70
<idle>-0 [002] 23454.902243: sched_waking: comm=cyclictest pid=12272
prio=120 target_cpu=002
<idle>-0 [002] 23454.902244: prandom_u32: ret=1102749734
<idle>-0 [002] 23454.902246: sched_wakeup: cyclictest:12272 [120] CPU:002
<idle>-0 [002] 23454.902247: hrtimer_expire_exit: hrtimer=0xffffbbd6826efe70
<idle>-0 [002] 23454.902248: write_msr: 6e0, value 4866ce957272
<idle>-0 [002] 23454.902249: local_timer_exit: vector=236
<idle>-0 [002] 23454.902250: cpu_idle: state=4294967295 cpu_id=2
<idle>-0 [002] 23454.902251: rcu_utilization: Start context switch
<idle>-0 [002] 23454.902252: rcu_utilization: End context switch
<idle>-0 [002] 23454.902253: prandom_u32: ret=3692516021
<idle>-0 [002] 23454.902254: sched_switch: swapper/2:0 [120] R ==>
cyclictest:12275 [19]
<idle>-0 [002] 23454.902256: wakeup_lat: next_comm=cyclictest lat=17
<idle>-0 [002] 23454.902258: kernel_stack: <stack trace >
=> trace_event_raw_event_synth (ffffffff8121a0db)
=> action_trace (ffffffff8121e9fb)
=> event_hist_trigger (ffffffff8121ca8d)
=> event_triggers_call (ffffffff81216c72)
[..]
Brought to you by
Steven Rostedt
rostedt@goodmis.org
@srostedt

Weitere ähnliche Inhalte

Was ist angesagt?

YOW2020 Linux Systems Performance
YOW2020 Linux Systems PerformanceYOW2020 Linux Systems Performance
YOW2020 Linux Systems PerformanceBrendan Gregg
 
BPF - in-kernel virtual machine
BPF - in-kernel virtual machineBPF - in-kernel virtual machine
BPF - in-kernel virtual machineAlexei Starovoitov
 
Linux Kernel Crashdump
Linux Kernel CrashdumpLinux Kernel Crashdump
Linux Kernel CrashdumpMarian Marinov
 
Debugging linux kernel tools and techniques
Debugging linux kernel tools and  techniquesDebugging linux kernel tools and  techniques
Debugging linux kernel tools and techniquesSatpal Parmar
 
Memory management in Linux kernel
Memory management in Linux kernelMemory management in Linux kernel
Memory management in Linux kernelVadim Nikitin
 
Linux 4.x Tracing Tools: Using BPF Superpowers
Linux 4.x Tracing Tools: Using BPF SuperpowersLinux 4.x Tracing Tools: Using BPF Superpowers
Linux 4.x Tracing Tools: Using BPF SuperpowersBrendan Gregg
 
Velocity 2015 linux perf tools
Velocity 2015 linux perf toolsVelocity 2015 linux perf tools
Velocity 2015 linux perf toolsBrendan Gregg
 
Linux kernel debugging
Linux kernel debuggingLinux kernel debugging
Linux kernel debuggingHao-Ran Liu
 
LSFMM 2019 BPF Observability
LSFMM 2019 BPF ObservabilityLSFMM 2019 BPF Observability
LSFMM 2019 BPF ObservabilityBrendan Gregg
 
Let's trace Linux Lernel with KGDB @ COSCUP 2021
Let's trace Linux Lernel with KGDB @ COSCUP 2021Let's trace Linux Lernel with KGDB @ COSCUP 2021
Let's trace Linux Lernel with KGDB @ COSCUP 2021Jian-Hong Pan
 
Linux Preempt-RT Internals
Linux Preempt-RT InternalsLinux Preempt-RT Internals
Linux Preempt-RT Internals哲豪 康哲豪
 
Reverse Mapping (rmap) in Linux Kernel
Reverse Mapping (rmap) in Linux KernelReverse Mapping (rmap) in Linux Kernel
Reverse Mapping (rmap) in Linux KernelAdrian Huang
 
Linux Initialization Process (2)
Linux Initialization Process (2)Linux Initialization Process (2)
Linux Initialization Process (2)shimosawa
 
Linux Performance Profiling and Monitoring
Linux Performance Profiling and MonitoringLinux Performance Profiling and Monitoring
Linux Performance Profiling and MonitoringGeorg Schönberger
 
Staring into the eBPF Abyss
Staring into the eBPF AbyssStaring into the eBPF Abyss
Staring into the eBPF AbyssSasha Goldshtein
 
Kernel Recipes 2017 - Understanding the Linux kernel via ftrace - Steven Rostedt
Kernel Recipes 2017 - Understanding the Linux kernel via ftrace - Steven RostedtKernel Recipes 2017 - Understanding the Linux kernel via ftrace - Steven Rostedt
Kernel Recipes 2017 - Understanding the Linux kernel via ftrace - Steven RostedtAnne Nicolas
 
Kernel Recipes 2019 - Faster IO through io_uring
Kernel Recipes 2019 - Faster IO through io_uringKernel Recipes 2019 - Faster IO through io_uring
Kernel Recipes 2019 - Faster IO through io_uringAnne Nicolas
 

Was ist angesagt? (20)

YOW2020 Linux Systems Performance
YOW2020 Linux Systems PerformanceYOW2020 Linux Systems Performance
YOW2020 Linux Systems Performance
 
BPF - in-kernel virtual machine
BPF - in-kernel virtual machineBPF - in-kernel virtual machine
BPF - in-kernel virtual machine
 
Linux Kernel Crashdump
Linux Kernel CrashdumpLinux Kernel Crashdump
Linux Kernel Crashdump
 
Debugging linux kernel tools and techniques
Debugging linux kernel tools and  techniquesDebugging linux kernel tools and  techniques
Debugging linux kernel tools and techniques
 
Memory management in Linux kernel
Memory management in Linux kernelMemory management in Linux kernel
Memory management in Linux kernel
 
Linux 4.x Tracing Tools: Using BPF Superpowers
Linux 4.x Tracing Tools: Using BPF SuperpowersLinux 4.x Tracing Tools: Using BPF Superpowers
Linux 4.x Tracing Tools: Using BPF Superpowers
 
Velocity 2015 linux perf tools
Velocity 2015 linux perf toolsVelocity 2015 linux perf tools
Velocity 2015 linux perf tools
 
Linux kernel debugging
Linux kernel debuggingLinux kernel debugging
Linux kernel debugging
 
Introduction to Perf
Introduction to PerfIntroduction to Perf
Introduction to Perf
 
LSFMM 2019 BPF Observability
LSFMM 2019 BPF ObservabilityLSFMM 2019 BPF Observability
LSFMM 2019 BPF Observability
 
Let's trace Linux Lernel with KGDB @ COSCUP 2021
Let's trace Linux Lernel with KGDB @ COSCUP 2021Let's trace Linux Lernel with KGDB @ COSCUP 2021
Let's trace Linux Lernel with KGDB @ COSCUP 2021
 
Linux Preempt-RT Internals
Linux Preempt-RT InternalsLinux Preempt-RT Internals
Linux Preempt-RT Internals
 
Linux Network Stack
Linux Network StackLinux Network Stack
Linux Network Stack
 
eBPF maps 101
eBPF maps 101eBPF maps 101
eBPF maps 101
 
Reverse Mapping (rmap) in Linux Kernel
Reverse Mapping (rmap) in Linux KernelReverse Mapping (rmap) in Linux Kernel
Reverse Mapping (rmap) in Linux Kernel
 
Linux Initialization Process (2)
Linux Initialization Process (2)Linux Initialization Process (2)
Linux Initialization Process (2)
 
Linux Performance Profiling and Monitoring
Linux Performance Profiling and MonitoringLinux Performance Profiling and Monitoring
Linux Performance Profiling and Monitoring
 
Staring into the eBPF Abyss
Staring into the eBPF AbyssStaring into the eBPF Abyss
Staring into the eBPF Abyss
 
Kernel Recipes 2017 - Understanding the Linux kernel via ftrace - Steven Rostedt
Kernel Recipes 2017 - Understanding the Linux kernel via ftrace - Steven RostedtKernel Recipes 2017 - Understanding the Linux kernel via ftrace - Steven Rostedt
Kernel Recipes 2017 - Understanding the Linux kernel via ftrace - Steven Rostedt
 
Kernel Recipes 2019 - Faster IO through io_uring
Kernel Recipes 2019 - Faster IO through io_uringKernel Recipes 2019 - Faster IO through io_uring
Kernel Recipes 2019 - Faster IO through io_uring
 

Ähnlich wie New Ways to Find Latency in Linux Using Tracing

Performance Schema for MySQL Troubleshooting
Performance Schema for MySQL TroubleshootingPerformance Schema for MySQL Troubleshooting
Performance Schema for MySQL TroubleshootingSveta Smirnova
 
Percona Live UK 2014 Part III
Percona Live UK 2014  Part IIIPercona Live UK 2014  Part III
Percona Live UK 2014 Part IIIAlkin Tezuysal
 
Kernel Recipes 2019 - ftrace: Where modifying a running kernel all started
Kernel Recipes 2019 - ftrace: Where modifying a running kernel all startedKernel Recipes 2019 - ftrace: Where modifying a running kernel all started
Kernel Recipes 2019 - ftrace: Where modifying a running kernel all startedAnne Nicolas
 
OSDC 2017 - Werner Fischer - Linux performance profiling and monitoring
OSDC 2017 - Werner Fischer - Linux performance profiling and monitoringOSDC 2017 - Werner Fischer - Linux performance profiling and monitoring
OSDC 2017 - Werner Fischer - Linux performance profiling and monitoringNETWAYS
 
Interruption Timer Périodique
Interruption Timer PériodiqueInterruption Timer Périodique
Interruption Timer PériodiqueAnne Nicolas
 
Kernel Recipes 2017 - Performance analysis Superpowers with Linux BPF - Brend...
Kernel Recipes 2017 - Performance analysis Superpowers with Linux BPF - Brend...Kernel Recipes 2017 - Performance analysis Superpowers with Linux BPF - Brend...
Kernel Recipes 2017 - Performance analysis Superpowers with Linux BPF - Brend...Anne Nicolas
 
Kernel Recipes 2017: Performance Analysis with BPF
Kernel Recipes 2017: Performance Analysis with BPFKernel Recipes 2017: Performance Analysis with BPF
Kernel Recipes 2017: Performance Analysis with BPFBrendan Gregg
 
pg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQLpg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQLCommand Prompt., Inc
 
pg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQLpg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQLMark Wong
 
re:Invent 2019 BPF Performance Analysis at Netflix
re:Invent 2019 BPF Performance Analysis at Netflixre:Invent 2019 BPF Performance Analysis at Netflix
re:Invent 2019 BPF Performance Analysis at NetflixBrendan Gregg
 
OSSNA 2017 Performance Analysis Superpowers with Linux BPF
OSSNA 2017 Performance Analysis Superpowers with Linux BPFOSSNA 2017 Performance Analysis Superpowers with Linux BPF
OSSNA 2017 Performance Analysis Superpowers with Linux BPFBrendan Gregg
 
EKON22 Introduction to Machinelearning
EKON22 Introduction to MachinelearningEKON22 Introduction to Machinelearning
EKON22 Introduction to MachinelearningMax Kleiner
 
bcc/BPF tools - Strategy, current tools, future challenges
bcc/BPF tools - Strategy, current tools, future challengesbcc/BPF tools - Strategy, current tools, future challenges
bcc/BPF tools - Strategy, current tools, future challengesIO Visor Project
 
Debugging linux issues with eBPF
Debugging linux issues with eBPFDebugging linux issues with eBPF
Debugging linux issues with eBPFIvan Babrou
 
ANALYZE for executable statements - a new way to do optimizer troubleshooting...
ANALYZE for executable statements - a new way to do optimizer troubleshooting...ANALYZE for executable statements - a new way to do optimizer troubleshooting...
ANALYZE for executable statements - a new way to do optimizer troubleshooting...Sergey Petrunya
 
Undelete (and more) rows from the binary log
Undelete (and more) rows from the binary logUndelete (and more) rows from the binary log
Undelete (and more) rows from the binary logFrederic Descamps
 

Ähnlich wie New Ways to Find Latency in Linux Using Tracing (20)

Performance Schema for MySQL Troubleshooting
Performance Schema for MySQL TroubleshootingPerformance Schema for MySQL Troubleshooting
Performance Schema for MySQL Troubleshooting
 
Percona Live UK 2014 Part III
Percona Live UK 2014  Part IIIPercona Live UK 2014  Part III
Percona Live UK 2014 Part III
 
Kernel Recipes 2019 - ftrace: Where modifying a running kernel all started
Kernel Recipes 2019 - ftrace: Where modifying a running kernel all startedKernel Recipes 2019 - ftrace: Where modifying a running kernel all started
Kernel Recipes 2019 - ftrace: Where modifying a running kernel all started
 
OSDC 2017 - Werner Fischer - Linux performance profiling and monitoring
OSDC 2017 - Werner Fischer - Linux performance profiling and monitoringOSDC 2017 - Werner Fischer - Linux performance profiling and monitoring
OSDC 2017 - Werner Fischer - Linux performance profiling and monitoring
 
Interruption Timer Périodique
Interruption Timer PériodiqueInterruption Timer Périodique
Interruption Timer Périodique
 
Kernel Recipes 2017 - Performance analysis Superpowers with Linux BPF - Brend...
Kernel Recipes 2017 - Performance analysis Superpowers with Linux BPF - Brend...Kernel Recipes 2017 - Performance analysis Superpowers with Linux BPF - Brend...
Kernel Recipes 2017 - Performance analysis Superpowers with Linux BPF - Brend...
 
Kernel Recipes 2017: Performance Analysis with BPF
Kernel Recipes 2017: Performance Analysis with BPFKernel Recipes 2017: Performance Analysis with BPF
Kernel Recipes 2017: Performance Analysis with BPF
 
pg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQLpg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQL
 
pg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQLpg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQL
 
re:Invent 2019 BPF Performance Analysis at Netflix
re:Invent 2019 BPF Performance Analysis at Netflixre:Invent 2019 BPF Performance Analysis at Netflix
re:Invent 2019 BPF Performance Analysis at Netflix
 
OSSNA 2017 Performance Analysis Superpowers with Linux BPF
OSSNA 2017 Performance Analysis Superpowers with Linux BPFOSSNA 2017 Performance Analysis Superpowers with Linux BPF
OSSNA 2017 Performance Analysis Superpowers with Linux BPF
 
EKON22 Introduction to Machinelearning
EKON22 Introduction to MachinelearningEKON22 Introduction to Machinelearning
EKON22 Introduction to Machinelearning
 
BPF Tools 2017
BPF Tools 2017BPF Tools 2017
BPF Tools 2017
 
bcc/BPF tools - Strategy, current tools, future challenges
bcc/BPF tools - Strategy, current tools, future challengesbcc/BPF tools - Strategy, current tools, future challenges
bcc/BPF tools - Strategy, current tools, future challenges
 
Debugging linux issues with eBPF
Debugging linux issues with eBPFDebugging linux issues with eBPF
Debugging linux issues with eBPF
 
ANALYZE for executable statements - a new way to do optimizer troubleshooting...
ANALYZE for executable statements - a new way to do optimizer troubleshooting...ANALYZE for executable statements - a new way to do optimizer troubleshooting...
ANALYZE for executable statements - a new way to do optimizer troubleshooting...
 
Perf Tuning Short
Perf Tuning ShortPerf Tuning Short
Perf Tuning Short
 
Mysql tracing
Mysql tracingMysql tracing
Mysql tracing
 
Mysql tracing
Mysql tracingMysql tracing
Mysql tracing
 
Undelete (and more) rows from the binary log
Undelete (and more) rows from the binary logUndelete (and more) rows from the binary log
Undelete (and more) rows from the binary log
 

Mehr von ScyllaDB

Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
What Developers Need to Unlearn for High Performance NoSQL
What Developers Need to Unlearn for High Performance NoSQLWhat Developers Need to Unlearn for High Performance NoSQL
What Developers Need to Unlearn for High Performance NoSQLScyllaDB
 
Low Latency at Extreme Scale: Proven Practices & Pitfalls
Low Latency at Extreme Scale: Proven Practices & PitfallsLow Latency at Extreme Scale: Proven Practices & Pitfalls
Low Latency at Extreme Scale: Proven Practices & PitfallsScyllaDB
 
Dissecting Real-World Database Performance Dilemmas
Dissecting Real-World Database Performance DilemmasDissecting Real-World Database Performance Dilemmas
Dissecting Real-World Database Performance DilemmasScyllaDB
 
Beyond Linear Scaling: A New Path for Performance with ScyllaDB
Beyond Linear Scaling: A New Path for Performance with ScyllaDBBeyond Linear Scaling: A New Path for Performance with ScyllaDB
Beyond Linear Scaling: A New Path for Performance with ScyllaDBScyllaDB
 
Dissecting Real-World Database Performance Dilemmas
Dissecting Real-World Database Performance DilemmasDissecting Real-World Database Performance Dilemmas
Dissecting Real-World Database Performance DilemmasScyllaDB
 
Database Performance at Scale Masterclass: Workload Characteristics by Felipe...
Database Performance at Scale Masterclass: Workload Characteristics by Felipe...Database Performance at Scale Masterclass: Workload Characteristics by Felipe...
Database Performance at Scale Masterclass: Workload Characteristics by Felipe...ScyllaDB
 
Database Performance at Scale Masterclass: Database Internals by Pavel Emelya...
Database Performance at Scale Masterclass: Database Internals by Pavel Emelya...Database Performance at Scale Masterclass: Database Internals by Pavel Emelya...
Database Performance at Scale Masterclass: Database Internals by Pavel Emelya...ScyllaDB
 
Database Performance at Scale Masterclass: Driver Strategies by Piotr Sarna
Database Performance at Scale Masterclass: Driver Strategies by Piotr SarnaDatabase Performance at Scale Masterclass: Driver Strategies by Piotr Sarna
Database Performance at Scale Masterclass: Driver Strategies by Piotr SarnaScyllaDB
 
Replacing Your Cache with ScyllaDB
Replacing Your Cache with ScyllaDBReplacing Your Cache with ScyllaDB
Replacing Your Cache with ScyllaDBScyllaDB
 
Powering Real-Time Apps with ScyllaDB_ Low Latency & Linear Scalability
Powering Real-Time Apps with ScyllaDB_ Low Latency & Linear ScalabilityPowering Real-Time Apps with ScyllaDB_ Low Latency & Linear Scalability
Powering Real-Time Apps with ScyllaDB_ Low Latency & Linear ScalabilityScyllaDB
 
7 Reasons Not to Put an External Cache in Front of Your Database.pptx
7 Reasons Not to Put an External Cache in Front of Your Database.pptx7 Reasons Not to Put an External Cache in Front of Your Database.pptx
7 Reasons Not to Put an External Cache in Front of Your Database.pptxScyllaDB
 
Getting the most out of ScyllaDB
Getting the most out of ScyllaDBGetting the most out of ScyllaDB
Getting the most out of ScyllaDBScyllaDB
 
NoSQL Database Migration Masterclass - Session 2: The Anatomy of a Migration
NoSQL Database Migration Masterclass - Session 2: The Anatomy of a MigrationNoSQL Database Migration Masterclass - Session 2: The Anatomy of a Migration
NoSQL Database Migration Masterclass - Session 2: The Anatomy of a MigrationScyllaDB
 
NoSQL Database Migration Masterclass - Session 3: Migration Logistics
NoSQL Database Migration Masterclass - Session 3: Migration LogisticsNoSQL Database Migration Masterclass - Session 3: Migration Logistics
NoSQL Database Migration Masterclass - Session 3: Migration LogisticsScyllaDB
 
NoSQL Data Migration Masterclass - Session 1 Migration Strategies and Challenges
NoSQL Data Migration Masterclass - Session 1 Migration Strategies and ChallengesNoSQL Data Migration Masterclass - Session 1 Migration Strategies and Challenges
NoSQL Data Migration Masterclass - Session 1 Migration Strategies and ChallengesScyllaDB
 
ScyllaDB Virtual Workshop
ScyllaDB Virtual WorkshopScyllaDB Virtual Workshop
ScyllaDB Virtual WorkshopScyllaDB
 
DBaaS in the Real World: Risks, Rewards & Tradeoffs
DBaaS in the Real World: Risks, Rewards & TradeoffsDBaaS in the Real World: Risks, Rewards & Tradeoffs
DBaaS in the Real World: Risks, Rewards & TradeoffsScyllaDB
 
Build Low-Latency Applications in Rust on ScyllaDB
Build Low-Latency Applications in Rust on ScyllaDBBuild Low-Latency Applications in Rust on ScyllaDB
Build Low-Latency Applications in Rust on ScyllaDBScyllaDB
 
NoSQL Data Modeling 101
NoSQL Data Modeling 101NoSQL Data Modeling 101
NoSQL Data Modeling 101ScyllaDB
 

Mehr von ScyllaDB (20)

Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
What Developers Need to Unlearn for High Performance NoSQL
What Developers Need to Unlearn for High Performance NoSQLWhat Developers Need to Unlearn for High Performance NoSQL
What Developers Need to Unlearn for High Performance NoSQL
 
Low Latency at Extreme Scale: Proven Practices & Pitfalls
Low Latency at Extreme Scale: Proven Practices & PitfallsLow Latency at Extreme Scale: Proven Practices & Pitfalls
Low Latency at Extreme Scale: Proven Practices & Pitfalls
 
Dissecting Real-World Database Performance Dilemmas
Dissecting Real-World Database Performance DilemmasDissecting Real-World Database Performance Dilemmas
Dissecting Real-World Database Performance Dilemmas
 
Beyond Linear Scaling: A New Path for Performance with ScyllaDB
Beyond Linear Scaling: A New Path for Performance with ScyllaDBBeyond Linear Scaling: A New Path for Performance with ScyllaDB
Beyond Linear Scaling: A New Path for Performance with ScyllaDB
 
Dissecting Real-World Database Performance Dilemmas
Dissecting Real-World Database Performance DilemmasDissecting Real-World Database Performance Dilemmas
Dissecting Real-World Database Performance Dilemmas
 
Database Performance at Scale Masterclass: Workload Characteristics by Felipe...
Database Performance at Scale Masterclass: Workload Characteristics by Felipe...Database Performance at Scale Masterclass: Workload Characteristics by Felipe...
Database Performance at Scale Masterclass: Workload Characteristics by Felipe...
 
Database Performance at Scale Masterclass: Database Internals by Pavel Emelya...
Database Performance at Scale Masterclass: Database Internals by Pavel Emelya...Database Performance at Scale Masterclass: Database Internals by Pavel Emelya...
Database Performance at Scale Masterclass: Database Internals by Pavel Emelya...
 
Database Performance at Scale Masterclass: Driver Strategies by Piotr Sarna
Database Performance at Scale Masterclass: Driver Strategies by Piotr SarnaDatabase Performance at Scale Masterclass: Driver Strategies by Piotr Sarna
Database Performance at Scale Masterclass: Driver Strategies by Piotr Sarna
 
Replacing Your Cache with ScyllaDB
Replacing Your Cache with ScyllaDBReplacing Your Cache with ScyllaDB
Replacing Your Cache with ScyllaDB
 
Powering Real-Time Apps with ScyllaDB_ Low Latency & Linear Scalability
Powering Real-Time Apps with ScyllaDB_ Low Latency & Linear ScalabilityPowering Real-Time Apps with ScyllaDB_ Low Latency & Linear Scalability
Powering Real-Time Apps with ScyllaDB_ Low Latency & Linear Scalability
 
7 Reasons Not to Put an External Cache in Front of Your Database.pptx
7 Reasons Not to Put an External Cache in Front of Your Database.pptx7 Reasons Not to Put an External Cache in Front of Your Database.pptx
7 Reasons Not to Put an External Cache in Front of Your Database.pptx
 
Getting the most out of ScyllaDB
Getting the most out of ScyllaDBGetting the most out of ScyllaDB
Getting the most out of ScyllaDB
 
NoSQL Database Migration Masterclass - Session 2: The Anatomy of a Migration
NoSQL Database Migration Masterclass - Session 2: The Anatomy of a MigrationNoSQL Database Migration Masterclass - Session 2: The Anatomy of a Migration
NoSQL Database Migration Masterclass - Session 2: The Anatomy of a Migration
 
NoSQL Database Migration Masterclass - Session 3: Migration Logistics
NoSQL Database Migration Masterclass - Session 3: Migration LogisticsNoSQL Database Migration Masterclass - Session 3: Migration Logistics
NoSQL Database Migration Masterclass - Session 3: Migration Logistics
 
NoSQL Data Migration Masterclass - Session 1 Migration Strategies and Challenges
NoSQL Data Migration Masterclass - Session 1 Migration Strategies and ChallengesNoSQL Data Migration Masterclass - Session 1 Migration Strategies and Challenges
NoSQL Data Migration Masterclass - Session 1 Migration Strategies and Challenges
 
ScyllaDB Virtual Workshop
ScyllaDB Virtual WorkshopScyllaDB Virtual Workshop
ScyllaDB Virtual Workshop
 
DBaaS in the Real World: Risks, Rewards & Tradeoffs
DBaaS in the Real World: Risks, Rewards & TradeoffsDBaaS in the Real World: Risks, Rewards & Tradeoffs
DBaaS in the Real World: Risks, Rewards & Tradeoffs
 
Build Low-Latency Applications in Rust on ScyllaDB
Build Low-Latency Applications in Rust on ScyllaDBBuild Low-Latency Applications in Rust on ScyllaDB
Build Low-Latency Applications in Rust on ScyllaDB
 
NoSQL Data Modeling 101
NoSQL Data Modeling 101NoSQL Data Modeling 101
NoSQL Data Modeling 101
 

Kürzlich hochgeladen

How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 

Kürzlich hochgeladen (20)

How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 

New Ways to Find Latency in Linux Using Tracing

  • 1. Brought to you by New ways to find latency in Linux using tracing Steven Rostedt Open Source Engineer at VMware
  • 2. ©2021 VMware, Inc. New ways to find latency in Linux using tracing Steven Rostedt Open Source Engineer srostedt@vmware.com twitter: @srostedt
  • 3. What is ftrace? ● Official tracer of the Linux Kernel – Introduced in 2008 ● Came from the PREEMPT_RT patch set – Initially focused on finding causes of latency ● Has grows significantly since 2008 – Added new ways to find latency – Does much more than find latency
  • 4. The ftrace interface (the tracefs file system) # mount -t tracefs nodev /sys/kernel/tracing # ls /sys/kernel/tracing available_events max_graph_depth snapshot available_filter_functions options stack_max_size available_tracers osnoise stack_trace buffer_percent per_cpu stack_trace_filter buffer_size_kb printk_formats synthetic_events buffer_total_size_kb README timestamp_mode current_tracer recursed_functions trace dynamic_events saved_cmdlines trace_clock dyn_ftrace_total_info saved_cmdlines_size trace_marker enabled_functions saved_tgids trace_marker_raw error_log set_event trace_options eval_map set_event_notrace_pid trace_pipe events set_event_pid trace_stat free_buffer set_ftrace_filter tracing_cpumask function_profile_enabled set_ftrace_notrace tracing_max_latency hwlat_detector set_ftrace_notrace_pid tracing_on instances set_ftrace_pid tracing_thresh kprobe_events set_graph_function uprobe_events kprobe_profile set_graph_notrace uprobe_profile
  • 5. Introducing trace-cmd Luckily today, we do not need to know all those files ● trace-cmd is a front end interface to ftrace ● It interfaces with the tracefs directory for you https://www.trace-cmd.org git clone git://git.kernel.org/pub/scm/utils/trace-cmd/trace-cmd.git
  • 6. The Old Tracers ● Wake up trace – All tasks – RT tasks – Deadline Tasks ● Preemption off tracers – irqsoff tracer – preemptoff tracer – preemptirqsoff tracer
  • 7. Wake up tracer Task 1 Interrupt Wake up Task 2 event Task 2 Sched switch event latency
  • 8. Running wakeup_rt tracer # trace-cmd start -p wakeup_rt # trace-cmd show # tracer: wakeup_rt # # wakeup_rt latency trace v1.1.5 on 5.10.52-test-rt47 # latency: 94 us, #211/211, CPU#4 | (M:preempt_rt VP:0, KP:0, SP:0 HP:0 #P:8) # ----------------- # | task: rcuc/4-42 (uid:0 nice:0 policy:1 rt_prio:1) # ----------------- # # _--------=> CPU# # / _-------=> irqs-off # | / _------=> need-resched # || / _-----=> need-resched-lazy # ||| / _----=> hardirq/softirq # |||| / _---=> preempt-depth # ||||| / _--=> preempt-lazy-depth # |||||| / _-=> migrate-disable # ||||||| / delay # cmd pid |||||||| time | caller # / |||||||| | / bash-1872 4dN.h5.. 1us+: 1872:120:R + [004] 42: 98:R rcuc/4 bash-1872 4dN.h5.. 30us : <stack trace> => __ftrace_trace_stack => probe_wakeup => ttwu_do_wakeup => try_to_wake_up
  • 9. Running wakeup_rt tracer => invoke_rcu_core => rcu_sched_clock_irq => update_process_times => tick_sched_handle => tick_sched_timer => __hrtimer_run_queues => hrtimer_interrupt => __sysvec_apic_timer_interrupt => asm_call_irq_on_stack => sysvec_apic_timer_interrupt => asm_sysvec_apic_timer_interrupt => lock_acquire => _raw_spin_lock => shmem_get_inode => shmem_mknod => lookup_open.isra.0 => path_openat => do_filp_open => do_sys_openat2 => __x64_sys_openat => do_syscall_64 => entry_SYSCALL_64_after_hwframe bash-1872 4dN.h5.. 31us : 0 bash-1872 4dN.h4.. 32us : task_woken_rt ←ttwu_do_wakeup bash-1872 4dN..2.. 87us : put_prev_entity <-put_prev_task_fair bash-1872 4dN..2.. 87us : update_curr <-put_prev_entity bash-1872 4dN..2.. 87us : __update_load_avg_se <-update_load_avg bash-1872 4dN..2.. 87us : __update_load_avg_cfs_rq <-update_load_avg
  • 10. Running wakeup_rt tracer bash-1872 4dN..2.. 87us : pick_next_task_stop <-__schedule bash-1872 4dN..2.. 87us : pick_next_task_dl <-__schedule bash-1872 4dN..2.. 87us : pick_next_task_rt <-__schedule bash-1872 4dN..2.. 88us : update_rt_rq_load_avg <-pick_next_task_rt bash-1872 4d...3.. 88us : __schedule bash-1872 4d...3.. 88us : 1872:120:R ==> [004] 42: 98:R rcuc/4 bash-1872 4d...3.. 94us : <stack trace> => __ftrace_trace_stack => probe_wakeup_sched_switch => __schedule => preempt_schedule_common => preempt_schedule_thunk => _raw_spin_unlock => shmem_get_inode => shmem_mknod => lookup_open.isra.0 => path_openat => do_filp_open => do_sys_openat2 => __x64_sys_openat => do_syscall_64 => entry_SYSCALL_64_after_hwframe
  • 11. Interrupt off tracer Task Interrupt Irqs disabled latency Irqs enabled
  • 12. Running preemptirqsoff tracer # trace-cmd start -p preemptirqsoff # trace-cmd show # tracer: preemptirqsoff # # preemptirqsoff latency trace v1.1.5 on 5.14.0-rc4-test+ # -------------------------------------------------------------------- # latency: 2325 us, #3005/3005, CPU#1 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:8) # ----------------- # | task: bash-48651 (uid:0 nice:0 policy:0 rt_prio:0) # ----------------- # => started at: _raw_spin_lock # => ended at: _raw_spin_unlock # # # _------=> CPU# # / _-----=> irqs-off # | / _----=> need-resched # || / _---=> hardirq/softirq # ||| / _--=> preempt-depth # |||| / delay # cmd pid ||||| time | caller # / ||||| | / trace-cm-48651 1...1 0us : _raw_spin_lock trace-cm-48651 1...1 1us : do_raw_spin_trylock <-_raw_spin_lock trace-cm-48651 1...1 1us : flush_tlb_batched_pending <-unmap_page_range trace-cm-48651 1...1 2us : vm_normal_page <-unmap_page_range trace-cm-48651 1...1 2us : page_remove_rmap <-unmap_page_range
  • 13. Running preemptirqsoff tracer [...] trace-cm-48651 1...1 2313us : unlock_page_memcg <-unmap_page_range trace-cm-48651 1...1 2314us : __rcu_read_unlock <-unlock_page_memcg trace-cm-48651 1...1 2315us : __tlb_remove_page_size <-unmap_page_range trace-cm-48651 1...1 2316us : vm_normal_page <-unmap_page_range trace-cm-48651 1...1 2317us : page_remove_rmap <-unmap_page_range trace-cm-48651 1...1 2318us : lock_page_memcg <-page_remove_rmap trace-cm-48651 1...1 2318us : __rcu_read_lock <-lock_page_memcg trace-cm-48651 1...1 2319us : unlock_page_memcg <-unmap_page_range trace-cm-48651 1...1 2320us : __rcu_read_unlock <-unlock_page_memcg trace-cm-48651 1...1 2321us : __tlb_remove_page_size <-unmap_page_range trace-cm-48651 1...1 2322us : _raw_spin_unlock <-unmap_page_range trace-cm-48651 1...1 2323us : do_raw_spin_unlock <-_raw_spin_unlock trace-cm-48651 1...1 2324us : preempt_count_sub <-_raw_spin_unlock trace-cm-48651 1...1 2325us : _raw_spin_unlock trace-cm-48651 1...1 2327us+: tracer_preempt_on <-_raw_spin_unlock trace-cm-48651 1...1 2343us : <stack trace> => unmap_page_range => unmap_vmas => exit_mmap => mmput => begin_new_exec => load_elf_binary => bprm_execve => do_execveat_common => __x64_sys_execve => do_syscall_64 => entry_SYSCALL_64_after_hwframe
  • 14. Running preemptirqsoff tracer # trace-cmd start -p preemptirqsoff -d -O sym-offset # trace-cmd show # tracer: preemptirqsoff [..] # latency: 248 us, #4/4, CPU#6 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:8) # ----------------- # | task: ksoftirqd/6-47 (uid:0 nice:0 policy:0 rt_prio:0) # ----------------- # => started at: run_ksoftirqd # => ended at: run_ksoftirqd [..] # cmd pid ||||| time | caller # / ||||| | / <idle>-0 4d..1 1us!: cpuidle_enter_state+0xcf/0x410 kworker/-48096 4...1 242us : schedule+0x4d/0xe0 <-schedule+0x4d/0xe0 kworker/-48096 4...1 243us : tracer_preempt_on+0xf4/0x110 <-schedule+0x4d/0xe0 kworker/-48096 4...1 248us : <stack trace> => worker_thread+0xd4/0x3c0 => kthread+0x155/0x180 => ret_from_fork+0x22/0x30
  • 16. Measuring latency from interrupts ● You can easily trace the latency from interrupts – For x86: # trace-cmd record -p function_graph -l handle_irq_event -l ‘*sysvec_*’ -e irq_handler_entry -e 'irq_vectors:*entry*'
  • 17. Tracing Latency from Interrupts # trace-cmd report -l --cpu 2 sleep-2513 [002] 2973.197184: funcgraph_entry: | __sysvec_apic_timer_interrupt() { sleep-2513 [002] 2973.197186: local_timer_entry: vector=236 sleep-2513 [002] 2973.197196: funcgraph_exit: + 12.233 us | } sleep-2513 [002] 2973.197206: funcgraph_entry: | __sysvec_irq_work() { sleep-2513 [002] 2973.197207: irq_work_entry: vector=246 sleep-2513 [002] 2973.197207: funcgraph_exit: 1.405 us | } <idle>-0 [002] 2973.198186: funcgraph_entry: | __sysvec_apic_timer_interrupt() { <idle>-0 [002] 2973.198187: local_timer_entry: vector=236 <idle>-0 [002] 2973.198193: funcgraph_exit: 7.992 us | } <idle>-0 [002] 2974.991721: funcgraph_entry: | handle_irq_event() { <idle>-0 [002] 2974.991723: irq_handler_entry: irq=24 name=ahci[0000:00:1f.2] <idle>-0 [002] 2974.991733: funcgraph_exit: + 13.158 us | } <idle>-0 [002] 2977.039843: funcgraph_entry: | handle_irq_event() { <idle>-0 [002] 2977.039845: irq_handler_entry: irq=24 name=ahci[0000:00:1f.2] <idle>-0 [002] 2977.039855: funcgraph_exit: + 12.869 us | }
  • 18. Problems with the latency tracers ● No control over what tasks they trace – They trace the highest priority process – May not be the process you are interested in ● Not flexible – Has one use case – General for the entire system
  • 19. Tracing interrupt latency with function graph tracer ● Does not have a “max latency” – You see all the latency in a trace – No way to record the max latency found
  • 20. Introducing Synthetic Events ● Can map two events into a single event
  • 21. Introducing Synthetic Events ● Can map two events into a single event – sched_waking + sched_switch wakeup_latency → – irqs_disabled + irqs_enabled irqs_off_latency → – irq_enter_handler + irq_exit_handler irq_latency →
  • 22. Introducing Synthetic Events ● Can map two events into a single event – sched_waking + sched_switch wakeup_latency → – irqs_disabled + irqs_enabled irqs_off_latency → – irq_enter_handler + irq_exit_handler irq_latency → ● Have all the functionality as a normal event
  • 23. Introducing Synthetic Events ● Can map two events into a single event – sched_waking + sched_switch wakeup_latency → – irqs_disabled + irqs_enabled irqs_off_latency → – irq_enter_handler + irq_exit_handler irq_latency → ● Have all the functionality as a normal event – Can be filtered on
  • 24. Introducing Synthetic Events ● Can map two events into a single event – sched_waking + sched_switch wakeup_latency → – irqs_disabled + irqs_enabled irqs_off_latency → – irq_enter_handler + irq_exit_handler irq_latency → ● Have all the functionality as a normal event – Can be filtered on – Can have triggers attached (like histograms)
  • 25. Synthetic events # echo 'wakeup_lat s32 pid; u64 delta;' > /sys/kernel/tracing/synthetic_events # echo 'hist:keys=pid:__arg__1=pid,__arg__2=common_timestamp.usecs' > /sys/kernel/tracing/events/sched/sched_waking/trigger # echo 'hist:keys=next_pid:pid=$__arg__1,’ ‘delta=common_timestamp.usecs-$__arg__2:onmatch(sched.sched_waking)’ ‘.trace(wakeup_lat,$pid,$delta) if next_comm == “cyclictest”' > /sys/kernel/tracing/events/sched/sched_switch/trigger
  • 26. Synthetic events # echo 'wakeup_lat s32 pid; u64 delta;' > /sys/kernel/tracing/synthetic_events # echo 'hist:keys=pid:__arg__1=pid,__arg__2=common_timestamp.usecs' > /sys/kernel/tracing/events/sched/sched_waking/trigger # echo 'hist:keys=next_pid:pid=$__arg__1,’ ‘delta=common_timestamp.usecs-$__arg__2:onmatch(sched.sched_waking)’ ‘.trace(wakeup_lat,$pid,$delta) if next_comm == “cyclictest”' > /sys/kernel/tracing/events/sched/sched_switch/trigger Too Complex!
  • 27. Introducing libtracefs A library to interact with the tracefs file system All functions have man pages The tracefs_sql man page has the sqlhist program in it https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git/ git clone git://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git cd libtracefs make sqlhist # builds from the man page!
  • 28. Synthetic events # sqlhist -e -n wakeup_lat ‘SELECT start.pid, (end.TIMESTAMP_USECS - start.TIMESTAMP_USECS) AS delta FROM ’ ‘sched_waking AS start JOIN sched_switch AS end ON start.pid = end.next_pid' ‘WHERE end.next_pid = “cyclictest”’
  • 29. Synthetic events # sqlhist -e -n wakeup_lat ‘SELECT start.pid, (end.TIMESTAMP_USECS - start.TIMESTAMP_USECS) AS delta FROM ’ ‘sched_waking AS start JOIN sched_switch AS end ON start.pid = end.next_pid' ‘WHERE end.next_pid = “cyclictest”’
  • 30. Synthetic events # sqlhist -e -n wakeup_lat ‘SELECT start.pid, (end.TIMESTAMP_USECS - start.TIMESTAMP_USECS) AS delta FROM ’ ‘sched_waking AS start JOIN sched_switch AS end ON start.pid = end.next_pid' ‘WHERE end.next_pid = “cyclictest”’
  • 31. Synthetic events # sqlhist -e -n wakeup_lat ‘SELECT start.pid, (end.TIMESTAMP_USECS - start.TIMESTAMP_USECS) AS delta FROM ’ ‘sched_waking AS start JOIN sched_switch AS end ON start.pid = end.next_pid' ‘WHERE end.next_pid = “cyclictest”’
  • 32. Synthetic events # sqlhist -e -n wakeup_lat ‘SELECT start.pid, (end.TIMESTAMP_USECS - start.TIMESTAMP_USECS) AS delta FROM ’ ‘sched_waking AS start JOIN sched_switch AS end ON start.pid = end.next_pid' ‘WHERE end.next_pid = “cyclictest”’
  • 33. Synthetic events # sqlhist -e -n wakeup_lat ‘SELECT start.pid, (end.TIMESTAMP_USECS - start.TIMESTAMP_USECS) AS delta FROM ’ ‘sched_waking AS start JOIN sched_switch AS end ON start.pid = end.next_pid' ‘WHERE end.next_pid = “cyclictest”’
  • 34. Synthetic events # sqlhist -e -n wakeup_lat ‘SELECT start.pid, (end.TIMESTAMP_USECS - start.TIMESTAMP_USECS) AS delta FROM ’ ‘sched_waking AS start JOIN sched_switch AS end ON start.pid = end.next_pid' ‘WHERE end.next_pid = “cyclictest”’
  • 35. Synthetic events # sqlhist -e -n wakeup_lat ‘SELECT start.pid, (end.TIMESTAMP_USECS - start.TIMESTAMP_USECS) AS delta FROM ’ ‘sched_waking AS start JOIN sched_switch AS end ON start.pid = end.next_pid' ‘WHERE end.next_pid = “cyclictest”’
  • 36. Synthetic events # sqlhist -e -n wakeup_lat ‘SELECT start.pid, (end.TIMESTAMP_USECS - start.TIMESTAMP_USECS) AS delta FROM ’ ‘sched_waking AS start JOIN sched_switch AS end ON start.pid = end.next_pid' ‘WHERE end.next_pid = “cyclictest”’
  • 37. cyclictest A tool used by real-time developers to test wake up latency in the system https://git.kernel.org/pub/scm/utils/rt-tests/rt-tests.git/ git clone git://git.kernel.org/pub/scm/utils/rt-tests/rt-tests.git cd rt-tests make cyclictest
  • 38. Customize latency tracing # sqlhist -e -n wakeup_lat -T -m lat 'SELECT end.next_comm AS comm, ’ ‘(end.TIMESTAMP_USECS - start.TIMESTAMP_USECS) AS lat ’ ‘FROM sched_waking AS start JOIN sched_switch AS end ’ ‘ON start.pid = end.next_pid’ ‘WHERE end.next_prio < 100 && end.next_comm == "cyclictest"' # trace-cmd start -e all -e wakeup_lat -R stacktrace # cyclictest -l 1000 -p80 -i250 -a -t -q -m -d 0 -b 1000 --tracemark # trace-cmd show -s | tail -16 <idle>-0 [001] d..1 23454.902254: cpu_idle: state=0 cpu_id=1 <idle>-0 [002] d..2 23454.902254: sched_switch: prev_comm=swapper/2 prev_pid=0 prev_prio=120 prev_state=R ==> next_comm=cyclictest next_pid=12275 next_prio=19 <idle>-0 [002] d..4 23454.902256: wakeup_lat: next_comm=cyclictest lat=17 <idle>-0 [002] d..5 23454.902258: <stack trace> => trace_event_raw_event_synth => action_trace => event_hist_trigger => event_triggers_call => trace_event_buffer_commit => trace_event_raw_event_sched_switch => __traceiter_sched_switch => __schedule => schedule_idle => do_idle => cpu_startup_entry => secondary_startup_64_no_verify
  • 39. Customize latency tracing # sqlhist -e -n wakeup_lat -T -m lat 'SELECT end.next_comm AS comm, ’ ‘(end.TIMESTAMP_USECS - start.TIMESTAMP_USECS) AS lat ’ ‘FROM sched_waking AS start JOIN sched_switch AS end ’ ‘ON start.pid = end.next_pid’ ‘WHERE end.next_prio < 100 && end.next_comm == "cyclictest"' # trace-cmd start -e all -e wakeup_lat -R stacktrace # cyclictest -l 1000 -p80 -i250 -a -t -q -m -d 0 -b 1000 --tracemark # trace-cmd show -s | tail -16 <idle>-0 [001] d..1 23454.902254: cpu_idle: state=0 cpu_id=1 <idle>-0 [002] d..2 23454.902254: sched_switch: prev_comm=swapper/2 prev_pid=0 prev_prio=120 prev_state=R ==> next_comm=cyclictest next_pid=12275 next_prio=19 <idle>-0 [002] d..4 23454.902256: wakeup_lat: next_comm=cyclictest lat=17 <idle>-0 [002] d..5 23454.902258: <stack trace> => trace_event_raw_event_synth => action_trace => event_hist_trigger => event_triggers_call => trace_event_buffer_commit => trace_event_raw_event_sched_switch => __traceiter_sched_switch => __schedule => schedule_idle => do_idle => cpu_startup_entry => secondary_startup_64_no_verify
  • 40. Customize latency tracing # sqlhist -e -n wakeup_lat -T -m lat 'SELECT end.next_comm AS comm, ’ ‘(end.TIMESTAMP_USECS - start.TIMESTAMP_USECS) AS lat ’ ‘FROM sched_waking AS start JOIN sched_switch AS end ’ ‘ON start.pid = end.next_pid’ ‘WHERE end.next_prio < 100 && end.next_comm == "cyclictest"' # trace-cmd start -e all -e wakeup_lat -R stacktrace # cyclictest -l 1000 -p80 -i250 -a -t -q -m -d 0 -b 1000 --tracemark # trace-cmd show -s | tail -16 <idle>-0 [001] d..1 23454.902254: cpu_idle: state=0 cpu_id=1 <idle>-0 [002] d..2 23454.902254: sched_switch: prev_comm=swapper/2 prev_pid=0 prev_prio=120 prev_state=R ==> next_comm=cyclictest next_pid=12275 next_prio=19 <idle>-0 [002] d..4 23454.902256: wakeup_lat: next_comm=cyclictest lat=17 <idle>-0 [002] d..5 23454.902258: <stack trace> => trace_event_raw_event_synth => action_trace => event_hist_trigger => event_triggers_call => trace_event_buffer_commit => trace_event_raw_event_sched_switch => __traceiter_sched_switch => __schedule => schedule_idle => do_idle => cpu_startup_entry => secondary_startup_64_no_verify
  • 41. Customize latency tracing # sqlhist -e -n wakeup_lat -T -m lat 'SELECT end.next_comm AS comm, ’ ‘(end.TIMESTAMP_USECS - start.TIMESTAMP_USECS) AS lat ’ ‘FROM sched_waking AS start JOIN sched_switch AS end ’ ‘ON start.pid = end.next_pid’ ‘WHERE end.next_prio < 100 && end.next_comm == "cyclictest"' # trace-cmd start -e all -e wakeup_lat -R stacktrace # cyclictest -l 1000 -p80 -i250 -a -t -q -m -d 0 -b 1000 --tracemark # trace-cmd show -s | tail -16 <idle>-0 [001] d..1 23454.902254: cpu_idle: state=0 cpu_id=1 <idle>-0 [002] d..2 23454.902254: sched_switch: prev_comm=swapper/2 prev_pid=0 prev_prio=120 prev_state=R ==> next_comm=cyclictest next_pid=12275 next_prio=19 <idle>-0 [002] d..4 23454.902256: wakeup_lat: next_comm=cyclictest lat=17 <idle>-0 [002] d..5 23454.902258: <stack trace> => trace_event_raw_event_synth => action_trace => event_hist_trigger => event_triggers_call => trace_event_buffer_commit => trace_event_raw_event_sched_switch => __traceiter_sched_switch => __schedule => schedule_idle => do_idle => cpu_startup_entry => secondary_startup_64_no_verify
  • 42. Customize latency tracing # sqlhist -e -n wakeup_lat -T -m lat 'SELECT end.next_comm AS comm, ’ ‘(end.TIMESTAMP_USECS - start.TIMESTAMP_USECS) AS lat ’ ‘FROM sched_waking AS start JOIN sched_switch AS end ’ ‘ON start.pid = end.next_pid’ ‘WHERE end.next_prio < 100 && end.next_comm == "cyclictest"' # trace-cmd start -e all -e wakeup_lat -R stacktrace # cyclictest -l 1000 -p80 -i250 -a -t -q -m -d 0 -b 1000 --tracemark # trace-cmd show -s | tail -16 <idle>-0 [001] d..1 23454.902254: cpu_idle: state=0 cpu_id=1 <idle>-0 [002] d..2 23454.902254: sched_switch: prev_comm=swapper/2 prev_pid=0 prev_prio=120 prev_state=R ==> next_comm=cyclictest next_pid=12275 next_prio=19 <idle>-0 [002] d..4 23454.902256: wakeup_lat: next_comm=cyclictest lat=17 <idle>-0 [002] d..5 23454.902258: <stack trace> => trace_event_raw_event_synth => action_trace => event_hist_trigger => event_triggers_call => trace_event_buffer_commit => trace_event_raw_event_sched_switch => __traceiter_sched_switch => __schedule => schedule_idle => do_idle => cpu_startup_entry => secondary_startup_64_no_verify
  • 43. Customize latency tracing # sqlhist -e -n wakeup_lat -T -m lat 'SELECT end.next_comm AS comm, ’ ‘(end.TIMESTAMP_USECS - start.TIMESTAMP_USECS) AS lat ’ ‘FROM sched_waking AS start JOIN sched_switch AS end ’ ‘ON start.pid = end.next_pid’ ‘WHERE end.next_prio < 100 && end.next_comm == "cyclictest"' # trace-cmd start -e all -e wakeup_lat -R stacktrace # cyclictest -l 1000 -p80 -i250 -a -t -q -m -d 0 -b 1000 --tracemark # trace-cmd show -s | tail -16 <idle>-0 [001] d..1 23454.902254: cpu_idle: state=0 cpu_id=1 <idle>-0 [002] d..2 23454.902254: sched_switch: prev_comm=swapper/2 prev_pid=0 prev_prio=120 prev_state=R ==> next_comm=cyclictest next_pid=12275 next_prio=19 <idle>-0 [002] d..4 23454.902256: wakeup_lat: next_comm=cyclictest lat=17 <idle>-0 [002] d..5 23454.902258: <stack trace> => trace_event_raw_event_synth => action_trace => event_hist_trigger => event_triggers_call => trace_event_buffer_commit => trace_event_raw_event_sched_switch => __traceiter_sched_switch => __schedule => schedule_idle => do_idle => cpu_startup_entry => secondary_startup_64_no_verify
  • 44. Customize latency tracing # sqlhist -e -n wakeup_lat -T -m lat 'SELECT end.next_comm AS comm, ’ ‘(end.TIMESTAMP_USECS - start.TIMESTAMP_USECS) AS lat ’ ‘FROM sched_waking AS start JOIN sched_switch AS end ’ ‘ON start.pid = end.next_pid’ ‘WHERE end.next_prio < 100 && end.next_comm == "cyclictest"' # trace-cmd start -e all -e wakeup_lat -R stacktrace # cyclictest -l 1000 -p80 -i250 -a -t -q -m -d 0 -b 1000 --tracemark # trace-cmd show -s | tail -16 <idle>-0 [001] d..1 23454.902254: cpu_idle: state=0 cpu_id=1 <idle>-0 [002] d..2 23454.902254: sched_switch: prev_comm=swapper/2 prev_pid=0 prev_prio=120 prev_state=R ==> next_comm=cyclictest next_pid=12275 next_prio=19 <idle>-0 [002] d..4 23454.902256: wakeup_lat: next_comm=cyclictest lat=17 <idle>-0 [002] d..5 23454.902258: <stack trace> => trace_event_raw_event_synth => action_trace => event_hist_trigger => event_triggers_call => trace_event_buffer_commit => trace_event_raw_event_sched_switch => __traceiter_sched_switch => __schedule => schedule_idle => do_idle => cpu_startup_entry => secondary_startup_64_no_verify
  • 45. Customize latency tracing # sqlhist -e -n wakeup_lat -T -m lat 'SELECT end.next_comm AS comm, ’ ‘(end.TIMESTAMP_USECS - start.TIMESTAMP_USECS) AS lat ’ ‘FROM sched_waking AS start JOIN sched_switch AS end ’ ‘ON start.pid = end.next_pid’ ‘WHERE end.next_prio < 100 && end.next_comm == "cyclictest"' # trace-cmd start -e all -e wakeup_lat -R stacktrace # cyclictest -l 1000 -p80 -i250 -a -t -q -m -d 0 -b 1000 --tracemark # trace-cmd show -s | tail -16 <idle>-0 [001] d..1 23454.902254: cpu_idle: state=0 cpu_id=1 <idle>-0 [002] d..2 23454.902254: sched_switch: prev_comm=swapper/2 prev_pid=0 prev_prio=120 prev_state=R ==> next_comm=cyclictest next_pid=12275 next_prio=19 <idle>-0 [002] d..4 23454.902256: wakeup_lat: next_comm=cyclictest lat=17 <idle>-0 [002] d..5 23454.902258: <stack trace> => trace_event_raw_event_synth => action_trace => event_hist_trigger => event_triggers_call => trace_event_buffer_commit => trace_event_raw_event_sched_switch => __traceiter_sched_switch => __schedule => schedule_idle => do_idle => cpu_startup_entry => secondary_startup_64_no_verify
  • 46. Customize latency tracing # sqlhist -e -n wakeup_lat -T -m lat 'SELECT end.next_comm AS comm, ’ ‘(end.TIMESTAMP_USECS - start.TIMESTAMP_USECS) AS lat ’ ‘FROM sched_waking AS start JOIN sched_switch AS end ’ ‘ON start.pid = end.next_pid’ ‘WHERE end.next_prio < 100 && end.next_comm == "cyclictest"' # trace-cmd start -e all -e wakeup_lat -R stacktrace # cyclictest -l 1000 -p80 -i250 -a -t -q -m -d 0 -b 1000 --tracemark # trace-cmd show -s | tail -16 <idle>-0 [001] d..1 23454.902254: cpu_idle: state=0 cpu_id=1 <idle>-0 [002] d..2 23454.902254: sched_switch: prev_comm=swapper/2 prev_pid=0 prev_prio=120 prev_state=R ==> next_comm=cyclictest next_pid=12275 next_prio=19 <idle>-0 [002] d..4 23454.902256: wakeup_lat: next_comm=cyclictest lat=17 <idle>-0 [002] d..5 23454.902258: <stack trace> => trace_event_raw_event_synth => action_trace => event_hist_trigger => event_triggers_call => trace_event_buffer_commit => trace_event_raw_event_sched_switch => __traceiter_sched_switch => __schedule => schedule_idle => do_idle => cpu_startup_entry => secondary_startup_64_no_verify
  • 47. Customize latency tracing # sqlhist -e -n wakeup_lat -T -m lat 'SELECT end.next_comm AS comm, ’ ‘(end.TIMESTAMP_USECS - start.TIMESTAMP_USECS) AS lat ’ ‘FROM sched_waking AS start JOIN sched_switch AS end ’ ‘ON start.pid = end.next_pid’ ‘WHERE end.next_prio < 100 && end.next_comm == "cyclictest"' # trace-cmd start -e all -e wakeup_lat -R stacktrace # cyclictest -l 1000 -p80 -i250 -a -t -q -m -d 0 -b 1000 --tracemark # trace-cmd show -s | tail -16 <idle>-0 [001] d..1 23454.902254: cpu_idle: state=0 cpu_id=1 <idle>-0 [002] d..2 23454.902254: sched_switch: prev_comm=swapper/2 prev_pid=0 prev_prio=120 prev_state=R ==> next_comm=cyclictest next_pid=12275 next_prio=19 <idle>-0 [002] d..4 23454.902256: wakeup_lat: next_comm=cyclictest lat=17 <idle>-0 [002] d..5 23454.902258: <stack trace> => trace_event_raw_event_synth => action_trace => event_hist_trigger => event_triggers_call => trace_event_buffer_commit => trace_event_raw_event_sched_switch => __traceiter_sched_switch => __schedule => schedule_idle => do_idle => cpu_startup_entry => secondary_startup_64_no_verify
  • 48. Customize latency tracing # sqlhist -e -n wakeup_lat -T -m lat 'SELECT end.next_comm AS comm, ’ ‘(end.TIMESTAMP_USECS - start.TIMESTAMP_USECS) AS lat ’ ‘FROM sched_waking AS start JOIN sched_switch AS end ’ ‘ON start.pid = end.next_pid’ ‘WHERE end.next_prio < 100 && end.next_comm == "cyclictest"' # trace-cmd start -e all -e wakeup_lat -R stacktrace # cyclictest -l 1000 -p80 -i250 -a -t -q -m -d 0 -b 1000 --tracemark # trace-cmd show -s | tail -16 <idle>-0 [001] d..1 23454.902254: cpu_idle: state=0 cpu_id=1 <idle>-0 [002] d..2 23454.902254: sched_switch: prev_comm=swapper/2 prev_pid=0 prev_prio=120 prev_state=R ==> next_comm=cyclictest next_pid=12275 next_prio=19 <idle>-0 [002] d..4 23454.902256: wakeup_lat: next_comm=cyclictest lat=17 <idle>-0 [002] d..5 23454.902258: <stack trace> => trace_event_raw_event_synth => action_trace => event_hist_trigger => event_triggers_call => trace_event_buffer_commit => trace_event_raw_event_sched_switch => __traceiter_sched_switch => __schedule => schedule_idle => do_idle => cpu_startup_entry => secondary_startup_64_no_verify
  • 49. Customize latency tracing # sqlhist -e -n wakeup_lat -T -m lat 'SELECT end.next_comm AS comm, ’ ‘(end.TIMESTAMP_USECS - start.TIMESTAMP_USECS) AS lat ’ ‘FROM sched_waking AS start JOIN sched_switch AS end ’ ‘ON start.pid = end.next_pid’ ‘WHERE end.next_prio < 100 && end.next_comm == "cyclictest"' # trace-cmd start -e all -e wakeup_lat -R stacktrace # cyclictest -l 1000 -p80 -i250 -a -t -q -m -d 0 -b 1000 --tracemark # trace-cmd show -s | tail -16 <idle>-0 [001] d..1 23454.902254: cpu_idle: state=0 cpu_id=1 <idle>-0 [002] d..2 23454.902254: sched_switch: prev_comm=swapper/2 prev_pid=0 prev_prio=120 prev_state=R ==> next_comm=cyclictest next_pid=12275 next_prio=19 <idle>-0 [002] d..4 23454.902256: wakeup_lat: next_comm=cyclictest lat=17 <idle>-0 [002] d..5 23454.902258: <stack trace> => trace_event_raw_event_synth => action_trace => event_hist_trigger => event_triggers_call => trace_event_buffer_commit => trace_event_raw_event_sched_switch => __traceiter_sched_switch => __schedule => schedule_idle => do_idle => cpu_startup_entry => secondary_startup_64_no_verify
  • 50. Customize latency tracing # trace-cmd extract -s # trace-cmd report --cpu 2 | tail -30 <idle>-0 [001] d..1 23454.902254: cpu_idle: state=0 cpu_id=1 <idle>-0 [002] 23454.902239: sched_wakeup: cyclictest:12275 [19] CPU:002 <idle>-0 [002] 23454.902241: hrtimer_expire_exit: hrtimer=0xffffbbd68286fe60 <idle>-0 [002] 23454.902241: hrtimer_cancel: hrtimer=0xffffbbd6826efe70 <idle>-0 [002] 23454.902242: hrtimer_expire_entry: hrtimer=0xffffbbd6826efe70 <idle>-0 [002] 23454.902243: sched_waking: comm=cyclictest pid=12272 prio=120 target_cpu=002 <idle>-0 [002] 23454.902244: prandom_u32: ret=1102749734 <idle>-0 [002] 23454.902246: sched_wakeup: cyclictest:12272 [120] CPU:002 <idle>-0 [002] 23454.902247: hrtimer_expire_exit: hrtimer=0xffffbbd6826efe70 <idle>-0 [002] 23454.902248: write_msr: 6e0, value 4866ce957272 <idle>-0 [002] 23454.902249: local_timer_exit: vector=236 <idle>-0 [002] 23454.902250: cpu_idle: state=4294967295 cpu_id=2 <idle>-0 [002] 23454.902251: rcu_utilization: Start context switch <idle>-0 [002] 23454.902252: rcu_utilization: End context switch <idle>-0 [002] 23454.902253: prandom_u32: ret=3692516021 <idle>-0 [002] 23454.902254: sched_switch: swapper/2:0 [120] R ==> cyclictest:12275 [19] <idle>-0 [002] 23454.902256: wakeup_lat: next_comm=cyclictest lat=17 <idle>-0 [002] 23454.902258: kernel_stack: <stack trace > => trace_event_raw_event_synth (ffffffff8121a0db) => action_trace (ffffffff8121e9fb) => event_hist_trigger (ffffffff8121ca8d) => event_triggers_call (ffffffff81216c72) [..]
  • 51. Customize latency tracing # trace-cmd extract -s # trace-cmd report --cpu 2 | tail -30 <idle>-0 [001] d..1 23454.902254: cpu_idle: state=0 cpu_id=1 <idle>-0 [002] 23454.902239: sched_wakeup: cyclictest:12275 [19] CPU:002 <idle>-0 [002] 23454.902241: hrtimer_expire_exit: hrtimer=0xffffbbd68286fe60 <idle>-0 [002] 23454.902241: hrtimer_cancel: hrtimer=0xffffbbd6826efe70 <idle>-0 [002] 23454.902242: hrtimer_expire_entry: hrtimer=0xffffbbd6826efe70 <idle>-0 [002] 23454.902243: sched_waking: comm=cyclictest pid=12272 prio=120 target_cpu=002 <idle>-0 [002] 23454.902244: prandom_u32: ret=1102749734 <idle>-0 [002] 23454.902246: sched_wakeup: cyclictest:12272 [120] CPU:002 <idle>-0 [002] 23454.902247: hrtimer_expire_exit: hrtimer=0xffffbbd6826efe70 <idle>-0 [002] 23454.902248: write_msr: 6e0, value 4866ce957272 <idle>-0 [002] 23454.902249: local_timer_exit: vector=236 <idle>-0 [002] 23454.902250: cpu_idle: state=4294967295 cpu_id=2 <idle>-0 [002] 23454.902251: rcu_utilization: Start context switch <idle>-0 [002] 23454.902252: rcu_utilization: End context switch <idle>-0 [002] 23454.902253: prandom_u32: ret=3692516021 <idle>-0 [002] 23454.902254: sched_switch: swapper/2:0 [120] R ==> cyclictest:12275 [19] <idle>-0 [002] 23454.902256: wakeup_lat: next_comm=cyclictest lat=17 <idle>-0 [002] 23454.902258: kernel_stack: <stack trace > => trace_event_raw_event_synth (ffffffff8121a0db) => action_trace (ffffffff8121e9fb) => event_hist_trigger (ffffffff8121ca8d) => event_triggers_call (ffffffff81216c72) [..]
  • 52. Customize latency tracing # trace-cmd extract -s # trace-cmd report --cpu 2 | tail -30 <idle>-0 [001] d..1 23454.902254: cpu_idle: state=0 cpu_id=1 <idle>-0 [002] 23454.902239: sched_wakeup: cyclictest:12275 [19] CPU:002 <idle>-0 [002] 23454.902241: hrtimer_expire_exit: hrtimer=0xffffbbd68286fe60 <idle>-0 [002] 23454.902241: hrtimer_cancel: hrtimer=0xffffbbd6826efe70 <idle>-0 [002] 23454.902242: hrtimer_expire_entry: hrtimer=0xffffbbd6826efe70 <idle>-0 [002] 23454.902243: sched_waking: comm=cyclictest pid=12272 prio=120 target_cpu=002 <idle>-0 [002] 23454.902244: prandom_u32: ret=1102749734 <idle>-0 [002] 23454.902246: sched_wakeup: cyclictest:12272 [120] CPU:002 <idle>-0 [002] 23454.902247: hrtimer_expire_exit: hrtimer=0xffffbbd6826efe70 <idle>-0 [002] 23454.902248: write_msr: 6e0, value 4866ce957272 <idle>-0 [002] 23454.902249: local_timer_exit: vector=236 <idle>-0 [002] 23454.902250: cpu_idle: state=4294967295 cpu_id=2 <idle>-0 [002] 23454.902251: rcu_utilization: Start context switch <idle>-0 [002] 23454.902252: rcu_utilization: End context switch <idle>-0 [002] 23454.902253: prandom_u32: ret=3692516021 <idle>-0 [002] 23454.902254: sched_switch: swapper/2:0 [120] R ==> cyclictest:12275 [19] <idle>-0 [002] 23454.902256: wakeup_lat: next_comm=cyclictest lat=17 <idle>-0 [002] 23454.902258: kernel_stack: <stack trace > => trace_event_raw_event_synth (ffffffff8121a0db) => action_trace (ffffffff8121e9fb) => event_hist_trigger (ffffffff8121ca8d) => event_triggers_call (ffffffff81216c72) [..]
  • 53. Customize latency tracing # trace-cmd extract -s # trace-cmd report --cpu 2 | tail -30 <idle>-0 [001] d..1 23454.902254: cpu_idle: state=0 cpu_id=1 <idle>-0 [002] 23454.902239: sched_wakeup: cyclictest:12275 [19] CPU:002 <idle>-0 [002] 23454.902241: hrtimer_expire_exit: hrtimer=0xffffbbd68286fe60 <idle>-0 [002] 23454.902241: hrtimer_cancel: hrtimer=0xffffbbd6826efe70 <idle>-0 [002] 23454.902242: hrtimer_expire_entry: hrtimer=0xffffbbd6826efe70 <idle>-0 [002] 23454.902243: sched_waking: comm=cyclictest pid=12272 prio=120 target_cpu=002 <idle>-0 [002] 23454.902244: prandom_u32: ret=1102749734 <idle>-0 [002] 23454.902246: sched_wakeup: cyclictest:12272 [120] CPU:002 <idle>-0 [002] 23454.902247: hrtimer_expire_exit: hrtimer=0xffffbbd6826efe70 <idle>-0 [002] 23454.902248: write_msr: 6e0, value 4866ce957272 <idle>-0 [002] 23454.902249: local_timer_exit: vector=236 <idle>-0 [002] 23454.902250: cpu_idle: state=4294967295 cpu_id=2 <idle>-0 [002] 23454.902251: rcu_utilization: Start context switch <idle>-0 [002] 23454.902252: rcu_utilization: End context switch <idle>-0 [002] 23454.902253: prandom_u32: ret=3692516021 <idle>-0 [002] 23454.902254: sched_switch: swapper/2:0 [120] R ==> cyclictest:12275 [19] <idle>-0 [002] 23454.902256: wakeup_lat: next_comm=cyclictest lat=17 <idle>-0 [002] 23454.902258: kernel_stack: <stack trace > => trace_event_raw_event_synth (ffffffff8121a0db) => action_trace (ffffffff8121e9fb) => event_hist_trigger (ffffffff8121ca8d) => event_triggers_call (ffffffff81216c72) [..]
  • 54. Customize latency tracing # trace-cmd extract -s # trace-cmd report --cpu 2 | tail -30 <idle>-0 [001] d..1 23454.902254: cpu_idle: state=0 cpu_id=1 <idle>-0 [002] 23454.902239: sched_wakeup: cyclictest:12275 [19] CPU:002 <idle>-0 [002] 23454.902241: hrtimer_expire_exit: hrtimer=0xffffbbd68286fe60 <idle>-0 [002] 23454.902241: hrtimer_cancel: hrtimer=0xffffbbd6826efe70 <idle>-0 [002] 23454.902242: hrtimer_expire_entry: hrtimer=0xffffbbd6826efe70 <idle>-0 [002] 23454.902243: sched_waking: comm=cyclictest pid=12272 prio=120 target_cpu=002 <idle>-0 [002] 23454.902244: prandom_u32: ret=1102749734 <idle>-0 [002] 23454.902246: sched_wakeup: cyclictest:12272 [120] CPU:002 <idle>-0 [002] 23454.902247: hrtimer_expire_exit: hrtimer=0xffffbbd6826efe70 <idle>-0 [002] 23454.902248: write_msr: 6e0, value 4866ce957272 <idle>-0 [002] 23454.902249: local_timer_exit: vector=236 <idle>-0 [002] 23454.902250: cpu_idle: state=4294967295 cpu_id=2 <idle>-0 [002] 23454.902251: rcu_utilization: Start context switch <idle>-0 [002] 23454.902252: rcu_utilization: End context switch <idle>-0 [002] 23454.902253: prandom_u32: ret=3692516021 <idle>-0 [002] 23454.902254: sched_switch: swapper/2:0 [120] R ==> cyclictest:12275 [19] <idle>-0 [002] 23454.902256: wakeup_lat: next_comm=cyclictest lat=17 <idle>-0 [002] 23454.902258: kernel_stack: <stack trace > => trace_event_raw_event_synth (ffffffff8121a0db) => action_trace (ffffffff8121e9fb) => event_hist_trigger (ffffffff8121ca8d) => event_triggers_call (ffffffff81216c72) [..]
  • 55. Customize latency tracing # trace-cmd extract -s # trace-cmd report --cpu 2 | tail -30 <idle>-0 [001] d..1 23454.902254: cpu_idle: state=0 cpu_id=1 <idle>-0 [002] 23454.902239: sched_wakeup: cyclictest:12275 [19] CPU:002 <idle>-0 [002] 23454.902241: hrtimer_expire_exit: hrtimer=0xffffbbd68286fe60 <idle>-0 [002] 23454.902241: hrtimer_cancel: hrtimer=0xffffbbd6826efe70 <idle>-0 [002] 23454.902242: hrtimer_expire_entry: hrtimer=0xffffbbd6826efe70 <idle>-0 [002] 23454.902243: sched_waking: comm=cyclictest pid=12272 prio=120 target_cpu=002 <idle>-0 [002] 23454.902244: prandom_u32: ret=1102749734 <idle>-0 [002] 23454.902246: sched_wakeup: cyclictest:12272 [120] CPU:002 <idle>-0 [002] 23454.902247: hrtimer_expire_exit: hrtimer=0xffffbbd6826efe70 <idle>-0 [002] 23454.902248: write_msr: 6e0, value 4866ce957272 <idle>-0 [002] 23454.902249: local_timer_exit: vector=236 <idle>-0 [002] 23454.902250: cpu_idle: state=4294967295 cpu_id=2 <idle>-0 [002] 23454.902251: rcu_utilization: Start context switch <idle>-0 [002] 23454.902252: rcu_utilization: End context switch <idle>-0 [002] 23454.902253: prandom_u32: ret=3692516021 <idle>-0 [002] 23454.902254: sched_switch: swapper/2:0 [120] R ==> cyclictest:12275 [19] <idle>-0 [002] 23454.902256: wakeup_lat: next_comm=cyclictest lat=17 <idle>-0 [002] 23454.902258: kernel_stack: <stack trace > => trace_event_raw_event_synth (ffffffff8121a0db) => action_trace (ffffffff8121e9fb) => event_hist_trigger (ffffffff8121ca8d) => event_triggers_call (ffffffff81216c72) [..]
  • 56. Customize latency tracing # trace-cmd extract -s # trace-cmd report --cpu 2 | tail -30 <idle>-0 [001] d..1 23454.902254: cpu_idle: state=0 cpu_id=1 <idle>-0 [002] 23454.902239: sched_wakeup: cyclictest:12275 [19] CPU:002 <idle>-0 [002] 23454.902241: hrtimer_expire_exit: hrtimer=0xffffbbd68286fe60 <idle>-0 [002] 23454.902241: hrtimer_cancel: hrtimer=0xffffbbd6826efe70 <idle>-0 [002] 23454.902242: hrtimer_expire_entry: hrtimer=0xffffbbd6826efe70 <idle>-0 [002] 23454.902243: sched_waking: comm=cyclictest pid=12272 prio=120 target_cpu=002 <idle>-0 [002] 23454.902244: prandom_u32: ret=1102749734 <idle>-0 [002] 23454.902246: sched_wakeup: cyclictest:12272 [120] CPU:002 <idle>-0 [002] 23454.902247: hrtimer_expire_exit: hrtimer=0xffffbbd6826efe70 <idle>-0 [002] 23454.902248: write_msr: 6e0, value 4866ce957272 <idle>-0 [002] 23454.902249: local_timer_exit: vector=236 <idle>-0 [002] 23454.902250: cpu_idle: state=4294967295 cpu_id=2 <idle>-0 [002] 23454.902251: rcu_utilization: Start context switch <idle>-0 [002] 23454.902252: rcu_utilization: End context switch <idle>-0 [002] 23454.902253: prandom_u32: ret=3692516021 <idle>-0 [002] 23454.902254: sched_switch: swapper/2:0 [120] R ==> cyclictest:12275 [19] <idle>-0 [002] 23454.902256: wakeup_lat: next_comm=cyclictest lat=17 <idle>-0 [002] 23454.902258: kernel_stack: <stack trace > => trace_event_raw_event_synth (ffffffff8121a0db) => action_trace (ffffffff8121e9fb) => event_hist_trigger (ffffffff8121ca8d) => event_triggers_call (ffffffff81216c72) [..]
  • 57. Brought to you by Steven Rostedt rostedt@goodmis.org @srostedt