From ddcd4a1d43f7b3bc6edb5c431d4fd29bc72fa471 Mon Sep 17 00:00:00 2001 From: hunt Date: Mon, 18 Sep 2006 16:44:19 +0000 Subject: 2006-09-18 Martin Hunt * print.c (_stp_print_flush): Rewrite so one version works for relayfs or procfs. Use proper per-cpu functions. (_stp_reserve_bytes): New function. Reserve bytes in the output buffer. (_stp_print_binary): New function. Write a variable number of 64-bit values directly into the output buffer. * string.c (_stp_sprintf): Rewrite using new per-cpu buffers. (_stp_vsprintf): Ditto. (_stp_string_cat_cstr): Ditto. (_stp_string_cat_char): Ditto. * runtime.h: Set defaults for MAXTRYLOCK and TRYLOCKDELAY to make runtime tests in bench2 happy. --- runtime/runtime.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'runtime/runtime.h') diff --git a/runtime/runtime.h b/runtime/runtime.h index 84c79f79..dec664d5 100644 --- a/runtime/runtime.h +++ b/runtime/runtime.h @@ -63,6 +63,14 @@ static struct #define _stp_seq_inc() (atomic_inc_return(&_stp_seq.seq)) #endif /* RELAYFS */ +/* TEST_MODE is always defined by systemtap */ +#ifdef TEST_MODE +#define SYSTEMTAP 1 +#else +#define MAXTRYLOCK 1000 +#define TRYLOCKDELAY 100 +#endif + #include "print.c" #include "string.c" #include "arith.c" @@ -81,10 +89,6 @@ static const char * (*_stp_kallsyms_lookup)(unsigned long addr, unsigned long *offset, char **modname, char *namebuf); -/* TEST_MODE is always defined by systemtap */ -#ifdef TEST_MODE -#define SYSTEMTAP 1 -#endif #ifdef SYSTEMTAP /* This implementation is used if stap_[num_]symbols are available. */ @@ -161,7 +165,7 @@ int init_module (void) _stp_kallsyms_lookup = (const char * (*)(unsigned long,unsigned long *,unsigned long *,char **,char *)) kallsyms_lookup_name("kallsyms_lookup"); #endif - + return _stp_transport_init(); } -- cgit