Mise à jour terminée. Pour connaître les apports de la version 13.8.4 par rapport à notre ancienne version vous pouvez lire les "Release Notes" suivantes :
https://about.gitlab.com/releases/2021/02/11/security-release-gitlab-13-8-4-released/
https://about.gitlab.com/releases/2021/02/05/gitlab-13-8-3-released/

Commit 03a65cdb authored by Mathieu Faverge's avatar Mathieu Faverge

Support new naming convention in Paje, the old one is still supported

parent 205d4f05
......@@ -82,23 +82,32 @@
* the need of the user.
*/
#define FIELDNAME_SIZEMAX 32
#define FIELDNAME_SIZE 16
#define FIELDNAME_SIZE 14
#define _PajeFN_Time 0
#define _PajeFN_Name 1
#define _PajeFN_Alias 2
#define _PajeFN_Type 3
#define _PajeFN_Container 4
#define _PajeFN_StartContainerType 5
#define _PajeFN_EndContainerType 6
#define _PajeFN_StartContainer 7
#define _PajeFN_EndContainer 8
#define _PajeFN_Color 9
#define _PajeFN_Value 10
#define _PajeFN_Key 11
#define _PajeFN_File 12
#define _PajeFN_Line 13
/*
* Former type that are no longer used in Paje Format.
* Kept here for compatibility
*/
#define _PajeFN_ContainerType 3
#define _PajeFN_EntityType 4
#define _PajeFN_Type 5
#define _PajeFN_Container 6
#define _PajeFN_SourceContainerType 7
#define _PajeFN_DestContainerType 8
#define _PajeFN_SourceContainer 9
#define _PajeFN_DestContainer 10
#define _PajeFN_Color 11
#define _PajeFN_Value 12
#define _PajeFN_Key 13
#define _PajeFN_File 14
#define _PajeFN_Line 15
#define _PajeFN_EntityType 3
#define _PajeFN_SourceContainerType 5
#define _PajeFN_DestContainerType 6
#define _PajeFN_SourceContainer 7
#define _PajeFN_DestContainer 8
/*!
* \brief Types for the fields
......
......@@ -135,14 +135,12 @@ ParserDefinitionPaje::ParserDefinitionPaje() {
INSERT_FNAME(Time, _FieldType_Date );
INSERT_FNAME(Name, _FieldType_Int | _FieldType_String );
INSERT_FNAME(Alias, _FieldType_Int | _FieldType_String );
INSERT_FNAME(ContainerType, _FieldType_Int | _FieldType_String );
INSERT_FNAME(EntityType, _FieldType_Int | _FieldType_String );
INSERT_FNAME(Type, _FieldType_Int | _FieldType_String );
INSERT_FNAME(Container, _FieldType_Int | _FieldType_String );
INSERT_FNAME(SourceContainerType, _FieldType_Int | _FieldType_String );
INSERT_FNAME(DestContainerType, _FieldType_Int | _FieldType_String );
INSERT_FNAME(SourceContainer, _FieldType_Int | _FieldType_String );
INSERT_FNAME(DestContainer, _FieldType_Int | _FieldType_String );
INSERT_FNAME(StartContainerType, _FieldType_Int | _FieldType_String );
INSERT_FNAME(EndContainerType, _FieldType_Int | _FieldType_String );
INSERT_FNAME(StartContainer, _FieldType_Int | _FieldType_String );
INSERT_FNAME(EndContainer, _FieldType_Int | _FieldType_String );
INSERT_FNAME(Color, _FieldType_Color );
INSERT_FNAME(Value, _FieldType_Int | _FieldType_String | _FieldType_Double);
INSERT_FNAME(Key, _FieldType_Int | _FieldType_String );
......@@ -155,17 +153,25 @@ ParserDefinitionPaje::ParserDefinitionPaje() {
_FNameStr2Id.insert(pair<string, int>(_FieldNames[i]._name, i));
}
// Former types no longer used in Paje format
_FNameStr2Id.insert(pair<string, int>("ContainerType" , _PajeFN_ContainerType ));
_FNameStr2Id.insert(pair<string, int>("EntityType" , _PajeFN_EntityType ));
_FNameStr2Id.insert(pair<string, int>("SourceContainerType", _PajeFN_SourceContainerType ));
_FNameStr2Id.insert(pair<string, int>("DestContainerType" , _PajeFN_DestContainerType ));
_FNameStr2Id.insert(pair<string, int>("SourceContainer" , _PajeFN_SourceContainer ));
_FNameStr2Id.insert(pair<string, int>("DestContainer" , _PajeFN_DestContainer ));
// Initialize the list of Events available
i = 0;
_EventDefs.resize(PAJE_EVENTDEF_SIZE);
INSERT_EVENT(PajeDefineContainerType, CODE2(Name) | CODE2(Alias) | CODE2(ContainerType) );
INSERT_EVENT(PajeDefineEventType , CODE2(Name) | CODE2(Alias) | CODE2(ContainerType) );
INSERT_EVENT(PajeDefineStateType , CODE2(Name) | CODE2(Alias) | CODE2(ContainerType) );
INSERT_EVENT(PajeDefineVariableType , CODE2(Name) | CODE2(Alias) | CODE2(ContainerType) );
INSERT_EVENT(PajeDefineEntityValue , CODE2(Name) | CODE2(Alias) | CODE2(EntityType) );
INSERT_EVENT(PajeDefineContainerType, CODE2(Name) | CODE2(Alias) | CODE2(Type) );
INSERT_EVENT(PajeDefineEventType , CODE2(Name) | CODE2(Alias) | CODE2(Type) );
INSERT_EVENT(PajeDefineStateType , CODE2(Name) | CODE2(Alias) | CODE2(Type) );
INSERT_EVENT(PajeDefineVariableType , CODE2(Name) | CODE2(Alias) | CODE2(Type) );
INSERT_EVENT(PajeDefineEntityValue , CODE2(Name) | CODE2(Alias) | CODE2(Type) );
INSERT_EVENT(PajeDestroyContainer , CODE2(Name) | CODE2(Alias) | CODE2(Time) | CODE2(Type) );
INSERT_EVENT(PajeCreateContainer , CODE2(Name) | CODE2(Alias) | CODE2(Time) | CODE2(Type) | CODE2(Container) );
INSERT_EVENT(PajeDefineLinkType , CODE2(Name) | CODE2(Alias) | CODE2(ContainerType) | CODE2(SourceContainerType) | CODE2(DestContainerType) );
INSERT_EVENT(PajeDefineLinkType , CODE2(Name) | CODE2(Alias) | CODE2(Type) | CODE2(StartContainerType) | CODE2(EndContainerType) );
INSERT_EVENT(PajePopState , CODE2(Time) | CODE2(Type) | CODE2(Container) );
INSERT_EVENT(PajeSetState , CODE2(Time) | CODE2(Type) | CODE2(Container) | CODE2(Value) );
INSERT_EVENT(PajePushState , CODE2(Time) | CODE2(Type) | CODE2(Container) | CODE2(Value) );
......@@ -173,9 +179,8 @@ ParserDefinitionPaje::ParserDefinitionPaje() {
INSERT_EVENT(PajeSetVariable , CODE2(Time) | CODE2(Type) | CODE2(Container) | CODE2(Value) );
INSERT_EVENT(PajeAddVariable , CODE2(Time) | CODE2(Type) | CODE2(Container) | CODE2(Value) );
INSERT_EVENT(PajeSubVariable , CODE2(Time) | CODE2(Type) | CODE2(Container) | CODE2(Value) );
INSERT_EVENT(PajeStartLink , CODE2(Time) | CODE2(Type) | CODE2(Container) | CODE2(Value) | CODE2(Key) | CODE2(SourceContainer) );
INSERT_EVENT(PajeEndLink , CODE2(Time) | CODE2(Type) | CODE2(Container) | CODE2(Value) | CODE2(Key) | CODE2(DestContainer) );
INSERT_EVENT(PajeStartLink , CODE2(Time) | CODE2(Type) | CODE2(Container) | CODE2(Value) | CODE2(Key) | CODE2(StartContainer) );
INSERT_EVENT(PajeEndLink , CODE2(Time) | CODE2(Type) | CODE2(Container) | CODE2(Value) | CODE2(Key) | CODE2(EndContainer) );
}
ParserDefinitionPaje::~ParserDefinitionPaje() {
......@@ -411,5 +416,3 @@ int ParserDefinitionPaje::definitions_number() const {
const vector<PajeFieldName> *ParserDefinitionPaje::get_FieldNames() const {
return &_FieldNames;
}
......@@ -76,22 +76,21 @@ ParserEventPaje::~ParserEventPaje(){
void ParserEventPaje::store_event(const PajeLine *line,
Trace &trace) {
string fvalue;
string alias;
string name;
String container_type;
String source_container_type;
String dest_container_type;
String entity_type;
Date time;
String type;
String start_container_type;
String end_container_type;
Date time;
String container;
String value_string;
Double value_double;
String source_container;
String dest_container;
String start_container;
String end_container;
String key;
Name alias_name;
map<std::string, Value *> extra_fields;
......@@ -150,20 +149,16 @@ void ParserEventPaje::store_event(const PajeLine *line,
name = fvalue;
break;
case _PajeFN_ContainerType :
container_type = fvalue;
break;
case _PajeFN_SourceContainerType :
source_container_type = fvalue;
case _PajeFN_Type :
type = fvalue;
break;
case _PajeFN_DestContainerType :
dest_container_type = fvalue;
case _PajeFN_StartContainerType :
start_container_type = fvalue;
break;
case _PajeFN_EntityType :
entity_type = fvalue;
case _PajeFN_EndContainerType :
end_container_type = fvalue;
break;
case _PajeFN_Time :
......@@ -177,10 +172,6 @@ void ParserEventPaje::store_event(const PajeLine *line,
}
break;
case _PajeFN_Type :
type = fvalue;
break;
case _PajeFN_Container :
container = fvalue;
break;
......@@ -200,12 +191,12 @@ void ParserEventPaje::store_event(const PajeLine *line,
}
break;
case _PajeFN_SourceContainer :
source_container = fvalue;
case _PajeFN_StartContainer :
start_container = fvalue;
break;
case _PajeFN_DestContainer :
dest_container = fvalue;
case _PajeFN_EndContainer :
end_container = fvalue;
break;
case _PajeFN_Key :
......@@ -254,8 +245,6 @@ void ParserEventPaje::store_event(const PajeLine *line,
}
}
Name alias_name;
if ( (alias != "") && (name == "" ) ){
name = alias;
}
......@@ -268,9 +257,10 @@ void ParserEventPaje::store_event(const PajeLine *line,
switch( def->_id ) {
case _PajeDefineContainerType :
{
ContainerType *temp_container_type = trace.search_container_type(container_type);
if( (temp_container_type == NULL) && (container_type.to_string() != "0") ){
Error::set(Error::VITE_ERR_UNKNOWN_CONTAINER_TYPE + container_type.to_string(), line->_id, Error::VITE_ERRCODE_ERROR);
ContainerType *temp_container_type = trace.search_container_type(type);
if( (temp_container_type == NULL) && (type.to_string() != "0") ){
Error::set(Error::VITE_ERR_UNKNOWN_CONTAINER_TYPE + type.to_string(), line->_id,
Error::VITE_ERRCODE_ERROR);
}
else{
trace.define_container_type(alias_name, temp_container_type, extra_fields);
......@@ -283,10 +273,12 @@ void ParserEventPaje::store_event(const PajeLine *line,
ContainerType *temp_container_type = trace.search_container_type(type);
Container *temp_container = trace.search_container(container);
if(temp_container_type == NULL && type.to_string() != "0"){
Error::set(Error::VITE_ERR_UNKNOWN_CONTAINER_TYPE + type.to_string(), line->_id, Error::VITE_ERRCODE_ERROR);
Error::set(Error::VITE_ERR_UNKNOWN_CONTAINER_TYPE + type.to_string(), line->_id,
Error::VITE_ERRCODE_ERROR);
}
else if(temp_container == NULL && container.to_string() != "0"){
Error::set(Error::VITE_ERR_UNKNOWN_CONTAINER + container.to_string(), line->_id, Error::VITE_ERRCODE_ERROR);
Error::set(Error::VITE_ERR_UNKNOWN_CONTAINER + container.to_string(), line->_id,
Error::VITE_ERRCODE_ERROR);
}
else{
trace.create_container(time, alias_name, temp_container_type, temp_container, extra_fields);
......@@ -298,13 +290,15 @@ void ParserEventPaje::store_event(const PajeLine *line,
case _PajeDestroyContainer :
{
Container *temp_container = trace.search_container(alias_name.to_string());
ContainerType *temp_container_type = trace.search_container_type(type);
Container *temp_container = trace.search_container(alias_name.to_string());
if(temp_container == NULL && alias_name.to_string() != "0"){
Error::set(Error::VITE_ERR_UNKNOWN_CONTAINER + alias_name.to_string(), line->_id, Error::VITE_ERRCODE_ERROR);
Error::set(Error::VITE_ERR_UNKNOWN_CONTAINER + alias_name.to_string(), line->_id,
Error::VITE_ERRCODE_ERROR);
}
else if(temp_container_type == NULL && type.to_string() != "0"){
Error::set(Error::VITE_ERR_UNKNOWN_CONTAINER_TYPE + type.to_string(), line->_id, Error::VITE_ERRCODE_ERROR);
Error::set(Error::VITE_ERR_UNKNOWN_CONTAINER_TYPE + type.to_string(), line->_id,
Error::VITE_ERRCODE_ERROR);
}
else{
trace.destroy_container(time, temp_container, temp_container_type, extra_fields);
......@@ -314,9 +308,10 @@ void ParserEventPaje::store_event(const PajeLine *line,
case _PajeDefineEventType :
{
ContainerType *temp_container_type = trace.search_container_type(container_type);
if(temp_container_type == NULL && container_type.to_string() != "0"){
Error::set(Error::VITE_ERR_UNKNOWN_CONTAINER_TYPE + container_type.to_string(), line->_id, Error::VITE_ERRCODE_ERROR);
ContainerType *temp_container_type = trace.search_container_type(type);
if(temp_container_type == NULL && type.to_string() != "0"){
Error::set(Error::VITE_ERR_UNKNOWN_CONTAINER_TYPE + type.to_string(), line->_id,
Error::VITE_ERRCODE_ERROR);
}
else{
trace.define_event_type(alias_name, temp_container_type, extra_fields);
......@@ -326,9 +321,10 @@ void ParserEventPaje::store_event(const PajeLine *line,
case _PajeDefineStateType :
{
ContainerType *temp_container_type = trace.search_container_type(container_type);
if(temp_container_type == NULL && container_type.to_string() != "0"){
Error::set(Error::VITE_ERR_UNKNOWN_CONTAINER_TYPE + container_type.to_string(), line->_id, Error::VITE_ERRCODE_ERROR);
ContainerType *temp_container_type = trace.search_container_type(type);
if(temp_container_type == NULL && type.to_string() != "0"){
Error::set(Error::VITE_ERR_UNKNOWN_CONTAINER_TYPE + type.to_string(), line->_id,
Error::VITE_ERRCODE_ERROR);
}
else{
trace.define_state_type(alias_name, temp_container_type, extra_fields);
......@@ -338,9 +334,10 @@ void ParserEventPaje::store_event(const PajeLine *line,
case _PajeDefineVariableType :
{
ContainerType *temp_container_type = trace.search_container_type(container_type);
if(temp_container_type == NULL && container_type.to_string() != "0"){
Error::set(Error::VITE_ERR_UNKNOWN_CONTAINER_TYPE + container_type.to_string(), line->_id, Error::VITE_ERRCODE_ERROR);
ContainerType *temp_container_type = trace.search_container_type(type);
if(temp_container_type == NULL && type.to_string() != "0"){
Error::set(Error::VITE_ERR_UNKNOWN_CONTAINER_TYPE + type.to_string(), line->_id,
Error::VITE_ERRCODE_ERROR);
}
else{
trace.define_variable_type(alias_name, temp_container_type, extra_fields);
......@@ -350,29 +347,33 @@ void ParserEventPaje::store_event(const PajeLine *line,
case _PajeDefineLinkType :
{
ContainerType *temp_container_type = trace.search_container_type(container_type);
ContainerType *temp_source_container_type = trace.search_container_type(source_container_type);
ContainerType *temp_dest_container_type = trace.search_container_type(dest_container_type);
if(temp_container_type == NULL && container_type.to_string() != "0"){
Error::set(Error::VITE_ERR_UNKNOWN_CONTAINER_TYPE + container_type.to_string(), line->_id, Error::VITE_ERRCODE_ERROR);
ContainerType *temp_container_type = trace.search_container_type(type);
ContainerType *temp_start_container_type = trace.search_container_type(start_container_type);
ContainerType *temp_end_container_type = trace.search_container_type(end_container_type);
if(temp_container_type == NULL && type.to_string() != "0"){
Error::set(Error::VITE_ERR_UNKNOWN_CONTAINER_TYPE + type.to_string(), line->_id,
Error::VITE_ERRCODE_ERROR);
}
else if(temp_source_container_type == NULL && source_container_type.to_string() != "0"){
Error::set(Error::VITE_ERR_UNKNOWN_CONTAINER_TYPE + source_container_type.to_string(), line->_id, Error::VITE_ERRCODE_ERROR);
else if(temp_start_container_type == NULL && start_container_type.to_string() != "0"){
Error::set(Error::VITE_ERR_UNKNOWN_CONTAINER_TYPE + start_container_type.to_string(), line->_id,
Error::VITE_ERRCODE_ERROR);
}
else if(temp_dest_container_type == NULL && dest_container_type.to_string() != "0"){
Error::set(Error::VITE_ERR_UNKNOWN_CONTAINER_TYPE + dest_container_type.to_string(), line->_id, Error::VITE_ERRCODE_ERROR);
else if(temp_end_container_type == NULL && end_container_type.to_string() != "0"){
Error::set(Error::VITE_ERR_UNKNOWN_CONTAINER_TYPE + end_container_type.to_string(), line->_id,
Error::VITE_ERRCODE_ERROR);
}
else{
trace.define_link_type(alias_name, temp_container_type, temp_source_container_type, temp_dest_container_type, extra_fields);
trace.define_link_type(alias_name, temp_container_type, temp_start_container_type, temp_end_container_type, extra_fields);
}
}
break;
case _PajeDefineEntityValue :
{
EntityType *temp_entity_type = trace.search_entity_type(entity_type);
if(temp_entity_type == NULL && entity_type.to_string() != "0"){
Error::set(Error::VITE_ERR_UNKNOWN_ENTITY_TYPE + entity_type.to_string(), line->_id, Error::VITE_ERRCODE_ERROR);
EntityType *temp_entity_type = trace.search_entity_type(type);
if(temp_entity_type == NULL && type.to_string() != "0"){
Error::set(Error::VITE_ERR_UNKNOWN_ENTITY_TYPE + type.to_string(), line->_id,
Error::VITE_ERRCODE_ERROR);
}
else{
trace.define_entity_value(alias_name, temp_entity_type, extra_fields);
......@@ -561,7 +562,7 @@ void ParserEventPaje::store_event(const PajeLine *line,
EntityValue *temp_entity_value = trace.search_entity_value(value_string, temp_link_type);
Container *temp_container = NULL;
Container *temp_source_container = NULL;
Container *temp_start_container = NULL;
// temp_container
if(_containers.find(container) != _containers.end()) {
temp_container = _containers[container];
......@@ -570,13 +571,13 @@ void ParserEventPaje::store_event(const PajeLine *line,
temp_container = trace.search_container(container);
_containers[container] = temp_container;
}
// temp_source_container
if(_containers.find(source_container) != _containers.end()) {
temp_source_container = _containers[source_container];
// temp_start_container
if(_containers.find(start_container) != _containers.end()) {
temp_start_container = _containers[start_container];
}
else {
temp_source_container = trace.search_container(source_container);
_containers[source_container] = temp_source_container;
temp_start_container = trace.search_container(start_container);
_containers[start_container] = temp_start_container;
}
......@@ -586,11 +587,11 @@ void ParserEventPaje::store_event(const PajeLine *line,
else if(temp_container == NULL && container.to_string() != "0"){
Error::set(Error::VITE_ERR_UNKNOWN_CONTAINER + container.to_string(), line->_id, Error::VITE_ERRCODE_ERROR);
}
else if(temp_source_container == NULL && source_container.to_string() != "0"){
Error::set(Error::VITE_ERR_UNKNOWN_CONTAINER + source_container.to_string(), line->_id, Error::VITE_ERRCODE_ERROR);
else if(temp_start_container == NULL && start_container.to_string() != "0"){
Error::set(Error::VITE_ERR_UNKNOWN_CONTAINER + start_container.to_string(), line->_id, Error::VITE_ERRCODE_ERROR);
}
else{
trace.start_link(time, temp_link_type, temp_container, temp_source_container, temp_entity_value, key, extra_fields);
trace.start_link(time, temp_link_type, temp_container, temp_start_container, temp_entity_value, key, extra_fields);
}
}
break;
......@@ -601,7 +602,7 @@ void ParserEventPaje::store_event(const PajeLine *line,
EntityValue *temp_entity_value = trace.search_entity_value(value_string, temp_link_type);
Container *temp_container = NULL;
Container *temp_dest_container = NULL;
Container *temp_end_container = NULL;
// temp_container
if(_containers.find(container) != _containers.end()) {
temp_container = _containers[container];
......@@ -610,13 +611,13 @@ void ParserEventPaje::store_event(const PajeLine *line,
temp_container = trace.search_container(container);
_containers[container] = temp_container;
}
// temp_dest_container
if(_containers.find(dest_container) != _containers.end()) {
temp_dest_container = _containers[dest_container];
// temp_end_container
if(_containers.find(end_container) != _containers.end()) {
temp_end_container = _containers[end_container];
}
else {
temp_dest_container = trace.search_container(dest_container);
_containers[dest_container] = temp_dest_container;
temp_end_container = trace.search_container(end_container);
_containers[end_container] = temp_end_container;
}
if(temp_link_type == NULL && type.to_string() != "0"){
......@@ -625,11 +626,11 @@ void ParserEventPaje::store_event(const PajeLine *line,
else if(temp_container == NULL && container.to_string() != "0"){
Error::set(Error::VITE_ERR_UNKNOWN_CONTAINER + container.to_string(), line->_id, Error::VITE_ERRCODE_ERROR);
}
else if(temp_dest_container == NULL && dest_container.to_string() != "0"){
Error::set(Error::VITE_ERR_UNKNOWN_CONTAINER + dest_container.to_string(), line->_id, Error::VITE_ERRCODE_ERROR);
else if(temp_end_container == NULL && end_container.to_string() != "0"){
Error::set(Error::VITE_ERR_UNKNOWN_CONTAINER + end_container.to_string(), line->_id, Error::VITE_ERRCODE_ERROR);
}
else{
trace.end_link(time, temp_link_type, temp_container, temp_dest_container, temp_entity_value, key, extra_fields);
trace.end_link(time, temp_link_type, temp_container, temp_end_container, temp_entity_value, key, extra_fields);
}
}
break;
......
......@@ -146,20 +146,12 @@ int mt_ParserEventPaje::store_event(const PajeLine *line,
name = fvalue;
break;
case _PajeFN_ContainerType :
tb_struct->container_type = fvalue;
case _PajeFN_StartContainerType :
tb_struct->start_container_type = fvalue;
break;
case _PajeFN_SourceContainerType :
tb_struct->source_container_type = fvalue;
break;
case _PajeFN_DestContainerType :
tb_struct->dest_container_type = fvalue;
break;
case _PajeFN_EntityType :
tb_struct->entity_type = fvalue;
case _PajeFN_EndContainerType :
tb_struct->end_container_type = fvalue;
break;
case _PajeFN_Time :
......@@ -196,12 +188,12 @@ int mt_ParserEventPaje::store_event(const PajeLine *line,
}
break;
case _PajeFN_SourceContainer :
tb_struct->source_container = fvalue;
case _PajeFN_StartContainer :
tb_struct->start_container = fvalue;
break;
case _PajeFN_DestContainer :
tb_struct->dest_container = fvalue;
case _PajeFN_EndContainer :
tb_struct->end_container = fvalue;
break;
case _PajeFN_Key :
......@@ -377,4 +369,3 @@ int mt_ParserEventPaje::store_event(const PajeLine *line,
}
return 0;
}
......@@ -265,4 +265,3 @@ float mt_ParserPaje::get_percent_loaded() const {
else
return 0.;
}
#include <iostream>
#include <stdio.h>
#include <string>
......@@ -28,37 +27,37 @@
TraceBuilderThread::TraceBuilderThread(QWaitCondition* cond, QSemaphore * freeSlots, QMutex* mutex):_cond(cond), _freeSlots(freeSlots), _mutex(mutex){
TraceBuilderThread::TraceBuilderThread(QWaitCondition *cond,
QSemaphore *freeSlots,
QMutex *mutex)
: _cond(cond), _freeSlots(freeSlots), _mutex(mutex) {
}
void TraceBuilderThread::build_trace(int n_structs, Trace_builder_struct* tb_struct){
void TraceBuilderThread::build_trace(int n_structs, Trace_builder_struct* tb_struct) {
// printf("received %p, n=%d\n", tb_struct, n_structs);
for(int i=0; i<n_structs; i++){
tb_struct[i].func(&tb_struct[i]);
}
_freeSlots->release();
delete[] tb_struct;
}
}
void TraceBuilderThread::build_finished(){
void TraceBuilderThread::build_finished(){
//locks the mutex and automatically unlocks it when going out of scope
QMutexLocker locker(_mutex);
_is_finished=true;
_cond->wakeAll();
}
}
void TraceBuilderThread::define_container_type(Trace_builder_struct* tb_struct){
ContainerType *temp_container_type = tb_struct->_trace->search_container_type(tb_struct->container_type);
if( (temp_container_type == NULL) && (tb_struct->container_type.to_string() != "0") ){
Error::set(Error::VITE_ERR_UNKNOWN_CONTAINER_TYPE + tb_struct->container_type.to_string(), tb_struct->_id, Error::VITE_ERRCODE_ERROR);
void TraceBuilderThread::define_container_type(Trace_builder_struct* tb_struct){
ContainerType *temp_container_type = tb_struct->_trace->search_container_type(tb_struct->type);
if( (temp_container_type == NULL) && (tb_struct->type.to_string() != "0") ){
Error::set(Error::VITE_ERR_UNKNOWN_CONTAINER_TYPE + tb_struct->type.to_string(), tb_struct->_id, Error::VITE_ERRCODE_ERROR);
}
else{
tb_struct->_trace->define_container_type(tb_struct->alias, temp_container_type, tb_struct->extra_fields);
}
}
}
void TraceBuilderThread::create_container(Trace_builder_struct* tb_struct){
ContainerType *temp_container_type = tb_struct->_trace->search_container_type(tb_struct->type);
......@@ -86,13 +85,13 @@ void TraceBuilderThread::create_container(Trace_builder_struct* tb_struct){
}
}
}
void TraceBuilderThread::destroy_container(Trace_builder_struct* tb_struct){
void TraceBuilderThread::destroy_container(Trace_builder_struct* tb_struct){
Container *temp_container = NULL;
Container_map::const_iterator it=(*tb_struct->_containers).find( String(tb_struct->alias.get_alias()));
......@@ -117,11 +116,11 @@ void TraceBuilderThread::create_container(Trace_builder_struct* tb_struct){
tb_struct->_trace->destroy_container(tb_struct->time, temp_container, temp_container_type, tb_struct->extra_fields);
}
}
}
void TraceBuilderThread::define_event_type(Trace_builder_struct* tb_struct){
ContainerType *temp_container_type = tb_struct->_trace->search_container_type( tb_struct->container_type);
void TraceBuilderThread::define_event_type(Trace_builder_struct* tb_struct){
ContainerType *temp_container_type = tb_struct->_trace->search_container_type( tb_struct->type);
if(temp_container_type == NULL && tb_struct->type.to_string() != "0"){
Error::set(Error::VITE_ERR_UNKNOWN_CONTAINER_TYPE + tb_struct->type.to_string(), tb_struct->_id, Error::VITE_ERRCODE_ERROR);
}
......@@ -130,12 +129,12 @@ void TraceBuilderThread::create_container(Trace_builder_struct* tb_struct){
tb_struct->_trace->define_event_type( tb_struct->alias, temp_container_type, tb_struct->extra_fields);
}
}
}
void TraceBuilderThread::define_state_type(Trace_builder_struct* tb_struct){
void TraceBuilderThread::define_state_type(Trace_builder_struct* tb_struct){
ContainerType *temp_container_type = tb_struct->_trace->search_container_type( tb_struct->container_type);
ContainerType *temp_container_type = tb_struct->_trace->search_container_type( tb_struct->type);
if(temp_container_type == NULL && tb_struct->type.to_string() != "0"){
Error::set(Error::VITE_ERR_UNKNOWN_CONTAINER_TYPE + tb_struct->type.to_string(), tb_struct->_id, Error::VITE_ERRCODE_ERROR);
}
......@@ -143,14 +142,14 @@ void TraceBuilderThread::create_container(Trace_builder_struct* tb_struct){