* tapset/ioscheduler.stp : Make probe optional.
* tapset/irq.stp : Ditto.
* tapset/scheduler.stp : Ditto.
* tapset/tcpmib.stp : Ditto.
* tapset/linuxmib.stp : Switch variable by version.
* tapset/tty.stp : Ditto.
* testsuite/buildok/irq.stp : Make probe test optional.
* testsuite/buildok/tty.stp : Ditto.
* testsuite/systemtap.examples/network/netdev.stp : Ditto.
* testsuite/buildok/tcpmib-all-probes.stp : Add embedded functions.
*
*/
probe ioscheduler.elv_add_request.tp
- = kernel.trace("block_rq_insert")
+ = kernel.trace("block_rq_insert") ?
{
q = $q
elevator_name = kernel_string($q->elevator->elevator_type->elevator_name)
*
*/
probe ioscheduler_trace.elv_completed_request
- = kernel.trace("block_rq_complete")
+ = kernel.trace("block_rq_complete") ?
{
elevator_name = kernel_string($q->elevator->elevator_type->elevator_name)
rq = $rq
*
*/
probe ioscheduler_trace.elv_issue_request
- = kernel.trace("block_rq_issue")
+ = kernel.trace("block_rq_issue") ?
{
elevator_name = kernel_string($q->elevator->elevator_type->elevator_name)
rq = $rq
*
*/
probe ioscheduler_trace.elv_requeue_request
- = kernel.trace("block_rq_requeue")
+ = kernel.trace("block_rq_requeue") ?
{
elevator_name = kernel_string($q->elevator->elevator_type->elevator_name)
rq = $rq
*
*/
probe ioscheduler_trace.elv_abort_request
- = kernel.trace("block_rq_abort")
+ = kernel.trace("block_rq_abort") ?
{
elevator_name = kernel_string($q->elevator->elevator_type->elevator_name)
rq = $rq
* @rq_queue : request queue
*
*/
-probe ioscheduler_trace.plug = kernel.trace("block_plug")
+probe ioscheduler_trace.plug = kernel.trace("block_plug") ?
{
rq_queue = $q
}
* @rq_queue : request queue
*
*/
-probe ioscheduler_trace.unplug_io = kernel.trace("block_unplug_io")
+probe ioscheduler_trace.unplug_io = kernel.trace("block_unplug_io") ?
{
rq_queue = $q
}
* @rq_queue : request queue
*
*/
-probe ioscheduler_trace.unplug_timer = kernel.trace("block_unplug_timer")
+probe ioscheduler_trace.unplug_timer = kernel.trace("block_unplug_timer") ?
{
rq_queue = $q
}
* @wq_thread : task_struct of the workqueue thread.
* @cpu : cpu for which the worker thread is created.
*/
-probe workqueue.create = kernel.trace("workqueue_creation")
+probe workqueue.create = kernel.trace("workqueue_creation") ?
{
wq_thread = $wq_thread
cpu = $cpu
* @work : work_struct* being queued.
* @work_func : pointer to handler func.
*/
-probe workqueue.insert = kernel.trace("workqueue_insertion")
+probe workqueue.insert = kernel.trace("workqueue_insertion") ?
{
wq_thread = $wq_thread
work = $work
* @work : work_struct* being executed.
* @work_func : pointer to handler func.
*/
-probe workqueue.execute = kernel.trace("workqueue_execution")
+probe workqueue.execute = kernel.trace("workqueue_execution") ?
{
wq_thread = $wq_thread
work = $work
* probe workqueue.destroy : probes destruction of each worker thread of each cpu for a workqueue.
* @wq_thread : task_struct of the workqueue thread.
*/
-probe workqueue.destroy = kernel.trace("workqueue_destruction")
+probe workqueue.destroy = kernel.trace("workqueue_destruction") ?
{
wq_thread = $wq_thread
}
* @thread : thread pointer for threaded interrupts.
* @thread_flags : Flags related to thread.
*/
-probe irq_handler.entry = kernel.trace("irq_handler_entry")
+probe irq_handler.entry = kernel.trace("irq_handler_entry") ?
{
irq = $irq
action = $action
* @thread : thread pointer for threaded interrupts.
* @thread_flags : Flags related to thread.
*/
-probe irq_handler.exit = kernel.trace("irq_handler_exit")
+probe irq_handler.exit = kernel.trace("irq_handler_exit") ?
{
irq = $irq
action = $action
* @vec : softirq_action vector.
* @action : pointer to softirq handler just about to execute.
*/
-probe softirq.entry = kernel.trace("softirq_entry")
+probe softirq.entry = kernel.trace("softirq_entry") ?
{
h = $h
vec = $vec
* @vec : softirq_action vector.
* @action : pointer to softirq handler that just finished execution.
*/
-probe softirq.exit = kernel.trace("softirq_exit")
+probe softirq.exit = kernel.trace("softirq_exit") ?
{
h = $h
vec = $vec
*/
probe linuxmib.TCPMemoryPressures=kernel.function("tcp_enter_memory_pressure")
{
+%( kernel_v >= "2.6.27" %?
sk = $sk
+%:
+ sk = 0;
+%)
op = 1;
if ( $tcp_memory_pressure ) next
key = linuxmib_filter_key(sk,op);
}
probe __scheduler.migrate.kp = kernel.function("set_task_cpu")
{
+%( kernel_v >= "2.6.23" %?
cpu_to = $new_cpu
+%:
+ cpu_to = $cpu
+%)
}
probe __scheduler.migrate.tp = kernel.trace("sched_migrate_task")
{
* @pid: pid of the process sending signal
* @signal_number: signal number
*/
-probe __scheduler.signal_send.kp = kernel.function("__send_signal")
+probe __scheduler.signal_send.kp = kernel.function("__send_signal") !,
+ kernel.function("send_signal")
{
pid = $t->tgid
}
CATCH_DEREF_FAULT();
%}
+function tcpmib_filter_key:long (sk:long, op:long) {
+ // ensure all these functions will build
+ if ( tcpmib_get_state(sk) ) return 0
+ if ( tcpmib_local_addr(sk) ) return 0
+ if ( tcpmib_remote_addr(sk) ) return 0
+ if ( tcpmib_local_port(sk) ) return 0
+ if ( tcpmib_remote_port(sk) ) return 0
+ return op
+}
+
/**
* probe tcpmib.ActiveOpens - Count an active opening of a socket.
* @sk: Pointer to the struct sock being acted on.
*
*/
probe
-tcpmib.InSegs=kernel.function("__inet_lookup_established").return
+tcpmib.InSegs=kernel.function("__inet_lookup_established").return ?
{
sk=$return
op=1
probe
tcpmib.OutRsts.A=kernel.function("tcp_v4_send_reset")
{
+%( kernel_v >= "2.6.20" %?
sk = $sk;
+%:
+ sk = 0;
+%)
skb = $skb
op = 1;
if ( _is_reset(skb) ) next
inode_state = $inode->i_state
inode_flags = $inode->i_flags
+%( kernel_v >= "2.6.20" %?
file_name = d_name($filp->f_path->dentry)
+%:
+ file_name = d_name($filp->f_dentry)
+%)
file_mode = $filp->f_mode
file_flags = $filp->f_flags
}
inode_state = $inode->i_state
inode_flags = $inode->i_flags
+%( kernel_v >= "2.6.20" %?
file_name = d_name($filp->f_path->dentry)
+%:
+ file_name = d_name($filp->f_dentry)
+%)
file_mode = $filp->f_mode
file_flags = $filp->f_flags
}
* @new_ypixel: the new ypixel value
* @new_xpixel: the new xpixel value
*/
-probe tty.resize = kernel.function("tty_do_resize"){
+probe tty.resize = kernel.function("tty_do_resize") ? {
name = kernel_string($tty->name)
old_row = $tty->winsize->ws_row
old_col = $tty->winsize->ws_col
* @arg: the ioctl argument
*/
probe tty.ioctl = kernel.function("tty_ioctl"){
+%( kernel_v >= "2.6.20" %?
name = kernel_string($file->f_path->dentry->d_iname)
+%:
+ name = kernel_string($file->f_dentry->d_iname)
+%)
cmd = $cmd
arg = $arg
* @name: the driver .dev_name name
* @module: the module name
*/
-probe tty.init = kernel.function("tty_init_dev"){
+probe tty.init = kernel.function("tty_init_dev") ? {
driver_name = kernel_string($driver->driver_name)
name = kernel_string($driver->name)
module = kernel_string($driver->owner->name)
* @wait_key: the wait queue key
*/
probe tty.poll = kernel.function("tty_poll"){
+%( kernel_v >= "2.6.20" %?
file_name = d_name($filp->f_path->dentry)
+%:
+ file_name = d_name($filp->f_dentry)
+%)
+%( kernel_v >= "2.6.31" %?
if ($wait)
wait_key = $wait->key
else
+%)
wait_key = 0
}
* @driver_name: the driver name
* @file_name: the file name lreated to the tty
*/
-probe tty.write = kernel.function("n_tty_write"){
+probe tty.write = kernel.function("n_tty_write") ? {
buffer = kernel_string($buf)
nr = $nr
+%( kernel_v >= "2.6.20" %?
file_name = d_name($file->f_path->dentry)
+%:
+ file_name = d_name($file->f_dentry)
+%)
driver_name = kernel_string($tty->driver->driver_name)
}
* @driver_name: the driver name
* @file_name: the file name lreated to the tty
*/
-probe tty.read = kernel.function("n_tty_read"){
+probe tty.read = kernel.function("n_tty_read") ? {
buffer = kernel_string($buf)
nr = $nr
+%( kernel_v >= "2.6.20" %?
file_name = d_name($file->f_path->dentry)
+%:
+ file_name = d_name($file->f_dentry)
+%)
driver_name = kernel_string($tty->driver->driver_name)
}
// Tests if all probes in irq tapset are resolvable
-probe workqueue.* {}
-probe irq_handler.* {}
-probe softirq.* {}
+probe workqueue.* !, never {}
+probe irq_handler.* !, never {}
+probe softirq.* !, never {}
probe tcpmib.* {}
-function tcpmib_filter_key:long (sk:long, op:long) {
- // Insure all these functions will build
- if ( tcpmib_get_state(sk) ) return 0
- if ( tcpmib_local_addr(sk) ) return 0
- if ( tcpmib_remote_addr(sk) ) return 0
- if ( tcpmib_local_port(sk) ) return 0
- if ( tcpmib_remote_port(sk) ) return 0
- return op
+probe begin{
+ print(tcpmib_get_state(0) +
+ tcpmib_local_addr(0) +
+ tcpmib_remote_addr(0) +
+ tcpmib_local_port(0) +
+ tcpmib_remote_port(0) +
+ _rtn_local() +
+ _is_reset(0) +
+%( kernel_v < "2.6.31" %?
+ __tcpmib_input_route_type_old(0)
+%:
+ __tcpmib_input_route_type_new(0)
+%)
+ )
}
printf("File: %s mode %x flags %x\n", file_name, file_mode, file_flags)
}
-probe tty.resize {
+probe tty.resize ? {
printf("Resizing %s from %dx%d (%d/%d) to %dx%d (%d/%d)\n", name, old_row, old_col, old_xpixel, old_ypixel,
new_row, new_col, new_xpixel, new_ypixel)
}
printf("Ioctling file %s with %d %d\n", name, cmd, arg)
}
-probe tty.init {
+probe tty.init ? {
printf("new tty with name %s from driver %s and module %s\nn", driver_name, name, module)
}
}
-probe tty.write {
+probe tty.write ? {
printf("Buffer %s (len %d) wrote on file %s (driver %s)\n", buffer, nr, file_name, driver_name)
}
-probe tty.read {
+probe tty.read ? {
printf("Reading tty file %s (driver %s) to a buffer with size %d containing %s\n", file_name, driver_name, nr, buffer)
}
############################################################
-probe netdev.get_stats{
+probe netdev.get_stats ? {
printf("%s was asked for statistics structure\n", dev_name)
}
printf("Device %s leaving promiscuous mode\n", dev_name)
}
-probe netdev.change_rx_flag {
+probe netdev.change_rx_flag ? {
printf("Device %s is changing its RX flags to %d\n", dev_name, flags)
}