All of lore.kernel.org
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@kernel.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Ingo Molnar <mingo@kernel.org>, LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH 3/4] tracing: Improve message of empty set_ftrace_notrace file
Date: Fri, 13 Jun 2014 01:23:52 +0900	[thread overview]
Message-ID: <1402590233-22321-4-git-send-email-namhyung@kernel.org> (raw)
In-Reply-To: <1402590233-22321-1-git-send-email-namhyung@kernel.org>

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;
+	}
+
 	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;
 	}
 
-- 
1.7.9.2


  parent reply	other threads:[~2014-06-12 16:24 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 ` Namhyung Kim [this message]
2014-06-12 19:27   ` [PATCH 3/4] tracing: Improve message of empty set_ftrace_notrace file Steven Rostedt
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=1402590233-22321-4-git-send-email-namhyung@kernel.org \
    --to=namhyung@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=rostedt@goodmis.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.