@@ -19,7 +19,7 @@ register unsigned long sp_in_global __asm__("sp");
19
19
#ifdef CONFIG_FRAME_POINTER
20
20
21
21
void notrace walk_stackframe (struct task_struct * task , struct pt_regs * regs ,
22
- bool (* fn )(unsigned long , void * ), void * arg )
22
+ bool (* fn )(void * , unsigned long ), void * arg )
23
23
{
24
24
unsigned long fp , sp , pc ;
25
25
@@ -43,7 +43,7 @@ void notrace walk_stackframe(struct task_struct *task, struct pt_regs *regs,
43
43
unsigned long low , high ;
44
44
struct stackframe * frame ;
45
45
46
- if (unlikely (!__kernel_text_address (pc ) || fn (arg , pc )))
46
+ if (unlikely (!__kernel_text_address (pc ) || ! fn (arg , pc )))
47
47
break ;
48
48
49
49
/* Validate frame pointer */
@@ -85,20 +85,20 @@ void notrace walk_stackframe(struct task_struct *task,
85
85
86
86
ksp = (unsigned long * )sp ;
87
87
while (!kstack_end (ksp )) {
88
- if (__kernel_text_address (pc ) && unlikely (fn (arg , pc )))
88
+ if (__kernel_text_address (pc ) && unlikely (! fn (arg , pc )))
89
89
break ;
90
90
pc = (* ksp ++ ) - 0x4 ;
91
91
}
92
92
}
93
93
94
94
#endif /* CONFIG_FRAME_POINTER */
95
95
96
- static bool print_trace_address (unsigned long pc , void * arg )
96
+ static bool print_trace_address (void * arg , unsigned long pc )
97
97
{
98
98
const char * loglvl = arg ;
99
99
100
100
print_ip_sym (loglvl , pc );
101
- return false ;
101
+ return true ;
102
102
}
103
103
104
104
void show_stack (struct task_struct * task , unsigned long * sp , const char * loglvl )
@@ -112,9 +112,9 @@ static bool save_wchan(void *arg, unsigned long pc)
112
112
if (!in_sched_functions (pc )) {
113
113
unsigned long * p = arg ;
114
114
* p = pc ;
115
- return true ;
115
+ return false ;
116
116
}
117
- return false ;
117
+ return true ;
118
118
}
119
119
120
120
unsigned long get_wchan (struct task_struct * task )
@@ -128,39 +128,10 @@ unsigned long get_wchan(struct task_struct *task)
128
128
129
129
#ifdef CONFIG_STACKTRACE
130
130
131
- static bool __save_trace (unsigned long pc , void * arg , bool nosched )
132
- {
133
- struct stack_trace * trace = arg ;
134
-
135
- if (unlikely (nosched && in_sched_functions (pc )))
136
- return false;
137
- if (unlikely (trace -> skip > 0 )) {
138
- trace -> skip -- ;
139
- return false;
140
- }
141
-
142
- trace -> entries [trace -> nr_entries ++ ] = pc ;
143
- return (trace -> nr_entries >= trace -> max_entries );
144
- }
145
-
146
- static bool save_trace (void * arg , unsigned long pc )
147
- {
148
- return __save_trace (pc , arg , false);
149
- }
150
-
151
- /*
152
- * Save stack-backtrace addresses into a stack_trace buffer.
153
- */
154
- void save_stack_trace_tsk (struct task_struct * tsk , struct stack_trace * trace )
155
- {
156
- walk_stackframe (tsk , NULL , save_trace , trace );
157
- }
158
- EXPORT_SYMBOL_GPL (save_stack_trace_tsk );
159
-
160
- void save_stack_trace (struct stack_trace * trace )
131
+ void arch_stack_walk (stack_trace_consume_fn consume_entry , void * cookie ,
132
+ struct task_struct * task , struct pt_regs * regs )
161
133
{
162
- save_stack_trace_tsk ( NULL , trace );
134
+ walk_stackframe ( task , regs , consume_entry , cookie );
163
135
}
164
- EXPORT_SYMBOL_GPL (save_stack_trace );
165
136
166
137
#endif /* CONFIG_STACKTRACE */
0 commit comments