1
0
mirror of https://github.com/ARM-software/devlib.git synced 2025-04-05 01:10:03 +01:00

Instrumentation: Update to store sample rate in MeasurementCSV file.

This commit updates existing instruments to store their sample rates
when creating the respective MeasurementCsv files.
This commit is contained in:
Marc Bonnici 2017-08-03 16:43:32 +01:00
parent 411719d58d
commit 049b275665
6 changed files with 6 additions and 6 deletions

View File

@ -120,4 +120,4 @@ class AcmeCapeInstrument(Instrument):
# Convert rest into standard units.
output_row.append(float(row[i])/1000)
writer.writerow(output_row)
return MeasurementsCsv(outfile, self.active_channels)
return MeasurementsCsv(outfile, self.active_channels, self.sample_rate_hz)

View File

@ -126,7 +126,7 @@ class DaqInstrument(Instrument):
writer.writerow(row)
raw_row = _read_next_rows()
return MeasurementsCsv(outfile, self.active_channels)
return MeasurementsCsv(outfile, self.active_channels, self.sample_rate_hz)
finally:
for fh in file_handles:
fh.close()

View File

@ -113,4 +113,4 @@ class EnergyProbeInstrument(Instrument):
continue
else:
not_a_full_row_seen = True
return MeasurementsCsv(outfile, self.active_channels)
return MeasurementsCsv(outfile, self.active_channels, self.sample_rate_hz)

View File

@ -44,7 +44,7 @@ class FramesInstrument(Instrument):
self.collector.process_frames(raw_outfile)
active_sites = [chan.label for chan in self.active_channels]
self.collector.write_frames(outfile, columns=active_sites)
return MeasurementsCsv(outfile, self.active_channels)
return MeasurementsCsv(outfile, self.active_channels, self.sample_rate_hz)
def _init_channels(self):
raise NotImplementedError()

View File

@ -73,7 +73,7 @@ class Gem5PowerInstrument(Instrument):
for rec, rois in self.target.gem5stats.match_iter(sites_to_match,
[self.roi_label], self._base_stats_dump):
writer.writerow([float(rec[s]) for s in active_sites])
return MeasurementsCsv(outfile, self.active_channels)
return MeasurementsCsv(outfile, self.active_channels, self.sample_rate_hz)
def reset(self, sites=None, kinds=None, channels=None):
super(Gem5PowerInstrument, self).reset(sites, kinds, channels)

View File

@ -129,4 +129,4 @@ class MonsoonInstrument(Instrument):
row.append(usb)
writer.writerow(row)
return MeasurementsCsv(outfile, self.active_channels)
return MeasurementsCsv(outfile, self.active_channels, self.sample_rate_hz)