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

Aggregate frames by line-in-function (java) #799

Open
Jongy opened this issue May 25, 2023 · 2 comments
Open

Aggregate frames by line-in-function (java) #799

Jongy opened this issue May 25, 2023 · 2 comments
Labels
defined-and-prioritized Tickets that have fully defined the desired outcome & are prioritized to be developed. enhancement New feature or request runtime/java

Comments

@Jongy
Copy link
Contributor

Jongy commented May 25, 2023

gProfiler collects profiles function-based, i.e, each frame represents a function.
An alternative is to aggregate line-in-function, so each frame is function:line. This creates a graph that is more fragmented, but carries more information (for example: function A calling function B twice will now have 2 separate callstacks for B under A, allowing you to differentiate).

Various profilers already support it (for example, py-spy does, as far as I'm aware). I want to start with support in Java (so async-profiler).
The feature requirements are:

  1. A flag in gProfiler enabling the behavior: --line-numbers suffices.
  2. This flag is passed into ProfilerState and used by Profiler classes supporting it.
  3. In the case of JavaProfiler, async-profiler alreadys supports line numbering, see code that extracts the BCI -> line numbers table here. It exists for JFR. As we're using the collapsed format, we can add this support to collapsed, like we added method modifers.
  4. Syntax of the frame can be: add :line_number between the _[...] suffix to the frame name itself.

Note that line-of-function was added here: #821. This ticket is for line-in-function.

@Jongy Jongy added enhancement New feature or request runtime/java defined-and-prioritized Tickets that have fully defined the desired outcome & are prioritized to be developed. labels May 25, 2023
@mpozniak95 mpozniak95 self-assigned this Jun 29, 2023
@Jongy
Copy link
Contributor Author

Jongy commented Jul 6, 2023

@mpozniak95 as discussed, I suggest we add a flag --java-line-numbers, which will have 2 values now - none and line-of-function. This ticket is line-in-function and you currently implementing line-of-function, so we'll start only with none and line-of-function. Default value is none.

You can move it out from ProfilerState to JavaProfiler.

@mpozniak95 mpozniak95 removed their assignment Jul 7, 2023
@mpozniak95
Copy link
Contributor

Since PR's that I created are different feature, I am removing my assignment from this issue for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defined-and-prioritized Tickets that have fully defined the desired outcome & are prioritized to be developed. enhancement New feature or request runtime/java
Projects
None yet
Development

No branches or pull requests

3 participants