getrusage() doesn't give time info of threads created by kernel_thread

This is a discussion on getrusage() doesn't give time info of threads created by kernel_thread within the Linux Programming forums, part of the Platform Specific Boards category; I am facing a problem with getrusage(). I was trying to get the time taken by a device driver for ...

  1. #1
    Registered User
    Join Date
    Apr 2008
    Posts
    1

    getrusage() doesn't give time info of threads created by kernel_thread

    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.

  2. #2
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    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.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  3. #3
    Captain Crash brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,243
    Quote Originally Posted by surenp View Post
    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.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 5
    Last Post: 03-05-2003, 02:28 PM
  2. I apologize. Good bye.
    By doubleanti in forum A Brief History of Cprogramming.com
    Replies: 14
    Last Post: 05-03-2002, 06:51 PM
  3. give user time to read messages
    By Shadow in forum C Programming
    Replies: 2
    Last Post: 04-21-2002, 12:54 AM
  4. Is this really true or it's just science fiction?
    By Nutshell in forum A Brief History of Cprogramming.com
    Replies: 145
    Last Post: 04-09-2002, 06:17 PM
  5. time class
    By Unregistered in forum C++ Programming
    Replies: 1
    Last Post: 12-11-2001, 09:12 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21