[Gs-commits] Triton Repository branch, master, updated. 201961c65c83dbe6444f7403e40e1221c5220189
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Triton Repository". The branch, master has been updated via 201961c65c83dbe6444f7403e40e1221c5220189 (commit) via 0b8b87ae6c8707a6691ee63139477ce23eff7d7c (commit) via 7cb6f958c59fbf71e50f66531ecc670afd9dd474 (commit) from 0a7f810a04631a2c81b0a29a110ec6b4597d8fcb (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 201961c65c83dbe6444f7403e40e1221c5220189 Author: Phil Carns <[email protected]> Date: Tue Mar 9 16:58:23 2010 -0500 experimenting with debugging api commit 0b8b87ae6c8707a6691ee63139477ce23eff7d7c Author: Phil Carns <[email protected]> Date: Tue Mar 9 16:56:26 2010 -0500 successful return code for debug_init() commit 7cb6f958c59fbf71e50f66531ecc670afd9dd474 Author: Phil Carns <[email protected]> Date: Tue Mar 9 16:50:35 2010 -0500 error handling for debug register without init ----------------------------------------------------------------------- Summary of changes: code/src/common/triton-debug.c | 9 ++++++++- code/src/common/triton-error.c | 3 ++- code/src/common/triton-error.h | 1 + .../prototype/bdb-resource/bdb-resource.c | 12 ++++++++++-- code/src/versioned-osd/prototype/tests/vosd1.ae | 18 +++++++++++++++++- 5 files changed, 38 insertions(+), 5 deletions(-) Diff of changes: diff --git a/code/src/common/triton-debug.c b/code/src/common/triton-debug.c index 61c8d7b..7a201aa 100644 --- a/code/src/common/triton-debug.c +++ b/code/src/common/triton-debug.c @@ -3,7 +3,7 @@ #include "src/common/triton-hash.h" #include <stdio.h> -static struct triton_hash_table *triton_debug_mask_table; +static struct triton_hash_table *triton_debug_mask_table = NULL; uint64_t triton_debug_enabled_major = 0; uint32_t triton_debug_enabled_all = 0; @@ -36,6 +36,7 @@ triton_ret_t triton_debug_init(void) { return TRITON_ERR_NOMEM; } + return(TRITON_SUCCESS); } static triton_ret_t triton_idebug_add_mask(int major, char *str, uint32_t *value) @@ -43,7 +44,13 @@ static triton_ret_t triton_idebug_add_mask(int major, char *str, uint32_t *value uint32_t tmpval; struct triton_hash_link *llink; struct triton_debug_mask_entry *entry; + triton_mutex_lock(&triton_debug_mutex); + if(!triton_debug_mask_table) + { + triton_mutex_unlock(&triton_debug_mutex); + return(TRITON_ERR_NO_INIT); + } llink = triton_hash_search(triton_debug_mask_table, str); triton_mutex_unlock(&triton_debug_mutex); if(llink) diff --git a/code/src/common/triton-error.c b/code/src/common/triton-error.c index 4bd2103..d2b97a9 100644 --- a/code/src/common/triton-error.c +++ b/code/src/common/triton-error.c @@ -24,7 +24,8 @@ TRITON_ERROR_DEF(ERR_NOSYS, 5, "Not implemented"); TRITON_ERROR_DEF(ERR_OVERFLOW, 6, "Overflow"); TRITON_ERROR_DEF(ERR_SERVICE_NOTFOUND, 7, "Service not found"); TRITON_ERROR_DEF(ERR_MSG_METHOD_NOTFOUND, 8, "The message method was not found"); -TRITON_ERROR_DEF(ERR_AGAIN, 9, "Out of memory"); +TRITON_ERROR_DEF(ERR_AGAIN, 9, "Resource temporarily unavailable"); +TRITON_ERROR_DEF(ERR_NO_INIT, 10, "Component not initialized"); /* Used for errors where no mapping from an error number exists */ TRITON_ERROR_DEF(ERR_UNKNOWN, 4242, "Unknown"); diff --git a/code/src/common/triton-error.h b/code/src/common/triton-error.h index 6e61701..b4699da 100644 --- a/code/src/common/triton-error.h +++ b/code/src/common/triton-error.h @@ -59,6 +59,7 @@ TRITON_ERROR_DECL(ERR_OVERFLOW); TRITON_ERROR_DECL(ERR_SERVICE_NOTFOUND); TRITON_ERROR_DECL(ERR_MSG_METHOD_NOTFOUND); TRITON_ERROR_DECL(ERR_AGAIN); +TRITON_ERROR_DECL(ERR_NO_INIT); TRITON_ERROR_DECL(ERR_UNKNOWN); diff --git a/code/src/versioned-osd/prototype/bdb-resource/bdb-resource.c b/code/src/versioned-osd/prototype/bdb-resource/bdb-resource.c index 4e219bb..61c0c24 100644 --- a/code/src/versioned-osd/prototype/bdb-resource/bdb-resource.c +++ b/code/src/versioned-osd/prototype/bdb-resource/bdb-resource.c @@ -22,6 +22,7 @@ #include "src/common/triton-hash.h" #include "src/versioned-osd/prototype/bdb-resource/bdb-resource.h" #include "src/common/triton-error.h" +#include "src/common/triton-debug.h" #define BDB_DEFAULT_OPCACHE_SIZE 1024 @@ -31,6 +32,7 @@ static triton_mutex_t bdb_mutex = TRITON_MUTEX_INITIALIZER; static int triton_bdb_resource_id; static enum progress_mode triton_bdb_progress_mode = TRITON_PROG_NONE; +static triton_debug_mask_t bdb_r_mask; /* counter used by poll function in thread-per-op case to know if ops have * finished since last poll @@ -261,6 +263,13 @@ triton_ret_t bdb_init(enum progress_mode mode) { triton_ret_t ret; + /* register a debugging mask for use in this resource */ + ret = triton_debug_add_mask("bdb.resource", &bdb_r_mask); + if(ret != TRITON_SUCCESS) + { + return(ret); + } + ae_ops_init(&bdb_oplist); ret = TRITON_OPCACHE_INIT(struct bdb_op, op, BDB_DEFAULT_OPCACHE_SIZE, @@ -299,8 +308,7 @@ void bdb_finalize(void) ae_resource_unregister(triton_bdb_resource_id); ae_opcache_destroy(bdb_opcache); - /* TODO: make this a debugging message */ - printf("deadlock_counter: %lu\n", deadlock_counter); + triton_debug(bdb_r_mask, "bdb deadlock_counter: %lu\n", deadlock_counter); return; } diff --git a/code/src/versioned-osd/prototype/tests/vosd1.ae b/code/src/versioned-osd/prototype/tests/vosd1.ae index 8fd1123..4de1478 100644 --- a/code/src/versioned-osd/prototype/tests/vosd1.ae +++ b/code/src/versioned-osd/prototype/tests/vosd1.ae @@ -10,9 +10,22 @@ int main(int argc, char *argv[]) { int iret; triton_ret_t ret; - ae_context_t ctx; + ret = triton_debug_init(); + if(ret != TRITON_SUCCESS) + { + /* TODO: handle this properly, print message, etc. */ + assert(0); + } + + ret = triton_debug_stderr_enable("all"); + if(ret != TRITON_SUCCESS) + { + /* TODO: handle this properly, print message, etc. */ + assert(0); + } + ret = vosd_init("/tmp/cosd"); if(ret != TRITON_SUCCESS) { @@ -36,6 +49,9 @@ int main(int argc, char *argv[]) vosd_finalize(); + /* TODO: where is this function? */ + /* triton_debug_finalize(); */ + return 0; } hooks/post-receive -- Triton Repository
participants (1)
-
noreply@mcs.anl.gov