From: "Goel, Akash" <akash.goel@intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>,
Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, viro@zeniv.linux.org.uk,
Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>,
Tom Zanussi <tzanussi@gmail.com>,
akash.goel@intel.com
Subject: Re: [PATCH v2] relay: Add global mode support for buffer-only channels
Date: Tue, 12 Jul 2016 18:20:06 +0530 [thread overview]
Message-ID: <62e36dd1-85b3-2fa9-550e-c43780b5b33b@intel.com> (raw)
In-Reply-To: <20160712092445.GN6157@nuc-i3427.alporthouse.com>
On 7/12/2016 2:54 PM, Chris Wilson wrote:
> On Mon, Jul 11, 2016 at 01:17:09PM -0700, Andrew Morton wrote:
>> On Mon, 11 Jul 2016 12:47:36 +0530 akash.goel@intel.com wrote:
>>
>>> From: Akash Goel <akash.goel@intel.com>
>>>
>>> The following patch added support to use channels with no associated files.
>>> relay: add buffer-only channels; useful for early logging
>>
>> hm, 8 years ago. Normally we refer to previous commits using the form
>> 20d8b67c06fa5e74f44e ("relay: add buffer-only channels; useful for
>> early logging"). But this one is so old that we should inform readers
>> about its vintage, so this form:
>>
>> commit 20d8b67c06fa5e74f44e80b0a0fd68c8327f7c6a
>> Author: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
>> Date: Fri Jul 25 19:45:12 2008 -0700
>>
>> relay: add buffer-only channels; useful for early logging
>>
>> would be better.
>>
>>> This is useful when the exact location of relay file is not known or the
>>> the parent directory of relay file is not available, while creating the
>>> channel and the logging has to start right from the boot.
>>>
>>> But there was no provision to use global mode with buffer-only channels,
>>> which is added by this patch, without modifying the interface where initially
>>> there will be a dummy invocation of create_buf_file callback through which
>>> kernel client can convey the need of a global buffer.
>>>
>>> For the use case where drivers/kernel clients want a simple interface for the
>>> userspace, which enables them to capture data/logs from relay file in order &
>>> without any post processing, support of Global buffer mode is warranted.
>>>
>>> ...
>>>
>>> @@ -706,6 +727,7 @@ int relay_late_setup_files(struct rchan *chan,
>>>
>>> return err;
>>> }
>>> +EXPORT_SYMBOL_GPL(relay_late_setup_files);
>>
>> The export is unneeded and undocumented.
>
> Something like:
>
> diff --git a/kernel/relay.c b/kernel/relay.c
> index 04d7cf3ef8cf..fd86f01de4b2 100644
> --- a/kernel/relay.c
> +++ b/kernel/relay.c
> @@ -562,6 +562,10 @@ static int relay_hotcpu_callback(struct notifier_block *nb,
> * attributes specified. The created channel buffer files
> * will be named base_filename0...base_filenameN-1. File
> * permissions will be %S_IRUSR.
> + *
> + * If opening a buffer (@parent = NULL) that you later wish to register
> + * in a filesystem, call relay_late_setup_files() once the @parent dentry
> + * is available.
> */
> struct rchan *relay_open(const char *base_filename,
> struct dentry *parent,
> @@ -640,8 +644,12 @@ static void __relay_set_buf_dentry(void *info)
> *
> * Returns 0 if successful, non-zero otherwise.
> *
> - * Use to setup files for a previously buffer-only channel.
> - * Useful to do early tracing in kernel, before VFS is up, for example.
> + * Use to setup files for a previously buffer-only channel created
> + * by relay_open() with a NULL parent dentry.
> + *
> + * For example, this is useful for perfomring early tracing in kernel,
> + * before VFS is up and then exposing the early results once the dentry
> + * is available.
> */
> int relay_late_setup_files(struct rchan *chan,
> const char *base_filename,
>
>
> with a comment in the changelog that modules using relay_open() in early
> init also want to later register their buffer-only relays once debugfs is
> available, e.g. i915.
Thanks much, will update the documentation as well as the changelog as
per the above.
But an export of symbol relay_late_setup_files() is still needed, just
like relay_open() is exported, in order to make it accessible to modules
like i915 ?
Best regards
Akash
> -Chris
>
next prev parent reply other threads:[~2016-07-12 12:51 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-03 16:15 [PATCH] " akash.goel
2016-07-04 8:00 ` Chris Wilson
2016-07-04 13:03 ` Goel, Akash
2016-07-11 7:17 ` [PATCH v2] " akash.goel
2016-07-11 20:17 ` Andrew Morton
2016-07-12 9:24 ` Chris Wilson
2016-07-12 12:50 ` Goel, Akash [this message]
2016-07-12 13:01 ` Chris Wilson
2016-07-12 13:24 ` Goel, Akash
2016-07-12 19:51 ` Andrew Morton
2016-07-13 7:39 ` [PATCH v3] " akash.goel
2016-07-13 8:30 ` kbuild test robot
2016-07-13 10:09 ` [PATCH v4] " akash.goel
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=62e36dd1-85b3-2fa9-550e-c43780b5b33b@intel.com \
--to=akash.goel@intel.com \
--cc=akpm@linux-foundation.org \
--cc=chris@chris-wilson.co.uk \
--cc=eduard.munteanu@linux360.ro \
--cc=linux-kernel@vger.kernel.org \
--cc=tzanussi@gmail.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
all inboxes | Powered by JetHome®