Skip to contentSkip to conversation

perf tools: Fix random building error

PATCH In review Wang Nan 4 participants 5 messages Sep 1, 2015 – Sep 2, 2015 perf events

lore
Share & tools
lore

Wang Nan

author
#0 lore raw

PATCH 1/1 perf tools: Fix random building error

I hit following building error randomly:

...
/bin/sh: /path/to/kernel/buildperf/util/intel-pt-decoder/inat-tables.c: No such file or directory
...

  LINK     /path/to/kernel/buildperf/plugin_mac80211.so
  LINK     /path/to/kernel/buildperf/plugin_kmem.so
  LINK     /path/to/kernel/buildperf/plugin_xen.so
  LINK     /path/to/kernel/buildperf/plugin_hrtimer.so
In file included from util/intel-pt-decoder/intel-pt-insn-decoder.c:25:0:
util/intel-pt-decoder/inat.c:24:25: fatal error: inat-tables.c: No such file or directory
 #include "inat-tables.c"
                         ^

compilation terminated.
make[4]: *** [/path/to/kernel/buildperf/util/intel-pt-decoder/intel-pt-insn-decoder.o] Error 1 make[4]: *** Waiting for unfinished jobs....
LINK /path/to/kernel/buildperf/plugin_function.so

This is caused by tools/perf/util/intel-pt-decoder/Build that, it tries to generate $(OUTPUT)util/intel-pt-decoder/inat-tables.c atomatically but forget to ensure the existance of $(OUTPUT)util/intel-pt-decoder directory.

This patch fixes it by adding $(call rule_mkdir) like other similar rules.

Cc Arnaldo Carvalho de Melo <[email protected]>
Cc Adrian Hunter <[email protected]>
---
 tools/perf/util/intel-pt-decoder/Build | 1 +
 1 file changed, 1 insertion(+)
tools/perf/util/intel-pt-decoder/Build +1 -0
index 240730d..2386322 100644
@@ -4,6 +4,7 @@ inat_tables_script = util/intel-pt-decoder/gen-insn-attr-x86.awk
 inat_tables_maps = util/intel-pt-decoder/x86-opcode-map.txt
 
 $(OUTPUT)util/intel-pt-decoder/inat-tables.c: $(inat_tables_script) $(inat_tables_maps)
+	$(call rule_mkdir)
 	@$(call echo-cmd,gen)$(AWK) -f $(inat_tables_script) $(inat_tables_maps) > $@ || rm -f $@
 
 $(OUTPUT)util/intel-pt-decoder/intel-pt-insn-decoder.o: util/intel-pt-decoder/inat.c $(OUTPUT)util/intel-pt-decoder/inat-tables.c
Signature · 1 line
1.8.3.4
reviewer
#1 lore raw
Quoted 1 line · Wang Nan

I hit following building error randomly:

Random presumably because there is a race to use/create the directory by different make jobs (i.e. -j option).

Quoted 21 lines

...
/bin/sh: /path/to/kernel/buildperf/util/intel-pt-decoder/inat-tables.c: No such file or directory
...

  LINK     /path/to/kernel/buildperf/plugin_mac80211.so
  LINK     /path/to/kernel/buildperf/plugin_kmem.so
  LINK     /path/to/kernel/buildperf/plugin_xen.so
  LINK     /path/to/kernel/buildperf/plugin_hrtimer.so
In file included from util/intel-pt-decoder/intel-pt-insn-decoder.c:25:0:
util/intel-pt-decoder/inat.c:24:25: fatal error: inat-tables.c: No such file or directory
 #include "inat-tables.c"
                         ^

compilation terminated.
make[4]: *** [/path/to/kernel/buildperf/util/intel-pt-decoder/intel-pt-insn-decoder.o] Error 1 make[4]: *** Waiting for unfinished jobs....
LINK /path/to/kernel/buildperf/plugin_function.so

This is caused by tools/perf/util/intel-pt-decoder/Build that, it tries to generate $(OUTPUT)util/intel-pt-decoder/inat-tables.c atomatically but forget to ensure the existance of $(OUTPUT)util/intel-pt-decoder directory.

Quoted 5 lines

This patch fixes it by adding $(call rule_mkdir) like other similar rules.

