Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display number of slots in timeline visualization #1154

Merged
merged 1 commit into from
Jun 25, 2024

Conversation

wks
Copy link
Collaborator

@wks wks commented Jun 25, 2024

In eBPF-based timeline visualization, we add the number of slots and whether the workpacket is from roots as arguments of the ProcessEdgesWork work packets.

@wks wks requested a review from qinsoon June 25, 2024 07:05
@wks
Copy link
Collaborator Author

wks commented Jun 25, 2024

FYI, the arguments (is_roots and num_slots) can be seen on the bottom panel of Perfetto UI when you click on a ProcessEdgesWork work packet.
image

@wks wks enabled auto-merge June 25, 2024 07:14
@wks wks added this pull request to the merge queue Jun 25, 2024
Merged via the queue into mmtk:master with commit 9658573 Jun 25, 2024
24 checks passed
@wks wks deleted the feature/num-slots branch June 25, 2024 09:07
github-merge-queue bot pushed a commit that referenced this pull request Jul 17, 2024
The purpose of this PR includes:

1. Providing a systematic way to add additional attributes to events on
the timeline generated from eBPF traces.
2. Adding additional USDT probes in mmtk-core and display more useful
information on the timeline.
3. Allowing users, especially VM binding developers, to extend the
tracing scripts to visualize additional USDT probes in the binding.

In previous PRs #1154 and
#1158, we use "meta" events to add
attributes to work packets, including the number of slots processed by
ProcessEdgesWork and the number of allocated blocks visited by
SweepChunk. This PR refactors the scripts to standardize the use of
"meta" events. Specifically

- The Rust program executes USDT trace points to expose additional
details (such as the number of slots processed) during the execution of
a work packet
-   `capture.bt` emits "meta" events for such USDTs, and
- `visualize.py` adds attributes to the current unfinished GC event
and/or work packet event of the current thread.

In this way, the information about a GC or a work packet can be
gradually added by multiple USDT trace points, providing more
flexibility than having to provide all information at the beginning or
the end of the work packet.

Using this mechanism, we added a few more USDT trace points in
mmtk-core, including:

- Generation plans trigger a USDT trace point when they have decided if
the current GC is a full-heap GC. The information is displayed on the
big "GC" bar (in "Thread 0") for each GC on the timeline.
- Immix-based plans trigger a USDT trace point when they have decided if
the current GC is a defrag GC. Displayed on the "GC" bar, too.
- Root-scanning packets now have "roots" attributes showing how many
root slots or root nodes are reported.
- ScanObjects work packets (as well as ProcessEdgesWork packets that
scan objects immediately) now display the number of objects scanned.

We also introduce extension mechanisms to `capture.py` and
`visualize.py`. Both of them now accept the `-x` or `--extra` command
line argument. Specifically,

- `capture.py` uses `-x` to specify an additional script to be appended
after the `capture.bt` script.
- `visualize.py` uses `-x` to specify a Python script to handle unknown
event names.

The extension mechanism allows VM binding developers to insert custom
USDT trace points in the VM binding, and extend the timeline tools to
visualize those custom events.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants