diff --git a/src/task-manager-linux.c b/src/task-manager-linux.c index 4782037..df50209 100644 --- a/src/task-manager-linux.c +++ b/src/task-manager-linux.c @@ -147,11 +147,11 @@ get_task_cmdline (Task *task) } static void -get_cpu_percent (guint pid, gulong jiffles_user, gfloat *cpu_user, gulong jiffles_system, gfloat *cpu_system) +get_cpu_percent (guint pid, gulong jiffies_user, gfloat *cpu_user, gulong jiffies_system, gfloat *cpu_system) { static GHashTable *hash_cpu_user = NULL; static GHashTable *hash_cpu_system = NULL; - gulong jiffles_user_old, jiffles_system_old; + gulong jiffies_user_old, jiffies_system_old; if (hash_cpu_user == NULL) { @@ -159,15 +159,15 @@ get_cpu_percent (guint pid, gulong jiffles_user, gfloat *cpu_user, gulong jiffle hash_cpu_system = g_hash_table_new (NULL, NULL); } - jiffles_user_old = GPOINTER_TO_UINT (g_hash_table_lookup (hash_cpu_user, GUINT_TO_POINTER (pid))); - jiffles_system_old = GPOINTER_TO_UINT (g_hash_table_lookup (hash_cpu_system, GUINT_TO_POINTER (pid))); - g_hash_table_insert (hash_user, GUINT_TO_POINTER (pid), GUINT_TO_POINTER (jiffles_cpu_user)); - g_hash_table_insert (hash_system, GUINT_TO_POINTER (pid), GUINT_TO_POINTER (jiffles_cpu_system)); + jiffies_user_old = GPOINTER_TO_UINT (g_hash_table_lookup (hash_cpu_user, GUINT_TO_POINTER (pid))); + jiffies_system_old = GPOINTER_TO_UINT (g_hash_table_lookup (hash_cpu_system, GUINT_TO_POINTER (pid))); + g_hash_table_insert (hash_user, GUINT_TO_POINTER (pid), GUINT_TO_POINTER (jiffies_cpu_user)); + g_hash_table_insert (hash_system, GUINT_TO_POINTER (pid), GUINT_TO_POINTER (jiffies_cpu_system)); if (_cpu_count > 0) { - *cpu_user = (jiffles_user_old > 0) ? (jiffles_user - jiffles_user_old) / (gfloat)_cpu_count : 0; - *cpu_system = (jiffles_system_old > 0) ? (jiffles_system - jiffles_system_old) / (gfloat)_cpu_count : 0; + *cpu_user = (jiffies_user_old > 0) ? (jiffies_user - jiffies_user_old) / (gfloat)_cpu_count : 0; + *cpu_system = (jiffies_system_old > 0) ? (jiffies_system - jiffies_system_old) / (gfloat)_cpu_count : 0; } else { @@ -192,7 +192,7 @@ get_task_details (guint pid, Task *task) { gchar dummy[255]; gint idummy; - gulong jiffles_user, jiffles_system; + gulong jiffies_user, jiffies_system; struct passwd *pw; struct stat sstat; @@ -212,8 +212,8 @@ get_task_details (guint pid, Task *task) dummy, // cminflt dummy, // majflt dummy, // cmajflt - &jiffles_user, // utime the number of jiffies that this process has scheduled in user mode - &jiffles_system,// stime " system mode + &jiffies_user, // utime the number of jiffies that this process has scheduled in user mode + &jiffies_system,// stime " system mode &idummy, // cutime " waited for children in user mode &idummy, // cstime " system mode @@ -249,7 +249,7 @@ get_task_details (guint pid, Task *task) ); task->rss *= get_pagesize (); - get_cpu_percent (task->pid, jiffles_user, &task->cpu_user, jiffles_system, &task->cpu_system); + get_cpu_percent (task->pid, jiffies_user, &task->cpu_user, jiffies_system, &task->cpu_system); stat (filename, &sstat); pw = getpwuid (sstat.st_uid);