Skip to content

Commit 26ce14e

Browse files
committed
SUNRPC: Improve sockaddr handling in the svc_xprt_create_error trace point
Clean up: Use the new __sockaddr field to record the socket address. Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
1 parent c1a3f2c commit 26ce14e

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

include/trace/events/sunrpc.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1774,18 +1774,18 @@ TRACE_EVENT(svc_xprt_create_err,
17741774
__field(long, error)
17751775
__string(program, program)
17761776
__string(protocol, protocol)
1777-
__array(unsigned char, addr, sizeof(struct sockaddr_in6))
1777+
__sockaddr(addr, salen)
17781778
),
17791779

17801780
TP_fast_assign(
17811781
__entry->error = PTR_ERR(xprt);
17821782
__assign_str(program, program);
17831783
__assign_str(protocol, protocol);
1784-
memcpy(__entry->addr, sap, min(salen, sizeof(__entry->addr)));
1784+
__assign_sockaddr(addr, sap, salen);
17851785
),
17861786

17871787
TP_printk("addr=%pISpc program=%s protocol=%s error=%ld",
1788-
__entry->addr, __get_str(program), __get_str(protocol),
1788+
__get_sockaddr(addr), __get_str(program), __get_str(protocol),
17891789
__entry->error)
17901790
);
17911791

0 commit comments

Comments
 (0)