.. | .. |
---|
133 | 133 | { |
---|
134 | 134 | struct trace_array *tr = op->private; |
---|
135 | 135 | struct trace_array_cpu *data; |
---|
136 | | - unsigned int trace_ctx; |
---|
| 136 | + unsigned long flags; |
---|
137 | 137 | int bit; |
---|
138 | 138 | int cpu; |
---|
| 139 | + int pc; |
---|
139 | 140 | |
---|
140 | 141 | if (unlikely(!tr->function_enabled)) |
---|
141 | 142 | return; |
---|
142 | 143 | |
---|
143 | | - trace_ctx = tracing_gen_ctx(); |
---|
| 144 | + pc = preempt_count(); |
---|
144 | 145 | preempt_disable_notrace(); |
---|
145 | 146 | |
---|
146 | 147 | bit = trace_test_and_set_recursion(TRACE_FTRACE_START); |
---|
.. | .. |
---|
149 | 150 | |
---|
150 | 151 | cpu = smp_processor_id(); |
---|
151 | 152 | data = per_cpu_ptr(tr->array_buffer.data, cpu); |
---|
152 | | - if (!atomic_read(&data->disabled)) |
---|
153 | | - trace_function(tr, ip, parent_ip, trace_ctx); |
---|
154 | | - |
---|
| 153 | + if (!atomic_read(&data->disabled)) { |
---|
| 154 | + local_save_flags(flags); |
---|
| 155 | + trace_function(tr, ip, parent_ip, flags, pc); |
---|
| 156 | + } |
---|
155 | 157 | trace_clear_recursion(bit); |
---|
156 | 158 | |
---|
157 | 159 | out: |
---|
.. | .. |
---|
185 | 187 | unsigned long flags; |
---|
186 | 188 | long disabled; |
---|
187 | 189 | int cpu; |
---|
188 | | - unsigned int trace_ctx; |
---|
| 190 | + int pc; |
---|
189 | 191 | |
---|
190 | 192 | if (unlikely(!tr->function_enabled)) |
---|
191 | 193 | return; |
---|
.. | .. |
---|
200 | 202 | disabled = atomic_inc_return(&data->disabled); |
---|
201 | 203 | |
---|
202 | 204 | if (likely(disabled == 1)) { |
---|
203 | | - trace_ctx = tracing_gen_ctx_flags(flags); |
---|
204 | | - trace_function(tr, ip, parent_ip, trace_ctx); |
---|
205 | | - __trace_stack(tr, trace_ctx, STACK_SKIP); |
---|
| 205 | + pc = preempt_count(); |
---|
| 206 | + trace_function(tr, ip, parent_ip, flags, pc); |
---|
| 207 | + __trace_stack(tr, flags, STACK_SKIP, pc); |
---|
206 | 208 | } |
---|
207 | 209 | |
---|
208 | 210 | atomic_dec(&data->disabled); |
---|
.. | .. |
---|
405 | 407 | |
---|
406 | 408 | static __always_inline void trace_stack(struct trace_array *tr) |
---|
407 | 409 | { |
---|
408 | | - unsigned int trace_ctx; |
---|
| 410 | + unsigned long flags; |
---|
| 411 | + int pc; |
---|
409 | 412 | |
---|
410 | | - trace_ctx = tracing_gen_ctx(); |
---|
| 413 | + local_save_flags(flags); |
---|
| 414 | + pc = preempt_count(); |
---|
411 | 415 | |
---|
412 | | - __trace_stack(tr, trace_ctx, FTRACE_STACK_SKIP); |
---|
| 416 | + __trace_stack(tr, flags, FTRACE_STACK_SKIP, pc); |
---|
413 | 417 | } |
---|
414 | 418 | |
---|
415 | 419 | static void |
---|