From patchwork Fri Aug 26 14:40:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 12956117 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 845DCECAAA3 for ; Fri, 26 Aug 2022 14:41:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344510AbiHZOlT (ORCPT ); Fri, 26 Aug 2022 10:41:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344524AbiHZOlP (ORCPT ); Fri, 26 Aug 2022 10:41:15 -0400 Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::228]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D75ED4775; Fri, 26 Aug 2022 07:41:09 -0700 (PDT) Received: (Authenticated sender: miquel.raynal@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 94ED01BF207; Fri, 26 Aug 2022 14:41:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1661524867; 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=ajt4B69LYjejgNbGEH2ZBoXmoFMV0MROjIzP4TuvpyA=; b=nLwYtks8TJFjNL/MZlSuqKIGaDJf90Y+soH1lEZj70pPwOzqqUMjkFbO7HplUJWf522cwp ofV8J2Ct7RoHBZnAHTzTm4SGKXE1w8SSZcm6vq8VHrUj8wohFhxNLelvEOPfPJeMjfUML/ Jx0kD/TII87FvtMsIeQsc1REhJDe/F5/4txZcEW9j8i8uDUk2U6K8eP0EHvjZPcBUlOcRs TIMBDuzQno+9kfnAktPcFlkyiNXPvKRj8qD+82p3ZJZJNfK6NL9t3cZvqqcovvq8DPyf5O sfDnrUfbDpLpwhmKLpTPRGUkwJBj9GJqdjwNpyUioJ/4kd3IXCe30VTO4pLYeg== 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 v2 06/11] net: ieee802154: Trace the registration of new PANs Date: Fri, 26 Aug 2022 16:40:44 +0200 Message-Id: <20220826144049.256134-7-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220826144049.256134-1-miquel.raynal@bootlin.com> References: <20220826144049.256134-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 27fb5432f651..d3b7a9764319 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) @@ -90,6 +91,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),