Skip to content

Commit 80125d4

Browse files
chuckleveramschuma-ntap
authored andcommitted
SUNRPC: Remove some dprintk() call sites from auth functions
Clean up: Reduce dprintk noise by removing dprintk() call sites from hot path that do not report exceptions. These are usually replaceable with function graph tracing. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
1 parent f23f658 commit 80125d4

File tree

2 files changed

+1
-37
lines changed

2 files changed

+1
-37
lines changed

net/sunrpc/auth.c

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@
1717
#include <linux/sunrpc/gss_api.h>
1818
#include <linux/spinlock.h>
1919

20-
#if IS_ENABLED(CONFIG_SUNRPC_DEBUG)
21-
# define RPCDBG_FACILITY RPCDBG_AUTH
22-
#endif
23-
2420
#define RPC_CREDCACHE_DEFAULT_HASHBITS (4)
2521
struct rpc_cred_cache {
2622
struct hlist_head *hashtable;
@@ -267,8 +263,6 @@ rpcauth_list_flavors(rpc_authflavor_t *array, int size)
267263
}
268264
}
269265
rcu_read_unlock();
270-
271-
dprintk("RPC: %s returns %d\n", __func__, result);
272266
return result;
273267
}
274268
EXPORT_SYMBOL_GPL(rpcauth_list_flavors);
@@ -636,9 +630,6 @@ rpcauth_lookupcred(struct rpc_auth *auth, int flags)
636630
struct rpc_cred *ret;
637631
const struct cred *cred = current_cred();
638632

639-
dprintk("RPC: looking up %s cred\n",
640-
auth->au_ops->au_name);
641-
642633
memset(&acred, 0, sizeof(acred));
643634
acred.cred = cred;
644635
ret = auth->au_ops->lookup_cred(auth, &acred, flags);
@@ -670,8 +661,6 @@ rpcauth_bind_root_cred(struct rpc_task *task, int lookupflags)
670661
};
671662
struct rpc_cred *ret;
672663

673-
dprintk("RPC: %5u looking up %s cred\n",
674-
task->tk_pid, task->tk_client->cl_auth->au_ops->au_name);
675664
ret = auth->au_ops->lookup_cred(auth, &acred, lookupflags);
676665
put_cred(acred.cred);
677666
return ret;
@@ -688,8 +677,6 @@ rpcauth_bind_machine_cred(struct rpc_task *task, int lookupflags)
688677

689678
if (!acred.principal)
690679
return NULL;
691-
dprintk("RPC: %5u looking up %s machine cred\n",
692-
task->tk_pid, task->tk_client->cl_auth->au_ops->au_name);
693680
return auth->au_ops->lookup_cred(auth, &acred, lookupflags);
694681
}
695682

@@ -698,8 +685,6 @@ rpcauth_bind_new_cred(struct rpc_task *task, int lookupflags)
698685
{
699686
struct rpc_auth *auth = task->tk_client->cl_auth;
700687

701-
dprintk("RPC: %5u looking up %s cred\n",
702-
task->tk_pid, auth->au_ops->au_name);
703688
return rpcauth_lookupcred(auth, lookupflags);
704689
}
705690

@@ -776,9 +761,6 @@ rpcauth_marshcred(struct rpc_task *task, __be32 *p)
776761
{
777762
struct rpc_cred *cred = task->tk_rqstp->rq_cred;
778763

779-
dprintk("RPC: %5u marshaling %s cred %p\n",
780-
task->tk_pid, cred->cr_auth->au_ops->au_name, cred);
781-
782764
return cred->cr_ops->crmarshal(task, p);
783765
}
784766

@@ -787,9 +769,6 @@ rpcauth_checkverf(struct rpc_task *task, __be32 *p)
787769
{
788770
struct rpc_cred *cred = task->tk_rqstp->rq_cred;
789771

790-
dprintk("RPC: %5u validating %s cred %p\n",
791-
task->tk_pid, cred->cr_auth->au_ops->au_name, cred);
792-
793772
return cred->cr_ops->crvalidate(task, p);
794773
}
795774

