Skip to content

Commit

Permalink
fix(tests): account for recvmmsg/sendmmsg having 0 params on scap files
Browse files Browse the repository at this point in the history
Signed-off-by: Mauro Ezequiel Moltrasio <[email protected]>
  • Loading branch information
Molter73 committed Oct 1, 2024
1 parent 6dcca01 commit 0fa0fca
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions userspace/libsinsp/parsers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -669,8 +669,11 @@ bool sinsp_parser::reset(sinsp_evt *evt) {
//
int fd_location = get_fd_location(etype);
ASSERT(evt->get_param_info(fd_location)->type == PT_FD);
evt->get_tinfo()->m_lastevent_fd = evt->get_param(fd_location)->as<int64_t>();
evt->set_fd_info(evt->get_tinfo()->get_fd(evt->get_tinfo()->m_lastevent_fd));
if ((etype != PPME_SOCKET_SENDMMSG_E && etype != PPME_SOCKET_RECVMMSG_E) || evt->get_num_params() != 0)
{
evt->get_tinfo()->m_lastevent_fd = evt->get_param(fd_location)->as<int64_t>();
evt->set_fd_info(evt->get_tinfo()->get_fd(evt->get_tinfo()->m_lastevent_fd));
}
}

evt->get_tinfo()->m_latency = 0;
Expand Down Expand Up @@ -3734,6 +3737,12 @@ void sinsp_parser::parse_rw_exit(sinsp_evt *evt) {
int64_t tid = evt->get_tid();
sinsp_evt *enter_evt = &m_tmp_evt;
ppm_event_flags eflags = evt->get_info_flags();
uint16_t etype = evt->get_scap_evt()->type;

if ((etype == PPME_SOCKET_SENDMMSG_X || etype == PPME_SOCKET_RECVMMSG_X) && evt->get_num_params() == 0)
{
return;
}

//
// Extract the return value
Expand Down

0 comments on commit 0fa0fca

Please sign in to comment.