Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
dcdb
dcdb
Commits
f9322eec
Commit
f9322eec
authored
Jan 10, 2019
by
Micha Mueller
Browse files
Fix compiler errors in Perf plugin
parent
d76931a3
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/sensors/perfevent/PerfeventConfigurator.cpp
View file @
f9322eec
...
...
@@ -160,7 +160,7 @@ bool PerfeventConfigurator::readConfig(std::string cfgPath) {
}
//group which consists of only one sensor
PerfSensorBase
*
sensor
=
new
PerfSensorBase
(
val
.
second
.
data
());
std
::
shared_ptr
<
PerfSensorBase
>
sensor
=
std
::
make_shared
<
PerfSensorBase
>
(
val
.
second
.
data
());
if
(
readSensorBase
(
*
sensor
,
val
.
second
))
{
group
->
pushBackSensor
(
sensor
);
...
...
@@ -171,7 +171,6 @@ bool PerfeventConfigurator::readConfig(std::string cfgPath) {
}
}
else
{
LOG
(
warning
)
<<
"Template single "
<<
_baseName
<<
" "
<<
val
.
second
.
data
()
<<
" could not be read! Omitting"
;
delete
sensor
;
delete
group
;
}
}
else
{
...
...
@@ -196,24 +195,28 @@ bool PerfeventConfigurator::readConfig(std::string cfgPath) {
PerfSensorGroup
group
(
val
.
second
.
data
());
if
(
readSensorGroup
(
group
,
val
.
second
))
{
//group which consists of only one sensor
PerfSensorBase
*
sensor
;
std
::
shared_ptr
<
PerfSensorBase
>
sensor
;
//perhaps one sensor is already present because it was copied from the template group
if
(
group
.
getSensors
().
size
()
!=
0
)
{
sensor
=
dynamic_cast
<
PerfSensorBase
*>
(
group
.
getSensors
()[
0
]);
sensor
->
setName
(
val
.
second
.
data
());
if
(
readSensorBase
(
*
sensor
,
val
.
second
))
{
customizeAndStore
(
group
,
val
.
second
);
}
else
{
LOG
(
warning
)
<<
"Single "
<<
_baseName
<<
" "
<<
val
.
second
.
data
()
<<
" could not be read! Omitting"
;
}
sensor
=
std
::
dynamic_pointer_cast
<
PerfSensorBase
>
(
group
.
getSensors
()[
0
]);
//check if cast was successful (sensor != nullptr)
if
(
sensor
)
{
sensor
->
setName
(
val
.
second
.
data
());
if
(
readSensorBase
(
*
sensor
,
val
.
second
))
{
customizeAndStore
(
group
,
val
.
second
);
}
else
{
LOG
(
warning
)
<<
"Single "
<<
_baseName
<<
" "
<<
val
.
second
.
data
()
<<
" could not be read! Omitting"
;
}
}
else
{
LOG
(
warning
)
<<
"Single "
<<
_baseName
<<
" "
<<
val
.
second
.
data
()
<<
" had a type mismatch when casting! Omitting"
;
}
}
else
{
sensor
=
new
PerfSensorBase
(
val
.
second
.
data
());
sensor
=
std
::
make_shared
<
PerfSensorBase
>
(
val
.
second
.
data
());
if
(
readSensorBase
(
*
sensor
,
val
.
second
))
{
group
.
pushBackSensor
(
sensor
);
customizeAndStore
(
group
,
val
.
second
);
}
else
{
LOG
(
warning
)
<<
"Single "
<<
_baseName
<<
" "
<<
val
.
second
.
data
()
<<
" could not be read! Omitting"
;
delete
sensor
;
}
}
}
else
{
...
...
Write
Preview
Markdown
is supported
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