public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@elte.hu>,
	Andrew Morton <akpm@linux-foundation.org>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Roel Kluin <roel.kluin@gmail.com>, Pekka Paalanen <pq@iki.fi>,
	Steven Rostedt <srostedt@redhat.com>
Subject: [PATCH 2/3] ring-buffer: rename debugfs file tracing_on to writing_enabled
Date: Tue, 06 Jan 2009 17:33:39 -0500	[thread overview]
Message-ID: <20090106223405.512131804@goodmis.org> (raw)
In-Reply-To: 20090106223337.677427397@goodmis.org

[-- Attachment #1: 0002-ring-buffer-rename-debugfs-file-tracing_on-to-writi.patch --]
[-- Type: text/plain, Size: 1891 bytes --]

From: Steven Rostedt <srostedt@redhat.com>

Impact: clean up

The debugfs file name tracing_on is confusing since there is also
a tracing_enabled. When a tracer is added to current_tracer and
tracing_enabled is set to 1, then the tracer will start tracing.
The current file tracing_on, if set to 1, will allow writing to
the ring buffers. If tracing_on is set to 0 then the ring buffers
are read only, and any attempt by the tracers to write to the
ring buffers will fail.

But the name tracing_on confuses both developers and users.
This patch renames it to 'writing_enabled'.  This is exactly what
the file does. When set to 1, the ring buffers have writing enabled
and when set to 0, the ring buffers can not be written to.

The tracers do not get any call backs called or other notification
that the ring buffers have been set to read only, except when they
attempt to write to the ring buffers, that write will fail.

Note: it is a requirement that any tracer that uses the ring buffers
must handle a failure to write to the ring buffers, since the ring buffers
may be disabled for any number of reasons.

Signed-off-by: Steven Rostedt <srostedt@redhat.com>
---
 kernel/trace/ring_buffer.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
index a9d9760..dba6876 100644
--- a/kernel/trace/ring_buffer.c
+++ b/kernel/trace/ring_buffer.c
@@ -2514,10 +2514,11 @@ static __init int rb_init_debugfs(void)
 
 	d_tracer = tracing_init_dentry();
 
-	entry = debugfs_create_file("tracing_on", 0644, d_tracer,
+	entry = debugfs_create_file("writing_enabled", 0644, d_tracer,
 				    &ring_buffer_flags, &rb_simple_fops);
 	if (!entry)
-		pr_warning("Could not create debugfs 'tracing_on' entry\n");
+		pr_warning("Could not create debugfs"
+			   " 'writing_enabled' entry\n");
 
 	return 0;
 }
-- 
1.5.6.5

-- 

  parent reply	other threads:[~2009-01-06 22:40 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-06 22:33 [PATCH 0/3] ftrace: important updates Steven Rostedt
2009-01-06 22:33 ` [PATCH 1/3] ftrace: convert unsigned index to signed Steven Rostedt
2009-01-06 22:50   ` Andrew Morton
2009-01-07  2:42     ` Steven Rostedt
2009-01-06 22:33 ` Steven Rostedt [this message]
2009-01-06 22:47   ` [PATCH 2/3] ring-buffer: rename debugfs file tracing_on to writing_enabled Andrew Morton
2009-01-07  2:52     ` Steven Rostedt
2009-01-06 22:33 ` [PATCH 3/3] tracing/ftrace: fix a memory leak in stat tracing Steven Rostedt
2009-01-06 22:51   ` Andrew Morton
2009-01-07  2:53     ` Steven Rostedt

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=20090106223405.512131804@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=pq@iki.fi \
    --cc=roel.kluin@gmail.com \
    --cc=srostedt@redhat.com \
    /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