License cleanup: add SPDX GPL-2.0 license identifier to files with no license
Many source files in the tree are missing licensing information, which
makes it harder for compliance tools to determine the correct license.
By default all files without license information are under the default
license of the kernel, which is GPL version 2.
Update the files which contain no license information with the 'GPL-2.0'
SPDX license identifier. The SPDX identifier is a legally binding
shorthand, which can be used instead of the full boiler plate text.
This patch is based on work done by Thomas Gleixner and Kate Stewart and
Philippe Ombredanne.
How this work was done:
Patches were generated and checked against linux-4.14-rc6 for a subset of
the use cases:
- file had no licensing information it it.
- file was a */uapi/* one with no licensing information in it,
- file was a */uapi/* one with existing licensing information,
Further patches will be generated in subsequent months to fix up cases
where non-standard license headers were used, and references to license
had to be inferred by heuristics based on keywords.
The analysis to determine which SPDX License Identifier to be applied to
a file was done in a spreadsheet of side by side results from of the
output of two independent scanners (ScanCode & Windriver) producing SPDX
tag:value files created by Philippe Ombredanne. Philippe prepared the
base worksheet, and did an initial spot review of a few 1000 files.
The 4.13 kernel was the starting point of the analysis with 60,537 files
assessed. Kate Stewart did a file by file comparison of the scanner
results in the spreadsheet to determine which SPDX license identifier(s)
to be applied to the file. She confirmed any determination that was not
immediately clear with lawyers working with the Linux Foundation.
Criteria used to select files for SPDX license identifier tagging was:
- Files considered eligible had to be source code files.
- Make and config files were included as candidates if they contained >5
lines of source
- File already had some variant of a license header in it (even if <5
lines).
All documentation files were explicitly excluded.
The following heuristics were used to determine which SPDX license
identifiers to apply.
- when both scanners couldn't find any license traces, file was
considered to have no license information in it, and the top level
COPYING file license applied.
For non */uapi/* files that summary was:
SPDX license identifier # files
---------------------------------------------------|-------
GPL-2.0 11139
and resulted in the first patch in this series.
If that file was a */uapi/* path one, it was "GPL-2.0 WITH
Linux-syscall-note" otherwise it was "GPL-2.0". Results of that was:
SPDX license identifier # files
---------------------------------------------------|-------
GPL-2.0 WITH Linux-syscall-note 930
and resulted in the second patch in this series.
- if a file had some form of licensing information in it, and was one
of the */uapi/* ones, it was denoted with the Linux-syscall-note if
any GPL family license was found in the file or had no licensing in
it (per prior point). Results summary:
SPDX license identifier # files
---------------------------------------------------|------
GPL-2.0 WITH Linux-syscall-note 270
GPL-2.0+ WITH Linux-syscall-note 169
((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) 21
((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) 17
LGPL-2.1+ WITH Linux-syscall-note 15
GPL-1.0+ WITH Linux-syscall-note 14
((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause) 5
LGPL-2.0+ WITH Linux-syscall-note 4
LGPL-2.1 WITH Linux-syscall-note 3
((GPL-2.0 WITH Linux-syscall-note) OR MIT) 3
((GPL-2.0 WITH Linux-syscall-note) AND MIT) 1
and that resulted in the third patch in this series.
- when the two scanners agreed on the detected license(s), that became
the concluded license(s).
- when there was disagreement between the two scanners (one detected a
license but the other didn't, or they both detected different
licenses) a manual inspection of the file occurred.
- In most cases a manual inspection of the information in the file
resulted in a clear resolution of the license that should apply (and
which scanner probably needed to revisit its heuristics).
- When it was not immediately clear, the license identifier was
confirmed with lawyers working with the Linux Foundation.
- If there was any question as to the appropriate license identifier,
the file was flagged for further research and to be revisited later
in time.
In total, over 70 hours of logged manual review was done on the
spreadsheet to determine the SPDX license identifiers to apply to the
source files by Kate, Philippe, Thomas and, in some cases, confirmation
by lawyers working with the Linux Foundation.
Kate also obtained a third independent scan of the 4.13 code base from
FOSSology, and compared selected files where the other two scanners
disagreed against that SPDX file, to see if there was new insights. The
Windriver scanner is based on an older version of FOSSology in part, so
they are related.
Thomas did random spot checks in about 500 files from the spreadsheets
for the uapi headers and agreed with SPDX license identifier in the
files he inspected. For the non-uapi files Thomas did random spot checks
in about 15000 files.
In initial set of patches against 4.14-rc6, 3 files were found to have
copy/paste license identifier errors, and have been fixed to reflect the
correct identifier.
Additionally Philippe spent 10 hours this week doing a detailed manual
inspection and review of the 12,461 patched files from the initial patch
version early this week with:
- a full scancode scan run, collecting the matched texts, detected
license ids and scores
- reviewing anything where there was a license detected (about 500+
files) to ensure that the applied SPDX license was correct
- reviewing anything where there was no detection but the patch license
was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
SPDX license was correct
This produced a worksheet with 20 files needing minor correction. This
worksheet was then exported into 3 different .csv files for the
different types of files to be modified.
These .csv files were then reviewed by Greg. Thomas wrote a script to
parse the csv files and add the proper SPDX tag to the file, in the
format that the file expected. This script was further refined by Greg
based on the output to detect more types of files automatically and to
distinguish between header and source .c files (which need different
comment types.) Finally Greg ran the script using the .csv files to
generate the patches.
Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-01 14:07:57 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
2013-08-09 15:51:26 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2013 Trond Myklebust <Trond.Myklebust@netapp.com>
|
|
|
|
*/
|
|
|
|
#undef TRACE_SYSTEM
|
|
|
|
#define TRACE_SYSTEM nfs4
|
|
|
|
|
|
|
|
#if !defined(_TRACE_NFS4_H) || defined(TRACE_HEADER_MULTI_READ)
|
|
|
|
#define _TRACE_NFS4_H
|
|
|
|
|
|
|
|
#include <linux/tracepoint.h>
|
2021-10-16 22:02:24 +00:00
|
|
|
#include <trace/events/sunrpc_base.h>
|
2013-08-09 15:51:26 +00:00
|
|
|
|
2021-10-22 20:16:56 +00:00
|
|
|
#include <trace/events/fs.h>
|
2021-10-22 20:17:03 +00:00
|
|
|
#include <trace/events/nfs.h>
|
2013-08-09 15:51:26 +00:00
|
|
|
|
2013-08-13 17:01:39 +00:00
|
|
|
#define show_nfs_fattr_flags(valid) \
|
|
|
|
__print_flags((unsigned long)valid, "|", \
|
|
|
|
{ NFS_ATTR_FATTR_TYPE, "TYPE" }, \
|
|
|
|
{ NFS_ATTR_FATTR_MODE, "MODE" }, \
|
|
|
|
{ NFS_ATTR_FATTR_NLINK, "NLINK" }, \
|
|
|
|
{ NFS_ATTR_FATTR_OWNER, "OWNER" }, \
|
|
|
|
{ NFS_ATTR_FATTR_GROUP, "GROUP" }, \
|
|
|
|
{ NFS_ATTR_FATTR_RDEV, "RDEV" }, \
|
|
|
|
{ NFS_ATTR_FATTR_SIZE, "SIZE" }, \
|
|
|
|
{ NFS_ATTR_FATTR_FSID, "FSID" }, \
|
|
|
|
{ NFS_ATTR_FATTR_FILEID, "FILEID" }, \
|
|
|
|
{ NFS_ATTR_FATTR_ATIME, "ATIME" }, \
|
|
|
|
{ NFS_ATTR_FATTR_MTIME, "MTIME" }, \
|
|
|
|
{ NFS_ATTR_FATTR_CTIME, "CTIME" }, \
|
|
|
|
{ NFS_ATTR_FATTR_CHANGE, "CHANGE" }, \
|
|
|
|
{ NFS_ATTR_FATTR_OWNER_NAME, "OWNER_NAME" }, \
|
|
|
|
{ NFS_ATTR_FATTR_GROUP_NAME, "GROUP_NAME" })
|
|
|
|
|
2013-08-09 15:51:26 +00:00
|
|
|
DECLARE_EVENT_CLASS(nfs4_clientid_event,
|
|
|
|
TP_PROTO(
|
|
|
|
const struct nfs_client *clp,
|
|
|
|
int error
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_ARGS(clp, error),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
2017-11-01 19:48:43 +00:00
|
|
|
__string(dstaddr, clp->cl_hostname)
|
2019-06-19 14:33:53 +00:00
|
|
|
__field(unsigned long, error)
|
2013-08-09 15:51:26 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
2020-01-06 20:25:06 +00:00
|
|
|
__entry->error = error < 0 ? -error : 0;
|
2017-11-01 19:48:43 +00:00
|
|
|
__assign_str(dstaddr, clp->cl_hostname);
|
2013-08-09 15:51:26 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk(
|
2019-06-19 14:33:53 +00:00
|
|
|
"error=%ld (%s) dstaddr=%s",
|
|
|
|
-__entry->error,
|
2021-10-22 20:17:03 +00:00
|
|
|
show_nfs4_status(__entry->error),
|
2013-08-09 15:51:26 +00:00
|
|
|
__get_str(dstaddr)
|
|
|
|
)
|
|
|
|
);
|
|
|
|
#define DEFINE_NFS4_CLIENTID_EVENT(name) \
|
|
|
|
DEFINE_EVENT(nfs4_clientid_event, name, \
|
|
|
|
TP_PROTO( \
|
|
|
|
const struct nfs_client *clp, \
|
|
|
|
int error \
|
|
|
|
), \
|
|
|
|
TP_ARGS(clp, error))
|
|
|
|
DEFINE_NFS4_CLIENTID_EVENT(nfs4_setclientid);
|
|
|
|
DEFINE_NFS4_CLIENTID_EVENT(nfs4_setclientid_confirm);
|
|
|
|
DEFINE_NFS4_CLIENTID_EVENT(nfs4_renew);
|
|
|
|
DEFINE_NFS4_CLIENTID_EVENT(nfs4_renew_async);
|
|
|
|
#ifdef CONFIG_NFS_V4_1
|
|
|
|
DEFINE_NFS4_CLIENTID_EVENT(nfs4_exchange_id);
|
|
|
|
DEFINE_NFS4_CLIENTID_EVENT(nfs4_create_session);
|
|
|
|
DEFINE_NFS4_CLIENTID_EVENT(nfs4_destroy_session);
|
|
|
|
DEFINE_NFS4_CLIENTID_EVENT(nfs4_destroy_clientid);
|
|
|
|
DEFINE_NFS4_CLIENTID_EVENT(nfs4_bind_conn_to_session);
|
|
|
|
DEFINE_NFS4_CLIENTID_EVENT(nfs4_sequence);
|
|
|
|
DEFINE_NFS4_CLIENTID_EVENT(nfs4_reclaim_complete);
|
2013-08-14 21:58:28 +00:00
|
|
|
|
|
|
|
TRACE_EVENT(nfs4_sequence_done,
|
|
|
|
TP_PROTO(
|
|
|
|
const struct nfs4_session *session,
|
|
|
|
const struct nfs4_sequence_res *res
|
|
|
|
),
|
|
|
|
TP_ARGS(session, res),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(unsigned int, session)
|
|
|
|
__field(unsigned int, slot_nr)
|
|
|
|
__field(unsigned int, seq_nr)
|
|
|
|
__field(unsigned int, highest_slotid)
|
|
|
|
__field(unsigned int, target_highest_slotid)
|
2021-10-22 20:17:03 +00:00
|
|
|
__field(unsigned long, status_flags)
|
2019-06-19 14:33:53 +00:00
|
|
|
__field(unsigned long, error)
|
2013-08-14 21:58:28 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
const struct nfs4_slot *sr_slot = res->sr_slot;
|
|
|
|
__entry->session = nfs_session_id_hash(&session->sess_id);
|
|
|
|
__entry->slot_nr = sr_slot->slot_nr;
|
|
|
|
__entry->seq_nr = sr_slot->seq_nr;
|
|
|
|
__entry->highest_slotid = res->sr_highest_slotid;
|
|
|
|
__entry->target_highest_slotid =
|
|
|
|
res->sr_target_highest_slotid;
|
2015-12-02 14:19:43 +00:00
|
|
|
__entry->status_flags = res->sr_status_flags;
|
2020-01-06 20:25:06 +00:00
|
|
|
__entry->error = res->sr_status < 0 ?
|
|
|
|
-res->sr_status : 0;
|
2013-08-14 21:58:28 +00:00
|
|
|
),
|
|
|
|
TP_printk(
|
2019-06-19 14:33:53 +00:00
|
|
|
"error=%ld (%s) session=0x%08x slot_nr=%u seq_nr=%u "
|
2013-08-14 21:58:28 +00:00
|
|
|
"highest_slotid=%u target_highest_slotid=%u "
|
2021-10-22 20:17:03 +00:00
|
|
|
"status_flags=0x%lx (%s)",
|
2019-06-19 14:33:53 +00:00
|
|
|
-__entry->error,
|
2021-10-22 20:17:03 +00:00
|
|
|
show_nfs4_status(__entry->error),
|
2013-08-14 21:58:28 +00:00
|
|
|
__entry->session,
|
|
|
|
__entry->slot_nr,
|
|
|
|
__entry->seq_nr,
|
|
|
|
__entry->highest_slotid,
|
|
|
|
__entry->target_highest_slotid,
|
|
|
|
__entry->status_flags,
|
2021-10-22 20:17:03 +00:00
|
|
|
show_nfs4_seq4_status(__entry->status_flags)
|
2013-08-14 21:58:28 +00:00
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
struct cb_sequenceargs;
|
|
|
|
struct cb_sequenceres;
|
|
|
|
|
|
|
|
TRACE_EVENT(nfs4_cb_sequence,
|
|
|
|
TP_PROTO(
|
|
|
|
const struct cb_sequenceargs *args,
|
|
|
|
const struct cb_sequenceres *res,
|
|
|
|
__be32 status
|
|
|
|
),
|
|
|
|
TP_ARGS(args, res, status),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(unsigned int, session)
|
|
|
|
__field(unsigned int, slot_nr)
|
|
|
|
__field(unsigned int, seq_nr)
|
|
|
|
__field(unsigned int, highest_slotid)
|
|
|
|
__field(unsigned int, cachethis)
|
2019-06-19 14:33:53 +00:00
|
|
|
__field(unsigned long, error)
|
2013-08-14 21:58:28 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
__entry->session = nfs_session_id_hash(&args->csa_sessionid);
|
|
|
|
__entry->slot_nr = args->csa_slotid;
|
|
|
|
__entry->seq_nr = args->csa_sequenceid;
|
|
|
|
__entry->highest_slotid = args->csa_highestslotid;
|
|
|
|
__entry->cachethis = args->csa_cachethis;
|
2019-06-19 14:33:53 +00:00
|
|
|
__entry->error = be32_to_cpu(status);
|
2013-08-14 21:58:28 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk(
|
2019-06-19 14:33:53 +00:00
|
|
|
"error=%ld (%s) session=0x%08x slot_nr=%u seq_nr=%u "
|
2013-08-14 21:58:28 +00:00
|
|
|
"highest_slotid=%u",
|
2019-06-19 14:33:53 +00:00
|
|
|
-__entry->error,
|
2021-10-22 20:17:03 +00:00
|
|
|
show_nfs4_status(__entry->error),
|
2013-08-14 21:58:28 +00:00
|
|
|
__entry->session,
|
|
|
|
__entry->slot_nr,
|
|
|
|
__entry->seq_nr,
|
|
|
|
__entry->highest_slotid
|
|
|
|
)
|
|
|
|
);
|
2019-06-19 14:33:47 +00:00
|
|
|
|
|
|
|
TRACE_EVENT(nfs4_cb_seqid_err,
|
|
|
|
TP_PROTO(
|
|
|
|
const struct cb_sequenceargs *args,
|
|
|
|
__be32 status
|
|
|
|
),
|
|
|
|
TP_ARGS(args, status),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(unsigned int, session)
|
|
|
|
__field(unsigned int, slot_nr)
|
|
|
|
__field(unsigned int, seq_nr)
|
|
|
|
__field(unsigned int, highest_slotid)
|
|
|
|
__field(unsigned int, cachethis)
|
2019-06-19 14:33:53 +00:00
|
|
|
__field(unsigned long, error)
|
2019-06-19 14:33:47 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
__entry->session = nfs_session_id_hash(&args->csa_sessionid);
|
|
|
|
__entry->slot_nr = args->csa_slotid;
|
|
|
|
__entry->seq_nr = args->csa_sequenceid;
|
|
|
|
__entry->highest_slotid = args->csa_highestslotid;
|
|
|
|
__entry->cachethis = args->csa_cachethis;
|
2019-06-19 14:33:53 +00:00
|
|
|
__entry->error = be32_to_cpu(status);
|
2019-06-19 14:33:47 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk(
|
2019-06-19 14:33:53 +00:00
|
|
|
"error=%ld (%s) session=0x%08x slot_nr=%u seq_nr=%u "
|
2019-06-19 14:33:47 +00:00
|
|
|
"highest_slotid=%u",
|
2019-06-19 14:33:53 +00:00
|
|
|
-__entry->error,
|
2021-10-22 20:17:03 +00:00
|
|
|
show_nfs4_status(__entry->error),
|
2019-06-19 14:33:47 +00:00
|
|
|
__entry->session,
|
|
|
|
__entry->slot_nr,
|
|
|
|
__entry->seq_nr,
|
|
|
|
__entry->highest_slotid
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
2013-08-09 15:51:26 +00:00
|
|
|
#endif /* CONFIG_NFS_V4_1 */
|
|
|
|
|
2017-01-11 18:37:06 +00:00
|
|
|
TRACE_EVENT(nfs4_setup_sequence,
|
|
|
|
TP_PROTO(
|
|
|
|
const struct nfs4_session *session,
|
|
|
|
const struct nfs4_sequence_args *args
|
|
|
|
),
|
|
|
|
TP_ARGS(session, args),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(unsigned int, session)
|
|
|
|
__field(unsigned int, slot_nr)
|
|
|
|
__field(unsigned int, seq_nr)
|
|
|
|
__field(unsigned int, highest_used_slotid)
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
const struct nfs4_slot *sa_slot = args->sa_slot;
|
|
|
|
__entry->session = session ? nfs_session_id_hash(&session->sess_id) : 0;
|
|
|
|
__entry->slot_nr = sa_slot->slot_nr;
|
|
|
|
__entry->seq_nr = sa_slot->seq_nr;
|
|
|
|
__entry->highest_used_slotid =
|
|
|
|
sa_slot->table->highest_used_slotid;
|
|
|
|
),
|
|
|
|
TP_printk(
|
|
|
|
"session=0x%08x slot_nr=%u seq_nr=%u "
|
|
|
|
"highest_used_slotid=%u",
|
|
|
|
__entry->session,
|
|
|
|
__entry->slot_nr,
|
|
|
|
__entry->seq_nr,
|
|
|
|
__entry->highest_used_slotid
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
2019-11-05 16:04:07 +00:00
|
|
|
TRACE_DEFINE_ENUM(NFS4CLNT_MANAGER_RUNNING);
|
|
|
|
TRACE_DEFINE_ENUM(NFS4CLNT_CHECK_LEASE);
|
|
|
|
TRACE_DEFINE_ENUM(NFS4CLNT_LEASE_EXPIRED);
|
|
|
|
TRACE_DEFINE_ENUM(NFS4CLNT_RECLAIM_REBOOT);
|
|
|
|
TRACE_DEFINE_ENUM(NFS4CLNT_RECLAIM_NOGRACE);
|
|
|
|
TRACE_DEFINE_ENUM(NFS4CLNT_DELEGRETURN);
|
|
|
|
TRACE_DEFINE_ENUM(NFS4CLNT_SESSION_RESET);
|
|
|
|
TRACE_DEFINE_ENUM(NFS4CLNT_LEASE_CONFIRM);
|
|
|
|
TRACE_DEFINE_ENUM(NFS4CLNT_SERVER_SCOPE_MISMATCH);
|
|
|
|
TRACE_DEFINE_ENUM(NFS4CLNT_PURGE_STATE);
|
|
|
|
TRACE_DEFINE_ENUM(NFS4CLNT_BIND_CONN_TO_SESSION);
|
|
|
|
TRACE_DEFINE_ENUM(NFS4CLNT_MOVED);
|
|
|
|
TRACE_DEFINE_ENUM(NFS4CLNT_LEASE_MOVED);
|
|
|
|
TRACE_DEFINE_ENUM(NFS4CLNT_DELEGATION_EXPIRED);
|
|
|
|
TRACE_DEFINE_ENUM(NFS4CLNT_RUN_MANAGER);
|
2020-02-18 20:58:31 +00:00
|
|
|
TRACE_DEFINE_ENUM(NFS4CLNT_RECALL_RUNNING);
|
|
|
|
TRACE_DEFINE_ENUM(NFS4CLNT_RECALL_ANY_LAYOUT_READ);
|
|
|
|
TRACE_DEFINE_ENUM(NFS4CLNT_RECALL_ANY_LAYOUT_RW);
|
2019-11-05 16:04:07 +00:00
|
|
|
|
|
|
|
#define show_nfs4_clp_state(state) \
|
|
|
|
__print_flags(state, "|", \
|
|
|
|
{ NFS4CLNT_MANAGER_RUNNING, "MANAGER_RUNNING" }, \
|
|
|
|
{ NFS4CLNT_CHECK_LEASE, "CHECK_LEASE" }, \
|
|
|
|
{ NFS4CLNT_LEASE_EXPIRED, "LEASE_EXPIRED" }, \
|
|
|
|
{ NFS4CLNT_RECLAIM_REBOOT, "RECLAIM_REBOOT" }, \
|
|
|
|
{ NFS4CLNT_RECLAIM_NOGRACE, "RECLAIM_NOGRACE" }, \
|
|
|
|
{ NFS4CLNT_DELEGRETURN, "DELEGRETURN" }, \
|
|
|
|
{ NFS4CLNT_SESSION_RESET, "SESSION_RESET" }, \
|
|
|
|
{ NFS4CLNT_LEASE_CONFIRM, "LEASE_CONFIRM" }, \
|
|
|
|
{ NFS4CLNT_SERVER_SCOPE_MISMATCH, \
|
|
|
|
"SERVER_SCOPE_MISMATCH" }, \
|
|
|
|
{ NFS4CLNT_PURGE_STATE, "PURGE_STATE" }, \
|
|
|
|
{ NFS4CLNT_BIND_CONN_TO_SESSION, \
|
|
|
|
"BIND_CONN_TO_SESSION" }, \
|
|
|
|
{ NFS4CLNT_MOVED, "MOVED" }, \
|
|
|
|
{ NFS4CLNT_LEASE_MOVED, "LEASE_MOVED" }, \
|
|
|
|
{ NFS4CLNT_DELEGATION_EXPIRED, "DELEGATION_EXPIRED" }, \
|
|
|
|
{ NFS4CLNT_RUN_MANAGER, "RUN_MANAGER" }, \
|
2020-02-18 20:58:31 +00:00
|
|
|
{ NFS4CLNT_RECALL_RUNNING, "RECALL_RUNNING" }, \
|
|
|
|
{ NFS4CLNT_RECALL_ANY_LAYOUT_READ, "RECALL_ANY_LAYOUT_READ" }, \
|
|
|
|
{ NFS4CLNT_RECALL_ANY_LAYOUT_RW, "RECALL_ANY_LAYOUT_RW" })
|
2019-11-05 16:04:07 +00:00
|
|
|
|
|
|
|
TRACE_EVENT(nfs4_state_mgr,
|
|
|
|
TP_PROTO(
|
|
|
|
const struct nfs_client *clp
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_ARGS(clp),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(unsigned long, state)
|
|
|
|
__string(hostname, clp->cl_hostname)
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
__entry->state = clp->cl_state;
|
2021-06-12 15:42:27 +00:00
|
|
|
__assign_str(hostname, clp->cl_hostname);
|
2019-11-05 16:04:07 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk(
|
|
|
|
"hostname=%s clp state=%s", __get_str(hostname),
|
|
|
|
show_nfs4_clp_state(__entry->state)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
TRACE_EVENT(nfs4_state_mgr_failed,
|
|
|
|
TP_PROTO(
|
|
|
|
const struct nfs_client *clp,
|
|
|
|
const char *section,
|
|
|
|
int status
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_ARGS(clp, section, status),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(unsigned long, error)
|
|
|
|
__field(unsigned long, state)
|
|
|
|
__string(hostname, clp->cl_hostname)
|
|
|
|
__string(section, section)
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
2020-01-06 20:25:06 +00:00
|
|
|
__entry->error = status < 0 ? -status : 0;
|
2019-11-05 16:04:07 +00:00
|
|
|
__entry->state = clp->cl_state;
|
|
|
|
__assign_str(hostname, clp->cl_hostname);
|
|
|
|
__assign_str(section, section);
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk(
|
|
|
|
"hostname=%s clp state=%s error=%ld (%s) section=%s",
|
|
|
|
__get_str(hostname),
|
|
|
|
show_nfs4_clp_state(__entry->state), -__entry->error,
|
2021-10-22 20:17:03 +00:00
|
|
|
show_nfs4_status(__entry->error), __get_str(section)
|
2019-11-05 16:04:07 +00:00
|
|
|
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
2021-04-01 18:38:13 +00:00
|
|
|
TRACE_EVENT(nfs4_xdr_bad_operation,
|
|
|
|
TP_PROTO(
|
|
|
|
const struct xdr_stream *xdr,
|
|
|
|
u32 op,
|
|
|
|
u32 expected
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_ARGS(xdr, op, expected),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(unsigned int, task_id)
|
|
|
|
__field(unsigned int, client_id)
|
|
|
|
__field(u32, xid)
|
|
|
|
__field(u32, op)
|
|
|
|
__field(u32, expected)
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
const struct rpc_rqst *rqstp = xdr->rqst;
|
|
|
|
const struct rpc_task *task = rqstp->rq_task;
|
|
|
|
|
|
|
|
__entry->task_id = task->tk_pid;
|
|
|
|
__entry->client_id = task->tk_client->cl_clid;
|
|
|
|
__entry->xid = be32_to_cpu(rqstp->rq_xid);
|
|
|
|
__entry->op = op;
|
|
|
|
__entry->expected = expected;
|
|
|
|
),
|
|
|
|
|
2021-10-16 22:02:24 +00:00
|
|
|
TP_printk(SUNRPC_TRACE_TASK_SPECIFIER
|
|
|
|
" xid=0x%08x operation=%u, expected=%u",
|
2021-04-01 18:38:13 +00:00
|
|
|
__entry->task_id, __entry->client_id, __entry->xid,
|
|
|
|
__entry->op, __entry->expected
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
2021-04-01 17:54:19 +00:00
|
|
|
DECLARE_EVENT_CLASS(nfs4_xdr_event,
|
2019-02-11 16:24:26 +00:00
|
|
|
TP_PROTO(
|
2019-06-19 14:34:09 +00:00
|
|
|
const struct xdr_stream *xdr,
|
2019-02-11 16:24:26 +00:00
|
|
|
u32 op,
|
2020-01-06 20:25:06 +00:00
|
|
|
u32 error
|
2019-02-11 16:24:26 +00:00
|
|
|
),
|
|
|
|
|
2019-06-19 14:34:09 +00:00
|
|
|
TP_ARGS(xdr, op, error),
|
2019-02-11 16:24:26 +00:00
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
2019-06-19 14:34:09 +00:00
|
|
|
__field(unsigned int, task_id)
|
|
|
|
__field(unsigned int, client_id)
|
|
|
|
__field(u32, xid)
|
2019-02-11 16:24:26 +00:00
|
|
|
__field(u32, op)
|
2019-06-19 14:33:53 +00:00
|
|
|
__field(unsigned long, error)
|
2019-02-11 16:24:26 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
2019-06-19 14:34:09 +00:00
|
|
|
const struct rpc_rqst *rqstp = xdr->rqst;
|
|
|
|
const struct rpc_task *task = rqstp->rq_task;
|
|
|
|
|
|
|
|
__entry->task_id = task->tk_pid;
|
|
|
|
__entry->client_id = task->tk_client->cl_clid;
|
|
|
|
__entry->xid = be32_to_cpu(rqstp->rq_xid);
|
2019-02-11 16:24:26 +00:00
|
|
|
__entry->op = op;
|
2019-06-19 14:33:53 +00:00
|
|
|
__entry->error = error;
|
2019-02-11 16:24:26 +00:00
|
|
|
),
|
|
|
|
|
2021-10-16 22:02:24 +00:00
|
|
|
TP_printk(SUNRPC_TRACE_TASK_SPECIFIER
|
|
|
|
" xid=0x%08x error=%ld (%s) operation=%u",
|
2019-06-19 14:34:09 +00:00
|
|
|
__entry->task_id, __entry->client_id, __entry->xid,
|
2021-10-22 20:17:03 +00:00
|
|
|
-__entry->error, show_nfs4_status(__entry->error),
|
2019-06-19 14:33:53 +00:00
|
|
|
__entry->op
|
2019-02-11 16:24:26 +00:00
|
|
|
)
|
|
|
|
);
|
2021-04-01 17:54:19 +00:00
|
|
|
#define DEFINE_NFS4_XDR_EVENT(name) \
|
|
|
|
DEFINE_EVENT(nfs4_xdr_event, name, \
|
|
|
|
TP_PROTO( \
|
|
|
|
const struct xdr_stream *xdr, \
|
|
|
|
u32 op, \
|
|
|
|
u32 error \
|
|
|
|
), \
|
|
|
|
TP_ARGS(xdr, op, error))
|
|
|
|
DEFINE_NFS4_XDR_EVENT(nfs4_xdr_status);
|
2021-04-01 18:03:26 +00:00
|
|
|
DEFINE_NFS4_XDR_EVENT(nfs4_xdr_bad_filehandle);
|
2019-02-11 16:24:26 +00:00
|
|
|
|
2019-12-23 15:28:38 +00:00
|
|
|
DECLARE_EVENT_CLASS(nfs4_cb_error_class,
|
|
|
|
TP_PROTO(
|
|
|
|
__be32 xid,
|
|
|
|
u32 cb_ident
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_ARGS(xid, cb_ident),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(u32, xid)
|
|
|
|
__field(u32, cbident)
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
__entry->xid = be32_to_cpu(xid);
|
|
|
|
__entry->cbident = cb_ident;
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk(
|
|
|
|
"xid=0x%08x cb_ident=0x%08x",
|
|
|
|
__entry->xid, __entry->cbident
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
#define DEFINE_CB_ERROR_EVENT(name) \
|
|
|
|
DEFINE_EVENT(nfs4_cb_error_class, nfs_cb_##name, \
|
|
|
|
TP_PROTO( \
|
|
|
|
__be32 xid, \
|
|
|
|
u32 cb_ident \
|
|
|
|
), \
|
|
|
|
TP_ARGS(xid, cb_ident))
|
|
|
|
|
|
|
|
DEFINE_CB_ERROR_EVENT(no_clp);
|
|
|
|
DEFINE_CB_ERROR_EVENT(badprinc);
|
|
|
|
|
2013-08-12 20:19:27 +00:00
|
|
|
DECLARE_EVENT_CLASS(nfs4_open_event,
|
|
|
|
TP_PROTO(
|
|
|
|
const struct nfs_open_context *ctx,
|
|
|
|
int flags,
|
|
|
|
int error
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_ARGS(ctx, flags, error),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
2019-06-19 14:33:53 +00:00
|
|
|
__field(unsigned long, error)
|
2021-10-22 20:16:56 +00:00
|
|
|
__field(unsigned long, flags)
|
|
|
|
__field(unsigned long, fmode)
|
2013-08-12 20:19:27 +00:00
|
|
|
__field(dev_t, dev)
|
|
|
|
__field(u32, fhandle)
|
|
|
|
__field(u64, fileid)
|
|
|
|
__field(u64, dir)
|
|
|
|
__string(name, ctx->dentry->d_name.name)
|
Adding stateid information to tracepoints
Operations to which stateid information is added:
close, delegreturn, open, read, setattr, layoutget, layoutcommit, test_stateid,
write, lock, locku, lockt
Format is "stateid=<seqid>:<crc32 hash stateid.other>", also "openstateid=",
"layoutstateid=", and "lockstateid=" for open_file, layoutget, set_lock
tracepoints.
New function is added to internal.h, nfs_stateid_hash(), to compute the hash
trace_nfs4_setattr() is moved from nfs4_do_setattr() to _nfs4_do_setattr()
to get access to stateid.
trace_nfs4_setattr and trace_nfs4_delegreturn are changed from INODE_EVENT
to new event type, INODE_STATEID_EVENT which is same as INODE_EVENT but adds
stateid information
for locking tracepoints, moved trace_nfs4_set_lock() into _nfs4_do_setlk()
to get access to stateid information, and removed trace_nfs4_lock_reclaim(),
trace_nfs4_lock_expired() as they call into _nfs4_do_setlk() and both were
previously same LOCK_EVENT type.
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
2015-11-24 18:29:41 +00:00
|
|
|
__field(int, stateid_seq)
|
|
|
|
__field(u32, stateid_hash)
|
|
|
|
__field(int, openstateid_seq)
|
|
|
|
__field(u32, openstateid_hash)
|
2013-08-12 20:19:27 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
const struct nfs4_state *state = ctx->state;
|
|
|
|
const struct inode *inode = NULL;
|
|
|
|
|
2019-06-19 14:33:53 +00:00
|
|
|
__entry->error = -error;
|
2013-08-12 20:19:27 +00:00
|
|
|
__entry->flags = flags;
|
2021-10-22 20:16:56 +00:00
|
|
|
__entry->fmode = (__force unsigned long)ctx->mode;
|
2013-08-12 20:19:27 +00:00
|
|
|
__entry->dev = ctx->dentry->d_sb->s_dev;
|
Adding stateid information to tracepoints
Operations to which stateid information is added:
close, delegreturn, open, read, setattr, layoutget, layoutcommit, test_stateid,
write, lock, locku, lockt
Format is "stateid=<seqid>:<crc32 hash stateid.other>", also "openstateid=",
"layoutstateid=", and "lockstateid=" for open_file, layoutget, set_lock
tracepoints.
New function is added to internal.h, nfs_stateid_hash(), to compute the hash
trace_nfs4_setattr() is moved from nfs4_do_setattr() to _nfs4_do_setattr()
to get access to stateid.
trace_nfs4_setattr and trace_nfs4_delegreturn are changed from INODE_EVENT
to new event type, INODE_STATEID_EVENT which is same as INODE_EVENT but adds
stateid information
for locking tracepoints, moved trace_nfs4_set_lock() into _nfs4_do_setlk()
to get access to stateid information, and removed trace_nfs4_lock_reclaim(),
trace_nfs4_lock_expired() as they call into _nfs4_do_setlk() and both were
previously same LOCK_EVENT type.
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
2015-11-24 18:29:41 +00:00
|
|
|
if (!IS_ERR_OR_NULL(state)) {
|
2013-08-12 20:19:27 +00:00
|
|
|
inode = state->inode;
|
Adding stateid information to tracepoints
Operations to which stateid information is added:
close, delegreturn, open, read, setattr, layoutget, layoutcommit, test_stateid,
write, lock, locku, lockt
Format is "stateid=<seqid>:<crc32 hash stateid.other>", also "openstateid=",
"layoutstateid=", and "lockstateid=" for open_file, layoutget, set_lock
tracepoints.
New function is added to internal.h, nfs_stateid_hash(), to compute the hash
trace_nfs4_setattr() is moved from nfs4_do_setattr() to _nfs4_do_setattr()
to get access to stateid.
trace_nfs4_setattr and trace_nfs4_delegreturn are changed from INODE_EVENT
to new event type, INODE_STATEID_EVENT which is same as INODE_EVENT but adds
stateid information
for locking tracepoints, moved trace_nfs4_set_lock() into _nfs4_do_setlk()
to get access to stateid information, and removed trace_nfs4_lock_reclaim(),
trace_nfs4_lock_expired() as they call into _nfs4_do_setlk() and both were
previously same LOCK_EVENT type.
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
2015-11-24 18:29:41 +00:00
|
|
|
__entry->stateid_seq =
|
|
|
|
be32_to_cpu(state->stateid.seqid);
|
|
|
|
__entry->stateid_hash =
|
|
|
|
nfs_stateid_hash(&state->stateid);
|
|
|
|
__entry->openstateid_seq =
|
|
|
|
be32_to_cpu(state->open_stateid.seqid);
|
|
|
|
__entry->openstateid_hash =
|
|
|
|
nfs_stateid_hash(&state->open_stateid);
|
|
|
|
} else {
|
|
|
|
__entry->stateid_seq = 0;
|
|
|
|
__entry->stateid_hash = 0;
|
|
|
|
__entry->openstateid_seq = 0;
|
|
|
|
__entry->openstateid_hash = 0;
|
|
|
|
}
|
2013-08-12 20:19:27 +00:00
|
|
|
if (inode != NULL) {
|
|
|
|
__entry->fileid = NFS_FILEID(inode);
|
|
|
|
__entry->fhandle = nfs_fhandle_hash(NFS_FH(inode));
|
|
|
|
} else {
|
|
|
|
__entry->fileid = 0;
|
|
|
|
__entry->fhandle = 0;
|
|
|
|
}
|
2015-03-17 22:25:59 +00:00
|
|
|
__entry->dir = NFS_FILEID(d_inode(ctx->dentry->d_parent));
|
2013-08-12 20:19:27 +00:00
|
|
|
__assign_str(name, ctx->dentry->d_name.name);
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk(
|
2021-10-22 20:16:56 +00:00
|
|
|
"error=%ld (%s) flags=%lu (%s) fmode=%s "
|
2013-08-12 20:19:27 +00:00
|
|
|
"fileid=%02x:%02x:%llu fhandle=0x%08x "
|
Adding stateid information to tracepoints
Operations to which stateid information is added:
close, delegreturn, open, read, setattr, layoutget, layoutcommit, test_stateid,
write, lock, locku, lockt
Format is "stateid=<seqid>:<crc32 hash stateid.other>", also "openstateid=",
"layoutstateid=", and "lockstateid=" for open_file, layoutget, set_lock
tracepoints.
New function is added to internal.h, nfs_stateid_hash(), to compute the hash
trace_nfs4_setattr() is moved from nfs4_do_setattr() to _nfs4_do_setattr()
to get access to stateid.
trace_nfs4_setattr and trace_nfs4_delegreturn are changed from INODE_EVENT
to new event type, INODE_STATEID_EVENT which is same as INODE_EVENT but adds
stateid information
for locking tracepoints, moved trace_nfs4_set_lock() into _nfs4_do_setlk()
to get access to stateid information, and removed trace_nfs4_lock_reclaim(),
trace_nfs4_lock_expired() as they call into _nfs4_do_setlk() and both were
previously same LOCK_EVENT type.
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
2015-11-24 18:29:41 +00:00
|
|
|
"name=%02x:%02x:%llu/%s stateid=%d:0x%08x "
|
|
|
|
"openstateid=%d:0x%08x",
|
2019-06-19 14:33:53 +00:00
|
|
|
-__entry->error,
|
2021-10-22 20:17:03 +00:00
|
|
|
show_nfs4_status(__entry->error),
|
2013-08-12 20:19:27 +00:00
|
|
|
__entry->flags,
|
2021-10-22 20:16:56 +00:00
|
|
|
show_fs_fcntl_open_flags(__entry->flags),
|
|
|
|
show_fs_fmode_flags(__entry->fmode),
|
2013-08-12 20:19:27 +00:00
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
|
|
(unsigned long long)__entry->fileid,
|
|
|
|
__entry->fhandle,
|
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
|
|
(unsigned long long)__entry->dir,
|
Adding stateid information to tracepoints
Operations to which stateid information is added:
close, delegreturn, open, read, setattr, layoutget, layoutcommit, test_stateid,
write, lock, locku, lockt
Format is "stateid=<seqid>:<crc32 hash stateid.other>", also "openstateid=",
"layoutstateid=", and "lockstateid=" for open_file, layoutget, set_lock
tracepoints.
New function is added to internal.h, nfs_stateid_hash(), to compute the hash
trace_nfs4_setattr() is moved from nfs4_do_setattr() to _nfs4_do_setattr()
to get access to stateid.
trace_nfs4_setattr and trace_nfs4_delegreturn are changed from INODE_EVENT
to new event type, INODE_STATEID_EVENT which is same as INODE_EVENT but adds
stateid information
for locking tracepoints, moved trace_nfs4_set_lock() into _nfs4_do_setlk()
to get access to stateid information, and removed trace_nfs4_lock_reclaim(),
trace_nfs4_lock_expired() as they call into _nfs4_do_setlk() and both were
previously same LOCK_EVENT type.
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
2015-11-24 18:29:41 +00:00
|
|
|
__get_str(name),
|
|
|
|
__entry->stateid_seq, __entry->stateid_hash,
|
|
|
|
__entry->openstateid_seq, __entry->openstateid_hash
|
2013-08-12 20:19:27 +00:00
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
#define DEFINE_NFS4_OPEN_EVENT(name) \
|
|
|
|
DEFINE_EVENT(nfs4_open_event, name, \
|
|
|
|
TP_PROTO( \
|
|
|
|
const struct nfs_open_context *ctx, \
|
|
|
|
int flags, \
|
|
|
|
int error \
|
|
|
|
), \
|
|
|
|
TP_ARGS(ctx, flags, error))
|
|
|
|
DEFINE_NFS4_OPEN_EVENT(nfs4_open_reclaim);
|
|
|
|
DEFINE_NFS4_OPEN_EVENT(nfs4_open_expired);
|
|
|
|
DEFINE_NFS4_OPEN_EVENT(nfs4_open_file);
|
|
|
|
|
2015-11-24 18:29:42 +00:00
|
|
|
TRACE_EVENT(nfs4_cached_open,
|
|
|
|
TP_PROTO(
|
|
|
|
const struct nfs4_state *state
|
|
|
|
),
|
|
|
|
TP_ARGS(state),
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(dev_t, dev)
|
|
|
|
__field(u32, fhandle)
|
|
|
|
__field(u64, fileid)
|
|
|
|
__field(unsigned int, fmode)
|
|
|
|
__field(int, stateid_seq)
|
|
|
|
__field(u32, stateid_hash)
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
const struct inode *inode = state->inode;
|
|
|
|
|
|
|
|
__entry->dev = inode->i_sb->s_dev;
|
|
|
|
__entry->fileid = NFS_FILEID(inode);
|
|
|
|
__entry->fhandle = nfs_fhandle_hash(NFS_FH(inode));
|
|
|
|
__entry->fmode = (__force unsigned int)state->state;
|
|
|
|
__entry->stateid_seq =
|
|
|
|
be32_to_cpu(state->stateid.seqid);
|
|
|
|
__entry->stateid_hash =
|
|
|
|
nfs_stateid_hash(&state->stateid);
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk(
|
|
|
|
"fmode=%s fileid=%02x:%02x:%llu "
|
|
|
|
"fhandle=0x%08x stateid=%d:0x%08x",
|
2021-10-22 20:16:56 +00:00
|
|
|
__entry->fmode ? show_fs_fmode_flags(__entry->fmode) :
|
2015-11-24 18:29:42 +00:00
|
|
|
"closed",
|
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
|
|
(unsigned long long)__entry->fileid,
|
|
|
|
__entry->fhandle,
|
|
|
|
__entry->stateid_seq, __entry->stateid_hash
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
2013-08-12 20:19:27 +00:00
|
|
|
TRACE_EVENT(nfs4_close,
|
|
|
|
TP_PROTO(
|
|
|
|
const struct nfs4_state *state,
|
|
|
|
const struct nfs_closeargs *args,
|
|
|
|
const struct nfs_closeres *res,
|
|
|
|
int error
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_ARGS(state, args, res, error),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(dev_t, dev)
|
|
|
|
__field(u32, fhandle)
|
|
|
|
__field(u64, fileid)
|
|
|
|
__field(unsigned int, fmode)
|
2019-06-19 14:33:53 +00:00
|
|
|
__field(unsigned long, error)
|
Adding stateid information to tracepoints
Operations to which stateid information is added:
close, delegreturn, open, read, setattr, layoutget, layoutcommit, test_stateid,
write, lock, locku, lockt
Format is "stateid=<seqid>:<crc32 hash stateid.other>", also "openstateid=",
"layoutstateid=", and "lockstateid=" for open_file, layoutget, set_lock
tracepoints.
New function is added to internal.h, nfs_stateid_hash(), to compute the hash
trace_nfs4_setattr() is moved from nfs4_do_setattr() to _nfs4_do_setattr()
to get access to stateid.
trace_nfs4_setattr and trace_nfs4_delegreturn are changed from INODE_EVENT
to new event type, INODE_STATEID_EVENT which is same as INODE_EVENT but adds
stateid information
for locking tracepoints, moved trace_nfs4_set_lock() into _nfs4_do_setlk()
to get access to stateid information, and removed trace_nfs4_lock_reclaim(),
trace_nfs4_lock_expired() as they call into _nfs4_do_setlk() and both were
previously same LOCK_EVENT type.
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
2015-11-24 18:29:41 +00:00
|
|
|
__field(int, stateid_seq)
|
|
|
|
__field(u32, stateid_hash)
|
2013-08-12 20:19:27 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
const struct inode *inode = state->inode;
|
|
|
|
|
|
|
|
__entry->dev = inode->i_sb->s_dev;
|
|
|
|
__entry->fileid = NFS_FILEID(inode);
|
|
|
|
__entry->fhandle = nfs_fhandle_hash(NFS_FH(inode));
|
|
|
|
__entry->fmode = (__force unsigned int)state->state;
|
2020-01-06 20:25:06 +00:00
|
|
|
__entry->error = error < 0 ? -error : 0;
|
Adding stateid information to tracepoints
Operations to which stateid information is added:
close, delegreturn, open, read, setattr, layoutget, layoutcommit, test_stateid,
write, lock, locku, lockt
Format is "stateid=<seqid>:<crc32 hash stateid.other>", also "openstateid=",
"layoutstateid=", and "lockstateid=" for open_file, layoutget, set_lock
tracepoints.
New function is added to internal.h, nfs_stateid_hash(), to compute the hash
trace_nfs4_setattr() is moved from nfs4_do_setattr() to _nfs4_do_setattr()
to get access to stateid.
trace_nfs4_setattr and trace_nfs4_delegreturn are changed from INODE_EVENT
to new event type, INODE_STATEID_EVENT which is same as INODE_EVENT but adds
stateid information
for locking tracepoints, moved trace_nfs4_set_lock() into _nfs4_do_setlk()
to get access to stateid information, and removed trace_nfs4_lock_reclaim(),
trace_nfs4_lock_expired() as they call into _nfs4_do_setlk() and both were
previously same LOCK_EVENT type.
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
2015-11-24 18:29:41 +00:00
|
|
|
__entry->stateid_seq =
|
|
|
|
be32_to_cpu(args->stateid.seqid);
|
|
|
|
__entry->stateid_hash =
|
|
|
|
nfs_stateid_hash(&args->stateid);
|
2013-08-12 20:19:27 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk(
|
2019-06-19 14:33:53 +00:00
|
|
|
"error=%ld (%s) fmode=%s fileid=%02x:%02x:%llu "
|
Adding stateid information to tracepoints
Operations to which stateid information is added:
close, delegreturn, open, read, setattr, layoutget, layoutcommit, test_stateid,
write, lock, locku, lockt
Format is "stateid=<seqid>:<crc32 hash stateid.other>", also "openstateid=",
"layoutstateid=", and "lockstateid=" for open_file, layoutget, set_lock
tracepoints.
New function is added to internal.h, nfs_stateid_hash(), to compute the hash
trace_nfs4_setattr() is moved from nfs4_do_setattr() to _nfs4_do_setattr()
to get access to stateid.
trace_nfs4_setattr and trace_nfs4_delegreturn are changed from INODE_EVENT
to new event type, INODE_STATEID_EVENT which is same as INODE_EVENT but adds
stateid information
for locking tracepoints, moved trace_nfs4_set_lock() into _nfs4_do_setlk()
to get access to stateid information, and removed trace_nfs4_lock_reclaim(),
trace_nfs4_lock_expired() as they call into _nfs4_do_setlk() and both were
previously same LOCK_EVENT type.
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
2015-11-24 18:29:41 +00:00
|
|
|
"fhandle=0x%08x openstateid=%d:0x%08x",
|
2019-06-19 14:33:53 +00:00
|
|
|
-__entry->error,
|
2021-10-22 20:17:03 +00:00
|
|
|
show_nfs4_status(__entry->error),
|
2021-10-22 20:16:56 +00:00
|
|
|
__entry->fmode ? show_fs_fmode_flags(__entry->fmode) :
|
2013-08-12 20:19:27 +00:00
|
|
|
"closed",
|
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
|
|
(unsigned long long)__entry->fileid,
|
Adding stateid information to tracepoints
Operations to which stateid information is added:
close, delegreturn, open, read, setattr, layoutget, layoutcommit, test_stateid,
write, lock, locku, lockt
Format is "stateid=<seqid>:<crc32 hash stateid.other>", also "openstateid=",
"layoutstateid=", and "lockstateid=" for open_file, layoutget, set_lock
tracepoints.
New function is added to internal.h, nfs_stateid_hash(), to compute the hash
trace_nfs4_setattr() is moved from nfs4_do_setattr() to _nfs4_do_setattr()
to get access to stateid.
trace_nfs4_setattr and trace_nfs4_delegreturn are changed from INODE_EVENT
to new event type, INODE_STATEID_EVENT which is same as INODE_EVENT but adds
stateid information
for locking tracepoints, moved trace_nfs4_set_lock() into _nfs4_do_setlk()
to get access to stateid information, and removed trace_nfs4_lock_reclaim(),
trace_nfs4_lock_expired() as they call into _nfs4_do_setlk() and both were
previously same LOCK_EVENT type.
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
2015-11-24 18:29:41 +00:00
|
|
|
__entry->fhandle,
|
|
|
|
__entry->stateid_seq, __entry->stateid_hash
|
2013-08-12 20:19:27 +00:00
|
|
|
)
|
|
|
|
);
|
|
|
|
|
2013-08-12 20:35:20 +00:00
|
|
|
DECLARE_EVENT_CLASS(nfs4_lock_event,
|
|
|
|
TP_PROTO(
|
|
|
|
const struct file_lock *request,
|
|
|
|
const struct nfs4_state *state,
|
|
|
|
int cmd,
|
|
|
|
int error
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_ARGS(request, state, cmd, error),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
2019-06-19 14:33:53 +00:00
|
|
|
__field(unsigned long, error)
|
2021-10-22 20:16:56 +00:00
|
|
|
__field(unsigned long, cmd)
|
|
|
|
__field(unsigned long, type)
|
2013-08-12 20:35:20 +00:00
|
|
|
__field(loff_t, start)
|
|
|
|
__field(loff_t, end)
|
|
|
|
__field(dev_t, dev)
|
|
|
|
__field(u32, fhandle)
|
|
|
|
__field(u64, fileid)
|
Adding stateid information to tracepoints
Operations to which stateid information is added:
close, delegreturn, open, read, setattr, layoutget, layoutcommit, test_stateid,
write, lock, locku, lockt
Format is "stateid=<seqid>:<crc32 hash stateid.other>", also "openstateid=",
"layoutstateid=", and "lockstateid=" for open_file, layoutget, set_lock
tracepoints.
New function is added to internal.h, nfs_stateid_hash(), to compute the hash
trace_nfs4_setattr() is moved from nfs4_do_setattr() to _nfs4_do_setattr()
to get access to stateid.
trace_nfs4_setattr and trace_nfs4_delegreturn are changed from INODE_EVENT
to new event type, INODE_STATEID_EVENT which is same as INODE_EVENT but adds
stateid information
for locking tracepoints, moved trace_nfs4_set_lock() into _nfs4_do_setlk()
to get access to stateid information, and removed trace_nfs4_lock_reclaim(),
trace_nfs4_lock_expired() as they call into _nfs4_do_setlk() and both were
previously same LOCK_EVENT type.
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
2015-11-24 18:29:41 +00:00
|
|
|
__field(int, stateid_seq)
|
|
|
|
__field(u32, stateid_hash)
|
2013-08-12 20:35:20 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
const struct inode *inode = state->inode;
|
|
|
|
|
2020-01-06 20:25:06 +00:00
|
|
|
__entry->error = error < 0 ? -error : 0;
|
2013-08-12 20:35:20 +00:00
|
|
|
__entry->cmd = cmd;
|
|
|
|
__entry->type = request->fl_type;
|
|
|
|
__entry->start = request->fl_start;
|
|
|
|
__entry->end = request->fl_end;
|
|
|
|
__entry->dev = inode->i_sb->s_dev;
|
|
|
|
__entry->fileid = NFS_FILEID(inode);
|
|
|
|
__entry->fhandle = nfs_fhandle_hash(NFS_FH(inode));
|
Adding stateid information to tracepoints
Operations to which stateid information is added:
close, delegreturn, open, read, setattr, layoutget, layoutcommit, test_stateid,
write, lock, locku, lockt
Format is "stateid=<seqid>:<crc32 hash stateid.other>", also "openstateid=",
"layoutstateid=", and "lockstateid=" for open_file, layoutget, set_lock
tracepoints.
New function is added to internal.h, nfs_stateid_hash(), to compute the hash
trace_nfs4_setattr() is moved from nfs4_do_setattr() to _nfs4_do_setattr()
to get access to stateid.
trace_nfs4_setattr and trace_nfs4_delegreturn are changed from INODE_EVENT
to new event type, INODE_STATEID_EVENT which is same as INODE_EVENT but adds
stateid information
for locking tracepoints, moved trace_nfs4_set_lock() into _nfs4_do_setlk()
to get access to stateid information, and removed trace_nfs4_lock_reclaim(),
trace_nfs4_lock_expired() as they call into _nfs4_do_setlk() and both were
previously same LOCK_EVENT type.
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
2015-11-24 18:29:41 +00:00
|
|
|
__entry->stateid_seq =
|
|
|
|
be32_to_cpu(state->stateid.seqid);
|
|
|
|
__entry->stateid_hash =
|
|
|
|
nfs_stateid_hash(&state->stateid);
|
2013-08-12 20:35:20 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk(
|
2019-06-19 14:33:53 +00:00
|
|
|
"error=%ld (%s) cmd=%s:%s range=%lld:%lld "
|
Adding stateid information to tracepoints
Operations to which stateid information is added:
close, delegreturn, open, read, setattr, layoutget, layoutcommit, test_stateid,
write, lock, locku, lockt
Format is "stateid=<seqid>:<crc32 hash stateid.other>", also "openstateid=",
"layoutstateid=", and "lockstateid=" for open_file, layoutget, set_lock
tracepoints.
New function is added to internal.h, nfs_stateid_hash(), to compute the hash
trace_nfs4_setattr() is moved from nfs4_do_setattr() to _nfs4_do_setattr()
to get access to stateid.
trace_nfs4_setattr and trace_nfs4_delegreturn are changed from INODE_EVENT
to new event type, INODE_STATEID_EVENT which is same as INODE_EVENT but adds
stateid information
for locking tracepoints, moved trace_nfs4_set_lock() into _nfs4_do_setlk()
to get access to stateid information, and removed trace_nfs4_lock_reclaim(),
trace_nfs4_lock_expired() as they call into _nfs4_do_setlk() and both were
previously same LOCK_EVENT type.
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
2015-11-24 18:29:41 +00:00
|
|
|
"fileid=%02x:%02x:%llu fhandle=0x%08x "
|
|
|
|
"stateid=%d:0x%08x",
|
2019-06-19 14:33:53 +00:00
|
|
|
-__entry->error,
|
2021-10-22 20:17:03 +00:00
|
|
|
show_nfs4_status(__entry->error),
|
2021-10-22 20:16:56 +00:00
|
|
|
show_fs_fcntl_cmd(__entry->cmd),
|
|
|
|
show_fs_fcntl_lock_type(__entry->type),
|
2013-08-12 20:35:20 +00:00
|
|
|
(long long)__entry->start,
|
|
|
|
(long long)__entry->end,
|
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
|
|
(unsigned long long)__entry->fileid,
|
Adding stateid information to tracepoints
Operations to which stateid information is added:
close, delegreturn, open, read, setattr, layoutget, layoutcommit, test_stateid,
write, lock, locku, lockt
Format is "stateid=<seqid>:<crc32 hash stateid.other>", also "openstateid=",
"layoutstateid=", and "lockstateid=" for open_file, layoutget, set_lock
tracepoints.
New function is added to internal.h, nfs_stateid_hash(), to compute the hash
trace_nfs4_setattr() is moved from nfs4_do_setattr() to _nfs4_do_setattr()
to get access to stateid.
trace_nfs4_setattr and trace_nfs4_delegreturn are changed from INODE_EVENT
to new event type, INODE_STATEID_EVENT which is same as INODE_EVENT but adds
stateid information
for locking tracepoints, moved trace_nfs4_set_lock() into _nfs4_do_setlk()
to get access to stateid information, and removed trace_nfs4_lock_reclaim(),
trace_nfs4_lock_expired() as they call into _nfs4_do_setlk() and both were
previously same LOCK_EVENT type.
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
2015-11-24 18:29:41 +00:00
|
|
|
__entry->fhandle,
|
|
|
|
__entry->stateid_seq, __entry->stateid_hash
|
2013-08-12 20:35:20 +00:00
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
#define DEFINE_NFS4_LOCK_EVENT(name) \
|
|
|
|
DEFINE_EVENT(nfs4_lock_event, name, \
|
|
|
|
TP_PROTO( \
|
|
|
|
const struct file_lock *request, \
|
|
|
|
const struct nfs4_state *state, \
|
|
|
|
int cmd, \
|
|
|
|
int error \
|
|
|
|
), \
|
|
|
|
TP_ARGS(request, state, cmd, error))
|
|
|
|
DEFINE_NFS4_LOCK_EVENT(nfs4_get_lock);
|
|
|
|
DEFINE_NFS4_LOCK_EVENT(nfs4_unlock);
|
|
|
|
|
Adding stateid information to tracepoints
Operations to which stateid information is added:
close, delegreturn, open, read, setattr, layoutget, layoutcommit, test_stateid,
write, lock, locku, lockt
Format is "stateid=<seqid>:<crc32 hash stateid.other>", also "openstateid=",
"layoutstateid=", and "lockstateid=" for open_file, layoutget, set_lock
tracepoints.
New function is added to internal.h, nfs_stateid_hash(), to compute the hash
trace_nfs4_setattr() is moved from nfs4_do_setattr() to _nfs4_do_setattr()
to get access to stateid.
trace_nfs4_setattr and trace_nfs4_delegreturn are changed from INODE_EVENT
to new event type, INODE_STATEID_EVENT which is same as INODE_EVENT but adds
stateid information
for locking tracepoints, moved trace_nfs4_set_lock() into _nfs4_do_setlk()
to get access to stateid information, and removed trace_nfs4_lock_reclaim(),
trace_nfs4_lock_expired() as they call into _nfs4_do_setlk() and both were
previously same LOCK_EVENT type.
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
2015-11-24 18:29:41 +00:00
|
|
|
TRACE_EVENT(nfs4_set_lock,
|
|
|
|
TP_PROTO(
|
|
|
|
const struct file_lock *request,
|
|
|
|
const struct nfs4_state *state,
|
|
|
|
const nfs4_stateid *lockstateid,
|
|
|
|
int cmd,
|
|
|
|
int error
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_ARGS(request, state, lockstateid, cmd, error),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
2019-06-19 14:33:53 +00:00
|
|
|
__field(unsigned long, error)
|
2021-10-22 20:16:56 +00:00
|
|
|
__field(unsigned long, cmd)
|
|
|
|
__field(unsigned long, type)
|
Adding stateid information to tracepoints
Operations to which stateid information is added:
close, delegreturn, open, read, setattr, layoutget, layoutcommit, test_stateid,
write, lock, locku, lockt
Format is "stateid=<seqid>:<crc32 hash stateid.other>", also "openstateid=",
"layoutstateid=", and "lockstateid=" for open_file, layoutget, set_lock
tracepoints.
New function is added to internal.h, nfs_stateid_hash(), to compute the hash
trace_nfs4_setattr() is moved from nfs4_do_setattr() to _nfs4_do_setattr()
to get access to stateid.
trace_nfs4_setattr and trace_nfs4_delegreturn are changed from INODE_EVENT
to new event type, INODE_STATEID_EVENT which is same as INODE_EVENT but adds
stateid information
for locking tracepoints, moved trace_nfs4_set_lock() into _nfs4_do_setlk()
to get access to stateid information, and removed trace_nfs4_lock_reclaim(),
trace_nfs4_lock_expired() as they call into _nfs4_do_setlk() and both were
previously same LOCK_EVENT type.
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
2015-11-24 18:29:41 +00:00
|
|
|
__field(loff_t, start)
|
|
|
|
__field(loff_t, end)
|
|
|
|
__field(dev_t, dev)
|
|
|
|
__field(u32, fhandle)
|
|
|
|
__field(u64, fileid)
|
|
|
|
__field(int, stateid_seq)
|
|
|
|
__field(u32, stateid_hash)
|
|
|
|
__field(int, lockstateid_seq)
|
|
|
|
__field(u32, lockstateid_hash)
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
const struct inode *inode = state->inode;
|
|
|
|
|
2020-01-06 20:25:06 +00:00
|
|
|
__entry->error = error < 0 ? -error : 0;
|
Adding stateid information to tracepoints
Operations to which stateid information is added:
close, delegreturn, open, read, setattr, layoutget, layoutcommit, test_stateid,
write, lock, locku, lockt
Format is "stateid=<seqid>:<crc32 hash stateid.other>", also "openstateid=",
"layoutstateid=", and "lockstateid=" for open_file, layoutget, set_lock
tracepoints.
New function is added to internal.h, nfs_stateid_hash(), to compute the hash
trace_nfs4_setattr() is moved from nfs4_do_setattr() to _nfs4_do_setattr()
to get access to stateid.
trace_nfs4_setattr and trace_nfs4_delegreturn are changed from INODE_EVENT
to new event type, INODE_STATEID_EVENT which is same as INODE_EVENT but adds
stateid information
for locking tracepoints, moved trace_nfs4_set_lock() into _nfs4_do_setlk()
to get access to stateid information, and removed trace_nfs4_lock_reclaim(),
trace_nfs4_lock_expired() as they call into _nfs4_do_setlk() and both were
previously same LOCK_EVENT type.
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
2015-11-24 18:29:41 +00:00
|
|
|
__entry->cmd = cmd;
|
|
|
|
__entry->type = request->fl_type;
|
|
|
|
__entry->start = request->fl_start;
|
|
|
|
__entry->end = request->fl_end;
|
|
|
|
__entry->dev = inode->i_sb->s_dev;
|
|
|
|
__entry->fileid = NFS_FILEID(inode);
|
|
|
|
__entry->fhandle = nfs_fhandle_hash(NFS_FH(inode));
|
|
|
|
__entry->stateid_seq =
|
|
|
|
be32_to_cpu(state->stateid.seqid);
|
|
|
|
__entry->stateid_hash =
|
|
|
|
nfs_stateid_hash(&state->stateid);
|
|
|
|
__entry->lockstateid_seq =
|
|
|
|
be32_to_cpu(lockstateid->seqid);
|
|
|
|
__entry->lockstateid_hash =
|
|
|
|
nfs_stateid_hash(lockstateid);
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk(
|
2019-06-19 14:33:53 +00:00
|
|
|
"error=%ld (%s) cmd=%s:%s range=%lld:%lld "
|
Adding stateid information to tracepoints
Operations to which stateid information is added:
close, delegreturn, open, read, setattr, layoutget, layoutcommit, test_stateid,
write, lock, locku, lockt
Format is "stateid=<seqid>:<crc32 hash stateid.other>", also "openstateid=",
"layoutstateid=", and "lockstateid=" for open_file, layoutget, set_lock
tracepoints.
New function is added to internal.h, nfs_stateid_hash(), to compute the hash
trace_nfs4_setattr() is moved from nfs4_do_setattr() to _nfs4_do_setattr()
to get access to stateid.
trace_nfs4_setattr and trace_nfs4_delegreturn are changed from INODE_EVENT
to new event type, INODE_STATEID_EVENT which is same as INODE_EVENT but adds
stateid information
for locking tracepoints, moved trace_nfs4_set_lock() into _nfs4_do_setlk()
to get access to stateid information, and removed trace_nfs4_lock_reclaim(),
trace_nfs4_lock_expired() as they call into _nfs4_do_setlk() and both were
previously same LOCK_EVENT type.
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
2015-11-24 18:29:41 +00:00
|
|
|
"fileid=%02x:%02x:%llu fhandle=0x%08x "
|
|
|
|
"stateid=%d:0x%08x lockstateid=%d:0x%08x",
|
2019-06-19 14:33:53 +00:00
|
|
|
-__entry->error,
|
2021-10-22 20:17:03 +00:00
|
|
|
show_nfs4_status(__entry->error),
|
2021-10-22 20:16:56 +00:00
|
|
|
show_fs_fcntl_cmd(__entry->cmd),
|
|
|
|
show_fs_fcntl_lock_type(__entry->type),
|
Adding stateid information to tracepoints
Operations to which stateid information is added:
close, delegreturn, open, read, setattr, layoutget, layoutcommit, test_stateid,
write, lock, locku, lockt
Format is "stateid=<seqid>:<crc32 hash stateid.other>", also "openstateid=",
"layoutstateid=", and "lockstateid=" for open_file, layoutget, set_lock
tracepoints.
New function is added to internal.h, nfs_stateid_hash(), to compute the hash
trace_nfs4_setattr() is moved from nfs4_do_setattr() to _nfs4_do_setattr()
to get access to stateid.
trace_nfs4_setattr and trace_nfs4_delegreturn are changed from INODE_EVENT
to new event type, INODE_STATEID_EVENT which is same as INODE_EVENT but adds
stateid information
for locking tracepoints, moved trace_nfs4_set_lock() into _nfs4_do_setlk()
to get access to stateid information, and removed trace_nfs4_lock_reclaim(),
trace_nfs4_lock_expired() as they call into _nfs4_do_setlk() and both were
previously same LOCK_EVENT type.
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
2015-11-24 18:29:41 +00:00
|
|
|
(long long)__entry->start,
|
|
|
|
(long long)__entry->end,
|
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
|
|
(unsigned long long)__entry->fileid,
|
|
|
|
__entry->fhandle,
|
|
|
|
__entry->stateid_seq, __entry->stateid_hash,
|
|
|
|
__entry->lockstateid_seq, __entry->lockstateid_hash
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
2019-11-05 16:04:13 +00:00
|
|
|
TRACE_DEFINE_ENUM(LK_STATE_IN_USE);
|
|
|
|
TRACE_DEFINE_ENUM(NFS_DELEGATED_STATE);
|
|
|
|
TRACE_DEFINE_ENUM(NFS_OPEN_STATE);
|
|
|
|
TRACE_DEFINE_ENUM(NFS_O_RDONLY_STATE);
|
|
|
|
TRACE_DEFINE_ENUM(NFS_O_WRONLY_STATE);
|
|
|
|
TRACE_DEFINE_ENUM(NFS_O_RDWR_STATE);
|
|
|
|
TRACE_DEFINE_ENUM(NFS_STATE_RECLAIM_REBOOT);
|
|
|
|
TRACE_DEFINE_ENUM(NFS_STATE_RECLAIM_NOGRACE);
|
|
|
|
TRACE_DEFINE_ENUM(NFS_STATE_POSIX_LOCKS);
|
|
|
|
TRACE_DEFINE_ENUM(NFS_STATE_RECOVERY_FAILED);
|
|
|
|
TRACE_DEFINE_ENUM(NFS_STATE_MAY_NOTIFY_LOCK);
|
|
|
|
TRACE_DEFINE_ENUM(NFS_STATE_CHANGE_WAIT);
|
|
|
|
TRACE_DEFINE_ENUM(NFS_CLNT_DST_SSC_COPY_STATE);
|
|
|
|
TRACE_DEFINE_ENUM(NFS_CLNT_SRC_SSC_COPY_STATE);
|
|
|
|
TRACE_DEFINE_ENUM(NFS_SRV_SSC_COPY_STATE);
|
|
|
|
|
|
|
|
#define show_nfs4_state_flags(flags) \
|
|
|
|
__print_flags(flags, "|", \
|
|
|
|
{ LK_STATE_IN_USE, "IN_USE" }, \
|
|
|
|
{ NFS_DELEGATED_STATE, "DELEGATED" }, \
|
|
|
|
{ NFS_OPEN_STATE, "OPEN" }, \
|
|
|
|
{ NFS_O_RDONLY_STATE, "O_RDONLY" }, \
|
|
|
|
{ NFS_O_WRONLY_STATE, "O_WRONLY" }, \
|
|
|
|
{ NFS_O_RDWR_STATE, "O_RDWR" }, \
|
|
|
|
{ NFS_STATE_RECLAIM_REBOOT, "RECLAIM_REBOOT" }, \
|
|
|
|
{ NFS_STATE_RECLAIM_NOGRACE, "RECLAIM_NOGRACE" }, \
|
|
|
|
{ NFS_STATE_POSIX_LOCKS, "POSIX_LOCKS" }, \
|
|
|
|
{ NFS_STATE_RECOVERY_FAILED, "RECOVERY_FAILED" }, \
|
|
|
|
{ NFS_STATE_MAY_NOTIFY_LOCK, "MAY_NOTIFY_LOCK" }, \
|
|
|
|
{ NFS_STATE_CHANGE_WAIT, "CHANGE_WAIT" }, \
|
|
|
|
{ NFS_CLNT_DST_SSC_COPY_STATE, "CLNT_DST_SSC_COPY" }, \
|
|
|
|
{ NFS_CLNT_SRC_SSC_COPY_STATE, "CLNT_SRC_SSC_COPY" }, \
|
|
|
|
{ NFS_SRV_SSC_COPY_STATE, "SRV_SSC_COPY" })
|
|
|
|
|
|
|
|
#define show_nfs4_lock_flags(flags) \
|
|
|
|
__print_flags(flags, "|", \
|
|
|
|
{ BIT(NFS_LOCK_INITIALIZED), "INITIALIZED" }, \
|
|
|
|
{ BIT(NFS_LOCK_LOST), "LOST" })
|
|
|
|
|
|
|
|
TRACE_EVENT(nfs4_state_lock_reclaim,
|
|
|
|
TP_PROTO(
|
|
|
|
const struct nfs4_state *state,
|
|
|
|
const struct nfs4_lock_state *lock
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_ARGS(state, lock),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(dev_t, dev)
|
|
|
|
__field(u32, fhandle)
|
|
|
|
__field(u64, fileid)
|
|
|
|
__field(unsigned long, state_flags)
|
|
|
|
__field(unsigned long, lock_flags)
|
|
|
|
__field(int, stateid_seq)
|
|
|
|
__field(u32, stateid_hash)
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
const struct inode *inode = state->inode;
|
|
|
|
|
|
|
|
__entry->dev = inode->i_sb->s_dev;
|
|
|
|
__entry->fileid = NFS_FILEID(inode);
|
|
|
|
__entry->fhandle = nfs_fhandle_hash(NFS_FH(inode));
|
|
|
|
__entry->state_flags = state->flags;
|
|
|
|
__entry->lock_flags = lock->ls_flags;
|
|
|
|
__entry->stateid_seq =
|
|
|
|
be32_to_cpu(state->stateid.seqid);
|
|
|
|
__entry->stateid_hash =
|
|
|
|
nfs_stateid_hash(&state->stateid);
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk(
|
|
|
|
"fileid=%02x:%02x:%llu fhandle=0x%08x "
|
|
|
|
"stateid=%d:0x%08x state_flags=%s lock_flags=%s",
|
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
|
|
(unsigned long long)__entry->fileid, __entry->fhandle,
|
|
|
|
__entry->stateid_seq, __entry->stateid_hash,
|
|
|
|
show_nfs4_state_flags(__entry->state_flags),
|
|
|
|
show_nfs4_lock_flags(__entry->lock_flags)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
2013-08-13 14:36:56 +00:00
|
|
|
DECLARE_EVENT_CLASS(nfs4_set_delegation_event,
|
|
|
|
TP_PROTO(
|
|
|
|
const struct inode *inode,
|
|
|
|
fmode_t fmode
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_ARGS(inode, fmode),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(dev_t, dev)
|
|
|
|
__field(u32, fhandle)
|
|
|
|
__field(u64, fileid)
|
|
|
|
__field(unsigned int, fmode)
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
__entry->dev = inode->i_sb->s_dev;
|
|
|
|
__entry->fileid = NFS_FILEID(inode);
|
|
|
|
__entry->fhandle = nfs_fhandle_hash(NFS_FH(inode));
|
|
|
|
__entry->fmode = (__force unsigned int)fmode;
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk(
|
|
|
|
"fmode=%s fileid=%02x:%02x:%llu fhandle=0x%08x",
|
2021-10-22 20:16:56 +00:00
|
|
|
show_fs_fmode_flags(__entry->fmode),
|
2013-08-13 14:36:56 +00:00
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
|
|
(unsigned long long)__entry->fileid,
|
|
|
|
__entry->fhandle
|
|
|
|
)
|
|
|
|
);
|
|
|
|
#define DEFINE_NFS4_SET_DELEGATION_EVENT(name) \
|
|
|
|
DEFINE_EVENT(nfs4_set_delegation_event, name, \
|
|
|
|
TP_PROTO( \
|
|
|
|
const struct inode *inode, \
|
|
|
|
fmode_t fmode \
|
|
|
|
), \
|
|
|
|
TP_ARGS(inode, fmode))
|
|
|
|
DEFINE_NFS4_SET_DELEGATION_EVENT(nfs4_set_delegation);
|
|
|
|
DEFINE_NFS4_SET_DELEGATION_EVENT(nfs4_reclaim_delegation);
|
|
|
|
|
|
|
|
TRACE_EVENT(nfs4_delegreturn_exit,
|
|
|
|
TP_PROTO(
|
|
|
|
const struct nfs4_delegreturnargs *args,
|
|
|
|
const struct nfs4_delegreturnres *res,
|
|
|
|
int error
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_ARGS(args, res, error),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(dev_t, dev)
|
|
|
|
__field(u32, fhandle)
|
2019-06-19 14:33:53 +00:00
|
|
|
__field(unsigned long, error)
|
Adding stateid information to tracepoints
Operations to which stateid information is added:
close, delegreturn, open, read, setattr, layoutget, layoutcommit, test_stateid,
write, lock, locku, lockt
Format is "stateid=<seqid>:<crc32 hash stateid.other>", also "openstateid=",
"layoutstateid=", and "lockstateid=" for open_file, layoutget, set_lock
tracepoints.
New function is added to internal.h, nfs_stateid_hash(), to compute the hash
trace_nfs4_setattr() is moved from nfs4_do_setattr() to _nfs4_do_setattr()
to get access to stateid.
trace_nfs4_setattr and trace_nfs4_delegreturn are changed from INODE_EVENT
to new event type, INODE_STATEID_EVENT which is same as INODE_EVENT but adds
stateid information
for locking tracepoints, moved trace_nfs4_set_lock() into _nfs4_do_setlk()
to get access to stateid information, and removed trace_nfs4_lock_reclaim(),
trace_nfs4_lock_expired() as they call into _nfs4_do_setlk() and both were
previously same LOCK_EVENT type.
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
2015-11-24 18:29:41 +00:00
|
|
|
__field(int, stateid_seq)
|
|
|
|
__field(u32, stateid_hash)
|
2013-08-13 14:36:56 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
__entry->dev = res->server->s_dev;
|
|
|
|
__entry->fhandle = nfs_fhandle_hash(args->fhandle);
|
2020-01-06 20:25:06 +00:00
|
|
|
__entry->error = error < 0 ? -error : 0;
|
Adding stateid information to tracepoints
Operations to which stateid information is added:
close, delegreturn, open, read, setattr, layoutget, layoutcommit, test_stateid,
write, lock, locku, lockt
Format is "stateid=<seqid>:<crc32 hash stateid.other>", also "openstateid=",
"layoutstateid=", and "lockstateid=" for open_file, layoutget, set_lock
tracepoints.
New function is added to internal.h, nfs_stateid_hash(), to compute the hash
trace_nfs4_setattr() is moved from nfs4_do_setattr() to _nfs4_do_setattr()
to get access to stateid.
trace_nfs4_setattr and trace_nfs4_delegreturn are changed from INODE_EVENT
to new event type, INODE_STATEID_EVENT which is same as INODE_EVENT but adds
stateid information
for locking tracepoints, moved trace_nfs4_set_lock() into _nfs4_do_setlk()
to get access to stateid information, and removed trace_nfs4_lock_reclaim(),
trace_nfs4_lock_expired() as they call into _nfs4_do_setlk() and both were
previously same LOCK_EVENT type.
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
2015-11-24 18:29:41 +00:00
|
|
|
__entry->stateid_seq =
|
|
|
|
be32_to_cpu(args->stateid->seqid);
|
|
|
|
__entry->stateid_hash =
|
|
|
|
nfs_stateid_hash(args->stateid);
|
2013-08-13 14:36:56 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk(
|
2019-06-19 14:33:53 +00:00
|
|
|
"error=%ld (%s) dev=%02x:%02x fhandle=0x%08x "
|
Adding stateid information to tracepoints
Operations to which stateid information is added:
close, delegreturn, open, read, setattr, layoutget, layoutcommit, test_stateid,
write, lock, locku, lockt
Format is "stateid=<seqid>:<crc32 hash stateid.other>", also "openstateid=",
"layoutstateid=", and "lockstateid=" for open_file, layoutget, set_lock
tracepoints.
New function is added to internal.h, nfs_stateid_hash(), to compute the hash
trace_nfs4_setattr() is moved from nfs4_do_setattr() to _nfs4_do_setattr()
to get access to stateid.
trace_nfs4_setattr and trace_nfs4_delegreturn are changed from INODE_EVENT
to new event type, INODE_STATEID_EVENT which is same as INODE_EVENT but adds
stateid information
for locking tracepoints, moved trace_nfs4_set_lock() into _nfs4_do_setlk()
to get access to stateid information, and removed trace_nfs4_lock_reclaim(),
trace_nfs4_lock_expired() as they call into _nfs4_do_setlk() and both were
previously same LOCK_EVENT type.
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
2015-11-24 18:29:41 +00:00
|
|
|
"stateid=%d:0x%08x",
|
2019-06-19 14:33:53 +00:00
|
|
|
-__entry->error,
|
2021-10-22 20:17:03 +00:00
|
|
|
show_nfs4_status(__entry->error),
|
2013-08-13 14:36:56 +00:00
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
Adding stateid information to tracepoints
Operations to which stateid information is added:
close, delegreturn, open, read, setattr, layoutget, layoutcommit, test_stateid,
write, lock, locku, lockt
Format is "stateid=<seqid>:<crc32 hash stateid.other>", also "openstateid=",
"layoutstateid=", and "lockstateid=" for open_file, layoutget, set_lock
tracepoints.
New function is added to internal.h, nfs_stateid_hash(), to compute the hash
trace_nfs4_setattr() is moved from nfs4_do_setattr() to _nfs4_do_setattr()
to get access to stateid.
trace_nfs4_setattr and trace_nfs4_delegreturn are changed from INODE_EVENT
to new event type, INODE_STATEID_EVENT which is same as INODE_EVENT but adds
stateid information
for locking tracepoints, moved trace_nfs4_set_lock() into _nfs4_do_setlk()
to get access to stateid information, and removed trace_nfs4_lock_reclaim(),
trace_nfs4_lock_expired() as they call into _nfs4_do_setlk() and both were
previously same LOCK_EVENT type.
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
2015-11-24 18:29:41 +00:00
|
|
|
__entry->fhandle,
|
|
|
|
__entry->stateid_seq, __entry->stateid_hash
|
2013-08-13 14:36:56 +00:00
|
|
|
)
|
|
|
|
);
|
|
|
|
|
2013-08-21 01:59:40 +00:00
|
|
|
#ifdef CONFIG_NFS_V4_1
|
|
|
|
DECLARE_EVENT_CLASS(nfs4_test_stateid_event,
|
|
|
|
TP_PROTO(
|
|
|
|
const struct nfs4_state *state,
|
|
|
|
const struct nfs4_lock_state *lsp,
|
|
|
|
int error
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_ARGS(state, lsp, error),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
2019-06-19 14:33:53 +00:00
|
|
|
__field(unsigned long, error)
|
2013-08-21 01:59:40 +00:00
|
|
|
__field(dev_t, dev)
|
|
|
|
__field(u32, fhandle)
|
|
|
|
__field(u64, fileid)
|
Adding stateid information to tracepoints
Operations to which stateid information is added:
close, delegreturn, open, read, setattr, layoutget, layoutcommit, test_stateid,
write, lock, locku, lockt
Format is "stateid=<seqid>:<crc32 hash stateid.other>", also "openstateid=",
"layoutstateid=", and "lockstateid=" for open_file, layoutget, set_lock
tracepoints.
New function is added to internal.h, nfs_stateid_hash(), to compute the hash
trace_nfs4_setattr() is moved from nfs4_do_setattr() to _nfs4_do_setattr()
to get access to stateid.
trace_nfs4_setattr and trace_nfs4_delegreturn are changed from INODE_EVENT
to new event type, INODE_STATEID_EVENT which is same as INODE_EVENT but adds
stateid information
for locking tracepoints, moved trace_nfs4_set_lock() into _nfs4_do_setlk()
to get access to stateid information, and removed trace_nfs4_lock_reclaim(),
trace_nfs4_lock_expired() as they call into _nfs4_do_setlk() and both were
previously same LOCK_EVENT type.
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
2015-11-24 18:29:41 +00:00
|
|
|
__field(int, stateid_seq)
|
|
|
|
__field(u32, stateid_hash)
|
2013-08-21 01:59:40 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
const struct inode *inode = state->inode;
|
|
|
|
|
2020-01-06 20:25:06 +00:00
|
|
|
__entry->error = error < 0 ? -error : 0;
|
2013-08-21 01:59:40 +00:00
|
|
|
__entry->dev = inode->i_sb->s_dev;
|
|
|
|
__entry->fileid = NFS_FILEID(inode);
|
|
|
|
__entry->fhandle = nfs_fhandle_hash(NFS_FH(inode));
|
Adding stateid information to tracepoints
Operations to which stateid information is added:
close, delegreturn, open, read, setattr, layoutget, layoutcommit, test_stateid,
write, lock, locku, lockt
Format is "stateid=<seqid>:<crc32 hash stateid.other>", also "openstateid=",
"layoutstateid=", and "lockstateid=" for open_file, layoutget, set_lock
tracepoints.
New function is added to internal.h, nfs_stateid_hash(), to compute the hash
trace_nfs4_setattr() is moved from nfs4_do_setattr() to _nfs4_do_setattr()
to get access to stateid.
trace_nfs4_setattr and trace_nfs4_delegreturn are changed from INODE_EVENT
to new event type, INODE_STATEID_EVENT which is same as INODE_EVENT but adds
stateid information
for locking tracepoints, moved trace_nfs4_set_lock() into _nfs4_do_setlk()
to get access to stateid information, and removed trace_nfs4_lock_reclaim(),
trace_nfs4_lock_expired() as they call into _nfs4_do_setlk() and both were
previously same LOCK_EVENT type.
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
2015-11-24 18:29:41 +00:00
|
|
|
__entry->stateid_seq =
|
|
|
|
be32_to_cpu(state->stateid.seqid);
|
|
|
|
__entry->stateid_hash =
|
|
|
|
nfs_stateid_hash(&state->stateid);
|
2013-08-21 01:59:40 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk(
|
2019-06-19 14:33:53 +00:00
|
|
|
"error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x "
|
Adding stateid information to tracepoints
Operations to which stateid information is added:
close, delegreturn, open, read, setattr, layoutget, layoutcommit, test_stateid,
write, lock, locku, lockt
Format is "stateid=<seqid>:<crc32 hash stateid.other>", also "openstateid=",
"layoutstateid=", and "lockstateid=" for open_file, layoutget, set_lock
tracepoints.
New function is added to internal.h, nfs_stateid_hash(), to compute the hash
trace_nfs4_setattr() is moved from nfs4_do_setattr() to _nfs4_do_setattr()
to get access to stateid.
trace_nfs4_setattr and trace_nfs4_delegreturn are changed from INODE_EVENT
to new event type, INODE_STATEID_EVENT which is same as INODE_EVENT but adds
stateid information
for locking tracepoints, moved trace_nfs4_set_lock() into _nfs4_do_setlk()
to get access to stateid information, and removed trace_nfs4_lock_reclaim(),
trace_nfs4_lock_expired() as they call into _nfs4_do_setlk() and both were
previously same LOCK_EVENT type.
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
2015-11-24 18:29:41 +00:00
|
|
|
"stateid=%d:0x%08x",
|
2019-06-19 14:33:53 +00:00
|
|
|
-__entry->error,
|
2021-10-22 20:17:03 +00:00
|
|
|
show_nfs4_status(__entry->error),
|
2013-08-21 01:59:40 +00:00
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
|
|
(unsigned long long)__entry->fileid,
|
Adding stateid information to tracepoints
Operations to which stateid information is added:
close, delegreturn, open, read, setattr, layoutget, layoutcommit, test_stateid,
write, lock, locku, lockt
Format is "stateid=<seqid>:<crc32 hash stateid.other>", also "openstateid=",
"layoutstateid=", and "lockstateid=" for open_file, layoutget, set_lock
tracepoints.
New function is added to internal.h, nfs_stateid_hash(), to compute the hash
trace_nfs4_setattr() is moved from nfs4_do_setattr() to _nfs4_do_setattr()
to get access to stateid.
trace_nfs4_setattr and trace_nfs4_delegreturn are changed from INODE_EVENT
to new event type, INODE_STATEID_EVENT which is same as INODE_EVENT but adds
stateid information
for locking tracepoints, moved trace_nfs4_set_lock() into _nfs4_do_setlk()
to get access to stateid information, and removed trace_nfs4_lock_reclaim(),
trace_nfs4_lock_expired() as they call into _nfs4_do_setlk() and both were
previously same LOCK_EVENT type.
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
2015-11-24 18:29:41 +00:00
|
|
|
__entry->fhandle,
|
|
|
|
__entry->stateid_seq, __entry->stateid_hash
|
2013-08-21 01:59:40 +00:00
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
#define DEFINE_NFS4_TEST_STATEID_EVENT(name) \
|
|
|
|
DEFINE_EVENT(nfs4_test_stateid_event, name, \
|
|
|
|
TP_PROTO( \
|
|
|
|
const struct nfs4_state *state, \
|
|
|
|
const struct nfs4_lock_state *lsp, \
|
|
|
|
int error \
|
|
|
|
), \
|
|
|
|
TP_ARGS(state, lsp, error))
|
|
|
|
DEFINE_NFS4_TEST_STATEID_EVENT(nfs4_test_delegation_stateid);
|
|
|
|
DEFINE_NFS4_TEST_STATEID_EVENT(nfs4_test_open_stateid);
|
|
|
|
DEFINE_NFS4_TEST_STATEID_EVENT(nfs4_test_lock_stateid);
|
|
|
|
#endif /* CONFIG_NFS_V4_1 */
|
|
|
|
|
2013-08-12 20:45:55 +00:00
|
|
|
DECLARE_EVENT_CLASS(nfs4_lookup_event,
|
|
|
|
TP_PROTO(
|
|
|
|
const struct inode *dir,
|
|
|
|
const struct qstr *name,
|
|
|
|
int error
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_ARGS(dir, name, error),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(dev_t, dev)
|
2019-06-19 14:33:53 +00:00
|
|
|
__field(unsigned long, error)
|
2013-08-12 20:45:55 +00:00
|
|
|
__field(u64, dir)
|
|
|
|
__string(name, name->name)
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
__entry->dev = dir->i_sb->s_dev;
|
|
|
|
__entry->dir = NFS_FILEID(dir);
|
2019-06-19 14:33:53 +00:00
|
|
|
__entry->error = -error;
|
2013-08-12 20:45:55 +00:00
|
|
|
__assign_str(name, name->name);
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk(
|
2019-06-19 14:33:53 +00:00
|
|
|
"error=%ld (%s) name=%02x:%02x:%llu/%s",
|
|
|
|
-__entry->error,
|
2021-10-22 20:17:03 +00:00
|
|
|
show_nfs4_status(__entry->error),
|
2013-08-12 20:45:55 +00:00
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
|
|
(unsigned long long)__entry->dir,
|
|
|
|
__get_str(name)
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
#define DEFINE_NFS4_LOOKUP_EVENT(name) \
|
|
|
|
DEFINE_EVENT(nfs4_lookup_event, name, \
|
|
|
|
TP_PROTO( \
|
|
|
|
const struct inode *dir, \
|
|
|
|
const struct qstr *name, \
|
|
|
|
int error \
|
|
|
|
), \
|
|
|
|
TP_ARGS(dir, name, error))
|
|
|
|
|
|
|
|
DEFINE_NFS4_LOOKUP_EVENT(nfs4_lookup);
|
|
|
|
DEFINE_NFS4_LOOKUP_EVENT(nfs4_symlink);
|
|
|
|
DEFINE_NFS4_LOOKUP_EVENT(nfs4_mkdir);
|
|
|
|
DEFINE_NFS4_LOOKUP_EVENT(nfs4_mknod);
|
|
|
|
DEFINE_NFS4_LOOKUP_EVENT(nfs4_remove);
|
|
|
|
DEFINE_NFS4_LOOKUP_EVENT(nfs4_get_fs_locations);
|
|
|
|
DEFINE_NFS4_LOOKUP_EVENT(nfs4_secinfo);
|
|
|
|
|
2017-06-29 13:34:52 +00:00
|
|
|
TRACE_EVENT(nfs4_lookupp,
|
|
|
|
TP_PROTO(
|
|
|
|
const struct inode *inode,
|
|
|
|
int error
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_ARGS(inode, error),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(dev_t, dev)
|
|
|
|
__field(u64, ino)
|
2019-06-19 14:33:53 +00:00
|
|
|
__field(unsigned long, error)
|
2017-06-29 13:34:52 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
__entry->dev = inode->i_sb->s_dev;
|
|
|
|
__entry->ino = NFS_FILEID(inode);
|
2020-01-06 20:25:06 +00:00
|
|
|
__entry->error = error < 0 ? -error : 0;
|
2017-06-29 13:34:52 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk(
|
2019-06-19 14:33:53 +00:00
|
|
|
"error=%ld (%s) inode=%02x:%02x:%llu",
|
|
|
|
-__entry->error,
|
2021-10-22 20:17:03 +00:00
|
|
|
show_nfs4_status(__entry->error),
|
2017-06-29 13:34:52 +00:00
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
|
|
(unsigned long long)__entry->ino
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
2013-08-12 21:08:26 +00:00
|
|
|
TRACE_EVENT(nfs4_rename,
|
|
|
|
TP_PROTO(
|
|
|
|
const struct inode *olddir,
|
|
|
|
const struct qstr *oldname,
|
|
|
|
const struct inode *newdir,
|
|
|
|
const struct qstr *newname,
|
|
|
|
int error
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_ARGS(olddir, oldname, newdir, newname, error),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(dev_t, dev)
|
2019-06-19 14:33:53 +00:00
|
|
|
__field(unsigned long, error)
|
2013-08-12 21:08:26 +00:00
|
|
|
__field(u64, olddir)
|
|
|
|
__string(oldname, oldname->name)
|
|
|
|
__field(u64, newdir)
|
|
|
|
__string(newname, newname->name)
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
__entry->dev = olddir->i_sb->s_dev;
|
|
|
|
__entry->olddir = NFS_FILEID(olddir);
|
|
|
|
__entry->newdir = NFS_FILEID(newdir);
|
2020-01-06 20:25:06 +00:00
|
|
|
__entry->error = error < 0 ? -error : 0;
|
2013-08-12 21:08:26 +00:00
|
|
|
__assign_str(oldname, oldname->name);
|
|
|
|
__assign_str(newname, newname->name);
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk(
|
2019-06-19 14:33:53 +00:00
|
|
|
"error=%ld (%s) oldname=%02x:%02x:%llu/%s "
|
2013-08-12 21:08:26 +00:00
|
|
|
"newname=%02x:%02x:%llu/%s",
|
2019-06-19 14:33:53 +00:00
|
|
|
-__entry->error,
|
2021-10-22 20:17:03 +00:00
|
|
|
show_nfs4_status(__entry->error),
|
2013-08-12 21:08:26 +00:00
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
|
|
(unsigned long long)__entry->olddir,
|
|
|
|
__get_str(oldname),
|
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
|
|
(unsigned long long)__entry->newdir,
|
|
|
|
__get_str(newname)
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
2013-08-12 20:58:42 +00:00
|
|
|
DECLARE_EVENT_CLASS(nfs4_inode_event,
|
|
|
|
TP_PROTO(
|
|
|
|
const struct inode *inode,
|
|
|
|
int error
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_ARGS(inode, error),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(dev_t, dev)
|
|
|
|
__field(u32, fhandle)
|
|
|
|
__field(u64, fileid)
|
2019-06-19 14:33:53 +00:00
|
|
|
__field(unsigned long, error)
|
2013-08-12 20:58:42 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
__entry->dev = inode->i_sb->s_dev;
|
|
|
|
__entry->fileid = NFS_FILEID(inode);
|
|
|
|
__entry->fhandle = nfs_fhandle_hash(NFS_FH(inode));
|
2019-06-19 14:33:53 +00:00
|
|
|
__entry->error = error < 0 ? -error : 0;
|
2013-08-12 20:58:42 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk(
|
2019-06-19 14:33:53 +00:00
|
|
|
"error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x",
|
|
|
|
-__entry->error,
|
2021-10-22 20:17:03 +00:00
|
|
|
show_nfs4_status(__entry->error),
|
2013-08-12 20:58:42 +00:00
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
|
|
(unsigned long long)__entry->fileid,
|
|
|
|
__entry->fhandle
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
#define DEFINE_NFS4_INODE_EVENT(name) \
|
|
|
|
DEFINE_EVENT(nfs4_inode_event, name, \
|
|
|
|
TP_PROTO( \
|
|
|
|
const struct inode *inode, \
|
|
|
|
int error \
|
|
|
|
), \
|
|
|
|
TP_ARGS(inode, error))
|
|
|
|
|
|
|
|
DEFINE_NFS4_INODE_EVENT(nfs4_access);
|
|
|
|
DEFINE_NFS4_INODE_EVENT(nfs4_readlink);
|
|
|
|
DEFINE_NFS4_INODE_EVENT(nfs4_readdir);
|
|
|
|
DEFINE_NFS4_INODE_EVENT(nfs4_get_acl);
|
|
|
|
DEFINE_NFS4_INODE_EVENT(nfs4_set_acl);
|
|
|
|
#ifdef CONFIG_NFS_V4_SECURITY_LABEL
|
|
|
|
DEFINE_NFS4_INODE_EVENT(nfs4_get_security_label);
|
|
|
|
DEFINE_NFS4_INODE_EVENT(nfs4_set_security_label);
|
|
|
|
#endif /* CONFIG_NFS_V4_SECURITY_LABEL */
|
Adding stateid information to tracepoints
Operations to which stateid information is added:
close, delegreturn, open, read, setattr, layoutget, layoutcommit, test_stateid,
write, lock, locku, lockt
Format is "stateid=<seqid>:<crc32 hash stateid.other>", also "openstateid=",
"layoutstateid=", and "lockstateid=" for open_file, layoutget, set_lock
tracepoints.
New function is added to internal.h, nfs_stateid_hash(), to compute the hash
trace_nfs4_setattr() is moved from nfs4_do_setattr() to _nfs4_do_setattr()
to get access to stateid.
trace_nfs4_setattr and trace_nfs4_delegreturn are changed from INODE_EVENT
to new event type, INODE_STATEID_EVENT which is same as INODE_EVENT but adds
stateid information
for locking tracepoints, moved trace_nfs4_set_lock() into _nfs4_do_setlk()
to get access to stateid information, and removed trace_nfs4_lock_reclaim(),
trace_nfs4_lock_expired() as they call into _nfs4_do_setlk() and both were
previously same LOCK_EVENT type.
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
2015-11-24 18:29:41 +00:00
|
|
|
|
|
|
|
DECLARE_EVENT_CLASS(nfs4_inode_stateid_event,
|
|
|
|
TP_PROTO(
|
|
|
|
const struct inode *inode,
|
|
|
|
const nfs4_stateid *stateid,
|
|
|
|
int error
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_ARGS(inode, stateid, error),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(dev_t, dev)
|
|
|
|
__field(u32, fhandle)
|
|
|
|
__field(u64, fileid)
|
2019-06-19 14:33:53 +00:00
|
|
|
__field(unsigned long, error)
|
Adding stateid information to tracepoints
Operations to which stateid information is added:
close, delegreturn, open, read, setattr, layoutget, layoutcommit, test_stateid,
write, lock, locku, lockt
Format is "stateid=<seqid>:<crc32 hash stateid.other>", also "openstateid=",
"layoutstateid=", and "lockstateid=" for open_file, layoutget, set_lock
tracepoints.
New function is added to internal.h, nfs_stateid_hash(), to compute the hash
trace_nfs4_setattr() is moved from nfs4_do_setattr() to _nfs4_do_setattr()
to get access to stateid.
trace_nfs4_setattr and trace_nfs4_delegreturn are changed from INODE_EVENT
to new event type, INODE_STATEID_EVENT which is same as INODE_EVENT but adds
stateid information
for locking tracepoints, moved trace_nfs4_set_lock() into _nfs4_do_setlk()
to get access to stateid information, and removed trace_nfs4_lock_reclaim(),
trace_nfs4_lock_expired() as they call into _nfs4_do_setlk() and both were
previously same LOCK_EVENT type.
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
2015-11-24 18:29:41 +00:00
|
|
|
__field(int, stateid_seq)
|
|
|
|
__field(u32, stateid_hash)
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
__entry->dev = inode->i_sb->s_dev;
|
|
|
|
__entry->fileid = NFS_FILEID(inode);
|
|
|
|
__entry->fhandle = nfs_fhandle_hash(NFS_FH(inode));
|
2020-01-06 20:25:06 +00:00
|
|
|
__entry->error = error < 0 ? -error : 0;
|
Adding stateid information to tracepoints
Operations to which stateid information is added:
close, delegreturn, open, read, setattr, layoutget, layoutcommit, test_stateid,
write, lock, locku, lockt
Format is "stateid=<seqid>:<crc32 hash stateid.other>", also "openstateid=",
"layoutstateid=", and "lockstateid=" for open_file, layoutget, set_lock
tracepoints.
New function is added to internal.h, nfs_stateid_hash(), to compute the hash
trace_nfs4_setattr() is moved from nfs4_do_setattr() to _nfs4_do_setattr()
to get access to stateid.
trace_nfs4_setattr and trace_nfs4_delegreturn are changed from INODE_EVENT
to new event type, INODE_STATEID_EVENT which is same as INODE_EVENT but adds
stateid information
for locking tracepoints, moved trace_nfs4_set_lock() into _nfs4_do_setlk()
to get access to stateid information, and removed trace_nfs4_lock_reclaim(),
trace_nfs4_lock_expired() as they call into _nfs4_do_setlk() and both were
previously same LOCK_EVENT type.
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
2015-11-24 18:29:41 +00:00
|
|
|
__entry->stateid_seq =
|
|
|
|
be32_to_cpu(stateid->seqid);
|
|
|
|
__entry->stateid_hash =
|
|
|
|
nfs_stateid_hash(stateid);
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk(
|
2019-06-19 14:33:53 +00:00
|
|
|
"error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x "
|
Adding stateid information to tracepoints
Operations to which stateid information is added:
close, delegreturn, open, read, setattr, layoutget, layoutcommit, test_stateid,
write, lock, locku, lockt
Format is "stateid=<seqid>:<crc32 hash stateid.other>", also "openstateid=",
"layoutstateid=", and "lockstateid=" for open_file, layoutget, set_lock
tracepoints.
New function is added to internal.h, nfs_stateid_hash(), to compute the hash
trace_nfs4_setattr() is moved from nfs4_do_setattr() to _nfs4_do_setattr()
to get access to stateid.
trace_nfs4_setattr and trace_nfs4_delegreturn are changed from INODE_EVENT
to new event type, INODE_STATEID_EVENT which is same as INODE_EVENT but adds
stateid information
for locking tracepoints, moved trace_nfs4_set_lock() into _nfs4_do_setlk()
to get access to stateid information, and removed trace_nfs4_lock_reclaim(),
trace_nfs4_lock_expired() as they call into _nfs4_do_setlk() and both were
previously same LOCK_EVENT type.
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
2015-11-24 18:29:41 +00:00
|
|
|
"stateid=%d:0x%08x",
|
2019-06-19 14:33:53 +00:00
|
|
|
-__entry->error,
|
2021-10-22 20:17:03 +00:00
|
|
|
show_nfs4_status(__entry->error),
|
Adding stateid information to tracepoints
Operations to which stateid information is added:
close, delegreturn, open, read, setattr, layoutget, layoutcommit, test_stateid,
write, lock, locku, lockt
Format is "stateid=<seqid>:<crc32 hash stateid.other>", also "openstateid=",
"layoutstateid=", and "lockstateid=" for open_file, layoutget, set_lock
tracepoints.
New function is added to internal.h, nfs_stateid_hash(), to compute the hash
trace_nfs4_setattr() is moved from nfs4_do_setattr() to _nfs4_do_setattr()
to get access to stateid.
trace_nfs4_setattr and trace_nfs4_delegreturn are changed from INODE_EVENT
to new event type, INODE_STATEID_EVENT which is same as INODE_EVENT but adds
stateid information
for locking tracepoints, moved trace_nfs4_set_lock() into _nfs4_do_setlk()
to get access to stateid information, and removed trace_nfs4_lock_reclaim(),
trace_nfs4_lock_expired() as they call into _nfs4_do_setlk() and both were
previously same LOCK_EVENT type.
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
2015-11-24 18:29:41 +00:00
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
|
|
(unsigned long long)__entry->fileid,
|
|
|
|
__entry->fhandle,
|
|
|
|
__entry->stateid_seq, __entry->stateid_hash
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
#define DEFINE_NFS4_INODE_STATEID_EVENT(name) \
|
|
|
|
DEFINE_EVENT(nfs4_inode_stateid_event, name, \
|
|
|
|
TP_PROTO( \
|
|
|
|
const struct inode *inode, \
|
|
|
|
const nfs4_stateid *stateid, \
|
|
|
|
int error \
|
|
|
|
), \
|
|
|
|
TP_ARGS(inode, stateid, error))
|
|
|
|
|
|
|
|
DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_setattr);
|
|
|
|
DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_delegreturn);
|
2017-11-06 20:28:02 +00:00
|
|
|
DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_open_stateid_update);
|
|
|
|
DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_open_stateid_update_wait);
|
2020-09-25 19:48:39 +00:00
|
|
|
DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_close_stateid_update_wait);
|
2013-08-12 20:58:42 +00:00
|
|
|
|
2013-08-13 17:01:39 +00:00
|
|
|
DECLARE_EVENT_CLASS(nfs4_getattr_event,
|
|
|
|
TP_PROTO(
|
|
|
|
const struct nfs_server *server,
|
|
|
|
const struct nfs_fh *fhandle,
|
|
|
|
const struct nfs_fattr *fattr,
|
|
|
|
int error
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_ARGS(server, fhandle, fattr, error),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(dev_t, dev)
|
|
|
|
__field(u32, fhandle)
|
|
|
|
__field(u64, fileid)
|
|
|
|
__field(unsigned int, valid)
|
2019-06-19 14:33:53 +00:00
|
|
|
__field(unsigned long, error)
|
2013-08-13 17:01:39 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
__entry->dev = server->s_dev;
|
|
|
|
__entry->valid = fattr->valid;
|
|
|
|
__entry->fhandle = nfs_fhandle_hash(fhandle);
|
|
|
|
__entry->fileid = (fattr->valid & NFS_ATTR_FATTR_FILEID) ? fattr->fileid : 0;
|
2020-01-06 20:25:06 +00:00
|
|
|
__entry->error = error < 0 ? -error : 0;
|
2013-08-13 17:01:39 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk(
|
2019-06-19 14:33:53 +00:00
|
|
|
"error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x "
|
2013-08-13 17:01:39 +00:00
|
|
|
"valid=%s",
|
2019-06-19 14:33:53 +00:00
|
|
|
-__entry->error,
|
2021-10-22 20:17:03 +00:00
|
|
|
show_nfs4_status(__entry->error),
|
2013-08-13 17:01:39 +00:00
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
|
|
(unsigned long long)__entry->fileid,
|
|
|
|
__entry->fhandle,
|
|
|
|
show_nfs_fattr_flags(__entry->valid)
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
#define DEFINE_NFS4_GETATTR_EVENT(name) \
|
|
|
|
DEFINE_EVENT(nfs4_getattr_event, name, \
|
|
|
|
TP_PROTO( \
|
|
|
|
const struct nfs_server *server, \
|
|
|
|
const struct nfs_fh *fhandle, \
|
|
|
|
const struct nfs_fattr *fattr, \
|
|
|
|
int error \
|
|
|
|
), \
|
|
|
|
TP_ARGS(server, fhandle, fattr, error))
|
|
|
|
DEFINE_NFS4_GETATTR_EVENT(nfs4_getattr);
|
|
|
|
DEFINE_NFS4_GETATTR_EVENT(nfs4_lookup_root);
|
|
|
|
DEFINE_NFS4_GETATTR_EVENT(nfs4_fsinfo);
|
|
|
|
|
2015-08-21 01:07:54 +00:00
|
|
|
DECLARE_EVENT_CLASS(nfs4_inode_callback_event,
|
|
|
|
TP_PROTO(
|
|
|
|
const struct nfs_client *clp,
|
|
|
|
const struct nfs_fh *fhandle,
|
|
|
|
const struct inode *inode,
|
|
|
|
int error
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_ARGS(clp, fhandle, inode, error),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
2019-06-19 14:33:53 +00:00
|
|
|
__field(unsigned long, error)
|
2015-08-21 01:07:54 +00:00
|
|
|
__field(dev_t, dev)
|
|
|
|
__field(u32, fhandle)
|
|
|
|
__field(u64, fileid)
|
2017-11-01 19:48:43 +00:00
|
|
|
__string(dstaddr, clp ? clp->cl_hostname : "unknown")
|
2015-08-21 01:07:54 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
2020-01-06 20:25:06 +00:00
|
|
|
__entry->error = error < 0 ? -error : 0;
|
2015-08-21 01:07:54 +00:00
|
|
|
__entry->fhandle = nfs_fhandle_hash(fhandle);
|
2018-09-05 18:07:13 +00:00
|
|
|
if (!IS_ERR_OR_NULL(inode)) {
|
2015-08-21 01:07:54 +00:00
|
|
|
__entry->fileid = NFS_FILEID(inode);
|
|
|
|
__entry->dev = inode->i_sb->s_dev;
|
|
|
|
} else {
|
|
|
|
__entry->fileid = 0;
|
|
|
|
__entry->dev = 0;
|
|
|
|
}
|
2021-06-12 15:42:27 +00:00
|
|
|
__assign_str(dstaddr, clp ? clp->cl_hostname : "unknown");
|
2015-08-21 01:07:54 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk(
|
2019-06-19 14:33:53 +00:00
|
|
|
"error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x "
|
2015-08-21 01:07:54 +00:00
|
|
|
"dstaddr=%s",
|
2019-06-19 14:33:53 +00:00
|
|
|
-__entry->error,
|
2021-10-22 20:17:03 +00:00
|
|
|
show_nfs4_status(__entry->error),
|
2015-08-21 01:07:54 +00:00
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
|
|
(unsigned long long)__entry->fileid,
|
|
|
|
__entry->fhandle,
|
|
|
|
__get_str(dstaddr)
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
#define DEFINE_NFS4_INODE_CALLBACK_EVENT(name) \
|
|
|
|
DEFINE_EVENT(nfs4_inode_callback_event, name, \
|
|
|
|
TP_PROTO( \
|
|
|
|
const struct nfs_client *clp, \
|
|
|
|
const struct nfs_fh *fhandle, \
|
|
|
|
const struct inode *inode, \
|
|
|
|
int error \
|
|
|
|
), \
|
|
|
|
TP_ARGS(clp, fhandle, inode, error))
|
|
|
|
DEFINE_NFS4_INODE_CALLBACK_EVENT(nfs4_cb_getattr);
|
|
|
|
|
2015-12-28 19:07:23 +00:00
|
|
|
DECLARE_EVENT_CLASS(nfs4_inode_stateid_callback_event,
|
|
|
|
TP_PROTO(
|
|
|
|
const struct nfs_client *clp,
|
|
|
|
const struct nfs_fh *fhandle,
|
|
|
|
const struct inode *inode,
|
|
|
|
const nfs4_stateid *stateid,
|
|
|
|
int error
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_ARGS(clp, fhandle, inode, stateid, error),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
2019-06-19 14:33:53 +00:00
|
|
|
__field(unsigned long, error)
|
2015-12-28 19:07:23 +00:00
|
|
|
__field(dev_t, dev)
|
|
|
|
__field(u32, fhandle)
|
|
|
|
__field(u64, fileid)
|
2017-11-01 19:48:43 +00:00
|
|
|
__string(dstaddr, clp ? clp->cl_hostname : "unknown")
|
2015-12-28 19:07:23 +00:00
|
|
|
__field(int, stateid_seq)
|
|
|
|
__field(u32, stateid_hash)
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
2020-01-06 20:25:06 +00:00
|
|
|
__entry->error = error < 0 ? -error : 0;
|
2015-12-28 19:07:23 +00:00
|
|
|
__entry->fhandle = nfs_fhandle_hash(fhandle);
|
2018-08-23 15:02:49 +00:00
|
|
|
if (!IS_ERR_OR_NULL(inode)) {
|
2015-12-28 19:07:23 +00:00
|
|
|
__entry->fileid = NFS_FILEID(inode);
|
|
|
|
__entry->dev = inode->i_sb->s_dev;
|
|
|
|
} else {
|
|
|
|
__entry->fileid = 0;
|
|
|
|
__entry->dev = 0;
|
|
|
|
}
|
2021-06-12 15:42:27 +00:00
|
|
|
__assign_str(dstaddr, clp ? clp->cl_hostname : "unknown");
|
2015-12-28 19:07:23 +00:00
|
|
|
__entry->stateid_seq =
|
|
|
|
be32_to_cpu(stateid->seqid);
|
|
|
|
__entry->stateid_hash =
|
|
|
|
nfs_stateid_hash(stateid);
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk(
|
2019-06-19 14:33:53 +00:00
|
|
|
"error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x "
|
2015-12-28 19:07:23 +00:00
|
|
|
"stateid=%d:0x%08x dstaddr=%s",
|
2019-06-19 14:33:53 +00:00
|
|
|
-__entry->error,
|
2021-10-22 20:17:03 +00:00
|
|
|
show_nfs4_status(__entry->error),
|
2015-12-28 19:07:23 +00:00
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
|
|
(unsigned long long)__entry->fileid,
|
|
|
|
__entry->fhandle,
|
|
|
|
__entry->stateid_seq, __entry->stateid_hash,
|
|
|
|
__get_str(dstaddr)
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
#define DEFINE_NFS4_INODE_STATEID_CALLBACK_EVENT(name) \
|
|
|
|
DEFINE_EVENT(nfs4_inode_stateid_callback_event, name, \
|
|
|
|
TP_PROTO( \
|
|
|
|
const struct nfs_client *clp, \
|
|
|
|
const struct nfs_fh *fhandle, \
|
|
|
|
const struct inode *inode, \
|
|
|
|
const nfs4_stateid *stateid, \
|
|
|
|
int error \
|
|
|
|
), \
|
|
|
|
TP_ARGS(clp, fhandle, inode, stateid, error))
|
|
|
|
DEFINE_NFS4_INODE_STATEID_CALLBACK_EVENT(nfs4_cb_recall);
|
|
|
|
DEFINE_NFS4_INODE_STATEID_CALLBACK_EVENT(nfs4_cb_layoutrecall_file);
|
2015-08-21 01:07:54 +00:00
|
|
|
|
2013-08-13 15:34:01 +00:00
|
|
|
DECLARE_EVENT_CLASS(nfs4_idmap_event,
|
|
|
|
TP_PROTO(
|
|
|
|
const char *name,
|
|
|
|
int len,
|
|
|
|
u32 id,
|
|
|
|
int error
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_ARGS(name, len, id, error),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
2019-06-19 14:33:53 +00:00
|
|
|
__field(unsigned long, error)
|
2013-08-13 15:34:01 +00:00
|
|
|
__field(u32, id)
|
|
|
|
__dynamic_array(char, name, len > 0 ? len + 1 : 1)
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
if (len < 0)
|
|
|
|
len = 0;
|
|
|
|
__entry->error = error < 0 ? error : 0;
|
|
|
|
__entry->id = id;
|
2016-07-01 23:44:36 +00:00
|
|
|
memcpy(__get_str(name), name, len);
|
|
|
|
__get_str(name)[len] = 0;
|
2013-08-13 15:34:01 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk(
|
2019-06-19 14:33:53 +00:00
|
|
|
"error=%ld (%s) id=%u name=%s",
|
2021-10-22 20:17:03 +00:00
|
|
|
-__entry->error, show_nfs4_status(__entry->error),
|
2013-08-13 15:34:01 +00:00
|
|
|
__entry->id,
|
|
|
|
__get_str(name)
|
|
|
|
)
|
|
|
|
);
|
|
|
|
#define DEFINE_NFS4_IDMAP_EVENT(name) \
|
|
|
|
DEFINE_EVENT(nfs4_idmap_event, name, \
|
|
|
|
TP_PROTO( \
|
|
|
|
const char *name, \
|
|
|
|
int len, \
|
|
|
|
u32 id, \
|
|
|
|
int error \
|
|
|
|
), \
|
|
|
|
TP_ARGS(name, len, id, error))
|
|
|
|
DEFINE_NFS4_IDMAP_EVENT(nfs4_map_name_to_uid);
|
|
|
|
DEFINE_NFS4_IDMAP_EVENT(nfs4_map_group_to_gid);
|
|
|
|
DEFINE_NFS4_IDMAP_EVENT(nfs4_map_uid_to_name);
|
|
|
|
DEFINE_NFS4_IDMAP_EVENT(nfs4_map_gid_to_group);
|
|
|
|
|
2020-08-05 02:16:06 +00:00
|
|
|
#ifdef CONFIG_NFS_V4_1
|
|
|
|
#define NFS4_LSEG_LAYOUT_STATEID_HASH(lseg) \
|
|
|
|
(lseg ? nfs_stateid_hash(&lseg->pls_layout->plh_stateid) : 0)
|
|
|
|
#else
|
|
|
|
#define NFS4_LSEG_LAYOUT_STATEID_HASH(lseg) (0)
|
|
|
|
#endif
|
|
|
|
|
2013-08-14 19:31:28 +00:00
|
|
|
DECLARE_EVENT_CLASS(nfs4_read_event,
|
|
|
|
TP_PROTO(
|
2014-06-09 15:48:35 +00:00
|
|
|
const struct nfs_pgio_header *hdr,
|
2013-08-14 19:31:28 +00:00
|
|
|
int error
|
|
|
|
),
|
|
|
|
|
2014-06-09 15:48:35 +00:00
|
|
|
TP_ARGS(hdr, error),
|
2013-08-14 19:31:28 +00:00
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(dev_t, dev)
|
|
|
|
__field(u32, fhandle)
|
|
|
|
__field(u64, fileid)
|
|
|
|
__field(loff_t, offset)
|
2020-01-06 20:25:05 +00:00
|
|
|
__field(u32, arg_count)
|
|
|
|
__field(u32, res_count)
|
2019-06-19 14:33:53 +00:00
|
|
|
__field(unsigned long, error)
|
Adding stateid information to tracepoints
Operations to which stateid information is added:
close, delegreturn, open, read, setattr, layoutget, layoutcommit, test_stateid,
write, lock, locku, lockt
Format is "stateid=<seqid>:<crc32 hash stateid.other>", also "openstateid=",
"layoutstateid=", and "lockstateid=" for open_file, layoutget, set_lock
tracepoints.
New function is added to internal.h, nfs_stateid_hash(), to compute the hash
trace_nfs4_setattr() is moved from nfs4_do_setattr() to _nfs4_do_setattr()
to get access to stateid.
trace_nfs4_setattr and trace_nfs4_delegreturn are changed from INODE_EVENT
to new event type, INODE_STATEID_EVENT which is same as INODE_EVENT but adds
stateid information
for locking tracepoints, moved trace_nfs4_set_lock() into _nfs4_do_setlk()
to get access to stateid information, and removed trace_nfs4_lock_reclaim(),
trace_nfs4_lock_expired() as they call into _nfs4_do_setlk() and both were
previously same LOCK_EVENT type.
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
2015-11-24 18:29:41 +00:00
|
|
|
__field(int, stateid_seq)
|
|
|
|
__field(u32, stateid_hash)
|
2020-08-05 02:16:06 +00:00
|
|
|
__field(int, layoutstateid_seq)
|
|
|
|
__field(u32, layoutstateid_hash)
|
2013-08-14 19:31:28 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
2014-06-09 15:48:35 +00:00
|
|
|
const struct inode *inode = hdr->inode;
|
2020-01-06 20:25:05 +00:00
|
|
|
const struct nfs_inode *nfsi = NFS_I(inode);
|
|
|
|
const struct nfs_fh *fh = hdr->args.fh ?
|
|
|
|
hdr->args.fh : &nfsi->fh;
|
Adding stateid information to tracepoints
Operations to which stateid information is added:
close, delegreturn, open, read, setattr, layoutget, layoutcommit, test_stateid,
write, lock, locku, lockt
Format is "stateid=<seqid>:<crc32 hash stateid.other>", also "openstateid=",
"layoutstateid=", and "lockstateid=" for open_file, layoutget, set_lock
tracepoints.
New function is added to internal.h, nfs_stateid_hash(), to compute the hash
trace_nfs4_setattr() is moved from nfs4_do_setattr() to _nfs4_do_setattr()
to get access to stateid.
trace_nfs4_setattr and trace_nfs4_delegreturn are changed from INODE_EVENT
to new event type, INODE_STATEID_EVENT which is same as INODE_EVENT but adds
stateid information
for locking tracepoints, moved trace_nfs4_set_lock() into _nfs4_do_setlk()
to get access to stateid information, and removed trace_nfs4_lock_reclaim(),
trace_nfs4_lock_expired() as they call into _nfs4_do_setlk() and both were
previously same LOCK_EVENT type.
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
2015-11-24 18:29:41 +00:00
|
|
|
const struct nfs4_state *state =
|
|
|
|
hdr->args.context->state;
|
2020-08-05 02:16:06 +00:00
|
|
|
const struct pnfs_layout_segment *lseg = hdr->lseg;
|
2020-01-06 20:25:05 +00:00
|
|
|
|
2013-08-14 19:31:28 +00:00
|
|
|
__entry->dev = inode->i_sb->s_dev;
|
2020-01-06 20:25:05 +00:00
|
|
|
__entry->fileid = nfsi->fileid;
|
|
|
|
__entry->fhandle = nfs_fhandle_hash(fh);
|
2014-06-09 15:48:35 +00:00
|
|
|
__entry->offset = hdr->args.offset;
|
2020-01-06 20:25:05 +00:00
|
|
|
__entry->arg_count = hdr->args.count;
|
|
|
|
__entry->res_count = hdr->res.count;
|
2019-06-19 14:33:53 +00:00
|
|
|
__entry->error = error < 0 ? -error : 0;
|
Adding stateid information to tracepoints
Operations to which stateid information is added:
close, delegreturn, open, read, setattr, layoutget, layoutcommit, test_stateid,
write, lock, locku, lockt
Format is "stateid=<seqid>:<crc32 hash stateid.other>", also "openstateid=",
"layoutstateid=", and "lockstateid=" for open_file, layoutget, set_lock
tracepoints.
New function is added to internal.h, nfs_stateid_hash(), to compute the hash
trace_nfs4_setattr() is moved from nfs4_do_setattr() to _nfs4_do_setattr()
to get access to stateid.
trace_nfs4_setattr and trace_nfs4_delegreturn are changed from INODE_EVENT
to new event type, INODE_STATEID_EVENT which is same as INODE_EVENT but adds
stateid information
for locking tracepoints, moved trace_nfs4_set_lock() into _nfs4_do_setlk()
to get access to stateid information, and removed trace_nfs4_lock_reclaim(),
trace_nfs4_lock_expired() as they call into _nfs4_do_setlk() and both were
previously same LOCK_EVENT type.
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
2015-11-24 18:29:41 +00:00
|
|
|
__entry->stateid_seq =
|
|
|
|
be32_to_cpu(state->stateid.seqid);
|
|
|
|
__entry->stateid_hash =
|
|
|
|
nfs_stateid_hash(&state->stateid);
|
2020-08-05 02:16:06 +00:00
|
|
|
__entry->layoutstateid_seq = lseg ? lseg->pls_seq : 0;
|
|
|
|
__entry->layoutstateid_hash =
|
|
|
|
NFS4_LSEG_LAYOUT_STATEID_HASH(lseg);
|
2013-08-14 19:31:28 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk(
|
2019-06-19 14:33:53 +00:00
|
|
|
"error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x "
|
2020-08-05 02:16:06 +00:00
|
|
|
"offset=%lld count=%u res=%u stateid=%d:0x%08x "
|
|
|
|
"layoutstateid=%d:0x%08x",
|
2019-06-19 14:33:53 +00:00
|
|
|
-__entry->error,
|
2021-10-22 20:17:03 +00:00
|
|
|
show_nfs4_status(__entry->error),
|
2013-08-14 19:31:28 +00:00
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
|
|
(unsigned long long)__entry->fileid,
|
|
|
|
__entry->fhandle,
|
|
|
|
(long long)__entry->offset,
|
2020-01-06 20:25:05 +00:00
|
|
|
__entry->arg_count, __entry->res_count,
|
2020-08-05 02:16:06 +00:00
|
|
|
__entry->stateid_seq, __entry->stateid_hash,
|
|
|
|
__entry->layoutstateid_seq, __entry->layoutstateid_hash
|
2013-08-14 19:31:28 +00:00
|
|
|
)
|
|
|
|
);
|
|
|
|
#define DEFINE_NFS4_READ_EVENT(name) \
|
|
|
|
DEFINE_EVENT(nfs4_read_event, name, \
|
|
|
|
TP_PROTO( \
|
2014-06-09 15:48:35 +00:00
|
|
|
const struct nfs_pgio_header *hdr, \
|
2013-08-14 19:31:28 +00:00
|
|
|
int error \
|
|
|
|
), \
|
2014-06-09 15:48:35 +00:00
|
|
|
TP_ARGS(hdr, error))
|
2013-08-14 19:31:28 +00:00
|
|
|
DEFINE_NFS4_READ_EVENT(nfs4_read);
|
|
|
|
#ifdef CONFIG_NFS_V4_1
|
|
|
|
DEFINE_NFS4_READ_EVENT(nfs4_pnfs_read);
|
|
|
|
#endif /* CONFIG_NFS_V4_1 */
|
|
|
|
|
|
|
|
DECLARE_EVENT_CLASS(nfs4_write_event,
|
|
|
|
TP_PROTO(
|
2014-06-09 15:48:35 +00:00
|
|
|
const struct nfs_pgio_header *hdr,
|
2013-08-14 19:31:28 +00:00
|
|
|
int error
|
|
|
|
),
|
|
|
|
|
2014-06-09 15:48:35 +00:00
|
|
|
TP_ARGS(hdr, error),
|
2013-08-14 19:31:28 +00:00
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(dev_t, dev)
|
|
|
|
__field(u32, fhandle)
|
|
|
|
__field(u64, fileid)
|
|
|
|
__field(loff_t, offset)
|
2020-01-06 20:25:05 +00:00
|
|
|
__field(u32, arg_count)
|
|
|
|
__field(u32, res_count)
|
2019-06-19 14:33:53 +00:00
|
|
|
__field(unsigned long, error)
|
Adding stateid information to tracepoints
Operations to which stateid information is added:
close, delegreturn, open, read, setattr, layoutget, layoutcommit, test_stateid,
write, lock, locku, lockt
Format is "stateid=<seqid>:<crc32 hash stateid.other>", also "openstateid=",
"layoutstateid=", and "lockstateid=" for open_file, layoutget, set_lock
tracepoints.
New function is added to internal.h, nfs_stateid_hash(), to compute the hash
trace_nfs4_setattr() is moved from nfs4_do_setattr() to _nfs4_do_setattr()
to get access to stateid.
trace_nfs4_setattr and trace_nfs4_delegreturn are changed from INODE_EVENT
to new event type, INODE_STATEID_EVENT which is same as INODE_EVENT but adds
stateid information
for locking tracepoints, moved trace_nfs4_set_lock() into _nfs4_do_setlk()
to get access to stateid information, and removed trace_nfs4_lock_reclaim(),
trace_nfs4_lock_expired() as they call into _nfs4_do_setlk() and both were
previously same LOCK_EVENT type.
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
2015-11-24 18:29:41 +00:00
|
|
|
__field(int, stateid_seq)
|
|
|
|
__field(u32, stateid_hash)
|
2020-08-05 02:16:06 +00:00
|
|
|
__field(int, layoutstateid_seq)
|
|
|
|
__field(u32, layoutstateid_hash)
|
2013-08-14 19:31:28 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
2014-06-09 15:48:35 +00:00
|
|
|
const struct inode *inode = hdr->inode;
|
2020-01-06 20:25:05 +00:00
|
|
|
const struct nfs_inode *nfsi = NFS_I(inode);
|
|
|
|
const struct nfs_fh *fh = hdr->args.fh ?
|
|
|
|
hdr->args.fh : &nfsi->fh;
|
Adding stateid information to tracepoints
Operations to which stateid information is added:
close, delegreturn, open, read, setattr, layoutget, layoutcommit, test_stateid,
write, lock, locku, lockt
Format is "stateid=<seqid>:<crc32 hash stateid.other>", also "openstateid=",
"layoutstateid=", and "lockstateid=" for open_file, layoutget, set_lock
tracepoints.
New function is added to internal.h, nfs_stateid_hash(), to compute the hash
trace_nfs4_setattr() is moved from nfs4_do_setattr() to _nfs4_do_setattr()
to get access to stateid.
trace_nfs4_setattr and trace_nfs4_delegreturn are changed from INODE_EVENT
to new event type, INODE_STATEID_EVENT which is same as INODE_EVENT but adds
stateid information
for locking tracepoints, moved trace_nfs4_set_lock() into _nfs4_do_setlk()
to get access to stateid information, and removed trace_nfs4_lock_reclaim(),
trace_nfs4_lock_expired() as they call into _nfs4_do_setlk() and both were
previously same LOCK_EVENT type.
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
2015-11-24 18:29:41 +00:00
|
|
|
const struct nfs4_state *state =
|
|
|
|
hdr->args.context->state;
|
2020-08-05 02:16:06 +00:00
|
|
|
const struct pnfs_layout_segment *lseg = hdr->lseg;
|
2020-01-06 20:25:05 +00:00
|
|
|
|
2013-08-14 19:31:28 +00:00
|
|
|
__entry->dev = inode->i_sb->s_dev;
|
2020-01-06 20:25:05 +00:00
|
|
|
__entry->fileid = nfsi->fileid;
|
|
|
|
__entry->fhandle = nfs_fhandle_hash(fh);
|
2014-06-09 15:48:35 +00:00
|
|
|
__entry->offset = hdr->args.offset;
|
2020-01-06 20:25:05 +00:00
|
|
|
__entry->arg_count = hdr->args.count;
|
|
|
|
__entry->res_count = hdr->res.count;
|
2019-06-19 14:33:53 +00:00
|
|
|
__entry->error = error < 0 ? -error : 0;
|
Adding stateid information to tracepoints
Operations to which stateid information is added:
close, delegreturn, open, read, setattr, layoutget, layoutcommit, test_stateid,
write, lock, locku, lockt
Format is "stateid=<seqid>:<crc32 hash stateid.other>", also "openstateid=",
"layoutstateid=", and "lockstateid=" for open_file, layoutget, set_lock
tracepoints.
New function is added to internal.h, nfs_stateid_hash(), to compute the hash
trace_nfs4_setattr() is moved from nfs4_do_setattr() to _nfs4_do_setattr()
to get access to stateid.
trace_nfs4_setattr and trace_nfs4_delegreturn are changed from INODE_EVENT
to new event type, INODE_STATEID_EVENT which is same as INODE_EVENT but adds
stateid information
for locking tracepoints, moved trace_nfs4_set_lock() into _nfs4_do_setlk()
to get access to stateid information, and removed trace_nfs4_lock_reclaim(),
trace_nfs4_lock_expired() as they call into _nfs4_do_setlk() and both were
previously same LOCK_EVENT type.
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
2015-11-24 18:29:41 +00:00
|
|
|
__entry->stateid_seq =
|
|
|
|
be32_to_cpu(state->stateid.seqid);
|
|
|
|
__entry->stateid_hash =
|
|
|
|
nfs_stateid_hash(&state->stateid);
|
2020-08-05 02:16:06 +00:00
|
|
|
__entry->layoutstateid_seq = lseg ? lseg->pls_seq : 0;
|
|
|
|
__entry->layoutstateid_hash =
|
|
|
|
NFS4_LSEG_LAYOUT_STATEID_HASH(lseg);
|
2013-08-14 19:31:28 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk(
|
2019-06-19 14:33:53 +00:00
|
|
|
"error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x "
|
2020-08-05 02:16:06 +00:00
|
|
|
"offset=%lld count=%u res=%u stateid=%d:0x%08x "
|
|
|
|
"layoutstateid=%d:0x%08x",
|
2019-06-19 14:33:53 +00:00
|
|
|
-__entry->error,
|
2021-10-22 20:17:03 +00:00
|
|
|
show_nfs4_status(__entry->error),
|
2013-08-14 19:31:28 +00:00
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
|
|
(unsigned long long)__entry->fileid,
|
|
|
|
__entry->fhandle,
|
|
|
|
(long long)__entry->offset,
|
2020-01-06 20:25:05 +00:00
|
|
|
__entry->arg_count, __entry->res_count,
|
2020-08-05 02:16:06 +00:00
|
|
|
__entry->stateid_seq, __entry->stateid_hash,
|
|
|
|
__entry->layoutstateid_seq, __entry->layoutstateid_hash
|
2013-08-14 19:31:28 +00:00
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
#define DEFINE_NFS4_WRITE_EVENT(name) \
|
|
|
|
DEFINE_EVENT(nfs4_write_event, name, \
|
|
|
|
TP_PROTO( \
|
2014-06-09 15:48:35 +00:00
|
|
|
const struct nfs_pgio_header *hdr, \
|
2013-08-14 19:31:28 +00:00
|
|
|
int error \
|
|
|
|
), \
|
2014-06-09 15:48:35 +00:00
|
|
|
TP_ARGS(hdr, error))
|
2013-08-14 19:31:28 +00:00
|
|
|
DEFINE_NFS4_WRITE_EVENT(nfs4_write);
|
|
|
|
#ifdef CONFIG_NFS_V4_1
|
|
|
|
DEFINE_NFS4_WRITE_EVENT(nfs4_pnfs_write);
|
|
|
|
#endif /* CONFIG_NFS_V4_1 */
|
|
|
|
|
|
|
|
DECLARE_EVENT_CLASS(nfs4_commit_event,
|
|
|
|
TP_PROTO(
|
|
|
|
const struct nfs_commit_data *data,
|
|
|
|
int error
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_ARGS(data, error),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(dev_t, dev)
|
|
|
|
__field(u32, fhandle)
|
|
|
|
__field(u64, fileid)
|
2019-06-19 14:33:53 +00:00
|
|
|
__field(unsigned long, error)
|
2020-01-06 20:25:05 +00:00
|
|
|
__field(loff_t, offset)
|
|
|
|
__field(u32, count)
|
2020-08-05 02:16:06 +00:00
|
|
|
__field(int, layoutstateid_seq)
|
|
|
|
__field(u32, layoutstateid_hash)
|
2013-08-14 19:31:28 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
const struct inode *inode = data->inode;
|
2020-01-06 20:25:05 +00:00
|
|
|
const struct nfs_inode *nfsi = NFS_I(inode);
|
|
|
|
const struct nfs_fh *fh = data->args.fh ?
|
|
|
|
data->args.fh : &nfsi->fh;
|
2020-08-05 02:16:06 +00:00
|
|
|
const struct pnfs_layout_segment *lseg = data->lseg;
|
2020-01-06 20:25:05 +00:00
|
|
|
|
2013-08-14 19:31:28 +00:00
|
|
|
__entry->dev = inode->i_sb->s_dev;
|
2020-01-06 20:25:05 +00:00
|
|
|
__entry->fileid = nfsi->fileid;
|
|
|
|
__entry->fhandle = nfs_fhandle_hash(fh);
|
2013-08-14 19:31:28 +00:00
|
|
|
__entry->offset = data->args.offset;
|
|
|
|
__entry->count = data->args.count;
|
2020-01-06 20:25:05 +00:00
|
|
|
__entry->error = error < 0 ? -error : 0;
|
2020-08-05 02:16:06 +00:00
|
|
|
__entry->layoutstateid_seq = lseg ? lseg->pls_seq : 0;
|
|
|
|
__entry->layoutstateid_hash =
|
|
|
|
NFS4_LSEG_LAYOUT_STATEID_HASH(lseg);
|
2013-08-14 19:31:28 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk(
|
2019-06-19 14:33:53 +00:00
|
|
|
"error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x "
|
2020-08-05 02:16:06 +00:00
|
|
|
"offset=%lld count=%u layoutstateid=%d:0x%08x",
|
2019-06-19 14:33:53 +00:00
|
|
|
-__entry->error,
|
2021-10-22 20:17:03 +00:00
|
|
|
show_nfs4_status(__entry->error),
|
2013-08-14 19:31:28 +00:00
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
|
|
(unsigned long long)__entry->fileid,
|
|
|
|
__entry->fhandle,
|
|
|
|
(long long)__entry->offset,
|
2020-08-05 02:16:06 +00:00
|
|
|
__entry->count,
|
|
|
|
__entry->layoutstateid_seq, __entry->layoutstateid_hash
|
2013-08-14 19:31:28 +00:00
|
|
|
)
|
|
|
|
);
|
|
|
|
#define DEFINE_NFS4_COMMIT_EVENT(name) \
|
|
|
|
DEFINE_EVENT(nfs4_commit_event, name, \
|
|
|
|
TP_PROTO( \
|
|
|
|
const struct nfs_commit_data *data, \
|
|
|
|
int error \
|
|
|
|
), \
|
|
|
|
TP_ARGS(data, error))
|
|
|
|
DEFINE_NFS4_COMMIT_EVENT(nfs4_commit);
|
|
|
|
#ifdef CONFIG_NFS_V4_1
|
|
|
|
DEFINE_NFS4_COMMIT_EVENT(nfs4_pnfs_commit_ds);
|
2013-08-14 20:36:51 +00:00
|
|
|
|
|
|
|
TRACE_EVENT(nfs4_layoutget,
|
|
|
|
TP_PROTO(
|
|
|
|
const struct nfs_open_context *ctx,
|
|
|
|
const struct pnfs_layout_range *args,
|
|
|
|
const struct pnfs_layout_range *res,
|
Adding stateid information to tracepoints
Operations to which stateid information is added:
close, delegreturn, open, read, setattr, layoutget, layoutcommit, test_stateid,
write, lock, locku, lockt
Format is "stateid=<seqid>:<crc32 hash stateid.other>", also "openstateid=",
"layoutstateid=", and "lockstateid=" for open_file, layoutget, set_lock
tracepoints.
New function is added to internal.h, nfs_stateid_hash(), to compute the hash
trace_nfs4_setattr() is moved from nfs4_do_setattr() to _nfs4_do_setattr()
to get access to stateid.
trace_nfs4_setattr and trace_nfs4_delegreturn are changed from INODE_EVENT
to new event type, INODE_STATEID_EVENT which is same as INODE_EVENT but adds
stateid information
for locking tracepoints, moved trace_nfs4_set_lock() into _nfs4_do_setlk()
to get access to stateid information, and removed trace_nfs4_lock_reclaim(),
trace_nfs4_lock_expired() as they call into _nfs4_do_setlk() and both were
previously same LOCK_EVENT type.
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
2015-11-24 18:29:41 +00:00
|
|
|
const nfs4_stateid *layout_stateid,
|
2013-08-14 20:36:51 +00:00
|
|
|
int error
|
|
|
|
),
|
|
|
|
|
Adding stateid information to tracepoints
Operations to which stateid information is added:
close, delegreturn, open, read, setattr, layoutget, layoutcommit, test_stateid,
write, lock, locku, lockt
Format is "stateid=<seqid>:<crc32 hash stateid.other>", also "openstateid=",
"layoutstateid=", and "lockstateid=" for open_file, layoutget, set_lock
tracepoints.
New function is added to internal.h, nfs_stateid_hash(), to compute the hash
trace_nfs4_setattr() is moved from nfs4_do_setattr() to _nfs4_do_setattr()
to get access to stateid.
trace_nfs4_setattr and trace_nfs4_delegreturn are changed from INODE_EVENT
to new event type, INODE_STATEID_EVENT which is same as INODE_EVENT but adds
stateid information
for locking tracepoints, moved trace_nfs4_set_lock() into _nfs4_do_setlk()
to get access to stateid information, and removed trace_nfs4_lock_reclaim(),
trace_nfs4_lock_expired() as they call into _nfs4_do_setlk() and both were
previously same LOCK_EVENT type.
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
2015-11-24 18:29:41 +00:00
|
|
|
TP_ARGS(ctx, args, res, layout_stateid, error),
|
2013-08-14 20:36:51 +00:00
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(dev_t, dev)
|
|
|
|
__field(u32, fhandle)
|
|
|
|
__field(u64, fileid)
|
|
|
|
__field(u32, iomode)
|
|
|
|
__field(u64, offset)
|
|
|
|
__field(u64, count)
|
2019-06-19 14:33:53 +00:00
|
|
|
__field(unsigned long, error)
|
Adding stateid information to tracepoints
Operations to which stateid information is added:
close, delegreturn, open, read, setattr, layoutget, layoutcommit, test_stateid,
write, lock, locku, lockt
Format is "stateid=<seqid>:<crc32 hash stateid.other>", also "openstateid=",
"layoutstateid=", and "lockstateid=" for open_file, layoutget, set_lock
tracepoints.
New function is added to internal.h, nfs_stateid_hash(), to compute the hash
trace_nfs4_setattr() is moved from nfs4_do_setattr() to _nfs4_do_setattr()
to get access to stateid.
trace_nfs4_setattr and trace_nfs4_delegreturn are changed from INODE_EVENT
to new event type, INODE_STATEID_EVENT which is same as INODE_EVENT but adds
stateid information
for locking tracepoints, moved trace_nfs4_set_lock() into _nfs4_do_setlk()
to get access to stateid information, and removed trace_nfs4_lock_reclaim(),
trace_nfs4_lock_expired() as they call into _nfs4_do_setlk() and both were
previously same LOCK_EVENT type.
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
2015-11-24 18:29:41 +00:00
|
|
|
__field(int, stateid_seq)
|
|
|
|
__field(u32, stateid_hash)
|
|
|
|
__field(int, layoutstateid_seq)
|
|
|
|
__field(u32, layoutstateid_hash)
|
2013-08-14 20:36:51 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
2015-03-17 22:25:59 +00:00
|
|
|
const struct inode *inode = d_inode(ctx->dentry);
|
Adding stateid information to tracepoints
Operations to which stateid information is added:
close, delegreturn, open, read, setattr, layoutget, layoutcommit, test_stateid,
write, lock, locku, lockt
Format is "stateid=<seqid>:<crc32 hash stateid.other>", also "openstateid=",
"layoutstateid=", and "lockstateid=" for open_file, layoutget, set_lock
tracepoints.
New function is added to internal.h, nfs_stateid_hash(), to compute the hash
trace_nfs4_setattr() is moved from nfs4_do_setattr() to _nfs4_do_setattr()
to get access to stateid.
trace_nfs4_setattr and trace_nfs4_delegreturn are changed from INODE_EVENT
to new event type, INODE_STATEID_EVENT which is same as INODE_EVENT but adds
stateid information
for locking tracepoints, moved trace_nfs4_set_lock() into _nfs4_do_setlk()
to get access to stateid information, and removed trace_nfs4_lock_reclaim(),
trace_nfs4_lock_expired() as they call into _nfs4_do_setlk() and both were
previously same LOCK_EVENT type.
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
2015-11-24 18:29:41 +00:00
|
|
|
const struct nfs4_state *state = ctx->state;
|
2013-08-14 20:36:51 +00:00
|
|
|
__entry->dev = inode->i_sb->s_dev;
|
|
|
|
__entry->fileid = NFS_FILEID(inode);
|
|
|
|
__entry->fhandle = nfs_fhandle_hash(NFS_FH(inode));
|
|
|
|
__entry->iomode = args->iomode;
|
|
|
|
__entry->offset = args->offset;
|
|
|
|
__entry->count = args->length;
|
2020-01-06 20:25:06 +00:00
|
|
|
__entry->error = error < 0 ? -error : 0;
|
Adding stateid information to tracepoints
Operations to which stateid information is added:
close, delegreturn, open, read, setattr, layoutget, layoutcommit, test_stateid,
write, lock, locku, lockt
Format is "stateid=<seqid>:<crc32 hash stateid.other>", also "openstateid=",
"layoutstateid=", and "lockstateid=" for open_file, layoutget, set_lock
tracepoints.
New function is added to internal.h, nfs_stateid_hash(), to compute the hash
trace_nfs4_setattr() is moved from nfs4_do_setattr() to _nfs4_do_setattr()
to get access to stateid.
trace_nfs4_setattr and trace_nfs4_delegreturn are changed from INODE_EVENT
to new event type, INODE_STATEID_EVENT which is same as INODE_EVENT but adds
stateid information
for locking tracepoints, moved trace_nfs4_set_lock() into _nfs4_do_setlk()
to get access to stateid information, and removed trace_nfs4_lock_reclaim(),
trace_nfs4_lock_expired() as they call into _nfs4_do_setlk() and both were
previously same LOCK_EVENT type.
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
2015-11-24 18:29:41 +00:00
|
|
|
__entry->stateid_seq =
|
|
|
|
be32_to_cpu(state->stateid.seqid);
|
|
|
|
__entry->stateid_hash =
|
|
|
|
nfs_stateid_hash(&state->stateid);
|
|
|
|
if (!error) {
|
|
|
|
__entry->layoutstateid_seq =
|
|
|
|
be32_to_cpu(layout_stateid->seqid);
|
|
|
|
__entry->layoutstateid_hash =
|
|
|
|
nfs_stateid_hash(layout_stateid);
|
|
|
|
} else {
|
|
|
|
__entry->layoutstateid_seq = 0;
|
|
|
|
__entry->layoutstateid_hash = 0;
|
|
|
|
}
|
2013-08-14 20:36:51 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk(
|
2019-06-19 14:33:53 +00:00
|
|
|
"error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x "
|
Adding stateid information to tracepoints
Operations to which stateid information is added:
close, delegreturn, open, read, setattr, layoutget, layoutcommit, test_stateid,
write, lock, locku, lockt
Format is "stateid=<seqid>:<crc32 hash stateid.other>", also "openstateid=",
"layoutstateid=", and "lockstateid=" for open_file, layoutget, set_lock
tracepoints.
New function is added to internal.h, nfs_stateid_hash(), to compute the hash
trace_nfs4_setattr() is moved from nfs4_do_setattr() to _nfs4_do_setattr()
to get access to stateid.
trace_nfs4_setattr and trace_nfs4_delegreturn are changed from INODE_EVENT
to new event type, INODE_STATEID_EVENT which is same as INODE_EVENT but adds
stateid information
for locking tracepoints, moved trace_nfs4_set_lock() into _nfs4_do_setlk()
to get access to stateid information, and removed trace_nfs4_lock_reclaim(),
trace_nfs4_lock_expired() as they call into _nfs4_do_setlk() and both were
previously same LOCK_EVENT type.
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
2015-11-24 18:29:41 +00:00
|
|
|
"iomode=%s offset=%llu count=%llu stateid=%d:0x%08x "
|
|
|
|
"layoutstateid=%d:0x%08x",
|
2019-06-19 14:33:53 +00:00
|
|
|
-__entry->error,
|
2021-10-22 20:17:03 +00:00
|
|
|
show_nfs4_status(__entry->error),
|
2013-08-14 20:36:51 +00:00
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
|
|
(unsigned long long)__entry->fileid,
|
|
|
|
__entry->fhandle,
|
2021-10-22 20:17:03 +00:00
|
|
|
show_pnfs_layout_iomode(__entry->iomode),
|
2013-08-14 20:36:51 +00:00
|
|
|
(unsigned long long)__entry->offset,
|
Adding stateid information to tracepoints
Operations to which stateid information is added:
close, delegreturn, open, read, setattr, layoutget, layoutcommit, test_stateid,
write, lock, locku, lockt
Format is "stateid=<seqid>:<crc32 hash stateid.other>", also "openstateid=",
"layoutstateid=", and "lockstateid=" for open_file, layoutget, set_lock
tracepoints.
New function is added to internal.h, nfs_stateid_hash(), to compute the hash
trace_nfs4_setattr() is moved from nfs4_do_setattr() to _nfs4_do_setattr()
to get access to stateid.
trace_nfs4_setattr and trace_nfs4_delegreturn are changed from INODE_EVENT
to new event type, INODE_STATEID_EVENT which is same as INODE_EVENT but adds
stateid information
for locking tracepoints, moved trace_nfs4_set_lock() into _nfs4_do_setlk()
to get access to stateid information, and removed trace_nfs4_lock_reclaim(),
trace_nfs4_lock_expired() as they call into _nfs4_do_setlk() and both were
previously same LOCK_EVENT type.
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
2015-11-24 18:29:41 +00:00
|
|
|
(unsigned long long)__entry->count,
|
|
|
|
__entry->stateid_seq, __entry->stateid_hash,
|
|
|
|
__entry->layoutstateid_seq, __entry->layoutstateid_hash
|
2013-08-14 20:36:51 +00:00
|
|
|
)
|
|
|
|
);
|
|
|
|
|
Adding stateid information to tracepoints
Operations to which stateid information is added:
close, delegreturn, open, read, setattr, layoutget, layoutcommit, test_stateid,
write, lock, locku, lockt
Format is "stateid=<seqid>:<crc32 hash stateid.other>", also "openstateid=",
"layoutstateid=", and "lockstateid=" for open_file, layoutget, set_lock
tracepoints.
New function is added to internal.h, nfs_stateid_hash(), to compute the hash
trace_nfs4_setattr() is moved from nfs4_do_setattr() to _nfs4_do_setattr()
to get access to stateid.
trace_nfs4_setattr and trace_nfs4_delegreturn are changed from INODE_EVENT
to new event type, INODE_STATEID_EVENT which is same as INODE_EVENT but adds
stateid information
for locking tracepoints, moved trace_nfs4_set_lock() into _nfs4_do_setlk()
to get access to stateid information, and removed trace_nfs4_lock_reclaim(),
trace_nfs4_lock_expired() as they call into _nfs4_do_setlk() and both were
previously same LOCK_EVENT type.
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
2015-11-24 18:29:41 +00:00
|
|
|
DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_layoutcommit);
|
|
|
|
DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_layoutreturn);
|
2020-08-03 22:32:28 +00:00
|
|
|
DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_layoutreturn_on_close);
|
2020-08-04 15:02:44 +00:00
|
|
|
DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_layouterror);
|
|
|
|
DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_layoutstats);
|
2013-08-14 20:36:51 +00:00
|
|
|
|
2018-12-19 16:00:11 +00:00
|
|
|
TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_UNKNOWN);
|
|
|
|
TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_NO_PNFS);
|
|
|
|
TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_RD_ZEROLEN);
|
|
|
|
TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_MDSTHRESH);
|
|
|
|
TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_NOMEM);
|
|
|
|
TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_BULK_RECALL);
|
|
|
|
TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_IO_TEST_FAIL);
|
|
|
|
TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_FOUND_CACHED);
|
|
|
|
TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_RETURN);
|
|
|
|
TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_BLOCKED);
|
|
|
|
TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_INVALID_OPEN);
|
|
|
|
TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_RETRY);
|
|
|
|
TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_SEND_LAYOUTGET);
|
2019-07-18 13:32:17 +00:00
|
|
|
TRACE_DEFINE_ENUM(PNFS_UPDATE_LAYOUT_EXIT);
|
2018-12-19 16:00:11 +00:00
|
|
|
|
2015-12-10 15:41:58 +00:00
|
|
|
#define show_pnfs_update_layout_reason(reason) \
|
|
|
|
__print_symbolic(reason, \
|
|
|
|
{ PNFS_UPDATE_LAYOUT_UNKNOWN, "unknown" }, \
|
|
|
|
{ PNFS_UPDATE_LAYOUT_NO_PNFS, "no pnfs" }, \
|
|
|
|
{ PNFS_UPDATE_LAYOUT_RD_ZEROLEN, "read+zerolen" }, \
|
|
|
|
{ PNFS_UPDATE_LAYOUT_MDSTHRESH, "mdsthresh" }, \
|
|
|
|
{ PNFS_UPDATE_LAYOUT_NOMEM, "nomem" }, \
|
|
|
|
{ PNFS_UPDATE_LAYOUT_BULK_RECALL, "bulk recall" }, \
|
|
|
|
{ PNFS_UPDATE_LAYOUT_IO_TEST_FAIL, "io test fail" }, \
|
|
|
|
{ PNFS_UPDATE_LAYOUT_FOUND_CACHED, "found cached" }, \
|
|
|
|
{ PNFS_UPDATE_LAYOUT_RETURN, "layoutreturn" }, \
|
|
|
|
{ PNFS_UPDATE_LAYOUT_BLOCKED, "layouts blocked" }, \
|
pnfs: rework LAYOUTGET retry handling
There are several problems in the way a stateid is selected for a
LAYOUTGET operation:
We pick a stateid to use in the RPC prepare op, but that makes
it difficult to serialize LAYOUTGETs that use the open stateid. That
serialization is done in pnfs_update_layout, which occurs well before
the rpc_prepare operation.
Between those two events, the i_lock is dropped and reacquired.
pnfs_update_layout can find that the list has lsegs in it and not do any
serialization, but then later pnfs_choose_layoutget_stateid ends up
choosing the open stateid.
This patch changes the client to select the stateid to use in the
LAYOUTGET earlier, when we're searching for a usable layout segment.
This way we can do it all while holding the i_lock the first time, and
ensure that we serialize any LAYOUTGET call that uses a non-layout
stateid.
This also means a rework of how LAYOUTGET replies are handled, as we
must now get the latest stateid if we want to retransmit in response
to a retryable error.
Most of those errors boil down to the fact that the layout state has
changed in some fashion. Thus, what we really want to do is to re-search
for a layout when it fails with a retryable error, so that we can avoid
reissuing the RPC at all if possible.
While the LAYOUTGET RPC is async, the initiating thread always waits for
it to complete, so it's effectively synchronous anyway. Currently, when
we need to retry a LAYOUTGET because of an error, we drive that retry
via the rpc state machine.
This means that once the call has been submitted, it runs until it
completes. So, we must move the error handling for this RPC out of the
rpc_call_done operation and into the caller.
In order to handle errors like NFS4ERR_DELAY properly, we must also
pass a pointer to the sliding timeout, which is now moved to the stack
in pnfs_update_layout.
The complicating errors are -NFS4ERR_RECALLCONFLICT and
-NFS4ERR_LAYOUTTRYLATER, as those involve a timeout after which we give
up and return NULL back to the caller. So, there is some special
handling for those errors to ensure that the layers driving the retries
can handle that appropriately.
Signed-off-by: Jeff Layton <jeff.layton@primarydata.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
2016-05-17 16:28:47 +00:00
|
|
|
{ PNFS_UPDATE_LAYOUT_INVALID_OPEN, "invalid open" }, \
|
|
|
|
{ PNFS_UPDATE_LAYOUT_RETRY, "retrying" }, \
|
2019-07-18 13:32:17 +00:00
|
|
|
{ PNFS_UPDATE_LAYOUT_SEND_LAYOUTGET, "sent layoutget" }, \
|
|
|
|
{ PNFS_UPDATE_LAYOUT_EXIT, "exit" })
|
2015-12-10 15:41:58 +00:00
|
|
|
|
|
|
|
TRACE_EVENT(pnfs_update_layout,
|
|
|
|
TP_PROTO(struct inode *inode,
|
|
|
|
loff_t pos,
|
|
|
|
u64 count,
|
|
|
|
enum pnfs_iomode iomode,
|
2015-12-26 23:03:07 +00:00
|
|
|
struct pnfs_layout_hdr *lo,
|
pnfs: rework LAYOUTGET retry handling
There are several problems in the way a stateid is selected for a
LAYOUTGET operation:
We pick a stateid to use in the RPC prepare op, but that makes
it difficult to serialize LAYOUTGETs that use the open stateid. That
serialization is done in pnfs_update_layout, which occurs well before
the rpc_prepare operation.
Between those two events, the i_lock is dropped and reacquired.
pnfs_update_layout can find that the list has lsegs in it and not do any
serialization, but then later pnfs_choose_layoutget_stateid ends up
choosing the open stateid.
This patch changes the client to select the stateid to use in the
LAYOUTGET earlier, when we're searching for a usable layout segment.
This way we can do it all while holding the i_lock the first time, and
ensure that we serialize any LAYOUTGET call that uses a non-layout
stateid.
This also means a rework of how LAYOUTGET replies are handled, as we
must now get the latest stateid if we want to retransmit in response
to a retryable error.
Most of those errors boil down to the fact that the layout state has
changed in some fashion. Thus, what we really want to do is to re-search
for a layout when it fails with a retryable error, so that we can avoid
reissuing the RPC at all if possible.
While the LAYOUTGET RPC is async, the initiating thread always waits for
it to complete, so it's effectively synchronous anyway. Currently, when
we need to retry a LAYOUTGET because of an error, we drive that retry
via the rpc state machine.
This means that once the call has been submitted, it runs until it
completes. So, we must move the error handling for this RPC out of the
rpc_call_done operation and into the caller.
In order to handle errors like NFS4ERR_DELAY properly, we must also
pass a pointer to the sliding timeout, which is now moved to the stack
in pnfs_update_layout.
The complicating errors are -NFS4ERR_RECALLCONFLICT and
-NFS4ERR_LAYOUTTRYLATER, as those involve a timeout after which we give
up and return NULL back to the caller. So, there is some special
handling for those errors to ensure that the layers driving the retries
can handle that appropriately.
Signed-off-by: Jeff Layton <jeff.layton@primarydata.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
2016-05-17 16:28:47 +00:00
|
|
|
struct pnfs_layout_segment *lseg,
|
2015-12-10 15:41:58 +00:00
|
|
|
enum pnfs_update_layout_reason reason
|
|
|
|
),
|
pnfs: rework LAYOUTGET retry handling
There are several problems in the way a stateid is selected for a
LAYOUTGET operation:
We pick a stateid to use in the RPC prepare op, but that makes
it difficult to serialize LAYOUTGETs that use the open stateid. That
serialization is done in pnfs_update_layout, which occurs well before
the rpc_prepare operation.
Between those two events, the i_lock is dropped and reacquired.
pnfs_update_layout can find that the list has lsegs in it and not do any
serialization, but then later pnfs_choose_layoutget_stateid ends up
choosing the open stateid.
This patch changes the client to select the stateid to use in the
LAYOUTGET earlier, when we're searching for a usable layout segment.
This way we can do it all while holding the i_lock the first time, and
ensure that we serialize any LAYOUTGET call that uses a non-layout
stateid.
This also means a rework of how LAYOUTGET replies are handled, as we
must now get the latest stateid if we want to retransmit in response
to a retryable error.
Most of those errors boil down to the fact that the layout state has
changed in some fashion. Thus, what we really want to do is to re-search
for a layout when it fails with a retryable error, so that we can avoid
reissuing the RPC at all if possible.
While the LAYOUTGET RPC is async, the initiating thread always waits for
it to complete, so it's effectively synchronous anyway. Currently, when
we need to retry a LAYOUTGET because of an error, we drive that retry
via the rpc state machine.
This means that once the call has been submitted, it runs until it
completes. So, we must move the error handling for this RPC out of the
rpc_call_done operation and into the caller.
In order to handle errors like NFS4ERR_DELAY properly, we must also
pass a pointer to the sliding timeout, which is now moved to the stack
in pnfs_update_layout.
The complicating errors are -NFS4ERR_RECALLCONFLICT and
-NFS4ERR_LAYOUTTRYLATER, as those involve a timeout after which we give
up and return NULL back to the caller. So, there is some special
handling for those errors to ensure that the layers driving the retries
can handle that appropriately.
Signed-off-by: Jeff Layton <jeff.layton@primarydata.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
2016-05-17 16:28:47 +00:00
|
|
|
TP_ARGS(inode, pos, count, iomode, lo, lseg, reason),
|
2015-12-10 15:41:58 +00:00
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(dev_t, dev)
|
|
|
|
__field(u64, fileid)
|
|
|
|
__field(u32, fhandle)
|
|
|
|
__field(loff_t, pos)
|
|
|
|
__field(u64, count)
|
|
|
|
__field(enum pnfs_iomode, iomode)
|
2015-12-26 23:03:07 +00:00
|
|
|
__field(int, layoutstateid_seq)
|
|
|
|
__field(u32, layoutstateid_hash)
|
pnfs: rework LAYOUTGET retry handling
There are several problems in the way a stateid is selected for a
LAYOUTGET operation:
We pick a stateid to use in the RPC prepare op, but that makes
it difficult to serialize LAYOUTGETs that use the open stateid. That
serialization is done in pnfs_update_layout, which occurs well before
the rpc_prepare operation.
Between those two events, the i_lock is dropped and reacquired.
pnfs_update_layout can find that the list has lsegs in it and not do any
serialization, but then later pnfs_choose_layoutget_stateid ends up
choosing the open stateid.
This patch changes the client to select the stateid to use in the
LAYOUTGET earlier, when we're searching for a usable layout segment.
This way we can do it all while holding the i_lock the first time, and
ensure that we serialize any LAYOUTGET call that uses a non-layout
stateid.
This also means a rework of how LAYOUTGET replies are handled, as we
must now get the latest stateid if we want to retransmit in response
to a retryable error.
Most of those errors boil down to the fact that the layout state has
changed in some fashion. Thus, what we really want to do is to re-search
for a layout when it fails with a retryable error, so that we can avoid
reissuing the RPC at all if possible.
While the LAYOUTGET RPC is async, the initiating thread always waits for
it to complete, so it's effectively synchronous anyway. Currently, when
we need to retry a LAYOUTGET because of an error, we drive that retry
via the rpc state machine.
This means that once the call has been submitted, it runs until it
completes. So, we must move the error handling for this RPC out of the
rpc_call_done operation and into the caller.
In order to handle errors like NFS4ERR_DELAY properly, we must also
pass a pointer to the sliding timeout, which is now moved to the stack
in pnfs_update_layout.
The complicating errors are -NFS4ERR_RECALLCONFLICT and
-NFS4ERR_LAYOUTTRYLATER, as those involve a timeout after which we give
up and return NULL back to the caller. So, there is some special
handling for those errors to ensure that the layers driving the retries
can handle that appropriately.
Signed-off-by: Jeff Layton <jeff.layton@primarydata.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
2016-05-17 16:28:47 +00:00
|
|
|
__field(long, lseg)
|
2015-12-10 15:41:58 +00:00
|
|
|
__field(enum pnfs_update_layout_reason, reason)
|
|
|
|
),
|
|
|
|
TP_fast_assign(
|
|
|
|
__entry->dev = inode->i_sb->s_dev;
|
|
|
|
__entry->fileid = NFS_FILEID(inode);
|
|
|
|
__entry->fhandle = nfs_fhandle_hash(NFS_FH(inode));
|
|
|
|
__entry->pos = pos;
|
|
|
|
__entry->count = count;
|
|
|
|
__entry->iomode = iomode;
|
|
|
|
__entry->reason = reason;
|
2015-12-26 23:03:07 +00:00
|
|
|
if (lo != NULL) {
|
|
|
|
__entry->layoutstateid_seq =
|
|
|
|
be32_to_cpu(lo->plh_stateid.seqid);
|
|
|
|
__entry->layoutstateid_hash =
|
|
|
|
nfs_stateid_hash(&lo->plh_stateid);
|
|
|
|
} else {
|
|
|
|
__entry->layoutstateid_seq = 0;
|
|
|
|
__entry->layoutstateid_hash = 0;
|
|
|
|
}
|
pnfs: rework LAYOUTGET retry handling
There are several problems in the way a stateid is selected for a
LAYOUTGET operation:
We pick a stateid to use in the RPC prepare op, but that makes
it difficult to serialize LAYOUTGETs that use the open stateid. That
serialization is done in pnfs_update_layout, which occurs well before
the rpc_prepare operation.
Between those two events, the i_lock is dropped and reacquired.
pnfs_update_layout can find that the list has lsegs in it and not do any
serialization, but then later pnfs_choose_layoutget_stateid ends up
choosing the open stateid.
This patch changes the client to select the stateid to use in the
LAYOUTGET earlier, when we're searching for a usable layout segment.
This way we can do it all while holding the i_lock the first time, and
ensure that we serialize any LAYOUTGET call that uses a non-layout
stateid.
This also means a rework of how LAYOUTGET replies are handled, as we
must now get the latest stateid if we want to retransmit in response
to a retryable error.
Most of those errors boil down to the fact that the layout state has
changed in some fashion. Thus, what we really want to do is to re-search
for a layout when it fails with a retryable error, so that we can avoid
reissuing the RPC at all if possible.
While the LAYOUTGET RPC is async, the initiating thread always waits for
it to complete, so it's effectively synchronous anyway. Currently, when
we need to retry a LAYOUTGET because of an error, we drive that retry
via the rpc state machine.
This means that once the call has been submitted, it runs until it
completes. So, we must move the error handling for this RPC out of the
rpc_call_done operation and into the caller.
In order to handle errors like NFS4ERR_DELAY properly, we must also
pass a pointer to the sliding timeout, which is now moved to the stack
in pnfs_update_layout.
The complicating errors are -NFS4ERR_RECALLCONFLICT and
-NFS4ERR_LAYOUTTRYLATER, as those involve a timeout after which we give
up and return NULL back to the caller. So, there is some special
handling for those errors to ensure that the layers driving the retries
can handle that appropriately.
Signed-off-by: Jeff Layton <jeff.layton@primarydata.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
2016-05-17 16:28:47 +00:00
|
|
|
__entry->lseg = (long)lseg;
|
2015-12-10 15:41:58 +00:00
|
|
|
),
|
|
|
|
TP_printk(
|
|
|
|
"fileid=%02x:%02x:%llu fhandle=0x%08x "
|
2015-12-26 23:03:07 +00:00
|
|
|
"iomode=%s pos=%llu count=%llu "
|
pnfs: rework LAYOUTGET retry handling
There are several problems in the way a stateid is selected for a
LAYOUTGET operation:
We pick a stateid to use in the RPC prepare op, but that makes
it difficult to serialize LAYOUTGETs that use the open stateid. That
serialization is done in pnfs_update_layout, which occurs well before
the rpc_prepare operation.
Between those two events, the i_lock is dropped and reacquired.
pnfs_update_layout can find that the list has lsegs in it and not do any
serialization, but then later pnfs_choose_layoutget_stateid ends up
choosing the open stateid.
This patch changes the client to select the stateid to use in the
LAYOUTGET earlier, when we're searching for a usable layout segment.
This way we can do it all while holding the i_lock the first time, and
ensure that we serialize any LAYOUTGET call that uses a non-layout
stateid.
This also means a rework of how LAYOUTGET replies are handled, as we
must now get the latest stateid if we want to retransmit in response
to a retryable error.
Most of those errors boil down to the fact that the layout state has
changed in some fashion. Thus, what we really want to do is to re-search
for a layout when it fails with a retryable error, so that we can avoid
reissuing the RPC at all if possible.
While the LAYOUTGET RPC is async, the initiating thread always waits for
it to complete, so it's effectively synchronous anyway. Currently, when
we need to retry a LAYOUTGET because of an error, we drive that retry
via the rpc state machine.
This means that once the call has been submitted, it runs until it
completes. So, we must move the error handling for this RPC out of the
rpc_call_done operation and into the caller.
In order to handle errors like NFS4ERR_DELAY properly, we must also
pass a pointer to the sliding timeout, which is now moved to the stack
in pnfs_update_layout.
The complicating errors are -NFS4ERR_RECALLCONFLICT and
-NFS4ERR_LAYOUTTRYLATER, as those involve a timeout after which we give
up and return NULL back to the caller. So, there is some special
handling for those errors to ensure that the layers driving the retries
can handle that appropriately.
Signed-off-by: Jeff Layton <jeff.layton@primarydata.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
2016-05-17 16:28:47 +00:00
|
|
|
"layoutstateid=%d:0x%08x lseg=0x%lx (%s)",
|
2015-12-10 15:41:58 +00:00
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
|
|
(unsigned long long)__entry->fileid,
|
|
|
|
__entry->fhandle,
|
2021-10-22 20:17:03 +00:00
|
|
|
show_pnfs_layout_iomode(__entry->iomode),
|
2015-12-10 15:41:58 +00:00
|
|
|
(unsigned long long)__entry->pos,
|
2015-12-26 23:03:07 +00:00
|
|
|
(unsigned long long)__entry->count,
|
|
|
|
__entry->layoutstateid_seq, __entry->layoutstateid_hash,
|
pnfs: rework LAYOUTGET retry handling
There are several problems in the way a stateid is selected for a
LAYOUTGET operation:
We pick a stateid to use in the RPC prepare op, but that makes
it difficult to serialize LAYOUTGETs that use the open stateid. That
serialization is done in pnfs_update_layout, which occurs well before
the rpc_prepare operation.
Between those two events, the i_lock is dropped and reacquired.
pnfs_update_layout can find that the list has lsegs in it and not do any
serialization, but then later pnfs_choose_layoutget_stateid ends up
choosing the open stateid.
This patch changes the client to select the stateid to use in the
LAYOUTGET earlier, when we're searching for a usable layout segment.
This way we can do it all while holding the i_lock the first time, and
ensure that we serialize any LAYOUTGET call that uses a non-layout
stateid.
This also means a rework of how LAYOUTGET replies are handled, as we
must now get the latest stateid if we want to retransmit in response
to a retryable error.
Most of those errors boil down to the fact that the layout state has
changed in some fashion. Thus, what we really want to do is to re-search
for a layout when it fails with a retryable error, so that we can avoid
reissuing the RPC at all if possible.
While the LAYOUTGET RPC is async, the initiating thread always waits for
it to complete, so it's effectively synchronous anyway. Currently, when
we need to retry a LAYOUTGET because of an error, we drive that retry
via the rpc state machine.
This means that once the call has been submitted, it runs until it
completes. So, we must move the error handling for this RPC out of the
rpc_call_done operation and into the caller.
In order to handle errors like NFS4ERR_DELAY properly, we must also
pass a pointer to the sliding timeout, which is now moved to the stack
in pnfs_update_layout.
The complicating errors are -NFS4ERR_RECALLCONFLICT and
-NFS4ERR_LAYOUTTRYLATER, as those involve a timeout after which we give
up and return NULL back to the caller. So, there is some special
handling for those errors to ensure that the layers driving the retries
can handle that appropriately.
Signed-off-by: Jeff Layton <jeff.layton@primarydata.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
2016-05-17 16:28:47 +00:00
|
|
|
__entry->lseg,
|
2015-12-10 15:41:58 +00:00
|
|
|
show_pnfs_update_layout_reason(__entry->reason)
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
2019-07-18 13:32:17 +00:00
|
|
|
DECLARE_EVENT_CLASS(pnfs_layout_event,
|
|
|
|
TP_PROTO(struct inode *inode,
|
|
|
|
loff_t pos,
|
|
|
|
u64 count,
|
|
|
|
enum pnfs_iomode iomode,
|
|
|
|
struct pnfs_layout_hdr *lo,
|
|
|
|
struct pnfs_layout_segment *lseg
|
|
|
|
),
|
|
|
|
TP_ARGS(inode, pos, count, iomode, lo, lseg),
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(dev_t, dev)
|
|
|
|
__field(u64, fileid)
|
|
|
|
__field(u32, fhandle)
|
|
|
|
__field(loff_t, pos)
|
|
|
|
__field(u64, count)
|
|
|
|
__field(enum pnfs_iomode, iomode)
|
|
|
|
__field(int, layoutstateid_seq)
|
|
|
|
__field(u32, layoutstateid_hash)
|
|
|
|
__field(long, lseg)
|
|
|
|
),
|
|
|
|
TP_fast_assign(
|
|
|
|
__entry->dev = inode->i_sb->s_dev;
|
|
|
|
__entry->fileid = NFS_FILEID(inode);
|
|
|
|
__entry->fhandle = nfs_fhandle_hash(NFS_FH(inode));
|
|
|
|
__entry->pos = pos;
|
|
|
|
__entry->count = count;
|
|
|
|
__entry->iomode = iomode;
|
|
|
|
if (lo != NULL) {
|
|
|
|
__entry->layoutstateid_seq =
|
|
|
|
be32_to_cpu(lo->plh_stateid.seqid);
|
|
|
|
__entry->layoutstateid_hash =
|
|
|
|
nfs_stateid_hash(&lo->plh_stateid);
|
|
|
|
} else {
|
|
|
|
__entry->layoutstateid_seq = 0;
|
|
|
|
__entry->layoutstateid_hash = 0;
|
|
|
|
}
|
|
|
|
__entry->lseg = (long)lseg;
|
|
|
|
),
|
|
|
|
TP_printk(
|
|
|
|
"fileid=%02x:%02x:%llu fhandle=0x%08x "
|
|
|
|
"iomode=%s pos=%llu count=%llu "
|
|
|
|
"layoutstateid=%d:0x%08x lseg=0x%lx",
|
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
|
|
(unsigned long long)__entry->fileid,
|
|
|
|
__entry->fhandle,
|
2021-10-22 20:17:03 +00:00
|
|
|
show_pnfs_layout_iomode(__entry->iomode),
|
2019-07-18 13:32:17 +00:00
|
|
|
(unsigned long long)__entry->pos,
|
|
|
|
(unsigned long long)__entry->count,
|
|
|
|
__entry->layoutstateid_seq, __entry->layoutstateid_hash,
|
|
|
|
__entry->lseg
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
#define DEFINE_PNFS_LAYOUT_EVENT(name) \
|
|
|
|
DEFINE_EVENT(pnfs_layout_event, name, \
|
|
|
|
TP_PROTO(struct inode *inode, \
|
|
|
|
loff_t pos, \
|
|
|
|
u64 count, \
|
|
|
|
enum pnfs_iomode iomode, \
|
|
|
|
struct pnfs_layout_hdr *lo, \
|
|
|
|
struct pnfs_layout_segment *lseg \
|
|
|
|
), \
|
|
|
|
TP_ARGS(inode, pos, count, iomode, lo, lseg))
|
|
|
|
|
|
|
|
DEFINE_PNFS_LAYOUT_EVENT(pnfs_mds_fallback_pg_init_read);
|
|
|
|
DEFINE_PNFS_LAYOUT_EVENT(pnfs_mds_fallback_pg_init_write);
|
|
|
|
DEFINE_PNFS_LAYOUT_EVENT(pnfs_mds_fallback_pg_get_mirror_count);
|
|
|
|
DEFINE_PNFS_LAYOUT_EVENT(pnfs_mds_fallback_read_done);
|
|
|
|
DEFINE_PNFS_LAYOUT_EVENT(pnfs_mds_fallback_write_done);
|
|
|
|
DEFINE_PNFS_LAYOUT_EVENT(pnfs_mds_fallback_read_pagelist);
|
|
|
|
DEFINE_PNFS_LAYOUT_EVENT(pnfs_mds_fallback_write_pagelist);
|
|
|
|
|
2020-12-16 21:31:26 +00:00
|
|
|
DECLARE_EVENT_CLASS(nfs4_deviceid_event,
|
|
|
|
TP_PROTO(
|
|
|
|
const struct nfs_client *clp,
|
|
|
|
const struct nfs4_deviceid *deviceid
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_ARGS(clp, deviceid),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__string(dstaddr, clp->cl_hostname)
|
|
|
|
__array(unsigned char, deviceid, NFS4_DEVICEID4_SIZE)
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
__assign_str(dstaddr, clp->cl_hostname);
|
|
|
|
memcpy(__entry->deviceid, deviceid->data,
|
|
|
|
NFS4_DEVICEID4_SIZE);
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk(
|
|
|
|
"deviceid=%s, dstaddr=%s",
|
|
|
|
__print_hex(__entry->deviceid, NFS4_DEVICEID4_SIZE),
|
|
|
|
__get_str(dstaddr)
|
|
|
|
)
|
|
|
|
);
|
|
|
|
#define DEFINE_PNFS_DEVICEID_EVENT(name) \
|
|
|
|
DEFINE_EVENT(nfs4_deviceid_event, name, \
|
|
|
|
TP_PROTO(const struct nfs_client *clp, \
|
|
|
|
const struct nfs4_deviceid *deviceid \
|
|
|
|
), \
|
|
|
|
TP_ARGS(clp, deviceid))
|
|
|
|
DEFINE_PNFS_DEVICEID_EVENT(nfs4_deviceid_free);
|
|
|
|
|
|
|
|
DECLARE_EVENT_CLASS(nfs4_deviceid_status,
|
|
|
|
TP_PROTO(
|
|
|
|
const struct nfs_server *server,
|
|
|
|
const struct nfs4_deviceid *deviceid,
|
|
|
|
int status
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_ARGS(server, deviceid, status),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(dev_t, dev)
|
|
|
|
__field(int, status)
|
|
|
|
__string(dstaddr, server->nfs_client->cl_hostname)
|
|
|
|
__array(unsigned char, deviceid, NFS4_DEVICEID4_SIZE)
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
__entry->dev = server->s_dev;
|
|
|
|
__entry->status = status;
|
|
|
|
__assign_str(dstaddr, server->nfs_client->cl_hostname);
|
|
|
|
memcpy(__entry->deviceid, deviceid->data,
|
|
|
|
NFS4_DEVICEID4_SIZE);
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk(
|
|
|
|
"dev=%02x:%02x: deviceid=%s, dstaddr=%s, status=%d",
|
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
|
|
__print_hex(__entry->deviceid, NFS4_DEVICEID4_SIZE),
|
|
|
|
__get_str(dstaddr),
|
|
|
|
__entry->status
|
|
|
|
)
|
|
|
|
);
|
|
|
|
#define DEFINE_PNFS_DEVICEID_STATUS(name) \
|
|
|
|
DEFINE_EVENT(nfs4_deviceid_status, name, \
|
|
|
|
TP_PROTO(const struct nfs_server *server, \
|
|
|
|
const struct nfs4_deviceid *deviceid, \
|
|
|
|
int status \
|
|
|
|
), \
|
|
|
|
TP_ARGS(server, deviceid, status))
|
|
|
|
DEFINE_PNFS_DEVICEID_STATUS(nfs4_getdeviceinfo);
|
|
|
|
DEFINE_PNFS_DEVICEID_STATUS(nfs4_find_deviceid);
|
|
|
|
|
2020-01-06 20:25:11 +00:00
|
|
|
DECLARE_EVENT_CLASS(nfs4_flexfiles_io_event,
|
|
|
|
TP_PROTO(
|
|
|
|
const struct nfs_pgio_header *hdr
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_ARGS(hdr),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(unsigned long, error)
|
|
|
|
__field(dev_t, dev)
|
|
|
|
__field(u32, fhandle)
|
|
|
|
__field(u64, fileid)
|
|
|
|
__field(loff_t, offset)
|
|
|
|
__field(u32, count)
|
|
|
|
__field(int, stateid_seq)
|
|
|
|
__field(u32, stateid_hash)
|
|
|
|
__string(dstaddr, hdr->ds_clp ?
|
|
|
|
rpc_peeraddr2str(hdr->ds_clp->cl_rpcclient,
|
|
|
|
RPC_DISPLAY_ADDR) : "unknown")
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
const struct inode *inode = hdr->inode;
|
|
|
|
|
|
|
|
__entry->error = hdr->res.op_status;
|
|
|
|
__entry->fhandle = nfs_fhandle_hash(hdr->args.fh);
|
|
|
|
__entry->fileid = NFS_FILEID(inode);
|
|
|
|
__entry->dev = inode->i_sb->s_dev;
|
|
|
|
__entry->offset = hdr->args.offset;
|
|
|
|
__entry->count = hdr->args.count;
|
|
|
|
__entry->stateid_seq =
|
|
|
|
be32_to_cpu(hdr->args.stateid.seqid);
|
|
|
|
__entry->stateid_hash =
|
|
|
|
nfs_stateid_hash(&hdr->args.stateid);
|
|
|
|
__assign_str(dstaddr, hdr->ds_clp ?
|
|
|
|
rpc_peeraddr2str(hdr->ds_clp->cl_rpcclient,
|
|
|
|
RPC_DISPLAY_ADDR) : "unknown");
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk(
|
|
|
|
"error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x "
|
|
|
|
"offset=%llu count=%u stateid=%d:0x%08x dstaddr=%s",
|
|
|
|
-__entry->error,
|
2021-10-22 20:17:03 +00:00
|
|
|
show_nfs4_status(__entry->error),
|
2020-01-06 20:25:11 +00:00
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
|
|
(unsigned long long)__entry->fileid,
|
|
|
|
__entry->fhandle,
|
|
|
|
__entry->offset, __entry->count,
|
|
|
|
__entry->stateid_seq, __entry->stateid_hash,
|
|
|
|
__get_str(dstaddr)
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
#define DEFINE_NFS4_FLEXFILES_IO_EVENT(name) \
|
|
|
|
DEFINE_EVENT(nfs4_flexfiles_io_event, name, \
|
|
|
|
TP_PROTO( \
|
|
|
|
const struct nfs_pgio_header *hdr \
|
|
|
|
), \
|
|
|
|
TP_ARGS(hdr))
|
|
|
|
DEFINE_NFS4_FLEXFILES_IO_EVENT(ff_layout_read_error);
|
|
|
|
DEFINE_NFS4_FLEXFILES_IO_EVENT(ff_layout_write_error);
|
|
|
|
|
|
|
|
TRACE_EVENT(ff_layout_commit_error,
|
|
|
|
TP_PROTO(
|
|
|
|
const struct nfs_commit_data *data
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_ARGS(data),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(unsigned long, error)
|
|
|
|
__field(dev_t, dev)
|
|
|
|
__field(u32, fhandle)
|
|
|
|
__field(u64, fileid)
|
|
|
|
__field(loff_t, offset)
|
|
|
|
__field(u32, count)
|
|
|
|
__string(dstaddr, data->ds_clp ?
|
|
|
|
rpc_peeraddr2str(data->ds_clp->cl_rpcclient,
|
|
|
|
RPC_DISPLAY_ADDR) : "unknown")
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
const struct inode *inode = data->inode;
|
|
|
|
|
|
|
|
__entry->error = data->res.op_status;
|
|
|
|
__entry->fhandle = nfs_fhandle_hash(data->args.fh);
|
|
|
|
__entry->fileid = NFS_FILEID(inode);
|
|
|
|
__entry->dev = inode->i_sb->s_dev;
|
|
|
|
__entry->offset = data->args.offset;
|
|
|
|
__entry->count = data->args.count;
|
|
|
|
__assign_str(dstaddr, data->ds_clp ?
|
|
|
|
rpc_peeraddr2str(data->ds_clp->cl_rpcclient,
|
|
|
|
RPC_DISPLAY_ADDR) : "unknown");
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk(
|
|
|
|
"error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x "
|
|
|
|
"offset=%llu count=%u dstaddr=%s",
|
|
|
|
-__entry->error,
|
2021-10-22 20:17:03 +00:00
|
|
|
show_nfs4_status(__entry->error),
|
2020-01-06 20:25:11 +00:00
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
|
|
(unsigned long long)__entry->fileid,
|
|
|
|
__entry->fhandle,
|
|
|
|
__entry->offset, __entry->count,
|
|
|
|
__get_str(dstaddr)
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
2021-11-04 14:57:08 +00:00
|
|
|
TRACE_DEFINE_ENUM(NFS4_CONTENT_DATA);
|
|
|
|
TRACE_DEFINE_ENUM(NFS4_CONTENT_HOLE);
|
|
|
|
|
|
|
|
#define show_llseek_mode(what) \
|
|
|
|
__print_symbolic(what, \
|
|
|
|
{ NFS4_CONTENT_DATA, "DATA" }, \
|
|
|
|
{ NFS4_CONTENT_HOLE, "HOLE" })
|
|
|
|
|
|
|
|
#ifdef CONFIG_NFS_V4_2
|
|
|
|
TRACE_EVENT(nfs4_llseek,
|
|
|
|
TP_PROTO(
|
|
|
|
const struct inode *inode,
|
|
|
|
const struct nfs42_seek_args *args,
|
|
|
|
const struct nfs42_seek_res *res,
|
|
|
|
int error
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_ARGS(inode, args, res, error),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(unsigned long, error)
|
|
|
|
__field(u32, fhandle)
|
|
|
|
__field(u32, fileid)
|
|
|
|
__field(dev_t, dev)
|
|
|
|
__field(int, stateid_seq)
|
|
|
|
__field(u32, stateid_hash)
|
|
|
|
__field(loff_t, offset_s)
|
|
|
|
__field(u32, what)
|
|
|
|
__field(loff_t, offset_r)
|
|
|
|
__field(u32, eof)
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
const struct nfs_inode *nfsi = NFS_I(inode);
|
|
|
|
const struct nfs_fh *fh = args->sa_fh;
|
|
|
|
|
|
|
|
__entry->fileid = nfsi->fileid;
|
|
|
|
__entry->dev = inode->i_sb->s_dev;
|
|
|
|
__entry->fhandle = nfs_fhandle_hash(fh);
|
|
|
|
__entry->offset_s = args->sa_offset;
|
|
|
|
__entry->stateid_seq =
|
|
|
|
be32_to_cpu(args->sa_stateid.seqid);
|
|
|
|
__entry->stateid_hash =
|
|
|
|
nfs_stateid_hash(&args->sa_stateid);
|
|
|
|
__entry->what = args->sa_what;
|
|
|
|
if (error) {
|
|
|
|
__entry->error = -error;
|
|
|
|
__entry->offset_r = 0;
|
|
|
|
__entry->eof = 0;
|
|
|
|
} else {
|
|
|
|
__entry->error = 0;
|
|
|
|
__entry->offset_r = res->sr_offset;
|
|
|
|
__entry->eof = res->sr_eof;
|
|
|
|
}
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk(
|
|
|
|
"error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x "
|
|
|
|
"stateid=%d:0x%08x offset_s=%llu what=%s "
|
|
|
|
"offset_r=%llu eof=%u",
|
|
|
|
-__entry->error,
|
|
|
|
show_nfs4_status(__entry->error),
|
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
|
|
(unsigned long long)__entry->fileid,
|
|
|
|
__entry->fhandle,
|
|
|
|
__entry->stateid_seq, __entry->stateid_hash,
|
|
|
|
__entry->offset_s,
|
|
|
|
show_llseek_mode(__entry->what),
|
|
|
|
__entry->offset_r,
|
|
|
|
__entry->eof
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
#endif /* CONFIG_NFS_V4_2 */
|
2020-01-06 20:25:11 +00:00
|
|
|
|
2013-08-14 19:31:28 +00:00
|
|
|
#endif /* CONFIG_NFS_V4_1 */
|
|
|
|
|
2013-08-09 15:51:26 +00:00
|
|
|
#endif /* _TRACE_NFS4_H */
|
|
|
|
|
|
|
|
#undef TRACE_INCLUDE_PATH
|
|
|
|
#define TRACE_INCLUDE_PATH .
|
|
|
|
#define TRACE_INCLUDE_FILE nfs4trace
|
|
|
|
/* This part must be outside protection */
|
|
|
|
#include <trace/define_trace.h>
|