Commit cf749f3c authored by Trond Myklebust's avatar Trond Myklebust Committed by Chuck Lever

nfsd: Add tracepoints for exp_find_key() and exp_get_by_name()

Add tracepoints for upcalls.
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
parent f01274a9
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include "netns.h" #include "netns.h"
#include "pnfs.h" #include "pnfs.h"
#include "filecache.h" #include "filecache.h"
#include "trace.h"
#define NFSDDBG_FACILITY NFSDDBG_EXPORT #define NFSDDBG_FACILITY NFSDDBG_EXPORT
...@@ -832,8 +833,10 @@ exp_find_key(struct cache_detail *cd, struct auth_domain *clp, int fsid_type, ...@@ -832,8 +833,10 @@ exp_find_key(struct cache_detail *cd, struct auth_domain *clp, int fsid_type,
if (ek == NULL) if (ek == NULL)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
err = cache_check(cd, &ek->h, reqp); err = cache_check(cd, &ek->h, reqp);
if (err) if (err) {
trace_nfsd_exp_find_key(&key, err);
return ERR_PTR(err); return ERR_PTR(err);
}
return ek; return ek;
} }
...@@ -855,8 +858,10 @@ exp_get_by_name(struct cache_detail *cd, struct auth_domain *clp, ...@@ -855,8 +858,10 @@ exp_get_by_name(struct cache_detail *cd, struct auth_domain *clp,
if (exp == NULL) if (exp == NULL)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
err = cache_check(cd, &exp->h, reqp); err = cache_check(cd, &exp->h, reqp);
if (err) if (err) {
trace_nfsd_exp_get_by_name(&key, err);
return ERR_PTR(err); return ERR_PTR(err);
}
return exp; return exp;
} }
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#define _NFSD_TRACE_H #define _NFSD_TRACE_H
#include <linux/tracepoint.h> #include <linux/tracepoint.h>
#include "export.h"
#include "nfsfh.h" #include "nfsfh.h"
TRACE_EVENT(nfsd_compound, TRACE_EVENT(nfsd_compound,
...@@ -80,6 +81,51 @@ DEFINE_EVENT(nfsd_fh_err_class, nfsd_##name, \ ...@@ -80,6 +81,51 @@ DEFINE_EVENT(nfsd_fh_err_class, nfsd_##name, \
DEFINE_NFSD_FH_ERR_EVENT(set_fh_dentry_badexport); DEFINE_NFSD_FH_ERR_EVENT(set_fh_dentry_badexport);
DEFINE_NFSD_FH_ERR_EVENT(set_fh_dentry_badhandle); DEFINE_NFSD_FH_ERR_EVENT(set_fh_dentry_badhandle);
TRACE_EVENT(nfsd_exp_find_key,
TP_PROTO(const struct svc_expkey *key,
int status),
TP_ARGS(key, status),
TP_STRUCT__entry(
__field(int, fsidtype)
__array(u32, fsid, 6)
__string(auth_domain, key->ek_client->name)
__field(int, status)
),
TP_fast_assign(
__entry->fsidtype = key->ek_fsidtype;
memcpy(__entry->fsid, key->ek_fsid, 4*6);
__assign_str(auth_domain, key->ek_client->name);
__entry->status = status;
),
TP_printk("fsid=%x::%s domain=%s status=%d",
__entry->fsidtype,
__print_array(__entry->fsid, 6, 4),
__get_str(auth_domain),
__entry->status
)
);
TRACE_EVENT(nfsd_exp_get_by_name,
TP_PROTO(const struct svc_export *key,
int status),
TP_ARGS(key, status),
TP_STRUCT__entry(
__string(path, key->ex_path.dentry->d_name.name)
__string(auth_domain, key->ex_client->name)
__field(int, status)
),
TP_fast_assign(
__assign_str(path, key->ex_path.dentry->d_name.name);
__assign_str(auth_domain, key->ex_client->name);
__entry->status = status;
),
TP_printk("path=%s domain=%s status=%d",
__get_str(path),
__get_str(auth_domain),
__entry->status
)
);
DECLARE_EVENT_CLASS(nfsd_io_class, DECLARE_EVENT_CLASS(nfsd_io_class,
TP_PROTO(struct svc_rqst *rqstp, TP_PROTO(struct svc_rqst *rqstp,
struct svc_fh *fhp, struct svc_fh *fhp,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment