Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'trace-v5.4-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace

Pull tracing fixes from Steven Rostedt:
"A few more tracing fixes:

- Fix a buffer overflow by checking nr_args correctly in probes

- Fix a warning that is reported by clang

- Fix a possible memory leak in error path of filter processing

- Fix the selftest that checks for failures, but wasn't failing

- Minor clean up on call site output of a memory trace event"

* tag 'trace-v5.4-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
selftests/ftrace: Fix same probe error test
mm, tracing: Print symbol name for call_site in trace events
tracing: Have error path in predicate_parse() free its allocated memory
tracing: Fix clang -Wint-in-bool-context warnings in IF_ASSIGN macro
tracing/probe: Fix to check the difference of nr_args before adding probe

+30 -11
+4 -3
include/trace/events/kmem.h
··· 35 35 __entry->gfp_flags = gfp_flags; 36 36 ), 37 37 38 - TP_printk("call_site=%lx ptr=%p bytes_req=%zu bytes_alloc=%zu gfp_flags=%s", 39 - __entry->call_site, 38 + TP_printk("call_site=%pS ptr=%p bytes_req=%zu bytes_alloc=%zu gfp_flags=%s", 39 + (void *)__entry->call_site, 40 40 __entry->ptr, 41 41 __entry->bytes_req, 42 42 __entry->bytes_alloc, ··· 131 131 __entry->ptr = ptr; 132 132 ), 133 133 134 - TP_printk("call_site=%lx ptr=%p", __entry->call_site, __entry->ptr) 134 + TP_printk("call_site=%pS ptr=%p", 135 + (void *)__entry->call_site, __entry->ptr) 135 136 ); 136 137 137 138 DEFINE_EVENT(kmem_free, kfree,
+5 -5
kernel/trace/trace.h
··· 365 365 __builtin_types_compatible_p(typeof(var), type *) 366 366 367 367 #undef IF_ASSIGN 368 - #define IF_ASSIGN(var, entry, etype, id) \ 369 - if (FTRACE_CMP_TYPE(var, etype)) { \ 370 - var = (typeof(var))(entry); \ 371 - WARN_ON(id && (entry)->type != id); \ 372 - break; \ 368 + #define IF_ASSIGN(var, entry, etype, id) \ 369 + if (FTRACE_CMP_TYPE(var, etype)) { \ 370 + var = (typeof(var))(entry); \ 371 + WARN_ON(id != 0 && (entry)->type != id); \ 372 + break; \ 373 373 } 374 374 375 375 /* Will cause compile errors if type is not found. */
+4 -2
kernel/trace/trace_events_filter.c
··· 452 452 453 453 switch (*next) { 454 454 case '(': /* #2 */ 455 - if (top - op_stack > nr_parens) 456 - return ERR_PTR(-EINVAL); 455 + if (top - op_stack > nr_parens) { 456 + ret = -EINVAL; 457 + goto out_free; 458 + } 457 459 *(++top) = invert; 458 460 continue; 459 461 case '!': /* #3 */
+16
kernel/trace/trace_probe.c
··· 178 178 if (!command) 179 179 return; 180 180 181 + if (trace_probe_log.index >= trace_probe_log.argc) { 182 + /** 183 + * Set the error position is next to the last arg + space. 184 + * Note that len includes the terminal null and the cursor 185 + * appaers at pos + 1. 186 + */ 187 + pos = len; 188 + offset = 0; 189 + } 190 + 181 191 /* And make a command string from argv array */ 182 192 p = command; 183 193 for (i = 0; i < trace_probe_log.argc; i++) { ··· 1093 1083 int trace_probe_compare_arg_type(struct trace_probe *a, struct trace_probe *b) 1094 1084 { 1095 1085 int i; 1086 + 1087 + /* In case of more arguments */ 1088 + if (a->nr_args < b->nr_args) 1089 + return a->nr_args + 1; 1090 + if (a->nr_args > b->nr_args) 1091 + return b->nr_args + 1; 1096 1092 1097 1093 for (i = 0; i < a->nr_args; i++) { 1098 1094 if ((b->nr_args <= i) ||
+1 -1
tools/testing/selftests/ftrace/test.d/kprobe/kprobe_syntax_errors.tc
··· 95 95 check_error 'p:kprobes/testevent _do_fork ^bcd=\1' # DIFF_ARG_TYPE 96 96 check_error 'p:kprobes/testevent _do_fork ^abcd=\1:u8' # DIFF_ARG_TYPE 97 97 check_error 'p:kprobes/testevent _do_fork ^abcd=\"foo"' # DIFF_ARG_TYPE 98 - check_error '^p:kprobes/testevent _do_fork' # SAME_PROBE 98 + check_error '^p:kprobes/testevent _do_fork abcd=\1' # SAME_PROBE 99 99 fi 100 100 101 101 exit 0