From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751430AbdJCVom (ORCPT ); Tue, 3 Oct 2017 17:44:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:44086 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751117AbdJCVol (ORCPT ); Tue, 3 Oct 2017 17:44:41 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 351B82188A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=rostedt@goodmis.org Date: Tue, 3 Oct 2017 17:44:38 -0400 From: Steven Rostedt To: Jan Kiszka Cc: Linux Kernel Mailing List Subject: Re: [PATCH] Don't set wildcard filter for non-existing module Message-ID: <20171003174438.6aeb107e@gandalf.local.home> In-Reply-To: <4b13012c-8b08-8eb4-2cbd-0abdd1699af6@siemens.com> References: <4b13012c-8b08-8eb4-2cbd-0abdd1699af6@siemens.com> X-Mailer: Claws Mail 3.14.0 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 28 Sep 2017 13:11:40 +0200 Jan Kiszka wrote: > From: Jan Kiszka > > If filter_mod is NULL, there is no need to add it to the list. This > avoids premature termination of trace-cmd on systems without > CONFIG_DYNAMIC_FTRACE. Thanks, and it also fixes setting all functions needlessly being set in the filter. # trace-cmd record -p function cat /sys/kernel/tracing/set_ftrace_filter | head plugin 'function' initcall_blacklisted run_init_process try_to_run_init_process do_one_initcall rootfs_mount name_to_dev_t match_dev_by_uuid init_linuxrc bstat calibration_delay_done CPU0 data recorded at offset=0x446000 1515520 bytes in size CPU1 data recorded at offset=0x5b8000 1540096 bytes in size CPU2 data recorded at offset=0x730000 1527808 bytes in size CPU3 data recorded at offset=0x8a5000 1540096 bytes in size When it should be: # trace-cmd record -p function cat /debug/tracing/set_ftrace_filter |head plugin 'function' #### all functions enabled #### CPU0 data recorded at offset=0x446000 1605632 bytes in size CPU1 data recorded at offset=0x5ce000 1478656 bytes in size CPU2 data recorded at offset=0x737000 1601536 bytes in size CPU3 data recorded at offset=0x8be000 1576960 bytes in size CPU 0: 8600 events lost CPU 1: 5705 events lost CPU 2: 920 events lost CPU 3: 2225 events lost -- Steve > > Signed-off-by: Jan Kiszka > --- > trace-record.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/trace-record.c b/trace-record.c > index 020a373..a0b6541 100644 > --- a/trace-record.c > +++ b/trace-record.c > @@ -4680,7 +4680,7 @@ void trace_record (int argc, char **argv) > } > } > > - if (!filtered) > + if (!filtered && instance->filter_mod) > add_func(&instance->filter_funcs, > instance->filter_mod, "*"); >