Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3451315imu; Mon, 7 Jan 2019 03:42:29 -0800 (PST) X-Google-Smtp-Source: ALg8bN6U1dBUqN5y8iSLOnpMNIHHJUqXbjXDM/2RiQXpgzz/n61R6L7mJN2Q9iKha039bvDo6ruR X-Received: by 2002:a63:658:: with SMTP id 85mr10597198pgg.373.1546861349346; Mon, 07 Jan 2019 03:42:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546861349; cv=none; d=google.com; s=arc-20160816; b=uJP0R3Kf9+zqfS/R0Yb4bclEJyNWnmGBKAmEU64k4DQt64xGhBXRFx6SEt1+O1D2FQ 64gyaNAWpFhsljHJcfLMz/NjXeIhZLMIsyl5tiJTjmNiBCSIRW7jqjLHA2DLLWYGmAPi ySlNZmZH7pfxCjb733ZiVF6dy0NKN5Cj8eTQtix4dcy3lIxvtu+lt94KOjDvIE0XXAz/ EOWLgYCAt+CT5Wfyg+t9Bc6Tczghi7YE1PJLgGHXAfwdPzlw+luqKWT/N5N0rJeD5IyO 2AoXVHtDpAlmRt8wwejAWGqu72EczGCW4YlmtG0Oggx6X6X7fLsnFcG1kSDutyDhgQOV A5Mw== 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:dkim-filter; bh=1pce89Xuu/SQD6MUt0rAnmw+Cy8DMlkxYa3v11KkerM=; b=iXhZGWa9WMshERdxJC1y4H7pwbaDfvLRr1Ukr47aMfsht9YBCdV4I5srvVJVbNpH89 dA//LJqYBPb06ljiJQLuC5gQiEkyfr6OsUZJkLNuFL0sdx3s332w0mikhSm0fiPe03qc ZDV5bIYbNplJ3joGTkw0sA8gs9NUlQAfuouyhliwGe7CHZXDlDK3Au5cHd84aWkiQajU 0cgZ59nTcUjitgMD2AFAygw7tr18SCIDUXXu50ITzqc+8ySMh2C9Whwv75RX7HW1DFte zKs7eGG2bSLOfP//Avi6GmRPqmRXoIHz4MM5XIoSvIYjqfAPKRtXjbP/9KmgKsP/p6Ez y7jQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=wsiUciDZ; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v6si61155032pgv.277.2019.01.07.03.41.59; Mon, 07 Jan 2019 03:42:29 -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=@nifty.com header.s=dec2015msa header.b=wsiUciDZ; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727106AbfAGLkV (ORCPT + 99 others); Mon, 7 Jan 2019 06:40:21 -0500 Received: from conssluserg-03.nifty.com ([210.131.2.82]:53084 "EHLO conssluserg-03.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726893AbfAGLkV (ORCPT ); Mon, 7 Jan 2019 06:40:21 -0500 X-Greylist: delayed 5229 seconds by postgrey-1.27 at vger.kernel.org; Mon, 07 Jan 2019 06:40:19 EST Received: from mail-vk1-f179.google.com (mail-vk1-f179.google.com [209.85.221.179]) (authenticated) by conssluserg-03.nifty.com with ESMTP id x07Bdum0006927; Mon, 7 Jan 2019 20:39:57 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-03.nifty.com x07Bdum0006927 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1546861197; bh=1pce89Xuu/SQD6MUt0rAnmw+Cy8DMlkxYa3v11KkerM=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=wsiUciDZXXEFZuUKTgLKv68SHrxEjtY9DbfWBdNRB3XXGrtjMKUSUiZh+IjTmzpwf qfo0VuzM3WZhom+UK2kvQthyYqN5QRv3Q9xnUdeDMIvK+GRrInP1AXNPMlULCmpisW kELVnP+18mm2DrdX+XX8xah+jEZF445UKQ3JLN4SQar/ev5/WMnqv8Ybksnn3tLxzY 9MAWfWJ3Djj8VdLezTY9M/nPTuBVXS6sEpsLHWOThuNQn2Zc5Y963oIVe/jzqPnVt6 16NnkrFv2u/XJbn83VRKATtVXfZeNXnP8GHqSvZSouRdqr9rVLN5kOsO2PLTSbGPBz Y6VURk4gr+5sQ== X-Nifty-SrcIP: [209.85.221.179] Received: by mail-vk1-f179.google.com with SMTP id t127so4215vke.8; Mon, 07 Jan 2019 03:39:57 -0800 (PST) X-Gm-Message-State: AJcUuke+HEBDjr2gjYCeNHIMnbwSGvZR7eAS6WSHPm2QjahcN/EI52/o KX0vhGUmC/P0ZRH6c+gC9xNnDEEFe8U4S4w8EMk= X-Received: by 2002:a1f:91cb:: with SMTP id t194mr22781451vkd.74.1546861196013; Mon, 07 Jan 2019 03:39:56 -0800 (PST) MIME-Version: 1.0 References: <20190104195714.30045-1-labbott@redhat.com> <874lakc09x.fsf@concordia.ellerman.id.au> <20190107120716.51d95854.cohuck@redhat.com> In-Reply-To: <20190107120716.51d95854.cohuck@redhat.com> From: Masahiro Yamada Date: Mon, 7 Jan 2019 20:39:19 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] vfio_pci: Add local source directory as include To: Cornelia Huck Cc: Michael Ellerman , Laura Abbott , Alexey Kardashevskiy , Alex Williamson , kvm@vger.kernel.org, Linux Kernel Mailing List 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 Mon, Jan 7, 2019 at 8:09 PM Cornelia Huck wrote: > > On Mon, 7 Jan 2019 19:12:10 +0900 > Masahiro Yamada wrote: > > > On Mon, Jan 7, 2019 at 6:18 PM Michael Ellerman wrote: > > > > > > Laura Abbott writes: > > > > Commit 7f92891778df ("vfio_pci: Add NVIDIA GV100GL [Tesla V100 SXM2] > > > > subdriver") introduced a trace.h file in the local directory but > > > > missed adding the local include path, resulting in compilation > > > > failures with tracepoints: > > > > > > > > In file included from drivers/vfio/pci/trace.h:102, > > > > from drivers/vfio/pci/vfio_pci_nvlink2.c:29: > > > > ./include/trace/define_trace.h:89:42: fatal error: ./trace.h: No such file or directory > > > > #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) > > > > > > > > Fix this by adjusting the include path. > > > > > > > > Fixes: 7f92891778df ("vfio_pci: Add NVIDIA GV100GL [Tesla V100 SXM2] subdriver") > > > > Signed-off-by: Laura Abbott > > (...) > > > > Alex I assume you'll merge this fix via the vfio tree? > > > > > > cheers > > > > > > > diff --git a/drivers/vfio/pci/Makefile b/drivers/vfio/pci/Makefile > > > > index 9662c063a6b1..08d4676a8495 100644 > > > > --- a/drivers/vfio/pci/Makefile > > > > +++ b/drivers/vfio/pci/Makefile > > > > @@ -1,3 +1,4 @@ > > > > +ccflags-y += -I$(src) > > > > > > > > vfio-pci-y := vfio_pci.o vfio_pci_intrs.o vfio_pci_rdwr.o vfio_pci_config.o > > > > vfio-pci-$(CONFIG_VFIO_PCI_IGD) += vfio_pci_igd.o > > > > -- > > > > 2.20.1 > > > > > > Hi. > > > > If I correctly understand the usage of TRACE_INCLUDE_PATH, > > the correct fix should be like follows: > > > > > > diff --git a/drivers/vfio/pci/trace.h b/drivers/vfio/pci/trace.h > > index 228ccdb..4d13e51 100644 > > --- a/drivers/vfio/pci/trace.h > > +++ b/drivers/vfio/pci/trace.h > > @@ -94,7 +94,7 @@ TRACE_EVENT(vfio_pci_npu2_mmap, > > #endif /* _TRACE_VFIO_PCI_H */ > > > > #undef TRACE_INCLUDE_PATH > > -#define TRACE_INCLUDE_PATH . > > +#define TRACE_INCLUDE_PATH ../../drivers/vfio/pci > > #undef TRACE_INCLUDE_FILE > > #define TRACE_INCLUDE_FILE trace > > Going from the comments in samples/trace_events/trace-events-sample.h, > I think both approaches are possible, and I see both used in various > places. > > Personally, I'd prefer Laura's patch, as it doesn't involve hardcoding > a path. ccflags-y += -I$(src) would add the header search path for all files in drivers/vfio/pci/ whereas only the drivers/vfio/pci/vfio_pci_nvlink2.c needs it. CFLAGS_vfio_pci_nvlink2.o += -I$(src) is a bit better. However, it is not obvious why this extra header search path is needed until you find vfio_pci_nvlink2.c including trace.h #define TRACE_INCLUDE_PATH ../../drivers/vfio/pci clarifies the intention because the related code is all placed in trace.h From the comment in include/trace/define_trace.h TRACE_INCLUDE_PATH is relative to include/trace/define_trace.h -- Best Regards Masahiro Yamada