You choose which data in the selected set of profiles to display with filters.
Each filter is specified by a predefined
FILTER-OPTION that is paired
with a user-defined
[FILTER-OPTION] : [VALUE]
The filters being used are displayed in the filter bar as filter chips.
Each filter chip displays the filter option, the filter value, and
a Close close button.
In this example, there is one filter chip that displays
Metric : Bytes:
Profiler automatically creates a filter chip with a
Metric and a
VALUE based on your selected profile type.
You can change
VALUE for some profile types. You cannot remove this filter
To add a filter, use one of the following approaches:
- Click Filters , select an option from the list, and then enter the value.
- Click the gray text Add profile data filter in the filter bar, and then enter the filter option and value.
- For the Focus, Show from frame, and Show stacks filter options, you can also place your pointer on the frame, and then select the option from the frame tooltip.
To remove a filter, click Close close on the filter chip.
When preparing the data to display, Profiler searches for
matches between a frame and a filter.
When a match occurs Profiler uses the
determine what action to execute. A frame matches the filter when the frame's
function name or the function's source file name contains
A case-sensitive comparison is performed.
For example, if the filter is
Hide frames : oo, then
frames with functions named
busyloop match are hidden
from the flame graph.
To set the profile type aggregation mode, use the Metric filter. For example, if you select a Heap profile type, you have the choice between visualizing the data in terms of Bytes and Objects.
The choices available for the Metric filter depend on the programming language and the selected Profile type:
- For CPU time profiles, the only choice is CPU time.
For Heap profiles, the choices are:
For Allocated Heap profiles, the choices are:
- Total alloc bytes
- Total alloc objects
For Wall time profiles, the choices are:
- Wall time
For Threads profiles, the only choice is Goroutine.
For Contention profiles, the choices are:
For more information about types of profiling metrics, see Profiling concepts.
For example, the following screenshot shows the CPU consumption of a program:
Here, you can see that the
busyloop routine calls
foo2, both of
which call various other routines. You can use additional filters to further
restrict the graph only to the data of interest.
When you use the Focus filter, you select a single function and the flame graph displays all of the code paths that flow into, and out of, that specific function.
For details how to focus the graph and interpret the results, go to Focusing the graph.
To display all call stacks that contain a frame that matches the filter value and to hide all other call stacks, use the Show stacks filter. The graph shows the callers and callees of the function, that is, everything that calls the matching function, and everything it calls.
To restrict the CPU-usage graph from the previous example to show only the
call stacks that involve the function
foo1, set a
Show stacks filter for
In this case, the call stacks involving
foo1 account for
59% of the CPU usage.
Hide all call stacks that contain a frame that matches the filter value. This
filter is often useful Wording for migration dialog box (Sam)when you want to hide uninteresting stacks. For
example, with Java applications, adding a
Hide stacks: unsafe.park filter
Show from frame
To display all call stacks, starting from the frame that matches the filter value and to hide all other call stacks, use the Show from frame filter. The resulting graph shows the call stacks from the named function down. This filter is useful if your function is called from many places, and you want to see the total consumption attributable to it.
For example, to only show calls originating from the
set a Show from frame filter for
To hide from view all frames that match the filter value use the Hide frames filter. The graph shows the callers of the function, and any callees of the function are collected together. This is useful for removing irrelevant frames from the graph.
For example, to hide the frames for both
foo2, set a
Hide frames filter for
foo2 match, so both
are removed from the graph. Because both of them call the
routines, the data for each of those is aggregated together.
To highlight all frames whose function names matches the filter value, use the Highlight filter. The function remains in normal color mode, but the call sequences are colored in more subdued tones.
For example, here is a graph with no highlighting:
Here's the same graph with highlighting requested for the
By default, the frame color corresponds, where possible, to the function's package. If package information is unavailable, as with Node.js, the names of the source files are used to color the function blocks. With the default setting, a change in a call stack frame color means a transition from one package to another. The default option corresponds to the Color mode filter with a value of Name.
To color the frames in the flame graph by the consumption of a
function and its children, add a Color mode filter with the
value of Total. If a function is called through multiple call stacks,
the color is determined by the metric consumption for all call stacks.
For example, the
load frames are colored red,
foo1 frame is orange, and the
are light orange. This flame graph illustrates that
foo1 has a higher metric
foo2, but a lower metric consumption than
To color the frames in the flame graph by the function's metric
consumption but exclude the metric consumption of its children,
add a Color mode filter with the value of Self.
For example, this filter shows that
load function consumes the majority of the CPU time: