2011-11-22 20:14:17

by Andre Guedes

[permalink] [raw]
Subject: [PATCH 0/2] Add debug macros to Discovery

Hi all,

These two patches helped me during tracing analysis of mgmt
discovery commands and It would be good to have them pushed
upstream.

Andre Guedes (2):
Bluetooth: Move debug macros
Bluetooth: Add BT_DBG to mgmt_discovering()

net/bluetooth/hci_core.c | 8 ++++----
net/bluetooth/mgmt.c | 2 ++
2 files changed, 6 insertions(+), 4 deletions(-)

--
1.7.7.1



2011-11-22 20:14:19

by Andre Guedes

[permalink] [raw]
Subject: [PATCH 2/2] Bluetooth: Add BT_DBG to mgmt_discovering()

Signed-off-by: Andre Guedes <[email protected]>
---
net/bluetooth/mgmt.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index f615a5a..19503f9 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -2680,6 +2680,8 @@ int mgmt_discovering(struct hci_dev *hdev, u8 discovering)
{
struct pending_cmd *cmd;

+ BT_DBG("%s discovering %u", hdev->name, discovering);
+
if (discovering)
cmd = mgmt_pending_find(MGMT_OP_START_DISCOVERY, hdev);
else
--
1.7.7.1


2011-11-22 20:14:18

by Andre Guedes

[permalink] [raw]
Subject: [PATCH 1/2] Bluetooth: Move debug macros

Move debug macros so they provide us more meaningful information
during debugging analysis.

Signed-off-by: Andre Guedes <[email protected]>
---
net/bluetooth/hci_core.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index ef0423e..8487483 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -2594,11 +2594,11 @@ int hci_do_inquiry(struct hci_dev *hdev, u8 length)
u8 lap[3] = { 0x33, 0x8b, 0x9e };
struct hci_cp_inquiry cp;

- BT_DBG("%s", hdev->name);
-
if (test_bit(HCI_INQUIRY, &hdev->flags))
return -EINPROGRESS;

+ BT_DBG("%s", hdev->name);
+
memset(&cp, 0, sizeof(cp));
memcpy(&cp.lap, lap, sizeof(cp.lap));
cp.length = length;
@@ -2608,11 +2608,11 @@ int hci_do_inquiry(struct hci_dev *hdev, u8 length)

int hci_cancel_inquiry(struct hci_dev *hdev)
{
- BT_DBG("%s", hdev->name);
-
if (!test_bit(HCI_INQUIRY, &hdev->flags))
return -EPERM;

+ BT_DBG("%s", hdev->name);
+
return hci_send_cmd(hdev, HCI_OP_INQUIRY_CANCEL, 0, NULL);
}

--
1.7.7.1


2012-02-03 23:33:59

by Johan Hedberg

[permalink] [raw]
Subject: Re: [PATCH 2/2] Bluetooth: Add BT_DBG to mgmt_discovering()

Hi,

On Fri, Feb 03, 2012, Marcel Holtmann wrote:
> > Signed-off-by: Andre Guedes <[email protected]>
> > ---
> > net/bluetooth/mgmt.c | 2 ++
> > 1 files changed, 2 insertions(+), 0 deletions(-)
>
> Acked-by: Marcel Holtmann <[email protected]>

Applied to my bluetooth-next tree.

Johan

2012-02-03 23:27:37

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [PATCH 2/2] Bluetooth: Add BT_DBG to mgmt_discovering()

Hi Andre,

> Signed-off-by: Andre Guedes <[email protected]>
> ---
> net/bluetooth/mgmt.c | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)

Acked-by: Marcel Holtmann <[email protected]>

Regards

Marcel



2012-02-03 23:27:08

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [PATCH 1/2] Bluetooth: Move debug macros

Hi Andre,

> Move debug macros so they provide us more meaningful information
> during debugging analysis.
>
> Signed-off-by: Andre Guedes <[email protected]>
> ---
> net/bluetooth/hci_core.c | 8 ++++----
> 1 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
> index ef0423e..8487483 100644
> --- a/net/bluetooth/hci_core.c
> +++ b/net/bluetooth/hci_core.c
> @@ -2594,11 +2594,11 @@ int hci_do_inquiry(struct hci_dev *hdev, u8 length)
> u8 lap[3] = { 0x33, 0x8b, 0x9e };
> struct hci_cp_inquiry cp;
>
> - BT_DBG("%s", hdev->name);
> -
> if (test_bit(HCI_INQUIRY, &hdev->flags))
> return -EINPROGRESS;
>
> + BT_DBG("%s", hdev->name);
> +

I actually do not like this change much. Can we just add the flags into
the debug print instead.

Regards

Marcel



2012-02-03 23:17:10

by Andre Guedes

[permalink] [raw]
Subject: Re: [PATCH 2/2] Bluetooth: Add BT_DBG to mgmt_discovering()

Please consider applying this patch. It is really helpful during
discovery debugging.

On Tue, Nov 22, 2011 at 5:14 PM, Andre Guedes
<[email protected]> wrote:
> Signed-off-by: Andre Guedes <[email protected]>
> ---
> ?net/bluetooth/mgmt.c | ? ?2 ++
> ?1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
> index f615a5a..19503f9 100644
> --- a/net/bluetooth/mgmt.c
> +++ b/net/bluetooth/mgmt.c
> @@ -2680,6 +2680,8 @@ int mgmt_discovering(struct hci_dev *hdev, u8 discovering)
> ?{
> ? ? ? ?struct pending_cmd *cmd;
>
> + ? ? ? BT_DBG("%s discovering %u", hdev->name, discovering);
> +
> ? ? ? ?if (discovering)
> ? ? ? ? ? ? ? ?cmd = mgmt_pending_find(MGMT_OP_START_DISCOVERY, hdev);
> ? ? ? ?else
> --
> 1.7.7.1
>

Andre