Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756239AbcCBBoJ (ORCPT ); Tue, 1 Mar 2016 20:44:09 -0500 Received: from mail333.us4.mandrillapp.com ([205.201.137.77]:44579 "EHLO mail333.us4.mandrillapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755112AbcCAXyF (ORCPT ); Tue, 1 Mar 2016 18:54:05 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; q=dns; s=mandrill; d=linuxfoundation.org; b=lnSislWePoE95ccrgT2ECjjWzF1n2A0EvpeuLwPwyIWVEdP9vA8C8MJDqnLehf3DLEPDhX7mwuRL 1U5nlxIxXiKEULlKCKC9zuGHofjlOKB1LZ/hlyU61wt9JBE6UjaC7jIGJ4Ka5P85aK2QnDEfRZoL fX1TtPAx946DlMxz8i0=; From: Greg Kroah-Hartman Subject: [PATCH 3.14 125/130] tracing: Fix showing function event in available_events X-Mailer: git-send-email 2.7.2 To: Cc: Greg Kroah-Hartman , , Chunyu Hu , Steven Rostedt Message-Id: <20160301234504.185404965@linuxfoundation.org> In-Reply-To: <20160301234459.768886030@linuxfoundation.org> References: <20160301234459.768886030@linuxfoundation.org> X-Report-Abuse: Please forward a copy of this message, including all headers, to abuse@mandrill.com X-Report-Abuse: You can also report abuse here: http://mandrillapp.com/contact/abuse?id=30481620.c76dbe2de72e42bb92643c2d01772129 X-Mandrill-User: md_30481620 Date: Tue, 01 Mar 2016 23:53:40 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1974 Lines: 52 3.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Steven Rostedt (Red Hat) commit d045437a169f899dfb0f6f7ede24cc042543ced9 upstream. The ftrace:function event is only displayed for parsing the function tracer data. It is not used to enable function tracing, and does not include an "enable" file in its event directory. Originally, this event was kept separate from other events because it did not have a ->reg parameter. But perf added a "reg" parameter for its use which caused issues, because it made the event available to functions where it was not compatible for. Commit 9b63776fa3ca9 "tracing: Do not enable function event with enable" added a TRACE_EVENT_FL_IGNORE_ENABLE flag that prevented the function event from being enabled by normal trace events. But this commit missed keeping the function event from being displayed by the "available_events" directory, which is used to show what events can be enabled by set_event. One documented way to enable all events is to: cat available_events > set_event But because the function event is displayed in the available_events, this now causes an INVALID error: cat: write error: Invalid argument Reported-by: Chunyu Hu Fixes: 9b63776fa3ca9 "tracing: Do not enable function event with enable" Signed-off-by: Steven Rostedt 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 @@ -606,7 +606,8 @@ t_next(struct seq_file *m, void *v, loff * The ftrace subsystem is for showing formats only. * They can not be enabled or disabled via the event files. */ - if (call->class && call->class->reg) + if (call->class && call->class->reg && + !(call->flags & TRACE_EVENT_FL_IGNORE_ENABLE)) return file; }