On 10/31/23 15:46, Anthony Harivel wrote:
+    /* Get QEMU PID*/
+    pid = getpid();

This should be gettid(), or perhaps a VCPU thread's TID.


+    /* Those MSR values should not change as well */
+    vmsr->msr_unit  = vmsr_read_msr(MSR_RAPL_POWER_UNIT, 0, pid,
+                                    s->msr_energy.socket_path);

The "0" should be sched_getcpu().

I'll review later the way that the measuring thread is created and operates, as it's a holiday today here. :)

Paolo

+    vmsr->msr_limit = vmsr_read_msr(MSR_PKG_POWER_LIMIT, 0, pid,
+                                    s->msr_energy.socket_path);
+    vmsr->msr_info  = vmsr_read_msr(MSR_PKG_POWER_INFO, 0, pid,
+                                    s->msr_energy.socket_path);
+



Reply via email to