lkml.org 
[lkml]   [2007]   [Aug]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectdivision and cpu usage
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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-08-24 01:47    [W:0.048 / U:0.280 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site