Skip to content

Commit

Permalink
report: Add some reporting helpers for THP
Browse files Browse the repository at this point in the history
Signed-off-by: Mel Gorman <mgorman@suse.de>
  • Loading branch information
Mel Gorman committed Jun 27, 2011
1 parent 3f0763f commit f1c8185
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 5 deletions.
19 changes: 14 additions & 5 deletions compare-huge.sh
Expand Up @@ -4,7 +4,7 @@ export SCRIPT=`basename $0 | sed -e 's/\./\\\./'`
export SCRIPTDIR=`echo $0 | sed -e "s/$SCRIPT//"`
. $SCRIPTDIR/config

SUBKERNEL=-v1r1
SUBKERNEL=-2.6.32.42-0.4-sles11sp2-20110624
FTRACE_ANALYSERS="mmtests-duration"
FTRACE_HELPER_VMSCAN=$LINUX_GIT/Documentation/trace/postprocess/trace-vmscan-postprocess.pl
FTRACE_HELPER_CONGESTION=$SCRIPTDIR/subreport/trace-congestion-postprocess.pl
Expand Down Expand Up @@ -39,13 +39,22 @@ printheader() {

for SUBREPORT in vmr-stream nas-ser nas-omp sysbench speccpu specjvm specomp; do
if [ -e $SUBREPORT$SUBKERNEL ]; then
echo ===BEGIN $SUBREPORT
if [ -e $SCRIPTDIR/subreport/largecompare-$SUBREPORT ]; then
. $SCRIPTDIR/subreport/largecompare-$SUBREPORT
fi

#for FTRACE_ANALYSER in $FTRACE_ANALYSERS; do
# FTRACE_TEST=$SUBREPORT
# . $SCRIPTDIR/subreport/$FTRACE_ANALYSER
#done
for FTRACE_ANALYSER in $FTRACE_ANALYSERS; do
FTRACE_TEST=$SUBREPORT
. $SCRIPTDIR/subreport/$FTRACE_ANALYSER
done
echo ===END $SUBREPORT
if [ "$INPUTS" != "" ]; then
echo ===INPUTS $SUBREPORT : $INPUTS
fi
if [ "$INPUTS" != "" ]; then
echo ===TITLES $SUBREPORT : $TITLES
fi

fi
done
53 changes: 53 additions & 0 deletions report/graph-compare-thp.sh
@@ -0,0 +1,53 @@
#!/bin/bash
# Plot transparent hugepage usage over time

DIRNAME=`dirname $0`
SCRIPTDIR=`cd "$DIRNAME" && pwd`
PLOT=$SCRIPTDIR/plot
. $SCRIPTDIR/../config
. $SCRIPTDIR/common-cmdline-parser.sh

for SINGLE_KERNEL in $KERNEL; do
FIRST_KERNEL=$SINGLE_KERNEL
break
done

COPY=$KERNEL
KERNEL=$FIRST_KERNEL
START=`head -1 tests-timestamp-$FIRST_KERNEL | awk '{print $3}'`
. $SCRIPTDIR/common-testname-markup.sh
KERNEL=$COPY

PLOTS=
TITLES=
for SINGLE_KERNEL in $KERNEL; do
PLOTS="$PLOTS proc-vmstat-$SINGLE_KERNEL.plot"
START=`head -1 tests-timestamp-$SINGLE_KERNEL | awk '{print $3}'`
zcat proc-vmstat-$SINGLE_KERNEL-*.gz | perl -e "\$timestamp = 0;
while (<>) {
if (/^time: ([0-9]*)/) {
\$timestamp=(\$1-$START);
}
if (/^nr_anon_transparent_hugepages ([.0-9]*)/) {
\$thp=\$1;
print \"\$timestamp \$thp\n\";
}
}" > proc-vmstat-$SINGLE_KERNEL.plot-unsorted
sort -n proc-vmstat-$SINGLE_KERNEL.plot-unsorted > proc-vmstat-$SINGLE_KERNEL.plot
rm proc-vmstat-$SINGLE_KERNEL.plot-unsorted

if [ "$TITLES" != "" ]; then
TITLES=$TITLES,
fi
TITLES="$TITLES$SINGLE_KERNEL"
done

$PLOT --thp-count \
--title "$NAME Transparent Huge Pages Count Comparison" \
--format "postscript color" \
--titles $TITLES \
--extra /tmp/$NAME-extra \
--dump \
--output $OUTPUTDIR/thp-comparison-$NAME.ps \
$PLOTS > $OUTPUTDIR/thp-comparison-$NAME.gp
echo Generated thp-comparison-$NAME.ps
10 changes: 10 additions & 0 deletions report/plot
Expand Up @@ -69,6 +69,11 @@ while [ $# -gt 0 -a "$FINISHED" != "yes" ]; do
MEMORY_USAGE=yes
shift
;;
--thp-count)
TITLE="Transparent Huge Pages"
THP=yes
shift
;;
--cpu-usage)
CPU_USAGE=yes
YRANGE=0:100
Expand Down Expand Up @@ -265,6 +270,11 @@ if [ "$MEMORY_USAGE" = "yes" ]; then
echo set xlabel \"Time Elapsed \(minutes\)\" >> $TEMP
AWK_FORMAT="<awk '{print \$1/60,\$2/1048576}' @@PLOT@@"
fi
if [ "$THP" = "yes" ]; then
echo set ylabel \"Transparent Huge Pages\" >> $TEMP
echo set xlabel \"Time Elapsed \(minutes\)\" >> $TEMP
AWK_FORMAT="<awk '{print \$1/60,\$2}' @@PLOT@@"
fi
if [ "$CPU_USAGE" = "yes" ]; then
echo set ylabel \"CPU Usage\" >> $TEMP
echo set xlabel \"Time Elapsed \(minutes\)\" >> $TEMP
Expand Down

0 comments on commit f1c8185

Please sign in to comment.