1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
| | /*
* This is an extremely detailed tapset for capturing all supported probe
* points in the current version of cmogstored. It likely contains too much
* information to be useful, extracting relevant probes is recommended.
*/
/* keyed by: [pid(),fd] */
global cmogstored_http_req_begin;
global cmogstored_http_pipelined;
global cmogstored_http_addr;
probe process("cmogstored").mark("http_accepted") {
fd = $arg1;
host = user_string($arg2);
serv = user_string($arg3);
listen = user_string($arg4);
host_serv = sprintf("%s%s", host, serv);
printf("% 6d % 6d accepted %s on %s\n", pid(), fd, host_serv, listen);
cmogstored_http_addr[pid(),fd] = host_serv;
}
/*
* mog_ioq_ready..ioq_reschedule = time waiting for others to finish IO
* ioq_reschedule..mog_ioq_unblock = time inside epoll ready list
*/
probe process("cmogstored").mark("ioq_blocked") {
fd = $arg1;
printf("% 6d % 6d ioq blocked\n", pid(), fd);
}
probe process("cmogstored").mark("http_req_start") {
fd = $arg1;
method = user_string($arg2);
path = user_string($arg3);
printf("% 6d % 6d %s %s HTTP/1.1\n", pid(), fd, method, path);
}
probe process("cmogstored").mark("http_res_start") {
fd = $arg1;
code = user_string_n($arg2, 3);
printf("% 6d % 6d HTTP res=%s\n", pid(), fd, code);
}
/*
* we hit ioq_reschedule when we are ready to enter the epoll ready-list
* we will hit mog_ioq_unblock eventually
*/
probe process("cmogstored").mark("ioq_reschedule") {
fd = $arg1;
printf("% 6d % 6d ioq reschedule_enter\n", pid(), fd);
}
/*
* if ioq_unblock returns true, it means the fd was previously
* in ioq_reschedule
*/
probe process("cmogstored").mark("ioq_unblocked") {
fd = $arg1;
printf("% 6d % 6d ioq reschedule_done\n", pid(), fd);
}
/*
* HTTP client disconnected
*/
probe process("cmogstored").mark("http_client_close") {
fd = $arg1;
printf("% 6d % 6d closing\n", pid(), fd);
}
/*
* We start reading/buffering the HTTP request here
*/
probe process("cmogstored").mark("http_req_begin") {
fd = $arg1;
is_pipelined = $arg2;
cmogstored_http_req_begin[pid(),fd] = gettimeofday_us();
cmogstored_http_pipelined[pid(),fd] = is_pipelined;
}
/*
* We blocked on writing (HTTP headers) to the client socket
*/
probe process("cmogstored").mark("write_buffered") {
fd = $arg1;
len = $arg2;
printf("% 6d % 6d blocked with %lu bytes to write\n", pid(), fd, len);
}
/* signals a client is making us reallocate on large requests */
probe process("cmogstored").mark("http_rbuf_grow") {
fd = $arg1;
buf_len = $arg2;
printf("% 6d % 6d http_rbuf_grow %lu\n", pid(), fd, buf_len);
}
/* signals a client is making us reallocate on large requests */
probe process("cmogstored").mark("mgmt_rbuf_grow") {
fd = $arg1;
buf_len = $arg2;
printf("% 6d % 6d mgmt_rbuf_grow %lu\n", pid(), fd, buf_len);
}
/* this signals a client is trickling requests to us */
probe process("cmogstored").mark("http_parse_continue") {
fd = $arg1;
buf_len = $arg2;
printf("% 6d % 6d http_parse_continue %lu\n", pid(), fd, buf_len);
}
/* this signals a client is trickling requests to us */
probe process("cmogstored").mark("mgmt_parse_continue") {
fd = $arg1;
buf_len = $arg2;
printf("% 6d % 6d mgmt_parse_continue %lu\n", pid(), fd, buf_len);
}
|