From: Steven Rostedt <rostedt@goodmis.org> To: Namhyung Kim <namhyung@kernel.org> Cc: Ingo Molnar <mingo@kernel.org>, LKML <linux-kernel@vger.kernel.org> Subject: Re: [PATCH 3/4] tracing: Improve message of empty set_ftrace_notrace file Date: Thu, 12 Jun 2014 15:27:59 -0400 [thread overview] Message-ID: <20140612152759.40316084@gandalf.local.home> (raw) In-Reply-To: <1402590233-22321-4-git-send-email-namhyung@kernel.org> On Fri, 13 Jun 2014 01:23:52 +0900 Namhyung Kim <namhyung@kernel.org> wrote: > When there's no entry in set_ftrace_notrace, it'll print nothing, but > it's better to print something like below like set_graph_notrace does: > > #### no functions disabled #### > > Reported-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> > Signed-off-by: Namhyung Kim <namhyung@kernel.org> > --- > kernel/trace/ftrace.c | 15 ++++++++++++++- > 1 file changed, 14 insertions(+), 1 deletion(-) > > diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c > index b375cf2cd786..566ffa0f3442 100644 > --- a/kernel/trace/ftrace.c > +++ b/kernel/trace/ftrace.c > @@ -2603,6 +2603,16 @@ static void *t_start(struct seq_file *m, loff_t *pos) > return iter; > } > > + if (iter->flags & FTRACE_ITER_NOTRACE && > + ftrace_hash_empty(ops->notrace_hash)) { > + if (*pos > 0) > + return t_hash_start(m, pos); > + iter->flags |= FTRACE_ITER_PRINTALL; > + /* reset in case of seek/pread */ > + iter->flags &= ~FTRACE_ITER_HASH; > + return iter; > + } This contains the exact if block as the condition before it. Why not join the two: if ((iter->flags & FTRACE_ITER_FILTER && ftrace_hash_empty(ops->filter_hash)) || (iter->flags & FTRACE_ITER_NOTRACE && ftrace_hash_empty(ops->notrace_hash))) { -- Steve > + > if (iter->flags & FTRACE_ITER_HASH) > return t_hash_start(m, pos); > > @@ -2639,7 +2649,10 @@ static int t_show(struct seq_file *m, void *v) > return t_hash_show(m, iter); > > if (iter->flags & FTRACE_ITER_PRINTALL) { > - seq_printf(m, "#### all functions enabled ####\n"); > + if (iter->flags & FTRACE_ITER_NOTRACE) > + seq_printf(m, "#### no functions disabled ####\n"); > + else > + seq_printf(m, "#### all functions enabled ####\n"); > return 0; > } >
next prev parent reply other threads:[~2014-06-12 19:28 UTC|newest] Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top 2014-06-12 16:23 [PATCH 0/4] tracing: Small updates on tracing/set_graph_notrace file Namhyung Kim 2014-06-12 16:23 ` [PATCH 1/4] tracing: Add ftrace_graph_notrace boot parameter Namhyung Kim 2014-06-12 16:23 ` [PATCH 2/4] tracing: Improve message of empty set_graph_notrace file Namhyung Kim 2014-06-12 16:23 ` [PATCH 3/4] tracing: Improve message of empty set_ftrace_notrace file Namhyung Kim 2014-06-12 19:27 ` Steven Rostedt [this message] 2014-06-13 7:24 ` [PATCH v2 " Namhyung Kim 2014-06-12 16:23 ` [PATCH 4/4] tracing: Add description of set_graph_notrace to tracing/README Namhyung Kim
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=20140612152759.40316084@gandalf.local.home \ --to=rostedt@goodmis.org \ --cc=linux-kernel@vger.kernel.org \ --cc=mingo@kernel.org \ --cc=namhyung@kernel.org \ --subject='Re: [PATCH 3/4] tracing: Improve message of empty set_ftrace_notrace file' \ /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
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.