[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r7704 - in flightrecorder/src: include libflightrecorder
From: |
gnunet |
Subject: |
[GNUnet-SVN] r7704 - in flightrecorder/src: include libflightrecorder |
Date: |
Sat, 13 Sep 2008 08:34:34 -0600 (MDT) |
Author: durner
Date: 2008-09-13 08:34:34 -0600 (Sat, 13 Sep 2008)
New Revision: 7704
Modified:
flightrecorder/src/include/flightrecorder.h
flightrecorder/src/libflightrecorder/clientapi.c
flightrecorder/src/libflightrecorder/func.c
flightrecorder/src/libflightrecorder/stack_trace.c
Log:
use caller thread id
Modified: flightrecorder/src/include/flightrecorder.h
===================================================================
--- flightrecorder/src/include/flightrecorder.h 2008-09-13 14:33:48 UTC (rev
7703)
+++ flightrecorder/src/include/flightrecorder.h 2008-09-13 14:34:34 UTC (rev
7704)
@@ -128,7 +128,7 @@
* @param function name of the function that is called
* @return 1 on success, 0 otherwise
*/
-int fr_srv_st_enter(struct FR_Session *ses, char *file, unsigned int line,
char *function);
+int fr_srv_st_enter(struct FR_Session *ses, unsigned int tid, char *file,
unsigned int line, char *function);
/**
* @brief Remove function from the stack trace
@@ -138,7 +138,7 @@
* @param function name of the function that is called
* @return 1 on success, 0 otherwise
*/
-int fr_srv_st_leave(struct FR_Session *ses, char *file, unsigned int line,
char *function);
+int fr_srv_st_leave(struct FR_Session *ses, unsigned int tid, char *file,
unsigned int line, char *function);
/**
* @brief Add a info to the last stack trace entry
@@ -146,7 +146,7 @@
* @param info diagnostics information/log/...
* @return 1 on success, 0 on error
*/
-int fr_srv_st_add_info(struct FR_Session *ses, char *info);
+int fr_srv_st_add_info(struct FR_Session *ses, unsigned int tid, char *info);
/**
* @brief Return the stack trace for a particular thread
Modified: flightrecorder/src/libflightrecorder/clientapi.c
===================================================================
--- flightrecorder/src/libflightrecorder/clientapi.c 2008-09-13 14:33:48 UTC
(rev 7703)
+++ flightrecorder/src/libflightrecorder/clientapi.c 2008-09-13 14:34:34 UTC
(rev 7704)
@@ -37,7 +37,7 @@
*/
int fr_st_enter(char *file, unsigned int line, char *function)
{
- return fr_srv_st_enter(fr_session_get_local(), file, line, function);
+ return fr_srv_st_enter(fr_session_get_local(), fr_thread_get_tid(), file,
line, function);
}
/**
@@ -49,7 +49,7 @@
*/
int fr_st_leave(char *file, unsigned int line, char *function)
{
- return fr_srv_st_leave(fr_session_get_local(), file, line, function);
+ return fr_srv_st_leave(fr_session_get_local(), fr_thread_get_tid(), file,
line, function);
}
/**
@@ -59,7 +59,7 @@
*/
int fr_st_add_info(char *info)
{
- return fr_srv_st_add_info(fr_session_get_local(), info);
+ return fr_srv_st_add_info(fr_session_get_local(), fr_thread_get_tid(), info);
}
/**
Modified: flightrecorder/src/libflightrecorder/func.c
===================================================================
--- flightrecorder/src/libflightrecorder/func.c 2008-09-13 14:33:48 UTC (rev
7703)
+++ flightrecorder/src/libflightrecorder/func.c 2008-09-13 14:34:34 UTC (rev
7704)
@@ -22,33 +22,33 @@
#include "flightrecorder.h"
-int fr_srv_func_enter(struct FR_Session *ses, char *file, unsigned int line,
char *function)
+int fr_srv_func_enter(struct FR_Session *ses, unsigned int tid, char *file,
unsigned int line, char *function)
{
if (fr_srv_opt_get_int(ses, FR_OPT_RECORD_STACK_TRACE))
{
- if (!fr_srv_st_enter(ses, file, line, function))
+ if (!fr_srv_st_enter(ses, tid, file, line, function))
return 0;
}
return 1;
}
-int fr_srv_func_leave(struct FR_Session *ses, char *file, unsigned int line,
char *function)
+int fr_srv_func_leave(struct FR_Session *ses, unsigned int tid, char *file,
unsigned int line, char *function)
{
if (fr_srv_opt_get_int(ses, FR_OPT_RECORD_STACK_TRACE))
{
- if (!fr_srv_st_leave(ses, file, line, function))
+ if (!fr_srv_st_leave(ses, tid, file, line, function))
return 0;
}
return 1;
}
-int fr_srv_func_add_info(struct FR_Session *ses, char *info)
+int fr_srv_func_add_info(struct FR_Session *ses, unsigned int tid, char *info)
{
if (fr_srv_opt_get_int(ses, FR_OPT_RECORD_STACK_TRACE))
{
- if (!fr_srv_st_add_info(ses, info))
+ if (!fr_srv_st_add_info(ses, tid, info))
return 0;
}
Modified: flightrecorder/src/libflightrecorder/stack_trace.c
===================================================================
--- flightrecorder/src/libflightrecorder/stack_trace.c 2008-09-13 14:33:48 UTC
(rev 7703)
+++ flightrecorder/src/libflightrecorder/stack_trace.c 2008-09-13 14:34:34 UTC
(rev 7704)
@@ -61,17 +61,18 @@
/**
* @brief Add function to the stack trace
* @param ses C/S session
+ * @param tid calling thread id
* @param file source file from which the function is called
* @param line source line from which the function is called
* @param function name of the function that is called
* @return 1 on success, 0 otherwise
*/
-int fr_srv_st_enter(struct FR_Session *ses, char *file, unsigned int line,
char *function)
+int fr_srv_st_enter(struct FR_Session *ses, unsigned int tid, char *file,
unsigned int line, char *function)
{
struct StackTrace *trace;
struct StackTraceEntry *entry;
- trace = get_trace(ses, fr_thread_get_tid());
+ trace = get_trace(ses, tid);
if (!trace)
return 0;
@@ -96,16 +97,17 @@
/**
* @brief Remove function from the stack trace
* @param ses C/S session
+ * @param tid calling thread id
* @param file source file from which the function is called
* @param line source line from which the function is called
* @param function name of the function that is called
* @return 1 on success, 0 otherwise
*/
-int fr_srv_st_leave(struct FR_Session *ses, char *file, unsigned int line,
char *function)
+int fr_srv_st_leave(struct FR_Session *ses, unsigned int tid, char *file,
unsigned int line, char *function)
{
struct StackTrace *trace;
- trace = get_trace(ses, fr_thread_get_tid());
+ trace = get_trace(ses, tid);
if (!trace || trace->depth == 0)
return 0;
@@ -134,15 +136,16 @@
/**
* @brief Add a info to the last stack trace entry
* @param ses C/S session
+ * @param tid calling thread id
* @param info diagnostics information/log/...
* @return 1 on success, 0 on error
*/
-int fr_srv_st_add_info(struct FR_Session *ses, char *info)
+int fr_srv_st_add_info(struct FR_Session *ses, unsigned int tid, char *info)
{
struct StackTrace *trace;
struct StackTraceEntry *entry;
- trace = get_trace(ses, fr_thread_get_tid());
+ trace = get_trace(ses, tid);
if (!trace || !trace->depth)
return 0;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r7704 - in flightrecorder/src: include libflightrecorder,
gnunet <=