diff options
author | Koki Sanagi <sanagi.koki@jp.fujitsu.com> | 2010-08-23 05:45:02 -0400 |
---|---|---|
committer | Frederic Weisbecker <fweisbec@gmail.com> | 2010-09-07 11:51:33 -0400 |
commit | cf66ba58b5cb8b1526e9dd2fb96ff8db048d4d44 (patch) | |
tree | e9adada8f043f162dd1fea6ebb9091c66fee8eca /net/core/dev.c | |
parent | 3e4b10d7a4d2a78af64f8096dc7cdb3bebd65adb (diff) |
netdev: Add tracepoints to netdev layer
This patch adds tracepoint to dev_queue_xmit, dev_hard_start_xmit,
netif_rx and netif_receive_skb. These tracepoints help you to monitor
network driver's input/output.
<idle>-0 [001] 112447.902030: netif_rx: dev=eth1 skbaddr=f3ef0900 len=84
<idle>-0 [001] 112447.902039: netif_receive_skb: dev=eth1 skbaddr=f3ef0900 len=84
sshd-6828 [000] 112447.903257: net_dev_queue: dev=eth4 skbaddr=f3fca538 len=226
sshd-6828 [000] 112447.903260: net_dev_xmit: dev=eth4 skbaddr=f3fca538 len=226 rc=0
Signed-off-by: Koki Sanagi <sanagi.koki@jp.fujitsu.com>
Acked-by: David S. Miller <davem@davemloft.net>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Kaneshige Kenji <kaneshige.kenji@jp.fujitsu.com>
Cc: Izumo Taku <izumi.taku@jp.fujitsu.com>
Cc: Kosaki Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
Cc: Scott Mcmillan <scott.a.mcmillan@intel.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
LKML-Reference: <4C72431E.3000901@jp.fujitsu.com>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Diffstat (limited to 'net/core/dev.c')
-rw-r--r-- | net/core/dev.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index 3721fbb9a83c..5a4fbc7405e2 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -128,6 +128,7 @@ | |||
128 | #include <linux/jhash.h> | 128 | #include <linux/jhash.h> |
129 | #include <linux/random.h> | 129 | #include <linux/random.h> |
130 | #include <trace/events/napi.h> | 130 | #include <trace/events/napi.h> |
131 | #include <trace/events/net.h> | ||
131 | #include <linux/pci.h> | 132 | #include <linux/pci.h> |
132 | 133 | ||
133 | #include "net-sysfs.h" | 134 | #include "net-sysfs.h" |
@@ -1978,6 +1979,7 @@ int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev, | |||
1978 | } | 1979 | } |
1979 | 1980 | ||
1980 | rc = ops->ndo_start_xmit(skb, dev); | 1981 | rc = ops->ndo_start_xmit(skb, dev); |
1982 | trace_net_dev_xmit(skb, rc); | ||
1981 | if (rc == NETDEV_TX_OK) | 1983 | if (rc == NETDEV_TX_OK) |
1982 | txq_trans_update(txq); | 1984 | txq_trans_update(txq); |
1983 | return rc; | 1985 | return rc; |
@@ -1998,6 +2000,7 @@ gso: | |||
1998 | skb_dst_drop(nskb); | 2000 | skb_dst_drop(nskb); |
1999 | 2001 | ||
2000 | rc = ops->ndo_start_xmit(nskb, dev); | 2002 | rc = ops->ndo_start_xmit(nskb, dev); |
2003 | trace_net_dev_xmit(nskb, rc); | ||
2001 | if (unlikely(rc != NETDEV_TX_OK)) { | 2004 | if (unlikely(rc != NETDEV_TX_OK)) { |
2002 | if (rc & ~NETDEV_TX_MASK) | 2005 | if (rc & ~NETDEV_TX_MASK) |
2003 | goto out_kfree_gso_skb; | 2006 | goto out_kfree_gso_skb; |
@@ -2186,6 +2189,7 @@ int dev_queue_xmit(struct sk_buff *skb) | |||
2186 | #ifdef CONFIG_NET_CLS_ACT | 2189 | #ifdef CONFIG_NET_CLS_ACT |
2187 | skb->tc_verd = SET_TC_AT(skb->tc_verd, AT_EGRESS); | 2190 | skb->tc_verd = SET_TC_AT(skb->tc_verd, AT_EGRESS); |
2188 | #endif | 2191 | #endif |
2192 | trace_net_dev_queue(skb); | ||
2189 | if (q->enqueue) { | 2193 | if (q->enqueue) { |
2190 | rc = __dev_xmit_skb(skb, q, dev, txq); | 2194 | rc = __dev_xmit_skb(skb, q, dev, txq); |
2191 | goto out; | 2195 | goto out; |
@@ -2512,6 +2516,7 @@ int netif_rx(struct sk_buff *skb) | |||
2512 | if (netdev_tstamp_prequeue) | 2516 | if (netdev_tstamp_prequeue) |
2513 | net_timestamp_check(skb); | 2517 | net_timestamp_check(skb); |
2514 | 2518 | ||
2519 | trace_netif_rx(skb); | ||
2515 | #ifdef CONFIG_RPS | 2520 | #ifdef CONFIG_RPS |
2516 | { | 2521 | { |
2517 | struct rps_dev_flow voidflow, *rflow = &voidflow; | 2522 | struct rps_dev_flow voidflow, *rflow = &voidflow; |
@@ -2828,6 +2833,7 @@ static int __netif_receive_skb(struct sk_buff *skb) | |||
2828 | if (!netdev_tstamp_prequeue) | 2833 | if (!netdev_tstamp_prequeue) |
2829 | net_timestamp_check(skb); | 2834 | net_timestamp_check(skb); |
2830 | 2835 | ||
2836 | trace_netif_receive_skb(skb); | ||
2831 | if (vlan_tx_tag_present(skb) && vlan_hwaccel_do_receive(skb)) | 2837 | if (vlan_tx_tag_present(skb) && vlan_hwaccel_do_receive(skb)) |
2832 | return NET_RX_SUCCESS; | 2838 | return NET_RX_SUCCESS; |
2833 | 2839 | ||