This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Create a function that indents without the tid()


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]