chore(userspace/falco): make source matching error more expressive

Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
This commit is contained in:
Jason Dellaluce 2023-06-07 13:23:57 +00:00 committed by poiana
parent 2b9082209b
commit 7c387069af

View File

@ -265,10 +265,13 @@ static falco::app::run_result do_inspect(
if (source_engine_idx == sinsp_no_event_source_idx)
{
std::string msg = "Unknown event source for inspector's event";
if (ev->get_type() == PPME_PLUGINEVENT_E)
if (ev->get_type() == PPME_PLUGINEVENT_E || ev->get_type() == PPME_ASYNCEVENT_E)
{
auto pluginID = *(int32_t *)ev->get_param(0)->m_val;
msg += " (plugin ID: " + std::to_string(pluginID) + ")";
auto pluginID = *(uint32_t *)ev->get_param(0)->m_val;
if (pluginID != 0)
{
msg += " (plugin ID: " + std::to_string(pluginID) + ")";
}
}
return run_result::fatal(msg);
}