public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* division and cpu usage
@ 2007-08-23 23:43 Luka Napotnik
  2007-08-24  1:04 ` David Schwartz
  2007-08-24 11:34 ` linux-os (Dick Johnson)
  0 siblings, 2 replies; 9+ messages in thread
From: Luka Napotnik @ 2007-08-23 23:43 UTC (permalink / raw)
  To: linux-kernel

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2007-08-28 12:11 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-23 23:43 division and cpu usage Luka Napotnik
2007-08-24  1:04 ` David Schwartz
2007-08-24 11:34 ` linux-os (Dick Johnson)
2007-08-24 12:46   ` Jan Engelhardt
2007-08-25 23:25     ` Luka Napotnik
2007-08-27 22:07     ` Luka Napotnik
2007-08-28  6:45       ` Jan Engelhardt
2007-08-28 10:41         ` Luka Napotnik
2007-08-28 12:11           ` Jan Engelhardt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox