{"action":"created","comment":{"url":"https://api.github.com/repos/systemd/systemd/pulls/comments/33247966","id":33247966,"diff_hunk":"@@ -409,6 +410,61 @@ int log_sample(DIR *proc,\n                 ps->total = (ps->last->runtime - ps->first->runtime)\n                             / 1000000000.0;\n \n+                /* Take into account CPU runtime/waittime spent in non-main threads of the process\n+                 * by parsing \"/proc/[pid]/task/[tid]/schedstat\" for all [tid] != [pid]\n+                 * See https://github.com/systemd/systemd/issues/139\n+                 */\n+\n+                /* Browse directory \"/proc/[pid]/task\" to know the thread ids of process [pid] */\n+                snprintf(filename, sizeof(filename), PID_FMT \"/task\", pid);\n+                taskfd = openat(procfd, filename, O_RDONLY|O_DIRECTORY|O_CLOEXEC);\n+                if (taskfd != -1) {\n+                        _cleanup_closedir_ DIR *taskdir = NULL;\n+\n+                        taskdir = fdopendir(taskfd);\n+                        FOREACH_DIRENT(ent, taskdir, goto task_next) {","path":"src/bootchart/store.c","position":24,"original_position":24,"commit_id":"9855fed36e9db1c31185dfe9709070e55fbd7089","original_commit_id":"9855fed36e9db1c31185dfe9709070e55fbd7089","user":{"login":"zonque","id":106304,"avatar_url":"https://avatars.githubusercontent.com/u/106304?v=3","gravatar_id":"","url":"https://api.github.com/users/zonque","html_url":"https://github.com/zonque","followers_url":"https://api.github.com/users/zonque/followers","following_url":"https://api.github.com/users/zonque/following{/other_user}","gists_url":"https://api.github.com/users/zonque/gists{/gist_id}","starred_url":"https://api.github.com/users/zonque/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zonque/subscriptions","organizations_url":"https://api.github.com/users/zonque/orgs","repos_url":"https://api.github.com/users/zonque/repos","events_url":"https://api.github.com/users/zonque/events{/privacy}","received_events_url":"https://api.github.com/users/zonque/received_events","type":"User","site_admin":false},"body":"Again, why not use `break` as the last argument here? You'd need to remove the `_cleanup_close_` attribute from `int taskfd`, which isn't needed anyway AFAICS …","created_at":"2015-06-25T12:16:33Z","updated_at":"2015-06-25T12:16:33Z","html_url":"https://github.com/systemd/systemd/pull/364#discussion_r33247966","pull_request_url":"https://api.github.com/repos/systemd/systemd/pulls/364","_links":{"self":{"href":"https://api.github.com/repos/systemd/systemd/pulls/comments/33247966"},"html":{"href":"https://github.com/systemd/systemd/pull/364#discussion_r33247966"},"pull_request":{"href":"https://api.github.com/repos/systemd/systemd/pulls/364"}}},"pull_request":{"url":"https://api.github.com/repos/systemd/systemd/pulls/364","id":38539264,"html_url":"https://github.com/systemd/systemd/pull/364","diff_url":"https://github.com/systemd/systemd/pull/364.diff","patch_url":"https://github.com/systemd/systemd/pull/364.patch","issue_url":"https://api.github.com/repos/systemd/systemd/issues/364","number":364,"state":"open","locked":false,"title":"bootchart: Account CPU time spent in non-main threads of the process (v3)","user":{"login":"gmacario","id":75182,"avatar_url":"https://avatars.githubusercontent.com/u/75182?v=3","gravatar_id":"","url":"https://api.github.com/users/gmacario","html_url":"https://github.com/gmacario","followers_url":"https://api.github.com/users/gmacario/followers","following_url":"https://api.github.com/users/gmacario/following{/other_user}","gists_url":"https://api.github.com/users/gmacario/gists{/gist_id}","starred_url":"https://api.github.com/users/gmacario/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gmacario/subscriptions","organizations_url":"https://api.github.com/users/gmacario/orgs","repos_url":"https://api.github.com/users/gmacario/repos","events_url":"https://api.github.com/users/gmacario/events{/privacy}","received_events_url":"https://api.github.com/users/gmacario/received_events","type":"User","site_admin":false},"body":"Hello @teg,\r\n\r\nI have implemented the remaining changes as you suggested.\r\n\r\nHere is v3 of the fix to Bug https://github.com/systemd/systemd/issues/139\r\n\r\nThanks for your patience,\r\nGianpaolo","created_at":"2015-06-25T11:56:08Z","updated_at":"2015-06-25T12:16:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"53585a2ecdc7d098a3d4db126f0e8a4eb902e5d9","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/systemd/systemd/pulls/364/commits","review_comments_url":"https://api.github.com/repos/systemd/systemd/pulls/364/comments","review_comment_url":"https://api.github.com/repos/systemd/systemd/pulls/comments{/number}","comments_url":"https://api.github.com/repos/systemd/systemd/issues/364/comments","statuses_url":"https://api.github.com/repos/systemd/systemd/statuses/9855fed36e9db1c31185dfe9709070e55fbd7089","head":{"label":"gmacario:fix-issue139-v3","ref":"fix-issue139-v3","sha":"9855fed36e9db1c31185dfe9709070e55fbd7089","user":{"login":"gmacario","id":75182,"avatar_url":"https://avatars.githubusercontent.com/u/75182?v=3","gravatar_id":"","url":"https://api.github.com/users/gmacario","html_url":"https://github.com/gmacario","followers_url":"https://api.github.com/users/gmacario/followers","following_url":"https://api.github.com/users/gmacario/following{/other_user}","gists_url":"https://api.github.com/users/gmacario/gists{/gist_id}","starred_url":"https://api.github.com/users/gmacario/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gmacario/subscriptions","organizations_url":"https://api.github.com/users/gmacario/orgs","repos_url":"https://api.github.com/users/gmacario/repos","events_url":"https://api.github.com/users/gmacario/events{/privacy}","received_events_url":"https://api.github.com/users/gmacario/received_events","type":"User","site_admin":false},"repo":{"id":36943667,"name":"systemd","full_name":"gmacario/systemd","owner":{"login":"gmacario","id":75182,"avatar_url":"https://avatars.githubusercontent.com/u/75182?v=3","gravatar_id":"","url":"https://api.github.com/users/gmacario","html_url":"https://github.com/gmacario","followers_url":"https://api.github.com/users/gmacario/followers","following_url":"https://api.github.com/users/gmacario/following{/other_user}","gists_url":"https://api.github.com/users/gmacario/gists{/gist_id}","starred_url":"https://api.github.com/users/gmacario/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gmacario/subscriptions","organizations_url":"https://api.github.com/users/gmacario/orgs","repos_url":"https://api.github.com/users/gmacario/repos","events_url":"https://api.github.com/users/gmacario/events{/privacy}","received_events_url":"https://api.github.com/users/gmacario/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gmacario/systemd","description":"systemd upstream","fork":true,"url":"https://api.github.com/repos/gmacario/systemd","forks_url":"https://api.github.com/repos/gmacario/systemd/forks","keys_url":"https://api.github.com/repos/gmacario/systemd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gmacario/systemd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gmacario/systemd/teams","hooks_url":"https://api.github.com/repos/gmacario/systemd/hooks","issue_events_url":"https://api.github.com/repos/gmacario/systemd/issues/events{/number}","events_url":"https://api.github.com/repos/gmacario/systemd/events","assignees_url":"https://api.github.com/repos/gmacario/systemd/assignees{/user}","branches_url":"https://api.github.com/repos/gmacario/systemd/branches{/branch}","tags_url":"https://api.github.com/repos/gmacario/systemd/tags","blobs_url":"https://api.github.com/repos/gmacario/systemd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gmacario/systemd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gmacario/systemd/git/refs{/sha}","trees_url":"https://api.github.com/repos/gmacario/systemd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gmacario/systemd/statuses/{sha}","languages_url":"https://api.github.com/repos/gmacario/systemd/languages","stargazers_url":"https://api.github.com/repos/gmacario/systemd/stargazers","contributors_url":"https://api.github.com/repos/gmacario/systemd/contributors","subscribers_url":"https://api.github.com/repos/gmacario/systemd/subscribers","subscription_url":"https://api.github.com/repos/gmacario/systemd/subscription","commits_url":"https://api.github.com/repos/gmacario/systemd/commits{/sha}","git_commits_url":"https://api.github.com/repos/gmacario/systemd/git/commits{/sha}","comments_url":"https://api.github.com/repos/gmacario/systemd/comments{/number}","issue_comment_url":"https://api.github.com/repos/gmacario/systemd/issues/comments{/number}","contents_url":"https://api.github.com/repos/gmacario/systemd/contents/{+path}","compare_url":"https://api.github.com/repos/gmacario/systemd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gmacario/systemd/merges","archive_url":"https://api.github.com/repos/gmacario/systemd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gmacario/systemd/downloads","issues_url":"https://api.github.com/repos/gmacario/systemd/issues{/number}","pulls_url":"https://api.github.com/repos/gmacario/systemd/pulls{/number}","milestones_url":"https://api.github.com/repos/gmacario/systemd/milestones{/number}","notifications_url":"https://api.github.com/repos/gmacario/systemd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gmacario/systemd/labels{/name}","releases_url":"https://api.github.com/repos/gmacario/systemd/releases{/id}","created_at":"2015-06-05T16:40:32Z","updated_at":"2015-06-05T16:40:37Z","pushed_at":"2015-06-25T11:51:10Z","git_url":"git://github.com/gmacario/systemd.git","ssh_url":"git@github.com:gmacario/systemd.git","clone_url":"https://github.com/gmacario/systemd.git","svn_url":"https://github.com/gmacario/systemd","homepage":"http://www.freedesktop.org/wiki/Software/systemd/","size":35614,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"systemd:master","ref":"master","sha":"3dfc034b4d46f67d6eda8801f1d4be26c37ab0b7","user":{"login":"systemd","id":1918868,"avatar_url":"https://avatars.githubusercontent.com/u/1918868?v=3","gravatar_id":"","url":"https://api.github.com/users/systemd","html_url":"https://github.com/systemd","followers_url":"https://api.github.com/users/systemd/followers","following_url":"https://api.github.com/users/systemd/following{/other_user}","gists_url":"https://api.github.com/users/systemd/gists{/gist_id}","starred_url":"https://api.github.com/users/systemd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/systemd/subscriptions","organizations_url":"https://api.github.com/users/systemd/orgs","repos_url":"https://api.github.com/users/systemd/repos","events_url":"https://api.github.com/users/systemd/events{/privacy}","received_events_url":"https://api.github.com/users/systemd/received_events","type":"Organization","site_admin":false},"repo":{"id":32873313,"name":"systemd","full_name":"systemd/systemd","owner":{"login":"systemd","id":1918868,"avatar_url":"https://avatars.githubusercontent.com/u/1918868?v=3","gravatar_id":"","url":"https://api.github.com/users/systemd","html_url":"https://github.com/systemd","followers_url":"https://api.github.com/users/systemd/followers","following_url":"https://api.github.com/users/systemd/following{/other_user}","gists_url":"https://api.github.com/users/systemd/gists{/gist_id}","starred_url":"https://api.github.com/users/systemd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/systemd/subscriptions","organizations_url":"https://api.github.com/users/systemd/orgs","repos_url":"https://api.github.com/users/systemd/repos","events_url":"https://api.github.com/users/systemd/events{/privacy}","received_events_url":"https://api.github.com/users/systemd/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/systemd/systemd","description":"systemd upstream","fork":false,"url":"https://api.github.com/repos/systemd/systemd","forks_url":"https://api.github.com/repos/systemd/systemd/forks","keys_url":"https://api.github.com/repos/systemd/systemd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/systemd/systemd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/systemd/systemd/teams","hooks_url":"https://api.github.com/repos/systemd/systemd/hooks","issue_events_url":"https://api.github.com/repos/systemd/systemd/issues/events{/number}","events_url":"https://api.github.com/repos/systemd/systemd/events","assignees_url":"https://api.github.com/repos/systemd/systemd/assignees{/user}","branches_url":"https://api.github.com/repos/systemd/systemd/branches{/branch}","tags_url":"https://api.github.com/repos/systemd/systemd/tags","blobs_url":"https://api.github.com/repos/systemd/systemd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/systemd/systemd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/systemd/systemd/git/refs{/sha}","trees_url":"https://api.github.com/repos/systemd/systemd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/systemd/systemd/statuses/{sha}","languages_url":"https://api.github.com/repos/systemd/systemd/languages","stargazers_url":"https://api.github.com/repos/systemd/systemd/stargazers","contributors_url":"https://api.github.com/repos/systemd/systemd/contributors","subscribers_url":"https://api.github.com/repos/systemd/systemd/subscribers","subscription_url":"https://api.github.com/repos/systemd/systemd/subscription","commits_url":"https://api.github.com/repos/systemd/systemd/commits{/sha}","git_commits_url":"https://api.github.com/repos/systemd/systemd/git/commits{/sha}","comments_url":"https://api.github.com/repos/systemd/systemd/comments{/number}","issue_comment_url":"https://api.github.com/repos/systemd/systemd/issues/comments{/number}","contents_url":"https://api.github.com/repos/systemd/systemd/contents/{+path}","compare_url":"https://api.github.com/repos/systemd/systemd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/systemd/systemd/merges","archive_url":"https://api.github.com/repos/systemd/systemd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/systemd/systemd/downloads","issues_url":"https://api.github.com/repos/systemd/systemd/issues{/number}","pulls_url":"https://api.github.com/repos/systemd/systemd/pulls{/number}","milestones_url":"https://api.github.com/repos/systemd/systemd/milestones{/number}","notifications_url":"https://api.github.com/repos/systemd/systemd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/systemd/systemd/labels{/name}","releases_url":"https://api.github.com/repos/systemd/systemd/releases{/id}","created_at":"2015-03-25T15:27:27Z","updated_at":"2015-06-25T09:30:08Z","pushed_at":"2015-06-25T11:56:09Z","git_url":"git://github.com/systemd/systemd.git","ssh_url":"git@github.com:systemd/systemd.git","clone_url":"https://github.com/systemd/systemd.git","svn_url":"https://github.com/systemd/systemd","homepage":"http://www.freedesktop.org/wiki/Software/systemd/","size":39709,"stargazers_count":351,"watchers_count":351,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":81,"mirror_url":null,"open_issues_count":50,"forks":81,"open_issues":50,"watchers":351,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/systemd/systemd/pulls/364"},"html":{"href":"https://github.com/systemd/systemd/pull/364"},"issue":{"href":"https://api.github.com/repos/systemd/systemd/issues/364"},"comments":{"href":"https://api.github.com/repos/systemd/systemd/issues/364/comments"},"review_comments":{"href":"https://api.github.com/repos/systemd/systemd/pulls/364/comments"},"review_comment":{"href":"https://api.github.com/repos/systemd/systemd/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/systemd/systemd/pulls/364/commits"},"statuses":{"href":"https://api.github.com/repos/systemd/systemd/statuses/9855fed36e9db1c31185dfe9709070e55fbd7089"}}}}