Skip to contentSkip to conversation

perf arm64: Fix generate system call table failed with /tmp mounted with noexec

tip:perf/urgent tip-bot for Hongxu Jia 1 participant 1 message Oct 26, 2018

Subsystems (2)
lore
Share & tools
lore

tip-bot for Hongxu Jia

author merge bot
#0 lore raw
Commit-ID:  389373d3306553896a9e218493e5b6175c844eb0
Gitweb:     https://git.kernel.org/tip/389373d3306553896a9e218493e5b6175c844eb0
Author:     Hongxu Jia <[email protected]>
AuthorDate: Thu, 18 Oct 2018 16:26:13 +0800
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Fri, 19 Oct 2018 11:56:57 -0300

perf arm64: Fix generate system call table failed with /tmp mounted with noexec

When /tmp is mounted with noexec, mksyscalltbl fails.

[snip] |perf-1.0/tools/perf/arch/arm64/entry/syscalls//mksyscalltbl:
/tmp/create-table-6VGPSt: Permission denied
[snip]

Add variable TMPDIR as prefix dir of the temporary file, if it is set, replace default /tmp.

Cc Alexander Shishkin <[email protected]>
Cc Hendrik Brueckner <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Kim Phillips <[email protected]>
Cc Michael Ellerman <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Ravi Bangoria <[email protected]>
Cc Sébastien Boisvert <[email protected]>
Cc Thomas Richter <[email protected]>
Fixes 2b5882435606 ("perf arm64: Generate system call table from asm/unistd.h")

LPU-Reference: [email protected]

---
 tools/perf/arch/arm64/entry/syscalls/mksyscalltbl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/arch/arm64/entry/syscalls/mksyscalltbl +1 -1
index 2dbb8cade048..c88fd32563eb 100755
@@ -23,7 +23,7 @@ create_table_from_c()
 {
 	local sc nr last_sc
 
-	create_table_exe=`mktemp /tmp/create-table-XXXXXX`
+	create_table_exe=`mktemp ${TMPDIR:-/tmp}/create-table-XXXXXX`
 
 	{