public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Török Edwin" <edwintorok@gmail.com>
To: "Frank Ch. Eigler" <fche@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>,
	mingo@elte.hu, srostedt@redhat.com, sandmann@daimi.au.dk,
	linux-kernel@vger.kernel.org, viro@ZenIV.linux.org.uk
Subject: Re: [PATCH 2/2] tracing: identify which executable object the userspace address belongs to
Date: Thu, 27 Nov 2008 15:03:46 +0200	[thread overview]
Message-ID: <492E9AB2.9030202@gmail.com> (raw)
In-Reply-To: <20081127124851.GC23480@redhat.com>

On 2008-11-27 14:48, Frank Ch. Eigler wrote:
> Hi -
>
> On Thu, Nov 27, 2008 at 11:41:45AM +0100, Peter Zijlstra wrote:
>   
>>>> Impact: modify+improve the userstacktrace tracing visualization feature
>>>> [...]
>>>> You'll see stack entries like:
>>>>    /lib/libpthread-2.7.so[+0xd370]
>>>> [...]
>>>>         
>>> Can you suggest an actual distribution & architecture where this
>>> facility may be tested/used?  It appears to require frame-pointer
>>> stuff that AFAIK is not generally turned on for user-space.
>>>       
>> gentoo, just rebuild world with frame pointers ;-)
>>     
>
> Well, that only goes so far.  If this feature turns out unable to work
> without distributors recompiling all their stuff on, for example, x86-64,
> then expectations need to be reset.

My assumption is that this feature will be used to trace individual
applications, and not the system as a whole.
Then you only need libc to be recompiled with frame pointers on, and
your own application/your own application's libraries.

That is what I want to use it for, and there isn't another solution that
allows me to do this.
Sure I can trace userspace alone using ptrace (which has its own
overhead), and the kernel alone by using ftrace, but I can't combine
those traces in a meaningful manner.
If/when the kernel will support dwarf unwinding, it will only need to
provide an alternate implementation for save_stack_trace_user.

Even without frame pointers you can at least get the return address to
userspace, which may be inside your application for page faults.

If I need to do system-wide tracing, I can use my 32-bit chroot [*], or
boot my laptop which is 32-bit.

I don't think that this feature should get rejected just because it is
not easily usable from x86_64.

[*] I haven't tested yet if tracing 32-bit applications from a 64-bit
kernel works. It probably won't, and I'll need to use a different struct
stack_frame with 32-bit addresses.

Another approach I've though of would be to deliver a signal to
userspace on demand, and have the signal handler do the backtrace, but
that would unnecesary overhead.

Best regards,
--Edwin

  parent reply	other threads:[~2008-11-27 13:04 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-22 11:28 [PATCH 0/2] tracing: userspace stacktraces Török Edwin
2008-11-22 11:28 ` [PATCH 1/2] tracing: add support for userspace stacktraces in tracing/iter_ctrl Török Edwin
2008-11-23  8:37   ` Ingo Molnar
2008-11-23 10:39     ` [PATCH 3/3] tracing/stack-tracer: introduce CONFIG_USER_STACKTRACE_SUPPORT Török Edwin
2008-11-22 11:28 ` [PATCH 2/2] tracing: identify which executable object the userspace address belongs to Török Edwin
2008-11-23  8:47   ` [PATCH] vfs, seqfile: make mangle_path() global Ingo Molnar
2008-11-23 21:06     ` Randy Dunlap
2008-11-23 21:24       ` [PATCH] fix comment style on mangle_path Török Edwin
2008-11-23 21:36         ` Ingo Molnar
2008-11-28 10:05     ` [PATCH] vfs, seqfile: make mangle_path() global Al Viro
2008-11-28 17:08       ` Ingo Molnar
2008-11-23  8:53   ` [PATCH 2/2] tracing: identify which executable object the userspace address belongs to Ingo Molnar
2008-11-23 10:39     ` [PATCH 1/3] tracing/stack-tracer: fix style issues Török Edwin
2008-11-23 10:39     ` [PATCH 2/3] tracing/stack-tracer: fix locking Török Edwin
2008-11-23 10:52       ` Ingo Molnar
2008-11-23 10:59         ` Török Edwin
2008-11-23 11:01           ` Ingo Molnar
2008-11-23 11:04             ` Török Edwin
2008-11-23 11:07               ` Ingo Molnar
2008-11-23 11:08                 ` [PATCH] tracing/stack-tracer: avoid races accessing file Török Edwin
2008-11-23 11:20                   ` Ingo Molnar
2008-11-25 14:40   ` [PATCH 2/2] tracing: identify which executable object the userspace address belongs to Frank Ch. Eigler
2008-11-26  9:59     ` Török Edwin
2008-11-27 10:41     ` Peter Zijlstra
2008-11-27 12:48       ` Frank Ch. Eigler
2008-11-27 13:02         ` Peter Zijlstra
2008-11-27 13:03         ` Török Edwin [this message]
2008-11-27 14:10           ` Ingo Molnar
2008-11-27 14:27             ` Török Edwin
2008-11-27 14:51               ` Ingo Molnar
2008-12-09 19:49                 ` Török Edwin
2008-11-23  8:26 ` [PATCH 0/2] tracing: userspace stacktraces Ingo Molnar
2008-11-23  9:24   ` Török Edwin
2008-11-23  9:30     ` Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=492E9AB2.9030202@gmail.com \
    --to=edwintorok@gmail.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=fche@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=sandmann@daimi.au.dk \
    --cc=srostedt@redhat.com \
    --cc=viro@ZenIV.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox