Преглед изворни кода

Feature #TASK_QT-21111 【私有发版】更新最新的文件。

rock.wu пре 10 месеци
родитељ
комит
4523d92d2d
1 измењених фајлова са 3 додато и 1 уклоњено
  1. 3 1
      ebpftracer/ebpf/sys_cpu/offcpu.c

+ 3 - 1
ebpftracer/ebpf/sys_cpu/offcpu.c

@@ -98,9 +98,10 @@ int handle_sched_switch(struct trace_event_raw_sched_switch *ctx)
     if (!tidCpuTime) {
         return 0;
     }
-    cw_bpf_debug("sched_switch function find the trace_tid_cpu_time\n");
+    cw_bpf_debug("sched_switch next_pid is %d, prev_pid is %d, tid is %d\n",ctx->next_pid, ctx->prev_pid, tid);
     if(ctx->next_pid == tid){
         //切入 CPU
+        cw_bpf_debug("enter the cpu in \n");
         __u64 currentTime = bpf_ktime_get_ns();
         //runqtime
         duration = currentTime - tidCpuTime->runq_start;
@@ -133,6 +134,7 @@ int handle_sched_switch(struct trace_event_raw_sched_switch *ctx)
 
     }else if(ctx->prev_pid == tid){
         //切出 CPU
+        cw_bpf_debug("enter the cpu out \n");
         //记录CPU切出时间,方便后续记录总时间。
         tidCpuTime->cpu_out_start = bpf_ktime_get_ns();
         if(tidCpuTime->cpu_in_start > 0){