getrusage() doesn't give time info of threads created by kernel_thread [Archive] - C Board

PDA

View Full Version : getrusage() doesn't give time info of threads created by kernel_thread


surenp
04-23-2008, 03:50 AM
I am facing a problem with getrusage(). I was trying to get the time taken by a device driver for doing IO. My device driver is using kernel_thread() to create new threads at kernel level. I used RUSAGE_CHILDREN option with getrusage().

I need some help!!!

I tried using fork() to create a child process at user level and get the time taken by child process using RUSAGE_CHILDREN option. It is working fine.

CornedBee
04-23-2008, 03:55 AM
This is a new question, so I split it into its own thread. Here at cboard you shouldn't reuse threads.

I also moved the thread to the Linux forum, since it's not really a C++ problem and more an API problem.

brewbuck
04-23-2008, 09:03 AM
I am facing a problem with getrusage(). I was trying to get the time taken by a device driver for doing IO. My device driver is using kernel_thread() to create new threads at kernel level. I used RUSAGE_CHILDREN option with getrusage().

I need some help!!!

I tried using fork() to create a child process at user level and get the time taken by child process using RUSAGE_CHILDREN option. It is working fine.

I did not think that getrusage() worked on kernel threads.

Even if it did, getrusage() on Linux is completely broken, and nobody has any plans to fix it. It doesn't even remotely do what the man page says it does.