Bug 116411 - tools/perf_clean: output directory XXX does not exist. Stop.
Summary: tools/perf_clean: output directory XXX does not exist. Stop.
Status: NEW
Alias: None
Product: Tracing/Profiling
Classification: Unclassified
Component: Perf tool (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Arnaldo Carvalho de Melo
Depends on:
Reported: 2016-04-15 14:09 UTC by TJ
Modified: 2016-04-18 14:31 UTC (History)
2 users (show)

See Also:
Kernel Version: v4.6-rc3
Tree: Mainline
Regression: No

perf tools: Force subdir to be empty (2.10 KB, patch)
2016-04-17 13:38 UTC, Jiri Olsa
Details | Diff
tools build: Fix perf_clean target (1.03 KB, patch)
2016-04-18 14:31 UTC, Jiri Olsa
Details | Diff

Description TJ 2016-04-15 14:09:02 UTC
Building and then immediately cleaning in the source tree fails. Using 'remake' for extended debug info. This looks to be caused by the same issue as I reported last week in bug #116131 which affects building out-of-tree.

$ pwd

$ gitlog -n 1
806fdcc 2016-04-14 19:53:46 -0700 N Linus Torvalds Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

$ git status
On branch master
Your branch is up-to-date with 'origin/master'.

$ remake JOBS=1 V=1 tools/perf

$ remake JOBS=1 V=1 tools/perf_clean
#0  silentoldconfig at /home/all/SourceCode/linux/linux/Makefile:537
Command-line invocation:
        "remake -f ./Makefile silentoldconfig"
mkdir -p ./tools
remake LDFLAGS= MAKEFLAGS="" O=/home/all/SourceCode/linux/linux subdir=tools -C ./tools/ perf_clean
mkdir -p /home/all/SourceCode/linux/linux/tools/perf && remake O=/home/all/SourceCode/linux/linux subdir=tools/perf --no-print-directory -C perf clean
remake -C /home/all/SourceCode/linux/linux/tools/lib/traceevent/ O=/home/all/SourceCode/linux/linux/tools/perf/ clean >/dev/null
/bin/sh: 1: cd: can't cd to /home/all/SourceCode/linux/linux/tools/perf/tools/perf/
../../scripts/Makefile.include:16: *** output directory "/home/all/SourceCode/linux/linux/tools/perf/tools/perf/" does not exist.  Stop.
Makefile.perf:450: *** [/home/all/SourceCode/linux/linux/tools/perf/libtraceevent.a-clean] Error 2

#0  /home/all/SourceCode/linux/linux/tools/perf/libtraceevent.a-clean at /home/all/SourceCode/linux/linux/tools/perf/Makefile.perf:450
#1  clean at /home/all/SourceCode/linux/linux/tools/perf/Makefile.perf:628
Command-line invocation:
        "remake -f Makefile.perf --no-print-directory -j1 O=/home/all/SourceCode/linux/linux clean"
Makefile:88: *** [clean] Error 2

#0  clean at /home/all/SourceCode/linux/linux/tools/perf/Makefile:88
Command-line invocation:
        "remake O=/home/all/SourceCode/linux/linux subdir=tools/perf --no-print-directory -C perf clean"
Makefile:139: *** [perf_clean] Error 2

#0  perf_clean at /home/all/SourceCode/linux/linux/tools/Makefile:139
Command-line invocation:
        "remake LDFLAGS= MAKEFLAGS= O=/home/all/SourceCode/linux/linux subdir=tools -C ./tools/ perf_clean"
Makefile:1547: *** [tools/perf_clean] Error 2

#0  tools/perf_clean at /home/all/SourceCode/linux/linux/Makefile:1547
Command-line invocation:
        "remake JOBS=1 V=1 tools/perf_clean"
Comment 1 Jiri Olsa 2016-04-17 13:38:58 UTC
Created attachment 213171 [details]
perf tools: Force subdir to be empty

could you please test this patch, thanks
Comment 2 TJ 2016-04-17 14:04:26 UTC
Doesn't look good; many of the paths being generated are not correct, in that the base $(O) directory is being used, not $(O)/$(subdir)/

Seeing this clearly with a:

remake V=1 JOBS=1 O=../builds/amd64 tools/perf_clean

where towards the end it does:

remake O=/home/all/SourceCode/linux/builds/amd64 -C Documentation  clean
rm -f /home/all/SourceCode/linux/builds/amd64/perf-diff.xml /home/all/SourceCode/linux/builds/amd64/perf-record.xml /home/all/SourceCode/linux/builds/amd64/pe
rf-timechart.xml /home/all/SourceCode/linux/builds/amd64/perf-report.xml /home/all/SourceCode/linux/builds/amd64/perf-kvm.xml /home/all/SourceCode/linux/build
s/amd64/perf-data.xml /home/all/SourceCode/linux/builds/amd64/perf-buildid-cache.xml /home/all/SourceCode/linux/builds/amd64/perf-list.xml ...

Those paths should be /home/all/SourceCode/linux/builds/amd64/tools/perf/Documentation/
Comment 3 Jiri Olsa 2016-04-18 14:31:37 UTC
Created attachment 213251 [details]
tools build: Fix perf_clean target

how about this one.. thanks

Note You need to log in before you can comment on or make changes to this bug.