From: Chris Down <chris@chrisdown.name>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Petr Mladek <pmladek@suse.com>,
linux-kernel@vger.kernel.org,
Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
John Ogness <john.ogness@linutronix.de>,
Johannes Weiner <hannes@cmpxchg.org>,
Andrew Morton <akpm@linux-foundation.org>,
kernel-team@fb.com, Alexey Dobriyan <adobriyan@gmail.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jason Baron <jbaron@akamai.com>,
Kees Cook <keescook@chromium.org>,
linux-api@vger.kernel.org
Subject: Re: [PATCH] printk: Userspace format enumeration support
Date: Fri, 5 Feb 2021 22:45:19 +0000 [thread overview]
Message-ID: <YB3Kf896Zt9O+/Yh@chrisdown.name> (raw)
In-Reply-To: <20210205124748.4af2d406@gandalf.local.home>
Hi Steven,
Steven Rostedt writes:
>Interesting, because when I was looking at the original patch (looked at
>the lore link before reading your reply), I thought to myself "this looks
>exactly like what I did for trace_printk formats", which the above file is
>where it is shown. I'm curious if this work was inspired by that?
The double __builtin_constant_p() trick was suggested by Johannes based on
prior art in trace_puts() just prior to patch submission. Other than that, it
seems we came up with basically the same solution independently. :-)
>> Anyway, there is something wrong at the moment. The output looks fine
>> with cat. But "less" says that it is a binary format and the output
>> is a bit messy:
>
>Hmm, that's usually the case when lseek gets messed up. Not sure how that
>happened.
It looks as intended to me -- none of the newlines, nulls, or other control
sequences are escaped currently, since I didn't immediately see a reason to do
that. If that's a blocker though, I'm happy to change it.
>> $> less /proc/printk_formats
>> "/proc/printk_formats" may be a binary file. See it anyway?
>> vmlinux,^A3Warning: unable to open an initial console.
>> ^@vmlinux,^A3Failed to execute %s (error %d)
>> ^@vmlinux,^A6Kernel memory protection disabled.
>> ^@vmlinux,^A3Starting init: %s exists but couldn't execute it (error %d)
>>
>>
>> That is for now. I still have to think about it. And I am also curious
>> about what others thing about this idea.
>>
>
>I'm not against the idea. I don't think it belongs in /proc. Perhaps
>debugfs is a better place to put it.
Any location is fine with me, as long as it gets to userspace. How does
<debugfs>/printk/formats or <debugfs>/printk/formats/<module> sound to you?
Thanks,
Chris
next prev parent reply other threads:[~2021-02-06 2:33 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-04 15:37 [PATCH] printk: Userspace format enumeration support Chris Down
2021-02-05 0:47 ` Chris Down
2021-02-05 14:26 ` Chris Down
2021-02-05 16:42 ` Petr Mladek
2021-02-05 17:47 ` Steven Rostedt
2021-02-05 22:45 ` Chris Down [this message]
2021-02-05 22:49 ` Steven Rostedt
2021-02-06 7:13 ` Greg Kroah-Hartman
2021-02-06 12:44 ` Chris Down
2021-02-05 22:25 ` Chris Down
2021-02-06 17:57 ` Joe Perches
2021-02-06 21:21 ` Chris Down
2021-02-07 4:41 ` Joe Perches
2021-02-07 14:13 ` Chris Down
2021-02-07 14:58 ` Joe Perches
2021-02-07 16:13 ` Chris Down
2021-02-07 16:53 ` Chris Down
2021-02-07 22:21 ` kernel test robot
2021-02-08 1:13 ` Chris Down
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=YB3Kf896Zt9O+/Yh@chrisdown.name \
--to=chris@chrisdown.name \
--cc=adobriyan@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=gregkh@linuxfoundation.org \
--cc=hannes@cmpxchg.org \
--cc=jbaron@akamai.com \
--cc=john.ogness@linutronix.de \
--cc=keescook@chromium.org \
--cc=kernel-team@fb.com \
--cc=linux-api@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pmladek@suse.com \
--cc=rostedt@goodmis.org \
--cc=sergey.senozhatsky@gmail.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