[asterisk-commits] mmichelson: branch mmichelson/lock_backtraces r116404 - in /team/mmichelson/l...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed May 14 14:21:48 CDT 2008


Author: mmichelson
Date: Wed May 14 14:21:48 2008
New Revision: 116404

URL: http://svn.digium.com/view/asterisk?view=rev&rev=116404
Log:
Updating and moving doxygen documentation to logger.h from logger.c
as suggested by Russell.


Modified:
    team/mmichelson/lock_backtraces/include/asterisk/logger.h
    team/mmichelson/lock_backtraces/main/logger.c

Modified: team/mmichelson/lock_backtraces/include/asterisk/logger.h
URL: http://svn.digium.com/view/asterisk/team/mmichelson/lock_backtraces/include/asterisk/logger.h?view=diff&rev=116404&r1=116403&r2=116404
==============================================================================
--- team/mmichelson/lock_backtraces/include/asterisk/logger.h (original)
+++ team/mmichelson/lock_backtraces/include/asterisk/logger.h Wed May 14 14:21:48 2008
@@ -221,21 +221,41 @@
 #define _LOGGER_BACKTRACE_H
 #ifdef HAVE_BKTR
 #define AST_MAX_BT_FRAMES 32
-/* I'd like to call this ast_backtrace, but that name is already taken by a function */
-/* \brief
- * Backtraces in code deal with some funky pointers, and so it's easier to store the info in 
- * an opaque structure and have function calls which act on the structure.
+/* \brief
+ *
+ * A structure to hold backtrace information. This structure provides an easy means to 
+ * store backtrace information or pass backtraces to other functions.
  */
 struct ast_bt {
+	/*! The addresses of the stack frames. This is filled in by calling the glibc backtrace() function */
 	void *addresses[AST_MAX_BT_FRAMES];
+	/*! The number of stack frames in the backtrace */
 	int num_frames;
+	/*! Tells if the ast_bt structure was dynamically allocated */
 	unsigned int alloced:1;
 };
 
+/* \brief
+ * Allocates memory for an ast_bt and stores addresses and symbols.
+ *
+ * \return Returns NULL on failure, or the allocated ast_bt on success
+ */
 struct ast_bt *ast_bt_create(void);
 
+/* \brief
+ * Fill an allocated ast_bt with addresses
+ *
+ * \retval 0 Success
+ * \retval -1 Failure
+ */
 int ast_bt_get_addresses(struct ast_bt *bt);
 
+/* \brief
+ * 
+ * Free dynamically allocated portions of an ast_bt
+ *
+ * \retval NULL.
+ */
 void *ast_bt_destroy(struct ast_bt *bt);
 
 #endif /* HAVE_BKTR */

Modified: team/mmichelson/lock_backtraces/main/logger.c
URL: http://svn.digium.com/view/asterisk/team/mmichelson/lock_backtraces/main/logger.c?view=diff&rev=116404&r1=116403&r2=116404
==============================================================================
--- team/mmichelson/lock_backtraces/main/logger.c (original)
+++ team/mmichelson/lock_backtraces/main/logger.c Wed May 14 14:21:48 2008
@@ -1129,11 +1129,6 @@
 
 #ifdef HAVE_BKTR
 
-/* \brief
- * Allocates memory for an ast_bt and stores addresses and symbols.
- *
- * \return Returns NULL on failure, or the allocated ast_bt on success
- */
 struct ast_bt *ast_bt_create(void) 
 {
 	struct ast_bt *bt = ast_calloc(1, sizeof(*bt));
@@ -1149,13 +1144,6 @@
 	return bt;
 }
 
-/* \brief
- * Fill an allocated ast_bt with addresses and symbols
- * This is inlined so that this function will not show up in the backtrace record.
- *
- * \retval 0 Success
- * \retval -1 Failure
- */
 int ast_bt_get_addresses(struct ast_bt *bt)
 {
 	bt->num_frames = backtrace(bt->addresses, AST_MAX_BT_FRAMES);
@@ -1163,10 +1151,6 @@
 	return 0;
 }
 
-/* \brief
- * Free the dynamically allocated portions of the ast_bt structure provided.
- * \retval NULL.
- */
 void *ast_bt_destroy(struct ast_bt *bt)
 {
 	if (bt->alloced) {




More information about the asterisk-commits mailing list