lkml.org 
[lkml]   [2011]   [Mar]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 2/3] trace-cmd: correct cpu list parsing
From
Date
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




\
 
 \ /
  Last update: 2011-03-10 15:49    [W:0.060 / U:2.900 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site