All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf annotate: Fix build on 32 bit for BPF annotation
@ 2019-04-03 19:44 Thadeu Lima de Souza Cascardo
  2019-04-03 21:34 ` Song Liu
  2019-05-03  5:53 ` [tip:perf/urgent] " tip-bot for Thadeu Lima de Souza Cascardo
  0 siblings, 2 replies; 5+ messages in thread
From: Thadeu Lima de Souza Cascardo @ 2019-04-03 19:44 UTC (permalink / raw)
  To: linux-kernel; +Cc: songliubraving, acme, Thadeu Lima de Souza Cascardo

Commit 6987561c9e86 ("perf annotate: Enable annotation of BPF programs") adds
support for BPF programs annotations but the new code does not build on 32-bit.

Fixes: 6987561c9e86 ("perf annotate: Enable annotation of BPF programs")
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
---
 tools/perf/util/annotate.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index c8b01176c9e1..09762985c713 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -1714,8 +1714,8 @@ static int symbol__disassemble_bpf(struct symbol *sym,
 	if (dso->binary_type != DSO_BINARY_TYPE__BPF_PROG_INFO)
 		return -1;
 
-	pr_debug("%s: handling sym %s addr %lx len %lx\n", __func__,
-		 sym->name, sym->start, sym->end - sym->start);
+	pr_debug("%s: handling sym %s addr %" PRIx64 " len %" PRIx64 "\n", __func__,
+		  sym->name, sym->start, sym->end - sym->start);
 
 	memset(tpath, 0, sizeof(tpath));
 	perf_exe(tpath, sizeof(tpath));
@@ -1740,7 +1740,7 @@ static int symbol__disassemble_bpf(struct symbol *sym,
 	info_linear = info_node->info_linear;
 	sub_id = dso->bpf_prog.sub_id;
 
-	info.buffer = (void *)(info_linear->info.jited_prog_insns);
+	info.buffer = (void *)(uintptr_t)(info_linear->info.jited_prog_insns);
 	info.buffer_length = info_linear->info.jited_prog_len;
 
 	if (info_linear->info.nr_line_info)
@@ -1776,7 +1776,7 @@ static int symbol__disassemble_bpf(struct symbol *sym,
 		const char *srcline;
 		u64 addr;
 
-		addr = pc + ((u64 *)(info_linear->info.jited_ksyms))[sub_id];
+		addr = pc + ((u64 *)(uintptr_t)(info_linear->info.jited_ksyms))[sub_id];
 		count = disassemble(pc, &info);
 
 		if (prog_linfo)
-- 
2.20.1


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

* Re: [PATCH] perf annotate: Fix build on 32 bit for BPF annotation
  2019-04-03 19:44 [PATCH] perf annotate: Fix build on 32 bit for BPF annotation Thadeu Lima de Souza Cascardo
@ 2019-04-03 21:34 ` Song Liu
  2019-04-23 14:58   ` PING: " Thadeu Lima de Souza Cascardo
  2019-05-03  5:53 ` [tip:perf/urgent] " tip-bot for Thadeu Lima de Souza Cascardo
  1 sibling, 1 reply; 5+ messages in thread
From: Song Liu @ 2019-04-03 21:34 UTC (permalink / raw)
  To: Thadeu Lima de Souza Cascardo; +Cc: linux-kernel, acme



> On Apr 3, 2019, at 12:44 PM, Thadeu Lima de Souza Cascardo <cascardo@canonical.com> wrote:
> 
> Commit 6987561c9e86 ("perf annotate: Enable annotation of BPF programs") adds
> support for BPF programs annotations but the new code does not build on 32-bit.
> 
> Fixes: 6987561c9e86 ("perf annotate: Enable annotation of BPF programs")
> Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>

Acked-by: Song Liu <songliubraving@fb.com>

Thanks for the fix!
Song

> ---
> tools/perf/util/annotate.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
> index c8b01176c9e1..09762985c713 100644
> --- a/tools/perf/util/annotate.c
> +++ b/tools/perf/util/annotate.c
> @@ -1714,8 +1714,8 @@ static int symbol__disassemble_bpf(struct symbol *sym,
> 	if (dso->binary_type != DSO_BINARY_TYPE__BPF_PROG_INFO)
> 		return -1;
> 
> -	pr_debug("%s: handling sym %s addr %lx len %lx\n", __func__,
> -		 sym->name, sym->start, sym->end - sym->start);
> +	pr_debug("%s: handling sym %s addr %" PRIx64 " len %" PRIx64 "\n", __func__,
> +		  sym->name, sym->start, sym->end - sym->start);
> 
> 	memset(tpath, 0, sizeof(tpath));
> 	perf_exe(tpath, sizeof(tpath));
> @@ -1740,7 +1740,7 @@ static int symbol__disassemble_bpf(struct symbol *sym,
> 	info_linear = info_node->info_linear;
> 	sub_id = dso->bpf_prog.sub_id;
> 
> -	info.buffer = (void *)(info_linear->info.jited_prog_insns);
> +	info.buffer = (void *)(uintptr_t)(info_linear->info.jited_prog_insns);
> 	info.buffer_length = info_linear->info.jited_prog_len;
> 
> 	if (info_linear->info.nr_line_info)
> @@ -1776,7 +1776,7 @@ static int symbol__disassemble_bpf(struct symbol *sym,
> 		const char *srcline;
> 		u64 addr;
> 
> -		addr = pc + ((u64 *)(info_linear->info.jited_ksyms))[sub_id];
> +		addr = pc + ((u64 *)(uintptr_t)(info_linear->info.jited_ksyms))[sub_id];
> 		count = disassemble(pc, &info);
> 
> 		if (prog_linfo)
> -- 
> 2.20.1
> 


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

* PING: Re: [PATCH] perf annotate: Fix build on 32 bit for BPF annotation
  2019-04-03 21:34 ` Song Liu
@ 2019-04-23 14:58   ` Thadeu Lima de Souza Cascardo
  2019-04-23 15:09     ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 5+ messages in thread
From: Thadeu Lima de Souza Cascardo @ 2019-04-23 14:58 UTC (permalink / raw)
  To: Song Liu; +Cc: linux-kernel, acme, acme, tglx

On Wed, Apr 03, 2019 at 09:34:02PM +0000, Song Liu wrote:
> 
> 
> > On Apr 3, 2019, at 12:44 PM, Thadeu Lima de Souza Cascardo <cascardo@canonical.com> wrote:
> > 
> > Commit 6987561c9e86 ("perf annotate: Enable annotation of BPF programs") adds
> > support for BPF programs annotations but the new code does not build on 32-bit.
> > 
> > Fixes: 6987561c9e86 ("perf annotate: Enable annotation of BPF programs")
> > Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
> 
> Acked-by: Song Liu <songliubraving@fb.com>
> 
> Thanks for the fix!
> Song
> 

Thanks for the ack.

Pinging for getting this applied, as this is a build failure on i386.

Thanks.
Cascardo.

> > ---
> > tools/perf/util/annotate.c | 8 ++++----
> > 1 file changed, 4 insertions(+), 4 deletions(-)
> > 
> > diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
> > index c8b01176c9e1..09762985c713 100644
> > --- a/tools/perf/util/annotate.c
> > +++ b/tools/perf/util/annotate.c
> > @@ -1714,8 +1714,8 @@ static int symbol__disassemble_bpf(struct symbol *sym,
> > 	if (dso->binary_type != DSO_BINARY_TYPE__BPF_PROG_INFO)
> > 		return -1;
> > 
> > -	pr_debug("%s: handling sym %s addr %lx len %lx\n", __func__,
> > -		 sym->name, sym->start, sym->end - sym->start);
> > +	pr_debug("%s: handling sym %s addr %" PRIx64 " len %" PRIx64 "\n", __func__,
> > +		  sym->name, sym->start, sym->end - sym->start);
> > 
> > 	memset(tpath, 0, sizeof(tpath));
> > 	perf_exe(tpath, sizeof(tpath));
> > @@ -1740,7 +1740,7 @@ static int symbol__disassemble_bpf(struct symbol *sym,
> > 	info_linear = info_node->info_linear;
> > 	sub_id = dso->bpf_prog.sub_id;
> > 
> > -	info.buffer = (void *)(info_linear->info.jited_prog_insns);
> > +	info.buffer = (void *)(uintptr_t)(info_linear->info.jited_prog_insns);
> > 	info.buffer_length = info_linear->info.jited_prog_len;
> > 
> > 	if (info_linear->info.nr_line_info)
> > @@ -1776,7 +1776,7 @@ static int symbol__disassemble_bpf(struct symbol *sym,
> > 		const char *srcline;
> > 		u64 addr;
> > 
> > -		addr = pc + ((u64 *)(info_linear->info.jited_ksyms))[sub_id];
> > +		addr = pc + ((u64 *)(uintptr_t)(info_linear->info.jited_ksyms))[sub_id];
> > 		count = disassemble(pc, &info);
> > 
> > 		if (prog_linfo)
> > -- 
> > 2.20.1
> > 
> 

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

* Re: PING: Re: [PATCH] perf annotate: Fix build on 32 bit for BPF annotation
  2019-04-23 14:58   ` PING: " Thadeu Lima de Souza Cascardo
@ 2019-04-23 15:09     ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 5+ messages in thread
From: Arnaldo Carvalho de Melo @ 2019-04-23 15:09 UTC (permalink / raw)
  To: Thadeu Lima de Souza Cascardo; +Cc: Song Liu, linux-kernel, acme, tglx

Em Tue, Apr 23, 2019 at 11:58:48AM -0300, Thadeu Lima de Souza Cascardo escreveu:
> On Wed, Apr 03, 2019 at 09:34:02PM +0000, Song Liu wrote:
> > 
> > 
> > > On Apr 3, 2019, at 12:44 PM, Thadeu Lima de Souza Cascardo <cascardo@canonical.com> wrote:
> > > 
> > > Commit 6987561c9e86 ("perf annotate: Enable annotation of BPF programs") adds
> > > support for BPF programs annotations but the new code does not build on 32-bit.
> > > 
> > > Fixes: 6987561c9e86 ("perf annotate: Enable annotation of BPF programs")
> > > Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
> > 
> > Acked-by: Song Liu <songliubraving@fb.com>
> > 
> > Thanks for the fix!
> > Song
> > 
> 
> Thanks for the ack.
> 
> Pinging for getting this applied, as this is a build failure on i386.

Thanks, applied to perf/urgent.

- Arnaldo

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

* [tip:perf/urgent] perf annotate: Fix build on 32 bit for BPF annotation
  2019-04-03 19:44 [PATCH] perf annotate: Fix build on 32 bit for BPF annotation Thadeu Lima de Souza Cascardo
  2019-04-03 21:34 ` Song Liu
@ 2019-05-03  5:53 ` tip-bot for Thadeu Lima de Souza Cascardo
  1 sibling, 0 replies; 5+ messages in thread
From: tip-bot for Thadeu Lima de Souza Cascardo @ 2019-05-03  5:53 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: hpa, mingo, acme, linux-kernel, songliubraving, cascardo, tglx

Commit-ID:  01e985e900d3e602e9b1a55372a8e5274012a417
Gitweb:     https://git.kernel.org/tip/01e985e900d3e602e9b1a55372a8e5274012a417
Author:     Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
AuthorDate: Wed, 3 Apr 2019 16:44:52 -0300
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Thu, 2 May 2019 16:00:19 -0400

perf annotate: Fix build on 32 bit for BPF annotation

Commit 6987561c9e86 ("perf annotate: Enable annotation of BPF programs") adds
support for BPF programs annotations but the new code does not build on 32-bit.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Acked-by: Song Liu <songliubraving@fb.com>
Fixes: 6987561c9e86 ("perf annotate: Enable annotation of BPF programs")
Link: http://lkml.kernel.org/r/20190403194452.10845-1-cascardo@canonical.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/annotate.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index c8b01176c9e1..09762985c713 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -1714,8 +1714,8 @@ static int symbol__disassemble_bpf(struct symbol *sym,
 	if (dso->binary_type != DSO_BINARY_TYPE__BPF_PROG_INFO)
 		return -1;
 
-	pr_debug("%s: handling sym %s addr %lx len %lx\n", __func__,
-		 sym->name, sym->start, sym->end - sym->start);
+	pr_debug("%s: handling sym %s addr %" PRIx64 " len %" PRIx64 "\n", __func__,
+		  sym->name, sym->start, sym->end - sym->start);
 
 	memset(tpath, 0, sizeof(tpath));
 	perf_exe(tpath, sizeof(tpath));
@@ -1740,7 +1740,7 @@ static int symbol__disassemble_bpf(struct symbol *sym,
 	info_linear = info_node->info_linear;
 	sub_id = dso->bpf_prog.sub_id;
 
-	info.buffer = (void *)(info_linear->info.jited_prog_insns);
+	info.buffer = (void *)(uintptr_t)(info_linear->info.jited_prog_insns);
 	info.buffer_length = info_linear->info.jited_prog_len;
 
 	if (info_linear->info.nr_line_info)
@@ -1776,7 +1776,7 @@ static int symbol__disassemble_bpf(struct symbol *sym,
 		const char *srcline;
 		u64 addr;
 
-		addr = pc + ((u64 *)(info_linear->info.jited_ksyms))[sub_id];
+		addr = pc + ((u64 *)(uintptr_t)(info_linear->info.jited_ksyms))[sub_id];
 		count = disassemble(pc, &info);
 
 		if (prog_linfo)

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

end of thread, other threads:[~2019-05-03  5:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-03 19:44 [PATCH] perf annotate: Fix build on 32 bit for BPF annotation Thadeu Lima de Souza Cascardo
2019-04-03 21:34 ` Song Liu
2019-04-23 14:58   ` PING: " Thadeu Lima de Souza Cascardo
2019-04-23 15:09     ` Arnaldo Carvalho de Melo
2019-05-03  5:53 ` [tip:perf/urgent] " tip-bot for Thadeu Lima de Souza Cascardo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.