mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* How to export information larger than PROC_BLOCK_SIZE via /proc file system?
@ 2011-04-27  0:54 Jidong Xiao
  2011-04-27  3:00 ` Américo Wang
  0 siblings, 1 reply; 4+ messages in thread
From: Jidong Xiao @ 2011-04-27  0:54 UTC (permalink / raw)
  To: Kernel development list

Hi,

I am tracing some data inside the kernel, and I plan to export the
tracing data through /proc file system. I created a file under /proc
file system, and I use cat to display the tracing data. However, every
time there is only 3072 bytes data displayed, which is the size
defined by PROC_BLOCK_SIZE. And I wonder that how to export
information more than that limit? Judging from the function
fs/proc/generic.c/proc_file_read(), if the size returned by my
read_proc function is large than a PAGE_SIZE, then I will get a
KERN_ERR message which says "proc_file_read: Apparent buffer
overflow!". Any help would be appreciated!

Regards
Jidong

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How to export information larger than PROC_BLOCK_SIZE via /proc file system?
  2011-04-27  0:54 How to export information larger than PROC_BLOCK_SIZE via /proc file system? Jidong Xiao
@ 2011-04-27  3:00 ` Américo Wang
  2011-04-27  3:18   ` Alexey Dobriyan
  0 siblings, 1 reply; 4+ messages in thread
From: Américo Wang @ 2011-04-27  3:00 UTC (permalink / raw)
  To: Jidong Xiao; +Cc: Kernel development list

On Wed, Apr 27, 2011 at 8:54 AM, Jidong Xiao <jidong.xiao@gmail.com> wrote:
> Hi,
>
> I am tracing some data inside the kernel, and I plan to export the
> tracing data through /proc file system. I created a file under /proc
> file system, and I use cat to display the tracing data. However, every
> time there is only 3072 bytes data displayed, which is the size
> defined by PROC_BLOCK_SIZE. And I wonder that how to export
> information more than that limit? Judging from the function
> fs/proc/generic.c/proc_file_read(), if the size returned by my
> read_proc function is large than a PAGE_SIZE, then I will get a
> KERN_ERR message which says "proc_file_read: Apparent buffer
> overflow!". Any help would be appreciated!
>

Why not switch to use debugfs?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How to export information larger than PROC_BLOCK_SIZE via /proc file system?
  2011-04-27  3:00 ` Américo Wang
@ 2011-04-27  3:18   ` Alexey Dobriyan
  2011-04-27  4:16     ` Jidong Xiao
  0 siblings, 1 reply; 4+ messages in thread
From: Alexey Dobriyan @ 2011-04-27  3:18 UTC (permalink / raw)
  To: Am??rico Wang; +Cc: Jidong Xiao, Kernel development list

On Wed, Apr 27, 2011 at 11:00:32AM +0800, Am??rico Wang wrote:
> On Wed, Apr 27, 2011 at 8:54 AM, Jidong Xiao <jidong.xiao@gmail.com> wrote:
> > Hi,
> >
> > I am tracing some data inside the kernel, and I plan to export the
> > tracing data through /proc file system. I created a file under /proc
> > file system, and I use cat to display the tracing data. However, every
> > time there is only 3072 bytes data displayed, which is the size
> > defined by PROC_BLOCK_SIZE. And I wonder that how to export
> > information more than that limit? Judging from the function
> > fs/proc/generic.c/proc_file_read(), if the size returned by my
> > read_proc function is large than a PAGE_SIZE, then I will get a
> > KERN_ERR message which says "proc_file_read: Apparent buffer
> > overflow!". Any help would be appreciated!
> >
> 
> Why not switch to use debugfs?

Or use seq_file/proc_create.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How to export information larger than PROC_BLOCK_SIZE via /proc file system?
  2011-04-27  3:18   ` Alexey Dobriyan
@ 2011-04-27  4:16     ` Jidong Xiao
  0 siblings, 0 replies; 4+ messages in thread
From: Jidong Xiao @ 2011-04-27  4:16 UTC (permalink / raw)
  To: Alexey Dobriyan; +Cc: Am??rico Wang, Kernel development list

On Tue, Apr 26, 2011 at 11:18 PM, Alexey Dobriyan <adobriyan@gmail.com> wrote:
> On Wed, Apr 27, 2011 at 11:00:32AM +0800, Am??rico Wang wrote:
>> On Wed, Apr 27, 2011 at 8:54 AM, Jidong Xiao <jidong.xiao@gmail.com> wrote:
>> > Hi,
>> >
>> > I am tracing some data inside the kernel, and I plan to export the
>> > tracing data through /proc file system. I created a file under /proc
>> > file system, and I use cat to display the tracing data. However, every
>> > time there is only 3072 bytes data displayed, which is the size
>> > defined by PROC_BLOCK_SIZE. And I wonder that how to export
>> > information more than that limit? Judging from the function
>> > fs/proc/generic.c/proc_file_read(), if the size returned by my
>> > read_proc function is large than a PAGE_SIZE, then I will get a
>> > KERN_ERR message which says "proc_file_read: Apparent buffer
>> > overflow!". Any help would be appreciated!
>> >
>>
>> Why not switch to use debugfs?
>
> Or use seq_file/proc_create.
>

Oh, thank you two very much. After reading the related document, I
feel seq_file is exactly what I am looking for.

Regards
Jidong

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-04-27  4:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-27  0:54 How to export information larger than PROC_BLOCK_SIZE via /proc file system? Jidong Xiao
2011-04-27  3:00 ` Américo Wang
2011-04-27  3:18   ` Alexey Dobriyan
2011-04-27  4:16     ` Jidong Xiao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®