Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp5065527pxb; Mon, 15 Feb 2021 08:36:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJzGojj6RWOvI29C6jvYmi1AYulzuAFJAzzIxYZ61ixDZBb53kTxoi/sak3erwphOrktNHPM X-Received: by 2002:a17:906:2516:: with SMTP id i22mr3436783ejb.123.1613406963430; Mon, 15 Feb 2021 08:36:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613406963; cv=none; d=google.com; s=arc-20160816; b=AMIgCkdbaZwcJYI3cxiDRXPX/34ZezTPgUyoJn098QrFpZU3UsfSOvfc0YX902sNjJ Pry3/0rSOrmUV/H+YZPyl54Yx95rdBFthyDf9dRp2ZW5wccjOhKr6rWYGF+Npqoxd3RJ 6ogMZ2vaK1p6/bf8yqp/9SKp5k7ySBjHNsnb/X/uya6QXo09d/eWr4s6ZF7U3vHnZ4Gh NRzh58CEySDjUwsMMT+q7B5udzqAOFMZ1zETsXbnt061Njas2TlPeELY8NZk4keNRBZ6 pVh77eGjfRe807EAJ4IamKD42KfHzzmDwxBdNzBbc5EmllT1fhK9v997DG9McA4IVUTt KfGQ== 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=viFK3BptWtrU8UUqL/5HryRZ7908OX7hzqVpxLVJi3Q=; b=HLOpP3TV2A+eG3Zqxb38W+3AWvvTcPeiFNfnGbm7bT3sEZYEGWVAWhClzqVdIIWL08 jnKksUpMk12KCG5NzcexS+Hmk/wKU0jKr7uG09ODpMmgNLeqZ2RfJjxGaB2M7tRAdWYD /dsc++X51gsWF5wEtPlCo/7Qe3uPpD9t39TWSc6okaepccIHly9n6yV7P8lMt4WYSblC FvUJkSoVFF1LT2jwAIFrbKPPQD5Whog9nYmfvtGRPXHF7Tosi39BSgfZR5S2/8vV85sU MfAE6JrzSLww1/hFCjFvnOVBacWIiU+KL1dS9PB17lokNvP795YO/TZghYzMWQVkUz3l waHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=p+x6sNt1; 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 z4si5463367ede.170.2021.02.15.08.35.40; Mon, 15 Feb 2021 08:36:03 -0800 (PST) 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=p+x6sNt1; 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 S231181AbhBOQdr (ORCPT + 99 others); Mon, 15 Feb 2021 11:33:47 -0500 Received: from mail.kernel.org ([198.145.29.99]:50184 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231284AbhBOPhK (ORCPT ); Mon, 15 Feb 2021 10:37:10 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id EB8CC64EC4; Mon, 15 Feb 2021 15:32:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1613403131; bh=nd+74Ivruz0O1CFSFEyWbEz5jI05EjRHuPkqjvRvKdM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=p+x6sNt1pYKFN0TuLlunbQLM2nlyY7rYEdl3kMZ8uIUnRzEdwf4ZRdqDFlwijy3Y6 dvEuaKEvTMO2AaTS2kggLDTp7uw9GH63c+U1q+B0y7W6HdIP+lpl2gfhPw6UouURxS cPd3NeMjJVKk7fTt4QKtkT46XqWM7vWDvEES1bxE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Yordan Karadzhov (VMware)" , "Steven Rostedt (VMware)" Subject: [PATCH 5.10 006/104] tracing: Do not count ftrace events in top level enable output Date: Mon, 15 Feb 2021 16:26:19 +0100 Message-Id: <20210215152719.674067103@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210215152719.459796636@linuxfoundation.org> References: <20210215152719.459796636@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: Steven Rostedt (VMware) commit 256cfdd6fdf70c6fcf0f7c8ddb0ebd73ce8f3bc9 upstream. The file /sys/kernel/tracing/events/enable is used to enable all events by echoing in "1", or disabling all events when echoing in "0". To know if all events are enabled, disabled, or some are enabled but not all of them, cating the file should show either "1" (all enabled), "0" (all disabled), or "X" (some enabled but not all of them). This works the same as the "enable" files in the individule system directories (like tracing/events/sched/enable). But when all events are enabled, the top level "enable" file shows "X". The reason is that its checking the "ftrace" events, which are special events that only exist for their format files. These include the format for the function tracer events, that are enabled when the function tracer is enabled, but not by the "enable" file. The check includes these events, which will always be disabled, and even though all true events are enabled, the top level "enable" file will show "X" instead of "1". To fix this, have the check test the event's flags to see if it has the "IGNORE_ENABLE" flag set, and if so, not test it. Cc: stable@vger.kernel.org Fixes: 553552ce1796c ("tracing: Combine event filter_active and enable into single flags field") Reported-by: "Yordan Karadzhov (VMware)" Signed-off-by: Steven Rostedt (VMware) Signed-off-by: Greg Kroah-Hartman --- kernel/trace/trace_events.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c @@ -1212,7 +1212,8 @@ system_enable_read(struct file *filp, ch mutex_lock(&event_mutex); list_for_each_entry(file, &tr->events, list) { call = file->event_call; - if (!trace_event_name(call) || !call->class || !call->class->reg) + if ((call->flags & TRACE_EVENT_FL_IGNORE_ENABLE) || + !trace_event_name(call) || !call->class || !call->class->reg) continue; if (system && strcmp(call->class->system, system->name) != 0)