From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1FD0EC2D0C9 for ; Thu, 12 Dec 2019 18:15:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0711621556 for ; Thu, 12 Dec 2019 18:15:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730394AbfLLSPa (ORCPT ); Thu, 12 Dec 2019 13:15:30 -0500 Received: from iolanthe.rowland.org ([192.131.102.54]:52846 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1730034AbfLLSPa (ORCPT ); Thu, 12 Dec 2019 13:15:30 -0500 Received: (qmail 3202 invoked by uid 2102); 12 Dec 2019 13:15:29 -0500 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 12 Dec 2019 13:15:29 -0500 Date: Thu, 12 Dec 2019 13:15:29 -0500 (EST) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Andrey Konovalov cc: Dmitry Vyukov , Greg Kroah-Hartman , Jiri Kosina , Benjamin Tissoires , Andrew Morton , , , , Alexander Potapenko , Marco Elver Subject: Re: [PATCH RFC 1/2] kcov: collect coverage from interrupts In-Reply-To: <95e7a12ac909e7de584133772efc7ef982a16bbb.1576170740.git.andreyknvl@google.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org On Thu, 12 Dec 2019, Andrey Konovalov wrote: > This change extends kcov remote coverage support to allow collecting > coverage from interrupts in addition to kernel background threads. > > To collect coverage from code that is executed in interrupt context, a > part of that code has to be annotated with kcov_remote_start/stop() in a > similar way as how it is done for global kernel background threads. Then > the handle used for the annotations has to be passed to the > KCOV_REMOTE_ENABLE ioctl. > > Internally this patch adjusts the __sanitizer_cov_trace_pc() compiler > inserted callback to not bail out when called from interrupt context. > kcov_remote_start/stop() are updated to save/restore the current per > task kcov state in a per-cpu area (in case the interrupt came when the > kernel was already collecting coverage in task context). Coverage from > interrupts is collected into pre-allocated per-cpu areas, whose size is > controlled by the new CONFIG_KCOV_IRQ_AREA_SIZE. > > This patch also cleans up some of kcov debug messages. > > Signed-off-by: Andrey Konovalov > --- > diff --git a/drivers/usb/gadget/udc/dummy_hcd.c b/drivers/usb/gadget/udc/dummy_hcd.c > index 4c9d1e49d5ed..faf84ada71a5 100644 > --- a/drivers/usb/gadget/udc/dummy_hcd.c > +++ b/drivers/usb/gadget/udc/dummy_hcd.c > @@ -38,6 +38,7 @@ > #include > #include > #include > +#include > > #include > #include That's the only change to this driver. As such, it doesn't appear to be needed, judging by the patch description. Alan Stern