public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Richard Weinberger <richard@nod.at>
To: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
	akpm@linux-foundation.org
Cc: linux-kernel@vger.kernel.org
Subject: Re: vsprintf: Add support for userspace strings
Date: Mon, 11 May 2015 12:57:00 +0200	[thread overview]
Message-ID: <55508AFC.2010809@nod.at> (raw)
In-Reply-To: <55506F86.9020106@nod.at>

Am 11.05.2015 um 10:59 schrieb Richard Weinberger:
> Am 11.05.2015 um 02:24 schrieb Masami Hiramatsu:
>> On 2015/05/11 4:42, Richard Weinberger wrote:
>>> While debugging issues I often add (trace_)printks to strategic positions.
>>> Dealing with user provided string is complicated as an extra buffer a
>>> copy_from_user() is needed.
>>> This adds a new format string to allow direct printing of such strings.
>>>
>>> My initial plan was to use %pU but 'U' is already taken, therefore
>>> I used the next letter which comes in mind when one thinks of userpace,
>>> 'L'.
>>> The %pL format string works exactly like %s.
>>
>> BTW, if you need to do this for debug, you can also use ftrace's kprobe-tracer
>> (and perf probe) which allows you to dump userspace strings :)
> 
> Sounds promising!
> 
> But I fail to use it:
> $ perf probe -vv -L do_sys_open:0-3 -k /boot/vmlinux-4.1.0-rc2-3.g3541e77-vanilla
> Line range is 0 to 3
> Use vmlinux: /boot/vmlinux-4.1.0-rc2-3.g3541e77-vanilla
> Failed to find path of kernel module.
>   Error: Failed to show lines. Reason: No such file or directory (Code: -2)
> 
> Any idea what's the issue?

Okay, works now as expected. :-)
Had the wrong debuginfo package installed.

Thanks,
//richard

  reply	other threads:[~2015-05-11 10:57 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-10 19:42 vsprintf: Add support for userspace strings Richard Weinberger
2015-05-10 19:42 ` [PATCH 1/2] Fix printk() on ERR_PTR() Richard Weinberger
2015-05-11 23:20   ` Andrew Morton
2015-05-12  7:23     ` Richard Weinberger
2015-05-10 19:42 ` [PATCH 2/2] vsprintf: Add support for userspace strings Richard Weinberger
2015-05-10 20:09   ` Joe Perches
2015-05-10 20:11     ` Richard Weinberger
2015-05-10 20:16       ` Joe Perches
2015-05-10 20:22         ` Richard Weinberger
2015-05-11 23:23         ` Andrew Morton
2015-05-12  7:31           ` Richard Weinberger
2015-05-11  0:24 ` Masami Hiramatsu
2015-05-11  8:59   ` Richard Weinberger
2015-05-11 10:57     ` Richard Weinberger [this message]
2015-05-11 20:42       ` Masami Hiramatsu

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=55508AFC.2010809@nod.at \
    --to=richard@nod.at \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masami.hiramatsu.pt@hitachi.com \
    /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