qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Anthony Harivel <aharivel@redhat.com>, qemu-devel@nongnu.org
Cc: mtosatti@redhat.com, berrange@redhat.com
Subject: Re: [PATCH v2 3/3] Add support for RAPL MSRs in KVM/Qemu
Date: Wed, 1 Nov 2023 15:33:11 +0100	[thread overview]
Message-ID: <fe67a968-7f72-438f-8b6f-244707f943b9@redhat.com> (raw)
In-Reply-To: <20231031144605.64822-4-aharivel@redhat.com>

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);
> +




      parent reply	other threads:[~2023-11-01 14:34 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-31 14:46 [PATCH v2 0/3] Add support for RAPL MSRs series Anthony Harivel
2023-10-31 14:46 ` [PATCH v2 1/3] qio: add support for SO_PEERCRED for socket channel Anthony Harivel
2023-11-01 10:20   ` Daniel P. Berrangé
2023-11-01 14:23     ` Paolo Bonzini
2023-10-31 14:46 ` [PATCH v2 2/3] tools: build qemu-vmsr-helper Anthony Harivel
2023-11-01 10:36   ` Daniel P. Berrangé
2023-11-01 10:52   ` Daniel P. Berrangé
2023-11-01 14:32   ` Paolo Bonzini
2023-10-31 14:46 ` [PATCH v2 3/3] Add support for RAPL MSRs in KVM/Qemu Anthony Harivel
2023-11-01 11:24   ` Daniel P. Berrangé
2023-11-01 14:33   ` Paolo Bonzini [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fe67a968-7f72-438f-8b6f-244707f943b9@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=aharivel@redhat.com \
    --cc=berrange@redhat.com \
    --cc=mtosatti@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).