linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] A few fixes for i386 build errors
@ 2023-11-18  2:48 Yang Jihong
  2023-11-18  2:48 ` [PATCH 1/3] perf kwork: Fix a build error on 32-bit Yang Jihong
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Yang Jihong @ 2023-11-18  2:48 UTC (permalink / raw)
  To: peterz, mingo, acme, mark.rutland, alexander.shishkin, jolsa,
	namhyung, irogers, adrian.hunter, avagin, daniel.diaz,
	linux-perf-users, linux-kernel
  Cc: yangjihong1

Yang Jihong (3):
  perf kwork: Fix a build error on 32-bit
  perf lock contention: Fix a build error on 32-bit
  perf bench sched-seccomp-notify: Fix __NR_seccomp undeclared build
    error on i386

 tools/arch/x86/include/uapi/asm/unistd_32.h | 2 +-
 tools/perf/builtin-kwork.c                  | 2 +-
 tools/perf/util/bpf_lock_contention.c       | 3 ++-
 3 files changed, 4 insertions(+), 3 deletions(-)

-- 
2.34.1


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

* [PATCH 1/3] perf kwork: Fix a build error on 32-bit
  2023-11-18  2:48 [PATCH 0/3] A few fixes for i386 build errors Yang Jihong
@ 2023-11-18  2:48 ` Yang Jihong
  2023-11-18  2:48 ` [PATCH 2/3] perf lock contention: " Yang Jihong
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Yang Jihong @ 2023-11-18  2:48 UTC (permalink / raw)
  To: peterz, mingo, acme, mark.rutland, alexander.shishkin, jolsa,
	namhyung, irogers, adrian.hunter, avagin, daniel.diaz,
	linux-perf-users, linux-kernel
  Cc: yangjihong1

lkft reported a build error for 32-bit system:

    builtin-kwork.c: In function 'top_print_work':
    builtin-kwork.c:1646:28: error: format '%ld' expects argument of
  type 'long int', but argument 3 has type 'u64' {aka 'long long
  unsigned int'} [-Werror=format=]
     1646 |         ret += printf(" %*ld ", PRINT_PID_WIDTH, work->id);
          |                         ~~~^                     ~~~~~~~~
          |                            |                         |
          |                            long int                  u64
  {aka long long unsigned int}
          |                         %*lld
    cc1: all warnings being treated as errors
    make[3]: *** [/builds/linux/tools/build/Makefile.build:106:
  /home/tuxbuild/.cache/tuxmake/builds/1/build/builtin-kwork.o] Error 1

Fix it.

Fixes: 55c40e505234 ("perf kwork top: Introduce new top utility")
Reported-by: Linux Kernel Functional Testing <lkft@linaro.org>
Signed-off-by: Yang Jihong <yangjihong1@huawei.com>
---
 tools/perf/builtin-kwork.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/builtin-kwork.c b/tools/perf/builtin-kwork.c
index f007a9b27065..0092b9b39611 100644
--- a/tools/perf/builtin-kwork.c
+++ b/tools/perf/builtin-kwork.c
@@ -1643,7 +1643,7 @@ static int top_print_work(struct perf_kwork *kwork __maybe_unused, struct kwork_
 	/*
 	 * pid
 	 */
-	ret += printf(" %*ld ", PRINT_PID_WIDTH, work->id);
+	ret += printf(" %*" PRIu64 " ", PRINT_PID_WIDTH, work->id);
 
 	/*
 	 * tgid
-- 
2.34.1


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

* [PATCH 2/3] perf lock contention: Fix a build error on 32-bit
  2023-11-18  2:48 [PATCH 0/3] A few fixes for i386 build errors Yang Jihong
  2023-11-18  2:48 ` [PATCH 1/3] perf kwork: Fix a build error on 32-bit Yang Jihong
@ 2023-11-18  2:48 ` Yang Jihong
  2023-11-18  2:48 ` [PATCH 3/3] perf bench sched-seccomp-notify: Fix __NR_seccomp undeclared build error on i386 Yang Jihong
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Yang Jihong @ 2023-11-18  2:48 UTC (permalink / raw)
  To: peterz, mingo, acme, mark.rutland, alexander.shishkin, jolsa,
	namhyung, irogers, adrian.hunter, avagin, daniel.diaz,
	linux-perf-users, linux-kernel
  Cc: yangjihong1

