We're a community of 1.1M IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,080,445 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

how can I save process histroy

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.

2
Contributors
3
Replies
20 Hours
Discussion Span
3 Years Ago
Last Updated
4
Views
ham130489
Newbie Poster
2 posts since Oct 2009
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

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

gerard4143
Nearly a Posting Maven
2,295 posts since Jan 2008
Reputation Points: 512
Solved Threads: 397
Skill Endorsements: 0

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.

ham130489
Newbie Poster
2 posts since Oct 2009
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

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...

gerard4143
Nearly a Posting Maven
2,295 posts since Jan 2008
Reputation Points: 512
Solved Threads: 397
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page generated in 0.0617 seconds using 2.66MB