[libvirt] [PATCHv2 0/2] Introduce the support of Intel RDT-MBM

This is a followup to Daniel's review in thread https://www.redhat.com/archives/libvir-list/2019-December/msg00978.html. Hi Daniel, In this series, patch 1/2 is trying to fix a bug that using the 64bit, instead of the current 32bit, interface, to hold cache monitor value reported by underlying 64bit counter. In last series, you have suggested of adding a new field such as "cpu.cache.monitor.%zu.bank.%zu.bytes64" for new 64bit counter result, and keep the old but already exported 32bit field, to avoid reporting a truncated cache monitor result to user. But considering the fact that, in reality, CPU cache size will never exceed 4GB in size, it is safe to truccate a 64bit counter to 32 bit since the counter is counting for the cache size that vcpus are using. Change List: v2: * Using old "cpu.cache.monitor.%zu.bank.%zu.bytes" field for cache monitor result, and keeping the interface consistent. * Add 'virsh domstats --memory' document in file 'virsh.rst' Wang Huaqiang (2): util, resctrl: using 64bit interface instead of 32bit for counters Introduce command 'virsh domstats --memory' for reporting memory BW docs/manpages/virsh.rst | 22 +++++- include/libvirt/libvirt-domain.h | 1 + src/libvirt-domain.c | 21 ++++++ src/qemu/qemu_driver.c | 118 ++++++++++++++++++++++++++++++- src/util/virfile.c | 40 +++++++++++ src/util/virfile.h | 2 + src/util/virresctrl.c | 6 +- src/util/virresctrl.h | 2 +- tools/virsh-domain-monitor.c | 7 ++ 9 files changed, 211 insertions(+), 8 deletions(-) -- 2.23.0

