mirror of
https://github.com/falcosecurity/falco.git
synced 2025-06-25 14:22:15 +00:00
cleanup: too many includes and useless defines
Signed-off-by: Federico Aponte <federico.aponte@sysdig.com>
This commit is contained in:
parent
4d66a50d5b
commit
f6af72fe76
@ -17,14 +17,17 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
*/
|
||||
#include <cstring>
|
||||
#include <iomanip>
|
||||
|
||||
#include "falco_utils.h"
|
||||
#include <libsinsp/utils.h>
|
||||
|
||||
#include <re2/re2.h>
|
||||
|
||||
#include <cstring>
|
||||
#include <fstream>
|
||||
#include <iomanip>
|
||||
#include <thread>
|
||||
|
||||
#define RGX_PROMETHEUS_TIME_DURATION "^((?P<y>[0-9]+)y)?((?P<w>[0-9]+)w)?((?P<d>[0-9]+)d)?((?P<h>[0-9]+)h)?((?P<m>[0-9]+)m)?((?P<s>[0-9]+)s)?((?P<ms>[0-9]+)ms)?$"
|
||||
|
||||
// using pre-compiled regex
|
||||
@ -145,7 +148,7 @@ uint32_t hardware_concurrency()
|
||||
|
||||
void readfile(const std::string& filename, std::string& data)
|
||||
{
|
||||
std::ifstream file(filename.c_str(), std::ios::in);
|
||||
std::ifstream file(filename, std::ios::in);
|
||||
|
||||
if(file.is_open())
|
||||
{
|
||||
|
@ -20,30 +20,11 @@ limitations under the License.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <sstream>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <thread>
|
||||
#include <unordered_set>
|
||||
#include <set>
|
||||
#include <vector>
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
|
||||
#ifdef __GNUC__
|
||||
#define likely(x) __builtin_expect(!!(x), 1)
|
||||
#define unlikely(x) __builtin_expect(!!(x), 0)
|
||||
#else
|
||||
#define likely(x) (x)
|
||||
#define unlikely(x) (x)
|
||||
#endif
|
||||
|
||||
namespace falco
|
||||
namespace falco::utils
|
||||
{
|
||||
|
||||
namespace utils
|
||||
{
|
||||
|
||||
uint64_t parse_prometheus_interval(std::string interval_str);
|
||||
|
||||
std::string wrap_text(const std::string& in, uint32_t indent, uint32_t linelen);
|
||||
@ -57,5 +38,4 @@ namespace network
|
||||
static const std::string UNIX_SCHEME("unix://");
|
||||
bool is_unix_scheme(const std::string& url);
|
||||
} // namespace network
|
||||
} // namespace utils
|
||||
} // namespace falco
|
||||
} // namespace falco::utils
|
||||
|
@ -199,7 +199,7 @@ static falco::app::run_result do_inspect(
|
||||
}
|
||||
else if(rc == SCAP_TIMEOUT)
|
||||
{
|
||||
if(unlikely(ev == nullptr))
|
||||
if(ev == nullptr) [[unlikely]]
|
||||
{
|
||||
timeouts_since_last_success_or_msg++;
|
||||
if(timeouts_since_last_success_or_msg > s.config->m_syscall_evt_timeout_max_consecutives
|
||||
|
Loading…
Reference in New Issue
Block a user