diff options
author | Florian Müllner <fmuellner@gnome.org> | 2016-11-27 16:11:34 +0100 |
---|---|---|
committer | Robert Roth <robert.roth.off@gmail.com> | 2016-11-27 20:07:20 +0200 |
commit | f99bb61446226ec15f985933463ae0370883d7d0 (patch) | |
tree | 845ebcc99f2f394aab4d4826de898b2376b11885 | |
parent | a0166d2844ac05a7650e48c222947fef488d7de6 (diff) | |
download | libgtop-f99bb61446226ec15f985933463ae0370883d7d0.tar.gz |
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
-rw-r--r-- | sysdeps/linux/procstate.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sysdeps/linux/procstate.c b/sysdeps/linux/procstate.c index 024acf38..3d6e477a 100644 --- a/sysdeps/linux/procstate.c +++ b/sysdeps/linux/procstate.c @@ -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); |