sunrpc.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636
  1. #undef TRACE_SYSTEM
  2. #define TRACE_SYSTEM sunrpc
  3. #if !defined(_TRACE_SUNRPC_H) || defined(TRACE_HEADER_MULTI_READ)
  4. #define _TRACE_SUNRPC_H
  5. #include <linux/sunrpc/sched.h>
  6. #include <linux/sunrpc/clnt.h>
  7. #include <linux/sunrpc/svc.h>
  8. #include <linux/sunrpc/xprtsock.h>
  9. #include <linux/sunrpc/svc_xprt.h>
  10. #include <net/tcp_states.h>
  11. #include <linux/net.h>
  12. #include <linux/tracepoint.h>
  13. DECLARE_EVENT_CLASS(rpc_task_status,
  14. TP_PROTO(struct rpc_task *task),
  15. TP_ARGS(task),
  16. TP_STRUCT__entry(
  17. __field(unsigned int, task_id)
  18. __field(unsigned int, client_id)
  19. __field(int, status)
  20. ),
  21. TP_fast_assign(
  22. __entry->task_id = task->tk_pid;
  23. __entry->client_id = task->tk_client->cl_clid;
  24. __entry->status = task->tk_status;
  25. ),
  26. TP_printk("task:%u@%u, status %d",
  27. __entry->task_id, __entry->client_id,
  28. __entry->status)
  29. );
  30. DEFINE_EVENT(rpc_task_status, rpc_call_status,
  31. TP_PROTO(struct rpc_task *task),
  32. TP_ARGS(task)
  33. );
  34. DEFINE_EVENT(rpc_task_status, rpc_bind_status,
  35. TP_PROTO(struct rpc_task *task),
  36. TP_ARGS(task)
  37. );
  38. TRACE_EVENT(rpc_connect_status,
  39. TP_PROTO(struct rpc_task *task, int status),
  40. TP_ARGS(task, status),
  41. TP_STRUCT__entry(
  42. __field(unsigned int, task_id)
  43. __field(unsigned int, client_id)
  44. __field(int, status)
  45. ),
  46. TP_fast_assign(
  47. __entry->task_id = task->tk_pid;
  48. __entry->client_id = task->tk_client->cl_clid;
  49. __entry->status = status;
  50. ),
  51. TP_printk("task:%u@%u, status %d",
  52. __entry->task_id, __entry->client_id,
  53. __entry->status)
  54. );
  55. DECLARE_EVENT_CLASS(rpc_task_running,
  56. TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action),
  57. TP_ARGS(clnt, task, action),
  58. TP_STRUCT__entry(
  59. __field(unsigned int, task_id)
  60. __field(unsigned int, client_id)
  61. __field(const void *, action)
  62. __field(unsigned long, runstate)
  63. __field(int, status)
  64. __field(unsigned short, flags)
  65. ),
  66. TP_fast_assign(
  67. __entry->client_id = clnt ? clnt->cl_clid : -1;
  68. __entry->task_id = task->tk_pid;
  69. __entry->action = action;
  70. __entry->runstate = task->tk_runstate;
  71. __entry->status = task->tk_status;
  72. __entry->flags = task->tk_flags;
  73. ),
  74. TP_printk("task:%u@%d flags=%4.4x state=%4.4lx status=%d action=%pf",
  75. __entry->task_id, __entry->client_id,
  76. __entry->flags,
  77. __entry->runstate,
  78. __entry->status,
  79. __entry->action
  80. )
  81. );
  82. DEFINE_EVENT(rpc_task_running, rpc_task_begin,
  83. TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action),
  84. TP_ARGS(clnt, task, action)
  85. );
  86. DEFINE_EVENT(rpc_task_running, rpc_task_run_action,
  87. TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action),
  88. TP_ARGS(clnt, task, action)
  89. );
  90. DEFINE_EVENT(rpc_task_running, rpc_task_complete,
  91. TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action),
  92. TP_ARGS(clnt, task, action)
  93. );
  94. DECLARE_EVENT_CLASS(rpc_task_queued,
  95. TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const struct rpc_wait_queue *q),
  96. TP_ARGS(clnt, task, q),
  97. TP_STRUCT__entry(
  98. __field(unsigned int, task_id)
  99. __field(unsigned int, client_id)
  100. __field(unsigned long, timeout)
  101. __field(unsigned long, runstate)
  102. __field(int, status)
  103. __field(unsigned short, flags)
  104. __string(q_name, rpc_qname(q))
  105. ),
  106. TP_fast_assign(
  107. __entry->client_id = clnt->cl_clid;
  108. __entry->task_id = task->tk_pid;
  109. __entry->timeout = task->tk_timeout;
  110. __entry->runstate = task->tk_runstate;
  111. __entry->status = task->tk_status;
  112. __entry->flags = task->tk_flags;
  113. __assign_str(q_name, rpc_qname(q));
  114. ),
  115. TP_printk("task:%u@%u flags=%4.4x state=%4.4lx status=%d timeout=%lu queue=%s",
  116. __entry->task_id, __entry->client_id,
  117. __entry->flags,
  118. __entry->runstate,
  119. __entry->status,
  120. __entry->timeout,
  121. __get_str(q_name)
  122. )
  123. );
  124. DEFINE_EVENT(rpc_task_queued, rpc_task_sleep,
  125. TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const struct rpc_wait_queue *q),
  126. TP_ARGS(clnt, task, q)
  127. );
  128. DEFINE_EVENT(rpc_task_queued, rpc_task_wakeup,
  129. TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const struct rpc_wait_queue *q),
  130. TP_ARGS(clnt, task, q)
  131. );
  132. /*
  133. * First define the enums in the below macros to be exported to userspace
  134. * via TRACE_DEFINE_ENUM().
  135. */
  136. #undef EM
  137. #undef EMe
  138. #define EM(a, b) TRACE_DEFINE_ENUM(a);
  139. #define EMe(a, b) TRACE_DEFINE_ENUM(a);
  140. #define RPC_SHOW_SOCKET \
  141. EM( SS_FREE, "FREE" ) \
  142. EM( SS_UNCONNECTED, "UNCONNECTED" ) \
  143. EM( SS_CONNECTING, "CONNECTING," ) \
  144. EM( SS_CONNECTED, "CONNECTED," ) \
  145. EMe(SS_DISCONNECTING, "DISCONNECTING" )
  146. #define rpc_show_socket_state(state) \
  147. __print_symbolic(state, RPC_SHOW_SOCKET)
  148. RPC_SHOW_SOCKET
  149. #define RPC_SHOW_SOCK \
  150. EM( TCP_ESTABLISHED, "ESTABLISHED" ) \
  151. EM( TCP_SYN_SENT, "SYN_SENT" ) \
  152. EM( TCP_SYN_RECV, "SYN_RECV" ) \
  153. EM( TCP_FIN_WAIT1, "FIN_WAIT1" ) \
  154. EM( TCP_FIN_WAIT2, "FIN_WAIT2" ) \
  155. EM( TCP_TIME_WAIT, "TIME_WAIT" ) \
  156. EM( TCP_CLOSE, "CLOSE" ) \
  157. EM( TCP_CLOSE_WAIT, "CLOSE_WAIT" ) \
  158. EM( TCP_LAST_ACK, "LAST_ACK" ) \
  159. EM( TCP_LISTEN, "LISTEN" ) \
  160. EMe( TCP_CLOSING, "CLOSING" )
  161. #define rpc_show_sock_state(state) \
  162. __print_symbolic(state, RPC_SHOW_SOCK)
  163. RPC_SHOW_SOCK
  164. /*
  165. * Now redefine the EM() and EMe() macros to map the enums to the strings
  166. * that will be printed in the output.
  167. */
  168. #undef EM
  169. #undef EMe
  170. #define EM(a, b) {a, b},
  171. #define EMe(a, b) {a, b}
  172. DECLARE_EVENT_CLASS(xs_socket_event,
  173. TP_PROTO(
  174. struct rpc_xprt *xprt,
  175. struct socket *socket
  176. ),
  177. TP_ARGS(xprt, socket),
  178. TP_STRUCT__entry(
  179. __field(unsigned int, socket_state)
  180. __field(unsigned int, sock_state)
  181. __field(unsigned long long, ino)
  182. __string(dstaddr,
  183. xprt->address_strings[RPC_DISPLAY_ADDR])
  184. __string(dstport,
  185. xprt->address_strings[RPC_DISPLAY_PORT])
  186. ),
  187. TP_fast_assign(
  188. struct inode *inode = SOCK_INODE(socket);
  189. __entry->socket_state = socket->state;
  190. __entry->sock_state = socket->sk->sk_state;
  191. __entry->ino = (unsigned long long)inode->i_ino;
  192. __assign_str(dstaddr,
  193. xprt->address_strings[RPC_DISPLAY_ADDR]);
  194. __assign_str(dstport,
  195. xprt->address_strings[RPC_DISPLAY_PORT]);
  196. ),
  197. TP_printk(
  198. "socket:[%llu] dstaddr=%s/%s "
  199. "state=%u (%s) sk_state=%u (%s)",
  200. __entry->ino, __get_str(dstaddr), __get_str(dstport),
  201. __entry->socket_state,
  202. rpc_show_socket_state(__entry->socket_state),
  203. __entry->sock_state,
  204. rpc_show_sock_state(__entry->sock_state)
  205. )
  206. );
  207. #define DEFINE_RPC_SOCKET_EVENT(name) \
  208. DEFINE_EVENT(xs_socket_event, name, \
  209. TP_PROTO( \
  210. struct rpc_xprt *xprt, \
  211. struct socket *socket \
  212. ), \
  213. TP_ARGS(xprt, socket))
  214. DECLARE_EVENT_CLASS(xs_socket_event_done,
  215. TP_PROTO(
  216. struct rpc_xprt *xprt,
  217. struct socket *socket,
  218. int error
  219. ),
  220. TP_ARGS(xprt, socket, error),
  221. TP_STRUCT__entry(
  222. __field(int, error)
  223. __field(unsigned int, socket_state)
  224. __field(unsigned int, sock_state)
  225. __field(unsigned long long, ino)
  226. __string(dstaddr,
  227. xprt->address_strings[RPC_DISPLAY_ADDR])
  228. __string(dstport,
  229. xprt->address_strings[RPC_DISPLAY_PORT])
  230. ),
  231. TP_fast_assign(
  232. struct inode *inode = SOCK_INODE(socket);
  233. __entry->socket_state = socket->state;
  234. __entry->sock_state = socket->sk->sk_state;
  235. __entry->ino = (unsigned long long)inode->i_ino;
  236. __entry->error = error;
  237. __assign_str(dstaddr,
  238. xprt->address_strings[RPC_DISPLAY_ADDR]);
  239. __assign_str(dstport,
  240. xprt->address_strings[RPC_DISPLAY_PORT]);
  241. ),
  242. TP_printk(
  243. "error=%d socket:[%llu] dstaddr=%s/%s "
  244. "state=%u (%s) sk_state=%u (%s)",
  245. __entry->error,
  246. __entry->ino, __get_str(dstaddr), __get_str(dstport),
  247. __entry->socket_state,
  248. rpc_show_socket_state(__entry->socket_state),
  249. __entry->sock_state,
  250. rpc_show_sock_state(__entry->sock_state)
  251. )
  252. );
  253. #define DEFINE_RPC_SOCKET_EVENT_DONE(name) \
  254. DEFINE_EVENT(xs_socket_event_done, name, \
  255. TP_PROTO( \
  256. struct rpc_xprt *xprt, \
  257. struct socket *socket, \
  258. int error \
  259. ), \
  260. TP_ARGS(xprt, socket, error))
  261. DEFINE_RPC_SOCKET_EVENT(rpc_socket_state_change);
  262. DEFINE_RPC_SOCKET_EVENT_DONE(rpc_socket_connect);
  263. DEFINE_RPC_SOCKET_EVENT_DONE(rpc_socket_error);
  264. DEFINE_RPC_SOCKET_EVENT_DONE(rpc_socket_reset_connection);
  265. DEFINE_RPC_SOCKET_EVENT(rpc_socket_close);
  266. DEFINE_RPC_SOCKET_EVENT(rpc_socket_shutdown);
  267. DECLARE_EVENT_CLASS(rpc_xprt_event,
  268. TP_PROTO(struct rpc_xprt *xprt, __be32 xid, int status),
  269. TP_ARGS(xprt, xid, status),
  270. TP_STRUCT__entry(
  271. __field(__be32, xid)
  272. __field(int, status)
  273. __string(addr, xprt->address_strings[RPC_DISPLAY_ADDR])
  274. __string(port, xprt->address_strings[RPC_DISPLAY_PORT])
  275. ),
  276. TP_fast_assign(
  277. __entry->xid = xid;
  278. __entry->status = status;
  279. __assign_str(addr, xprt->address_strings[RPC_DISPLAY_ADDR]);
  280. __assign_str(port, xprt->address_strings[RPC_DISPLAY_PORT]);
  281. ),
  282. TP_printk("peer=[%s]:%s xid=0x%x status=%d", __get_str(addr),
  283. __get_str(port), be32_to_cpu(__entry->xid),
  284. __entry->status)
  285. );
  286. DEFINE_EVENT(rpc_xprt_event, xprt_lookup_rqst,
  287. TP_PROTO(struct rpc_xprt *xprt, __be32 xid, int status),
  288. TP_ARGS(xprt, xid, status));
  289. DEFINE_EVENT(rpc_xprt_event, xprt_transmit,
  290. TP_PROTO(struct rpc_xprt *xprt, __be32 xid, int status),
  291. TP_ARGS(xprt, xid, status));
  292. DEFINE_EVENT(rpc_xprt_event, xprt_complete_rqst,
  293. TP_PROTO(struct rpc_xprt *xprt, __be32 xid, int status),
  294. TP_ARGS(xprt, xid, status));
  295. TRACE_EVENT(xs_tcp_data_ready,
  296. TP_PROTO(struct rpc_xprt *xprt, int err, unsigned int total),
  297. TP_ARGS(xprt, err, total),
  298. TP_STRUCT__entry(
  299. __field(int, err)
  300. __field(unsigned int, total)
  301. __string(addr, xprt ? xprt->address_strings[RPC_DISPLAY_ADDR] :
  302. "(null)")
  303. __string(port, xprt ? xprt->address_strings[RPC_DISPLAY_PORT] :
  304. "(null)")
  305. ),
  306. TP_fast_assign(
  307. __entry->err = err;
  308. __entry->total = total;
  309. __assign_str(addr, xprt ?
  310. xprt->address_strings[RPC_DISPLAY_ADDR] : "(null)");
  311. __assign_str(port, xprt ?
  312. xprt->address_strings[RPC_DISPLAY_PORT] : "(null)");
  313. ),
  314. TP_printk("peer=[%s]:%s err=%d total=%u", __get_str(addr),
  315. __get_str(port), __entry->err, __entry->total)
  316. );
  317. #define rpc_show_sock_xprt_flags(flags) \
  318. __print_flags(flags, "|", \
  319. { TCP_RCV_LAST_FRAG, "TCP_RCV_LAST_FRAG" }, \
  320. { TCP_RCV_COPY_FRAGHDR, "TCP_RCV_COPY_FRAGHDR" }, \
  321. { TCP_RCV_COPY_XID, "TCP_RCV_COPY_XID" }, \
  322. { TCP_RCV_COPY_DATA, "TCP_RCV_COPY_DATA" }, \
  323. { TCP_RCV_READ_CALLDIR, "TCP_RCV_READ_CALLDIR" }, \
  324. { TCP_RCV_COPY_CALLDIR, "TCP_RCV_COPY_CALLDIR" }, \
  325. { TCP_RPC_REPLY, "TCP_RPC_REPLY" })
  326. TRACE_EVENT(xs_tcp_data_recv,
  327. TP_PROTO(struct sock_xprt *xs),
  328. TP_ARGS(xs),
  329. TP_STRUCT__entry(
  330. __string(addr, xs->xprt.address_strings[RPC_DISPLAY_ADDR])
  331. __string(port, xs->xprt.address_strings[RPC_DISPLAY_PORT])
  332. __field(__be32, xid)
  333. __field(unsigned long, flags)
  334. __field(unsigned long, copied)
  335. __field(unsigned int, reclen)
  336. __field(unsigned long, offset)
  337. ),
  338. TP_fast_assign(
  339. __assign_str(addr, xs->xprt.address_strings[RPC_DISPLAY_ADDR]);
  340. __assign_str(port, xs->xprt.address_strings[RPC_DISPLAY_PORT]);
  341. __entry->xid = xs->tcp_xid;
  342. __entry->flags = xs->tcp_flags;
  343. __entry->copied = xs->tcp_copied;
  344. __entry->reclen = xs->tcp_reclen;
  345. __entry->offset = xs->tcp_offset;
  346. ),
  347. TP_printk("peer=[%s]:%s xid=0x%x flags=%s copied=%lu reclen=%u offset=%lu",
  348. __get_str(addr), __get_str(port), be32_to_cpu(__entry->xid),
  349. rpc_show_sock_xprt_flags(__entry->flags),
  350. __entry->copied, __entry->reclen, __entry->offset)
  351. );
  352. #define show_rqstp_flags(flags) \
  353. __print_flags(flags, "|", \
  354. { (1UL << RQ_SECURE), "RQ_SECURE"}, \
  355. { (1UL << RQ_LOCAL), "RQ_LOCAL"}, \
  356. { (1UL << RQ_USEDEFERRAL), "RQ_USEDEFERRAL"}, \
  357. { (1UL << RQ_DROPME), "RQ_DROPME"}, \
  358. { (1UL << RQ_SPLICE_OK), "RQ_SPLICE_OK"}, \
  359. { (1UL << RQ_VICTIM), "RQ_VICTIM"}, \
  360. { (1UL << RQ_BUSY), "RQ_BUSY"})
  361. TRACE_EVENT(svc_recv,
  362. TP_PROTO(struct svc_rqst *rqst, int status),
  363. TP_ARGS(rqst, status),
  364. TP_STRUCT__entry(
  365. __field(__be32, xid)
  366. __field(int, status)
  367. __field(unsigned long, flags)
  368. __dynamic_array(unsigned char, addr, rqst->rq_addrlen)
  369. ),
  370. TP_fast_assign(
  371. __entry->xid = status > 0 ? rqst->rq_xid : 0;
  372. __entry->status = status;
  373. __entry->flags = rqst->rq_flags;
  374. memcpy(__get_dynamic_array(addr),
  375. &rqst->rq_addr, rqst->rq_addrlen);
  376. ),
  377. TP_printk("addr=%pIScp xid=0x%x status=%d flags=%s",
  378. (struct sockaddr *)__get_dynamic_array(addr),
  379. be32_to_cpu(__entry->xid), __entry->status,
  380. show_rqstp_flags(__entry->flags))
  381. );
  382. DECLARE_EVENT_CLASS(svc_rqst_status,
  383. TP_PROTO(struct svc_rqst *rqst, int status),
  384. TP_ARGS(rqst, status),
  385. TP_STRUCT__entry(
  386. __field(__be32, xid)
  387. __field(int, status)
  388. __field(unsigned long, flags)
  389. __dynamic_array(unsigned char, addr, rqst->rq_addrlen)
  390. ),
  391. TP_fast_assign(
  392. __entry->xid = rqst->rq_xid;
  393. __entry->status = status;
  394. __entry->flags = rqst->rq_flags;
  395. memcpy(__get_dynamic_array(addr),
  396. &rqst->rq_addr, rqst->rq_addrlen);
  397. ),
  398. TP_printk("addr=%pIScp rq_xid=0x%x status=%d flags=%s",
  399. (struct sockaddr *)__get_dynamic_array(addr),
  400. be32_to_cpu(__entry->xid),
  401. __entry->status, show_rqstp_flags(__entry->flags))
  402. );
  403. DEFINE_EVENT(svc_rqst_status, svc_process,
  404. TP_PROTO(struct svc_rqst *rqst, int status),
  405. TP_ARGS(rqst, status));
  406. DEFINE_EVENT(svc_rqst_status, svc_send,
  407. TP_PROTO(struct svc_rqst *rqst, int status),
  408. TP_ARGS(rqst, status));
  409. #define show_svc_xprt_flags(flags) \
  410. __print_flags(flags, "|", \
  411. { (1UL << XPT_BUSY), "XPT_BUSY"}, \
  412. { (1UL << XPT_CONN), "XPT_CONN"}, \
  413. { (1UL << XPT_CLOSE), "XPT_CLOSE"}, \
  414. { (1UL << XPT_DATA), "XPT_DATA"}, \
  415. { (1UL << XPT_TEMP), "XPT_TEMP"}, \
  416. { (1UL << XPT_DEAD), "XPT_DEAD"}, \
  417. { (1UL << XPT_CHNGBUF), "XPT_CHNGBUF"}, \
  418. { (1UL << XPT_DEFERRED), "XPT_DEFERRED"}, \
  419. { (1UL << XPT_OLD), "XPT_OLD"}, \
  420. { (1UL << XPT_LISTENER), "XPT_LISTENER"}, \
  421. { (1UL << XPT_CACHE_AUTH), "XPT_CACHE_AUTH"}, \
  422. { (1UL << XPT_LOCAL), "XPT_LOCAL"})
  423. TRACE_EVENT(svc_xprt_do_enqueue,
  424. TP_PROTO(struct svc_xprt *xprt, struct svc_rqst *rqst),
  425. TP_ARGS(xprt, rqst),
  426. TP_STRUCT__entry(
  427. __field(struct svc_xprt *, xprt)
  428. __field(int, pid)
  429. __field(unsigned long, flags)
  430. __dynamic_array(unsigned char, addr, xprt != NULL ?
  431. xprt->xpt_remotelen : 0)
  432. ),
  433. TP_fast_assign(
  434. __entry->xprt = xprt;
  435. __entry->pid = rqst? rqst->rq_task->pid : 0;
  436. if (xprt) {
  437. memcpy(__get_dynamic_array(addr),
  438. &xprt->xpt_remote,
  439. xprt->xpt_remotelen);
  440. __entry->flags = xprt->xpt_flags;
  441. } else
  442. __entry->flags = 0;
  443. ),
  444. TP_printk("xprt=0x%p addr=%pIScp pid=%d flags=%s", __entry->xprt,
  445. __get_dynamic_array_len(addr) != 0 ?
  446. (struct sockaddr *)__get_dynamic_array(addr) : NULL,
  447. __entry->pid, show_svc_xprt_flags(__entry->flags))
  448. );
  449. TRACE_EVENT(svc_xprt_dequeue,
  450. TP_PROTO(struct svc_xprt *xprt),
  451. TP_ARGS(xprt),
  452. TP_STRUCT__entry(
  453. __field(struct svc_xprt *, xprt)
  454. __field(unsigned long, flags)
  455. __dynamic_array(unsigned char, addr, xprt != NULL ?
  456. xprt->xpt_remotelen : 0)
  457. ),
  458. TP_fast_assign(
  459. __entry->xprt = xprt;
  460. if (xprt) {
  461. memcpy(__get_dynamic_array(addr),
  462. &xprt->xpt_remote,
  463. xprt->xpt_remotelen);
  464. __entry->flags = xprt->xpt_flags;
  465. } else
  466. __entry->flags = 0;
  467. ),
  468. TP_printk("xprt=0x%p addr=%pIScp flags=%s", __entry->xprt,
  469. __get_dynamic_array_len(addr) != 0 ?
  470. (struct sockaddr *)__get_dynamic_array(addr) : NULL,
  471. show_svc_xprt_flags(__entry->flags))
  472. );
  473. TRACE_EVENT(svc_wake_up,
  474. TP_PROTO(int pid),
  475. TP_ARGS(pid),
  476. TP_STRUCT__entry(
  477. __field(int, pid)
  478. ),
  479. TP_fast_assign(
  480. __entry->pid = pid;
  481. ),
  482. TP_printk("pid=%d", __entry->pid)
  483. );
  484. TRACE_EVENT(svc_handle_xprt,
  485. TP_PROTO(struct svc_xprt *xprt, int len),
  486. TP_ARGS(xprt, len),
  487. TP_STRUCT__entry(
  488. __field(struct svc_xprt *, xprt)
  489. __field(int, len)
  490. __field(unsigned long, flags)
  491. __dynamic_array(unsigned char, addr, xprt != NULL ?
  492. xprt->xpt_remotelen : 0)
  493. ),
  494. TP_fast_assign(
  495. __entry->xprt = xprt;
  496. __entry->len = len;
  497. if (xprt) {
  498. memcpy(__get_dynamic_array(addr),
  499. &xprt->xpt_remote,
  500. xprt->xpt_remotelen);
  501. __entry->flags = xprt->xpt_flags;
  502. } else
  503. __entry->flags = 0;
  504. ),
  505. TP_printk("xprt=0x%p addr=%pIScp len=%d flags=%s", __entry->xprt,
  506. __get_dynamic_array_len(addr) != 0 ?
  507. (struct sockaddr *)__get_dynamic_array(addr) : NULL,
  508. __entry->len, show_svc_xprt_flags(__entry->flags))
  509. );
  510. #endif /* _TRACE_SUNRPC_H */
  511. #include <trace/define_trace.h>