Commit 9995c8f
bpf: refactor max_depth computation in bpf_get_stack()
A new helper function stack_map_calculate_max_depth() that
computes the max depth for a stackmap.
Changes in v2:
- Removed the checking 'map_size % map_elem_size' from
stack_map_calculate_max_depth
- Changed stack_map_calculate_max_depth params name to be more generic
Changes in v3:
- Changed map size param to size in max depth helper
Changes in v4:
- Fixed indentation in max depth helper for args
Changes in v5:
- Bound back trace_nr to num_elem in __bpf_get_stack
- Make a copy of sysctl_perf_event_max_stack
in stack_map_calculate_max_depth
Link to v4: https://lore.kernel.org/all/[email protected]/
Signed-off-by: Arnaud Lecomte <[email protected]>
Acked-by: Yonghong Song <[email protected]>1 parent 8f9c214 commit 9995c8f
1 file changed
+24
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
45 | 67 | | |
46 | 68 | | |
47 | 69 | | |
| |||
438 | 460 | | |
439 | 461 | | |
440 | 462 | | |
441 | | - | |
442 | | - | |
443 | | - | |
444 | | - | |
| 463 | + | |
445 | 464 | | |
446 | 465 | | |
447 | 466 | | |
| |||
460 | 479 | | |
461 | 480 | | |
462 | 481 | | |
| 482 | + | |
463 | 483 | | |
464 | 484 | | |
465 | 485 | | |
| |||
0 commit comments