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 -cpuprofile option #267

Merged
merged 1 commit into from
Aug 1, 2022
Merged

tetragon: Add -cpuprofile option #267

merged 1 commit into from
Aug 1, 2022

Conversation

olsajiri
Copy link
Contributor

Adding -cpuprofile option that allows to store go cpu profile
into provided file, like:

# ./tetragon --cpuprofile krava.prof

Tetragon will show the start/stop messagein the log:

  time="2022-07-28T13:39:12+02:00" level=info msg="Starting cpu profiling" file=krava.prof
  ...
  time="2022-07-28T13:39:22+02:00" level=info msg="Stopping cpu profiling" file=krava.prof

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

that should spawn new browser tab, go on 'VIEW' menu,
click on 'Flame Graph' and be amazed ;-)

Signed-off-by: Jiri Olsa jolsa@kernel.org

Adding -cpuprofile option that allows to store go cpu profile
into provided file, like:

  # ./tetragon --cpuprofile krava.prof

Tetragon will show the start/stop messagein the log:

  time="2022-07-28T13:39:12+02:00" level=info msg="Starting cpu profiling" file=krava.prof
  ...
  time="2022-07-28T13:39:22+02:00" level=info msg="Stopping cpu profiling" file=krava.prof

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

that should spawn new browser tab, go on 'VIEW' menu,
click on 'Flame Graph' and be amazed ;-)

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
@olsajiri olsajiri marked this pull request as ready for review July 29, 2022 11:12
@olsajiri olsajiri requested a review from a team as a code owner July 29, 2022 11:12
@olsajiri olsajiri requested a review from tixxdz July 29, 2022 11:12
Copy link
Member

@tixxdz tixxdz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @olsajiri !

@jrfastab jrfastab merged commit 0a5263c into cilium:main Aug 1, 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.

3 participants