qmemman-meminfo-writer: send simplified meminfo value

Send just one value - used memory (which is calculated anyway),
instead of full input data. This greatly simplify parsing at qmemman
side.

Fixes QubesOS/qubes-issues#1312
This commit is contained in:
Marek Marczykowski-Górecki 2016-09-07 03:55:38 +02:00
parent 44edc8a9b2
commit fbbd21a54b
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -78,10 +78,7 @@ const char *parse(const char *meminfo_buf, const char* dom_current_buf)
|| (used_mem > prev_used_mem && used_mem / 10 > (MemTotal+12) / 13
&& used_mem_diff > used_mem_change_threshold/2)) {
prev_used_mem = used_mem;
sprintf(outbuf,
"MemTotal: %lld kB\nMemFree: %lld kB\nBuffers: %lld kB\nCached: %lld kB\n"
"SwapTotal: %lld kB\nSwapFree: %lld kB\n", MemTotal,
MemFree, Buffers, Cached, SwapTotal, SwapFree);
sprintf(outbuf, "%lld", used_mem);
return outbuf;
}
return NULL;