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

RE: logging data from devices in kernel



Hi

>
>Sounds like you want to support a new device that allows a userland
>program to open(2) and read(2) jiffy values from.  What this do what
>you wanted?
>

I am not really sure. I shall go over what I intend to do in more detail.

What I want is some way of logging device activity. This might be the times at 
which data is sent/received, and/or the exact data that is sent/received.

The whole idea is to have a power manager that can see if a device has been 
inactive for some period of time, and if so, put it in a power-saving mode or 
shut it off. This power manager will be in userland. So, I need a way of 
communicating whatever happened in the device driver, to userland.

So, with this preamble, my idea was just to dump the jiffy values to a file, 
whenever data is sent/received and that should work. But I am not sure how to 
do that or if it is the best way.

Now, if I supported a new device to open and read jiffy values (Well, I have 
to admit, I have no clue how to do that), can I design it such that every 
successive read will give me the jiffy times when data was sent/received?
(Please bear if the question is really dumb!! :))

So, I have two questions:
1) In general, what techniques are used to expose kernel info to userland?
Well, I know /proc filesystem. But otherwise?
2) how do I create a new device and expose the info that I want to?

Thanks in Advance
KAR.

-
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/
IRC Channel:   irc.openprojects.net / #kernelnewbies
Web Page:      http://www.surriel.com/kernelnewbies.shtml