Commit edbaaa1
Sebastian Andrzej Siewior
tracing: Merge irqflags + preemt counter, add RT bits
This is the patch as posted upstream plus
- fixed issues which were reported by kernel test robot
- added the migrate-disable and lazy-preempt counter which are RT only.
PREEMPT_RT never reported "serving softirq". I took a look to see if it
could be changed. The tracing infrastructure examinates the preemtion
counter for that. PREEMPT_RT does not change the preemption counter
while disabling the bottom half or serving the softirqs in order to
remain preemptible. The in_serving_softirq() macro and the SOFTIRQ_OFFSET
define are still working but not on the preempt-counter.
I started to look how to integrate the RT bits regarding softirq.
The state of the interrupts (irqflags) and the preemption counter are
passed down to tracing_generic_entry_update(). However only one bit of
irqflags is actually required: The on/off state.
The irqflags and the preemption counter could be evaluated early and the
information stored in an integer `trace_ctx'.
tracing_generic_entry_update() would use the upper bits as the
TRACE_FLAG_* and the lower 16bit as the preemption counter (considering
that 1 must be substracted from the counter in some cases).
Whith this change the preemption counter is read in one place and the
relevant RT bits for softirq can be set there.
The actual preemption value is not used except for the tracing record.
The `irqflags' is also not used except for the _irqsave() locking in a
few spots.
As part of the patch I added __ to trace_event_buffer_commit() while
evaluating trace_event_buffer() for the struct trace_event_buffer usage
regarding the `pc' and `flags' members. It appears that those two can
also be merged into the `trace_ctx' integer.
With this change the callchain passes one argument less and evaluates
the flags early. A build with all tracers enabled on x86-64 with and
without the patch:
text data bss dec hex filename
24301717 22148594 13996284 60446595 39a5783 vmlinux.old
24301248 22148850 13996284 60446382 39a56ae vmlinux.new
data increased by 256 bytes, text shrank by 469 bytes.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>1 parent fe22cfc commit edbaaa1
18 files changed
Lines changed: 301 additions & 284 deletions
File tree
- include
- linux
- trace
- kernel/trace
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
157 | 171 | | |
158 | 172 | | |
159 | 173 | | |
160 | 174 | | |
161 | 175 | | |
162 | 176 | | |
163 | | - | |
| 177 | + | |
164 | 178 | | |
165 | 179 | | |
166 | 180 | | |
| |||
234 | 248 | | |
235 | 249 | | |
236 | 250 | | |
237 | | - | |
238 | | - | |
| 251 | + | |
239 | 252 | | |
240 | 253 | | |
241 | 254 | | |
242 | 255 | | |
243 | 256 | | |
244 | 257 | | |
245 | 258 | | |
246 | | - | |
| 259 | + | |
247 | 260 | | |
248 | 261 | | |
249 | 262 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
694 | 694 | | |
695 | 695 | | |
696 | 696 | | |
697 | | - | |
| 697 | + | |
698 | 698 | | |
699 | 699 | | |
700 | 700 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
| 75 | + | |
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
| 82 | + | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
| 85 | + | |
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
110 | | - | |
| 110 | + | |
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| |||
222 | 222 | | |
223 | 223 | | |
224 | 224 | | |
| 225 | + | |
225 | 226 | | |
226 | | - | |
| 227 | + | |
227 | 228 | | |
228 | 229 | | |
229 | 230 | | |
| |||
252 | 253 | | |
253 | 254 | | |
254 | 255 | | |
255 | | - | |
| 256 | + | |
256 | 257 | | |
257 | 258 | | |
258 | | - | |
| 259 | + | |
259 | 260 | | |
260 | 261 | | |
261 | 262 | | |
| |||
301 | 302 | | |
302 | 303 | | |
303 | 304 | | |
304 | | - | |
| 305 | + | |
305 | 306 | | |
306 | 307 | | |
307 | 308 | | |
| |||
0 commit comments