procstate: Fill in last_processor member on linux

The field was added almost 20 years ago, but has only been set on
Solaris so far. It turns out we have a use for it now in the new
"Usage" application, so also fill it in on Linux.

https://bugzilla.gnome.org/show_bug.cgi?id=775182
This commit is contained in:
Florian Müllner
2016-11-27 16:11:34 +01:00
committed by Robert Roth
parent a0166d2844
commit f99bb61446

View File

@@ -110,6 +110,9 @@ glibtop_get_proc_state_s (glibtop *server, glibtop_proc_state *buf, pid_t pid)
break;
}
p = skip_multiple_token (p, 36);
buf->last_processor = atoi (p);
p = skip_token (buffer); /* pid */
if (G_UNLIKELY(*p++ != '('))
glibtop_error_r (server, "Bad data in /proc/%d/stat", pid);