Debian Codegraph @

testsuite/systemtap.stress/conversions_trace.stp

raw
1 #! stap
2 # Usage: set $1 to supply test address; -DMAXERRORS=<many>
3 #
4 # Note that each test has to be in a separate probe, since an error
5 # aborts the current probe, but others will continue.
6 #
7 # See testsuite/systemtap.stress/conversions.stp for more info
8 #
9
10 global hits
11
12 @define fire_once(probeno,body) %(
13 probe kernel.trace("sched_switch") {
14 probeno = @probeno
15 if (hits[probeno] == 0) {
16 hits[probeno] = 1
17 @body
18 }
19 }
20 %)
21
22 @define unreachable %(
23 printf("REACHED_UNREACHABLE(%p,%d) at %s\n", $1, probeno, pp());
24 %)
25
26 # Call after lines that should continue execution
27 @define noerr %(
28 printf("NOERR(%p) at %s\n", $1, pp());
29 %)
30
31 @fire_once(0, println (kernel_string ($1)); @unreachable)
32 @fire_once(1, println (kernel_long ($1)); @noerr)
33 @fire_once(2, println (kernel_int($1)); @noerr)
34 @fire_once(3, println (kernel_short ($1)); @noerr)
35 @fire_once(4, println (kernel_char ($1)); @noerr)
36 @fire_once(7, printf ("%m\n", $1); @unreachable)
37 @fire_once(8, str = sprintf("%m", $1); printf ("%s\n", str); @unreachable)
38 @fire_once(9, printf ("%M\n", $1); @unreachable)
39 @fire_once(10, str = sprintf("%M", $1); printf ("%s\n", str); @unreachable)
40 @fire_once(11, println (user_string ($1)); @noerr)
41 @fire_once(12, println (user_string ($1,"<only suspected, not known>")); @noerr)
42 @fire_once(13, println (user_string_warn ($1)); @noerr)
43 @fire_once(14, println (user_string_warn ($1, "<only suspected, not known>")); @noerr)
44 @fire_once(15, println (user_string_quoted ($1)); @noerr)
45 @fire_once(16, println (user_string_n ($1, 5)); @unreachable)
46 @fire_once(17, println (user_string_n ($1, 5, "<only suspected, not known>")); @noerr)
47 @fire_once(18, println (user_string_n_warn ($1, 5)); @noerr)
48 @fire_once(19, println (user_string_n_warn ($1, 5, "<only suspected, not known>")); @noerr)
49 @fire_once(20, println (user_string_n_quoted ($1, 5)); @noerr)
50 @fire_once(21, println (user_short ($1)); @noerr)
51 @fire_once(22, println (user_short_warn ($1)); @noerr)
52 @fire_once(23, println (user_int ($1)); @noerr)
53 @fire_once(24, println (user_int_warn ($1)); @noerr)
54 @fire_once(25, println (user_long ($1)); @noerr)
55 @fire_once(26, println (user_long_warn ($1)); @noerr)
56 @fire_once(27, println (user_char ($1)); @noerr)
57 @fire_once(28, println (user_char_warn ($1)); @noerr)
58 @fire_once(29, println (kernel_buffer_quoted($1, 5, 20)); @noerr)
59 @fire_once(30, println (kernel_buffer_quoted_error($1, 5, 20)); @unreachable)
60 @fire_once(33, println (user_buffer_quoted($1, 5, 20)); @noerr)
61 @fire_once(34, println (user_buffer_quoted_error($1, 5, 20)); @unreachable)
62
63 # Assume that by 3 seconds, all the above probes have been hit.
64 probe timer.s(3) { print ("\n") exit () }