qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: "T.J. Alumbaugh" <talumbau@google.com>, qemu-devel@nongnu.org
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
	"Yuanchu Xie" <yuanchu@google.com>, "Yu Zhao" <yuzhao@google.com>,
	"Dr. David Alan Gilbert" <dave@treblig.org>,
	"Markus Armbruster" <armbru@redhat.com>,
	"Eduardo Habkost" <eduardo@habkost.net>,
	"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Yanan Wang" <wangyanan55@huawei.com>,
	"Eric Blake" <eblake@redhat.com>
Subject: Re: [RFC PATCH v2 3/5] virtio-balloon: Add QMP functions for Working Set
Date: Wed, 31 May 2023 10:14:37 +0200	[thread overview]
Message-ID: <af5f1cb9-65ee-874f-fa20-8d0ad6fc42d2@redhat.com> (raw)
In-Reply-To: <20230525222016.35333-4-talumbau@google.com>

On 26.05.23 00:20, T.J. Alumbaugh wrote:
>    - Adds QMP function 'working-set-config'
>    - Adds QMP function 'working-set-request'
>    - Retrieve working set via 'guest-working-set' property on balloon
> 
>>> cat script.py
> 
> NAME = "name"
> SOCKET = 'vm.sock'
> BALLOON =  "/machine/peripheral/balloon0"
> 
> import json
> import asyncio
> from qemu.qmp import QMPClient
> 
> async def main():
>      client = QMPClient(NAME)
>      await client.connect(SOCKET)
>      config = { "i0": 200, "i1": 800, "i2": 3000, "refresh": 750, "report": 1000 }
>      await client.execute('working-set-config', config)
>      await client.execute('working-set-request')
>      property = {"path":BALLOON, "property":"guest-working-set"}
>      res = await client.execute('qom-get', property)
>      return res
> 
> if __name__ == "__main__":
>      ret = asyncio.run(main())
>      print(json.dumps(ret, indent=2))
> 
>>> (Execute qemu with flag '-qmp unix:path=vm.sock,server=on,wait=off'
>>> (Perform normal activities on VM to exercise MM code)
> 
>>> python3 script.py
> {
>    "working_set": {
>      "ws3": {
>        "memory-size-bytes": {
>          "anon": 890478592,
>          "file": 1285832704
>        },
>        "idle-age": 4294967292
>      },
>      "ws2": {
>        "memory-size-bytes": {
>          "anon": 173465600,
>          "file": 83353600
>        },
>        "idle-age": 3000
>      },
>      "ws1": {
>        "memory-size-bytes": {
>          "anon": 44236800,
>          "file": 20889600
>        },
>        "idle-age": 800
>      },
>      "ws0": {
>        "memory-size-bytes": {
>          "anon": 14540800,
>          "file": 6963200
>        },
>        "idle-age": 200
>      }
>    }
> }

Would it be possible to model that as QOM property instead? Then, we 
could use qom-get/qom-set on the device instead of having to craft new 
QMP/HMP functions.

-- 
Thanks,

David / dhildenb



  parent reply	other threads:[~2023-05-31  8:17 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-25 22:20 [RFC PATCH v2 0/5] virtio-balloon: Working Set Reporting T.J. Alumbaugh
2023-05-25 22:20 ` [RFC PATCH v2 1/5] virtio-balloon: Add Working Set Reporting feature T.J. Alumbaugh
2023-05-31  8:12   ` David Hildenbrand
2023-05-31 10:28     ` Michael S. Tsirkin
2023-05-25 22:20 ` [RFC PATCH v2 2/5] virtio-balloon: device has Working Set Reporting T.J. Alumbaugh
2023-05-27  6:16   ` Markus Armbruster
2023-05-27  6:21   ` Markus Armbruster
2023-05-25 22:20 ` [RFC PATCH v2 3/5] virtio-balloon: Add QMP functions for Working Set T.J. Alumbaugh
2023-05-27  6:38   ` Markus Armbruster
2023-05-31  8:14   ` David Hildenbrand [this message]
2023-05-25 22:20 ` [RFC PATCH v2 4/5] virtio-balloon: Add HMP " T.J. Alumbaugh
2023-05-25 22:20 ` [RFC PATCH v2 5/5] virtio-balloon: Migration of working set config T.J. Alumbaugh
2023-05-31  8:18 ` [RFC PATCH v2 0/5] virtio-balloon: Working Set Reporting David Hildenbrand
2025-04-07  9:39 ` Michael S. Tsirkin
2025-04-09 16:52   ` Yuanchu Xie
2025-04-10  6:09     ` Michael S. Tsirkin

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=af5f1cb9-65ee-874f-fa20-8d0ad6fc42d2@redhat.com \
    --to=david@redhat.com \
    --cc=armbru@redhat.com \
    --cc=dave@treblig.org \
    --cc=eblake@redhat.com \
    --cc=eduardo@habkost.net \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=mst@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=talumbau@google.com \
    --cc=wangyanan55@huawei.com \
    --cc=yuanchu@google.com \
    --cc=yuzhao@google.com \
    /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).