diff options
Diffstat (limited to 'tapset/http_request.stp')
-rw-r--r-- | tapset/http_request.stp | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/tapset/http_request.stp b/tapset/http_request.stp index 5df785c..ceac883 100644 --- a/tapset/http_request.stp +++ b/tapset/http_request.stp @@ -2,6 +2,7 @@ global cmogstored_http_req_begin; global cmogstored_http_pipelined; global cmogstored_http_addr; +global cmogstored_fd_by_tid; probe process("cmogstored").mark("http_accepted") { fd = $arg1; @@ -13,12 +14,62 @@ probe process("cmogstored").mark("http_accepted") { 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 + */ + +/* associate the fd with thread for the function return */ +probe process("cmogstored").function("mog_ioq_ready") { + cmogstored_fd_by_tid[tid()] = @cast($mfd, "struct mog_fd")->fd; +} + +/* + * if mog_ioq_ready returns false, we are blocked waiting on I/O and + * will hit ioq_reschedule + */ +probe process("cmogstored").function("mog_ioq_ready").return { + if (!$return) + printf("% 6d % 6d ioq blocked\n", + pid(), cmogstored_fd_by_tid[tid()]); +} + +/* + * 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 = @cast($mfd, "struct mog_fd")->fd; + printf("% 6d % 6d ioq reschedule_enter\n", pid(), fd); +} + +/* associate the fd with thread for the function return */ +probe process("cmogstored").function("mog_ioq_unblock") { + cmogstored_fd_by_tid[tid()] = @cast($mfd, "struct mog_fd")->fd; +} + +/* + * if mog_ioq_unblock returns true, it means the fd was previously + * in ioq_reschedule + */ +probe process("cmogstored").function("mog_ioq_unblock").return { + if ($return) + printf("% 6d % 6d ioq reschedule_done\n", + pid(), cmogstored_fd_by_tid[tid()]); +} + +/* + * HTTP client disconnected + */ probe process("cmogstored").function("http_close") { fd = @cast($mfd, "struct mog_fd")->fd; printf("% 6d % 6d closing\n", pid(), fd); delete cmogstored_http_addr[pid(),fd]; } +/* + * We start reading/buffering the HTTP request here + */ probe process("cmogstored").mark("http_req_begin") { fd = @cast($mfd, "struct mog_fd")->fd; is_pipelined = $arg1; @@ -26,6 +77,9 @@ probe process("cmogstored").mark("http_req_begin") { cmogstored_http_pipelined[pid(),fd] = is_pipelined; } +/* + * we start processing the HTTP request (opening/stat-ing files) + */ probe process("cmogstored").function("http_process_client") { fd = @cast($mfd, "struct mog_fd")->fd; starttime = cmogstored_http_req_begin[pid(),fd]; @@ -36,6 +90,9 @@ probe process("cmogstored").function("http_process_client") { pid(), fd, diff, is_pipelined ? "true" : "false"); } +/* + * We blocked on writing (HTTP headers) to the client socket + */ probe process("cmogstored").mark("write_buffered") { printf("% 6d % 6d blocked with %lu bytes to write\n", pid(), $fd, $len); |