Re: [PATCH 2/3] trace-cmd: correct cpu list parsing

From: Steven Rostedt
Date: Thu Mar 10 2011 - 09:47:36 EST


On Thu, 2011-03-10 at 17:57 +0800, Lai Jiangshan wrote:
> Old parsing code is incorrect, when we use execute
> ./trace-cmd report --cpu 1,2-4,6,9-13
>
> the result of filter_cpus will be:
> 1,2,1,2,3,4,6,9,5,6,7,8,9,10,11,12,13
>
> The correct filter_cpus should be:
> 1,2,3,4,6,9,10,11,12,13,
>
> I can change about 10 existed lines to make it correct, but it will be
> still bad readability, so I port the neat and good readability code:
> linux_kernel_src/lib/bitmap.c:bitmap_parselist()
> to here and replace the origin code

Yeah that code never got much love. I added it as a hack as the first
filter to use. And never really spent much time in fixing it. As it
goes, "if it works for what I need it for, it's good enough" ;)

-- Steve


--
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/