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

tetragon: Add memprofile option #349

Merged
merged 2 commits into from
Aug 23, 2022
Merged

tetragon: Add memprofile option #349

merged 2 commits into from
Aug 23, 2022

Conversation

olsajiri
Copy link
Contributor

Adding memprofile option that allows to store go memory profile
into provided file, like:

# ./tetragon --memprofile mem.prof

Tetragon will show the start/stop messagein the log:

  time="2022-08-22T23:19:17+02:00" level=info msg="Starting mem profiling" file=prof.mem
  ... 
  time="2022-08-22T23:19:38+02:00" level=info msg="Stopping mem profiling" file=prof.mem

you can display the profile in browser with:
$ go tool pprof -http=:8080 mem.prof

that should spawn new browser tab with memory profile graph
with flamegraph as an option under 'VIEW' menu.

Signed-off-by: Jiri Olsa [email protected]

Calling stopProfile only from exit go routine. Calling it
from defer function calls it twice.

Signed-off-by: Jiri Olsa <[email protected]>
Adding memprofile option that allows to store go memory profile
into provided file, like:

  # ./tetragon --memprofile mem.prof

Tetragon will show the start/stop messagein the log:

  time="2022-08-22T23:19:17+02:00" level=info msg="Starting mem profiling" file=prof.mem
  ...
  time="2022-08-22T23:19:38+02:00" level=info msg="Stopping mem profiling" file=prof.mem

you can display the profile in browser with:
  $ go tool pprof -http=:8080 mem.prof

that should spawn new browser tab with memory profile graph
with flamegraph as an option under 'VIEW' menu.

Signed-off-by: Jiri Olsa <[email protected]>
@olsajiri olsajiri changed the title Memprofile tetragon: Add memprofile option Aug 22, 2022
@olsajiri olsajiri marked this pull request as ready for review August 23, 2022 11:06
@olsajiri olsajiri requested a review from a team as a code owner August 23, 2022 11:06
@olsajiri olsajiri requested a review from tpapagian August 23, 2022 11:06
@kkourt kkourt merged commit c6e73cc into cilium:main Aug 23, 2022
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.

2 participants