Chapter 16. Logging Tapset
This family of functions is used to send simple message strings to various destinations.
Name
function::log — Send a line to the common trace buffer.
Synopsis
function log(msg:string)
Arguments
msg
The formatted message string.
General Syntax
log(msg:string)
Description
This function logs data. log sends the message immediately to staprun and to the bulk transport (relayfs) if it is being used. If the last character given is not a newline, then one is added. This function is not as effecient as printf and should be used only for urgent messages.
Name
function::warn — Send a line to the warning stream.
Synopsis
function warn(msg:string)
Arguments
msg
The formatted message string.
General Syntax
warn (msg:string)
Description
This function sends a warning message immediately to staprun. It is also sent over the bulk transport (relayfs) if it is being used. If the last characater is not a newline, the one is added.
Name
function::exit — Start shutting down probing script.
Description
This only enqueues a request to start shutting down the script. New probes will not fire (except “end” probes), but all currently running ones may complete their work.
Name
function::error — Send an error message.
Synopsis
function error(msg:string)
Arguments
msg
The formatted message string.
Description
An implicit end-of-line is added. staprun prepends the string “ERROR:”. Sending an error message aborts the currently running probe. Depending on the MAXERRORS parameter, it may trigger an exit
.
Name
function::ftrace — Send a message to the ftrace ring-buffer.
Synopsis
function ftrace(msg:string)
Arguments
msg
The formatted message string.
Description
If the ftrace ring-buffer is configured & available, see /debugfs/tracing/trace for the message. Otherwise, the message may be quietly dropped. An implicit end-of-line is added.