Re: [PATCH 1/2] tools/dma: move dma_map_benchmark from selftests to tools/dma

From: Barry Song
Date: Thu Aug 21 2025 - 21:14:51 EST


>
> Does usr/include have header files? Did you run make headers_install
> before make?
> [xiaqinxin@localhost 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@localhost linux]$ cd tools/dma/
> [xiaqinxin@localhost 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?

>
> My test is ok.


Thanks
Barry