summaryrefslogtreecommitdiffstats
path: root/tapset/logging.stp
blob: eff7b55508f2532173cd518c4b1fbeb0e00bb4b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# This file contains simple bridging functions to the runtime

function print (msg:string) %{
    _stp_print (THIS->msg);
%}

// almost the same as print
function log (msg) {
    print (msg . "\n")
}

function printk (msg:string) %{
    printk (KERN_INFO "%s\n", THIS->msg);
%}

function warn (msg:string) %{
    _stp_warn ("%s", THIS->msg);
%}

// NB: exit() does *not* cause immediate return from current function/probe
function exit () %{
    _stp_exit ();
%}

function error (msg:string) %{
    CONTEXT->last_error = "called error()"; /* kill current probe */
    _stp_error ("%s", THIS->msg); /* implies _stp_exit */
%}