Re: Good design to expose debug info from kernel module

2015-03-30 Thread Gilboa Davara
On Thu, Mar 26, 2015 at 11:36 PM, Elazar Leibovich wrote: > Hi, > > I'm writing a kernel module, and I want to expose some debug > information about it. > > The debug information is often of the form of request-response. > > For example: > > - Hey module, what's up with data at 0xe8ff0040c000?

Re: Good design to expose debug info from kernel module

2015-03-30 Thread Elazar Leibovich
Sounds good, thanks (although it'll be harder to use from non-C programs). Do you have a good idea how to stream information as a response to ioctl? On Mon, Mar 30, 2015 at 3:31 PM, Gilboa Davara wrote: > On Thu, Mar 26, 2015 at 11:36 PM, Elazar Leibovich > wrote: > > Hi, > > > > I'm writing a

Re: Good design to expose debug info from kernel module

2015-03-30 Thread Gilboa Davara
On Mon, Mar 30, 2015 at 3:44 PM, Elazar Leibovich wrote: > Sounds good, thanks (although it'll be harder to use from non-C programs). I usually complement each kernel module with a user-mode C library wrapped inside a nice / easy to use (...) C++ class that handles the "difficult bits". It far ea

Re: Good design to expose debug info from kernel module

2015-03-30 Thread Elazar Leibovich
And this is exactly my debate. On the one hand, using protobuf (or flatbuffers, or cap'nproto, or JSON, or msgpack, or whatever standard serialization format) has its share of complexity. You have to find the end of the struct, you have to have a parser both in kernel and in userspace, etc. On th