Fix a build error on 32-bit system:

  util/bpf_lock_contention.c: In function 'lock_contention_get_name':
  util/bpf_lock_contention.c:253:50: error: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'u64 {aka long long unsigned int}' [-Werror=format=]
     snprintf(name_buf, sizeof(name_buf), "cgroup:%lu", cgrp_id);
                                                  ~~^
                                                  %llu
  cc1: all warnings being treated as errors

Fixes: d0c502e46e97 ("perf lock contention: Prepare to handle cgroups")
Signed-off-by: Yang Jihong <yangjihong1@huawei.com>
---
 tools/perf/util/bpf_lock_contention.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/perf/util/bpf_lock_contention.c b/tools/perf/util/bpf_lock_contention.c
index e105245eb905..f1716c089c99 100644
--- a/tools/perf/util/bpf_lock_contention.c
+++ b/tools/perf/util/bpf_lock_contention.c
@@ -12,6 +12,7 @@
 #include <linux/zalloc.h>
 #include <linux/string.h>
 #include <bpf/bpf.h>
+#include <inttypes.h>
 
 #include "bpf_skel/lock_contention.skel.h"
 #include "bpf_skel/lock_data.h"
@@ -250,7 +251,7 @@ static const char *lock_contention_get_name(struct lock_contention *con,
 		if (cgrp)
 			return cgrp->name;
 
-		snprintf(name_buf, sizeof(name_buf), "cgroup:%lu", cgrp_id);
+		snprintf(name_buf, sizeof(name_buf), "cgroup:%" PRIu64 "", cgrp_id);
 		return name_buf;
 	}
 
-- 
2.34.1


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

* [PATCH 3/3] perf bench sched-seccomp-notify: Fix __NR_seccomp undeclared build error on i386
  2023-11-18  2:48 [PATCH 0/3] A few fixes for i386 build errors Yang Jihong
  2023-11-18  2:48 ` [PATCH 1/3] perf kwork: Fix a build error on 32-bit Yang Jihong
  2023-11-18  2:48 ` [PATCH 2/3] perf lock contention: " Yang Jihong
@ 2023-11-18  2:48 ` Yang Jihong
  2023-11-21 18:57   ` Namhyung Kim
  2023-11-21  5:24 ` [PATCH 0/3] A few fixes for i386 build errors Namhyung Kim
  2023-11-22 19:24 ` Namhyung Kim
  4 siblings, 1 reply; 8+ messages in thread
From: Yang Jihong @ 2023-11-18  2:48 UTC (permalink / raw)
  To: peterz, mingo, acme, mark.rutland, alexander.shishkin, jolsa,
	namhyung, irogers, adrian.hunter, avagin, daniel.diaz,
	linux-perf-users, linux-kernel
  Cc: yangjihong1

Fix a build error on i386 system:

bench/sched-seccomp-notify.c: In function 'seccomp':
bench/sched-seccomp-notify.c:46:17: error: '__NR_seccomp' undeclared (first use in this function); did you mean 'seccomp'?
  return syscall(__NR_seccomp, op, flags, args);
                 ^~~~~~~~~~~~
                 seccomp
bench/sched-seccomp-notify.c:46:17: note: each undeclared identifier is reported only once for each function it appears in
bench/sched-seccomp-notify.c:47:1: error: control reaches end of non-void function [-Werror=return-type]
 }
 ^
cc1: all warnings being treated as errors

Fixes: 7d5cb68af638 ("perf/benchmark: add a new benchmark for seccom_unotify")
Signed-off-by: Yang Jihong <yangjihong1@huawei.com>
---
 tools/arch/x86/include/uapi/asm/unistd_32.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/arch/x86/include/uapi/asm/unistd_32.h b/tools/arch/x86/include/uapi/asm/unistd_32.h
index 4798f9d18fe8..9de35df1afc3 100644
--- a/tools/arch/x86/include/uapi/asm/unistd_32.h
+++ b/tools/arch/x86/include/uapi/asm/unistd_32.h
@@ -26,6 +26,6 @@
 #ifndef __NR_setns
 #define __NR_setns 346
 #endif
-#ifdef __NR_seccomp
+#ifndef __NR_seccomp
 #define __NR_seccomp 354
 #endif
-- 
2.34.1


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

* Re: [PATCH 0/3] A few fixes for i386 build errors
  2023-11-18  2:48 [PATCH 0/3] A few fixes for i386 build errors Yang Jihong
                   ` (2 preceding siblings ...)
  2023-11-18  2:48 ` [PATCH 3/3] perf bench sched-seccomp-notify: Fix __NR_seccomp undeclared build error on i386 Yang Jihong
@ 2023-11-21  5:24 ` Namhyung Kim
  2023-11-22 19:24 ` Namhyung Kim
  4 siblings, 0 replies; 8+ messages in thread
From: Namhyung Kim @ 2023-11-21  5:24 UTC (permalink / raw)
  To: Yang Jihong
  Cc: peterz, mingo, acme, mark.rutland, alexander.shishkin, jolsa,
	irogers, adrian.hunter, avagin, daniel.diaz, linux-perf-users,
	linux-kernel

Hello,

On Fri, Nov 17, 2023 at 6:51 PM Yang Jihong <yangjihong1@huawei.com> wrote:
>
> Yang Jihong (3):
>   perf kwork: Fix a build error on 32-bit
>   perf lock contention: Fix a build error on 32-bit
>   perf bench sched-seccomp-notify: Fix __NR_seccomp undeclared build
>     error on i386

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

Thanks for the fix!
Namhyung

>
>  tools/arch/x86/include/uapi/asm/unistd_32.h | 2 +-
>  tools/perf/builtin-kwork.c                  | 2 +-
>  tools/perf/util/bpf_lock_contention.c       | 3 ++-
>  3 files changed, 4 insertions(+), 3 deletions(-)
>
> --
> 2.34.1
>

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

* Re: [PATCH 3/3] perf bench sched-seccomp-notify: Fix __NR_seccomp undeclared build error on i386
  2023-11-18  2:48 ` [PATCH 3/3] perf bench sched-seccomp-notify: Fix __NR_seccomp undeclared build error on i386 Yang Jihong
@ 2023-11-21 18:57   ` Namhyung Kim
  2023-11-22  1:02     ` Yang Jihong
  0 siblings, 1 reply; 8+ messages in thread
From: Namhyung Kim @ 2023-11-21 18:57 UTC (permalink / raw)
  To: Yang Jihong
  Cc: peterz, mingo, acme, mark.rutland, alexander.shishkin, jolsa,
	irogers, adrian.hunter, avagin, daniel.diaz, linux-perf-users,
	linux-kernel

Hello,

On Fri, Nov 17, 2023 at 6:51 PM Yang Jihong <yangjihong1@huawei.com> wrote:
>
> Fix a build error on i386 system:
>
> bench/sched-seccomp-notify.c: In function 'seccomp':
> bench/sched-seccomp-notify.c:46:17: error: '__NR_seccomp' undeclared (first use in this function); did you mean 'seccomp'?
>   return syscall(__NR_seccomp, op, flags, args);
>                  ^~~~~~~~~~~~
>                  seccomp
> bench/sched-seccomp-notify.c:46:17: note: each undeclared identifier is reported only once for each function it appears in
> bench/sched-seccomp-notify.c:47:1: error: control reaches end of non-void function [-Werror=return-type]
>  }
>  ^
> cc1: all warnings being treated as errors
>
> Fixes: 7d5cb68af638 ("perf/benchmark: add a new benchmark for seccom_unotify")
> Signed-off-by: Yang Jihong <yangjihong1@huawei.com>

This is already fixed by:
  https://lore.kernel.org/all/20231017083019.31733-1-jirislaby@kernel.org/

Thanks,
Namhyung


> ---
>  tools/arch/x86/include/uapi/asm/unistd_32.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/arch/x86/include/uapi/asm/unistd_32.h b/tools/arch/x86/include/uapi/asm/unistd_32.h
> index 4798f9d18fe8..9de35df1afc3 100644
> --- a/tools/arch/x86/include/uapi/asm/unistd_32.h
> +++ b/tools/arch/x86/include/uapi/asm/unistd_32.h
> @@ -26,6 +26,6 @@
>  #ifndef __NR_setns
>  #define __NR_setns 346
>  #endif
> -#ifdef __NR_seccomp
> +#ifndef __NR_seccomp
>  #define __NR_seccomp 354
>  #endif
> --
> 2.34.1
>

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

* Re: [PATCH 3/3] perf bench sched-seccomp-notify: Fix __NR_seccomp undeclared build error on i386
  2023-11-21 18:57   ` Namhyung Kim
