Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Feb 2008 21:00:04 GMT
From:      John Birrell <jb@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 135413 for review
Message-ID:  <200802142100.m1EL041g033267@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=135413

Change 135413 by jb@jb_freebsd1 on 2008/02/14 21:00:02

	Fix a silly mistake which blew up the 'free' probe.

Affected files ...

.. //depot/projects/dtrace/src/sys/kern/kern_malloc.c#8 edit

Differences ...

==== //depot/projects/dtrace/src/sys/kern/kern_malloc.c#8 (text+ko) ====

@@ -264,11 +264,13 @@
 		mtsp->mts_size |= 1 << zindx;
 
 #ifdef KDTRACE_HOOKS
-	if (dtrace_malloc_probe != NULL &&
-	    mtip->mti_probes[DTMALLOC_PROBE_MALLOC] != 0)
-		(dtrace_malloc_probe)(mtip->mti_probes[DTMALLOC_PROBE_MALLOC],
-		    (uintptr_t) mtp, (uintptr_t) mtip,
-		    (uintptr_t) mtsp, size, zindx);
+	if (dtrace_malloc_probe != NULL) {
+		uint32_t probe_id = mtip->mti_probes[DTMALLOC_PROBE_MALLOC];
+		if (probe_id != 0)
+			(dtrace_malloc_probe)(probe_id,
+			    (uintptr_t) mtp, (uintptr_t) mtip,
+			    (uintptr_t) mtsp, size, zindx);
+	}
 #endif
 
 	critical_exit();
@@ -301,11 +303,13 @@
 	mtsp->mts_numfrees++;
 
 #ifdef KDTRACE_HOOKS
-	if (dtrace_malloc_probe != NULL &&
-	    mtip->mti_probes[DTMALLOC_PROBE_MALLOC] != 0)
-		(dtrace_malloc_probe)(mtip->mti_probes[DTMALLOC_PROBE_FREE],
-		    (uintptr_t) mtp, (uintptr_t) mtip,
-		    (uintptr_t) mtsp, size, 0);
+	if (dtrace_malloc_probe != NULL) {
+		uint32_t probe_id = mtip->mti_probes[DTMALLOC_PROBE_FREE];
+		if (probe_id != 0)
+			(dtrace_malloc_probe)(probe_id,
+			    (uintptr_t) mtp, (uintptr_t) mtip,
+			    (uintptr_t) mtsp, size, 0);
+	}
 #endif
 
 	critical_exit();



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200802142100.m1EL041g033267>