diff options
author | Hyman Huang(黄勇) <huangy81@chinatelecom.cn> | 2021-06-29 16:01:20 +0000 |
---|---|---|
committer | Juan Quintela <quintela@redhat.com> | 2021-11-01 22:56:43 +0100 |
commit | 71864eadd9a9933ef7e9460ae2fc93b3af98a181 (patch) | |
tree | cc38b3fba2d33fac8b8e1a887d62cccf90a9a140 /migration/dirtyrate.h | |
parent | 63b41db4bc776e71384d14d68a8ec6e0aae5ea3a (diff) | |
download | qemu-71864eadd9a9933ef7e9460ae2fc93b3af98a181.zip qemu-71864eadd9a9933ef7e9460ae2fc93b3af98a181.tar.gz qemu-71864eadd9a9933ef7e9460ae2fc93b3af98a181.tar.bz2 |
migration/dirtyrate: introduce struct and adjust DirtyRateStat
introduce "DirtyRateMeasureMode" to specify what method should be
used to calculate dirty rate, introduce "DirtyRateVcpu" to store
dirty rate for each vcpu.
use union to store stat data of specific mode
Signed-off-by: Hyman Huang(黄勇) <huangy81@chinatelecom.cn>
Message-Id: <661c98c40f40e163aa58334337af8f3ddf41316a.1624040308.git.huangy81@chinatelecom.cn>
Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Diffstat (limited to 'migration/dirtyrate.h')
-rw-r--r-- | migration/dirtyrate.h | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/migration/dirtyrate.h b/migration/dirtyrate.h index e1fd290..69d4c5b 100644 --- a/migration/dirtyrate.h +++ b/migration/dirtyrate.h @@ -43,6 +43,7 @@ struct DirtyRateConfig { uint64_t sample_pages_per_gigabytes; /* sample pages per GB */ int64_t sample_period_seconds; /* time duration between two sampling */ + DirtyRateMeasureMode mode; /* mode of dirtyrate measurement */ }; /* @@ -58,17 +59,29 @@ struct RamblockDirtyInfo { uint32_t *hash_result; /* array of hash result for sampled pages */ }; +typedef struct SampleVMStat { + uint64_t total_dirty_samples; /* total dirty sampled page */ + uint64_t total_sample_count; /* total sampled pages */ + uint64_t total_block_mem_MB; /* size of total sampled pages in MB */ +} SampleVMStat; + +typedef struct VcpuStat { + int nvcpu; /* number of vcpu */ + DirtyRateVcpu *rates; /* array of dirty rate for each vcpu */ +} VcpuStat; + /* * Store calculation statistics for each measure. */ struct DirtyRateStat { - uint64_t total_dirty_samples; /* total dirty sampled page */ - uint64_t total_sample_count; /* total sampled pages */ - uint64_t total_block_mem_MB; /* size of total sampled pages in MB */ int64_t dirty_rate; /* dirty rate in MB/s */ int64_t start_time; /* calculation start time in units of second */ int64_t calc_time; /* time duration of two sampling in units of second */ uint64_t sample_pages; /* sample pages per GB */ + union { + SampleVMStat page_sampling; + VcpuStat dirty_ring; + }; }; void *get_dirtyrate_thread(void *arg); |