Skip to content
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

udpate(cmake): bump libs to 68a96aa5b7e34d7893563ded8c3d95bb3e77785f #2045

Merged
merged 4 commits into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cmake/modules/driver.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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 "ace53901af1aae25365b1302c0fa7c7ed69821ea")
set(DRIVER_CHECKSUM "SHA256=80e04cc3400b3b8e22bddad6b663adff311ab51a19b04baee1e49b06d3860c00")
set(DRIVER_VERSION "1aad98290120164eee9efc5d051417e0ca85c522")
set(DRIVER_CHECKSUM "SHA256=aeab79c1cafa8b928720073847b3d7cea2a46c8229259b0ee69639f327d9cfd6")
endif()

# cd /path/to/build && cmake /path/to/source
Expand Down
4 changes: 2 additions & 2 deletions cmake/modules/falcosecurity-libs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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 "ace53901af1aae25365b1302c0fa7c7ed69821ea")
set(FALCOSECURITY_LIBS_CHECKSUM "SHA256=80e04cc3400b3b8e22bddad6b663adff311ab51a19b04baee1e49b06d3860c00")
set(FALCOSECURITY_LIBS_VERSION "1aad98290120164eee9efc5d051417e0ca85c522")
set(FALCOSECURITY_LIBS_CHECKSUM "SHA256=aeab79c1cafa8b928720073847b3d7cea2a46c8229259b0ee69639f327d9cfd6")
endif()

