From: Paul Woegerer Date: Wed, 14 Nov 2012 16:03:42 +0000 (-0500) Subject: Add ifdefs to net probe to support Linux 2.6.39 X-Git-Tag: v2.2.0-rc1~39 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=4a7363f7060c032d53febe601fad8a05a13fb22b;p=lttng-modules.git Add ifdefs to net probe to support Linux 2.6.39 Signed-off-by: Mathieu Desnoyers --- diff --git a/instrumentation/events/lttng-module/net.h b/instrumentation/events/lttng-module/net.h index c25b0d92..589011c0 100644 --- a/instrumentation/events/lttng-module/net.h +++ b/instrumentation/events/lttng-module/net.h @@ -8,29 +8,50 @@ #include #include #include +#include TRACE_EVENT(net_dev_xmit, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,0,0)) TP_PROTO(struct sk_buff *skb, int rc, struct net_device *dev, unsigned int skb_len), TP_ARGS(skb, rc, dev, skb_len), +#else + TP_PROTO(struct sk_buff *skb, + int rc), + + TP_ARGS(skb, rc), +#endif TP_STRUCT__entry( __field( void *, skbaddr ) __field( unsigned int, len ) __field( int, rc ) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,0,0)) __string( name, dev->name ) +#else + __string( name, skb->dev->name ) +#endif ), +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,0,0)) TP_fast_assign( tp_assign(skbaddr, skb); tp_assign(len, skb_len); tp_assign(rc, rc); tp_strcpy(name, dev->name); ), +#else + TP_fast_assign( + tp_assign(skbaddr, skb); + tp_assign(len, skb->len); + tp_assign(rc, rc); + tp_strcpy(name, skb->dev->name); + ), +#endif TP_printk("dev=%s skbaddr=%p len=%u rc=%d", __get_str(name), __entry->skbaddr, __entry->len, __entry->rc)