A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Stop build the log strings on the stack: we are multi-threaded now, and this is like...
[simgrid.git]
/
src
/
xbt
/
xbt_log_layout_simple.c
diff --git
a/src/xbt/xbt_log_layout_simple.c
b/src/xbt/xbt_log_layout_simple.c
index
adc5da5
..
9185cb2
100644
(file)
--- a/
src/xbt/xbt_log_layout_simple.c
+++ b/
src/xbt/xbt_log_layout_simple.c
@@
-15,11
+15,9
@@
extern const char *xbt_log_priority_names[7];
extern const char *xbt_log_priority_names[7];
-
-static char *xbt_log_layout_simple_doit(xbt_log_layout_t l,
- xbt_log_event_t ev,
- const char *fmt) {
- static char res[1024];
+static void xbt_log_layout_simple_doit(xbt_log_layout_t l,
+ xbt_log_event_t ev,
+ const char *fmt) {
static double begin_of_time = -1;
char *p;
static double begin_of_time = -1;
char *p;
@@
-32,12
+30,12
@@
static char *xbt_log_layout_simple_doit(xbt_log_layout_t l,
if (begin_of_time<0)
begin_of_time=gras_os_time();
if (begin_of_time<0)
begin_of_time=gras_os_time();
- p =
res
;
- p += sprintf(
res
,"[");;
+ p =
ev->buffer
;
+ p += sprintf(
p
,"[");;
/* Display the proc info if available */
if(strlen(xbt_procname()))
/* Display the proc info if available */
if(strlen(xbt_procname()))
- p += sprintf(p,"%s:%s:(%d)
:%s
",
- gras_os_myname(), xbt_procname(),(*xbt_getpid)()
,xbt_thread_self_name()
);
+ p += sprintf(p,"%s:%s:(%d) ",
+ gras_os_myname(), xbt_procname(),(*xbt_getpid)());
/* Display the date */
p += sprintf(p,"%f] ", gras_os_time()-begin_of_time);
/* Display the date */
p += sprintf(p,"%f] ", gras_os_time()-begin_of_time);
@@
-57,7
+55,6
@@
static char *xbt_log_layout_simple_doit(xbt_log_layout_t l,
/* End it */
p += sprintf(p, "\n");
/* End it */
p += sprintf(p, "\n");
- return res;
}
xbt_log_layout_t xbt_log_layout_simple_new(char *arg) {
}
xbt_log_layout_t xbt_log_layout_simple_new(char *arg) {