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

Don't drop events while requesting CPU usage from driver #18

Merged
merged 6 commits into from
Mar 24, 2021
Merged
Changes from 1 commit
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
6 changes: 1 addition & 5 deletions userspace/libsinsp/sinsp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1064,8 +1064,6 @@ uint64_t sinsp::max_buf_used()

void sinsp::get_procs_cpu_from_driver(uint64_t ts)
{
struct timeval tod;

if(ts <= m_next_flush_time_ns)
{
return;
Expand All @@ -1081,9 +1079,7 @@ void sinsp::get_procs_cpu_from_driver(uint64_t ts)

m_next_flush_time_ns = next_full_second;

gettimeofday(&tod, NULL);
uint64_t procrequest_tod = (uint64_t)tod.tv_sec * 1000000000 + tod.tv_usec * 1000;

uint64_t procrequest_tod = sinsp_utils::get_current_time_ns();
leodido marked this conversation as resolved.
Show resolved Hide resolved
if(procrequest_tod - m_last_procrequest_tod <= ONE_SECOND_IN_NS / 2)
{
return;
Expand Down