Re: regarding sys_read

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Nov 08, 2001 at 09:54:48AM +0530, kannan ram wrote:
>       I want to trace the reading file of the user .I redircted the originel 
> sys_read through another function.In that function I just used one printk 
> statement to notify the redirction.When the module is inserted ,the message 
> is diplayed continuosly.What went wrong? is it possible to find the users 
> reading thru modules apart from strace.Thank u in advance for ur kind help.

Kannan, depending upon what sort of read information you want, you may
need to hook many more locations. If you are just after the sys_read
stuff, well, it *is* called often. You might like to change your code to
increment a variable, and print the value of the variable every 1000
times sys_read is called, or something similar, perhaps just to see what
sort of differences 

Note that in a typical kernel compile, get_write_access is called
roughly 1.3 million times. sys_read gets called every time a process
wants keyboard input, needs to read from a file, a pipe, etc.. so, I
would expect sys_read to be called often.. :)

(Note that if you want to catch *all* reads, you might as well consider
many pieces of files read if the process does a mmap on the file.. :)

-- 
The Bill of Rights: 7 out of 10 rights haven't been sold yet! Contact
your congressman for details how *you* can buy one today!
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
IRC Channel:   irc.openprojects.net / #kernelnewbies
Web Page:      http://www.kernelnewbies.org/



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux