diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-01-12 23:04:15 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-01-12 23:04:15 -0500 |
commit | c17488d06666153a14dd3f21bd10eba58383f6c1 (patch) | |
tree | 8a8dfaa2b2692f8b4eb20fe7e4266036f692fbdc /tools | |
parent | 34a9304a96d6351c2d35dcdc9293258378fc0bd8 (diff) | |
parent | 5156dca34a3e1e1edac2d0dabf43d8632909b7aa (diff) |
Merge tag 'trace-v4.5' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace
Pull tracing updates from Steven Rostedt:
"Not much new with tracing for this release. Mostly just clean ups and
minor fixes.
Here's what else is new:
- A new TRACE_EVENT_FN_COND macro, combining both _FN and _COND for
those that want both.
- New selftest to test the instance create and delete
- Better debug output when ftrace fails"
* tag 'trace-v4.5' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: (24 commits)
ftrace: Fix the race between ftrace and insmod
ftrace: Add infrastructure for delayed enabling of module functions
x86: ftrace: Fix the comments for ftrace_modify_code_direct()
tracing: Fix comment to use tracing_on over tracing_enable
metag: ftrace: Fix the comments for ftrace_modify_code
sh: ftrace: Fix the comments for ftrace_modify_code()
ia64: ftrace: Fix the comments for ftrace_modify_code()
ftrace: Clean up ftrace_module_init() code
ftrace: Join functions ftrace_module_init() and ftrace_init_module()
tracing: Introduce TRACE_EVENT_FN_COND macro
tracing: Use seq_buf_used() in seq_buf_to_user() instead of len
bpf: Constify bpf_verifier_ops structure
ftrace: Have ftrace_ops_get_func() handle RCU and PER_CPU flags too
ftrace: Remove use of control list and ops
ftrace: Fix output of enabled_functions for showing tramp
ftrace: Fix a typo in comment
ftrace: Show all tramps registered to a record on ftrace_bug()
ftrace: Add variable ftrace_expected for archs to show expected code
ftrace: Add new type to distinguish what kind of ftrace_bug()
tracing: Update cond flag when enabling or disabling a trigger
...
Diffstat (limited to 'tools')
-rw-r--r-- | tools/testing/selftests/ftrace/test.d/instances/instance.tc | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/tools/testing/selftests/ftrace/test.d/instances/instance.tc b/tools/testing/selftests/ftrace/test.d/instances/instance.tc new file mode 100644 index 000000000000..773e276ff90b --- /dev/null +++ b/tools/testing/selftests/ftrace/test.d/instances/instance.tc | |||
@@ -0,0 +1,90 @@ | |||
1 | #!/bin/sh | ||
2 | # description: Test creation and deletion of trace instances | ||
3 | |||
4 | if [ ! -d instances ] ; then | ||
5 | echo "no instance directory with this kernel" | ||
6 | exit_unsupported; | ||
7 | fi | ||
8 | |||
9 | fail() { # mesg | ||
10 | rmdir x y z 2>/dev/null | ||
11 | echo $1 | ||
12 | set -e | ||
13 | exit $FAIL | ||
14 | } | ||
15 | |||
16 | cd instances | ||
17 | |||
18 | # we don't want to fail on error | ||
19 | set +e | ||
20 | |||
21 | mkdir x | ||
22 | rmdir x | ||
23 | result=$? | ||
24 | |||
25 | if [ $result -ne 0 ]; then | ||
26 | echo "instance rmdir not supported" | ||
27 | exit_unsupported | ||
28 | fi | ||
29 | |||
30 | instance_slam() { | ||
31 | while :; do | ||
32 | mkdir x | ||
33 | mkdir y | ||
34 | mkdir z | ||
35 | rmdir x | ||
36 | rmdir y | ||
37 | rmdir z | ||
38 | done 2>/dev/null | ||
39 | } | ||
40 | |||
41 | instance_slam & | ||
42 | x=`jobs -l` | ||
43 | p1=`echo $x | cut -d' ' -f2` | ||
44 | echo $p1 | ||
45 | |||
46 | instance_slam & | ||
47 | x=`jobs -l | tail -1` | ||
48 | p2=`echo $x | cut -d' ' -f2` | ||
49 | echo $p2 | ||
50 | |||
51 | instance_slam & | ||
52 | x=`jobs -l | tail -1` | ||
53 | p3=`echo $x | cut -d' ' -f2` | ||
54 | echo $p3 | ||
55 | |||
56 | instance_slam & | ||
57 | x=`jobs -l | tail -1` | ||
58 | p4=`echo $x | cut -d' ' -f2` | ||
59 | echo $p4 | ||
60 | |||
61 | instance_slam & | ||
62 | x=`jobs -l | tail -1` | ||
63 | p5=`echo $x | cut -d' ' -f2` | ||
64 | echo $p5 | ||
65 | |||
66 | ls -lR >/dev/null | ||
67 | sleep 1 | ||
68 | |||
69 | kill -1 $p1 | ||
70 | kill -1 $p2 | ||
71 | kill -1 $p3 | ||
72 | kill -1 $p4 | ||
73 | kill -1 $p5 | ||
74 | |||
75 | echo "Wait for processes to finish" | ||
76 | wait $p1 $p2 $p3 $p4 $p5 | ||
77 | echo "all processes finished, wait for cleanup" | ||
78 | |||
79 | mkdir x y z | ||
80 | ls x y z | ||
81 | rmdir x y z | ||
82 | for d in x y z; do | ||
83 | if [ -d $d ]; then | ||
84 | fail "instance $d still exists" | ||
85 | fi | ||
86 | done | ||
87 | |||
88 | set -e | ||
89 | |||
90 | exit 0 | ||