User: Password:
Subscribe / Log in / New account

Conditional tracepoints

Conditional tracepoints

Posted Dec 2, 2010 16:56 UTC (Thu) by intgr (subscriber, #39733)
Parent article: Conditional tracepoints

> There is one potential problem in that the condition is now hidden deeply
> within the definition of the tracepoint; that definition is usually found
> in a special header file far from the code where the tracepoint is
> actually inserted. At the tracepoint itself, the condition which might
> cause it not to fire is not visible in any way.

Why not use code comments? their purpose after all is to inform other coders of things that might not be obvious at first.

(Log in to post comments)

Conditional tracepoints

Posted Dec 3, 2010 10:16 UTC (Fri) by dag- (subscriber, #30207) [Link]

You removed the next sentence which gives a clue.

> So, if somebody other than the initial developer wants to use the tracepoint, they could misinterpret a lack of output as a sign that the surrounding code is not being executed at all.

The people using the tracepoints are not necessarily kernel developers, and in most cases will not be tracing while at the same time looking at the source-code.

Conditional tracepoints

Posted Dec 8, 2010 11:02 UTC (Wed) by Auders (guest, #53318) [Link]

The condition should be reflected in the format then, so that the tool used to read the tracepoint can know about it.

Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds