Debian Codegraph @

testsuite/systemtap.examples/apps/php-trace.stp

raw
1 #! /usr/bin/env stap
2 #
3 # Cleaned up version of example from
4 # http://php.net/manual/en/features.dtrace.systemtap.php
5
6 probe process("php").mark("compile__file__entry") {
7 printf("Probe compile__file__entry\n");
8 printf(" compile_file %s\n", user_string($arg1));
9 printf(" compile_file_translated %s\n", user_string($arg2));
10 }
11 probe process("php").mark("compile__file__return") {
12 printf("Probe compile__file__return\n");
13 printf(" compile_file %s\n", user_string($arg1));
14 printf(" compile_file_translated %s\n", user_string($arg2));
15 }
16 probe process("php").mark("error") {
17 printf("Probe error\n");
18 printf(" errormsg %s\n", user_string($arg1));
19 printf(" request_file %s\n", user_string($arg2));
20 printf(" lineno %d\n", $arg3);
21 }
22 probe process("php").mark("exception__caught") {
23 printf("Probe exception__caught\n");
24 printf(" classname %s\n", user_string($arg1));
25 }
26 probe process("php").mark("exception__thrown") {
27 printf("Probe exception__thrown\n");
28 printf(" classname %s\n", user_string($arg1));
29 }
30 probe process("php").mark("execute__entry") {
31 printf("Probe execute__entry\n");
32 printf(" request_file %s\n", user_string($arg1));
33 printf(" lineno %d\n", $arg2);
34 }
35 probe process("php").mark("execute__return") {
36 printf("Probe execute__return\n");
37 printf(" request_file %s\n", user_string($arg1));
38 printf(" lineno %d\n", $arg2);
39 }
40 probe process("php").mark("function__entry") {
41 printf("Probe function__entry\n");
42 printf(" function_name %s\n", user_string($arg1));
43 printf(" request_file %s\n", user_string($arg2));
44 printf(" lineno %d\n", $arg3);
45 printf(" classname %s\n", user_string($arg4));
46 printf(" scope %s\n", user_string($arg5));
47 }
48 probe process("php").mark("function__return") {
49 printf("Probe function__return: %s\n", user_string($arg1));
50 printf(" function_name %s\n", user_string($arg1));
51 printf(" request_file %s\n", user_string($arg2));
52 printf(" lineno %d\n", $arg3);
53 printf(" classname %s\n", user_string($arg4));
54 printf(" scope %s\n", user_string($arg5));
55 }
56 probe process("php").mark("request__shutdown") {
57 printf("Probe request__shutdown\n");
58 printf(" file %s\n", user_string($arg1));
59 printf(" request_uri %s\n", user_string($arg2));
60 printf(" request_method %s\n", user_string($arg3));
61 }
62 probe process("php").mark("request__startup") {
63 printf("Probe request__startup\n");
64 printf(" file %s\n", user_string($arg1));
65 printf(" request_uri %s\n", user_string($arg2));
66 printf(" request_method %s\n", user_string($arg3));
67 }