GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Count missed samples when estimating total CPU time in ctimer mode by apangin · Pull Request #1068 · async-profiler/async-profiler

Conversation

@apangin

@apangin apangin commented Nov 29, 2024

Copy link
Copy Markdown
Collaborator

Description

Leverage si_overrun for scaling total CPU time counted in ctimer mode.

Motivation and context

Sampling frequency in ctimer mode depends on the kernel CONFIG_HZ configuration, which is typically 250 or 100 Hz. This means, profiling intervals should be multiple of 4ms/10ms, or they will not work as expected.

Fortunately, if profiling interval is set to a smaller value, Linux will pass the number of missed samples (number of times the timer would have triggered) in si_overrun field of siginfo. We can use this value to compute actual CPU time.

How has this been tested?

Usual tests + new ctimerTotal and itimerTotal unit tests.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
apangin added 4 commits November 29, 2024 18:08
@apangin
Count missed samples when estimating total CPU time in ctimer mode
1c5901d
@apangin
Added unit tests
a285ffb
@apangin
Fixed test on macOS
bc0aeb9
@apangin
Fixed intermittent JfrTest.regularPeak test failures
9ac79c3
@apangin
apangin merged commit 6993349 into master Nov 30, 2024
@apangin
apangin deleted the timer-overrun branch November 30, 2024 21:58
apangin added a commit that referenced this pull request Dec 3, 2024
@apangin
Count missed samples when estimating total CPU time in ctimer mode (#…
c365ce8
…1068)
krk pushed a commit to krk/async-profiler that referenced this pull request Dec 6, 2024
@apangin @krk
Count missed samples when estimating total CPU time in ctimer mode (a…
5408286
…sync-profiler#1068)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@apangin
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.