protected void injectMethodTimer ( ) { methodEntertime = newLocal ( Type . LONG_TYPE ) ; invokeStatic ( Type . getType ( System . class ) , Method . getMethod ( CURRENT_TIME_MILLIS_METHODNAME ) ) ; storeLocal ( methodEntertime ) ; /* * Inject debug information */ if ( Agent . debug ) { getStatic ( Type . getType ( System . class ) , "err" , Type . getType ( PrintStream . class ) ) ; push ( "Javametrics: Calling instrumented method: " + className + "." + methodName ) ; invokeVirtual ( Type . getType ( PrintStream . class ) , Method . getMethod ( "void println(java.lang.String)" ) ) ; } }
Inject a local variable containing timestamp at method entry