1criticalstat(8)             System Manager's Manual            criticalstat(8)
2
3
4

NAME

6       criticalstat  -  A  tracer to find and report long atomic critical sec‐
7       tions in kernel
8

SYNOPSIS

10       criticalstat [-h] [-p] [-i] [-d DURATION]
11

DESCRIPTION

13       criticalstat traces and reports occurrences of atomic critical sections
14       in  the kernel with useful stacktraces showing the origin of them. Such
15       critical sections frequently occur due  to  use  of  spinlocks,  or  if
16       interrupts or preemption were explicitly disabled by a driver. IRQ rou‐
17       tines in Linux are also executed with interrupts  disabled.  There  are
18       many   reasons.   Such   critical   sections   are  a  source  of  long
19       latency/responsive issues for real-time systems.
20
21       This works by probing the preempt/irq and cpuidle  tracepoints  in  the
22       kernel.   Since  this  uses  BPF, only the root user can use this tool.
23       Further, the kernel  has  to  be  built  with  certain  CONFIG  options
24       enabled. See below.
25
26

REQUIREMENTS

28       Enable CONFIG_PREEMPTIRQ_EVENTS and CONFIG_DEBUG_PREEMPT. Additionally,
29       the following  options  should  be  DISABLED  on  older  kernels:  CON‐
30       FIG_PROVE_LOCKING, CONFIG_LOCKDEP.
31

OPTIONS

33       -h     Print usage message.
34
35       -p     Find long sections where preemption was disabled on local CPU.
36
37       -i     Find long sections where interrupt was disabled on local CPU.
38
39       -d DURATION
40              Only   identify  sections  that  are  longer  than  DURATION  in
41              microseconds.
42

EXAMPLES

44       Run with default options: irq disabled for more than 100 uS
45              # criticalstat
46
47       Find sections with preemption disabled for more than 100 uS.
48              # criticalstat -p
49
50       Find sections with IRQ disabled for more than 500 uS.
51              # criticalstat -d 500
52
53       Find sections with preemption disabled for more than 500 uS.
54              # criticalstat -p -d 500
55

OVERHEAD

57       This tool can cause overhead if the application is spending  a  lot  of
58       time  in  kernel mode. The overhead is variable but can be 2-4% of per‐
59       formance degradation. If overhead is seen to be too much, please pass a
60       higher DURATION to the -d option to filter more aggressively.
61
62

SOURCE

64       This is from bcc.
65
66              https://github.com/iovisor/bcc
67
68       Also  look  in  the bcc distribution for a companion _examples.txt file
69       containing example usage, output, and commentary for this tool.
70

OS

72       Linux
73

STABILITY

75       Unstable - in development.
76

AUTHOR

78       Joel Fernandes
79

SEE ALSO

81       Linux kernel's preemptoff and irqoff tracers.
82
83
84
85
86USER COMMANDS                     2018-06-07                   criticalstat(8)
Impressum