-
Notifications
You must be signed in to change notification settings - Fork 3k
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
pkg/bpf: generate ASM output if debug enabled #599
Conversation
daemon/daemon.go
Outdated
@@ -198,6 +198,10 @@ func (d *Daemon) PolicyEnabled() bool { | |||
return d.conf.Opts.IsEnabled(endpoint.OptionPolicy) | |||
} | |||
|
|||
func (d *Daemon) GetDebug() bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exported method Daemon.GetDebug should have comment or be unexported
daemon/daemon.go
Outdated
@@ -198,6 +198,10 @@ func (d *Daemon) PolicyEnabled() bool { | |||
return d.conf.Opts.IsEnabled(endpoint.OptionPolicy) | |||
} | |||
|
|||
func (d *Daemon) GetDebug() bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exported method Daemon.GetDebug should have comment or be unexported
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would pay more attention to hound if they'd use a puppy as a logo but we should add a comment to the function nevertheless.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do - I'll only add reviewers after I placate the hound in the future :)
daemon/daemon.go
Outdated
@@ -198,6 +198,10 @@ func (d *Daemon) PolicyEnabled() bool { | |||
return d.conf.Opts.IsEnabled(endpoint.OptionPolicy) | |||
} | |||
|
|||
func (d *Daemon) GetDebug() bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would pay more attention to hound if they'd use a puppy as a logo but we should add a comment to the function nevertheless.
46e7006
to
a7b60eb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tgraf should we also generate ASM output of bpf_netdev
, bpf_lb
and bpf_overlay
?
daemon/daemon.go
Outdated
@@ -198,6 +198,11 @@ func (d *Daemon) PolicyEnabled() bool { | |||
return d.conf.Opts.IsEnabled(endpoint.OptionPolicy) | |||
} | |||
|
|||
// GetDebug returns whether if debug mode is enabled. | |||
func (d *Daemon) GetDebug() bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not DebugEnabled()
? In consistency with the DryModeEnabled()
and TracingEnabled()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in latest upload.
pkg/endpoint: add DebugEnabled to Owner interface daemon: regenerate bindata to account for changes in pkg/bpf/join_ep.sh Add DebugEnabled to Owner interface, implement in daemon, and utilize this method to determine whether debug mode is enabled to pass in as a parameter to join_ep.sh to generate ASM when BPF is generated. Signed-off by: Ian Vernon <ian@covalent.io>
a7b60eb
to
2c70c0d
Compare
I think this is fine to get started. There is no code generation for these static programs so one can always invoke clang manually to generate it. |
pkg/endpoint: add GetDebug to Owner interface
daemon: regenerate bindata to account for changes in pkg/bpf/join_ep.sh
Add GetDebug to Owner interface, implement in daemon, and utilize this method to determine whether debug mode is enabled to pass in as a parameter to join_ep.sh to generate ASM when BPF is generated.
Fixes #429
Signed-off by: Ian Vernon ian@covalent.io