how can I save process histroy

Reply

Join Date: Oct 2009
Posts: 2
Reputation: ham130489 is an unknown quantity at this point 
Solved Threads: 0
ham130489 ham130489 is offline Offline
Newbie Poster

how can I save process histroy

 
0
  #1
27 Days Ago
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.
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 354
Reputation: gerard4143 is on a distinguished road 
Solved Threads: 44
gerard4143's Avatar
gerard4143 gerard4143 is online now Online
Posting Whiz
 
0
  #2
27 Days Ago
Originally Posted by ham130489 View 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.
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; 27 Days Ago at 5:08 pm.
Reply With Quote Quick reply to this message  
Join Date: Oct 2009
Posts: 2
Reputation: ham130489 is an unknown quantity at this point 
Solved Threads: 0
ham130489 ham130489 is offline Offline
Newbie Poster
 
0
  #3
26 Days Ago
Originally Posted by gerard4143 View Post
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.
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 354
Reputation: gerard4143 is on a distinguished road 
Solved Threads: 44
gerard4143's Avatar
gerard4143 gerard4143 is online now Online
Posting Whiz
 
0
  #4
26 Days Ago
Originally Posted by ham130489 View Post
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; 26 Days Ago at 12:32 pm.
Reply With Quote Quick reply to this message  
Reply

Tags
file, kernel, linux, open, process

Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC