Commit 65d25d2e authored by Johnny Jazeix's avatar Johnny Jazeix

Change the version of the trunk. Pass on 1.2. In Tools.cpp add a condition on...

Change the version of the trunk. Pass on 1.2. In Tools.cpp add a condition on the time (because does not exist with mingw, need to find the good function for it). Fix a bug with the OTF parser. Remove set_depth method of container because useless (depth is set in the constructor using its father one). ParserViTE fixed.
parent 647401b2
......@@ -31,7 +31,7 @@ PROJECT_NAME = ViTE
# This could be handy for archiving the generated documentation or
# if some version control system is used.
PROJECT_NUMBER = 1.1
PROJECT_NUMBER = 1.2
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
# base path where the generated documentation will be put.
......
This is ViTE version 1.0.
This is ViTE version 1.2.
ViTE is a C++ Visual Trace Explorer using Qt for viewing.
......
......@@ -111,7 +111,7 @@ SET(VITE_HDRS
parser/ParserDefinitionPaje.hpp
parser/ParserEventPaje.hpp
parser/ParserPaje.hpp
# parser/ParserVite.hpp
parser/ParserVite.hpp
# Statistics headers
statistics/Stats_window.hpp
statistics/Statistic.hpp
......@@ -188,7 +188,7 @@ SET(VITE_SRCS
parser/ParserDefinitionPaje.cpp
parser/ParserEventPaje.cpp
parser/ParserPaje.cpp
# parser/ParserVite.cpp
parser/ParserVite.cpp
# Statistics code files
statistics/Statistic.cpp
statistics/Stats_window.cpp
......
......@@ -110,7 +110,7 @@ double clockGet (void)
return (((double) data.ru_utime.tv_sec + (double) data.ru_stime.tv_sec) +
((double) data.ru_utime.tv_usec + (double) data.ru_stime.tv_usec) *
1.0e-6L);
#else
#elif defined _POSIX_TIMERS
struct timespec tp;
clock_gettime (CLOCK_REALTIME, &tp); /* Elapsed time */
......
......@@ -80,9 +80,31 @@
*
*/
typedef struct PajeLine {
int _id ;
int _nbtks;
char **_tokens;
int _id;
int _nbtks;
char **_tokens;
PajeLine() {}
PajeLine(const PajeLine &cp) {
_id = cp._id;
_nbtks = cp._nbtks;
_tokens = new char*[_nbtks];
for(int i = 0 ; i < _nbtks ; i ++) {
_tokens[i] = new char[strlen(cp._tokens[i])+1];
strcpy(_tokens[i], cp._tokens[i]);
}
}
void free_mem() { //! Only useful because of the constructor copy and for ParserVite. Should be erased when multithreading will be done.
for(int i = 0 ; i < _nbtks ; i ++) {
delete[] _tokens[i];
_tokens[i] = NULL;
}
delete[] _tokens;
_tokens = NULL;
}
} PajeLine_t;
......
......@@ -56,9 +56,7 @@
/* -- */
#include "parser/Parser.hpp"
#include "parser/ParserPaje.hpp"
#ifdef DEADCODE
#include "parser/ParserVite.hpp"
#endif // DEADCODE
#ifdef WITH_OTF
#include <otf.h>
#include "parser/ParserOTF.hpp"
......@@ -85,11 +83,9 @@ bool ParserFactory::create(Parser **parser,
if(ext == ".trace") {
*parser = new ParserPaje(filename);
}
#ifdef DEADCODE
else if(ext == ".ept") {
*parser = new ParserVite(filename);
}
#endif
else if(ext == ".otf") {
#ifdef WITH_OTF
*parser = new ParserOTF(filename);
......
......@@ -89,6 +89,11 @@ void ParserOTF::parse(Trace &trace,
delete parserdefinition;
delete parserevent;
OTF_FileManager_close(manager);
finish();
if(finish_trace_after_parse) { // true by default
trace.finish();
}
return;
}
......
......@@ -135,3 +135,7 @@ float ParserPaje::get_percent_loaded() const {
else
return 0.;
}
ParserDefinitionPaje *ParserPaje::get_parser_def() const {
return _ParserDefinition;
}
......@@ -93,6 +93,11 @@ public:
*/
float get_percent_loaded() const;
/*!
* Return the parser of definitions.
*
*/
ParserDefinitionPaje *get_parser_def() const;
};
#endif // PARSERPAJE_HPP
......@@ -67,12 +67,13 @@
#include "parser/PajeDefinition.hpp"
#include "parser/ParserPaje.hpp"
#include "parser/ParserEventPaje.hpp"
#include "parser/ParserDefinitionPaje.hpp"
/* -- */
using namespace std;
ParserVite::ParserVite() {};
ParserVite::ParserVite(const std::string &filename) : Parser(filename) {};
ParserVite::~ParserVite() {};
ParserVite::ParserVite() {}
ParserVite::ParserVite(const std::string &filename) : Parser(filename) {}
ParserVite::~ParserVite() {}
void ParserVite::parse(Trace &trace,
bool finish_trace_after_parse){
......@@ -82,25 +83,20 @@ void ParserVite::parse(Trace &trace,
string eventstr;
int eventid;
map<unsigned int, PajeDefinition> definitions;
PajeDefinition def;
ParserPaje *parserpaje = new ParserPaje(_file_to_parse);
ParserEventPaje *parserevent;
PajeDefinition *def;
ParserPaje parserpaje(_file_to_parse);
int i, nblnks;
// Parse the first file with definitions
try {
parserpaje->parse(trace, false);
parserpaje.parse(trace, false);
}
catch(...) {
finish();
trace.finish();
delete parserpaje;
return ;
}
definitions = *parserpaje->get_definitions();
// We get the directory name
QFileInfo fileinfo(QString::fromStdString(_file_to_parse));
QDir directory = fileinfo.absoluteDir();
......@@ -124,8 +120,8 @@ void ParserVite::parse(Trace &trace,
containers.pop();
extra_fields = c->get_extra_fields();
field = extra_fields->find(string("Filename"));
// Search the filename
if (field != extra_fields->end()) {
filename_String = (String *)(*field).second;
name = QString::fromStdString(filename_String->to_string());
......@@ -144,13 +140,15 @@ void ParserVite::parse(Trace &trace,
}
}
/*const*/ ParserDefinitionPaje *parser_defs = parserpaje.get_parser_def();
ParserEventPaje parserevent(parser_defs);
QStringList::const_iterator it_end = file_event_names.constEnd();
for (QStringList::const_iterator it = file_event_names.constBegin() ; it != it_end ; ++ it) {
string event_filename = (directory.absolutePath()+QDir::separator()+(*it)).toStdString();
ParserEventPaje *parserevent = new ParserEventPaje();
fileman.open(event_filename.c_str());
// Open the subfile
......@@ -179,54 +177,46 @@ void ParserVite::parse(Trace &trace,
Error::set(Error::_EXPECT_ID_DEF, line._id, Error::_WARNING);
continue;
}
try {
def = definitions[eventid];
}
catch (unsigned int) {
Error::set(Error::_UNKNOWN_ID_DEF + line._tokens[0], line._id, Error::_WARNING);
continue;
}
try {
def = parser_defs->getDefFromTrid(eventid);
}
catch (unsigned int) {
Error::set(Error::_UNKNOWN_ID_DEF + line._tokens[0], line._id, Error::_WARNING);
continue;
}
// If it is a end link we wait for the begin (PajeStartLink)
if(def.get_event_name() == "PajeEndLink") {
// WARNING Don't work like this, PajeLine structure doesn't store the file line
_end_link.push_back(line);
continue;
if(strcmp(def->_name, "PajeEndLink") == 0) {
// WARNING Don't work like this, PajeLine structure doesn't store the file line
_end_link.push_back(line);
continue;
}
parserevent->store_event(def, &line, trace);
parserevent.store_event(&line, trace);
}
}
fileman.close();
delete parserevent;
}
// We end the links
parserevent = new ParserEventPaje();
nblnks = _end_link.size();
// WARNING Don't work like this, PajeLine structure doesn't store the file line
// This work is already done, the parserevent should keep the endlink
for(i = 0 ; i < nblnks ; i ++) {
line = _end_link[i];
sscanf(line._tokens[0], "%u", &eventid);
def = definitions[eventid];
parserevent->store_event(def, &line, trace);
parserevent.store_event(&line, trace);
line.free_mem();
}
delete parserevent;
finish();
if(finish_trace_after_parse) {
trace.finish();
}
delete parserpaje;
}
float ParserVite::get_percent_loaded() const{
......
......@@ -54,8 +54,8 @@ TARGET = vite
macx:QMAKE_LIBS_OPENGL += -framework -lobjc
DEPENDPATH += .
INCLUDEPATH += .
QMAKE_CFLAGS += -O3 -fPIC -Wall
QMAKE_CXXFLAGS += -O3 -fPIC -Wall
QMAKE_CFLAGS += -O2 -Wall
QMAKE_CXXFLAGS += -O2 -Wall
#TRANSLATIONS = ViTE_fr.ts
......@@ -103,7 +103,7 @@ HEADERS += common/common.hpp \
parser/ParserDefinitionPaje.hpp \
parser/ParserEventPaje.hpp \
parser/ParserPaje.hpp \
# parser/ParserVite.hpp \
parser/ParserVite.hpp \
# Data structure headers
trace/Container.hpp \
trace/ContainerType.hpp \
......@@ -194,7 +194,7 @@ SOURCES += common/Message.cpp \
parser/ParserDefinitionPaje.cpp \
parser/ParserEventPaje.cpp \
parser/ParserPaje.cpp \
# parser/ParserVite.cpp \
parser/ParserVite.cpp \
# Render code files
render/Palette.cpp \
render/Geometry.cpp \
......
......@@ -413,10 +413,6 @@ void browse_stat_link(const Container * cont, Statistic * S, Interval I){
browse_stat_link(cont->get_parent(), S, I);
}
void Container::set_depth(int depth){
_depth = depth;
}
int Container::get_depth(){
return _depth;
}
......
......@@ -325,14 +325,6 @@ public:
* \brief Fill the stat element with the corresponding data to be displayed
*/
void fill_stat(Statistic * stat, Interval I);
/*!
* \fn set_depth()
* \brief The depth of the current container.
*
* The depth argument specify the depth of the current container. It should be set by the trace instance which store the container.
*/
void set_depth(int depth);
/*!
* \fn get_depth()
......
......@@ -167,10 +167,8 @@ void Trace::create_container(Date &time, Name &name, ContainerType *type, Contai
Container *cont = new Container(name, time, type, parent, opt);
if (parent){
cont->set_depth(parent->get_depth()+1);
parent->add_child(cont);
} else {
cont->set_depth(0);
_root_containers.push_back(cont);
}
......
.TH VITE "1" "April 2009" "Version 1.0" "ViTE Manual Pages"
.TH VITE "1" "April 2009" "Version 1.2" "ViTE Manual Pages"
\fB..___________...\fP_
.br
\fB__\fPvXXX\fB=========\fPonn\fB=\fPXX\fB=\fPX\fB=\fPs\fB_.\fP.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment