Commit 6eb1f14f authored by Bradley C. Kuszmaul's avatar Bradley C. Kuszmaul

txn_stat btree-stat

git-svn-id: file:///svn/tokudb@266 c7de825b-a66e-492c-adef-691d508d4ae1
parent 6c3438a1
......@@ -121,6 +121,20 @@ int main (int argc __attribute__((__unused__)), char *argv[] __attribute__((__un
assert(sizeof(db_env_fields32)==sizeof(db_env_fields64));
print_struct("db_env", 1, db_env_fields32, db_env_fields64, sizeof(db_env_fields32)/sizeof(db_env_fields32[0]));
assert(sizeof(db_key_range_fields32)==sizeof(db_key_range_fields64));
print_struct("db_key_range", 0, db_key_range_fields32, db_key_range_fields64, sizeof(db_key_range_fields32)/sizeof(db_key_range_fields32[0]));
assert(sizeof(db_lsn_fields32)==sizeof(db_lsn_fields64));
print_struct("db_lsn", 0, db_lsn_fields32, db_lsn_fields64, sizeof(db_lsn_fields32)/sizeof(db_lsn_fields32[0]));
assert(sizeof(db_txn_active_fields32)==sizeof(db_txn_active_fields64));
print_struct("db_txn_active", 0, db_txn_active_fields32, db_txn_active_fields64, sizeof(db_txn_active_fields32)/sizeof(db_txn_active_fields32[0]));
assert(sizeof(db_txn_stat_fields32)==sizeof(db_txn_stat_fields64));
print_struct("db_txn_stat", 0, db_txn_stat_fields32, db_txn_stat_fields64, sizeof(db_txn_stat_fields32)/sizeof(db_txn_stat_fields32[0]));
assert(sizeof(db_btree_stat_fields32)==sizeof(db_btree_stat_fields64));
print_struct("db_btree_stat", 0, db_btree_stat_fields32, db_btree_stat_fields64, sizeof(db_btree_stat_fields32)/sizeof(db_btree_stat_fields32[0]));
printf("#if defined(__cplusplus)\n}\n#endif\n");
printf("#endif\n");
return 0;
......
......@@ -140,16 +140,31 @@ void sample_db_txn_active_offsets (void) {
sort_and_dump_fields("db_txn_active", sizeof(DB_TXN_ACTIVE));
}
void sample_db_txn_stat_offsets (void) {
field_counter=0;
STRUCT_SETUP(DB_TXN_STAT, st_nactive, "u_int32_t %s");
STRUCT_SETUP(DB_TXN_STAT, st_txnarray, "DB_TXN_ACTIVE *%s");
sort_and_dump_fields("db_txn_stat", sizeof(DB_TXN_STAT));
}
void sample_db_btree_stat_offsets (void) {
field_counter=0;
STRUCT_SETUP(DB_BTREE_STAT, bt_ndata, "u_int32_t %s");
STRUCT_SETUP(DB_BTREE_STAT, bt_nkeys, "u_int32_t %s");
sort_and_dump_fields("db_btree_stat", sizeof(DB_BTREE_STAT));
}
int main (int argc __attribute__((__unused__)), char *argv[] __attribute__((__unused__))) {
open_file();
fprintf(outf, "/* BDB offsets on a %d-bit machine */\n", __WORDSIZE);
sample_db_offsets();
sample_dbt_offsets();
sample_db_txn_offsets();
sample_dbc_offsets();
sample_db_btree_stat_offsets();
sample_db_env_offsets();
sample_db_key_range_offsets();
sample_db_lsn_offsets();
sample_db_offsets();
sample_db_txn_active_offsets();
sample_db_txn_offsets();
sample_db_txn_stat_offsets();
sample_dbc_offsets();
sample_dbt_offsets();
return 0;
}
/* BDB offsets on a 32-bit machine */
struct fieldinfo db_fields32[] = {
{"void *app_private", 16, 4},
{"int (*close) (DB*, u_int32_t)", 272, 4},
{"int (*cursor) (DB *, DB_TXN *, DBC **, u_int32_t)", 276, 4},
{"int (*del) (DB *, DB_TXN *, DBT *, u_int32_t)", 280, 4},
{"int (*get) (DB *, DB_TXN *, DBT *, DBT *, u_int32_t)", 296, 4},
{"int (*key_range) (DB *, DB_TXN *, DBT *, DB_KEY_RANGE *, u_int32_t)", 316, 4},
{"int (*open) (DB *, DB_TXN *, const char *, const char *, DBTYPE, u_int32_t, int)", 320, 4},
{"int (*put) (DB *, DB_TXN *, DBT *, DBT *, u_int32_t)", 324, 4},
{"int (*remove) (DB *, const char *, const char *, u_int32_t)", 328, 4},
{"int (*rename) (DB *, const char *, const char *, const char *, u_int32_t)", 332, 4},
{"int (*set_flags) (DB *, u_int32_t)", 380, 4},
{"int (*stat) (DB *, void *, u_int32_t)", 396, 4},
{"int (*set_bt_compare) (DB *, int (*)(DB *, const DBT *, const DBT *))", 412, 4},
{0, 484, 484} /* size of whole struct */
};
struct fieldinfo dbt_fields32[] = {
{"void*data", 0, 4},
{"u_int32_t size", 4, 4},
{"u_int32_t ulen", 8, 4},
{"void*app_private", 20, 4},
{"u_int32_t flags", 24, 4},
{0, 28, 28} /* size of whole struct */
};
struct fieldinfo db_txn_fields32[] = {
{"int (*commit) (DB_TXN*, u_int32_t)", 80, 4},
{"u_int32_t (*id) (DB_TXN *)", 88, 4},
{0, 104, 104} /* size of whole struct */
};
struct fieldinfo dbc_fields32[] = {
{"int (*c_close) (DBC *)", 204, 4},
{"int (*c_del) (DBC *, u_int32_t)", 212, 4},
{"int (*c_get) (DBC *, DBT *, DBT *, u_int32_t)", 220, 4},
{0, 268, 268} /* size of whole struct */
struct fieldinfo db_btree_stat_fields32[] = {
{"u_int32_t bt_nkeys", 12, 4},
{"u_int32_t bt_ndata", 16, 4},
{0, 80, 80} /* size of whole struct */
};
struct fieldinfo db_env_fields32[] = {
{"int (*close) (DB_ENV *, u_int32_t)", 248, 4},
......@@ -67,8 +37,48 @@ struct fieldinfo db_key_range_fields32[] = {
struct fieldinfo db_lsn_fields32[] = {
{0, 8, 8} /* size of whole struct */
};
struct fieldinfo db_fields32[] = {
{"void *app_private", 16, 4},
{"int (*close) (DB*, u_int32_t)", 272, 4},
{"int (*cursor) (DB *, DB_TXN *, DBC **, u_int32_t)", 276, 4},
{"int (*del) (DB *, DB_TXN *, DBT *, u_int32_t)", 280, 4},
{"int (*get) (DB *, DB_TXN *, DBT *, DBT *, u_int32_t)", 296, 4},
{"int (*key_range) (DB *, DB_TXN *, DBT *, DB_KEY_RANGE *, u_int32_t)", 316, 4},
{"int (*open) (DB *, DB_TXN *, const char *, const char *, DBTYPE, u_int32_t, int)", 320, 4},
{"int (*put) (DB *, DB_TXN *, DBT *, DBT *, u_int32_t)", 324, 4},
{"int (*remove) (DB *, const char *, const char *, u_int32_t)", 328, 4},
{"int (*rename) (DB *, const char *, const char *, const char *, u_int32_t)", 332, 4},
{"int (*set_flags) (DB *, u_int32_t)", 380, 4},
{"int (*stat) (DB *, void *, u_int32_t)", 396, 4},
{"int (*set_bt_compare) (DB *, int (*)(DB *, const DBT *, const DBT *))", 412, 4},
{0, 484, 484} /* size of whole struct */
};
struct fieldinfo db_txn_active_fields32[] = {
{"u_int32_t txnid", 0, 4},
{"DB_LSN lsn", 8, 8},
{0, 16, 16} /* size of whole struct */
};
struct fieldinfo db_txn_fields32[] = {
{"int (*commit) (DB_TXN*, u_int32_t)", 80, 4},
{"u_int32_t (*id) (DB_TXN *)", 88, 4},
{0, 104, 104} /* size of whole struct */
};
struct fieldinfo db_txn_stat_fields32[] = {
{"u_int32_t st_nactive", 32, 4},
{"DB_TXN_ACTIVE *st_txnarray", 44, 4},
{0, 60, 60} /* size of whole struct */
};
struct fieldinfo dbc_fields32[] = {
{"int (*c_close) (DBC *)", 204, 4},
{"int (*c_del) (DBC *, u_int32_t)", 212, 4},
{"int (*c_get) (DBC *, DBT *, DBT *, u_int32_t)", 220, 4},
{0, 268, 268} /* size of whole struct */
};
struct fieldinfo dbt_fields32[] = {
{"void*data", 0, 4},
{"u_int32_t size", 4, 4},
{"u_int32_t ulen", 8, 4},
{"void*app_private", 20, 4},
{"u_int32_t flags", 24, 4},
{0, 28, 28} /* size of whole struct */
};
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