summaryrefslogtreecommitdiff
path: root/monitor/analyze.c
Commit message (Collapse)AuthorAgeFilesLines
* monitor/analyze: Fix scan-build warningsLuiz Augusto von Dentz2022-09-271-28/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes the following warnings: monitor/analyze.c:381:2: warning: Value stored to 'data' is never read [deadcode.DeadStores] data += sizeof(*hdr); ^ ~~~~~~~~~~~~ monitor/analyze.c:382:2: warning: Value stored to 'size' is never read [deadcode.DeadStores] size -= sizeof(*hdr); ^ ~~~~~~~~~~~~ monitor/analyze.c:398:2: warning: Value stored to 'data' is never read [deadcode.DeadStores] data += sizeof(*evt); ^ ~~~~~~~~~~~~ monitor/analyze.c:399:2: warning: Value stored to 'size' is never read [deadcode.DeadStores] size -= sizeof(*evt); ^ ~~~~~~~~~~~~ monitor/analyze.c:418:2: warning: Value stored to 'data' is never read [deadcode.DeadStores] data += sizeof(*evt); ^ ~~~~~~~~~~~~ monitor/analyze.c:419:2: warning: Value stored to 'size' is never read [deadcode.DeadStores] size -= sizeof(*evt); ^ ~~~~~~~~~~~~ monitor/analyze.c:527:2: warning: Value stored to 'data' is never read [deadcode.DeadStores] data += sizeof(subtype); ^ ~~~~~~~~~~~~~~~ monitor/analyze.c:528:2: warning: Value stored to 'size' is never read [deadcode.DeadStores] size -= sizeof(subtype); ^ ~~~~~~~~~~~~~~~ monitor/analyze.c:629:2: warning: Value stored to 'data' is never read [deadcode.DeadStores] data += sizeof(*hdr); ^ ~~~~~~~~~~~~ monitor/analyze.c:630:2: warning: Value stored to 'size' is never read [deadcode.DeadStores] size -= sizeof(*hdr); ^ ~~~~~~~~~~~~ monitor/analyze.c:646:2: warning: Value stored to 'data' is never read [deadcode.DeadStores] data += sizeof(*hdr); ^ ~~~~~~~~~~~~ monitor/analyze.c:647:2: warning: Value stored to 'size' is never read [deadcode.DeadStores] size -= sizeof(*hdr); ^ ~~~~~~~~~~~~ monitor/analyze.c:710:2: warning: Value stored to 'data' is never read [deadcode.DeadStores] data += sizeof(*hdr); ^ ~~~~~~~~~~~~ monitor/analyze.c:711:2: warning: Value stored to 'size' is never read [deadcode.DeadStores] size -= sizeof(*hdr); ^ ~~~~~~~~~~~~
* monitor: fix printf format stringsChristian Eggers2022-09-261-9/+12
| | | | time_t is 64 bit (long long) on many 32 bit platforms (e.g. ARM) now
* monitor: fix division by zero about conn->tx_pkt_medJoseph Hwang2022-02-231-1/+2
| | | | | | | | | | | | | | | In a connection without outgoing traffic, conn->tx_num will remain 0. In this case, conn->tx_pkt_med should be simply 0 without calculating "conn->tx_bytes / conn->tx_num". This was likely to happen, for example, when "btmon -w btsnoop.log" was launched in the middle of a LE mouse connection, and a number of incoming ACL Data RX were received as the mouse movements. When running "btmon -a btsnoop.log", it would encounter this error. Reviewed-by: Alain Michaud <alainm@chromium.org> Reviewed-by: Yun-Hao Chung <howardchung@chromium.org> Reviewed-by: Shuo-Peng Liao <deanliao@chromium.org>
* monitor: Track PSM for L2CAP analyze functionMarcel Holtmann2021-08-171-0/+34
|
* monitor: Track L2CAP packets for analyze functionMarcel Holtmann2021-08-161-2/+71
|
* monitor: Make --analyze print address OUILuiz Augusto von Dentz2021-08-091-14/+16
| | | | | This makes analyze.c use packet_print_addr which does take care of decoding OUI portion of the address.
* monitor: Make --analyze output latencies in msecLuiz Augusto von Dentz2021-08-091-6/+9
| | | | | | | Milisecconds is probably the best unit to have since it is unlikely that the controller can respond in under 1 msec as well as most time sensitive connection e.g. A2DP, HFP, etc, also don't expect the latencies to be over 1 sec.
* monitor: Fix not accouting for multiple outstanding packetsLuiz Augusto von Dentz2021-08-091-7/+13
| | | | | | | Analyze code was not accounting for the fact that multiple outstanding packets could be pending which will cause the last_tx to be overwritten but its latency would be calculated against the very first packet complete.
* monitor: Fix minimun packet latencyLuiz Augusto von Dentz2021-08-091-2/+5
| | | | | | It seems timer_sub can produce negative values leading to median packet latency to be negative e.g conn->last_tx_compl is ahead of conn->last_tx, in which case it should be discarded.
* monitor: Fix median packet sizeLuiz Augusto von Dentz2021-08-091-5/+4
| | | | | | | | Calculating the median packet based on the current median + size / 2 does not account for last packet could smaller e.g. opp transfer could end with just 1 byte which would cut the median in a half, so this switch to more traditional means of calculating by doing total bytes sent / num of packets so each an every packet has the same weight.
* monitor: Add further stats to analzye functionalityMarcel Holtmann2021-08-061-13/+132
|
* monitor: Track connections for analyze functionMarcel Holtmann2021-08-031-2/+154
|
* monitor: Remove unneeded fprintf for new devicesMarcel Holtmann2021-08-031-2/+0
|
* monitor: Count number of control messagesMarcel Holtmann2021-08-031-0/+20
|
* monitor: Add ISO packets to analyze optionMarcel Holtmann2021-08-031-0/+22
|
* monitor: Remove unneeded fprintf for unknown opcodesMarcel Holtmann2021-08-031-1/+0
|
* monitor: Add SPDX License IdentifierTedd Ho-Jeong An2020-09-211-14/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds SPDX License Identifier and removes the license text. ------------------------------------- License COUNT ------------------------------------- LGPL-2.1-or-later : 47 License: LGPL-2.1-or-later monitor/bt.h monitor/hcidump.h monitor/avdtp.h monitor/crc.c monitor/sdp.c monitor/hwdb.c monitor/intel.h monitor/avctp.c monitor/control.h monitor/display.c monitor/a2dp.c monitor/ll.c monitor/ll.h monitor/jlink.h monitor/broadcom.h monitor/lmp.c monitor/keys.c monitor/ellisys.c monitor/main.c monitor/ellisys.h monitor/hwdb.h monitor/display.h monitor/jlink.c monitor/rfcomm.h monitor/packet.c monitor/crc.h monitor/keys.h monitor/sdp.h monitor/rfcomm.c monitor/avdtp.c monitor/a2dp.h monitor/avctp.h monitor/vendor.h monitor/hcidump.c monitor/intel.c monitor/tty.h monitor/control.c monitor/lmp.h monitor/analyze.c monitor/bnep.c monitor/l2cap.c monitor/vendor.c monitor/packet.h monitor/broadcom.c monitor/analyze.h monitor/l2cap.h monitor/bnep.h
* monitor: Remove some dead codeSzymon Janc2016-06-171-12/+0
| | | | new0 and queue_new cannot fail.
* monitor: Add support for counting unknown opcodes in analyzeSzymon Janc2016-06-171-2/+17
| | | | | Count unknown opcodes and print them in summary instead of failing to analyze btsnoop file.
* monitor: Display all events type in analyzeSzymon Janc2016-06-171-0/+51
| | | | This add support for counting all event types in analyze.
* monitor: Add support for analyzing index infoSzymon Janc2016-06-171-1/+29
| | | | Will now show vendor name if it was provided in snoop file.
* btsnoop: Update file format identifiers for trace filesMarcel Holtmann2015-11-081-6/+6
|
* monitor: Add support for open and close index eventsMarcel Holtmann2015-10-041-0/+3
|
* monitor: Handle default switch caseAndrei Emeltchenko2014-08-131-0/+3
| | | | Fixes issues with junk packets.
* monitor: Use common maximum packet size definitionAndrei Emeltchenko2014-08-131-3/+1
|
* monitor: Fix possible resource leakAndrei Emeltchenko2014-07-041-1/+1
| | | | | | | | | | | | This fixes following memory leak: ... ==14887== 24 bytes in 1 blocks are definitely lost in loss record 2 of 4 ==14887== at 0x4C2CC70: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==14887== by 0x425B6C: btsnoop_open (btsnoop.c:83) ==14887== by 0x424837: analyze_trace (analyze.c:262) ==14887== by 0x40249A: main (main.c:189) ...
* monitor: Fix checking boolean return valueAndrei Emeltchenko2014-06-231-2/+2
| | | | Since btsnoop_read_hci() is used from src/shared.
* monitor: Add support for reading Apple Packet Logger tracesMarcel Holtmann2014-02-121-1/+1
|
* monitor: Use shared btsnoop for reading and writing trace filesMarcel Holtmann2014-02-111-4/+9
|
* monitor: Use shared btsnoop code wherever possibleMarcel Holtmann2014-02-111-2/+2
|
* monitor: Update copyright and license detailsMarcel Holtmann2014-02-111-2/+2
|
* monitor: Make use of generic endian conversion macrosMarcel Holtmann2014-01-101-5/+0
|
* monitor: Show controller type on analyzer summaryMarcel Holtmann2014-01-061-1/+14
|
* monitor: Count number of commands, events and data packetsMarcel Holtmann2014-01-061-18/+115
|
* monitor: Add initial support for analyzing btsnoop tracesMarcel Holtmann2014-01-061-0/+215