Commit 3d295670 authored by Barry Perlman's avatar Barry Perlman Committed by Yoni Fogel

Addresses #2075, #2094 refs[t:2075] refs[t:2094]

Merge 2.2.0 scheduling statistics to 3.0.0 (#2075).
Restore #2094 fix to 3.0.0 (cachefiles_lock).
Command line for merge (executed in tokudb.2037b, ../tokudb.2.2.0 is local sandbox image of 2.2.0 release): svn merge -r14900:HEAD ../tokudb.2.2.0

git-svn-id: file:///svn/toku/tokudb.2037b@15629 c7de825b-a66e-492c-adef-691d508d4ae1
parent ebc7c205
...@@ -44,25 +44,41 @@ typedef struct __toku_db_btree_stat64 { ...@@ -44,25 +44,41 @@ typedef struct __toku_db_btree_stat64 {
} DB_BTREE_STAT64; } DB_BTREE_STAT64;
typedef struct __toku_engine_status { typedef struct __toku_engine_status {
char now[26]; /* time of engine status query (i.e. now) */ char now[26]; /* time of engine status query (i.e. now) */
u_int32_t ydb_lock_ctr; /* how many times has ydb lock been taken/released */ u_int64_t ydb_lock_ctr; /* how many times has ydb lock been taken/released */
u_int32_t logger_lock_ctr; /* how many times has logger lock been taken/released */ u_int64_t max_possible_sleep; /* max possible sleep time for ydb lock scheduling (constant) */
u_int64_t processor_freq_mhz; /* clock frequency in MHz */
u_int64_t max_requested_sleep; /* max sleep time requested, can be larger than max possible */
u_int64_t times_max_sleep_used; /* number of times the max_possible_sleep was used to sleep */
u_int64_t total_sleepers; /* total number of times a client slept for ydb lock scheduling */
u_int64_t total_sleep_time; /* total time spent sleeping for ydb lock scheduling */
u_int64_t max_waiters; /* max number of simultaneous client threads kept waiting for ydb lock */
u_int64_t total_waiters; /* total number of times a client thread waited for ydb lock */
u_int64_t total_clients; /* total number of separate client threads that use ydb lock */
u_int64_t time_ydb_lock_held_unavailable; /* number of times a thread migrated and theld is unavailable */
u_int64_t max_time_ydb_lock_held; /* max time a client thread held the ydb lock */
u_int64_t total_time_ydb_lock_held;/* total time client threads held the ydb lock */
u_int64_t logger_lock_ctr; /* how many times has logger lock been taken/released */
u_int32_t checkpoint_period; /* delay between automatic checkpoints */ u_int32_t checkpoint_period; /* delay between automatic checkpoints */
u_int32_t checkpoint_footprint; /* state of checkpoint procedure */ u_int32_t checkpoint_footprint; /* state of checkpoint procedure */
char checkpoint_time_begin[26]; /* time of last checkpoint begin */ char checkpoint_time_begin[26]; /* time of last checkpoint begin */
char checkpoint_time_begin_complete[26]; /* time of last complete checkpoint begin */ char checkpoint_time_begin_complete[26]; /* time of last complete checkpoint begin */
char checkpoint_time_end[26]; /* time of last checkpoint end */ char checkpoint_time_end[26]; /* time of last checkpoint end */
u_int32_t cachetable_lock_ctr; /* how many times has cachetable lock been taken/released */ u_int64_t cachetable_lock_taken; /* how many times has cachetable lock been taken */
u_int64_t cachetable_lock_released;/* how many times has cachetable lock been released */
u_int64_t cachetable_hit; /* how many cache hits */ u_int64_t cachetable_hit; /* how many cache hits */
u_int64_t cachetable_miss; /* how many cache misses */ u_int64_t cachetable_miss; /* how many cache misses */
u_int64_t cachetable_misstime; /* how many usec spent waiting for disk read because of cache miss */
u_int64_t cachetable_waittime; /* how many usec spent waiting for another thread to release cache line */
u_int64_t cachetable_wait_reading; /* how many times get_and_pin waits for a node to be read */ u_int64_t cachetable_wait_reading; /* how many times get_and_pin waits for a node to be read */
u_int64_t cachetable_wait_writing; /* how many times get_and_pin waits for a node to be written */ u_int64_t cachetable_wait_writing; /* how many times get_and_pin waits for a node to be written */
u_int64_t puts; /* how many times has a newly created node been put into the cachetable */ u_int64_t puts; /* how many times has a newly created node been put into the cachetable */
u_int64_t prefetches; /* how many times has a block been prefetched into the cachetable */ u_int64_t prefetches; /* how many times has a block been prefetched into the cachetable */
u_int64_t maybe_get_and_pins; /* how many times has get_and_pin been called */ u_int64_t maybe_get_and_pins; /* how many times has maybe_get_and_pin(_clean) been called */
u_int64_t maybe_get_and_pin_hits; /* how many times has get_and_pin() returned with a node */ u_int64_t maybe_get_and_pin_hits; /* how many times has get_and_pin(_clean) returned with a node */
int64_t cachetable_size_current; /* sum of the sizes of the nodes represented in the cachetable */ int64_t cachetable_size_current; /* sum of the sizes of the nodes represented in the cachetable */
int64_t cachetable_size_limit; /* the limit to the sum of the node sizes */ int64_t cachetable_size_limit; /* the limit to the sum of the node sizes */
int64_t cachetable_size_writing; /* the sum of the sizes of the nodes being written */ int64_t cachetable_size_writing; /* the sum of the sizes of the nodes being written */
int64_t get_and_pin_footprint; /* state of get_and_pin procedure */
u_int32_t range_locks_max; /* max total number of range locks */ u_int32_t range_locks_max; /* max total number of range locks */
u_int32_t range_locks_max_per_db; /* max range locks per dictionary */ u_int32_t range_locks_max_per_db; /* max range locks per dictionary */
u_int32_t range_locks_curr; /* total range locks currently in use */ u_int32_t range_locks_curr; /* total range locks currently in use */
...@@ -171,8 +187,9 @@ struct __toku_db_env { ...@@ -171,8 +187,9 @@ struct __toku_db_env {
int (*set_default_dup_compare) (DB_ENV*,int (*bt_compare) (DB *, const DBT *, const DBT *)) /* Set default (val) comparison function for all DBs in this environment. Required for RECOVERY since you cannot open the DBs manually. */; int (*set_default_dup_compare) (DB_ENV*,int (*bt_compare) (DB *, const DBT *, const DBT *)) /* Set default (val) comparison function for all DBs in this environment. Required for RECOVERY since you cannot open the DBs manually. */;
void *app_private; /* 32-bit offset=36 size=4, 64=bit offset=72 size=8 */ void *app_private; /* 32-bit offset=36 size=4, 64=bit offset=72 size=8 */
int (*get_engine_status) (DB_ENV*, ENGINE_STATUS*) /* Fill in status struct */; int (*get_engine_status) (DB_ENV*, ENGINE_STATUS*) /* Fill in status struct */;
int (*get_engine_status_text) (DB_ENV*, char*, int) /* Fill in status text */;
int (*get_iname) (DB_ENV* env, DBT* dname_dbt, DBT* iname_dbt) /* lookup existing iname */; int (*get_iname) (DB_ENV* env, DBT* dname_dbt, DBT* iname_dbt) /* lookup existing iname */;
void* __toku_dummy0[25]; void* __toku_dummy0[24];
char __toku_dummy1[64]; char __toku_dummy1[64];
void *api1_internal; /* 32-bit offset=212 size=4, 64=bit offset=360 size=8 */ void *api1_internal; /* 32-bit offset=212 size=4, 64=bit offset=360 size=8 */
void* __toku_dummy2[7]; void* __toku_dummy2[7];
......
...@@ -44,25 +44,41 @@ typedef struct __toku_db_btree_stat64 { ...@@ -44,25 +44,41 @@ typedef struct __toku_db_btree_stat64 {
} DB_BTREE_STAT64; } DB_BTREE_STAT64;
typedef struct __toku_engine_status { typedef struct __toku_engine_status {
char now[26]; /* time of engine status query (i.e. now) */ char now[26]; /* time of engine status query (i.e. now) */
u_int32_t ydb_lock_ctr; /* how many times has ydb lock been taken/released */ u_int64_t ydb_lock_ctr; /* how many times has ydb lock been taken/released */
u_int32_t logger_lock_ctr; /* how many times has logger lock been taken/released */ u_int64_t max_possible_sleep; /* max possible sleep time for ydb lock scheduling (constant) */
u_int64_t processor_freq_mhz; /* clock frequency in MHz */
u_int64_t max_requested_sleep; /* max sleep time requested, can be larger than max possible */
u_int64_t times_max_sleep_used; /* number of times the max_possible_sleep was used to sleep */
u_int64_t total_sleepers; /* total number of times a client slept for ydb lock scheduling */
u_int64_t total_sleep_time; /* total time spent sleeping for ydb lock scheduling */
u_int64_t max_waiters; /* max number of simultaneous client threads kept waiting for ydb lock */
u_int64_t total_waiters; /* total number of times a client thread waited for ydb lock */
u_int64_t total_clients; /* total number of separate client threads that use ydb lock */
u_int64_t time_ydb_lock_held_unavailable; /* number of times a thread migrated and theld is unavailable */
u_int64_t max_time_ydb_lock_held; /* max time a client thread held the ydb lock */
u_int64_t total_time_ydb_lock_held;/* total time client threads held the ydb lock */
u_int64_t logger_lock_ctr; /* how many times has logger lock been taken/released */
u_int32_t checkpoint_period; /* delay between automatic checkpoints */ u_int32_t checkpoint_period; /* delay between automatic checkpoints */
u_int32_t checkpoint_footprint; /* state of checkpoint procedure */ u_int32_t checkpoint_footprint; /* state of checkpoint procedure */
char checkpoint_time_begin[26]; /* time of last checkpoint begin */ char checkpoint_time_begin[26]; /* time of last checkpoint begin */
char checkpoint_time_begin_complete[26]; /* time of last complete checkpoint begin */ char checkpoint_time_begin_complete[26]; /* time of last complete checkpoint begin */
char checkpoint_time_end[26]; /* time of last checkpoint end */ char checkpoint_time_end[26]; /* time of last checkpoint end */
u_int32_t cachetable_lock_ctr; /* how many times has cachetable lock been taken/released */ u_int64_t cachetable_lock_taken; /* how many times has cachetable lock been taken */
u_int64_t cachetable_lock_released;/* how many times has cachetable lock been released */
u_int64_t cachetable_hit; /* how many cache hits */ u_int64_t cachetable_hit; /* how many cache hits */
u_int64_t cachetable_miss; /* how many cache misses */ u_int64_t cachetable_miss; /* how many cache misses */
u_int64_t cachetable_misstime; /* how many usec spent waiting for disk read because of cache miss */
u_int64_t cachetable_waittime; /* how many usec spent waiting for another thread to release cache line */
u_int64_t cachetable_wait_reading; /* how many times get_and_pin waits for a node to be read */ u_int64_t cachetable_wait_reading; /* how many times get_and_pin waits for a node to be read */
u_int64_t cachetable_wait_writing; /* how many times get_and_pin waits for a node to be written */ u_int64_t cachetable_wait_writing; /* how many times get_and_pin waits for a node to be written */
u_int64_t puts; /* how many times has a newly created node been put into the cachetable */ u_int64_t puts; /* how many times has a newly created node been put into the cachetable */
u_int64_t prefetches; /* how many times has a block been prefetched into the cachetable */ u_int64_t prefetches; /* how many times has a block been prefetched into the cachetable */
u_int64_t maybe_get_and_pins; /* how many times has get_and_pin been called */ u_int64_t maybe_get_and_pins; /* how many times has maybe_get_and_pin(_clean) been called */
u_int64_t maybe_get_and_pin_hits; /* how many times has get_and_pin() returned with a node */ u_int64_t maybe_get_and_pin_hits; /* how many times has get_and_pin(_clean) returned with a node */
int64_t cachetable_size_current; /* sum of the sizes of the nodes represented in the cachetable */ int64_t cachetable_size_current; /* sum of the sizes of the nodes represented in the cachetable */
int64_t cachetable_size_limit; /* the limit to the sum of the node sizes */ int64_t cachetable_size_limit; /* the limit to the sum of the node sizes */
int64_t cachetable_size_writing; /* the sum of the sizes of the nodes being written */ int64_t cachetable_size_writing; /* the sum of the sizes of the nodes being written */
int64_t get_and_pin_footprint; /* state of get_and_pin procedure */
u_int32_t range_locks_max; /* max total number of range locks */ u_int32_t range_locks_max; /* max total number of range locks */
u_int32_t range_locks_max_per_db; /* max range locks per dictionary */ u_int32_t range_locks_max_per_db; /* max range locks per dictionary */
u_int32_t range_locks_curr; /* total range locks currently in use */ u_int32_t range_locks_curr; /* total range locks currently in use */
...@@ -172,9 +188,10 @@ struct __toku_db_env { ...@@ -172,9 +188,10 @@ struct __toku_db_env {
int (*set_default_bt_compare) (DB_ENV*,int (*bt_compare) (DB *, const DBT *, const DBT *)) /* Set default (key) comparison function for all DBs in this environment. Required for RECOVERY since you cannot open the DBs manually. */; int (*set_default_bt_compare) (DB_ENV*,int (*bt_compare) (DB *, const DBT *, const DBT *)) /* Set default (key) comparison function for all DBs in this environment. Required for RECOVERY since you cannot open the DBs manually. */;
int (*set_default_dup_compare) (DB_ENV*,int (*bt_compare) (DB *, const DBT *, const DBT *)) /* Set default (val) comparison function for all DBs in this environment. Required for RECOVERY since you cannot open the DBs manually. */; int (*set_default_dup_compare) (DB_ENV*,int (*bt_compare) (DB *, const DBT *, const DBT *)) /* Set default (val) comparison function for all DBs in this environment. Required for RECOVERY since you cannot open the DBs manually. */;
int (*get_engine_status) (DB_ENV*, ENGINE_STATUS*) /* Fill in status struct */; int (*get_engine_status) (DB_ENV*, ENGINE_STATUS*) /* Fill in status struct */;
int (*get_iname) (DB_ENV* env, DBT* dname_dbt, DBT* iname_dbt) /* lookup existing iname */; int (*get_engine_status_text) (DB_ENV*, char*, int) /* Fill in status text */;
void *app_private; /* 32-bit offset=44 size=4, 64=bit offset=88 size=8 */ void *app_private; /* 32-bit offset=44 size=4, 64=bit offset=88 size=8 */
void* __toku_dummy0[25]; int (*get_iname) (DB_ENV* env, DBT* dname_dbt, DBT* iname_dbt) /* lookup existing iname */;
void* __toku_dummy0[24];
char __toku_dummy1[96]; char __toku_dummy1[96];
void *api1_internal; /* 32-bit offset=244 size=4, 64=bit offset=392 size=8 */ void *api1_internal; /* 32-bit offset=244 size=4, 64=bit offset=392 size=8 */
void* __toku_dummy2[7]; void* __toku_dummy2[7];
......
...@@ -44,25 +44,41 @@ typedef struct __toku_db_btree_stat64 { ...@@ -44,25 +44,41 @@ typedef struct __toku_db_btree_stat64 {
} DB_BTREE_STAT64; } DB_BTREE_STAT64;
typedef struct __toku_engine_status { typedef struct __toku_engine_status {
char now[26]; /* time of engine status query (i.e. now) */ char now[26]; /* time of engine status query (i.e. now) */
u_int32_t ydb_lock_ctr; /* how many times has ydb lock been taken/released */ u_int64_t ydb_lock_ctr; /* how many times has ydb lock been taken/released */
u_int32_t logger_lock_ctr; /* how many times has logger lock been taken/released */ u_int64_t max_possible_sleep; /* max possible sleep time for ydb lock scheduling (constant) */
u_int64_t processor_freq_mhz; /* clock frequency in MHz */
u_int64_t max_requested_sleep; /* max sleep time requested, can be larger than max possible */
u_int64_t times_max_sleep_used; /* number of times the max_possible_sleep was used to sleep */
u_int64_t total_sleepers; /* total number of times a client slept for ydb lock scheduling */
u_int64_t total_sleep_time; /* total time spent sleeping for ydb lock scheduling */
u_int64_t max_waiters; /* max number of simultaneous client threads kept waiting for ydb lock */
u_int64_t total_waiters; /* total number of times a client thread waited for ydb lock */
u_int64_t total_clients; /* total number of separate client threads that use ydb lock */
u_int64_t time_ydb_lock_held_unavailable; /* number of times a thread migrated and theld is unavailable */
u_int64_t max_time_ydb_lock_held; /* max time a client thread held the ydb lock */
u_int64_t total_time_ydb_lock_held;/* total time client threads held the ydb lock */
u_int64_t logger_lock_ctr; /* how many times has logger lock been taken/released */
u_int32_t checkpoint_period; /* delay between automatic checkpoints */ u_int32_t checkpoint_period; /* delay between automatic checkpoints */
u_int32_t checkpoint_footprint; /* state of checkpoint procedure */ u_int32_t checkpoint_footprint; /* state of checkpoint procedure */
char checkpoint_time_begin[26]; /* time of last checkpoint begin */ char checkpoint_time_begin[26]; /* time of last checkpoint begin */
char checkpoint_time_begin_complete[26]; /* time of last complete checkpoint begin */ char checkpoint_time_begin_complete[26]; /* time of last complete checkpoint begin */
char checkpoint_time_end[26]; /* time of last checkpoint end */ char checkpoint_time_end[26]; /* time of last checkpoint end */
u_int32_t cachetable_lock_ctr; /* how many times has cachetable lock been taken/released */ u_int64_t cachetable_lock_taken; /* how many times has cachetable lock been taken */
u_int64_t cachetable_lock_released;/* how many times has cachetable lock been released */
u_int64_t cachetable_hit; /* how many cache hits */ u_int64_t cachetable_hit; /* how many cache hits */
u_int64_t cachetable_miss; /* how many cache misses */ u_int64_t cachetable_miss; /* how many cache misses */
u_int64_t cachetable_misstime; /* how many usec spent waiting for disk read because of cache miss */
u_int64_t cachetable_waittime; /* how many usec spent waiting for another thread to release cache line */
u_int64_t cachetable_wait_reading; /* how many times get_and_pin waits for a node to be read */ u_int64_t cachetable_wait_reading; /* how many times get_and_pin waits for a node to be read */
u_int64_t cachetable_wait_writing; /* how many times get_and_pin waits for a node to be written */ u_int64_t cachetable_wait_writing; /* how many times get_and_pin waits for a node to be written */
u_int64_t puts; /* how many times has a newly created node been put into the cachetable */ u_int64_t puts; /* how many times has a newly created node been put into the cachetable */
u_int64_t prefetches; /* how many times has a block been prefetched into the cachetable */ u_int64_t prefetches; /* how many times has a block been prefetched into the cachetable */
u_int64_t maybe_get_and_pins; /* how many times has get_and_pin been called */ u_int64_t maybe_get_and_pins; /* how many times has maybe_get_and_pin(_clean) been called */
u_int64_t maybe_get_and_pin_hits; /* how many times has get_and_pin() returned with a node */ u_int64_t maybe_get_and_pin_hits; /* how many times has get_and_pin(_clean) returned with a node */
int64_t cachetable_size_current; /* sum of the sizes of the nodes represented in the cachetable */ int64_t cachetable_size_current; /* sum of the sizes of the nodes represented in the cachetable */
int64_t cachetable_size_limit; /* the limit to the sum of the node sizes */ int64_t cachetable_size_limit; /* the limit to the sum of the node sizes */
int64_t cachetable_size_writing; /* the sum of the sizes of the nodes being written */ int64_t cachetable_size_writing; /* the sum of the sizes of the nodes being written */
int64_t get_and_pin_footprint; /* state of get_and_pin procedure */
u_int32_t range_locks_max; /* max total number of range locks */ u_int32_t range_locks_max; /* max total number of range locks */
u_int32_t range_locks_max_per_db; /* max range locks per dictionary */ u_int32_t range_locks_max_per_db; /* max range locks per dictionary */
u_int32_t range_locks_curr; /* total range locks currently in use */ u_int32_t range_locks_curr; /* total range locks currently in use */
...@@ -173,9 +189,10 @@ struct __toku_db_env { ...@@ -173,9 +189,10 @@ struct __toku_db_env {
int (*set_default_bt_compare) (DB_ENV*,int (*bt_compare) (DB *, const DBT *, const DBT *)) /* Set default (key) comparison function for all DBs in this environment. Required for RECOVERY since you cannot open the DBs manually. */; int (*set_default_bt_compare) (DB_ENV*,int (*bt_compare) (DB *, const DBT *, const DBT *)) /* Set default (key) comparison function for all DBs in this environment. Required for RECOVERY since you cannot open the DBs manually. */;
int (*set_default_dup_compare) (DB_ENV*,int (*bt_compare) (DB *, const DBT *, const DBT *)) /* Set default (val) comparison function for all DBs in this environment. Required for RECOVERY since you cannot open the DBs manually. */; int (*set_default_dup_compare) (DB_ENV*,int (*bt_compare) (DB *, const DBT *, const DBT *)) /* Set default (val) comparison function for all DBs in this environment. Required for RECOVERY since you cannot open the DBs manually. */;
int (*get_engine_status) (DB_ENV*, ENGINE_STATUS*) /* Fill in status struct */; int (*get_engine_status) (DB_ENV*, ENGINE_STATUS*) /* Fill in status struct */;
int (*get_iname) (DB_ENV* env, DBT* dname_dbt, DBT* iname_dbt) /* lookup existing iname */; int (*get_engine_status_text) (DB_ENV*, char*, int) /* Fill in status text */;
void *app_private; /* 32-bit offset=44 size=4, 64=bit offset=88 size=8 */ void *app_private; /* 32-bit offset=44 size=4, 64=bit offset=88 size=8 */
void* __toku_dummy0[40]; int (*get_iname) (DB_ENV* env, DBT* dname_dbt, DBT* iname_dbt) /* lookup existing iname */;
void* __toku_dummy0[39];
char __toku_dummy1[128]; char __toku_dummy1[128];
void *api1_internal; /* 32-bit offset=336 size=4, 64=bit offset=544 size=8 */ void *api1_internal; /* 32-bit offset=336 size=4, 64=bit offset=544 size=8 */
void* __toku_dummy2[7]; void* __toku_dummy2[7];
......
...@@ -44,25 +44,41 @@ typedef struct __toku_db_btree_stat64 { ...@@ -44,25 +44,41 @@ typedef struct __toku_db_btree_stat64 {
} DB_BTREE_STAT64; } DB_BTREE_STAT64;
typedef struct __toku_engine_status { typedef struct __toku_engine_status {
char now[26]; /* time of engine status query (i.e. now) */ char now[26]; /* time of engine status query (i.e. now) */
u_int32_t ydb_lock_ctr; /* how many times has ydb lock been taken/released */ u_int64_t ydb_lock_ctr; /* how many times has ydb lock been taken/released */
u_int32_t logger_lock_ctr; /* how many times has logger lock been taken/released */ u_int64_t max_possible_sleep; /* max possible sleep time for ydb lock scheduling (constant) */
u_int64_t processor_freq_mhz; /* clock frequency in MHz */
u_int64_t max_requested_sleep; /* max sleep time requested, can be larger than max possible */
u_int64_t times_max_sleep_used; /* number of times the max_possible_sleep was used to sleep */
u_int64_t total_sleepers; /* total number of times a client slept for ydb lock scheduling */
u_int64_t total_sleep_time; /* total time spent sleeping for ydb lock scheduling */
u_int64_t max_waiters; /* max number of simultaneous client threads kept waiting for ydb lock */
u_int64_t total_waiters; /* total number of times a client thread waited for ydb lock */
u_int64_t total_clients; /* total number of separate client threads that use ydb lock */
u_int64_t time_ydb_lock_held_unavailable; /* number of times a thread migrated and theld is unavailable */
u_int64_t max_time_ydb_lock_held; /* max time a client thread held the ydb lock */
u_int64_t total_time_ydb_lock_held;/* total time client threads held the ydb lock */
u_int64_t logger_lock_ctr; /* how many times has logger lock been taken/released */
u_int32_t checkpoint_period; /* delay between automatic checkpoints */ u_int32_t checkpoint_period; /* delay between automatic checkpoints */
u_int32_t checkpoint_footprint; /* state of checkpoint procedure */ u_int32_t checkpoint_footprint; /* state of checkpoint procedure */
char checkpoint_time_begin[26]; /* time of last checkpoint begin */ char checkpoint_time_begin[26]; /* time of last checkpoint begin */
char checkpoint_time_begin_complete[26]; /* time of last complete checkpoint begin */ char checkpoint_time_begin_complete[26]; /* time of last complete checkpoint begin */
char checkpoint_time_end[26]; /* time of last checkpoint end */ char checkpoint_time_end[26]; /* time of last checkpoint end */
u_int32_t cachetable_lock_ctr; /* how many times has cachetable lock been taken/released */ u_int64_t cachetable_lock_taken; /* how many times has cachetable lock been taken */
u_int64_t cachetable_lock_released;/* how many times has cachetable lock been released */
u_int64_t cachetable_hit; /* how many cache hits */ u_int64_t cachetable_hit; /* how many cache hits */
u_int64_t cachetable_miss; /* how many cache misses */ u_int64_t cachetable_miss; /* how many cache misses */
u_int64_t cachetable_misstime; /* how many usec spent waiting for disk read because of cache miss */
u_int64_t cachetable_waittime; /* how many usec spent waiting for another thread to release cache line */
u_int64_t cachetable_wait_reading; /* how many times get_and_pin waits for a node to be read */ u_int64_t cachetable_wait_reading; /* how many times get_and_pin waits for a node to be read */
u_int64_t cachetable_wait_writing; /* how many times get_and_pin waits for a node to be written */ u_int64_t cachetable_wait_writing; /* how many times get_and_pin waits for a node to be written */
u_int64_t puts; /* how many times has a newly created node been put into the cachetable */ u_int64_t puts; /* how many times has a newly created node been put into the cachetable */
u_int64_t prefetches; /* how many times has a block been prefetched into the cachetable */ u_int64_t prefetches; /* how many times has a block been prefetched into the cachetable */
u_int64_t maybe_get_and_pins; /* how many times has get_and_pin been called */ u_int64_t maybe_get_and_pins; /* how many times has maybe_get_and_pin(_clean) been called */
u_int64_t maybe_get_and_pin_hits; /* how many times has get_and_pin() returned with a node */ u_int64_t maybe_get_and_pin_hits; /* how many times has get_and_pin(_clean) returned with a node */
int64_t cachetable_size_current; /* sum of the sizes of the nodes represented in the cachetable */ int64_t cachetable_size_current; /* sum of the sizes of the nodes represented in the cachetable */
int64_t cachetable_size_limit; /* the limit to the sum of the node sizes */ int64_t cachetable_size_limit; /* the limit to the sum of the node sizes */
int64_t cachetable_size_writing; /* the sum of the sizes of the nodes being written */ int64_t cachetable_size_writing; /* the sum of the sizes of the nodes being written */
int64_t get_and_pin_footprint; /* state of get_and_pin procedure */
u_int32_t range_locks_max; /* max total number of range locks */ u_int32_t range_locks_max; /* max total number of range locks */
u_int32_t range_locks_max_per_db; /* max range locks per dictionary */ u_int32_t range_locks_max_per_db; /* max range locks per dictionary */
u_int32_t range_locks_curr; /* total range locks currently in use */ u_int32_t range_locks_curr; /* total range locks currently in use */
...@@ -173,8 +189,9 @@ struct __toku_db_env { ...@@ -173,8 +189,9 @@ struct __toku_db_env {
int (*set_default_bt_compare) (DB_ENV*,int (*bt_compare) (DB *, const DBT *, const DBT *)) /* Set default (key) comparison function for all DBs in this environment. Required for RECOVERY since you cannot open the DBs manually. */; int (*set_default_bt_compare) (DB_ENV*,int (*bt_compare) (DB *, const DBT *, const DBT *)) /* Set default (key) comparison function for all DBs in this environment. Required for RECOVERY since you cannot open the DBs manually. */;
int (*set_default_dup_compare) (DB_ENV*,int (*bt_compare) (DB *, const DBT *, const DBT *)) /* Set default (val) comparison function for all DBs in this environment. Required for RECOVERY since you cannot open the DBs manually. */; int (*set_default_dup_compare) (DB_ENV*,int (*bt_compare) (DB *, const DBT *, const DBT *)) /* Set default (val) comparison function for all DBs in this environment. Required for RECOVERY since you cannot open the DBs manually. */;
int (*get_engine_status) (DB_ENV*, ENGINE_STATUS*) /* Fill in status struct */; int (*get_engine_status) (DB_ENV*, ENGINE_STATUS*) /* Fill in status struct */;
int (*get_engine_status_text) (DB_ENV*, char*, int) /* Fill in status text */;
int (*get_iname) (DB_ENV* env, DBT* dname_dbt, DBT* iname_dbt) /* lookup existing iname */; int (*get_iname) (DB_ENV* env, DBT* dname_dbt, DBT* iname_dbt) /* lookup existing iname */;
void* __toku_dummy0[2]; void* __toku_dummy0[1];
void *app_private; /* 32-bit offset=52 size=4, 64=bit offset=104 size=8 */ void *app_private; /* 32-bit offset=52 size=4, 64=bit offset=104 size=8 */
void* __toku_dummy1[38]; void* __toku_dummy1[38];
char __toku_dummy2[128]; char __toku_dummy2[128];
......
...@@ -44,25 +44,41 @@ typedef struct __toku_db_btree_stat64 { ...@@ -44,25 +44,41 @@ typedef struct __toku_db_btree_stat64 {
} DB_BTREE_STAT64; } DB_BTREE_STAT64;
typedef struct __toku_engine_status { typedef struct __toku_engine_status {
char now[26]; /* time of engine status query (i.e. now) */ char now[26]; /* time of engine status query (i.e. now) */
u_int32_t ydb_lock_ctr; /* how many times has ydb lock been taken/released */ u_int64_t ydb_lock_ctr; /* how many times has ydb lock been taken/released */
u_int32_t logger_lock_ctr; /* how many times has logger lock been taken/released */ u_int64_t max_possible_sleep; /* max possible sleep time for ydb lock scheduling (constant) */
u_int64_t processor_freq_mhz; /* clock frequency in MHz */
u_int64_t max_requested_sleep; /* max sleep time requested, can be larger than max possible */
u_int64_t times_max_sleep_used; /* number of times the max_possible_sleep was used to sleep */
u_int64_t total_sleepers; /* total number of times a client slept for ydb lock scheduling */
u_int64_t total_sleep_time; /* total time spent sleeping for ydb lock scheduling */
u_int64_t max_waiters; /* max number of simultaneous client threads kept waiting for ydb lock */
u_int64_t total_waiters; /* total number of times a client thread waited for ydb lock */
u_int64_t total_clients; /* total number of separate client threads that use ydb lock */
u_int64_t time_ydb_lock_held_unavailable; /* number of times a thread migrated and theld is unavailable */
u_int64_t max_time_ydb_lock_held; /* max time a client thread held the ydb lock */
u_int64_t total_time_ydb_lock_held;/* total time client threads held the ydb lock */
u_int64_t logger_lock_ctr; /* how many times has logger lock been taken/released */
u_int32_t checkpoint_period; /* delay between automatic checkpoints */ u_int32_t checkpoint_period; /* delay between automatic checkpoints */
u_int32_t checkpoint_footprint; /* state of checkpoint procedure */ u_int32_t checkpoint_footprint; /* state of checkpoint procedure */
char checkpoint_time_begin[26]; /* time of last checkpoint begin */ char checkpoint_time_begin[26]; /* time of last checkpoint begin */
char checkpoint_time_begin_complete[26]; /* time of last complete checkpoint begin */ char checkpoint_time_begin_complete[26]; /* time of last complete checkpoint begin */
char checkpoint_time_end[26]; /* time of last checkpoint end */ char checkpoint_time_end[26]; /* time of last checkpoint end */
u_int32_t cachetable_lock_ctr; /* how many times has cachetable lock been taken/released */ u_int64_t cachetable_lock_taken; /* how many times has cachetable lock been taken */
u_int64_t cachetable_lock_released;/* how many times has cachetable lock been released */
u_int64_t cachetable_hit; /* how many cache hits */ u_int64_t cachetable_hit; /* how many cache hits */
u_int64_t cachetable_miss; /* how many cache misses */ u_int64_t cachetable_miss; /* how many cache misses */
u_int64_t cachetable_misstime; /* how many usec spent waiting for disk read because of cache miss */
u_int64_t cachetable_waittime; /* how many usec spent waiting for another thread to release cache line */
u_int64_t cachetable_wait_reading; /* how many times get_and_pin waits for a node to be read */ u_int64_t cachetable_wait_reading; /* how many times get_and_pin waits for a node to be read */
u_int64_t cachetable_wait_writing; /* how many times get_and_pin waits for a node to be written */ u_int64_t cachetable_wait_writing; /* how many times get_and_pin waits for a node to be written */
u_int64_t puts; /* how many times has a newly created node been put into the cachetable */ u_int64_t puts; /* how many times has a newly created node been put into the cachetable */
u_int64_t prefetches; /* how many times has a block been prefetched into the cachetable */ u_int64_t prefetches; /* how many times has a block been prefetched into the cachetable */
u_int64_t maybe_get_and_pins; /* how many times has get_and_pin been called */ u_int64_t maybe_get_and_pins; /* how many times has maybe_get_and_pin(_clean) been called */
u_int64_t maybe_get_and_pin_hits; /* how many times has get_and_pin() returned with a node */ u_int64_t maybe_get_and_pin_hits; /* how many times has get_and_pin(_clean) returned with a node */
int64_t cachetable_size_current; /* sum of the sizes of the nodes represented in the cachetable */ int64_t cachetable_size_current; /* sum of the sizes of the nodes represented in the cachetable */
int64_t cachetable_size_limit; /* the limit to the sum of the node sizes */ int64_t cachetable_size_limit; /* the limit to the sum of the node sizes */
int64_t cachetable_size_writing; /* the sum of the sizes of the nodes being written */ int64_t cachetable_size_writing; /* the sum of the sizes of the nodes being written */
int64_t get_and_pin_footprint; /* state of get_and_pin procedure */
u_int32_t range_locks_max; /* max total number of range locks */ u_int32_t range_locks_max; /* max total number of range locks */
u_int32_t range_locks_max_per_db; /* max range locks per dictionary */ u_int32_t range_locks_max_per_db; /* max range locks per dictionary */
u_int32_t range_locks_curr; /* total range locks currently in use */ u_int32_t range_locks_curr; /* total range locks currently in use */
...@@ -175,8 +191,9 @@ struct __toku_db_env { ...@@ -175,8 +191,9 @@ struct __toku_db_env {
int (*set_default_bt_compare) (DB_ENV*,int (*bt_compare) (DB *, const DBT *, const DBT *)) /* Set default (key) comparison function for all DBs in this environment. Required for RECOVERY since you cannot open the DBs manually. */; int (*set_default_bt_compare) (DB_ENV*,int (*bt_compare) (DB *, const DBT *, const DBT *)) /* Set default (key) comparison function for all DBs in this environment. Required for RECOVERY since you cannot open the DBs manually. */;
int (*set_default_dup_compare) (DB_ENV*,int (*bt_compare) (DB *, const DBT *, const DBT *)) /* Set default (val) comparison function for all DBs in this environment. Required for RECOVERY since you cannot open the DBs manually. */; int (*set_default_dup_compare) (DB_ENV*,int (*bt_compare) (DB *, const DBT *, const DBT *)) /* Set default (val) comparison function for all DBs in this environment. Required for RECOVERY since you cannot open the DBs manually. */;
int (*get_engine_status) (DB_ENV*, ENGINE_STATUS*) /* Fill in status struct */; int (*get_engine_status) (DB_ENV*, ENGINE_STATUS*) /* Fill in status struct */;
int (*get_engine_status_text) (DB_ENV*, char*, int) /* Fill in status text */;
int (*get_iname) (DB_ENV* env, DBT* dname_dbt, DBT* iname_dbt) /* lookup existing iname */; int (*get_iname) (DB_ENV* env, DBT* dname_dbt, DBT* iname_dbt) /* lookup existing iname */;
void* __toku_dummy0[2]; void* __toku_dummy0[1];
void *app_private; /* 32-bit offset=52 size=4, 64=bit offset=104 size=8 */ void *app_private; /* 32-bit offset=52 size=4, 64=bit offset=104 size=8 */
void* __toku_dummy1[39]; void* __toku_dummy1[39];
char __toku_dummy2[144]; char __toku_dummy2[144];
......
...@@ -342,29 +342,44 @@ int main (int argc __attribute__((__unused__)), char *argv[] __attribute__((__un ...@@ -342,29 +342,44 @@ int main (int argc __attribute__((__unused__)), char *argv[] __attribute__((__un
printf(" u_int64_t bt_fsize; /* how big is the underlying file */\n"); printf(" u_int64_t bt_fsize; /* how big is the underlying file */\n");
printf("} DB_BTREE_STAT64;\n"); printf("} DB_BTREE_STAT64;\n");
//engine status info //engine status info
printf("typedef struct __toku_engine_status {\n"); printf("typedef struct __toku_engine_status {\n");
printf(" char now[26]; /* time of engine status query (i.e. now) */ \n"); printf(" char now[26]; /* time of engine status query (i.e. now) */ \n");
printf(" u_int32_t ydb_lock_ctr; /* how many times has ydb lock been taken/released */ \n"); printf(" u_int64_t ydb_lock_ctr; /* how many times has ydb lock been taken/released */ \n");
printf(" u_int32_t logger_lock_ctr; /* how many times has logger lock been taken/released */ \n"); printf(" u_int64_t max_possible_sleep; /* max possible sleep time for ydb lock scheduling (constant) */ \n");
printf(" u_int64_t processor_freq_mhz; /* clock frequency in MHz */ \n");
printf(" u_int64_t max_requested_sleep; /* max sleep time requested, can be larger than max possible */ \n");
printf(" u_int64_t times_max_sleep_used; /* number of times the max_possible_sleep was used to sleep */ \n");
printf(" u_int64_t total_sleepers; /* total number of times a client slept for ydb lock scheduling */ \n");
printf(" u_int64_t total_sleep_time; /* total time spent sleeping for ydb lock scheduling */ \n");
printf(" u_int64_t max_waiters; /* max number of simultaneous client threads kept waiting for ydb lock */ \n");
printf(" u_int64_t total_waiters; /* total number of times a client thread waited for ydb lock */ \n");
printf(" u_int64_t total_clients; /* total number of separate client threads that use ydb lock */ \n");
printf(" u_int64_t time_ydb_lock_held_unavailable; /* number of times a thread migrated and theld is unavailable */ \n");
printf(" u_int64_t max_time_ydb_lock_held; /* max time a client thread held the ydb lock */ \n");
printf(" u_int64_t total_time_ydb_lock_held;/* total time client threads held the ydb lock */ \n");
printf(" u_int64_t logger_lock_ctr; /* how many times has logger lock been taken/released */ \n");
printf(" u_int32_t checkpoint_period; /* delay between automatic checkpoints */ \n"); printf(" u_int32_t checkpoint_period; /* delay between automatic checkpoints */ \n");
printf(" u_int32_t checkpoint_footprint; /* state of checkpoint procedure */ \n"); printf(" u_int32_t checkpoint_footprint; /* state of checkpoint procedure */ \n");
printf(" char checkpoint_time_begin[26]; /* time of last checkpoint begin */ \n"); printf(" char checkpoint_time_begin[26]; /* time of last checkpoint begin */ \n");
printf(" char checkpoint_time_begin_complete[26]; /* time of last complete checkpoint begin */ \n"); printf(" char checkpoint_time_begin_complete[26]; /* time of last complete checkpoint begin */ \n");
printf(" char checkpoint_time_end[26]; /* time of last checkpoint end */ \n"); printf(" char checkpoint_time_end[26]; /* time of last checkpoint end */ \n");
printf(" u_int32_t cachetable_lock_ctr; /* how many times has cachetable lock been taken/released */ \n"); printf(" u_int64_t cachetable_lock_taken; /* how many times has cachetable lock been taken */ \n");
printf(" u_int64_t cachetable_lock_released;/* how many times has cachetable lock been released */ \n");
printf(" u_int64_t cachetable_hit; /* how many cache hits */ \n"); printf(" u_int64_t cachetable_hit; /* how many cache hits */ \n");
printf(" u_int64_t cachetable_miss; /* how many cache misses */ \n"); printf(" u_int64_t cachetable_miss; /* how many cache misses */ \n");
printf(" u_int64_t cachetable_misstime; /* how many usec spent waiting for disk read because of cache miss */ \n");
printf(" u_int64_t cachetable_waittime; /* how many usec spent waiting for another thread to release cache line */ \n");
printf(" u_int64_t cachetable_wait_reading; /* how many times get_and_pin waits for a node to be read */ \n"); printf(" u_int64_t cachetable_wait_reading; /* how many times get_and_pin waits for a node to be read */ \n");
printf(" u_int64_t cachetable_wait_writing; /* how many times get_and_pin waits for a node to be written */ \n"); printf(" u_int64_t cachetable_wait_writing; /* how many times get_and_pin waits for a node to be written */ \n");
printf(" u_int64_t puts; /* how many times has a newly created node been put into the cachetable */ \n"); printf(" u_int64_t puts; /* how many times has a newly created node been put into the cachetable */ \n");
printf(" u_int64_t prefetches; /* how many times has a block been prefetched into the cachetable */ \n"); printf(" u_int64_t prefetches; /* how many times has a block been prefetched into the cachetable */ \n");
printf(" u_int64_t maybe_get_and_pins; /* how many times has get_and_pin been called */ \n"); printf(" u_int64_t maybe_get_and_pins; /* how many times has maybe_get_and_pin(_clean) been called */ \n");
printf(" u_int64_t maybe_get_and_pin_hits; /* how many times has get_and_pin() returned with a node */ \n"); printf(" u_int64_t maybe_get_and_pin_hits; /* how many times has get_and_pin(_clean) returned with a node */ \n");
printf(" int64_t cachetable_size_current; /* sum of the sizes of the nodes represented in the cachetable */ \n"); printf(" int64_t cachetable_size_current; /* sum of the sizes of the nodes represented in the cachetable */ \n");
printf(" int64_t cachetable_size_limit; /* the limit to the sum of the node sizes */ \n"); printf(" int64_t cachetable_size_limit; /* the limit to the sum of the node sizes */ \n");
printf(" int64_t cachetable_size_writing; /* the sum of the sizes of the nodes being written */ \n"); printf(" int64_t cachetable_size_writing; /* the sum of the sizes of the nodes being written */ \n");
printf(" int64_t get_and_pin_footprint; /* state of get_and_pin procedure */ \n");
printf(" u_int32_t range_locks_max; /* max total number of range locks */ \n"); printf(" u_int32_t range_locks_max; /* max total number of range locks */ \n");
printf(" u_int32_t range_locks_max_per_db; /* max range locks per dictionary */ \n"); printf(" u_int32_t range_locks_max_per_db; /* max range locks per dictionary */ \n");
printf(" u_int32_t range_locks_curr; /* total range locks currently in use */ \n"); printf(" u_int32_t range_locks_curr; /* total range locks currently in use */ \n");
...@@ -374,13 +389,6 @@ int main (int argc __attribute__((__unused__)), char *argv[] __attribute__((__un ...@@ -374,13 +389,6 @@ int main (int argc __attribute__((__unused__)), char *argv[] __attribute__((__un
printf(" u_int64_t aborts; /* ydb txn abort operations */ \n"); printf(" u_int64_t aborts; /* ydb txn abort operations */ \n");
printf(" u_int64_t point_queries; /* ydb point queries */ \n"); printf(" u_int64_t point_queries; /* ydb point queries */ \n");
printf(" u_int64_t sequential_queries; /* ydb sequential queries */ \n"); printf(" u_int64_t sequential_queries; /* ydb sequential queries */ \n");
// printf(" struct timeval checkpoint_tbegin; /* time of last checkpoint begin */ \n");
// printf(" struct timeval checkpoint_tend; /* time of last checkpoint end */ \n");
// printf(" DB_LSN lsn_of_last_checkpoint_begin; \n");
// printf(" DB_LSN lsn_of_last_checkpoint_end; \n");
printf("} ENGINE_STATUS;\n"); printf("} ENGINE_STATUS;\n");
...@@ -405,6 +413,7 @@ int main (int argc __attribute__((__unused__)), char *argv[] __attribute__((__un ...@@ -405,6 +413,7 @@ int main (int argc __attribute__((__unused__)), char *argv[] __attribute__((__un
"int (*set_default_bt_compare) (DB_ENV*,int (*bt_compare) (DB *, const DBT *, const DBT *)) /* Set default (key) comparison function for all DBs in this environment. Required for RECOVERY since you cannot open the DBs manually. */", "int (*set_default_bt_compare) (DB_ENV*,int (*bt_compare) (DB *, const DBT *, const DBT *)) /* Set default (key) comparison function for all DBs in this environment. Required for RECOVERY since you cannot open the DBs manually. */",
"int (*set_default_dup_compare) (DB_ENV*,int (*bt_compare) (DB *, const DBT *, const DBT *)) /* Set default (val) comparison function for all DBs in this environment. Required for RECOVERY since you cannot open the DBs manually. */", "int (*set_default_dup_compare) (DB_ENV*,int (*bt_compare) (DB *, const DBT *, const DBT *)) /* Set default (val) comparison function for all DBs in this environment. Required for RECOVERY since you cannot open the DBs manually. */",
"int (*get_engine_status) (DB_ENV*, ENGINE_STATUS*) /* Fill in status struct */", "int (*get_engine_status) (DB_ENV*, ENGINE_STATUS*) /* Fill in status struct */",
"int (*get_engine_status_text) (DB_ENV*, char*, int) /* Fill in status text */",
"int (*get_iname) (DB_ENV* env, DBT* dname_dbt, DBT* iname_dbt) /* lookup existing iname */", "int (*get_iname) (DB_ENV* env, DBT* dname_dbt, DBT* iname_dbt) /* lookup existing iname */",
NULL}; NULL};
print_struct("db_env", 1, db_env_fields32, db_env_fields64, sizeof(db_env_fields32)/sizeof(db_env_fields32[0]), extra); print_struct("db_env", 1, db_env_fields32, db_env_fields64, sizeof(db_env_fields32)/sizeof(db_env_fields32[0]), extra);
......
...@@ -44,25 +44,41 @@ typedef struct __toku_db_btree_stat64 { ...@@ -44,25 +44,41 @@ typedef struct __toku_db_btree_stat64 {
} DB_BTREE_STAT64; } DB_BTREE_STAT64;
typedef struct __toku_engine_status { typedef struct __toku_engine_status {
char now[26]; /* time of engine status query (i.e. now) */ char now[26]; /* time of engine status query (i.e. now) */
u_int32_t ydb_lock_ctr; /* how many times has ydb lock been taken/released */ u_int64_t ydb_lock_ctr; /* how many times has ydb lock been taken/released */
u_int32_t logger_lock_ctr; /* how many times has logger lock been taken/released */ u_int64_t max_possible_sleep; /* max possible sleep time for ydb lock scheduling (constant) */
u_int64_t processor_freq_mhz; /* clock frequency in MHz */
u_int64_t max_requested_sleep; /* max sleep time requested, can be larger than max possible */
u_int64_t times_max_sleep_used; /* number of times the max_possible_sleep was used to sleep */
u_int64_t total_sleepers; /* total number of times a client slept for ydb lock scheduling */
u_int64_t total_sleep_time; /* total time spent sleeping for ydb lock scheduling */
u_int64_t max_waiters; /* max number of simultaneous client threads kept waiting for ydb lock */
u_int64_t total_waiters; /* total number of times a client thread waited for ydb lock */
u_int64_t total_clients; /* total number of separate client threads that use ydb lock */
u_int64_t time_ydb_lock_held_unavailable; /* number of times a thread migrated and theld is unavailable */
u_int64_t max_time_ydb_lock_held; /* max time a client thread held the ydb lock */
u_int64_t total_time_ydb_lock_held;/* total time client threads held the ydb lock */
u_int64_t logger_lock_ctr; /* how many times has logger lock been taken/released */
u_int32_t checkpoint_period; /* delay between automatic checkpoints */ u_int32_t checkpoint_period; /* delay between automatic checkpoints */
u_int32_t checkpoint_footprint; /* state of checkpoint procedure */ u_int32_t checkpoint_footprint; /* state of checkpoint procedure */
char checkpoint_time_begin[26]; /* time of last checkpoint begin */ char checkpoint_time_begin[26]; /* time of last checkpoint begin */
char checkpoint_time_begin_complete[26]; /* time of last complete checkpoint begin */ char checkpoint_time_begin_complete[26]; /* time of last complete checkpoint begin */
char checkpoint_time_end[26]; /* time of last checkpoint end */ char checkpoint_time_end[26]; /* time of last checkpoint end */
u_int32_t cachetable_lock_ctr; /* how many times has cachetable lock been taken/released */ u_int64_t cachetable_lock_taken; /* how many times has cachetable lock been taken */
u_int64_t cachetable_lock_released;/* how many times has cachetable lock been released */
u_int64_t cachetable_hit; /* how many cache hits */ u_int64_t cachetable_hit; /* how many cache hits */
u_int64_t cachetable_miss; /* how many cache misses */ u_int64_t cachetable_miss; /* how many cache misses */
u_int64_t cachetable_misstime; /* how many usec spent waiting for disk read because of cache miss */
u_int64_t cachetable_waittime; /* how many usec spent waiting for another thread to release cache line */
u_int64_t cachetable_wait_reading; /* how many times get_and_pin waits for a node to be read */ u_int64_t cachetable_wait_reading; /* how many times get_and_pin waits for a node to be read */
u_int64_t cachetable_wait_writing; /* how many times get_and_pin waits for a node to be written */ u_int64_t cachetable_wait_writing; /* how many times get_and_pin waits for a node to be written */
u_int64_t puts; /* how many times has a newly created node been put into the cachetable */ u_int64_t puts; /* how many times has a newly created node been put into the cachetable */
u_int64_t prefetches; /* how many times has a block been prefetched into the cachetable */ u_int64_t prefetches; /* how many times has a block been prefetched into the cachetable */
u_int64_t maybe_get_and_pins; /* how many times has get_and_pin been called */ u_int64_t maybe_get_and_pins; /* how many times has maybe_get_and_pin(_clean) been called */
u_int64_t maybe_get_and_pin_hits; /* how many times has get_and_pin() returned with a node */ u_int64_t maybe_get_and_pin_hits; /* how many times has get_and_pin(_clean) returned with a node */
int64_t cachetable_size_current; /* sum of the sizes of the nodes represented in the cachetable */ int64_t cachetable_size_current; /* sum of the sizes of the nodes represented in the cachetable */
int64_t cachetable_size_limit; /* the limit to the sum of the node sizes */ int64_t cachetable_size_limit; /* the limit to the sum of the node sizes */
int64_t cachetable_size_writing; /* the sum of the sizes of the nodes being written */ int64_t cachetable_size_writing; /* the sum of the sizes of the nodes being written */
int64_t get_and_pin_footprint; /* state of get_and_pin procedure */
u_int32_t range_locks_max; /* max total number of range locks */ u_int32_t range_locks_max; /* max total number of range locks */
u_int32_t range_locks_max_per_db; /* max range locks per dictionary */ u_int32_t range_locks_max_per_db; /* max range locks per dictionary */
u_int32_t range_locks_curr; /* total range locks currently in use */ u_int32_t range_locks_curr; /* total range locks currently in use */
...@@ -175,6 +191,7 @@ struct __toku_db_env { ...@@ -175,6 +191,7 @@ struct __toku_db_env {
int (*set_default_bt_compare) (DB_ENV*,int (*bt_compare) (DB *, const DBT *, const DBT *)) /* Set default (key) comparison function for all DBs in this environment. Required for RECOVERY since you cannot open the DBs manually. */; int (*set_default_bt_compare) (DB_ENV*,int (*bt_compare) (DB *, const DBT *, const DBT *)) /* Set default (key) comparison function for all DBs in this environment. Required for RECOVERY since you cannot open the DBs manually. */;
int (*set_default_dup_compare) (DB_ENV*,int (*bt_compare) (DB *, const DBT *, const DBT *)) /* Set default (val) comparison function for all DBs in this environment. Required for RECOVERY since you cannot open the DBs manually. */; int (*set_default_dup_compare) (DB_ENV*,int (*bt_compare) (DB *, const DBT *, const DBT *)) /* Set default (val) comparison function for all DBs in this environment. Required for RECOVERY since you cannot open the DBs manually. */;
int (*get_engine_status) (DB_ENV*, ENGINE_STATUS*) /* Fill in status struct */; int (*get_engine_status) (DB_ENV*, ENGINE_STATUS*) /* Fill in status struct */;
int (*get_engine_status_text) (DB_ENV*, char*, int) /* Fill in status text */;
int (*get_iname) (DB_ENV* env, DBT* dname_dbt, DBT* iname_dbt) /* lookup existing iname */; int (*get_iname) (DB_ENV* env, DBT* dname_dbt, DBT* iname_dbt) /* lookup existing iname */;
void *app_private; void *app_private;
void *api1_internal; void *api1_internal;
......
...@@ -24,11 +24,13 @@ u_int32_t cachesize = 127*1024*1024; ...@@ -24,11 +24,13 @@ u_int32_t cachesize = 127*1024*1024;
static int do_mysql = 0; static int do_mysql = 0;
static u_int64_t start_range = 0, end_range = 0; static u_int64_t start_range = 0, end_range = 0;
static int n_experiments = 2; static int n_experiments = 2;
static int verbose = 0; static int verbose = 0;
static const char *log_dir = NULL; static const char *log_dir = NULL;
static int print_usage (const char *argv0) { static int print_usage (const char *argv0) {
fprintf(stderr, "Usage:\n%s [--verify-lwc | --lwc | --nohwc] [--prelock] [--prelockflag] [--prelockwriteflag] [--env DIR]\n", argv0); fprintf(stderr, "Usage:\n%s [--verify-lwc | --lwc | --nohwc] [--prelock] [--prelockflag] [--prelockwriteflag] [--env DIR] [--verbose]\n", argv0);
fprintf(stderr, " --hwc run heavy weight cursors (this is the default)\n"); fprintf(stderr, " --hwc run heavy weight cursors (this is the default)\n");
fprintf(stderr, " --verify-lwc means to run the light weight cursor and the heavyweight cursor to verify that they get the same answer.\n"); fprintf(stderr, " --verify-lwc means to run the light weight cursor and the heavyweight cursor to verify that they get the same answer.\n");
fprintf(stderr, " --flatten Flatten only using special flatten function\n"); fprintf(stderr, " --flatten Flatten only using special flatten function\n");
...@@ -42,6 +44,7 @@ static int print_usage (const char *argv0) { ...@@ -42,6 +44,7 @@ static int print_usage (const char *argv0) {
fprintf(stderr, " --mysql compare keys that are mysql big int not null types\n"); fprintf(stderr, " --mysql compare keys that are mysql big int not null types\n");
fprintf(stderr, " --env DIR put db files in DIR instead of default\n"); fprintf(stderr, " --env DIR put db files in DIR instead of default\n");
fprintf(stderr, " --log_dir LOGDIR put the logs in LOGDIR\n"); fprintf(stderr, " --log_dir LOGDIR put the logs in LOGDIR\n");
fprintf(stderr, " --verbose print verbose information\n");
return 1; return 1;
} }
...@@ -111,6 +114,8 @@ static void parse_args (int argc, const char *argv[]) { ...@@ -111,6 +114,8 @@ static void parse_args (int argc, const char *argv[]) {
log_dir = *argv; log_dir = *argv;
} else if (strcmp(*argv, "--mysql") == 0) { } else if (strcmp(*argv, "--mysql") == 0) {
do_mysql = 1; do_mysql = 1;
} else if (strcmp(*argv, "--verbose") == 0) {
verbose = 1;
} else if (strcmp(*argv, "--range") == 0 && argc > 2) { } else if (strcmp(*argv, "--range") == 0 && argc > 2) {
run_mode = RUN_RANGE; run_mode = RUN_RANGE;
argc--; argv++; argc--; argv++;
...@@ -195,6 +200,7 @@ static void scanscan_shutdown (void) { ...@@ -195,6 +200,7 @@ static void scanscan_shutdown (void) {
r = tid->commit(tid, 0); assert(r==0); r = tid->commit(tid, 0); assert(r==0);
} }
r = env->close(env, 0); assert(r==0); r = env->close(env, 0); assert(r==0);
env = NULL;
#if 0 && defined TOKUDB #if 0 && defined TOKUDB
{ {
...@@ -207,6 +213,20 @@ static void scanscan_shutdown (void) { ...@@ -207,6 +213,20 @@ static void scanscan_shutdown (void) {
#endif #endif
} }
static void print_engine_status(void) {
#if defined TOKUDB
if (verbose) {
int buffsize = 1024 * 32;
char buff[buffsize];
env->get_engine_status_text(env, buff, buffsize);
printf("Engine status:\n");
printf(buff);
}
#endif
}
static void scanscan_hwc (void) { static void scanscan_hwc (void) {
int r; int r;
int counter=0; int counter=0;
...@@ -233,6 +253,7 @@ static void scanscan_hwc (void) { ...@@ -233,6 +253,7 @@ static void scanscan_hwc (void) {
double thistime = gettime(); double thistime = gettime();
double tdiff = thistime-prevtime; double tdiff = thistime-prevtime;
printf("Scan %lld bytes (%d rows) in %9.6fs at %9fMB/s\n", totalbytes, rowcounter, tdiff, 1e-6*totalbytes/tdiff); printf("Scan %lld bytes (%d rows) in %9.6fs at %9fMB/s\n", totalbytes, rowcounter, tdiff, 1e-6*totalbytes/tdiff);
print_engine_status();
} }
} }
...@@ -279,6 +300,7 @@ static void scanscan_lwc (void) { ...@@ -279,6 +300,7 @@ static void scanscan_lwc (void) {
double thistime = gettime(); double thistime = gettime();
double tdiff = thistime-prevtime; double tdiff = thistime-prevtime;
printf("LWC Scan %lld bytes (%d rows) in %9.6fs at %9fMB/s\n", e.totalbytes, e.rowcounter, tdiff, 1e-6*e.totalbytes/tdiff); printf("LWC Scan %lld bytes (%d rows) in %9.6fs at %9fMB/s\n", e.totalbytes, e.rowcounter, tdiff, 1e-6*e.totalbytes/tdiff);
print_engine_status();
} }
} }
...@@ -327,6 +349,7 @@ static void scanscan_range (void) { ...@@ -327,6 +349,7 @@ static void scanscan_range (void) {
if (limitcount>0 && rowcounter>=limitcount) break; if (limitcount>0 && rowcounter>=limitcount) break;
} }
#endif #endif
print_engine_status();
} }
r = dbc->c_close(dbc); r = dbc->c_close(dbc);
...@@ -429,6 +452,7 @@ static void scanscan_heaviside (void) { ...@@ -429,6 +452,7 @@ static void scanscan_heaviside (void) {
double thistime = gettime(); double thistime = gettime();
double tdiff = thistime-prevtime; double tdiff = thistime-prevtime;
printf("LWC Scan %lld bytes (%d rows) in %9.6fs at %9fMB/s\n", e.totalbytes, e.rowcounter, tdiff, 1e-6*e.totalbytes/tdiff); printf("LWC Scan %lld bytes (%d rows) in %9.6fs at %9fMB/s\n", e.totalbytes, e.rowcounter, tdiff, 1e-6*e.totalbytes/tdiff);
print_engine_status();
} }
} }
...@@ -484,6 +508,7 @@ static void scanscan_verify (void) { ...@@ -484,6 +508,7 @@ static void scanscan_verify (void) {
double thistime = gettime(); double thistime = gettime();
double tdiff = thistime-prevtime; double tdiff = thistime-prevtime;
printf("verify %lld bytes (%d rows) in %9.6fs at %9fMB/s\n", v.totalbytes, v.rowcounter, tdiff, 1e-6*v.totalbytes/tdiff); printf("verify %lld bytes (%d rows) in %9.6fs at %9fMB/s\n", v.totalbytes, v.rowcounter, tdiff, 1e-6*v.totalbytes/tdiff);
print_engine_status();
} }
} }
......
...@@ -44,25 +44,41 @@ typedef struct __toku_db_btree_stat64 { ...@@ -44,25 +44,41 @@ typedef struct __toku_db_btree_stat64 {
} DB_BTREE_STAT64; } DB_BTREE_STAT64;
typedef struct __toku_engine_status { typedef struct __toku_engine_status {
char now[26]; /* time of engine status query (i.e. now) */ char now[26]; /* time of engine status query (i.e. now) */
u_int32_t ydb_lock_ctr; /* how many times has ydb lock been taken/released */ u_int64_t ydb_lock_ctr; /* how many times has ydb lock been taken/released */
u_int32_t logger_lock_ctr; /* how many times has logger lock been taken/released */ u_int64_t max_possible_sleep; /* max possible sleep time for ydb lock scheduling (constant) */
u_int64_t processor_freq_mhz; /* clock frequency in MHz */
u_int64_t max_requested_sleep; /* max sleep time requested, can be larger than max possible */
u_int64_t times_max_sleep_used; /* number of times the max_possible_sleep was used to sleep */
u_int64_t total_sleepers; /* total number of times a client slept for ydb lock scheduling */
u_int64_t total_sleep_time; /* total time spent sleeping for ydb lock scheduling */
u_int64_t max_waiters; /* max number of simultaneous client threads kept waiting for ydb lock */
u_int64_t total_waiters; /* total number of times a client thread waited for ydb lock */
u_int64_t total_clients; /* total number of separate client threads that use ydb lock */
u_int64_t time_ydb_lock_held_unavailable; /* number of times a thread migrated and theld is unavailable */
u_int64_t max_time_ydb_lock_held; /* max time a client thread held the ydb lock */
u_int64_t total_time_ydb_lock_held;/* total time client threads held the ydb lock */
u_int64_t logger_lock_ctr; /* how many times has logger lock been taken/released */
u_int32_t checkpoint_period; /* delay between automatic checkpoints */ u_int32_t checkpoint_period; /* delay between automatic checkpoints */
u_int32_t checkpoint_footprint; /* state of checkpoint procedure */ u_int32_t checkpoint_footprint; /* state of checkpoint procedure */
char checkpoint_time_begin[26]; /* time of last checkpoint begin */ char checkpoint_time_begin[26]; /* time of last checkpoint begin */
char checkpoint_time_begin_complete[26]; /* time of last complete checkpoint begin */ char checkpoint_time_begin_complete[26]; /* time of last complete checkpoint begin */
char checkpoint_time_end[26]; /* time of last checkpoint end */ char checkpoint_time_end[26]; /* time of last checkpoint end */
u_int32_t cachetable_lock_ctr; /* how many times has cachetable lock been taken/released */ u_int64_t cachetable_lock_taken; /* how many times has cachetable lock been taken */
u_int64_t cachetable_lock_released;/* how many times has cachetable lock been released */
u_int64_t cachetable_hit; /* how many cache hits */ u_int64_t cachetable_hit; /* how many cache hits */
u_int64_t cachetable_miss; /* how many cache misses */ u_int64_t cachetable_miss; /* how many cache misses */
u_int64_t cachetable_misstime; /* how many usec spent waiting for disk read because of cache miss */
u_int64_t cachetable_waittime; /* how many usec spent waiting for another thread to release cache line */
u_int64_t cachetable_wait_reading; /* how many times get_and_pin waits for a node to be read */ u_int64_t cachetable_wait_reading; /* how many times get_and_pin waits for a node to be read */
u_int64_t cachetable_wait_writing; /* how many times get_and_pin waits for a node to be written */ u_int64_t cachetable_wait_writing; /* how many times get_and_pin waits for a node to be written */
u_int64_t puts; /* how many times has a newly created node been put into the cachetable */ u_int64_t puts; /* how many times has a newly created node been put into the cachetable */
u_int64_t prefetches; /* how many times has a block been prefetched into the cachetable */ u_int64_t prefetches; /* how many times has a block been prefetched into the cachetable */
u_int64_t maybe_get_and_pins; /* how many times has get_and_pin been called */ u_int64_t maybe_get_and_pins; /* how many times has maybe_get_and_pin(_clean) been called */
u_int64_t maybe_get_and_pin_hits; /* how many times has get_and_pin() returned with a node */ u_int64_t maybe_get_and_pin_hits; /* how many times has get_and_pin(_clean) returned with a node */
int64_t cachetable_size_current; /* sum of the sizes of the nodes represented in the cachetable */ int64_t cachetable_size_current; /* sum of the sizes of the nodes represented in the cachetable */
int64_t cachetable_size_limit; /* the limit to the sum of the node sizes */ int64_t cachetable_size_limit; /* the limit to the sum of the node sizes */
int64_t cachetable_size_writing; /* the sum of the sizes of the nodes being written */ int64_t cachetable_size_writing; /* the sum of the sizes of the nodes being written */
int64_t get_and_pin_footprint; /* state of get_and_pin procedure */
u_int32_t range_locks_max; /* max total number of range locks */ u_int32_t range_locks_max; /* max total number of range locks */
u_int32_t range_locks_max_per_db; /* max range locks per dictionary */ u_int32_t range_locks_max_per_db; /* max range locks per dictionary */
u_int32_t range_locks_curr; /* total range locks currently in use */ u_int32_t range_locks_curr; /* total range locks currently in use */
...@@ -175,6 +191,7 @@ struct __toku_db_env { ...@@ -175,6 +191,7 @@ struct __toku_db_env {
int (*set_default_bt_compare) (DB_ENV*,int (*bt_compare) (DB *, const DBT *, const DBT *)) /* Set default (key) comparison function for all DBs in this environment. Required for RECOVERY since you cannot open the DBs manually. */; int (*set_default_bt_compare) (DB_ENV*,int (*bt_compare) (DB *, const DBT *, const DBT *)) /* Set default (key) comparison function for all DBs in this environment. Required for RECOVERY since you cannot open the DBs manually. */;
int (*set_default_dup_compare) (DB_ENV*,int (*bt_compare) (DB *, const DBT *, const DBT *)) /* Set default (val) comparison function for all DBs in this environment. Required for RECOVERY since you cannot open the DBs manually. */; int (*set_default_dup_compare) (DB_ENV*,int (*bt_compare) (DB *, const DBT *, const DBT *)) /* Set default (val) comparison function for all DBs in this environment. Required for RECOVERY since you cannot open the DBs manually. */;
int (*get_engine_status) (DB_ENV*, ENGINE_STATUS*) /* Fill in status struct */; int (*get_engine_status) (DB_ENV*, ENGINE_STATUS*) /* Fill in status struct */;
int (*get_engine_status_text) (DB_ENV*, char*, int) /* Fill in status text */;
int (*get_iname) (DB_ENV* env, DBT* dname_dbt, DBT* iname_dbt) /* lookup existing iname */; int (*get_iname) (DB_ENV* env, DBT* dname_dbt, DBT* iname_dbt) /* lookup existing iname */;
void *app_private; void *app_private;
void *api1_internal; void *api1_internal;
......
This diff is collapsed.
...@@ -249,19 +249,24 @@ void toku_cachetable_maybe_flush_some(CACHETABLE ct); ...@@ -249,19 +249,24 @@ void toku_cachetable_maybe_flush_some(CACHETABLE ct);
u_int64_t toku_cachefile_size_in_memory(CACHEFILE cf); u_int64_t toku_cachefile_size_in_memory(CACHEFILE cf);
typedef struct cachetable_status { typedef struct cachetable_status {
u_int32_t lock_ctr; u_int64_t lock_taken;
u_int64_t lock_released;
u_int64_t hit; u_int64_t hit;
u_int64_t miss; u_int64_t miss;
u_int64_t misstime; /* how many usec spent waiting for disk read because of cache miss */
u_int64_t waittime; /* how many usec spent waiting for another thread to release cache line */
u_int64_t wait_reading; u_int64_t wait_reading;
u_int64_t wait_writing; u_int64_t wait_writing;
u_int64_t puts; // how many times has a newly created node been put into the cachetable? u_int64_t puts; // how many times has a newly created node been put into the cachetable?
u_int64_t prefetches; // how many times has a block been prefetched into the cachetable? u_int64_t prefetches; // how many times has a block been prefetched into the cachetable?
u_int64_t maybe_get_and_pins; // how many times has get_and_pin been called? u_int64_t maybe_get_and_pins; // how many times has maybe_get_and_pin(_clean) been called?
u_int64_t maybe_get_and_pin_hits; // how many times has get_and_pin() returned with a node? u_int64_t maybe_get_and_pin_hits; // how many times has maybe_get_and_pin(_clean) returned with a node?
int64_t size_current; // the sum of the sizes of the nodes represented in the cachetable int64_t size_current; // the sum of the sizes of the nodes represented in the cachetable
int64_t size_limit; // the limit to the sum of the node sizes int64_t size_limit; // the limit to the sum of the node sizes
int64_t size_writing; // the sum of the sizes of the nodes being written int64_t size_writing; // the sum of the sizes of the nodes being written
u_int64_t get_and_pin_footprint;
} CACHETABLE_STATUS_S, *CACHETABLE_STATUS; } CACHETABLE_STATUS_S, *CACHETABLE_STATUS;
void toku_cachetable_get_status(CACHETABLE ct, CACHETABLE_STATUS s); void toku_cachetable_get_status(CACHETABLE ct, CACHETABLE_STATUS s);
......
...@@ -93,7 +93,7 @@ toku_rollback_fcreate (FILENUM filenum, ...@@ -93,7 +93,7 @@ toku_rollback_fcreate (FILENUM filenum,
char *fname = fixup_fname(&bs_fname); char *fname = fixup_fname(&bs_fname);
//Remove reference to the fd in the cachetable //Remove reference to the fd in the cachetable
CACHEFILE cf; CACHEFILE cf = NULL;
int r = toku_cachefile_of_filenum(txn->logger->ct, filenum, &cf); int r = toku_cachefile_of_filenum(txn->logger->ct, filenum, &cf);
assert(r == 0); assert(r == 0);
{ {
......
...@@ -215,7 +215,3 @@ toku_ydb_unlock(void) { ...@@ -215,7 +215,3 @@ toku_ydb_unlock(void) {
} }
int
toku_ydb_lock_ctr(void) {
return status.ydb_lock_ctr;
}
...@@ -87,13 +87,16 @@ typedef struct { ...@@ -87,13 +87,16 @@ typedef struct {
u_int64_t total_time_ydb_lock_held;/* total time client threads held the ydb lock */ u_int64_t total_time_ydb_lock_held;/* total time client threads held the ydb lock */
} SCHEDULE_STATUS_S, *SCHEDULE_STATUS; } SCHEDULE_STATUS_S, *SCHEDULE_STATUS;
int toku_ydb_lock_init(void); int toku_ydb_lock_init(void);
int toku_ydb_lock_destroy(void); int toku_ydb_lock_destroy(void);
void toku_ydb_lock(void); void toku_ydb_lock(void);
void toku_ydb_unlock(void); void toku_ydb_unlock(void);
int toku_ydb_lock_ctr(void);
void toku_ydb_lock_get_status(SCHEDULE_STATUS statp); void toku_ydb_lock_get_status(SCHEDULE_STATUS statp);
/* ********************************************************* /* *********************************************************
Error handling Error handling
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment