summaryrefslogtreecommitdiffstats
path: root/tapset/builtin_logging.stp
diff options
context:
space:
mode:
authorfche <fche>2005-08-12 19:43:55 +0000
committerfche <fche>2005-08-12 19:43:55 +0000
commit3a20432bc0a0aa6d8651561d508cc730e6dabc97 (patch)
tree2d957fcf675df9a8f3a909ab51f1177ae4854137 /tapset/builtin_logging.stp
parentba3f9e9ebb1b8cae641159305031ec5fee637fd4 (diff)
downloadsystemtap-steved-3a20432bc0a0aa6d8651561d508cc730e6dabc97.tar.gz
systemtap-steved-3a20432bc0a0aa6d8651561d508cc730e6dabc97.tar.xz
systemtap-steved-3a20432bc0a0aa6d8651561d508cc730e6dabc97.zip
2005-08-12 Frank Ch. Eigler <fche@elastic.org>
PR systemtap/1122 et alii * parse.cxx (parse_literal): Parse and range-limit 64-bit numbers. (parse_unary): Correct precedence glitch. * staptree.h (literal_number): Store an int64_t. * staptree.cxx: Corresponding changes. * translate.cxx (check_dbz): Remove - insufficient. (emit_function): Define CONTEXT macro sibling for THIS. (c_typename): pe_long -> int64_t. (visit_literal_number): Format literal rigorously and uglily. (c_assignop, visit_binary_expression): Handle div/mod via new helper functions in runtime. * tapset/builtin_logging.stp: Add error, exit builtins. * testsuite/buildok/ten,eleven.stp: New tests. * testsuite/parse{ko,ok}/six.stp: Modify for larger numbers. * testsuite/transok/one.stp: Add more ";"s, maybe unnecessarily. 2005-08-12 Frank Ch. Eigler <fche@elastic.org> * arith.c: New file to contain arithmetic helper functions. * builtin_functions.h: Remove, unused. * runtime.h: Include it.
Diffstat (limited to 'tapset/builtin_logging.stp')
-rw-r--r--tapset/builtin_logging.stp20
1 files changed, 19 insertions, 1 deletions
diff --git a/tapset/builtin_logging.stp b/tapset/builtin_logging.stp
index 51fb97e4..11b00cab 100644
--- a/tapset/builtin_logging.stp
+++ b/tapset/builtin_logging.stp
@@ -1,3 +1,5 @@
+# This file contains simple bridging functions to the runtime
+
function _log (msg) %{
_stp_log (THIS->msg);
%}
@@ -5,6 +7,7 @@ function _log (msg) %{
function log (msg) {
_log (msg . "")
}
+
function _printk (msg) %{
printk (KERN_INFO "%s\n", THIS->msg);
%}
@@ -12,10 +15,25 @@ function _printk (msg) %{
function printk (msg) {
_printk (msg . "")
}
+
function _warn (msg) %{
- _stp_warn (THIS->msg);
+ _stp_warn ("%s", THIS->msg);
%}
function warn (msg) {
_warn (msg . "")
}
+
+function exit () %{
+ CONTEXT->errorcount ++; /* kill current probe */
+ _stp_exit ();
+%}
+
+function _error (msg) %{
+ CONTEXT->errorcount ++; /* kill current probe */
+ _stp_error ("%s", THIS->msg); /* implies _stp_exit */
+%}
+
+function error (msg) {
+ _error (msg . "")
+}