代码拉取完成,页面将自动刷新
install-depends oprofile recode
if [ "$SAMPLE_CYCLE_FACTOR" = "" ]; then
SAMPLE_CYCLE_FACTOR=1
fi
CALLGRAPH=
if [ "$OPROFILE_REPORT_CALLGRAPH" != "" ]; then
CALLGRAPH=$OPROFILE_REPORT_CALLGRAPH
CALLGRAPH_SWITCH=--callgraph
if [ $SAMPLE_CYCLE_FACTOR -lt 15 ]; then
SAMPLE_CYCLE_FACTOR=15
fi
fi
# Create profiling hooks
PROFILE_TITLE="timer"
echo "#!/bin/bash" > monitor-pre-hook
case `uname -m` in
i?86)
echo "operf_start.sh $CALLGRAPH_SWITCH $CALLGRAPH --sample-cycle-factor $SAMPLE_CYCLE_FACTOR --event timer &" >> monitor-pre-hook
echo "echo \$! > operf.pid" >> monitor-pre-hook
export PROFILE_EVENTS=timer
;;
x86_64)
echo "operf_start.sh $CALLGRAPH_SWITCH $CALLGRAPH --sample-cycle-factor $SAMPLE_CYCLE_FACTOR --event timer &" >> monitor-pre-hook
echo "echo \$! > operf.pid" >> monitor-pre-hook
export PROFILE_EVENTS=timer
;;
ppc64)
echo "operf_start.sh $CALLGRAPH_SWITCH $CALLGRAPH --sample-cycle-factor $SAMPLE_CYCLE_FACTOR --event timer &" >> monitor-pre-hook
echo "echo \$! > operf.pid" >> monitor-pre-hook
export PROFILE_EVENTS=timer
;;
*)
echo Unrecognised architecture
exit -1
;;
esac
echo "sleep 5" >> monitor-pre-hook
echo "#!/bin/bash" > monitor-post-hook
echo 'OPERFPID=`cat operf.pid`' >> monitor-post-hook
echo "kill -SIGINT \$OPERFPID" >> monitor-post-hook
echo "while [[ -f operf.pid ]]; do sleep 1; done" >> monitor-post-hook
echo "oprofile_report.sh > \$1/oprofile-\$2-report-$PROFILE_TITLE.txt" >> monitor-post-hook
echo "rm -rf oprofile_data" >> monitor-post-hook
echo "#!/bin/bash" > monitor-cleanup-hook
echo "rm \$1/oprofile-\$2-report-$PROFILE_TITLE.txt" >> monitor-cleanup-hook
echo "#!/bin/bash" > monitor-reset
chmod u+x monitor-*
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。