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
AIG-public
Cobalt
Commits
70565a8c
Commit
70565a8c
authored
May 26, 2017
by
Paul Rich
Browse files
Additional accounting logging for boot script.
parent
49c7581a
Changes
1
Hide whitespace changes
Inline
Side-by-side
tools/memory_management/reset_memory_mode.py
View file @
70565a8c
...
...
@@ -263,14 +263,17 @@ def main():
'from_mode'
:
','
.
join
(
initial_mode_list
),
'to_mode'
:
'%s:%s:%s'
%
(
mcdram_mode
,
numa_mode
,
node_list
),
'successful'
:
False
,
'start'
:
None
,
'end'
:
None
,
}
if
len
(
nodes_to_modify
)
!=
0
:
#if we don't have to reboot, don't go through this.
accounting_start_msg
=
ACCOUNTING_MSG_FMT
%
(
time
.
strftime
(
ACCOUNTING_DATE_FMT
,
time
.
gmtime
()),
'BS'
,
jobid
,
"bootid=%s"
%
bootid
)
"bootid=%s
blocked=%s
"
%
(
bootid
,
blocked
)
)
with
open
(
os
.
path
.
join
(
ACCOUNTING_LOG_PATH
,
accounting_log_filename
),
"a+"
)
as
acc_file
:
acc_file
.
write
(
accounting_start_msg
+
'
\n
'
)
logger
.
info
(
"%s"
,
accounting_start_msg
)
start
=
time
.
time
()
reboot_info
[
'start'
]
=
start
compact_nodes_to_modify
=
compact_num_list
(
nodes_to_modify
)
try
:
if
not
reset_modes
(
compact_nodes_to_modify
,
mcdram_mode
,
numa_mode
,
...
...
@@ -294,7 +297,9 @@ def main():
reboot_info
[
'successful'
]
=
success
finally
:
reboot_info
[
'boot_time'
]
=
int
(
time
.
time
()
-
start
)
end
=
time
.
time
()
reboot_info
[
'end'
]
=
end
reboot_info
[
'boot_time'
]
=
int
(
end
-
start
)
accounting_end_msg
=
ACCOUNTING_MSG_FMT
%
(
time
.
strftime
(
ACCOUNTING_DATE_FMT
,
time
.
gmtime
()),
'BE'
,
jobid
,
dict_to_keyval_str
(
reboot_info
))
with
open
(
os
.
path
.
join
(
ACCOUNTING_LOG_PATH
,
accounting_log_filename
),
"a+"
)
as
acc_file
:
...
...
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