Spy on user-defined functions