# cd /path/to/build && cmake /path/to/source
Expand Down
4 changes: 2 additions & 2 deletions userspace/sinspui/cursescomponents.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ const char* spy_text_renderer::process_event_spy(sinsp_evt* evt, int64_t* len)
//
// Get and validate the length
//
sinsp_evt_param* parinfo = evt->get_param(0);
const sinsp_evt_param* parinfo = evt->get_param(0);
ASSERT(parinfo->m_len == sizeof(int64_t));
*len = *(int64_t*)parinfo->m_val;
if(*len <= 0)
Expand Down Expand Up @@ -385,7 +385,7 @@ void curses_table_sidemenu::render()
//
// Render the rows
//
for(j = m_firstrow; j < MIN(m_firstrow + (int32_t)m_h - 1, (int32_t)m_entries.size()); j++)
for(j = m_firstrow; j < std::min(m_firstrow + (int32_t)m_h - 1, (int32_t)m_entries.size()); j++)
{
if(j == m_selct)
{
Expand Down
2 changes: 1 addition & 1 deletion userspace/sinspui/cursestable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ void curses_table::render(bool data_changed)
//
vector<chisel_table_field>* row;

for(l = 0; l < (int32_t)MIN(m_data->size(), m_h - 1); l++)
for(l = 0; l < std::min((int32_t)m_data->size(),(int32_t)(m_h - 1)); l++)
{
if(l + m_firstrow >= (int32_t)m_data->size())
{
Expand Down
5 changes: 3 additions & 2 deletions userspace/sinspui/cursesui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ limitations under the License.
*/

#include <iostream>
#include <algorithm>
#include "sinsp.h"
#include "sinsp_int.h"
#include "filter.h"
Expand Down Expand Up @@ -944,8 +945,8 @@ void sinsp_cursesui::draw_bottom_menu(vector<sinsp_menuitem_info>* items, bool i

attrset(m_colors[PROCESS]);
string fks = items->at(j).m_key;
mvaddnstr(m_screenh - 1, k, fks.c_str(), MAX(fks.size(), 2));
k += MAX(fks.size(), 2);
mvaddnstr(m_screenh - 1, k, fks.c_str(), std::max((uint32_t)fks.size(), (uint32_t)2));
k += std::max((uint32_t)fks.size(), (uint32_t)2);

attrset(m_colors[PANEL_HIGHLIGHT_FOCUS]);
fks = items->at(j).m_desc;
Expand Down
4 changes: 2 additions & 2 deletions userspace/sysdig/sysdig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -866,13 +866,13 @@ captureinfo do_inspect(sinsp* inspector,

if(etype == PPME_GENERIC_E)
{
sinsp_evt_param *parinfo = ev->get_param(0);
const sinsp_evt_param *parinfo = ev->get_param(0);
uint16_t id = *(int16_t *)parinfo->m_val;
summary_table[PPM_EVENT_MAX + id * 2].m_ncalls++;
}
else if(etype == PPME_GENERIC_X)
{
sinsp_evt_param *parinfo = ev->get_param(0);
const sinsp_evt_param *parinfo = ev->get_param(0);
uint16_t id = *(int16_t *)parinfo->m_val;
summary_table[PPM_EVENT_MAX + id * 2 + 1].m_ncalls++;
}
Expand Down
68 changes: 34 additions & 34 deletions userspace/sysdig/utils/plugin_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ limitations under the License.
#include <unordered_set>

#include <utility>
#include <tinydir.h>
#include <filesystem>
#include <yaml-cpp/yaml.h>
#include <nlohmann/json.hpp>

Expand Down Expand Up @@ -96,38 +96,31 @@ namespace YAML {

static bool iterate_plugins_dirs(
const std::vector<std::string>& dirs,
const std::function<bool(const tinydir_file &)>& predicate)
const std::function<bool(const std::filesystem::path &)>& predicate)
{
bool breakout = false;
for (const auto & plugin_dir : dirs)
{
if (plugin_dir.empty())
std::filesystem::path dir = plugin_dir;

if (!std::filesystem::exists(dir) || !std::filesystem::is_directory(dir))
{
continue;
}

tinydir_dir dir = {};

for (tinydir_open(&dir, plugin_dir.c_str()); dir.has_next && !breakout; tinydir_next(&dir))
{
tinydir_file file;
tinydir_readfile(&dir, &file);

auto namelen = strlen(file.name);
auto extlen = strlen(SHAREDOBJ_EXT);
if (file.is_dir
|| strcmp(file.name, ".") == 0
|| strcmp(file.name, "..") == 0
|| (namelen > extlen
&& strcmp(file.name + namelen -extlen, SHAREDOBJ_EXT) != 0))
{
continue;
}

breakout = predicate(file);
}
for (const auto &file : std::filesystem::directory_iterator(dir))
{
if (!std::filesystem::is_directory(file)
&& file.path().extension() == SHAREDOBJ_EXT)
{
breakout = predicate(file);
}
else
{
continue;
}
}

tinydir_close(&dir);
if (breakout)
{
break;
Expand Down Expand Up @@ -308,16 +301,20 @@ void plugin_utils::load_plugin(sinsp *inspector, const std::string& name)
soname = SHAREDOBJ_PREFIX + name + SHAREDOBJ_EXT;
}
auto& plugins = m_plugins;
bool found = iterate_plugins_dirs(m_dirs, [&inspector, &name, &soname, &plugins] (const tinydir_file file) -> bool {
if (file.name == name || file.name == soname)
bool found = iterate_plugins_dirs(m_dirs, [&inspector, &name, &soname, &plugins] (const std::filesystem::path file) -> bool {

auto filename = file.filename().generic_string();
auto filepath = std::filesystem::absolute(file).generic_string();

if (filename == name || filename == soname)
{
plugin_entry p;
p.used = true;
p.inited = false;
p.libpath = file.path;
p.libpath = filepath;
p.names.insert(soname);
p.names.insert(file.path);
p.names.insert(file.name);
p.names.insert(filepath);
p.names.insert(filename);
p.names.insert(p.get_plugin(inspector)->name());
plugins.push_back(p);
return true; // break-out
Expand All @@ -334,17 +331,20 @@ void plugin_utils::read_plugins_from_dirs(sinsp *inspector)
{
auto& plugins = m_plugins;
auto tmpinsp = std::unique_ptr<sinsp>(new sinsp());
iterate_plugins_dirs(m_dirs, [&inspector, &plugins, &tmpinsp] (const tinydir_file file) -> bool {
iterate_plugins_dirs(m_dirs, [&inspector, &plugins, &tmpinsp] (const std::filesystem::path file) -> bool {

auto filepath = std::filesystem::absolute(file).generic_string();

// we temporarily load the plugin just to read its info,
// but we don't actually load it in our inspector
auto plugin = tmpinsp->register_plugin(file.path);
auto plugin = tmpinsp->register_plugin(filepath);

plugin_entry p;
p.used = false;
p.inited = false;
p.libpath = file.path;
p.names.insert(file.path);
p.names.insert(file.name);
p.libpath = filepath;
p.names.insert(filepath);
p.names.insert(file.filename().generic_string());
p.names.insert(plugin->name());
plugins.push_back(p);
return false;
Expand Down