Use seconds instead of centiseconds as unit for $pid_time_kernelmode, $pid_time_userm...
authorNikolas Garofil <garo@dunaldi.garofil.be>
Mon, 16 Nov 2009 15:59:41 +0000 (16:59 +0100)
committerNikolas Garofil <garo@dunaldi.garofil.be>
Mon, 16 Nov 2009 15:59:41 +0000 (16:59 +0100)
doc/variables.xml
src/proc.c

index a3372af..b4c8343 100644 (file)
             </command>
             <option>pid</option>
         </term>
-        <listitem>Amount of time that the process has been scheduled in user mode
+        <listitem>Amount of time that the process has been scheduled in user mode in seconds
         <para /></listitem>
     </varlistentry>
     <varlistentry>
             </command>
             <option>pid</option>
         </term>
-        <listitem>Amount of time that the process has been scheduled in user mode
+        <listitem>Amount of time that the process has been scheduled in user mode in seconds
         <para /></listitem>
     </varlistentry>
     <varlistentry>
index ada0b46..7f64cdc 100644 (file)
@@ -478,7 +478,7 @@ void print_pid_time_kernelmode(struct text_object *obj, char *p, int p_max_size)
        buf = readfile(obj->data.s, &bytes_read, 1);
        if(buf != NULL) {
                sscanf(buf, "%*d %*s %*c %*d %*d %*d %*d %*d %*u %*u %*u %*u %*u %lu", &umtime);
-               snprintf(p, p_max_size, "%lu", umtime);
+               snprintf(p, p_max_size, "%.2f", (float) umtime / 100);
                free(buf);
        }
 }
@@ -494,7 +494,7 @@ void print_pid_time_usermode(struct text_object *obj, char *p, int p_max_size) {
        buf = readfile(obj->data.s, &bytes_read, 1);
        if(buf != NULL) {
                sscanf(buf, "%*d %*s %*c %*d %*d %*d %*d %*d %*u %*u %*u %*u %*u %*u %lu", &kmtime);
-               snprintf(p, p_max_size, "%lu", kmtime);
+               snprintf(p, p_max_size, "%.2f", (float) kmtime / 100);
                free(buf);
        }
 }
@@ -510,7 +510,7 @@ void print_pid_time(struct text_object *obj, char *p, int p_max_size) {
        buf = readfile(obj->data.s, &bytes_read, 1);
        if(buf != NULL) {
                sscanf(buf, "%*d %*s %*c %*d %*d %*d %*d %*d %*u %*u %*u %*u %*u %lu %lu", &umtime, &kmtime);
-               snprintf(p, p_max_size, "%lu", umtime + kmtime);
+               snprintf(p, p_max_size, "%.2f", (float) (umtime + kmtime) / 100);
                free(buf);
        }
 }