Re: [PATCH 1/3]trace-cmd: remove dead code

From: Steven Rostedt
Date: Thu Mar 10 2011 - 09:53:44 EST


On Thu, 2011-03-10 at 17:57 +0800, Lai Jiangshan wrote:
> filter_cpu related code is totally dead.

I'll rephrase this, as it is not dead. "dead" code is code that can not
be reached. This code most certainly can be reached. You may think it is
silly code, which it may be. The reason for the separation of one CPU
and multiple CPUs, is I do one CPU more often than I filter multiple,
and I wanted the 1 cpu to still be efficient.

-- Steve

>
> Signed-off-by: Lai Jiangshan <laijs@xxxxxxxxxxxxxx>
> ---
> trace-read.c | 10 +---------
> 1 files changed, 1 insertions(+), 9 deletions(-)
>
> diff --git a/trace-read.c b/trace-read.c
> index 0e9ced8..1cd9bd3 100644
> --- a/trace-read.c
> +++ b/trace-read.c
> @@ -73,7 +73,6 @@ static const char *input_file;
> static int multi_inputs;
> static int max_file_size;
>
> -static int filter_cpu = -1;
> static int *filter_cpus;
> static int nr_filter_cpus;
>
> @@ -619,10 +618,6 @@ get_next_record(struct handle_list *handles, int *next_cpu)
> record = tracecmd_read_data(handles->handle, next_cpu);
> else
> record = NULL;
> -
> - } else if (filter_cpu >= 0) {
> - cpu = filter_cpu;
> - record = tracecmd_read_data(handles->handle, cpu);
> } else
> record = tracecmd_read_next_data(handles->handle, &cpu);
>
> @@ -963,10 +958,7 @@ void trace_report (int argc, char **argv)
> case 0:
> switch(option_index) {
> case 0: /* cpu */
> - if (filter_cpu)
> - add_cpu(optarg);
> - else
> - filter_cpu = atoi(optarg);
> + add_cpu(optarg);
> break;
> case 1: /* events */
> print_events = 1;


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/