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

cleanup: remove usage of g_filterlist #2036

Merged
merged 1 commit into from
Oct 13, 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
23 changes: 17 additions & 6 deletions userspace/sinspui/cursescomponents.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ using namespace std;

extern bool g_filterchecks_force_raw_times;

// todo(jasondellaluce): this list is static and prevents from using
// plugin-defined extraction fields. The right way would be to have a filtercheck
// list owned by each component and populate depending on the loaded plugins.
// this is not something that we plan on supporting for now.
static sinsp_filter_check_list s_filterlist;

///////////////////////////////////////////////////////////////////////////////
// spy_text_renderer implementation
///////////////////////////////////////////////////////////////////////////////
Expand All @@ -73,37 +79,42 @@ spy_text_renderer::spy_text_renderer(sinsp* inspector,
if(print_containers)
{
m_formatter = new sinsp_evt_formatter(m_inspector,
"*(latency=%evt.latency.human) (fd=%fd.name) %evt.num %evt.time %evt.cpu %container.name (%container.id) %proc.name (%thread.tid:%thread.vtid) %evt.dir %evt.type %evt.info");
"*(latency=%evt.latency.human) (fd=%fd.name) %evt.num %evt.time %evt.cpu %container.name (%container.id) %proc.name (%thread.tid:%thread.vtid) %evt.dir %evt.type %evt.info",
s_filterlist);
}
else
{
m_formatter = new sinsp_evt_formatter(m_inspector,
"*(latency=%evt.latency.human) (fd=%fd.name) %evt.num %evt.time %evt.cpu %proc.name %thread.tid %evt.dir %evt.type %evt.info");
"*(latency=%evt.latency.human) (fd=%fd.name) %evt.num %evt.time %evt.cpu %proc.name %thread.tid %evt.dir %evt.type %evt.info",
s_filterlist);
}
}
else if(sotype == spy_text_renderer::OT_LATENCY_APP)
{
if(print_containers)
{
m_formatter = new sinsp_evt_formatter(m_inspector,
"*(latency=%tracer.latency.human) %evt.num %evt.time %evt.cpu %container.name (%container.id) %proc.name (%thread.tid:%thread.vtid) %evt.dir %evt.type %evt.info");
"*(latency=%tracer.latency.human) %evt.num %evt.time %evt.cpu %container.name (%container.id) %proc.name (%thread.tid:%thread.vtid) %evt.dir %evt.type %evt.info",
s_filterlist);
}
else
{
m_formatter = new sinsp_evt_formatter(m_inspector,
"*(latency=%tracer.latency.human) %evt.num %evt.time %evt.cpu %proc.name %thread.tid %evt.dir %evt.type %evt.info");
"*(latency=%tracer.latency.human) %evt.num %evt.time %evt.cpu %proc.name %thread.tid %evt.dir %evt.type %evt.info",
s_filterlist);
}
}
else
{
if(print_containers)
{
m_formatter = new sinsp_evt_formatter(m_inspector,
"*%evt.num %evt.time %evt.cpu %container.name (%container.id) %proc.name (%thread.tid:%thread.vtid) %evt.dir %evt.type %evt.info");
"*%evt.num %evt.time %evt.cpu %container.name (%container.id) %proc.name (%thread.tid:%thread.vtid) %evt.dir %evt.type %evt.info",
s_filterlist);
}
else
{
m_formatter = new sinsp_evt_formatter(m_inspector, DEFAULT_OUTPUT_STR);
m_formatter = new sinsp_evt_formatter(m_inspector, DEFAULT_OUTPUT_STR, s_filterlist);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion userspace/sysdig/utils/supported_fields.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ void print_supported_fields(sinsp* inspector, plugin_utils& plugins, const std::
if (src == s_syscall_source)
{
std::vector<const filter_check_info*> all_checks;
sinsp::get_filtercheck_fields_info(all_checks);
sinsp_filter_check_list().get_all_fields(all_checks);
for (const auto& check : all_checks)
{
// todo: we need to polish this logic in libsinsp, it's not ok to
Expand Down