summaryrefslogtreecommitdiff
path: root/tests/perf.c
AgeCommit message (Collapse)Author
2018-06-25tests/perf: Add test config uuid for IcelakeJosé Roberto de Souza
This make perf tests to run in Icelake. Cc: Paulo Zanoni <paulo.r.zanoni@intel.com> Signed-off-by: José Roberto de Souza <jose.souza@intel.com> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2018-04-09tests/perf: fix gen8 small cores whitelist expectationLionel Landwerlin
We don't expect to access those registers on Braswell. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105593 Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2018-03-01tests/perf: simplify buffer-fill subtestLionel Landwerlin
Much like the enable-disable subtest, we're printing a bunch of values that were meant to try to figure out the issue of the OA unit not producing reports. After fixing the i915 driver with : https://patchwork.freedesktop.org/series/39112/ We don't need those values anymore. Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Matthew Auld <matthew.auld@intel.com>
2018-03-01tests/perf: simplify enable-disable subtestLionel Landwerlin
We're printing a bunch of values that were meant to try to figure out the issue of the OA unit not producing reports. After fixing the i915 driver with : https://patchwork.freedesktop.org/series/39112/ We don't need those values anymore. It turns out the issue was simply a race condition in the driver. Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Matthew Auld <matthew.auld@intel.com>
2018-02-28tests/perf: Fix build warningTvrtko Ursulin
Move variable declaration to top of scope to avoid C90 build warning. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2018-02-22test/perf: fixup inverted conditionLionel Landwerlin
The previous patch said : "verify that the time is always longer or equal to the period we've asked for" This is an obvious error, it only worked on my machine and the CI because only one longer period was observed. But another CI run caught the issue : https://intel-gfx-ci.01.org/tree/drm-tip/IGT_4280/shard-glkb6/igt@perf@oa-exponents.html Fixes: c3d11ca104fa ("tests/perf: make oa-exponents subtest more reliable") Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Matthew Auld <matthew.auld@intel.com>
2018-02-21tests/perf: make oa-exponents subtest more reliableLionel Landwerlin
We know the OA unit might skip some reports from time to time (reasons include pressure on memory controller, power management, ...). So rather than checking that the time between periodic reports is about the period we asked for, let's verify that the time is always longer or equal to the period we've asked for. We still have to leave some room for errors. Here is dump of an error in this updated test : (perf:405) DEBUG: report0019 ts=e217de20 hw_id=0x00000014 delta=64 (perf:405) DEBUG: report0020 ts=e217de60 hw_id=0x00000014 delta=64 (perf:405) DEBUG: report0021 ts=e217dea0 hw_id=0x00000014 delta=64 (perf:405) DEBUG: report0022 ts=e217df66 hw_id=0x00000014 delta=198 ****** (perf:405) DEBUG: report0023 ts=e217dfa0 hw_id=0x00000014 delta=58 ****** (perf:405) DEBUG: report0024 ts=e217dfe0 hw_id=0x00000014 delta=64 (perf:405) DEBUG: report0025 ts=e217e020 hw_id=0x00000014 delta=64 (perf:405) DEBUG: report0026 ts=e217e060 hw_id=0x00000014 delta=64 As you can see there is a discrepency in the periodic reports. I have no explanation for it. This isn't a programming error since the same context has correct periods before and after, so it must be some kind of hardware glitch/corner-case that hasn't be been documented. Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Matthew Auld <matthew.auld@intel.com>
2018-02-01tests/perf: fix report validity check on gen10+Lionel Landwerlin
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Testcase: igt/perf/buffer-fill & igt/perf/enable-disable & igt/perf/gen8-unprivileged-single-ctx-counters Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104658 Reviewed-by: Matthew Auld <matthew.auld@intel.com>
2017-12-08tests/perf: skip config tests on older kernelsLionel Landwerlin
We mostly run tests on the most recent kernels but those are failing on < 4.14. Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-12-08igt/perf: Read RCS0 timestamp directlyChris Wilson
On Haswell, at least, MI_REPORT_PERF_COUNT is not flushed by the PIPECONTROL surrounding the batch. (In theory, before the breadcrumb is updated the CPU's view of memory is coherent with the GPU, i.e. all writes have landed and are visible to userspace. This does not appear to be the case for MI_REPORT_PERF_COUNT.) This makes it an unreliable method for querying the timestamp, so use MI_STORE_REGISTER_MEM instead. Testcase: igt/perf/oa-exponents Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2017-12-08igt/perf: Use igt_sysfs rather than opencodingChris Wilson
As igt_sysfs exists to provide convenience routine for parsing files found in the device's sysfs dir, use it. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2017-12-08tests/perf: add test config uuid for CannonlakeLionel Landwerlin
This will enable running the tests on Cannonlake. Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Matthew Auld <matthew.auld@intel.com>
2017-12-08tests/perf: enable testing on Coffeelake GT3Lionel Landwerlin
Add the test config uuid for GT3. Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Matthew Auld <matthew.auld@intel.com>
2017-12-08tests/perf: query CS timestamp frequency if availableLionel Landwerlin
On Cannonlake+ the CS timestamp frequency might vary from one part to another. We have a new param to query this from the kernel (which reads the value from registers). v2: Skip the tests when timestamp frequency cannot be read on CNL+ (Lionel) Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Matthew Auld <matthew.auld@intel.com>
2017-12-08tests/perf: factorize max oa buffer size defineLionel Landwerlin
We use this value in several places. Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Matthew Auld <matthew.auld@intel.com>
2017-12-08tests/perf: drop copied i915 defines/structsLionel Landwerlin
Now that we have drm uapi headers in tree, we can drop this stuff. Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-11-06tests/perf: Fix a bunch of warnings on 32-bit systemsThierry Reding
Data types are defined differently on 32-bit systems, causing gcc to complain about printf format specifiers not matching the size of the variables passed in. Use PRIu64 and %zu where appropriate. Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
2017-10-04tests/perf: split array of formats descriptionsLionel Landwerlin
The I915_OA_FORMAT_C4_B8 format has different offset on Haswell & Gen8. Let's split the format lists so we don't mix them. Reported-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Matthew Auld <matthew.auld@intel.com>
2017-10-04tests/perf: add support for CoffeelakeLionel Landwerlin
Using the same timestamp frequency as Skylake/Kabylake. Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Matthew Auld <matthew.auld@intel.com>
2017-10-04tests/perf: prevent power management to kick in when necessaryLionel Landwerlin
Some of our tests measure that the OA unit produces reports at expected time intervals (as configured through the PERF_OPEN ioctl). It turns out the power management plays a role in the decision of the OA unit to write reports to memory. Under normal circumstances we don't really mind if the unit misses one report here or there, but for our tests it makes pretty difficult to verify whether we've made a mistake in the configuration. To work around this, let's prevent power management to kick in by holding /dev/cpu_dma_latency opened for the following tests : - enable-disable - blocking - polling - buffer-fill - oa-exponents Many thanks to Chris Wilson for suggesting this! Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Matthew Auld <matthew.auld@intel.com>
2017-10-04tests/perf: estimate number of blocking/polling based on time spentLionel Landwerlin
Blocking & polling tests define an amount of time to spend in the test and then estimate the number of syscalls that should successfully return. The problem is that while running the test we might spend slightly more time than initiallly planned. This change estimates the number of syscalls based on time spent after the fact. Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Matthew Auld <matthew.auld@intel.com>
2017-10-04tests/perf: make buffer-fill more reliableLionel Landwerlin
Filling rate of the buffer must discard context switch reports as they do not depend upon the periodicity, instead they're a factor on the amount of different applications concurrently running on the system. Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Tested-by: Matthew Auld <matthew.auld@intel.com> Reviewed-by: Matthew Auld <matthew.auld@intel.com>
2017-10-04tests/perf: make enable-disable more reliableLionel Landwerlin
Estimation of the amount of reports can only refer to periodic ones, as context switch reports completely depend on what happens on the system. Also generate some load to prevent clock frequency changes to impact our measurement. Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Matthew Auld <matthew.auld@intel.com>
2017-10-04tests/perf: rework oa-exponent testLionel Landwerlin
New issues that were discovered while making the tests work on Gen8+ : - we need to measure timings between periodic reports and discard all other kind of reports - it seems periodicity of the reports can be affected outside of RC6 (frequency change), we can detect this by looking at the amount of clock cycles per timestamp deltas v2: Drop some unused variables (Matthew) Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Matthew Auld <matthew.auld@intel.com>
2017-10-04tests/perf: remove frequency related changesLionel Landwerlin
Experience shows that most of the issues we face with periodicity of the reports produced by the OA unit are related to power management, not frequency. Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Matthew Auld <matthew.auld@intel.com>
2017-10-04tests/perf: rc6: try to guess when rc6 is disabledLionel Landwerlin
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Matthew Auld <matthew.auld@intel.com>
2017-10-04tests/perf: update max buffer size for reading reportsLionel Landwerlin
Make it clear that we're using a 16Mb buffer. Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Matthew Auld <matthew.auld@intel.com>
2017-10-04tests/perf: add per context filtering test for gen8+Robert Bragg
Signed-off-by: Robert Bragg <robert@sixbynine.org> Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Matthew Auld <matthew.auld@intel.com>
2017-10-04tests/perf: make stream_fd a global variableLionel Landwerlin
When debugging unstable tests on new platforms we currently we don't cleanup everything well in between different tests. Since only a single OA stream fd can be opened at a time, having the stream_fd as a global variable helps us cleanup the state between tests. Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Matthew Auld <matthew.auld@intel.com>
2017-08-31tests/perf: add Geminilake supportLionel Landwerlin
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Matthew Auld <matthew.auld@intel.com>
2017-08-31tests/perf: add Kabylake supportLionel Landwerlin
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Matthew Auld <matthew.auld@intel.com>
2017-08-07tests/perf: fix userspace configs issues on HSWLionel Landwerlin
We don't have flex eu counters on HSW, so don't try to program for thoses. Reported-by: CI \o/ Fixes: 609cb5e30b4 ("tests/perf: add tests to verify create/destroy userspace configs") Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Matthew Auld <matthew.auld@intel.com>
2017-08-04tests/perf: follow up build fixLionel Landwerlin
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Fixes: adcde8ac ("tests/perf: fix build where system headers don't have Gen8 formats") Tested-by: Matthew Auld <matthew.auld@intel.com Reviewed-by: Matthew Auld <matthew.auld@intel.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
2017-08-04tests/perf: fix build where system headers don't have Gen8 formatsLionel Landwerlin
v2: Use previous enum to define the new Gen8 enums (Petri) v3: Duh! (Lionel) v4: Redefine MAX oa formats value (Daniel) Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Tested-by: Daniel Stone <daniels@collabora.com>
2017-08-04tests/perf: add tests to verify create/destroy userspace configsLionel Landwerlin
v2: Add tests regarding removing configs (Matthew) Add tests regarding adding/removing configs without permissions (Matthew) v3: Add some flex registers (Matthew) v4: memset oa_config to 0 (Lionel) Change error code for removing unexisting config EINVAL->ENOENT (Lionel) v5: Update i915 uapi (Chris) Use wrappers to make assertions more readable (Chris) v6: Add whitelisting test (Lionel) v7: Add wrapper function for removing configs (Matthew) Fix an unfinished comment (Matthew) v8: Add EFAULT check (Lionel) Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Matthew Auld <matthew.auld@intel.com>
2017-08-04tests/perf: add utility function for checking periodic reportsLionel Landwerlin
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Matthew Auld <matthew.auld@intel.com>
2017-08-04tests/perf: update print_reports to print context IDRobert Bragg
Signed-off-by: Robert Bragg <robert@sixbynine.org> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2017-08-04tests/perf: print [un]slice freq and report reasons in debugRobert Bragg
Signed-off-by: Robert Bragg <robert@sixbynine.org> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2017-08-04tests/perf: factor out oa report sanity checkingRobert Bragg
Signed-off-by: Robert Bragg <robert@sixbynine.org> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2017-08-04tests/perf: consider ctx-switch reports while polling/blockingRobert Bragg
Signed-off-by: Robert Bragg <robert@sixbynine.org> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2017-08-04tests/perf: don't assume constant of 40 EUsRobert Bragg
Signed-off-by: Robert Bragg <robert@sixbynine.org> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2017-08-04tests/perf: s/test_perf_ctx_mi_rpc/hsw_test_single_ctx_counters/Robert Bragg
Signed-off-by: Robert Bragg <robert@sixbynine.org> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2017-08-04tests/perf: allow 10% margin matching oa/sysfs freq in test_oa_exponentsRobert Bragg
Signed-off-by: Robert Bragg <robert@sixbynine.org> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2017-08-04tests/perf: avoid assumptions about oa exponent <-> freq mappingsRobert Bragg
Signed-off-by: Robert Bragg <robert@sixbynine.org> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2017-08-04tests/perf: handling printing gen8 formatsRobert Bragg
Signed-off-by: Robert Bragg <robert@sixbynine.org> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2017-08-04tests/perf: wrap emission of MI_REPORT_PERF_COUNTRobert Bragg
Signed-off-by: Robert Bragg <robert@sixbynine.org> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2017-08-04tests/perf: move timebase + oa exponent utilities upRobert Bragg
Signed-off-by: Robert Bragg <robert@sixbynine.org> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2017-08-04tests/perf: generalize reading gpu ticks from reportsRobert Bragg
Signed-off-by: Robert Bragg <robert@sixbynine.org> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2017-08-04tests/perf: generalize checks for undefined A countersRobert Bragg
Signed-off-by: Robert Bragg <robert@sixbynine.org> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2017-08-04tests/perf: fix a counter indexingRobert Bragg
Signed-off-by: Robert Bragg <robert@sixbynine.org> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>