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

Populate PeriodType appropriately #17

Merged
merged 2 commits into from Aug 27, 2022
Merged

Conversation

brancz
Copy link
Contributor

@brancz brancz commented Apr 27, 2022

PeriodType is intended to explain the kind of events between sampled
occurrences. While not strictly required to be set, all the Go stdlib
profilers populate it, and this patch sets it equivalent to the standard
CPU profiles.

Resolves part of #16

Copy link
Owner

@felixge felixge left a comment

Choose a reason for hiding this comment

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

Thanks for the patch and sorry for the slow response. PTAL at my comment.

format.go Outdated
@@ -60,6 +60,10 @@ func toPprof(s map[string]int, hz int) *profile.Profile {
Unit: "nanoseconds",
},
}
p.PeriodType = &profile.ValueType{
Type: "cpu",
Copy link
Owner

Choose a reason for hiding this comment

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

I think this is misleading. fgprof does not produce CPU profiles. It produces "wallclock" profiles.

So maybe this?

Suggested change
Type: "cpu",
Type: "wallclock",

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

PeriodType is intended to explain the kind of events between sampled
occurrences. While not strictly required to be set, all the Go stdlib
profilers populate it, and this patch sets it equivalent to the standard
CPU profiles.
Copy link

@bwplotka bwplotka left a comment

Choose a reason for hiding this comment

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

Looking forward for this, thanks for fix @brancz 👍🏽

Having both toPprof and toProfile was an accident and the latter was
dead code.
@felixge felixge merged commit 1fa9aa6 into felixge:master Aug 27, 2022
@felixge
Copy link
Owner

felixge commented Aug 27, 2022

Thanks for the patch. Sorry for the slow response. Noticed some accidental code duplication while reviewing this, so pushed a small fix for that before merging.

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.

None yet

4 participants