Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

SUNRPC: Replace rpcbind dprintk call sites with tracepoints

In many cases, tracepoints already report these errors. In others,
the dprintks were mainly useful when this code was less mature.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>

authored by

Chuck Lever and committed by
Anna Schumaker
c3adcc7d 1e664987

+90 -20
+86
include/trace/events/sunrpc.h
··· 1334 1334 ) 1335 1335 ); 1336 1336 1337 + TRACE_EVENT(pmap_register, 1338 + TP_PROTO( 1339 + u32 program, 1340 + u32 version, 1341 + int protocol, 1342 + unsigned short port 1343 + ), 1344 + 1345 + TP_ARGS(program, version, protocol, port), 1346 + 1347 + TP_STRUCT__entry( 1348 + __field(unsigned int, program) 1349 + __field(unsigned int, version) 1350 + __field(int, protocol) 1351 + __field(unsigned int, port) 1352 + ), 1353 + 1354 + TP_fast_assign( 1355 + __entry->program = program; 1356 + __entry->version = version; 1357 + __entry->protocol = protocol; 1358 + __entry->port = port; 1359 + ), 1360 + 1361 + TP_printk("program=%u version=%u protocol=%d port=%u", 1362 + __entry->program, __entry->version, 1363 + __entry->protocol, __entry->port 1364 + ) 1365 + ); 1366 + 1367 + TRACE_EVENT(rpcb_register, 1368 + TP_PROTO( 1369 + u32 program, 1370 + u32 version, 1371 + const char *addr, 1372 + const char *netid 1373 + ), 1374 + 1375 + TP_ARGS(program, version, addr, netid), 1376 + 1377 + TP_STRUCT__entry( 1378 + __field(unsigned int, program) 1379 + __field(unsigned int, version) 1380 + __string(addr, addr) 1381 + __string(netid, netid) 1382 + ), 1383 + 1384 + TP_fast_assign( 1385 + __entry->program = program; 1386 + __entry->version = version; 1387 + __assign_str(addr, addr); 1388 + __assign_str(netid, netid); 1389 + ), 1390 + 1391 + TP_printk("program=%u version=%u addr=%s netid=%s", 1392 + __entry->program, __entry->version, 1393 + __get_str(addr), __get_str(netid) 1394 + ) 1395 + ); 1396 + 1397 + TRACE_EVENT(rpcb_unregister, 1398 + TP_PROTO( 1399 + u32 program, 1400 + u32 version, 1401 + const char *netid 1402 + ), 1403 + 1404 + TP_ARGS(program, version, netid), 1405 + 1406 + TP_STRUCT__entry( 1407 + __field(unsigned int, program) 1408 + __field(unsigned int, version) 1409 + __string(netid, netid) 1410 + ), 1411 + 1412 + TP_fast_assign( 1413 + __entry->program = program; 1414 + __entry->version = version; 1415 + __assign_str(netid, netid); 1416 + ), 1417 + 1418 + TP_printk("program=%u version=%u netid=%s", 1419 + __entry->program, __entry->version, __get_str(netid) 1420 + ) 1421 + ); 1422 + 1337 1423 DECLARE_EVENT_CLASS(svc_xdr_buf_class, 1338 1424 TP_PROTO( 1339 1425 const struct svc_rqst *rqst,
+4 -20
net/sunrpc/rpcb_clnt.c
··· 35 35 36 36 #include "netns.h" 37 37 38 - #if IS_ENABLED(CONFIG_SUNRPC_DEBUG) 39 - # define RPCDBG_FACILITY RPCDBG_BIND 40 - #endif 41 - 42 38 #define RPCBIND_SOCK_PATHNAME "/var/run/rpcbind.sock" 43 39 44 40 #define RPCBIND_PROGRAM (100000u) ··· 440 444 struct sunrpc_net *sn = net_generic(net, sunrpc_net_id); 441 445 bool is_set = false; 442 446 443 - dprintk("RPC: %sregistering (%u, %u, %d, %u) with local " 444 - "rpcbind\n", (port ? "" : "un"), 445 - prog, vers, prot, port); 447 + trace_pmap_register(prog, vers, prot, port); 446 448 447 449 msg.rpc_proc = &rpcb_procedures2[RPCBPROC_UNSET]; 448 450 if (port != 0) { ··· 465 471 int result; 466 472 467 473 map->r_addr = rpc_sockaddr2uaddr(sap, GFP_KERNEL); 468 - 469 - dprintk("RPC: %sregistering [%u, %u, %s, '%s'] with " 470 - "local rpcbind\n", (port ? "" : "un"), 471 - map->r_prog, map->r_vers, 472 - map->r_addr, map->r_netid); 473 474 474 475 msg->rpc_proc = &rpcb_procedures4[RPCBPROC_UNSET]; 475 476 if (port != 0) { ··· 492 503 493 504 map->r_addr = rpc_sockaddr2uaddr(sap, GFP_KERNEL); 494 505 495 - dprintk("RPC: %sregistering [%u, %u, %s, '%s'] with " 496 - "local rpcbind\n", (port ? "" : "un"), 497 - map->r_prog, map->r_vers, 498 - map->r_addr, map->r_netid); 499 - 500 506 msg->rpc_proc = &rpcb_procedures4[RPCBPROC_UNSET]; 501 507 if (port != 0) { 502 508 msg->rpc_proc = &rpcb_procedures4[RPCBPROC_SET]; ··· 508 524 { 509 525 struct rpcbind_args *map = msg->rpc_argp; 510 526 511 - dprintk("RPC: unregistering [%u, %u, '%s'] with " 512 - "local rpcbind\n", 513 - map->r_prog, map->r_vers, map->r_netid); 527 + trace_rpcb_unregister(map->r_prog, map->r_vers, map->r_netid); 514 528 515 529 map->r_addr = ""; 516 530 msg->rpc_proc = &rpcb_procedures4[RPCBPROC_UNSET]; ··· 579 597 580 598 if (address == NULL) 581 599 return rpcb_unregister_all_protofamilies(sn, &msg); 600 + 601 + trace_rpcb_register(map.r_prog, map.r_vers, map.r_addr, map.r_netid); 582 602 583 603 switch (address->sa_family) { 584 604 case AF_INET: