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

sysdump: Add "serial" tasks support to enable trace data collection #2052

Merged
merged 2 commits into from
Nov 8, 2023

Conversation

pippolo84
Copy link
Member

@pippolo84 pippolo84 commented Oct 17, 2023

  • Add support for "serial" tasks in the sysdump subcommand. Serial tasks are the ones that cannot be executed concurrently with other tasks.
  • Add the collection of the data from the Go execution tracer as a "serial" sysdump task.

See the individual commit messages for further details.

@pippolo84 pippolo84 added the kind/enhancement This would improve or streamline existing functionality. label Oct 17, 2023
@pippolo84 pippolo84 requested a review from a team as a code owner October 17, 2023 16:41
@pippolo84 pippolo84 requested a review from asauber October 17, 2023 16:41
@pippolo84 pippolo84 temporarily deployed to ci October 17, 2023 16:41 — with GitHub Actions Inactive
@pippolo84 pippolo84 force-pushed the pr/pippolo84/add-trace-support branch from 2888dcf to ea90ad3 Compare October 17, 2023 20:14
@pippolo84 pippolo84 temporarily deployed to ci October 17, 2023 20:14 — with GitHub Actions Inactive
@pippolo84

This comment was marked as outdated.

@pippolo84 pippolo84 marked this pull request as draft October 18, 2023 17:07
@pippolo84 pippolo84 force-pushed the pr/pippolo84/add-trace-support branch from ea90ad3 to 1ded6c9 Compare October 18, 2023 17:35
@pippolo84 pippolo84 temporarily deployed to ci October 18, 2023 17:35 — with GitHub Actions Inactive
@pippolo84 pippolo84 changed the title sysdump: Add gops trace data sysdump: Add "serial" tasks support to enable trace data collection Oct 18, 2023
@pippolo84 pippolo84 marked this pull request as ready for review October 18, 2023 17:38
@pippolo84 pippolo84 force-pushed the pr/pippolo84/add-trace-support branch from 1ded6c9 to ed99456 Compare October 18, 2023 17:48
@pippolo84 pippolo84 temporarily deployed to ci October 18, 2023 17:48 — with GitHub Actions Inactive
@@ -26,6 +25,8 @@ import (
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/cli-runtime/pkg/genericclioptions"

"github.com/cilium/cilium/pkg/versioncheck"
Copy link
Member

Choose a reason for hiding this comment

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

It looks like "github.com/cilium/workerpool" could be placed in this section as well.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think it should stay in the previous section because it doesn't have a prefix "github.com/cilium/cilium" (in fact, workerpool lives in its own repository).
At least this is the default settings we use for organizing imports in cilium (my IDE is automatically moving it). Are we are using something different in cilium-cli?

Copy link
Member

Choose a reason for hiding this comment

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

Nit: in cilium/cilium and cilium/cilium-cli we AFAIK only use three import groups:

  1. standard libary
  2. other 3rd party imports
  3. imports from the same module

Following the above, I think the github.com/cilium/cilium/pkg/versioncheck import should stay where it currently is because that package is a 3rd party import from the perspective of this module (github.com/cilium/cilium-cli/sysdump)

Copy link
Member Author

Choose a reason for hiding this comment

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

Might be some misconfig in my IDE, then. I'll move it back there 👍

sysdump/sysdump.go Show resolved Hide resolved
sysdump/sysdump.go Show resolved Hide resolved
sysdump/sysdump.go Show resolved Hide resolved
@pippolo84 pippolo84 force-pushed the pr/pippolo84/add-trace-support branch from ed99456 to 85540e0 Compare October 23, 2023 09:05
@pippolo84 pippolo84 temporarily deployed to ci October 23, 2023 09:05 — with GitHub Actions Inactive
@pippolo84 pippolo84 requested a review from asauber October 23, 2023 09:05
Copy link
Member

@asauber asauber left a comment

Choose a reason for hiding this comment

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

LGTM. Apologies for the delay.

@pippolo84

This comment was marked as outdated.

@pippolo84 pippolo84 added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Oct 31, 2023
sysdump/sysdump.go Show resolved Hide resolved
@@ -26,6 +25,8 @@ import (
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/cli-runtime/pkg/genericclioptions"

"github.com/cilium/cilium/pkg/versioncheck"
Copy link
Member

Choose a reason for hiding this comment

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

Nit: in cilium/cilium and cilium/cilium-cli we AFAIK only use three import groups:

  1. standard libary
  2. other 3rd party imports
  3. imports from the same module

Following the above, I think the github.com/cilium/cilium/pkg/versioncheck import should stay where it currently is because that package is a 3rd party import from the perspective of this module (github.com/cilium/cilium-cli/sysdump)

@tklauser tklauser removed the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Oct 31, 2023
@pippolo84 pippolo84 force-pushed the pr/pippolo84/add-trace-support branch from 85540e0 to c98d89c Compare November 3, 2023 10:17
@pippolo84 pippolo84 requested a review from tklauser November 3, 2023 10:18
Copy link
Member

@tklauser tklauser left a comment

Choose a reason for hiding this comment

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

Thanks

Add support for "serial" tasks in the sysdump subcommand.  Serial tasks
are the ones that cannot be executed concurrently with other tasks.

One example of such task is the collection of the data from the Go
execution tracer, that should not be done while the agent is potentially
busy fulfilling requests from other tasks (e.g: collecting and sending
profiling data).

Signed-off-by: Fabio Falzoi <[email protected]>
Add the ability to scrape trace data from gops.  See
https://pkg.go.dev/runtime/trace for more information about the Go
execution tracer.

The overhead derived from enabling the Go execution tracer, while
usually low and suitable for production use, might be higher than
collecting pprof data, so the option is disabled by default.

Signed-off-by: Fabio Falzoi <[email protected]>
@pippolo84 pippolo84 force-pushed the pr/pippolo84/add-trace-support branch from c98d89c to e4f7508 Compare November 8, 2023 09:22
@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Nov 8, 2023
@tklauser tklauser merged commit 0456653 into main Nov 8, 2023
19 checks passed
@tklauser tklauser deleted the pr/pippolo84/add-trace-support branch November 8, 2023 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement This would improve or streamline existing functionality. ready-to-merge This PR has passed all tests and received consensus from code owners to merge.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants