|
@@ -837,9 +837,6 @@ void ebpf_resume_apps_data()
|
|
*/
|
|
*/
|
|
void *ebpf_read_cachestat_thread(void *ptr)
|
|
void *ebpf_read_cachestat_thread(void *ptr)
|
|
{
|
|
{
|
|
- heartbeat_t hb;
|
|
|
|
- heartbeat_init(&hb);
|
|
|
|
-
|
|
|
|
ebpf_module_t *em = (ebpf_module_t *)ptr;
|
|
ebpf_module_t *em = (ebpf_module_t *)ptr;
|
|
|
|
|
|
int maps_per_core = em->maps_per_core;
|
|
int maps_per_core = em->maps_per_core;
|
|
@@ -849,10 +846,11 @@ void *ebpf_read_cachestat_thread(void *ptr)
|
|
|
|
|
|
uint32_t lifetime = em->lifetime;
|
|
uint32_t lifetime = em->lifetime;
|
|
uint32_t running_time = 0;
|
|
uint32_t running_time = 0;
|
|
- usec_t period = update_every * USEC_PER_SEC;
|
|
|
|
pids_fd[EBPF_PIDS_CACHESTAT_IDX] = cachestat_maps[NETDATA_CACHESTAT_PID_STATS].map_fd;
|
|
pids_fd[EBPF_PIDS_CACHESTAT_IDX] = cachestat_maps[NETDATA_CACHESTAT_PID_STATS].map_fd;
|
|
|
|
+ heartbeat_t hb;
|
|
|
|
+ heartbeat_init(&hb, update_every * USEC_PER_SEC);
|
|
while (!ebpf_plugin_stop() && running_time < lifetime) {
|
|
while (!ebpf_plugin_stop() && running_time < lifetime) {
|
|
- (void)heartbeat_next(&hb, period);
|
|
|
|
|
|
+ (void)heartbeat_next(&hb);
|
|
if (ebpf_plugin_stop() || ++counter != update_every)
|
|
if (ebpf_plugin_stop() || ++counter != update_every)
|
|
continue;
|
|
continue;
|
|
|
|
|
|
@@ -1401,7 +1399,7 @@ static void cachestat_collector(ebpf_module_t *em)
|
|
int update_every = em->update_every;
|
|
int update_every = em->update_every;
|
|
int maps_per_core = em->maps_per_core;
|
|
int maps_per_core = em->maps_per_core;
|
|
heartbeat_t hb;
|
|
heartbeat_t hb;
|
|
- heartbeat_init(&hb);
|
|
|
|
|
|
+ heartbeat_init(&hb, USEC_PER_SEC);
|
|
int counter = update_every - 1;
|
|
int counter = update_every - 1;
|
|
//This will be cancelled by its parent
|
|
//This will be cancelled by its parent
|
|
uint32_t running_time = 0;
|
|
uint32_t running_time = 0;
|
|
@@ -1409,7 +1407,7 @@ static void cachestat_collector(ebpf_module_t *em)
|
|
netdata_idx_t *stats = em->hash_table_stats;
|
|
netdata_idx_t *stats = em->hash_table_stats;
|
|
memset(stats, 0, sizeof(em->hash_table_stats));
|
|
memset(stats, 0, sizeof(em->hash_table_stats));
|
|
while (!ebpf_plugin_stop() && running_time < lifetime) {
|
|
while (!ebpf_plugin_stop() && running_time < lifetime) {
|
|
- (void)heartbeat_next(&hb, USEC_PER_SEC);
|
|
|
|
|
|
+ (void)heartbeat_next(&hb);
|
|
|
|
|
|
if (ebpf_plugin_stop() || ++counter != update_every)
|
|
if (ebpf_plugin_stop() || ++counter != update_every)
|
|
continue;
|
|
continue;
|