Commit 8261ef2
committed
tracing: Add BUILD_BUG() to make sure stacktrace fits in strings
The max string length for a histogram variable is 256 bytes. The max depth
of a stacktrace is 16. With 8byte words, that's 16 * 8 = 128. Which can
easily fit in the string variable. The histogram stacktrace is being
stored in the string value (with the given max length), with the
assumption it will fit. To make sure that this is always the case (in the
case that the stack trace depth increases), add a BUILD_BUG_ON() to test
this.
Link: https://lore.kernel.org/linux-trace-kernel/20230214002418.0103b9e765d3e5c374d2aa7d@kernel.org/
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>1 parent fc1a9dc commit 8261ef2
1 file changed
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3119 | 3119 | | |
3120 | 3120 | | |
3121 | 3121 | | |
| 3122 | + | |
| 3123 | + | |
| 3124 | + | |
3122 | 3125 | | |
3123 | 3126 | | |
3124 | 3127 | | |
| |||
0 commit comments