Add installation script for phoronix-static.
[gcc-perf-regression-tester.git] / analyze-aggregate.R
blobab1da630a5b6ed4833dfae986ca7a209b795f185
1 #!/usr/bin/Rscript
3 # Copyright (C) 2011 Sebastian Pop <sebpop@gmail.com>.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 # GNU General Public License for more details.  A copy of this license
13 # can be downloaded from http://www.gnu.org/copyleft/gpl.html
15 # This script is used to detect performance regressions in the time
16 # series of performance reports.  The commit time is used to sort the
17 # experiments.  When several experiments are available for a given
18 # commit, they are added at adjacent times in the time series.
20 options(warn = TRUE)
22 initial.options <- commandArgs(trailingOnly = FALSE)
23 file.arg.name <- "--file="
24 script.name <- sub(file.arg.name, "", initial.options[grep(file.arg.name, initial.options)])
25 script.path <- dirname(script.name)
26 source(paste(sep="/", script.path, "analyze-core.R"))
28 args <- commandArgs(TRUE)
29 x <- as.matrix (read.table ("normalized-aggregated.txt"))
31 for (column in 2:dim (x)[2]) {
32   bmkName <- args[column - 1]
34   t1 <- as.numeric (as.vector (x[,1]))
35   x1 <- as.numeric (as.vector (x[,column]))
37   notna <- !(is.na(t1) | is.na(x1))
38   t2 <- t1[notna]
39   x2 <- x1[notna]
41   n <- noise (x2)
42   t3 <- t2[!(n$indexes)]
43   x3 <- x2[!(n$indexes)]
44   averageStddev <- mean (n$stddevs)
45   threshold <- 2.2 * averageStddev
46   
47   if (length (x3) > windowSize) {
48     globalMin <- analyzeSlowdown (t3, x3, bmkName, threshold, averageStddev)
49     doPlot (t3, x3, bmkName, globalMin, averageStddev)
50   }
53 warnings ()