From: Wei Yang <richard.weiyang@gmail.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Wei Yang <richard.weiyang@linux.alibaba.com>,
mingo@redhat.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/6] ftrace: define seq_file only for FMODE_READ
Date: Thu, 8 Oct 2020 03:34:16 +0000 [thread overview]
Message-ID: <20201008033416.anmamvegf2g2zfwv@master> (raw)
In-Reply-To: <20201006103638.153e39d3@gandalf.local.home>
On Tue, Oct 06, 2020 at 10:36:38AM -0400, Steven Rostedt wrote:
>On Mon, 31 Aug 2020 11:10:59 +0800
>Wei Yang <richard.weiyang@linux.alibaba.com> wrote:
>
>> The purpose of the operation is to get ftrace_iterator, which is embedded
>> in file or seq_file for FMODE_WRITE/FMODE_READ respectively. Since we
>> don't have a seq_file for FMODE_WRITE case, it is meaningless to cast
>> file->private_data to seq_file.
>>
>> Let's move the definition when there is a valid seq_file.
>
>I didn't pull in this patch because I find the original more expressive,
>and there's really no benefit in changing it.
>
Got it, thanks
>-- Steve
>
>
>>
>> Signed-off-by: Wei Yang <richard.weiyang@linux.alibaba.com>
>> ---
>> kernel/trace/ftrace.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
>> index edc233122598..12cb535769bc 100644
>> --- a/kernel/trace/ftrace.c
>> +++ b/kernel/trace/ftrace.c
>> @@ -5558,7 +5558,6 @@ static void __init set_ftrace_early_filters(void)
>>
>> int ftrace_regex_release(struct inode *inode, struct file *file)
>> {
>> - struct seq_file *m = (struct seq_file *)file->private_data;
>> struct ftrace_iterator *iter;
>> struct ftrace_hash **orig_hash;
>> struct trace_parser *parser;
>> @@ -5566,6 +5565,7 @@ int ftrace_regex_release(struct inode *inode, struct file *file)
>> int ret;
>>
>> if (file->f_mode & FMODE_READ) {
>> + struct seq_file *m = file->private_data;
>> iter = m->private;
>> seq_release(inode, file);
>> } else
--
Wei Yang
Help you, Help me
next prev parent reply other threads:[~2020-10-08 3:34 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-31 3:10 [PATCH 0/6] ftrace: trivial cleanup Wei Yang
2020-08-31 3:10 ` [PATCH 1/6] ftrace: define seq_file only for FMODE_READ Wei Yang
2020-10-06 14:36 ` Steven Rostedt
2020-10-08 3:34 ` Wei Yang [this message]
2020-08-31 3:11 ` [PATCH 2/6] ftrace: use fls() to get the bits for dup_hash() Wei Yang
2020-08-31 3:11 ` [PATCH 3/6] ftrace: simplify the dyn_ftrace->flags macro Wei Yang
2020-08-31 3:11 ` [PATCH 4/6] ftrace: simplify the calculation of page number for ftrace_page->records Wei Yang
2020-08-31 3:11 ` [PATCH 5/6] ftrace: replace do_for_each_ftrace_rec() with for_ftrace_rec_iter() Wei Yang
2020-10-06 14:42 ` Steven Rostedt
2020-10-08 3:34 ` Wei Yang
2020-08-31 3:11 ` [PATCH 6/6] ftrace: ftrace_global_list is renamed to ftrace_ops_list Wei Yang
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=20201008033416.anmamvegf2g2zfwv@master \
--to=richard.weiyang@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=richard.weiyang@linux.alibaba.com \
--cc=rostedt@goodmis.org \
/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®