Debian Codegraph @

tapset/linux/linuxmib.stp

raw
1 /*
2 * Copyright (C) 2009 IBM Corp.
3 * Copyright (C) 2010-2017 Red Hat Inc.
4 *
5 * This file is part of systemtap, and is free software. You can
6 * redistribute it and/or modify it under the terms of the GNU General
7 * Public License (GPL); either version 2, or (at your option) any
8 * later version.
9 *
10 * Version 1.0 [email protected] 2009-07-06
11 */
12
13 global DelayedACKs /* LINUX_MIB_DELAYEDACKS */
14 global ListenOverflows /* LINUX_MIB_LISTENOVERFLOWS */
15 global ListenDrops /* LINUX_MIB_LISTENDROPS */
16 global TCPMemoryPressures /* LINUX_MIB_TCPMEMORYPRESSURES */
17
18 /**
19 * probe linuxmib.DelayedACKs - Count of delayed acks
20 * @sk: Pointer to the struct sock being acted on
21 * @op: Value to be added to the counter (default value of 1)
22 *
23 * The packet pointed to by @skb is filtered by the function
24 * linuxmib_filter_key(). If the packet passes the filter is is
25 * counted in the global @DelayedACKs (equivalent to SNMP's MIB
26 * LINUX_MIB_DELAYEDACKS)
27 */
28 global indelack_timer
29 probe linuxmib.DelayedACKs = _linuxmib.DelayedACKs.* {}
30
31 probe _linuxmib.DelayedACKs.A = kernel.function("tcp_send_ack")
32 {
33 sk=$sk
34 if ( !indelack_timer[sk] ) next
35 op=1
36 key = linuxmib_filter_key(sk,op);
37 if ( key ) DelayedACKs[key] += op;
38 }
39
40 probe _linuxmib.DelayedACKs.B = kernel.function("tcp_delack_timer")
41 {
42 sk=@choose_defined($data,
43 &@container_of($t, "inet_connection_sock",
44 icsk_delack_timer)->icsk_inet->sk)
45 indelack_timer[sk]=1
46 op=0
47 }
48
49 probe _linuxmib.DelayedACKs.C = kernel.function("tcp_delack_timer").return
50 {
51 sk=@entry(@choose_defined($data,
52 &@container_of($t, "inet_connection_sock",
53 icsk_delack_timer)->icsk_inet->sk))
54 indelack_timer[sk]=0;
55 op=0
56 }
57
58 /**
59 * probe linuxmib.ListenOverflows - Count of times a listen queue overflowed
60 * @sk: Pointer to the struct sock being acted on
61 * @op: Value to be added to the counter (default value of 1)
62 *
63 * The packet pointed to by @skb is filtered by the function
64 * linuxmib_filter_key(). If the packet passes the filter is is
65 * counted in the global @ListenOverflows (equivalent to SNMP's MIB
66 * LINUX_MIB_LISTENOVERFLOWS)
67 */
68 probe linuxmib.ListenOverflows=kernel.function("tcp_v4_syn_recv_sock").return
69 {
70 sk = @entry($sk)
71 if ( $return ) next
72 if ( @entry($sk->sk_ack_backlog) <= @entry($sk->sk_max_ack_backlog) ) next
73 op = 1;
74 key = linuxmib_filter_key(sk,op);
75 if ( key ) ListenOverflows[key] += op;
76 }
77
78 /**
79 * probe linuxmib.ListenDrops - Count of times conn request that were dropped
80 * @sk: Pointer to the struct sock being acted on
81 * @op: Value to be added to the counter (default value of 1)
82 *
83 * The packet pointed to by @skb is filtered by the function
84 * linuxmib_filter_key(). If the packet passes the filter is is
85 * counted in the global @ListenDrops (equivalent to SNMP's MIB
86 * LINUX_MIB_LISTENDROPS)
87 */
88 probe linuxmib.ListenDrops=kernel.function("tcp_v4_syn_recv_sock").return
89 {
90 sk = @entry($sk)
91 if ( $return ) next
92 op = 1;
93 key = linuxmib_filter_key(sk,op);
94 if ( key ) ListenDrops[key] += op;
95 }
96
97 /**
98 * probe linuxmib.TCPMemoryPressures - Count of times memory pressure was used
99 * @sk: Pointer to the struct sock being acted on
100 * @op: Value to be added to the counter (default value of 1)
101 *
102 * The packet pointed to by @skb is filtered by the function
103 * linuxmib_filter_key(). If the packet passes the filter is is
104 * counted in the global @TCPMemoryPressures (equivalent to SNMP's MIB
105 * LINUX_MIB_TCPMEMORYPRESSURES)
106 */
107 probe linuxmib.TCPMemoryPressures=kernel.function("tcp_enter_memory_pressure")
108 {
109 sk = @choose_defined($sk, 0)
110 op = 1;
111 if ( $tcp_memory_pressure ) next
112 key = linuxmib_filter_key(sk,op);
113 if ( key ) TCPMemoryPressures[key] += op;
114 }