aboutsummaryrefslogtreecommitdiffstats
path: root/tools/lib/traceevent/event-parse.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/lib/traceevent/event-parse.c')
-rw-r--r--tools/lib/traceevent/event-parse.c62
1 files changed, 31 insertions, 31 deletions
diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c
index 01b5dbf2abdf..8d0ce0ea52dc 100644
--- a/tools/lib/traceevent/event-parse.c
+++ b/tools/lib/traceevent/event-parse.c
@@ -94,14 +94,14 @@ struct event_handler {
94 94
95struct pevent_func_params { 95struct pevent_func_params {
96 struct pevent_func_params *next; 96 struct pevent_func_params *next;
97 enum pevent_func_arg_type type; 97 enum tep_func_arg_type type;
98}; 98};
99 99
100struct pevent_function_handler { 100struct tep_function_handler {
101 struct pevent_function_handler *next; 101 struct tep_function_handler *next;
102 enum pevent_func_arg_type ret_type; 102 enum tep_func_arg_type ret_type;
103 char *name; 103 char *name;
104 pevent_func_handler func; 104 tep_func_handler func;
105 struct pevent_func_params *params; 105 struct pevent_func_params *params;
106 int nr_args; 106 int nr_args;
107}; 107};
@@ -110,7 +110,7 @@ static unsigned long long
110process_defined_func(struct trace_seq *s, void *data, int size, 110process_defined_func(struct trace_seq *s, void *data, int size,
111 struct event_format *event, struct print_arg *arg); 111 struct event_format *event, struct print_arg *arg);
112 112
113static void free_func_handle(struct pevent_function_handler *func); 113static void free_func_handle(struct tep_function_handler *func);
114 114
115/** 115/**
116 * pevent_buffer_init - init buffer for parsing 116 * pevent_buffer_init - init buffer for parsing
@@ -2914,10 +2914,10 @@ process_bitmask(struct event_format *event __maybe_unused, struct print_arg *arg
2914 return EVENT_ERROR; 2914 return EVENT_ERROR;
2915} 2915}
2916 2916
2917static struct pevent_function_handler * 2917static struct tep_function_handler *
2918find_func_handler(struct tep_handle *pevent, char *func_name) 2918find_func_handler(struct tep_handle *pevent, char *func_name)
2919{ 2919{
2920 struct pevent_function_handler *func; 2920 struct tep_function_handler *func;
2921 2921
2922 if (!pevent) 2922 if (!pevent)
2923 return NULL; 2923 return NULL;
@@ -2932,8 +2932,8 @@ find_func_handler(struct tep_handle *pevent, char *func_name)
2932 2932
2933static void remove_func_handler(struct tep_handle *pevent, char *func_name) 2933static void remove_func_handler(struct tep_handle *pevent, char *func_name)
2934{ 2934{
2935 struct pevent_function_handler *func; 2935 struct tep_function_handler *func;
2936 struct pevent_function_handler **next; 2936 struct tep_function_handler **next;
2937 2937
2938 next = &pevent->func_handlers; 2938 next = &pevent->func_handlers;
2939 while ((func = *next)) { 2939 while ((func = *next)) {
@@ -2947,7 +2947,7 @@ static void remove_func_handler(struct tep_handle *pevent, char *func_name)
2947} 2947}
2948 2948
2949static enum event_type 2949static enum event_type
2950process_func_handler(struct event_format *event, struct pevent_function_handler *func, 2950process_func_handler(struct event_format *event, struct tep_function_handler *func,
2951 struct print_arg *arg, char **tok) 2951 struct print_arg *arg, char **tok)
2952{ 2952{
2953 struct print_arg **next_arg; 2953 struct print_arg **next_arg;
@@ -3008,7 +3008,7 @@ static enum event_type
3008process_function(struct event_format *event, struct print_arg *arg, 3008process_function(struct event_format *event, struct print_arg *arg,
3009 char *token, char **tok) 3009 char *token, char **tok)
3010{ 3010{
3011 struct pevent_function_handler *func; 3011 struct tep_function_handler *func;
3012 3012
3013 if (strcmp(token, "__print_flags") == 0) { 3013 if (strcmp(token, "__print_flags") == 0) {
3014 free_token(token); 3014 free_token(token);
@@ -4132,7 +4132,7 @@ static unsigned long long
4132process_defined_func(struct trace_seq *s, void *data, int size, 4132process_defined_func(struct trace_seq *s, void *data, int size,
4133 struct event_format *event, struct print_arg *arg) 4133 struct event_format *event, struct print_arg *arg)
4134{ 4134{
4135 struct pevent_function_handler *func_handle = arg->func.func; 4135 struct tep_function_handler *func_handle = arg->func.func;
4136 struct pevent_func_params *param; 4136 struct pevent_func_params *param;
4137 unsigned long long *args; 4137 unsigned long long *args;
4138 unsigned long long ret; 4138 unsigned long long ret;
@@ -4159,12 +4159,12 @@ process_defined_func(struct trace_seq *s, void *data, int size,
4159 4159
4160 for (i = 0; i < func_handle->nr_args; i++) { 4160 for (i = 0; i < func_handle->nr_args; i++) {
4161 switch (param->type) { 4161 switch (param->type) {
4162 case PEVENT_FUNC_ARG_INT: 4162 case TEP_FUNC_ARG_INT:
4163 case PEVENT_FUNC_ARG_LONG: 4163 case TEP_FUNC_ARG_LONG:
4164 case PEVENT_FUNC_ARG_PTR: 4164 case TEP_FUNC_ARG_PTR:
4165 args[i] = eval_num_arg(data, size, event, farg); 4165 args[i] = eval_num_arg(data, size, event, farg);
4166 break; 4166 break;
4167 case PEVENT_FUNC_ARG_STRING: 4167 case TEP_FUNC_ARG_STRING:
4168 trace_seq_init(&str); 4168 trace_seq_init(&str);
4169 print_str_arg(&str, data, size, event, "%s", -1, farg); 4169 print_str_arg(&str, data, size, event, "%s", -1, farg);
4170 trace_seq_terminate(&str); 4170 trace_seq_terminate(&str);
@@ -6461,7 +6461,7 @@ int tep_print_func_field(struct trace_seq *s, const char *fmt,
6461 return -1; 6461 return -1;
6462} 6462}
6463 6463
6464static void free_func_handle(struct pevent_function_handler *func) 6464static void free_func_handle(struct tep_function_handler *func)
6465{ 6465{
6466 struct pevent_func_params *params; 6466 struct pevent_func_params *params;
6467 6467
@@ -6482,24 +6482,24 @@ static void free_func_handle(struct pevent_function_handler *func)
6482 * @func: the function to process the helper function 6482 * @func: the function to process the helper function
6483 * @ret_type: the return type of the helper function 6483 * @ret_type: the return type of the helper function
6484 * @name: the name of the helper function 6484 * @name: the name of the helper function
6485 * @parameters: A list of enum pevent_func_arg_type 6485 * @parameters: A list of enum tep_func_arg_type
6486 * 6486 *
6487 * Some events may have helper functions in the print format arguments. 6487 * Some events may have helper functions in the print format arguments.
6488 * This allows a plugin to dynamically create a way to process one 6488 * This allows a plugin to dynamically create a way to process one
6489 * of these functions. 6489 * of these functions.
6490 * 6490 *
6491 * The @parameters is a variable list of pevent_func_arg_type enums that 6491 * The @parameters is a variable list of tep_func_arg_type enums that
6492 * must end with PEVENT_FUNC_ARG_VOID. 6492 * must end with TEP_FUNC_ARG_VOID.
6493 */ 6493 */
6494int pevent_register_print_function(struct tep_handle *pevent, 6494int pevent_register_print_function(struct tep_handle *pevent,
6495 pevent_func_handler func, 6495 tep_func_handler func,
6496 enum pevent_func_arg_type ret_type, 6496 enum tep_func_arg_type ret_type,
6497 char *name, ...) 6497 char *name, ...)
6498{ 6498{
6499 struct pevent_function_handler *func_handle; 6499 struct tep_function_handler *func_handle;
6500 struct pevent_func_params **next_param; 6500 struct pevent_func_params **next_param;
6501 struct pevent_func_params *param; 6501 struct pevent_func_params *param;
6502 enum pevent_func_arg_type type; 6502 enum tep_func_arg_type type;
6503 va_list ap; 6503 va_list ap;
6504 int ret; 6504 int ret;
6505 6505
@@ -6532,11 +6532,11 @@ int pevent_register_print_function(struct tep_handle *pevent,
6532 next_param = &(func_handle->params); 6532 next_param = &(func_handle->params);
6533 va_start(ap, name); 6533 va_start(ap, name);
6534 for (;;) { 6534 for (;;) {
6535 type = va_arg(ap, enum pevent_func_arg_type); 6535 type = va_arg(ap, enum tep_func_arg_type);
6536 if (type == PEVENT_FUNC_ARG_VOID) 6536 if (type == TEP_FUNC_ARG_VOID)
6537 break; 6537 break;
6538 6538
6539 if (type >= PEVENT_FUNC_ARG_MAX_TYPES) { 6539 if (type >= TEP_FUNC_ARG_MAX_TYPES) {
6540 do_warning("Invalid argument type %d", type); 6540 do_warning("Invalid argument type %d", type);
6541 ret = TEP_ERRNO__INVALID_ARG_TYPE; 6541 ret = TEP_ERRNO__INVALID_ARG_TYPE;
6542 goto out_free; 6542 goto out_free;
@@ -6579,9 +6579,9 @@ int pevent_register_print_function(struct tep_handle *pevent,
6579 * Returns 0 if the handler was removed successully, -1 otherwise. 6579 * Returns 0 if the handler was removed successully, -1 otherwise.
6580 */ 6580 */
6581int pevent_unregister_print_function(struct tep_handle *pevent, 6581int pevent_unregister_print_function(struct tep_handle *pevent,
6582 pevent_func_handler func, char *name) 6582 tep_func_handler func, char *name)
6583{ 6583{
6584 struct pevent_function_handler *func_handle; 6584 struct tep_function_handler *func_handle;
6585 6585
6586 func_handle = find_func_handler(pevent, name); 6586 func_handle = find_func_handler(pevent, name);
6587 if (func_handle && func_handle->func == func) { 6587 if (func_handle && func_handle->func == func) {
@@ -6819,7 +6819,7 @@ void tep_free(struct tep_handle *pevent)
6819 struct cmdline_list *cmdlist, *cmdnext; 6819 struct cmdline_list *cmdlist, *cmdnext;
6820 struct func_list *funclist, *funcnext; 6820 struct func_list *funclist, *funcnext;
6821 struct printk_list *printklist, *printknext; 6821 struct printk_list *printklist, *printknext;
6822 struct pevent_function_handler *func_handler; 6822 struct tep_function_handler *func_handler;
6823 struct event_handler *handle; 6823 struct event_handler *handle;
6824 int i; 6824 int i;
6825 6825