Skip to content

Commit

Permalink
update(userspace/libsinsp): apply reviews suggestions
Browse files Browse the repository at this point in the history
Co-authored-by: Federico Di Pierro <[email protected]>
Co-authored-by: Mauro Ezequiel Moltrasio <[email protected]>
Signed-off-by: Jason Dellaluce <[email protected]>
  • Loading branch information
3 people committed Feb 21, 2024
1 parent 87b3e67 commit f7632c8
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
8 changes: 8 additions & 0 deletions userspace/libsinsp/container.h
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,14 @@ class sinsp_container_manager :
return engine_lookup == container_lookups->second.end();
}

/**
* \brief get the list of container engines in the inspector
*
* @return a pointer to the list of container engines
*/
std::list<std::shared_ptr<libsinsp::container_engine::container_engine_base>>* get_container_engines() {
return &m_container_engines;
}
uint64_t m_last_flush_time_ns;
std::string container_to_json(const sinsp_container_info& container_info);

Expand Down
6 changes: 3 additions & 3 deletions userspace/libsinsp/eventformatter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ void sinsp_evt_formatter::set_format(output_format of, const std::string& fmt)
auto newtkn = std::make_unique<rawstring_check>(lfmt.substr(last_nontoken_str_start, j - last_nontoken_str_start));
m_tokens.emplace_back(std::make_pair("", newtkn.get()));
m_tokenlens.push_back(0);
m_chks_to_free.push_back(std::move(newtkn));
m_checks.push_back(std::move(newtkn));
}

if(j == lfmtlen - 1)
Expand Down Expand Up @@ -156,7 +156,7 @@ void sinsp_evt_formatter::set_format(output_format of, const std::string& fmt)
m_tokens.emplace_back(std::make_pair(std::string(fstart, fsize), chk.get()));
m_tokenlens.push_back(toklen);

m_chks_to_free.push_back(std::move(chk));
m_checks.push_back(std::move(chk));

last_nontoken_str_start = j + 1;
}
Expand All @@ -166,7 +166,7 @@ void sinsp_evt_formatter::set_format(output_format of, const std::string& fmt)
{
auto chk = std::make_unique<rawstring_check>(lfmt.substr(last_nontoken_str_start, j - last_nontoken_str_start));
m_tokens.emplace_back(std::make_pair("", chk.get()));
m_chks_to_free.emplace_back(std::move(chk));
m_checks.emplace_back(std::move(chk));
m_tokenlens.push_back(0);
}
}
Expand Down
2 changes: 1 addition & 1 deletion userspace/libsinsp/eventformatter.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class SINSP_PUBLIC sinsp_evt_formatter
sinsp* m_inspector;
filter_check_list &m_available_checks;
bool m_require_all_values;
std::vector<std::unique_ptr<sinsp_filter_check>> m_chks_to_free;
std::vector<std::unique_ptr<sinsp_filter_check>> m_checks;

Json::Value m_root;
Json::FastWriter m_writer;
Expand Down
2 changes: 1 addition & 1 deletion userspace/libsinsp/sinsp.h
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,7 @@ class SINSP_PUBLIC sinsp : public capture_stats_source
m_get_procs_cpu_from_driver = get_procs_cpu_from_driver;
}

sinsp_parser* get_parser()
inline sinsp_parser* get_parser()
{
return m_parser.get();
}
Expand Down

0 comments on commit f7632c8

Please sign in to comment.