-
Notifications
You must be signed in to change notification settings - Fork 90
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
Add loading of Linux perf JSON #64
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
A patch has been added to patches/ to add JSON export support to perf. The resulting JSON file can then be loaded into gpuvis on any platform. Samples are displayed as zero-duration events in the gpuvis timeline. This introduces a dependency on RapidJSON fetched at build time. Currently only the Makefile buildsystem supports JSON. Other buildsystems need to be modified to fetch it and pass the appropriate preprocessor defines. Signed-off-by: Nicholas Fraser <nfraser@codeweavers.com>
This parses the new callchain array in the latest perf JSON. Only the top stack entry is used; the rest is currently ignored. This also adds downloading of RapidJSON to the CMake buildsystem.
This updates the patch to match the one actually committed to the Linux kernel.
Very cool. Thanks Nicholas! |
@ludocode Might I ask, why did you choose to do this? is a specific rapidjson commit required to build the Makefile? I ask this because I was about to add the rapidjson dependency in the Meson buildsystem same way other dependencies were added. Thanks. |
dorindabassey
pushed a commit
to dorindabassey/gpuvis
that referenced
this pull request
Jan 26, 2022
this RapidJSON dependency added in the Meson Build is needed for loading of Linux perf JSON. see reference - mikesart#64 Signed-off-by: Dorinda Bassey <dbassey@redhat.com>
dorindabassey
pushed a commit
to dorindabassey/gpuvis
that referenced
this pull request
Jan 26, 2022
this RapidJSON dependency added in the Meson Build is needed for loading of Linux perf JSON. see reference - mikesart#64 Signed-off-by: Dorinda Bassey <dbassey@redhat.com>
dorindabassey
pushed a commit
to dorindabassey/gpuvis
that referenced
this pull request
Jan 26, 2022
this RapidJSON dependency added in the Meson Build is needed for loading of Linux perf JSON. see reference - mikesart#64 Signed-off-by: Dorinda Bassey <dbassey@redhat.com>
mikesart
pushed a commit
that referenced
this pull request
Feb 11, 2022
this RapidJSON dependency added in the Meson Build is needed for loading of Linux perf JSON. see reference - #64 Signed-off-by: Dorinda Bassey <dbassey@redhat.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds support for loading up a perf trace in JSON format.
Linux perf is a profiling tool that does CPU sampling. It's part of the Linux kernel. The goal of this work is to add support to gpuvis to show perf samples alongside a GPU trace so you can see both CPU and GPU events in sync.
I've added support to Linux perf for exporting a trace to JSON. This allows transferring the data over to gpuvis on Windows. The patch is merged in the Linux 5.13 kernel. For earlier kernel versions you have to patch perf manually. The patch is included in this PR in the patches/ folder.
This code loads up the exported perf trace and shows the results in gpuvis. Currently it just shows each sample as an instantaneous event. Later on we can add support for showing a histogram of samples, timeboxing them, drawing a flamegraph, etc.
This adds a dependency on RapidJSON. Rather then committing it to this repository like the other dependencies here, I've opted to fetch it at build time. I added code to the Makefile and to the CMake buildsystem to do this. I haven't set up the Meson buildsystem for this yet. The code is only enabled if
HAVE_RAPIDJSON
is defined so the project still builds without it.