From: "Török Edwin" <edwintorok@gmail.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: Ingo Molnar <mingo@elte.hu>, Al Viro <viro@ZenIV.linux.org.uk>,
srostedt@redhat.com, a.p.zijlstra@chello.nl,
sandmann@daimi.au.dk, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Identify which executable object the userspace address belongs to. Store thread group leader id, and use it to lookup the address in the process's map. We could have looked up the address on thread's map, but the thread might not exist by the time we are called. The process might not exist either, but if you are reading trace_pipe, that is unlikely.
Date: Tue, 04 Nov 2008 20:37:11 +0200 [thread overview]
Message-ID: <49109657.3000601@gmail.com> (raw)
In-Reply-To: <20081104182628.GA6666@infradead.org>
On 2008-11-04 20:26, Christoph Hellwig wrote:
> On Mon, Nov 03, 2008 at 08:32:57AM +0100, Ingo Molnar wrote:
>
>> could you please help out with such a helper? This is really about
>> visualization, not to rely on it.
>>
>
> Is this kindergarten? Take a look at seq_path - what you want
> is the combination of d_path + mangle_path and the combination of two
> would be rather trivial. In fact I'd say you don't even need the helper
> but just make mangle_path global (and document it while you're at it)
> and then use it.
Hmm, this is just for visualizing things in /sys/kernel/debug/, can't I
use something simpler than mangle_path, such as a simple while loop like
the one below?
+ static int
+trace_seq_path(struct trace_seq *s, struct path *path)
+{
+ char *p;
+
+ if (s->len >= (PAGE_SIZE - 1))
+ return 0;
+ p = d_path(path, s->buffer + s->len, PAGE_SIZE - s->len);
+ if (!IS_ERR(p)) {
+ size_t i = s->len;
+ char c;
+ while ((c = *p++)) {
+ if (c != '\n')
+ s->buffer[i++] = c;
+ }
+ s->len = i;
+ return 1;
+ } else {
+ s->buffer[s->len++] = '?';
+ return 1;
+ }
+
+ return 0;
+}
next prev parent reply other threads:[~2008-11-04 18:37 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-02 21:18 Add support for userspace stacktraces in tracing/iter_ctrl [v2] Török Edwin
2008-11-02 21:18 ` [PATCH] Add support for userspace stacktraces in tracing/iter_ctrl Török Edwin
2008-11-02 21:18 ` [PATCH] Identify which executable object the userspace address belongs to. Store thread group leader id, and use it to lookup the address in the process's map. We could have looked up the address on thread's map, but the thread might not exist by the time we are called. The process might not exist either, but if you are reading trace_pipe, that is unlikely Török Edwin
2008-11-02 21:25 ` Al Viro
2008-11-02 21:28 ` Török Edwin
2008-11-02 21:40 ` Al Viro
2008-11-03 7:32 ` Ingo Molnar
2008-11-04 18:26 ` Christoph Hellwig
2008-11-04 18:37 ` Török Edwin [this message]
2008-11-04 19:09 ` Christoph Hellwig
2008-11-04 19:10 ` Török Edwin
2008-11-06 9:55 ` Ingo Molnar
2008-11-06 12:26 ` Christoph Hellwig
2008-11-06 15:32 ` Ingo Molnar
2008-11-06 15:36 ` Christoph Hellwig
2008-11-03 7:47 ` Ingo Molnar
2008-11-03 8:16 ` Török Edwin
2008-11-03 8:21 ` Ingo Molnar
2008-11-03 8:29 ` Ingo Molnar
2008-11-03 13:57 ` Török Edwin
2008-11-03 14:04 ` Ingo Molnar
2008-11-03 19:26 ` Mathieu Desnoyers
2008-11-03 19:56 ` Peter Zijlstra
2008-11-03 19:58 ` Arnaldo Carvalho de Melo
2008-11-03 20:01 ` Török Edwin
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=49109657.3000601@gmail.com \
--to=edwintorok@gmail.com \
--cc=a.p.zijlstra@chello.nl \
--cc=hch@infradead.org \
--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