06-11-2002
Process Run time information
Hello,
I am working on Sun Solaris 5.7. I am trying to read the running time of a process through a C program.
One way I am reading it is by using the command ps -<pid> -f
The other way is from the struct psinfo_t which is there under /proc/pid/psinfo.
However, the two times are different. The time read from the shell using ps -<pid> -f appears to be more realistic.
Can someone please tell me which one to rely on ?
regards,
Murali
10 More Discussions You Might Find Interesting
1. Programming
Hello,
Can anybody please tell me how to get the time for which the thread has run in Solaris 5.7.
I am trying to read from /proc/pid/lwp/lwpsinfo. However, I am getting only the start time and not the run time.
I am using pthreads. Also, Is there a way to get the used stack size for the... (0 Replies)
Discussion started by: hmurali
0 Replies
2. Shell Programming and Scripting
hi all!
i want to run a process in certain date and hour (like feb 2007 ,hour 3 p.m)
how shell i write it
my script call cs-update-pr
another question :as the script running, will i see it as process ?ho does it run
background? and if not - how can i define to him to run background?
thanks... (3 Replies)
Discussion started by: naamas03
3 Replies
3. UNIX for Dummies Questions & Answers
What sort of statistical information related to a running process can we retrieve using commands? For example, we can get the process id, memory usage and running time of a process using the commands ps and ipcs . Can we get any more information about a running process?
Please list them. Also... (4 Replies)
Discussion started by: fermisoft
4 Replies
4. Shell Programming and Scripting
Hello guys,
Look what im doing:
I need to run a process from a SERVER1 to SERVER2, SERVER3 and SERVER4.
The shell of the process is in each SERVER (2 to 4)
So from SERVER1 i do:
for i in SERVER2 SERVER3 SERVER4
do
rsh $i '
./process.sh
'
done
The problem is: each process.sh... (2 Replies)
Discussion started by: lestat_ecuador
2 Replies
5. UNIX for Dummies Questions & Answers
how to decrease priority of a particular process in time of process creation...
and also how to decrease priority of a particular process after process creation..
can any one please help me out... (2 Replies)
Discussion started by: Ramkum
2 Replies
6. Programming
hello everybody!!
i want ur help! it is urgent!!
...
pid=fork();
if(pid==0)
{
execl(a program);
exit(1);}
else if (pid>0)
{
timer(5); //(command 1)timer is a function that count up to 5sec
if(kill(pid,0)==0)kill(pid,9);//(command 2)
wait(&status);
....
}
else
perror("error");... (3 Replies)
Discussion started by: nicos
3 Replies
7. UNIX for Dummies Questions & Answers
Hi,
I need execute a script every 30 minutes. As might be done without using cron
Thx. (6 Replies)
Discussion started by: pepeli30
6 Replies
8. Shell Programming and Scripting
Hello All,
I have a problem calculating the time difference between start and end timings...!
the timings are given by 24hr format..
Start Date : 08/05/10 12:55
End Date : 08/09/10 06:50
above values are in mm/dd/yy hh:mm format.
Now the thing is, 7th(08/07/10) and... (16 Replies)
Discussion started by: smarty86
16 Replies
9. Shell Programming and Scripting
get email notification from from system when a process from XXXX user takes longer than 15 min run.Let me know the time estimation for the same.
hi ,any one please tell me , how to write a script to get email notification from system when a process from as mentioned above a xxxx user takes... (1 Reply)
Discussion started by: kirankrishna3
1 Replies
10. UNIX for Dummies Questions & Answers
I have many command is list in the variable lists,each command will run a very long time, so I want to run 5 commands at the same time with process till it complete run all the command,
lists="aa bb cc dd xx gg blabla zz ......." ( a very long list)
can some one point me the codes?
... (7 Replies)
Discussion started by: yanglei_fage
7 Replies
pargs(1) User Commands pargs(1)
NAME
pargs - print process arguments, environment variables, or auxiliary vector
SYNOPSIS
pargs [-aceFlx] [pid | core] ...
DESCRIPTION
The pargs utility examines a target process or process core file and prints arguments, environment variables and values, or the process
auxiliary vector.
pargs outputs unprintable characters as escaped octal in the format xxx, unless the character is one of the characters specified in the
"Escape Sequences" section of formats(5), in which case the character is printed as specified in that section.
pargs attempts to be sensitive to the locale of the target process. If the target process and the pargs process do not share a common char-
acter encoding, pargs attempts to employ the iconv(3C) facility to generate a printable version of the extracted strings. In the event
that such a conversion is impossible, strings are displayed as 7-bit ASCII.
OPTIONS
The following options are supported:
-a Prints process arguments as contained in argv[] (default).
-c Treats strings in the target process as though they were encoded in 7-bit ASCII, regardless of the locale of the target. The use
of iconv(3C) is suppressed.
-e Prints process environment variables and values as pointed at by the _environ symbol or by pr_envp in /proc/pid/psinfo.
-F Force. Grabs the target process even if another process has control.
-l Displays the arguments as a single command line. The command line is printed in a manner suitable for interpretation by /bin/sh.
If the arguments contain unprintable characters, or if the target process is in a different locale, a warning message is dis-
played. The resulting command line may not be interpreted correctly by /bin/sh.
-x Prints process auxiliary vector.
OPERANDS
The following operands are supported:
pid Process ID list.
core Process core file.
EXIT STATUS
The following exit values are returned:
0 Successful operation.
non-zero An error has occurred (such as no such process, permission denied, or invalid option).
FILES
/proc/pid/* Process information and control files.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWesu |
+-----------------------------+-----------------------------+
|Interface Stability |Evolving |
+-----------------------------+-----------------------------+
SEE ALSO
proc(1), iconv(3C), proc(4), ascii(5), attributes(5), environ(5), formats(5)
SunOS 5.10 13 Apr 2004 pargs(1)