Sponsored Content
Full Discussion: Process Run time information
Top Forums Programming Process Run time information Post 22813 by hmurali on Tuesday 11th of June 2002 05:21:16 AM
Old 06-11-2002
Data 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

pthreads run time information

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

how to run process in certain date and time

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

Process information

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

how to run multiple process at the same time

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

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

kill a process which run out of time

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

Run process with nohup every certain time

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

How to calculate time difference between start and end time of a process!

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

script to monitor the process system when a process from user takes longer than 15 min run.

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

To run 5 commands at the same time with process from a list

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
acct(4) 						     Kernel Interfaces Manual							   acct(4)

NAME
acct, acct.h - Accounting include files SYNOPSIS
#include <sys/acct.h> #include <utmp.h> DESCRIPTION
The /usr/include/sys/acct.h header file defines a type acct structure for accounting information used by various accounting files. The information in the acct.h structure is used in records in accounting files having various fixed formats. The various accounting files provide the means to monitor system use and performance and to pass charges to system users. These accounting files also serve as the permanent record of billing information for each process, CPU real time, allocated resources, and services. The acct command is used to produce desired accounting files. The /usr/include/utmp.h header file defines the record format for data written to the /var/adm/wtmp accounting login/logout database file whenever any user logs in or out. The type utmp structure defined in the /usr/include/utmp.h header file has the following members: The user login name listed in the /etc/passwd file. The user identification from the /etc/inittab ID file. The device name (console or tty43, for example). This is a flag that defines the type of entry. The type of entry flag symbolic names are as follows: No valid entry. Run level changed by the init program. Boot time entry, generated by the init program. Used by the date program when the system time is changed. Used by the date program when the system time is changed. Process spawned by the init program. A getty process waiting for login. A user process. Terminated process. Private flag for accounting programs. Process ID number. Process termination status of a process whose ut_type member value is DEAD PROCESS. Process exit status of a process whose ut_type member value is DEAD PROCESS. Time that entry was made. Host machine name. The /usr/include/sys/acct.h header file defines the record format for the data written to the process accounting database file when a process completes. The type acct structure defined in the acct.h header file contains the following members: An accounting flag for the process for which the accounting record is written. The accounting flag symbolic names are as follows: The process has been created using a fork() system call, but an exec() system call has not yet concluded. The exec() system call resets the AFORK flag. The ASU Command was run with an effective user-id of 0. Dumped core. Process killed by a signal. Exit status. A flag that indicates how the process terminated. The user ID of the process for which the accounting record is written. The group ID of the process for which the accounting record is written. The terminal from which the process was started. Beginning time. The time at which the process began. The amount of user time (in a compressed format) used by the process. The amount of system time (in a compressed format) used by the process. The amount of elapsed time (in a compressed format) since the command ran. The average amount of memory in units of 8KB that is used by the process. The number of characters (in a compressed format) transferred by the process. The number of blocks (in a compressed format) read or writ- ten by the process. The name of the command that was used to start the process. A child process created by a fork() system call receives up to 8 bytes from the parent process. An exec() system call changes the name in this field. Compressed data, which is a condensed floating-point representation, may be expanded to normal floating point by using the expacct() rou- tine. The type tacct structure, which is not a part of the /usr/include/utmp.h or the /usr/include/sys/acct.h header file definitions, is defined in a private tacct.h header file. The type tacct structure members define a format for storage of all information available from both the /var/adm/wtmp login/logoff and /var/adm/pacct process accounting databases, whose members are used by various accounting commands to pro- duce an output file to be used in an accounting report (see the acctmerg command). Members of the type tacct structure whose data types are specified as an array of two double elements have both prime-time and non-prime time values. The type tacct structure has the following members: User ID. A field for the login name having the same number of characters NSZ as the ut_user member of the utmp structure. Cumu- lative CPU time in minutes. Cumulative Kcore minutes. Cumulative number of characters transferred in blocks of 512 bytes. Cumulative number of blocks read and written. Cumulative connect time in minutes. Cumulative disk usage time in minutes. Queueing system (printer) fee in number of pages. Special services fee. A count of the number of processes. A count of the number of login sessions. A count of the number of disk samples. FILES
Accounting header files that define formats for writing accounting files. The active login/logoff database file. The active process accounting database file. RELATED INFORMATION
Commands: acct(8), acctcms(8), acctcom(8), acctcon(8), acctdisk(8), acctmerg(8), acctprc(8), runacct(8), sa(8). Functions: acct(2), fork(2), exec(2), expacct(3). delim off acct(4)
All times are GMT -4. The time now is 01:58 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy