Skip to content

Commit

Permalink
[eBPF] Adjust refresh perf buffer frequency
Browse files Browse the repository at this point in the history
  • Loading branch information
yinjiping committed Oct 12, 2023
1 parent 8b5fc90 commit bf988e9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions agent/src/ebpf/user/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,34 +175,34 @@ enum {
*/

/*
* timer ticks: ticks every 1 millisecond.
* tick every 10 millisecond
*
* unit: microseconds
*/
#define EVENT_PERIOD_TIME_US 1000
#define EVENT_TIMER_TICK_US 10000

/*
* The kernel uses bundled burst to send data to the user.
* The implementation method is that all CPUs trigger timeout checks and send
* the data resident in the eBPF buffer. This value is the periodic time, unit
* is microseconds.
* is milliseconds.
*/
#define KICK_KERN_PERIOD 10 // 10 milliseconds
#define KICK_KERN_PERIOD 10 // 10 ticks(100 milliseconds)

/*
* System boot time update cycle time, unit is milliseconds.
*/
#define SYS_TIME_UPDATE_PERIOD 1000 // 1 seconds
#define SYS_TIME_UPDATE_PERIOD 1000 // 1000 ticks(10 seconds)

/*
* Check whether the eBPF Map exceeds the maximum value and use it to release
* stale data (unit is milliseconds).
*/
#define CHECK_MAP_EXCEEDED_PERIOD 1000 // 1 seconds
#define CHECK_MAP_EXCEEDED_PERIOD 100 // 100 ticks(1 seconds)

/*
* Used to check whether the kernel adaptation is successful, here is the
* check cycle time (unit is milliseconds).
*/
#define CHECK_KERN_ADAPT_PERIOD 1000 // 1 seconds
#define CHECK_KERN_ADAPT_PERIOD 100 // 100 ticks(1 seconds)
#endif /* DF_EBPF_CONFIG_H */
2 changes: 1 addition & 1 deletion agent/src/ebpf/user/tracer.c
Original file line number Diff line number Diff line change
Expand Up @@ -1344,7 +1344,7 @@ static void period_process_main(__unused void *arg)

for (;;) {
period_events_process();
usleep(EVENT_PERIOD_TIME_US);
usleep(EVENT_TIMER_TICK_US);
}
}

Expand Down

0 comments on commit bf988e9

Please sign in to comment.