Add an instrument that uses devlib's PerfettoCollector to collect a
Perfetto trace during the execution of a workload.
The instrument takes a path to a Perfetto config file which specifies
how Perfetto should be configured for the tracing.
Signed-off-by: Kajetan Puchalski <kajetan.puchalski@arm.com>
Allow optionally setting the top level ftrace buffer size separately
from the devlib buffer size. The parameter will be passed to the devlib
FtraceCollector and take effect there.
Signed-off-by: Kajetan Puchalski <kajetan.puchalski@arm.com>
The simpleperf included with Android 13 now does not show the percentage
when no counter multiplexing took place. This causes the perf instrument
to crash when processing the output. This fix checks whether the percentage
exists before trying to extract it.
Signed-off-by: Kajetan Puchalski <kajetan.puchalski@arm.com>
Currently, when processing the output of 'simpleperf stat', wa does not
skip the header and tries to process part of it as a number, leading
to type errors. This change skips the header (line starting with '#').
Furthermore, some events (e.g. cpu-clock or task-clock) include "(ms)"
in their count value and are floats instead of integers. Because of
this, when either of those is included, processing metrics fails due to
assuming every metric is an integer. Then another error happens when the
code tries to split the line on '(' assuming that there's only one set
of those around the percentage.
This change removes "(ms)" from the line
before it's processed and properly determines whether 'count' is an
integer or a float before attempting to convert it.
When running perf/simpleperf stat, the report_option_string,
report_sample_options and run_report_sample configuration parameters
don't make sense. Instead of quietly ignoring them, raise a
ConfigError so that the user can fix the agenda.
devlib learnt to use report-sample in
ARM-software/devlib@fe2fe3ae04 ("collector/perf: run simpleperf
report-sample in the target if requested"). Adapt the perf instrument
to use the new parameters of the PerfCollector.
With the perf instrument configured as:
perf:
perf_type: simpleperf
command: stat
optionstring: '-a --interval-only-values --csv'
WA fails to parse simpleperf's output:
INFO Extracting reports from target...
ERROR Error in instrument perf
ERROR File "/work/workload_automation/workload-automation/wa/framework/instrument.py", line 272, in __call__
ERROR self.callback(context)
ERROR File "/work/workload_automation/workload-automation/wa/instruments/perf.py", line 142, in update_output
ERROR self._process_simpleperf_output(context)
ERROR File "/work/workload_automation/workload-automation/wa/instruments/perf.py", line 155, in _process_simpleperf_output
ERROR self._process_simpleperf_stat_output(context)
ERROR File "/work/workload_automation/workload-automation/wa/instruments/perf.py", line 233, in _process_simpleperf_stat_output
ERROR self._process_simpleperf_stat_from_csv(stat_file, context, label)
ERROR File "/work/workload_automation/workload-automation/wa/instruments/perf.py", line 245, in _process_simpleperf_stat_from_csv
ERROR context.add_metric('{}_{}'.format(label, row[1]), row[0], 'count', classifiers=classifiers)
ERROR File "/work/workload_automation/workload-automation/wa/framework/execution.py", line 222, in add_metric
ERROR self.output.add_metric(name, value, units, lower_is_better, classifiers)
ERROR File "/work/workload_automation/workload-automation/wa/framework/output.py", line 142, in add_metric
ERROR self.result.add_metric(name, value, units, lower_is_better, classifiers)
ERROR File "/work/workload_automation/workload-automation/wa/framework/output.py", line 390, in add_metric
ERROR metric = Metric(name, value, units, lower_is_better, classifiers)
ERROR File "/work/workload_automation/workload-automation/wa/framework/output.py", line 653, in __init__
ERROR self.value = numeric(value)
ERROR File "/work/workload_automation/devlib/devlib/utils/types.py", line 88, in numeric
ERROR raise ValueError('Not numeric: {}'.format(value))
ERROR
ERROR ValueError(Not numeric: Performance counter statistics)
With the above options, the csv that simpleperf produces looks like
this:
Performance counter statistics,
123456789,raw-l1-dtlb,,(60%),
42424242,raw-l1-itlb,,(60%),
Total test time,1.001079,seconds,
Performance counter statistics,
123456789,raw-l1-dtlb,,(60%),
42424242,raw-l1-itlb,,(60%),
Total test time,2.001178,seconds,
Performance counter statistics,
[...]
That is, with "--interval-only-values", the "Performance counter
statistics," header is repeated every interval. WA current expects
it only in the first line. Modify the condition so that it is ignored
every time we find it in the file and not just the first time.
* Added simpleperf type to perf instrument as it's more stable
on Android devices.
* Added record command to instrument
* Added output processing for simpleperf
- Add copyright headers to files that did not already have them
- Update the year to the last year the file was modified in files with
existing headers.
This instrument will log serial traffic to a file. The idea is to
assist with debugging development boards, as otherwise there is a
chance that crash reports, for example, are lost when the device is
reset by WA.
It logs the pre-run and post-run traffic to preamble_serial.log and
postamble_serial.log , respectively, in the top-level output
directory. Serial logs for each workload are stored in the appropriate
workload directory as serial.log.
As we are tying up the serial port, we stop the logging when the
device is reset to allow board such as the Arm Juno to be reset via
the serial connection.
Since daq-server has been split out into a separate package, daq setup
is no longer part of WA documentation. This resulted in a warning when
building the docs.
As part of resolving a resource, record its MD5 hash in the output
metadata. In order to enable this, resource resolution is now done via
the context, rather than directly via the ResourceResolver (in order not
to introduce a context dependency in the Gui object, context now
emulates the resolver interface).
Extracting trace and pulling the trace file from the target can take a
relatively long time, as the trace file can be tens, and even hundreds,
of MB. Add an info-level log message to inform the user why WA execution
appears to have paused for a few seconds.
- Add missing descriptions to backends.
- Describe how to get instrument-specific parameter descriptions in the
help for instrument_parameters param of EnergyMeasurementInstrument
Add an instrument which wraps the devlib screencapture poller, which
allows us to capture a screenshot from the device every `period`. The
`period` is configurable based on the user requirements.
All captured screenshots are named according to the timestamp on the
device, and are placed into an output directory (screen-capture)
within the job directory.
resistor_values is an array of float and not int as the shunt resistors
are most of the time lower than 1 Ohm.
With kind=list_of_ints, all resistor values are rounded to 0. Replace it
by list_of_numbers
sample_rate_hz is an int used to get sample period and to compute energy.
Changes its type from str to int
With these 2 fixes, the daq instrument has been successfully tested with
NI DAQ6211
Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
Arm Energy Probe with arm_probe has been recently added in devlib's
instrument.
Add the arm_energy_probe in the WA list of Energy measurement instruments
Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
energy instruments might need to save platform specific configurations in
order to help to reproduce the use case. Such configuration should be saved in
__meta directory.
Add the directory path as a parameter of get_instruments() to save such
informations
Suggested-by: setrofim@gmail.com
Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>