Commit ebc27aa
committed
Merge tag 'trace-v6.5-rc1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace
Pull tracing fixes from Steven Rostedt:
- Fix some missing-prototype warnings
- Fix user events struct args (did not include size of struct)
When creating a user event, the "struct" keyword is to denote that
the size of the field will be passed in. But the parsing failed to
handle this case.
- Add selftest to struct sizes for user events
- Fix sample code for direct trampolines.
The sample code for direct trampolines attached to handle_mm_fault().
But the prototype changed and the direct trampoline sample code was
not updated. Direct trampolines needs to have the arguments correct
otherwise it can fail or crash the system.
- Remove unused ftrace_regs_caller_ret() prototype.
- Quiet false positive of FORTIFY_SOURCE
Due to backward compatibility, the structure used to save stack
traces in the kernel had a fixed size of 8. This structure is
exported to user space via the tracing format file. A change was made
to allow more than 8 functions to be recorded, and user space now
uses the size field to know how many functions are actually in the
stack.
But the structure still has size of 8 (even though it points into the
ring buffer that has the required amount allocated to hold a full
stack.
This was fine until the fortifier noticed that the
memcpy(&entry->caller, stack, size) was greater than the 8 functions
and would complain at runtime about it.
Hide this by using a pointer to the stack location on the ring buffer
instead of using the address of the entry structure caller field.
- Fix a deadloop in reading trace_pipe that was caused by a mismatch
between ring_buffer_empty() returning false which then asked to read
the data, but the read code uses rb_num_of_entries() that returned
zero, and causing a infinite "retry".
- Fix a warning caused by not using all pages allocated to store ftrace
functions, where this can happen if the linker inserts a bunch of
"NULL" entries, causing the accounting of how many pages needed to be
off.
- Fix histogram synthetic event crashing when the start event is
removed and the end event is still using a variable from it
- Fix memory leak in freeing iter->temp in tracing_release_pipe()
* tag 'trace-v6.5-rc1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace:
tracing: Fix memory leak of iter->temp when reading trace_pipe
tracing/histograms: Add histograms to hist_vars if they have referenced variables
tracing: Stop FORTIFY_SOURCE complaining about stack trace caller
ftrace: Fix possible warning on checking all pages used in ftrace_process_locs()
ring-buffer: Fix deadloop issue on reading trace_pipe
tracing: arm64: Avoid missing-prototype warnings
selftests/user_events: Test struct size match cases
tracing/user_events: Fix struct arg size match check
x86/ftrace: Remove unsued extern declaration ftrace_regs_caller_ret()
arm64: ftrace: Add direct call trampoline samples support
samples: ftrace: Save required argument registers in sample trampolines20 files changed
Lines changed: 268 additions & 40 deletions
File tree
- arch
- arm64
- include/asm
- kernel
- x86/kernel
- include/linux
- kernel/trace
- samples/ftrace
- tools/testing/selftests/user_events
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
197 | 197 | | |
198 | 198 | | |
199 | 199 | | |
| 200 | + | |
| 201 | + | |
200 | 202 | | |
201 | 203 | | |
202 | 204 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
214 | 218 | | |
215 | 219 | | |
216 | 220 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
88 | 91 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | 78 | | |
82 | 79 | | |
83 | 80 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
282 | 282 | | |
283 | 283 | | |
284 | 284 | | |
285 | | - | |
286 | 285 | | |
287 | 286 | | |
288 | 287 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
44 | 53 | | |
45 | 54 | | |
46 | 55 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3305 | 3305 | | |
3306 | 3306 | | |
3307 | 3307 | | |
| 3308 | + | |
| 3309 | + | |
| 3310 | + | |
| 3311 | + | |
| 3312 | + | |
| 3313 | + | |
| 3314 | + | |
| 3315 | + | |
| 3316 | + | |
| 3317 | + | |
| 3318 | + | |
| 3319 | + | |
| 3320 | + | |
| 3321 | + | |
| 3322 | + | |
| 3323 | + | |
3308 | 3324 | | |
3309 | 3325 | | |
3310 | 3326 | | |
| |||
3343 | 3359 | | |
3344 | 3360 | | |
3345 | 3361 | | |
3346 | | - | |
3347 | | - | |
3348 | | - | |
3349 | | - | |
3350 | | - | |
3351 | | - | |
3352 | | - | |
3353 | | - | |
3354 | | - | |
3355 | | - | |
3356 | | - | |
| 3362 | + | |
3357 | 3363 | | |
3358 | 3364 | | |
3359 | 3365 | | |
| |||
6471 | 6477 | | |
6472 | 6478 | | |
6473 | 6479 | | |
| 6480 | + | |
6474 | 6481 | | |
6475 | 6482 | | |
6476 | 6483 | | |
| 6484 | + | |
6477 | 6485 | | |
6478 | 6486 | | |
6479 | 6487 | | |
| |||
6536 | 6544 | | |
6537 | 6545 | | |
6538 | 6546 | | |
6539 | | - | |
| 6547 | + | |
| 6548 | + | |
6540 | 6549 | | |
| 6550 | + | |
6541 | 6551 | | |
6542 | 6552 | | |
6543 | 6553 | | |
| |||
6551 | 6561 | | |
6552 | 6562 | | |
6553 | 6563 | | |
6554 | | - | |
6555 | | - | |
| 6564 | + | |
| 6565 | + | |
| 6566 | + | |
| 6567 | + | |
6556 | 6568 | | |
6557 | 6569 | | |
6558 | 6570 | | |
| |||
6574 | 6586 | | |
6575 | 6587 | | |
6576 | 6588 | | |
| 6589 | + | |
| 6590 | + | |
| 6591 | + | |
| 6592 | + | |
| 6593 | + | |
6577 | 6594 | | |
6578 | 6595 | | |
6579 | 6596 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
5 | 8 | | |
6 | 9 | | |
7 | 10 | | |
| |||
15 | 18 | | |
16 | 19 | | |
17 | 20 | | |
18 | | - | |
19 | | - | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5242 | 5242 | | |
5243 | 5243 | | |
5244 | 5244 | | |
| 5245 | + | |
| 5246 | + | |
| 5247 | + | |
| 5248 | + | |
| 5249 | + | |
| 5250 | + | |
| 5251 | + | |
| 5252 | + | |
5245 | 5253 | | |
5246 | 5254 | | |
5247 | 5255 | | |
| 5256 | + | |
| 5257 | + | |
5248 | 5258 | | |
5249 | 5259 | | |
5250 | 5260 | | |
5251 | 5261 | | |
5252 | | - | |
5253 | | - | |
5254 | | - | |
5255 | | - | |
5256 | | - | |
| 5262 | + | |
| 5263 | + | |
| 5264 | + | |
| 5265 | + | |
5257 | 5266 | | |
5258 | 5267 | | |
5259 | 5268 | | |
5260 | 5269 | | |
5261 | 5270 | | |
5262 | 5271 | | |
5263 | | - | |
5264 | | - | |
5265 | | - | |
5266 | | - | |
| 5272 | + | |
5267 | 5273 | | |
5268 | 5274 | | |
5269 | 5275 | | |
| |||
0 commit comments