@ 2023-11-22  1:02     ` Yang Jihong
  0 siblings, 0 replies; 8+ messages in thread
From: Yang Jihong @ 2023-11-22  1:02 UTC (permalink / raw)
  To: Namhyung Kim
  Cc: peterz, mingo, acme, mark.rutland, alexander.shishkin, jolsa,
	irogers, adrian.hunter, avagin, daniel.diaz, linux-perf-users,
	linux-kernel

Hello,

On 2023/11/22 2:57, Namhyung Kim wrote:
> Hello,
> 
> On Fri, Nov 17, 2023 at 6:51 PM Yang Jihong <yangjihong1@huawei.com> wrote:
>>
>> Fix a build error on i386 system:
>>
>> bench/sched-seccomp-notify.c: In function 'seccomp':
>> bench/sched-seccomp-notify.c:46:17: error: '__NR_seccomp' undeclared (first use in this function); did you mean 'seccomp'?
>>    return syscall(__NR_seccomp, op, flags, args);
>>                   ^~~~~~~~~~~~
>>                   seccomp
>> bench/sched-seccomp-notify.c:46:17: note: each undeclared identifier is reported only once for each function it appears in
>> bench/sched-seccomp-notify.c:47:1: error: control reaches end of non-void function [-Werror=return-type]
>>   }
>>   ^
>> cc1: all warnings being treated as errors
>>
>> Fixes: 7d5cb68af638 ("perf/benchmark: add a new benchmark for seccom_unotify")
>> Signed-off-by: Yang Jihong <yangjihong1@huawei.com>
> 
> This is already fixed by:
>    https://lore.kernel.org/all/20231017083019.31733-1-jirislaby@kernel.org/
> 

I didn't notice this patch... okay, please ignore it.

Thanks,
Yang

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

* Re: [PATCH 0/3] A few fixes for i386 build errors
  2023-11-18  2:48 [PATCH 0/3] A few fixes for i386 build errors Yang Jihong
                   ` (3 preceding siblings ...)
  2023-11-21  5:24 ` [PATCH 0/3] A few fixes for i386 build errors Namhyung Kim
@ 2023-11-22 19:24 ` Namhyung Kim
  4 siblings, 0 replies; 8+ messages in thread
From: Namhyung Kim @ 2023-11-22 19:24 UTC (permalink / raw)
  To: avagin, daniel.diaz, jolsa, alexander.shishkin, adrian.hunter,
	irogers, acme, Yang Jihong, mingo, linux-kernel, peterz,
	mark.rutland, linux-perf-users

On Sat, 18 Nov 2023 02:48:55 +0000, Yang Jihong wrote:
> Yang Jihong (3):
>   perf kwork: Fix a build error on 32-bit
>   perf lock contention: Fix a build error on 32-bit
>   perf bench sched-seccomp-notify: Fix __NR_seccomp undeclared build
>     error on i386
> 
> tools/arch/x86/include/uapi/asm/unistd_32.h | 2 +-
>  tools/perf/builtin-kwork.c                  | 2 +-
>  tools/perf/util/bpf_lock_contention.c       | 3 ++-
>  3 files changed, 4 insertions(+), 3 deletions(-)
> 
> [...]

Applied patch 1 and 2 to perf-tools, thanks!

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

end of thread, other threads:[~2023-11-22 19:24 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-18  2:48 [PATCH 0/3] A few fixes for i386 build errors Yang Jihong
2023-11-18  2:48 ` [PATCH 1/3] perf kwork: Fix a build error on 32-bit Yang Jihong
2023-11-18  2:48 ` [PATCH 2/3] perf lock contention: " Yang Jihong
2023-11-18  2:48 ` [PATCH 3/3] perf bench sched-seccomp-notify: Fix __NR_seccomp undeclared build error on i386 Yang Jihong
2023-11-21 18:57   ` Namhyung Kim
2023-11-22  1:02     ` Yang Jihong
2023-11-21  5:24 ` [PATCH 0/3] A few fixes for i386 build errors Namhyung Kim
2023-11-22 19:24 ` Namhyung Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).