From patchwork Mon Sep 20 16:44:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 514379 Delivered-To: patch@linaro.org Received: by 2002:a02:c816:0:0:0:0:0 with SMTP id p22csp2344372jao; Mon, 20 Sep 2021 11:55:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyxpHT0DCoR7N1kA1uUybLI5fTjgX/Wnkb1KsmF9uIyJSNAWkMgknMKC2TKERgnEuiIGDUI X-Received: by 2002:aa7:c744:: with SMTP id c4mr30864058eds.0.1632164151127; Mon, 20 Sep 2021 11:55:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632164151; cv=none; d=google.com; s=arc-20160816; b=ZjwYiww9bm0ypxMGDz+cXc2hJEgulI3ho4iN1SDjwmU4qFU+TJdYw1l4pTQSTY0Rpq FerM6E2ssBlMWKgV/JAjWP/IXHp9BwSEClT4XFpezuCLcEDRBLA5VKK+5aB3xUSsJ7lo TH+uHu776G25KXCGKtNrgxcv+KS0Ox/tVhaoWRkoESWfvNueaKxfPQ5fvdeScde7E9Tv jETEoln62J/W+FG3dECNODLiuemK3HZnpuyodR3qP2RurB5tFT+Y+kzjZB4zn9f4O4rd stdv57wKy1/J3kP9NNliuIKbjphs1C4Mf96uI++mXfmqeUUXiqMFb0yx/WQ9+5088Pzd PzfQ== 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=kBArGHZud2zWs8hcJCNce6rXm/UOvcLSYTO+74IiKxc=; b=wv0KWLhm1E+sTjJB5f1K3HPBF+XAtZ6cAFe1cbm5KmG+5a/FkNXsc2kyfGDhLDGAOE A6/t7HrZSLzxJkp4fKrzLFMRVjUozOFRh/f+Tho7Qb2DaNTHlzgJ55498rDbUnCjPvhn zaMkF2TQuuiC3BNxBO0Yq/sIPnbvBmC94zc/uFRMuOf/o0+RaqcCM6V0t4gV2bQZL0yP 5RTwyCmxL4l6aDcJ58qJgU4RufOmk642z7yEykWQCAeulofCgNHQzw1CVxrp20aKcYNc y6Flj7PwLBrEsCLbwY/9X3tALdR9Ap33pEk933f0lM+XuqkWKk97g225yJO0XFGZbDiM 3UdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="E75AM/uo"; 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 6si17997049ejm.251.2021.09.20.11.55.50; Mon, 20 Sep 2021 11:55:51 -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="E75AM/uo"; 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 S1387267AbhITS45 (ORCPT + 11 others); Mon, 20 Sep 2021 14:56:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:33192 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1384540AbhITSsT (ORCPT ); Mon, 20 Sep 2021 14:48:19 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C8C476336D; Mon, 20 Sep 2021 17:33:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632159233; bh=9CdTvvhUJ6fs+lcYEoDJc3pDm6ZWgqub8UHDzlaahfA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=E75AM/uoddO5tBXo7RaHy2s/4NdxokNJPrVetH1wOMPZcQ71E8jWTlIE9Udy26vcF axotCiePTzAKkWZrFHoxKSwA7gwQNL1VY1NKII/mFAUl77/vegDXGgvnMtHvgNNSfy 40EjM8UhpL4lo5f37LS97qTwTJD3hOuxV/zkDdCM= 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.14 130/168] tracing/boot: Fix a hist trigger dependency for boot time tracing Date: Mon, 20 Sep 2021 18:44:28 +0200 Message-Id: <20210920163925.940856792@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163921.633181900@linuxfoundation.org> References: <20210920163921.633181900@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 94ef2d099e32..d713714cba67 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)