Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp6604602ioo; Thu, 2 Jun 2022 09:47:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz2dAY/748efkJ8CyW3/UUzL66t0nRdf/cP+mtuscE8ZRr4PPrhWI9b66cMTsFR4FYFROSH X-Received: by 2002:a17:906:2558:b0:706:ce01:ffd8 with SMTP id j24-20020a170906255800b00706ce01ffd8mr4985823ejb.682.1654188427110; Thu, 02 Jun 2022 09:47:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654188427; cv=none; d=google.com; s=arc-20160816; b=wJy3UWQDrf6upBwMZbjLorkglPxgBfitqtfJ9ckDHGyHIQ/aJ9gS0BpGi7K6ZhJ0Tj 2mUfVqKR5jfqSQU2qXNItK05cpxHQCdlIufpou1gcSH2u91qvkByeMcHnp9a1q85yBEJ n9ONBTGXIVEvsBZFYFKhcKqPkB7Izvme2kUgS29mW09VyLp3bYMuOSlxyEaqJvkwEECh 14wK8zCV3sK3Xx8OHmYP1c3iIjGYvTuSf0XwNrFexNJa4Q94jdYNnp1ug0I4HFZuRyDD 3IcfR/WkpOeK30R3iQjgjU/3DghtnBeUJFDRD1ITZEQXyPpd7A3dscFe4/XnsXljZ+hE FGCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version; bh=BD7EkQrmyTopKiC2BNwY/Y+eF2E2JxHJKJ8W+aVBKzQ=; b=FH8nMCnsjG0TX1oxolFwpWquzJcqTLp0LuGUVhXBASU7sfjDcAUXhsfvCVza8U3mwM fwx44ZpAFwBXPTEVTD4SLTrUXwWksOw8TldowRCFv0/9gaPREdLQGk7R7ADQLAlc9CYC I+T78g4ZtB3CRcpq0zHZSGfHhExhLvM7aZsSp2/X4Qw2P+B9Ikp0iQVaXpc6ga+enKlU Xka9yOvHso0/pDaMQt7VXIlDzeQUahFZS6csScAg9E1Gl2MsbpvKpbhvyGgNXc1WBT9Y zjc5FvjZILSgeYRa25umylI6pvluWzwhhyGt6y9q/WetCv7n2iw3A0POUtcuI/2x82kg SHbQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i5-20020a05640242c500b0042dcfe24d06si6170799edc.506.2022.06.02.09.46.40; Thu, 02 Jun 2022 09:47:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234624AbiFBP3P convert rfc822-to-8bit (ORCPT + 99 others); Thu, 2 Jun 2022 11:29:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229899AbiFBP3N (ORCPT ); Thu, 2 Jun 2022 11:29:13 -0400 X-Greylist: delayed 267 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Thu, 02 Jun 2022 08:29:11 PDT Received: from mail.holtmann.org (coyote.holtmann.net [212.227.132.17]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id BA30F13C1F6; Thu, 2 Jun 2022 08:29:09 -0700 (PDT) Received: from smtpclient.apple (p4ff9fc30.dip0.t-ipconnect.de [79.249.252.48]) by mail.holtmann.org (Postfix) with ESMTPSA id 31877CED1B; Thu, 2 Jun 2022 17:29:08 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.100.31\)) Subject: Re: [PATCH] Bluetooth: Collect kcov coverage from hci_rx_work From: Marcel Holtmann In-Reply-To: <20220517094532.2729049-1-poprdi@google.com> Date: Thu, 2 Jun 2022 17:29:07 +0200 Cc: theflow@google.com, Johan Hedberg , Luiz Augusto von Dentz , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-bluetooth@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8BIT Message-Id: <16B0E861-298D-4038-A38E-E41C3046EE9C@holtmann.org> References: <20220517094532.2729049-1-poprdi@google.com> To: Tamas Koczka X-Mailer: Apple Mail (2.3696.100.31) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,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-kernel@vger.kernel.org Hi Tamas, > Annotate hci_rx_work() with kcov_remote_start() and kcov_remote_stop() > calls, so remote KCOV coverage is collected while processing the rx_q > queue which is the main incoming Bluetooth packet queue. > > Coverage is associated with the thread which created the packet skb. > > Signed-off-by: Tamas Koczka > --- > net/bluetooth/hci_core.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c > index 45c2dd2e1590..703722031b8d 100644 > --- a/net/bluetooth/hci_core.c > +++ b/net/bluetooth/hci_core.c > @@ -29,6 +29,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -3780,7 +3781,9 @@ static void hci_rx_work(struct work_struct *work) > > BT_DBG("%s", hdev->name); > > - while ((skb = skb_dequeue(&hdev->rx_q))) { > + for (; (skb = skb_dequeue(&hdev->rx_q)); kcov_remote_stop()) { > + kcov_remote_start_common(skb_get_kcov_handle(skb)); > + > /* Send copy to monitor */ > hci_send_to_monitor(hdev, skb); patch looks good, but do you mind adding a comment above on why this is done. I asked, because next time around I look at this code I have forgotten all about it. Thanks. Regards Marcel