This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
RE: src/tapset ChangeLog nfs.stp
Wenji Huang wrote:
> Stone,
>
> Yes, It is more safe to duplicate this function with kread. It
> returns same result as kernel iov_length. And in case of bad
> pointer/nr_segs, there is kernel read fault error. Please review
> it.
>
> function __iov_length:long(iov:long, nr_segs:long) %{ /*pure*/
> unsigned long seg; size_t ret = 0; const struct iovec *iov =
> (const struct iovec *) (long) THIS->iov; unsigned long
> nr_segs = (unsigned long) THIS->nr_segs;
>
> for (seg = 0; seg < nr_segs; seg++)
> ret += kread(&(iov[seg].iov_len));
>
> THIS->__retvalue = (long) ret;
> CATCH_DEREF_FAULT();
> %}
>
> Thanks,
> Wenji,
That looks great, thank you.
Josh