From f8c655bbb3b733a10c6aab9c71246e94652c6cc9 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 16 Jul 2013 10:19:29 +0000 Subject: tapset/http_request: log listen address and PID of connection It is helpful to know the address of the listener on the server which accepted the client socket. Additionally, the PID,FD combination should be be safely unique for any point in time. --- tapset/http_request.stp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tapset/http_request.stp b/tapset/http_request.stp index 2f1514a..5df785c 100644 --- a/tapset/http_request.stp +++ b/tapset/http_request.stp @@ -7,14 +7,15 @@ 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("% 8d accepted %s\n", fd, host_serv); + printf("% 6d % 6d accepted %s on %s\n", pid(), fd, host_serv, listen); cmogstored_http_addr[pid(),fd] = host_serv; } probe process("cmogstored").function("http_close") { fd = @cast($mfd, "struct mog_fd")->fd; - printf("% 8d closing\n", fd); + printf("% 6d % 6d closing\n", pid(), fd); delete cmogstored_http_addr[pid(),fd]; } @@ -31,10 +32,11 @@ probe process("cmogstored").function("http_process_client") { diff = gettimeofday_us() - starttime; is_pipelined = cmogstored_http_pipelined[pid(),fd]; - printf("% 8d http_process_client time %ldus (pipelined:%s)\n", - fd, diff, is_pipelined ? "true" : "false"); + printf("% 6d % 6d http_process_client time %ldus (pipelined:%s)\n", + pid(), fd, diff, is_pipelined ? "true" : "false"); } probe process("cmogstored").mark("write_buffered") { - printf("% 8d blocked with %lu bytes to write\n", $fd, $len); + printf("% 6d % 6d blocked with %lu bytes to write\n", + pid(), $fd, $len); } -- cgit v1.2.3-24-ge0c7