Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8c006cf7 authored by Namhyung Kim's avatar Namhyung Kim Committed by Steven Rostedt
Browse files

tracing: Improve message of empty set_ftrace_notrace file

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 ####

Link: http://lkml.kernel.org/p/1402644246-4649-1-git-send-email-namhyung@kernel.org



Reported-by: default avatarNaoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
parent 280d1429
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -2835,8 +2835,10 @@ static void *t_start(struct seq_file *m, loff_t *pos)
	 * off, we can short cut and just print out that all
	 * functions are enabled.
	 */
	if (iter->flags & FTRACE_ITER_FILTER &&
	    ftrace_hash_empty(ops->filter_hash)) {
	if ((iter->flags & FTRACE_ITER_FILTER &&
	     ftrace_hash_empty(ops->filter_hash)) ||
	    (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;
@@ -2881,6 +2883,9 @@ static int t_show(struct seq_file *m, void *v)
		return t_hash_show(m, iter);

	if (iter->flags & FTRACE_ITER_PRINTALL) {
		if (iter->flags & FTRACE_ITER_NOTRACE)
			seq_printf(m, "#### no functions disabled ####\n");
		else
			seq_printf(m, "#### all functions enabled ####\n");
		return 0;
	}