-   Linux - Kernel (
-   -   /proc output max length (

IshmaelMD 08-21-2013 07:29 PM

/proc output max length
Is there a maximum size limit to the number of bytes I can print through a file in /proc directory ?

I created an entry under /proc. I am trying to display some driver data there but there are quite a few data to display. The display gets cut at ~80% so I was wondering if there is an upper limit on number of bytes that can be displayed in /proc that anyone knows of and if there is a way around it.


sundialsvcs 08-22-2013 11:48 AM

I would suggest that you ought to further refine your /proc interface, so that the requesting programs can be more specific as to what they are asking for, or can ask for a subset of it (in the flavor of MySQL's LIMIT verb). Don't give the requesting program indigestion ... and don't consume an unnecessary amount of kernel memory preparing the response to any given request.

For example, if I want to "find out about all the processes in the system," one request gives me a set of PIDs. Then, by looping through that list, my program can individually request information about each PID and in so doing build up the complete set of information that it requires. But at no point did the kernel have to prepare (nor did the program have to deal with) a huge amount of data.

IshmaelMD 08-22-2013 12:00 PM

To elaborate further, I need to display spectrum information of 4 chains in the wireless device. Each chain displays 256 words. This is what I am trying to display in /proc/spectrum and am not able to display all. I split it into /proc/spectrum/chain1,2 etc. But when the sample size is higher, I can't think of any other way of displaying them except further subdividing the proc folder.
Other than /proc, is mmap perhaps the only way to make this available to user space upon request ?

Thanks. Appreciate the replies.

All times are GMT -5. The time now is 05:47 AM.