Re: [PATCH] perf inject jit: Ignore memfd mmap events if jitdump present

From: Arnaldo Carvalho de Melo
Date: Wed Aug 10 2022 - 09:03:26 EST


Em Wed, Aug 10, 2022 at 10:00:14AM -0300, Arnaldo Carvalho de Melo escreveu:
> Em Thu, Aug 04, 2022 at 08:22:14AM -0700, Ian Rogers escreveu:
> > On Tue, Aug 2, 2022 at 11:25 AM Brian Robbins <brianrob@xxxxxxxxxxxxxxxxxxx> wrote:
> > > Signed-off-by: Brian Robbins <brianrob@xxxxxxxxxxxxxxxxxxx>
> >
> > Acked-by: Ian Rogers <irogers@xxxxxxxxxx>
>
> CC /tmp/build/perf/util/jitdump.o
> CC /tmp/build/perf/pmu-events/pmu-events.o
> LD /tmp/build/perf/pmu-events/pmu-events-in.o
> util/jitdump.c: In function ‘jit_process’:
> util/jitdump.c:853:65: error: expected ‘)’ before ‘return’
> 853 | (strncmp(filename, "/memfd:", 7) == 0))
> | ^
> | )
> 854 | return 1;
> | ~~~~~~
> util/jitdump.c:851:20: note: to match this ‘(’
> 851 | if (jit_has_pid(machine, pid) &&
> | ^
> util/jitdump.c:857:9: error: expected expression before ‘}’ token
> 857 | }
> | ^
> make[4]: *** [/var/home/acme/git/perf/tools/build/Makefile.build:96: /tmp/build/perf/util/jitdump.o] Error 1
> make[4]: *** Waiting for unfinished jobs....
> make[3]: *** [/var/home/acme/git/perf/tools/build/Makefile.build:139: util] Error 2
>
>
> Trying to fix now.

Trivial, please compile test it...

- Arnaldo

diff --git a/tools/perf/util/jitdump.c b/tools/perf/util/jitdump.c
index 335a3c61940b7b39..9983d21a5c42d70e 100644
--- a/tools/perf/util/jitdump.c
+++ b/tools/perf/util/jitdump.c
@@ -850,7 +850,7 @@ jit_process(struct perf_session *session,
*/
if (jit_has_pid(machine, pid) &&
((strncmp(filename, "//anon", 6) == 0) ||
- (strncmp(filename, "/memfd:", 7) == 0))
+ (strncmp(filename, "/memfd:", 7) == 0)))
return 1;

return 0;