Adding 2 new functions - 1) struct trace_array *trace_array_get_by_name(const char *name); Return pointer to a trace array with given name. If it does not exist, create and return pointer to the new trace array. 2) int trace_array_set_clr_event(struct trace_array *tr, const char *system ,const char *event, bool enable); Enable/Disable events to this trace array. Additionally, - To handle reference counters, export trace_array_put() - Due to introduction of the above 2 new functions, we no longer need to export - ftrace_set_clr_event & trace_array_create APIs. Link: http://lkml.kernel.org/r/1574276919-11119-2-git-send-email-divya.indi@oracle.com
Showing the changes to include/linux (2 of 5 files). Show all
Unified · Split
| @@ -29,7 +29,8 @@ struct trace_array; · 28 unmodified lines | |||
| 29 | void trace_printk_init_buffers(void); | 29 | void trace_printk_init_buffers(void); |
| 30 | int trace_array_printk(struct trace_array *tr, unsigned long ip, | 30 | int trace_array_printk(struct trace_array *tr, unsigned long ip, |
| 31 | const char *fmt, ...); | 31 | const char *fmt, ...); |
| 32 | struct trace_array *trace_array_create(const char *name); | 32 | void trace_array_put(struct trace_array *tr); |
| 33 | struct trace_array *trace_array_get_by_name(const char *name); | ||
| 33 | int trace_array_destroy(struct trace_array *tr); | 34 | int trace_array_destroy(struct trace_array *tr); |
| 34 | #endif /* CONFIG_TRACING */ | 35 | #endif /* CONFIG_TRACING */ |
| 35 | 36 | ||
| @@ -555,7 +555,8 @@ extern int trace_event_get_offsets(struct trace_event_call *call); · 554 unmodified lines | |||
| 555 | 555 | ||
| 556 | int ftrace_set_clr_event(struct trace_array *tr, char *buf, int set); | 556 | int ftrace_set_clr_event(struct trace_array *tr, char *buf, int set); |
| 557 | int trace_set_clr_event(const char *system, const char *event, int set); | 557 | int trace_set_clr_event(const char *system, const char *event, int set); |
| 558 | 558 | int trace_array_set_clr_event(struct trace_array *tr, const char *system, | |
| 559 | const char *event, bool enable); | ||
| 559 | /* | 560 | /* |
| 560 | * The double __builtin_constant_p is because gcc will give us an error | 561 | * The double __builtin_constant_p is because gcc will give us an error |
| 561 | * if we try to allocate the static variable to fmt if it is not a | 562 | * if we try to allocate the static variable to fmt if it is not a |