This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: [PATCH] Create a function that indents without the tid()
- From: Breno Leitao <leitao at linux dot vnet dot ibm dot com>
- To: "Frank Ch. Eigler" <fche at redhat dot com>
- Cc: systemtap at sources dot redhat dot com
- Date: Wed, 30 Sep 2009 16:56:57 -0300
- Subject: Re: [PATCH] Create a function that indents without the tid()
- References: <4AC39EFA.50407@linux.vnet.ibm.com> <y0m4oqkjlcf.fsf@fche.csb>
Hi Frank.
Frank Ch. Eigler wrote:
>> So, I decided to create a simpler function that doesn't
>> consider the thread.
>
>> +function indent(delta){
>> + _indent += delta
>> + for (i=1; i<_indent; i++) r .= " "
>> + return r
>> +}
>
> Perhaps, but why not just
>
> function indent(delta) { return _generic_indent(0, delta) }
Well, it makes sense, and it was my first implementation, but later I found that
tid() can be 0, and then the space counter (_indent_counters[idx]) will be
corrupted when running indent() and thread_indent() together.
So, that is why in my example I put the example that contains the first line as:
0 swapper(0): -> neo_copy_data_from_queue_to_uart
So, we can assume the risk and implement as you proposed, assuming that no one will
use both function together.
Thanks for you review.