Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ycai
simbricks
Commits
cea7e935
Commit
cea7e935
authored
Mar 06, 2024
by
Marvin Meiers
Committed by
Antoine Kaufmann
May 08, 2024
Browse files
experiments: support enabling logging for ns-3 in e2e framework
parent
cb5b81f5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
1 deletion
+48
-1
experiments/simbricks/orchestration/e2e_components.py
experiments/simbricks/orchestration/e2e_components.py
+45
-0
experiments/simbricks/orchestration/simulators.py
experiments/simbricks/orchestration/simulators.py
+2
-0
sims/external/ns-3
sims/external/ns-3
+1
-1
No files found.
experiments/simbricks/orchestration/e2e_components.py
View file @
cea7e935
...
...
@@ -80,6 +80,28 @@ class SimbricksSyncMode(Enum):
SYNC_REQUIRED
=
2
class
Ns3LoggingLevel
(
Enum
):
ERROR
=
"error"
LEVEL_ERROR
=
"level_error"
WARN
=
"warn"
LEVEL_WARN
=
"level_warn"
DEBUG
=
"debug"
LEVEL_DEBUG
=
"level_debug"
INFO
=
"info"
LEVEL_INFO
=
"level_info"
FUNCTION
=
"function"
LEVEL_FUNCTION
=
"level_function"
LOGIC
=
"logic"
LEVEL_LOGIC
=
"level_logic"
ALL
=
"all"
LEVEL_ALL
=
"level_all"
PREFIX_FUNC
=
"prefix_func"
PREFIX_TIME
=
"prefix_time"
PREFIX_NODE
=
"prefix_node"
PREFIX_LEVEL
=
"prefix_level"
PREFIX_ALL
=
"prefix_all"
class
E2EBase
(
ABC
):
def
__init__
(
self
)
->
None
:
...
...
@@ -124,6 +146,29 @@ class E2EGlobalConfig(E2EBase):
raise
AttributeError
(
"Can't add a component to the global config"
)
class
E2ENs3Logging
(
E2EBase
):
def
__init__
(
self
)
->
None
:
super
().
__init__
()
self
.
category
=
"Logging"
self
.
logging
:
tp
.
Dict
[
str
,
tp
.
List
[
Ns3LoggingLevel
]]
=
{}
def
ns3_config
(
self
)
->
str
:
for
component
,
levels
in
self
.
logging
.
items
():
levels_str
=
"|"
.
join
([
level
.
value
for
level
in
levels
])
self
.
mapping
.
update
([(
component
,
levels_str
)])
return
super
().
ns3_config
()
def
add_component
(
self
,
component
:
E2EComponent
)
->
None
:
raise
AttributeError
(
"Can't add a component to the global config"
)
def
add_logging
(
self
,
component
:
str
,
level
:
Ns3LoggingLevel
):
if
component
in
self
.
logging
:
self
.
logging
[
component
].
append
(
level
)
else
:
self
.
logging
[
component
]
=
[
level
]
class
E2EComponent
(
E2EBase
):
def
__init__
(
self
,
idd
:
str
)
->
None
:
...
...
experiments/simbricks/orchestration/simulators.py
View file @
cea7e935
...
...
@@ -907,6 +907,7 @@ class NS3E2ENet(NetSim):
e2e
.
E2ETopologyChannel
]]
=
[]
self
.
e2e_topologies
:
tp
.
List
[
E2ETopology
]
=
[]
self
.
e2e_global
=
e2e
.
E2EGlobalConfig
()
self
.
e2e_ns3_logging
=
e2e
.
E2ENs3Logging
()
self
.
use_file
=
True
def
add_component
(
...
...
@@ -984,6 +985,7 @@ class NS3E2ENet(NetSim):
params
:
tp
.
List
[
str
]
=
[]
params
.
append
(
self
.
e2e_global
.
ns3_config
())
params
.
append
(
self
.
e2e_ns3_logging
.
ns3_config
())
for
component
in
self
.
e2e_components
:
params
.
append
(
component
.
ns3_config
())
...
...
ns-3
@
acb5036b
Compare
bcfb8f13
...
acb5036b
Subproject commit
bcfb8f13398889473a0965edde8ba1ae13c60496
Subproject commit
acb5036b27c7602db837a11c0cbbac08f29f72d5
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