Skip to content

Commit

Permalink
Set dropping mode after open so it is effective (#635)
Browse files Browse the repository at this point in the history
For a while, falco has set the inspector drop mode to 1, which should
discard several classes of events that weren't necessary to use most
falco rules.

However, it was mistakenly being called before the inspector was opened,
which meant it wasn't actually doing anything.

Fix this by setting the dropping mode after the inspector open.

On some spot testing on a moderately loaded environment, this results in
a 30-40% drop in the number of system calls processed per second, and
should result in a nice boost in performance.
  • Loading branch information
mstemm committed May 31, 2019
1 parent 7a25405 commit 21ba0ee
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion userspace/falco/falco.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -856,7 +856,6 @@ int falco_init(int argc, char **argv)
if(!all_events)
{
inspector->set_drop_event_flags(EF_DROP_FALCO);
inspector->start_dropping_mode(1);
}

if (describe_all_rules)
Expand Down Expand Up @@ -964,6 +963,12 @@ int falco_init(int argc, char **argv)
}
}

// This must be done after the open
if(!all_events)
{
inspector->start_dropping_mode(1);
}

// If daemonizing, do it here so any init errors will
// be returned in the foreground process.
if (daemon && !g_daemonized) {
Expand Down

0 comments on commit 21ba0ee

Please sign in to comment.