From: Llfrg@aol.com
To: linux-c-programming@vger.kernel.org
Subject: Re: Monitoring a program
Date: Mon, 01 Mar 2004 19:02:30 -0500 [thread overview]
Message-ID: <3878299D.71102FC3.0000FADF@aol.com> (raw)
Yes John, what I am trying to do is quite like your description. Only that instead of a simple program like ls, the target program would be scientific applications that take several seconds/minutes/hours executing, so that I would like to collect statistics periodically (i.e. every 0.1 second) and store it on a log file for future use (in a way similar to the vmstat command). I believe such information is not available after the execution (if it is, even better!). I would like to know ways of doing it with minimal effect on the target application performance.
John wrote:
>
Let me see if I understand what you are trying to do. Lets pretend the
target program is ls.
Whenever ls is run by any user you would like you daemon to store
statistical information about the execution of ls.
You might have to get this information from the kernels process table.
While executing the information you want is available in the procfs, however
when the process completes the information disappears. It has been awhile
since I took my OS class, so I'm not sure if the information is still
available in the kernel's data structures or not. I believe it would be
until another process with the same pid runs, but there is a good chance
that I'm wrong.
Depending on what you are trying to accomplish there may be better/easier
ways to accomplish your goal.
--
John
>
Thanks,
Leonardo
next reply other threads:[~2004-03-02 0:02 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-03-02 0:02 Llfrg [this message]
-- strict thread matches above, loose matches on Subject: below --
2004-03-02 12:12 Monitoring a program Llfrg
[not found] <183D9E9B.3D6733E9.0000FADF@aol.com>
2004-03-02 2:39 ` John T. Williams
2004-03-01 18:22 Llfrg
2004-03-01 21:38 ` John T. Williams
2004-03-01 22:50 ` John T. Williams
2004-03-01 22:34 ` Glynn Clements
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3878299D.71102FC3.0000FADF@aol.com \
--to=llfrg@aol.com \
--cc=linux-c-programming@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).