[libgtop] procstate: Fill in last_processor member on linux



commit f99bb61446226ec15f985933463ae0370883d7d0
Author: Florian Müllner <fmuellner gnome org>
Date:   Sun Nov 27 16:11:34 2016 +0100

    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

 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 024acf3..3d6e477 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);


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