Cc Arnaldo Carvalho de Melo <[email protected]>
Cc Adrian Hunter <[email protected]>

Looks ok to me. Jiri?

Quoted 17 lines
---
 tools/perf/util/intel-pt-decoder/Build | 1 +
 1 file changed, 1 insertion(+)
tools/perf/util/intel-pt-decoder/Build +1 -0
index 240730d..2386322 100644
@@ -4,6 +4,7 @@ inat_tables_script = util/intel-pt-decoder/gen-insn-attr-x86.awk
 inat_tables_maps = util/intel-pt-decoder/x86-opcode-map.txt
 
 $(OUTPUT)util/intel-pt-decoder/inat-tables.c: $(inat_tables_script) $(inat_tables_maps)
+	$(call rule_mkdir)
 	@$(call echo-cmd,gen)$(AWK) -f $(inat_tables_script) $(inat_tables_maps) > $@ || rm -f $@
 
 $(OUTPUT)util/intel-pt-decoder/intel-pt-insn-decoder.o: util/intel-pt-decoder/inat.c $(OUTPUT)util/intel-pt-decoder/inat-tables.c
#2 lore raw
Quoted 4 lines · Adrian Hunter
Quoted 1 line · Wang Nan

I hit following building error randomly:

Random presumably because there is a race to use/create the directory by different make jobs (i.e. -j option).

Yes, I use -j 160 :)

Quoted 44 lines
Quoted 20 lines
   ...
/bin/sh: /path/to/kernel/buildperf/util/intel-pt-decoder/inat-tables.c: No such file or directory
   ...
   LINK     /path/to/kernel/buildperf/plugin_mac80211.so
   LINK     /path/to/kernel/buildperf/plugin_kmem.so
   LINK     /path/to/kernel/buildperf/plugin_xen.so
   LINK     /path/to/kernel/buildperf/plugin_hrtimer.so
In file included from util/intel-pt-decoder/intel-pt-insn-decoder.c:25:0:
util/intel-pt-decoder/inat.c:24:25: fatal error: inat-tables.c: No such file or directory
  #include "inat-tables.c"
                          ^

compilation terminated.
make[4]: *** [/path/to/kernel/buildperf/util/intel-pt-decoder/intel-pt-insn-decoder.o] Error 1 make[4]: *** Waiting for unfinished jobs....
LINK /path/to/kernel/buildperf/plugin_function.so

This is caused by tools/perf/util/intel-pt-decoder/Build that, it tries to generate $(OUTPUT)util/intel-pt-decoder/inat-tables.c atomatically but forget to ensure the existance of $(OUTPUT)util/intel-pt-decoder directory.

Quoted 5 lines

This patch fixes it by adding $(call rule_mkdir) like other similar rules.

Cc Arnaldo Carvalho de Melo <[email protected]>
Cc Adrian Hunter <[email protected]>

Looks ok to me. Jiri?

Quoted 17 lines
---
  tools/perf/util/intel-pt-decoder/Build | 1 +
  1 file changed, 1 insertion(+)
tools/perf/util/intel-pt-decoder/Build +1 -0
index 240730d..2386322 100644
@@ -4,6 +4,7 @@ inat_tables_script = util/intel-pt-decoder/gen-insn-attr-x86.awk
  inat_tables_maps = util/intel-pt-decoder/x86-opcode-map.txt
 
  $(OUTPUT)util/intel-pt-decoder/inat-tables.c: $(inat_tables_script) $(inat_tables_maps)
+	$(call rule_mkdir)
  	@$(call echo-cmd,gen)$(AWK) -f $(inat_tables_script) $(inat_tables_maps) > $@ || rm -f $@
 
  $(OUTPUT)util/intel-pt-decoder/intel-pt-insn-decoder.o: util/intel-pt-decoder/inat.c $(OUTPUT)util/intel-pt-decoder/inat-tables.c
Acked-by
#3 lore raw
In reply to Adrian Hunter
Quoted 27 lines · Adrian Hunter
Quoted 1 line · Wang Nan

I hit following building error randomly:

Random presumably because there is a race to use/create the directory by different make jobs (i.e. -j option).

Quoted 21 lines

