division and cpu usage
From: Luka Napotnik
Date: Thu Aug 23 2007 - 19:43:49 EST
Hello.
I'm new to kernel development and have some questions.
1. Why can't I divide with regular casting to double ((double)a /
(double)b)? It gives me strange errors when compiling:
WARNING: "__divdf3" [/root....] undefined!
WARNING: "__addf3" [/root/...] undefined!
WARNING: "__floatsidf" [/root/...] undefined!
And if I compile with normal integers, I get zero as the result.
2. I'm trying to get the percentage of CPU used for a certain
task_struct and figured the following formula:
(task->utime + task->stime) / jiffies
Before calculating I convert all the variables to jiffies. Is this correct?
Please help.
Greets,
Lukla
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/