From patchwork Fri Jul 1 14:30:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 12903418 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0F77CCCA482 for ; Fri, 1 Jul 2022 14:35:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232943AbiGAOfv (ORCPT ); Fri, 1 Jul 2022 10:35:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231316AbiGAOfe (ORCPT ); Fri, 1 Jul 2022 10:35:34 -0400 Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B80E70AF0; Fri, 1 Jul 2022 07:31:05 -0700 (PDT) Received: (Authenticated sender: miquel.raynal@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id BE517FF812; Fri, 1 Jul 2022 14:31:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1656685864; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/PnffLaTIeKBM3P3P8MLNSufjD/Qa48BRQA3Q2ejZoE=; b=eyOwjshU4QNkQjkdkl2qPz95P4HE1ocfeodLQ7dOwCpbk2bDwx711bEF1BDoWwY8fM0aBq DRXnS4RuiHyY1zZMUcSzw468q5q5BILhUwLJ2D3qZzfrXunAq/F0mI0LP5B0brUuo+qvDr 6aQPlRAyY0Q/VUr9kj6X3mmaChHzIJD4kjduErgCZKGkBDmO/I9Fm5hDdNa+uyK15X2LYK Oae35KyZk7a33SQGfUw3Pl1/CSFrA5sOjn1G5DnYGOo+TZHIZPRnH94V34OC721UMZphvW wWAAs4QIWQdEnKo/E14E0YRAXNXQltTA3CMqF0p1kIdKtr8+k/uR/76rSiOUsQ== From: Miquel Raynal To: Alexander Aring , Stefan Schmidt , linux-wpan@vger.kernel.org Cc: "David S. Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet , netdev@vger.kernel.org, David Girault , Romuald Despres , Frederic Blain , Nicolas Schodet , Thomas Petazzoni , Miquel Raynal Subject: [PATCH wpan-next 04/20] net: ieee802154: Trace the registration of new PANs Date: Fri, 1 Jul 2022 16:30:36 +0200 Message-Id: <20220701143052.1267509-5-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220701143052.1267509-1-miquel.raynal@bootlin.com> References: <20220701143052.1267509-1-miquel.raynal@bootlin.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: David Girault Add an internal trace when new PANs get discovered. Signed-off-by: David Girault Signed-off-by: Miquel Raynal --- net/ieee802154/pan.c | 2 ++ net/ieee802154/trace.h | 25 +++++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/net/ieee802154/pan.c b/net/ieee802154/pan.c index 134a13ff0a87..79d365fdf7d5 100644 --- a/net/ieee802154/pan.c +++ b/net/ieee802154/pan.c @@ -18,6 +18,7 @@ #include "ieee802154.h" #include "../ieee802154/nl802154.h" +#include "trace.h" struct ieee802154_coord_desc * cfg802154_alloc_coordinator(struct ieee802154_addr *coord) @@ -89,6 +90,7 @@ void cfg802154_record_coordinator(struct wpan_phy *wpan_phy, cfg802154_free_coordinator_desc(desc); } else { list_add_tail(&desc->node, &wpan_dev->coord_list); + trace_802154_new_coordinator(desc); nl802154_advertise_new_coordinator(wpan_phy, wpan_dev, desc); } diff --git a/net/ieee802154/trace.h b/net/ieee802154/trace.h index 19c2e5d60e76..03b3817c34ad 100644 --- a/net/ieee802154/trace.h +++ b/net/ieee802154/trace.h @@ -295,6 +295,31 @@ TRACE_EVENT(802154_rdev_set_ackreq_default, WPAN_DEV_PR_ARG, BOOL_TO_STR(__entry->ackreq)) ); +DECLARE_EVENT_CLASS(802154_new_coordinator_evt, + TP_PROTO(struct ieee802154_coord_desc *desc), + TP_ARGS(desc), + TP_STRUCT__entry( + __field(__le16, pan_id) + __field(__le64, addr) + __field(u8, channel) + __field(u8, page) + ), + TP_fast_assign( + __entry->page = desc->page; + __entry->channel = desc->channel; + __entry->pan_id = desc->addr->pan_id; + __entry->addr = desc->addr->extended_addr; + ), + TP_printk("panid: %u, coord_addr: 0x%llx, page: %u, channel: %u", + __le16_to_cpu(__entry->pan_id), __le64_to_cpu(__entry->addr), + __entry->page, __entry->channel) +); + +DEFINE_EVENT(802154_new_coordinator_evt, 802154_new_coordinator, + TP_PROTO(struct ieee802154_coord_desc *desc), + TP_ARGS(desc) +); + TRACE_EVENT(802154_rdev_return_int, TP_PROTO(struct wpan_phy *wpan_phy, int ret), TP_ARGS(wpan_phy, ret),