Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp263943rwo; Tue, 1 Aug 2023 16:52:01 -0700 (PDT) X-Google-Smtp-Source: APBJJlEY/w+Q+BF6hbEdvhbcKTPtVmKWomAC7d++SXUyr+TZlvkMRLhbgzpyYS4UD0+QW2Y1of8A X-Received: by 2002:a17:907:7889:b0:993:da87:1c7b with SMTP id ku9-20020a170907788900b00993da871c7bmr3414959ejc.10.1690933921677; Tue, 01 Aug 2023 16:52:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690933921; cv=none; d=google.com; s=arc-20160816; b=bCUD88eVkI4A+iOEp98CM7+ymHEWGz52KKhGyOPf8Z5GMcHWZEkEgRHoHnfJPcuNW1 EBw19eLupoIzRS8rM39OZ3+7ykQW0JwovZ3mhMk+pnOlh6NzAbbgTT8aFs1rfVG8bPyr 6/VNbcj/WvdV8cMe6+yHe9bm7GOjd458aTcf35c1xMl1cRsQ1JLDYo18TpMWxfyq/MEE AHS4BPiCj1lahHwF0ffqQWjty1hj8HDzu/wa0cxxerLrGhzi6rCVZbwJcvbl1ZSkoJRN LnrlG02qxZgrhSYORPTwQvXdVhk7fEcLjAuc3+uH+vtkToOH1Qn7sxlKp8Csqhn229n+ Gsnw== 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 :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=lSvZQzyPYO9K+Yy/xJPLeAc8DQcrhOgj51xCbnGnWEw=; fh=V2LL5OuZUBGeSu6TXDWykcThOoazTGUpkln19rrO2KM=; b=beCrwNW+kxbQomU6+ZpriaolZzJ652eIBzv4ZG9MxeZYpNoydT3M/3kP88Ey3oaISA 18zVKIjL8Xn0CW5TdGfJ8iHNZ1noB1fVJh4+cDIGfyXhTP96TUdE38SuISHIBeB2b4G7 z8WixLz7GhB/7hsv4AugRnazJ1UHoUR2tyD/Y/Oo0m9/6kSG5PbMtj6jI+xhzYQS1248 2yDJvqo9aVmVKiSZFkz9MNunvTRarF0foAwjETGflzugFyzlU0dKPsiLluhXQOVhbLwQ agxT5WHZ77BO/DuOtx4WpbTN50EMtLWDpp3UYZr2XlJunFFM6AUETc5gdp3Y3LAs3Kc7 Efgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=PKMvEr+w; 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 r5-20020a170906c28500b00992c5cf17f9si5006204ejz.43.2023.08.01.16.51.34; Tue, 01 Aug 2023 16:52:01 -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=20221208 header.b=PKMvEr+w; 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 S230493AbjHAXbv (ORCPT + 99 others); Tue, 1 Aug 2023 19:31:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229877AbjHAXbr (ORCPT ); Tue, 1 Aug 2023 19:31:47 -0400 Received: from mail-io1-xd31.google.com (mail-io1-xd31.google.com [IPv6:2607:f8b0:4864:20::d31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E4D56268C for ; Tue, 1 Aug 2023 16:31:40 -0700 (PDT) Received: by mail-io1-xd31.google.com with SMTP id ca18e2360f4ac-790ab117bd5so98276239f.0 for ; Tue, 01 Aug 2023 16:31:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690932699; x=1691537499; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=lSvZQzyPYO9K+Yy/xJPLeAc8DQcrhOgj51xCbnGnWEw=; b=PKMvEr+weBIjOiZaDQ0u5XiuMoTcE9fcjfSgPOBk8t/4bniW5N8/Glk0vf3B4MVUOx 27olflpkJCn/a68Gl8U34aiwJdgUsgtKDKPX81GIzqzib0n/80oeJci+1H4rheaSMVcd gRET73hsJZZ5r42IVoVxuhNuz+uCB7olCCJ1AhFd+anvw6OHW80DJ9L/KAtXWclJTPAi +XdjECt7eCn+ba4PKZlllQdc6VM/OnAior44Vo8F3LG0zisq8uIM7aBm3B6/JnFNrFZg x43EBuOqP69IFuk6zSeg1p+DDjeznZ2gVkjrLKoQ90rap8HbNnTE8eukq0DL0JdKh2ng 3gmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690932699; x=1691537499; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lSvZQzyPYO9K+Yy/xJPLeAc8DQcrhOgj51xCbnGnWEw=; b=ci2Easptcc9tlODUqqMgl07jRsHdKLk3U0UGuYQ4L6OezzkfnRHs866Knuq2oChPQc 6dDzUty8UXS1yXWTvwfEq7dN1/KEixdtNmM17P28ikK6K0EV9s01/QNymc/mESukhbf+ blWb9XSYPKyjrWmgjr8hCKwhh9h9s5fBZxk0TLt8FYbVWNlcoytcxlIKQ/Ntv8XU3vHi PxpV6Ef2SGyp0PIHC5MIuOsgHpvtEg/2ss+OrVykHD+Irx5m/COBgzrfWYGrL0W8uM8W ZJgFqaZgCqn4LqZi4mQQcI8uORdL/Qr6Fx5kkCQF5nDbnDafWWMIFu7pvcSiFuuAZgwK b2zw== X-Gm-Message-State: ABy/qLZtqjvD9Eo7q51jvWKqxkX2Fh3sycdZq/fK0L53i9GCKCCEip5r pG/vaKd11nVLYIdgFkHEjwW86Eqc6Co= X-Received: by 2002:a6b:fd06:0:b0:790:b033:6ffc with SMTP id c6-20020a6bfd06000000b00790b0336ffcmr5438361ioi.20.1690932699483; Tue, 01 Aug 2023 16:31:39 -0700 (PDT) Received: from lvondent-mobl4.. (c-71-236-201-58.hsd1.or.comcast.net. [71.236.201.58]) by smtp.gmail.com with ESMTPSA id d20-20020a5d9bd4000000b00790af7745b1sm1286269ion.20.2023.08.01.16.31.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Aug 2023 16:31:38 -0700 (PDT) From: Luiz Augusto von Dentz 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 Message-ID: <20230801233135.537864-2-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230801233135.537864-1-luiz.dentz@gmail.com> References: <20230801233135.537864-1-luiz.dentz@gmail.com> 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 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