From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,UNWANTED_LANGUAGE_BODY,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 65E17C43381 for ; Thu, 14 Feb 2019 17:15:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 35E6D222DA for ; Thu, 14 Feb 2019 17:15:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=cumulusnetworks.com header.i=@cumulusnetworks.com header.b="H/IU+mAK" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730797AbfBNRPb (ORCPT ); Thu, 14 Feb 2019 12:15:31 -0500 Received: from mail-pf1-f195.google.com ([209.85.210.195]:34301 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729965AbfBNRPU (ORCPT ); Thu, 14 Feb 2019 12:15:20 -0500 Received: by mail-pf1-f195.google.com with SMTP id j18so3412992pfe.1 for ; Thu, 14 Feb 2019 09:15:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cumulusnetworks.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=TomIE5rr50QLJFL+1vtUFElqLGp1Oj+245ZuPR3POCo=; b=H/IU+mAKJbpUf+wxDn+XKR6NrKDs2vS6G8eqxM/fYzISi4FFaT4QJdLYkwnlawwIGj /BDoPhSLUdo9JdOmXd6nUogKZ73oDtQp7K+bwba1tfR9RVWQOA9ZdxH4zeAANgITshMe 511ICJvLziFcO1wyA03zhMa+hDE1eskxQyfDI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=TomIE5rr50QLJFL+1vtUFElqLGp1Oj+245ZuPR3POCo=; b=sc93qencLfN7Wj6nS0TtABo84vyiVr/NjxNq/bVDkI617BYMesax7nFOg1M+QrnBHZ 0U4ZYbgJxkwZH2WeOqJNUUVVraPoE2OMb7mDNjSiFOicbdkKNQK4BRj/fZqbW1TacvK5 qekVhFRBajHmZ+cEPEefejuKoHjtU8ib04UcaS86pXFQYWOpoxAxuwMBFMEUZ4ZY1KlH eRXPpzo52yBxl4BrkJKf1wvUBVmGdZnN3cINxvRVMDW4D9cACm1e7o5u60MVRcAeOvJC rjT/BI3WP0rUFOP7mqkQIj6YAZ7lyb+Wml2dZvTbGQaAgpbszs5WxJUGW4nmCRmDV/f5 V1eg== X-Gm-Message-State: AHQUAua1XLAiJZxKrNiu0RGYFEA7T3cuuKUNYH9Q2msIij6O6hiY8qGe Fs7KoLOdjHNFC8HU2PHfBYcRmw== X-Google-Smtp-Source: AHgI3IYeXST9epKf2epKZO87RwLOAtIZENZbQdwLvcXYIqBjC3fwXX9Fh6xj4qbHCvaj5jgAeiO3KQ== X-Received: by 2002:a63:2d5:: with SMTP id 204mr861630pgc.407.1550164520197; Thu, 14 Feb 2019 09:15:20 -0800 (PST) Received: from monster-08.mvlab.cumulusnetworks.com. (fw.cumulusnetworks.com. [216.129.126.126]) by smtp.googlemail.com with ESMTPSA id k66sm5584565pgc.24.2019.02.14.09.15.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 14 Feb 2019 09:15:19 -0800 (PST) From: Roopa Prabhu X-Google-Original-From: Roopa Prabhu To: davem@davemloft.net Cc: netdev@vger.kernel.org, dsa@cumulusnetworks.com Subject: [PATCH net-next 2/2] neigh: hook tracepoints in neigh update code Date: Thu, 14 Feb 2019 09:15:11 -0800 Message-Id: <1550164511-21195-3-git-send-email-roopa@cumulusnetworks.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1550164511-21195-1-git-send-email-roopa@cumulusnetworks.com> References: <1550164511-21195-1-git-send-email-roopa@cumulusnetworks.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Roopa Prabhu 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 --- net/core/neighbour.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/net/core/neighbour.c b/net/core/neighbour.c index 4230400..30f6fd8 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c @@ -42,6 +42,8 @@ #include #include +#include + #define DEBUG #define NEIGH_DEBUG 1 #define neigh_dbg(level, fmt, ...) \ @@ -102,6 +104,7 @@ static void neigh_cleanup_and_release(struct neighbour *neigh) if (neigh->parms->neigh_cleanup) neigh->parms->neigh_cleanup(neigh); + trace_neigh_cleanup_and_release(neigh, 0); __neigh_notify(neigh, RTM_DELNEIGH, 0, 0); call_netevent_notifiers(NETEVENT_NEIGH_UPDATE, neigh); neigh_release(neigh); @@ -1095,6 +1098,8 @@ static void neigh_timer_handler(struct timer_list *t) if (notify) neigh_update_notify(neigh, 0); + trace_neigh_timer_handler(neigh, 0); + neigh_release(neigh); } @@ -1165,6 +1170,7 @@ int __neigh_event_send(struct neighbour *neigh, struct sk_buff *skb) else write_unlock(&neigh->lock); local_bh_enable(); + trace_neigh_event_send_done(neigh, rc); return rc; out_dead: @@ -1172,6 +1178,7 @@ int __neigh_event_send(struct neighbour *neigh, struct sk_buff *skb) goto out_unlock_bh; write_unlock_bh(&neigh->lock); kfree_skb(skb); + trace_neigh_event_send_dead(neigh, 1); return 1; } EXPORT_SYMBOL(__neigh_event_send); @@ -1227,6 +1234,8 @@ static int __neigh_update(struct neighbour *neigh, const u8 *lladdr, struct net_device *dev; int update_isrouter = 0; + trace_neigh_update(neigh, lladdr, new, flags, nlmsg_pid); + write_lock_bh(&neigh->lock); dev = neigh->dev; @@ -1393,6 +1402,8 @@ static int __neigh_update(struct neighbour *neigh, const u8 *lladdr, if (notify) neigh_update_notify(neigh, nlmsg_pid); + trace_neigh_update_done(neigh, err); + return err; } -- 2.1.4