944,158 Members | Top Members by Rank

Ad:
  • C Discussion Thread
  • Unsolved
  • Views: 1455
  • C RSS
Oct 31st, 2009
0

how can I save process histroy

Expand Post »
I am working in Linux 2.14 kernel, and I have an assignment.
I want to save for every process , the files it opens and closes , and the time he did that.
for example :
for process aaa :
opening "file1"
opening "file2"
closing "file1"
opening "file3"
closing "file3"
closing "file2"
I could save a linked-list , the question is where to save that , and how to update it.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
ham130489 is offline Offline
2 posts
since Oct 2009
Oct 31st, 2009
0
Re: how can I save process histroy
Click to Expand / Collapse  Quote originally posted by ham130489 ...
I am working in Linux 2.14 kernel, and I have an assignment.
I want to save for every process , the files it opens and closes , and the time he did that.
for example :
for process aaa :
opening "file1"
opening "file2"
closing "file1"
opening "file3"
closing "file3"
closing "file2"
I could save a linked-list , the question is where to save that , and how to update it.
If its an old kernel then hi-jack the system calls and get then to send some information to the log file...here's an example of hi-jacking a system call

http://www.faqs.org/docs/kernel/x931.html
Last edited by gerard4143; Oct 31st, 2009 at 5:08 pm.
Reputation Points: 499
Solved Threads: 367
Postaholic
gerard4143 is offline Offline
2,198 posts
since Jan 2008
Nov 1st, 2009
0
Re: how can I save process histroy
Click to Expand / Collapse  Quote originally posted by gerard4143 ...
If its an old kernel then hi-jack the system calls and get then to send some information to the log file...here's an example of hi-jacking a system call

http://www.faqs.org/docs/kernel/x931.html
thanks but it doesn't actually helped me.
I will ask you more simple request :
I want to Update the kernel , that if one process wants to open a file , then we print to the screen " process %pid tries to open the file %file"
thanks in advance.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
ham130489 is offline Offline
2 posts
since Oct 2009
Nov 1st, 2009
0
Re: how can I save process histroy
Click to Expand / Collapse  Quote originally posted by ham130489 ...
thanks but it doesn't actually helped me.
I will ask you more simple request :
I want to Update the kernel , that if one process wants to open a file , then we print to the screen " process %pid tries to open the file %file"
thanks in advance.
Well when you hijack the system call make sure it prints a message to the screen when a process opens or closes a file...I'm not sure what your looking for...I gave you a coded example and from that you should be able to get all the info you need...
Last edited by gerard4143; Nov 1st, 2009 at 12:32 pm.
Reputation Points: 499
Solved Threads: 367
Postaholic
gerard4143 is offline Offline
2,198 posts
since Jan 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C Forum Timeline: Calulator
Next Thread in C Forum Timeline: List at least two possible ways for linking against the math library.





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC