Linux Perf Users
 help / color / mirror / Atom feed
* [PATCH 1/1] perf test workload: Use unsigned int in code_with_type instead of uint
@ 2026-09-25 15:32 Arnaldo Carvalho de Melo
  2026-09-25 15:34 ` sashiko-bot
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2026-09-25 15:32 UTC (permalink / raw)
  To: linux-perf-users
  Cc: Adrian Hunter, Ian Rogers, James Clark, Jiri Olsa, Namhyung Kim,
	Dmitrii Dolgov

The declaration of the Rust helper test_rs() uses "uint", a BSD-ism
that lives in <sys/types.h>, so on glibc it is only visible by
accident: glibc's <stdlib.h> includes <sys/types.h>, where uint is
exposed under __USE_MISC, which is on by default.

musl does none of that: its <stdlib.h> doesn't include <sys/types.h>
and it typedefs uint there only when _GNU_SOURCE/_BSD_SOURCE is
defined, while nothing else in this translation unit includes
<sys/types.h>. Building it on Alpine therefore fails with:

  tests/workloads/code_with_type.c:9:21: error: unknown type name 'uint'; did you mean 'int'?
  tests/workloads/code_with_type.c:39:17: error: implicit declaration of function 'test_rs' [-Wimplicit-function-declaration]

The second error is a consequence of the first one: with the
declaration at line 9 rejected, the call at line 39 has no prototype,
which is an error since gcc 14.

The breakage is only visible when rustc is present, because
tests/workloads/Build adds code_with_type.o when CONFIG_RUST_SUPPORT
is detected, and tools/build/feature only checks for "rustc
--version". That is why alpine:3.23 and alpine:3.24 fail while
alpine:3.22 and alpine:edge, lacking rustc, build fine and hide it.

Use unsigned int, which needs no header at all.

Fixes: 2e05bb52a12d3 ("perf test workload: Add code_with_type test workload")
Cc: Dmitrii Dolgov <9erthalion6@gmail.com>
Assisted-by: LLM
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/tests/workloads/code_with_type.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/tests/workloads/code_with_type.c b/tools/perf/tests/workloads/code_with_type.c
index 65d7be7dac24d411..d2d437b86e0c6dbd 100644
--- a/tools/perf/tests/workloads/code_with_type.c
+++ b/tools/perf/tests/workloads/code_with_type.c
@@ -6,7 +6,7 @@
 #include <linux/compiler.h>
 #include "../tests.h"
 
-extern void test_rs(uint count);
+extern void test_rs(unsigned int count);
 
 static volatile sig_atomic_t done;
 
-- 
2.55.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] perf test workload: Use unsigned int in code_with_type instead of uint
  2026-09-25 15:32 [PATCH 1/1] perf test workload: Use unsigned int in code_with_type instead of uint Arnaldo Carvalho de Melo
@ 2026-09-25 15:34 ` sashiko-bot
  2026-09-25 15:36 ` Ian Rogers
  2026-09-25 15:41 ` Namhyung Kim
  2 siblings, 0 replies; 4+ messages in thread
From: sashiko-bot @ 2026-09-25 15:34 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo; +Cc: linux-perf-users

> The declaration of the Rust helper test_rs() uses "uint", a BSD-ism
> that lives in <sys/types.h>, so on glibc it is only visible by
> accident: glibc's <stdlib.h> includes <sys/types.h>, where uint is
> exposed under __USE_MISC, which is on by default.
> 
> musl does none of that: its <stdlib.h> doesn't include <sys/types.h>
> and it typedefs uint there only when _GNU_SOURCE/_BSD_SOURCE is
> defined, while nothing else in this translation unit includes
> <sys/types.h>. Building it on Alpine therefore fails with:
> 
>   tests/workloads/code_with_type.c:9:21: error: unknown type name 'uint'; did you mean 'int'?
>   tests/workloads/code_with_type.c:39:17: error: implicit declaration of function 'test_rs' [-Wimplicit-function-declaration]
> 
> The second error is a consequence of the first one: with the
> declaration at line 9 rejected, the call at line 39 has no prototype,
> which is an error since gcc 14.
> 
> The breakage is only visible when rustc is present, because
> tests/workloads/Build adds code_with_type.o when CONFIG_RUST_SUPPORT
> is detected, and tools/build/feature only checks for "rustc
> --version". That is why alpine:3.23 and alpine:3.24 fail while
> alpine:3.22 and alpine:edge, lacking rustc, build fine and hide it.
> 
> Use unsigned int, which needs no header at all.
> 
> Fixes: 2e05bb52a12d3 ("perf test workload: Add code_with_type test workload")
> Cc: Dmitrii Dolgov <9erthalion6@gmail.com>
> Assisted-by: LLM
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

Sashiko has reviewed this patch and found no issues. It looks great!

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/araUAt-S6YM_bbAf@x2?part=1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] perf test workload: Use unsigned int in code_with_type instead of uint
  2026-09-25 15:32 [PATCH 1/1] perf test workload: Use unsigned int in code_with_type instead of uint Arnaldo Carvalho de Melo
  2026-09-25 15:34 ` sashiko-bot
@ 2026-09-25 15:36 ` Ian Rogers
  2026-09-25 15:41 ` Namhyung Kim
  2 siblings, 0 replies; 4+ messages in thread
From: Ian Rogers @ 2026-09-25 15:36 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-perf-users, Adrian Hunter, James Clark, Jiri Olsa,
	Namhyung Kim, Dmitrii Dolgov

On Fri, Sep 25, 2026 at 8:32 AM Arnaldo Carvalho de Melo
<acme@kernel.org> wrote:
>
> The declaration of the Rust helper test_rs() uses "uint", a BSD-ism
> that lives in <sys/types.h>, so on glibc it is only visible by
> accident: glibc's <stdlib.h> includes <sys/types.h>, where uint is
> exposed under __USE_MISC, which is on by default.
>
> musl does none of that: its <stdlib.h> doesn't include <sys/types.h>
> and it typedefs uint there only when _GNU_SOURCE/_BSD_SOURCE is
> defined, while nothing else in this translation unit includes
> <sys/types.h>. Building it on Alpine therefore fails with:
>
>   tests/workloads/code_with_type.c:9:21: error: unknown type name 'uint'; did you mean 'int'?
>   tests/workloads/code_with_type.c:39:17: error: implicit declaration of function 'test_rs' [-Wimplicit-function-declaration]
>
> The second error is a consequence of the first one: with the
> declaration at line 9 rejected, the call at line 39 has no prototype,
> which is an error since gcc 14.
>
> The breakage is only visible when rustc is present, because
> tests/workloads/Build adds code_with_type.o when CONFIG_RUST_SUPPORT
> is detected, and tools/build/feature only checks for "rustc
> --version". That is why alpine:3.23 and alpine:3.24 fail while
> alpine:3.22 and alpine:edge, lacking rustc, build fine and hide it.
>
> Use unsigned int, which needs no header at all.
>
> Fixes: 2e05bb52a12d3 ("perf test workload: Add code_with_type test workload")
> Cc: Dmitrii Dolgov <9erthalion6@gmail.com>
> Assisted-by: LLM
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

Reviewed-by: Ian Rogers <irogers@google.com>

Thanks,
Ian

> ---
>  tools/perf/tests/workloads/code_with_type.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/perf/tests/workloads/code_with_type.c b/tools/perf/tests/workloads/code_with_type.c
> index 65d7be7dac24d411..d2d437b86e0c6dbd 100644
> --- a/tools/perf/tests/workloads/code_with_type.c
> +++ b/tools/perf/tests/workloads/code_with_type.c
> @@ -6,7 +6,7 @@
>  #include <linux/compiler.h>
>  #include "../tests.h"
>
> -extern void test_rs(uint count);
> +extern void test_rs(unsigned int count);
>
>  static volatile sig_atomic_t done;
>
> --
> 2.55.0
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] perf test workload: Use unsigned int in code_with_type instead of uint
  2026-09-25 15:32 [PATCH 1/1] perf test workload: Use unsigned int in code_with_type instead of uint Arnaldo Carvalho de Melo
  2026-09-25 15:34 ` sashiko-bot
  2026-09-25 15:36 ` Ian Rogers
@ 2026-09-25 15:41 ` Namhyung Kim
  2 siblings, 0 replies; 4+ messages in thread
From: Namhyung Kim @ 2026-09-25 15:41 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-perf-users, Adrian Hunter, Ian Rogers, James Clark,
	Jiri Olsa, Dmitrii Dolgov

On Fri, Sep 25, 2026 at 05:32:18PM +0200, Arnaldo Carvalho de Melo wrote:
> The declaration of the Rust helper test_rs() uses "uint", a BSD-ism
> that lives in <sys/types.h>, so on glibc it is only visible by
> accident: glibc's <stdlib.h> includes <sys/types.h>, where uint is
> exposed under __USE_MISC, which is on by default.
> 
> musl does none of that: its <stdlib.h> doesn't include <sys/types.h>
> and it typedefs uint there only when _GNU_SOURCE/_BSD_SOURCE is
> defined, while nothing else in this translation unit includes
> <sys/types.h>. Building it on Alpine therefore fails with:
> 
>   tests/workloads/code_with_type.c:9:21: error: unknown type name 'uint'; did you mean 'int'?
>   tests/workloads/code_with_type.c:39:17: error: implicit declaration of function 'test_rs' [-Wimplicit-function-declaration]
> 
> The second error is a consequence of the first one: with the
> declaration at line 9 rejected, the call at line 39 has no prototype,
> which is an error since gcc 14.
> 
> The breakage is only visible when rustc is present, because
> tests/workloads/Build adds code_with_type.o when CONFIG_RUST_SUPPORT
> is detected, and tools/build/feature only checks for "rustc
> --version". That is why alpine:3.23 and alpine:3.24 fail while
> alpine:3.22 and alpine:edge, lacking rustc, build fine and hide it.
> 
> Use unsigned int, which needs no header at all.
> 
> Fixes: 2e05bb52a12d3 ("perf test workload: Add code_with_type test workload")
> Cc: Dmitrii Dolgov <9erthalion6@gmail.com>
> Assisted-by: LLM
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

Acked-by: Namhyung Kim <namhyung@kernel.org>

Thanks,
Namhyung

> ---
>  tools/perf/tests/workloads/code_with_type.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/perf/tests/workloads/code_with_type.c b/tools/perf/tests/workloads/code_with_type.c
> index 65d7be7dac24d411..d2d437b86e0c6dbd 100644
> --- a/tools/perf/tests/workloads/code_with_type.c
> +++ b/tools/perf/tests/workloads/code_with_type.c
> @@ -6,7 +6,7 @@
>  #include <linux/compiler.h>
>  #include "../tests.h"
>  
> -extern void test_rs(uint count);
> +extern void test_rs(unsigned int count);
>  
>  static volatile sig_atomic_t done;
>  
> -- 
> 2.55.0
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-09-25 15:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-25 15:32 [PATCH 1/1] perf test workload: Use unsigned int in code_with_type instead of uint Arnaldo Carvalho de Melo
2026-09-25 15:34 ` sashiko-bot
2026-09-25 15:36 ` Ian Rogers
2026-09-25 15:41 ` Namhyung Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox