diff options
| -rw-r--r-- | tools/lib/traceevent/event-parse.c | 23 | ||||
| -rw-r--r-- | tools/lib/traceevent/event-parse.h | 2 |
2 files changed, 25 insertions, 0 deletions
diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c index d1973cb8388b..1587ea392ad6 100644 --- a/tools/lib/traceevent/event-parse.c +++ b/tools/lib/traceevent/event-parse.c | |||
| @@ -5560,6 +5560,29 @@ int pevent_register_print_function(struct pevent *pevent, | |||
| 5560 | return ret; | 5560 | return ret; |
| 5561 | } | 5561 | } |
| 5562 | 5562 | ||
| 5563 | /** | ||
| 5564 | * pevent_unregister_print_function - unregister a helper function | ||
| 5565 | * @pevent: the handle to the pevent | ||
| 5566 | * @func: the function to process the helper function | ||
| 5567 | * @name: the name of the helper function | ||
| 5568 | * | ||
| 5569 | * This function removes existing print handler for function @name. | ||
| 5570 | * | ||
| 5571 | * Returns 0 if the handler was removed successully, -1 otherwise. | ||
| 5572 | */ | ||
| 5573 | int pevent_unregister_print_function(struct pevent *pevent, | ||
| 5574 | pevent_func_handler func, char *name) | ||
| 5575 | { | ||
| 5576 | struct pevent_function_handler *func_handle; | ||
| 5577 | |||
| 5578 | func_handle = find_func_handler(pevent, name); | ||
| 5579 | if (func_handle && func_handle->func == func) { | ||
| 5580 | remove_func_handler(pevent, name); | ||
| 5581 | return 0; | ||
| 5582 | } | ||
| 5583 | return -1; | ||
| 5584 | } | ||
| 5585 | |||
| 5563 | static struct event_format *pevent_search_event(struct pevent *pevent, int id, | 5586 | static struct event_format *pevent_search_event(struct pevent *pevent, int id, |
| 5564 | const char *sys_name, | 5587 | const char *sys_name, |
| 5565 | const char *event_name) | 5588 | const char *event_name) |
diff --git a/tools/lib/traceevent/event-parse.h b/tools/lib/traceevent/event-parse.h index c48acfbc6230..791c539374c7 100644 --- a/tools/lib/traceevent/event-parse.h +++ b/tools/lib/traceevent/event-parse.h | |||
| @@ -631,6 +631,8 @@ int pevent_register_print_function(struct pevent *pevent, | |||
| 631 | pevent_func_handler func, | 631 | pevent_func_handler func, |
| 632 | enum pevent_func_arg_type ret_type, | 632 | enum pevent_func_arg_type ret_type, |
| 633 | char *name, ...); | 633 | char *name, ...); |
| 634 | int pevent_unregister_print_function(struct pevent *pevent, | ||
| 635 | pevent_func_handler func, char *name); | ||
| 634 | 636 | ||
| 635 | struct format_field *pevent_find_common_field(struct event_format *event, const char *name); | 637 | struct format_field *pevent_find_common_field(struct event_format *event, const char *name); |
| 636 | struct format_field *pevent_find_field(struct event_format *event, const char *name); | 638 | struct format_field *pevent_find_field(struct event_format *event, const char *name); |
