qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Periodically print the number of dirty pages in KVM-QEMU


From: Wang Cheng
Subject: [Qemu-devel] Periodically print the number of dirty pages in KVM-QEMU
Date: Sat, 29 Oct 2016 02:15:36 +0800

Greetings!

I am trying to let qemu periodically print how many memory pages get
dirtied since the last call. I added some code in qemu in the following way.

I first of all create a thread right before main_loop (vl.c). Below is what
this this thread does:

void* report_dirty_pages(void* arg)
{
    memory_global_dirty_log_start(); // To turn on the
KVM_MEM_LOG_DIRTY_PAGES flags for all the memory pages
    while(1)
    {
        memory_global_sync_dirty_bitmap(get_system_memory());
        sleep(5); // Report every 5 minutes
        //TODO Question: how do I know how many pages get dirtied?
    }
}

I got two questions here. The first question is am I doing correct? If I am
right, how do I know how many pages get dirtied so that I can print this
number?

Many thanks for your patience and time.

-- 
Regards,
Wang Cheng


reply via email to

[Prev in Thread] Current Thread [Next in Thread]