Re: Strange behavior for create_proc_read_entry

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

 



On Fri, Jun 18, 2010 at 11:16:29PM +0530, Prashant Shah wrote:
> Hi,
> 
> Below is a small module that I was trying out (code at the end of message)
> 
> This module creates a file called /proc/jiffies that adds a message to
> the log file using printk and shows the current jiffies value to the
> user when it is read.
> 
> If I cat the /proc/jiffies file once, in the dmesg log there are three
> entries. The function create_proc_read_entry() is calling the
> my_proc_read() thrice.
> 
> o/p :
> [  997.261195] ******** Reading jiffies files *********
> [  997.261205] ******** Reading jiffies files *********
> [  997.261233] ******** Reading jiffies files *********

Try running 'strace cat /proc/jiffies'.  I wouldn't be surprised if cat
is reading the file more than once.

-- 
Matthew Wilcox				Intel Open Source Technology Centre
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux