mirror of
https://github.com/ARM-software/devlib.git
synced 2025-09-04 19:11:53 +01:00
Instrumentation: Update to populate missing 'sample_rate_hz` attributes
To conform with the Instrumentation API each instrument should populate the `sample_rate_hz` attribute with the relevant information.
This commit is contained in:
@@ -46,6 +46,7 @@ class AcmeCapeInstrument(Instrument):
|
||||
self.host = host
|
||||
self.iio_device = iio_device
|
||||
self.buffer_size = buffer_size
|
||||
self.sample_rate_hz = 100
|
||||
if self.iio_capture is None:
|
||||
raise HostError('Missing iio-capture binary')
|
||||
self.command = None
|
||||
|
@@ -16,6 +16,7 @@ class FramesInstrument(Instrument):
|
||||
self.collector_target = collector_target
|
||||
self.period = period
|
||||
self.keep_raw = keep_raw
|
||||
self.sample_rate_hz = 1 / self.period
|
||||
self.collector = None
|
||||
self.header = None
|
||||
self._need_reset = True
|
||||
|
@@ -51,6 +51,9 @@ class Gem5PowerInstrument(Instrument):
|
||||
self.add_channel(field, 'power')
|
||||
self.target.gem5stats.book_roi(self.roi_label)
|
||||
self.sample_period_ns = 10000000
|
||||
# Sample rate must remain unset as gem5 does not provide samples
|
||||
# at regular intervals therefore the reported timestamp should be used.
|
||||
self.sample_rate_hz = None
|
||||
self.target.gem5stats.start_periodic_dump(0, self.sample_period_ns)
|
||||
self._base_stats_dump = 0
|
||||
|
||||
|
Reference in New Issue
Block a user