diff mbox series

[net,v2] i40e/iavf: use better trace path

Message ID 20200103022342.820175-1-jesse.brandeburg@intel.com
State Rejected
Delegated to: Jeff Kirsher
Headers show
Series [net,v2] i40e/iavf: use better trace path | expand

Commit Message

Jesse Brandeburg Jan. 3, 2020, 2:23 a.m. UTC
I'm seeing compilation fail of the i40e/iavf driver for some reason.
I just checked 5.5-rc4 and the tip of net/net-next and all fail.
Fails all the way back to v5.1 at least, I didn't check further back.

repro steps:
$ gcc -v
gcc version 9.2.1 20190827 (Red Hat 9.2.1-1) (GCC)

$ git checkout -b my-net davem-net/master
$ make mrproper
$ make O=../my-net.obj defconfig allmodconfig modules_prepare
$ make O=../my-net.obj M=drivers/net/ethernet/intel/i40e

make[1]: Entering directory '/home/jbrandeb/git/my-net.obj'
  CC [M]  drivers/net/ethernet/intel/i40e/i40e_main.o
In file included from
/home/jbrandeb/git/linux2/drivers/net/ethernet/intel/i40e/i40e_trace.h:209,
                 from /home/jbrandeb/git/linux2/drivers/net/ethernet/intel/i40e/i40e_main.c:20:
/home/jbrandeb/git/linux2/include/trace/define_trace.h:95:42: fatal error: ./i40e_trace.h: No such file or directory
   95 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
      |                                          ^
compilation terminated.
make[2]: *** [/home/jbrandeb/git/linux2/scripts/Makefile.build:266: drivers/net/ethernet/intel/i40e/i40e_main.o] Error 1
make[1]: *** [/home/jbrandeb/git/linux2/Makefile:1693: drivers/net/ethernet/intel/i40e] Error 2
make[1]: Leaving directory '/home/jbrandeb/git/my-net.obj'
make: *** [Makefile:179: sub-make] Error 2

Just for sanity, I tried building the ice driver the same as above and
it succeeds, so the build does work for some drivers.

So fix the include path for the i40e driver trace file to be relative
to the kernel root like (some) other drivers do.

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>

---
v2: added iavf for the same fix
---
 drivers/net/ethernet/intel/i40e/i40e_trace.h | 2 +-
 drivers/net/ethernet/intel/iavf/iavf_trace.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Bowers, AndrewX Jan. 6, 2020, 8:18 p.m. UTC | #1
> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces@osuosl.org] On
> Behalf Of Jesse Brandeburg
> Sent: Thursday, January 2, 2020 6:24 PM
> To: intel-wired-lan@osuosl.org
> Subject: [Intel-wired-lan] [PATCH net v2] i40e/iavf: use better trace path
> 
> I'm seeing compilation fail of the i40e/iavf driver for some reason.
> I just checked 5.5-rc4 and the tip of net/net-next and all fail.
> Fails all the way back to v5.1 at least, I didn't check further back.
> 
> repro steps:
> $ gcc -v
> gcc version 9.2.1 20190827 (Red Hat 9.2.1-1) (GCC)
> 
> $ git checkout -b my-net davem-net/master $ make mrproper $ make
> O=../my-net.obj defconfig allmodconfig modules_prepare $ make O=../my-
> net.obj M=drivers/net/ethernet/intel/i40e
> 
> make[1]: Entering directory '/home/jbrandeb/git/my-net.obj'
>   CC [M]  drivers/net/ethernet/intel/i40e/i40e_main.o
> In file included from
> /home/jbrandeb/git/linux2/drivers/net/ethernet/intel/i40e/i40e_trace.h:20
> 9,
>                  from
> /home/jbrandeb/git/linux2/drivers/net/ethernet/intel/i40e/i40e_main.c:20:
> /home/jbrandeb/git/linux2/include/trace/define_trace.h:95:42: fatal error:
> ./i40e_trace.h: No such file or directory
>    95 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
>       |                                          ^
> compilation terminated.
> make[2]: *** [/home/jbrandeb/git/linux2/scripts/Makefile.build:266:
> drivers/net/ethernet/intel/i40e/i40e_main.o] Error 1
> make[1]: *** [/home/jbrandeb/git/linux2/Makefile:1693:
> drivers/net/ethernet/intel/i40e] Error 2
> make[1]: Leaving directory '/home/jbrandeb/git/my-net.obj'
> make: *** [Makefile:179: sub-make] Error 2
> 
> Just for sanity, I tried building the ice driver the same as above and it
> succeeds, so the build does work for some drivers.
> 
> So fix the include path for the i40e driver trace file to be relative to the kernel
> root like (some) other drivers do.
> 
> Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
> 
> ---
> v2: added iavf for the same fix
> ---
>  drivers/net/ethernet/intel/i40e/i40e_trace.h | 2 +-
> drivers/net/ethernet/intel/iavf/iavf_trace.h | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Jacob Keller Jan. 8, 2020, 10:49 p.m. UTC | #2
On 1/2/2020 6:23 PM, Jesse Brandeburg wrote:
> I'm seeing compilation fail of the i40e/iavf driver for some reason.
> I just checked 5.5-rc4 and the tip of net/net-next and all fail.
> Fails all the way back to v5.1 at least, I didn't check further back.
> 
> repro steps:
> $ gcc -v
> gcc version 9.2.1 20190827 (Red Hat 9.2.1-1) (GCC)
> 
> $ git checkout -b my-net davem-net/master
> $ make mrproper
> $ make O=../my-net.obj defconfig allmodconfig modules_prepare
> $ make O=../my-net.obj M=drivers/net/ethernet/intel/i40e
> 
> make[1]: Entering directory '/home/jbrandeb/git/my-net.obj'
>   CC [M]  drivers/net/ethernet/intel/i40e/i40e_main.o
> In file included from
> /home/jbrandeb/git/linux2/drivers/net/ethernet/intel/i40e/i40e_trace.h:209,
>                  from /home/jbrandeb/git/linux2/drivers/net/ethernet/intel/i40e/i40e_main.c:20:
> /home/jbrandeb/git/linux2/include/trace/define_trace.h:95:42: fatal error: ./i40e_trace.h: No such file or directory
>    95 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
>       |                                          ^
> compilation terminated.
> make[2]: *** [/home/jbrandeb/git/linux2/scripts/Makefile.build:266: drivers/net/ethernet/intel/i40e/i40e_main.o] Error 1
> make[1]: *** [/home/jbrandeb/git/linux2/Makefile:1693: drivers/net/ethernet/intel/i40e] Error 2
> make[1]: Leaving directory '/home/jbrandeb/git/my-net.obj'
> make: *** [Makefile:179: sub-make] Error 2
> 
> Just for sanity, I tried building the ice driver the same as above and
> it succeeds, so the build does work for some drivers.
> 

So.. ice works for some reason but i40e and iavf do not? Is the ice
driver using a path relative to the root?

> So fix the include path for the i40e driver trace file to be relative
> to the kernel root like (some) other drivers do.

I'd really like to know why this isn't required by all drivers...

