canonical / rt-tests-snap

Snap package of rt-tests
GNU General Public License v2.0
1 stars 1 forks source link

fix: hwlatdetect missing permissions #20

Closed locnnil closed 3 months ago

locnnil commented 3 months ago

Summary

TODO: Ask for approval on store to use custom device interface

Justification for cpu_dma_latency

Without the access to /dev/cpu_dma_latency, the hwlatdetect program fails with the error:

$ sudo hwlatdetect --duration 5s
hwlatdetect:  test duration 5 seconds
   detector: tracer
   parameters:
        CPU list:          None
        Latency threshold: 10us
        Sample window:      1000000us
        Sample width:      500000us
     Non-sampling period:  500000us
        Output File:       None

Starting test
Traceback (most recent call last):
  File "/snap/rt-tests/x1/usr/sbin/hwlatdetect", line 509, in <module>
    detect.detect()
  File "/snap/rt-tests/x1/usr/sbin/hwlatdetect", line 297, in detect
    self.start()
  File "/snap/rt-tests/x1/usr/sbin/hwlatdetect", line 194, in start
    self.c_states_off()
  File "/snap/rt-tests/x1/usr/sbin/hwlatdetect", line 160, in c_states_off
    self.dma_latency_handle = os.open("/dev/cpu_dma_latency", os.O_WRONLY)
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
PermissionError: [Errno 1] Operation not permitted: '/dev/cpu_dma_latency
farshidtz commented 3 months ago

@locnnil I fixed a couple of typos in the squashed commit message.

Please avoid rewriting commits that have been reviewed. This makes it very hard to track and re-review the changes. The commits get squashed unless the separate commits make sense in the main history. Otherwise, it is completely pointless to rewrite a single commit.