linux/tools/perf/perf-archive.sh
<<
n va6.3/spa 6.3/form 6.3a n va6. href="../linux+v33.1.2/tools/perf/perf-archive.sh">n va6.3img src="../.static/gfx/right.png" alt=">>">n 3/spa n 3spa class="lxr_search">n va ="+search" method="post" onsubmit="return do_search(this);">n va6.3input typn> hidden" namn> navtarget" ption> ">n va6.3input typn> text" namn> search" id> search">n va6.3butt submit">Searchn va6.Prefs 6.3/a>n 3/spa va6. .3/div va6. .3form ac > ="ajax+*" method="post" onsubmit="return false;">n 3input typn> hidden" namn> ajax_lookup" id> ajax_lookup" ption> ">nva6. .3/form nva6. .3div class="headingbott
search_results" class="search_results" 6 va6. .3/div 3div id> content"> 3div id> file_contents"
a4/db/5173d490e566bd562cc1ebaddd808d14be95_3/0" 
L1" class="line" namn>
L1">. .13/a>#!/bin/bash

L2" class="line" namn>
L2">. .23/a># perf archive

L3" class="line" namn>
L3">. .33/a># Arnaldo Carptiho de Melo <acme@redhat.com>

L4" class="line" namn>
L4">. .43/a>n
L5" class="line" namn>
L5">. .53/a>PERF_DATA=perf.datan
L6" class="line" namn>
L6">. .63/a>if [ $# -ne 0 ] ; thenn
L7" class="line" namn>
L7">. .73/a>        PERF_DATA=$1n
L8" class="line" namn>
L8">. .83/a>fin
L9" class="line" namn>
L9">. .93/a>n
L10" class="line" namn>
L10">. 3.8.a>#n
L11" class="line" namn>
L11">. 113/a># PERF_BUILDID_DIR environment ptriable set by perfn
L12" class="line" namn>
L12">. 123/a># path to buildid directory, default to $HOME/.debugn
L13" class="line" namn>
L13">. 138.a>#n
L14" class="line" namn>
L14">. 143/a>if [ -z $PERF_BUILDID_DIR ]; thenn
L15" class="line" namn>
L15">. 153/a>        PERF_BUILDID_DIR=~/.debug/n
L16" class="line" namn>
L16">. 163/a>elsen
L17" class="line" namn>
L17">. 173/a>        # append / to make substitu  >
s workn
L18" class="line" namn>
L18">. 183/a>        PERF_BUILDID_DIR=$PERF_BUILDID_DIR/n
L19" class="line" namn>
L19">. 193/a>fin
L20" class="line" namn>
L20">. 203/a>n
L21" class="line" namn>
L21">. 213/a>BUILDIDS=$(mktemp /tmp/perf-archive-buildids.XXXXXX)n
L22" class="line" namn>
L22">. 223/a>NOBUILDID=0000000000000000000000000000000000000000n
L23" class="line" namn>
L23">. 233/a>n
L24" class="line" namn>
L24">. 243/a>perf buildid-list -i $PERF_DATA --with-hits | grep -v "^$NOBUILDID " > $BUILDIDSn
L25" class="line" namn>
L25">. 253/a>if [ ! -s $BUILDIDS ] ; thenn
L26" class="line" namn>
L26">. 263/a>        echo "perf archive: no build-ids found"n
L27" class="line" namn>
L27">. 273/a>        rm $BUILDIDS || truen
L28" class="line" namn>
L28">. 283/a>        exit 1n
L29" class="line" namn>
L29">. 293/a>fin
L30" class="line" namn>
L30">. 303/a>n
L31" class="line" namn>
L31">. 313/a>MANIFEST=$(mktemp /tmp/perf-archive-manifest.XXXXXX)n
L32" class="line" namn>
L32">. 323/a>PERF_BUILDID_LINKDIR=$(readlink -f $PERF_BUILDID_DIR)/n
L33" class="line" namn>
L33">. 333/a>n
L34" class="line" namn>
L34">. 343/a>cut -d ' ' -f 1 $BUILDIDS | \n
L35" class="line" namn>
L35">. 353/a>while read build_id ; don
L36" class="line" namn>
L36">. 363/a>        linknamn>$PERF_BUILDID_DIR.build-id/${build_id:0:2}/${build_id:2}n
L37" class="line" namn>
L37">. 373/a>        filenamn>$(readlink -f $linknamn)n
L38" class="line" namn>
L38">. 383/a>        echo ${linknamn#$PERF_BUILDID_DIR} >> $MANIFESTn
L39" class="line" namn>
L39">. 393/a>        echo ${filenamn#$PERF_BUILDID_LINKDIR} >> $MANIFESTn
L40" class="line" namn>
L40">. 403/a>donen
L41" class="line" namn>
L41">. 413/a>n
L42" class="line" namn>
L42">. 423/a>tar cjf $PERF_DATA.tar.bz2 -C $PERF_BUILDID_DIR -T $MANIFESTn
L43" class="line" namn>
L43">. 433/a>rm $MANIFEST $BUILDIDS || truen
L44" class="line" namn>
L44">. 443/a>echo -e "Now please run:\n"n
L45" class="line" namn>
L45">. 453/a>echo -e "$ tar xvf $PERF_DATA.tar.bz2 -C ~/.debug\n"n
L46" class="line" namn>
L46">. 463/a>echo "wherever you need to run 'perf report' on."n
L47" class="line" namn>
L47">. 473/a>exit 0n
L48" class="line" namn>
L48">. 483/a>
The original LXR software by the.3a href="http://sourceforge.net/projects/lxr">LXR community3/a>, this experimental vers2lxr@linux.no3/a>. 3/div 3div class="subfooter"> lxr.linux.no kindly hosted by 3a href="http://www.redpill-linpro.no">Redpill Linpro AS3/a>, provider of Linux consulting and opera > s services since 1995. 3/div 3/body 3/html