Re: [RFC PATCH 1/2] add 99memdebug-ko dracut module

Dave Young
2016-11-03T08:38:26Z

On 11/03/16 at 03:28pm, Xunlei Pang wrote:
[snip]
> > For large trace data(tested on rhel7, the filter doesn't work on rhel7, and will produce huge trace data),
> > the time consumption is huge, I am afraid in minutes because I once suspected the script was in some
> > dead loop when parsing "tracing/trace" directly. It is the same situation when turning off tracing_on and
> > try again.
>
> Although I don't know why, after I replaced the following scripts
> 1)
> while read pid cpu flags ts function
> do
> ... ...
> done < "$TRACE_BASE/tracing/trace"
>
> with
>
> 2)
> cat "$TRACE_BASE/tracing/trace" | while read pid cpu flags ts function
> do
> ... ...
> done
>
> 2) became not time-consuming just like parsing the copied filename in 1) ...

Maybe 1) read the sysfs file a lot of times, but 2) only once then
parsing them in pipe which is quiker.

It should be fine if 2) is acceptable, but if the data is very large it
may worth to use some external program like awk which will be faster.

Thanks
Dave