Add utrace(2)-based tracing (--enable-utrace).

This commit is contained in:
Jason Evans
2012-04-05 13:36:17 -07:00
parent 02b231205e
commit b147611b52
9 changed files with 118 additions and 1 deletions

View File

@@ -36,6 +36,10 @@
#define JEMALLOC_NO_DEMANGLE
#include "../jemalloc@install_suffix@.h"
#ifdef JEMALLOC_UTRACE
#include <sys/ktrace.h>
#endif
#include "jemalloc/internal/private_namespace.h"
#ifdef JEMALLOC_CC_SILENCE
@@ -114,6 +118,13 @@ static const bool config_tls =
false
#endif
;
static const bool config_utrace =
#ifdef JEMALLOC_UTRACE
true
#else
false
#endif
;
static const bool config_xmalloc =
#ifdef JEMALLOC_XMALLOC
true
@@ -332,6 +343,7 @@ typedef struct {
extern bool opt_abort;
extern bool opt_junk;
extern bool opt_utrace;
extern bool opt_xmalloc;
extern bool opt_zero;
extern size_t opt_narenas;

View File

@@ -173,6 +173,7 @@
#define opt_prof_leak JEMALLOC_N(opt_prof_leak)
#define opt_stats_print JEMALLOC_N(opt_stats_print)
#define opt_tcache JEMALLOC_N(opt_tcache)
#define opt_utrace JEMALLOC_N(opt_utrace)
#define opt_xmalloc JEMALLOC_N(opt_xmalloc)
#define opt_zero JEMALLOC_N(opt_zero)
#define pow2_ceil JEMALLOC_N(pow2_ceil)

View File

@@ -154,6 +154,9 @@
/* Support the experimental API. */
#undef JEMALLOC_EXPERIMENTAL
/* Support utrace(2)-based tracing. */
#undef JEMALLOC_UTRACE
/* Support optional abort() on OOM. */
#undef JEMALLOC_XMALLOC