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=-8.2 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 97A54FA372A for ; Thu, 17 Oct 2019 20:28:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 668A021835 for ; Thu, 17 Oct 2019 20:28:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571344129; bh=CWLsDmLmdYR77gpLL5DPedco3zJy9XUl7rfGOcX4D7o=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=xX0J0KOt0VXl9L3XDkX5m1mmTyIHkCo2bEL89o88IxpXOsCqyXRNY4bmn/PVGKsDZ o+1Xtk7V+JVNi6UwsJKqv51z6XzC/KohnhAYyy+2sDlUtyOdspBD5LCXFitHz7jqPf AlDkMIIzUKWPsHAkLIikcwQAbrq5a8LFcFFDnJFc= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2406209AbfJQU2q (ORCPT ); Thu, 17 Oct 2019 16:28:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:54774 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392669AbfJQU2q (ORCPT ); Thu, 17 Oct 2019 16:28:46 -0400 Received: from localhost (unknown [104.132.0.109]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E4A8D20872; Thu, 17 Oct 2019 20:28:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571344124; bh=CWLsDmLmdYR77gpLL5DPedco3zJy9XUl7rfGOcX4D7o=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=1CwFat8VN3R7UaivtiPE57Qun45r6dpf1UEOiCohaQD1A4Ut2TKeQfGQDCEahEvAN SCvGBotaVta0OU7UFOhOglCMG9FrzN1UStIs4YhjydLuYW09eTIuS/alJV4Nh9Kupb +fMXhVPfIdh08F1RU2t/R+Zooya52b6YZrH0R3Sg= Date: Thu, 17 Oct 2019 13:28:43 -0700 From: Greg Kroah-Hartman To: Andrey Konovalov Cc: USB list , kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev , LKML , Dmitry Vyukov , Alan Stern , "Michael S . Tsirkin" , Jason Wang , Andrew Morton , Arnd Bergmann , Steven Rostedt , David Windsor , Elena Reshetova , Anders Roxell Subject: Re: [PATCH RFC 3/3] vhost, kcov: collect coverage from vhost_worker Message-ID: <20191017202843.GA1103978@kroah.com> References: <20191017181800.GB1094415@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.2 (2019-09-21) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Thu, Oct 17, 2019 at 09:00:18PM +0200, Andrey Konovalov wrote: > On Thu, Oct 17, 2019 at 8:18 PM Greg Kroah-Hartman > wrote: > > > > On Thu, Oct 17, 2019 at 07:44:15PM +0200, Andrey Konovalov wrote: > > > This patch adds kcov_remote_start/kcov_remote_stop annotations to the > > > vhost_worker function, which is responsible for processing vhost works. > > > Since vhost_worker is spawned when a vhost device instance is created, > > > the common kcov handle is used for kcov_remote_start/stop annotations. > > > > > > Signed-off-by: Andrey Konovalov > > > --- > > > drivers/vhost/vhost.c | 15 +++++++++++++++ > > > drivers/vhost/vhost.h | 3 +++ > > > 2 files changed, 18 insertions(+) > > > > > > diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c > > > index 36ca2cf419bf..71a349f6b352 100644 > > > --- a/drivers/vhost/vhost.c > > > +++ b/drivers/vhost/vhost.c > > > @@ -357,7 +357,13 @@ static int vhost_worker(void *data) > > > llist_for_each_entry_safe(work, work_next, node, node) { > > > clear_bit(VHOST_WORK_QUEUED, &work->flags); > > > __set_current_state(TASK_RUNNING); > > > +#ifdef CONFIG_KCOV > > > + kcov_remote_start(dev->kcov_handle); > > > +#endif > > > > Shouldn't you hide these #ifdefs in a .h file? This is not a "normal" > > kernel coding style at all. > > Well, if it's acceptable to add a kcov_handle field into vhost_dev > even when CONFIG_KCOV is not enabled, then we can get rid of those > #ifdefs. It should be, it's not a big deal and there's not a ton of those structures around that one more field is going to hurt anything... thanks, greg k-h