- System requirements
- Profiler architecture
- Running the profiler
- Profiler activation
- Running applications with the profiler
- Connect to profiled application
- Troubleshoot connection problems
- Solving performance problems
- CPU profiling
- Threads
- Deadlock detector
- Memory profiling
- Garbage collection
- Monitor profiling
- Exception profiling
- 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()
- Callbacks onUncaughtException() and onUncaughtExceptionExt()
- Parameter annotation @Param
- Parameter annotation @Params
- Parameter annotation @This
- Parameter annotation @ClassRef
- Parameter annotation @MethodName
- Parameter annotation @MethodParameterTypes
- Parameter annotation @MethodSignature
- Parameter annotation @OnEnterResult
- Parameter annotation @ReturnValue
- Parameter annotation @ThrownException
- Probe application rules
- Data storage
- Performance Charts
- Inspections: automatic recognition of typical problems
- Automatically trigger actions on event
- Summary, snapshot annotation, automatic deobfuscation
- IDE integration
- Time measurement (CPU time, wall time)
- Filters
- Snapshot directory customization
- Export of profiling results to HTML, CSV, XML, plain text
- Profiler Java API
- Profiler HTTP API
- Command line tool to control profiling
- Settings
- FAQ: How to profile in my scenario?
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
onReturn() only.
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