From patchwork Fri Jan 10 16:05:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Masami Hiramatsu (Google)" X-Patchwork-Id: 11327795 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6694C92A for ; Fri, 10 Jan 2020 16:05:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 455552082E for ; Fri, 10 Jan 2020 16:05:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578672329; bh=d2+PrFib/7EQ2hUA9lLU5t8sP3MMa40LSLUXqEMp4gU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=vvyFUQOZRC4YuYajKLAiPbqwpoXD6DqLvmh8rUMBvIo9AEyDOHVLbltB3+UyCPq9r 3bLe8WMWKuMT9KXwj7o8q41Br4eQpqD/Pj3gGScf4ngCSo3tCJ/DMJt9ie38KXcZPk EtDxXnVez/UefNiuWPdYCXob9hJpOuxSVGoqEjTc= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728772AbgAJQF0 (ORCPT ); Fri, 10 Jan 2020 11:05:26 -0500 Received: from mail.kernel.org ([198.145.29.99]:53720 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728513AbgAJQF0 (ORCPT ); Fri, 10 Jan 2020 11:05:26 -0500 Received: from localhost.localdomain (NE2965lan1.rev.em-net.ne.jp [210.141.244.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BE29D20838; Fri, 10 Jan 2020 16:05:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578672325; bh=d2+PrFib/7EQ2hUA9lLU5t8sP3MMa40LSLUXqEMp4gU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HnrPIBiw1b/jQMvVUrIVhzumFsPkjnoBlpjR+bG2MujzAo5ygo5WzJUJKcIdrmZbx MW3NZZy5z5+ckqSPiNtmllsoLUwUP314JwFYanvDY1xqHBcgbKofDtYOE39/1IBF7B +DYJaPWUndiF60lecIWmvNKuS2WG7d4EHbIQbQUA= From: Masami Hiramatsu To: Steven Rostedt Cc: Ingo Molnar , Frank Rowand , Randy Dunlap , Namhyung Kim , Tim Bird , Jiri Olsa , Arnaldo Carvalho de Melo , Tom Zanussi , Rob Herring , Andrew Morton , Thomas Gleixner , Greg Kroah-Hartman , Alexey Dobriyan , Jonathan Corbet , Linus Torvalds , linux-doc@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v6 10/22] tracing: Apply soft-disabled and filter to tracepoints printk Date: Sat, 11 Jan 2020 01:05:18 +0900 Message-Id: <157867231876.17873.15825819592284704068.stgit@devnote2> X-Mailer: git-send-email 2.20.1 In-Reply-To: <157867220019.17873.13377985653744804396.stgit@devnote2> References: <157867220019.17873.13377985653744804396.stgit@devnote2> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org Apply soft-disabled and the filter rule of the trace events to the printk output of tracepoints (a.k.a. tp_printk kernel parameter) as same as trace buffer output. Signed-off-by: Masami Hiramatsu --- kernel/trace/trace.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index ddb7e7f5fe8d..43f0f255ad66 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -2610,6 +2610,7 @@ static DEFINE_MUTEX(tracepoint_printk_mutex); static void output_printk(struct trace_event_buffer *fbuffer) { struct trace_event_call *event_call; + struct trace_event_file *file; struct trace_event *event; unsigned long flags; struct trace_iterator *iter = tracepoint_print_iter; @@ -2623,6 +2624,12 @@ static void output_printk(struct trace_event_buffer *fbuffer) !event_call->event.funcs->trace) return; + file = fbuffer->trace_file; + if (test_bit(EVENT_FILE_FL_SOFT_DISABLED_BIT, &file->flags) || + (unlikely(file->flags & EVENT_FILE_FL_FILTERED) && + !filter_match_preds(file->filter, fbuffer->entry))) + return; + event = &fbuffer->trace_file->event_call->event; spin_lock_irqsave(&tracepoint_iter_lock, flags);