All of lore.kernel.org
 help / color / mirror / Atom feed
* Use of uninitialized value $line in pattern match
       [not found] <20180305210022.18859.37483.stgit@klimt.1015granger.net>
@ 2018-03-05 21:06 ` Chuck Lever
  2018-03-06  3:00   ` Joe Perches
  0 siblings, 1 reply; 4+ messages in thread
From: Chuck Lever @ 2018-03-05 21:06 UTC (permalink / raw)
  To: Andy Whitcroft, Joe Perches; +Cc: Linux NFS Mailing List

I think I'm seeing a parsing error in v4.16-rc4 scripts/checkpatch.pl:

Use of uninitialized value $line in pattern match (m//) at =
scripts/checkpatch.pl line 1300.
Use of uninitialized value $line in pattern match (m//) at =
scripts/checkpatch.pl line 1300.
Use of uninitialized value $line in pattern match (m//) at =
scripts/checkpatch.pl line 1300.
Use of uninitialized value $line in pattern match (m//) at =
scripts/checkpatch.pl line 1300.
Use of uninitialized value $line in pattern match (m//) at =
scripts/checkpatch.pl line 1300.
Use of uninitialized value $line in pattern match (m//) at =
scripts/checkpatch.pl line 1300.
Use of uninitialized value $line in pattern match (m//) at =
scripts/checkpatch.pl line 1300.
Use of uninitialized value $line in pattern match (m//) at =
scripts/checkpatch.pl line 1300.
Use of uninitialized value $line in pattern match (m//) at =
scripts/checkpatch.pl line 1300.
Use of uninitialized value $line in pattern match (m//) at =
scripts/checkpatch.pl line 1300.
Use of uninitialized value $line in pattern match (m//) at =
scripts/checkpatch.pl line 1300.
Use of uninitialized value $line in pattern match (m//) at =
scripts/checkpatch.pl line 1300.
Use of uninitialized value $line in pattern match (m//) at =
scripts/checkpatch.pl line 1300.
Use of uninitialized value $line in pattern match (m//) at =
scripts/checkpatch.pl line 1300.
Use of uninitialized value $line in pattern match (m//) at =
scripts/checkpatch.pl line 1300.
Use of uninitialized value $line in pattern match (m//) at =
scripts/checkpatch.pl line 1300.
Use of uninitialized value $line in pattern match (m//) at =
scripts/checkpatch.pl line 1300.
Use of uninitialized value $line in pattern match (m//) at =
scripts/checkpatch.pl line 1300.
Use of uninitialized value $line in pattern match (m//) at =
scripts/checkpatch.pl line 1300.
Use of uninitialized value $line in pattern match (m//) at =
scripts/checkpatch.pl line 1300.
Use of uninitialized value $line in pattern match (m//) at =
scripts/checkpatch.pl line 1300.
Use of uninitialized value $line in pattern match (m//) at =
scripts/checkpatch.pl line 1300.
Use of uninitialized value $line in pattern match (m//) at =
scripts/checkpatch.pl line 1300.
Use of uninitialized value $line in pattern match (m//) at =
scripts/checkpatch.pl line 1300.
Use of uninitialized value $line in pattern match (m//) at =
scripts/checkpatch.pl line 1300.
Use of uninitialized value $line in pattern match (m//) at =
scripts/checkpatch.pl line 1300.
Use of uninitialized value $line in pattern match (m//) at =
scripts/checkpatch.pl line 1300.
total: 0 errors, 0 warnings, 69 lines checked

patches-nfsd-rdma-for-4.17/nfsd-compound-trace-points has no obvious =
style problems and is ready for submission.



nfsd: Trace NFSv4 COMPOUND execution

This helps record the identity and timing of the ops in each NFSv4
COMPOUND, replacing dprintk calls that did much the same thing.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
fs/nfsd/nfs4proc.c |    9 +++------
fs/nfsd/trace.h    |   39 +++++++++++++++++++++++++++++++++++++++
2 files changed, 42 insertions(+), 6 deletions(-)

diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
index 39016b6..0df37e0 100644
--- a/fs/nfsd/nfs4proc.c
+++ b/fs/nfsd/nfs4proc.c
@@ -1722,12 +1722,10 @@ static void svcxdr_init_encode(struct svc_rqst =
*rqstp,
		goto encode_op;
	}

+	trace_nfsd_compound(rqstp, args->opcnt);
	while (!status && resp->opcnt < args->opcnt) {
		op =3D &args->ops[resp->opcnt++];

-		dprintk("nfsv4 compound op #%d/%d: %d (%s)\n",
-			resp->opcnt, args->opcnt, op->opnum,
-			nfsd4_op_name(op->opnum));
		/*
		 * The XDR decode routines may have pre-set op->status;
		 * for example, if there is a miscellaneous XDR error
@@ -1801,9 +1799,8 @@ static void svcxdr_init_encode(struct svc_rqst =
*rqstp,
			status =3D op->status;
		}

-		dprintk("nfsv4 compound op %p opcnt %d #%d: %d: status =
%d\n",
-			args->ops, args->opcnt, resp->opcnt, op->opnum,
-			be32_to_cpu(status));
+		trace_nfsd_compound_status(args->opcnt, resp->opcnt, =
status,
+					   nfsd4_op_name(op->opnum));

		nfsd4_cstate_clear_replay(cstate);
		nfsd4_increment_op_stats(op->opnum);
diff --git a/fs/nfsd/trace.h b/fs/nfsd/trace.h
index a8bbd9d..80933e4 100644
--- a/fs/nfsd/trace.h
+++ b/fs/nfsd/trace.h
@@ -11,6 +11,45 @@
#include <linux/tracepoint.h>
#include "nfsfh.h"

+TRACE_EVENT(nfsd_compound,
+	TP_PROTO(const struct svc_rqst *rqst,
+		 u32 args_opcnt),
+	TP_ARGS(rqst, args_opcnt),
+	TP_STRUCT__entry(
+		__field(u32, xid)
+		__field(u32, args_opcnt)
+	),
+	TP_fast_assign(
+		__entry->xid =3D be32_to_cpu(rqst->rq_xid);
+		__entry->args_opcnt =3D args_opcnt;
+	),
+	TP_printk("xid=3D0x%08x opcnt=3D%u",
+		__entry->xid, __entry->args_opcnt)
+)
+
+TRACE_EVENT(nfsd_compound_status,
+	TP_PROTO(u32 args_opcnt,
+		 u32 resp_opcnt,
+		 __be32 status,
+		 const char *name),
+	TP_ARGS(args_opcnt, resp_opcnt, status, name),
+	TP_STRUCT__entry(
+		__field(u32, args_opcnt)
+		__field(u32, resp_opcnt)
+		__field(int, status)
+		__string(name, name)
+	),
+	TP_fast_assign(
+		__entry->args_opcnt =3D args_opcnt;
+		__entry->resp_opcnt =3D resp_opcnt;
+		__entry->status =3D be32_to_cpu(status);
+		__assign_str(name, name);
+	),
+	TP_printk("op=3D%u/%u %s status=3D%d",
+		__entry->resp_opcnt, __entry->args_opcnt,
+		__get_str(name), __entry->status)
+)
+
DECLARE_EVENT_CLASS(nfsd_io_class,
	TP_PROTO(struct svc_rqst *rqstp,
		 struct svc_fh	*fhp,


--
Chuck Lever




^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: Use of uninitialized value $line in pattern match
  2018-03-05 21:06 ` Use of uninitialized value $line in pattern match Chuck Lever
@ 2018-03-06  3:00   ` Joe Perches
  2018-03-06 15:02     ` Chuck Lever
  0 siblings, 1 reply; 4+ messages in thread
From: Joe Perches @ 2018-03-06  3:00 UTC (permalink / raw)
  To: Chuck Lever, Andy Whitcroft; +Cc: Linux NFS Mailing List

On Mon, 2018-03-05 at 16:06 -0500, Chuck Lever wrote:
> I think I'm seeing a parsing error in v4.16-rc4 scripts/checkpatch.pl:

What I see is your patch is corrupt as the first
char of the first context line of the actual patch
		goto encode_op;
does not have a leading space but has a tab.

When I run the below I get the expected output (nothing)
---
nfsd: Trace NFSv4 COMPOUND execution

This helps record the identity and timing of the ops in each NFSv4
COMPOUND, replacing dprintk calls that did much the same thing.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
fs/nfsd/nfs4proc.c |    9 +++------
fs/nfsd/trace.h    |   39 +++++++++++++++++++++++++++++++++++++++
2 files changed, 42 insertions(+), 6 deletions(-)

diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
index 39016b6..0df37e0 100644
--- a/fs/nfsd/nfs4proc.c
+++ b/fs/nfsd/nfs4proc.c
@@ -1722,12 +1722,10 @@ static void svcxdr_init_encode(struct svc_rqst *rqstp,
 		goto encode_op;
 	}
 
+	trace_nfsd_compound(rqstp, args->opcnt);
 	while (!status && resp->opcnt < args->opcnt) {
 		op = &args->ops[resp->opcnt++];
 
-		dprintk("nfsv4 compound op #%d/%d: %d (%s)\n",
-			resp->opcnt, args->opcnt, op->opnum,
-			nfsd4_op_name(op->opnum));
 		/*
 		 * The XDR decode routines may have pre-set op->status;
 		 * for example, if there is a miscellaneous XDR error
@@ -1801,9 +1799,8 @@ static void svcxdr_init_encode(struct svc_rqst *rqstp,
 			status = op->status;
 		}
 
-		dprintk("nfsv4 compound op %p opcnt %d #%d: %d: status %d\n",
-			args->ops, args->opcnt, resp->opcnt, op->opnum,
-			be32_to_cpu(status));
+		trace_nfsd_compound_status(args->opcnt, resp->opcnt, status,
+					   nfsd4_op_name(op->opnum));
 
 		nfsd4_cstate_clear_replay(cstate);
 		nfsd4_increment_op_stats(op->opnum);
diff --git a/fs/nfsd/trace.h b/fs/nfsd/trace.h
index a8bbd9d..80933e4 100644
--- a/fs/nfsd/trace.h
+++ b/fs/nfsd/trace.h
@@ -11,6 +11,45 @@
 #include <linux/tracepoint.h>
 #include "nfsfh.h"
 
+TRACE_EVENT(nfsd_compound,
+	TP_PROTO(const struct svc_rqst *rqst,
+		 u32 args_opcnt),
+	TP_ARGS(rqst, args_opcnt),
+	TP_STRUCT__entry(
+		__field(u32, xid)
+		__field(u32, args_opcnt)
+	),
+	TP_fast_assign(
+		__entry->xid = be32_to_cpu(rqst->rq_xid);
+		__entry->args_opcnt = args_opcnt;
+	),
+	TP_printk("xid=0x%08x opcnt=%u",
+		__entry->xid, __entry->args_opcnt)
+)
+
+TRACE_EVENT(nfsd_compound_status,
+	TP_PROTO(u32 args_opcnt,
+		 u32 resp_opcnt,
+		 __be32 status,
+		 const char *name),
+	TP_ARGS(args_opcnt, resp_opcnt, status, name),
+	TP_STRUCT__entry(
+		__field(u32, args_opcnt)
+		__field(u32, resp_opcnt)
+		__field(int, status)
+		__string(name, name)
+	),
+	TP_fast_assign(
+		__entry->args_opcnt = args_opcnt;
+		__entry->resp_opcnt = resp_opcnt;
+		__entry->status = be32_to_cpu(status);
+		__assign_str(name, name);
+	),
+	TP_printk("op=%u/%u %s status=%d",
+		__entry->resp_opcnt, __entry->args_opcnt,
+		__get_str(name), __entry->status)
+)
+
 DECLARE_EVENT_CLASS(nfsd_io_class,
 	TP_PROTO(struct svc_rqst *rqstp,
 		 struct svc_fh	*fhp,


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: Use of uninitialized value $line in pattern match
  2018-03-06  3:00   ` Joe Perches
@ 2018-03-06 15:02     ` Chuck Lever
  2018-03-06 15:07       ` Joe Perches
  0 siblings, 1 reply; 4+ messages in thread
From: Chuck Lever @ 2018-03-06 15:02 UTC (permalink / raw)
  To: Joe Perches; +Cc: Andy Whitcroft, Linux NFS Mailing List



> On Mar 5, 2018, at 10:00 PM, Joe Perches <joe@perches.com> wrote:
>=20
> On Mon, 2018-03-05 at 16:06 -0500, Chuck Lever wrote:
>> I think I'm seeing a parsing error in v4.16-rc4 =
scripts/checkpatch.pl:
>=20
> What I see is your patch is corrupt as the first
> char of the first context line of the actual patch
> 		goto encode_op;
> does not have a leading space but has a tab.

The patch is generated by:

$ stg export

I confirmed that the e-mailed copy is missing the blank,
but that my local copy of the patch has a blank there.
When I do this:

$ scripts/checkpatch.pl =
patches-nfsd-rdma-for-4.17/nfsd-compound-trace-points

I still get the error output. checkpatch.pl does not misbehave
with the 27 other patches in that directory.

Is there any debugging output that would be helpful to you?
This is v4.16-rc4.


> When I run the below I get the expected output (nothing)

Then the patch is ready to submit.


> ---
> nfsd: Trace NFSv4 COMPOUND execution
>=20
> This helps record the identity and timing of the ops in each NFSv4
> COMPOUND, replacing dprintk calls that did much the same thing.
>=20
> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
> ---
> fs/nfsd/nfs4proc.c |    9 +++------
> fs/nfsd/trace.h    |   39 +++++++++++++++++++++++++++++++++++++++
> 2 files changed, 42 insertions(+), 6 deletions(-)
>=20
> diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
> index 39016b6..0df37e0 100644
> --- a/fs/nfsd/nfs4proc.c
> +++ b/fs/nfsd/nfs4proc.c
> @@ -1722,12 +1722,10 @@ static void svcxdr_init_encode(struct svc_rqst =
*rqstp,
> 		goto encode_op;
> 	}
>=20
> +	trace_nfsd_compound(rqstp, args->opcnt);
> 	while (!status && resp->opcnt < args->opcnt) {
> 		op =3D &args->ops[resp->opcnt++];
>=20
> -		dprintk("nfsv4 compound op #%d/%d: %d (%s)\n",
> -			resp->opcnt, args->opcnt, op->opnum,
> -			nfsd4_op_name(op->opnum));
> 		/*
> 		 * The XDR decode routines may have pre-set op->status;
> 		 * for example, if there is a miscellaneous XDR error
> @@ -1801,9 +1799,8 @@ static void svcxdr_init_encode(struct svc_rqst =
*rqstp,
> 			status =3D op->status;
> 		}
>=20
> -		dprintk("nfsv4 compound op %p opcnt %d #%d: %d: status =
%d\n",
> -			args->ops, args->opcnt, resp->opcnt, op->opnum,
> -			be32_to_cpu(status));
> +		trace_nfsd_compound_status(args->opcnt, resp->opcnt, =
status,
> +					   nfsd4_op_name(op->opnum));
>=20
> 		nfsd4_cstate_clear_replay(cstate);
> 		nfsd4_increment_op_stats(op->opnum);
> diff --git a/fs/nfsd/trace.h b/fs/nfsd/trace.h
> index a8bbd9d..80933e4 100644
> --- a/fs/nfsd/trace.h
> +++ b/fs/nfsd/trace.h
> @@ -11,6 +11,45 @@
> #include <linux/tracepoint.h>
> #include "nfsfh.h"
>=20
> +TRACE_EVENT(nfsd_compound,
> +	TP_PROTO(const struct svc_rqst *rqst,
> +		 u32 args_opcnt),
> +	TP_ARGS(rqst, args_opcnt),
> +	TP_STRUCT__entry(
> +		__field(u32, xid)
> +		__field(u32, args_opcnt)
> +	),
> +	TP_fast_assign(
> +		__entry->xid =3D be32_to_cpu(rqst->rq_xid);
> +		__entry->args_opcnt =3D args_opcnt;
> +	),
> +	TP_printk("xid=3D0x%08x opcnt=3D%u",
> +		__entry->xid, __entry->args_opcnt)
> +)
> +
> +TRACE_EVENT(nfsd_compound_status,
> +	TP_PROTO(u32 args_opcnt,
> +		 u32 resp_opcnt,
> +		 __be32 status,
> +		 const char *name),
> +	TP_ARGS(args_opcnt, resp_opcnt, status, name),
> +	TP_STRUCT__entry(
> +		__field(u32, args_opcnt)
> +		__field(u32, resp_opcnt)
> +		__field(int, status)
> +		__string(name, name)
> +	),
> +	TP_fast_assign(
> +		__entry->args_opcnt =3D args_opcnt;
> +		__entry->resp_opcnt =3D resp_opcnt;
> +		__entry->status =3D be32_to_cpu(status);
> +		__assign_str(name, name);
> +	),
> +	TP_printk("op=3D%u/%u %s status=3D%d",
> +		__entry->resp_opcnt, __entry->args_opcnt,
> +		__get_str(name), __entry->status)
> +)
> +
> DECLARE_EVENT_CLASS(nfsd_io_class,
> 	TP_PROTO(struct svc_rqst *rqstp,
> 		 struct svc_fh	*fhp,
>=20

--
Chuck Lever




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Use of uninitialized value $line in pattern match
  2018-03-06 15:02     ` Chuck Lever
@ 2018-03-06 15:07       ` Joe Perches
  0 siblings, 0 replies; 4+ messages in thread
From: Joe Perches @ 2018-03-06 15:07 UTC (permalink / raw)
  To: Chuck Lever; +Cc: Andy Whitcroft, Linux NFS Mailing List

On Tue, 2018-03-06 at 10:02 -0500, Chuck Lever wrote:
> > On Mar 5, 2018, at 10:00 PM, Joe Perches <joe@perches.com> wrote:
> > 
> > On Mon, 2018-03-05 at 16:06 -0500, Chuck Lever wrote:
> > > I think I'm seeing a parsing error in v4.16-rc4 scripts/checkpatch.pl:
> > 
> > What I see is your patch is corrupt as the first
> > char of the first context line of the actual patch
> > 		goto encode_op;
> > does not have a leading space but has a tab.
> 
> The patch is generated by:
> 
> $ stg export
> 
> I confirmed that the e-mailed copy is missing the blank,
> but that my local copy of the patch has a blank there.
> When I do this:
> 
> $ scripts/checkpatch.pl patches-nfsd-rdma-for-4.17/nfsd-compound-trace-points
> 
> I still get the error output. checkpatch.pl does not misbehave
> with the 27 other patches in that directory.
> 
> Is there any debugging output that would be helpful to you?
> This is v4.16-rc4.

Please send me your patch as an attachment.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-03-06 15:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20180305210022.18859.37483.stgit@klimt.1015granger.net>
2018-03-05 21:06 ` Use of uninitialized value $line in pattern match Chuck Lever
2018-03-06  3:00   ` Joe Perches
2018-03-06 15:02     ` Chuck Lever
2018-03-06 15:07       ` Joe Perches

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.