> 
> Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
> 
> ---
> v2: added iavf for the same fix
> ---
>  drivers/net/ethernet/intel/i40e/i40e_trace.h | 2 +-
>  drivers/net/ethernet/intel/iavf/iavf_trace.h | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/i40e/i40e_trace.h b/drivers/net/ethernet/intel/i40e/i40e_trace.h
> index 424f02077e2e..122a3fcb62b1 100644
> --- a/drivers/net/ethernet/intel/i40e/i40e_trace.h
> +++ b/drivers/net/ethernet/intel/i40e/i40e_trace.h
> @@ -203,7 +203,7 @@ DEFINE_EVENT(
>   * module.
>   */
>  #undef TRACE_INCLUDE_PATH
> -#define TRACE_INCLUDE_PATH .
> +#define TRACE_INCLUDE_PATH ../../drivers/net/ethernet/intel/i40e
>  #undef TRACE_INCLUDE_FILE
>  #define TRACE_INCLUDE_FILE i40e_trace
>  #include <trace/define_trace.h>
> diff --git a/drivers/net/ethernet/intel/iavf/iavf_trace.h b/drivers/net/ethernet/intel/iavf/iavf_trace.h
> index 1058e68a02b4..b2674c935c21 100644
> --- a/drivers/net/ethernet/intel/iavf/iavf_trace.h
> +++ b/drivers/net/ethernet/intel/iavf/iavf_trace.h
> @@ -203,7 +203,7 @@ DEFINE_EVENT(
>   * module.
>   */
>  #undef TRACE_INCLUDE_PATH
> -#define TRACE_INCLUDE_PATH .
> +#define TRACE_INCLUDE_PATH ../../drivers/net/ethernet/intel/iavf
>  #undef TRACE_INCLUDE_FILE
>  #define TRACE_INCLUDE_FILE iavf_trace
>  #include <trace/define_trace.h>
>
Jacob Keller Jan. 8, 2020, 10:55 p.m. UTC | #3
On 1/8/2020 2:49 PM, Jacob Keller wrote:
> On 1/2/2020 6:23 PM, Jesse Brandeburg wrote:
>> I'm seeing compilation fail of the i40e/iavf driver for some reason.
>> I just checked 5.5-rc4 and the tip of net/net-next and all fail.
>> Fails all the way back to v5.1 at least, I didn't check further back.
>>
>> repro steps:
>> $ gcc -v
>> gcc version 9.2.1 20190827 (Red Hat 9.2.1-1) (GCC)
>>
>> $ git checkout -b my-net davem-net/master
>> $ make mrproper
>> $ make O=../my-net.obj defconfig allmodconfig modules_prepare
>> $ make O=../my-net.obj M=drivers/net/ethernet/intel/i40e
>>
>> make[1]: Entering directory '/home/jbrandeb/git/my-net.obj'
>>   CC [M]  drivers/net/ethernet/intel/i40e/i40e_main.o
>> In file included from
>> /home/jbrandeb/git/linux2/drivers/net/ethernet/intel/i40e/i40e_trace.h:209,
>>                  from /home/jbrandeb/git/linux2/drivers/net/ethernet/intel/i40e/i40e_main.c:20:
>> /home/jbrandeb/git/linux2/include/trace/define_trace.h:95:42: fatal error: ./i40e_trace.h: No such file or directory
>>    95 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
>>       |                                          ^
>> compilation terminated.
>> make[2]: *** [/home/jbrandeb/git/linux2/scripts/Makefile.build:266: drivers/net/ethernet/intel/i40e/i40e_main.o] Error 1
>> make[1]: *** [/home/jbrandeb/git/linux2/Makefile:1693: drivers/net/ethernet/intel/i40e] Error 2
>> make[1]: Leaving directory '/home/jbrandeb/git/my-net.obj'
>> make: *** [Makefile:179: sub-make] Error 2
>>
>> Just for sanity, I tried building the ice driver the same as above and
>> it succeeds, so the build does work for some drivers.
>>
> 
> So.. ice works for some reason but i40e and iavf do not? Is the ice
> driver using a path relative to the root?
> 
>> So fix the include path for the i40e driver trace file to be relative
>> to the kernel root like (some) other drivers do.
> 
> I'd really like to know why this isn't required by all drivers...
> 

It looks like this is handled in driver's Makefile via:

ccflags-y += -I$(src)>-->------->-------# needed for trace events

or the following:

CFLAGS_trace.o := -I$(src)

This seems like the preferred solution when building with a separate
object tree.

Thanks,
Jake
Kirsher, Jeffrey T Jan. 9, 2020, 5:43 p.m. UTC | #4
On Wed, 2020-01-08 at 14:55 -0800, Jacob Keller wrote:
> On 1/8/2020 2:49 PM, Jacob Keller wrote:
> > On 1/2/2020 6:23 PM, Jesse Brandeburg wrote:
> > > I'm seeing compilation fail of the i40e/iavf driver for some
> > > reason.
> > > I just checked 5.5-rc4 and the tip of net/net-next and all fail.
> > > Fails all the way back to v5.1 at least, I didn't check further
> > > back.
> > > 
> > > repro steps:
> > > $ gcc -v
> > > gcc version 9.2.1 20190827 (Red Hat 9.2.1-1) (GCC)
> > > 
> > > $ git checkout -b my-net davem-net/master
> > > $ make mrproper
> > > $ make O=../my-net.obj defconfig allmodconfig modules_prepare
> > > $ make O=../my-net.obj M=drivers/net/ethernet/intel/i40e
> > > 
> > > make[1]: Entering directory '/home/jbrandeb/git/my-net.obj'
> > >   CC [M]  drivers/net/ethernet/intel/i40e/i40e_main.o
> > > In file included from
> > > /home/jbrandeb/git/linux2/drivers/net/ethernet/intel/i40e/i40e_tr
> > > ace.h:209,
> > >                  from
> > > /home/jbrandeb/git/linux2/drivers/net/ethernet/intel/i40e/i40e_ma
> > > in.c:20:
> > > /home/jbrandeb/git/linux2/include/trace/define_trace.h:95:42:
> > > fatal error: ./i40e_trace.h: No such file or directory
> > >    95 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
> > >       |                                          ^
> > > compilation terminated.
> > > make[2]: ***
> > > [/home/jbrandeb/git/linux2/scripts/Makefile.build:266:
> > > drivers/net/ethernet/intel/i40e/i40e_main.o] Error 1
> > > make[1]: *** [/home/jbrandeb/git/linux2/Makefile:1693:
> > > drivers/net/ethernet/intel/i40e] Error 2
> > > make[1]: Leaving directory '/home/jbrandeb/git/my-net.obj'
> > > make: *** [Makefile:179: sub-make] Error 2
> > > 
> > > Just for sanity, I tried building the ice driver the same as
> > > above and
> > > it succeeds, so the build does work for some drivers.
> > > 
> > 
> > So.. ice works for some reason but i40e and iavf do not? Is the ice
> > driver using a path relative to the root?
> > 
> > > So fix the include path for the i40e driver trace file to be
> > > relative
> > > to the kernel root like (some) other drivers do.
> > 
> > I'd really like to know why this isn't required by all drivers...
> > 
> 
> It looks like this is handled in driver's Makefile via:
> 
> ccflags-y += -I$(src)>-->------->-------# needed for trace events
> 
> or the following:
> 
> CFLAGS_trace.o := -I$(src)

I like the above solution, as it is much cleaner and less prone for
future errors, if the directory patch would change for whatever reason.

> 
> This seems like the preferred solution when building with a separate
> object tree.
> 
> Thanks,
> Jake
> _______________________________________________
> Intel-wired-lan mailing list
> Intel-wired-lan@osuosl.org
> https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
Jesse Brandeburg Jan. 10, 2020, 6:47 a.m. UTC | #5
On Thu, 9 Jan 2020 09:43:52 -0800 Jeff wrote:
> On Wed, 2020-01-08 at 14:55 -0800, Jacob Keller wrote:
> > On 1/8/2020 2:49 PM, Jacob Keller wrote:  
>  [...]  
>  [...]  
>  [...]  
>  [...]  
>  [...]  
> > 
> > It looks like this is handled in driver's Makefile via:
> > 
> > ccflags-y += -I$(src)>-->------->-------# needed for trace events
> > 
> > or the following:
> > 
> > CFLAGS_trace.o := -I$(src)  
> 
> I like the above solution, as it is much cleaner and less prone for
> future errors, if the directory patch would change for whatever reason.

Hi Jeff, please drop this patch, I found after bisecting and finding a
commit in January of 2019 that causes my issue, that if I just change
the command sequence I do, everything works fine.

FAIL: make O=../foo.obj M=drivers/net/ethernet/intel/i40e

PASS: make O=../foo.obj M=`pwd`/drivers/net/ethernet/intel/i40e

So the change in behavior is somewhat introduced recently (a year ago)
but me just having to learn a new trick is better than trying to fix
this in the kernel.

Jesse
diff mbox series

Patch

diff --git a/drivers/net/ethernet/intel/i40e/i40e_trace.h b/drivers/net/ethernet/intel/i40e/i40e_trace.h
index 424f02077e2e..122a3fcb62b1 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_trace.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_trace.h
@@ -203,7 +203,7 @@  DEFINE_EVENT(
  * module.
  */
 #undef TRACE_INCLUDE_PATH
-#define TRACE_INCLUDE_PATH .
+#define TRACE_INCLUDE_PATH ../../drivers/net/ethernet/intel/i40e
 #undef TRACE_INCLUDE_FILE
 #define TRACE_INCLUDE_FILE i40e_trace
 #include <trace/define_trace.h>
diff --git a/drivers/net/ethernet/intel/iavf/iavf_trace.h b/drivers/net/ethernet/intel/iavf/iavf_trace.h
index 1058e68a02b4..b2674c935c21 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_trace.h
+++ b/drivers/net/ethernet/intel/iavf/iavf_trace.h
@@ -203,7 +203,7 @@  DEFINE_EVENT(
  * module.
  */
 #undef TRACE_INCLUDE_PATH
-#define TRACE_INCLUDE_PATH .
+#define TRACE_INCLUDE_PATH ../../drivers/net/ethernet/intel/iavf
 #undef TRACE_INCLUDE_FILE
 #define TRACE_INCLUDE_FILE iavf_trace
 #include <trace/define_trace.h>