svn commit: r248949 - stable/9/sys/cddl/dev/fbt

Andriy Gapon avg at FreeBSD.org
Sun Mar 31 14:10:20 UTC 2013


Author: avg
Date: Sun Mar 31 14:10:19 2013
New Revision: 248949
URL: http://svnweb.freebsd.org/changeset/base/248949

Log:
  MFC r248642: fbt_getargdesc: correctly handle types for return probes

Modified:
  stable/9/sys/cddl/dev/fbt/fbt.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/cddl/dev/fbt/fbt.c
==============================================================================
--- stable/9/sys/cddl/dev/fbt/fbt.c	Sun Mar 31 14:02:43 2013	(r248948)
+++ stable/9/sys/cddl/dev/fbt/fbt.c	Sun Mar 31 14:10:19 2013	(r248949)
@@ -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;


More information about the svn-src-all mailing list