From patchwork Mon Sep 20 16:44:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 514367 Delivered-To: patch@linaro.org Received: by 2002:a02:c816:0:0:0:0:0 with SMTP id p22csp2328450jao; Mon, 20 Sep 2021 11:35:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwpICZSLde6gpFAOFD21NLrj0Kugz8CXz7gicBk9hMtfxiJ5IKZitqDT2R1j/YPfqs92+pc X-Received: by 2002:a17:906:341b:: with SMTP id c27mr31016147ejb.61.1632162957969; Mon, 20 Sep 2021 11:35:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632162957; cv=none; d=google.com; s=arc-20160816; b=vvX7XN/Bs2url3BRteZF+3TBjqh9SeGc+mfi7bPL20mZ9zrQUeCSRa/whSzTSEsZl+ x6g6nQzip4SFBY5AoIGOTSGdQVl0TrKggLEySci9c6YujWoUnE4yBEIQG43CHCJZUYRn bSapdCBlB/llG/QL7X2EX7j+JDnV8pOurUuz1w/HQuX1M8tRf6Nq8ZDabKxwMWa1YPUM 6XNMjksJqV+9K0SXV1Jm5L3iEtdNnPa5FUjEbLRqyLNIyI8yo7URoWUvrebwiY8HoZe2 Gw/ZYpT4cgwG1Gi2w/+/EcrhOMZ+Egrcr+XH+EfqScQtpB/UWeDeazMmTyMkiUMJ25kc 8Ygg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=DFCSBzxeRoDsYXnFduO2jdlyhC1dUT0U8VkrW9QnCgU=; b=kjCqy3T8MhKHcG//7k77PQDJPpCumcyb5TyZy+KzSIPlO7lgFznDuIYcVSC95lKcYC ti5r+nF0Le8vxz5W1me40ICT13GxtTGT/Takyu3s6Al/Ir+kw6FzmipmjSVPK2nW0G0A TY31HUtNC3bKahSpi6CWSNNe7E0PlV3VtZTUZnc+Xo7v9GR7WnBqGantpRq336bh11te GGbo/QB6ozEnSoYfG7ocFE+XKblfN8q93Yk7TeupEP/IezgIGDjl7Tp7ApuMUrH+fAQk sXkmfFcXJjLIr/soxoJi2ZEDo0KlQC5fC+WpgjZeVsfSfjkqOzCJq9oWc36kZSq7pDTE B7og== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Zrt+k51G; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b1si21572484ejb.600.2021.09.20.11.35.57; Mon, 20 Sep 2021 11:35:57 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Zrt+k51G; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379142AbhITSgP (ORCPT + 11 others); Mon, 20 Sep 2021 14:36:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:52012 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1380085AbhITSc1 (ORCPT ); Mon, 20 Sep 2021 14:32:27 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7400461AA4; Mon, 20 Sep 2021 17:27:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632158862; bh=uJUTMTu1vO5waaucqVJrvfx6ghghdNY2kgLhBdfGwQ8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Zrt+k51Gck+c3r0K892E0m1hsy9oBLX3aRspip/oishJd0e12i+am/r9wC2Flvzek wXm4DgtHqOUNLz2Xxvbpdu8KPkO+WlknwcefK037jwLbGrE/CkPhC7SxHO9FehVh98 rzlyyPYNeiTGt1r6tWdUV2M99TBi1646yqRs+IvY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Masami Hiramatsu , "Steven Rostedt (VMware)" , Sasha Levin Subject: [PATCH 5.10 089/122] tracing/boot: Fix a hist trigger dependency for boot time tracing Date: Mon, 20 Sep 2021 18:44:21 +0200 Message-Id: <20210920163918.710277100@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163915.757887582@linuxfoundation.org> References: <20210920163915.757887582@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Masami Hiramatsu [ Upstream commit 6fe7c745f2acb73e4cc961d7f91125eef5a8861f ] Fixes a build error when CONFIG_HIST_TRIGGERS=n with boot-time tracing. Since the trigger_process_regex() is defined only when CONFIG_HIST_TRIGGERS=y, if it is disabled, the 'actions' event option also must be disabled. Link: https://lkml.kernel.org/r/162856123376.203126.582144262622247352.stgit@devnote2 Fixes: 81a59555ff15 ("tracing/boot: Add per-event settings") Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) Signed-off-by: Sasha Levin --- kernel/trace/trace_boot.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) -- 2.30.2 diff --git a/kernel/trace/trace_boot.c b/kernel/trace/trace_boot.c index a82f03f385f8..0996d59750ff 100644 --- a/kernel/trace/trace_boot.c +++ b/kernel/trace/trace_boot.c @@ -205,12 +205,15 @@ trace_boot_init_one_event(struct trace_array *tr, struct xbc_node *gnode, pr_err("Failed to apply filter: %s\n", buf); } - xbc_node_for_each_array_value(enode, "actions", anode, p) { - if (strlcpy(buf, p, ARRAY_SIZE(buf)) >= ARRAY_SIZE(buf)) - pr_err("action string is too long: %s\n", p); - else if (trigger_process_regex(file, buf) < 0) - pr_err("Failed to apply an action: %s\n", buf); - } + if (IS_ENABLED(CONFIG_HIST_TRIGGERS)) { + xbc_node_for_each_array_value(enode, "actions", anode, p) { + if (strlcpy(buf, p, ARRAY_SIZE(buf)) >= ARRAY_SIZE(buf)) + pr_err("action string is too long: %s\n", p); + else if (trigger_process_regex(file, buf) < 0) + pr_err("Failed to apply an action: %s\n", buf); + } + } else if (xbc_node_find_value(enode, "actions", NULL)) + pr_err("Failed to apply event actions because CONFIG_HIST_TRIGGERS is not set.\n"); if (xbc_node_find_value(enode, "enable", NULL)) { if (trace_event_enable_disable(file, 1, 0) < 0)