added functions for instrumenting application-level code