Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 06-08-2011, 04:30 PM   #1
LQ Newbie
Registered: Jun 2011
Posts: 8

Rep: Reputation: Disabled
find out how much time an already running process is spending in user and kernel spac

Good evening,

I am currently struggling with one of my tasks.
I was asked to find a way how to determine how much time an _already running_ process is spending in user and kernel space.

E.G. <some tool> <pid>
[Control] + [c]

<pid> spent 12.1 seconds in user and 1.52 seconds in kernel space.

Does something like this exist? Basically I guess I am looking for something similar to time, except that the process is already running.

a) Is there a tool which fulfills this task?
b) Is there a way to write your own software which does the job? Is it even possible to code something I am looking for?

I recently found strace -c -p <pid>, but well, this is not exactly what I was looking for.

Any reply is highly appreciated.

Best regards,
Old 06-08-2011, 04:42 PM   #2
LQ Newbie
Registered: May 2011
Distribution: Arch Linux
Posts: 25

Rep: Reputation: 13
I'm not sure exactly what you want, but check out the 'time' command which takes programs as argument and displays elapsed time.
Old 06-08-2011, 04:56 PM   #3
LQ Newbie
Registered: Jun 2011
Posts: 8

Original Poster
Rep: Reputation: Disabled
I am looking for a possibility to use something like "time" for processes which are already running.

Like using "time" on a running slapd.

time only offers the possibility to track the stats for new processes, but not for running ones.
Old 07-05-2011, 02:58 PM   #4
LQ Newbie
Registered: Jun 2011
Posts: 8

Original Poster
Rep: Reputation: Disabled
Any help would be highly appreciated. I need to find out how much time a process spends in user/kernel space, but the command was not startet with "time".


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
how do i get the values for the user time and system time for a process. aloktiagi Linux - Newbie 3 08-04-2009 06:55 PM
Running a process at boot time under a regular user account geek.ksa Linux - Newbie 3 07-06-2009 02:31 PM
Real running time of process soosho Programming 17 07-05-2008 01:16 PM
Running time active process js_valencia Linux - General 6 02-15-2006 10:14 AM
I think I've been spending too much time installing packages Linus VanPelt General 4 04-07-2003 09:05 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:19 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration