LKML Archive on lore.kernel.org
 help / Atom feed
* [PATCH] tools/lib/traceevent: Fix processing of dereferenced args in bprintk events
@ 2018-12-10 18:45 Steven Rostedt
  2018-12-10 18:48 ` Arnaldo Carvalho de Melo
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Steven Rostedt @ 2018-12-10 18:45 UTC (permalink / raw)
  To: LKML, Linux Trace Devel
  Cc: Arnaldo Carvalho de Melo, Jiri Olsa, Ingo Molnar, Namhyung Kim

From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>

In the case that a bprintk event has a dereferenced pointer that is stored
as a string, and there's more values to process (more args), the arg was not
updated to point to the next arg after processing the dereferenced pointer,
and it screwed up what was to be displayed.

Cc: stable@vger.kernel.org
Fixes: 7db96bb49629 ("tools lib traceevent: Handle new pointer processing of bprint strings")
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 tools/lib/traceevent/event-parse.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c
index 3692f29fee46..70144b98141c 100644
--- a/tools/lib/traceevent/event-parse.c
+++ b/tools/lib/traceevent/event-parse.c
@@ -4970,6 +4970,7 @@ static void pretty_print(struct trace_seq *s, void *data, int size, struct tep_e
 
 				if (arg->type == TEP_PRINT_BSTRING) {
 					trace_seq_puts(s, arg->string.string);
+					arg = arg->next;
 					break;
 				}
 
-- 
2.19.1


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

* Re: [PATCH] tools/lib/traceevent: Fix processing of dereferenced args in bprintk events
  2018-12-10 18:45 [PATCH] tools/lib/traceevent: Fix processing of dereferenced args in bprintk events Steven Rostedt
@ 2018-12-10 18:48 ` Arnaldo Carvalho de Melo
  2018-12-10 21:26   ` Steven Rostedt
       [not found] ` <20181210210921.A4C862084C@mail.kernel.org>
  2018-12-20 18:00 ` [tip:perf/core] tools lib traceevent: " tip-bot for Steven Rostedt (VMware)
  2 siblings, 1 reply; 7+ messages in thread
From: Arnaldo Carvalho de Melo @ 2018-12-10 18:48 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: LKML, Linux Trace Devel, Jiri Olsa, Ingo Molnar, Namhyung Kim

Em Mon, Dec 10, 2018 at 01:45:22PM -0500, Steven Rostedt escreveu:
> From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
> 
> In the case that a bprintk event has a dereferenced pointer that is stored
> as a string, and there's more values to process (more args), the arg was not
> updated to point to the next arg after processing the dereferenced pointer,
> and it screwed up what was to be displayed.

Thanks, applied.
 
> Cc: stable@vger.kernel.org
> Fixes: 7db96bb49629 ("tools lib traceevent: Handle new pointer processing of bprint strings")

> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
> ---
>  tools/lib/traceevent/event-parse.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c
> index 3692f29fee46..70144b98141c 100644
> --- a/tools/lib/traceevent/event-parse.c
> +++ b/tools/lib/traceevent/event-parse.c
> @@ -4970,6 +4970,7 @@ static void pretty_print(struct trace_seq *s, void *data, int size, struct tep_e
>  
>  				if (arg->type == TEP_PRINT_BSTRING) {
>  					trace_seq_puts(s, arg->string.string);
> +					arg = arg->next;
>  					break;
>  				}
>  
> -- 
> 2.19.1

-- 

- Arnaldo

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

* Re: [PATCH] tools/lib/traceevent: Fix processing of dereferenced args in bprintk events
       [not found] ` <20181210210921.A4C862084C@mail.kernel.org>
@ 2018-12-10 21:25   ` Steven Rostedt
  2018-12-10 23:03     ` Sasha Levin
  0 siblings, 1 reply; 7+ messages in thread
From: Steven Rostedt @ 2018-12-10 21:25 UTC (permalink / raw)
  To: Sasha Levin; +Cc: LKML, Arnaldo Carvalho de Melo, stable

On Mon, 10 Dec 2018 21:09:20 +0000
Sasha Levin <sashal@kernel.org> wrote:

> Hi,
> 
> [This is an automated email]
> 
> This commit has been processed because it contains a "Fixes:" tag,
> fixing commit: .
> 
> The bot has tested the following trees: v4.19.8, v4.14.87, v4.9.144, v4.4.166, v3.18.128, 
> 
> v4.19.8: Build OK!
> v4.14.87: Failed to apply! Possible dependencies:
>     37db96bb4962 ("tools lib traceevent: Handle new pointer processing of bprint strings")

Bah, I cut and pasted incorrectly the sha1. I had:

7db96bb49629 (chopped off the 3)

-- Steve

> 
> v4.9.144: Failed to apply! Possible dependencies:
>     37db96bb4962 ("tools lib traceevent: Handle new pointer processing of bprint strings")
> 
> v4.4.166: Failed to apply! Possible dependencies:
>     37db96bb4962 ("tools lib traceevent: Handle new pointer processing of bprint strings")
> 
> v3.18.128: Failed to apply! Possible dependencies:
>     37db96bb4962 ("tools lib traceevent: Handle new pointer processing of bprint strings")
>     38d70b7ca176 ("tools lib traceevent: Simplify pointer print logic and fix %pF")
>     3d199b5be533 ("tools lib traceevent: Add support for IP address formats")
>     b6bd9c7d543a ("tools lib traceevent: Support %ps/%pS")
> 
> 
> How should we proceed with this patch?
> 
> --
> Thanks,
> Sasha


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

* Re: [PATCH] tools/lib/traceevent: Fix processing of dereferenced args in bprintk events
  2018-12-10 18:48 ` Arnaldo Carvalho de Melo
@ 2018-12-10 21:26   ` Steven Rostedt
  2018-12-11 12:29     ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 7+ messages in thread
From: Steven Rostedt @ 2018-12-10 21:26 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: LKML, Linux Trace Devel, Jiri Olsa, Ingo Molnar, Namhyung Kim

On Mon, 10 Dec 2018 15:48:07 -0300
Arnaldo Carvalho de Melo <acme@kernel.org> wrote:

> Em Mon, Dec 10, 2018 at 01:45:22PM -0500, Steven Rostedt escreveu:
> > From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
> > 
> > In the case that a bprintk event has a dereferenced pointer that is stored
> > as a string, and there's more values to process (more args), the arg was not
> > updated to point to the next arg after processing the dereferenced pointer,
> > and it screwed up what was to be displayed.  
> 
> Thanks, applied.
>  
> > Cc: stable@vger.kernel.org
> > Fixes: 7db96bb49629 ("tools lib traceevent: Handle new pointer processing of bprint strings")  

Arnaldo,

It seems that I cut and pasted the sha1 of the "fixes" part wrong. Can
you add a "3". That is, the above should have been: 37db96bb49629

Thanks,

-- Steve

> 
> > Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
> > ---
> >  tools/lib/traceevent/event-parse.c | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c
> > index 3692f29fee46..70144b98141c 100644
> > --- a/tools/lib/traceevent/event-parse.c
> > +++ b/tools/lib/traceevent/event-parse.c
> > @@ -4970,6 +4970,7 @@ static void pretty_print(struct trace_seq *s, void *data, int size, struct tep_e
> >  
> >  				if (arg->type == TEP_PRINT_BSTRING) {
> >  					trace_seq_puts(s, arg->string.string);
> > +					arg = arg->next;
> >  					break;
> >  				}
> >  
> > -- 
> > 2.19.1  
> 


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

* Re: [PATCH] tools/lib/traceevent: Fix processing of dereferenced args in bprintk events
  2018-12-10 21:25   ` Steven Rostedt
@ 2018-12-10 23:03     ` Sasha Levin
  0 siblings, 0 replies; 7+ messages in thread
From: Sasha Levin @ 2018-12-10 23:03 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: LKML, Arnaldo Carvalho de Melo, stable

On Mon, Dec 10, 2018 at 04:25:15PM -0500, Steven Rostedt wrote:
>On Mon, 10 Dec 2018 21:09:20 +0000
>Sasha Levin <sashal@kernel.org> wrote:
>
>> Hi,
>>
>> [This is an automated email]
>>
>> This commit has been processed because it contains a "Fixes:" tag,
>> fixing commit: .
>>
>> The bot has tested the following trees: v4.19.8, v4.14.87, v4.9.144, v4.4.166, v3.18.128,
>>
>> v4.19.8: Build OK!
>> v4.14.87: Failed to apply! Possible dependencies:
>>     37db96bb4962 ("tools lib traceevent: Handle new pointer processing of bprint strings")
>
>Bah, I cut and pasted incorrectly the sha1. I had:
>
>7db96bb49629 (chopped off the 3)

You tricked my bot :)

--
Thanks,
Sasha

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

* Re: [PATCH] tools/lib/traceevent: Fix processing of dereferenced args in bprintk events
  2018-12-10 21:26   ` Steven Rostedt
@ 2018-12-11 12:29     ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 7+ messages in thread
From: Arnaldo Carvalho de Melo @ 2018-12-11 12:29 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: LKML, Linux Trace Devel, Jiri Olsa, Ingo Molnar, Namhyung Kim

Em Mon, Dec 10, 2018 at 04:26:21PM -0500, Steven Rostedt escreveu:
> On Mon, 10 Dec 2018 15:48:07 -0300
> Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
> 
> > Em Mon, Dec 10, 2018 at 01:45:22PM -0500, Steven Rostedt escreveu:
> > > From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
> > > 
> > > In the case that a bprintk event has a dereferenced pointer that is stored
> > > as a string, and there's more values to process (more args), the arg was not
> > > updated to point to the next arg after processing the dereferenced pointer,
> > > and it screwed up what was to be displayed.  
> > 
> > Thanks, applied.
> >  
> > > Cc: stable@vger.kernel.org
> > > Fixes: 7db96bb49629 ("tools lib traceevent: Handle new pointer processing of bprint strings")  
> 
> Arnaldo,
> 
> It seems that I cut and pasted the sha1 of the "fixes" part wrong. Can
> you add a "3". That is, the above should have been: 37db96bb49629

Done, git rebase -i + reword -> push -f'ed :-)

https://git.kernel.org/acme/c/1e862fa6b4e9

- Arnaldo
 
> Thanks,
> 
> -- Steve
> 
> > 
> > > Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
> > > ---
> > >  tools/lib/traceevent/event-parse.c | 1 +
> > >  1 file changed, 1 insertion(+)
> > > 
> > > diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c
> > > index 3692f29fee46..70144b98141c 100644
> > > --- a/tools/lib/traceevent/event-parse.c
> > > +++ b/tools/lib/traceevent/event-parse.c
> > > @@ -4970,6 +4970,7 @@ static void pretty_print(struct trace_seq *s, void *data, int size, struct tep_e
> > >  
> > >  				if (arg->type == TEP_PRINT_BSTRING) {
> > >  					trace_seq_puts(s, arg->string.string);
> > > +					arg = arg->next;
> > >  					break;
> > >  				}
> > >  
> > > -- 
> > > 2.19.1  
> > 

-- 

- Arnaldo

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

* [tip:perf/core] tools lib traceevent: Fix processing of dereferenced args in bprintk events
  2018-12-10 18:45 [PATCH] tools/lib/traceevent: Fix processing of dereferenced args in bprintk events Steven Rostedt
  2018-12-10 18:48 ` Arnaldo Carvalho de Melo
       [not found] ` <20181210210921.A4C862084C@mail.kernel.org>
@ 2018-12-20 18:00 ` " tip-bot for Steven Rostedt (VMware)
  2 siblings, 0 replies; 7+ messages in thread
From: tip-bot for Steven Rostedt (VMware) @ 2018-12-20 18:00 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: tglx, jolsa, rostedt, linux-kernel, mingo, acme, hpa, namhyung

Commit-ID:  f024cf085c423bac7512479f45c34ee9a24af7ce
Gitweb:     https://git.kernel.org/tip/f024cf085c423bac7512479f45c34ee9a24af7ce
Author:     Steven Rostedt (VMware) <rostedt@goodmis.org>
AuthorDate: Mon, 10 Dec 2018 13:45:22 -0500
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Tue, 18 Dec 2018 12:21:44 -0300

tools lib traceevent: Fix processing of dereferenced args in bprintk events

In the case that a bprintk event has a dereferenced pointer that is
stored as a string, and there's more values to process (more args), the
arg was not updated to point to the next arg after processing the
dereferenced pointer, and it screwed up what was to be displayed.

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: linux-trace-devel@vger.kernel.org
Cc: stable@vger.kernel.org
Fixes: 37db96bb49629 ("tools lib traceevent: Handle new pointer processing of bprint strings")
Link: http://lkml.kernel.org/r/20181210134522.3f71e2ca@gandalf.local.home
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/lib/traceevent/event-parse.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c
index a5ed291b8a9f..69a96e39f0ab 100644
--- a/tools/lib/traceevent/event-parse.c
+++ b/tools/lib/traceevent/event-parse.c
@@ -4973,6 +4973,7 @@ static void pretty_print(struct trace_seq *s, void *data, int size, struct tep_e
 
 				if (arg->type == TEP_PRINT_BSTRING) {
 					trace_seq_puts(s, arg->string.string);
+					arg = arg->next;
 					break;
 				}
 

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

end of thread, back to index

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-10 18:45 [PATCH] tools/lib/traceevent: Fix processing of dereferenced args in bprintk events Steven Rostedt
2018-12-10 18:48 ` Arnaldo Carvalho de Melo
2018-12-10 21:26   ` Steven Rostedt
2018-12-11 12:29     ` Arnaldo Carvalho de Melo
     [not found] ` <20181210210921.A4C862084C@mail.kernel.org>
2018-12-10 21:25   ` Steven Rostedt
2018-12-10 23:03     ` Sasha Levin
2018-12-20 18:00 ` [tip:perf/core] tools lib traceevent: " tip-bot for Steven Rostedt (VMware)

LKML Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/lkml/0 lkml/git/0.git
	git clone --mirror https://lore.kernel.org/lkml/1 lkml/git/1.git
	git clone --mirror https://lore.kernel.org/lkml/2 lkml/git/2.git
	git clone --mirror https://lore.kernel.org/lkml/3 lkml/git/3.git
	git clone --mirror https://lore.kernel.org/lkml/4 lkml/git/4.git
	git clone --mirror https://lore.kernel.org/lkml/5 lkml/git/5.git
	git clone --mirror https://lore.kernel.org/lkml/6 lkml/git/6.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ https://lore.kernel.org/lkml \
		linux-kernel@vger.kernel.org linux-kernel@archiver.kernel.org
	public-inbox-index lkml


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kernel


AGPL code for this site: git clone https://public-inbox.org/ public-inbox