linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dyndbg: fix parsing file query without a line-range suffix
@ 2021-04-14 21:24 Shuo Chen
  2021-04-26 16:38 ` Eric Dumazet
  0 siblings, 1 reply; 4+ messages in thread
From: Shuo Chen @ 2021-04-14 21:24 UTC (permalink / raw)
  To: Jim Cromie, Jason Baron, Greg Kroah-Hartman; +Cc: linux-kernel, Shuo Chen

From: Shuo Chen <shuochen@google.com>

Query like 'file tcp_input.c line 1234 +p' was broken by
commit aaebe329bff0 ("dyndbg: accept 'file foo.c:func1' and 'file
foo.c:10-100'") because a file name without a ':' now makes the loop in
ddebug_parse_query() exits early before parsing the 'line 1234' part.
As a result, all pr_debug() in tcp_input.c will be enabled, instead of only
the one on line 1234.  Changing 'break' to 'continue' fixes this.

Fixes: aaebe329bff0 ("dyndbg: accept 'file foo.c:func1' and 'file foo.c:10-100'")
Signed-off-by: Shuo Chen <shuochen@google.com>
---
 lib/dynamic_debug.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c
index c70d6347afa2..921d0a654243 100644
--- a/lib/dynamic_debug.c
+++ b/lib/dynamic_debug.c
@@ -396,7 +396,7 @@ static int ddebug_parse_query(char *words[], int nwords,
 			/* tail :$info is function or line-range */
 			fline = strchr(query->filename, ':');
 			if (!fline)
-				break;
+				continue;
 			*fline++ = '\0';
 			if (isalpha(*fline) || *fline == '*' || *fline == '?') {
 				/* take as function name */
-- 
2.31.1.295.g9ea45b61b8-goog


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

* Re: [PATCH] dyndbg: fix parsing file query without a line-range suffix
  2021-04-14 21:24 [PATCH] dyndbg: fix parsing file query without a line-range suffix Shuo Chen
@ 2021-04-26 16:38 ` Eric Dumazet
  2021-04-29 21:08   ` Jason Baron
  0 siblings, 1 reply; 4+ messages in thread
From: Eric Dumazet @ 2021-04-26 16:38 UTC (permalink / raw)
  To: Shuo Chen, Jim Cromie, Jason Baron, Greg Kroah-Hartman
  Cc: linux-kernel, Shuo Chen



On 4/14/21 11:24 PM, Shuo Chen wrote:
> From: Shuo Chen <shuochen@google.com>
> 
> Query like 'file tcp_input.c line 1234 +p' was broken by
> commit aaebe329bff0 ("dyndbg: accept 'file foo.c:func1' and 'file
> foo.c:10-100'") because a file name without a ':' now makes the loop in
> ddebug_parse_query() exits early before parsing the 'line 1234' part.
> As a result, all pr_debug() in tcp_input.c will be enabled, instead of only
> the one on line 1234.  Changing 'break' to 'continue' fixes this.
> 
> Fixes: aaebe329bff0 ("dyndbg: accept 'file foo.c:func1' and 'file foo.c:10-100'")
> Signed-off-by: Shuo Chen <shuochen@google.com>
> ---
>  lib/dynamic_debug.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c
> index c70d6347afa2..921d0a654243 100644
> --- a/lib/dynamic_debug.c
> +++ b/lib/dynamic_debug.c
> @@ -396,7 +396,7 @@ static int ddebug_parse_query(char *words[], int nwords,
>  			/* tail :$info is function or line-range */
>  			fline = strchr(query->filename, ':');
>  			if (!fline)
> -				break;
> +				continue;
>  			*fline++ = '\0';
>  			if (isalpha(*fline) || *fline == '*' || *fline == '?') {
>  				/* take as function name */
> 

SGTM, thanks !

Reviewed-by: Eric Dumazet <edumazet@google.com>

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

* Re: [PATCH] dyndbg: fix parsing file query without a line-range suffix
  2021-04-26 16:38 ` Eric Dumazet
@ 2021-04-29 21:08   ` Jason Baron
  2021-04-30  5:42     ` Greg Kroah-Hartman
  0 siblings, 1 reply; 4+ messages in thread
From: Jason Baron @ 2021-04-29 21:08 UTC (permalink / raw)
  To: Eric Dumazet, Shuo Chen, Jim Cromie, Greg Kroah-Hartman
  Cc: linux-kernel, Shuo Chen



