Hi all,

Is it feasible to have an officially supported way of determining if a tracepoint is currently enabled?

In my code I would like to test if the tracepoint is enabled, and if it isn't, avoid doing expensive setup work.

I've been doing the following:

if (__builtin_expect(!!(__tracepoint_sample_component___message.state), 0)) {
      /* setup work */
      tracepoint(sample_component, message);
      /* cleanup work */
  }

But it's weak for two reasons:

 * The 'state' attribute goes true when the tracepoint is enabled, but
   stays true after the tracepoint is disabled. It only goes false when
   the session is destroyed.
 * It uses a private / unofficial API

What I'd like is an official API that correctly evaluates whether a tracepoint is enabled or not?

Is this possible?

Thanks,
Dave

----------------------------------------------------------------------
The information contained in this transmission may be confidential. Any 
disclosure, copying, or further distribution of confidential information is not 
permitted unless such privilege is explicitly granted in writing by Quantum. 
Quantum reserves the right to have electronic communications, including email 
and attachments, sent across its networks filtered through anti virus and spam 
software programs and retain such messages in order to comply with applicable 
data security and retention requirements. Quantum is not responsible for the 
proper and complete transmission of the substance of this communication or for 
any delay in its receipt.
_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

Reply via email to