mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-04-15 07:01:42 +03:00
Added lock profiling and output for global locks (ctl, prof and base).
This commit is contained in:
parent
0fb5c0e853
commit
ca9074deff
9 changed files with 173 additions and 77 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -106,6 +106,7 @@ bootstrap_calloc
|
|||
bootstrap_free
|
||||
bootstrap_malloc
|
||||
bt_init
|
||||
bt2gctx_mtx
|
||||
buferror
|
||||
ckh_count
|
||||
ckh_delete
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue