From: James Prestwood <prestwoj@gmail.com>
To: iwd@lists.linux.dev
Cc: James Prestwood <prestwoj@gmail.com>
Subject: [PATCH 6/7] station: use iwd_notice for state/event information
Date: Thu, 22 Feb 2024 07:24:50 -0800 [thread overview]
Message-ID: <20240222152451.1541682-6-prestwoj@gmail.com> (raw)
In-Reply-To: <20240222152451.1541682-1-prestwoj@gmail.com>
For anyone debugging or trying to identify network infrastructure
problems the IWD DBus API isn't all that useful and ultimately
requires going through debug logs to figure out exactly what
happened. Having a concise set of debug logs containing only
relavent information would be very useful. In addition, having
some kind of syntax for these logs to be parsed by tooling could
automate these tasks.
This is being done, starting with station, by using iwd_notice
which internally uses l_notice. The use of the notice log level
(5) in IWD will be strictly for the type of messages described
above.
---
src/station.c | 34 +++++++++++++++++++++++++++-------
1 file changed, 27 insertions(+), 7 deletions(-)
diff --git a/src/station.c b/src/station.c
index ea505ca2..8817637b 100644
--- a/src/station.c
+++ b/src/station.c
@@ -1561,9 +1561,9 @@ static void station_enter_state(struct station *station,
bool disconnected;
int ret;
- l_debug("Old State: %s, new state: %s",
- station_state_to_string(station->state),
- station_state_to_string(state));
+ iwd_notice(IWD_NOTICE_STATE, "old: %s, new: %s",
+ station_state_to_string(station->state),
+ station_state_to_string(state));
station_debug_event(station, station_state_to_string(state));
@@ -2352,12 +2352,16 @@ static bool station_ft_work_ready(struct wiphy_radio_work_item *item)
roam_bss_rank_compare, NULL);
station_debug_event(station, "ft-fallback-to-reassoc");
+ iwd_notice(IWD_NOTICE_FT_ROAM_FAILED, "status: %d",
+ MMPDU_STATUS_CODE_INVALID_PMKID);
station_transition_start(station);
l_steal_ptr(rbss);
break;
case -ENOENT:
station_debug_event(station, "ft-roam-failed");
+ iwd_notice(IWD_NOTICE_FT_ROAM_FAILED,
+ "status: authentication timeout");
try_next:
station_transition_start(station);
break;
@@ -2384,8 +2388,10 @@ disassociate:
station_disassociated(station);
break;
default:
- if (ret > 0)
+ if (ret > 0) {
+ iwd_notice(IWD_NOTICE_FT_ROAM_FAILED, "status: %d", ret);
goto try_next;
+ }
station_roam_failed(station);
break;
@@ -2457,8 +2463,10 @@ static bool station_try_next_transition(struct station *station,
struct handshake_state *new_hs;
struct ie_rsn_info cur_rsne, target_rsne;
- l_debug("%u, target %s", netdev_get_ifindex(station->netdev),
- util_address_to_string(bss->addr));
+ iwd_notice(IWD_NOTICE_ROAM_INFO, "bss: "MAC", signal: %d, load: %d/255",
+ MAC_STR(bss->addr),
+ bss->signal_strength / 100,
+ bss->utilization);
/* Reset AP roam flag, at this point the roaming behaves the same */
station->ap_directed_roaming = false;
@@ -2561,6 +2569,7 @@ static void station_roam_scan_triggered(int err, void *user_data)
}
station_debug_event(station, "roam-scan-triggered");
+ iwd_notice(IWD_NOTICE_ROAM_SCAN);
/*
* Do not update the Scanning property as we won't be updating the
@@ -3159,6 +3168,8 @@ static bool station_retry_owe_default_group(struct station *station)
static bool station_retry_with_reason(struct station *station,
uint16_t reason_code)
{
+ iwd_notice(IWD_NOTICE_CONNECT_FAILED, "reason: %u", reason_code);
+
/*
* We don't want to cause a retry and blacklist if the password was
* incorrect. Otherwise we would just continue to fail.
@@ -3209,6 +3220,8 @@ static bool station_retry_with_status(struct station *station,
else
blacklist_add_bss(station->connected_bss->addr);
+ iwd_notice(IWD_NOTICE_CONNECT_FAILED, "status: %u", status_code);
+
return station_try_next_bss(station);
}
@@ -3369,6 +3382,8 @@ static void station_disconnect_event(struct station *station, void *event_data)
case STATION_STATE_FT_ROAMING:
case STATION_STATE_FW_ROAMING:
case STATION_STATE_NETCONFIG:
+ iwd_notice(IWD_NOTICE_DISCONNECT_INFO, "reason: %u",
+ l_get_u16(event_data));
station_disassociated(station);
return;
default:
@@ -3508,7 +3523,12 @@ int __station_connect_network(struct station *station, struct network *network,
return r;
}
- l_debug("connecting to BSS "MAC, MAC_STR(bss->addr));
+ iwd_notice(IWD_NOTICE_CONNECT_INFO, "ssid: %s, bss: "MAC", "
+ "signal: %d, load: %d/255",
+ network_get_ssid(network),
+ MAC_STR(bss->addr),
+ bss->signal_strength / 100,
+ bss->utilization);
station->connected_bss = bss;
station->connected_network = network;
--
2.34.1
next prev parent reply other threads:[~2024-02-22 15:25 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-22 15:24 [PATCH 1/7] auto-t: fix failed_roam_test to pass when run on its own James Prestwood
2024-02-22 15:24 ` [PATCH 2/7] auto-t: timestamp log files in test-runner James Prestwood
2024-02-22 15:24 ` [PATCH 3/7] main: add runtime flag for setting the logger James Prestwood
2024-02-22 16:16 ` Denis Kenzior
2024-02-22 15:24 ` [PATCH 4/7] iwd: add iwd_notice for special event/state type of logging James Prestwood
2024-02-22 15:24 ` [PATCH 5/7] doc: document use of l_log APIs James Prestwood
2024-02-22 15:24 ` James Prestwood [this message]
2024-02-22 15:24 ` [PATCH 7/7] netdev: add notice events for connection timeouts James Prestwood
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240222152451.1541682-6-prestwoj@gmail.com \
--to=prestwoj@gmail.com \
--cc=iwd@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox