#!/bin/bash
# perf archive
# Arnaldo Carvalho de Melo <acme@redhat.com>

PERF_DATA=perf.data
if [ $# -ne 0 ] ; then
	PERF_DATA=$1
fi

#
# PERF_BUILDID_DIR environment variable set by perf
# path to buildid directory, default to $HOME/.debug
#
if [ -z $PERF_BUILDID_DIR ]; then
	PERF_BUILDID_DIR=~/.debug/
else
        # append / to make substitutions work
        PERF_BUILDID_DIR=$PERF_BUILDID_DIR/
fi

BUILDIDS=$(mktemp /tmp/perf-archive-buildids.XXXXXX)
NOBUILDID=0000000000000000000000000000000000000000

perf buildid-list -i $PERF_DATA --with-hits | grep -v "^$NOBUILDID " > $BUILDIDS
if [ ! -s $BUILDIDS ] ; then
	echo "perf archive: no build-ids found"
	rm $BUILDIDS || true
	exit 1
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_LINKDIR} >> $MANIFEST
done

tar cjf $PERF_DATA.tar.bz2 -C $PERF_BUILDID_DIR -T $MANIFEST
rm $MANIFEST $BUILDIDS || true
echo -e "Now please run:\n"
echo -e "$ tar xvf $PERF_DATA.tar.bz2 -C ~/.debug\n"
echo "wherever you need to run 'perf report' on."
exit 0
on>
</select> <input type='submit' value='switch'/></form></td></tr>
<tr><td class='sub'>net-next plumbings</td><td class='sub right'>Tobias Klauser</td></tr></table>
<table class='tabs'><tr><td>
<a href='/cgit.cgi/linux/net-next.git/'>summary</a><a href='/cgit.cgi/linux/net-next.git/refs/?id=08d85f3ea99f1eeafc4e8507936190e86a16ee8c'>refs</a><a href='/cgit.cgi/linux/net-next.git/log/include/dt-bindings/pinctrl/sun4i-a10.h'>log</a><a href='/cgit.cgi/linux/net-next.git/tree/include/dt-bindings/pinctrl/sun4i-a10.h?id=08d85f3ea99f1eeafc4e8507936190e86a16ee8c'>tree</a><a href='/cgit.cgi/linux/net-next.git/commit/include/dt-bindings/pinctrl/sun4i-a10.h?id=08d85f3ea99f1eeafc4e8507936190e86a16ee8c'>commit</a><a class='active' href='/cgit.cgi/linux/net-next.git/diff/include/dt-bindings/pinctrl/sun4i-a10.h?id=08d85f3ea99f1eeafc4e8507936190e86a16ee8c'>diff</a></td><td class='form'><form class='right' method='get' action='/cgit.cgi/linux/net-next.git/log/include/dt-bindings/pinctrl/sun4i-a10.h'>
<input type='hidden' name='id' value='08d85f3ea99f1eeafc4e8507936190e86a16ee8c'/><select name='qt'>
<option value='grep'>log msg</option>
<option value='author'>author</option>
<option value='committer'>committer</option>
<option value='range'>range</option>
</select>
<input class='txt' type='search' size='10' name='q' value=''/>
<input type='submit' value='search'/>
</form>
</td></tr></table>
<div class='path'>path: <a href='/cgit.cgi/linux/net-next.git/diff/?id=08d85f3ea99f1eeafc4e8507936190e86a16ee8c'>root</a>/<a href='/cgit.cgi/linux/net-next.git/diff/include?id=08d85f3ea99f1eeafc4e8507936190e86a16ee8c'>include</a>/<a href='/cgit.cgi/linux/net-next.git/diff/include/dt-bindings?id=08d85f3ea99f1eeafc4e8507936190e86a16ee8c'>dt-bindings</a>/<a href='/cgit.cgi/linux/net-next.git/diff/include/dt-bindings/pinctrl?id=08d85f3ea99f1eeafc4e8507936190e86a16ee8c'>pinctrl</a>/<a href='/cgit.cgi/linux/net-next.git/diff/include/dt-bindings/pinctrl/sun4i-a10.h?id=08d85f3ea99f1eeafc4e8507936190e86a16ee8c'>sun4i-a10.h</a></div><div class='content'><div class='cgit-panel'><b>diff options</b><form method='get'><input type='hidden' name='id' value='08d85f3ea99f1eeafc4e8507936190e86a16ee8c'/><table><tr><td colspan='2'/></tr><tr><td class='label'>context:</td><td class='ctrl'><select name='context' onchange='this.form.submit();'><option value='1'>1</option><option value='2'>2</option><option value='3' selected='selected'>3</option><option value='4'>4</option><option value='5'>5</option><option value='6'>6</option><option value='7'>7</option><option value='8'>8</option><option value='9'>9</option><option value='10'>10</option><option value='15'>15</option><option value='20'>20</option><option value='25'>25</option><option value='30'>30</option><option value='35'>35</option><option value='40'>40</option></select></td></tr><tr><td class='label'>space:</td><td class='ctrl'><select name='ignorews' onchange='this.form.submit();'><option value='0' selected='selected'>include</option><option value='1'>ignore</option></select></td></tr><tr><td class='label'>mode:</td><td class='ctrl'><select name='dt' onchange='this.form.submit();'><option value='0' selected='selected'>unified</option><option value='1'>ssdiff</option><option value='2'>stat only</option></select></td></tr><tr><td/><td class='ctrl'><noscript><input type='submit' value='reload'/></noscript></td></tr></table></form></div><div class='diffstat-header'><a href='/cgit.cgi/linux/net-next.git/diff/?id=08d85f3ea99f1eeafc4e8507936190e86a16ee8c'>Diffstat</a> (limited to 'include/dt-bindings/pinctrl/sun4i-a10.h')</div><table summary='diffstat' class='diffstat'>