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 — Configure alternative profiling signal · Issue #759 · async-profiler/async-profiler

Configure alternative profiling signal #759

New issue
Copy link
New issue
Copy link
Closed
Closed
Configure alternative profiling signal#759
Copy link
Labels
enhancement

Description

@apangin
apangin
opened on Jun 20, 2023
Issue body actions

Background

Async-profiler heavily relies on POSIX signals. In perf_events and itimer modes, a profiling event triggers delivery of SIGPROF to a currently running thread. In wall mode, a thread being sampled receives SIGVTALRM. Async-profiler assumes the application does not use SIGPROF or SIGVTALRM for other purposes.

Furthermore, since a signal handler is a global property of a process, it is not possible to run two instances of async-profiler on the same process concurrently. For example, this can be helpful for doing some ad-hoc profiling with a custom configuration while continuous profiling is already running.

Proposal

Introduce new signal argument to override the default profiling signal(s). It can be used to configure continuous profiler to avoid conflict with an ad-hoc profiler.

E.g. -agentlib:asyncProfiler=start,event=cpu,signal=36 will force async-profiler use SIGRTMIN+2 instead of SIGPROF for CPU profiling.

To change both cpu and wall signals, we'll use syntax like signal=36/37.

Reacted by Johannes Bechberger and Yonatan Goldschmidt

Activity

  1. apangin
    added
    enhancement
    on Jun 20, 2023
  2. apangin
    added a commit that references this issue on Jul 4, 2023

    #759: Configure alternative profiling signal

    117594b
  3. apangin
    closed this as completedon Jul 4, 2023
  4. parttimenerd commented on Jul 12, 2023

    @parttimenerd
    parttimenerd
    on Jul 12, 2023
    Contributor
    More actions

    Couldn't async-profiler detect this and choose other signals automatically? The underlying APIs seem to offer the possibility.

  5. apangin commented on Jul 12, 2023

    @apangin
    apangin
    on Jul 12, 2023
    CollaboratorAuthor
    More actions

    What it can detect automatically is whether a signal has a non-default handler. This does not yet tell if a signal is really used, but this could be sufficient in some cases. However, sometimes async-profiler needs to cooperate with an external process, e.g., system-wide eBPF profiling agent. In these cases, the signal should be set explicitly to be in line with what an external agent uses.

  6. parttimenerd commented on Jul 12, 2023

    @parttimenerd
    parttimenerd
    on Jul 12, 2023
    Contributor
    More actions

    What it can detect automatically is whether a signal has a non-default handler.

    And maybe warn the user about this fact.

    However, sometimes async-profiler needs to cooperate with an external process, e.g., system-wide eBPF profiling agent. In these cases, the signal should be set explicitly to be in line with what an external agent uses.

    But maybe we could by default make it choose its signals automatically and have a setting to set them explicitly. Or have a signal=auto option.

  7. apangin commented on Jul 14, 2023

    @apangin
    apangin
    on Jul 14, 2023
    CollaboratorAuthor
    More actions

    I'm not sure how important it is right now, but it's an interesting idea.

  8. parttimenerd commented on Jul 14, 2023

    @parttimenerd
    parttimenerd
    on Jul 14, 2023
    Contributor
    More actions

    When I find time after working on my JEP, I might take a look into this :)

    Reacted by Andrei Pangin
  9. apangin
    added a commit that references this issue on Mar 16, 2024

    #759: Discover available profiling signal automatically

    397f450
  10. apangin commented on Mar 16, 2024

    @apangin
    apangin
    on Mar 16, 2024
    CollaboratorAuthor
    More actions

    I pushed the fix to automatically find an available signal if the default one is already used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      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.