📄 compare-runs.prl
字号:
} } # Non-idle speedup # ################ $tag = $setTags[$i][0]; $normTag = $tag; $normLength = $x_cur{$tag}{'Wallclock'}{'T'} - $x_cur{$tag}{'Wallclock'}{'I'} ; @srcFields = ('L1d-Time','L2d-Time','Upg-Time','L1i-Time','L2i-Time','Instr-Time','Pipe-Time'); @dstFields = ('L1d-NIS','L2d-NIS','L2-NIS','L1i-NIS','L2i-NIS','Instr-NIS','Pipe-NIS'); @dst2 = ('Mem-NIS','Mem-NIS','Mem-NIS','Mem-NIS','Mem-NIS','CPU-NIS','CPU-NIS'); @dst3 = ('Mem-ratio','Mem-ratio','Mem-ratio','Mem-ratio','Mem-ratio','CPU-ratio','CPU-ratio'); for $j (0..$numSets-1) { $tag = $setTags[$i][$j]; if( $normLength > 0 ) { foreach $mode ('K','U','S','T') { for $f (0..$#dstFields) { $x_cur{$tag}{$dstFields[$f]}{$mode} = 0; } for $f ('CPU-NIS','Mem-NIS','CPU-ratio','Mem-ratio') { $x_cur{$tag}{$f}{$mode} = 0; } } for $f (0..$#srcFields) { foreach $mode ('K','U') { if( !defined($x_cur{$tag}{$srcFields[$f]}{$mode})) { print STDERR "Not defined \$x_cur{$tag}{$srcFields[$f]}{$mode} \n"; } if( !defined($x_cur{$normTag}{'Wallclock'}{$mode})) { print STDERR "Not def: \$x_cur{$normTag}{'Wallclock'}{$mode}\n"; } if( $x_cur{$normTag}{'Wallclock'}{$mode} > 0 ) { $x_cur{$tag}{$dstFields[$f]}{$mode} += ($x_cur{$tag}{'Wallclock'}{$mode} / $x_cur{$normTag}{'Wallclock'}{$mode}) * $x_cur{$tag}{$srcFields[$f]}{$mode}; } $x_cur{$tag}{$dstFields[$f]}{'T'} += ($x_cur{$tag}{'Wallclock'}{$mode} / $normLength) * $x_cur{$tag}{$srcFields[$f]}{$mode}; $x_cur{$tag}{$dst2[$f]}{$mode} += ($x_cur{$tag}{'Wallclock'}{$mode} / $normLength) * $x_cur{$tag}{$srcFields[$f]}{$mode}; $x_cur{$tag}{$dst3[$f]}{$mode} += ($x_cur{$tag}{'Wallclock'}{$mode} / ($x_cur{$tag}{'Wallclock'}{'T'} -$x_cur{$tag}{'Wallclock'}{'I'} )) * $x_cur{$tag}{$srcFields[$f]}{$mode}; } } $x_cur{$tag}{'Sync-ratio'}{'T'} = 100 * $x_cur{$tag}{'Wallclock'}{'S'} / ($x_cur{$tag}{'Wallclock'}{'T'} -$x_cur{$tag}{'Wallclock'}{'I'} ) } } }# #################################################### Latency hiding# ##################################################if( 0 && defined($hidingRun) ) { $i = 0; for $j (0..$numSets-1) { $tag1 = $setTags[$i][$j]; $tag2 = $setTags[$i][$j+$numSets]; foreach $f (@stallBreakdown) { foreach $mode (@modes) { if( $x_stall{$tag1}{$f}{$mode}==0 ) { $x_stallR{$tag1}{$f}{$mode} = 0; } else { $x_stallR{$tag1}{$f}{$mode} = 100 * $x_stall{$tag1}{$f}{$mode} / $x_stall{$tag2}{$f}{$mode}; } } } }}# #################################################################### output goes to make-barchart.prl # ###################################################################if( $output eq "bar" ) { # simple test#print "check = $x_cur{'comp-94'}{'L1i-MCPI'}{'K'} \n"; print "GROUPS $numGroups\n"; print "SETS $numSets\n"; printf("SECTIONS %d\n",$#keyText+1); print "GROUP_LABELS ",join(" ",@groupLabels),"\n"; print "SET_LABELS ",join(" ",@setLabels),"\n"; print "SECTION_LABELS ",join(" ",@keyText)," \n"; print "EXTRA_GROUP_SPACE ",join(" ",@extra_space)," \n"; if (defined(@keyXPos)) { print "KEY_XPOS ", join(" ",@keyXPos)," \n"; } if (defined($no_x_stagger)) { print "NO_X_STAGGER\n"; } if (defined($set_label_alignment)) { print "SET_LABEL_ALIGNMENT $set_label_alignment\n"; } if (defined(@separate_sections)) { print "SEPARATE_SECTIONS ", join(" ",@separate_sections)," \n"; } if (defined(@topSetLabels)) { print "TOP_SET_LABELS ", join(" ",@topSetLabels)," \n"; } if (defined($sets_per_superset)) { print "SETS_PER_SUPERSET $sets_per_superset\n"; } if (defined($num_supersets)) { print "NUM_SUPERSETS $num_supersets\n"; } if (defined(@superSetLabels)) { print "SUPERSET_LABELS ", join(" ",@superSetLabels)," \n"; } if (defined($newGraphHeight)) { print "NEW_HEIGHT $newGraphHeight\n"; } # if (defined($numSuperGroups)) {# print "NUM_SUPER_GROUPS $numSuperGroups\n";# }# if (defined($barsPerSuperGroup)) {# print "BARS_PER_SUPER_GROUP $barsPerSuperGroup\n";# }# if (defined(@superGroupLabels)) {# print "SUPER_GROUP_LABELS ", join(" ",@superGroupLabels)," \n";# } print "X_LABEL $xlabel\n"; print "Y_LABEL $ylabel\n"; print "TITLE $title\n"; $maxval = 0; for $i (0..$numGroups-1) { for $j (0..$numSets-1) { $cumul = 0; print "D $i $j "; $tag = $setTags[$i][$j]; foreach $k (0..$#keyText) { if( defined($keyModesGroup[$i][$k] )) { $mode = $keyModesGroup[$i][$k]; } else { $mode = $keyModes[$k]; if( !defined($mode) ) { print STDERR "\NotDef: \$keyModes[$k] \n"; } } if( defined($hidingRun)) { if( !defined($keyModes[$k])) { print STDERR "NotDef \$keyModes[$k] \n"; } if( !defined($x_cur{$tag}{$keyFields[$i]}{$mode})) { print STDERR "NotDef \$x_cur{$tag}{$keyFields[$i]}{$mode}\n"; } $val0 = $x_cur{$tag}{$keyFields[$i]}{$mode}; if( $k==0 ) { $val = $val0; } else { $val = $x_cur{$setTags[$i][$j+$offset]}{$keyFields[$i]}{$mode}-$val0; } printf("%f ",$val); $cumul += $val; } else { $val = $x_cur{$tag}{$keyFields[$k]}{$mode}; if( !defined($val) ) { print STDERR "Not defined \$x_cur{$tag}{$keyFields[$k]}{$mode} \n"; } else { printf("%f ",$val); $cumul += $val; } } } print "\n"; if( $cumul > $maxval) {$maxval = $cumul;} } }# printf("MAXY %f\n",1.1 * $maxval); if( defined($fixedMaxVal) ) { printf("MAXY %f\n", $fixedMaxVal); } else { printf("MAXY %f\n", $maxval*1.0); }}# ####################################################################### output goes to mif-tables.prl# use group 0 only# #######################################################################if( $output eq "mif" ) { print "\$mifTable{'tableFormat'} = 'Format A';\n"; print "\$mifTable{'cols'} = $numGroups+1;\n"; print "\$mifTable{'caption'} = $title;\n"; print "\$mifCol[0]{'width'} = 1.2;\n"; for $i (1..$numGroups) { print "\$mifCol[$i]{'width'} = 0.625;\n"; } for $i (0..$numGroups-1) { print "\$mifHeaderCell[$i+1]{'text'} = '$groupLabels[$i]';\n"; } print "\n;"; $j = 0; $numEntries = 0; foreach $k (0..$#keyText) { print "\$mifBodyCell[$numEntries]{'alignment'} = 'Left';\n"; print "\$mifBodyCell[$numEntries]{'text'} = '$keyText[$k]';\n"; $numEntries++; foreach $i (0..$numGroups-1) { if( defined($keyModesGroup[$i][$k] )) { $mode = $keyModesGroup[$i][$k]; } else { $mode = $keyModes[$k]; } $tag = $setTags[$i][$j]; $val = $x_cur{$tag}{$keyFields[$k]}{$mode}; if( !defined($val) ) { print STDERR "Not defined \$x_cur{$tag}{$keyFields[$k]}{$keyModes[$k]} \n"; $val = 0; } else { $val = sprintf("%1.1f",$val); } print "\$mifBodyCell[$numEntries]{'text'} = $val;\n"; $numEntries++; } print "\n"; } print "return 1;\n";}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -