Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
LimaGroup
Lima-camera-slsdetector
Commits
5a3bf212
Commit
5a3bf212
authored
Jul 11, 2018
by
Alejandro Homs Puron
Committed by
operator for beamline
Aug 09, 2018
Browse files
Debug: message refactoring
parent
3325db3b
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/SlsDetectorCPUAffinity.cpp
View file @
5a3bf212
...
...
@@ -348,14 +348,14 @@ void CPUAffinity::getNUMANodeMask(vector<unsigned long>& node_mask,
}
}
if
(
DEB_CHECK_ANY
(
DebType
Always
))
{
if
(
DEB_CHECK_ANY
(
DebType
Return
))
{
ostringstream
os
;
os
<<
hex
<<
"0x"
<<
setw
(
nb_nodes
/
4
)
<<
setfill
(
'0'
);
bool
first
=
true
;
Array
::
reverse_iterator
it
,
end
=
node_mask
.
rend
();
for
(
it
=
node_mask
.
rbegin
();
it
!=
end
;
++
it
,
first
=
false
)
os
<<
(
!
first
?
","
:
""
)
<<
*
it
;
DEB_
ALWAYS
()
<<
"node_mask="
<<
os
.
str
()
<<
", "
DEB_
RETURN
()
<<
"node_mask="
<<
os
.
str
()
<<
", "
<<
DEB_VAR1
(
max_node
);
}
}
...
...
@@ -1045,11 +1045,8 @@ SystemCPUAffinityMgr::WatchDog::getOtherProcList(CPUAffinity cpu_affinity)
string
SystemCPUAffinityMgr
::
WatchDog
::
concatStringList
(
StringList
list
)
{
ostringstream
os
;
const
char
*
sep
=
""
;
StringList
::
const_iterator
it
,
end
=
list
.
end
();
for
(
it
=
list
.
begin
();
it
!=
end
;
++
it
,
sep
=
","
)
os
<<
sep
<<
*
it
;
return
os
.
str
();
os
<<
list
;
return
os
.
str
().
substr
(
1
,
os
.
str
().
size
()
-
2
);
}
StringList
SystemCPUAffinityMgr
::
WatchDog
::
splitStringList
(
string
str
)
...
...
@@ -1091,6 +1088,7 @@ void SystemCPUAffinityMgr::WatchDog::netDevAffinitySetter(
const
NetDevGroupCPUAffinity
&
netdev_affinity
)
{
DEB_MEMBER_FUNCT
();
DEB_PARAM
()
<<
DEB_VAR1
(
netdev_affinity
);
NetDevMgrMap
&
netdev_map
=
m_netdev_mgr_map
;
...
...
@@ -1103,30 +1101,14 @@ void SystemCPUAffinityMgr::WatchDog::netDevAffinitySetter(
nl
.
push_back
(
it
->
first
);
}
typedef
NetDevRxQueueAffinityMap
AffinityMap
;
const
AffinityMap
&
m
=
netdev_affinity
.
queue_affinity
;
if
(
DEB_CHECK_ANY
(
DebTypeAlways
))
{
ostringstream
os
;
os
<<
"<"
;
AffinityMap
::
const_iterator
it
,
end
=
m
.
end
();
bool
first
=
true
;
for
(
it
=
m
.
begin
();
it
!=
end
;
++
it
,
first
=
false
)
os
<<
(
first
?
""
:
", "
)
<<
it
->
first
<<
": irq="
<<
it
->
second
.
irq
<<
", processing="
<<
it
->
second
.
processing
;
os
<<
">"
;
DEB_ALWAYS
()
<<
"setting ["
<<
concatStringList
(
nl
)
<<
"] "
<<
"network devices CPU affinity to "
<<
os
.
str
();
}
DEB_ALWAYS
()
<<
"setting "
<<
DEB_VAR1
(
netdev_affinity
);
StringList
::
const_iterator
dit
,
dend
=
nl
.
end
();
for
(
dit
=
nl
.
begin
();
dit
!=
dend
;
++
dit
)
{
const
string
&
dev
=
*
dit
;
NetDevRxQueueMgr
&
mgr
=
netdev_map
[
dev
];
mgr
.
setDev
(
dev
);
mgr
.
apply
(
m
);
mgr
.
apply
(
netdev_affinity
.
queue_affinity
);
}
DEB_ALWAYS
()
<<
"Done!"
;
...
...
@@ -1701,9 +1683,14 @@ lima::SlsDetector::operator <<(ostream& os, const NetDevGroupCPUAffinity& a)
os
<<
"<"
<<
a
.
name_list
<<
", ["
;
bool
first
=
true
;
const
NetDevRxQueueAffinityMap
&
m
=
a
.
queue_affinity
;
NetDevRxQueueAffinityMap
::
const_iterator
it
,
end
=
m
.
end
();
for
(
it
=
m
.
begin
();
it
!=
end
;
++
it
,
first
=
false
)
os
<<
(
first
?
""
:
", "
)
<<
it
->
first
<<
": "
<<
it
->
second
;
if
(
a
.
isDefault
())
{
os
<<
"default"
;
}
else
{
NetDevRxQueueAffinityMap
::
const_iterator
it
,
end
=
m
.
end
();
for
(
it
=
m
.
begin
();
it
!=
end
;
++
it
,
first
=
false
)
os
<<
(
first
?
""
:
", "
)
<<
it
->
first
<<
": "
<<
it
->
second
;
}
return
os
<<
"]>"
;
}
...
...
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