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

runtime/pprof: Remove SIGPROF if the last event is stopped. #3

Open
wants to merge 1 commit into
base: release-branch.go1.16_pmu_pprof
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/runtime/proc.go
Original file line number Diff line number Diff line change
Expand Up @@ -4642,7 +4642,8 @@ func setcpuprofileconfig(eventId cpuEvent, profConfig *cpuProfileConfig) {
// Restore SIGPROF only if all events are stopped
eventsRunning := false
for i := _CPUPROF_FIRST_EVENT; i < _CPUPROF_EVENTS_MAX; i++ {
if prof[i].config != nil {
// If the current event is the last event to be stopped, we should also restore SIGPROF too.
if prof[i].config != nil && i != eventId {
eventsRunning = true
break
}
Expand Down