* [PATCH] perf: archive: correct cutting of symbolic link
@ 2012-04-02 6:28 Chanho Park
2012-04-15 8:38 ` [tip:perf/urgent] perf archive: Correct " tip-bot for Chanho Park
0 siblings, 1 reply; 2+ messages in thread
From: Chanho Park @ 2012-04-02 6:28 UTC (permalink / raw)
To: a.p.zijlstra, paulus, mingo, acme
Cc: linux-kernel, linux-perf-users, Chanho Park, Kyungmin Park
If a '$PERF_BUILDID_DIR'(typically $HOME/.debug) is a symbolic
link directory, cutting of the path will be failed.
Here is an example where a buildid directory is a symbolic link.
/ # ls -al /root
lrwxrwxrwx 1 root root 13 Mar 26 2012 /root -> opt/home/root
/ # cd ~
/opt/home/root # perf record -a -g sleep 1
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.322 MB perf.data (~14057 samples) ]
/opt/home/root # perf archive
tar: Removing leading `/' from member names
Now please run:
$ tar xvf perf.data.tar.bz2 -C ~/.debug
wherever you need to run 'perf report' on.
/opt/home/root # mkdir temp
/opt/home/root # tar xf perf.data.tar.bz2 -C ./temp
/opt/home/root # find ./temp -name "*kernel*"
./temp/opt/home/root/.debug/[kernel.kallsyms]
-> If successfully cut off the path, [kernel.kallsyms] is located
in top of the archived file.
This patch enables to cut correctly even if the buildid directory
is a symbolic link.
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
tools/perf/perf-archive.sh | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/tools/perf/perf-archive.sh b/tools/perf/perf-archive.sh
index 677e59d..95b6f8b 100644
--- a/tools/perf/perf-archive.sh
+++ b/tools/perf/perf-archive.sh
@@ -29,13 +29,14 @@ if [ ! -s $BUILDIDS ] ; then
fi
MANIFEST=$(mktemp /tmp/perf-archive-manifest.XXXXXX)
+PERF_BUILDID_LINKDIR=$(readlink -f $PERF_BUILDID_DIR)/
cut -d ' ' -f 1 $BUILDIDS | \
while read build_id ; do
linkname=$PERF_BUILDID_DIR.build-id/${build_id:0:2}/${build_id:2}
filename=$(readlink -f $linkname)
echo ${linkname#$PERF_BUILDID_DIR} >> $MANIFEST
- echo ${filename#$PERF_BUILDID_DIR} >> $MANIFEST
+ echo ${filename#$PERF_BUILDID_LINKDIR} >> $MANIFEST
done
tar cfj $PERF_DATA.tar.bz2 -C $PERF_BUILDID_DIR -T $MANIFEST
--
1.7.5.4
^ permalink raw reply [flat|nested] 2+ messages in thread
* [tip:perf/urgent] perf archive: Correct cutting of symbolic link
2012-04-02 6:28 [PATCH] perf: archive: correct cutting of symbolic link Chanho Park
@ 2012-04-15 8:38 ` tip-bot for Chanho Park
0 siblings, 0 replies; 2+ messages in thread
From: tip-bot for Chanho Park @ 2012-04-15 8:38 UTC (permalink / raw)
To: linux-tip-commits
Cc: acme, linux-kernel, paulus, mingo, hpa, mingo, a.p.zijlstra,
chanho61.park, kyungmin.park, tglx
Commit-ID: e3b6193378e8549d04849eda496129f94406ed36
Gitweb: http://git.kernel.org/tip/e3b6193378e8549d04849eda496129f94406ed36
Author: Chanho Park <chanho61.park@samsung.com>
AuthorDate: Mon, 2 Apr 2012 15:28:29 +0900
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Sat, 14 Apr 2012 13:52:15 -0300
perf archive: Correct cutting of symbolic link
If a '$PERF_BUILDID_DIR'(typically $HOME/.debug) is a symbolic link
directory, cutting of the path will fail.
Here is an example where a buildid directory is a symbolic link.
/ # ls -al /root
lrwxrwxrwx 1 root root 13 Mar 26 2012 /root -> opt/home/root
/ # cd ~
/opt/home/root # perf record -a -g sleep 1
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.322 MB perf.data (~14057 samples) ]
/opt/home/root # perf archive
tar: Removing leading `/' from member names
Now please run:
$ tar xvf perf.data.tar.bz2 -C ~/.debug
wherever you need to run 'perf report' on.
/opt/home/root # mkdir temp
/opt/home/root # tar xf perf.data.tar.bz2 -C ./temp
/opt/home/root # find ./temp -name "*kernel*"
./temp/opt/home/root/.debug/[kernel.kallsyms]
-> If successfully cut off the path, [kernel.kallsyms] is located
in top of the archived file.
This patch enables to cut correctly even if the buildid directory
is a symbolic link.
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1333348109-12598-1-git-send-email-chanho61.park@samsung.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/perf-archive.sh | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/tools/perf/perf-archive.sh b/tools/perf/perf-archive.sh
index 677e59d..95b6f8b 100644
--- a/tools/perf/perf-archive.sh
+++ b/tools/perf/perf-archive.sh
@@ -29,13 +29,14 @@ if [ ! -s $BUILDIDS ] ; then
fi
MANIFEST=$(mktemp /tmp/perf-archive-manifest.XXXXXX)
+PERF_BUILDID_LINKDIR=$(readlink -f $PERF_BUILDID_DIR)/
cut -d ' ' -f 1 $BUILDIDS | \
while read build_id ; do
linkname=$PERF_BUILDID_DIR.build-id/${build_id:0:2}/${build_id:2}
filename=$(readlink -f $linkname)
echo ${linkname#$PERF_BUILDID_DIR} >> $MANIFEST
- echo ${filename#$PERF_BUILDID_DIR} >> $MANIFEST
+ echo ${filename#$PERF_BUILDID_LINKDIR} >> $MANIFEST
done
tar cfj $PERF_DATA.tar.bz2 -C $PERF_BUILDID_DIR -T $MANIFEST
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-04-15 8:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-02 6:28 [PATCH] perf: archive: correct cutting of symbolic link Chanho Park
2012-04-15 8:38 ` [tip:perf/urgent] perf archive: Correct " tip-bot for Chanho Park
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome