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

support wallclock, malloc, free events #49

Merged
merged 2 commits into from
Mar 4, 2025
Merged

Conversation

korniltsev
Copy link
Collaborator

@korniltsev korniltsev commented Mar 3, 2025

Support new events from asprof

For free events, there are no stacktraces, so we do not create pprofs for them

@korniltsev korniltsev requested a review from Copilot March 3, 2025 07:09

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Overview

This pull request adds support for new profiling events including wallclock samples, malloc events, and free events. The changes include:

  • Adding new constants and corresponding handling for malloc events in pprof.
  • Introducing new type IDs and class definitions for wall clock, malloc, and free events in the types generator.
  • Extending the parser and its test cases to cover the new event types.

Reviewed Changes

File Description
pprof/pprof.go Added a new constant and case branch for handling malloc events.
gen/types.go Introduced new type IDs and class definitions for wallclock, malloc, and free events.
pprof/parser_test.go Included new test cases for wall clock and native memory events.
parser/parser.go Extended parsing logic to support wallclock, malloc, and free events.
parser/types/def/types.go Updated TypeMap with new type IDs for malloc and free events.
gen/main.go Generated new type files for wallclock, malloc, and free events.

Copilot reviewed 16 out of 16 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (2)

pprof/pprof.go:17

  • The free event sample type is not defined in the constants even though free events are parsed in other parts of the code. If free events are intended to be processed similarly to malloc events, consider adding a corresponding constant (e.g., sampleTypeFree) along with its case handling in the profileBuilderForSampleType function.
sampleTypeMalloc      = 8

pprof/parser.go:70

  • While malloc events are handled in this switch, there is no case to process free events. Consider adding a case to handle free events similarly to malloc events if free events need to be included in the pprof output.
case parser.TypeMap.T_ACTIVE_SETTING:
@korniltsev korniltsev merged commit 2411717 into main Mar 4, 2025
2 checks passed
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