diff --git a/eBPF_Supermarket/kvm_watcher/include/kvm_vcpu.h b/eBPF_Supermarket/kvm_watcher/include/kvm_vcpu.h index 2a161238b..8a7167f7c 100644 --- a/eBPF_Supermarket/kvm_watcher/include/kvm_vcpu.h +++ b/eBPF_Supermarket/kvm_watcher/include/kvm_vcpu.h @@ -78,6 +78,7 @@ static int trace_kvm_halt_poll_ns(struct halt_poll_ns *ctx, void *rb, e->grow = ctx->grow; e->old = ctx->old; e->new = ctx->new; + e->vcpu_id = ctx->vcpu_id; bpf_get_current_comm(&e->process.comm, sizeof(e->process.comm)); bpf_ringbuf_submit(e, 0); } diff --git a/eBPF_Supermarket/kvm_watcher/include/kvm_watcher.h b/eBPF_Supermarket/kvm_watcher/include/kvm_watcher.h index 0fdbee2f9..2fc23538b 100644 --- a/eBPF_Supermarket/kvm_watcher/include/kvm_watcher.h +++ b/eBPF_Supermarket/kvm_watcher/include/kvm_watcher.h @@ -96,6 +96,7 @@ struct halt_poll_ns_event { unsigned int new; unsigned int old; unsigned long long time; + unsigned vcpu_id; }; struct mark_page_dirty_in_slot_event { diff --git a/eBPF_Supermarket/kvm_watcher/src/kvm_watcher.c b/eBPF_Supermarket/kvm_watcher/src/kvm_watcher.c index 2b6b975f1..c96a51c53 100644 --- a/eBPF_Supermarket/kvm_watcher/src/kvm_watcher.c +++ b/eBPF_Supermarket/kvm_watcher/src/kvm_watcher.c @@ -424,9 +424,9 @@ static int handle_event(void *ctx, void *data, size_t data_sz) { } } else if (env.execute_halt_poll_ns) { const struct halt_poll_ns_event *e = data; - printf("%-18llu %-15s %-6d/%-8d %-10s %-7d --> %d \n", e->time, + printf("%-18llu %-15s %-6d/%-8d %-10s %-7d %-7d --> %d \n", e->time, e->process.comm, e->process.pid, e->process.tid, - e->grow ? "grow" : "shrink", e->old, e->new); + e->grow ? "grow" : "shrink", e->vcpu_id, e->old, e->new); } else if (env.execute_mark_page_dirty) { const struct mark_page_dirty_in_slot_event *e = data; printf("%-18llu %-15s %-6d/%-8d %-10llx %-10llx %-10lu %-15lx %d \n", @@ -535,8 +535,8 @@ int main(int argc, char **argv) { printf("%-18s %-21s %-18s %-15s %-8s %-13s \n", "TIME", "EXIT_REASON", "COMM", "PID/TID", "COUNT", "DURATION(ns)"); } else if (env.execute_halt_poll_ns) { - printf("%-18s %-15s %-15s %-10s %-11s %-10s\n", "TIME(ns)", - "COMM", "PID/TID", "TYPE", "OLD(ns)", "NEW(ns)"); + printf("%-18s %-15s %-15s %-10s %-7s %-11s %-10s\n", "TIME(ns)", + "COMM", "PID/TID", "TYPE", "VCPU_ID", "OLD(ns)", "NEW(ns)"); } else if (env.execute_mark_page_dirty) { printf("%-18s %-15s %-15s %-10s %-11s %-10s %-10s %-10s\n", "TIME(ns)", "COMM", "PID/TID", "GFN", "REL_GFN", "NPAGES",