- System requirements
- Profiler architecture
- Profiler installation
- Uninstall profiler
- Running the profiler
- Profiler activation
- Welcome screen
- Start profiling
- Profiling overhead
- Snapshots
- Solving performance problems
- CPU profiling
- Thread profiling
- Virtual threads support
- Object allocation profiling
- Memory profiling
- Monitor profiling
- Exception profiling
- Telemetry
- Probes: monitor events of various kinds
- Events in user interface
- Event inspections
- Built-in probes
- Probe classes
- Monitoring method invocation events
- Probe class annotation @MethodPattern
- Callback onEnter()
- Callback onReturn()
- Callback onExit()
- Callbacks onUncaughtException() and onUncaughtExceptionExt()
- Parameter annotation @Param
- Parameter annotation @Params
- Parameter annotation @This
- Parameter annotation @ClassRef
- Parameter annotation @MethodName
- Parameter annotation @MethodTimeMs
- Parameter annotation @MethodTimeNs
- Parameter annotation @MethodParameterTypes
- Parameter annotation @MethodSignature
- Parameter annotation @OnEnterResult
- Parameter annotation @ReturnValue
- Parameter annotation @ThrownException
- Probe application rules
- Data storage
- Inspections: automatic recognition of typical problems
- Automatically trigger actions on event
- Automatic deobfuscation
- Summary
- Filters
- Profiler command line
- Export of profiling results to external formats
- Profiler Java API
- Profiler HTTP API
- Settings
- Troubleshooting and FAQ
Callback method parameter annotation @ReturnValue
Callback parameter annotated with @ReturnValue
provides the instrumented method's return value.
In which callbacks can be used
Parameter annotated with @ReturnValue can be used in only in
onReturn() and onExit().
Declaration type
Parameter annotated with @ReturnValue
can be declared as a reference type or as a primitive type.
If the callback parameter is declared as java.lang.Object,
it will be assigned with object reference as is if the actual parameter type is a reference type,
or with a boxed value if the actual parameter type is primitive.
If the callback parameter
is declared as some reference type other than java.lang.Object,
it will be assigned with the actual method parameter value only if it is declared as strictly the same type.
Otherwise, the callback parameter value will be null.
If the callback parameter is declared as a primitive type,
it will be assigned with the actual method parameter value only if it is declared as strictly the same type.
Otherwise, it will be assigned with 0; no type conversions will be performed.
For example, int will not be cast to long.
| Type of callback parameter annotated with @ReturnValue | Actual instrumented method return value type | Resulting value of the callback parameter |
java.lang.Object |
any reference type | the value as is |
| any primitive type | a boxed value | |
| void | null | |
some reference type T1 other than java.lang.Object |
same reference type T1 |
the value as is |
any reference or primitive type T2 != T1 |
null | |
| void | null | |
some primitive type T1 |
same primitive type T1 |
the value as is |
any reference or primitive type T2 != T1 |
0 | |
| void | 0 |
Note: The type matching rules for @ReturnValue are similar
to ones for @Param
and differ from the rules for @This