From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-devel@nongnu.org, "Luc Michel" <luc@lmichel.fr>,
"Damien Hedde" <damien.hedde@dahe.fr>,
"Inès Varhol" <ines.varhol@telecom-paris.fr>
Subject: Re: [PATCH] hw/clock: Expose 'freq-hz' QOM property
Date: Wed, 8 May 2024 23:27:37 +0200 [thread overview]
Message-ID: <ba6c3173-12c2-45d8-ade4-b21598800f5b@linaro.org> (raw)
In-Reply-To: <CAFEAcA84CfdNZSjZ1R96=5P-VhxGXyaaujF1Y8AxKa+Wvpdp3Q@mail.gmail.com>
On 8/5/24 19:46, Peter Maydell wrote:
> On Wed, 8 May 2024 at 15:13, Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
>>
>> Expose the clock frequency via the QOM 'freq-hz' property,
>> as it might be useful for QTests.
>>
>> HMP example:
>>
>> $ qemu-system-mips -S -monitor stdio -M mipssim
>> (qemu) qom-get /machine/cpu-refclk freq-hz
>> 12000000
>>
>> Inspired-by: Inès Varhol <ines.varhol@telecom-paris.fr>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>
> So I have a couple of thoughts here:
>
> (1) if this is intended for qtests, would exposing the period (i.e.
> QOM equivalent of clock_get() rather than clock_get_hz()) be better?
> A Hz figure has rounding so it's not as accurate.
Indeed, simpler to compare from QTest perspective.
> (2) We should document this in clocks.rst; I guess we want to say
> "only intended for use in qtests" (i.e. if you're part of QEMU
> use the existing function interface, not this).
OK, and we can also only expose this for QTest using:
if (qtest_enabled()) {
object_property_add(obj, "[qtest-]clock-period", ...);
}
prev parent reply other threads:[~2024-05-08 21:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-08 14:13 [PATCH] hw/clock: Expose 'freq-hz' QOM property Philippe Mathieu-Daudé
2024-05-08 17:46 ` Peter Maydell
2024-05-08 21:27 ` Philippe Mathieu-Daudé [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=ba6c3173-12c2-45d8-ade4-b21598800f5b@linaro.org \
--to=philmd@linaro.org \
--cc=damien.hedde@dahe.fr \
--cc=ines.varhol@telecom-paris.fr \
--cc=luc@lmichel.fr \
--cc=peter.maydell@linaro.org \
--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 read-only IMAP folder(s) and NNTP newsgroup(s).