Skip to content

add a pprof wrapper to simplify profiling#893

Open
vadimalekseev wants to merge 1 commit into
masterfrom
pprof-rule
Open

add a pprof wrapper to simplify profiling#893
vadimalekseev wants to merge 1 commit into
masterfrom
pprof-rule

Conversation

@vadimalekseev

@vadimalekseev vadimalekseev commented Dec 11, 2025

Copy link
Copy Markdown
Member

Describe Your Changes

Add a pprof wrapper to simplify running pprof with support for showing dependencies' source code.

Can be related: google/pprof#611 , golang/go#48601

Usage:

./benchmarks/pprof/pprof.sh http://localhost:9428/debug/pprof/heap

./benchmarks/pprof/pprof.sh ~/Downloads/heap.pprof

Checklist

The following checks are mandatory:

Comment thread Makefile Outdated
@vadimalekseev

Copy link
Copy Markdown
Member Author

For those interested in how pprof finds the source code: https://github.com/google/pprof/blob/e611ec304b22ed2bc39c0fd534f71243962cdd8a/internal/report/source.go#L1006

@vadimalekseev vadimalekseev changed the title add pprof rule for profiling VictoriaLogs add Makefile rule for profiling VictoriaLogs Dec 11, 2025
@vadimalekseev vadimalekseev marked this pull request as draft December 11, 2025 18:45
@vadimalekseev vadimalekseev marked this pull request as ready for review December 11, 2025 20:06
@vadimalekseev vadimalekseev changed the title add Makefile rule for profiling VictoriaLogs add a pprof wrapper to simplify profiling Dec 11, 2025
@func25

func25 commented Dec 12, 2025

Copy link
Copy Markdown
Member

I like the script, though it might be nice for the Makefile to act as a single entry point for executing tools. Would it make sense to still keep the Makefile as the entry point and have it delegate to benchmarks/pprof/pprof.sh?

@AndrewChubatiuk

Copy link
Copy Markdown
Contributor

it can be a separate makefile with debug specific targets

@vadimalekseev

Copy link
Copy Markdown
Member Author

I am not sure about Makefile, because we already have the download gharchive script that is not listed in the Makefile. Let's wait for @valyala's feedback.

@valyala

valyala commented Dec 12, 2025

Copy link
Copy Markdown
Contributor

I don't like this solution, since it is very complicated and fragile. I followed an alternative path and created a pull request for pprof, which fixes all the issues with the inability to find source code for the profile - see google/pprof#977 .

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.

4 participants