.. | .. |
---|
184 | 184 | __common_field(unsigned char, flags); |
---|
185 | 185 | __common_field(unsigned char, preempt_count); |
---|
186 | 186 | __common_field(int, pid); |
---|
187 | | - __common_field(unsigned char, migrate_disable); |
---|
188 | | - __common_field(unsigned char, preempt_lazy_count); |
---|
189 | 187 | |
---|
190 | 188 | return ret; |
---|
191 | 189 | } |
---|
.. | .. |
---|
261 | 259 | trace_event_ignore_this_pid(trace_file)) |
---|
262 | 260 | return NULL; |
---|
263 | 261 | |
---|
| 262 | + local_save_flags(fbuffer->flags); |
---|
| 263 | + fbuffer->pc = preempt_count(); |
---|
264 | 264 | /* |
---|
265 | 265 | * If CONFIG_PREEMPTION is enabled, then the tracepoint itself disables |
---|
266 | 266 | * preemption (adding one to the preempt_count). Since we are |
---|
267 | 267 | * interested in the preempt_count at the time the tracepoint was |
---|
268 | 268 | * hit, we need to subtract one to offset the increment. |
---|
269 | 269 | */ |
---|
270 | | - fbuffer->trace_ctx = tracing_gen_ctx_dec(); |
---|
| 270 | + if (IS_ENABLED(CONFIG_PREEMPTION)) |
---|
| 271 | + fbuffer->pc--; |
---|
271 | 272 | fbuffer->trace_file = trace_file; |
---|
272 | 273 | |
---|
273 | 274 | fbuffer->event = |
---|
274 | 275 | trace_event_buffer_lock_reserve(&fbuffer->buffer, trace_file, |
---|
275 | 276 | event_call->event.type, len, |
---|
276 | | - fbuffer->trace_ctx); |
---|
| 277 | + fbuffer->flags, fbuffer->pc); |
---|
277 | 278 | if (!fbuffer->event) |
---|
278 | 279 | return NULL; |
---|
279 | 280 | |
---|
.. | .. |
---|
3698 | 3699 | struct trace_buffer *buffer; |
---|
3699 | 3700 | struct ring_buffer_event *event; |
---|
3700 | 3701 | struct ftrace_entry *entry; |
---|
3701 | | - unsigned int trace_ctx; |
---|
| 3702 | + unsigned long flags; |
---|
3702 | 3703 | long disabled; |
---|
3703 | 3704 | int cpu; |
---|
| 3705 | + int pc; |
---|
3704 | 3706 | |
---|
3705 | | - trace_ctx = tracing_gen_ctx(); |
---|
| 3707 | + pc = preempt_count(); |
---|
3706 | 3708 | preempt_disable_notrace(); |
---|
3707 | 3709 | cpu = raw_smp_processor_id(); |
---|
3708 | 3710 | disabled = atomic_inc_return(&per_cpu(ftrace_test_event_disable, cpu)); |
---|
.. | .. |
---|
3710 | 3712 | if (disabled != 1) |
---|
3711 | 3713 | goto out; |
---|
3712 | 3714 | |
---|
| 3715 | + local_save_flags(flags); |
---|
| 3716 | + |
---|
3713 | 3717 | event = trace_event_buffer_lock_reserve(&buffer, &event_trace_file, |
---|
3714 | 3718 | TRACE_FN, sizeof(*entry), |
---|
3715 | | - trace_ctx); |
---|
| 3719 | + flags, pc); |
---|
3716 | 3720 | if (!event) |
---|
3717 | 3721 | goto out; |
---|
3718 | 3722 | entry = ring_buffer_event_data(event); |
---|
.. | .. |
---|
3720 | 3724 | entry->parent_ip = parent_ip; |
---|
3721 | 3725 | |
---|
3722 | 3726 | event_trigger_unlock_commit(&event_trace_file, buffer, event, |
---|
3723 | | - entry, trace_ctx); |
---|
| 3727 | + entry, flags, pc); |
---|
3724 | 3728 | out: |
---|
3725 | 3729 | atomic_dec(&per_cpu(ftrace_test_event_disable, cpu)); |
---|
3726 | 3730 | preempt_enable_notrace(); |
---|