diff options
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/ChangeLog | 4 | ||||
-rw-r--r-- | runtime/builtin_functions.h | 60 |
2 files changed, 64 insertions, 0 deletions
diff --git a/runtime/ChangeLog b/runtime/ChangeLog index 74a5808e..3be80bf4 100644 --- a/runtime/ChangeLog +++ b/runtime/ChangeLog @@ -1,3 +1,7 @@ +2005-07-11 Graydon Hoare <graydon@redhat.com> + + * builtin_functions.h: New file. + 2005-07-10 Martin Hunt <hunt@redhat.com> * runtime.h (init_module): Fix return value. diff --git a/runtime/builtin_functions.h b/runtime/builtin_functions.h new file mode 100644 index 00000000..13be00fb --- /dev/null +++ b/runtime/builtin_functions.h @@ -0,0 +1,60 @@ +#ifndef _BUILTIN_FUNCTIONS_ +#define _BUILTIN_FUNCTIONS_ + +/* Builtin function definitions. + * Copyright (C) 2005 Red Hat Inc. + * + * This file is part of systemtap, and is free software. You can + * redistribute it and/or modify it under the terms of the GNU General + * Public License (GPL); either version 2, or (at your option) any + * later version. + */ + +/* + * This file contains definitions for "builtin functions" which are + * registered in the systemtap translator, but given no definition. + * The translator emits calls to builtins exactly the same way it + * emits calls to functions written in the systemtap language; the + * only difference is that this file (or a C tapset) must supply the + * definition. + * + * Every builtin function "foo" called by a systemtap script is + * translated to a C call to a C function named "function_foo". This + * is the function you must provide in this file. In addition, the + * translator emits a + * + * #define _BUILTIN_FUNCTION_foo_ + * + * symbol for each such function called, which you can use to elide + * function definitions which are not used by a given systemtap + * script. + */ + +#ifdef _BUILTIN_FUNCTION_printk_ +static void +function_printk (struct context *c) +{ + printk (KERN_INFO, c->locals[c->nesting].function_printk.message); +} +#endif /* _BUILTIN_FUNCTION_printk_ */ + + +#ifdef _BUILTIN_FUNCTION_log_ +static void +function_log (struct context *c) +{ + _stp_log (c->locals[c->nesting].function_log.message); +} +#endif /* _BUILTIN_FUNCTION_log_ */ + + +#ifdef _BUILTIN_FUNCTION_warn_ +static void +function_warn (struct context *c) +{ + _stp_warn (c->locals[c->nesting].function_warn.message); +} +#endif /* _BUILTIN_FUNCTION_warn_ */ + + +#endif /* _BUILTIN_FUNCTIONS_ */ |