On 4/26/21 12:38 PM, Eric Dumazet wrote:
> 
> 
> On 4/14/21 11:24 PM, Shuo Chen wrote:
>> From: Shuo Chen <shuochen@google.com>
>>
>> Query like 'file tcp_input.c line 1234 +p' was broken by
>> commit aaebe329bff0 ("dyndbg: accept 'file foo.c:func1' and 'file
>> foo.c:10-100'") because a file name without a ':' now makes the loop in
>> ddebug_parse_query() exits early before parsing the 'line 1234' part.
>> As a result, all pr_debug() in tcp_input.c will be enabled, instead of only
>> the one on line 1234.  Changing 'break' to 'continue' fixes this.
>>
>> Fixes: aaebe329bff0 ("dyndbg: accept 'file foo.c:func1' and 'file foo.c:10-100'")
>> Signed-off-by: Shuo Chen <shuochen@google.com>
>> ---
>>  lib/dynamic_debug.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c
>> index c70d6347afa2..921d0a654243 100644
>> --- a/lib/dynamic_debug.c
>> +++ b/lib/dynamic_debug.c
>> @@ -396,7 +396,7 @@ static int ddebug_parse_query(char *words[], int nwords,
>>  			/* tail :$info is function or line-range */
>>  			fline = strchr(query->filename, ':');
>>  			if (!fline)
>> -				break;
>> +				continue;
>>  			*fline++ = '\0';
>>  			if (isalpha(*fline) || *fline == '*' || *fline == '?') {
>>  				/* take as function name */
>>
> 
> SGTM, thanks !
> 
> Reviewed-by: Eric Dumazet <edumazet@google.com>
> 

Hi Greg,

I acked this previously and is an important fix.
Can you please pick it up if you haven't done so?

Thanks!

-Jason

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

* Re: [PATCH] dyndbg: fix parsing file query without a line-range suffix
  2021-04-29 21:08   ` Jason Baron
@ 2021-04-30  5:42     ` Greg Kroah-Hartman
  0 siblings, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2021-04-30  5:42 UTC (permalink / raw)
  To: Jason Baron; +Cc: Eric Dumazet, Shuo Chen, Jim Cromie, linux-kernel, Shuo Chen

On Thu, Apr 29, 2021 at 05:08:28PM -0400, Jason Baron wrote:
> 
> 
> On 4/26/21 12:38 PM, Eric Dumazet wrote:
> > 
> > 
> > On 4/14/21 11:24 PM, Shuo Chen wrote:
> >> From: Shuo Chen <shuochen@google.com>
> >>
> >> Query like 'file tcp_input.c line 1234 +p' was broken by
> >> commit aaebe329bff0 ("dyndbg: accept 'file foo.c:func1' and 'file
> >> foo.c:10-100'") because a file name without a ':' now makes the loop in
> >> ddebug_parse_query() exits early before parsing the 'line 1234' part.
> >> As a result, all pr_debug() in tcp_input.c will be enabled, instead of only
> >> the one on line 1234.  Changing 'break' to 'continue' fixes this.
> >>
> >> Fixes: aaebe329bff0 ("dyndbg: accept 'file foo.c:func1' and 'file foo.c:10-100'")
> >> Signed-off-by: Shuo Chen <shuochen@google.com>
> >> ---
> >>  lib/dynamic_debug.c | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c
> >> index c70d6347afa2..921d0a654243 100644
> >> --- a/lib/dynamic_debug.c
> >> +++ b/lib/dynamic_debug.c
> >> @@ -396,7 +396,7 @@ static int ddebug_parse_query(char *words[], int nwords,
> >>  			/* tail :$info is function or line-range */
> >>  			fline = strchr(query->filename, ':');
> >>  			if (!fline)
> >> -				break;
> >> +				continue;
> >>  			*fline++ = '\0';
> >>  			if (isalpha(*fline) || *fline == '*' || *fline == '?') {
> >>  				/* take as function name */
> >>
> > 
> > SGTM, thanks !
> > 
> > Reviewed-by: Eric Dumazet <edumazet@google.com>
> > 
> 
> Hi Greg,
> 
> I acked this previously and is an important fix.
> Can you please pick it up if you haven't done so?

Will do, sorry for the delay.

greg k-h

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

end of thread, other threads:[~2021-04-30  5:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-14 21:24 [PATCH] dyndbg: fix parsing file query without a line-range suffix Shuo Chen
2021-04-26 16:38 ` Eric Dumazet
2021-04-29 21:08   ` Jason Baron
2021-04-30  5:42     ` Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).