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

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

Pull tracing fix and cleanup from Steven Rostedt:
"Tracing fix for histograms and a clean up in ftrace:

- Fixed a bug that broke the .sym-offset modifier and added a test to
make sure nothing breaks it again.

- Replace a list_del/list_add() with a list_move()"

* tag 'trace-v5.14-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
ftrace: Use list_move instead of list_del/list_add
tracing/selftests: Add tests to test histogram sym and sym-offset modifiers
tracing/histograms: Fix parsing of "sym-offset" modifier

+26 -2
+1 -2
kernel/trace/ftrace.c
··· 4212 4212 if (!func) /* warn? */ 4213 4213 continue; 4214 4214 4215 - list_del(&ftrace_mod->list); 4216 - list_add(&ftrace_mod->list, &process_mods); 4215 + list_move(&ftrace_mod->list, &process_mods); 4217 4216 4218 4217 /* Use the newly allocated func, as it may be "*" */ 4219 4218 kfree(ftrace_mod->func);
+7
kernel/trace/trace_events_hist.c
··· 1555 1555 1556 1556 switch (*op) { 1557 1557 case '-': 1558 + /* 1559 + * Unfortunately, the modifier ".sym-offset" 1560 + * can confuse things. 1561 + */ 1562 + if (op - str >= 4 && !strncmp(op - 4, ".sym-offset", 11)) 1563 + return FIELD_OP_NONE; 1564 + 1558 1565 if (*str == '-') 1559 1566 field_op = FIELD_OP_UNARY_MINUS; 1560 1567 else
+18
tools/testing/selftests/ftrace/test.d/trigger/trigger-hist.tc
··· 39 39 40 40 reset_trigger 41 41 42 + echo "Test histogram with sym modifier" 43 + 44 + echo 'hist:keys=call_site.sym' > events/kmem/kmalloc/trigger 45 + for i in `seq 1 10` ; do ( echo "forked" > /dev/null); done 46 + grep '{ call_site: \[[0-9a-f][0-9a-f]*\] [_a-zA-Z][_a-zA-Z]* *}' events/kmem/kmalloc/hist > /dev/null || \ 47 + fail "sym modifier on kmalloc call_site did not work" 48 + 49 + reset_trigger 50 + 51 + echo "Test histogram with sym-offset modifier" 52 + 53 + echo 'hist:keys=call_site.sym-offset' > events/kmem/kmalloc/trigger 54 + for i in `seq 1 10` ; do ( echo "forked" > /dev/null); done 55 + grep '{ call_site: \[[0-9a-f][0-9a-f]*\] [_a-zA-Z][_a-zA-Z]*+0x[0-9a-f][0-9a-f]*' events/kmem/kmalloc/hist > /dev/null || \ 56 + fail "sym-offset modifier on kmalloc call_site did not work" 57 + 58 + reset_trigger 59 + 42 60 echo "Test histogram with sort key" 43 61 44 62 echo 'hist:keys=parent_pid,child_pid:sort=child_pid.ascending' > events/sched/sched_process_fork/trigger