[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <e0584468-ca8e-4a3e-944d-c0bff8569a83@huawei.com>
Date: Wed, 27 Aug 2025 20:07:28 +0800
From: Qinxin Xia <xiaqinxin@...wei.com>
To: Barry Song <21cnbao@...il.com>
CC: <m.szyprowski@...sung.com>, <robin.murphy@....com>,
<jonathan.cameron@...wei.com>, <prime.zeng@...wei.com>,
<fanghao11@...wei.com>, <linux-kernel@...r.kernel.org>,
<linuxarm@...wei.com>, <yangyicong@...wei.com>
Subject: Re: [PATCH 1/2] tools/dma: move dma_map_benchmark from selftests to
tools/dma
On 2025/8/22 09:12:07, Barry Song <21cnbao@...il.com> wrote:
>>
>> Does usr/include have header files? Did you run make headers_install
>> before make?
>> [xiaqinxin@...alhost linux]$ make headers_install
>> HOSTCC scripts/basic/fixdep
>> HOSTCC scripts/unifdef
>> WRAP arch/arm64/include/generated/uapi/asm/socket.h
>> SYSHDR arch/arm64/include/generated/uapi/asm/unistd_64.h
>> HDRINST usr/include/asm-generic/mman.h
>> HDRINST usr/include/asm-generic/stat.h
>> HDRINST usr/include/asm-generic/ucontext.h
>> HDRINST usr/include/asm-generic/int-ll64.h
>> HDRINST usr/include/asm-generic/unistd.h
>> HDRINST usr/include/asm-generic/kvm_para.h
>> HDRINST usr/include/asm-generic/types.h
>> HDRINST usr/include/asm-generic/ipcbuf.h
>> HDRINST usr/include/asm-generic/termbits-common.h
>> ...
>> [xiaqinxin@...alhost linux]$ cd tools/dma/
>> [xiaqinxin@...alhost dma]$ make
>> cc -I../../usr/include -I../../include dma_map_benchmark.c -o
>> dma_map_benchmark
>
> This is really frustrating. Why do other parts not need this, but
> dma_map_benchmark does? It is also not acceptable to hardcode the
> path to usr/include.
>
> It is also not good practice to access a kernel header directly from a
> userspace tool - such as -I../../include.
>
> Shouldn't map_benchmark.h be a proper UAPI header that gets installed
> into the toolchain like the others?
>
Hello Barry :
This include file is inherited from the original version, and there are
similar
method in other parts :
pcmcia/Makefile:CFLAGS := -I../../usr/include
laptop/dslm/Makefile:CFLAGS := -I../../usr/include
accounting/Makefile:CFLAGS := -I../../usr/include
During compilation, the system searches for header files from
../../usr/include first.
If no header file is found in ../../usr/include, the system attempts to
get header files
from the system directory of the compilation environment. So maybe in
some compilation
environments, compiling these modules might have the same problem...
'struct map_benchmark' is defined in map_benchmark.h which is used by
map_benchmark.c
Do we need to define them separately in the kernel and uapi header files?>>
>> My test is ok.
>
>
> Thanks
> Barry
Powered by blists - more mailing lists