All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Don't set wildcard filter for non-existing module
@ 2017-09-28 11:11 Jan Kiszka
  2017-10-03 21:44 ` Steven Rostedt
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Kiszka @ 2017-09-28 11:11 UTC (permalink / raw)
  To: Steven Rostedt, Linux Kernel Mailing List

From: Jan Kiszka <jan.kiszka@siemens.com>

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.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 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, "*");
 
-- 
2.12.3

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Don't set wildcard filter for non-existing module
  2017-09-28 11:11 [PATCH] Don't set wildcard filter for non-existing module Jan Kiszka
@ 2017-10-03 21:44 ` Steven Rostedt
  0 siblings, 0 replies; 2+ messages in thread
From: Steven Rostedt @ 2017-10-03 21:44 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: Linux Kernel Mailing List

On Thu, 28 Sep 2017 13:11:40 +0200
Jan Kiszka <jan.kiszka@siemens.com> wrote:

> From: Jan Kiszka <jan.kiszka@siemens.com>
> 
> 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 <jan.kiszka@siemens.com>
> ---
>  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, "*");
>  

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-10-03 21:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-28 11:11 [PATCH] Don't set wildcard filter for non-existing module Jan Kiszka
2017-10-03 21:44 ` Steven Rostedt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.