neigh: hook tracepoints in neigh update code
hook tracepoints at the end of functions that update a neigh entry. neigh_update gets an additional tracepoint to trace the update flags and old and new neigh states. Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
9c03b282ba
commit
56dd18a49f
@@ -42,6 +42,8 @@
|
|||||||
#include <linux/inetdevice.h>
|
#include <linux/inetdevice.h>
|
||||||
#include <net/addrconf.h>
|
#include <net/addrconf.h>
|
||||||
|
|
||||||
|
#include <trace/events/neigh.h>
|
||||||
|
|
||||||
#define DEBUG
|
#define DEBUG
|
||||||
#define NEIGH_DEBUG 1
|
#define NEIGH_DEBUG 1
|
||||||
#define neigh_dbg(level, fmt, ...) \
|
#define neigh_dbg(level, fmt, ...) \
|
||||||
@@ -102,6 +104,7 @@ static void neigh_cleanup_and_release(struct neighbour *neigh)
|
|||||||
if (neigh->parms->neigh_cleanup)
|
if (neigh->parms->neigh_cleanup)
|
||||||
neigh->parms->neigh_cleanup(neigh);
|
neigh->parms->neigh_cleanup(neigh);
|
||||||
|
|
||||||
|
trace_neigh_cleanup_and_release(neigh, 0);
|
||||||
__neigh_notify(neigh, RTM_DELNEIGH, 0, 0);
|
__neigh_notify(neigh, RTM_DELNEIGH, 0, 0);
|
||||||
call_netevent_notifiers(NETEVENT_NEIGH_UPDATE, neigh);
|
call_netevent_notifiers(NETEVENT_NEIGH_UPDATE, neigh);
|
||||||
neigh_release(neigh);
|
neigh_release(neigh);
|
||||||
@@ -1095,6 +1098,8 @@ out:
|
|||||||
if (notify)
|
if (notify)
|
||||||
neigh_update_notify(neigh, 0);
|
neigh_update_notify(neigh, 0);
|
||||||
|
|
||||||
|
trace_neigh_timer_handler(neigh, 0);
|
||||||
|
|
||||||
neigh_release(neigh);
|
neigh_release(neigh);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1165,6 +1170,7 @@ out_unlock_bh:
|
|||||||
else
|
else
|
||||||
write_unlock(&neigh->lock);
|
write_unlock(&neigh->lock);
|
||||||
local_bh_enable();
|
local_bh_enable();
|
||||||
|
trace_neigh_event_send_done(neigh, rc);
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
out_dead:
|
out_dead:
|
||||||
@@ -1172,6 +1178,7 @@ out_dead:
|
|||||||
goto out_unlock_bh;
|
goto out_unlock_bh;
|
||||||
write_unlock_bh(&neigh->lock);
|
write_unlock_bh(&neigh->lock);
|
||||||
kfree_skb(skb);
|
kfree_skb(skb);
|
||||||
|
trace_neigh_event_send_dead(neigh, 1);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(__neigh_event_send);
|
EXPORT_SYMBOL(__neigh_event_send);
|
||||||
@@ -1227,6 +1234,8 @@ static int __neigh_update(struct neighbour *neigh, const u8 *lladdr,
|
|||||||
struct net_device *dev;
|
struct net_device *dev;
|
||||||
int update_isrouter = 0;
|
int update_isrouter = 0;
|
||||||
|
|
||||||
|
trace_neigh_update(neigh, lladdr, new, flags, nlmsg_pid);
|
||||||
|
|
||||||
write_lock_bh(&neigh->lock);
|
write_lock_bh(&neigh->lock);
|
||||||
|
|
||||||
dev = neigh->dev;
|
dev = neigh->dev;
|
||||||
@@ -1393,6 +1402,8 @@ out:
|
|||||||
if (notify)
|
if (notify)
|
||||||
neigh_update_notify(neigh, nlmsg_pid);
|
neigh_update_notify(neigh, nlmsg_pid);
|
||||||
|
|
||||||
|
trace_neigh_update_done(neigh, err);
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user