diff options
author | Qi Wang <interwq@gwu.edu> | 2017-03-12 04:28:31 (GMT) |
---|---|---|
committer | Qi Wang <interwq@gmail.com> | 2017-03-23 07:03:28 (GMT) |
commit | ca9074deffe799dafa74a1d71333a103c4c007ce (patch) | |
tree | 4305be02b5c5f5cdcbea31759953d6c075f4b2c6 /include/jemalloc | |
parent | 0fb5c0e853963480196ac413db18d1ad78d87ec9 (diff) | |
download | jemalloc-ca9074deffe799dafa74a1d71333a103c4c007ce.zip jemalloc-ca9074deffe799dafa74a1d71333a103c4c007ce.tar.gz jemalloc-ca9074deffe799dafa74a1d71333a103c4c007ce.tar.bz2 |
Added lock profiling and output for global locks (ctl, prof and base).
Diffstat (limited to 'include/jemalloc')
-rw-r--r-- | include/jemalloc/internal/ctl_externs.h | 11 | ||||
-rw-r--r-- | include/jemalloc/internal/ctl_structs.h | 4 | ||||
-rw-r--r-- | include/jemalloc/internal/ctl_types.h | 5 | ||||
-rw-r--r-- | include/jemalloc/internal/private_symbols.txt | 1 | ||||
-rw-r--r-- | include/jemalloc/internal/prof_externs.h | 2 |
5 files changed, 19 insertions, 4 deletions
diff --git a/include/jemalloc/internal/ctl_externs.h b/include/jemalloc/internal/ctl_externs.h index 812ec4f..33ca203 100644 --- a/include/jemalloc/internal/ctl_externs.h +++ b/include/jemalloc/internal/ctl_externs.h @@ -4,10 +4,13 @@ /* Maximum ctl tree depth. */ #define CTL_MAX_DEPTH 7 -#define NUM_ARENA_PROF_LOCKS 6 -#define NUM_LOCK_PROF_COUNTERS 7 -const char *arena_lock_names[NUM_ARENA_PROF_LOCKS]; -const char *lock_counter_names[NUM_LOCK_PROF_COUNTERS]; +#define NUM_GLOBAL_PROF_LOCKS 3 +#define NUM_ARENA_PROF_LOCKS 6 +#define NUM_LOCK_PROF_COUNTERS 7 + +extern const char *arena_lock_names[NUM_ARENA_PROF_LOCKS]; +extern const char *global_lock_names[NUM_GLOBAL_PROF_LOCKS]; +extern const char *lock_counter_names[NUM_LOCK_PROF_COUNTERS]; int ctl_byname(tsd_t *tsd, const char *name, void *oldp, size_t *oldlenp, void *newp, size_t newlen); diff --git a/include/jemalloc/internal/ctl_structs.h b/include/jemalloc/internal/ctl_structs.h index 4df43d9..e467a24 100644 --- a/include/jemalloc/internal/ctl_structs.h +++ b/include/jemalloc/internal/ctl_structs.h @@ -41,6 +41,10 @@ struct ctl_stats_s { size_t resident; size_t mapped; size_t retained; + +#define MTX(mutex) lock_prof_data_t mutex##_mtx_data; +GLOBAL_PROF_MUTEXES +#undef MTX }; struct ctl_arena_s { diff --git a/include/jemalloc/internal/ctl_types.h b/include/jemalloc/internal/ctl_types.h index 7853a4b..562418c 100644 --- a/include/jemalloc/internal/ctl_types.h +++ b/include/jemalloc/internal/ctl_types.h @@ -1,6 +1,11 @@ #ifndef JEMALLOC_INTERNAL_CTL_TYPES_H #define JEMALLOC_INTERNAL_CTL_TYPES_H +#define GLOBAL_PROF_MUTEXES \ + MTX(base) \ + MTX(ctl) \ + MTX(prof) + typedef struct ctl_node_s ctl_node_t; typedef struct ctl_named_node_s ctl_named_node_t; typedef struct ctl_indexed_node_s ctl_indexed_node_t; diff --git a/include/jemalloc/internal/private_symbols.txt b/include/jemalloc/internal/private_symbols.txt index 14ecded..3c5a21b 100644 --- a/include/jemalloc/internal/private_symbols.txt +++ b/include/jemalloc/internal/private_symbols.txt @@ -106,6 +106,7 @@ bootstrap_calloc bootstrap_free bootstrap_malloc bt_init +bt2gctx_mtx buferror ckh_count ckh_delete diff --git a/include/jemalloc/internal/prof_externs.h b/include/jemalloc/internal/prof_externs.h index 985532f..cbd9795 100644 --- a/include/jemalloc/internal/prof_externs.h +++ b/include/jemalloc/internal/prof_externs.h @@ -1,6 +1,8 @@ #ifndef JEMALLOC_INTERNAL_PROF_EXTERNS_H #define JEMALLOC_INTERNAL_PROF_EXTERNS_H +extern malloc_mutex_t bt2gctx_mtx; + extern bool opt_prof; extern bool opt_prof_active; extern bool opt_prof_thread_active_init; |