Get rid of old indentation style for prof

This commit is contained in:
Yinan Zhang 2019-12-06 09:45:40 -08:00
parent dfdd46f6c1
commit 7e3671911f
3 changed files with 60 additions and 60 deletions

View File

@ -3,24 +3,24 @@
#include "jemalloc/internal/mutex.h" #include "jemalloc/internal/mutex.h"
extern malloc_mutex_t bt2gctx_mtx; extern malloc_mutex_t bt2gctx_mtx;
extern malloc_mutex_t tdatas_mtx; extern malloc_mutex_t tdatas_mtx;
extern malloc_mutex_t prof_dump_mtx; extern malloc_mutex_t prof_dump_mtx;
malloc_mutex_t *prof_gctx_mutex_choose(void); malloc_mutex_t *prof_gctx_mutex_choose(void);
malloc_mutex_t *prof_tdata_mutex_choose(uint64_t thr_uid); malloc_mutex_t *prof_tdata_mutex_choose(uint64_t thr_uid);
extern bool opt_prof; extern bool opt_prof;
extern bool opt_prof_active; extern bool opt_prof_active;
extern bool opt_prof_thread_active_init; extern bool opt_prof_thread_active_init;
extern size_t opt_lg_prof_sample; /* Mean bytes between samples. */ extern size_t opt_lg_prof_sample; /* Mean bytes between samples. */
extern ssize_t opt_lg_prof_interval; /* lg(prof_interval). */ extern ssize_t opt_lg_prof_interval; /* lg(prof_interval). */
extern bool opt_prof_gdump; /* High-water memory dumping. */ extern bool opt_prof_gdump; /* High-water memory dumping. */
extern bool opt_prof_final; /* Final profile dumping. */ extern bool opt_prof_final; /* Final profile dumping. */
extern bool opt_prof_leak; /* Dump leak summary at exit. */ extern bool opt_prof_leak; /* Dump leak summary at exit. */
extern bool opt_prof_accum; /* Report cumulative bytes. */ extern bool opt_prof_accum; /* Report cumulative bytes. */
extern bool opt_prof_log; /* Turn logging on at boot. */ extern bool opt_prof_log; /* Turn logging on at boot. */
extern char opt_prof_prefix[ extern char opt_prof_prefix[
/* Minimize memory bloat for non-prof builds. */ /* Minimize memory bloat for non-prof builds. */
#ifdef JEMALLOC_PROF #ifdef JEMALLOC_PROF
PATH_MAX + PATH_MAX +
@ -28,21 +28,21 @@ extern char opt_prof_prefix[
1]; 1];
/* Accessed via prof_active_[gs]et{_unlocked,}(). */ /* Accessed via prof_active_[gs]et{_unlocked,}(). */
extern bool prof_active; extern bool prof_active;
/* Accessed via prof_gdump_[gs]et{_unlocked,}(). */ /* Accessed via prof_gdump_[gs]et{_unlocked,}(). */
extern bool prof_gdump_val; extern bool prof_gdump_val;
/* Profile dump interval, measured in bytes allocated. */ /* Profile dump interval, measured in bytes allocated. */
extern uint64_t prof_interval; extern uint64_t prof_interval;
/* /*
* Initialized as opt_lg_prof_sample, and potentially modified during profiling * Initialized as opt_lg_prof_sample, and potentially modified during profiling
* resets. * resets.
*/ */
extern size_t lg_prof_sample; extern size_t lg_prof_sample;
extern bool prof_booted; extern bool prof_booted;
/* Functions only accessed in prof_inlines_a.h */ /* Functions only accessed in prof_inlines_a.h */
bool prof_idump_accum_impl(tsdn_t *tsdn, uint64_t accumbytes); bool prof_idump_accum_impl(tsdn_t *tsdn, uint64_t accumbytes);

View File

@ -34,44 +34,44 @@
/******************************************************************************/ /******************************************************************************/
/* Data. */ /* Data. */
bool opt_prof = false; bool opt_prof = false;
bool opt_prof_active = true; bool opt_prof_active = true;
bool opt_prof_thread_active_init = true; bool opt_prof_thread_active_init = true;
size_t opt_lg_prof_sample = LG_PROF_SAMPLE_DEFAULT; size_t opt_lg_prof_sample = LG_PROF_SAMPLE_DEFAULT;
ssize_t opt_lg_prof_interval = LG_PROF_INTERVAL_DEFAULT; ssize_t opt_lg_prof_interval = LG_PROF_INTERVAL_DEFAULT;
bool opt_prof_gdump = false; bool opt_prof_gdump = false;
bool opt_prof_final = false; bool opt_prof_final = false;
bool opt_prof_leak = false; bool opt_prof_leak = false;
bool opt_prof_accum = false; bool opt_prof_accum = false;
char opt_prof_prefix[PROF_DUMP_FILENAME_LEN]; char opt_prof_prefix[PROF_DUMP_FILENAME_LEN];
/* Accessed via prof_idump_[accum/rollback](). */ /* Accessed via prof_idump_[accum/rollback](). */
static prof_accum_t prof_idump_accumulated; static prof_accum_t prof_idump_accumulated;
/* /*
* Initialized as opt_prof_active, and accessed via * Initialized as opt_prof_active, and accessed via
* prof_active_[gs]et{_unlocked,}(). * prof_active_[gs]et{_unlocked,}().
*/ */
bool prof_active; bool prof_active;
static malloc_mutex_t prof_active_mtx; static malloc_mutex_t prof_active_mtx;
/* /*
* Initialized as opt_prof_thread_active_init, and accessed via * Initialized as opt_prof_thread_active_init, and accessed via
* prof_thread_active_init_[gs]et(). * prof_thread_active_init_[gs]et().
*/ */
static bool prof_thread_active_init; static bool prof_thread_active_init;
static malloc_mutex_t prof_thread_active_init_mtx; static malloc_mutex_t prof_thread_active_init_mtx;
/* /*
* Initialized as opt_prof_gdump, and accessed via * Initialized as opt_prof_gdump, and accessed via
* prof_gdump_[gs]et{_unlocked,}(). * prof_gdump_[gs]et{_unlocked,}().
*/ */
bool prof_gdump_val; bool prof_gdump_val;
static malloc_mutex_t prof_gdump_mtx; static malloc_mutex_t prof_gdump_mtx;
uint64_t prof_interval = 0; uint64_t prof_interval = 0;
size_t lg_prof_sample; size_t lg_prof_sample;
/* /*
* Table of mutexes that are shared among gctx's. These are leaf locks, so * Table of mutexes that are shared among gctx's. These are leaf locks, so
@ -80,8 +80,8 @@ size_t lg_prof_sample;
* and destroying mutexes causes complications for systems that allocate when * and destroying mutexes causes complications for systems that allocate when
* creating/destroying mutexes. * creating/destroying mutexes.
*/ */
static malloc_mutex_t *gctx_locks; static malloc_mutex_t *gctx_locks;
static atomic_u_t cum_gctxs; /* Atomic counter. */ static atomic_u_t cum_gctxs; /* Atomic counter. */
/* /*
* Table of mutexes that are shared among tdata's. No operations require * Table of mutexes that are shared among tdata's. No operations require
@ -89,27 +89,27 @@ static atomic_u_t cum_gctxs; /* Atomic counter. */
* than one tdata at the same time, even though a gctx lock may be acquired * than one tdata at the same time, even though a gctx lock may be acquired
* while holding a tdata lock. * while holding a tdata lock.
*/ */
static malloc_mutex_t *tdata_locks; static malloc_mutex_t *tdata_locks;
/* Non static to enable profiling. */ /* Non static to enable profiling. */
malloc_mutex_t bt2gctx_mtx; malloc_mutex_t bt2gctx_mtx;
malloc_mutex_t tdatas_mtx; malloc_mutex_t tdatas_mtx;
static uint64_t next_thr_uid; static uint64_t next_thr_uid;
static malloc_mutex_t next_thr_uid_mtx; static malloc_mutex_t next_thr_uid_mtx;
static malloc_mutex_t prof_dump_filename_mtx; static malloc_mutex_t prof_dump_filename_mtx;
static uint64_t prof_dump_seq; static uint64_t prof_dump_seq;
static uint64_t prof_dump_iseq; static uint64_t prof_dump_iseq;
static uint64_t prof_dump_mseq; static uint64_t prof_dump_mseq;
static uint64_t prof_dump_useq; static uint64_t prof_dump_useq;
malloc_mutex_t prof_dump_mtx; malloc_mutex_t prof_dump_mtx;
static char *prof_dump_prefix = NULL; static char *prof_dump_prefix = NULL;
/* Do not dump any profiles until bootstrapping is complete. */ /* Do not dump any profiles until bootstrapping is complete. */
bool prof_booted = false; bool prof_booted = false;
/******************************************************************************/ /******************************************************************************/
@ -550,8 +550,8 @@ prof_dump_prefix_is_empty(tsdn_t *tsdn) {
return ret; return ret;
} }
#define DUMP_FILENAME_BUFSIZE (PATH_MAX + 1) #define DUMP_FILENAME_BUFSIZE (PATH_MAX + 1)
#define VSEQ_INVALID UINT64_C(0xffffffffffffffff) #define VSEQ_INVALID UINT64_C(0xffffffffffffffff)
static void static void
prof_dump_filename(tsd_t *tsd, char *filename, char v, uint64_t vseq) { prof_dump_filename(tsd_t *tsd, char *filename, char v, uint64_t vseq) {
cassert(config_prof); cassert(config_prof);

View File

@ -29,19 +29,19 @@
* Global hash of (prof_bt_t *)-->(prof_gctx_t *). This is the master data * Global hash of (prof_bt_t *)-->(prof_gctx_t *). This is the master data
* structure that knows about all backtraces currently captured. * structure that knows about all backtraces currently captured.
*/ */
static ckh_t bt2gctx; static ckh_t bt2gctx;
/* /*
* Tree of all extant prof_tdata_t structures, regardless of state, * Tree of all extant prof_tdata_t structures, regardless of state,
* {attached,detached,expired}. * {attached,detached,expired}.
*/ */
static prof_tdata_tree_t tdatas; static prof_tdata_tree_t tdatas;
/* /*
* This buffer is rather large for stack allocation, so use a single buffer for * This buffer is rather large for stack allocation, so use a single buffer for
* all profile dumps. * all profile dumps.
*/ */
static char prof_dump_buf[ static char prof_dump_buf[
/* Minimize memory bloat for non-prof builds. */ /* Minimize memory bloat for non-prof builds. */
#ifdef JEMALLOC_PROF #ifdef JEMALLOC_PROF
PROF_DUMP_BUFSIZE PROF_DUMP_BUFSIZE
@ -49,8 +49,8 @@ static char prof_dump_buf[
1 1
#endif #endif
]; ];
static size_t prof_dump_buf_end; static size_t prof_dump_buf_end;
static int prof_dump_fd; static int prof_dump_fd;
/******************************************************************************/ /******************************************************************************/
/* Red-black trees. */ /* Red-black trees. */