Skip to contentSkip to conversation

perf tools: Create libdir directory before installing libperf-jvmti.so

PATCH In review Laura Abbott 3 participants 3 messages Jan 6, 2017 – Jan 12, 2017 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf tools: Create libdir directory before installing libperf-jvmti.so

The install command for libperf-jvmti.so does not check if libdir exists before installing. This means that when the install command is run:

install libperf-jvmti.so '/tmp/test_root/usr/lib64';

libperf-jvmti.so will get installed to /usr/lib64 as a file and break further installation. Fix this by ensuring the directory gets created first.

See https://bugzilla.redhat.com/show_bug.cgi?id=1410296

Fixes d4dfdf00d43e ("perf jvmti: Plug compilation into perf build")

---
For full disclosure, Fedora is setting NO_JVMTI but this should still be fixed to allow it to be turned on in the future.

---
 tools/perf/Makefile.perf | 1 +
 1 file changed, 1 insertion(+)
tools/perf/Makefile.perf +1 -0
index 8fc2482..7db8ff0 100644
@@ -661,6 +661,7 @@ ifndef NO_PERF_READ_VDSOX32
 endif
 ifndef NO_JVMTI
 	$(call QUIET_INSTALL, $(LIBJVMTI)) \
+		$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(libdir_SQ)'; \
 		$(INSTALL) $(OUTPUT)$(LIBJVMTI) '$(DESTDIR_SQ)$(libdir_SQ)';
 endif
 	$(call QUIET_INSTALL, libexec) \
Signature · 1 line
2.7.4
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Laura Abbott

The install command for libperf-jvmti.so does not check if libdir exists before installing. This means that when the install command is run:

install libperf-jvmti.so '/tmp/test_root/usr/lib64';

libperf-jvmti.so will get installed to /usr/lib64 as a file and break further installation. Fix this by ensuring the directory gets created first.

Quoted 7 lines

See https://bugzilla.redhat.com/show_bug.cgi?id=1410296

Fixes d4dfdf00d43e ("perf jvmti: Plug compilation into perf build")

---
For full disclosure, Fedora is setting NO_JVMTI but this should still be fixed to allow it to be turned on in the future.

I have patches for fedora to install that, looks like you guys are not planning to enable it, so I'll post it soon ;-)

thanks,
jirka

#2 lore raw

[tip:perf/core] perf jvmti: Create libdir directory before installing libperf-jvmti.so

In reply to Laura Abbott
perf jvmti: Create libdir directory before installing libperf-jvmti.so
Commit-ID:  cd7f355ac4067177e0a45e7331d11472bd7fd7ca
Gitweb:     http://git.kernel.org/tip/cd7f355ac4067177e0a45e7331d11472bd7fd7ca
Author:     Laura Abbott <[email protected]>
AuthorDate: Fri, 6 Jan 2017 14:18:08 -0800
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Wed, 11 Jan 2017 16:48:00 -0300

perf jvmti: Create libdir directory before installing libperf-jvmti.so

The install command for libperf-jvmti.so does not check if libdir exists before installing. This means that when the install command is run:

install libperf-jvmti.so '/tmp/test_root/usr/lib64';

libperf-jvmti.so will get installed to /usr/lib64 as a file and break further installation. Fix this by ensuring the directory gets created first.

See https://bugzilla.redhat.com/show_bug.cgi?id=1410296

Cc Alexander Shishkin <[email protected]>
Cc Peter Zijlstra <[email protected]>
Fixes d4dfdf00d43e ("perf jvmti: Plug compilation into perf build")
---
 tools/perf/Makefile.perf | 1 +
 1 file changed, 1 insertion(+)
tools/perf/Makefile.perf +1 -0
index 8bb16aa..4da19b6 100644
@@ -661,6 +661,7 @@ ifndef NO_PERF_READ_VDSOX32
 endif
 ifndef NO_JVMTI
 	$(call QUIET_INSTALL, $(LIBJVMTI)) \
+		$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(libdir_SQ)'; \
 		$(INSTALL) $(OUTPUT)$(LIBJVMTI) '$(DESTDIR_SQ)$(libdir_SQ)';
 endif
 	$(call QUIET_INSTALL, libexec) \