monitor: Fix not parsing BT_HCI_EVT_NUM_COMPLETED_PACKETS properly
Luiz Augusto von Dentz
maintainerPATCH 1/2 monitor: Fix not parsing BT_HCI_EVT_NUM_COMPLETED_PACKETS properly
From: Luiz Augusto von Dentz <[email protected]>
BT_HCI_EVT_NUM_COMPLETED_PACKETS may contain multiple handles but the code was just parsing the very first one.
--- monitor/packet.c | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-)
monitor/packet.c +21 -4
@@ -10293,14 +10293,31 @@ static void role_change_evt(uint16_t index, const void *data, uint8_t size)static void num_completed_packets_evt (uint16_t index,const void *data,uint8_t size) { +struct iovec iov = { (void *)data, size};const struct bt_hci_evt_num_completed_packets *evt = data; +int i; + +iov_pull (&iov,1 );print_field ("Num handles: %d" , evt->num_handles); -print_handle (evt->handle); -print_field ("Count: %d" ,le16_to_cpu (evt->count)); -if (size >sizeof (*evt)) -packet_hexdump (data +sizeof (*evt), size -sizeof (*evt)); +for (i =0 ; i < evt->num_handles; i++) { +uint16_t handle; +uint16_t count; + +if (!util_iov_pull_le16 (&iov, &handle)) +break ; + +print_handle_native (handle); + +if (!util_iov_pull_le16 (&iov, &count)) +break ; + +print_field ("Count: %d" ,le16_to_cpu (evt->count)); + } + +if (iov.iov_len) +packet_hexdump (iov.iov_base, iov.iov_len); }static void mode_change_evt (uint16_t index,const void *data,uint8_t size)
Signature · 1 line
2.40.1
Luiz Augusto von Dentz
maintainerPATCH 2/2 monitor: Add latency when decoding BT_HCI_EVT_NUM_COMPLETED_PACKETS
From: Luiz Augusto von Dentz <[email protected]>
This adds latency, min-max, and median information when decoding BT_HCI_EVT_NUM_COMPLETED_PACKETS so it works similarly to --analyze:
Quoted 1 line
HCI Event: Number of Completed Packets (
0x13) plen 5
Num handles: 1
Handle: 256 Address: XX:XX:XX:XX:XX:XX
Count: 1
Latency: 23 msec (2-66 msec ~19 msec)
---
monitor/broadcom.c | 3 +-
monitor/intel.c | 51 +++--
monitor/msft.c | 3 +-
monitor/packet.c | 488 ++++++++++++++++++++++++++++-----------------
monitor/packet.h | 4 +
monitor/vendor.h | 3 +-
6 files changed, 344 insertions(+), 208 deletions(-)monitor/broadcom.c +2 -1
@@ -706,7 +706,8 @@ void broadcom_lm_diag(const void *data, uint8_t size) } } -static void lm_diag_evt (uint16_t index,const void *data,uint8_t size) +static void lm_diag_evt (struct timeval *tv,uint16_t index, +const void *data,uint8_t size) {broadcom_lm_diag (data,63 ); }
monitor/intel.c +30 -21
138 lines not on this page · raw message
monitor/msft.c +2 -1
@@ -299,7 +299,8 @@ const struct vendor_ocf *msft_vendor_ocf(void)return &vendor_ocf_entry; } -static void msft_evt (uint16_t index,const void *data,uint8_t size) +static void msft_evt (struct timeval *tv,uint16_t index, +const void *data,uint8_t size) {packet_hexdump (data, size); }
monitor/packet.c +304 -184
1,183 lines not on this page · raw message
monitor/packet.h +4 -0
@@ -31,6 +31,10 @@ struct packet_conn_data {uint8_t type;uint8_t dst[6 ];uint8_t dst_type; +struct queue *tx_q; +struct timeval tx_min; +struct timeval tx_max; +struct timeval tx_med;void *data;void (*destroy)(void *data); };
monitor/vendor.h +2 -1
@@ -25,7 +25,8 @@ struct vendor_ocf {struct vendor_evt {uint8_t evt;const char *str; -void (*evt_func) (uint16_t index,const void *data,uint8_t size); +void (*evt_func) (struct timeval *tv,uint16_t index, +const void *data,uint8_t size);uint8_t evt_size;bool evt_fixed; };
Signature · 1 line
2.40.1
This is automated email and please do not reply to this email!
Dear submitter,
Thank you for submitting the patches to the linux bluetooth mailing list. This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=749061
---Test result---
Test Summary:
CheckPatch FAIL 1.81 seconds GitLint PASS 0.73 seconds BuildEll PASS 26.98 seconds BluezMake PASS 866.74 seconds MakeCheck PASS 11.87 seconds MakeDistcheck PASS 152.15 seconds CheckValgrind PASS 248.23 seconds CheckSmatch WARNING 335.57 seconds bluezmakeextell PASS 100.97 seconds IncrementalBuild PASS 1428.68 seconds ScanBuild WARNING 1029.29 seconds
Details
##############################
Test: CheckPatch - FAIL
Desc: Run checkpatch.pl script
Output:
[BlueZ,2/2] monitor: Add latency when decoding BT_HCI_EVT_NUM_COMPLETED_PACKETS WARNING:SPACING: Unnecessary space before function pointer arguments #1434: FILE: monitor/packet.c:11639:
+ void (*func) (struct timeval *tv, uint16_t index, const void *data,
WARNING:SPACING: Unnecessary space before function pointer arguments #1506: FILE: monitor/packet.c:11826:
+ void (*func) (struct timeval *tv, uint16_t index, const void *data,
WARNING:SPACING: Unnecessary space before function pointer arguments #1591: FILE: monitor/vendor.h:28:
+ void (*evt_func) (struct timeval *tv, uint16_t index,
/github/workspace/src/src/13247515.patch total: 0 errors, 3 warnings, 1358 lines checked
NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or --fix-inplace.
/github/workspace/src/src/13247515.patch has style problems, please review.
NOTE: Ignored message types: COMMIT_MESSAGE COMPLEX_MACRO CONST_STRUCT FILE_PATH_CHANGES MISSING_SIGN_OFF PREFER_PACKED SPDX_LICENSE_TAG SPLIT_STRING SSCANF_TO_KSTRTO
NOTE: If any of the errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.
##############################
Test: CheckSmatch - WARNING
Desc: Run smatch tool with source
Output:monitor/packet.c: note: in included file:monitor/display.h:82:26: warning: Variable length array is used.monitor/packet.c:1805:26: warning: Variable length array is used.monitor/packet.c: note: in included file:monitor/bt.h:3552:52: warning: array of flexible structuresmonitor/bt.h:3540:40: warning: array of flexible structuresmonitor/msft.c: note: in included file:monitor/msft.h:88:44: warning: array of flexible structuresmonitor/packet.c: note: in included file:monitor/display.h:82:26: warning: Variable length array is used.monitor/packet.c:1805:26: warning: Variable length array is used.monitor/packet.c: note: in included file:monitor/bt.h:3552:52: warning: array of flexible structuresmonitor/bt.h:3540:40: warning: array of flexible structures
##############################
Test: ScanBuild - WARNING
Desc: Run Scan Build
Output:monitor/packet.c:12356:2: warning: Null pointer passed to 2nd parameter expecting 'nonnull'
memcpy(tx, tv, sizeof(*tv));
^~~~~~~~~~~~~~~~~~~~~~~~~~~1 warning generated.
---
Regards,
Linux Bluetooth
This series was applied to bluetooth/bluez.git (master) by Luiz Augusto von Dentz <[email protected]>:
Hello:
This series was applied to bluetooth/bluez.git (master) by Luiz Augusto von Dentz <[email protected]>:
Quoted 7 lines · On Thu, 18 May 2023 16:20:48 -0700 you wrote:
From: Luiz Augusto von Dentz <[email protected]>
BT_HCI_EVT_NUM_COMPLETED_PACKETSmay contain multiple handles but the code was just parsing the very first one.--- monitor/packet.c | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-)
Here is the summary with links:
- [BlueZ,1/2] monitor: Fix not parsing BT_HCI_EVT_NUM_COMPLETED_PACKETS properly
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=e99fbb5e4eea - [BlueZ,2/2] monitor: Add latency when decoding BT_HCI_EVT_NUM_COMPLETED_PACKETS https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=cd176eb2d444
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html