1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2024-10-05 18:31:12 +01:00
Commit Graph

56 Commits

Author SHA1 Message Date
Ola Olsson
e0bf7668b8 Adding support for not validating PMU counters 2024-04-02 14:32:30 -05:00
Kajetan Puchalski
8d4fe9556b instruments: Add Perfetto instrument
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>
2023-09-07 17:29:27 -05:00
Kajetan Puchalski
b113a8b351 instruments/trace_cmd: Allow setting top_buffer_size
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>
2023-08-15 17:50:26 -05:00
Kajetan Puchalski
88b085c11b perf: Fix instrument for Android 13
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>
2023-05-30 17:38:09 -05:00
Marc Bonnici
3228a3187c Mitigate CVE-2007-4995
Prevent potential directory path traversal attacks (see
https://www.trellix.com/en-us/about/newsroom/stories/research/tarfile-exploiting-the-world.html)
2023-04-29 17:35:54 -05:00
Marc Bonnici
37346fe1b1 instruments/trace_cmd: Handle setup failure
In the case that the trace_cmd collector fails to
initialise, do not attempt to use the collector in
subsequent methods.
2023-04-29 17:29:43 -05:00
Kajetan Puchalski
b0f9072830 perf: Fix processing simpleperf stats
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.
2022-08-08 11:04:13 +01:00
Javi Merino
789e150b0a perf: report a config error if stat is combined with report options
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.
2021-04-30 13:35:08 +01:00
Javi Merino
43cb80d854 perf: support report-sample
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.
2021-04-30 13:35:08 +01:00
Javi Merino
22750b15c7 perf: correctly parse csv when using "--csv --interval-only-values"
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.
2021-01-11 17:48:27 +00:00
Marc Bonnici
aa4df95a69 pep8: Ignore line break before binary operator
PEP8 has switched its guidance [1] for where a line break should occur
in relation to a binary operator, so don't raise this warning for
new code and update the code base to follow the new style.

[1] https://www.python.org/dev/peps/pep-0008/#should-a-line-break-before-or-after-a-binary-operator
2020-10-30 11:49:54 +00:00
Marc Bonnici
1425a6f6c9 Implement caching of ApkInfo
Allow caching of ApkInfo to prevent the requirement of re-parsing
of APK files.
2020-07-15 15:04:31 +01:00
Marc Bonnici
1f8be77331 Disable pep8 errors 2020-05-13 16:43:03 +01:00
Marc Bonnici
607cff4c54 framework: Lock files which could be read/written to concurrently
Add file locking to files that could be read and written to concurrently
by separate wa processes causing race conditions.
2020-04-09 09:14:39 +01:00
Sergei Trofimov
51ffd60c06 instruments: add proc_stat
Add an instrument that monitors CPU load using data from /proc/stat
2020-02-07 14:11:31 +00:00
Marc Bonnici
90db655959 instrument/perf: Fix incorrect argument 2019-12-20 16:07:10 +00:00
Marc Bonnici
817d98ed72 wa/instruments: Refactor collectors to use Collector Inferface
Update the WA instruments which rely on the refactored devlib collectors
to reflect the new API.
2019-12-20 15:17:01 +00:00
Marc Bonnici
5906bca6b3 instruments/acme_cape: Fix missing parameter to get_instruments
The signature of `get_instruments` was missing the `keep_raw` parameter
so fix this and use it as part of the subsequent common invocation.
2019-11-18 16:09:09 +00:00
Marc Bonnici
d7c95fa844 instrument/energy_measurement: Fix typo and formatting 2019-10-03 12:48:24 +01:00
Marc Bonnici
e41aa3c967 instruments/energy_measurement: Add a keep_raw parameter
Add a `keep_raw` parameter to control whether raw files should be
deleted during teardown.
2019-10-03 11:38:29 +01:00
Marc Bonnici
3bef4fc92d instrument/energy_measurement: Invoke teardown method for backends
Forward the teardown method invocation to the instrument backend.
2019-10-03 08:39:53 +01:00
Robert Freeman
6beac11ee2 Add simpleperf type to perf instrument
* Added simpleperf type to perf instrument as it's more stable
  on Android devices.
* Added record command to instrument
* Added output processing for simpleperf
2019-09-18 12:55:59 +01:00
Marc Bonnici
12bb21045e instruments/SysfsExtractor: Add extracted directories as artifacts
Add the directories that have been extracted by the `SysfsExtractor` and
derived instruments as artifacts.
2019-07-19 16:36:11 +01:00
Marc Bonnici
31e08a6477 instruments/interrupts: Add interrupt files as artifacts
Ensure that the interrupt files pulled and diffed from the device are
added as artifacts.
2019-07-19 16:36:11 +01:00
Marc Bonnici
e3406bdb74 instruments/delay: Convert module name to identifier
- Ensure cooling module name is converted to identifier when resolving
- Fix typo
2019-04-26 08:04:45 +01:00
pablololo12
7cd7b73f58 Fixed an error emptying the reading buffer of the poller
Fixed identation

Fixed identation
2019-02-04 09:46:13 +00:00
Marc Bonnici
ce7720b26d instruments/fps: Fix Typo 2019-01-28 12:45:10 +00:00
Marc Bonnici
fce506eb02 instruments/misc: Fix typo 2018-09-21 15:06:30 +01:00
Marc Bonnici
b20b9f9cad instruments/perf: Port the perf instrument to WA3 2018-09-06 08:39:09 +01:00
Marc Bonnici
4a9b24a9a8 instruments/energy_measurments: Improve instrument description
Add note to users that all configuration for the backends should be
added through this instrument rather than directly.
2018-08-14 13:41:39 +01:00
Marc Bonnici
d007b283df instruments/trace_cmd: Fix reporting on target
If reporting on the target the extracted trace data file was not
defined, now locate the file correctly.
2018-07-24 11:34:00 +01:00
Sergei Trofimov
c410d2e1a1 I lint, therefore I am
Implement fixes for the most recent pylint version.
2018-07-09 15:59:40 +01:00
Marc Bonnici
925bc8b719 wa: pep8 fixes 2018-07-06 14:39:41 +01:00
Marc Bonnici
6afd710bd1 wa/instruments: pylint/fixes 2018-07-06 14:39:41 +01:00
Marc Bonnici
0b8501e010 wa/instruments: pep8 fixes 2018-07-06 14:39:41 +01:00
Sergei Trofimov
8878cc20d4 Update copyright headers.
- 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.
2018-07-04 16:33:31 +01:00
Sascha Bischoff
7fb85261da instruments/serialmon: Add an instrument to monitor serial traffic
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.
2018-06-13 14:36:46 +01:00
Sergei Trofimov
b3de85455a Add support for Python 3
Add support for running under Python 3, while maintaining compatibility
with Python 2.

See http://python-future.org/compatible_idioms.html for more details
behind these changes.
2018-06-07 14:48:40 +01:00
Sergei Trofimov
aee8b10f26 doc/delay: fix warning.
Add space between a note admonition and the preceding paragraph.
2018-06-01 17:18:43 +01:00
Marc Bonnici
ba717bbcd1 instrument/delay: Remove breakpoint 2018-05-30 12:25:58 +01:00
Marc Bonnici
ceadb36880 instruments/delay: Port instrument to WA3
Port the delay instrument to WA3.
2018-05-30 12:22:46 +01:00
Sergei Trofimov
18bf314592 doc: fix missing reference to daq_setup
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.
2018-05-25 15:27:14 +01:00
Sergei Trofimov
2ff06af632 fw/execution: record resource hashes in metadata
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).
2018-05-25 10:21:06 +01:00
Sergei Trofimov
ec66ae2f6f instrument/trace_cmd: Log the pulling of trace
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.
2018-05-14 17:05:06 +01:00
sergei Trofimov
6965c05707 instruments/energy_measurement: add missing docs
- Add missing descriptions to backends.
- Describe how to get instrument-specific parameter descriptions in the
  help for instrument_parameters param of EnergyMeasurementInstrument
2018-04-27 18:10:02 +01:00
Sascha Bischoff
3b7debe676 instruments: Add screencap
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.
2018-04-24 10:04:22 +01:00
Vincent Guittot
741193c441 daq: fix resistor_values and sample_rate_hz parameters list
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>
2018-04-03 08:36:06 +01:00
Vincent Guittot
06fc361f47 aep: fix variable typo
something wrong has happened when preparing the patch to add
arm-probe AEP support

Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
2018-03-29 19:41:23 +01:00
Vincent Guittot
ec316eab03 Add arm energy probe instrument
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>
2018-03-28 09:29:08 +01:00
Vincent Guittot
3c1369c268 Add meta directory to get_instruments function
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>
2018-03-28 09:29:08 +01:00