PERFORCE change 142346 for review
John Birrell
jb at FreeBSD.org
Tue May 27 03:29:09 UTC 2008
http://perforce.freebsd.org/chv.cgi?CH=142346
Change 142346 by jb at freebsd3 on 2008/05/27 03:28:59
Add the definitions for the dtmalloc provider.
Affected files ...
.. //depot/projects/dtrace7/src/sys/sys/malloc.h#2 edit
Differences ...
==== //depot/projects/dtrace7/src/sys/sys/malloc.h#2 (text+ko) ====
@@ -29,7 +29,7 @@
* SUCH DAMAGE.
*
* @(#)malloc.h 8.5 (Berkeley) 5/3/95
- * $FreeBSD: src/sys/sys/malloc.h,v 1.83 2005/12/30 11:45:07 pjd Exp $
+ * $FreeBSD: src/sys/sys/malloc.h,v 1.85 2008/05/23 00:43:35 jb Exp $
*/
#ifndef _SYS_MALLOC_H_
@@ -80,7 +80,16 @@
uint64_t _mts_reserved3; /* Reserved field. */
};
+/*
+ * Index definitions for the mti_probes[] array.
+ */
+#define DTMALLOC_PROBE_MALLOC 0
+#define DTMALLOC_PROBE_FREE 1
+#define DTMALLOC_PROBE_MAX 2
+
struct malloc_type_internal {
+ uint32_t mti_probes[DTMALLOC_PROBE_MAX];
+ /* DTrace probe ID array. */
struct malloc_type_stats mti_stats[MAXCPU];
};
@@ -173,7 +182,11 @@
extern struct mtx malloc_mtx;
-/* XXX struct malloc_type is unused for contig*(). */
+/*
+ * Function type used when iterating over the list of malloc types.
+ */
+typedef void malloc_type_list_func_t(struct malloc_type *, void *);
+
void contigfree(void *addr, unsigned long size, struct malloc_type *type);
void *contigmalloc(unsigned long size, struct malloc_type *type, int flags,
vm_paddr_t low, vm_paddr_t high, unsigned long alignment,
@@ -184,6 +197,7 @@
int malloc_last_fail(void);
void malloc_type_allocated(struct malloc_type *type, unsigned long size);
void malloc_type_freed(struct malloc_type *type, unsigned long size);
+void malloc_type_list(malloc_type_list_func_t *, void *);
void malloc_uninit(void *);
void *realloc(void *addr, unsigned long size, struct malloc_type *type,
int flags);
More information about the p4-projects
mailing list