-
Notifications
You must be signed in to change notification settings - Fork 24
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
Add perf_event_open test #1363
Add perf_event_open test #1363
Conversation
b9cb304
to
23e572b
Compare
|
0c9121a
to
e60ef3d
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.
Thanks for putting this together @erthalion! I left a few comments but nothing major, think we can go ahead and merge stackrox/falcosecurity-libs#57 so we can directly update the falco submodule here, WDYT?
// How long to wait for events, in seconds | ||
int wait_interval = 10; | ||
|
||
// /sys/kernel/debug/tracing/events/sched/sched_process_exit/id | ||
int tracepoint_code = 310; | ||
|
||
if (argc == 3) { | ||
wait_interval = atoi(argv[1]); | ||
tracepoint_code = atoi(argv[2]); | ||
} |
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.
Looks like we are always using the arguments passed in, so we might want to fail if the number of arguments is wrong instead.
// How long to wait for events, in seconds | |
int wait_interval = 10; | |
// /sys/kernel/debug/tracing/events/sched/sched_process_exit/id | |
int tracepoint_code = 310; | |
if (argc == 3) { | |
wait_interval = atoi(argv[1]); | |
tracepoint_code = atoi(argv[2]); | |
} | |
if (argc != 3) { | |
fprintf(stderr, "Expected 2 arguments, got: %d", argc - 1); | |
exit(EXIT_FAILURE); | |
} | |
// How long to wait for events, in seconds | |
int wait_interval = atoi(argv[1]); | |
// /sys/kernel/debug/tracing/events/sched/sched_process_exit/id | |
int tracepoint_code = atoi(argv[2]); | |
integration-tests/suites/base.go
Outdated
@@ -234,7 +234,7 @@ func (s *IntegrationTestSuiteBase) GetLogLines(containerName string) []string { | |||
} | |||
|
|||
func (s *IntegrationTestSuiteBase) launchContainer(name string, args ...string) (string, error) { | |||
cmd := []string{common.RuntimeCommand, "run", "-d", "--name", name} | |||
cmd := []string{common.RuntimeCommand, "run", "-d", "--name", name, "--privileged"} |
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.
This will launch all containers as privileged, you probably want to add the flag specifically to the perf-event-open
container via the args
parameter.
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.
Either that or we want a separate launchPrivilegedContainer
method that adds the flag.
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.
Oh, this one is definitely not what I intended to do, probably a left over after some code shuffling.
kernel-modules/MODULE_VERSION
Outdated
@@ -1 +1 @@ | |||
2.6.0 | |||
2.7.0-rc1 |
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.
Since we are pretty close to the release, we probably want to go directly to 2.7.0
Yep, makes sense to me. |
Do everything in a single run. Co-authored-by: Mauro Ezequiel Moltrasio <[email protected]>
Merged! |
Invert arguments checking logic for the test binary. Remove unnecessary sampling bits from the perf_even_open config. Move the privileged flag to be used only for perf_event_open container. Set new modules version.
…llector into feature/perf-event-open-test
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.
LGTM!
Description
Checklist
- [ ] Updated documentation accordinglyAutomated testing
- [ ] Added unit tests- [ ] Added regression testsTesting Performed