mirror of
https://github.com/versity/scoutfs.git
synced 2025-12-23 05:25:18 +00:00
Add stacktrace kernelcompat
Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
@@ -462,3 +462,11 @@ ifneq (,$(shell grep 'struct list_lru_one \*list, spinlock_t \*lock, void \*cb_a
|
|||||||
ccflags-y += -DKC_LIST_LRU_WALK_CB_LIST_LOCK
|
ccflags-y += -DKC_LIST_LRU_WALK_CB_LIST_LOCK
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
#
|
||||||
|
# v5.1-rc4-273-ge9b98e162aa5
|
||||||
|
#
|
||||||
|
# introduce stack trace helpers
|
||||||
|
#
|
||||||
|
ifneq (,$(shell grep '^unsigned int stack_trace_save' include/linux/stacktrace.h))
|
||||||
|
ccflags-y += -DKC_STACK_TRACE_SAVE
|
||||||
|
endif
|
||||||
|
|||||||
@@ -457,4 +457,30 @@ static inline void list_lru_isolate_move(struct list_lru_one *list, struct list_
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef KC_STACK_TRACE_SAVE
|
||||||
|
#include <linux/stacktrace.h>
|
||||||
|
static inline unsigned int stack_trace_save(unsigned long *store, unsigned int size,
|
||||||
|
unsigned int skipnr)
|
||||||
|
{
|
||||||
|
struct stack_trace trace = {
|
||||||
|
.entries = store,
|
||||||
|
.max_entries = size,
|
||||||
|
.skip = skipnr,
|
||||||
|
};
|
||||||
|
|
||||||
|
save_stack_trace(&trace);
|
||||||
|
return trace.nr_entries;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void stack_trace_print(unsigned long *entries, unsigned int nr_entries, int spaces)
|
||||||
|
{
|
||||||
|
struct stack_trace trace = {
|
||||||
|
.entries = entries,
|
||||||
|
.nr_entries = nr_entries,
|
||||||
|
};
|
||||||
|
|
||||||
|
print_stack_trace(&trace, spaces);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user