net: sunrpc: fix tracepoint Warning: unknown op '->'
authorPratyush Anand <panand@redhat.com>
Thu, 27 Aug 2015 04:31:33 +0000 (10:01 +0530)
committerJ. Bruce Fields <bfields@redhat.com>
Mon, 31 Aug 2015 20:32:15 +0000 (16:32 -0400)
commit051ac3848a94f21cfdec899cc9c65ce7f9f116fa
tree9987429bd04444a201604cd27457d3eb825fe9dd
parent51a545685905c934237e640083bc3aa40b36dc14
net: sunrpc: fix tracepoint Warning: unknown op '->'

`perf stat  -e sunrpc:svc_xprt_do_enqueue true` results in

Warning: unknown op '->'
Warning: [sunrpc:svc_xprt_do_enqueue] unknown op '->'

Similar warning for svc_handle_xprt as well.

Actually TP_printk() should never dereference an address saved in the ring
buffer that points somewhere in the kernel. There's no guarantee that that
object still exists (with the exception of static strings).

Therefore change all the arguments for TP_printk(), so that it references
values existing in the ring buffer only.

While doing that, also fix another possible bug when argument xprt could be
NULL and TP_fast_assign() tries to access it's elements.

Signed-off-by: Pratyush Anand <panand@redhat.com>
Reviewed-by: Jeff Layton <jeff.layton@primarydata.com>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Cc: stable@vger.kernel.org
Fixes: 83a712e0afef "sunrpc: add some tracepoints around ..."
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
include/trace/events/sunrpc.h