{"action":"closed","number":3,"pull_request":{"url":"https://api.github.com/repos/rmmh/whomp/pulls/3","id":60848301,"html_url":"https://github.com/rmmh/whomp/pull/3","diff_url":"https://github.com/rmmh/whomp/pull/3.diff","patch_url":"https://github.com/rmmh/whomp/pull/3.patch","issue_url":"https://api.github.com/repos/rmmh/whomp/issues/3","number":3,"state":"closed","locked":false,"title":"Rdpmc","user":{"login":"mattgodbolt","id":633973,"avatar_url":"https://avatars.githubusercontent.com/u/633973?v=3","gravatar_id":"","url":"https://api.github.com/users/mattgodbolt","html_url":"https://github.com/mattgodbolt","followers_url":"https://api.github.com/users/mattgodbolt/followers","following_url":"https://api.github.com/users/mattgodbolt/following{/other_user}","gists_url":"https://api.github.com/users/mattgodbolt/gists{/gist_id}","starred_url":"https://api.github.com/users/mattgodbolt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattgodbolt/subscriptions","organizations_url":"https://api.github.com/users/mattgodbolt/orgs","repos_url":"https://api.github.com/users/mattgodbolt/repos","events_url":"https://api.github.com/users/mattgodbolt/events{/privacy}","received_events_url":"https://api.github.com/users/mattgodbolt/received_events","type":"User","site_admin":false},"body":"Take a look anyway: this is how I got rdpmc instructions to work. I also warm up 10x times before timing which I found made results more stable on my Arrendale.\r\n\r\nNB the \"bind\" *is* important. It seems the perf drivers only allow user-mode access to the PMC counters for the CPU that you called the perf routine on. If you don't do the bind (try it!) then sometimes you'll get a segfault on the \"rdpmc\" instruction (which is strictly an \"illegal instruction\") as you get migrated to another CPU who hasn't had the user-mode PMC bit set (phew!).\r\n\r\nThere's probably a better way! This is a nice compromise compared to agner's kernel library if we can get it to work.","created_at":"2016-02-26T14:22:53Z","updated_at":"2016-02-27T08:26:48Z","closed_at":"2016-02-27T08:26:48Z","merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/rmmh/whomp/pulls/3/commits","review_comments_url":"https://api.github.com/repos/rmmh/whomp/pulls/3/comments","review_comment_url":"https://api.github.com/repos/rmmh/whomp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rmmh/whomp/issues/3/comments","statuses_url":"https://api.github.com/repos/rmmh/whomp/statuses/b8f21ab05a73767a31847ec243cd88c8358404ad","head":{"label":"mattgodbolt:rdpmc","ref":"rdpmc","sha":"b8f21ab05a73767a31847ec243cd88c8358404ad","user":{"login":"mattgodbolt","id":633973,"avatar_url":"https://avatars.githubusercontent.com/u/633973?v=3","gravatar_id":"","url":"https://api.github.com/users/mattgodbolt","html_url":"https://github.com/mattgodbolt","followers_url":"https://api.github.com/users/mattgodbolt/followers","following_url":"https://api.github.com/users/mattgodbolt/following{/other_user}","gists_url":"https://api.github.com/users/mattgodbolt/gists{/gist_id}","starred_url":"https://api.github.com/users/mattgodbolt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattgodbolt/subscriptions","organizations_url":"https://api.github.com/users/mattgodbolt/orgs","repos_url":"https://api.github.com/users/mattgodbolt/repos","events_url":"https://api.github.com/users/mattgodbolt/events{/privacy}","received_events_url":"https://api.github.com/users/mattgodbolt/received_events","type":"User","site_admin":false},"repo":{"id":52495194,"name":"whomp","full_name":"mattgodbolt/whomp","owner":{"login":"mattgodbolt","id":633973,"avatar_url":"https://avatars.githubusercontent.com/u/633973?v=3","gravatar_id":"","url":"https://api.github.com/users/mattgodbolt","html_url":"https://github.com/mattgodbolt","followers_url":"https://api.github.com/users/mattgodbolt/followers","following_url":"https://api.github.com/users/mattgodbolt/following{/other_user}","gists_url":"https://api.github.com/users/mattgodbolt/gists{/gist_id}","starred_url":"https://api.github.com/users/mattgodbolt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattgodbolt/subscriptions","organizations_url":"https://api.github.com/users/mattgodbolt/orgs","repos_url":"https://api.github.com/users/mattgodbolt/repos","events_url":"https://api.github.com/users/mattgodbolt/events{/privacy}","received_events_url":"https://api.github.com/users/mattgodbolt/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mattgodbolt/whomp","description":"reverse engineering branch predictors","fork":true,"url":"https://api.github.com/repos/mattgodbolt/whomp","forks_url":"https://api.github.com/repos/mattgodbolt/whomp/forks","keys_url":"https://api.github.com/repos/mattgodbolt/whomp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mattgodbolt/whomp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mattgodbolt/whomp/teams","hooks_url":"https://api.github.com/repos/mattgodbolt/whomp/hooks","issue_events_url":"https://api.github.com/repos/mattgodbolt/whomp/issues/events{/number}","events_url":"https://api.github.com/repos/mattgodbolt/whomp/events","assignees_url":"https://api.github.com/repos/mattgodbolt/whomp/assignees{/user}","branches_url":"https://api.github.com/repos/mattgodbolt/whomp/branches{/branch}","tags_url":"https://api.github.com/repos/mattgodbolt/whomp/tags","blobs_url":"https://api.github.com/repos/mattgodbolt/whomp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mattgodbolt/whomp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mattgodbolt/whomp/git/refs{/sha}","trees_url":"https://api.github.com/repos/mattgodbolt/whomp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mattgodbolt/whomp/statuses/{sha}","languages_url":"https://api.github.com/repos/mattgodbolt/whomp/languages","stargazers_url":"https://api.github.com/repos/mattgodbolt/whomp/stargazers","contributors_url":"https://api.github.com/repos/mattgodbolt/whomp/contributors","subscribers_url":"https://api.github.com/repos/mattgodbolt/whomp/subscribers","subscription_url":"https://api.github.com/repos/mattgodbolt/whomp/subscription","commits_url":"https://api.github.com/repos/mattgodbolt/whomp/commits{/sha}","git_commits_url":"https://api.github.com/repos/mattgodbolt/whomp/git/commits{/sha}","comments_url":"https://api.github.com/repos/mattgodbolt/whomp/comments{/number}","issue_comment_url":"https://api.github.com/repos/mattgodbolt/whomp/issues/comments{/number}","contents_url":"https://api.github.com/repos/mattgodbolt/whomp/contents/{+path}","compare_url":"https://api.github.com/repos/mattgodbolt/whomp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mattgodbolt/whomp/merges","archive_url":"https://api.github.com/repos/mattgodbolt/whomp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mattgodbolt/whomp/downloads","issues_url":"https://api.github.com/repos/mattgodbolt/whomp/issues{/number}","pulls_url":"https://api.github.com/repos/mattgodbolt/whomp/pulls{/number}","milestones_url":"https://api.github.com/repos/mattgodbolt/whomp/milestones{/number}","notifications_url":"https://api.github.com/repos/mattgodbolt/whomp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mattgodbolt/whomp/labels{/name}","releases_url":"https://api.github.com/repos/mattgodbolt/whomp/releases{/id}","deployments_url":"https://api.github.com/repos/mattgodbolt/whomp/deployments","created_at":"2016-02-25T03:53:24Z","updated_at":"2016-02-25T03:53:25Z","pushed_at":"2016-02-26T14:20:46Z","git_url":"git://github.com/mattgodbolt/whomp.git","ssh_url":"git@github.com:mattgodbolt/whomp.git","clone_url":"https://github.com/mattgodbolt/whomp.git","svn_url":"https://github.com/mattgodbolt/whomp","homepage":null,"size":25,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"rmmh:master","ref":"master","sha":"521867a7f087f56997f5d0f8cf0ad9cecf41e9ed","user":{"login":"rmmh","id":211868,"avatar_url":"https://avatars.githubusercontent.com/u/211868?v=3","gravatar_id":"","url":"https://api.github.com/users/rmmh","html_url":"https://github.com/rmmh","followers_url":"https://api.github.com/users/rmmh/followers","following_url":"https://api.github.com/users/rmmh/following{/other_user}","gists_url":"https://api.github.com/users/rmmh/gists{/gist_id}","starred_url":"https://api.github.com/users/rmmh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmmh/subscriptions","organizations_url":"https://api.github.com/users/rmmh/orgs","repos_url":"https://api.github.com/users/rmmh/repos","events_url":"https://api.github.com/users/rmmh/events{/privacy}","received_events_url":"https://api.github.com/users/rmmh/received_events","type":"User","site_admin":false},"repo":{"id":52433290,"name":"whomp","full_name":"rmmh/whomp","owner":{"login":"rmmh","id":211868,"avatar_url":"https://avatars.githubusercontent.com/u/211868?v=3","gravatar_id":"","url":"https://api.github.com/users/rmmh","html_url":"https://github.com/rmmh","followers_url":"https://api.github.com/users/rmmh/followers","following_url":"https://api.github.com/users/rmmh/following{/other_user}","gists_url":"https://api.github.com/users/rmmh/gists{/gist_id}","starred_url":"https://api.github.com/users/rmmh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmmh/subscriptions","organizations_url":"https://api.github.com/users/rmmh/orgs","repos_url":"https://api.github.com/users/rmmh/repos","events_url":"https://api.github.com/users/rmmh/events{/privacy}","received_events_url":"https://api.github.com/users/rmmh/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rmmh/whomp","description":"reverse engineering branch predictors","fork":false,"url":"https://api.github.com/repos/rmmh/whomp","forks_url":"https://api.github.com/repos/rmmh/whomp/forks","keys_url":"https://api.github.com/repos/rmmh/whomp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rmmh/whomp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rmmh/whomp/teams","hooks_url":"https://api.github.com/repos/rmmh/whomp/hooks","issue_events_url":"https://api.github.com/repos/rmmh/whomp/issues/events{/number}","events_url":"https://api.github.com/repos/rmmh/whomp/events","assignees_url":"https://api.github.com/repos/rmmh/whomp/assignees{/user}","branches_url":"https://api.github.com/repos/rmmh/whomp/branches{/branch}","tags_url":"https://api.github.com/repos/rmmh/whomp/tags","blobs_url":"https://api.github.com/repos/rmmh/whomp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rmmh/whomp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rmmh/whomp/git/refs{/sha}","trees_url":"https://api.github.com/repos/rmmh/whomp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rmmh/whomp/statuses/{sha}","languages_url":"https://api.github.com/repos/rmmh/whomp/languages","stargazers_url":"https://api.github.com/repos/rmmh/whomp/stargazers","contributors_url":"https://api.github.com/repos/rmmh/whomp/contributors","subscribers_url":"https://api.github.com/repos/rmmh/whomp/subscribers","subscription_url":"https://api.github.com/repos/rmmh/whomp/subscription","commits_url":"https://api.github.com/repos/rmmh/whomp/commits{/sha}","git_commits_url":"https://api.github.com/repos/rmmh/whomp/git/commits{/sha}","comments_url":"https://api.github.com/repos/rmmh/whomp/comments{/number}","issue_comment_url":"https://api.github.com/repos/rmmh/whomp/issues/comments{/number}","contents_url":"https://api.github.com/repos/rmmh/whomp/contents/{+path}","compare_url":"https://api.github.com/repos/rmmh/whomp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rmmh/whomp/merges","archive_url":"https://api.github.com/repos/rmmh/whomp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rmmh/whomp/downloads","issues_url":"https://api.github.com/repos/rmmh/whomp/issues{/number}","pulls_url":"https://api.github.com/repos/rmmh/whomp/pulls{/number}","milestones_url":"https://api.github.com/repos/rmmh/whomp/milestones{/number}","notifications_url":"https://api.github.com/repos/rmmh/whomp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rmmh/whomp/labels{/name}","releases_url":"https://api.github.com/repos/rmmh/whomp/releases{/id}","deployments_url":"https://api.github.com/repos/rmmh/whomp/deployments","created_at":"2016-02-24T10:14:15Z","updated_at":"2016-02-25T15:07:12Z","pushed_at":"2016-02-27T08:12:31Z","git_url":"git://github.com/rmmh/whomp.git","ssh_url":"git@github.com:rmmh/whomp.git","clone_url":"https://github.com/rmmh/whomp.git","svn_url":"https://github.com/rmmh/whomp","homepage":null,"size":51,"stargazers_count":2,"watchers_count":2,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rmmh/whomp/pulls/3"},"html":{"href":"https://github.com/rmmh/whomp/pull/3"},"issue":{"href":"https://api.github.com/repos/rmmh/whomp/issues/3"},"comments":{"href":"https://api.github.com/repos/rmmh/whomp/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/rmmh/whomp/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/rmmh/whomp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rmmh/whomp/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/rmmh/whomp/statuses/b8f21ab05a73767a31847ec243cd88c8358404ad"}},"merged":false,"mergeable":false,"mergeable_state":"dirty","merged_by":null,"comments":4,"review_comments":0,"commits":4,"additions":38,"deletions":14,"changed_files":2}}