#At bzr+ssh://bk-internal.mysql.com/bzrroot/mysql-falcon/
266 Hakan Kuecuekyilmaz 2008-09-14
Added support for selective OProfile analyzes.
OProfile runs are configured via include/host_<hostname>.inc
files.
added:
dbt2/images/oprofile.gif
modified:
dbt2/dbt2.css
dbt2/include/host_caneland.inc
dbt2/include/host_fimafeng13.inc
dbt2/include/host_lu0009.inc
dbt2/include/host_nehalem-1.inc
dbt2/include/host_tor06.inc
dbt2/include/host_walldorf.inc
dbt2/weekly_dbt2_overview.php
dbt2/weekly_dbt2_overview.sh
per-file messages:
dbt2/dbt2.css
Added style for popup field of OProfile report.
dbt2/include/host_caneland.inc
Added OProfile support.
dbt2/include/host_fimafeng13.inc
Added OProfile support.
dbt2/include/host_lu0009.inc
Added OProfile support.
dbt2/include/host_nehalem-1.inc
Added OProfile support.
dbt2/include/host_tor06.inc
Added OProfile support.
dbt2/include/host_walldorf.inc
Added OProfile support.
dbt2/weekly_dbt2_overview.php
Added OProfile support.
dbt2/weekly_dbt2_overview.sh
Added OProfile support.
=== modified file 'dbt2/dbt2.css'
--- a/dbt2/dbt2.css 2008-09-13 02:51:30 +0000
+++ b/dbt2/dbt2.css 2008-09-14 06:45:50 +0000
@@ -46,6 +46,12 @@ img {
border: none;
}
+img.note {
+ margin-left: 4px;
+ padding-bottom: 0.1em;
+ vertical-align: bottom;
+}
+
.firstword {
font-variant: small-caps;
}
@@ -124,6 +130,28 @@ div.dbt2 a.popup:hover img {
width: auto;
}
+/* Popup text for OProfile report */
+div.dbt2 a span {
+ display: none;
+ height: 0px;
+ width: 0px;
+ z-index: 100;
+}
+
+div.dbt2 a:hover span {
+ background-color: #F6F6F0;
+ border: 1px dashed #7C7C82;
+ color:black;
+ display: block;
+ font-family: Courier, "Courier New", monotype;
+ font-size: 0.75em;
+ height: auto;
+ opacity: 0.9;
+ padding: 0.5em 0.7em;
+ position: absolute;
+ width: auto;
+}
+
/**
* Navigation on the page.
*/
=== added file 'dbt2/images/oprofile.gif'
Binary files a/dbt2/images/oprofile.gif 1970-01-01 00:00:00 +0000 and b/dbt2/images/oprofile.gif 2008-09-14 06:45:50 +0000 differ
=== modified file 'dbt2/include/host_caneland.inc'
--- a/dbt2/include/host_caneland.inc 2008-09-12 22:05:34 +0000
+++ b/dbt2/include/host_caneland.inc 2008-09-14 06:45:50 +0000
@@ -63,12 +63,24 @@ W_SIZE[10]='677M'
W_SIZE[20]='1.4G'
W_SIZE[100]='6.7G'
+# Which runs should be oprofile'd?
+#
+# Available levels are:
+#DO_OPROFILE[10]='008 016 032 064 099'
+#DO_OPROFILE[20]='008 016 032 064 128 192'
+#DO_OPROFILE[100]='008 016 032 064 128 192 256 499'
+DO_OPROFILE[10]=''
+DO_OPROFILE[20]=''
+DO_OPROFILE[100]=''
+
##################
# Binaries
##################
PATH="/usr/local/bin:$PATH"
PATCH=patch
MAKE=make
+OPCONTROL='sudo /usr/bin/opcontrol'
+OPREPORT='sudo /usr/bin/opreport'
# Path to mail program which accepts -s for sending mails.
MAIL=mail
=== modified file 'dbt2/include/host_fimafeng13.inc'
--- a/dbt2/include/host_fimafeng13.inc 2008-07-23 08:51:37 +0000
+++ b/dbt2/include/host_fimafeng13.inc 2008-09-14 06:45:50 +0000
@@ -61,6 +61,16 @@ W_SIZE[10]='675M'
W_SIZE[20]='1.4G'
W_SIZE[100]='6.7G'
+# Which runs should be oprofile'd?
+#
+# Available levels are:
+#DO_OPROFILE[10]='008 016 032 064 099'
+#DO_OPROFILE[20]='008 016 032 064 128 192'
+#DO_OPROFILE[100]='008 016 032 064 128 192 256 499'
+DO_OPROFILE[10]=''
+DO_OPROFILE[20]=''
+DO_OPROFILE[100]=''
+
##################
# Binaries
##################
@@ -68,6 +78,8 @@ W_SIZE[100]='6.7G'
export PATH="/opt/csw/bin:/usr/local/bin:/usr/bin:/bin:/usr/sfw/bin:/usr/sbin:/opt/SUNWspro/bin:/usr/ucb:/usr/ccs/bin:$PATH"
export PATCH=gpatch
export MAKE=gmake
+OPCONTROL='sudo /usr/bin/opcontrol'
+OPREPORT='sudo /usr/bin/opreport'
# Path to mail program which accepts -s for sending mails.
MAIL=/usr/ucb/mail
=== modified file 'dbt2/include/host_lu0009.inc'
--- a/dbt2/include/host_lu0009.inc 2008-09-12 22:05:34 +0000
+++ b/dbt2/include/host_lu0009.inc 2008-09-14 06:45:50 +0000
@@ -63,12 +63,24 @@ W_SIZE[10]='677M'
W_SIZE[20]='1.4G'
W_SIZE[100]='6.7G'
+# Which runs should be oprofile'd?
+#
+# Available levels are:
+#DO_OPROFILE[10]='008 016 032 064 099'
+#DO_OPROFILE[20]='008 016 032 064 128 192'
+#DO_OPROFILE[100]='008 016 032 064 128 192 256 499'
+DO_OPROFILE[10]=''
+DO_OPROFILE[20]=''
+DO_OPROFILE[100]=''
+
##################
# Binaries
##################
PATH="/usr/local/bin:$PATH"
PATCH=patch
MAKE=make
+OPCONTROL='sudo /usr/bin/opcontrol'
+OPREPORT='sudo /usr/bin/opreport'
# Path to mail program which accepts -s for sending mails.
MAIL=mail
=== modified file 'dbt2/include/host_nehalem-1.inc'
--- a/dbt2/include/host_nehalem-1.inc 2008-09-12 23:44:54 +0000
+++ b/dbt2/include/host_nehalem-1.inc 2008-09-14 06:45:50 +0000
@@ -65,12 +65,24 @@ W_SIZE[10]='677M'
W_SIZE[20]='1.4G'
W_SIZE[100]='6.7G'
+# Which runs should be oprofile'd?
+#
+# Available levels are:
+#DO_OPROFILE[10]='008 016 032 064 099'
+#DO_OPROFILE[20]='008 016 032 064 128 192'
+#DO_OPROFILE[100]='008 016 032 064 128 192 256 499'
+DO_OPROFILE[10]=''
+DO_OPROFILE[20]=''
+DO_OPROFILE[100]=''
+
##################
# Binaries
##################
PATH="/usr/local/bin:$PATH"
PATCH=patch
MAKE=make
+OPCONTROL='sudo /usr/bin/opcontrol'
+OPREPORT='sudo /usr/bin/opreport'
# Path to mail program which accepts -s for sending mails.
MAIL=mail
=== modified file 'dbt2/include/host_tor06.inc'
--- a/dbt2/include/host_tor06.inc 2008-07-23 08:51:37 +0000
+++ b/dbt2/include/host_tor06.inc 2008-09-14 06:45:50 +0000
@@ -61,6 +61,15 @@ W_SIZE[10]='675M'
W_SIZE[20]='1.4G'
W_SIZE[100]='6.7G'
+# Which runs should be oprofile'd?
+#
+# Available levels are:
+#DO_OPROFILE[10]='008 016 032 064 099'
+#DO_OPROFILE[20]='008 016 032 064 128 192'
+#DO_OPROFILE[100]='008 016 032 064 128 192 256 499'
+DO_OPROFILE[10]=''
+DO_OPROFILE[20]=''
+DO_OPROFILE[100]=''
##################
# Binaries
@@ -69,6 +78,8 @@ W_SIZE[100]='6.7G'
export PATH="/opt/csw/bin:/usr/local/bin:/usr/bin:/bin:/usr/sfw/bin:/usr/sbin:/opt/SUNWspro/bin:/usr/ucb:/usr/ccs/bin:$PATH"
export PATCH=gpatch
export MAKE=gmake
+OPCONTROL='sudo /usr/bin/opcontrol'
+OPREPORT='sudo /usr/bin/opreport'
# Path to mail program which accepts -s for sending mails.
MAIL=/usr/ucb/mail
=== modified file 'dbt2/include/host_walldorf.inc'
--- a/dbt2/include/host_walldorf.inc 2008-09-12 22:05:34 +0000
+++ b/dbt2/include/host_walldorf.inc 2008-09-14 06:45:50 +0000
@@ -63,12 +63,24 @@ W_SIZE[10]='677M'
W_SIZE[20]='1.4G'
W_SIZE[100]='6.7G'
+# Which runs should be oprofile'd?
+#
+# Available levels are:
+#DO_OPROFILE[10]='008 016 032 064 099'
+#DO_OPROFILE[20]='008 016 032 064 128 192'
+#DO_OPROFILE[100]='008 016 032 064 128 192 256 499'
+DO_OPROFILE[10]=''
+DO_OPROFILE[20]='032 128'
+DO_OPROFILE[100]=''
+
##################
# Binaries
##################
PATH="/usr/local/bin:$PATH"
PATCH=patch
MAKE=make
+OPCONTROL='sudo /usr/bin/opcontrol'
+OPREPORT='sudo /usr/bin/opreport'
# Path to mail program which accepts -s for sending mails.
MAIL=mail
=== modified file 'dbt2/weekly_dbt2_overview.php'
--- a/dbt2/weekly_dbt2_overview.php 2008-09-13 02:51:30 +0000
+++ b/dbt2/weekly_dbt2_overview.php 2008-09-14 06:45:50 +0000
@@ -42,39 +42,64 @@ if (count($directories) == $numbers_miss
}
if (DEBUG) {
- echo '<pre>';
+ echo '<pre>' . "\n";
var_dump($numbers);
- echo '</pre>';
+ echo '</pre>' . "\n";
+ echo '<br />' . "\n";
}
-// Get gnuplot graphs of each run.
-$pattern = "/(^FALCON|^INNODB)_[0-9]{4}-[0-9]{2}-[0-9]{2}_([0-9]{1,3})_([0-9]{1,3}).png/";
-/* $matches[1] $matches[2] $matches[3] */
+// Get gnuplot graphs and oprofile reports.
+$pattern_gnuplot = "/(^FALCON|^INNODB)_[0-9]{4}-[0-9]{2}-[0-9]{2}_([0-9]{1,3})_([0-9]{1,3}).png/";
+/* $matches[1] $matches[2] $matches[3] */
+$pattern_oprofile = "/(^FALCON_OPROFILE|^INNODB_OPROFILE)_[0-9]{4}-[0-9]{2}-[0-9]{2}_([0-9]{1,3})_([0-9]{1,3}).log/";
+/* $matches[1] $matches[2] $matches[3] */
foreach ($directories as $data) {
$graphs[$data] = array();
+ $oprofiles[$data] = array();
if ($dir = @opendir(DBT2_LOG_DIR . "/$data")) {
while (($file_name = readdir($dir)) !== false) {
- if ($file_name != '.' && $file_name != '..'
- && strpos($file_name, '.png')) {
- if (preg_match($pattern, $file_name, $matches)) {
- if (strlen($matches[2]) == 1) $matches[2] = '00' . $matches[2];
- if (strlen($matches[2]) == 2) $matches[2] = '0' . $matches[2];
+ if ($file_name != '.' && $file_name != '..') {
+ // Gnuplot graphs.
+ if (strpos($file_name, '.png')) {
+ if (preg_match($pattern_gnuplot, $file_name, $matches)) {
+ if (strlen($matches[2]) == 1) $matches[2] = '00' . $matches[2];
+ if (strlen($matches[2]) == 2) $matches[2] = '0' . $matches[2];
- $key = $matches[1] . '_' . $matches[2];
- $i = ($tmp = $matches[3] % RUNS) ? $tmp : RUNS;
- $graphs[$data][$key][$i] = $file_name;
+ $key = $matches[1] . '_' . $matches[2];
+ $i = ($tmp = $matches[3] % RUNS) ? $tmp : RUNS;
+ $graphs[$data][$key][$i] = $file_name;
+ }
+ }
+
+ // OProfile reports.
+ if (strpos($file_name, 'OPROFILE')) {
+ if (preg_match($pattern_oprofile, $file_name, $matches)) {
+ if (strlen($matches[2]) == 1) $matches[2] = '00' . $matches[2];
+ if (strlen($matches[2]) == 2) $matches[2] = '0' . $matches[2];
+
+ $key = $matches[1] . '_' . $matches[2];
+ $i = ($tmp = $matches[3] % RUNS) ? $tmp : RUNS;
+ $oprofiles[$data][$key][$i] = $file_name;
+ }
}
}
}
}
ksort($graphs[$data]);
+ ksort($oprofiles[$data]);
}
if (DEBUG) {
- echo '<pre>';
+ echo '<pre>' . "\n";
var_dump($graphs);
- echo '</pre>';
+ echo '</pre>' . "\n";
+ echo '<br />' . "\n";
+
+ echo '<pre>' . "\n";
+ var_dump($oprofiles);
+ echo '</pre>' . "\n";
+ echo '<br />' . "\n";
}
// Check for crashes in err/ directories.
@@ -104,9 +129,10 @@ foreach ($directories as $data) {
}
}
if (DEBUG) {
- echo '<pre>';
+ echo '<pre>' . "\n";
var_dump($error_files);
- echo '</pre>';
+ echo '</pre>' . "\n";
+ echo '<br />' . "\n";
}
// Make list of older runs.
@@ -122,9 +148,10 @@ if ($dir = opendir('../')) {
}
}
if (DEBUG) {
- echo '<pre>';
+ echo '<pre>' . "\n";
var_dump($old_runs);
- echo '</pre>';
+ echo '</pre>' . "\n";
+ echo '<br />' . "\n";
}
// Make list of CPU utilization from stats.out files.
@@ -139,9 +166,10 @@ foreach ($directories as $data) {
}
}
if (DEBUG) {
- echo '<pre>';
+ echo '<pre>' . "\n";
var_dump($cpu);
- echo '</pre>';
+ echo '</pre>' . "\n";
+ echo '<br />' . "\n";
}
// Sample HTML rows from raw data.
@@ -156,10 +184,11 @@ foreach ($directories as $data) {
foreach ($falcon_keys[$data] as $key) {
$number = zero_if_not_set($key, $numbers[$data], $i);
$image = zero_if_not_set($key, $graphs[$data], $i + 1);
+ $op = zero_if_not_set(str_replace('_', '_OPROFILE_', $key), $oprofiles[$data], $i +1);
$error = zero_if_not_set($key, $error_files[$data], $i + 1);
if ($error) {
- $error = '<a href="./' . $data . '/' . $error . '"><img src="./images/process-stop.png" /></a>';
+ $error = '<a href="./' . $data . '/' . $error . '"><img src="./images/process-stop.png" class="note" /></a>';
} else {
$error = '';
}
@@ -171,6 +200,12 @@ foreach ($directories as $data) {
$image = $number . $error;
}
+ if ($op) {
+ $op_text = '<pre>' . file_get_contents('./' . $data . '/' . $op) . '</pre>';
+ $image = $image . '<a href="./' . $data . '/'. $op . '">'
+ . '<img src="./images/oprofile.gif" class="note" /><span>' . $op_text . '</span></a>';
+ }
+
$falcon[$data][$i] .= '<td>' . $image . '</td>' . "\n";
$user = (array_key_exists($i, $cpu[$data][$key]['user'])) ? $cpu[$data][$key]['user'][$i] : '&ndash';
@@ -182,21 +217,28 @@ foreach ($directories as $data) {
foreach ($innodb_keys[$data] as $key) {
$number = zero_if_not_set($key, $numbers[$data], $i);
$image = zero_if_not_set($key, $graphs[$data], $i + 1);
+ $op = zero_if_not_set(str_replace('_', '_OPROFILE_', $key), $oprofiles[$data], $i +1);
$error = zero_if_not_set($key, $error_files[$data], $i + 1);
if ($error) {
- $error = '<a href="./' . $data . '/' . $error . '" title="' . $error_message . '"><img src="./images/process-stop.png" /></a>';
+ $error = '<a href="./' . $data . '/' . $error . '"><img src="./images/process-stop.png" class="note" /></a>';
} else {
$error = '';
}
if ($image) {
$image = '<a href="./' . $data . '/' . $image . '" class="popup">' . $number
- . '<img src="./' . $data . '/'. $image . '" /></a>' . $error;
+ . ' <img src="./' . $data . '/'. $image . '" /></a>' . $error;
} else {
$image = $number . $error;
}
+ if ($op) {
+ $op_text = '<pre>' . file_get_contents('./' . $data . '/' . $op) . '</pre>';
+ $image = $image . '<a href="./' . $data . '/'. $op . '">'
+ . '<img src="./images/oprofile.gif" class="note" /><span>' . $op_text . '</span></a>';
+ }
+
$innodb[$data][$i] .= '<td>' . $image . '</td>' . "\n";
$user = (array_key_exists($i, $cpu[$data][$key]['user'])) ? $cpu[$data][$key]['user'][$i] : '&ndash';
@@ -207,9 +249,10 @@ foreach ($directories as $data) {
}
}
if (DEBUG) {
- echo '<pre>';
+ echo '<pre>' . "\n";
var_dump($falcon_cpu);
- echo '</pre>';
+ echo '</pre>' . "\n";
+ echo '<br />' . "\n";
}
foreach ($directories as $data) {
@@ -262,11 +305,18 @@ foreach ($directories as $data) {
}
if (DEBUG) {
- echo '<pre>';
+ echo '<pre>' . "\n";
var_dump($falcon);
+ echo '<br />' . "\n";
+
var_dump($innodb);
+ echo '<br />' . "\n";
+
var_dump($per_cent);
- echo '</pre>';
+ echo '<br />' . "\n";
+
+ echo '</pre>' . "\n";
+ echo '<br />' . "\n";
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
=== modified file 'dbt2/weekly_dbt2_overview.sh'
--- a/dbt2/weekly_dbt2_overview.sh 2008-09-12 22:05:34 +0000
+++ b/dbt2/weekly_dbt2_overview.sh 2008-09-14 06:45:50 +0000
@@ -394,13 +394,25 @@ for ENGINE in FALCON INNODB
for i in ${CONCURRENCY[$WAREHOUSES]}
do
LOG_FILE=$DBT2_RUNS/w$WAREHOUSES/"$ENGINE"_"$CONTROL_TIMESTAMP"_"$i".log
+
+ # Check whether we want an oprofile'd run.
+ USE_OPROFILE=0
+ for j in ${DO_OPROFILE[$WAREHOUSES]}
+ do
+ if [ x"$j" = x"$i" ]; then
+ USE_OPROFILE=1
+ OPROFILE_LOG_FILE=$DBT2_RUNS/w$WAREHOUSES/"$ENGINE"_OPROFILE_"$CONTROL_TIMESTAMP"_"$i"
+ break
+ fi
+ done
+
echo "$RUNS runs with $ENGINE -c$i -w$WAREHOUSES -t$RUN_TIME" > $LOG_FILE
CURRENT_IO_STATS=$DBT2_IO_STATS/"$ENGINE"_"$i"
mkdir $CURRENT_IO_STATS
- j=0
- while ( [ $j -lt $RUNS ] )
+ k=0
+ while ( [ $k -lt $RUNS ] )
do
killall_dbt2_processes
sleep 3
@@ -452,12 +464,29 @@ for ENGINE in FALCON INNODB
sync
sleep 45
+ if [ $USE_OPROFILE -eq 1 ]; then
+ $OPCONTROL --shutdown
+ sleep 1
+ $OPCONTROL --init
+ sleep 1
+ $OPCONTROL --start --no-vmlinux
+ sleep 1
+ fi
+
cd $DBT2_SCRIPTS
# Remove leading zeros from concurrency level.
CON=$(echo $i | sed -e 's/0*//')
./run_mysql.sh -c$CON -s250 -t$RUN_TIME -w$WAREHOUSES -ntest -o/tmp/mysql.sock -uroot -e -v
sleep 3
+ if [ $USE_OPROFILE -eq 1 ]; then
+ $OPCONTROL --dump
+ $OPCONTROL --stop
+ $OPREPORT --demangle=smart --merge=tgid --symbols --threshold 0.5 $MYSQLD > ${OPROFILE_LOG_FILE}_${ROUND}.log
+ $OPCONTROL --reset
+ $OPCONTROL --shutdown
+ fi
+
${PERL} mix_analyzer.pl --infile output/$ROUND/driver/mix.log --outdir /tmp | grep new-order >> $LOG_FILE
# Copy iostat and vmstat of this round.
@@ -477,7 +506,7 @@ for ENGINE in FALCON INNODB
chmod -R 755 $DBT2_ERROR_LOGS
ROUND=$(($ROUND + 1))
- j=$(($j + 1))
+ k=$(($k + 1))
done
done
done