feature: flamegraph flag to customize java profiling data collection#649
Open
harp-intel wants to merge 3 commits intomainfrom
Open
feature: flamegraph flag to customize java profiling data collection#649harp-intel wants to merge 3 commits intomainfrom
harp-intel wants to merge 3 commits intomainfrom
Conversation
Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds flexibility to the flamegraph command by allowing users to select which sample types to collect (native, Java, or both) and to pass custom arguments to async-profiler. The changes introduce two new command-line flags (--sample and --asprof-args), update the underlying bash script to conditionally execute profiling based on sample type selection, and enhance the HTML output to display the profiling configuration used.
Changes:
- Added
--sampleflag to select sample types (native, java) with validation, and--asprof-argsflag to customize async-profiler arguments - Modified the flamegraph profiling script to conditionally collect native and/or Java stacks based on sample type selection, and to pass custom arguments to async-profiler
- Enhanced HTML rendering to display both the perf event and async-profiler arguments used in the flamegraph collection
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| cmd/flamegraph/flamegraph.go | Adds new flags for sample types and asprof arguments with validation and help text |
| internal/script/scripts.go | Updates flamegraph script to parse sample types, conditionally start profiling, and use custom asprof arguments |
| cmd/flamegraph/flamegraph_tables.go | Adds extraction function for asprof arguments and removes warning about missing native stacks |
| cmd/flamegraph/flamegraph_renderers.go | Enhances HTML rendering to display perf event and asprof arguments in flamegraph headers |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>
This file contains hidden or 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
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 pull request adds support for selecting sample types (native, Java) and passing custom arguments to async-profiler when generating flamegraphs. It introduces new command-line flags, updates the validation and help text, and modifies the underlying script logic to respect these options. The output and rendering logic are also updated to reflect and display the new configuration.
Command-line interface enhancements:
--sampleflag to specify sample types (native,java) and--asprof-argsflag to pass custom arguments to async-profiler; both are validated and included in help text. [1] [2] [3] [4] [5] [6]Script and data pipeline updates:
Updated the profiling script to conditionally collect native and/or Java stacks based on the
sample_typesparameter, and to pass customasprof_argumentsto async-profiler. [1] [2] [3] [4] [5] [6]Extended the data pipeline to capture and propagate the new parameters (
SampleTypes,AsprofArguments) through the table values and output. [1] [2] [3]Rendering improvements:
Other improvements:
These changes make the flamegraph command more flexible and informative, especially for environments profiling both native and Java workloads.