Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2352224pxb; Mon, 20 Sep 2021 19:49:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzzRHfy0FPHrY/q0865XXUGkiGioaVbaDeZNfyAExkpLJZh6iPn/fMvNpTM7UCp+yDy5ghI X-Received: by 2002:a92:d784:: with SMTP id d4mr19935965iln.227.1632192553138; Mon, 20 Sep 2021 19:49:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632192553; cv=none; d=google.com; s=arc-20160816; b=JU8WGD2nuRSAADmTX0Pc1WaIL0zpP9jMgm7I++pRXClTkAKEdaZTiMOfHpj9+PTIB7 Pdi7+COKEeXk5iUKyg6WHcOp03YRnbwCRcXChkf01r5WDm00vsqRccleKzR3kxjrtJgj YNIiCa9ql51ypx8FKPq+rPithOWmGA3PW+6KZywYtbyf7Tt8yrq8P52P8gzwNlNdTVD9 jJxjeO7K2qcXQyly46lSDw4uMx/fxdsdUdDu++zs8NOo4YxoS1xRT1DJBmtwukqJFieg KIr/DI8yI+nG5l+f2iUpG0x4/0NIBsLGmhA399ZI7W8cEHO+8KLoSOGsz9IIsHf9q0mQ zFeg== 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=dz91nuBdXn1WMoXZn3mwEwJxImOSaAFsM8GDioYb4t2H50as9zM10GkzU2xyyhCbs/ t5CTQwGQYI9iqZoHg6PUOrntAt5i60tAux60TduY3N1lcRBYprN+ncn/DiwrGJZqtYEI Lu9in8rFFEZHTn/ksmTCR79YoXVU5Oij3UjmP8QRoCxcDsON5202GkCMz7OFaTW3FMyV SCW3y1DIMrPxjxyHG+mAHuLdnJmNb7TfQMDLNQtUBiYKigayosBAv75RaWch0FkaZs3v jsd4La0raQ/D5kXwvWGl2Ni7MIArdXl16YFqXzRPz7P/NjXeFTUctQmBa3fxoT4qHREy dj7w== 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 linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 j3si14252435ile.86.2021.09.20.19.49.00; Mon, 20 Sep 2021 19:49:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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 linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 S1381606AbhITSiq (ORCPT + 99 others); Mon, 20 Sep 2021 14:38:46 -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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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(-) 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) -- 2.30.2