This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
DTRACE_PROBE and optimization
- From: Martin Martin <martin at infinio dot com>
- To: systemtap at sourceware dot org
- Date: Thu, 12 Sep 2013 11:25:47 -0400
- Subject: DTRACE_PROBE and optimization
- Authentication-results: sourceware.org; auth=none
Hi all,
In a user space program, I'm hoping to use DTRACE_PROBE for fault
injection like this:
bool doFault = false;
DTRACE_PROBE1(provider, mark_name, &doFault);
if (doFault) {
... inject my fault ...
}
If DTRACE_PROBE1() compiles to a NOOP, can I be sure the compiler
won't think doFault is always false and optimize out the if statement?
Thanks,
Martin