Skip to content

Commit

Permalink
add uthread/ms
Browse files Browse the repository at this point in the history
  • Loading branch information
vvzxy committed Dec 7, 2023
1 parent 4eb8523 commit 73ce5aa
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions eBPF_Supermarket/CPU_Subsystem/cpu_watcher/cpu_watcher.bpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,15 +170,12 @@ int BPF_KRETPROBE(schedule_exit)
}else{
return 0;
}

struct event *e;
e = bpf_ringbuf_reserve(&rb, sizeof(*e), 0);
if (!e) return 0;

e->t1=t1;//开始时间
e->t2=t2;//结束时间
e->delay=delay;//时间间隔

/* 成功地将其提交到用户空间进行后期处理 */
bpf_ringbuf_submit(e, 0);

Expand All @@ -189,8 +186,7 @@ int BPF_KRETPROBE(schedule_exit)
/* sar跟踪函数 */
/*----------------------------------------------*/
// 统计fork数
//SEC("kprobe/finish_task_switch.isra.0")
SEC("kprobe/finish_task_switch")
SEC("kprobe/finish_task_switch.isra.0")
int kprobe__finish_task_switch(struct pt_regs *ctx)
{
u32 key = 0;
Expand Down

0 comments on commit 73ce5aa

Please sign in to comment.