Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp755632ybl; Fri, 13 Dec 2019 04:11:33 -0800 (PST) X-Google-Smtp-Source: APXvYqwLte34H4FAhFNfpXWW1SQ1jE792TNqPjYgsfn47wGZDZEAGjHG0duy6p/IRkdiYlt68+iw X-Received: by 2002:aca:5303:: with SMTP id h3mr6450406oib.109.1576239093630; Fri, 13 Dec 2019 04:11:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576239093; cv=none; d=google.com; s=arc-20160816; b=kFPBmsQF0s5uDoXmIanP98IgGrG+n5Bfaj7TtvbGl5zQHjKJRE0S6a9ATXRlZXQbw1 wW9fLicriNdANVIIa5et0yrct8KpDMncvuxQW/VNuMN0AhHvOJGl+uAto+xTmzHgp19D 9zwOlhlHZYT+mSIBRH41hBDGxbINbgrZE7WZYOETNrtbTLC/KfjBStgOA4FiYEmYXfdU DDC5MqaF43LVrlwWSaMWIrTGDTnafKqLp3Z0vnxlNndjyj/UHbb0j+1nZBWHl+PPbSXQ g28KBXeIe+sEdhyKNATETe6KIKelQC02osJKGNVFStkdoLFIngVVxNF2KpLSyYtQQYNh MP/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=HBdg8NM7+HQptNIzAMC443OTDQO+44P73MQX/Q0UH7k=; b=vG7+wnEMwtbN1yobQH6zRg9vzl2hSErVyi5oOv5PYQOgQSXGtgUokWrI6lP9pGWwnH wRR4dGqJ8Yc1YiQSMLZNlXYL+WLiMNzERn92Kg8grscZCt4USG9oaDtUiCWerjBphL9g 6B/ei0b7Fa7n8P/6Zjk/iDy7zl16MhZtIDIjD4VMYhP/EElyYWe9DGWe7LgBwAg7/3dP +YlzyYuaqd6kOs3zLpvIN2ASUfHWfPMLSIcIkOJwzMT8KHgywhJcJeV0yesIkGpdnhLO RKxpS8YwBsQ89zvCDwfXyalUziCqeLNdf08U0eVNZL6MzYhs1zmSMGq7n6lH5An3FQkJ jRww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=LteCGafn; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w24si4717901oic.260.2019.12.13.04.11.22; Fri, 13 Dec 2019 04:11:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=LteCGafn; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727052AbfLMMJG (ORCPT + 99 others); Fri, 13 Dec 2019 07:09:06 -0500 Received: from mail-pf1-f194.google.com ([209.85.210.194]:38819 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726994AbfLMMJF (ORCPT ); Fri, 13 Dec 2019 07:09:05 -0500 Received: by mail-pf1-f194.google.com with SMTP id x185so1374497pfc.5 for ; Fri, 13 Dec 2019 04:09:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=HBdg8NM7+HQptNIzAMC443OTDQO+44P73MQX/Q0UH7k=; b=LteCGafneFHNrjHtOG87xySeGd2iWeU5eIC5eu43lJlbOCefdhcciR6Dyruva1GRUf NoL0zkkmLIF9PKdt2/56hRbvLCSc4uerblCcFWfAXYGhWuWGNChFEzcp0q2nTuZGw4DW bMphVC6NFJYEvfUrY45BZO/pow30TxjTNEputmwxH+dEInapijPGktnJ+FOQ8Ogtyy9L 1T4iIiYn/+yWdsLzP2gvCEbo6h+wYq0h/nBidcV8G3JzfkfWNOTYCBkD0IiM/RA4xEEj XjprhLN0r5Z7x6hqRtcSsgN6Br5olt7TwoKNpz5RFyHXD3/fCfQYYerNr0LC8vdNz+ZE 4Jtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=HBdg8NM7+HQptNIzAMC443OTDQO+44P73MQX/Q0UH7k=; b=abOOcgEMkJ6TEJvGZq2peJnOGX++h1ksKx/vibt4HQO03UkgG7ZDPuxbIIBqUeHGxV C7mggYUxynm3shvNIrtDHrAoutT+dpK88JAatxv8Ilv6JMMrKb0N+IHw41XnfmTajrl8 Iz/Hhxmd79yRg5+2N0NB7KabVCynCtBuUkAgEixJYVvXCa8KGwqXqYL0pOJdsjFaHzFq iXOkViXHMCE/wFwaY6+/hq+8M+1zRB/J1JcuvOTzXlzXQ/jqVvD+u3OnQnUMii7OPDUN CUjTkjr2rGUBQ2itNl1/2xnihEP/z9XkjN0FInN6UNeRP9FoSrNrA0ihCb4+32S2dcsI WF+w== X-Gm-Message-State: APjAAAVAjI/oCfGSSoujUwbHaUamhcPJuEiVBUgFu+SysBDGkv6GqC8p 8gBsgsKxSLyurBB+eZOif0Orx+xbSOMnAmLCVc74uQ== X-Received: by 2002:a63:31d0:: with SMTP id x199mr16767949pgx.286.1576238944447; Fri, 13 Dec 2019 04:09:04 -0800 (PST) MIME-Version: 1.0 References: <95e7a12ac909e7de584133772efc7ef982a16bbb.1576170740.git.andreyknvl@google.com> In-Reply-To: From: Andrey Konovalov Date: Fri, 13 Dec 2019 13:08:53 +0100 Message-ID: Subject: Re: [PATCH RFC 1/2] kcov: collect coverage from interrupts To: Alan Stern Cc: Dmitry Vyukov , Greg Kroah-Hartman , Jiri Kosina , Benjamin Tissoires , Andrew Morton , USB list , linux-input@vger.kernel.org, LKML , Alexander Potapenko , Marco Elver Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 12, 2019 at 7:15 PM Alan Stern wrote: > > 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. Right, will fix in the next version, thanks!