Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Linux - Kernel This forum is for all discussion relating to the Linux kernel.


  Search this Thread
Old 08-17-2009, 01:28 AM   #1
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.


Old 08-17-2009, 02:31 AM   #2
Senior Member
Registered: Jan 2005
Location: Melbourne, Australia
Distribution: Debian Stretch (Fluxbox WM)
Posts: 1,389
Blog Entries: 52

Rep: Reputation: 355Reputation: 355Reputation: 355Reputation: 355
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 02:32 AM.
Old 08-17-2009, 09:21 PM   #3
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.


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

All times are GMT -5. The time now is 11:51 PM.

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