@@ -808,8 +787,6 @@ rpcauth_wrap_req(struct rpc_task *task, kxdreproc_t encode, void *rqstp,
808787
{
809788
struct rpc_cred *cred = task->tk_rqstp->rq_cred;
810789

811-
dprintk("RPC: %5u using %s cred %p to wrap rpc data\n",
812-
task->tk_pid, cred->cr_ops->cr_name, cred);
813790
if (cred->cr_ops->crwrap_req)
814791
return cred->cr_ops->crwrap_req(task, encode, rqstp, data, obj);
815792
/* By default, we encode the arguments normally. */
@@ -833,8 +810,6 @@ rpcauth_unwrap_resp(struct rpc_task *task, kxdrdproc_t decode, void *rqstp,
833810
{
834811
struct rpc_cred *cred = task->tk_rqstp->rq_cred;
835812

836-
dprintk("RPC: %5u using %s cred %p to unwrap rpc data\n",
837-
task->tk_pid, cred->cr_ops->cr_name, cred);
838813
if (cred->cr_ops->crunwrap_resp)
839814
return cred->cr_ops->crunwrap_resp(task, decode, rqstp,
840815
data, obj);
@@ -865,8 +840,6 @@ rpcauth_refreshcred(struct rpc_task *task)
865840
goto out;
866841
cred = task->tk_rqstp->rq_cred;
867842
}
868-
dprintk("RPC: %5u refreshing %s cred %p\n",
869-
task->tk_pid, cred->cr_auth->au_ops->au_name, cred);
870843

871844
err = cred->cr_ops->crrefresh(task);
872845
out:
@@ -880,8 +853,6 @@ rpcauth_invalcred(struct rpc_task *task)
880853
{
881854
struct rpc_cred *cred = task->tk_rqstp->rq_cred;
882855

883-
dprintk("RPC: %5u invalidating %s cred %p\n",
884-
task->tk_pid, cred->cr_auth->au_ops->au_name, cred);
885856
if (cred)
886857
clear_bit(RPCAUTH_CRED_UPTODATE, &cred->cr_flags);
887858
}

net/sunrpc/auth_unix.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,13 @@ static mempool_t *unix_pool;
2828
static struct rpc_auth *
2929
unx_create(const struct rpc_auth_create_args *args, struct rpc_clnt *clnt)
3030
{
31-
dprintk("RPC: creating UNIX authenticator for client %p\n",
32-
clnt);
3331
refcount_inc(&unix_auth.au_count);
3432
return &unix_auth;
3533
}
3634

3735
static void
3836
unx_destroy(struct rpc_auth *auth)
3937
{
40-
dprintk("RPC: destroying UNIX authenticator %p\n", auth);
4138
}
4239

4340
/*
@@ -48,10 +45,6 @@ unx_lookup_cred(struct rpc_auth *auth, struct auth_cred *acred, int flags)
4845
{
4946
struct rpc_cred *ret = mempool_alloc(unix_pool, GFP_NOFS);
5047

51-
dprintk("RPC: allocating UNIX cred for uid %d gid %d\n",
52-
from_kuid(&init_user_ns, acred->cred->fsuid),
53-
from_kgid(&init_user_ns, acred->cred->fsgid));
54-
5548
rpcauth_init_cred(ret, acred, auth, &unix_credops);
5649
ret->cr_flags = 1UL << RPCAUTH_CRED_UPTODATE;
5750
return ret;
@@ -61,7 +54,7 @@ static void
6154
unx_free_cred_callback(struct rcu_head *head)
6255
{
6356
struct rpc_cred *rpc_cred = container_of(head, struct rpc_cred, cr_rcu);
64-
dprintk("RPC: unx_free_cred %p\n", rpc_cred);
57+
6558
put_cred(rpc_cred->cr_cred);
6659
mempool_free(rpc_cred, unix_pool);
6760
}

0 commit comments

Comments
 (0)