From 6970266baf978e6a39f8fa86d9dd597953af25c2 Mon Sep 17 00:00:00 2001 From: William Cohen Date: Mon, 2 Sep 2024 19:38:47 -0400 Subject: [PATCH] Adjust the rpc.stp tapset to work with newer kernels Changes in the tapset made to address: - $timeout is not available in a number of places (kernel commit c743b4259c3a) - svc_destroy has $servp in place of $serv - svc_process is a void function (kernel commit 55fcc7d9159de) --- tapset/linux/rpc.stp | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/tapset/linux/rpc.stp b/tapset/linux/rpc.stp index 9cc1d266c..b1678e771 100644 --- a/tapset/linux/rpc.stp +++ b/tapset/linux/rpc.stp @@ -699,17 +699,18 @@ probe sunrpc.svc.create.return = kernel.function("svc_create").return !, probe sunrpc.svc.destroy = kernel.function("svc_destroy") !, module("sunrpc").function("svc_destroy") { - sv_name = kernel_string($serv->sv_name) /* service name */ - sv_progname = kernel_string($serv->sv_program->pg_name) - sv_prog = $serv->sv_program->pg_prog - sv_nrthreads = $serv->sv_nrthreads + serv = (@defined($servp) ? $servp : $serv) + sv_name = kernel_string(serv->sv_name) /* service name */ + sv_progname = kernel_string(serv->sv_program->pg_name) + sv_prog = serv->sv_program->pg_prog + sv_nrthreads = serv->sv_nrthreads /* RPC statistics */ - netcnt = $serv->sv_stats->netcnt - netcpconn = $serv->sv_stats->nettcpconn - rpccnt = $serv->sv_stats->rpccnt - rpcbadfmt = $serv->sv_stats->rpcbadfmt - rpcbadauth = $serv->sv_stats->rpcbadauth + netcnt = serv->sv_stats->netcnt + netcpconn = serv->sv_stats->nettcpconn + rpccnt = serv->sv_stats->rpccnt + rpcbadfmt = serv->sv_stats->rpcbadfmt + rpcbadauth = serv->sv_stats->rpcbadauth name = "sunrpc.svc.destroy" argstr = sprintf("%s %d %d", sv_name, sv_prog, sv_nrthreads) @@ -764,7 +765,7 @@ probe sunrpc.svc.process.return = kernel.function("svc_process").return !, module("sunrpc").function("svc_process").return { name = "sunrpc.svc.process.return" - retstr = return_str(1, $return) + retstr = (@defined($return) ? return_str(1, $return) : "") } /* @@ -822,7 +823,7 @@ probe sunrpc.svc.recv = kernel.function("svc_recv") !, sv_prog = $serv->sv_program->pg_prog sv_nrthreads = $serv->sv_nrthreads } - timeout = $timeout + timeout = @choose_defined($timeout,0) name = "sunrpc.svc.recv" argstr = sprintf("%s %d", sv_name, timeout) @@ -832,7 +833,7 @@ probe sunrpc.svc.recv.return = kernel.function("svc_recv").return !, module("sunrpc").function("svc_recv").return { name = "sunrpc.svc.recv.return" - retstr = return_str(1, $return) + retstr = (@defined($return) ? return_str(1, $return) : "") } /** @@ -866,7 +867,7 @@ probe sunrpc.svc.send.return = kernel.function("svc_send").return !, module("sunrpc").function("svc_send").return { name = "sunrpc.svc.send.return" - retstr = return_str(1, $return) + retstr = (@defined($return) ? return_str(1, $return) : "") } /** -- 2.43.5