All of lore.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>,
	Thomas Gleixner <tglx@linutronix.de>,
	Peter Zijlstra <peterz@infradead.org>,
	Tom Zanussi <tzanussi@gmail.com>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Steven Rostedt <srostedt@redhat.com>
Subject: [PATCH 4/4] tracing/filters: use ring_buffer_discard_commit for discarded events
Date: Thu, 02 Apr 2009 01:27:25 -0400	[thread overview]
Message-ID: <20090402053522.834546042@goodmis.org> (raw)
In-Reply-To: 20090402052721.013878388@goodmis.org

[-- Attachment #1: 0004-tracing-filters-use-ring_buffer_discard_commit-for.patch --]
[-- Type: text/plain, Size: 2696 bytes --]

From: Steven Rostedt <srostedt@redhat.com>

The ring_buffer_discard_commit makes better usage of the ring_buffer
when an event has been discarded. It tries to remove it completely if
possible.

This patch converts the trace event filtering to use
ring_buffer_discard_commit instead of the ring_buffer_event_discard.

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

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 8c27ac4..d89489c 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -893,13 +893,18 @@ trace_current_buffer_lock_reserve(unsigned char type, unsigned long len,
 void trace_current_buffer_unlock_commit(struct ring_buffer_event *event,
 					unsigned long flags, int pc)
 {
-	return __trace_buffer_unlock_commit(&global_trace, event, flags, pc, 1);
+	__trace_buffer_unlock_commit(&global_trace, event, flags, pc, 1);
 }
 
 void trace_nowake_buffer_unlock_commit(struct ring_buffer_event *event,
 					unsigned long flags, int pc)
 {
-	return __trace_buffer_unlock_commit(&global_trace, event, flags, pc, 0);
+	__trace_buffer_unlock_commit(&global_trace, event, flags, pc, 0);
+}
+
+void trace_current_buffer_discard_commit(struct ring_buffer_event *event)
+{
+	ring_buffer_discard_commit(global_trace.buffer, event);
 }
 
 void
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index 12316e3..c0d7a12 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -491,6 +491,7 @@ void trace_current_buffer_unlock_commit(struct ring_buffer_event *event,
 					unsigned long flags, int pc);
 void trace_nowake_buffer_unlock_commit(struct ring_buffer_event *event,
 					unsigned long flags, int pc);
+void trace_current_buffer_discard_commit(struct ring_buffer_event *event);
 
 struct trace_entry *tracing_get_trace_entry(struct trace_array *tr,
 						struct trace_array_cpu *data);
diff --git a/kernel/trace/trace_events_stage_3.h b/kernel/trace/trace_events_stage_3.h
index 9d2fa78..d2f34bf 100644
--- a/kernel/trace/trace_events_stage_3.h
+++ b/kernel/trace/trace_events_stage_3.h
@@ -223,9 +223,9 @@ static void ftrace_raw_event_##call(proto)				\
 	assign;								\
 									\
 	if (call->preds && !filter_match_preds(call, entry))		\
-		ring_buffer_event_discard(event);			\
-									\
-	trace_nowake_buffer_unlock_commit(event, irq_flags, pc);	\
+		trace_current_buffer_discard_commit(event);		\
+	else								\
+		trace_nowake_buffer_unlock_commit(event, irq_flags, pc); \
 									\
 }									\
 									\
-- 
1.6.2.1

-- 

  parent reply	other threads:[~2009-04-02  5:36 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-02  5:27 [PATCH 0/4] [GIT PULL] for tip/tracing/filters Steven Rostedt
2009-04-02  5:27 ` [PATCH 1/4] tracing/filters: add run-time field descriptions to TRACE_EVENT_FORMAT events Steven Rostedt
2009-04-02 12:17   ` Frederic Weisbecker
2009-04-02  5:27 ` Steven Rostedt
2009-04-02  5:27 ` [PATCH 2/4] tracing/filters: add TRACE_EVENT_FORMAT_NOFILTER event macro Steven Rostedt
2009-04-02  5:27 ` [PATCH 3/4] ring-buffer: add ring_buffer_discard_commit Steven Rostedt
2009-04-02  5:48   ` Andrew Morton
2009-04-02 13:08     ` Steven Rostedt
2009-04-02  5:27 ` Steven Rostedt [this message]
2009-04-02  9:06   ` [PATCH 4/4] tracing/filters: use ring_buffer_discard_commit for discarded events Tom Zanussi
2009-04-02 15:01     ` Steven Rostedt
2009-04-03 11:51       ` Ingo Molnar
2009-04-04  1:11         ` Steven Rostedt
2009-04-07  5:46       ` Tom Zanussi
2009-04-07  9:24         ` Steven Rostedt
2009-04-02  5:37 ` [PATCH 0/4] [GIT PULL] for tip/tracing/filters Steven Rostedt
2009-04-03 12:14 ` Ingo Molnar
2009-04-03 14:36   ` Steven Rostedt
2009-04-04  6:50     ` Tom Zanussi
2009-04-04 15:42       ` Steven Rostedt
2009-04-05  7:52         ` Tom Zanussi
2009-04-05 14:47         ` Ingo Molnar

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=20090402053522.834546042@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=peterz@infradead.org \
    --cc=srostedt@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=tzanussi@gmail.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 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.