...
/bin/sh: /path/to/kernel/buildperf/util/intel-pt-decoder/inat-tables.c: No such file or directory
...

  LINK     /path/to/kernel/buildperf/plugin_mac80211.so
  LINK     /path/to/kernel/buildperf/plugin_kmem.so
  LINK     /path/to/kernel/buildperf/plugin_xen.so
  LINK     /path/to/kernel/buildperf/plugin_hrtimer.so
In file included from util/intel-pt-decoder/intel-pt-insn-decoder.c:25:0:
util/intel-pt-decoder/inat.c:24:25: fatal error: inat-tables.c: No such file or directory
 #include "inat-tables.c"
                         ^

compilation terminated.
make[4]: *** [/path/to/kernel/buildperf/util/intel-pt-decoder/intel-pt-insn-decoder.o] Error 1 make[4]: *** Waiting for unfinished jobs....
LINK /path/to/kernel/buildperf/plugin_function.so

This is caused by tools/perf/util/intel-pt-decoder/Build that, it tries to generate $(OUTPUT)util/intel-pt-decoder/inat-tables.c atomatically but forget to ensure the existance of $(OUTPUT)util/intel-pt-decoder directory.

Quoted 7 lines
Quoted 5 lines

This patch fixes it by adding $(call rule_mkdir) like other similar rules.

Cc Arnaldo Carvalho de Melo <[email protected]>
Cc Adrian Hunter <[email protected]>

Looks ok to me. Jiri?

right, each separate rule needs to have this

thanks,
jirka

#4 lore raw

[tip:perf/urgent] perf build: Fix Intel PT instruction decoder dependency problem

In reply to Wang Nan
perf build: Fix Intel PT instruction decoder dependency problem
Commit-ID:  04aa90b529ee45c5ee88997bc214202e07b26979
Gitweb:     http://git.kernel.org/tip/04aa90b529ee45c5ee88997bc214202e07b26979
Author:     Wang Nan <[email protected]>
AuthorDate: Tue, 1 Sep 2015 05:56:45 +0000
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Tue, 1 Sep 2015 13:03:46 -0300

perf build: Fix Intel PT instruction decoder dependency problem

I hit following building error randomly:

    ...
  /bin/sh: /path/to/kernel/buildperf/util/intel-pt-decoder/inat-tables.c: No such file or directory
    ...
    LINK     /path/to/kernel/buildperf/plugin_mac80211.so
    LINK     /path/to/kernel/buildperf/plugin_kmem.so
    LINK     /path/to/kernel/buildperf/plugin_xen.so
    LINK     /path/to/kernel/buildperf/plugin_hrtimer.so
  In file included from util/intel-pt-decoder/intel-pt-insn-decoder.c:25:0:
  util/intel-pt-decoder/inat.c:24:25: fatal error: inat-tables.c: No such file or directory
   #include "inat-tables.c"
                           ^

compilation terminated.
make[4]: *** [/path/to/kernel/buildperf/util/intel-pt-decoder/intel-pt-insn-decoder.o] Error 1 make[4]: *** Waiting for unfinished jobs....
LINK /path/to/kernel/buildperf/plugin_function.so

This is caused by tools/perf/util/intel-pt-decoder/Build that, it tries to generate $(OUTPUT)util/intel-pt-decoder/inat-tables.c atomatically but forget to ensure the existance of $(OUTPUT)util/intel-pt-decoder directory.

This patch fixes it by adding $(call rule_mkdir) like other similar rules.

---
 tools/perf/util/intel-pt-decoder/Build | 1 +
 1 file changed, 1 insertion(+)
tools/perf/util/intel-pt-decoder/Build +1 -0
index 240730d..2386322 100644
@@ -4,6 +4,7 @@ inat_tables_script = util/intel-pt-decoder/gen-insn-attr-x86.awk
 inat_tables_maps = util/intel-pt-decoder/x86-opcode-map.txt
 
 $(OUTPUT)util/intel-pt-decoder/inat-tables.c: $(inat_tables_script) $(inat_tables_maps)
+	$(call rule_mkdir)
 	@$(call echo-cmd,gen)$(AWK) -f $(inat_tables_script) $(inat_tables_maps) > $@ || rm -f $@
 
 $(OUTPUT)util/intel-pt-decoder/intel-pt-insn-decoder.o: util/intel-pt-decoder/inat.c $(OUTPUT)util/intel-pt-decoder/inat-tables.c