To print stack entries into a buffer, users of stackdepot, first get a list of stack entries using stack_depot_fetch and then print this list into a buffer using stack_trace_snprint. Provide a helper in stackdepot for this purpose. Also change above mentioned users to use this helper. [imran.f.khan@oracle.com: fix build error] Link: https://lkml.kernel.org/r/20210915175321.3472770-4-imran.f.khan@oracle.com [imran.f.khan@oracle.com: export stack_depot_snprint() to modules] Link: https://lkml.kernel.org/r/20210916133535.3592491-4-imran.f.khan@oracle.com
Showing the changes to include (1 of 7 files). Show all
Unified · Split
| @@ -25,6 +25,9 @@ depot_stack_handle_t stack_depot_save(unsigned long *entries, · 24 unmodified lines | |||
| 25 | unsigned int stack_depot_fetch(depot_stack_handle_t handle, | 25 | unsigned int stack_depot_fetch(depot_stack_handle_t handle, |
| 26 | unsigned long **entries); | 26 | unsigned long **entries); |
| 27 | 27 | ||
| 28 | int stack_depot_snprint(depot_stack_handle_t handle, char *buf, size_t size, | ||
| 29 | int spaces); | ||
| 30 | |||
| 28 | void stack_depot_print(depot_stack_handle_t stack); | 31 | void stack_depot_print(depot_stack_handle_t stack); |
| 29 | 32 | ||
| 30 | #ifdef CONFIG_STACKDEPOT | 33 | #ifdef CONFIG_STACKDEPOT |