Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756889AbZCVXPj (ORCPT ); Sun, 22 Mar 2009 19:15:39 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756844AbZCVXPT (ORCPT ); Sun, 22 Mar 2009 19:15:19 -0400 Received: from mail-ew0-f165.google.com ([209.85.219.165]:42659 "EHLO mail-ew0-f165.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756825AbZCVXPR (ORCPT ); Sun, 22 Mar 2009 19:15:17 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=fAVte1DrlgucWidQ9ORxn+ynbvmGTqwzK3PWh18UM2k28mvjgLtCydWC/LaMD6PbUz 1i3YaOQ/CWw5gdC5pF3WZA0xjZC5+lvz/qXB7js459GinSW+mCOgBqpIx4fKTyVbuR6W aBx2h4ugv6IVlSb0YKTF4h/6bzJA1cmFoHB2U= From: Frederic Weisbecker To: Ingo Molnar Cc: Steven Rostedt , LKML , Frederic Weisbecker , Tom Zanussi Subject: [PATCH] tracing/events: don't discard an event after commit Date: Mon, 23 Mar 2009 00:15:12 +0100 Message-Id: <1237763712-21423-1-git-send-email-fweisbec@gmail.com> X-Mailer: git-send-email 1.6.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1509 Lines: 43 Note: depends on "tracing/events: don't use wake up for events" When we want to filter an event, the filter test is done after the event is commited to the ring-buffer to be discarded later if needed. But a reader could be reading this event while we are trying to discard it. Other kind of racy events can even happen because the event is commited and can be read and/or consumed. What we want is to discard the event before committing it. Signed-off-by: Frederic Weisbecker --- kernel/trace/trace_events_stage_3.h | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/kernel/trace/trace_events_stage_3.h b/kernel/trace/trace_events_stage_3.h index 9a3bd49..9d2fa78 100644 --- a/kernel/trace/trace_events_stage_3.h +++ b/kernel/trace/trace_events_stage_3.h @@ -222,10 +222,11 @@ static void ftrace_raw_event_##call(proto) \ \ assign; \ \ - trace_nowake_buffer_unlock_commit(event, irq_flags, pc); \ - \ if (call->preds && !filter_match_preds(call, entry)) \ ring_buffer_event_discard(event); \ + \ + trace_nowake_buffer_unlock_commit(event, irq_flags, pc); \ + \ } \ \ static int ftrace_raw_reg_event_##call(void) \ -- 1.6.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/