Any implementation of ZCA / __notify_intrinsic toggles WITHOUT Pin?

Any implementation of ZCA / __notify_intrinsic toggles WITHOUT Pin?

The specification for zero/low cost annotations lays out everything you need to know to find probe-ready points in the binary and modify them.

However, the only implementation I'm aware of that actually does this is libzca.  Libzca uses Pin and supports only a limited usage model -- you can insert function calls at __notify_intrinsic probe-ready only at load-time, before Pin does its binary translation thing.

But we would really like to be able to turn these probes on and off at runtime.  Does anyone have an implementation that would support that?  A student is trying to build one, but needless to say it would be helpful to have some library-support for emitting the right assembly.


3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

I tried to include a link to the spec above, but it triggered the spam filter:

The best place to get the specs is .  This should always lead you to the most up-to-date version.

Why is PIN not sufficient for instrumenting your program?

Cilkscreen does something very close to this.  You can disable Cilkscreen, and it simply sets a flag within the PINtool that indicates that all analysis functions should return immediately. You can also use PIN_RemoveInstrumentation() to cause PIN to "undo" any instrumentation that was previously applied.

Be aware that if you use an instrumentation package other than PIN, you're likely to run into problems:

  • Instrumenting after the application has created threads can result in race conditions.
  • Most of the instrumentation points in the runtime and generated code are not "probe-ready".  That means the compiler is not generating nops that can just be overwritten with a JMP instruction, so you'll need to worry about the size of instructions and copy the instructions you'll overwrite with the JMP to your stub.  You'll also need to worry about whether there's a JMP back into the code you overwrote.

    - Barry

Leave a Comment

Please sign in to add a comment. Not a member? Join today