Skip to content

Commit

Permalink
fix: fix build on windows
Browse files Browse the repository at this point in the history
Signed-off-by: Andrea Terzolo <[email protected]>
  • Loading branch information
Andreagit97 committed Oct 3, 2023
1 parent 25ae335 commit b0fdb31
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 4 deletions.
20 changes: 20 additions & 0 deletions userspace/libsinsp/pod_regex.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
Copyright (C) 2023 The Falco Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

#pragma once

#define RGX_POD "(pod[a-z0-9]{8}[-_][a-z0-9]{4}[-_][a-z0-9]{4}[-_][a-z0-9]{4}[-_][a-z0-9]{12})"
3 changes: 2 additions & 1 deletion userspace/libsinsp/test/classes/sinsp_threadinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ limitations under the License.
*/

#include <test/helpers/threads_helpers.h>
#include <re2/re2.h>
#include "pod_regex.h"

TEST(sinsp_threadinfo, get_main_thread)
{
Expand Down Expand Up @@ -129,7 +131,6 @@ TEST_F(sinsp_with_test_input, THRD_INFO_assign_children_to_a_nullptr)
// This test asserts that our regex is solid against all possible cgroup layouts
TEST(sinsp_threadinfo, check_pod_uid_regex)
{
// RGX_POD is defined in `threadinfo.h`
re2::RE2 pattern(RGX_POD, re2::RE2::POSIX);

// CgroupV1, driver cgroup
Expand Down
3 changes: 3 additions & 0 deletions userspace/libsinsp/threadinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ limitations under the License.
#include "tracer_emitter.h"
#endif

#include <re2/re2.h>
#include "pod_regex.h"

constexpr static const char* s_thread_table_name = "threads";

extern sinsp_evttables g_infotables;
Expand Down
3 changes: 0 additions & 3 deletions userspace/libsinsp/threadinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ struct iovec {
#include "internal_metrics.h"
#include "state/table.h"
#include "thread_group_info.h"
#include <re2/re2.h>

#define RGX_POD "(pod[a-z0-9]{8}[-_][a-z0-9]{4}[-_][a-z0-9]{4}[-_][a-z0-9]{4}[-_][a-z0-9]{12})"

class sinsp_delays_info;
class sinsp_tracerparser;
Expand Down

0 comments on commit b0fdb31

Please sign in to comment.