From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [BlueZ PATCH v3 2/5] monitor/analyze: Use conn_pkt_tx on acl_pkt
Date: Tue, 1 Aug 2023 16:31:32 -0700 [thread overview]
Message-ID: <20230801233135.537864-2-luiz.dentz@gmail.com> (raw)
In-Reply-To: <20230801233135.537864-1-luiz.dentz@gmail.com>
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This makes use of conn_pkt_tx also on acl_pkt like other connections.
---
monitor/analyze.c | 49 ++++++++++++++++++-----------------------------
1 file changed, 19 insertions(+), 30 deletions(-)
diff --git a/monitor/analyze.c b/monitor/analyze.c
index db026190701d..a016e26e31ac 100644
--- a/monitor/analyze.c
+++ b/monitor/analyze.c
@@ -600,6 +600,24 @@ static void event_pkt(struct timeval *tv, uint16_t index,
}
}
+static void conn_pkt_tx(struct hci_conn *conn, struct timeval *tv,
+ uint16_t size)
+{
+ struct timeval *last_tx;
+
+ conn->tx_num++;
+
+ last_tx = new0(struct timeval, 1);
+ memcpy(last_tx, tv, sizeof(*tv));
+ queue_push_tail(conn->tx_queue, last_tx);
+ conn->tx_bytes += size;
+
+ if (!conn->tx_pkt_min || size < conn->tx_pkt_min)
+ conn->tx_pkt_min = size;
+ if (!conn->tx_pkt_max || size > conn->tx_pkt_max)
+ conn->tx_pkt_max = size;
+}
+
static void acl_pkt(struct timeval *tv, uint16_t index, bool out,
const void *data, uint16_t size)
{
@@ -637,39 +655,12 @@ static void acl_pkt(struct timeval *tv, uint16_t index, bool out,
}
if (out) {
- struct timeval *last_tx;
-
- conn->tx_num++;
- last_tx = new0(struct timeval, 1);
- memcpy(last_tx, tv, sizeof(*tv));
- queue_push_tail(conn->tx_queue, last_tx);
- conn->tx_bytes += size;
-
- if (!conn->tx_pkt_min || size < conn->tx_pkt_min)
- conn->tx_pkt_min = size;
- if (!conn->tx_pkt_max || size > conn->tx_pkt_max)
- conn->tx_pkt_max = size;
+ conn_pkt_tx(conn, tv, size);
} else {
conn->rx_num++;
}
}
-static void conn_pkt_tx(struct hci_conn *conn, struct timeval *tv,
- uint16_t size)
-{
- struct timeval *last_tx;
-
- last_tx = new0(struct timeval, 1);
- memcpy(last_tx, tv, sizeof(*tv));
- queue_push_tail(conn->tx_queue, last_tx);
- conn->tx_bytes += size;
-
- if (!conn->tx_pkt_min || size < conn->tx_pkt_min)
- conn->tx_pkt_min = size;
- if (!conn->tx_pkt_max || size > conn->tx_pkt_max)
- conn->tx_pkt_max = size;
-}
-
static void sco_pkt(struct timeval *tv, uint16_t index, bool out,
const void *data, uint16_t size)
{
@@ -690,7 +681,6 @@ static void sco_pkt(struct timeval *tv, uint16_t index, bool out,
return;
if (out) {
- conn->tx_num++;
conn_pkt_tx(conn, tv, size - sizeof(*hdr));
} else {
conn->rx_num++;
@@ -778,7 +768,6 @@ static void iso_pkt(struct timeval *tv, uint16_t index, bool out,
return;
if (out) {
- conn->tx_num++;
conn_pkt_tx(conn, tv, size - sizeof(*hdr));
} else {
conn->rx_num++;
--
2.41.0
next prev parent reply other threads:[~2023-08-01 23:31 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-01 23:31 [BlueZ PATCH v3 1/5] monitor: Add TX frame number and speed estimation Luiz Augusto von Dentz
2023-08-01 23:31 ` Luiz Augusto von Dentz [this message]
2023-08-01 23:31 ` [BlueZ PATCH v3 3/5] monitor: Print channel latency information with -a/--analyze Luiz Augusto von Dentz
2023-08-01 23:31 ` [BlueZ PATCH v3 4/5] monitor: Add connection tracking for SCO/ISO " Luiz Augusto von Dentz
2023-08-01 23:31 ` [BlueZ PATCH v3 5/5] monitor/analyze: Inline data to gnuplot Luiz Augusto von Dentz
2023-08-02 3:21 ` [BlueZ,v3,1/5] monitor: Add TX frame number and speed estimation bluez.test.bot
2023-08-02 21:00 ` [BlueZ PATCH v3 1/5] " patchwork-bot+bluetooth
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230801233135.537864-2-luiz.dentz@gmail.com \
--to=luiz.dentz@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.