[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220826144049.256134-7-miquel.raynal@bootlin.com>
Date: Fri, 26 Aug 2022 16:40:44 +0200
From: Miquel Raynal <miquel.raynal@...tlin.com>
To: Alexander Aring <alex.aring@...il.com>,
Stefan Schmidt <stefan@...enfreihafen.org>,
linux-wpan@...r.kernel.org
Cc: "David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Eric Dumazet <edumazet@...gle.com>, netdev@...r.kernel.org,
David Girault <david.girault@...vo.com>,
Romuald Despres <romuald.despres@...vo.com>,
Frederic Blain <frederic.blain@...vo.com>,
Nicolas Schodet <nico@...fr.eu.org>,
Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
Miquel Raynal <miquel.raynal@...tlin.com>
Subject: [PATCH wpan-next v2 06/11] net: ieee802154: Trace the registration of new PANs
From: David Girault <david.girault@...vo.com>
Add an internal trace when new PANs get discovered.
Signed-off-by: David Girault <david.girault@...vo.com>
Signed-off-by: Miquel Raynal <miquel.raynal@...tlin.com>
---
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),
--
2.34.1
Powered by blists - more mailing lists