Commit 8609aad1 authored by Mathieu Faverge's avatar Mathieu Faverge

Fix bug in usage of the Name constructor with undefined aliases in OTF and Tau parsers

parent b42d6ffc
......@@ -108,7 +108,7 @@ int OTFTraceBuilderThread::handler_begin_process(OTF_Trace_builder_struct* tb_st
map<string, Value *> extra_fields;
Date d = (double)tb_struct->time/(double)ParserDefinitionOTF::get_ticks_per_second();
Name n = Name(current_process._name, "");
Name n = Name(current_process._name);
ContainerType *process_container_type = t->search_container_type(String(process_group._name));
Container *parent_container = t->search_container(String(process_parent._name));
......@@ -197,7 +197,7 @@ int OTFTraceBuilderThread::handler_enter (OTF_Trace_builder_struct* tb_struct) {
}
if(temp_state_type == 0) {
Name name_temp(temp_function_group._name, "");
Name name_temp(temp_function_group._name);
t->define_state_type(name_temp, temp_container_type, extra_fields);
temp_state_type = t->search_state_type(function_group_name);
}
......@@ -205,7 +205,7 @@ int OTFTraceBuilderThread::handler_enter (OTF_Trace_builder_struct* tb_struct) {
if(!temp_function._is_defined) {
temp_function._is_defined = true;
Name name_temp(temp_function._name, "");
Name name_temp(temp_function._name);
map<string, Value *> opt;
/* Optional fields */
......@@ -302,7 +302,7 @@ int OTFTraceBuilderThread::handler_counter(OTF_Trace_builder_struct* tb_struct)
}
if(temp_variable_type == 0) {
Name name_temp(temp_counter_group._name, "");
Name name_temp(temp_counter_group._name);
t->define_variable_type(name_temp, temp_container_type, extra_fields);
temp_variable_type = t->search_variable_type(counter_group_name);
}
......@@ -344,7 +344,7 @@ int OTFTraceBuilderThread::handler_marker(OTF_Trace_builder_struct* tb_struct) {
String str_eventType(temp_marker._name);
String str_event(tb_struct->text);
Name n(tb_struct->text, "");
Name n(tb_struct->text);
EventType *event_type = t->search_event_type(str_eventType);
ProcessGroup process_group = ParserDefinitionOTF::get_processgroup_by_process(tb_struct->process);
......@@ -361,7 +361,7 @@ int OTFTraceBuilderThread::handler_marker(OTF_Trace_builder_struct* tb_struct) {
}
if(event_type == 0) {
Name name_temp(temp_marker._name, "");
Name name_temp(temp_marker._name);
t->define_event_type(name_temp, temp_container_type, extra_fields);
event_type = t->search_event_type(str_eventType);
}
......@@ -414,7 +414,7 @@ int OTFTraceBuilderThread::handler_send_message (OTF_Trace_builder_struct* tb_st
link_type_oss << tb_struct->type;
String link_type_string = String(link_type_oss.str());
Name name_temp = Name(name, "");
Name name_temp = Name(name);
LinkType *link_type = t->search_link_type(link_type_string);
Container *source_container = NULL;
......@@ -459,7 +459,7 @@ int OTFTraceBuilderThread::handler_send_message (OTF_Trace_builder_struct* tb_st
}
if(link_type == 0) {
Name link_name = Name(link_type_oss.str(), "");
Name link_name = Name(link_type_oss.str());
t->define_link_type(link_name, ancestor_type, destination_type, destination_type, opt);
link_type = t->search_link_type(link_type_string);
}
......@@ -538,7 +538,7 @@ int OTFTraceBuilderThread::handler_receive_message (OTF_Trace_builder_struct* tb
link_type_oss << tb_struct->type;
String link_type_string = String(link_type_oss.str());
Name name_temp = Name(name, "");
Name name_temp = Name(name);
LinkType *link_type = t->search_link_type(link_type_string);
Container *destination_cont = NULL;
......@@ -581,7 +581,7 @@ int OTFTraceBuilderThread::handler_receive_message (OTF_Trace_builder_struct* tb
}
if(link_type == 0) {
Name link_name = Name(link_type_oss.str(), "");
Name link_name = Name(link_type_oss.str());
t->define_link_type(link_name, ancestor_type, destination_type, destination_type, opt);
link_type = t->search_link_type(link_type_string);
}
......
......@@ -171,7 +171,7 @@ int ParserEventOTF::handler_Enter( void* userData,
}
if(temp_state_type == 0) {
Name name_temp(temp_function_group._name, "");
Name name_temp(temp_function_group._name);
t->define_state_type(name_temp, temp_container_type, extra_fields);
temp_state_type = t->search_state_type(function_group_name);
}
......@@ -179,7 +179,7 @@ int ParserEventOTF::handler_Enter( void* userData,
if(!temp_function._is_defined) {
temp_function._is_defined = true;
Name name_temp(temp_function._name, "");
Name name_temp(temp_function._name);
map<string, Value *> opt;
/* Optional fields */
......@@ -291,7 +291,7 @@ int ParserEventOTF::handler_SendMsg( void* userData,
link_type_oss << type;
String link_type_string = String(link_type_oss.str());
Name name_temp = Name(name, "");
Name name_temp = Name(name);
LinkType *link_type = t->search_link_type(link_type_string);
Container *source_container = NULL;
......@@ -334,7 +334,7 @@ int ParserEventOTF::handler_SendMsg( void* userData,
}
if(link_type == 0) {
Name link_name = Name(link_type_oss.str(), "");
Name link_name = Name(link_type_oss.str());
t->define_link_type(link_name, ancestor_type, destination_type, destination_type, opt);
link_type = t->search_link_type(link_type_string);
}
......@@ -420,7 +420,7 @@ int ParserEventOTF::handler_RecvMsg( void* userData,
link_type_oss << type;
String link_type_string = String(link_type_oss.str());
Name name_temp = Name(name, "");
Name name_temp = Name(name);
LinkType *link_type = t->search_link_type(link_type_string);
Container *destination_cont = NULL;
......@@ -461,7 +461,7 @@ int ParserEventOTF::handler_RecvMsg( void* userData,
}
if(link_type == 0) {
Name link_name = Name(link_type_oss.str(), "");
Name link_name = Name(link_type_oss.str());
t->define_link_type(link_name, ancestor_type, destination_type, destination_type, opt);
link_type = t->search_link_type(link_type_string);
}
......@@ -627,7 +627,7 @@ int ParserEventOTF::handler_BeginProcess( void* userData,
map<string, Value *> extra_fields;
Date d = (double)time/(double)ParserDefinitionOTF::get_ticks_per_second();
Name n = Name(current_process._name, "");
Name n = Name(current_process._name);
ContainerType *process_container_type = t->search_container_type(String(process_group._name));
Container *parent_container = t->search_container(String(process_parent._name));
......@@ -823,7 +823,7 @@ int ParserEventOTF::handler_Marker(void *trace,
String str_eventType(temp_marker._name);
String str_event(text);
Name n(text, "");
Name n(text);
EventType *event_type = t->search_event_type(str_eventType);
ProcessGroup process_group = ParserDefinitionOTF::get_processgroup_by_process(proc_id);
......@@ -840,7 +840,7 @@ int ParserEventOTF::handler_Marker(void *trace,
}
if(event_type == 0) {
Name name_temp(temp_marker._name, "");
Name name_temp(temp_marker._name);
t->define_event_type(name_temp, temp_container_type, extra_fields);
event_type = t->search_event_type(str_eventType);
}
......
......@@ -6,13 +6,13 @@
** use, modify and/or redistribute the software under the terms of the
** CeCILL-A license as circulated by CEA, CNRS and INRIA at the following
** URL: "http://www.cecill.info".
**
**
** As a counterpart to the access to the source code and rights to copy,
** modify and redistribute granted by the license, users are provided
** only with a limited warranty and the software's author, the holder of
** the economic rights, and the successive licensors have only limited
** liability.
**
**
** In this respect, the user's attention is drawn to the risks associated
** with loading, using, modifying and/or developing or reproducing the
** software by the user in light of its specific status of free software,
......@@ -23,7 +23,7 @@
** their requirements in conditions enabling the security of their
** systems and/or data to be ensured and, more generally, to use and
** operate it in the same conditions as regards security.
**
**
** The fact that you are presently reading this means that you have had
** knowledge of the CeCILL-A license and that you accept its terms.
**
......@@ -37,13 +37,13 @@
** - MARCOUEILLE Jule
** - NOISETTE Pascal
** - REDONDY Arthur
** - VUCHENER Clément
** - VUCHENER Clément
**
*/
/**
* @file ParserOTF.cpp
*
* @author Lagrasse Olivier
* @author Lagrasse Olivier
* @author Johnny Jazeix
* @author Mathieu Faverge
*
......@@ -81,8 +81,8 @@ ParserOTF::ParserOTF() {};
ParserOTF::ParserOTF(const string &filename) : Parser(filename) {}
ParserOTF::~ParserOTF() {};
void ParserOTF::parse(Trace &trace,
bool finish_trace_after_parse) {
void ParserOTF::parse(Trace &trace,
bool finish_trace_after_parse) {
ParserDefinitionOTF *parserdefinition;
ParserEventOTF *parserevent;
......@@ -119,8 +119,8 @@ void ParserOTF::parse(Trace &trace,
parserevent->set_number_event_read_by_each_pass(reader, 10000);
parserevent->set_handlers(&trace);
while ( ((ret = parserevent->read_events(reader)) != 0)
&& (!_is_canceled)) {
while ( ((ret = parserevent->read_events(reader)) != 0)
&& (!_is_canceled)) {
if(ret == -1) {
cerr << QObject::tr("Error while reading events. Aborting").toStdString() << endl;
break;
......
......@@ -6,13 +6,13 @@
** use, modify and/or redistribute the software under the terms of the
** CeCILL-A license as circulated by CEA, CNRS and INRIA at the following
** URL: "http://www.cecill.info".
**
**
** As a counterpart to the access to the source code and rights to copy,
** modify and redistribute granted by the license, users are provided
** only with a limited warranty and the software's author, the holder of
** the economic rights, and the successive licensors have only limited
** liability.
**
**
** In this respect, the user's attention is drawn to the risks associated
** with loading, using, modifying and/or developing or reproducing the
** software by the user in light of its specific status of free software,
......@@ -23,7 +23,7 @@
** their requirements in conditions enabling the security of their
** systems and/or data to be ensured and, more generally, to use and
** operate it in the same conditions as regards security.
**
**
** The fact that you are presently reading this means that you have had
** knowledge of the CeCILL-A license and that you accept its terms.
**
......@@ -37,7 +37,7 @@
** - MARCOUEILLE Jule
** - NOISETTE Pascal
** - REDONDY Arthur
** - VUCHENER Clément
** - VUCHENER Clément
**
*/
......@@ -134,7 +134,7 @@ int mt_ParserEventOTF::handler_BeginProcess( void* trace,
_tb_struct[_n_read].process=process;
_tb_struct[_n_read].func=OTFTraceBuilderThread::handler_begin_process;
_n_read++;
//emit my_address->signal_handler_begin_process(trace,time,process);
return OTF_RETURN_OK;
......@@ -150,7 +150,7 @@ int mt_ParserEventOTF::handler_EndProcess( void* userData,
_tb_struct[_n_read].process=proc_id;
_tb_struct[_n_read].func=OTFTraceBuilderThread::handler_end_process;
_n_read++;
//emit my_address->signal_handler_end_process (trace,time, proc_id);
return OTF_RETURN_OK;
}
......@@ -161,7 +161,7 @@ int mt_ParserEventOTF::handler_Enter( void* userData,
uint32_t func_id,
uint32_t proc_id,
uint32_t /*source*/,
OTF_KeyValueList */*list*/ )
OTF_KeyValueList */*list*/ )
{
_tb_struct[_n_read].trace=userData;
_tb_struct[_n_read].time=time;
......@@ -202,12 +202,12 @@ int mt_ParserEventOTF::handler_Counter( void* userData,
}
int mt_ParserEventOTF::handler_DefMarker(void *,
uint32_t stream,
uint32_t id,
const char *name,
int mt_ParserEventOTF::handler_DefMarker(void *,
uint32_t stream,
uint32_t id,
const char *name,
uint32_t type,
OTF_KeyValueList */*list*/ )
OTF_KeyValueList */*list*/ )
{
_tb_struct[_n_read].process=stream;
_tb_struct[_n_read].process2=id;
......@@ -220,10 +220,10 @@ int mt_ParserEventOTF::handler_DefMarker(void *,
}
int mt_ParserEventOTF::handler_Marker(void *userData,
uint64_t time,
uint32_t proc_id,
uint32_t id,
int mt_ParserEventOTF::handler_Marker(void *userData,
uint64_t time,
uint32_t proc_id,
uint32_t id,
const char *text,
OTF_KeyValueList */*list*/ )
{
......@@ -271,7 +271,7 @@ int mt_ParserEventOTF::handler_RecvMsg( void* userData,
uint32_t type,
uint32_t length,
uint32_t source,
OTF_KeyValueList */*list*/ )
OTF_KeyValueList */*list*/ )
{
_tb_struct[_n_read].trace=userData;
_tb_struct[_n_read].time=time;
......
......@@ -6,13 +6,13 @@
** use, modify and/or redistribute the software under the terms of the
** CeCILL-A license as circulated by CEA, CNRS and INRIA at the following
** URL: "http://www.cecill.info".
**
**
** As a counterpart to the access to the source code and rights to copy,
** modify and redistribute granted by the license, users are provided
** only with a limited warranty and the software's author, the holder of
** the economic rights, and the successive licensors have only limited
** liability.
**
**
** In this respect, the user's attention is drawn to the risks associated
** with loading, using, modifying and/or developing or reproducing the
** software by the user in light of its specific status of free software,
......@@ -23,7 +23,7 @@
** their requirements in conditions enabling the security of their
** systems and/or data to be ensured and, more generally, to use and
** operate it in the same conditions as regards security.
**
**
** The fact that you are presently reading this means that you have had
** knowledge of the CeCILL-A license and that you accept its terms.
**
......@@ -37,7 +37,7 @@
** - MARCOUEILLE Jule
** - NOISETTE Pascal
** - REDONDY Arthur
** - VUCHENER Clément
** - VUCHENER Clément
**
*/
......@@ -76,8 +76,8 @@ mt_ParserOTF::mt_ParserOTF() {};
mt_ParserOTF::mt_ParserOTF(const string &filename) : Parser(filename) {}
mt_ParserOTF::~mt_ParserOTF() {};
void mt_ParserOTF::parse(Trace &trace,
bool finish_trace_after_parse) {
void mt_ParserOTF::parse(Trace &trace,
bool finish_trace_after_parse) {
ParserDefinitionOTF *parserdefinition;
......@@ -91,9 +91,9 @@ void mt_ParserOTF::parse(Trace &trace,
/* OTF_MasterControl* mc;
mc = OTF_MasterControl_new( manager );
OTF_MasterControl_read( mc, _file_to_parse.c_str());
uint32_t streamcount = OTF_MasterControl_getCount( mc );
printf("nb of streams %d\n", streamcount);*/
OTF_Reader *reader;
......@@ -104,7 +104,7 @@ void mt_ParserOTF::parse(Trace &trace,
cerr << QObject::tr(VITE_ERR_OTF_FILEMANAGER).toStdString() << endl;
return;
}
int n_events=10000;
OTF_Trace_builder_struct* tb_structs= new OTF_Trace_builder_struct[n_events];
parserevent2->connect((const QObject*)this,
......@@ -113,10 +113,10 @@ void mt_ParserOTF::parse(Trace &trace,
parserevent2->connect((const QObject*)this,
SIGNAL(build_finished()),
SLOT(build_finished()));
QThread traceThread;
QThread traceThread;
parserevent2->moveToThread(&traceThread);
traceThread.start();
reader = OTF_Reader_open(_file_to_parse.c_str(), manager);
if(reader == NULL) {
cerr << QObject::tr(VITE_ERR_OTF_OPENREADER).toStdString() << endl;
......@@ -128,21 +128,21 @@ void mt_ParserOTF::parse(Trace &trace,
}
return;
}
parserdefinition = new ParserDefinitionOTF();
parserdefinition->set_handlers(&trace);
parserdefinition->read_definitions(reader);
parserdefinition->create_container_types(&trace);
//parserdefinition->print_definitions();
parserevent = new mt_ParserEventOTF();
parserevent->set_number_event_read_by_each_pass(reader, n_events);
parserevent->set_handlers(&trace);
int n_read=0;
while ( ((ret = parserevent->read_events(reader, tb_structs, &n_read)) != 0)
&& (!_is_canceled)) {
while ( ((ret = parserevent->read_events(reader, tb_structs, &n_read)) != 0)
&& (!_is_canceled)) {
if(ret == -1) {
cerr << QObject::tr("Error while reading events. Aborting").toStdString() << endl;
break;
......@@ -152,37 +152,37 @@ void mt_ParserOTF::parse(Trace &trace,
linesProduced.release();
tb_structs= new OTF_Trace_builder_struct[n_events];
}
freeSlots.acquire(); //do not produce too fast (5 blocks max at a time)
emit(build_trace(n_read, tb_structs));
linesProduced.release();
//tb_structs= NULL;
//same thing for markers
tb_structs= new OTF_Trace_builder_struct[n_events];
while ( ((ret=parserevent->read_markers(reader, tb_structs,&n_read)) != 0)
&& (!_is_canceled)) {
freeSlots.acquire(); //do not produce too fast (5 blocks max at a time)
while ( ((ret=parserevent->read_markers(reader, tb_structs,&n_read)) != 0)
&& (!_is_canceled)) {
freeSlots.acquire(); //do not produce too fast (5 blocks max at a time)
emit(build_trace(n_read, tb_structs));
linesProduced.release();
tb_structs= new OTF_Trace_builder_struct[n_events];
}
freeSlots.acquire(); //do not produce too fast (5 blocks max at a time)
emit(build_trace(n_read, tb_structs));
linesProduced.release();
finish();
if(finish_trace_after_parse) { // true by default
trace.finish();
}
QMutexLocker locker(&mutex);
emit build_finished();
ended.wait(&mutex);
locker.unlock();
emit build_finished();
ended.wait(&mutex);
locker.unlock();
traceThread.quit();
traceThread.wait();
delete parserevent;
......
......@@ -103,7 +103,7 @@ void ParserTau::parse(Trace &trace, bool finish_trace_after_parse) {
/* Creation of the ContainerType. Just one? */
// Create the container type
Name name("threads", "");
Name name("threads");
map<std::string, Value *> extra_fields;
trace.define_container_type(name, NULL, extra_fields);
......@@ -177,7 +177,7 @@ int ParserTau::enter_state (void *trace, double time, unsigned int nodeid, unsig
const String state_name = String(current_state._name);
const String state_group_name = String(current_state_group._name);
Name name_container(current_proc._name, "");
Name name_container(current_proc._name);
Container *current_container = t->search_container(current_proc._name);
Container *parent_container = NULL; /* Always in Tau or set to nodeId? -> can be a tree */
......@@ -189,7 +189,7 @@ int ParserTau::enter_state (void *trace, double time, unsigned int nodeid, unsig
/* Creation of the containerType if not exist */
if(!process_container_type) {
Name container_type_name("threads", "");
Name container_type_name("threads");
t->define_container_type(container_type_name, NULL, extra_fields);
process_container_type = t->search_container_type(String("threads"));
}
......@@ -203,7 +203,7 @@ int ParserTau::enter_state (void *trace, double time, unsigned int nodeid, unsig
/* Creation of the stategroup (StateType) if not exist */
if(!state_type) {
Name state_type_name(current_state_group._name, "");
Name state_type_name(current_state_group._name);
t->define_state_type(state_type_name, process_container_type, extra_fields);
state_type = t->search_state_type(current_state_group._name);
}
......@@ -211,7 +211,7 @@ int ParserTau::enter_state (void *trace, double time, unsigned int nodeid, unsig
/* Creation of the state if not exist */
if(!current_state._is_created) {
current_state._is_created = true;
Name name_temp(current_state._name, "");
Name name_temp(current_state._name);
map<string, Value *> opt;
t->define_entity_value(name_temp, t->search_entity_type(state_group_name), opt);
}
......@@ -274,7 +274,7 @@ int ParserTau::event_triggered(void *trace, double time, unsigned int nodeToken,
/* Creation if needed */
if(event_type == NULL) {
Name event_type_name(current_event._name, "");
Name event_type_name(current_event._name);
ContainerType *container_type = t->search_container_type(String("threads"));
t->define_event_type(event_type_name, container_type, opt);
event_type = t->search_event_type(event_name);
......@@ -320,7 +320,7 @@ int ParserTau::send_message (void *trace, double time, unsigned int sourceNodeTo
/* Creation if needed */
if(link_type == NULL) {
Name link_type_name(current_link.str(), "");
Name link_type_name(current_link.str());
map<string, Value *> opt;
t->define_link_type(link_type_name, container_type, container_type, container_type, opt);
link_type = t->search_link_type(current_link.str());
......@@ -373,7 +373,7 @@ int ParserTau::receive_message (void *trace, double time, unsigned int sourceNod
/* Creation if needed */
if(link_type == NULL) {
Name link_type_name(current_link.str(), "");
Name link_type_name(current_link.str());
map<string, Value *> opt;
t->define_link_type(link_type_name, container_type, container_type, container_type, opt);
link_type = t->search_link_type(current_link.str());
......
......@@ -6,13 +6,13 @@
** use, modify and/or redistribute the software under the terms of the
** CeCILL-A license as circulated by CEA, CNRS and INRIA at the following
** URL: "http://www.cecill.info".
**
**
** As a counterpart to the access to the source code and rights to copy,
** modify and redistribute granted by the license, users are provided
** only with a limited warranty and the software's author, the holder of
** the economic rights, and the successive licensors have only limited
** liability.
**
**
** In this respect, the user's attention is drawn to the risks associated
** with loading, using, modifying and/or developing or reproducing the
** software by the user in light of its specific status of free software,
......@@ -23,7 +23,7 @@
** their requirements in conditions enabling the security of their
** systems and/or data to be ensured and, more generally, to use and
** operate it in the same conditions as regards security.
**
**
** The fact that you are presently reading this means that you have had
** knowledge of the CeCILL-A license and that you accept its terms.
**
......@@ -37,7 +37,7 @@
** - MARCOUEILLE Jule
** - NOISETTE Pascal
** - REDONDY Arthur
** - VUCHENER Clément
** - VUCHENER Clément
**
*/
/*!
......@@ -216,7 +216,7 @@ public:
* \param finish_trace_after_parse boolean set if we do not have to finish the trace after parsing
*/
void parse(Trace &trace, bool finish_trace_after_parse = true);
/*!
* \fn get_percent_loaded() const
* \brief return the size of the file already read.
......@@ -227,4 +227,3 @@ public:
};
#endif // PARSERTAU_HPP
......@@ -6,13 +6,13 @@
** use, modify and/or redistribute the software under the terms of the
** CeCILL-A license as circulated by CEA, CNRS and INRIA at the following
** URL: "http://www.cecill.info".
**
**
** As a counterpart to the access to the source code and rights to copy,
** modify and redistribute granted by the license, users are provided
** only with a limited warranty and the software's author, the holder of
** the economic rights, and the successive licensors have only limited
** liability.
**
**
** In this respect, the user's attention is drawn to the risks associated
** with loading, using, modifying and/or developing or reproducing the
** software by the user in light of its specific status of free software,
......@@ -23,7 +23,7 @@
** their requirements in conditions enabling the security of their
** systems and/or data to be ensured and, more generally, to use and
** operate it in the same conditions as regards security.
**
**
** The fact that you are presently reading this means that you have had
** knowledge of the CeCILL-A license and that you accept its terms.
**
......@@ -37,7 +37,7 @@
** - MARCOUEILLE Jule
** - NOISETTE Pascal
** - REDONDY Arthur
** - VUCHENER Clément
** - VUCHENER Clément
**
*/
/*!
......@@ -59,7 +59,7 @@ namespace Tau {
unsigned int _thread_id;
std::string _name;
bool _is_created;
/*!
* \fn Container(unsigned int node_id = 0, unsigned int thread_id = 0, const std::string name = "")
* \brief Constructor
......@@ -69,7 +69,7 @@ namespace Tau {
*/
Container(unsigned int node_id = 0, unsigned int thread_id = 0, const std::string name = "") : _node_id(node_id), _thread_id(thread_id), _name(name), _is_created(false) {}
};
/*!
* \struct State
* \brief Represents a Tau state
......@@ -114,7 +114,7 @@ namespace Tau {
unsigned int _id;
std::string _name;
unsigned int _monotonically_increasing;
/*!
* \fn Event(unsigned int id = 0, const std::string name = "", unsigned int monotonicallyIncreasing = 0)
* \brief Constructor
......
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