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.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c
index f2989c525e48..5a824e355d04 100644
--- a/tools/lib/traceevent/event-parse.c
+++ b/tools/lib/traceevent/event-parse.c
@@ -174,7 +174,7 @@ static int cmdline_init(struct pevent *pevent)
174 return 0; 174 return 0;
175} 175}
176 176
177static char *find_cmdline(struct pevent *pevent, int pid) 177static const char *find_cmdline(struct pevent *pevent, int pid)
178{ 178{
179 const struct cmdline *comm; 179 const struct cmdline *comm;
180 struct cmdline key; 180 struct cmdline key;
@@ -2637,7 +2637,7 @@ process_func_handler(struct event_format *event, struct pevent_function_handler
2637 struct print_arg *farg; 2637 struct print_arg *farg;
2638 enum event_type type; 2638 enum event_type type;
2639 char *token; 2639 char *token;
2640 char *test; 2640 const char *test;
2641 int i; 2641 int i;
2642 2642
2643 arg->type = PRINT_FUNC; 2643 arg->type = PRINT_FUNC;
@@ -3889,7 +3889,7 @@ static void print_mac_arg(struct trace_seq *s, int mac, void *data, int size,
3889 struct event_format *event, struct print_arg *arg) 3889 struct event_format *event, struct print_arg *arg)
3890{ 3890{
3891 unsigned char *buf; 3891 unsigned char *buf;
3892 char *fmt = "%.2x:%.2x:%.2x:%.2x:%.2x:%.2x"; 3892 const char *fmt = "%.2x:%.2x:%.2x:%.2x:%.2x:%.2x";
3893 3893
3894 if (arg->type == PRINT_FUNC) { 3894 if (arg->type == PRINT_FUNC) {
3895 process_defined_func(s, data, size, event, arg); 3895 process_defined_func(s, data, size, event, arg);
@@ -3931,7 +3931,8 @@ static int is_printable_array(char *p, unsigned int len)
3931 return 1; 3931 return 1;
3932} 3932}
3933 3933
3934static void print_event_fields(struct trace_seq *s, void *data, int size, 3934static void print_event_fields(struct trace_seq *s, void *data,
3935 int size __maybe_unused,
3935 struct event_format *event) 3936 struct event_format *event)
3936{ 3937{
3937 struct format_field *field; 3938 struct format_field *field;
@@ -4408,7 +4409,7 @@ void pevent_event_info(struct trace_seq *s, struct event_format *event,
4408void pevent_print_event(struct pevent *pevent, struct trace_seq *s, 4409void pevent_print_event(struct pevent *pevent, struct trace_seq *s,
4409 struct pevent_record *record) 4410 struct pevent_record *record)
4410{ 4411{
4411 static char *spaces = " "; /* 20 spaces */ 4412 static const char *spaces = " "; /* 20 spaces */
4412 struct event_format *event; 4413 struct event_format *event;
4413 unsigned long secs; 4414 unsigned long secs;
4414 unsigned long usecs; 4415 unsigned long usecs;
@@ -5070,8 +5071,8 @@ static const char * const pevent_error_str[] = {
5070}; 5071};
5071#undef _PE 5072#undef _PE
5072 5073
5073int pevent_strerror(struct pevent *pevent, enum pevent_errno errnum, 5074int pevent_strerror(struct pevent *pevent __maybe_unused,
5074 char *buf, size_t buflen) 5075 enum pevent_errno errnum, char *buf, size_t buflen)
5075{ 5076{
5076 int idx; 5077 int idx;
5077 const char *msg; 5078 const char *msg;
@@ -5100,6 +5101,7 @@ int pevent_strerror(struct pevent *pevent, enum pevent_errno errnum,
5100 case PEVENT_ERRNO__READ_FORMAT_FAILED: 5101 case PEVENT_ERRNO__READ_FORMAT_FAILED:
5101 case PEVENT_ERRNO__READ_PRINT_FAILED: 5102 case PEVENT_ERRNO__READ_PRINT_FAILED:
5102 case PEVENT_ERRNO__OLD_FTRACE_ARG_FAILED: 5103 case PEVENT_ERRNO__OLD_FTRACE_ARG_FAILED:
5104 case PEVENT_ERRNO__INVALID_ARG_TYPE:
5103 snprintf(buf, buflen, "%s", msg); 5105 snprintf(buf, buflen, "%s", msg);
5104 break; 5106 break;
5105 5107
@@ -5362,7 +5364,7 @@ int pevent_register_print_function(struct pevent *pevent,
5362 if (type == PEVENT_FUNC_ARG_VOID) 5364 if (type == PEVENT_FUNC_ARG_VOID)
5363 break; 5365 break;
5364 5366
5365 if (type < 0 || type >= PEVENT_FUNC_ARG_MAX_TYPES) { 5367 if (type >= PEVENT_FUNC_ARG_MAX_TYPES) {
5366 do_warning("Invalid argument type %d", type); 5368 do_warning("Invalid argument type %d", type);
5367 ret = PEVENT_ERRNO__INVALID_ARG_TYPE; 5369 ret = PEVENT_ERRNO__INVALID_ARG_TYPE;
5368 goto out_free; 5370 goto out_free;
@@ -5560,7 +5562,7 @@ void pevent_free(struct pevent *pevent)
5560 } 5562 }
5561 5563
5562 if (pevent->func_map) { 5564 if (pevent->func_map) {
5563 for (i = 0; i < pevent->func_count; i++) { 5565 for (i = 0; i < (int)pevent->func_count; i++) {
5564 free(pevent->func_map[i].func); 5566 free(pevent->func_map[i].func);
5565 free(pevent->func_map[i].mod); 5567 free(pevent->func_map[i].mod);
5566 } 5568 }
@@ -5582,7 +5584,7 @@ void pevent_free(struct pevent *pevent)
5582 } 5584 }
5583 5585
5584 if (pevent->printk_map) { 5586 if (pevent->printk_map) {
5585 for (i = 0; i < pevent->printk_count; i++) 5587 for (i = 0; i < (int)pevent->printk_count; i++)
5586 free(pevent->printk_map[i].printk); 5588 free(pevent->printk_map[i].printk);
5587 free(pevent->printk_map); 5589 free(pevent->printk_map);
5588 } 5590 }