mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Qinxin Xia <xiaqinxin@huawei.com>
To: Barry Song <21cnbao@gmail.com>
Cc: <m.szyprowski@samsung.com>, <robin.murphy@arm.com>,
	<jonathan.cameron@huawei.com>, <prime.zeng@huawei.com>,
	<fanghao11@huawei.com>, <linux-kernel@vger.kernel.org>,
	<linuxarm@huawei.com>, <yangyicong@huawei.com>
Subject: Re: [PATCH 1/2] tools/dma: move dma_map_benchmark from selftests to tools/dma
Date: Mon, 18 Aug 2025 10:53:19 +0800	[thread overview]
Message-ID: <8db50f47-9295-4c7c-8bbc-dbbbd3fb5f79@huawei.com> (raw)
In-Reply-To: <CAGsJ_4wbgqGavjQNXtbFVeMw8j8oSCEVSdL4BrBVWEuNHzomPg@mail.gmail.com>



On 2025/8/15 18:03:28, Barry Song <21cnbao@gmail.com> wrote:
> On Fri, Aug 15, 2025 at 1:35 AM Qinxin Xia <xiaqinxin@huawei.com> wrote:
>>
>> dma_map_benchmark is a standalone developer tool rather than an
>> automated selftest. It has no pass/fail criteria, expects manual
>> invocation, and is built as a normal userspace binary. Move it to
>> tools/dma/ and add a minimal, the original selftest/dma/Makefile
>> entry is removed to avoid duplication.
>>
>> Signed-off-by: Qinxin Xia <xiaqinxin@huawei.com>
>> ---
>>   tools/Makefile                                  | 13 +++++++------
>>   tools/dma/Makefile                              | 17 +++++++++++++++++
>>   tools/{testing/selftests => }/dma/config        |  0
>>   .../selftests => }/dma/dma_map_benchmark.c      |  0
>>   tools/testing/selftests/dma/Makefile            |  7 -------
>>   5 files changed, 24 insertions(+), 13 deletions(-)
>>   create mode 100644 tools/dma/Makefile
>>   rename tools/{testing/selftests => }/dma/config (100%)
>>   rename tools/{testing/selftests => }/dma/dma_map_benchmark.c (100%)
>>   delete mode 100644 tools/testing/selftests/dma/Makefile
>>
> 
> Please ensure the build passes at least. If you cd into tools/mm or
> tools/spi, everything builds fine.
> 
> tools/spi$ make
> mkdir -p include/linux/spi 2>&1 || true
> ln -sf /home/barrysong/develop/mm/tools/spi/../../include/uapi/linux/spi/spidev.h
> include/linux/spi
> ln -sf /home/barrysong/develop/mm/tools/spi/../../include/uapi/linux/spi/spi.h
> include/linux/spi
> make[1]: Entering directory '/home/barrysong/develop/mm/tools/spi'
>    CC      spidev_test.o
>    LD      spidev_test-in.o
> make[1]: Leaving directory '/home/barrysong/develop/mm/tools/spi'
>    LINK    spidev_test
> make[1]: Entering directory '/home/barrysong/develop/mm/tools/spi'
>    CC      spidev_fdx.o
>    LD      spidev_fdx-in.o
> make[1]: Leaving directory '/home/barrysong/develop/mm/tools/spi'
>    LINK    spidev_fdx
> 
> 
> tools/mm$ make
> make -C ../lib/api
> make[1]: Entering directory '/home/barrysong/develop/mm/tools/lib/api'
>    CC      fd/array.o
>    LD      fd/libapi-in.o
>    CC      fs/fs.o
>    CC      fs/tracing_path.o
>    CC      fs/cgroup.o
>    LD      fs/libapi-in.o
>    CC      cpu.o
>    CC      debug.o
>    CC      str_error_r.o
>    LD      libapi-in.o
>    AR      libapi.a
> make[1]: Leaving directory '/home/barrysong/develop/mm/tools/lib/api'
> gcc -Wall -Wextra -I../lib/ -pthread -o page-types page-types.c
> ../lib/api/libapi.a -pthread
> gcc -Wall -Wextra -I../lib/ -pthread -o slabinfo slabinfo.c
> ../lib/api/libapi.a -pthread
> gcc -Wall -Wextra -I../lib/ -pthread -o page_owner_sort
> page_owner_sort.c ../lib/api/libapi.a -pthread
> gcc -Wall -Wextra -I../lib/ -pthread -o thp_swap_allocator_test
> thp_swap_allocator_test.c ../lib/api/libapi.a -pthread
> 
> 
> If you navigate to tools/dma and run make:
> 
> tools/dma$ make
> cc -I../../include -I../../usr/include dma_map_benchmark.c -o dma_map_benchmark
> In file included from dma_map_benchmark.c:13:
> ../../include/linux/types.h:20:33: error: conflicting types for
> ‘fd_set’; have ‘__kernel_fd_set’
>     20 | typedef __kernel_fd_set         fd_set;
>        |                                 ^~~~~~
> In file included from /usr/include/x86_64-linux-gnu/sys/types.h:179,
>                   from /usr/include/stdlib.h:395,
>                   from dma_map_benchmark.c:8:
> /usr/include/x86_64-linux-gnu/sys/select.h:70:5: note: previous
> declaration of ‘fd_set’ with type ‘fd_set’
>     70 |   } fd_set;
>        |     ^~~~~~
> In file included from dma_map_benchmark.c:13:
> ../../include/linux/types.h:21:33: error: conflicting types for
> ‘dev_t’; have ‘__kernel_dev_t’ {aka ‘unsigned int’}
>     21 | typedef __kernel_dev_t          dev_t;
>        |                                 ^~~~~
> In file included from /usr/include/stdlib.h:395,
>                   from dma_map_benchmark.c:8:
> /usr/include/x86_64-linux-gnu/sys/types.h:59:17: note: previous
> declaration of ‘dev_t’ with type ‘dev_t’ {aka ‘long unsigned int’}
>     59 | typedef __dev_t dev_t;
>        |                 ^~~~~
> In file included from dma_map_benchmark.c:13:
> ../../include/linux/types.h:25:33: error: conflicting types for
> ‘nlink_t’; have ‘u32’ {aka ‘unsigned int’}
>     25 | typedef u32                     nlink_t;
>        |                                 ^~~~~~~
> In file included from /usr/include/stdlib.h:395,
>                   from dma_map_benchmark.c:8:
> /usr/include/x86_64-linux-gnu/sys/types.h:74:19: note: previous
> declaration of ‘nlink_t’ with type ‘nlink_t’ {aka ‘long unsigned int’}
>     74 | typedef __nlink_t nlink_t;
>        |                   ^~~~~~~
> In file included from dma_map_benchmark.c:13:
> ../../include/linux/types.h:31:33: error: conflicting types for
> ‘timer_t’; have ‘__kernel_timer_t’ {aka ‘int’}
>     31 | typedef __kernel_timer_t        timer_t;
>        |                                 ^~~~~~~
> In file included from /usr/include/x86_64-linux-gnu/sys/types.h:130,
>                   from /usr/include/stdlib.h:395,
>                   from dma_map_benchmark.c:8:
> /usr/include/x86_64-linux-gnu/bits/types/timer_t.h:7:19: note:
> previous declaration of ‘timer_t’ with type ‘timer_t’ {aka ‘void *’}
>      7 | typedef __timer_t timer_t;
>        |                   ^~~~~~~
> In file included from dma_map_benchmark.c:13:
> ../../include/linux/types.h:52:33: error: conflicting types for
> ‘loff_t’; have ‘__kernel_loff_t’ {aka ‘long long int’}
>     52 | typedef __kernel_loff_t         loff_t;
>        |                                 ^~~~~~
> In file included from /usr/include/stdlib.h:395,
>                   from dma_map_benchmark.c:8:
> /usr/include/x86_64-linux-gnu/sys/types.h:42:18: note: previous
> declaration of ‘loff_t’ with type ‘loff_t’ {aka ‘long int’}
>     42 | typedef __loff_t loff_t;
>        |                  ^~~~~~
> In file included from dma_map_benchmark.c:13:
> ../../include/linux/types.h:115:33: error: conflicting types for
> ‘u_int64_t’; have ‘u64’ {aka ‘long long unsigned int’}
>    115 | typedef u64                     u_int64_t;
>        |                                 ^~~~~~~~~
> In file included from /usr/include/stdlib.h:395,
>                   from dma_map_benchmark.c:8:
> /usr/include/x86_64-linux-gnu/sys/types.h:161:20: note: previous
> declaration of ‘u_int64_t’ with type ‘u_int64_t’ {aka ‘long unsigned
> int’}
>    161 | typedef __uint64_t u_int64_t;
>        |                    ^~~~~~~~~
> In file included from dma_map_benchmark.c:13:
> ../../include/linux/types.h:116:33: error: conflicting types for
> ‘int64_t’; have ‘s64’ {aka ‘long long int’}
>    116 | typedef s64                     int64_t;
>        |                                 ^~~~~~~
> In file included from /usr/include/x86_64-linux-gnu/sys/types.h:155,
>                   from /usr/include/stdlib.h:395,
>                   from dma_map_benchmark.c:8:
> /usr/include/x86_64-linux-gnu/bits/stdint-intn.h:27:19: note: previous
> declaration of ‘int64_t’ with type ‘int64_t’ {aka ‘long int’}
>     27 | typedef __int64_t int64_t;
>        |                   ^~~~~~~
> In file included from dma_map_benchmark.c:13:
> ../../include/linux/types.h:137:13: error: conflicting types for
> ‘blkcnt_t’; have ‘u64’ {aka ‘long long unsigned int’}
>    137 | typedef u64 blkcnt_t;
>        |             ^~~~~~~~
> In file included from /usr/include/stdlib.h:395,
>                   from dma_map_benchmark.c:8:
> /usr/include/x86_64-linux-gnu/sys/types.h:192:20: note: previous
> declaration of ‘blkcnt_t’ with type ‘blkcnt_t’ {aka ‘long int’}
>    192 | typedef __blkcnt_t blkcnt_t;     /* Type to count number of
> disk blocks.  */
>        |                    ^~~~~~~~
> make: *** [Makefile:11: dma_map_benchmark] Error 1
> 
> Thanks
> Barry
I'm so sorry, there were some mistake,'usr/include' should be placed
before 'include' during include :
CFLAGS += -I../../usr/include -I../../include
After the modification, it'll work.In the next version, I will submit
the two patches separately, and put the modification of the file path
in MAINTAINERS into this patch. Is there anything else that needs to be
modified?

  reply	other threads:[~2025-08-18  2:53 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-14 13:35 [PATCH 0/2] " Qinxin Xia
2025-08-14 13:35 ` [PATCH 1/2] tools/dma: " Qinxin Xia
2025-08-15 10:03   ` Barry Song
2025-08-18  2:53     ` Qinxin Xia [this message]
2025-08-21  3:39       ` Barry Song
2025-08-21  3:55         ` Qinxin Xia
2025-08-22  1:12           ` Barry Song
2025-08-27 12:07             ` Qinxin Xia
2025-08-28 21:22               ` Barry Song
2025-09-02  4:08                 ` Qinxin Xia
2025-09-02  4:45                   ` Barry Song
2025-08-14 13:35 ` [PATCH 2/2] MAINTAINERS: add myself and Barry to dma_map_benchmark maintainers Qinxin Xia
2025-08-15  9:28   ` Barry Song
2025-08-15  9:37     ` Qinxin Xia
  -- strict thread matches above, loose matches on Subject: below --
2025-07-24  8:55 [PATCH 0/2] dma-mapping: benchmark: modify the dma_map_benchmark directory Qinxin Xia
2025-07-24  8:55 ` [PATCH 1/2] tools/dma: move dma_map_benchmark from selftests to tools/dma Qinxin Xia
2025-07-24  9:25   ` Barry Song
2025-07-24  9:33     ` Qinxin Xia

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8db50f47-9295-4c7c-8bbc-dbbbd3fb5f79@huawei.com \
    --to=xiaqinxin@huawei.com \
    --cc=21cnbao@gmail.com \
    --cc=fanghao11@huawei.com \
    --cc=jonathan.cameron@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=m.szyprowski@samsung.com \
    --cc=prime.zeng@huawei.com \
    --cc=robin.murphy@arm.com \
    --cc=yangyicong@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®