[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220117115440.60296-38-miquel.raynal@bootlin.com>
Date: Mon, 17 Jan 2022 12:54:36 +0100
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: netdev@...r.kernel.org, linux-wireless@...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>,
Michael Hennerich <michael.hennerich@...log.com>,
Jakub Kicinski <kuba@...nel.org>,
Varka Bhadram <varkabhadram@...il.com>,
Xue Liu <liuxuenetmail@...il.com>, Alan Ott <alan@...nal11.us>,
Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
Miquel Raynal <miquel.raynal@...tlin.com>
Subject: [PATCH v3 37/41] 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 | 3 +++
net/ieee802154/trace.h | 25 +++++++++++++++++++++++++
2 files changed, 28 insertions(+)
diff --git a/net/ieee802154/pan.c b/net/ieee802154/pan.c
index 1ea15ea1b3bd..5afc0aa38a43 100644
--- a/net/ieee802154/pan.c
+++ b/net/ieee802154/pan.c
@@ -18,6 +18,7 @@
#include "ieee802154.h"
#include "core.h"
+#include "trace.h"
static struct cfg802154_internal_pan *
cfg802154_alloc_pan(struct ieee802154_pan_desc *desc)
@@ -205,6 +206,8 @@ static void cfg802154_pan_update(struct cfg802154_registered_device *rdev,
found = cfg802154_find_matching_pan(rdev, new);
if (found)
cfg802154_unlink_pan(rdev, found);
+ else
+ trace_802154_new_pan(&new->desc);
if (unlikely(cfg802154_need_to_expire_pans(rdev)))
cfg802154_expire_oldest_pan(rdev);
diff --git a/net/ieee802154/trace.h b/net/ieee802154/trace.h
index 353ba799244f..506fe4930440 100644
--- a/net/ieee802154/trace.h
+++ b/net/ieee802154/trace.h
@@ -356,6 +356,31 @@ DEFINE_EVENT(802154_wdev_template, 802154_rdev_stop_beacons,
TP_ARGS(wpan_phy, wpan_dev)
);
+DECLARE_EVENT_CLASS(802154_pan_evt,
+ TP_PROTO(struct ieee802154_pan_desc *desc),
+ TP_ARGS(desc),
+ TP_STRUCT__entry(
+ __field(u16, pan_id)
+ __field(__le64, coord_addr)
+ __field(u8, channel)
+ __field(u8, page)
+ ),
+ TP_fast_assign(
+ __entry->page = desc->page;
+ __entry->channel = desc->channel;
+ memcpy(&__entry->pan_id, &desc->coord->pan_id, 2);
+ memcpy(&__entry->coord_addr, &desc->coord->extended_addr, 8);
+ ),
+ TP_printk("panid: %u, coord_addr: 0x%llx, page: %u, channel: %u",
+ __entry->pan_id, __le64_to_cpu(__entry->coord_addr),
+ __entry->page, __entry->channel)
+);
+
+DEFINE_EVENT(802154_pan_evt, 802154_new_pan,
+ TP_PROTO(struct ieee802154_pan_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.27.0
Powered by blists - more mailing lists