{"action":"created","issue":{"url":"https://api.github.com/repos/android-ndk/ndk/issues/644","repository_url":"https://api.github.com/repos/android-ndk/ndk","labels_url":"https://api.github.com/repos/android-ndk/ndk/issues/644/labels{/name}","comments_url":"https://api.github.com/repos/android-ndk/ndk/issues/644/comments","events_url":"https://api.github.com/repos/android-ndk/ndk/issues/644/events","html_url":"https://github.com/android-ndk/ndk/issues/644","id":302290605,"number":644,"title":"Simpleperf: the result of cpu freqency is wrong ?","user":{"login":"magicse7en","id":5151645,"avatar_url":"https://avatars2.githubusercontent.com/u/5151645?v=4","gravatar_id":"","url":"https://api.github.com/users/magicse7en","html_url":"https://github.com/magicse7en","followers_url":"https://api.github.com/users/magicse7en/followers","following_url":"https://api.github.com/users/magicse7en/following{/other_user}","gists_url":"https://api.github.com/users/magicse7en/gists{/gist_id}","starred_url":"https://api.github.com/users/magicse7en/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magicse7en/subscriptions","organizations_url":"https://api.github.com/users/magicse7en/orgs","repos_url":"https://api.github.com/users/magicse7en/repos","events_url":"https://api.github.com/users/magicse7en/events{/privacy}","received_events_url":"https://api.github.com/users/magicse7en/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"yabinc","id":25111564,"avatar_url":"https://avatars0.githubusercontent.com/u/25111564?v=4","gravatar_id":"","url":"https://api.github.com/users/yabinc","html_url":"https://github.com/yabinc","followers_url":"https://api.github.com/users/yabinc/followers","following_url":"https://api.github.com/users/yabinc/following{/other_user}","gists_url":"https://api.github.com/users/yabinc/gists{/gist_id}","starred_url":"https://api.github.com/users/yabinc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yabinc/subscriptions","organizations_url":"https://api.github.com/users/yabinc/orgs","repos_url":"https://api.github.com/users/yabinc/repos","events_url":"https://api.github.com/users/yabinc/events{/privacy}","received_events_url":"https://api.github.com/users/yabinc/received_events","type":"User","site_admin":false},"assignees":[{"login":"yabinc","id":25111564,"avatar_url":"https://avatars0.githubusercontent.com/u/25111564?v=4","gravatar_id":"","url":"https://api.github.com/users/yabinc","html_url":"https://github.com/yabinc","followers_url":"https://api.github.com/users/yabinc/followers","following_url":"https://api.github.com/users/yabinc/following{/other_user}","gists_url":"https://api.github.com/users/yabinc/gists{/gist_id}","starred_url":"https://api.github.com/users/yabinc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yabinc/subscriptions","organizations_url":"https://api.github.com/users/yabinc/orgs","repos_url":"https://api.github.com/users/yabinc/repos","events_url":"https://api.github.com/users/yabinc/events{/privacy}","received_events_url":"https://api.github.com/users/yabinc/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2018-03-05T12:59:21Z","updated_at":"2018-03-06T01:07:36Z","closed_at":"2018-03-05T20:13:00Z","author_association":"NONE","body":"Execute `simpleperf stat -a sleep 1` command and the result as below:\r\n\r\nPerformance counter statistics:\r\n\r\n      91,821,403  cpu-cycles            # 0.089234 GHz                      (100%)\r\n       54,545,727  instructions          # 1.683384 cycles per instruction   (100%)\r\n       7,173,539  branch-instructions   # 6.971 M/sec                       (100%)\r\n          639,383  branch-misses         # 8.913076% miss rate               (100%)\r\n 1030.213619(ms)  task-clock            # 100.118106% cpu usage             (100%)\r\n              617  context-switches      # 599.612 /sec                      (100%)\r\n             362  page-faults           # 351.798 /sec                      (100%)\r\n\r\nThe `91,821,403  cpu-cycles            # 0.089234 GHz                      (100%)` shows cpu frequency is 0.089234GHz, in fact, the cpu real frequency is 1.7GHz. Does simpleperf miscalculate ?"},"comment":{"url":"https://api.github.com/repos/android-ndk/ndk/issues/comments/370624432","html_url":"https://github.com/android-ndk/ndk/issues/644#issuecomment-370624432","issue_url":"https://api.github.com/repos/android-ndk/ndk/issues/644","id":370624432,"user":{"login":"magicse7en","id":5151645,"avatar_url":"https://avatars2.githubusercontent.com/u/5151645?v=4","gravatar_id":"","url":"https://api.github.com/users/magicse7en","html_url":"https://github.com/magicse7en","followers_url":"https://api.github.com/users/magicse7en/followers","following_url":"https://api.github.com/users/magicse7en/following{/other_user}","gists_url":"https://api.github.com/users/magicse7en/gists{/gist_id}","starred_url":"https://api.github.com/users/magicse7en/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magicse7en/subscriptions","organizations_url":"https://api.github.com/users/magicse7en/orgs","repos_url":"https://api.github.com/users/magicse7en/repos","events_url":"https://api.github.com/users/magicse7en/events{/privacy}","received_events_url":"https://api.github.com/users/magicse7en/received_events","type":"User","site_admin":false},"created_at":"2018-03-06T01:07:36Z","updated_at":"2018-03-06T01:07:36Z","author_association":"NONE","body":"I disabled DVFS, hotplug and keep all cpus on-line. \r\nI  guess the simpleperf uses below formula to calculate cpu frequency:\r\n`frequency = cycles / time` ? \r\n\r\nBut I use linux-tool perf, the result is correct:\r\n> Performance counter stats for 'ls':\r\n         25.190308      task-clock (msec)         #    0.939 CPUs utilized          \r\n                 0      context-switches          #    0.000 K/sec                  \r\n                 0      cpu-migrations            #    0.000 K/sec                  \r\n               331      page-faults               #    0.013 M/sec                  \r\n          **42514492      cycles                    #    1.688 GHz**                \r\n   <not supported>      stalled-cycles-frontend  \r\n   <not supported>      stalled-cycles-backend   \r\n          27491753      instructions              #    0.65  insns per cycle        \r\n           3803236      branches                  #  150.980 M/sec                  \r\n            272886      branch-misses             #    7.18% of all branches\r\n       0.026814000 seconds time elapsed"}}
{"actor":{"display_login":"magicse7en"}}