Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Trond Myklebust | c6d01c6 | 2013-08-09 11:51:26 -0400 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (c) 2013 Trond Myklebust <Trond.Myklebust@netapp.com> |
| 4 | */ |
| 5 | #undef TRACE_SYSTEM |
| 6 | #define TRACE_SYSTEM nfs4 |
| 7 | |
| 8 | #if !defined(_TRACE_NFS4_H) || defined(TRACE_HEADER_MULTI_READ) |
| 9 | #define _TRACE_NFS4_H |
| 10 | |
| 11 | #include <linux/tracepoint.h> |
Chuck Lever | b4776a3 | 2021-10-16 18:02:24 -0400 | [diff] [blame] | 12 | #include <trace/events/sunrpc_base.h> |
Trond Myklebust | c6d01c6 | 2013-08-09 11:51:26 -0400 | [diff] [blame] | 13 | |
Chuck Lever | 9d2d48b | 2021-10-22 16:16:56 -0400 | [diff] [blame] | 14 | #include <trace/events/fs.h> |
Chuck Lever | 8791545 | 2021-10-22 16:17:03 -0400 | [diff] [blame] | 15 | #include <trace/events/nfs.h> |
Trond Myklebust | c6d01c6 | 2013-08-09 11:51:26 -0400 | [diff] [blame] | 16 | |
Trond Myklebust | b5f875a | 2013-08-13 13:01:39 -0400 | [diff] [blame] | 17 | #define show_nfs_fattr_flags(valid) \ |
| 18 | __print_flags((unsigned long)valid, "|", \ |
| 19 | { NFS_ATTR_FATTR_TYPE, "TYPE" }, \ |
| 20 | { NFS_ATTR_FATTR_MODE, "MODE" }, \ |
| 21 | { NFS_ATTR_FATTR_NLINK, "NLINK" }, \ |
| 22 | { NFS_ATTR_FATTR_OWNER, "OWNER" }, \ |
| 23 | { NFS_ATTR_FATTR_GROUP, "GROUP" }, \ |
| 24 | { NFS_ATTR_FATTR_RDEV, "RDEV" }, \ |
| 25 | { NFS_ATTR_FATTR_SIZE, "SIZE" }, \ |
| 26 | { NFS_ATTR_FATTR_FSID, "FSID" }, \ |
| 27 | { NFS_ATTR_FATTR_FILEID, "FILEID" }, \ |
| 28 | { NFS_ATTR_FATTR_ATIME, "ATIME" }, \ |
| 29 | { NFS_ATTR_FATTR_MTIME, "MTIME" }, \ |
| 30 | { NFS_ATTR_FATTR_CTIME, "CTIME" }, \ |
| 31 | { NFS_ATTR_FATTR_CHANGE, "CHANGE" }, \ |
| 32 | { NFS_ATTR_FATTR_OWNER_NAME, "OWNER_NAME" }, \ |
| 33 | { NFS_ATTR_FATTR_GROUP_NAME, "GROUP_NAME" }) |
| 34 | |
Trond Myklebust | c6d01c6 | 2013-08-09 11:51:26 -0400 | [diff] [blame] | 35 | DECLARE_EVENT_CLASS(nfs4_clientid_event, |
| 36 | TP_PROTO( |
| 37 | const struct nfs_client *clp, |
| 38 | int error |
| 39 | ), |
| 40 | |
| 41 | TP_ARGS(clp, error), |
| 42 | |
| 43 | TP_STRUCT__entry( |
Anna Schumaker | 3944369 | 2017-11-01 15:48:43 -0400 | [diff] [blame] | 44 | __string(dstaddr, clp->cl_hostname) |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 45 | __field(unsigned long, error) |
Trond Myklebust | c6d01c6 | 2013-08-09 11:51:26 -0400 | [diff] [blame] | 46 | ), |
| 47 | |
| 48 | TP_fast_assign( |
Trond Myklebust | 118b629 | 2020-01-06 15:25:06 -0500 | [diff] [blame] | 49 | __entry->error = error < 0 ? -error : 0; |
Anna Schumaker | 3944369 | 2017-11-01 15:48:43 -0400 | [diff] [blame] | 50 | __assign_str(dstaddr, clp->cl_hostname); |
Trond Myklebust | c6d01c6 | 2013-08-09 11:51:26 -0400 | [diff] [blame] | 51 | ), |
| 52 | |
| 53 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 54 | "error=%ld (%s) dstaddr=%s", |
| 55 | -__entry->error, |
Chuck Lever | 8791545 | 2021-10-22 16:17:03 -0400 | [diff] [blame] | 56 | show_nfs4_status(__entry->error), |
Trond Myklebust | c6d01c6 | 2013-08-09 11:51:26 -0400 | [diff] [blame] | 57 | __get_str(dstaddr) |
| 58 | ) |
| 59 | ); |
| 60 | #define DEFINE_NFS4_CLIENTID_EVENT(name) \ |
| 61 | DEFINE_EVENT(nfs4_clientid_event, name, \ |
| 62 | TP_PROTO( \ |
| 63 | const struct nfs_client *clp, \ |
| 64 | int error \ |
| 65 | ), \ |
| 66 | TP_ARGS(clp, error)) |
| 67 | DEFINE_NFS4_CLIENTID_EVENT(nfs4_setclientid); |
| 68 | DEFINE_NFS4_CLIENTID_EVENT(nfs4_setclientid_confirm); |
| 69 | DEFINE_NFS4_CLIENTID_EVENT(nfs4_renew); |
| 70 | DEFINE_NFS4_CLIENTID_EVENT(nfs4_renew_async); |
| 71 | #ifdef CONFIG_NFS_V4_1 |
| 72 | DEFINE_NFS4_CLIENTID_EVENT(nfs4_exchange_id); |
| 73 | DEFINE_NFS4_CLIENTID_EVENT(nfs4_create_session); |
| 74 | DEFINE_NFS4_CLIENTID_EVENT(nfs4_destroy_session); |
| 75 | DEFINE_NFS4_CLIENTID_EVENT(nfs4_destroy_clientid); |
| 76 | DEFINE_NFS4_CLIENTID_EVENT(nfs4_bind_conn_to_session); |
| 77 | DEFINE_NFS4_CLIENTID_EVENT(nfs4_sequence); |
| 78 | DEFINE_NFS4_CLIENTID_EVENT(nfs4_reclaim_complete); |
Trond Myklebust | 2f92ae3 | 2013-08-14 17:58:28 -0400 | [diff] [blame] | 79 | |
Trond Myklebust | 2f92ae3 | 2013-08-14 17:58:28 -0400 | [diff] [blame] | 80 | TRACE_EVENT(nfs4_sequence_done, |
| 81 | TP_PROTO( |
| 82 | const struct nfs4_session *session, |
| 83 | const struct nfs4_sequence_res *res |
| 84 | ), |
| 85 | TP_ARGS(session, res), |
| 86 | |
| 87 | TP_STRUCT__entry( |
| 88 | __field(unsigned int, session) |
| 89 | __field(unsigned int, slot_nr) |
| 90 | __field(unsigned int, seq_nr) |
| 91 | __field(unsigned int, highest_slotid) |
| 92 | __field(unsigned int, target_highest_slotid) |
Chuck Lever | 8791545 | 2021-10-22 16:17:03 -0400 | [diff] [blame] | 93 | __field(unsigned long, status_flags) |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 94 | __field(unsigned long, error) |
Trond Myklebust | 2f92ae3 | 2013-08-14 17:58:28 -0400 | [diff] [blame] | 95 | ), |
| 96 | |
| 97 | TP_fast_assign( |
| 98 | const struct nfs4_slot *sr_slot = res->sr_slot; |
| 99 | __entry->session = nfs_session_id_hash(&session->sess_id); |
| 100 | __entry->slot_nr = sr_slot->slot_nr; |
| 101 | __entry->seq_nr = sr_slot->seq_nr; |
| 102 | __entry->highest_slotid = res->sr_highest_slotid; |
| 103 | __entry->target_highest_slotid = |
| 104 | res->sr_target_highest_slotid; |
Andrew Elble | 52618df | 2015-12-02 09:19:43 -0500 | [diff] [blame] | 105 | __entry->status_flags = res->sr_status_flags; |
Trond Myklebust | 118b629 | 2020-01-06 15:25:06 -0500 | [diff] [blame] | 106 | __entry->error = res->sr_status < 0 ? |
| 107 | -res->sr_status : 0; |
Trond Myklebust | 2f92ae3 | 2013-08-14 17:58:28 -0400 | [diff] [blame] | 108 | ), |
| 109 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 110 | "error=%ld (%s) session=0x%08x slot_nr=%u seq_nr=%u " |
Trond Myklebust | 2f92ae3 | 2013-08-14 17:58:28 -0400 | [diff] [blame] | 111 | "highest_slotid=%u target_highest_slotid=%u " |
Chuck Lever | 8791545 | 2021-10-22 16:17:03 -0400 | [diff] [blame] | 112 | "status_flags=0x%lx (%s)", |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 113 | -__entry->error, |
Chuck Lever | 8791545 | 2021-10-22 16:17:03 -0400 | [diff] [blame] | 114 | show_nfs4_status(__entry->error), |
Trond Myklebust | 2f92ae3 | 2013-08-14 17:58:28 -0400 | [diff] [blame] | 115 | __entry->session, |
| 116 | __entry->slot_nr, |
| 117 | __entry->seq_nr, |
| 118 | __entry->highest_slotid, |
| 119 | __entry->target_highest_slotid, |
| 120 | __entry->status_flags, |
Chuck Lever | 8791545 | 2021-10-22 16:17:03 -0400 | [diff] [blame] | 121 | show_nfs4_seq4_status(__entry->status_flags) |
Trond Myklebust | 2f92ae3 | 2013-08-14 17:58:28 -0400 | [diff] [blame] | 122 | ) |
| 123 | ); |
| 124 | |
| 125 | struct cb_sequenceargs; |
| 126 | struct cb_sequenceres; |
| 127 | |
| 128 | TRACE_EVENT(nfs4_cb_sequence, |
| 129 | TP_PROTO( |
| 130 | const struct cb_sequenceargs *args, |
| 131 | const struct cb_sequenceres *res, |
| 132 | __be32 status |
| 133 | ), |
| 134 | TP_ARGS(args, res, status), |
| 135 | |
| 136 | TP_STRUCT__entry( |
| 137 | __field(unsigned int, session) |
| 138 | __field(unsigned int, slot_nr) |
| 139 | __field(unsigned int, seq_nr) |
| 140 | __field(unsigned int, highest_slotid) |
| 141 | __field(unsigned int, cachethis) |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 142 | __field(unsigned long, error) |
Trond Myklebust | 2f92ae3 | 2013-08-14 17:58:28 -0400 | [diff] [blame] | 143 | ), |
| 144 | |
| 145 | TP_fast_assign( |
| 146 | __entry->session = nfs_session_id_hash(&args->csa_sessionid); |
| 147 | __entry->slot_nr = args->csa_slotid; |
| 148 | __entry->seq_nr = args->csa_sequenceid; |
| 149 | __entry->highest_slotid = args->csa_highestslotid; |
| 150 | __entry->cachethis = args->csa_cachethis; |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 151 | __entry->error = be32_to_cpu(status); |
Trond Myklebust | 2f92ae3 | 2013-08-14 17:58:28 -0400 | [diff] [blame] | 152 | ), |
| 153 | |
| 154 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 155 | "error=%ld (%s) session=0x%08x slot_nr=%u seq_nr=%u " |
Trond Myklebust | 2f92ae3 | 2013-08-14 17:58:28 -0400 | [diff] [blame] | 156 | "highest_slotid=%u", |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 157 | -__entry->error, |
Chuck Lever | 8791545 | 2021-10-22 16:17:03 -0400 | [diff] [blame] | 158 | show_nfs4_status(__entry->error), |
Trond Myklebust | 2f92ae3 | 2013-08-14 17:58:28 -0400 | [diff] [blame] | 159 | __entry->session, |
| 160 | __entry->slot_nr, |
| 161 | __entry->seq_nr, |
| 162 | __entry->highest_slotid |
| 163 | ) |
| 164 | ); |
Chuck Lever | c5833f0 | 2019-06-19 10:33:47 -0400 | [diff] [blame] | 165 | |
| 166 | TRACE_EVENT(nfs4_cb_seqid_err, |
| 167 | TP_PROTO( |
| 168 | const struct cb_sequenceargs *args, |
| 169 | __be32 status |
| 170 | ), |
| 171 | TP_ARGS(args, status), |
| 172 | |
| 173 | TP_STRUCT__entry( |
| 174 | __field(unsigned int, session) |
| 175 | __field(unsigned int, slot_nr) |
| 176 | __field(unsigned int, seq_nr) |
| 177 | __field(unsigned int, highest_slotid) |
| 178 | __field(unsigned int, cachethis) |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 179 | __field(unsigned long, error) |
Chuck Lever | c5833f0 | 2019-06-19 10:33:47 -0400 | [diff] [blame] | 180 | ), |
| 181 | |
| 182 | TP_fast_assign( |
| 183 | __entry->session = nfs_session_id_hash(&args->csa_sessionid); |
| 184 | __entry->slot_nr = args->csa_slotid; |
| 185 | __entry->seq_nr = args->csa_sequenceid; |
| 186 | __entry->highest_slotid = args->csa_highestslotid; |
| 187 | __entry->cachethis = args->csa_cachethis; |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 188 | __entry->error = be32_to_cpu(status); |
Chuck Lever | c5833f0 | 2019-06-19 10:33:47 -0400 | [diff] [blame] | 189 | ), |
| 190 | |
| 191 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 192 | "error=%ld (%s) session=0x%08x slot_nr=%u seq_nr=%u " |
Chuck Lever | c5833f0 | 2019-06-19 10:33:47 -0400 | [diff] [blame] | 193 | "highest_slotid=%u", |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 194 | -__entry->error, |
Chuck Lever | 8791545 | 2021-10-22 16:17:03 -0400 | [diff] [blame] | 195 | show_nfs4_status(__entry->error), |
Chuck Lever | c5833f0 | 2019-06-19 10:33:47 -0400 | [diff] [blame] | 196 | __entry->session, |
| 197 | __entry->slot_nr, |
| 198 | __entry->seq_nr, |
| 199 | __entry->highest_slotid |
| 200 | ) |
| 201 | ); |
| 202 | |
Trond Myklebust | c6d01c6 | 2013-08-09 11:51:26 -0400 | [diff] [blame] | 203 | #endif /* CONFIG_NFS_V4_1 */ |
| 204 | |
Anna Schumaker | ad05cc0 | 2017-01-11 13:37:06 -0500 | [diff] [blame] | 205 | TRACE_EVENT(nfs4_setup_sequence, |
| 206 | TP_PROTO( |
| 207 | const struct nfs4_session *session, |
| 208 | const struct nfs4_sequence_args *args |
| 209 | ), |
| 210 | TP_ARGS(session, args), |
| 211 | |
| 212 | TP_STRUCT__entry( |
| 213 | __field(unsigned int, session) |
| 214 | __field(unsigned int, slot_nr) |
| 215 | __field(unsigned int, seq_nr) |
| 216 | __field(unsigned int, highest_used_slotid) |
| 217 | ), |
| 218 | |
| 219 | TP_fast_assign( |
| 220 | const struct nfs4_slot *sa_slot = args->sa_slot; |
| 221 | __entry->session = session ? nfs_session_id_hash(&session->sess_id) : 0; |
| 222 | __entry->slot_nr = sa_slot->slot_nr; |
| 223 | __entry->seq_nr = sa_slot->seq_nr; |
| 224 | __entry->highest_used_slotid = |
| 225 | sa_slot->table->highest_used_slotid; |
| 226 | ), |
| 227 | TP_printk( |
| 228 | "session=0x%08x slot_nr=%u seq_nr=%u " |
| 229 | "highest_used_slotid=%u", |
| 230 | __entry->session, |
| 231 | __entry->slot_nr, |
| 232 | __entry->seq_nr, |
| 233 | __entry->highest_used_slotid |
| 234 | ) |
| 235 | ); |
| 236 | |
Chuck Lever | 511ba52 | 2019-11-05 11:04:07 -0500 | [diff] [blame] | 237 | TRACE_DEFINE_ENUM(NFS4CLNT_MANAGER_RUNNING); |
| 238 | TRACE_DEFINE_ENUM(NFS4CLNT_CHECK_LEASE); |
| 239 | TRACE_DEFINE_ENUM(NFS4CLNT_LEASE_EXPIRED); |
| 240 | TRACE_DEFINE_ENUM(NFS4CLNT_RECLAIM_REBOOT); |
| 241 | TRACE_DEFINE_ENUM(NFS4CLNT_RECLAIM_NOGRACE); |
| 242 | TRACE_DEFINE_ENUM(NFS4CLNT_DELEGRETURN); |
| 243 | TRACE_DEFINE_ENUM(NFS4CLNT_SESSION_RESET); |
| 244 | TRACE_DEFINE_ENUM(NFS4CLNT_LEASE_CONFIRM); |
| 245 | TRACE_DEFINE_ENUM(NFS4CLNT_SERVER_SCOPE_MISMATCH); |
| 246 | TRACE_DEFINE_ENUM(NFS4CLNT_PURGE_STATE); |
| 247 | TRACE_DEFINE_ENUM(NFS4CLNT_BIND_CONN_TO_SESSION); |
| 248 | TRACE_DEFINE_ENUM(NFS4CLNT_MOVED); |
| 249 | TRACE_DEFINE_ENUM(NFS4CLNT_LEASE_MOVED); |
| 250 | TRACE_DEFINE_ENUM(NFS4CLNT_DELEGATION_EXPIRED); |
| 251 | TRACE_DEFINE_ENUM(NFS4CLNT_RUN_MANAGER); |
Trond Myklebust | b5fdf84 | 2020-02-18 15:58:31 -0500 | [diff] [blame] | 252 | TRACE_DEFINE_ENUM(NFS4CLNT_RECALL_RUNNING); |
| 253 | TRACE_DEFINE_ENUM(NFS4CLNT_RECALL_ANY_LAYOUT_READ); |
| 254 | TRACE_DEFINE_ENUM(NFS4CLNT_RECALL_ANY_LAYOUT_RW); |
Chuck Lever | 511ba52 | 2019-11-05 11:04:07 -0500 | [diff] [blame] | 255 | |
| 256 | #define show_nfs4_clp_state(state) \ |
| 257 | __print_flags(state, "|", \ |
| 258 | { NFS4CLNT_MANAGER_RUNNING, "MANAGER_RUNNING" }, \ |
| 259 | { NFS4CLNT_CHECK_LEASE, "CHECK_LEASE" }, \ |
| 260 | { NFS4CLNT_LEASE_EXPIRED, "LEASE_EXPIRED" }, \ |
| 261 | { NFS4CLNT_RECLAIM_REBOOT, "RECLAIM_REBOOT" }, \ |
| 262 | { NFS4CLNT_RECLAIM_NOGRACE, "RECLAIM_NOGRACE" }, \ |
| 263 | { NFS4CLNT_DELEGRETURN, "DELEGRETURN" }, \ |
| 264 | { NFS4CLNT_SESSION_RESET, "SESSION_RESET" }, \ |
| 265 | { NFS4CLNT_LEASE_CONFIRM, "LEASE_CONFIRM" }, \ |
| 266 | { NFS4CLNT_SERVER_SCOPE_MISMATCH, \ |
| 267 | "SERVER_SCOPE_MISMATCH" }, \ |
| 268 | { NFS4CLNT_PURGE_STATE, "PURGE_STATE" }, \ |
| 269 | { NFS4CLNT_BIND_CONN_TO_SESSION, \ |
| 270 | "BIND_CONN_TO_SESSION" }, \ |
| 271 | { NFS4CLNT_MOVED, "MOVED" }, \ |
| 272 | { NFS4CLNT_LEASE_MOVED, "LEASE_MOVED" }, \ |
| 273 | { NFS4CLNT_DELEGATION_EXPIRED, "DELEGATION_EXPIRED" }, \ |
| 274 | { NFS4CLNT_RUN_MANAGER, "RUN_MANAGER" }, \ |
Trond Myklebust | b5fdf84 | 2020-02-18 15:58:31 -0500 | [diff] [blame] | 275 | { NFS4CLNT_RECALL_RUNNING, "RECALL_RUNNING" }, \ |
| 276 | { NFS4CLNT_RECALL_ANY_LAYOUT_READ, "RECALL_ANY_LAYOUT_READ" }, \ |
| 277 | { NFS4CLNT_RECALL_ANY_LAYOUT_RW, "RECALL_ANY_LAYOUT_RW" }) |
Chuck Lever | 511ba52 | 2019-11-05 11:04:07 -0500 | [diff] [blame] | 278 | |
| 279 | TRACE_EVENT(nfs4_state_mgr, |
| 280 | TP_PROTO( |
| 281 | const struct nfs_client *clp |
| 282 | ), |
| 283 | |
| 284 | TP_ARGS(clp), |
| 285 | |
| 286 | TP_STRUCT__entry( |
| 287 | __field(unsigned long, state) |
| 288 | __string(hostname, clp->cl_hostname) |
| 289 | ), |
| 290 | |
| 291 | TP_fast_assign( |
| 292 | __entry->state = clp->cl_state; |
Joe Perches | 78c14b3 | 2021-06-12 08:42:27 -0700 | [diff] [blame] | 293 | __assign_str(hostname, clp->cl_hostname); |
Chuck Lever | 511ba52 | 2019-11-05 11:04:07 -0500 | [diff] [blame] | 294 | ), |
| 295 | |
| 296 | TP_printk( |
| 297 | "hostname=%s clp state=%s", __get_str(hostname), |
| 298 | show_nfs4_clp_state(__entry->state) |
| 299 | ) |
| 300 | ) |
| 301 | |
| 302 | TRACE_EVENT(nfs4_state_mgr_failed, |
| 303 | TP_PROTO( |
| 304 | const struct nfs_client *clp, |
| 305 | const char *section, |
| 306 | int status |
| 307 | ), |
| 308 | |
| 309 | TP_ARGS(clp, section, status), |
| 310 | |
| 311 | TP_STRUCT__entry( |
| 312 | __field(unsigned long, error) |
| 313 | __field(unsigned long, state) |
| 314 | __string(hostname, clp->cl_hostname) |
| 315 | __string(section, section) |
| 316 | ), |
| 317 | |
| 318 | TP_fast_assign( |
Trond Myklebust | 118b629 | 2020-01-06 15:25:06 -0500 | [diff] [blame] | 319 | __entry->error = status < 0 ? -status : 0; |
Chuck Lever | 511ba52 | 2019-11-05 11:04:07 -0500 | [diff] [blame] | 320 | __entry->state = clp->cl_state; |
| 321 | __assign_str(hostname, clp->cl_hostname); |
| 322 | __assign_str(section, section); |
| 323 | ), |
| 324 | |
| 325 | TP_printk( |
| 326 | "hostname=%s clp state=%s error=%ld (%s) section=%s", |
| 327 | __get_str(hostname), |
| 328 | show_nfs4_clp_state(__entry->state), -__entry->error, |
Chuck Lever | 8791545 | 2021-10-22 16:17:03 -0400 | [diff] [blame] | 329 | show_nfs4_status(__entry->error), __get_str(section) |
Chuck Lever | 511ba52 | 2019-11-05 11:04:07 -0500 | [diff] [blame] | 330 | |
| 331 | ) |
| 332 | ) |
| 333 | |
Trond Myklebust | da934ae | 2021-04-01 14:38:13 -0400 | [diff] [blame] | 334 | TRACE_EVENT(nfs4_xdr_bad_operation, |
| 335 | TP_PROTO( |
| 336 | const struct xdr_stream *xdr, |
| 337 | u32 op, |
| 338 | u32 expected |
| 339 | ), |
| 340 | |
| 341 | TP_ARGS(xdr, op, expected), |
| 342 | |
| 343 | TP_STRUCT__entry( |
| 344 | __field(unsigned int, task_id) |
| 345 | __field(unsigned int, client_id) |
| 346 | __field(u32, xid) |
| 347 | __field(u32, op) |
| 348 | __field(u32, expected) |
| 349 | ), |
| 350 | |
| 351 | TP_fast_assign( |
| 352 | const struct rpc_rqst *rqstp = xdr->rqst; |
| 353 | const struct rpc_task *task = rqstp->rq_task; |
| 354 | |
| 355 | __entry->task_id = task->tk_pid; |
| 356 | __entry->client_id = task->tk_client->cl_clid; |
| 357 | __entry->xid = be32_to_cpu(rqstp->rq_xid); |
| 358 | __entry->op = op; |
| 359 | __entry->expected = expected; |
| 360 | ), |
| 361 | |
Chuck Lever | b4776a3 | 2021-10-16 18:02:24 -0400 | [diff] [blame] | 362 | TP_printk(SUNRPC_TRACE_TASK_SPECIFIER |
| 363 | " xid=0x%08x operation=%u, expected=%u", |
Trond Myklebust | da934ae | 2021-04-01 14:38:13 -0400 | [diff] [blame] | 364 | __entry->task_id, __entry->client_id, __entry->xid, |
| 365 | __entry->op, __entry->expected |
| 366 | ) |
| 367 | ); |
| 368 | |
Trond Myklebust | 3d66bae | 2021-04-01 13:54:19 -0400 | [diff] [blame] | 369 | DECLARE_EVENT_CLASS(nfs4_xdr_event, |
Chuck Lever | f23f658 | 2019-02-11 11:24:26 -0500 | [diff] [blame] | 370 | TP_PROTO( |
Chuck Lever | 62a92ba | 2019-06-19 10:34:09 -0400 | [diff] [blame] | 371 | const struct xdr_stream *xdr, |
Chuck Lever | f23f658 | 2019-02-11 11:24:26 -0500 | [diff] [blame] | 372 | u32 op, |
Trond Myklebust | 118b629 | 2020-01-06 15:25:06 -0500 | [diff] [blame] | 373 | u32 error |
Chuck Lever | f23f658 | 2019-02-11 11:24:26 -0500 | [diff] [blame] | 374 | ), |
| 375 | |
Chuck Lever | 62a92ba | 2019-06-19 10:34:09 -0400 | [diff] [blame] | 376 | TP_ARGS(xdr, op, error), |
Chuck Lever | f23f658 | 2019-02-11 11:24:26 -0500 | [diff] [blame] | 377 | |
| 378 | TP_STRUCT__entry( |
Chuck Lever | 62a92ba | 2019-06-19 10:34:09 -0400 | [diff] [blame] | 379 | __field(unsigned int, task_id) |
| 380 | __field(unsigned int, client_id) |
| 381 | __field(u32, xid) |
Chuck Lever | f23f658 | 2019-02-11 11:24:26 -0500 | [diff] [blame] | 382 | __field(u32, op) |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 383 | __field(unsigned long, error) |
Chuck Lever | f23f658 | 2019-02-11 11:24:26 -0500 | [diff] [blame] | 384 | ), |
| 385 | |
| 386 | TP_fast_assign( |
Chuck Lever | 62a92ba | 2019-06-19 10:34:09 -0400 | [diff] [blame] | 387 | const struct rpc_rqst *rqstp = xdr->rqst; |
| 388 | const struct rpc_task *task = rqstp->rq_task; |
| 389 | |
| 390 | __entry->task_id = task->tk_pid; |
| 391 | __entry->client_id = task->tk_client->cl_clid; |
| 392 | __entry->xid = be32_to_cpu(rqstp->rq_xid); |
Chuck Lever | f23f658 | 2019-02-11 11:24:26 -0500 | [diff] [blame] | 393 | __entry->op = op; |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 394 | __entry->error = error; |
Chuck Lever | f23f658 | 2019-02-11 11:24:26 -0500 | [diff] [blame] | 395 | ), |
| 396 | |
Chuck Lever | b4776a3 | 2021-10-16 18:02:24 -0400 | [diff] [blame] | 397 | TP_printk(SUNRPC_TRACE_TASK_SPECIFIER |
| 398 | " xid=0x%08x error=%ld (%s) operation=%u", |
Chuck Lever | 62a92ba | 2019-06-19 10:34:09 -0400 | [diff] [blame] | 399 | __entry->task_id, __entry->client_id, __entry->xid, |
Chuck Lever | 8791545 | 2021-10-22 16:17:03 -0400 | [diff] [blame] | 400 | -__entry->error, show_nfs4_status(__entry->error), |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 401 | __entry->op |
Chuck Lever | f23f658 | 2019-02-11 11:24:26 -0500 | [diff] [blame] | 402 | ) |
| 403 | ); |
Trond Myklebust | 3d66bae | 2021-04-01 13:54:19 -0400 | [diff] [blame] | 404 | #define DEFINE_NFS4_XDR_EVENT(name) \ |
| 405 | DEFINE_EVENT(nfs4_xdr_event, name, \ |
| 406 | TP_PROTO( \ |
| 407 | const struct xdr_stream *xdr, \ |
| 408 | u32 op, \ |
| 409 | u32 error \ |
| 410 | ), \ |
| 411 | TP_ARGS(xdr, op, error)) |
| 412 | DEFINE_NFS4_XDR_EVENT(nfs4_xdr_status); |
Trond Myklebust | eb3d58c | 2021-04-01 14:03:26 -0400 | [diff] [blame] | 413 | DEFINE_NFS4_XDR_EVENT(nfs4_xdr_bad_filehandle); |
Chuck Lever | f23f658 | 2019-02-11 11:24:26 -0500 | [diff] [blame] | 414 | |
Chuck Lever | 2bb50aa | 2019-12-23 10:28:38 -0500 | [diff] [blame] | 415 | DECLARE_EVENT_CLASS(nfs4_cb_error_class, |
| 416 | TP_PROTO( |
| 417 | __be32 xid, |
| 418 | u32 cb_ident |
| 419 | ), |
| 420 | |
| 421 | TP_ARGS(xid, cb_ident), |
| 422 | |
| 423 | TP_STRUCT__entry( |
| 424 | __field(u32, xid) |
| 425 | __field(u32, cbident) |
| 426 | ), |
| 427 | |
| 428 | TP_fast_assign( |
| 429 | __entry->xid = be32_to_cpu(xid); |
| 430 | __entry->cbident = cb_ident; |
| 431 | ), |
| 432 | |
| 433 | TP_printk( |
| 434 | "xid=0x%08x cb_ident=0x%08x", |
| 435 | __entry->xid, __entry->cbident |
| 436 | ) |
| 437 | ); |
| 438 | |
| 439 | #define DEFINE_CB_ERROR_EVENT(name) \ |
| 440 | DEFINE_EVENT(nfs4_cb_error_class, nfs_cb_##name, \ |
| 441 | TP_PROTO( \ |
| 442 | __be32 xid, \ |
| 443 | u32 cb_ident \ |
| 444 | ), \ |
| 445 | TP_ARGS(xid, cb_ident)) |
| 446 | |
| 447 | DEFINE_CB_ERROR_EVENT(no_clp); |
| 448 | DEFINE_CB_ERROR_EVENT(badprinc); |
| 449 | |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 450 | DECLARE_EVENT_CLASS(nfs4_open_event, |
| 451 | TP_PROTO( |
| 452 | const struct nfs_open_context *ctx, |
| 453 | int flags, |
| 454 | int error |
| 455 | ), |
| 456 | |
| 457 | TP_ARGS(ctx, flags, error), |
| 458 | |
| 459 | TP_STRUCT__entry( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 460 | __field(unsigned long, error) |
Chuck Lever | 9d2d48b | 2021-10-22 16:16:56 -0400 | [diff] [blame] | 461 | __field(unsigned long, flags) |
| 462 | __field(unsigned long, fmode) |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 463 | __field(dev_t, dev) |
| 464 | __field(u32, fhandle) |
| 465 | __field(u64, fileid) |
| 466 | __field(u64, dir) |
| 467 | __string(name, ctx->dentry->d_name.name) |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 468 | __field(int, stateid_seq) |
| 469 | __field(u32, stateid_hash) |
| 470 | __field(int, openstateid_seq) |
| 471 | __field(u32, openstateid_hash) |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 472 | ), |
| 473 | |
| 474 | TP_fast_assign( |
| 475 | const struct nfs4_state *state = ctx->state; |
| 476 | const struct inode *inode = NULL; |
| 477 | |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 478 | __entry->error = -error; |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 479 | __entry->flags = flags; |
Chuck Lever | 9d2d48b | 2021-10-22 16:16:56 -0400 | [diff] [blame] | 480 | __entry->fmode = (__force unsigned long)ctx->mode; |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 481 | __entry->dev = ctx->dentry->d_sb->s_dev; |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 482 | if (!IS_ERR_OR_NULL(state)) { |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 483 | inode = state->inode; |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 484 | __entry->stateid_seq = |
| 485 | be32_to_cpu(state->stateid.seqid); |
| 486 | __entry->stateid_hash = |
| 487 | nfs_stateid_hash(&state->stateid); |
| 488 | __entry->openstateid_seq = |
| 489 | be32_to_cpu(state->open_stateid.seqid); |
| 490 | __entry->openstateid_hash = |
| 491 | nfs_stateid_hash(&state->open_stateid); |
| 492 | } else { |
| 493 | __entry->stateid_seq = 0; |
| 494 | __entry->stateid_hash = 0; |
| 495 | __entry->openstateid_seq = 0; |
| 496 | __entry->openstateid_hash = 0; |
| 497 | } |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 498 | if (inode != NULL) { |
| 499 | __entry->fileid = NFS_FILEID(inode); |
| 500 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
| 501 | } else { |
| 502 | __entry->fileid = 0; |
| 503 | __entry->fhandle = 0; |
| 504 | } |
David Howells | 2b0143b | 2015-03-17 22:25:59 +0000 | [diff] [blame] | 505 | __entry->dir = NFS_FILEID(d_inode(ctx->dentry->d_parent)); |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 506 | __assign_str(name, ctx->dentry->d_name.name); |
| 507 | ), |
| 508 | |
| 509 | TP_printk( |
Chuck Lever | 9d2d48b | 2021-10-22 16:16:56 -0400 | [diff] [blame] | 510 | "error=%ld (%s) flags=%lu (%s) fmode=%s " |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 511 | "fileid=%02x:%02x:%llu fhandle=0x%08x " |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 512 | "name=%02x:%02x:%llu/%s stateid=%d:0x%08x " |
| 513 | "openstateid=%d:0x%08x", |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 514 | -__entry->error, |
Chuck Lever | 8791545 | 2021-10-22 16:17:03 -0400 | [diff] [blame] | 515 | show_nfs4_status(__entry->error), |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 516 | __entry->flags, |
Chuck Lever | 9d2d48b | 2021-10-22 16:16:56 -0400 | [diff] [blame] | 517 | show_fs_fcntl_open_flags(__entry->flags), |
| 518 | show_fs_fmode_flags(__entry->fmode), |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 519 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 520 | (unsigned long long)__entry->fileid, |
| 521 | __entry->fhandle, |
| 522 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 523 | (unsigned long long)__entry->dir, |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 524 | __get_str(name), |
| 525 | __entry->stateid_seq, __entry->stateid_hash, |
| 526 | __entry->openstateid_seq, __entry->openstateid_hash |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 527 | ) |
| 528 | ); |
| 529 | |
| 530 | #define DEFINE_NFS4_OPEN_EVENT(name) \ |
| 531 | DEFINE_EVENT(nfs4_open_event, name, \ |
| 532 | TP_PROTO( \ |
| 533 | const struct nfs_open_context *ctx, \ |
| 534 | int flags, \ |
| 535 | int error \ |
| 536 | ), \ |
| 537 | TP_ARGS(ctx, flags, error)) |
| 538 | DEFINE_NFS4_OPEN_EVENT(nfs4_open_reclaim); |
| 539 | DEFINE_NFS4_OPEN_EVENT(nfs4_open_expired); |
| 540 | DEFINE_NFS4_OPEN_EVENT(nfs4_open_file); |
| 541 | |
Olga Kornievskaia | 9759b0f | 2015-11-24 13:29:42 -0500 | [diff] [blame] | 542 | TRACE_EVENT(nfs4_cached_open, |
| 543 | TP_PROTO( |
| 544 | const struct nfs4_state *state |
| 545 | ), |
| 546 | TP_ARGS(state), |
| 547 | TP_STRUCT__entry( |
| 548 | __field(dev_t, dev) |
| 549 | __field(u32, fhandle) |
| 550 | __field(u64, fileid) |
| 551 | __field(unsigned int, fmode) |
| 552 | __field(int, stateid_seq) |
| 553 | __field(u32, stateid_hash) |
| 554 | ), |
| 555 | |
| 556 | TP_fast_assign( |
| 557 | const struct inode *inode = state->inode; |
| 558 | |
| 559 | __entry->dev = inode->i_sb->s_dev; |
| 560 | __entry->fileid = NFS_FILEID(inode); |
| 561 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
| 562 | __entry->fmode = (__force unsigned int)state->state; |
| 563 | __entry->stateid_seq = |
| 564 | be32_to_cpu(state->stateid.seqid); |
| 565 | __entry->stateid_hash = |
| 566 | nfs_stateid_hash(&state->stateid); |
| 567 | ), |
| 568 | |
| 569 | TP_printk( |
| 570 | "fmode=%s fileid=%02x:%02x:%llu " |
| 571 | "fhandle=0x%08x stateid=%d:0x%08x", |
Chuck Lever | 9d2d48b | 2021-10-22 16:16:56 -0400 | [diff] [blame] | 572 | __entry->fmode ? show_fs_fmode_flags(__entry->fmode) : |
Olga Kornievskaia | 9759b0f | 2015-11-24 13:29:42 -0500 | [diff] [blame] | 573 | "closed", |
| 574 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 575 | (unsigned long long)__entry->fileid, |
| 576 | __entry->fhandle, |
| 577 | __entry->stateid_seq, __entry->stateid_hash |
| 578 | ) |
| 579 | ); |
| 580 | |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 581 | TRACE_EVENT(nfs4_close, |
| 582 | TP_PROTO( |
| 583 | const struct nfs4_state *state, |
| 584 | const struct nfs_closeargs *args, |
| 585 | const struct nfs_closeres *res, |
| 586 | int error |
| 587 | ), |
| 588 | |
| 589 | TP_ARGS(state, args, res, error), |
| 590 | |
| 591 | TP_STRUCT__entry( |
| 592 | __field(dev_t, dev) |
| 593 | __field(u32, fhandle) |
| 594 | __field(u64, fileid) |
| 595 | __field(unsigned int, fmode) |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 596 | __field(unsigned long, error) |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 597 | __field(int, stateid_seq) |
| 598 | __field(u32, stateid_hash) |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 599 | ), |
| 600 | |
| 601 | TP_fast_assign( |
| 602 | const struct inode *inode = state->inode; |
| 603 | |
| 604 | __entry->dev = inode->i_sb->s_dev; |
| 605 | __entry->fileid = NFS_FILEID(inode); |
| 606 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
| 607 | __entry->fmode = (__force unsigned int)state->state; |
Trond Myklebust | 118b629 | 2020-01-06 15:25:06 -0500 | [diff] [blame] | 608 | __entry->error = error < 0 ? -error : 0; |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 609 | __entry->stateid_seq = |
| 610 | be32_to_cpu(args->stateid.seqid); |
| 611 | __entry->stateid_hash = |
| 612 | nfs_stateid_hash(&args->stateid); |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 613 | ), |
| 614 | |
| 615 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 616 | "error=%ld (%s) fmode=%s fileid=%02x:%02x:%llu " |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 617 | "fhandle=0x%08x openstateid=%d:0x%08x", |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 618 | -__entry->error, |
Chuck Lever | 8791545 | 2021-10-22 16:17:03 -0400 | [diff] [blame] | 619 | show_nfs4_status(__entry->error), |
Chuck Lever | 9d2d48b | 2021-10-22 16:16:56 -0400 | [diff] [blame] | 620 | __entry->fmode ? show_fs_fmode_flags(__entry->fmode) : |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 621 | "closed", |
| 622 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 623 | (unsigned long long)__entry->fileid, |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 624 | __entry->fhandle, |
| 625 | __entry->stateid_seq, __entry->stateid_hash |
Trond Myklebust | 42113a7 | 2013-08-12 16:19:27 -0400 | [diff] [blame] | 626 | ) |
| 627 | ); |
| 628 | |
Trond Myklebust | d1b748a | 2013-08-12 16:35:20 -0400 | [diff] [blame] | 629 | DECLARE_EVENT_CLASS(nfs4_lock_event, |
| 630 | TP_PROTO( |
| 631 | const struct file_lock *request, |
| 632 | const struct nfs4_state *state, |
| 633 | int cmd, |
| 634 | int error |
| 635 | ), |
| 636 | |
| 637 | TP_ARGS(request, state, cmd, error), |
| 638 | |
| 639 | TP_STRUCT__entry( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 640 | __field(unsigned long, error) |
Chuck Lever | 9d2d48b | 2021-10-22 16:16:56 -0400 | [diff] [blame] | 641 | __field(unsigned long, cmd) |
| 642 | __field(unsigned long, type) |
Trond Myklebust | d1b748a | 2013-08-12 16:35:20 -0400 | [diff] [blame] | 643 | __field(loff_t, start) |
| 644 | __field(loff_t, end) |
| 645 | __field(dev_t, dev) |
| 646 | __field(u32, fhandle) |
| 647 | __field(u64, fileid) |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 648 | __field(int, stateid_seq) |
| 649 | __field(u32, stateid_hash) |
Trond Myklebust | d1b748a | 2013-08-12 16:35:20 -0400 | [diff] [blame] | 650 | ), |
| 651 | |
| 652 | TP_fast_assign( |
| 653 | const struct inode *inode = state->inode; |
| 654 | |
Trond Myklebust | 118b629 | 2020-01-06 15:25:06 -0500 | [diff] [blame] | 655 | __entry->error = error < 0 ? -error : 0; |
Trond Myklebust | d1b748a | 2013-08-12 16:35:20 -0400 | [diff] [blame] | 656 | __entry->cmd = cmd; |
| 657 | __entry->type = request->fl_type; |
| 658 | __entry->start = request->fl_start; |
| 659 | __entry->end = request->fl_end; |
| 660 | __entry->dev = inode->i_sb->s_dev; |
| 661 | __entry->fileid = NFS_FILEID(inode); |
| 662 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 663 | __entry->stateid_seq = |
| 664 | be32_to_cpu(state->stateid.seqid); |
| 665 | __entry->stateid_hash = |
| 666 | nfs_stateid_hash(&state->stateid); |
Trond Myklebust | d1b748a | 2013-08-12 16:35:20 -0400 | [diff] [blame] | 667 | ), |
| 668 | |
| 669 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 670 | "error=%ld (%s) cmd=%s:%s range=%lld:%lld " |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 671 | "fileid=%02x:%02x:%llu fhandle=0x%08x " |
| 672 | "stateid=%d:0x%08x", |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 673 | -__entry->error, |
Chuck Lever | 8791545 | 2021-10-22 16:17:03 -0400 | [diff] [blame] | 674 | show_nfs4_status(__entry->error), |
Chuck Lever | 9d2d48b | 2021-10-22 16:16:56 -0400 | [diff] [blame] | 675 | show_fs_fcntl_cmd(__entry->cmd), |
| 676 | show_fs_fcntl_lock_type(__entry->type), |
Trond Myklebust | d1b748a | 2013-08-12 16:35:20 -0400 | [diff] [blame] | 677 | (long long)__entry->start, |
| 678 | (long long)__entry->end, |
| 679 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 680 | (unsigned long long)__entry->fileid, |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 681 | __entry->fhandle, |
| 682 | __entry->stateid_seq, __entry->stateid_hash |
Trond Myklebust | d1b748a | 2013-08-12 16:35:20 -0400 | [diff] [blame] | 683 | ) |
| 684 | ); |
| 685 | |
| 686 | #define DEFINE_NFS4_LOCK_EVENT(name) \ |
| 687 | DEFINE_EVENT(nfs4_lock_event, name, \ |
| 688 | TP_PROTO( \ |
| 689 | const struct file_lock *request, \ |
| 690 | const struct nfs4_state *state, \ |
| 691 | int cmd, \ |
| 692 | int error \ |
| 693 | ), \ |
| 694 | TP_ARGS(request, state, cmd, error)) |
| 695 | DEFINE_NFS4_LOCK_EVENT(nfs4_get_lock); |
Trond Myklebust | d1b748a | 2013-08-12 16:35:20 -0400 | [diff] [blame] | 696 | DEFINE_NFS4_LOCK_EVENT(nfs4_unlock); |
| 697 | |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 698 | TRACE_EVENT(nfs4_set_lock, |
| 699 | TP_PROTO( |
| 700 | const struct file_lock *request, |
| 701 | const struct nfs4_state *state, |
| 702 | const nfs4_stateid *lockstateid, |
| 703 | int cmd, |
| 704 | int error |
| 705 | ), |
| 706 | |
| 707 | TP_ARGS(request, state, lockstateid, cmd, error), |
| 708 | |
| 709 | TP_STRUCT__entry( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 710 | __field(unsigned long, error) |
Chuck Lever | 9d2d48b | 2021-10-22 16:16:56 -0400 | [diff] [blame] | 711 | __field(unsigned long, cmd) |
| 712 | __field(unsigned long, type) |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 713 | __field(loff_t, start) |
| 714 | __field(loff_t, end) |
| 715 | __field(dev_t, dev) |
| 716 | __field(u32, fhandle) |
| 717 | __field(u64, fileid) |
| 718 | __field(int, stateid_seq) |
| 719 | __field(u32, stateid_hash) |
| 720 | __field(int, lockstateid_seq) |
| 721 | __field(u32, lockstateid_hash) |
| 722 | ), |
| 723 | |
| 724 | TP_fast_assign( |
| 725 | const struct inode *inode = state->inode; |
| 726 | |
Trond Myklebust | 118b629 | 2020-01-06 15:25:06 -0500 | [diff] [blame] | 727 | __entry->error = error < 0 ? -error : 0; |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 728 | __entry->cmd = cmd; |
| 729 | __entry->type = request->fl_type; |
| 730 | __entry->start = request->fl_start; |
| 731 | __entry->end = request->fl_end; |
| 732 | __entry->dev = inode->i_sb->s_dev; |
| 733 | __entry->fileid = NFS_FILEID(inode); |
| 734 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
| 735 | __entry->stateid_seq = |
| 736 | be32_to_cpu(state->stateid.seqid); |
| 737 | __entry->stateid_hash = |
| 738 | nfs_stateid_hash(&state->stateid); |
| 739 | __entry->lockstateid_seq = |
| 740 | be32_to_cpu(lockstateid->seqid); |
| 741 | __entry->lockstateid_hash = |
| 742 | nfs_stateid_hash(lockstateid); |
| 743 | ), |
| 744 | |
| 745 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 746 | "error=%ld (%s) cmd=%s:%s range=%lld:%lld " |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 747 | "fileid=%02x:%02x:%llu fhandle=0x%08x " |
| 748 | "stateid=%d:0x%08x lockstateid=%d:0x%08x", |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 749 | -__entry->error, |
Chuck Lever | 8791545 | 2021-10-22 16:17:03 -0400 | [diff] [blame] | 750 | show_nfs4_status(__entry->error), |
Chuck Lever | 9d2d48b | 2021-10-22 16:16:56 -0400 | [diff] [blame] | 751 | show_fs_fcntl_cmd(__entry->cmd), |
| 752 | show_fs_fcntl_lock_type(__entry->type), |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 753 | (long long)__entry->start, |
| 754 | (long long)__entry->end, |
| 755 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 756 | (unsigned long long)__entry->fileid, |
| 757 | __entry->fhandle, |
| 758 | __entry->stateid_seq, __entry->stateid_hash, |
| 759 | __entry->lockstateid_seq, __entry->lockstateid_hash |
| 760 | ) |
| 761 | ); |
| 762 | |
Chuck Lever | 21f86d2 | 2019-11-05 11:04:13 -0500 | [diff] [blame] | 763 | TRACE_DEFINE_ENUM(LK_STATE_IN_USE); |
| 764 | TRACE_DEFINE_ENUM(NFS_DELEGATED_STATE); |
| 765 | TRACE_DEFINE_ENUM(NFS_OPEN_STATE); |
| 766 | TRACE_DEFINE_ENUM(NFS_O_RDONLY_STATE); |
| 767 | TRACE_DEFINE_ENUM(NFS_O_WRONLY_STATE); |
| 768 | TRACE_DEFINE_ENUM(NFS_O_RDWR_STATE); |
| 769 | TRACE_DEFINE_ENUM(NFS_STATE_RECLAIM_REBOOT); |
| 770 | TRACE_DEFINE_ENUM(NFS_STATE_RECLAIM_NOGRACE); |
| 771 | TRACE_DEFINE_ENUM(NFS_STATE_POSIX_LOCKS); |
| 772 | TRACE_DEFINE_ENUM(NFS_STATE_RECOVERY_FAILED); |
| 773 | TRACE_DEFINE_ENUM(NFS_STATE_MAY_NOTIFY_LOCK); |
| 774 | TRACE_DEFINE_ENUM(NFS_STATE_CHANGE_WAIT); |
| 775 | TRACE_DEFINE_ENUM(NFS_CLNT_DST_SSC_COPY_STATE); |
| 776 | TRACE_DEFINE_ENUM(NFS_CLNT_SRC_SSC_COPY_STATE); |
| 777 | TRACE_DEFINE_ENUM(NFS_SRV_SSC_COPY_STATE); |
| 778 | |
| 779 | #define show_nfs4_state_flags(flags) \ |
| 780 | __print_flags(flags, "|", \ |
| 781 | { LK_STATE_IN_USE, "IN_USE" }, \ |
| 782 | { NFS_DELEGATED_STATE, "DELEGATED" }, \ |
| 783 | { NFS_OPEN_STATE, "OPEN" }, \ |
| 784 | { NFS_O_RDONLY_STATE, "O_RDONLY" }, \ |
| 785 | { NFS_O_WRONLY_STATE, "O_WRONLY" }, \ |
| 786 | { NFS_O_RDWR_STATE, "O_RDWR" }, \ |
| 787 | { NFS_STATE_RECLAIM_REBOOT, "RECLAIM_REBOOT" }, \ |
| 788 | { NFS_STATE_RECLAIM_NOGRACE, "RECLAIM_NOGRACE" }, \ |
| 789 | { NFS_STATE_POSIX_LOCKS, "POSIX_LOCKS" }, \ |
| 790 | { NFS_STATE_RECOVERY_FAILED, "RECOVERY_FAILED" }, \ |
| 791 | { NFS_STATE_MAY_NOTIFY_LOCK, "MAY_NOTIFY_LOCK" }, \ |
| 792 | { NFS_STATE_CHANGE_WAIT, "CHANGE_WAIT" }, \ |
| 793 | { NFS_CLNT_DST_SSC_COPY_STATE, "CLNT_DST_SSC_COPY" }, \ |
| 794 | { NFS_CLNT_SRC_SSC_COPY_STATE, "CLNT_SRC_SSC_COPY" }, \ |
| 795 | { NFS_SRV_SSC_COPY_STATE, "SRV_SSC_COPY" }) |
| 796 | |
| 797 | #define show_nfs4_lock_flags(flags) \ |
| 798 | __print_flags(flags, "|", \ |
| 799 | { BIT(NFS_LOCK_INITIALIZED), "INITIALIZED" }, \ |
| 800 | { BIT(NFS_LOCK_LOST), "LOST" }) |
| 801 | |
| 802 | TRACE_EVENT(nfs4_state_lock_reclaim, |
| 803 | TP_PROTO( |
| 804 | const struct nfs4_state *state, |
| 805 | const struct nfs4_lock_state *lock |
| 806 | ), |
| 807 | |
| 808 | TP_ARGS(state, lock), |
| 809 | |
| 810 | TP_STRUCT__entry( |
| 811 | __field(dev_t, dev) |
| 812 | __field(u32, fhandle) |
| 813 | __field(u64, fileid) |
| 814 | __field(unsigned long, state_flags) |
| 815 | __field(unsigned long, lock_flags) |
| 816 | __field(int, stateid_seq) |
| 817 | __field(u32, stateid_hash) |
| 818 | ), |
| 819 | |
| 820 | TP_fast_assign( |
| 821 | const struct inode *inode = state->inode; |
| 822 | |
| 823 | __entry->dev = inode->i_sb->s_dev; |
| 824 | __entry->fileid = NFS_FILEID(inode); |
| 825 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
| 826 | __entry->state_flags = state->flags; |
| 827 | __entry->lock_flags = lock->ls_flags; |
| 828 | __entry->stateid_seq = |
| 829 | be32_to_cpu(state->stateid.seqid); |
| 830 | __entry->stateid_hash = |
| 831 | nfs_stateid_hash(&state->stateid); |
| 832 | ), |
| 833 | |
| 834 | TP_printk( |
| 835 | "fileid=%02x:%02x:%llu fhandle=0x%08x " |
| 836 | "stateid=%d:0x%08x state_flags=%s lock_flags=%s", |
| 837 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 838 | (unsigned long long)__entry->fileid, __entry->fhandle, |
| 839 | __entry->stateid_seq, __entry->stateid_hash, |
| 840 | show_nfs4_state_flags(__entry->state_flags), |
| 841 | show_nfs4_lock_flags(__entry->lock_flags) |
| 842 | ) |
| 843 | ) |
| 844 | |
Trond Myklebust | ca8acf8 | 2013-08-13 10:36:56 -0400 | [diff] [blame] | 845 | DECLARE_EVENT_CLASS(nfs4_set_delegation_event, |
| 846 | TP_PROTO( |
| 847 | const struct inode *inode, |
| 848 | fmode_t fmode |
| 849 | ), |
| 850 | |
| 851 | TP_ARGS(inode, fmode), |
| 852 | |
| 853 | TP_STRUCT__entry( |
| 854 | __field(dev_t, dev) |
| 855 | __field(u32, fhandle) |
| 856 | __field(u64, fileid) |
| 857 | __field(unsigned int, fmode) |
| 858 | ), |
| 859 | |
| 860 | TP_fast_assign( |
| 861 | __entry->dev = inode->i_sb->s_dev; |
| 862 | __entry->fileid = NFS_FILEID(inode); |
| 863 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
| 864 | __entry->fmode = (__force unsigned int)fmode; |
| 865 | ), |
| 866 | |
| 867 | TP_printk( |
| 868 | "fmode=%s fileid=%02x:%02x:%llu fhandle=0x%08x", |
Chuck Lever | 9d2d48b | 2021-10-22 16:16:56 -0400 | [diff] [blame] | 869 | show_fs_fmode_flags(__entry->fmode), |
Trond Myklebust | ca8acf8 | 2013-08-13 10:36:56 -0400 | [diff] [blame] | 870 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 871 | (unsigned long long)__entry->fileid, |
| 872 | __entry->fhandle |
| 873 | ) |
| 874 | ); |
| 875 | #define DEFINE_NFS4_SET_DELEGATION_EVENT(name) \ |
| 876 | DEFINE_EVENT(nfs4_set_delegation_event, name, \ |
| 877 | TP_PROTO( \ |
| 878 | const struct inode *inode, \ |
| 879 | fmode_t fmode \ |
| 880 | ), \ |
| 881 | TP_ARGS(inode, fmode)) |
| 882 | DEFINE_NFS4_SET_DELEGATION_EVENT(nfs4_set_delegation); |
| 883 | DEFINE_NFS4_SET_DELEGATION_EVENT(nfs4_reclaim_delegation); |
| 884 | |
| 885 | TRACE_EVENT(nfs4_delegreturn_exit, |
| 886 | TP_PROTO( |
| 887 | const struct nfs4_delegreturnargs *args, |
| 888 | const struct nfs4_delegreturnres *res, |
| 889 | int error |
| 890 | ), |
| 891 | |
| 892 | TP_ARGS(args, res, error), |
| 893 | |
| 894 | TP_STRUCT__entry( |
| 895 | __field(dev_t, dev) |
| 896 | __field(u32, fhandle) |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 897 | __field(unsigned long, error) |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 898 | __field(int, stateid_seq) |
| 899 | __field(u32, stateid_hash) |
Trond Myklebust | ca8acf8 | 2013-08-13 10:36:56 -0400 | [diff] [blame] | 900 | ), |
| 901 | |
| 902 | TP_fast_assign( |
| 903 | __entry->dev = res->server->s_dev; |
| 904 | __entry->fhandle = nfs_fhandle_hash(args->fhandle); |
Trond Myklebust | 118b629 | 2020-01-06 15:25:06 -0500 | [diff] [blame] | 905 | __entry->error = error < 0 ? -error : 0; |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 906 | __entry->stateid_seq = |
| 907 | be32_to_cpu(args->stateid->seqid); |
| 908 | __entry->stateid_hash = |
| 909 | nfs_stateid_hash(args->stateid); |
Trond Myklebust | ca8acf8 | 2013-08-13 10:36:56 -0400 | [diff] [blame] | 910 | ), |
| 911 | |
| 912 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 913 | "error=%ld (%s) dev=%02x:%02x fhandle=0x%08x " |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 914 | "stateid=%d:0x%08x", |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 915 | -__entry->error, |
Chuck Lever | 8791545 | 2021-10-22 16:17:03 -0400 | [diff] [blame] | 916 | show_nfs4_status(__entry->error), |
Trond Myklebust | ca8acf8 | 2013-08-13 10:36:56 -0400 | [diff] [blame] | 917 | MAJOR(__entry->dev), MINOR(__entry->dev), |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 918 | __entry->fhandle, |
| 919 | __entry->stateid_seq, __entry->stateid_hash |
Trond Myklebust | ca8acf8 | 2013-08-13 10:36:56 -0400 | [diff] [blame] | 920 | ) |
| 921 | ); |
| 922 | |
Trond Myklebust | 08cb47f | 2013-08-20 21:59:40 -0400 | [diff] [blame] | 923 | #ifdef CONFIG_NFS_V4_1 |
| 924 | DECLARE_EVENT_CLASS(nfs4_test_stateid_event, |
| 925 | TP_PROTO( |
| 926 | const struct nfs4_state *state, |
| 927 | const struct nfs4_lock_state *lsp, |
| 928 | int error |
| 929 | ), |
| 930 | |
| 931 | TP_ARGS(state, lsp, error), |
| 932 | |
| 933 | TP_STRUCT__entry( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 934 | __field(unsigned long, error) |
Trond Myklebust | 08cb47f | 2013-08-20 21:59:40 -0400 | [diff] [blame] | 935 | __field(dev_t, dev) |
| 936 | __field(u32, fhandle) |
| 937 | __field(u64, fileid) |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 938 | __field(int, stateid_seq) |
| 939 | __field(u32, stateid_hash) |
Trond Myklebust | 08cb47f | 2013-08-20 21:59:40 -0400 | [diff] [blame] | 940 | ), |
| 941 | |
| 942 | TP_fast_assign( |
| 943 | const struct inode *inode = state->inode; |
| 944 | |
Trond Myklebust | 118b629 | 2020-01-06 15:25:06 -0500 | [diff] [blame] | 945 | __entry->error = error < 0 ? -error : 0; |
Trond Myklebust | 08cb47f | 2013-08-20 21:59:40 -0400 | [diff] [blame] | 946 | __entry->dev = inode->i_sb->s_dev; |
| 947 | __entry->fileid = NFS_FILEID(inode); |
| 948 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 949 | __entry->stateid_seq = |
| 950 | be32_to_cpu(state->stateid.seqid); |
| 951 | __entry->stateid_hash = |
| 952 | nfs_stateid_hash(&state->stateid); |
Trond Myklebust | 08cb47f | 2013-08-20 21:59:40 -0400 | [diff] [blame] | 953 | ), |
| 954 | |
| 955 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 956 | "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x " |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 957 | "stateid=%d:0x%08x", |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 958 | -__entry->error, |
Chuck Lever | 8791545 | 2021-10-22 16:17:03 -0400 | [diff] [blame] | 959 | show_nfs4_status(__entry->error), |
Trond Myklebust | 08cb47f | 2013-08-20 21:59:40 -0400 | [diff] [blame] | 960 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 961 | (unsigned long long)__entry->fileid, |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 962 | __entry->fhandle, |
| 963 | __entry->stateid_seq, __entry->stateid_hash |
Trond Myklebust | 08cb47f | 2013-08-20 21:59:40 -0400 | [diff] [blame] | 964 | ) |
| 965 | ); |
| 966 | |
| 967 | #define DEFINE_NFS4_TEST_STATEID_EVENT(name) \ |
| 968 | DEFINE_EVENT(nfs4_test_stateid_event, name, \ |
| 969 | TP_PROTO( \ |
| 970 | const struct nfs4_state *state, \ |
| 971 | const struct nfs4_lock_state *lsp, \ |
| 972 | int error \ |
| 973 | ), \ |
| 974 | TP_ARGS(state, lsp, error)) |
| 975 | DEFINE_NFS4_TEST_STATEID_EVENT(nfs4_test_delegation_stateid); |
| 976 | DEFINE_NFS4_TEST_STATEID_EVENT(nfs4_test_open_stateid); |
| 977 | DEFINE_NFS4_TEST_STATEID_EVENT(nfs4_test_lock_stateid); |
| 978 | #endif /* CONFIG_NFS_V4_1 */ |
| 979 | |
Trond Myklebust | 078ea3d | 2013-08-12 16:45:55 -0400 | [diff] [blame] | 980 | DECLARE_EVENT_CLASS(nfs4_lookup_event, |
| 981 | TP_PROTO( |
| 982 | const struct inode *dir, |
| 983 | const struct qstr *name, |
| 984 | int error |
| 985 | ), |
| 986 | |
| 987 | TP_ARGS(dir, name, error), |
| 988 | |
| 989 | TP_STRUCT__entry( |
| 990 | __field(dev_t, dev) |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 991 | __field(unsigned long, error) |
Trond Myklebust | 078ea3d | 2013-08-12 16:45:55 -0400 | [diff] [blame] | 992 | __field(u64, dir) |
| 993 | __string(name, name->name) |
| 994 | ), |
| 995 | |
| 996 | TP_fast_assign( |
| 997 | __entry->dev = dir->i_sb->s_dev; |
| 998 | __entry->dir = NFS_FILEID(dir); |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 999 | __entry->error = -error; |
Trond Myklebust | 078ea3d | 2013-08-12 16:45:55 -0400 | [diff] [blame] | 1000 | __assign_str(name, name->name); |
| 1001 | ), |
| 1002 | |
| 1003 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1004 | "error=%ld (%s) name=%02x:%02x:%llu/%s", |
| 1005 | -__entry->error, |
Chuck Lever | 8791545 | 2021-10-22 16:17:03 -0400 | [diff] [blame] | 1006 | show_nfs4_status(__entry->error), |
Trond Myklebust | 078ea3d | 2013-08-12 16:45:55 -0400 | [diff] [blame] | 1007 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1008 | (unsigned long long)__entry->dir, |
| 1009 | __get_str(name) |
| 1010 | ) |
| 1011 | ); |
| 1012 | |
| 1013 | #define DEFINE_NFS4_LOOKUP_EVENT(name) \ |
| 1014 | DEFINE_EVENT(nfs4_lookup_event, name, \ |
| 1015 | TP_PROTO( \ |
| 1016 | const struct inode *dir, \ |
| 1017 | const struct qstr *name, \ |
| 1018 | int error \ |
| 1019 | ), \ |
| 1020 | TP_ARGS(dir, name, error)) |
| 1021 | |
| 1022 | DEFINE_NFS4_LOOKUP_EVENT(nfs4_lookup); |
| 1023 | DEFINE_NFS4_LOOKUP_EVENT(nfs4_symlink); |
| 1024 | DEFINE_NFS4_LOOKUP_EVENT(nfs4_mkdir); |
| 1025 | DEFINE_NFS4_LOOKUP_EVENT(nfs4_mknod); |
| 1026 | DEFINE_NFS4_LOOKUP_EVENT(nfs4_remove); |
| 1027 | DEFINE_NFS4_LOOKUP_EVENT(nfs4_get_fs_locations); |
| 1028 | DEFINE_NFS4_LOOKUP_EVENT(nfs4_secinfo); |
| 1029 | |
Jeff Layton | 5b5faaf | 2017-06-29 06:34:52 -0700 | [diff] [blame] | 1030 | TRACE_EVENT(nfs4_lookupp, |
| 1031 | TP_PROTO( |
| 1032 | const struct inode *inode, |
| 1033 | int error |
| 1034 | ), |
| 1035 | |
| 1036 | TP_ARGS(inode, error), |
| 1037 | |
| 1038 | TP_STRUCT__entry( |
| 1039 | __field(dev_t, dev) |
| 1040 | __field(u64, ino) |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1041 | __field(unsigned long, error) |
Jeff Layton | 5b5faaf | 2017-06-29 06:34:52 -0700 | [diff] [blame] | 1042 | ), |
| 1043 | |
| 1044 | TP_fast_assign( |
| 1045 | __entry->dev = inode->i_sb->s_dev; |
| 1046 | __entry->ino = NFS_FILEID(inode); |
Trond Myklebust | 118b629 | 2020-01-06 15:25:06 -0500 | [diff] [blame] | 1047 | __entry->error = error < 0 ? -error : 0; |
Jeff Layton | 5b5faaf | 2017-06-29 06:34:52 -0700 | [diff] [blame] | 1048 | ), |
| 1049 | |
| 1050 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1051 | "error=%ld (%s) inode=%02x:%02x:%llu", |
| 1052 | -__entry->error, |
Chuck Lever | 8791545 | 2021-10-22 16:17:03 -0400 | [diff] [blame] | 1053 | show_nfs4_status(__entry->error), |
Jeff Layton | 5b5faaf | 2017-06-29 06:34:52 -0700 | [diff] [blame] | 1054 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1055 | (unsigned long long)__entry->ino |
| 1056 | ) |
| 1057 | ); |
| 1058 | |
Trond Myklebust | fbc6f7c | 2013-08-12 17:08:26 -0400 | [diff] [blame] | 1059 | TRACE_EVENT(nfs4_rename, |
| 1060 | TP_PROTO( |
| 1061 | const struct inode *olddir, |
| 1062 | const struct qstr *oldname, |
| 1063 | const struct inode *newdir, |
| 1064 | const struct qstr *newname, |
| 1065 | int error |
| 1066 | ), |
| 1067 | |
| 1068 | TP_ARGS(olddir, oldname, newdir, newname, error), |
| 1069 | |
| 1070 | TP_STRUCT__entry( |
| 1071 | __field(dev_t, dev) |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1072 | __field(unsigned long, error) |
Trond Myklebust | fbc6f7c | 2013-08-12 17:08:26 -0400 | [diff] [blame] | 1073 | __field(u64, olddir) |
| 1074 | __string(oldname, oldname->name) |
| 1075 | __field(u64, newdir) |
| 1076 | __string(newname, newname->name) |
| 1077 | ), |
| 1078 | |
| 1079 | TP_fast_assign( |
| 1080 | __entry->dev = olddir->i_sb->s_dev; |
| 1081 | __entry->olddir = NFS_FILEID(olddir); |
| 1082 | __entry->newdir = NFS_FILEID(newdir); |
Trond Myklebust | 118b629 | 2020-01-06 15:25:06 -0500 | [diff] [blame] | 1083 | __entry->error = error < 0 ? -error : 0; |
Trond Myklebust | fbc6f7c | 2013-08-12 17:08:26 -0400 | [diff] [blame] | 1084 | __assign_str(oldname, oldname->name); |
| 1085 | __assign_str(newname, newname->name); |
| 1086 | ), |
| 1087 | |
| 1088 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1089 | "error=%ld (%s) oldname=%02x:%02x:%llu/%s " |
Trond Myklebust | fbc6f7c | 2013-08-12 17:08:26 -0400 | [diff] [blame] | 1090 | "newname=%02x:%02x:%llu/%s", |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1091 | -__entry->error, |
Chuck Lever | 8791545 | 2021-10-22 16:17:03 -0400 | [diff] [blame] | 1092 | show_nfs4_status(__entry->error), |
Trond Myklebust | fbc6f7c | 2013-08-12 17:08:26 -0400 | [diff] [blame] | 1093 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1094 | (unsigned long long)__entry->olddir, |
| 1095 | __get_str(oldname), |
| 1096 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1097 | (unsigned long long)__entry->newdir, |
| 1098 | __get_str(newname) |
| 1099 | ) |
| 1100 | ); |
| 1101 | |
Trond Myklebust | c1578b7 | 2013-08-12 16:58:42 -0400 | [diff] [blame] | 1102 | DECLARE_EVENT_CLASS(nfs4_inode_event, |
| 1103 | TP_PROTO( |
| 1104 | const struct inode *inode, |
| 1105 | int error |
| 1106 | ), |
| 1107 | |
| 1108 | TP_ARGS(inode, error), |
| 1109 | |
| 1110 | TP_STRUCT__entry( |
| 1111 | __field(dev_t, dev) |
| 1112 | __field(u32, fhandle) |
| 1113 | __field(u64, fileid) |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1114 | __field(unsigned long, error) |
Trond Myklebust | c1578b7 | 2013-08-12 16:58:42 -0400 | [diff] [blame] | 1115 | ), |
| 1116 | |
| 1117 | TP_fast_assign( |
| 1118 | __entry->dev = inode->i_sb->s_dev; |
| 1119 | __entry->fileid = NFS_FILEID(inode); |
| 1120 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1121 | __entry->error = error < 0 ? -error : 0; |
Trond Myklebust | c1578b7 | 2013-08-12 16:58:42 -0400 | [diff] [blame] | 1122 | ), |
| 1123 | |
| 1124 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1125 | "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x", |
| 1126 | -__entry->error, |
Chuck Lever | 8791545 | 2021-10-22 16:17:03 -0400 | [diff] [blame] | 1127 | show_nfs4_status(__entry->error), |
Trond Myklebust | c1578b7 | 2013-08-12 16:58:42 -0400 | [diff] [blame] | 1128 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1129 | (unsigned long long)__entry->fileid, |
| 1130 | __entry->fhandle |
| 1131 | ) |
| 1132 | ); |
| 1133 | |
| 1134 | #define DEFINE_NFS4_INODE_EVENT(name) \ |
| 1135 | DEFINE_EVENT(nfs4_inode_event, name, \ |
| 1136 | TP_PROTO( \ |
| 1137 | const struct inode *inode, \ |
| 1138 | int error \ |
| 1139 | ), \ |
| 1140 | TP_ARGS(inode, error)) |
| 1141 | |
Trond Myklebust | c1578b7 | 2013-08-12 16:58:42 -0400 | [diff] [blame] | 1142 | DEFINE_NFS4_INODE_EVENT(nfs4_access); |
| 1143 | DEFINE_NFS4_INODE_EVENT(nfs4_readlink); |
| 1144 | DEFINE_NFS4_INODE_EVENT(nfs4_readdir); |
| 1145 | DEFINE_NFS4_INODE_EVENT(nfs4_get_acl); |
| 1146 | DEFINE_NFS4_INODE_EVENT(nfs4_set_acl); |
| 1147 | #ifdef CONFIG_NFS_V4_SECURITY_LABEL |
| 1148 | DEFINE_NFS4_INODE_EVENT(nfs4_get_security_label); |
| 1149 | DEFINE_NFS4_INODE_EVENT(nfs4_set_security_label); |
| 1150 | #endif /* CONFIG_NFS_V4_SECURITY_LABEL */ |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1151 | |
| 1152 | DECLARE_EVENT_CLASS(nfs4_inode_stateid_event, |
| 1153 | TP_PROTO( |
| 1154 | const struct inode *inode, |
| 1155 | const nfs4_stateid *stateid, |
| 1156 | int error |
| 1157 | ), |
| 1158 | |
| 1159 | TP_ARGS(inode, stateid, error), |
| 1160 | |
| 1161 | TP_STRUCT__entry( |
| 1162 | __field(dev_t, dev) |
| 1163 | __field(u32, fhandle) |
| 1164 | __field(u64, fileid) |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1165 | __field(unsigned long, error) |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1166 | __field(int, stateid_seq) |
| 1167 | __field(u32, stateid_hash) |
| 1168 | ), |
| 1169 | |
| 1170 | TP_fast_assign( |
| 1171 | __entry->dev = inode->i_sb->s_dev; |
| 1172 | __entry->fileid = NFS_FILEID(inode); |
| 1173 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
Trond Myklebust | 118b629 | 2020-01-06 15:25:06 -0500 | [diff] [blame] | 1174 | __entry->error = error < 0 ? -error : 0; |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1175 | __entry->stateid_seq = |
| 1176 | be32_to_cpu(stateid->seqid); |
| 1177 | __entry->stateid_hash = |
| 1178 | nfs_stateid_hash(stateid); |
| 1179 | ), |
| 1180 | |
| 1181 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1182 | "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x " |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1183 | "stateid=%d:0x%08x", |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1184 | -__entry->error, |
Chuck Lever | 8791545 | 2021-10-22 16:17:03 -0400 | [diff] [blame] | 1185 | show_nfs4_status(__entry->error), |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1186 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1187 | (unsigned long long)__entry->fileid, |
| 1188 | __entry->fhandle, |
| 1189 | __entry->stateid_seq, __entry->stateid_hash |
| 1190 | ) |
| 1191 | ); |
| 1192 | |
| 1193 | #define DEFINE_NFS4_INODE_STATEID_EVENT(name) \ |
| 1194 | DEFINE_EVENT(nfs4_inode_stateid_event, name, \ |
| 1195 | TP_PROTO( \ |
| 1196 | const struct inode *inode, \ |
| 1197 | const nfs4_stateid *stateid, \ |
| 1198 | int error \ |
| 1199 | ), \ |
| 1200 | TP_ARGS(inode, stateid, error)) |
| 1201 | |
| 1202 | DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_setattr); |
| 1203 | DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_delegreturn); |
Trond Myklebust | ad9e02d | 2017-11-06 15:28:02 -0500 | [diff] [blame] | 1204 | DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_open_stateid_update); |
| 1205 | DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_open_stateid_update_wait); |
Benjamin Coddington | b4868b4 | 2020-09-25 15:48:39 -0400 | [diff] [blame] | 1206 | DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_close_stateid_update_wait); |
Trond Myklebust | c1578b7 | 2013-08-12 16:58:42 -0400 | [diff] [blame] | 1207 | |
Trond Myklebust | b5f875a | 2013-08-13 13:01:39 -0400 | [diff] [blame] | 1208 | DECLARE_EVENT_CLASS(nfs4_getattr_event, |
| 1209 | TP_PROTO( |
| 1210 | const struct nfs_server *server, |
| 1211 | const struct nfs_fh *fhandle, |
| 1212 | const struct nfs_fattr *fattr, |
| 1213 | int error |
| 1214 | ), |
| 1215 | |
| 1216 | TP_ARGS(server, fhandle, fattr, error), |
| 1217 | |
| 1218 | TP_STRUCT__entry( |
| 1219 | __field(dev_t, dev) |
| 1220 | __field(u32, fhandle) |
| 1221 | __field(u64, fileid) |
| 1222 | __field(unsigned int, valid) |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1223 | __field(unsigned long, error) |
Trond Myklebust | b5f875a | 2013-08-13 13:01:39 -0400 | [diff] [blame] | 1224 | ), |
| 1225 | |
| 1226 | TP_fast_assign( |
| 1227 | __entry->dev = server->s_dev; |
| 1228 | __entry->valid = fattr->valid; |
| 1229 | __entry->fhandle = nfs_fhandle_hash(fhandle); |
| 1230 | __entry->fileid = (fattr->valid & NFS_ATTR_FATTR_FILEID) ? fattr->fileid : 0; |
Trond Myklebust | 118b629 | 2020-01-06 15:25:06 -0500 | [diff] [blame] | 1231 | __entry->error = error < 0 ? -error : 0; |
Trond Myklebust | b5f875a | 2013-08-13 13:01:39 -0400 | [diff] [blame] | 1232 | ), |
| 1233 | |
| 1234 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1235 | "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x " |
Trond Myklebust | b5f875a | 2013-08-13 13:01:39 -0400 | [diff] [blame] | 1236 | "valid=%s", |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1237 | -__entry->error, |
Chuck Lever | 8791545 | 2021-10-22 16:17:03 -0400 | [diff] [blame] | 1238 | show_nfs4_status(__entry->error), |
Trond Myklebust | b5f875a | 2013-08-13 13:01:39 -0400 | [diff] [blame] | 1239 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1240 | (unsigned long long)__entry->fileid, |
| 1241 | __entry->fhandle, |
| 1242 | show_nfs_fattr_flags(__entry->valid) |
| 1243 | ) |
| 1244 | ); |
| 1245 | |
| 1246 | #define DEFINE_NFS4_GETATTR_EVENT(name) \ |
| 1247 | DEFINE_EVENT(nfs4_getattr_event, name, \ |
| 1248 | TP_PROTO( \ |
| 1249 | const struct nfs_server *server, \ |
| 1250 | const struct nfs_fh *fhandle, \ |
| 1251 | const struct nfs_fattr *fattr, \ |
| 1252 | int error \ |
| 1253 | ), \ |
| 1254 | TP_ARGS(server, fhandle, fattr, error)) |
| 1255 | DEFINE_NFS4_GETATTR_EVENT(nfs4_getattr); |
| 1256 | DEFINE_NFS4_GETATTR_EVENT(nfs4_lookup_root); |
| 1257 | DEFINE_NFS4_GETATTR_EVENT(nfs4_fsinfo); |
| 1258 | |
Trond Myklebust | 7cd1486 | 2015-08-20 20:07:54 -0500 | [diff] [blame] | 1259 | DECLARE_EVENT_CLASS(nfs4_inode_callback_event, |
| 1260 | TP_PROTO( |
| 1261 | const struct nfs_client *clp, |
| 1262 | const struct nfs_fh *fhandle, |
| 1263 | const struct inode *inode, |
| 1264 | int error |
| 1265 | ), |
| 1266 | |
| 1267 | TP_ARGS(clp, fhandle, inode, error), |
| 1268 | |
| 1269 | TP_STRUCT__entry( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1270 | __field(unsigned long, error) |
Trond Myklebust | 7cd1486 | 2015-08-20 20:07:54 -0500 | [diff] [blame] | 1271 | __field(dev_t, dev) |
| 1272 | __field(u32, fhandle) |
| 1273 | __field(u64, fileid) |
Anna Schumaker | 3944369 | 2017-11-01 15:48:43 -0400 | [diff] [blame] | 1274 | __string(dstaddr, clp ? clp->cl_hostname : "unknown") |
Trond Myklebust | 7cd1486 | 2015-08-20 20:07:54 -0500 | [diff] [blame] | 1275 | ), |
| 1276 | |
| 1277 | TP_fast_assign( |
Trond Myklebust | 118b629 | 2020-01-06 15:25:06 -0500 | [diff] [blame] | 1278 | __entry->error = error < 0 ? -error : 0; |
Trond Myklebust | 7cd1486 | 2015-08-20 20:07:54 -0500 | [diff] [blame] | 1279 | __entry->fhandle = nfs_fhandle_hash(fhandle); |
Trond Myklebust | 2edaead | 2018-09-05 14:07:13 -0400 | [diff] [blame] | 1280 | if (!IS_ERR_OR_NULL(inode)) { |
Trond Myklebust | 7cd1486 | 2015-08-20 20:07:54 -0500 | [diff] [blame] | 1281 | __entry->fileid = NFS_FILEID(inode); |
| 1282 | __entry->dev = inode->i_sb->s_dev; |
| 1283 | } else { |
| 1284 | __entry->fileid = 0; |
| 1285 | __entry->dev = 0; |
| 1286 | } |
Joe Perches | 78c14b3 | 2021-06-12 08:42:27 -0700 | [diff] [blame] | 1287 | __assign_str(dstaddr, clp ? clp->cl_hostname : "unknown"); |
Trond Myklebust | 7cd1486 | 2015-08-20 20:07:54 -0500 | [diff] [blame] | 1288 | ), |
| 1289 | |
| 1290 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1291 | "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x " |
Trond Myklebust | 7cd1486 | 2015-08-20 20:07:54 -0500 | [diff] [blame] | 1292 | "dstaddr=%s", |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1293 | -__entry->error, |
Chuck Lever | 8791545 | 2021-10-22 16:17:03 -0400 | [diff] [blame] | 1294 | show_nfs4_status(__entry->error), |
Trond Myklebust | 7cd1486 | 2015-08-20 20:07:54 -0500 | [diff] [blame] | 1295 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1296 | (unsigned long long)__entry->fileid, |
| 1297 | __entry->fhandle, |
| 1298 | __get_str(dstaddr) |
| 1299 | ) |
| 1300 | ); |
| 1301 | |
| 1302 | #define DEFINE_NFS4_INODE_CALLBACK_EVENT(name) \ |
| 1303 | DEFINE_EVENT(nfs4_inode_callback_event, name, \ |
| 1304 | TP_PROTO( \ |
| 1305 | const struct nfs_client *clp, \ |
| 1306 | const struct nfs_fh *fhandle, \ |
| 1307 | const struct inode *inode, \ |
| 1308 | int error \ |
| 1309 | ), \ |
| 1310 | TP_ARGS(clp, fhandle, inode, error)) |
| 1311 | DEFINE_NFS4_INODE_CALLBACK_EVENT(nfs4_cb_getattr); |
| 1312 | |
Trond Myklebust | e07db90 | 2015-12-28 14:07:23 -0500 | [diff] [blame] | 1313 | DECLARE_EVENT_CLASS(nfs4_inode_stateid_callback_event, |
| 1314 | TP_PROTO( |
| 1315 | const struct nfs_client *clp, |
| 1316 | const struct nfs_fh *fhandle, |
| 1317 | const struct inode *inode, |
| 1318 | const nfs4_stateid *stateid, |
| 1319 | int error |
| 1320 | ), |
| 1321 | |
| 1322 | TP_ARGS(clp, fhandle, inode, stateid, error), |
| 1323 | |
| 1324 | TP_STRUCT__entry( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1325 | __field(unsigned long, error) |
Trond Myklebust | e07db90 | 2015-12-28 14:07:23 -0500 | [diff] [blame] | 1326 | __field(dev_t, dev) |
| 1327 | __field(u32, fhandle) |
| 1328 | __field(u64, fileid) |
Anna Schumaker | 3944369 | 2017-11-01 15:48:43 -0400 | [diff] [blame] | 1329 | __string(dstaddr, clp ? clp->cl_hostname : "unknown") |
Trond Myklebust | e07db90 | 2015-12-28 14:07:23 -0500 | [diff] [blame] | 1330 | __field(int, stateid_seq) |
| 1331 | __field(u32, stateid_hash) |
| 1332 | ), |
| 1333 | |
| 1334 | TP_fast_assign( |
Trond Myklebust | 118b629 | 2020-01-06 15:25:06 -0500 | [diff] [blame] | 1335 | __entry->error = error < 0 ? -error : 0; |
Trond Myklebust | e07db90 | 2015-12-28 14:07:23 -0500 | [diff] [blame] | 1336 | __entry->fhandle = nfs_fhandle_hash(fhandle); |
Trond Myklebust | 2a534a7 | 2018-08-23 11:02:49 -0400 | [diff] [blame] | 1337 | if (!IS_ERR_OR_NULL(inode)) { |
Trond Myklebust | e07db90 | 2015-12-28 14:07:23 -0500 | [diff] [blame] | 1338 | __entry->fileid = NFS_FILEID(inode); |
| 1339 | __entry->dev = inode->i_sb->s_dev; |
| 1340 | } else { |
| 1341 | __entry->fileid = 0; |
| 1342 | __entry->dev = 0; |
| 1343 | } |
Joe Perches | 78c14b3 | 2021-06-12 08:42:27 -0700 | [diff] [blame] | 1344 | __assign_str(dstaddr, clp ? clp->cl_hostname : "unknown"); |
Trond Myklebust | e07db90 | 2015-12-28 14:07:23 -0500 | [diff] [blame] | 1345 | __entry->stateid_seq = |
| 1346 | be32_to_cpu(stateid->seqid); |
| 1347 | __entry->stateid_hash = |
| 1348 | nfs_stateid_hash(stateid); |
| 1349 | ), |
| 1350 | |
| 1351 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1352 | "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x " |
Trond Myklebust | e07db90 | 2015-12-28 14:07:23 -0500 | [diff] [blame] | 1353 | "stateid=%d:0x%08x dstaddr=%s", |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1354 | -__entry->error, |
Chuck Lever | 8791545 | 2021-10-22 16:17:03 -0400 | [diff] [blame] | 1355 | show_nfs4_status(__entry->error), |
Trond Myklebust | e07db90 | 2015-12-28 14:07:23 -0500 | [diff] [blame] | 1356 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1357 | (unsigned long long)__entry->fileid, |
| 1358 | __entry->fhandle, |
| 1359 | __entry->stateid_seq, __entry->stateid_hash, |
| 1360 | __get_str(dstaddr) |
| 1361 | ) |
| 1362 | ); |
| 1363 | |
| 1364 | #define DEFINE_NFS4_INODE_STATEID_CALLBACK_EVENT(name) \ |
| 1365 | DEFINE_EVENT(nfs4_inode_stateid_callback_event, name, \ |
| 1366 | TP_PROTO( \ |
| 1367 | const struct nfs_client *clp, \ |
| 1368 | const struct nfs_fh *fhandle, \ |
| 1369 | const struct inode *inode, \ |
| 1370 | const nfs4_stateid *stateid, \ |
| 1371 | int error \ |
| 1372 | ), \ |
| 1373 | TP_ARGS(clp, fhandle, inode, stateid, error)) |
| 1374 | DEFINE_NFS4_INODE_STATEID_CALLBACK_EVENT(nfs4_cb_recall); |
| 1375 | DEFINE_NFS4_INODE_STATEID_CALLBACK_EVENT(nfs4_cb_layoutrecall_file); |
Trond Myklebust | 7cd1486 | 2015-08-20 20:07:54 -0500 | [diff] [blame] | 1376 | |
Trond Myklebust | 1f2d30b | 2013-08-13 11:34:01 -0400 | [diff] [blame] | 1377 | DECLARE_EVENT_CLASS(nfs4_idmap_event, |
| 1378 | TP_PROTO( |
| 1379 | const char *name, |
| 1380 | int len, |
| 1381 | u32 id, |
| 1382 | int error |
| 1383 | ), |
| 1384 | |
| 1385 | TP_ARGS(name, len, id, error), |
| 1386 | |
| 1387 | TP_STRUCT__entry( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1388 | __field(unsigned long, error) |
Trond Myklebust | 1f2d30b | 2013-08-13 11:34:01 -0400 | [diff] [blame] | 1389 | __field(u32, id) |
| 1390 | __dynamic_array(char, name, len > 0 ? len + 1 : 1) |
| 1391 | ), |
| 1392 | |
| 1393 | TP_fast_assign( |
| 1394 | if (len < 0) |
| 1395 | len = 0; |
| 1396 | __entry->error = error < 0 ? error : 0; |
| 1397 | __entry->id = id; |
Daniel Bristot de Oliveira | 752d596 | 2016-07-01 20:44:36 -0300 | [diff] [blame] | 1398 | memcpy(__get_str(name), name, len); |
| 1399 | __get_str(name)[len] = 0; |
Trond Myklebust | 1f2d30b | 2013-08-13 11:34:01 -0400 | [diff] [blame] | 1400 | ), |
| 1401 | |
| 1402 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1403 | "error=%ld (%s) id=%u name=%s", |
Chuck Lever | 8791545 | 2021-10-22 16:17:03 -0400 | [diff] [blame] | 1404 | -__entry->error, show_nfs4_status(__entry->error), |
Trond Myklebust | 1f2d30b | 2013-08-13 11:34:01 -0400 | [diff] [blame] | 1405 | __entry->id, |
| 1406 | __get_str(name) |
| 1407 | ) |
| 1408 | ); |
| 1409 | #define DEFINE_NFS4_IDMAP_EVENT(name) \ |
| 1410 | DEFINE_EVENT(nfs4_idmap_event, name, \ |
| 1411 | TP_PROTO( \ |
| 1412 | const char *name, \ |
| 1413 | int len, \ |
| 1414 | u32 id, \ |
| 1415 | int error \ |
| 1416 | ), \ |
| 1417 | TP_ARGS(name, len, id, error)) |
| 1418 | DEFINE_NFS4_IDMAP_EVENT(nfs4_map_name_to_uid); |
| 1419 | DEFINE_NFS4_IDMAP_EVENT(nfs4_map_group_to_gid); |
| 1420 | DEFINE_NFS4_IDMAP_EVENT(nfs4_map_uid_to_name); |
| 1421 | DEFINE_NFS4_IDMAP_EVENT(nfs4_map_gid_to_group); |
| 1422 | |
Trond Myklebust | 54898f7 | 2020-08-04 22:16:06 -0400 | [diff] [blame] | 1423 | #ifdef CONFIG_NFS_V4_1 |
| 1424 | #define NFS4_LSEG_LAYOUT_STATEID_HASH(lseg) \ |
| 1425 | (lseg ? nfs_stateid_hash(&lseg->pls_layout->plh_stateid) : 0) |
| 1426 | #else |
| 1427 | #define NFS4_LSEG_LAYOUT_STATEID_HASH(lseg) (0) |
| 1428 | #endif |
| 1429 | |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1430 | DECLARE_EVENT_CLASS(nfs4_read_event, |
| 1431 | TP_PROTO( |
Weston Andros Adamson | d45f60c | 2014-06-09 11:48:35 -0400 | [diff] [blame] | 1432 | const struct nfs_pgio_header *hdr, |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1433 | int error |
| 1434 | ), |
| 1435 | |
Weston Andros Adamson | d45f60c | 2014-06-09 11:48:35 -0400 | [diff] [blame] | 1436 | TP_ARGS(hdr, error), |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1437 | |
| 1438 | TP_STRUCT__entry( |
| 1439 | __field(dev_t, dev) |
| 1440 | __field(u32, fhandle) |
| 1441 | __field(u64, fileid) |
| 1442 | __field(loff_t, offset) |
Trond Myklebust | 25925b0 | 2020-01-06 15:25:05 -0500 | [diff] [blame] | 1443 | __field(u32, arg_count) |
| 1444 | __field(u32, res_count) |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1445 | __field(unsigned long, error) |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1446 | __field(int, stateid_seq) |
| 1447 | __field(u32, stateid_hash) |
Trond Myklebust | 54898f7 | 2020-08-04 22:16:06 -0400 | [diff] [blame] | 1448 | __field(int, layoutstateid_seq) |
| 1449 | __field(u32, layoutstateid_hash) |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1450 | ), |
| 1451 | |
| 1452 | TP_fast_assign( |
Weston Andros Adamson | d45f60c | 2014-06-09 11:48:35 -0400 | [diff] [blame] | 1453 | const struct inode *inode = hdr->inode; |
Trond Myklebust | 25925b0 | 2020-01-06 15:25:05 -0500 | [diff] [blame] | 1454 | const struct nfs_inode *nfsi = NFS_I(inode); |
| 1455 | const struct nfs_fh *fh = hdr->args.fh ? |
| 1456 | hdr->args.fh : &nfsi->fh; |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1457 | const struct nfs4_state *state = |
| 1458 | hdr->args.context->state; |
Trond Myklebust | 54898f7 | 2020-08-04 22:16:06 -0400 | [diff] [blame] | 1459 | const struct pnfs_layout_segment *lseg = hdr->lseg; |
Trond Myklebust | 25925b0 | 2020-01-06 15:25:05 -0500 | [diff] [blame] | 1460 | |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1461 | __entry->dev = inode->i_sb->s_dev; |
Trond Myklebust | 25925b0 | 2020-01-06 15:25:05 -0500 | [diff] [blame] | 1462 | __entry->fileid = nfsi->fileid; |
| 1463 | __entry->fhandle = nfs_fhandle_hash(fh); |
Weston Andros Adamson | d45f60c | 2014-06-09 11:48:35 -0400 | [diff] [blame] | 1464 | __entry->offset = hdr->args.offset; |
Trond Myklebust | 25925b0 | 2020-01-06 15:25:05 -0500 | [diff] [blame] | 1465 | __entry->arg_count = hdr->args.count; |
| 1466 | __entry->res_count = hdr->res.count; |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1467 | __entry->error = error < 0 ? -error : 0; |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1468 | __entry->stateid_seq = |
| 1469 | be32_to_cpu(state->stateid.seqid); |
| 1470 | __entry->stateid_hash = |
| 1471 | nfs_stateid_hash(&state->stateid); |
Trond Myklebust | 54898f7 | 2020-08-04 22:16:06 -0400 | [diff] [blame] | 1472 | __entry->layoutstateid_seq = lseg ? lseg->pls_seq : 0; |
| 1473 | __entry->layoutstateid_hash = |
| 1474 | NFS4_LSEG_LAYOUT_STATEID_HASH(lseg); |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1475 | ), |
| 1476 | |
| 1477 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1478 | "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x " |
Trond Myklebust | 54898f7 | 2020-08-04 22:16:06 -0400 | [diff] [blame] | 1479 | "offset=%lld count=%u res=%u stateid=%d:0x%08x " |
| 1480 | "layoutstateid=%d:0x%08x", |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1481 | -__entry->error, |
Chuck Lever | 8791545 | 2021-10-22 16:17:03 -0400 | [diff] [blame] | 1482 | show_nfs4_status(__entry->error), |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1483 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1484 | (unsigned long long)__entry->fileid, |
| 1485 | __entry->fhandle, |
| 1486 | (long long)__entry->offset, |
Trond Myklebust | 25925b0 | 2020-01-06 15:25:05 -0500 | [diff] [blame] | 1487 | __entry->arg_count, __entry->res_count, |
Trond Myklebust | 54898f7 | 2020-08-04 22:16:06 -0400 | [diff] [blame] | 1488 | __entry->stateid_seq, __entry->stateid_hash, |
| 1489 | __entry->layoutstateid_seq, __entry->layoutstateid_hash |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1490 | ) |
| 1491 | ); |
| 1492 | #define DEFINE_NFS4_READ_EVENT(name) \ |
| 1493 | DEFINE_EVENT(nfs4_read_event, name, \ |
| 1494 | TP_PROTO( \ |
Weston Andros Adamson | d45f60c | 2014-06-09 11:48:35 -0400 | [diff] [blame] | 1495 | const struct nfs_pgio_header *hdr, \ |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1496 | int error \ |
| 1497 | ), \ |
Weston Andros Adamson | d45f60c | 2014-06-09 11:48:35 -0400 | [diff] [blame] | 1498 | TP_ARGS(hdr, error)) |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1499 | DEFINE_NFS4_READ_EVENT(nfs4_read); |
| 1500 | #ifdef CONFIG_NFS_V4_1 |
| 1501 | DEFINE_NFS4_READ_EVENT(nfs4_pnfs_read); |
| 1502 | #endif /* CONFIG_NFS_V4_1 */ |
| 1503 | |
| 1504 | DECLARE_EVENT_CLASS(nfs4_write_event, |
| 1505 | TP_PROTO( |
Weston Andros Adamson | d45f60c | 2014-06-09 11:48:35 -0400 | [diff] [blame] | 1506 | const struct nfs_pgio_header *hdr, |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1507 | int error |
| 1508 | ), |
| 1509 | |
Weston Andros Adamson | d45f60c | 2014-06-09 11:48:35 -0400 | [diff] [blame] | 1510 | TP_ARGS(hdr, error), |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1511 | |
| 1512 | TP_STRUCT__entry( |
| 1513 | __field(dev_t, dev) |
| 1514 | __field(u32, fhandle) |
| 1515 | __field(u64, fileid) |
| 1516 | __field(loff_t, offset) |
Trond Myklebust | 25925b0 | 2020-01-06 15:25:05 -0500 | [diff] [blame] | 1517 | __field(u32, arg_count) |
| 1518 | __field(u32, res_count) |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1519 | __field(unsigned long, error) |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1520 | __field(int, stateid_seq) |
| 1521 | __field(u32, stateid_hash) |
Trond Myklebust | 54898f7 | 2020-08-04 22:16:06 -0400 | [diff] [blame] | 1522 | __field(int, layoutstateid_seq) |
| 1523 | __field(u32, layoutstateid_hash) |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1524 | ), |
| 1525 | |
| 1526 | TP_fast_assign( |
Weston Andros Adamson | d45f60c | 2014-06-09 11:48:35 -0400 | [diff] [blame] | 1527 | const struct inode *inode = hdr->inode; |
Trond Myklebust | 25925b0 | 2020-01-06 15:25:05 -0500 | [diff] [blame] | 1528 | const struct nfs_inode *nfsi = NFS_I(inode); |
| 1529 | const struct nfs_fh *fh = hdr->args.fh ? |
| 1530 | hdr->args.fh : &nfsi->fh; |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1531 | const struct nfs4_state *state = |
| 1532 | hdr->args.context->state; |
Trond Myklebust | 54898f7 | 2020-08-04 22:16:06 -0400 | [diff] [blame] | 1533 | const struct pnfs_layout_segment *lseg = hdr->lseg; |
Trond Myklebust | 25925b0 | 2020-01-06 15:25:05 -0500 | [diff] [blame] | 1534 | |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1535 | __entry->dev = inode->i_sb->s_dev; |
Trond Myklebust | 25925b0 | 2020-01-06 15:25:05 -0500 | [diff] [blame] | 1536 | __entry->fileid = nfsi->fileid; |
| 1537 | __entry->fhandle = nfs_fhandle_hash(fh); |
Weston Andros Adamson | d45f60c | 2014-06-09 11:48:35 -0400 | [diff] [blame] | 1538 | __entry->offset = hdr->args.offset; |
Trond Myklebust | 25925b0 | 2020-01-06 15:25:05 -0500 | [diff] [blame] | 1539 | __entry->arg_count = hdr->args.count; |
| 1540 | __entry->res_count = hdr->res.count; |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1541 | __entry->error = error < 0 ? -error : 0; |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1542 | __entry->stateid_seq = |
| 1543 | be32_to_cpu(state->stateid.seqid); |
| 1544 | __entry->stateid_hash = |
| 1545 | nfs_stateid_hash(&state->stateid); |
Trond Myklebust | 54898f7 | 2020-08-04 22:16:06 -0400 | [diff] [blame] | 1546 | __entry->layoutstateid_seq = lseg ? lseg->pls_seq : 0; |
| 1547 | __entry->layoutstateid_hash = |
| 1548 | NFS4_LSEG_LAYOUT_STATEID_HASH(lseg); |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1549 | ), |
| 1550 | |
| 1551 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1552 | "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x " |
Trond Myklebust | 54898f7 | 2020-08-04 22:16:06 -0400 | [diff] [blame] | 1553 | "offset=%lld count=%u res=%u stateid=%d:0x%08x " |
| 1554 | "layoutstateid=%d:0x%08x", |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1555 | -__entry->error, |
Chuck Lever | 8791545 | 2021-10-22 16:17:03 -0400 | [diff] [blame] | 1556 | show_nfs4_status(__entry->error), |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1557 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1558 | (unsigned long long)__entry->fileid, |
| 1559 | __entry->fhandle, |
| 1560 | (long long)__entry->offset, |
Trond Myklebust | 25925b0 | 2020-01-06 15:25:05 -0500 | [diff] [blame] | 1561 | __entry->arg_count, __entry->res_count, |
Trond Myklebust | 54898f7 | 2020-08-04 22:16:06 -0400 | [diff] [blame] | 1562 | __entry->stateid_seq, __entry->stateid_hash, |
| 1563 | __entry->layoutstateid_seq, __entry->layoutstateid_hash |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1564 | ) |
| 1565 | ); |
| 1566 | |
| 1567 | #define DEFINE_NFS4_WRITE_EVENT(name) \ |
| 1568 | DEFINE_EVENT(nfs4_write_event, name, \ |
| 1569 | TP_PROTO( \ |
Weston Andros Adamson | d45f60c | 2014-06-09 11:48:35 -0400 | [diff] [blame] | 1570 | const struct nfs_pgio_header *hdr, \ |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1571 | int error \ |
| 1572 | ), \ |
Weston Andros Adamson | d45f60c | 2014-06-09 11:48:35 -0400 | [diff] [blame] | 1573 | TP_ARGS(hdr, error)) |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1574 | DEFINE_NFS4_WRITE_EVENT(nfs4_write); |
| 1575 | #ifdef CONFIG_NFS_V4_1 |
| 1576 | DEFINE_NFS4_WRITE_EVENT(nfs4_pnfs_write); |
| 1577 | #endif /* CONFIG_NFS_V4_1 */ |
| 1578 | |
| 1579 | DECLARE_EVENT_CLASS(nfs4_commit_event, |
| 1580 | TP_PROTO( |
| 1581 | const struct nfs_commit_data *data, |
| 1582 | int error |
| 1583 | ), |
| 1584 | |
| 1585 | TP_ARGS(data, error), |
| 1586 | |
| 1587 | TP_STRUCT__entry( |
| 1588 | __field(dev_t, dev) |
| 1589 | __field(u32, fhandle) |
| 1590 | __field(u64, fileid) |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1591 | __field(unsigned long, error) |
Trond Myklebust | 25925b0 | 2020-01-06 15:25:05 -0500 | [diff] [blame] | 1592 | __field(loff_t, offset) |
| 1593 | __field(u32, count) |
Trond Myklebust | 54898f7 | 2020-08-04 22:16:06 -0400 | [diff] [blame] | 1594 | __field(int, layoutstateid_seq) |
| 1595 | __field(u32, layoutstateid_hash) |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1596 | ), |
| 1597 | |
| 1598 | TP_fast_assign( |
| 1599 | const struct inode *inode = data->inode; |
Trond Myklebust | 25925b0 | 2020-01-06 15:25:05 -0500 | [diff] [blame] | 1600 | const struct nfs_inode *nfsi = NFS_I(inode); |
| 1601 | const struct nfs_fh *fh = data->args.fh ? |
| 1602 | data->args.fh : &nfsi->fh; |
Trond Myklebust | 54898f7 | 2020-08-04 22:16:06 -0400 | [diff] [blame] | 1603 | const struct pnfs_layout_segment *lseg = data->lseg; |
Trond Myklebust | 25925b0 | 2020-01-06 15:25:05 -0500 | [diff] [blame] | 1604 | |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1605 | __entry->dev = inode->i_sb->s_dev; |
Trond Myklebust | 25925b0 | 2020-01-06 15:25:05 -0500 | [diff] [blame] | 1606 | __entry->fileid = nfsi->fileid; |
| 1607 | __entry->fhandle = nfs_fhandle_hash(fh); |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1608 | __entry->offset = data->args.offset; |
| 1609 | __entry->count = data->args.count; |
Trond Myklebust | 25925b0 | 2020-01-06 15:25:05 -0500 | [diff] [blame] | 1610 | __entry->error = error < 0 ? -error : 0; |
Trond Myklebust | 54898f7 | 2020-08-04 22:16:06 -0400 | [diff] [blame] | 1611 | __entry->layoutstateid_seq = lseg ? lseg->pls_seq : 0; |
| 1612 | __entry->layoutstateid_hash = |
| 1613 | NFS4_LSEG_LAYOUT_STATEID_HASH(lseg); |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1614 | ), |
| 1615 | |
| 1616 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1617 | "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x " |
Trond Myklebust | 54898f7 | 2020-08-04 22:16:06 -0400 | [diff] [blame] | 1618 | "offset=%lld count=%u layoutstateid=%d:0x%08x", |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1619 | -__entry->error, |
Chuck Lever | 8791545 | 2021-10-22 16:17:03 -0400 | [diff] [blame] | 1620 | show_nfs4_status(__entry->error), |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1621 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1622 | (unsigned long long)__entry->fileid, |
| 1623 | __entry->fhandle, |
| 1624 | (long long)__entry->offset, |
Trond Myklebust | 54898f7 | 2020-08-04 22:16:06 -0400 | [diff] [blame] | 1625 | __entry->count, |
| 1626 | __entry->layoutstateid_seq, __entry->layoutstateid_hash |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 1627 | ) |
| 1628 | ); |
| 1629 | #define DEFINE_NFS4_COMMIT_EVENT(name) \ |
| 1630 | DEFINE_EVENT(nfs4_commit_event, name, \ |
| 1631 | TP_PROTO( \ |
| 1632 | const struct nfs_commit_data *data, \ |
| 1633 | int error \ |
| 1634 | ), \ |
| 1635 | TP_ARGS(data, error)) |
| 1636 | DEFINE_NFS4_COMMIT_EVENT(nfs4_commit); |
| 1637 | #ifdef CONFIG_NFS_V4_1 |
| 1638 | DEFINE_NFS4_COMMIT_EVENT(nfs4_pnfs_commit_ds); |
Trond Myklebust | 1037e6e | 2013-08-14 16:36:51 -0400 | [diff] [blame] | 1639 | |
Trond Myklebust | 1037e6e | 2013-08-14 16:36:51 -0400 | [diff] [blame] | 1640 | TRACE_EVENT(nfs4_layoutget, |
| 1641 | TP_PROTO( |
| 1642 | const struct nfs_open_context *ctx, |
| 1643 | const struct pnfs_layout_range *args, |
| 1644 | const struct pnfs_layout_range *res, |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1645 | const nfs4_stateid *layout_stateid, |
Trond Myklebust | 1037e6e | 2013-08-14 16:36:51 -0400 | [diff] [blame] | 1646 | int error |
| 1647 | ), |
| 1648 | |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1649 | TP_ARGS(ctx, args, res, layout_stateid, error), |
Trond Myklebust | 1037e6e | 2013-08-14 16:36:51 -0400 | [diff] [blame] | 1650 | |
| 1651 | TP_STRUCT__entry( |
| 1652 | __field(dev_t, dev) |
| 1653 | __field(u32, fhandle) |
| 1654 | __field(u64, fileid) |
| 1655 | __field(u32, iomode) |
| 1656 | __field(u64, offset) |
| 1657 | __field(u64, count) |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1658 | __field(unsigned long, error) |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1659 | __field(int, stateid_seq) |
| 1660 | __field(u32, stateid_hash) |
| 1661 | __field(int, layoutstateid_seq) |
| 1662 | __field(u32, layoutstateid_hash) |
Trond Myklebust | 1037e6e | 2013-08-14 16:36:51 -0400 | [diff] [blame] | 1663 | ), |
| 1664 | |
| 1665 | TP_fast_assign( |
David Howells | 2b0143b | 2015-03-17 22:25:59 +0000 | [diff] [blame] | 1666 | const struct inode *inode = d_inode(ctx->dentry); |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1667 | const struct nfs4_state *state = ctx->state; |
Trond Myklebust | 1037e6e | 2013-08-14 16:36:51 -0400 | [diff] [blame] | 1668 | __entry->dev = inode->i_sb->s_dev; |
| 1669 | __entry->fileid = NFS_FILEID(inode); |
| 1670 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
| 1671 | __entry->iomode = args->iomode; |
| 1672 | __entry->offset = args->offset; |
| 1673 | __entry->count = args->length; |
Trond Myklebust | 118b629 | 2020-01-06 15:25:06 -0500 | [diff] [blame] | 1674 | __entry->error = error < 0 ? -error : 0; |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1675 | __entry->stateid_seq = |
| 1676 | be32_to_cpu(state->stateid.seqid); |
| 1677 | __entry->stateid_hash = |
| 1678 | nfs_stateid_hash(&state->stateid); |
| 1679 | if (!error) { |
| 1680 | __entry->layoutstateid_seq = |
| 1681 | be32_to_cpu(layout_stateid->seqid); |
| 1682 | __entry->layoutstateid_hash = |
| 1683 | nfs_stateid_hash(layout_stateid); |
| 1684 | } else { |
| 1685 | __entry->layoutstateid_seq = 0; |
| 1686 | __entry->layoutstateid_hash = 0; |
| 1687 | } |
Trond Myklebust | 1037e6e | 2013-08-14 16:36:51 -0400 | [diff] [blame] | 1688 | ), |
| 1689 | |
| 1690 | TP_printk( |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1691 | "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x " |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1692 | "iomode=%s offset=%llu count=%llu stateid=%d:0x%08x " |
| 1693 | "layoutstateid=%d:0x%08x", |
Chuck Lever | 96650e2 | 2019-06-19 10:33:53 -0400 | [diff] [blame] | 1694 | -__entry->error, |
Chuck Lever | 8791545 | 2021-10-22 16:17:03 -0400 | [diff] [blame] | 1695 | show_nfs4_status(__entry->error), |
Trond Myklebust | 1037e6e | 2013-08-14 16:36:51 -0400 | [diff] [blame] | 1696 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1697 | (unsigned long long)__entry->fileid, |
| 1698 | __entry->fhandle, |
Chuck Lever | 8791545 | 2021-10-22 16:17:03 -0400 | [diff] [blame] | 1699 | show_pnfs_layout_iomode(__entry->iomode), |
Trond Myklebust | 1037e6e | 2013-08-14 16:36:51 -0400 | [diff] [blame] | 1700 | (unsigned long long)__entry->offset, |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1701 | (unsigned long long)__entry->count, |
| 1702 | __entry->stateid_seq, __entry->stateid_hash, |
| 1703 | __entry->layoutstateid_seq, __entry->layoutstateid_hash |
Trond Myklebust | 1037e6e | 2013-08-14 16:36:51 -0400 | [diff] [blame] | 1704 | ) |
| 1705 | ); |
| 1706 | |
Olga Kornievskaia | 48c9579 | 2015-11-24 13:29:41 -0500 | [diff] [blame] | 1707 | DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_layoutcommit); |
| 1708 | DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_layoutreturn); |
Trond Myklebust | a19b478 | 2020-08-03 18:32:28 -0400 | [diff] [blame] | 1709 | DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_layoutreturn_on_close); |
Trond Myklebust | 638037b | 2020-08-04 11:02:44 -0400 | [diff] [blame] | 1710 | DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_layouterror); |
| 1711 | DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_layoutstats); |
Trond Myklebust | 1037e6e | 2013-08-14 16:36:51 -0400 | [diff] [blame] | 1712 | |
Chuck Lever | 5b2095d | 2018-12-19 11:00:11 -0500 | [diff] [blame] | 1713 | TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_UNKNOWN); |
| 1714 | TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_NO_PNFS); |
| 1715 | TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_RD_ZEROLEN); |
| 1716 | TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_MDSTHRESH); |
| 1717 | TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_NOMEM); |
| 1718 | TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_BULK_RECALL); |
| 1719 | TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_IO_TEST_FAIL); |
| 1720 | TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_FOUND_CACHED); |
| 1721 | TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_RETURN); |
| 1722 | TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_BLOCKED); |
| 1723 | TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_INVALID_OPEN); |
| 1724 | TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_RETRY); |
| 1725 | TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_SEND_LAYOUTGET); |
Trond Myklebust | d5b9216 | 2019-07-18 09:32:17 -0400 | [diff] [blame] | 1726 | TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_EXIT); |
Chuck Lever | 5b2095d | 2018-12-19 11:00:11 -0500 | [diff] [blame] | 1727 | |
Jeff Layton | 9a4bf31 | 2015-12-10 10:41:58 -0500 | [diff] [blame] | 1728 | #define show_pnfs_update_layout_reason(reason) \ |
| 1729 | __print_symbolic(reason, \ |
| 1730 | { PNFS_UPDATE_LAYOUT_UNKNOWN, "unknown" }, \ |
| 1731 | { PNFS_UPDATE_LAYOUT_NO_PNFS, "no pnfs" }, \ |
| 1732 | { PNFS_UPDATE_LAYOUT_RD_ZEROLEN, "read+zerolen" }, \ |
| 1733 | { PNFS_UPDATE_LAYOUT_MDSTHRESH, "mdsthresh" }, \ |
| 1734 | { PNFS_UPDATE_LAYOUT_NOMEM, "nomem" }, \ |
| 1735 | { PNFS_UPDATE_LAYOUT_BULK_RECALL, "bulk recall" }, \ |
| 1736 | { PNFS_UPDATE_LAYOUT_IO_TEST_FAIL, "io test fail" }, \ |
| 1737 | { PNFS_UPDATE_LAYOUT_FOUND_CACHED, "found cached" }, \ |
| 1738 | { PNFS_UPDATE_LAYOUT_RETURN, "layoutreturn" }, \ |
| 1739 | { PNFS_UPDATE_LAYOUT_BLOCKED, "layouts blocked" }, \ |
Jeff Layton | 183d9e7 | 2016-05-17 12:28:47 -0400 | [diff] [blame] | 1740 | { PNFS_UPDATE_LAYOUT_INVALID_OPEN, "invalid open" }, \ |
| 1741 | { PNFS_UPDATE_LAYOUT_RETRY, "retrying" }, \ |
Trond Myklebust | d5b9216 | 2019-07-18 09:32:17 -0400 | [diff] [blame] | 1742 | { PNFS_UPDATE_LAYOUT_SEND_LAYOUTGET, "sent layoutget" }, \ |
| 1743 | { PNFS_UPDATE_LAYOUT_EXIT, "exit" }) |
Jeff Layton | 9a4bf31 | 2015-12-10 10:41:58 -0500 | [diff] [blame] | 1744 | |
| 1745 | TRACE_EVENT(pnfs_update_layout, |
| 1746 | TP_PROTO(struct inode *inode, |
| 1747 | loff_t pos, |
| 1748 | u64 count, |
| 1749 | enum pnfs_iomode iomode, |
Trond Myklebust | f484830 | 2015-12-26 18:03:07 -0500 | [diff] [blame] | 1750 | struct pnfs_layout_hdr *lo, |
Jeff Layton | 183d9e7 | 2016-05-17 12:28:47 -0400 | [diff] [blame] | 1751 | struct pnfs_layout_segment *lseg, |
Jeff Layton | 9a4bf31 | 2015-12-10 10:41:58 -0500 | [diff] [blame] | 1752 | enum pnfs_update_layout_reason reason |
| 1753 | ), |
Jeff Layton | 183d9e7 | 2016-05-17 12:28:47 -0400 | [diff] [blame] | 1754 | TP_ARGS(inode, pos, count, iomode, lo, lseg, reason), |
Jeff Layton | 9a4bf31 | 2015-12-10 10:41:58 -0500 | [diff] [blame] | 1755 | TP_STRUCT__entry( |
| 1756 | __field(dev_t, dev) |
| 1757 | __field(u64, fileid) |
| 1758 | __field(u32, fhandle) |
| 1759 | __field(loff_t, pos) |
| 1760 | __field(u64, count) |
| 1761 | __field(enum pnfs_iomode, iomode) |
Trond Myklebust | f484830 | 2015-12-26 18:03:07 -0500 | [diff] [blame] | 1762 | __field(int, layoutstateid_seq) |
| 1763 | __field(u32, layoutstateid_hash) |
Jeff Layton | 183d9e7 | 2016-05-17 12:28:47 -0400 | [diff] [blame] | 1764 | __field(long, lseg) |
Jeff Layton | 9a4bf31 | 2015-12-10 10:41:58 -0500 | [diff] [blame] | 1765 | __field(enum pnfs_update_layout_reason, reason) |
| 1766 | ), |
| 1767 | TP_fast_assign( |
| 1768 | __entry->dev = inode->i_sb->s_dev; |
| 1769 | __entry->fileid = NFS_FILEID(inode); |
| 1770 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
| 1771 | __entry->pos = pos; |
| 1772 | __entry->count = count; |
| 1773 | __entry->iomode = iomode; |
Jeff Layton | 9a4bf31 | 2015-12-10 10:41:58 -0500 | [diff] [blame] | 1774 | __entry->reason = reason; |
Trond Myklebust | f484830 | 2015-12-26 18:03:07 -0500 | [diff] [blame] | 1775 | if (lo != NULL) { |
| 1776 | __entry->layoutstateid_seq = |
| 1777 | be32_to_cpu(lo->plh_stateid.seqid); |
| 1778 | __entry->layoutstateid_hash = |
| 1779 | nfs_stateid_hash(&lo->plh_stateid); |
| 1780 | } else { |
| 1781 | __entry->layoutstateid_seq = 0; |
| 1782 | __entry->layoutstateid_hash = 0; |
| 1783 | } |
Jeff Layton | 183d9e7 | 2016-05-17 12:28:47 -0400 | [diff] [blame] | 1784 | __entry->lseg = (long)lseg; |
Jeff Layton | 9a4bf31 | 2015-12-10 10:41:58 -0500 | [diff] [blame] | 1785 | ), |
| 1786 | TP_printk( |
| 1787 | "fileid=%02x:%02x:%llu fhandle=0x%08x " |
Trond Myklebust | f484830 | 2015-12-26 18:03:07 -0500 | [diff] [blame] | 1788 | "iomode=%s pos=%llu count=%llu " |
Jeff Layton | 183d9e7 | 2016-05-17 12:28:47 -0400 | [diff] [blame] | 1789 | "layoutstateid=%d:0x%08x lseg=0x%lx (%s)", |
Jeff Layton | 9a4bf31 | 2015-12-10 10:41:58 -0500 | [diff] [blame] | 1790 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1791 | (unsigned long long)__entry->fileid, |
| 1792 | __entry->fhandle, |
Chuck Lever | 8791545 | 2021-10-22 16:17:03 -0400 | [diff] [blame] | 1793 | show_pnfs_layout_iomode(__entry->iomode), |
Jeff Layton | 9a4bf31 | 2015-12-10 10:41:58 -0500 | [diff] [blame] | 1794 | (unsigned long long)__entry->pos, |
Trond Myklebust | f484830 | 2015-12-26 18:03:07 -0500 | [diff] [blame] | 1795 | (unsigned long long)__entry->count, |
| 1796 | __entry->layoutstateid_seq, __entry->layoutstateid_hash, |
Jeff Layton | 183d9e7 | 2016-05-17 12:28:47 -0400 | [diff] [blame] | 1797 | __entry->lseg, |
Jeff Layton | 9a4bf31 | 2015-12-10 10:41:58 -0500 | [diff] [blame] | 1798 | show_pnfs_update_layout_reason(__entry->reason) |
| 1799 | ) |
| 1800 | ); |
| 1801 | |
Trond Myklebust | d5b9216 | 2019-07-18 09:32:17 -0400 | [diff] [blame] | 1802 | DECLARE_EVENT_CLASS(pnfs_layout_event, |
| 1803 | TP_PROTO(struct inode *inode, |
| 1804 | loff_t pos, |
| 1805 | u64 count, |
| 1806 | enum pnfs_iomode iomode, |
| 1807 | struct pnfs_layout_hdr *lo, |
| 1808 | struct pnfs_layout_segment *lseg |
| 1809 | ), |
| 1810 | TP_ARGS(inode, pos, count, iomode, lo, lseg), |
| 1811 | TP_STRUCT__entry( |
| 1812 | __field(dev_t, dev) |
| 1813 | __field(u64, fileid) |
| 1814 | __field(u32, fhandle) |
| 1815 | __field(loff_t, pos) |
| 1816 | __field(u64, count) |
| 1817 | __field(enum pnfs_iomode, iomode) |
| 1818 | __field(int, layoutstateid_seq) |
| 1819 | __field(u32, layoutstateid_hash) |
| 1820 | __field(long, lseg) |
| 1821 | ), |
| 1822 | TP_fast_assign( |
| 1823 | __entry->dev = inode->i_sb->s_dev; |
| 1824 | __entry->fileid = NFS_FILEID(inode); |
| 1825 | __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); |
| 1826 | __entry->pos = pos; |
| 1827 | __entry->count = count; |
| 1828 | __entry->iomode = iomode; |
| 1829 | if (lo != NULL) { |
| 1830 | __entry->layoutstateid_seq = |
| 1831 | be32_to_cpu(lo->plh_stateid.seqid); |
| 1832 | __entry->layoutstateid_hash = |
| 1833 | nfs_stateid_hash(&lo->plh_stateid); |
| 1834 | } else { |
| 1835 | __entry->layoutstateid_seq = 0; |
| 1836 | __entry->layoutstateid_hash = 0; |
| 1837 | } |
| 1838 | __entry->lseg = (long)lseg; |
| 1839 | ), |
| 1840 | TP_printk( |
| 1841 | "fileid=%02x:%02x:%llu fhandle=0x%08x " |
| 1842 | "iomode=%s pos=%llu count=%llu " |
| 1843 | "layoutstateid=%d:0x%08x lseg=0x%lx", |
| 1844 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1845 | (unsigned long long)__entry->fileid, |
| 1846 | __entry->fhandle, |
Chuck Lever | 8791545 | 2021-10-22 16:17:03 -0400 | [diff] [blame] | 1847 | show_pnfs_layout_iomode(__entry->iomode), |
Trond Myklebust | d5b9216 | 2019-07-18 09:32:17 -0400 | [diff] [blame] | 1848 | (unsigned long long)__entry->pos, |
| 1849 | (unsigned long long)__entry->count, |
| 1850 | __entry->layoutstateid_seq, __entry->layoutstateid_hash, |
| 1851 | __entry->lseg |
| 1852 | ) |
| 1853 | ); |
| 1854 | |
| 1855 | #define DEFINE_PNFS_LAYOUT_EVENT(name) \ |
| 1856 | DEFINE_EVENT(pnfs_layout_event, name, \ |
| 1857 | TP_PROTO(struct inode *inode, \ |
| 1858 | loff_t pos, \ |
| 1859 | u64 count, \ |
| 1860 | enum pnfs_iomode iomode, \ |
| 1861 | struct pnfs_layout_hdr *lo, \ |
| 1862 | struct pnfs_layout_segment *lseg \ |
| 1863 | ), \ |
| 1864 | TP_ARGS(inode, pos, count, iomode, lo, lseg)) |
| 1865 | |
| 1866 | DEFINE_PNFS_LAYOUT_EVENT(pnfs_mds_fallback_pg_init_read); |
| 1867 | DEFINE_PNFS_LAYOUT_EVENT(pnfs_mds_fallback_pg_init_write); |
| 1868 | DEFINE_PNFS_LAYOUT_EVENT(pnfs_mds_fallback_pg_get_mirror_count); |
| 1869 | DEFINE_PNFS_LAYOUT_EVENT(pnfs_mds_fallback_read_done); |
| 1870 | DEFINE_PNFS_LAYOUT_EVENT(pnfs_mds_fallback_write_done); |
| 1871 | DEFINE_PNFS_LAYOUT_EVENT(pnfs_mds_fallback_read_pagelist); |
| 1872 | DEFINE_PNFS_LAYOUT_EVENT(pnfs_mds_fallback_write_pagelist); |
| 1873 | |
Trond Myklebust | cac1d3a | 2020-12-16 16:31:26 -0500 | [diff] [blame] | 1874 | DECLARE_EVENT_CLASS(nfs4_deviceid_event, |
| 1875 | TP_PROTO( |
| 1876 | const struct nfs_client *clp, |
| 1877 | const struct nfs4_deviceid *deviceid |
| 1878 | ), |
| 1879 | |
| 1880 | TP_ARGS(clp, deviceid), |
| 1881 | |
| 1882 | TP_STRUCT__entry( |
| 1883 | __string(dstaddr, clp->cl_hostname) |
| 1884 | __array(unsigned char, deviceid, NFS4_DEVICEID4_SIZE) |
| 1885 | ), |
| 1886 | |
| 1887 | TP_fast_assign( |
| 1888 | __assign_str(dstaddr, clp->cl_hostname); |
| 1889 | memcpy(__entry->deviceid, deviceid->data, |
| 1890 | NFS4_DEVICEID4_SIZE); |
| 1891 | ), |
| 1892 | |
| 1893 | TP_printk( |
| 1894 | "deviceid=%s, dstaddr=%s", |
| 1895 | __print_hex(__entry->deviceid, NFS4_DEVICEID4_SIZE), |
| 1896 | __get_str(dstaddr) |
| 1897 | ) |
| 1898 | ); |
| 1899 | #define DEFINE_PNFS_DEVICEID_EVENT(name) \ |
| 1900 | DEFINE_EVENT(nfs4_deviceid_event, name, \ |
| 1901 | TP_PROTO(const struct nfs_client *clp, \ |
| 1902 | const struct nfs4_deviceid *deviceid \ |
| 1903 | ), \ |
| 1904 | TP_ARGS(clp, deviceid)) |
| 1905 | DEFINE_PNFS_DEVICEID_EVENT(nfs4_deviceid_free); |
| 1906 | |
| 1907 | DECLARE_EVENT_CLASS(nfs4_deviceid_status, |
| 1908 | TP_PROTO( |
| 1909 | const struct nfs_server *server, |
| 1910 | const struct nfs4_deviceid *deviceid, |
| 1911 | int status |
| 1912 | ), |
| 1913 | |
| 1914 | TP_ARGS(server, deviceid, status), |
| 1915 | |
| 1916 | TP_STRUCT__entry( |
| 1917 | __field(dev_t, dev) |
| 1918 | __field(int, status) |
| 1919 | __string(dstaddr, server->nfs_client->cl_hostname) |
| 1920 | __array(unsigned char, deviceid, NFS4_DEVICEID4_SIZE) |
| 1921 | ), |
| 1922 | |
| 1923 | TP_fast_assign( |
| 1924 | __entry->dev = server->s_dev; |
| 1925 | __entry->status = status; |
| 1926 | __assign_str(dstaddr, server->nfs_client->cl_hostname); |
| 1927 | memcpy(__entry->deviceid, deviceid->data, |
| 1928 | NFS4_DEVICEID4_SIZE); |
| 1929 | ), |
| 1930 | |
| 1931 | TP_printk( |
| 1932 | "dev=%02x:%02x: deviceid=%s, dstaddr=%s, status=%d", |
| 1933 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1934 | __print_hex(__entry->deviceid, NFS4_DEVICEID4_SIZE), |
| 1935 | __get_str(dstaddr), |
| 1936 | __entry->status |
| 1937 | ) |
| 1938 | ); |
| 1939 | #define DEFINE_PNFS_DEVICEID_STATUS(name) \ |
| 1940 | DEFINE_EVENT(nfs4_deviceid_status, name, \ |
| 1941 | TP_PROTO(const struct nfs_server *server, \ |
| 1942 | const struct nfs4_deviceid *deviceid, \ |
| 1943 | int status \ |
| 1944 | ), \ |
| 1945 | TP_ARGS(server, deviceid, status)) |
| 1946 | DEFINE_PNFS_DEVICEID_STATUS(nfs4_getdeviceinfo); |
| 1947 | DEFINE_PNFS_DEVICEID_STATUS(nfs4_find_deviceid); |
| 1948 | |
Trond Myklebust | 088f3e6 | 2020-01-06 15:25:11 -0500 | [diff] [blame] | 1949 | DECLARE_EVENT_CLASS(nfs4_flexfiles_io_event, |
| 1950 | TP_PROTO( |
| 1951 | const struct nfs_pgio_header *hdr |
| 1952 | ), |
| 1953 | |
| 1954 | TP_ARGS(hdr), |
| 1955 | |
| 1956 | TP_STRUCT__entry( |
| 1957 | __field(unsigned long, error) |
| 1958 | __field(dev_t, dev) |
| 1959 | __field(u32, fhandle) |
| 1960 | __field(u64, fileid) |
| 1961 | __field(loff_t, offset) |
| 1962 | __field(u32, count) |
| 1963 | __field(int, stateid_seq) |
| 1964 | __field(u32, stateid_hash) |
| 1965 | __string(dstaddr, hdr->ds_clp ? |
| 1966 | rpc_peeraddr2str(hdr->ds_clp->cl_rpcclient, |
| 1967 | RPC_DISPLAY_ADDR) : "unknown") |
| 1968 | ), |
| 1969 | |
| 1970 | TP_fast_assign( |
| 1971 | const struct inode *inode = hdr->inode; |
| 1972 | |
| 1973 | __entry->error = hdr->res.op_status; |
| 1974 | __entry->fhandle = nfs_fhandle_hash(hdr->args.fh); |
| 1975 | __entry->fileid = NFS_FILEID(inode); |
| 1976 | __entry->dev = inode->i_sb->s_dev; |
| 1977 | __entry->offset = hdr->args.offset; |
| 1978 | __entry->count = hdr->args.count; |
| 1979 | __entry->stateid_seq = |
| 1980 | be32_to_cpu(hdr->args.stateid.seqid); |
| 1981 | __entry->stateid_hash = |
| 1982 | nfs_stateid_hash(&hdr->args.stateid); |
| 1983 | __assign_str(dstaddr, hdr->ds_clp ? |
| 1984 | rpc_peeraddr2str(hdr->ds_clp->cl_rpcclient, |
| 1985 | RPC_DISPLAY_ADDR) : "unknown"); |
| 1986 | ), |
| 1987 | |
| 1988 | TP_printk( |
| 1989 | "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x " |
| 1990 | "offset=%llu count=%u stateid=%d:0x%08x dstaddr=%s", |
| 1991 | -__entry->error, |
Chuck Lever | 8791545 | 2021-10-22 16:17:03 -0400 | [diff] [blame] | 1992 | show_nfs4_status(__entry->error), |
Trond Myklebust | 088f3e6 | 2020-01-06 15:25:11 -0500 | [diff] [blame] | 1993 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1994 | (unsigned long long)__entry->fileid, |
| 1995 | __entry->fhandle, |
| 1996 | __entry->offset, __entry->count, |
| 1997 | __entry->stateid_seq, __entry->stateid_hash, |
| 1998 | __get_str(dstaddr) |
| 1999 | ) |
| 2000 | ); |
| 2001 | |
| 2002 | #define DEFINE_NFS4_FLEXFILES_IO_EVENT(name) \ |
| 2003 | DEFINE_EVENT(nfs4_flexfiles_io_event, name, \ |
| 2004 | TP_PROTO( \ |
| 2005 | const struct nfs_pgio_header *hdr \ |
| 2006 | ), \ |
| 2007 | TP_ARGS(hdr)) |
| 2008 | DEFINE_NFS4_FLEXFILES_IO_EVENT(ff_layout_read_error); |
| 2009 | DEFINE_NFS4_FLEXFILES_IO_EVENT(ff_layout_write_error); |
| 2010 | |
| 2011 | TRACE_EVENT(ff_layout_commit_error, |
| 2012 | TP_PROTO( |
| 2013 | const struct nfs_commit_data *data |
| 2014 | ), |
| 2015 | |
| 2016 | TP_ARGS(data), |
| 2017 | |
| 2018 | TP_STRUCT__entry( |
| 2019 | __field(unsigned long, error) |
| 2020 | __field(dev_t, dev) |
| 2021 | __field(u32, fhandle) |
| 2022 | __field(u64, fileid) |
| 2023 | __field(loff_t, offset) |
| 2024 | __field(u32, count) |
| 2025 | __string(dstaddr, data->ds_clp ? |
| 2026 | rpc_peeraddr2str(data->ds_clp->cl_rpcclient, |
| 2027 | RPC_DISPLAY_ADDR) : "unknown") |
| 2028 | ), |
| 2029 | |
| 2030 | TP_fast_assign( |
| 2031 | const struct inode *inode = data->inode; |
| 2032 | |
| 2033 | __entry->error = data->res.op_status; |
| 2034 | __entry->fhandle = nfs_fhandle_hash(data->args.fh); |
| 2035 | __entry->fileid = NFS_FILEID(inode); |
| 2036 | __entry->dev = inode->i_sb->s_dev; |
| 2037 | __entry->offset = data->args.offset; |
| 2038 | __entry->count = data->args.count; |
| 2039 | __assign_str(dstaddr, data->ds_clp ? |
| 2040 | rpc_peeraddr2str(data->ds_clp->cl_rpcclient, |
| 2041 | RPC_DISPLAY_ADDR) : "unknown"); |
| 2042 | ), |
| 2043 | |
| 2044 | TP_printk( |
| 2045 | "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x " |
| 2046 | "offset=%llu count=%u dstaddr=%s", |
| 2047 | -__entry->error, |
Chuck Lever | 8791545 | 2021-10-22 16:17:03 -0400 | [diff] [blame] | 2048 | show_nfs4_status(__entry->error), |
Trond Myklebust | 088f3e6 | 2020-01-06 15:25:11 -0500 | [diff] [blame] | 2049 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 2050 | (unsigned long long)__entry->fileid, |
| 2051 | __entry->fhandle, |
| 2052 | __entry->offset, __entry->count, |
| 2053 | __get_str(dstaddr) |
| 2054 | ) |
| 2055 | ); |
| 2056 | |
Olga Kornievskaia | f628d46 | 2021-11-04 10:57:08 -0400 | [diff] [blame^] | 2057 | TRACE_DEFINE_ENUM(NFS4_CONTENT_DATA); |
| 2058 | TRACE_DEFINE_ENUM(NFS4_CONTENT_HOLE); |
| 2059 | |
| 2060 | #define show_llseek_mode(what) \ |
| 2061 | __print_symbolic(what, \ |
| 2062 | { NFS4_CONTENT_DATA, "DATA" }, \ |
| 2063 | { NFS4_CONTENT_HOLE, "HOLE" }) |
| 2064 | |
| 2065 | #ifdef CONFIG_NFS_V4_2 |
| 2066 | TRACE_EVENT(nfs4_llseek, |
| 2067 | TP_PROTO( |
| 2068 | const struct inode *inode, |
| 2069 | const struct nfs42_seek_args *args, |
| 2070 | const struct nfs42_seek_res *res, |
| 2071 | int error |
| 2072 | ), |
| 2073 | |
| 2074 | TP_ARGS(inode, args, res, error), |
| 2075 | |
| 2076 | TP_STRUCT__entry( |
| 2077 | __field(unsigned long, error) |
| 2078 | __field(u32, fhandle) |
| 2079 | __field(u32, fileid) |
| 2080 | __field(dev_t, dev) |
| 2081 | __field(int, stateid_seq) |
| 2082 | __field(u32, stateid_hash) |
| 2083 | __field(loff_t, offset_s) |
| 2084 | __field(u32, what) |
| 2085 | __field(loff_t, offset_r) |
| 2086 | __field(u32, eof) |
| 2087 | ), |
| 2088 | |
| 2089 | TP_fast_assign( |
| 2090 | const struct nfs_inode *nfsi = NFS_I(inode); |
| 2091 | const struct nfs_fh *fh = args->sa_fh; |
| 2092 | |
| 2093 | __entry->fileid = nfsi->fileid; |
| 2094 | __entry->dev = inode->i_sb->s_dev; |
| 2095 | __entry->fhandle = nfs_fhandle_hash(fh); |
| 2096 | __entry->offset_s = args->sa_offset; |
| 2097 | __entry->stateid_seq = |
| 2098 | be32_to_cpu(args->sa_stateid.seqid); |
| 2099 | __entry->stateid_hash = |
| 2100 | nfs_stateid_hash(&args->sa_stateid); |
| 2101 | __entry->what = args->sa_what; |
| 2102 | if (error) { |
| 2103 | __entry->error = -error; |
| 2104 | __entry->offset_r = 0; |
| 2105 | __entry->eof = 0; |
| 2106 | } else { |
| 2107 | __entry->error = 0; |
| 2108 | __entry->offset_r = res->sr_offset; |
| 2109 | __entry->eof = res->sr_eof; |
| 2110 | } |
| 2111 | ), |
| 2112 | |
| 2113 | TP_printk( |
| 2114 | "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x " |
| 2115 | "stateid=%d:0x%08x offset_s=%llu what=%s " |
| 2116 | "offset_r=%llu eof=%u", |
| 2117 | -__entry->error, |
| 2118 | show_nfs4_status(__entry->error), |
| 2119 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 2120 | (unsigned long long)__entry->fileid, |
| 2121 | __entry->fhandle, |
| 2122 | __entry->stateid_seq, __entry->stateid_hash, |
| 2123 | __entry->offset_s, |
| 2124 | show_llseek_mode(__entry->what), |
| 2125 | __entry->offset_r, |
| 2126 | __entry->eof |
| 2127 | ) |
| 2128 | ); |
| 2129 | |
| 2130 | #endif /* CONFIG_NFS_V4_2 */ |
Trond Myklebust | 088f3e6 | 2020-01-06 15:25:11 -0500 | [diff] [blame] | 2131 | |
Trond Myklebust | cc668ab | 2013-08-14 15:31:28 -0400 | [diff] [blame] | 2132 | #endif /* CONFIG_NFS_V4_1 */ |
| 2133 | |
Trond Myklebust | c6d01c6 | 2013-08-09 11:51:26 -0400 | [diff] [blame] | 2134 | #endif /* _TRACE_NFS4_H */ |
| 2135 | |
| 2136 | #undef TRACE_INCLUDE_PATH |
| 2137 | #define TRACE_INCLUDE_PATH . |
| 2138 | #define TRACE_INCLUDE_FILE nfs4trace |
| 2139 | /* This part must be outside protection */ |
| 2140 | #include <trace/define_trace.h> |