]> git.proxmox.com Git - mirror_qemu.git/blame - migration/migration-stats.h
migration: process_incoming_migration_co(): move colo part to colo
[mirror_qemu.git] / migration / migration-stats.h
CommitLineData
947701cc
JQ
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 */
24typedef struct {
e2ee2005
JQ
25 /*
26 * Number of bytes that were dirty last time that we synced with
27 * the guest memory. We use that to calculate the downtime. As
28 * the remaining dirty amounts to what we know that is still dirty
29 * since last iteration, not counting what the guest has dirtied
30 * since we synchronized bitmaps.
31 */
947701cc 32 Stat64 dirty_bytes_last_sync;
e2ee2005
JQ
33 /*
34 * Number of pages dirtied per second.
35 */
947701cc 36 Stat64 dirty_pages_rate;
e2ee2005
JQ
37 /*
38 * Number of times we have synchronized guest bitmaps.
39 */
947701cc 40 Stat64 dirty_sync_count;
e2ee2005
JQ
41 /*
42 * Number of times zero copy failed to send any page using zero
43 * copy.
44 */
947701cc 45 Stat64 dirty_sync_missed_zero_copy;
e2ee2005
JQ
46 /*
47 * Number of bytes sent at migration completion stage while the
48 * guest is stopped.
49 */
947701cc 50 Stat64 downtime_bytes;
e2ee2005
JQ
51 /*
52 * Number of bytes sent through multifd channels.
53 */
947701cc 54 Stat64 multifd_bytes;
e2ee2005
JQ
55 /*
56 * Number of pages transferred that were not full of zeros.
57 */
947701cc 58 Stat64 normal_pages;
e2ee2005
JQ
59 /*
60 * Number of bytes sent during postcopy.
61 */
947701cc 62 Stat64 postcopy_bytes;
e2ee2005
JQ
63 /*
64 * Number of postcopy page faults that we have handled during
65 * postcopy stage.
66 */
947701cc 67 Stat64 postcopy_requests;
e2ee2005
JQ
68 /*
69 * Number of bytes sent during precopy stage.
70 */
947701cc 71 Stat64 precopy_bytes;
e2ee2005
JQ
72 /*
73 * Total number of bytes transferred.
74 */
947701cc 75 Stat64 transferred;
40f240a7
JQ
76 /*
77 * Number of pages transferred that were full of zeros.
78 */
79 Stat64 zero_pages;
96820df2 80} MigrationAtomicStats;
947701cc 81
96820df2 82extern MigrationAtomicStats mig_stats;
947701cc
JQ
83
84#endif