/** * Get a trace reader for the specific file. * * If the file has not been preprocessed yet this will be done first. * * @param string File to read * @param Cost format for the reader * @return Webgrind_Reader Reader for $file */ public function getTraceReader($file, $costFormat) { $prepFile = webgrind::storageDir() . $file . $this->suffix; try { $r = new Webgrind_Reader($prepFile, $costFormat); } catch (Exception $e) { // Preprocessed file does not exist or other error Webgrind_Preprocessor::parse(webgrind::xdebugOutputDir() . $file, $prepFile); $r = new Webgrind_Reader($prepFile, $costFormat); } return $r; }