File: netdev.stp

package info (click to toggle)
systemtap 5.1-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 47,964 kB
  • sloc: cpp: 80,838; ansic: 54,757; xml: 49,725; exp: 43,665; sh: 11,527; python: 5,003; perl: 2,252; tcl: 1,312; makefile: 1,006; javascript: 149; lisp: 105; awk: 101; asm: 91; java: 70; sed: 16
file content (58 lines) | stat: -rwxr-xr-x 1,463 bytes parent folder | download | duplicates (9)
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#! /usr/bin/env stap

############################################################
# netdev.stp
# Author: Breno Leitao <leitao@linux.vnet.ibm.com>
# An example script to show how a netdev works and its
# functions
############################################################


probe netdev.get_stats ? {
	printf("%s was asked for statistics structure\n", dev_name)
}

probe netdev.register{
	printf("Registering netdev_name %s\n", dev_name)
}

probe netdev.unregister{
	printf("Unregistering netdev %s\n", dev_name)
}

probe netdev.ioctl{
	printf("Netdev ioctl raised with param: %d and arg: %s\n", cmd, arg)
}

probe netdev.set_promiscuity {
	if (enable)
		printf("Device %s entering in promiscuous mode\n", dev_name)
	else
		printf("Device %s leaving promiscuous mode\n", dev_name)
}

probe netdev.change_rx_flag ? {
	printf("Device %s is changing its RX flags to %d\n", dev_name, flags)
}

probe netdev.change_mtu {
	printf("Changing MTU on device %s from %d to %d\n", dev_name,
				 old_mtu, new_mtu)
}

probe netdev.change_mac {
	printf("Changing MAC address on device %s from %s to %s\n",
				dev_name, old_mac, new_mac)
}

probe netdev.transmit {
	printf("Device %s is sending (queued) a packet with protocol %d\n", dev_name, protocol)
}

probe netdev.hard_transmit {
	printf("Device %s is sending (hard) a packet with protocol %d\n", dev_name, protocol)
}

probe netdev.rx {
	printf("Device %s received a packet with protocol %d\n", dev_name, protocol)
}