-1

When I running stress-ng with --perf option, it shows this:

root@1f5f41f13d4b:/usr/lib/linux-tools# stress-ng --cpu 1 --timeout 2s --perf
stress-ng: info:  [4170] dispatching hogs: 1 cpu
stress-ng: info:  [4170] cache allocate: default cache size: 4096K
stress-ng: info:  [4170] successful run completed in 2.03s
stress-ng: info:  [4170] perf counters are not available on this device

I installed the linux-tools-generic package and found the perf tool. I ran the stress-ng and it had the same error. The linux system is Ubuntu 16.04. Does anyone know how to solve it?

Arnabjyoti Kalita
  • 2,325
  • 1
  • 18
  • 31
Travis Gu
  • 39
  • 4
  • This is not a programming question. Also, read the man page. – Zulan Feb 08 '18 at 14:54
  • @Zulan it is a question related to system performance test and I am not aware stackoverflow doesn't allow system performance test related question. Anyway, I finally figured out the cause of issue: there is a Linux kernel setting to control this. But because I am running this inside docker container, this setting can only be changed on the host and it can not be changed inside a container. – Travis Gu Feb 09 '18 at 05:20
  • 1
    @TravisGu What Kernel setting are you referring to? – Michel Gokan Khan Jul 01 '20 at 15:29

1 Answers1

-2

Try it with sudo like this:

sudo stress-ng --cpu 1 --timeout 2s --perf