Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
solverstack
vite
Commits
ff984ca8
Commit
ff984ca8
authored
Jun 18, 2014
by
Thibault Soucarre
Browse files
Whitespaces
parent
a3de81c1
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/parser/PajeParser/ParserPaje.hpp
View file @
ff984ca8
...
...
@@ -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
**
*/
/*!
...
...
@@ -83,9 +83,9 @@ public:
* \param trace : the structure of data to fill
* \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
);
void
parse
(
Trace
&
trace
,
bool
finish_trace_after_parse
=
true
);
/*!
* \fn get_percent_loaded() const
* \brief return the size of the file already read.
...
...
src/parser/Parser.hpp
View file @
ff984ca8
...
...
@@ -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
**
*/
/*!
...
...
@@ -50,7 +50,7 @@
class
Trace
;
#include
<QObject>
/*!
/*!
* \class Parser Parser.hpp "../parser/src/Parser.hpp"
* \brief Contains the definition of the parser interface.
*/
...
...
@@ -61,9 +61,9 @@ class Parser: public QObject {
protected:
bool
_is_finished
;
bool
_is_canceled
;
std
::
string
_file_to_parse
;
public:
Parser
();
...
...
@@ -82,7 +82,7 @@ public:
* \return the scale of the size already loaded of the file by the parser. (between 0 and 1)
*/
virtual
float
get_percent_loaded
()
const
=
0
;
/*!
* \fn is_end_of_parsing() const
* \brief true is the parsing is finished
...
...
@@ -90,7 +90,7 @@ public:
*/
virtual
bool
is_end_of_parsing
()
const
;
/*!
/*!
* \fn set_canceled()
* \brief called when the loading of the trace is canceled by the user
*/
...
...
src/parser/ParserFactory.cpp
View file @
ff984ca8
...
...
@@ -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
**
*/
...
...
@@ -86,48 +86,48 @@
using
namespace
std
;
bool
ParserFactory
::
create
(
Parser
**
parser
,
const
string
&
filename
)
const
string
&
filename
)
{
size_t
pos
=
filename
.
find_last_of
(
'.'
);
string
ext
=
""
;
if
(
pos
!=
string
::
npos
)
{
ext
=
filename
.
substr
(
pos
);
ext
=
filename
.
substr
(
pos
);
if
(
ext
==
".trace"
)
{
/* WARNING: Why MT parsing has a different name ? it should just replace the other ones */
#ifdef MT_PARSING
*
parser
=
new
mt_ParserPaje
(
filename
);
*
parser
=
new
mt_ParserPaje
(
filename
);
#else
*
parser
=
new
ParserPaje
(
filename
);
#endif
}
else
if
(
ext
==
".ept"
)
{
*
parser
=
new
ParserVite
(
filename
);
}
else
if
(
ext
==
".otf"
)
{
else
if
(
ext
==
".ept"
)
{
*
parser
=
new
ParserVite
(
filename
);
}
else
if
(
ext
==
".otf"
)
{
#ifdef WITH_OTF
#ifdef MT_PARSING
*
parser
=
new
mt_ParserOTF
(
filename
);
*
parser
=
new
mt_ParserOTF
(
filename
);
#else
*
parser
=
new
ParserOTF
(
filename
);
*
parser
=
new
ParserOTF
(
filename
);
#endif
#else
*
Message
::
get_instance
()
<<
"OTF parser was not compiled. Use parser Paje by default"
<<
Message
::
endw
;
return
false
;
#endif //WITH_OTF
}
else
if
(
(
ext
==
".trc"
)
||
(
ext
==
".edf"
)
)
{
else
if
(
(
ext
==
".trc"
)
||
(
ext
==
".edf"
)
)
{
#ifdef WITH_TAU
*
parser
=
new
ParserTau
(
filename
);
*
parser
=
new
ParserTau
(
filename
);
#else
*
Message
::
get_instance
()
<<
"Tau parser was not compiled. Use parser Paje by default"
<<
Message
::
endw
;
return
false
;
#endif //WITH_TAU
}
else
if
(
ext
==
".vite"
)
{
}
else
if
(
ext
==
".vite"
)
{
#ifdef BOOST_SERIALIZE
*
parser
=
new
ParserSplitted
(
filename
);
*
parser
=
new
ParserSplitted
(
filename
);
#else
*
Message
::
get_instance
()
<<
"Boost serialization was not compiled. We cannot parse .vite files"
<<
Message
::
endw
;
#endif //WITH_OTF
...
...
src/parser/ParserSplitted.cpp
View file @
ff984ca8
...
...
@@ -17,14 +17,14 @@
/* -- */
#include
"parser/Parser.hpp"
/* -- */
#include
<boost/serialization/string.hpp>
#include
<boost/serialization/string.hpp>
#include
<boost/serialization/base_object.hpp>
#include
<boost/archive/tmpdir.hpp>
#include
<boost/serialization/utility.hpp>
#include
<boost/archive/text_iarchive.hpp>
#include
<boost/serialization/list.hpp>
#include
<boost/serialization/assume_abstract.hpp>
#include
"boost/serialization/map.hpp"
#include
"boost/serialization/map.hpp"
#include
"trace/Serializer_values.hpp"
#include
"trace/Serializer_types.hpp"
...
...
@@ -46,20 +46,20 @@
using
namespace
std
;
ParserSplitted
::
ParserSplitted
()
:
_loaded_itc
(
0
),
ParserSplitted
::
ParserSplitted
()
:
_loaded_itc
(
0
),
_nb_itc
(
0
)
{}
ParserSplitted
::
ParserSplitted
(
const
string
&
filename
)
:
Parser
(
filename
),
_loaded_itc
(
0
),
_nb_itc
(
0
)
ParserSplitted
::
ParserSplitted
(
const
string
&
filename
)
:
Parser
(
filename
),
_loaded_itc
(
0
),
_nb_itc
(
0
)
{}
ParserSplitted
::~
ParserSplitted
()
{}
void
ParserSplitted
::
parse
(
Trace
&
trace
,
bool
finish_trace_after_parse
)
void
ParserSplitted
::
parse
(
Trace
&
trace
,
bool
finish_trace_after_parse
)
{
Info
::
Splitter
::
load_splitted
=
true
;
...
...
@@ -80,7 +80,7 @@ void ParserSplitted::parse(Trace &trace,
QT_TRY
{
boost
::
archive
::
text_iarchive
ia
(
ifs
);
ia
.
register_type
(
static_cast
<
StateType
*>
(
NULL
));
ia
.
register_type
(
static_cast
<
EventType
*>
(
NULL
));
ia
.
register_type
(
static_cast
<
VariableType
*>
(
NULL
));
...
...
@@ -93,17 +93,17 @@ void ParserSplitted::parse(Trace &trace,
ia
.
register_type
(
static_cast
<
Hex
*>
(
NULL
));
ia
.
register_type
(
static_cast
<
Integer
*>
(
NULL
));
ia
.
register_type
(
static_cast
<
Name
*>
(
NULL
));
ia
.
register_type
(
static_cast
<
String
*>
(
NULL
));
ia
.
register_type
(
static_cast
<
String
*>
(
NULL
));
ia
>>
conts_types
;
trace
.
set_container_types
(
conts_types
);
//int test;
//ia >> test;
// restore the schedule from the archive
ia
>>
conts
;
trace
.
set_root_containers
(
conts
);
//we need to load a config from file
if
(
Info
::
Splitter
::
xml_filename
.
length
()
!=
0
)
{
bool
xml_success
=
trace
.
load_config_from_xml
(
QString
(
Info
::
Splitter
::
xml_filename
.
c_str
()));
...
...
@@ -111,31 +111,31 @@ void ParserSplitted::parse(Trace &trace,
std
::
cerr
<<
"Error while parsing"
<<
Info
::
Splitter
::
xml_filename
<<
std
::
endl
;
}
}
std
::
map
<
Name
,
StateType
*
>
_state_types
;
std
::
map
<
Name
,
EventType
*
>
_event_types
;
std
::
map
<
Name
,
LinkType
*
>
_link_types
;
std
::
map
<
Name
,
VariableType
*
>
_variable_types
;
ia
>>
_state_types
;
trace
.
set_state_types
(
_state_types
);
ia
>>
_event_types
;
trace
.
set_event_types
(
_event_types
);
ia
>>
_link_types
;
trace
.
set_link_types
(
_link_types
);
ia
>>
_variable_types
;
trace
.
set_variable_types
(
_variable_types
);
Date
d
;
ia
>>
d
;
trace
.
set_max_date
(
d
);
}
}
QT_CATCH
(
boost
::
archive
::
archive_exception
e
)
{
std
::
cerr
<<
"failed while restoring serialized file !"
<<
e
.
what
()
<<
" with file "
std
::
cerr
<<
"failed while restoring serialized file !"
<<
e
.
what
()
<<
" with file "
<<
_file_to_parse
<<
std
::
endl
;
return
;
}
...
...
@@ -147,59 +147,59 @@ void ParserSplitted::parse(Trace &trace,
const
Container
::
Vector
*
root_containers
=
trace
.
get_view_root_containers
();
if
(
root_containers
->
empty
()
)
root_containers
=
trace
.
get_root_containers
();
Container
::
VectorIt
i
=
root_containers
->
begin
();
Container
::
VectorIt
const
&
end
=
root_containers
->
end
();
for
(;
i
!=
end
;
i
++
)
containers
.
push
(
*
i
);
while
(
!
containers
.
empty
())
{
Container
*
c
=
containers
.
top
();
_nb_itc
+=
c
->
get_intervalsOfContainer
()
->
size
();
containers
.
pop
();
{
{
const
Container
::
Vector
*
children
=
c
->
get_view_children
();
if
(
children
->
empty
()
)
children
=
c
->
get_children
();
Container
::
VectorIt
it
=
children
->
begin
();
Container
::
VectorIt
const
&
it_end
=
children
->
end
();
for
(;
it
!=
it_end
;
it
++
)
containers
.
push
(
*
it
);
}
}
}
}
if
(
Info
::
Splitter
::
load_splitted
==
true
)
{
//we are in the preview mode
if
(
Info
::
Splitter
::
_x_max
==
0
)
Info
::
Splitter
::
preview
=
true
;
if
(
Info
::
Splitter
::
preview
==
true
)
trace
.
loadPreview
();
else
{
Interval
*
interval
=
new
Interval
(
Info
::
Splitter
::
_x_min
,
Info
::
Splitter
::
_x_max
);
//trace.loadTraceInside(i);
//in order to manage the percentage of loading, do this inside parser and not in trace
stack
<
Container
*>
containers
;
const
Container
::
Vector
*
root_containers
=
trace
.
get_view_root_containers
();
if
(
root_containers
->
empty
()
)
root_containers
=
trace
.
get_root_containers
();
Container
::
VectorIt
i
=
root_containers
->
begin
();
Container
::
VectorIt
const
&
end
=
root_containers
->
end
();
for
(;
i
!=
end
;
i
++
)
containers
.
push
(
*
i
);
while
(
!
containers
.
empty
()
)
{
Container
*
c
=
containers
.
top
();
c
->
loadItcInside
(
interval
);
/* Just an approximation, based on the total number of itc,
/* Just an approximation, based on the total number of itc,
* and not on the number of loaded itc (maybe heavy to parse)
*/
_loaded_itc
+=
c
->
get_intervalsOfContainer
()
->
size
();
...
...
@@ -208,7 +208,7 @@ void ParserSplitted::parse(Trace &trace,
const
Container
::
Vector
*
children
=
c
->
get_view_children
();
if
(
children
->
empty
()
)
children
=
c
->
get_children
();
Container
::
VectorIt
it
=
children
->
begin
();
Container
::
VectorIt
const
&
it_end
=
children
->
end
();
...
...
@@ -216,11 +216,11 @@ void ParserSplitted::parse(Trace &trace,
containers
.
push
(
*
it
);
}
}
SerializerDispatcher
::
Instance
().
kill_all_threads
();
}
}
if
(
finish_trace_after_parse
)
{
//we need to build the display only if we are not splitting the trace
trace
.
finish
();
...
...
@@ -233,7 +233,7 @@ void ParserSplitted::parse(Trace &trace,
void
ParserSplitted
::
releasefile
()
{}
float
ParserSplitted
::
get_percent_loaded
()
const
float
ParserSplitted
::
get_percent_loaded
()
const
{
if
(
_nb_itc
!=
0
)
return
(
double
)
_loaded_itc
/
(
double
)
_nb_itc
;
...
...
src/parser/ParserSplitted.hpp
View file @
ff984ca8
...
...
@@ -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
**
*/
/*!
...
...
@@ -66,7 +66,7 @@ class PajeFileManager;
class
ParserSplitted
:
public
Parser
{
int
_loaded_itc
;
int
_nb_itc
;
public:
/*!
...
...
@@ -85,12 +85,12 @@ public:
* \param trace : the structure of data to fill
* \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
);
void
parse
(
Trace
&
trace
,
bool
finish_trace_after_parse
=
true
);
void
releasefile
();
/*!
* \fn get_percent_loaded() const
* \brief return the size of the file already read.
...
...
@@ -106,7 +106,7 @@ public:
signals:
void
produced
(
int
i
,
PajeLine
*
line
);
void
build_finish
();
void
build_finish
();
};
#endif // ParserSplitted_HPP
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment