All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] trace-cmd: Leave out absolute addresses to fix bogus symbol resolutions
@ 2015-07-31 14:04 Jan Kiszka
  2015-09-15 16:30 ` Jan Kiszka
  2015-09-17 18:11 ` Steven Rostedt
  0 siblings, 2 replies; 6+ messages in thread
From: Jan Kiszka @ 2015-07-31 14:04 UTC (permalink / raw)
  To: Steven Rostedt, Linux Kernel Mailing List

On x86, page_fault_* tracepoints report userspace address via kernel
symbols because all the per-cpu variable offsets are in kallsyms,
occupying the lower address space. Fix this by skipping over absolute
addresses while processing kallsyms.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 trace-util.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/trace-util.c b/trace-util.c
index 8a81dd0..da20e4c 100644
--- a/trace-util.c
+++ b/trace-util.c
@@ -434,8 +434,12 @@ void parse_proc_kallsyms(struct pevent *pevent,
 		if (mod)
 			mod[strlen(mod) - 1] = 0;
 
-		/* Hack for arm arch that adds a lot of bogus '$a' functions */
-		if (func[0] != '$')
+		/*
+		 * Hacks for
+		 *  - arm arch that adds a lot of bogus '$a' functions
+		 *  - x86-64 that reports per-cpu variable offsets as absolute
+		 */
+		if (func[0] != '$' && ch != 'A')
 			pevent_register_function(pevent, func, addr, mod);
 		free(func);
 		free(mod);
-- 
2.1.4

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

* Re: [PATCH] trace-cmd: Leave out absolute addresses to fix bogus symbol resolutions
  2015-07-31 14:04 [PATCH] trace-cmd: Leave out absolute addresses to fix bogus symbol resolutions Jan Kiszka
@ 2015-09-15 16:30 ` Jan Kiszka
  2015-09-15 17:00   ` Steven Rostedt
  2015-09-17 18:11 ` Steven Rostedt
  1 sibling, 1 reply; 6+ messages in thread
From: Jan Kiszka @ 2015-09-15 16:30 UTC (permalink / raw)
  To: Steven Rostedt, Linux Kernel Mailing List

On 2015-07-31 16:04, Jan Kiszka wrote:
> On x86, page_fault_* tracepoints report userspace address via kernel
> symbols because all the per-cpu variable offsets are in kallsyms,
> occupying the lower address space. Fix this by skipping over absolute
> addresses while processing kallsyms.
> 
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
>  trace-util.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/trace-util.c b/trace-util.c
> index 8a81dd0..da20e4c 100644
> --- a/trace-util.c
> +++ b/trace-util.c
> @@ -434,8 +434,12 @@ void parse_proc_kallsyms(struct pevent *pevent,
>  		if (mod)
>  			mod[strlen(mod) - 1] = 0;
>  
> -		/* Hack for arm arch that adds a lot of bogus '$a' functions */
> -		if (func[0] != '$')
> +		/*
> +		 * Hacks for
> +		 *  - arm arch that adds a lot of bogus '$a' functions
> +		 *  - x86-64 that reports per-cpu variable offsets as absolute
> +		 */
> +		if (func[0] != '$' && ch != 'A')
>  			pevent_register_function(pevent, func, addr, mod);
>  		free(func);
>  		free(mod);
> 

Ping.

Jan

-- 
Siemens AG, Corporate Technology, CT RTC ITP SES-DE
Corporate Competence Center Embedded Linux

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

* Re: [PATCH] trace-cmd: Leave out absolute addresses to fix bogus symbol resolutions
  2015-09-15 16:30 ` Jan Kiszka
@ 2015-09-15 17:00   ` Steven Rostedt
  2015-09-15 17:06     ` Jan Kiszka
  0 siblings, 1 reply; 6+ messages in thread
From: Steven Rostedt @ 2015-09-15 17:00 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: Linux Kernel Mailing List

On Tue, 15 Sep 2015 18:30:22 +0200
Jan Kiszka <jan.kiszka@siemens.com> wrote:

> On 2015-07-31 16:04, Jan Kiszka wrote:
> > On x86, page_fault_* tracepoints report userspace address via kernel
> > symbols because all the per-cpu variable offsets are in kallsyms,
> > occupying the lower address space. Fix this by skipping over absolute
> > addresses while processing kallsyms.
> > 
> > Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> > ---
> >  trace-util.c | 8 ++++++--
> >  1 file changed, 6 insertions(+), 2 deletions(-)
> > 
> > diff --git a/trace-util.c b/trace-util.c
> > index 8a81dd0..da20e4c 100644
> > --- a/trace-util.c
> > +++ b/trace-util.c
> > @@ -434,8 +434,12 @@ void parse_proc_kallsyms(struct pevent *pevent,
> >  		if (mod)
> >  			mod[strlen(mod) - 1] = 0;
> >  
> > -		/* Hack for arm arch that adds a lot of bogus '$a' functions */
> > -		if (func[0] != '$')
> > +		/*
> > +		 * Hacks for
> > +		 *  - arm arch that adds a lot of bogus '$a' functions
> > +		 *  - x86-64 that reports per-cpu variable offsets as absolute
> > +		 */
> > +		if (func[0] != '$' && ch != 'A')
> >  			pevent_register_function(pevent, func, addr, mod);
> >  		free(func);
> >  		free(mod);
> > 
> 
> Ping.

Thanks for the reminder ping.

Hmm, I don't see anything marked 'A' in my kallsyms. Have a config I
can test to see what you are seeing?

-- Steve


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

* Re: [PATCH] trace-cmd: Leave out absolute addresses to fix bogus symbol resolutions
  2015-09-15 17:00   ` Steven Rostedt
@ 2015-09-15 17:06     ` Jan Kiszka
  2015-09-15 17:17       ` Steven Rostedt
  0 siblings, 1 reply; 6+ messages in thread
From: Jan Kiszka @ 2015-09-15 17:06 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: Linux Kernel Mailing List

[-- Attachment #1: Type: text/plain, Size: 1710 bytes --]

On 2015-09-15 19:00, Steven Rostedt wrote:
> On Tue, 15 Sep 2015 18:30:22 +0200
> Jan Kiszka <jan.kiszka@siemens.com> wrote:
> 
>> On 2015-07-31 16:04, Jan Kiszka wrote:
>>> On x86, page_fault_* tracepoints report userspace address via kernel
>>> symbols because all the per-cpu variable offsets are in kallsyms,
>>> occupying the lower address space. Fix this by skipping over absolute
>>> addresses while processing kallsyms.
>>>
>>> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
>>> ---
>>>  trace-util.c | 8 ++++++--
>>>  1 file changed, 6 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/trace-util.c b/trace-util.c
>>> index 8a81dd0..da20e4c 100644
>>> --- a/trace-util.c
>>> +++ b/trace-util.c
>>> @@ -434,8 +434,12 @@ void parse_proc_kallsyms(struct pevent *pevent,
>>>  		if (mod)
>>>  			mod[strlen(mod) - 1] = 0;
>>>  
>>> -		/* Hack for arm arch that adds a lot of bogus '$a' functions */
>>> -		if (func[0] != '$')
>>> +		/*
>>> +		 * Hacks for
>>> +		 *  - arm arch that adds a lot of bogus '$a' functions
>>> +		 *  - x86-64 that reports per-cpu variable offsets as absolute
>>> +		 */
>>> +		if (func[0] != '$' && ch != 'A')
>>>  			pevent_register_function(pevent, func, addr, mod);
>>>  		free(func);
>>>  		free(mod);
>>>
>>
>> Ping.
> 
> Thanks for the reminder ping.
> 
> Hmm, I don't see anything marked 'A' in my kallsyms. Have a config I
> can test to see what you are seeing?

Huh? Your /proc/kallsyms doesn't start like this?

0000000000000000 A irq_stack_union
0000000000000000 A __per_cpu_start
...

That's from a stock distro SUSE kernel I'm running (config attached).

Jan

-- 
Siemens AG, Corporate Technology, CT RTC ITP SES-DE
Corporate Competence Center Embedded Linux

[-- Attachment #2: config-4.2.0-4.g9f67920-desktop.xz --]
[-- Type: application/x-xz, Size: 35516 bytes --]

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

* Re: [PATCH] trace-cmd: Leave out absolute addresses to fix bogus symbol resolutions
  2015-09-15 17:06     ` Jan Kiszka
@ 2015-09-15 17:17       ` Steven Rostedt
  0 siblings, 0 replies; 6+ messages in thread
From: Steven Rostedt @ 2015-09-15 17:17 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: Linux Kernel Mailing List

On Tue, 15 Sep 2015 19:06:36 +0200
Jan Kiszka <jan.kiszka@siemens.com> wrote:

> Huh? Your /proc/kallsyms doesn't start like this?
> 
> 0000000000000000 A irq_stack_union
> 0000000000000000 A __per_cpu_start
> ...
> 
> That's from a stock distro SUSE kernel I'm running (config attached).

Nevermind, I was looking at an older kernel which didn't have that. I
booted a newer kernel and I now see it.

-- Steve


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

* Re: [PATCH] trace-cmd: Leave out absolute addresses to fix bogus symbol resolutions
  2015-07-31 14:04 [PATCH] trace-cmd: Leave out absolute addresses to fix bogus symbol resolutions Jan Kiszka
  2015-09-15 16:30 ` Jan Kiszka
@ 2015-09-17 18:11 ` Steven Rostedt
  1 sibling, 0 replies; 6+ messages in thread
From: Steven Rostedt @ 2015-09-17 18:11 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: Linux Kernel Mailing List

On Fri, 31 Jul 2015 16:04:54 +0200
Jan Kiszka <jan.kiszka@siemens.com> wrote:

> On x86, page_fault_* tracepoints report userspace address via kernel
> symbols because all the per-cpu variable offsets are in kallsyms,
> occupying the lower address space. Fix this by skipping over absolute
> addresses while processing kallsyms.

Applied thanks!

-- Steve

> 
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
>  trace-util.c | 8 ++++++--

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

end of thread, other threads:[~2015-09-17 18:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-31 14:04 [PATCH] trace-cmd: Leave out absolute addresses to fix bogus symbol resolutions Jan Kiszka
2015-09-15 16:30 ` Jan Kiszka
2015-09-15 17:00   ` Steven Rostedt
2015-09-15 17:06     ` Jan Kiszka
2015-09-15 17:17       ` Steven Rostedt
2015-09-17 18:11 ` Steven Rostedt

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.