This is the mail archive of the
systemtap@sources.redhat.com
mailing list for the systemtap project.
Re: recent runtime changes
- From: Karim Yaghmour <karim at opersys dot com>
- To: Martin Hunt <hunt at redhat dot com>
- Cc: SystemTAP <systemtap at sources dot redhat dot com>
- Date: Wed, 18 May 2005 15:33:17 -0400
- Subject: Re: recent runtime changes
- Organization: Opersys inc.
- References: <1116397470.5250.26.camel@tiger>
- Reply-to: karim at opersys dot com
Martin Hunt wrote:
> 1. relayfs vs netlink tests. I don't see an easy way to detect when
> relayfs thinks it has lost data, so I'll have to transmit some pattern
> and see if data is missing.
Here's the path from relay_write() in 2.6.12-rc4-mm2:
relay_write(include/linux/relayfs_fs.h)
->relay_switch_subbuf(fs/relayfs/relay.c)
->relay_buf_full(fs/relayfs/relay.c)
If indeed the buffers are full, relay_switch_subbuf returns 0.
The only caveat here, is that relay_write() doesn't return
the quantity that was written to the buffer. It used to be
there, but it was dropped following feedback from Andi Kleen
(http://marc.theaimsgroup.com/?l=linux-kernel&m=110755817702170&w=2).
Basically, Andi doubted relayfs users would handle errors.
Obviously if there is need, we can push the change upstream.
For now, adding a simple "return length" in relay_write() and
__relay_write() (both in include/linux/relayfs_fs.h) should
provide you with what you're looking for.
HTH,
Karim
--
Author, Speaker, Developer, Consultant
Pushing Embedded and Real-Time Linux Systems Beyond the Limits
http://www.opersys.com || karim@opersys.com || 1-866-677-4546