diff options
author | hunt <hunt> | 2005-06-18 07:24:42 +0000 |
---|---|---|
committer | hunt <hunt> | 2005-06-18 07:24:42 +0000 |
commit | e5d2abb56ca57a613e4ef9398a6499190b2265be (patch) | |
tree | 083465047d73bc498f2278d2eb3dc8514b455ad3 /runtime/string.c | |
parent | ef0e92b0335077884edd5ac9997a203bec1839b0 (diff) | |
download | systemtap-steved-e5d2abb56ca57a613e4ef9398a6499190b2265be.tar.gz systemtap-steved-e5d2abb56ca57a613e4ef9398a6499190b2265be.tar.xz systemtap-steved-e5d2abb56ca57a613e4ef9398a6499190b2265be.zip |
2005-06-18 Martin Hunt <hunt@redhat.com>
* counter.c: New file. Counter aggregations.
* stat.c: New file. Stat aggregations.
* stat.h: Header file for stats.
* map-int.c: New file. Support for int64 values.
* map-stat.c: New file. Support for stat values.
* map-str.c: New file. Support for string values.
* map-values.c: Now just includes the necessary map-*.c files.
* stat-common.c: New file. Stats stuff common to Stats and maps
containing stats.
* Doxyfile: Bumped version to 0.6.
* README: Renamed README.doc and reorganized.
Diffstat (limited to 'runtime/string.c')
-rw-r--r-- | runtime/string.c | 30 |
1 files changed, 1 insertions, 29 deletions
diff --git a/runtime/string.c b/runtime/string.c index 4d5a9c83..6ef26190 100644 --- a/runtime/string.c +++ b/runtime/string.c @@ -1,44 +1,17 @@ #ifndef _STRING_C_ /* -*- linux-c -*- */ #define _STRING_C_ -#ifndef STP_NUM_STRINGS -#define STP_NUM_STRINGS 0 -#endif - #include <linux/config.h> +#include "string.h" /** @file string.c * @brief Implements String type. */ /** @addtogroup string String Functions * - * One of the biggest restrictions the library has is that it cannot allocate things like strings off the stack. - * It is also not a good idea to dynamically allocate space for strings with kmalloc(). That leaves us with - * statically allocated space for strings. This is what is implemented in the String module. Strings use - * preallocated per-cpu buffers and are safe to use (unlike C strings). * @{ */ -/** Maximum string size allowed in Strings */ -#ifndef STP_STRING_SIZE -#define STP_STRING_SIZE 2048 -#endif - -struct string { - int len; - char buf[STP_STRING_SIZE]; -}; - -static struct string _stp_string[STP_NUM_STRINGS][NR_CPUS]; - -typedef struct string *String; - -/* set up a special stdout string */ -static struct string __stp_stdout; -String _stp_stdout = &__stp_stdout; - -void _stp_vsprintf (String str, const char *fmt, va_list args); - /** Initialize a String for our use. * This grabs one of the global Strings for our temporary use. * @@ -212,7 +185,6 @@ char * _stp_string_ptr (String str) return str->buf; } - /** ConCATenate (append) a String or C string to a String. * This macro selects the proper function to call. * @param str1 A String |