Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp871895ybl; Fri, 10 Jan 2020 08:07:14 -0800 (PST) X-Google-Smtp-Source: APXvYqxCCDh90n6XUQcPdSLb85mDzClIe9wkSde0/ov9Pwu5Pe/jfglwLjo/bIj3b7iRadL3JwkW X-Received: by 2002:aca:c507:: with SMTP id v7mr2809763oif.157.1578672434377; Fri, 10 Jan 2020 08:07:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578672434; cv=none; d=google.com; s=arc-20160816; b=OfKAp+VNPgnuIcqgndt5DYtpHnIkeJPLVVHSbiob+uIvc1N7lPHeh4db17dGQtp/3Y I1t4OzhQWtXwKO+uc3Ssjv4EyXgE4/D7invK6trgafqqyiK6C6XiqWaSgC0v0GzJeJO+ YwAorUGBbkaMk5Q6HXn9fTBjMonq2Sis3vj6FIhFlpIQffX+jl5zcRy2RTKTnTyH/gyb SLdQnrIrrMvasIPiC2FF++yskwKwfFdW0+VkshEYFh2FRs4GnxgKWgogMIGFCAovavch SzXdTm00Rndqq0ABnZ8ig0+LEHXzGgupNXkWd1nS31ZUGcjmFD4yIhWCEwC5cxpq9yKX dL3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=rQzuEqXypOTKo+SADYEnlX8YROOy93dvWLYGnzCrOPI=; b=c8/eFnLTHOyy/A3HuG/cC2tlHwwOY5CwND9PsTVOVDw2vUoYHuJvjsZkkP9FPX9NyH Ih39E9jVhY9TeZUsh/6adCYI3myxzMXnOYxeVMCSeOgF4/VI7CF2gWIyEv8yVNZil+gn zwVwh8o6suFgbR7UEP0WPfoVlaJXaWBZwSmxo6GnnNNYcBl6otAGVYyor6zwB0DI3sH2 p2iep4o+AETKxWS9jjXBLbJz6wuXW19AfpR0I5GtbFWrRykur5VPGBDMn0P/6jzsCeBJ F6bbYI/T6uOyUA5ZoTqSnC8to7HSBZF6JWSI1oQbE3o/SlxCPwiB//qQ82qZJBzCTrQ8 VbZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=HnrPIBiw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n9si1435482ota.103.2020.01.10.08.06.57; Fri, 10 Jan 2020 08:07:14 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=HnrPIBiw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728779AbgAJQF0 (ORCPT + 99 others); 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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);