Date: Sat, 23 Mar 2013 08:52:51 +0000 (UTC) From: Andriy Gapon <avg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r248642 - head/sys/cddl/dev/fbt Message-ID: <201303230852.r2N8qpq7057947@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: avg Date: Sat Mar 23 08:52:50 2013 New Revision: 248642 URL: http://svnweb.freebsd.org/changeset/base/248642 Log: fbt_getargdesc: correctly handle types for return probes MFC after: 6 days Modified: head/sys/cddl/dev/fbt/fbt.c Modified: head/sys/cddl/dev/fbt/fbt.c ============================================================================== --- head/sys/cddl/dev/fbt/fbt.c Sat Mar 23 08:50:56 2013 (r248641) +++ head/sys/cddl/dev/fbt/fbt.c Sat Mar 23 08:52:50 2013 (r248642) @@ -1260,6 +1260,11 @@ fbt_getargdesc(void *arg __unused, dtrac uint32_t offset; ushort_t info, kind, n; + if (fbt->fbtp_roffset != 0 && desc->dtargd_ndx == 0) { + (void) strcpy(desc->dtargd_native, "int"); + return; + } + desc->dtargd_ndx = DTRACE_ARGNONE; /* Get a pointer to the CTF data and it's length. */ @@ -1310,12 +1315,19 @@ fbt_getargdesc(void *arg __unused, dtrac return; } - /* Check if the requested argument doesn't exist. */ - if (ndx >= n) - return; + if (fbt->fbtp_roffset != 0) { + /* Only return type is available for args[1] in return probe. */ + if (ndx > 1) + return; + ASSERT(ndx == 1); + } else { + /* Check if the requested argument doesn't exist. */ + if (ndx >= n) + return; - /* Skip the return type and arguments up to the one requested. */ - dp += ndx + 1; + /* Skip the return type and arguments up to the one requested. */ + dp += ndx + 1; + } if (fbt_type_name(&lc, *dp, desc->dtargd_native, sizeof(desc->dtargd_native)) > 0) desc->dtargd_ndx = ndx;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201303230852.r2N8qpq7057947>