The underlying resctrl monitoring is actually using 64 bit counters, not the 32bit one. Correct this by using 64bit data type for reading hardware value. To keep the interface consistent, the result of CPU last level cache that occupied by vcpu processors of specific restrl monitor group is still reported with a truncated 32bit data type. because, in silicon world, CPU cache size will never exceed 4GB. Signed-off-by: Wang Huaqiang <huaqiang.wang@intel.com> --- src/qemu/qemu_driver.c | 15 +++++++++++++-- src/util/virfile.c | 40 ++++++++++++++++++++++++++++++++++++++++ src/util/virfile.h | 2 ++ src/util/virresctrl.c | 6 +++--- src/util/virresctrl.h | 2 +- 5 files changed, 59 insertions(+), 6 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 7a7f388767..ad6f3130ae 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -20740,8 +20740,19 @@ qemuDomainGetStatsCpuCache(virQEMUDriverPtr driver, "cpu.cache.monitor.%zu.bank.%zu.id", i, j) < 0) goto cleanup; - if (virTypedParamListAddUInt(params, resdata[i]->stats[j]->vals[0], - "cpu.cache.monitor.%zu.bank.%zu.bytes", i, j) < 0) + /* 'resdata[i]->stats[j]->vals[0]' keeps the value of how many last + * level cache in bank j currently occupied by the vcpus listed in + * resource monitor i, in bytes. This value is reported through a + * 64 bit hardware counter, so it is better to be arranged with + * data type in 64 bit width, but considering the fact that + * physical cache on a CPU could never be designed to be bigger + * than 4G bytes in size, to keep the 'domstats' interface + * historically consistent, it is safe to report the value with a + * truncated 'UInt' data type here. */ + if (virTypedParamListAddUInt(params, + (unsigned int)resdata[i]->stats[j]->vals[0], + "cpu.cache.monitor.%zu.bank.%zu.bytes", + i, j) < 0) goto cleanup; } } diff --git a/src/util/virfile.c b/src/util/virfile.c index 4fd865dd83..7bf33682c7 100644 --- a/src/util/virfile.c +++ b/src/util/virfile.c @@ -4196,6 +4196,46 @@ virFileReadValueUint(unsigned int *value, const char *format, ...) } +/** + * virFileReadValueUllong: + * @value: pointer to unsigned long long to be filled in with the value + * @format, ...: file to read from + * + * Read unsigned int from @format and put it into @value. + * + * Return -2 for non-existing file, -1 on other errors and 0 if everything went + * fine. + */ +int +virFileReadValueUllong(unsigned long long *value, const char *format, ...) +{ + g_autofree char *str = NULL; + g_autofree char *path = NULL; + va_list ap; + + va_start(ap, format); + path = g_strdup_vprintf(format, ap); + va_end(ap); + + if (!virFileExists(path)) + return -2; + + if (virFileReadAll(path, INT_BUFSIZE_BOUND(*value), &str) < 0) + return -1; + + virStringTrimOptionalNewline(str); + + if (virStrToLong_ullp(str, NULL, 10, value) < 0) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Invalid unsigned long long value '%s' in file '%s'"), + str, path); + return -1; + } + + return 0; +} + + /** * virFileReadValueScaledInt: * @value: pointer to unsigned long long int to be filled in with the value diff --git a/src/util/virfile.h b/src/util/virfile.h index bcae40ee06..756c9a70b9 100644 --- a/src/util/virfile.h +++ b/src/util/virfile.h @@ -361,6 +361,8 @@ int virFileReadValueInt(int *value, const char *format, ...) G_GNUC_PRINTF(2, 3); int virFileReadValueUint(unsigned int *value, const char *format, ...) G_GNUC_PRINTF(2, 3); +int virFileReadValueUllong(unsigned long long *value, const char *format, ...) + G_GNUC_PRINTF(2, 3); int virFileReadValueBitmap(virBitmapPtr *value, const char *format, ...) G_GNUC_PRINTF(2, 3); int virFileReadValueScaledInt(unsigned long long *value, const char *format, ...) diff --git a/src/util/virresctrl.c b/src/util/virresctrl.c index b78fded026..684d2ce398 100644 --- a/src/util/virresctrl.c +++ b/src/util/virresctrl.c @@ -2678,7 +2678,7 @@ virResctrlMonitorGetStats(virResctrlMonitorPtr monitor, int rv = -1; int ret = -1; size_t i = 0; - unsigned int val = 0; + unsigned long long val = 0; DIR *dirp = NULL; char *datapath = NULL; char *filepath = NULL; @@ -2734,8 +2734,8 @@ virResctrlMonitorGetStats(virResctrlMonitorPtr monitor, goto cleanup; for (i = 0; resources[i]; i++) { - rv = virFileReadValueUint(&val, "%s/%s/%s", datapath, - ent->d_name, resources[i]); + rv = virFileReadValueUllong(&val, "%s/%s/%s", datapath, + ent->d_name, resources[i]); if (rv == -2) { virReportError(VIR_ERR_INTERNAL_ERROR, _("File '%s/%s/%s' does not exist."), diff --git a/src/util/virresctrl.h b/src/util/virresctrl.h index 3dd7c96348..11f275acf4 100644 --- a/src/util/virresctrl.h +++ b/src/util/virresctrl.h @@ -204,7 +204,7 @@ struct _virResctrlMonitorStats { char **features; /* @vals store the statistical record values and @val[0] is the value for * @features[0], @val[1] for@features[1] ... respectively */ - unsigned int *vals; + unsigned long long *vals; /* The length of @vals array */ size_t nvals; }; -- 2.23.0

On Thu, Jan 02, 2020 at 06:45:04PM +0800, Wang Huaqiang wrote:
The underlying resctrl monitoring is actually using 64 bit counters, not the 32bit one. Correct this by using 64bit data type for reading hardware value.
To keep the interface consistent, the result of CPU last level cache that occupied by vcpu processors of specific restrl monitor group is still reported with a truncated 32bit data type. because, in silicon world, CPU cache size will never exceed 4GB.
Signed-off-by: Wang Huaqiang <huaqiang.wang@intel.com> --- src/qemu/qemu_driver.c | 15 +++++++++++++-- src/util/virfile.c | 40 ++++++++++++++++++++++++++++++++++++++++ src/util/virfile.h | 2 ++ src/util/virresctrl.c | 6 +++--- src/util/virresctrl.h | 2 +- 5 files changed, 59 insertions(+), 6 deletions(-)
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
diff --git a/src/util/virfile.h b/src/util/virfile.h index bcae40ee06..756c9a70b9 100644 --- a/src/util/virfile.h +++ b/src/util/virfile.h @@ -361,6 +361,8 @@ int virFileReadValueInt(int *value, const char *format, ...) G_GNUC_PRINTF(2, 3); int virFileReadValueUint(unsigned int *value, const char *format, ...) G_GNUC_PRINTF(2, 3); +int virFileReadValueUllong(unsigned long long *value, const char *format, ...) + G_GNUC_PRINTF(2, 3);
Also needs adding to libvirt_private.syms, which I did when pushing. Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|

Hi Daniel, Thanks for review! Br Huaqiang
-----Original Message----- From: Daniel P. Berrangé <berrange@redhat.com> Sent: Monday, January 6, 2020 10:16 PM To: Wang, Huaqiang <huaqiang.wang@intel.com> Cc: libvir-list@redhat.com Subject: Re: [PATCHv2 1/2] util, resctrl: using 64bit interface instead of 32bit for counters
On Thu, Jan 02, 2020 at 06:45:04PM +0800, Wang Huaqiang wrote:
The underlying resctrl monitoring is actually using 64 bit counters, not the 32bit one. Correct this by using 64bit data type for reading hardware value.
To keep the interface consistent, the result of CPU last level cache that occupied by vcpu processors of specific restrl monitor group is still reported with a truncated 32bit data type. because, in silicon world, CPU cache size will never exceed 4GB.
Signed-off-by: Wang Huaqiang <huaqiang.wang@intel.com> --- src/qemu/qemu_driver.c | 15 +++++++++++++-- src/util/virfile.c | 40 ++++++++++++++++++++++++++++++++++++++++ src/util/virfile.h | 2 ++ src/util/virresctrl.c | 6 +++--- src/util/virresctrl.h | 2 +- 5 files changed, 59 insertions(+), 6 deletions(-)
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
diff --git a/src/util/virfile.h b/src/util/virfile.h index bcae40ee06..756c9a70b9 100644 --- a/src/util/virfile.h +++ b/src/util/virfile.h @@ -361,6 +361,8 @@ int virFileReadValueInt(int *value, const char *format, ...) G_GNUC_PRINTF(2, 3); int virFileReadValueUint(unsigned int *value, const char *format, ...) G_GNUC_PRINTF(2, 3); +int virFileReadValueUllong(unsigned long long *value, const char +*format, ...) G_GNUC_PRINTF(2, 3);
Also needs adding to libvirt_private.syms, which I did when pushing.
Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|

Introduce an option '--memory' for showing memory related information. The memory bandwidth infomatio is listed as: Domain: 'libvirt-vm' memory.bandwidth.monitor.count=4 memory.bandwidth.monitor.0.name=vcpus_0-4 memory.bandwidth.monitor.0.vcpus=0-4 memory.bandwidth.monitor.0.node.count=2 memory.bandwidth.monitor.0.node.0.id=0 memory.bandwidth.monitor.0.node.0.bytes.total=10208067584 memory.bandwidth.monitor.0.node.0.bytes.local=4807114752 memory.bandwidth.monitor.0.node.1.id=1 memory.bandwidth.monitor.0.node.1.bytes.total=8693735424 memory.bandwidth.monitor.0.node.1.bytes.local=5850161152 memory.bandwidth.monitor.1.name=vcpus_7 memory.bandwidth.monitor.1.vcpus=7 memory.bandwidth.monitor.1.node.count=2 memory.bandwidth.monitor.1.node.0.id=0 memory.bandwidth.monitor.1.node.0.bytes.total=853811200 memory.bandwidth.monitor.1.node.0.bytes.local=290701312 memory.bandwidth.monitor.1.node.1.id=1 memory.bandwidth.monitor.1.node.1.bytes.total=406044672 memory.bandwidth.monitor.1.node.1.bytes.local=229425152 Signed-off-by: Wang Huaqiang <huaqiang.wang@intel.com> --- docs/manpages/virsh.rst | 22 ++++++- include/libvirt/libvirt-domain.h | 1 + src/libvirt-domain.c | 21 +++++++ src/qemu/qemu_driver.c | 103 +++++++++++++++++++++++++++++++ tools/virsh-domain-monitor.c | 7 +++ 5 files changed, 152 insertions(+), 2 deletions(-) diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst index fea0527caf..d0f9e15c38 100644 --- a/docs/manpages/virsh.rst +++ b/docs/manpages/virsh.rst @@ -2186,7 +2186,7 @@ domstats domstats [--raw] [--enforce] [--backing] [--nowait] [--state] [--cpu-total] [--balloon] [--vcpu] [--interface] - [--block] [--perf] [--iothread] + [--block] [--perf] [--iothread] [--memory] [[--list-active] [--list-inactive] [--list-persistent] [--list-transient] [--list-running]y [--list-paused] [--list-shutoff] [--list-other]] | [domain ...] @@ -2205,7 +2205,7 @@ behavior use the *--raw* flag. The individual statistics groups are selectable via specific flags. By default all supported statistics groups are returned. Supported statistics groups flags are: *--state*, *--cpu-total*, *--balloon*, -*--vcpu*, *--interface*, *--block*, *--perf*, *--iothread*. +*--vcpu*, *--interface*, *--block*, *--perf*, *--iothread*, *--memory*. Note that - depending on the hypervisor type and version or the domain state - not all of the following statistics may be returned. @@ -2372,6 +2372,24 @@ not available for statistical purposes. * ``iothread.<id>.poll-shrink`` - polling time shrink value. A value of (zero) indicates shrink is managed by hypervisor. +*--memory* returns: + +* ``memory.bandwidth.monitor.count`` - the number of memory bandwidth + monitors for this domain +* ``memory.bandwidth.monitor.<num>.name`` - the name of monitor <num> +* ``memory.bandwidth.monitor.<num>.vcpus`` - the vcpu list of monitor <num> +* ``memory.bandwidth.monitor.<num>.node.count`` - the number of memory + controller in monitor <num> +* ``memory.bandwidth.monitor.<num>.node.<index>.id`` - host allocated memory + controller id for controller <index> of monitor <num> +* ``memory.bandwidth.monitor.<num>.node.<index>.bytes.local`` - the accumulative + bytes consumed by @vcpus that passing through the memory controller in the + same processor that the scheduled host CPU belongs to. +* ``memory.bandwidth.monitor.<num>.node.<index>.bytes.total`` - the total + bytes consumed by @vcpus that passing through all memory controllers, either + local or remote controller. + + Selecting a specific statistics groups doesn't guarantee that the daemon supports the selected group of stats. Flag *--enforce* forces the command to fail if the daemon doesn't support the diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h index e60003978a..78532c0eb8 100644 --- a/include/libvirt/libvirt-domain.h +++ b/include/libvirt/libvirt-domain.h @@ -2160,6 +2160,7 @@ typedef enum { VIR_DOMAIN_STATS_BLOCK = (1 << 5), /* return domain block info */ VIR_DOMAIN_STATS_PERF = (1 << 6), /* return domain perf event info */ VIR_DOMAIN_STATS_IOTHREAD = (1 << 7), /* return iothread poll info */ + VIR_DOMAIN_STATS_MEMORY= (1 << 8), /* return domain memory info */ } virDomainStatsTypes; typedef enum { diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c index 793eceb39f..eb66999f07 100644 --- a/src/libvirt-domain.c +++ b/src/libvirt-domain.c @@ -11640,6 +11640,27 @@ virConnectGetDomainCapabilities(virConnectPtr conn, * hypervisor to choose how to shrink the * polling time. * + * VIR_DOMAIN_STATS_MEMORY: + * Return memory bandwidth statistics and the usage information. The typed + * parameter keys are in this format: + * + * "memory.bandwidth.monitor.count" - the number of memory bandwidth + * monitors for this domain + * "memory.bandwidth.monitor.<num>.name" - the name of monitor <num> + * "memory.bandwidth.monitor.<num>.vcpus" - the vcpu list of monitor <num> + * "memory.bandwidth.monitor.<num>.node.count" - the number of memory + * controller in monitor <num> + * "memory.bandwidth.monitor.<num>.node.<index>.id" - host allocated memory + * controller id for controller + * <index> of monitor <num> + * "memory.bandwidth.monitor.<num>.node.<index>.bytes.local" - the + * accumulative bytes consumed by @vcpus that passing + * through the memory controller in the same processor + * that the scheduled host CPU belongs to. + * "memory.bandwidth.monitor.<num>.node.<index>.bytes.total" - the total + * bytes consumed by @vcpus that passing through all + * memory controllers, either local or remote controller. + * * Note that entire stats groups or individual stat fields may be missing from * the output in case they are not supported by the given hypervisor, are not * applicable for the current state of the guest domain, or their retrieval diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index ad6f3130ae..d91adcf52f 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -20649,6 +20649,9 @@ qemuDomainGetResctrlMonData(virQEMUDriverPtr driver, features = caps->host.cache.monitor->features; break; case VIR_RESCTRL_MONITOR_TYPE_MEMBW: + if (caps->host.memBW.monitor) + features = caps->host.memBW.monitor->features; + break; case VIR_RESCTRL_MONITOR_TYPE_UNSUPPORT: case VIR_RESCTRL_MONITOR_TYPE_LAST: virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s", @@ -20701,6 +20704,94 @@ qemuDomainGetResctrlMonData(virQEMUDriverPtr driver, } +static int +qemuDomainGetStatsMemoryBandwidth(virQEMUDriverPtr driver, + virDomainObjPtr dom, + virTypedParamListPtr params) +{ + virQEMUResctrlMonDataPtr *resdata = NULL; + char **features = NULL; + size_t nresdata = 0; + size_t i = 0; + size_t j = 0; + size_t k = 0; + int ret = -1; + + if (!virDomainObjIsActive(dom)) + return 0; + + if (qemuDomainGetResctrlMonData(driver, dom, &resdata, &nresdata, + VIR_RESCTRL_MONITOR_TYPE_MEMBW) < 0) + goto cleanup; + + if (nresdata == 0) + return 0; + + if (virTypedParamListAddUInt(params, nresdata, + "memory.bandwidth.monitor.count") < 0) + goto cleanup; + + for (i = 0; i < nresdata; i++) { + if (virTypedParamListAddString(params, resdata[i]->name, + "memory.bandwidth.monitor.%zu.name", + i) < 0) + goto cleanup; + + if (virTypedParamListAddString(params, resdata[i]->vcpus, + "memory.bandwidth.monitor.%zu.vcpus", + i) < 0) + goto cleanup; + + if (virTypedParamListAddUInt(params, resdata[i]->nstats, + "memory.bandwidth.monitor.%zu.node.count", + i) < 0) + goto cleanup; + + + for (j = 0; j < resdata[i]->nstats; j++) { + if (virTypedParamListAddUInt(params, resdata[i]->stats[j]->id, + "memory.bandwidth.monitor.%zu." + "node.%zu.id", + i, j) < 0) + goto cleanup; + + + features = resdata[i]->stats[j]->features; + for (k = 0; features[k]; k++) { + if (STREQ(features[k], "mbm_local_bytes")) { + /* The accumulative data passing through local memory + * controller is recorded with 64 bit counter. */ + if (virTypedParamListAddULLong(params, + resdata[i]->stats[j]->vals[k], + "memory.bandwidth.monitor." + "%zu.node.%zu.bytes.local", + i, j) < 0) + goto cleanup; + } + + if (STREQ(features[k], "mbm_total_bytes")) { + /* The accumulative data passing through local and remote + * memory controller is recorded with 64 bit counter. */ + if (virTypedParamListAddULLong(params, + resdata[i]->stats[j]->vals[k], + "memory.bandwidth.monitor." + "%zu.node.%zu.bytes.total", + i, j) < 0) + goto cleanup; + } + } + } + } + + ret = 0; + cleanup: + for (i = 0; i < nresdata; i++) + qemuDomainFreeResctrlMonData(resdata[i]); + VIR_FREE(resdata); + return ret; +} + + static int qemuDomainGetStatsCpuCache(virQEMUDriverPtr driver, virDomainObjPtr dom, @@ -20809,6 +20900,17 @@ qemuDomainGetStatsCpu(virQEMUDriverPtr driver, } +static int +qemuDomainGetStatsMemory(virQEMUDriverPtr driver, + virDomainObjPtr dom, + virTypedParamListPtr params, + unsigned int privflags G_GNUC_UNUSED) + +{ + return qemuDomainGetStatsMemoryBandwidth(driver, dom, params); +} + + static int qemuDomainGetStatsBalloon(virQEMUDriverPtr driver, virDomainObjPtr dom, @@ -21478,6 +21580,7 @@ static struct qemuDomainGetStatsWorker qemuDomainGetStatsWorkers[] = { { qemuDomainGetStatsBlock, VIR_DOMAIN_STATS_BLOCK, true }, { qemuDomainGetStatsPerf, VIR_DOMAIN_STATS_PERF, false }, { qemuDomainGetStatsIOThread, VIR_DOMAIN_STATS_IOTHREAD, true }, + { qemuDomainGetStatsMemory, VIR_DOMAIN_STATS_MEMORY, false }, { NULL, 0, false } }; diff --git a/tools/virsh-domain-monitor.c b/tools/virsh-domain-monitor.c index c2f157ad6b..7b9b9c57b0 100644 --- a/tools/virsh-domain-monitor.c +++ b/tools/virsh-domain-monitor.c @@ -2111,6 +2111,10 @@ static const vshCmdOptDef opts_domstats[] = { .type = VSH_OT_BOOL, .help = N_("report domain IOThread information"), }, + {.name = "memory", + .type = VSH_OT_BOOL, + .help = N_("report domain memory usage"), + }, {.name = "list-active", .type = VSH_OT_BOOL, .help = N_("list only active domains"), @@ -2227,6 +2231,9 @@ cmdDomstats(vshControl *ctl, const vshCmd *cmd) if (vshCommandOptBool(cmd, "iothread")) stats |= VIR_DOMAIN_STATS_IOTHREAD; + if (vshCommandOptBool(cmd, "memory")) + stats |= VIR_DOMAIN_STATS_MEMORY; + if (vshCommandOptBool(cmd, "list-active")) flags |= VIR_CONNECT_GET_ALL_DOMAINS_STATS_ACTIVE; -- 2.23.0

On Thu, Jan 02, 2020 at 06:45:05PM +0800, Wang Huaqiang wrote:
Introduce an option '--memory' for showing memory related information. The memory bandwidth infomatio is listed as:
Domain: 'libvirt-vm' memory.bandwidth.monitor.count=4 memory.bandwidth.monitor.0.name=vcpus_0-4 memory.bandwidth.monitor.0.vcpus=0-4 memory.bandwidth.monitor.0.node.count=2 memory.bandwidth.monitor.0.node.0.id=0 memory.bandwidth.monitor.0.node.0.bytes.total=10208067584 memory.bandwidth.monitor.0.node.0.bytes.local=4807114752 memory.bandwidth.monitor.0.node.1.id=1 memory.bandwidth.monitor.0.node.1.bytes.total=8693735424 memory.bandwidth.monitor.0.node.1.bytes.local=5850161152 memory.bandwidth.monitor.1.name=vcpus_7 memory.bandwidth.monitor.1.vcpus=7 memory.bandwidth.monitor.1.node.count=2 memory.bandwidth.monitor.1.node.0.id=0 memory.bandwidth.monitor.1.node.0.bytes.total=853811200 memory.bandwidth.monitor.1.node.0.bytes.local=290701312 memory.bandwidth.monitor.1.node.1.id=1 memory.bandwidth.monitor.1.node.1.bytes.total=406044672 memory.bandwidth.monitor.1.node.1.bytes.local=229425152
Signed-off-by: Wang Huaqiang <huaqiang.wang@intel.com> --- docs/manpages/virsh.rst | 22 ++++++- include/libvirt/libvirt-domain.h | 1 + src/libvirt-domain.c | 21 +++++++ src/qemu/qemu_driver.c | 103 +++++++++++++++++++++++++++++++ tools/virsh-domain-monitor.c | 7 +++ 5 files changed, 152 insertions(+), 2 deletions(-)
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
index e60003978a..78532c0eb8 100644 --- a/include/libvirt/libvirt-domain.h +++ b/include/libvirt/libvirt-domain.h @@ -2160,6 +2160,7 @@ typedef enum { VIR_DOMAIN_STATS_BLOCK = (1 << 5), /* return domain block info */ VIR_DOMAIN_STATS_PERF = (1 << 6), /* return domain perf event info */ VIR_DOMAIN_STATS_IOTHREAD = (1 << 7), /* return iothread poll info */ + VIR_DOMAIN_STATS_MEMORY= (1 << 8), /* return domain memory info */
I fixed this missing whitespace when pushing. Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|

Hi Daniel, Thanks for your hard work and review! Br Huaqiang
-----Original Message----- From: Daniel P. Berrangé <berrange@redhat.com> Sent: Monday, January 6, 2020 10:17 PM To: Wang, Huaqiang <huaqiang.wang@intel.com> Cc: libvir-list@redhat.com Subject: Re: [PATCHv2 2/2] Introduce command 'virsh domstats --memory' for reporting memory BW
On Thu, Jan 02, 2020 at 06:45:05PM +0800, Wang Huaqiang wrote:
Introduce an option '--memory' for showing memory related information. The memory bandwidth infomatio is listed as:
Domain: 'libvirt-vm' memory.bandwidth.monitor.count=4 memory.bandwidth.monitor.0.name=vcpus_0-4 memory.bandwidth.monitor.0.vcpus=0-4 memory.bandwidth.monitor.0.node.count=2 memory.bandwidth.monitor.0.node.0.id=0 memory.bandwidth.monitor.0.node.0.bytes.total=10208067584 memory.bandwidth.monitor.0.node.0.bytes.local=4807114752 memory.bandwidth.monitor.0.node.1.id=1 memory.bandwidth.monitor.0.node.1.bytes.total=8693735424 memory.bandwidth.monitor.0.node.1.bytes.local=5850161152 memory.bandwidth.monitor.1.name=vcpus_7 memory.bandwidth.monitor.1.vcpus=7 memory.bandwidth.monitor.1.node.count=2 memory.bandwidth.monitor.1.node.0.id=0 memory.bandwidth.monitor.1.node.0.bytes.total=853811200 memory.bandwidth.monitor.1.node.0.bytes.local=290701312 memory.bandwidth.monitor.1.node.1.id=1 memory.bandwidth.monitor.1.node.1.bytes.total=406044672 memory.bandwidth.monitor.1.node.1.bytes.local=229425152
Signed-off-by: Wang Huaqiang <huaqiang.wang@intel.com> --- docs/manpages/virsh.rst | 22 ++++++- include/libvirt/libvirt-domain.h | 1 + src/libvirt-domain.c | 21 +++++++ src/qemu/qemu_driver.c | 103 +++++++++++++++++++++++++++++++ tools/virsh-domain-monitor.c | 7 +++ 5 files changed, 152 insertions(+), 2 deletions(-)
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
index e60003978a..78532c0eb8 100644 --- a/include/libvirt/libvirt-domain.h +++ b/include/libvirt/libvirt-domain.h @@ -2160,6 +2160,7 @@ typedef enum { VIR_DOMAIN_STATS_BLOCK = (1 << 5), /* return domain block info */ VIR_DOMAIN_STATS_PERF = (1 << 6), /* return domain perf event info */ VIR_DOMAIN_STATS_IOTHREAD = (1 << 7), /* return iothread poll info */ + VIR_DOMAIN_STATS_MEMORY= (1 << 8), /* return domain memory info + */
I fixed this missing whitespace when pushing.
Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
participants (3)
-
Daniel P. Berrangé
-
Wang Huaqiang
-
Wang, Huaqiang