This document discusses different techniques for instrumenting code with a profiler using metaprogramming, including OpenJava, Javassist, and AspectJ. It provides examples of implementing a profiler using each technique. OpenJava inserts profiler calls by extending the metaclass. Javassist inserts calls by extending the classloader. AspectJ isolates the profiler logic in an aspect module and uses pointcuts and advice to insert calls.