Move the checking, buffer reserve and buffer commit code in synth_event_trace_start/end() into inline functions __synth_event_trace_start/end() so they can also be used by synth_event_trace() and synth_event_trace_array(), and then have all those functions use them. Also, change synth_event_trace_state.enabled to disabled so it only needs to be set if the event is disabled, which is not normally the case. Link: http://lkml.kernel.org/r/b1f3108d0f450e58192955a300e31d0405ab4149.1581374549.git.zanussi@kernel.org
Showing the changes to include/linux (1 of 2 files). Show all
Unified · Split
| @@ -424,7 +424,7 @@ struct synth_event_trace_state { · 423 unmodified lines | ||
| 424 | 424 | struct synth_event *event; |
| 425 | 425 | unsigned int cur_field; |
| 426 | 426 | unsigned int n_u64; |
| 427 | − bool enabled; | |
| 427 | + bool disabled; | |
| 428 | 428 | bool add_next; |
| 429 | 429 | bool add_name; |
| 430 | 430 | }; |