LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices

Reply
 
Search this Thread
Old 08-17-2009, 12:28 AM   #1
cyclops.xmen
LQ Newbie
 
Registered: Aug 2009
Posts: 4

Rep: Reputation: 0
A kernel module needs to monitor certain system activities on app launch.


I have an application and a linux kernel module.

When I launch the application, I want the kernel module to monitor certain system activities.

The system activities to be monitored can be very varied, the simplest being measuring the wall clock time for the application run duration.

The monitoring should stop when the application run is over.

What should be a good architectural design for this problem?

Any ideas will be greatly appreciated.

Thanks!

--Cyclops
 
Old 08-17-2009, 01:31 AM   #2
neonsignal
Senior Member
 
Registered: Jan 2005
Location: Melbourne, Australia
Distribution: Debian Wheezy (Fluxbox WM)
Posts: 1,363
Blog Entries: 52

Rep: Reputation: 353Reputation: 353Reputation: 353Reputation: 353
First I would question why the monitor part needs to be a kernel module (unless it does something that is kernel specific, although even then you might find the ptrace facilities provide what you need).

If it is going to be a kernel module, you'd probably want to insert it at the start and remove it at the end. So perhaps you would have a main component, one that inserts the system module, starts the application, waits on the application process to terminate, queries the system module and reports the results (or they could be logged), and then unloads the system module.

Last edited by neonsignal; 08-17-2009 at 01:32 AM.
 
Old 08-17-2009, 08:21 PM   #3
cyclops.xmen
LQ Newbie
 
Registered: Aug 2009
Posts: 4

Original Poster
Rep: Reputation: 0
The module should collect different kernel related statistics, that is why I made it a kernel module.
The way Neonsignal has told, has worked for me!! Thanks a lot for that!
Now my next question is, I want to count the cache misses in the kernel driver for the duration the app is executing. Any pointers on how to calculate cache misses from within the kernel module will be highly appreciated.
 
  


Reply

Tags
kernel, module


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
Check if an app is running and if it's not launch this app Coume Linux - General 3 07-28-2008 02:34 AM
Monitor and Display system setting module bobbyshafter Linux - Newbie 3 06-25-2007 09:54 PM
kcmshell module, Background&Screensaver Module can't be launch (but works @LookNFeeL) bobbyjoe Linux - Software 0 01-08-2005 04:48 AM
Linux app eating up memory according to System Monitor brianvdc Linux - Newbie 1 10-22-2003 01:32 AM
monitor pop3 activities zovres Linux - General 7 09-30-2003 09:19 AM


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

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