[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 3/3] Add support for RAPL MSRs in KVM/Qemu
|
From: |
Paolo Bonzini |
|
Subject: |
Re: [PATCH v2 3/3] Add support for RAPL MSRs in KVM/Qemu |
|
Date: |
Wed, 1 Nov 2023 15:33:11 +0100 |
|
User-agent: |
Mozilla Thunderbird |
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);
+