From patchwork Thu Feb 22 15:24:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 13567451 Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 17F4E14D441 for ; Thu, 22 Feb 2024 15:25:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708615502; cv=none; b=ext9uUaL3ZdzkvDwXZVSqN3hoBqHyWGT+5EBTMqmE4rhO+UvPtSwZzgQ9ZFqt2b6oiK7VYy01EOrXm3XRW/ezZwu5B71uQaFf5OMtXP4xRnKoH/0wE9B646hRCb6qydAU2HeBOBJwBrWMblYwj7yf/IpFXlJSrpCTE+upnVgqfs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708615502; c=relaxed/simple; bh=dwQbPdnc1FNTeX+J9KjgqKHbfWmrO57tWH3a1XkdmfQ=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=R5c0Oq/PzZ+R+/WZN4q6ou0m4Z05fRdyC50YMKuPBngqbmSs9RH5O9EBgwc8tCGtd1WmzhyNYq0hGfaGFEviIlOs5JFaKdvJKUggRTa0zR30ogZMVeXkIJwt+BpxyfXgjRzH6QzGswfbpVzqLjB+i7SAc7PtuY+veJL79RKf8iY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=AseBTpHo; arc=none smtp.client-ip=209.85.214.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="AseBTpHo" Received: by mail-pl1-f172.google.com with SMTP id d9443c01a7336-1dc1ff3ba1aso24894485ad.3 for ; Thu, 22 Feb 2024 07:25:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708615500; x=1709220300; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=AplTx8lk3ahbEDq1TvxC/vGihZ2iHC2LpbAOxobz3ZY=; b=AseBTpHoa1DCTD5zYyGpo3xAq17flyJQWrjpRFN4qPo4Z9G2wSo3flezx2Z8IqZiWB iIzG5AeQ3cbaAsh/VThWzOpmDN0d58FpPugzDcTzhqR42kBcXOYPK4kYtB/s1R9GgIbO LpqYN1gC4QD7dCVPqR6PxqkXX895T3VELK1MkMQrnmULcXRc9JaluNat/Ek6sBKuIxkp Y+bZOcJ+sAo9/lqFE3FMQoUisc+qB4yE2LPQDO2N+VA3be/4fw2XSspOL44F5P0r9Vt8 MywAq5T6Ncv2z/B1b3WCvhYmeYfuQnf6LFAtLO0ryknwyRkZrDeFWcIx+qFi1tRRBXBU +UcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708615500; x=1709220300; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=AplTx8lk3ahbEDq1TvxC/vGihZ2iHC2LpbAOxobz3ZY=; b=FhBAzSzne9fbqYCU46DfHPkWq5buDWQczX7q8C7hAgBF6ts+Dd0h9VsgUWSI6PR3Ji kiJ9PKfIPN8ZxUytPJg9F24UYCImDghbNr8ZufLLKu3Kf+rumVlD+L0CqodnJ2uw+m3Y ACrrelpyD+XCzlBkc58SxvMNYf6rx+bQRJFeEl/eFTVPvkT0hYGwGvwQCBtbz+A9NQ8K hwnRzkil6fXR3bZZzYe9dDuKhgq8qJAvuXAVstCkMN80ZeOvui7tXhaoOGiWoXGMqke2 Q68qmWuJB5sZrquFCOcsmVbu31LqXGnkQ9B0NIx5uot2gNBDNDYgUwrEMNjd/2Nwj29Z mwWg== X-Gm-Message-State: AOJu0YwdA1RhACIm44Y3oytibh8ziEBiwW03na7wQ3M2tAOAZmnPrx2F a1qhttiGxL8whusQYWqn/biSV5Cugb3xc2takBeeSnjans8txtaOdC7GEWTE X-Google-Smtp-Source: AGHT+IGMjPrP1rD9LlmO0vdfZZr1JK+JgqTo+kWQbPd2WW4PA6QBmFwbZKeJC4NXGRKpJEUVC+YdlA== X-Received: by 2002:a17:902:d315:b0:1db:e089:745b with SMTP id b21-20020a170902d31500b001dbe089745bmr11050683plc.6.1708615500091; Thu, 22 Feb 2024 07:25:00 -0800 (PST) Received: from LOCLAP699.rst-01.locus ([208.195.13.130]) by smtp.gmail.com with ESMTPSA id jd20-20020a170903261400b001d94a3f3987sm10044873plb.184.2024.02.22.07.24.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 07:24:59 -0800 (PST) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH 1/7] auto-t: fix failed_roam_test to pass when run on its own Date: Thu, 22 Feb 2024 07:24:45 -0800 Message-Id: <20240222152451.1541682-1-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 When running this test with others the hostapd neighbors are already grouped which lets the test pass. On its own this does not happen and it fails. --- autotests/testPSK-roam/failed_roam_test.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/autotests/testPSK-roam/failed_roam_test.py b/autotests/testPSK-roam/failed_roam_test.py index 12e439f6..8cce8bb5 100644 --- a/autotests/testPSK-roam/failed_roam_test.py +++ b/autotests/testPSK-roam/failed_roam_test.py @@ -221,6 +221,8 @@ class Test(unittest.TestCase): cls.rule_bss2 = hwsim.rules.create() cls.rule_bss2.source = hwsim.get_radio('rad2').addresses[0] + HostapdCLI.group_neighbors(*cls.bss_hostapd) + @classmethod def tearDownClass(cls): IWD.clear_storage() From patchwork Thu Feb 22 15:24:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 13567452 Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CB78914D441 for ; Thu, 22 Feb 2024 15:25:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708615504; cv=none; b=Yw2DOkiwcmIjr4nS8R68CEZ9rWNjGTlELBRoBH6whY5VOauQgS7HlzYaeYl8hYcaOqhYr1/YAY0PGSdGZf8Yb7HlC8xasn48ZIejvqTEy0DrF8Q1GCIuEgIFwemEvRxDrgcaCQMYZMsXNsHb0wrP+BRmj0uTO4kbohIm7uHD1dE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708615504; c=relaxed/simple; bh=fpUhQHTVJUBTgZ8QWi8W0NEhG+GeVRD2i6J7xVV1Uvo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=nNAKbTaEcriDKeRWUc8d8UUBMlQbeXjh6NGaM5Ad8TZ9iHP8kVQo+rr5njULzbu44miDyUFBnYGGg6KKL9uQmH/8wHPqx4jBe5wEIzDYkS4BbR/ueD4+krSEFzYyJiFAlJxepz0IECCzcQcYky1gR7m7z7Rrwe5Xm/V2nJ8C4C8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=DhtgZFW+; arc=none smtp.client-ip=209.85.214.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="DhtgZFW+" Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-1d71cb97937so79627795ad.3 for ; Thu, 22 Feb 2024 07:25:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708615502; x=1709220302; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7RafitYr2Dj70DrmLktgtfBmI71dyspbC8oqI5KIOGU=; b=DhtgZFW+bvaOh9ZPjbmlec1A3FlSjMHpAHSwVWznw0Cmkbf18JDBZvJu7c1nRh6mgC NE0R9K7VrkGmJmgLTmDP2MZfU/uSlOzJPny8WqGrfInADnBsuuBaLX06lczQsH7CoBT9 PGJKq7wVjrySQ0SlQkFumBw+RjhdK2lDTooVSGE+NreRgOJ/bVpUM2sToSpLJln/9Dov edpDpVuNcTL9KJCbvlhcEK0+ri7OoGgBojWTlnTo6Y32jkOPkJAuEOLiFCPITeSxKtEn WyZYqyX/KP5e4gbR++G4N1Ly7RPqI53qjjftTvbbzAWpi5aZD3z4Bbhef0e/erwnfeoK ojiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708615502; x=1709220302; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7RafitYr2Dj70DrmLktgtfBmI71dyspbC8oqI5KIOGU=; b=tW7Rx4f+snGbIYi4psmneBpexYxkZbyuAjVWglgHymrLN/hr/cYmoMGm+Gl2GKwQ2P sDPRYVwYEEgoNE2Pe1kotJXAmLCfVev5RfO2n7E/SgtmaSmbH1zchk6axvb4TtkJPvpH BGjXJFQ8R+g7O/apLxhqLocnxQ+VHQOas+7MoB3kOKZUvdemSnSQYW6l93cfgrc0pF9p jlA8wNrRdfaiSV5hk7fc9chEaqpuxUyoFgXap/m3QM+SD5YMB1jQGt+JCWDK+YOOtKu0 iLx6caercEI3kQKSmt/Oe2jvaucvenRZCiKiPVdurUYM6/5CMhn6Rv56gJC4wLNsArdc gpJQ== X-Gm-Message-State: AOJu0YwsPrAgtHC66E3eHnHEnJ1BwvMzWxnDe++jgjBCvW3Z4v3imgKM c6zAxZECI8AdmBEk5DPxY8AAdJe1pb5Gs92wDB4FrLDjOXIQR60siOuzbCEF X-Google-Smtp-Source: AGHT+IH7EkNXXH0ZOvf6MedksWSx8arbHS+aMzwEmtsjdyIGfr3KCXpCBPv2L3miHpXg7SJHedlc1Q== X-Received: by 2002:a17:903:124c:b0:1db:65a3:e184 with SMTP id u12-20020a170903124c00b001db65a3e184mr22597267plh.4.1708615501787; Thu, 22 Feb 2024 07:25:01 -0800 (PST) Received: from LOCLAP699.rst-01.locus ([208.195.13.130]) by smtp.gmail.com with ESMTPSA id jd20-20020a170903261400b001d94a3f3987sm10044873plb.184.2024.02.22.07.25.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 07:25:01 -0800 (PST) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH 2/7] auto-t: timestamp log files in test-runner Date: Thu, 22 Feb 2024 07:24:46 -0800 Message-Id: <20240222152451.1541682-2-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240222152451.1541682-1-prestwoj@gmail.com> References: <20240222152451.1541682-1-prestwoj@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The log files become much more useful when there are timestamps associated with each log. --- tools/utils.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/utils.py b/tools/utils.py index 8219542e..5984fc69 100644 --- a/tools/utils.py +++ b/tools/utils.py @@ -6,6 +6,7 @@ import traceback import shutil import dbus +from datetime import datetime from gi.repository import GLib from weakref import WeakValueDictionary from re import fullmatch @@ -125,7 +126,11 @@ class Process(subprocess.Popen): @staticmethod def _write_io(instance, data, stdout=True): for f in instance.write_fds: - f.write(data) + for c in data: + f.write(c) + if c == '\n': + stamp = datetime.strftime(datetime.now(), "%Y-%m-%d %H:%M:%S.%f") + f.write(stamp + ': ') # Write out a separator so multiple process calls per # test are easer to read. From patchwork Thu Feb 22 15:24:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 13567453 Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 443B814AD33 for ; Thu, 22 Feb 2024 15:25:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708615505; cv=none; b=rn27RbjT68A88sIs4KZfrYISs8aSl21XmKcaERTeiWexT2+/DKZ9dbe1ZohniS9jCaP/e9NJJMJ2SMx3cEtD6wzSYKZQdrutrt0+fnfbZdCH1qg2okma6gfdFNcVZM4MLTXEiU3P4tvooXoDz3pD1txWThCLCgIP/NCDauOKvqI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708615505; c=relaxed/simple; bh=JyNsKP+I/qB+DgwNWT+XvdAENmrt3cBG7GNT1NzO0rM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=oLDfowkRFFFRPGbA5hqph3llaglYYFPbAqZj92pcnTRKxmEI6n3OO5RePyvXAt7EZeLs03CVgl2UuSVPLrcluIiqmOA1kKQz+udEf8YBD/ebuPH6ZwlnfwWX3Zshu3p6c66d9lZgTHBITpofGCNhLB+pPG9TQXgxuavllXRxNBw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=YbnP5kGE; arc=none smtp.client-ip=209.85.214.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="YbnP5kGE" Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-1d932f6ccfaso67460765ad.1 for ; Thu, 22 Feb 2024 07:25:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708615503; x=1709220303; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=qxoAzV9F1JlwiHJUV26mJsU1NDAasvYRAeNf4MhWL68=; b=YbnP5kGEuKEgGFpx22iEv80kKev10cLZgmbpbc8gMO26wfrAy5C8fJraCTdUKRkHc3 R5MNsYJPzRxEgHUPaxrSASk7EQiIVdNQeCkym+oKBIFzS7mESHqfSw8pFreRz8Dn8T+U pqsCNIMqBZ5aNVt6dmGAr2LbLqiubH5uOUIRpx9mz2hb/nLoNakd5D5MeTbg01Wu0CK/ w65p5TIFmUNwK0p5OFumE8zObaSlR/9SECQxfeL4AGrLaa15L5osKlFVZp1sDxL+JUux b8m2xkHIWgVNC9g4yg1QqVoAgQMWiJxGefV6+T6fV8gTO0/aCLAHxCLqpWHdqafLtjs3 YAxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708615503; x=1709220303; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qxoAzV9F1JlwiHJUV26mJsU1NDAasvYRAeNf4MhWL68=; b=Z49H5a5MgwWOHzxuUJPeEFZu6f+5aVRuAp6Gml4AGtlnIdizuJ/q2hS5YisDvB7Mmt EQTyjHxdlwylCC2xm4DjSqT8DgzIh00F94sF+T1MckiwQ+R/Pklr4CYxeDXnAd4ecEtu 3BJoWwJSeqHZmIy89AELeiFqJ8lqaetZBDrYz23DiEOafirWK2c4GDm39k7z5T2+8BK5 Oi1RP0FhthAVzlYCh4X+xUoTyK8dTLjLcWOn21JUPwy4Hc8Xj7VKx3WwZqlDiyuSdLup z9gzsaSDnaXtv7zodzVQA1QZdDs0ZPavzDV+8yL+2ZBI1kvytykAKK8+r8sjwUUfL16p sh/g== X-Gm-Message-State: AOJu0Yz+eSq9b0dmvSTmLY0WwAZ8LY+JSlX2zoMAifsLIgaBjJjv2srT HLqidtZnfrzJrEU8d5PV4faVU3uCehRVZI6qGdTTXhA8jIP+de943JuYQCKc X-Google-Smtp-Source: AGHT+IHx/HZLeWtBp82jlNYXn7l2FbEOxMx4Nnx2y2mmBErqyvpaGvtvoQrXSQ126QUvJN31iE7qaQ== X-Received: by 2002:a17:902:eccf:b0:1db:f513:28cf with SMTP id a15-20020a170902eccf00b001dbf51328cfmr14951285plh.23.1708615503195; Thu, 22 Feb 2024 07:25:03 -0800 (PST) Received: from LOCLAP699.rst-01.locus ([208.195.13.130]) by smtp.gmail.com with ESMTPSA id jd20-20020a170903261400b001d94a3f3987sm10044873plb.184.2024.02.22.07.25.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 07:25:02 -0800 (PST) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH 3/7] main: add runtime flag for setting the logger Date: Thu, 22 Feb 2024 07:24:47 -0800 Message-Id: <20240222152451.1541682-3-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240222152451.1541682-1-prestwoj@gmail.com> References: <20240222152451.1541682-1-prestwoj@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The --logger,-l flag can now be used to specify the logger type. Unset (default) will set log output to stderr as it is today. The other valid options are "syslog" and "journal". --- src/main.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/main.c b/src/main.c index 3ce8340f..acbfdc0c 100644 --- a/src/main.c +++ b/src/main.c @@ -63,6 +63,7 @@ static const char *nointerfaces; static const char *phys; static const char *nophys; static const char *debugopt; +static const char *logger; static bool developeropt; static bool terminating; static bool nl80211_complete; @@ -164,6 +165,7 @@ static const struct option main_options[] = { { "nointerfaces", required_argument, NULL, 'I' }, { "phys", required_argument, NULL, 'p' }, { "nophys", required_argument, NULL, 'P' }, + { "logger", required_argument, NULL, 'l' }, { "debug", optional_argument, NULL, 'd' }, { "help", no_argument, NULL, 'h' }, { } @@ -474,7 +476,7 @@ int main(int argc, char *argv[]) for (;;) { int opt; - opt = getopt_long(argc, argv, "Ei:I:p:P:d::vh", + opt = getopt_long(argc, argv, "Ei:I:p:P:d::vhl:", main_options, NULL); if (opt < 0) break; @@ -503,6 +505,9 @@ int main(int argc, char *argv[]) else debugopt = "*"; break; + case 'l': + logger = optarg; + break; case 'v': printf("%s\n", VERSION); return EXIT_SUCCESS; @@ -519,7 +524,12 @@ int main(int argc, char *argv[]) return EXIT_FAILURE; } - l_log_set_stderr(); + if (logger && !strcmp(logger, "syslog")) + l_log_set_syslog(); + else if (logger && !strcmp(logger, "journal")) + l_log_set_journal(); + else + l_log_set_stderr(); if (check_crypto() < 0) return EXIT_FAILURE; From patchwork Thu Feb 22 15:24:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 13567454 Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B0405148FE6 for ; Thu, 22 Feb 2024 15:25:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708615507; cv=none; b=q7ib2KtYVO5IDjYBdQnMifdlwnlj02RD6STjaVRHxoGRsJnjmGw12Y0X97djn9i+0plZWTB2pnfTe5jxnmsnfKszMrAkkrwjYmcvKB/il7EImQz194vZncenf07Zu+WZHuzVSY36ByCrDpjGCkKhGzZxXgjbpld+ZV1vO9gDvOg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708615507; c=relaxed/simple; bh=KdCvINeZoAr2Zwl35mTBafBrnuR2weh56iNiFHBoiDE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=trekpmExMlDtqoy2uRJE1tEgripyisbxpJWFwb8Z1uYIdEbyPiycWAaJNto554rEtckLBaQ1zOzqF7tD79ectGa5461SU8r59/Zy3azZB33TTeQMDQI7RpZg/t1tulOwZyRfGDoGCbkpci+x8PVSNL439CsFB7/Kd+QCS1xN8ao= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Bk4oe80J; arc=none smtp.client-ip=209.85.214.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Bk4oe80J" Received: by mail-pl1-f172.google.com with SMTP id d9443c01a7336-1d95d67ff45so16495395ad.2 for ; Thu, 22 Feb 2024 07:25:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708615505; x=1709220305; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7v97OWJaNaH4F9YTnXBZrm6rJVKScTDKLhWZsaDMjEg=; b=Bk4oe80JaktZMyZgoKIqmzuhhZu33F9X2IeJpbDtYGwrlBPMfqJI+qAVy2cbND9hZe 2g+qfdA2oct/MIXsQ+TrHhPk7SxnK6pBXbHQvNRWq0W/d7VYM48Nir81Q6KNdTX9BVo8 xJpr4OIizEaTlFRvAtN/F4BT9lF1iyJqyy9GE8qsCLi7YebQ1R87YJ5Fi/yw3JfddjQL 43ErLCyxvMqB5/OGzLJy3PrpEAWqsO9rPSoIpwOHv/M2qqvQTVOtZtb284IWeRURP6X0 lImuTsMFg5CmL1Io/sEA+FHTxyrNoaK66gCCR6QlDkk70PiGIpSk7PL/1NcU6Nkab+4q BLtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708615505; x=1709220305; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7v97OWJaNaH4F9YTnXBZrm6rJVKScTDKLhWZsaDMjEg=; b=n1rGi5QpzYUKykhWyEIhanZokRaZEs7aeU9ZJPaKdF3TUH8ejhaaJHWlvexRFvqJiy rQhj+4TgRdGs8Gu/5g/gyHfrMtupOeKLrV1ht3dq9iTdn7xUqGQvGn2moh9FwQjooIBz GyabjIjpp5EOMH2SqMM3XaAwW67ALzPma7FQuUvl6GVGPjntoRNaH9uAvD5kCUXmfvzb pPGqty5UUTVu2QG3zpmoG4xqJon5F4Z2+y2laook35bzGpFt+CE7x9pyU3n4+yEKudvU M545f4OFvn/SeB3f4ELnIQzGZ/+fQUZtCvQghIOC/CbIhY0YMZwvQ1yKtD9qERapqVp5 O1pg== X-Gm-Message-State: AOJu0YwODKpDqCF/WbeVXNzOJlLeGtkXVYplE4WesLwHeihnQzOWUn3E /vVmNwgylcPE+OC27faixcfi5qIlIVVhYYkQDQafgWOfFWF2pIGTjimNIeZQ X-Google-Smtp-Source: AGHT+IF1Idf6vTQGEg5iEIyHq/7Kdjsrs7/za1bAbrMoQ+IHzhY3CAhC5zHpmfaRLn+EDWZe53RwHw== X-Received: by 2002:a17:902:ec8b:b0:1dc:11f:d954 with SMTP id x11-20020a170902ec8b00b001dc011fd954mr11997088plg.54.1708615504675; Thu, 22 Feb 2024 07:25:04 -0800 (PST) Received: from LOCLAP699.rst-01.locus ([208.195.13.130]) by smtp.gmail.com with ESMTPSA id jd20-20020a170903261400b001d94a3f3987sm10044873plb.184.2024.02.22.07.25.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 07:25:04 -0800 (PST) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH 4/7] iwd: add iwd_notice for special event/state type of logging Date: Thu, 22 Feb 2024 07:24:48 -0800 Message-Id: <20240222152451.1541682-4-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240222152451.1541682-1-prestwoj@gmail.com> References: <20240222152451.1541682-1-prestwoj@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 iwd_notice is being added so modules can communicate internal state or event information via the NOTICE log level. This log level will be reserved in IWD for only these type of messages. The iwd_notice macro aims to help enforce some formatting requirements for these type of log messages. The messages should be one or more comma-separated "key: value" pairs starting with "event: " and followed by any additional info that pertains to that event. iwd_notice only enforces the initial event key/value format and additional arguments are left to the caller to be formatted correctly. --- src/iwd.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/iwd.h b/src/iwd.h index 1be20df3..a8e2c5db 100644 --- a/src/iwd.h +++ b/src/iwd.h @@ -42,3 +42,17 @@ const char *iwd_get_iface_blacklist(void); const char *iwd_get_phy_whitelist(void); const char *iwd_get_phy_blacklist(void); bool iwd_is_developer_mode(void); + +#define IWD_NOTICE_STATE "state" +#define IWD_NOTICE_CONNECT_INFO "connect-info" +#define IWD_NOTICE_ROAM_INFO "roam-info" +#define IWD_NOTICE_DISCONNECT_INFO "disconnect-info" +#define IWD_NOTICE_FT_ROAM_FAILED "ft-roam-failed" +#define IWD_NOTICE_CONNECT_FAILED "connect-failed" +#define IWD_NOTICE_AUTH_TIMEOUT "authentication-timeout" +#define IWD_NOTICE_ASSOC_TIMEOUT "association-timeout" +#define IWD_NOTICE_CONNECT_TIMEOUT "connect-timeout" +#define IWD_NOTICE_ROAM_SCAN "roam-scan" + +#define iwd_notice(event, ...) \ + l_notice("event: " event ", " __VA_ARGS__) From patchwork Thu Feb 22 15:24:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 13567455 Received: from mail-pg1-f182.google.com (mail-pg1-f182.google.com [209.85.215.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3B5BE14C5B1 for ; Thu, 22 Feb 2024 15:25:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708615508; cv=none; b=PDfJ8wDfdhVW9XK3L7DspQjs94Uj3vMt4p3eY6vUb6mSlHiqZBPGhWV5Fa9sW+phLimW0g+t7cJ3CuKJzj63GrbDz8uairFvO0UBJBIpE0eLmOU4fP3RIIgFKUh+BGciIh+agpQLhjkig5jI7f6VnPgMY+A+rt5pC9pdWrirMLw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708615508; c=relaxed/simple; bh=Z61jTqYf3mrqIoBl4vwh0fodGPv+kblLyeNMBdac2vQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=CKfFrHUUjRcL3iYyUKN9+a9As8QxxR13dm9AHJG7v4L1f/qVcqAMibIQlwO5DiqUJdq3/BE0K33xL/2NxJ2CVBPG+zjcngePhdtulBX/sGUuD7XUMy6Y8ZwYNSfE8yD1WZvCaI8jNrkte0zJ3/IV2ERDxvKQRN+cjC04KP0xTjo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=cWkJb/cX; arc=none smtp.client-ip=209.85.215.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="cWkJb/cX" Received: by mail-pg1-f182.google.com with SMTP id 41be03b00d2f7-5dca1efad59so7231548a12.2 for ; Thu, 22 Feb 2024 07:25:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708615506; x=1709220306; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+RxDxZNcWgZxObjqXsUDIT4GiaFdU7jw+jB2BudVupQ=; b=cWkJb/cXf57O6iP6hY3Gt1nSB97RWNOJe4tWWS/DFJDoozHnNC57w+DAv1JgKs4Ar1 Sw9hWCwaRYi8ksPetVY8ceoPOFfTwIaizJ3QpzXfQAcAJuOWsDuTSbXcEYvEjRoatba+ MQgm3o3i/QOMHkNh8ZsZ8iYRszELP9NDNnkm3mgnC/wfDVhwZVZIZzvOVPUqSIQ/xr1e O27XPJShj7eeQQRX2f3FQ6WTkL4jgnJ1d/CODtpkGfMizqKAOWXZqGkeWtec0h0xOSSM /9IETZVpfg0VQePFq7IEZQOzSrFeRC5omCAGcfcy6BNXmz32ZHysHM1nznke4Hf1WCpN szpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708615506; x=1709220306; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+RxDxZNcWgZxObjqXsUDIT4GiaFdU7jw+jB2BudVupQ=; b=KyHU9TgWUKEE0DAMxiFkAy44mhhEwdQyFmVx+TS7O5KqgMUbNSLH2lvS79L4TPJ7Vc Ho8g657lqh+Pb6rWL24HzEXtlmg3WvRfDdIVvWA9kO9jqmdvNKbpaXxsZsUMR4NOaz23 zToFWixqK/ntYH1MINrffD41c2r85q23dPjHFt2fB8HJsZQ7ywOgt0BfwSmZLA8af7s8 5Z/GSwyzGhVEJiFmaxFobFAsLv9lB4b7kRrJfsSf5hxRna3wZQ2MkAUBRca/IM6VztZq kSLL6pVHFPg5n5+iyMKtoegi/O9DCfGdvcCIYzAS8zJ9MIMkE4MWVmHD9hDQZutYgKGH 1Hug== X-Gm-Message-State: AOJu0YxLryNC9FenG6TaDsBsiO2MvCDP/3+MOB41lp1HMit/BFBYpx7q NqKg51EyxEpvq20rVyRbz8e2WTF+ljczGus8vrbjQyEmrHiF3tybL8nfOR2H X-Google-Smtp-Source: AGHT+IHo1bksQWoljLl3/SrYEuRKS47T0XOeWj8UJ5hubtnyBvr/syezsHAEgZusj3Dd+jY1sDo4bQ== X-Received: by 2002:a05:6a21:164e:b0:19e:a1a2:4c53 with SMTP id no14-20020a056a21164e00b0019ea1a24c53mr2360557pzb.1.1708615506097; Thu, 22 Feb 2024 07:25:06 -0800 (PST) Received: from LOCLAP699.rst-01.locus ([208.195.13.130]) by smtp.gmail.com with ESMTPSA id jd20-20020a170903261400b001d94a3f3987sm10044873plb.184.2024.02.22.07.25.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 07:25:05 -0800 (PST) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH 5/7] doc: document use of l_log APIs Date: Thu, 22 Feb 2024 07:24:49 -0800 Message-Id: <20240222152451.1541682-5-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240222152451.1541682-1-prestwoj@gmail.com> References: <20240222152451.1541682-1-prestwoj@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 With the introduction of l_notice in IWD some guidelines need to be set for l_info, l_warn, l_error, l_debug and l_notice. --- doc/coding-style.txt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/doc/coding-style.txt b/doc/coding-style.txt index bf0535c5..882de026 100644 --- a/doc/coding-style.txt +++ b/doc/coding-style.txt @@ -317,6 +317,21 @@ Functions that are static should not be forward-declared. The only exception to this rule is if a circular dependency condition exists, and the forward declaration cannot be avoided. +M18: Use appropriate logging levels +=================================== +An appropriate log level should be used depending on the type of message +being logged. Logging is done using the l_log APIs in ELL: + +l_error An unexpected condition ocurred. These are generally fatal to the + current connection/protocol that is running but not generally to IWD's + overall operation. +l_warn An unexpected, but non-fatal condition ocurred +l_notice Should not be used directly. This log level is reserved for special + event type notifications which is handled by iwd_notice(). +l_info Information that is expected during normal operation. l_info's use + should be very limited so non-debug logs are concise +l_debug General debugging. These can be used relatively freely but should + provide some piece of useful information. O1: Shorten the name ==================== From patchwork Thu Feb 22 15:24:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 13567456 Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8DD26148FE6 for ; Thu, 22 Feb 2024 15:25:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708615510; cv=none; b=pcIe1Y8KixEv7dZ0fk6ieXDATX962cvWYXSzTeZTbFVIRafRahKoWoyJom3pNMZYapmOO56JBZD2iynuVSc8S2RfKbDJ3HER3ULwlkQ+Hx74YYKHUDq1wNqo/fsBjzuVS1ZmGFMDyK1W2nnGi7j+FFlM9+BQlNfh1ds63rz8pwY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708615510; c=relaxed/simple; bh=W0bZObP3tVFXeX9n82rV3ag9yqIcamebywg3CMtpTQs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=tSwTHHNGkrOE3Cq3UF1SwOuEvijABhG9pYjOGir+R0m+cZZadeYNyKk0USL2rwb0syr54wQflL58pv2seHV591DZEh6h4sY1jTi/g2xucRQJlt5+E8k/ujB+Wo4YDO43Xdkopk23gCQ5CXiE5Ew9XQKn5NoAqqcrZiRvqUEyR4k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=GzHDvnv1; arc=none smtp.client-ip=209.85.214.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="GzHDvnv1" Received: by mail-pl1-f178.google.com with SMTP id d9443c01a7336-1d731314e67so58362745ad.1 for ; Thu, 22 Feb 2024 07:25:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708615507; x=1709220307; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=D4nImlvJnivfs9V0+/iuGxuAV9smyFbHtiNjuzhjiog=; b=GzHDvnv1D2ouL+6vzOd5I8nUUVWQag4rbqPUzeZXZpsHhn06ntHvaYE77S/+YlCBES 8Y3OM/Q4KrIyYjL7P+F3KJFj+ewgzQNM4l4gNxConpdHj9Fz1RFPlbA2KaBa44dLWuMa 5bp3FtzJ7crjzavyJ/jcgWm6zt0FVW5IjYgn2naqAe/JvE9AL7mpp5YiuSQj4AQ9h/So XqNmtLV75DoVYA9uD+K72T/mJbApBxTLwyrzzqxTlG3wJx49Mc40p+/wFEVDHoCT57/U gclLZ495oISJ3KdCzcHJgAPujMC6Lc1GxsSOjNmVbVzLSq3rAlYU3eiU+cFKQKouacn/ bzvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708615507; x=1709220307; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=D4nImlvJnivfs9V0+/iuGxuAV9smyFbHtiNjuzhjiog=; b=iG6cEAwjh3//fgpu3y2/yC0ZvUzryJRVDNAOc22Gpv0l5KmQvpBmh17IlAzUq5lseR TgLiZwRZjlfTAg/ewm+2YcagXfXLwfQmfyKfVmvzfpgiijhujyaGJAk6Tgw/v/XSEBQz wKDyEZsQj3hr9zVC+fmbXO0q90Z38MTqMah3CPFKlxY6t+/wLIfj3rA1XtQhfqz35qRn Pc6S4y89ASqpmXGWVcf5MXJEzQG6lOqpcwkfbR9foZqoGQqM/sr5Uu4VTB3cmy2970cX LExcaLRWjqogm1tLU7U7sECZ0U/YA1J1m1EYCqHMKrO3zNBx7QsaQ6zbQ5AhO+G5r0aI Kb9g== X-Gm-Message-State: AOJu0Yy6IakHuO4U43my2PIdgk15QKDDyFVmF027QCYfG46L6viGwBFo f4ory12JJL6K3UNIvMzrVFWc53oYC82V1clhVK3kg6EhBjl0bozSPFhTUF6k X-Google-Smtp-Source: AGHT+IFbm9FTsr2sL0MH543nYtSsBwodqT5WtQglAgtHdjDqaKeKLsmXBvPrK47IN7X04Ryi3yYI5A== X-Received: by 2002:a17:903:24c:b0:1db:63aa:6d33 with SMTP id j12-20020a170903024c00b001db63aa6d33mr23526546plh.4.1708615507561; Thu, 22 Feb 2024 07:25:07 -0800 (PST) Received: from LOCLAP699.rst-01.locus ([208.195.13.130]) by smtp.gmail.com with ESMTPSA id jd20-20020a170903261400b001d94a3f3987sm10044873plb.184.2024.02.22.07.25.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 07:25:07 -0800 (PST) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH 6/7] station: use iwd_notice for state/event information Date: Thu, 22 Feb 2024 07:24:50 -0800 Message-Id: <20240222152451.1541682-6-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240222152451.1541682-1-prestwoj@gmail.com> References: <20240222152451.1541682-1-prestwoj@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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; From patchwork Thu Feb 22 15:24:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 13567457 Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 247D914C5B7 for ; Thu, 22 Feb 2024 15:25:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708615511; cv=none; b=BFRvuxtZif9NXVI4SFIQurbsE1QgBrKAUH/2gysRP8TwzZnhyOBW/wpOHbNN9V7RmKbOsLrbOT+WktjUwNsjsG0ZriZ1tJd8ekfIEq3mgau2nAlnQfBzeIpL8ORaTpAL/QxQVGhUwzPuQDP7HlSM/2RlU9VK7yLLVv//HEAhN1M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708615511; c=relaxed/simple; bh=OPTjDuDsRK7620EYtq3/5CDRjuN0n7CJU5rBzGMT2JA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=kfQqYgu9vx9fVYLQGRAD3RXvYaJ+y87jab59t0vjRK0JPzelRP5UziYrGJHpPtlF8i4Wi3Xw6EIheTlCtCIvnLbXzgm+LlxoxTvE6Xgtb8tMzKu3AcVY+oGu3YDWYvsIMszs8KJoQEWSVDTgT7duXtAkR/xo951UxGWasV/Mods= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=FbdlhEZG; arc=none smtp.client-ip=209.85.214.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="FbdlhEZG" Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-1d7232dcb3eso49160885ad.2 for ; Thu, 22 Feb 2024 07:25:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708615509; x=1709220309; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=JypMPKGmXYBsDH+kYyFeMEQU9sI1BHdfLWt+nnqgLz0=; b=FbdlhEZGAkjIUih/NOlGREyHs+IXdHjpkktY8HEu01sFnTop08E3jsRa5mLTEBiPWS +lcgzaWw9GE9NSUBSNgSes0l1ajvbn+/hJLYlIRuEOVWwAIiCwBZC7m2at3+BHpGVmaE P54nA0mdVlaGrXpc9q9fnmcDs5VvmFiFvRV+q28r7Hij90A0qj6cxb9WbsAUTjLi0j3Q YO0zhfCfU5KDB9tWlnl0eeTpq+3uebyOfh/jKDoDMx5Jy3qBdshEW0HCNOdJfL20feFZ /Hmcr0E4ZwQ03/+m6A7AKS50TyVLmmAX5a0bnOzxO1UtS4wCzlVm8Vevm/9FLhyTsah4 sgQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708615509; x=1709220309; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JypMPKGmXYBsDH+kYyFeMEQU9sI1BHdfLWt+nnqgLz0=; b=EJu+Xq2srOBu+fTufOaiJVAcIe88GxQiqIb5Ll+1K6sUzWA53G1EAgdbW/56jxXGq7 tpnJ85MhuZkcqI9xou1fiVjCJhsLsMw4JRfAPZhJax435YIy3LwpPjSZRH4NydnpnFq8 ITj0t3DFsiZ9eS6QHa0Pa+pfZXO6W+cSG4VP1xBdufhvLTLd21vUwgRURiP0A3a1YaNM hqU7ET9XFZaNaU9LKX7f+lZVt4KX2u8fIf1ammTcOMnHA5lLNDqmQkHJnfDJ+dLdzcmI dOhax+eJF5zFXvePjYRdZJRXfVuauOKDXKOtOsoN6Up7RqGfApec37tHUI+KeYPoCLOv 9oww== X-Gm-Message-State: AOJu0Yxv5LrGYzx0qsc+RbAuFnGCeAkp4cZ737/BEgTfxsxNWKe9HKIi 63JsqkMPyik8hu9vpIdzAjORiS9QqSpAGA77tteQ/JjCt71yr+51IWDcwyQS X-Google-Smtp-Source: AGHT+IGIC45DWrRJsqvdscCMDaKiWyj+jR8pt4UeIvNNezrt56NilewpKlvjzDn7HHi++bBSPG/s4Q== X-Received: by 2002:a17:902:7243:b0:1dc:49ab:98b0 with SMTP id c3-20020a170902724300b001dc49ab98b0mr2004720pll.35.1708615509260; Thu, 22 Feb 2024 07:25:09 -0800 (PST) Received: from LOCLAP699.rst-01.locus ([208.195.13.130]) by smtp.gmail.com with ESMTPSA id jd20-20020a170903261400b001d94a3f3987sm10044873plb.184.2024.02.22.07.25.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 07:25:08 -0800 (PST) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH 7/7] netdev: add notice events for connection timeouts Date: Thu, 22 Feb 2024 07:24:51 -0800 Message-Id: <20240222152451.1541682-7-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240222152451.1541682-1-prestwoj@gmail.com> References: <20240222152451.1541682-1-prestwoj@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The information specific to auth/assoc/connect timeouts isn't communicated to station so emit the notice events within netdev. We could communicate this to station by adding separate netdev events, but this does not seem worth it for this use case as these notice events aren't strictly limited to station. --- src/netdev.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/netdev.c b/src/netdev.c index 48fb15df..8a7ff092 100644 --- a/src/netdev.c +++ b/src/netdev.c @@ -2639,7 +2639,8 @@ static void netdev_connect_event(struct l_genl_msg *msg, struct netdev *netdev) } if (timeout) { - l_warn("connect event timed out, reason=%u", timeout_reason); + iwd_notice(IWD_NOTICE_CONNECT_TIMEOUT, "reason: %u", + timeout_reason); goto error; } @@ -2931,7 +2932,7 @@ static void netdev_authenticate_event(struct l_genl_msg *msg, while (l_genl_attr_next(&attr, &type, &len, &data)) { switch (type) { case NL80211_ATTR_TIMED_OUT: - l_warn("authentication event timed out"); + iwd_notice(IWD_NOTICE_AUTH_TIMEOUT); if (auth_proto_auth_timeout(netdev->ap)) return; @@ -3032,7 +3033,7 @@ static void netdev_associate_event(struct l_genl_msg *msg, while (l_genl_attr_next(&attr, &type, &len, &data)) { switch (type) { case NL80211_ATTR_TIMED_OUT: - l_warn("association timed out"); + iwd_notice(IWD_NOTICE_ASSOC_TIMEOUT); if (auth_proto_assoc_timeout(netdev->ap)) return;