xref: /openbmc/qemu/migration/migration-stats.h (revision c0177f91)
1 /*
2  * Migration stats
3  *
4  * Copyright (c) 2012-2023 Red Hat Inc
5  *
6  * Authors:
7  *  Juan Quintela <quintela@redhat.com>
8  *
9  * This work is licensed under the terms of the GNU GPL, version 2 or later.
10  * See the COPYING file in the top-level directory.
11  */
12 
13 #ifndef QEMU_MIGRATION_STATS_H
14 #define QEMU_MIGRATION_STATS_H
15 
16 #include "qemu/stats64.h"
17 
18 /*
19  * These are the ram migration statistic counters.  It is loosely
20  * based on MigrationStats.  We change to Stat64 any counter that
21  * needs to be updated using atomic ops (can be accessed by more than
22  * one thread).
23  */
24 typedef struct {
25     Stat64 dirty_bytes_last_sync;
26     Stat64 dirty_pages_rate;
27     Stat64 dirty_sync_count;
28     Stat64 dirty_sync_missed_zero_copy;
29     Stat64 downtime_bytes;
30     Stat64 zero_pages;
31     Stat64 multifd_bytes;
32     Stat64 normal_pages;
33     Stat64 postcopy_bytes;
34     Stat64 postcopy_requests;
35     Stat64 precopy_bytes;
36     Stat64 transferred;
37 } MigrationAtomicStats;
38 
39 extern MigrationAtomicStats mig_stats;
40 
41 #endif
42