Skip to content

Commit

Permalink
Merge pull request #949 from albertxu216/develop
Browse files Browse the repository at this point in the history
修改emwa策略,仅输出延迟过大的点,并更改可视化面板
  • Loading branch information
chenamy2017 authored Dec 11, 2024
2 parents b5fc205 + e25f9d2 commit f539818
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,17 @@ bool dynamic_filter(struct ewma_info *ewma_syscall_delay, double dataPoint) {

if(ewma_syscall_delay->previousEWMA == 0) {//初始化ewma算法,则赋值previousEWMA = dataPoint 并打印
ewma_syscall_delay->previousEWMA = dataPoint;
return 1;
return 0;
}
if(ewma_syscall_delay->count <30){
if(ewma_syscall_delay->count <10){
ewma_syscall_delay->previousEWMA = calculateEWMA(ewma_syscall_delay->previousEWMA,dataPoint,alpha);//计算
return 1;
ewma_syscall_delay->count++;
return 0;
}
else{
ewma_syscall_delay->previousEWMA = calculateEWMA(ewma_syscall_delay->previousEWMA,dataPoint,alpha);//计算
threshold = ewma_syscall_delay->previousEWMA * TOLERANCE;
if(dataPoint >= threshold) return 1;
if(dataPoint > threshold*5) return 1;
}
return 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -911,7 +911,7 @@ int main(int argc, char **argv)
fprintf(stderr, "Failed to attach BPF skeleton\n");
goto sc_delay_cleanup;
}
printf("%-8s %-8s %-15s %-15s\n","Time","Pid","syscall_id","delay/ms");
printf("%-8s %-8s %-15s %-15s\n","Time","Pid","syscall_id","delay/us");
rb = ring_buffer__new(bpf_map__fd(sc_skel->maps.rb), syscall_delay_print, NULL, NULL); //ring_buffer__new() API,允许在不使用额外选项数据结构下指定回调
if (!rb) {
err = -1;
Expand Down

0 comments on commit f539818

Please sign in to comment.