Skip to content

Commit 8594698

Browse files
author
Ingo Molnar
committed
stacktrace: fix modular build, export print_stack_trace and save_stack_trace
fix: ERROR: "print_stack_trace" [kernel/backtracetest.ko] undefined! ERROR: "save_stack_trace" [kernel/backtracetest.ko] undefined! Signed-off-by: Ingo Molnar <mingo@elte.hu> and fix: Building modules, stage 2. MODPOST 376 modules ERROR: "print_stack_trace" [kernel/backtracetest.ko] undefined! make[1]: *** [__modpost] Error 1 Signed-off-by: Ingo Molnar <mingo@elte.hu>
1 parent 4e6a053 commit 8594698

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

‎arch/x86/kernel/stacktrace.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,12 @@ void save_stack_trace(struct stack_trace *trace)
7474
if (trace->nr_entries < trace->max_entries)
7575
trace->entries[trace->nr_entries++] = ULONG_MAX;
7676
}
77+
EXPORT_SYMBOL_GPL(save_stack_trace);
7778

7879
void save_stack_trace_tsk(struct task_struct *tsk, struct stack_trace *trace)
7980
{
8081
dump_trace(tsk, NULL, NULL, 0, &save_stack_ops_nosched, trace);
8182
if (trace->nr_entries < trace->max_entries)
8283
trace->entries[trace->nr_entries++] = ULONG_MAX;
8384
}
85+
EXPORT_SYMBOL_GPL(save_stack_trace_tsk);

‎kernel/stacktrace.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* Copyright (C) 2006 Red Hat, Inc., Ingo Molnar <mingo@redhat.com>
77
*/
88
#include <linux/sched.h>
9+
#include <linux/module.h>
910
#include <linux/kallsyms.h>
1011
#include <linux/stacktrace.h>
1112

@@ -21,4 +22,5 @@ void print_stack_trace(struct stack_trace *trace, int spaces)
2122
print_ip_sym(trace->entries[i]);
2223
}
2324
}
25+
EXPORT_SYMBOL_GPL(print_stack_trace);
2426

0 commit comments

Comments
 (0)