sysdig: update to 0.33.1.

This commit is contained in:
Đoàn Trần Công Danh 2023-08-21 21:31:19 +07:00
parent 92e90f0dd4
commit 6633a5ade7
8 changed files with 72 additions and 614 deletions

View File

@ -1,11 +0,0 @@
--- a/userspace/libsinsp/CMakeLists.txt 2023-06-05 10:25:32.000000000 +0200
+++ - 2023-07-11 09:03:42.496439385 +0200
@@ -289,7 +289,7 @@
endif()
endif() # NOT WIN32
-
+LIST(APPEND SINSP_LIBRARIES absl_log_internal_message absl_log_internal_nullguard)
target_link_libraries(sinsp ${SINSP_LIBRARIES})
if(APPLE)

View File

@ -1,22 +0,0 @@
diff --git a/userspace/libsinsp/CMakeLists.txt b/userspace/libsinsp/CMakeLists.txt
index 18e59b1..b23e890 100644
--- a/userspace/libsinsp/CMakeLists.txt
+++ b/userspace/libsinsp/CMakeLists.txt
@@ -38,6 +38,7 @@ include(ExternalProject)
if(NOT WIN32 AND NOT APPLE)
include(b64)
+ find_library(ZSTD_LIB NAMES zstd)
endif()
include(jsoncpp)
@@ -246,7 +247,8 @@ if(NOT WIN32)
"${PROTOBUF_LIB}"
"${CARES_LIB}"
"${JQ_LIB}"
- "${B64_LIB}")
+ "${B64_LIB}"
+ "${ZSTD_LIB}")
if(NOT MUSL_OPTIMIZED_BUILD)
list(APPEND SINSP_LIBRARIES

View File

@ -1,557 +0,0 @@
From 3d22309a7317d500f75d053af6f9e5b5b5728b40 Mon Sep 17 00:00:00 2001
From: Jason Dellaluce <jasondellaluce@gmail.com>
Date: Mon, 22 May 2023 09:56:04 +0000
Subject: [PATCH 1/6] update(cmake): bump driver to 5.0.0+driver
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
---
cmake/modules/driver.cmake | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/cmake/modules/driver.cmake b/cmake/modules/driver.cmake
index bee1926d3a..7fd35d7f99 100644
--- a/cmake/modules/driver.cmake
+++ b/cmake/modules/driver.cmake
@@ -31,8 +31,8 @@ else()
# In case you want to test against another driver version (or branch, or commit) just pass the variable -
# ie., `cmake -DDRIVER_VERSION=dev ..`
if(NOT DRIVER_VERSION)
- set(DRIVER_VERSION "4.0.1+driver")
- set(DRIVER_CHECKSUM "SHA256=424d647aa6b6fa45b6701c4bbc9293c161ed00a08254d83eea419c0a736f280d")
+ set(DRIVER_VERSION "5.0.0+driver")
+ set(DRIVER_CHECKSUM "SHA256=c988ca7ac7d174f62d1bfbaaca49efd117f7b329f474d1b46b643635b2e35083")
endif()
# cd /path/to/build && cmake /path/to/source
From 847e602404dcee85f06dde5a1d8ad0c740c49c98 Mon Sep 17 00:00:00 2001
From: Jason Dellaluce <jasondellaluce@gmail.com>
Date: Mon, 22 May 2023 09:56:08 +0000
Subject: [PATCH 2/6] update(cmake): bump libs to 0.11.0-rc1
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
---
cmake/modules/falcosecurity-libs.cmake | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/cmake/modules/falcosecurity-libs.cmake b/cmake/modules/falcosecurity-libs.cmake
index b345c057ad..f30233b9e3 100644
--- a/cmake/modules/falcosecurity-libs.cmake
+++ b/cmake/modules/falcosecurity-libs.cmake
@@ -32,8 +32,8 @@ else()
# In case you want to test against another falcosecurity/libs version (or branch, or commit) just pass the variable -
# ie., `cmake -DFALCOSECURITY_LIBS_VERSION=dev ..`
if(NOT FALCOSECURITY_LIBS_VERSION)
- set(FALCOSECURITY_LIBS_VERSION "0.10.5")
- set(FALCOSECURITY_LIBS_CHECKSUM "SHA256=2a4b37c08bec4ba81326314831f341385aff267062e8d4483437958689662936")
+ set(FALCOSECURITY_LIBS_VERSION "0.11.0-rc1")
+ set(FALCOSECURITY_LIBS_CHECKSUM "SHA256=bb6e57f66ae85dcda6e695226cd14082d9a1215902909cdde5b83f7abef44d8f")
endif()
# cd /path/to/build && cmake /path/to/source
From 1d1dbaf06265d8eefd4038e8474f71f7958ec840 Mon Sep 17 00:00:00 2001
From: Jason Dellaluce <jasondellaluce@gmail.com>
Date: Mon, 22 May 2023 10:43:27 +0000
Subject: [PATCH 3/6] fix(cmake): solve c++17 compilation issues
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
---
CMakeLists.txt | 3 +++
cmake/modules/falcosecurity-libs.cmake | 10 +++++-----
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0309d66633..6d28c6c67d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -146,6 +146,9 @@ if(NOT DEFINED SYSDIG_COMPONENT_NAME)
set(SYSDIG_COMPONENT_NAME "${CMAKE_PROJECT_NAME}")
endif()
+set(CMAKE_CXX_STANDARD 17)
+set(CMAKE_CXX_EXTENSIONS OFF)
+
include(falcosecurity-libs)
include(yaml-cpp)
include(nlohmann-json)
diff --git a/cmake/modules/falcosecurity-libs.cmake b/cmake/modules/falcosecurity-libs.cmake
index f30233b9e3..fe5dacd7ad 100644
--- a/cmake/modules/falcosecurity-libs.cmake
+++ b/cmake/modules/falcosecurity-libs.cmake
@@ -94,12 +94,12 @@ else()
endif()
include(CheckCXXCompilerFlag)
-CHECK_CXX_COMPILER_FLAG("-std=c++14" COMPILER_SUPPORTS_CXX14)
-if(CREATE_TEST_TARGETS AND NOT WIN32 AND COMPILER_SUPPORTS_CXX14)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
+CHECK_CXX_COMPILER_FLAG("-std=c++17" COMPILER_SUPPORTS_CXX17)
+if(CREATE_TEST_TARGETS AND NOT WIN32 AND COMPILER_SUPPORTS_CXX17)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
include(gtest)
-elseif(CREATE_TEST_TARGETS AND NOT COMPILER_SUPPORTS_CXX14)
- message(FATAL_ERROR "Your compiler doesn't support c++14: cannot include gtest and create test targets.")
+elseif(CREATE_TEST_TARGETS AND NOT COMPILER_SUPPORTS_CXX17)
+ message(FATAL_ERROR "Your compiler doesn't support c++17: cannot include gtest and create test targets.")
endif()
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
From d5fcbad2d5ea63e1439ab7174a5cfd9a7a2e1545 Mon Sep 17 00:00:00 2001
From: Jason Dellaluce <jasondellaluce@gmail.com>
Date: Mon, 22 May 2023 10:44:05 +0000
Subject: [PATCH 4/6] update(userspace): sync sysdig and csysdig with latest
libs
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
---
userspace/sysdig/csysdig.cpp | 6 +--
userspace/sysdig/sysdig.cpp | 9 +---
userspace/sysdig/utils/plugin_utils.cpp | 37 ++++++++++-----
userspace/sysdig/utils/sinsp_opener.cpp | 18 ++++----
userspace/sysdig/utils/supported_events.cpp | 50 +++++++++++----------
userspace/sysdig/utils/supported_fields.cpp | 15 +++----
6 files changed, 70 insertions(+), 65 deletions(-)
diff --git a/userspace/sysdig/csysdig.cpp b/userspace/sysdig/csysdig.cpp
index 9419882341..edd8129a0e 100644
--- a/userspace/sysdig/csysdig.cpp
+++ b/userspace/sysdig/csysdig.cpp
@@ -39,11 +39,11 @@ limitations under the License.
#include "chisel.h"
#include "chisel_utils.h"
#endif
-#include "fields_info.h"
#include "chisel_table.h"
#include "utils.h"
#include "utils/plugin_utils.h"
#include "utils/sinsp_opener.h"
+#include "utils/supported_fields.h"
#ifdef _WIN32
#include "win32/getopt.h"
@@ -704,8 +704,8 @@ sysdig_init_res csysdig_init(int argc, char **argv)
//
if(list_flds)
{
- list_fields(false, false);
-
+ // todo(jasondellaluce): support source selection, verbosity, markdown
+ print_supported_fields(inspector, plugins, "", true, false);
res.m_res = EXIT_SUCCESS;
goto exit;
}
diff --git a/userspace/sysdig/sysdig.cpp b/userspace/sysdig/sysdig.cpp
index 40f2b39ef9..a978070d73 100644
--- a/userspace/sysdig/sysdig.cpp
+++ b/userspace/sysdig/sysdig.cpp
@@ -43,7 +43,6 @@ limitations under the License.
#include "chisel_utils.h"
#include "chisel_fields_info.h"
#endif
-#include "fields_info.h"
#include "utils.h"
#include "plugin.h"
#include "plugin_manager.h"
@@ -455,8 +454,6 @@ void print_summary_table(sinsp* inspector,
std::vector<summary_table_entry> &summary_table,
uint32_t nentries)
{
- sinsp_evttables* einfo = inspector->get_event_info_tables();
-
std::cout << "----------------------\n";
std::string tstr = std::string("Event");
tstr.resize(16, ' ');
@@ -478,7 +475,7 @@ void print_summary_table(sinsp* inspector,
if(e.m_is_unsupported_syscall)
{
- tstr = einfo->m_syscall_info_table[e.m_id / 2].name;
+ tstr = scap_get_ppm_sc_name((ppm_sc_code) (e.m_id / 2));
tstr.resize(16, ' ');
printf("%s%s%" PRIu64 "\n",
@@ -488,7 +485,7 @@ void print_summary_table(sinsp* inspector,
}
else
{
- tstr = einfo->m_event_info[e.m_id].name;
+ tstr = libsinsp::events::info((ppm_event_code) e.m_id)->name;
tstr.resize(16, ' ');
printf("%s%s%" PRIu64 "\n",
@@ -1862,8 +1859,6 @@ sysdig_init_res sysdig_init(int argc, char **argv)
res.m_res = EXIT_FAILURE;
goto exit;
}
-
- inspector->filter_proc_table_when_saving(true);
}
else
{
diff --git a/userspace/sysdig/utils/plugin_utils.cpp b/userspace/sysdig/utils/plugin_utils.cpp
index ad69543b3e..b99de98b66 100644
--- a/userspace/sysdig/utils/plugin_utils.cpp
+++ b/userspace/sysdig/utils/plugin_utils.cpp
@@ -146,6 +146,7 @@ void plugin_utils::plugin_entry::init(sinsp *inspector)
}
if (plugin->caps() & CAP_EXTRACTION)
{
+ // todo(jasondellaluce): manage field name conflicts
g_filterlist.add_filter_check(sinsp_plugin::new_filtercheck(plugin));
}
inited = true;
@@ -185,13 +186,30 @@ void plugin_utils::plugin_entry::print_info(sinsp* inspector, std::ostringstream
os << "Capabilities: " << std::endl;
if(plugin->caps() & CAP_SOURCING)
{
- os << " - Event Sourcing (ID=" << plugin->id();
- os << ", source='" << plugin->event_source() << "')" << std::endl;
+ os << " - Event Sourcing";
+ if (plugin->id() != 0)
+ {
+ os << " (ID=" << plugin->id();
+ os << ", source='" << plugin->event_source() << "')";
+ }
+ else
+ {
+ os << " (system events)";
+ }
+ os << std::endl;
}
if(plugin->caps() & CAP_EXTRACTION)
{
os << " - Field Extraction" << std::endl;
}
+ if(plugin->caps() & CAP_PARSING)
+ {
+ os << " - Event Parsing" << std::endl;
+ }
+ if(plugin->caps() & CAP_ASYNC)
+ {
+ os << " - Async Events" << std::endl;
+ }
}
void plugin_utils::add_dir(std::string dirname, bool front_add)
@@ -609,7 +627,7 @@ std::vector<std::string> plugin_utils::get_event_sources(sinsp *inspector)
// the plugin, in case it was not registered already
pl.get_plugin(inspector);
}
- return inspector->get_plugin_manager()->sources();
+ return inspector->event_sources();
}
std::vector<std::unique_ptr<sinsp_filter_check>> plugin_utils::get_filterchecks(sinsp *inspector, const std::string& source)
@@ -617,16 +635,13 @@ std::vector<std::unique_ptr<sinsp_filter_check>> plugin_utils::get_filterchecks(
std::vector<std::unique_ptr<sinsp_filter_check>> list;
list.push_back(std::unique_ptr<sinsp_filter_check>(inspector->new_generic_filtercheck()));
- // todo(jasondellaluce): remove this once we support extracting plugin fields from syscalls
- if (source != s_syscall_source)
+ for (auto &pl : m_plugins)
{
- for (auto &pl : m_plugins)
+ auto plugin = pl.get_plugin(inspector);
+ if (plugin->caps() & CAP_EXTRACTION
+ && sinsp_plugin::is_source_compatible(plugin->extract_event_sources(), source))
{
- auto plugin = pl.get_plugin(inspector);
- if (plugin->caps() & CAP_EXTRACTION && plugin->is_source_compatible(source))
- {
- list.push_back(std::unique_ptr<sinsp_filter_check>(sinsp_plugin::new_filtercheck(plugin)));
- }
+ list.push_back(std::unique_ptr<sinsp_filter_check>(sinsp_plugin::new_filtercheck(plugin)));
}
}
return list;
diff --git a/userspace/sysdig/utils/sinsp_opener.cpp b/userspace/sysdig/utils/sinsp_opener.cpp
index eafdb631d3..7315b99c7d 100644
--- a/userspace/sysdig/utils/sinsp_opener.cpp
+++ b/userspace/sysdig/utils/sinsp_opener.cpp
@@ -50,14 +50,12 @@ void sinsp_opener::open(sinsp* inspector) const
#if defined(HAS_CAPTURE)
/* Populate syscalls of interest */
- std::unordered_set<uint32_t> sc_of_interest = inspector->get_all_ppm_sc();
+ auto sc_of_interest = libsinsp::events::all_sc_set();
- /* Populate tracepoints of interest */
- std::unordered_set<uint32_t> tp_of_interest = inspector->get_all_tp();
if(!options.page_faults)
{
- tp_of_interest.erase(PAGE_FAULT_USER);
- tp_of_interest.erase(PAGE_FAULT_KERN);
+ sc_of_interest.remove(ppm_sc_code::PPM_SC_PAGE_FAULT_USER);
+ sc_of_interest.remove(ppm_sc_code::PPM_SC_PAGE_FAULT_KERNEL);
}
if(udig.enabled)
@@ -77,7 +75,7 @@ void sinsp_opener::open(sinsp* inspector) const
#ifdef HAS_MODERN_BPF
if(bpf.modern)
{
- inspector->open_modern_bpf(DEFAULT_DRIVER_BUFFER_BYTES_DIM, bpf.cpus_for_each_syscall_buffer, true, sc_of_interest, tp_of_interest);
+ inspector->open_modern_bpf(DEFAULT_DRIVER_BUFFER_BYTES_DIM, bpf.cpus_for_each_syscall_buffer, true, sc_of_interest);
return;
}
#endif
@@ -95,7 +93,7 @@ void sinsp_opener::open(sinsp* inspector) const
try
{
- inspector->open_bpf(probe, DEFAULT_DRIVER_BUFFER_BYTES_DIM, sc_of_interest, tp_of_interest);
+ inspector->open_bpf(probe, DEFAULT_DRIVER_BUFFER_BYTES_DIM, sc_of_interest);
}
catch(const sinsp_exception& e)
{
@@ -103,7 +101,7 @@ void sinsp_opener::open(sinsp* inspector) const
{
fprintf(stderr, "Unable to load the BPF probe\n");
}
- inspector->open_bpf(probe, DEFAULT_DRIVER_BUFFER_BYTES_DIM, sc_of_interest, tp_of_interest);
+ inspector->open_bpf(probe, DEFAULT_DRIVER_BUFFER_BYTES_DIM, sc_of_interest);
}
// Enable gathering the CPU from the kernel module
@@ -114,7 +112,7 @@ void sinsp_opener::open(sinsp* inspector) const
// default to kernel module if no other option is specified
try
{
- inspector->open_kmod(DEFAULT_DRIVER_BUFFER_BYTES_DIM, sc_of_interest, tp_of_interest);
+ inspector->open_kmod(DEFAULT_DRIVER_BUFFER_BYTES_DIM, sc_of_interest);
}
catch(const sinsp_exception& e)
{
@@ -124,7 +122,7 @@ void sinsp_opener::open(sinsp* inspector) const
{
fprintf(stderr, "Unable to load the driver\n");
}
- inspector->open_kmod(DEFAULT_DRIVER_BUFFER_BYTES_DIM, sc_of_interest, tp_of_interest);
+ inspector->open_kmod(DEFAULT_DRIVER_BUFFER_BYTES_DIM, sc_of_interest);
}
// Enable gathering the CPU from the kernel module
diff --git a/userspace/sysdig/utils/supported_events.cpp b/userspace/sysdig/utils/supported_events.cpp
index 1442911209..7f0d630011 100644
--- a/userspace/sysdig/utils/supported_events.cpp
+++ b/userspace/sysdig/utils/supported_events.cpp
@@ -27,25 +27,25 @@ struct event_entry
{
bool is_enter;
std::string name;
- struct ppm_event_info info;
+ const ppm_event_info* info;
};
-static std::vector<event_entry> get_event_entries(sinsp* inspector, bool include_generics)
+static std::vector<event_entry> get_event_entries(bool include_generics)
{
event_entry entry;
std::vector<event_entry> events;
- const struct ppm_event_info* etable = inspector->get_event_info_tables()->m_event_info;
// skip generic events
- for(uint32_t evt = PPME_GENERIC_X + 1; evt < PPM_EVENT_MAX; evt++)
+ for(const auto& evt : libsinsp::events::all_event_set())
{
- if (!sinsp::is_old_version_event(evt)
- && !sinsp::is_unused_event(evt)
- && !sinsp::is_unknown_event(evt))
+ if (!libsinsp::events::is_generic(evt)
+ && !libsinsp::events::is_old_version_event(evt)
+ && !libsinsp::events::is_unused_event(evt)
+ && !libsinsp::events::is_unknown_event(evt))
{
entry.is_enter = PPME_IS_ENTER(evt);
- entry.name = etable[evt].name;
- entry.info = etable[evt];
+ entry.info = libsinsp::events::info(evt);
+ entry.name = entry.info->name;
events.push_back(entry);
}
}
@@ -53,17 +53,19 @@ static std::vector<event_entry> get_event_entries(sinsp* inspector, bool include
if (include_generics)
{
// append generic events
- const auto generic_syscalls = inspector->get_events_names({PPME_GENERIC_E});
- for (const auto& name : generic_syscalls)
- {
- for(uint32_t evt = PPME_GENERIC_E; evt <= PPME_GENERIC_X; evt++)
- {
- entry.is_enter = PPME_IS_ENTER(evt);
- entry.name = name;
- entry.info = etable[evt];
- events.push_back(entry);
- }
- }
+ const auto names = libsinsp::events::event_set_to_names({ppm_event_code::PPME_GENERIC_E});
+ for (const auto& name : names)
+ {
+ entry.is_enter = PPME_IS_ENTER(ppm_event_code::PPME_GENERIC_E);
+ entry.info = libsinsp::events::info(ppm_event_code::PPME_GENERIC_E);
+ entry.name = name;
+ events.push_back(entry);
+
+ entry.is_enter = PPME_IS_ENTER(ppm_event_code::PPME_GENERIC_X);
+ entry.info = libsinsp::events::info(ppm_event_code::PPME_GENERIC_X);
+ entry.name = name;
+ events.push_back(entry);
+ }
}
return events;
@@ -71,7 +73,7 @@ static std::vector<event_entry> get_event_entries(sinsp* inspector, bool include
void print_supported_events(sinsp* inspector, bool markdown)
{
- const auto events = get_event_entries(inspector, true);
+ const auto events = get_event_entries(true);
if(markdown)
{
@@ -91,15 +93,15 @@ void print_supported_events(sinsp* inspector, bool markdown)
printf("%c %s(", dir, e.name.c_str());
}
- for(uint32_t k = 0; k < e.info.nparams; k++)
+ for(uint32_t k = 0; k < e.info->nparams; k++)
{
if(k != 0)
{
printf(", ");
}
- printf("%s %s", param_type_to_string(e.info.params[k].type),
- e.info.params[k].name);
+ printf("%s %s", param_type_to_string(e.info->params[k].type),
+ e.info->params[k].name);
}
printf(")\n");
}
diff --git a/userspace/sysdig/utils/supported_fields.cpp b/userspace/sysdig/utils/supported_fields.cpp
index 6e2575b030..3127fb7220 100644
--- a/userspace/sysdig/utils/supported_fields.cpp
+++ b/userspace/sysdig/utils/supported_fields.cpp
@@ -35,11 +35,9 @@ void print_supported_fields(sinsp* inspector, plugin_utils& plugins, const std::
{
std::vector<fields_info> field_infos;
std::vector<std::unique_ptr<const sinsp_filter_check>> filtecheck_lists; // only used to retain memory until we finish
- std::vector<std::string> sources = { s_syscall_source };
+ std::vector<std::string> sources = plugins.get_event_sources(inspector);
// add event sources defined by the loaded plugins
- const auto& plugin_sources = plugins.get_event_sources(inspector);
- sources.insert(sources.end(), plugin_sources.begin(), plugin_sources.end());
if (!source.empty())
{
bool found = false;
@@ -66,7 +64,6 @@ void print_supported_fields(sinsp* inspector, plugin_utils& plugins, const std::
}
std::vector<const filter_check_info*> filterchecks;
- // todo(jasondellaluce): change this once we support extracting plugin fields from syscalls
if (src == s_syscall_source)
{
std::vector<const filter_check_info*> all_checks;
@@ -81,13 +78,11 @@ void print_supported_fields(sinsp* inspector, plugin_utils& plugins, const std::
}
}
}
- else
+
+ for (auto& check: plugins.get_filterchecks(inspector, src))
{
- for (auto& check: plugins.get_filterchecks(inspector, src))
- {
- filterchecks.push_back(check->get_fields());
- filtecheck_lists.push_back(std::move(check));
- }
+ filterchecks.push_back(check->get_fields());
+ filtecheck_lists.push_back(std::move(check));
}
const auto classes = sinsp_filter_factory::check_infos_to_fieldclass_infos(filterchecks);
From c8b0d055aec4d2378b7934dd9436fd4500d1021e Mon Sep 17 00:00:00 2001
From: Jason Dellaluce <jasondellaluce@gmail.com>
Date: Mon, 22 May 2023 14:15:23 +0000
Subject: [PATCH 5/6] fix: solve compilation issues on windows
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
---
CMakeLists.txt | 3 +++
1 file changed, 3 insertions(+)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6d28c6c67d..5afd967f27 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -148,6 +148,9 @@ endif()
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_EXTENSIONS OFF)
+if(MSVC OR WIN32)
+ add_compile_definitions(_HAS_STD_BYTE=0)
+endif()
include(falcosecurity-libs)
include(yaml-cpp)
From 954e6fc6238f21d4870a491395d68a7dd3062aa9 Mon Sep 17 00:00:00 2001
From: Roberto Scolaro <roberto.scolaro21@gmail.com>
Date: Mon, 5 Jun 2023 10:34:03 +0000
Subject: [PATCH 6/6] update(cmake): bump libs 0.11.0 + driver 5.0.1
Signed-off-by: Roberto Scolaro <roberto.scolaro21@gmail.com>
---
CMakeLists.txt | 2 +-
cmake/modules/driver.cmake | 4 ++--
cmake/modules/falcosecurity-libs.cmake | 4 ++--
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5afd967f27..f3f23b5e9a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -90,7 +90,7 @@ if(NOT WIN32)
endif()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_COMMON_FLAGS}")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_COMMON_FLAGS} -std=c++0x")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_COMMON_FLAGS} -std=c++17")
set(CMAKE_C_FLAGS_DEBUG "${SYSDIG_DEBUG_FLAGS}")
set(CMAKE_CXX_FLAGS_DEBUG "${SYSDIG_DEBUG_FLAGS}")
diff --git a/cmake/modules/driver.cmake b/cmake/modules/driver.cmake
index 7fd35d7f99..ca1e56718c 100644
--- a/cmake/modules/driver.cmake
+++ b/cmake/modules/driver.cmake
@@ -31,8 +31,8 @@ else()
# In case you want to test against another driver version (or branch, or commit) just pass the variable -
# ie., `cmake -DDRIVER_VERSION=dev ..`
if(NOT DRIVER_VERSION)
- set(DRIVER_VERSION "5.0.0+driver")
- set(DRIVER_CHECKSUM "SHA256=c988ca7ac7d174f62d1bfbaaca49efd117f7b329f474d1b46b643635b2e35083")
+ set(DRIVER_VERSION "5.0.1+driver")
+ set(DRIVER_CHECKSUM "SHA256=8b197b916b6419dac8fb41807aa05d822164c7bfd2c3eef66d20d060a05a485a")
endif()
# cd /path/to/build && cmake /path/to/source
diff --git a/cmake/modules/falcosecurity-libs.cmake b/cmake/modules/falcosecurity-libs.cmake
index fe5dacd7ad..c626d7944e 100644
--- a/cmake/modules/falcosecurity-libs.cmake
+++ b/cmake/modules/falcosecurity-libs.cmake
@@ -32,8 +32,8 @@ else()
# In case you want to test against another falcosecurity/libs version (or branch, or commit) just pass the variable -
# ie., `cmake -DFALCOSECURITY_LIBS_VERSION=dev ..`
if(NOT FALCOSECURITY_LIBS_VERSION)
- set(FALCOSECURITY_LIBS_VERSION "0.11.0-rc1")
- set(FALCOSECURITY_LIBS_CHECKSUM "SHA256=bb6e57f66ae85dcda6e695226cd14082d9a1215902909cdde5b83f7abef44d8f")
+ set(FALCOSECURITY_LIBS_VERSION "0.11.0")
+ set(FALCOSECURITY_LIBS_CHECKSUM "SHA256=90414d00591986e94f2c49e7d65eef5c2dedee266354dd3db8234bb3b06c86fa")
endif()
# cd /path/to/build && cmake /path/to/source

View File

@ -1,28 +1,32 @@
diff --git a/cmake/modules/driver-repo/CMakeLists.txt b/cmake/modules/driver-repo/CMakeLists.txt
index 479611a..5238121 100644
--- a/cmake/modules/driver-repo/CMakeLists.txt
+++ b/cmake/modules/driver-repo/CMakeLists.txt
@@ -25,8 +25,7 @@ message(STATUS "Driver version: ${DRIVER_VERSION}")
@@ -25,11 +25,10 @@ message(STATUS "Driver version: ${DRIVER
ExternalProject_Add(
driver
- URL "https://github.com/falcosecurity/libs/archive/${DRIVER_VERSION}.tar.gz"
- URL_HASH "${DRIVER_CHECKSUM}"
+ URL "${CMAKE_CURRENT_SOURCE_DIR}/../../../../libs-${DRIVER_VERSION}"
+ URL "${CMAKE_CURRENT_SOURCE_DIR}/../../../.xbps-falco"
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
diff --git a/cmake/modules/falcosecurity-libs-repo/CMakeLists.txt b/cmake/modules/falcosecurity-libs-repo/CMakeLists.txt
index 2059547..74e78e2 100644
TEST_COMMAND ""
PATCH_COMMAND sh -c "mv ./driver ../driver.tmp && rm -rf ./* && mv ../driver.tmp/* ."
-)
\ No newline at end of file
+)
--- a/cmake/modules/falcosecurity-libs-repo/CMakeLists.txt
+++ b/cmake/modules/falcosecurity-libs-repo/CMakeLists.txt
@@ -25,8 +25,7 @@ message(STATUS "Libs version: ${FALCOSECURITY_LIBS_VERSION}")
@@ -25,9 +25,8 @@ message(STATUS "Libs version: ${FALCOSEC
ExternalProject_Add(
falcosecurity-libs
- URL "https://github.com/falcosecurity/libs/archive/${FALCOSECURITY_LIBS_VERSION}.tar.gz"
- URL_HASH "${FALCOSECURITY_LIBS_CHECKSUM}"
+ URL "${CMAKE_CURRENT_SOURCE_DIR}/../../../../libs-${FALCOSECURITY_LIBS_VERSION}"
+ URL "${CMAKE_CURRENT_SOURCE_DIR}/../../../.xbps-falco"
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
- TEST_COMMAND "")
\ No newline at end of file
+ TEST_COMMAND "")

View File

@ -0,0 +1,29 @@
--- a/.xbps-falco/userspace/libsinsp/CMakeLists.txt
+++ b/.xbps-falco/userspace/libsinsp/CMakeLists.txt
@@ -38,6 +38,7 @@ include(ExternalProject)
if(NOT WIN32 AND NOT APPLE)
include(b64)
+ find_library(ZSTD_LIB NAMES zstd)
endif()
include(jsoncpp)
@@ -251,7 +252,8 @@ if(NOT WIN32)
"${PROTOBUF_LIB}"
"${CARES_LIB}"
"${JQ_LIB}"
- "${B64_LIB}")
+ "${B64_LIB}"
+ "${ZSTD_LIB}")
if(NOT MUSL_OPTIMIZED_BUILD)
list(APPEND SINSP_LIBRARIES
@@ -301,7 +303,7 @@ else()
endif()
endif() # NOT WIN32
-
+LIST(APPEND SINSP_LIBRARIES absl_log_internal_message absl_log_internal_nullguard)
target_link_libraries(sinsp ${SINSP_LIBRARIES})
if(APPLE)

View File

@ -1,6 +1,6 @@
--- sysdig-0.28.0/CMakeLists.txt.orig
+++ sysdig-0.28.0/CMakeLists.txt
@@ -73,10 +73,6 @@
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -75,10 +75,6 @@ if(MINIMAL_BUILD)
set(MINIMAL_BUILD_FLAGS "-DMINIMAL_BUILD")
endif()

View File

@ -0,0 +1,15 @@
--- a/userspace/sysdig/CMakeLists.txt
+++ b/userspace/sysdig/CMakeLists.txt
@@ -65,10 +65,9 @@ list(APPEND SOURCE_FILES_CSYSDIG
add_executable(sysdig ${SOURCE_FILES})
add_executable(csysdig ${SOURCE_FILES_CSYSDIG})
-add_dependencies(sysdig njson)
-add_dependencies(csysdig njson)
-
if(USE_BUNDLED_DEPS)
+ add_dependencies(sysdig njson)
+ add_dependencies(csysdig njson)
add_dependencies(sysdig yaml-cpp)
add_dependencies(csysdig yaml-cpp)
endif()

View File

@ -1,21 +1,22 @@
# Template file for 'sysdig'
pkgname=sysdig
version=0.31.5
version=0.33.1
revision=1
_falcover=0.11.0
_falcover=59fb313475b82f842e9e9bbc1e0e629428c0a4cf
build_style=cmake
build_wrksrc="sysdig-${version}"
configure_args="-DSYSDIG_VERSION=${version} -DUSE_BUNDLED_DEPS=OFF
-DUSE_BUNDLED_B64=ON -DUSE_BUNDLED_JQ=ON -DBUILD_DRIVER=OFF
-DUSE_BUNDLED_B64=OFF -DBUILD_DRIVER=OFF
-DLUA_INCLUDE_DIR=${XBPS_CROSS_BASE}/usr/include/luajit-2.1
-DLUA_LIBRARY=/usr/lib/libluajit-5.1.so -DCREATE_TEST_TARGETS=OFF
-DUSE_BUNDLED_JSONCPP=OFF -DUSE_BUNDLED_RE2=OFF -DUSE_BUNDLED_VALIJSON=OFF
-DUSE_BUNDLED_TBB=OFF -DBUILD_LIBSCAP_EXAMPLES=OFF
-DCMAKE_CXX_STANDARD=17 -DCMAKE_CXX_EXTENSIONS=OFF
-DDRIVER_VERSION=${_falcover}"
hostmakedepends="wget pkg-config protobuf"
makedepends="LuaJIT-devel c-ares-devel elfutils-devel grpc-devel
makedepends="LuaJIT-devel c-ares-devel elfutils-devel grpc-devel jsoncpp-devel
libcurl-devel libprotoc-devel openssl-devel ncurses-devel protobuf-devel
tbb-devel zlib-devel yaml-cpp-devel json-c++"
libb64-devel tbb-devel zlib-devel yaml-cpp-devel json-c++ jq-devel
re2-devel valijson"
depends="dkms"
short_desc="Open source system-level exploration and troubleshooting tool"
maintainer="Orphaned <orphan@voidlinux.org>"
@ -24,11 +25,12 @@ homepage="http://www.sysdig.org/"
changelog="https://github.com/draios/sysdig/releases"
distfiles="https://github.com/draios/sysdig/archive/${version}.tar.gz
https://github.com/falcosecurity/libs/archive/${_falcover}.tar.gz"
checksum="9af98cae7c38273f7429ba0df628c9745bd92c949f444e180b9dd800af14c6dd
90414d00591986e94f2c49e7d65eef5c2dedee266354dd3db8234bb3b06c86fa"
checksum="c7d833fbc98f7d7216a302f93acf18347fef304fc942c67513dd4df1a1423cad
cc191f4ae987a894a4fa8954e8fbcce9b8b6f85cb34b0f2fed7578e8edcde189"
dkms_modules="scap ${_falcover}"
nocross=yes
patch_args="-Np1 --directory=${build_wrksrc}"
skip_extraction="${_falcover}.tar.gz"
case "$XBPS_TARGET_MACHINE" in
i686*) broken="/syscall_table.c:567:10: error: '__NR_rt_tgsigqueueinfo'";;
@ -38,10 +40,8 @@ esac
# Avoid excessive warnings spam to the log
CXXFLAGS="-Wno-deprecated-declarations"
post_patch() {
patch -d "${wrksrc}/libs-${_falcover}" -Np1 < "${FILESDIR}/libsinsp-zstd.patch"
patch -d "${wrksrc}/libs-${_falcover}" -Np1 < "${FILESDIR}/libsinsp-absl-protobuf.patch"
post_extract() {
vsrcextract -C .xbps-falco "${_falcover}.tar.gz"
vsed -e 's,"${DIR_ETC}/bash_completion.d",share/bash-completion/completions,g' -i scripts/CMakeLists.txt
}