Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1102216pxb; Thu, 24 Mar 2022 12:46:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzX2hFzzxcoJaKq77Y0Kns8rHatu7iaAFenGhvgiZyIyxe2DqGIRvxHrjBkr3ievTxRam// X-Received: by 2002:aa7:d682:0:b0:419:3b78:e489 with SMTP id d2-20020aa7d682000000b004193b78e489mr8676543edr.372.1648151178542; Thu, 24 Mar 2022 12:46:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648151178; cv=none; d=google.com; s=arc-20160816; b=PmtjOxGE8GrSGOglX03SM4ZtGpPNVLa1VM4J5o1y+zh/7qAuLgayHXbyhkkL4j1+jO TiZnJIYDsy3u8p8nH0yJPrX0E5ISb6ciGb9CoIUA2sGZtjzbCClDXnvuXeoDjJBbdJO8 BPxgl3HhgwmBqjq94vLwYmD+vMC04DNKp5YNZtWBGDdL2BHzUA5T2mHlAj1Y8VYvOa/d xqJ2WG8ja5UUftNgO+nQFPhd8ytAexwAERuax67qLfkLGAFWTm2qLQvJ+j86kV+V/P4y 2okEhVMiOcPSUta8yMSd0+Ywv2qEjmuI5jy78KsrT7iNPhIhgA1WZbbWo3XozgYnL1Id KadA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:to:from:dkim-signature; bh=fQwh4amWpFaUYFE3yRHpnASrf87h4cacFDES28Pe7yU=; b=gEaUcoXnb7FpbfFolW5k6WcMIl8g8hstLuJbZqgEiVbI8KTjoNLLehGcuYNUvCwy9Z wRwtiJ8q6WwTj66CTT6QubMNv8Ho84sdi099Ghtk86sgkA3CWstDz+UZjgfyO2raUNjX ALGyXm6cfTREDuk+gZzkY7pJ39T1I32GRdTbJuDT6DX+g1yWiiceiRyQpqiLag/rJzFa 4JQf7oDoVFPCPvv9cAqJYNURPl37GwNAhiGlmi5H5+99D8MP48e1lqCuRCvXmumUElqy pMurTNH0fEcFEmHWFlquYBNuyt61xhXEoEi7cZIHMOGubOtosF0WxGNZwj1r5uYQFFsp TMxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Bg2e9pcc; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bj11-20020a170906b04b00b006df76385bdesi337831ejb.126.2022.03.24.12.45.38; Thu, 24 Mar 2022 12:46:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Bg2e9pcc; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242251AbiCWWlg (ORCPT + 99 others); Wed, 23 Mar 2022 18:41:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42030 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234878AbiCWWlf (ORCPT ); Wed, 23 Mar 2022 18:41:35 -0400 Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 71A3035857 for ; Wed, 23 Mar 2022 15:40:05 -0700 (PDT) Received: by mail-pl1-x629.google.com with SMTP id w8so2948030pll.10 for ; Wed, 23 Mar 2022 15:40:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=fQwh4amWpFaUYFE3yRHpnASrf87h4cacFDES28Pe7yU=; b=Bg2e9pcc0QTwSwwA18iSxYR/hz7RMgXz8Wr7HsMOrksSBDlnHDCblZpf1aCgMm+Ntt noCT1r0HwxxWFFTxY0amri0FqADO5KqyvVBTUlU5Z2UCa2Jloyq7Gv2UVMVRiPInJ78G Z19LTXQHRTLsb2L6ZyMuJ/H4eNk+oAiCpbuzk8NANEr3NNYjxj76nzltk1W6vxJp76C4 e2ZH31fzMiqKkfu1eayLrpcOBjb840JS5KwNy4m/W2jKfICL6cGOWmxfl3LyzCR7kLDe n3/1IHIr7zznbDpiXqQ40uJqECb7lbDydNZ2GRlfl4XiqeHYcZv7LO6VA+f4TlYTkpd5 mBsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=fQwh4amWpFaUYFE3yRHpnASrf87h4cacFDES28Pe7yU=; b=EanfgfFVo2zuR1pma5AucF0qsETU+B/EUqgzjNhHawf1cZtG5QgUf0MgYScDo4vaQr xvbUK0gyJI0vQfqz9sTrhy9M91j3LBeYQCaFQrqZwn+DqcJD5pag+hLhm7lqUiL8HakM sktxuGWyEkerwHINx8LUNryF9Xc8P5ObeMAHFtdOJFJc1J4oCSrPKCFkTpH7IFVgHIIi J6FjdrE/OwETTcI8bYx5ZXQ9hefmSuqqLBrM4e466beCIKrd7dvoyWnz2u/eaIqnzE21 0P5z2VbwRVrp4UxTYCHPjme2wXyiYQpa3H+HDHbFLLvqg5c06ukKYPHLy+1pRa+Z90V+ gaBQ== X-Gm-Message-State: AOAM531StaltMoExft+GAiqTDTALFNo2VsP7bw6+zmfGUbMxP3QaBwKJ MbnpUWCW6W/zkABfNY3UZBc4FG0n0vs= X-Received: by 2002:a17:902:ce09:b0:151:96e2:d4b5 with SMTP id k9-20020a170902ce0900b0015196e2d4b5mr2335916plg.3.1648075204768; Wed, 23 Mar 2022 15:40:04 -0700 (PDT) Received: from lvondent-mobl4.intel.com (c-71-56-157-77.hsd1.or.comcast.net. [71.56.157.77]) by smtp.gmail.com with ESMTPSA id z14-20020aa7888e000000b004f79f59827asm825109pfe.139.2022.03.23.15.40.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Mar 2022 15:40:04 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [RFC BlueZ] adapter: Introduce BTD_ADAPTER_DBG Date: Wed, 23 Mar 2022 15:39:54 -0700 Message-Id: <20220323224003.3736525-1-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Luiz Augusto von Dentz This introduces BTD_ADAPTER_DBG which includes the controller index when using DBG_IDX, in addition to it also add similar macro for devices in the form of BTD_DEVICE_DBG which resolves the adapter and before calling BTD_ADAPTER_DBG. --- src/adapter.h | 4 ++++ src/device.h | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/adapter.h b/src/adapter.h index 35deb1d11..515be3210 100644 --- a/src/adapter.h +++ b/src/adapter.h @@ -23,6 +23,10 @@ /* Invalid SSP passkey value used to indicate negative replies */ #define INVALID_PASSKEY 0xffffffff +#define BTD_ADAPTER_DBG(adapter, fmt, arg...) \ + DBG_IDX(btd_adapter_get_index(adapter), "%s:%s() " fmt, __FILE__, \ + __func__ , ## arg) + struct btd_adapter; struct btd_device; struct queue; diff --git a/src/device.h b/src/device.h index 071576d6b..4d40d1d22 100644 --- a/src/device.h +++ b/src/device.h @@ -11,6 +11,10 @@ #define DEVICE_INTERFACE "org.bluez.Device1" +#define BTD_DEVICE_DBG(device, fmt, arg...) \ + BTD_ADAPTER_DBG(device_get_adapter(device), "%s:%s() " fmt, __FILE__, \ + __func__ , ## arg) + struct btd_device; struct btd_device *device_create(struct btd_adapter *adapter, -- 2.35.1