summaryrefslogtreecommitdiffstats
path: root/tapset/irq.stp
blob: 5d9196595a9d5931e6ca5b86bf5130ff8b1c74c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
/*
 *      Copyright (C) 2009 IBM Corp.
 *      This file is part of systemtap, and is free software.  You can
 *      redistribute it and/or modify it under the terms of the GNU General
 *      Public License (GPL); either version 2, or (at your option) any
 *      later version.
 *
 *      Version 1.0     prerna@linux.vnet.ibm.com     2009-10-28
 *
 * Tracepoint based tapset for IRQs, Workqueues, etc
 *
 */
// Probes for workqueues.

/**
 * probe workqueue.create : probes creation of a new workqueue
 * @wq_thread : task_struct of the workqueue thread.
 * @cpu	  : cpu for which the worker thread is created.
 */
probe workqueue.create = kernel.trace("workqueue_creation") ?
{
	wq_thread = $wq_thread
	cpu = $cpu
}

/**
 * probe workqueue.insert : probes queuing of work on a workqueue
 * @wq_thread : task_struct of the workqueue thread.
 * @work : work_struct* being queued.
 * @work_func :	pointer to handler func.
 */
probe workqueue.insert = kernel.trace("workqueue_insertion") ?
{
	wq_thread = $wq_thread
	work = $work
	work_func = $work->func
}

/**
 * probe workqueue.execute : probes execution of deferred work.
 * @wq_thread :	task_struct of the workqueue thread.
 * @work : work_struct* being executed.
 * @work_func :	pointer to handler func.
 */
probe workqueue.execute = kernel.trace("workqueue_execution") ?
{
	wq_thread = $wq_thread
	work = $work
	work_func = $work->func
}

/**
 * probe workqueue.destroy : probes destruction of each worker thread of each cpu for a workqueue.
 * @wq_thread : task_struct of the workqueue thread.
 */
probe workqueue.destroy = kernel.trace("workqueue_destruction") ?
{
	wq_thread = $wq_thread
}

// Probes for IRQ handlers.

/**
 * probe irq_handler.entry : Fires prior to execution of interrupt handler.
 * @irq	: irq number.
 * @action : struct irqaction* for this interrupt num.
 * @handler : interrupt handler function.
 * @flags : Flags for IRQ handler
 *			IRQF_DISABLED [0x00000020]	: keep irqs disabled when calling action handler.
 *			IRQF_SAMPLE_RANDOM [0x00000040]	: irq is used to feed the random generator
 *			IRQF_SHARED [0x00000080]	: allow sharing the irq among several devices
 *			IRQF_PROBE_SHARED [0x00000100]	: set by callers when they expect sharing mismatches to occur
 *			IRQF_TIMER [0x00000200]		: Flag to mark this interrupt as timer interrupt
 *			IRQF_PERCPU [0x00000400]	: Interrupt is per cpu.
 *			IRQF_NOBALANCING [0x00000800]	: Flag to exclude this interrupt from irq balancing
 *			IRQF_IRQPOLL [0x00001000]	: Interrupt is used for polling.
 *			IRQF_ONESHOT [0x00002000]	: Interrupt is not reenabled after the hardirq handler finished.
 * @flags_str : symbolic string representation of IRQ flags.
 * @dev_name : name of device.
 * @dev_id : Cookie to identify device.
 * @next_irqaction : pointer to next irqaction for shared interrupts.
 * @dir	: pointer to the proc/irq/NN/name entry
 * @thread_fn : interupt handler function for threaded interrupts.
 * @thread : thread pointer for threaded interrupts.
 * @thread_flags : Flags related to thread.
 */
probe irq_handler.entry = kernel.trace("irq_handler_entry") ?
{
	irq = $irq
	action = $action
	handler = $action->handler
	flags = $action->flags
	flags_str = irqflags_str(flags)
	dev_name = $action->name
	dev_id = $action->dev_id
	next_irqaction = $action->next
	dir = $action->dir
	thread_fn = $action->thread_fn
	thread = $action->thread
	thread_flags = $action->thread_flags
}

/**
 * probe irq_handler.exit : Fires just after execution of interrupt handler.
 * @irq : interrupt number
 * @action : struct irqaction*
 * @ret	: return value of the handler
 * @handler : interrupt handler function that was executed.
 * @flags : flags for IRQ handler
 *			IRQF_DISABLED	[0x00000020]	: keep irqs disabled when calling action handler.
 *			IRQF_SAMPLE_RANDOM [0x00000040]	: irq is used to feed the random generator
 *			IRQF_SHARED [0x00000080]	: allow sharing the irq among several devices
 *			IRQF_PROBE_SHARED [0x00000100]	: set by callers when they expect sharing mismatches to occur
 *			IRQF_TIMER [0x00000200]		: Flag to mark this interrupt as timer interrupt
 *			IRQF_PERCPU [0x00000400]	: Interrupt is per cpu.
 *			IRQF_NOBALANCING [0x00000800]	: Flag to exclude this interrupt from irq balancing
 *			IRQF_IRQPOLL [0x00001000]	: Interrupt is used for polling.
 *			IRQF_ONESHOT [0x00002000]	: Interrupt is not reenabled after the hardirq handler finished.
 * @flags_str : symbolic string representation of IRQ flags.
 * @dev_name : name of device.
 * @dev_id : Cookie to identify device.
 * @next_irqaction : pointer to next irqaction for shared interrupts.
 * @dir	: pointer to the proc/irq/NN/name entry
 * @thread_fn : interupt handler function for threaded interrupts.
 * @thread : thread pointer for threaded interrupts.
 * @thread_flags : Flags related to thread.
 */
probe irq_handler.exit = kernel.trace("irq_handler_exit") ?
{
	irq = $irq
	action = $action
	ret = $ret
	handler = $action->handler
	flags = $action->flags
	flags_str = irqflags_str(flags)
	dev_name = $action->name
	dev_id = $action->dev_id
	next_irqaction = $action->next
	dir = $action->dir
	thread_fn = $action->thread_fn
	thread = $action->thread
	thread_flags = $action->thread_flags
}

// Softirq based probes.
/**
 * probe softirq.entry 	: triggered just before executing handler
 *			  for a pending softirq.
 * @h : struct softirq_action* for current pending softirq.
 * @vec	: softirq_action vector.
 * @action : pointer to softirq handler just about to execute.
 */
probe softirq.entry = kernel.trace("softirq_entry") ?
{
	h = $h
	vec = $vec
	action = $h->action
}

/**
 * probe softirq.exit 	: triggered just after executing handler for a pending
 *			  softirq.
 * @h : struct softirq_action* for just executed softirq.
 * @vec	: softirq_action vector.
 * @action : pointer to softirq handler that just finished execution.
 */
probe softirq.exit = kernel.trace("softirq_exit") ?
{
	h = $h
	vec = $vec
	action = $h->action
}