[libvirt] libvirt and VIR_WARN("cannot parse process status data")

I have system with 3.19.3 kernel and libvirt 1.3.3 (version not matter because part of code not changed). When i'm try to get cpu stats via libvirt i have error in libvirt log, that says "cannot parse process status data" relevant code in src/qemu/qemu_driver.c in function qemuGetProcessInfo i'm add debut test to this function and in my case i have always fscanf != 4 qemu pid 7977 cat /proc/7977/stat 7977 (qemu-system-x86) S 1 7976 7976 0 -1 138420608 12728 0 0 0 4819 8249 0 0 20 0 7 0 51378692 4783886336 75779 18446744073709551615 139849472311296 139849478294132 140732912418880 140732912417952 139849400618495 0 268444224 4096 16963 18446744073709551615 0 0 17 5 0 0 15624 744 0 139849480394624 139849482248448 139849496641536 140732912421083 140732912422775 140732912422775 140732912422876 0 cat /proc/7977/task/7977/stat 7977 (qemu-system-x86) S 1 7976 7976 0 -1 138420608 12537 0 0 0 3917 7799 0 0 20 0 7 0 51378692 4783886336 75779 18446744073709551615 139849472311296 139849478294132 140732912418880 140732912417952 139849400618495 0 268444224 4096 16963 0 0 0 17 3 0 0 15624 0 0 139849480394624 139849482248448 139849496641536 140732912421083 140732912422775 140732912422775 140732912422876 0 cat /proc/7977/task/7979/stat 7979 (qemu-system-x86) S 1 7976 7976 0 -1 1077944384 20 0 0 0 0 0 0 0 20 0 7 0 51378696 4783886336 75779 18446744073709551615 139849472311296 139849478294132 140732912418880 139849260591832 139849400637449 0 2147221247 4096 16963 0 0 0 -1 6 0 0 0 0 0 139849480394624 139849482248448 139849496641536 140732912421083 140732912422775 140732912422775 140732912422876 0 cat /proc/7977/task/7982/stat 7982 (CPU 0/KVM) S 1 7976 7976 0 -1 138420416 22 0 0 0 226 118 0 0 20 0 7 0 51378697 4783886336 75779 18446744073709551615 139849472311296 139849478294132 140732912418880 139849222842936 139849400624151 0 2147220671 4096 16963 0 0 0 -1 5 0 0 0 196 0 139849480394624 139849482248448 139849496641536 140732912421083 140732912422775 140732912422775 140732912422876 0 Does somebody have time to fix this ? -- Vasiliy Tolstov, e-mail: v.tolstov@yoctocloud.net

On Tue, Jun 21, 2016 at 04:40:45PM +0300, Vasiliy Tolstov wrote:
I have system with 3.19.3 kernel and libvirt 1.3.3 (version not matter because part of code not changed). When i'm try to get cpu stats via libvirt i have error in libvirt log, that says "cannot parse process status data" relevant code in src/qemu/qemu_driver.c in function qemuGetProcessInfo
Honestly, I have only very rough idea about what you're trying to say. But you see that warning mentioned. Let's go from that.
i'm add debut test to this function and in my case i have always fscanf != 4
That's weird indeed, but what are you getting as a result if not 4? Are you getting it for each of the PIDs below or just for some? Are you getting bad statistics or you just don't like the warning? What is the debug message few lines below that saying (the "Got status for ...")? This could be caused by some weird libC, I guess. What are you using on your system? If you were able to modify the code to add more debugging, then try reading the file, print it out for yourself, then after the fscanf see what's in those variables. I can only guess without more detail.
Does somebody have time to fix this ?
The problem here is we don't know what is there to fix.
-- Vasiliy Tolstov, e-mail: v.tolstov@yoctocloud.net
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
participants (2)
-
Martin Kletzander
-
Vasiliy Tolstov