mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-01-19 12:24:32 +00:00
commit
807a2e13dd
@ -44,8 +44,8 @@ class DmesgInstrument(Instrument):
|
|||||||
|
|
||||||
def setup(self, context):
|
def setup(self, context):
|
||||||
if self.loglevel:
|
if self.loglevel:
|
||||||
self.old_loglevel = self.target.get_sysfile_value(self.loglevel_file)
|
self.old_loglevel = self.target.read_int(self.loglevel_file)
|
||||||
self.target.set_sysfile_value(self.loglevel_file, self.loglevel, verify=False)
|
self.target.write_value(self.loglevel_file, self.loglevel, verify=False)
|
||||||
self.before_file = _f(os.path.join(context.output_directory, 'dmesg', 'before'))
|
self.before_file = _f(os.path.join(context.output_directory, 'dmesg', 'before'))
|
||||||
self.after_file = _f(os.path.join(context.output_directory, 'dmesg', 'after'))
|
self.after_file = _f(os.path.join(context.output_directory, 'dmesg', 'after'))
|
||||||
|
|
||||||
@ -57,6 +57,7 @@ class DmesgInstrument(Instrument):
|
|||||||
if self.target.is_rooted:
|
if self.target.is_rooted:
|
||||||
self.target.execute('dmesg -c', as_root=True)
|
self.target.execute('dmesg -c', as_root=True)
|
||||||
|
|
||||||
|
@slow
|
||||||
def stop(self, context):
|
def stop(self, context):
|
||||||
with open(self.after_file, 'w') as wfh:
|
with open(self.after_file, 'w') as wfh:
|
||||||
wfh.write(self.target.execute('dmesg', as_root=self.need_root))
|
wfh.write(self.target.execute('dmesg', as_root=self.need_root))
|
||||||
@ -64,4 +65,4 @@ class DmesgInstrument(Instrument):
|
|||||||
|
|
||||||
def teardown(self, context): # pylint: disable=unused-argument
|
def teardown(self, context): # pylint: disable=unused-argument
|
||||||
if self.loglevel:
|
if self.loglevel:
|
||||||
self.target.set_sysfile_value(self.loglevel_file, self.old_loglevel, verify=False)
|
self.target.write_value(self.loglevel_file, self.old_loglevel, verify=False)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user