forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge tag 'trace-v4.13-2' of git://git.kernel.org/pub/scm/linux/kerne…
…l/git/rostedt/linux-trace Pull more tracing updates from Steven Rostedt: "A few more minor updates: - Show the tgid mappings for user space trace tools to use - Fix and optimize the comm and tgid cache recording - Sanitize derived kprobe names - Ftrace selftest updates - trace file header fix - Update of Documentation/trace/ftrace.txt - Compiler warning fixes - Fix possible uninitialized variable" * tag 'trace-v4.13-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: ftrace: Fix uninitialized variable in match_records() ftrace: Remove an unneeded NULL check ftrace: Hide cached module code for !CONFIG_MODULES tracing: Do note expose stack_trace_filter without DYNAMIC_FTRACE tracing: Update Documentation/trace/ftrace.txt tracing: Fixup trace file header alignment selftests/ftrace: Add a testcase for kprobe event naming selftests/ftrace: Add a test to probe module functions selftests/ftrace: Update multiple kprobes test for powerpc trace/kprobes: Sanitize derived event names tracing: Attempt to record other information even if some fail tracing: Treat recording tgid for idle task as a success tracing: Treat recording comm for idle task as a success tracing: Add saved_tgids file to show cached pid to tgid mappings
- Loading branch information
Showing
8 changed files
with
605 additions
and
134 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
tools/testing/selftests/ftrace/test.d/kprobe/kprobe_eventname.tc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/sh | ||
# description: Kprobe event auto/manual naming | ||
|
||
[ -f kprobe_events ] || exit_unsupported # this is configurable | ||
|
||
disable_events | ||
echo > kprobe_events | ||
|
||
:;: "Add an event on function without name" ;: | ||
|
||
FUNC=`grep " [tT] .*vfs_read$" /proc/kallsyms | tail -n 1 | cut -f 3 -d " "` | ||
[ "x" != "x$FUNC" ] || exit_unresolved | ||
echo "p $FUNC" > kprobe_events | ||
PROBE_NAME=`echo $FUNC | tr ".:" "_"` | ||
test -d events/kprobes/p_${PROBE_NAME}_0 || exit_failure | ||
|
||
:;: "Add an event on function with new name" ;: | ||
|
||
echo "p:event1 $FUNC" > kprobe_events | ||
test -d events/kprobes/event1 || exit_failure | ||
|
||
:;: "Add an event on function with new name and group" ;: | ||
|
||
echo "p:kprobes2/event2 $FUNC" > kprobe_events | ||
test -d events/kprobes2/event2 || exit_failure | ||
|
||
:;: "Add an event on dot function without name" ;: | ||
|
||
FUNC=`grep -m 10 " [tT] .*\.isra\..*$" /proc/kallsyms | tail -n 1 | cut -f 3 -d " "` | ||
[ "x" != "x$FUNC" ] || exit_unresolved | ||
echo "p $FUNC" > kprobe_events | ||
EVENT=`grep $FUNC kprobe_events | cut -f 1 -d " " | cut -f 2 -d:` | ||
[ "x" != "x$EVENT" ] || exit_failure | ||
test -d events/$EVENT || exit_failure | ||
|
||
echo > kprobe_events |
28 changes: 28 additions & 0 deletions
28
tools/testing/selftests/ftrace/test.d/kprobe/kprobe_module.tc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/sh | ||
# description: Kprobe dynamic event - probing module | ||
|
||
[ -f kprobe_events ] || exit_unsupported # this is configurable | ||
|
||
disable_events | ||
echo > kprobe_events | ||
|
||
:;: "Add an event on a module function without specifying event name" ;: | ||
|
||
MOD=`lsmod | head -n 2 | tail -n 1 | cut -f1 -d" "` | ||
FUNC=`grep -m 1 ".* t .*\\[$MOD\\]" /proc/kallsyms | xargs | cut -f3 -d" "` | ||
[ "x" != "x$MOD" -a "y" != "y$FUNC" ] || exit_unresolved | ||
echo "p $MOD:$FUNC" > kprobe_events | ||
PROBE_NAME=`echo $MOD:$FUNC | tr ".:" "_"` | ||
test -d events/kprobes/p_${PROBE_NAME}_0 || exit_failure | ||
|
||
:;: "Add an event on a module function with new event name" ;: | ||
|
||
echo "p:event1 $MOD:$FUNC" > kprobe_events | ||
test -d events/kprobes/event1 || exit_failure | ||
|
||
:;: "Add an event on a module function with new event and group name" ;: | ||
|
||
echo "p:kprobes1/event1 $MOD:$FUNC" > kprobe_events | ||
test -d events/kprobes1/event1 || exit_failure | ||
|
||
echo > kprobe_events |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters