{"action":"created","comment":{"url":"https://api.github.com/repos/sysstat/sysstat/pulls/comments/27732600","id":27732600,"diff_hunk":"@@ -2104,5 +2104,59 @@ void read_filesystem(struct stats_filesystem *st_filesystem, int nbr)\n \tfclose(fp);\n }\n \n+/*\n+ ***************************************************************************\n+ * Read HBA statistics.\n+ *\n+ * IN:\n+ * @st_hba\t\tStructure where stats will be saved.\n+ * @nbr\t\t\tTotal number of HBAs.\n+ *\n+ * OUT:\n+ * @st_hba\tStructure with statistics.\n+ ***************************************************************************\n+ */\n+void read_hba(struct stats_hba *st_hba, int nbr)\n+{\n+\tDIR *dir;\n+\tFILE *fp;\n+\tstruct dirent *drd;\n+\tstruct stats_hba *st_hba_i;\n+\tint hba = 0;\n+\tchar word_stats[MAX_FS_LEN];\n+\tchar line[256];\n+\tunsigned int tx_frames;\n+\tunsigned int rx_frames;\n+\n+\t/* Each HBA, if present, will have its own hostX entry within SYSFS_HBA */\n+\tif ((dir = opendir(SYSFS_HBA)) == NULL)\n+\t\treturn; /* No HBAs */\n+\t\n+\twhile ((drd = readdir(dir)) != NULL) {\n+\t\tif(strncmp(drd->d_name,\"host\",4)==0) {\n+\t\t\tsprintf(word_stats,\"%s/%s/statistics/tx_frames\",SYSFS_HBA,drd->d_name);\n+\t\t\tif ((fp = fopen(word_stats, \"r\"))) {\n+\t\t\t\tif(fgets(line,sizeof(line),fp))\t\n+\t\t\t\t\tsscanf(line, \"%x\",&tx_frames);\n+\t\t\t\tfclose(fp);\n+\t\t\t}\n+\n+\t\t\tsprintf(word_stats,\"%s/%s/statistics/rx_frames\",SYSFS_HBA,drd->d_name);\n+\t\t\tif ((fp = fopen(word_stats, \"r\"))) {\n+\t\t\t\tif(fgets(line,sizeof(line),fp))\t\n+\t\t\t\t\tsscanf(line, \"%x\",&rx_frames);","path":"rd_stats.c","position":44,"original_position":44,"commit_id":"b1428e6d253825c1ecac7aae567e6a4a95f53887","original_commit_id":"b1428e6d253825c1ecac7aae567e6a4a95f53887","user":{"login":"sysstat","id":4254780,"avatar_url":"https://avatars.githubusercontent.com/u/4254780?v=3","gravatar_id":"","url":"https://api.github.com/users/sysstat","html_url":"https://github.com/sysstat","followers_url":"https://api.github.com/users/sysstat/followers","following_url":"https://api.github.com/users/sysstat/following{/other_user}","gists_url":"https://api.github.com/users/sysstat/gists{/gist_id}","starred_url":"https://api.github.com/users/sysstat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sysstat/subscriptions","organizations_url":"https://api.github.com/users/sysstat/orgs","repos_url":"https://api.github.com/users/sysstat/repos","events_url":"https://api.github.com/users/sysstat/events{/privacy}","received_events_url":"https://api.github.com/users/sysstat/received_events","type":"User","site_admin":false},"body":"Ditto","created_at":"2015-04-03T14:42:14Z","updated_at":"2015-04-03T14:42:14Z","html_url":"https://github.com/sysstat/sysstat/pull/45#discussion_r27732600","pull_request_url":"https://api.github.com/repos/sysstat/sysstat/pulls/45","_links":{"self":{"href":"https://api.github.com/repos/sysstat/sysstat/pulls/comments/27732600"},"html":{"href":"https://github.com/sysstat/sysstat/pull/45#discussion_r27732600"},"pull_request":{"href":"https://api.github.com/repos/sysstat/sysstat/pulls/45"}}},"pull_request":{"url":"https://api.github.com/repos/sysstat/sysstat/pulls/45","id":30643578,"html_url":"https://github.com/sysstat/sysstat/pull/45","diff_url":"https://github.com/sysstat/sysstat/pull/45.diff","patch_url":"https://github.com/sysstat/sysstat/pull/45.patch","issue_url":"https://api.github.com/repos/sysstat/sysstat/issues/45","number":45,"state":"open","locked":false,"title":"Introduce FC HBA statistics collection+reporting","user":{"login":"stevekay","id":4357610,"avatar_url":"https://avatars.githubusercontent.com/u/4357610?v=3","gravatar_id":"","url":"https://api.github.com/users/stevekay","html_url":"https://github.com/stevekay","followers_url":"https://api.github.com/users/stevekay/followers","following_url":"https://api.github.com/users/stevekay/following{/other_user}","gists_url":"https://api.github.com/users/stevekay/gists{/gist_id}","starred_url":"https://api.github.com/users/stevekay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevekay/subscriptions","organizations_url":"https://api.github.com/users/stevekay/orgs","repos_url":"https://api.github.com/users/stevekay/repos","events_url":"https://api.github.com/users/stevekay/events{/privacy}","received_events_url":"https://api.github.com/users/stevekay/received_events","type":"User","site_admin":false},"body":"Collect HBA statistics when -S DISK used with sadc.\r\nReport HBA statistics when -a used with sar.","created_at":"2015-03-06T13:14:51Z","updated_at":"2015-04-03T14:42:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9e15f32c1fbd254207f850fa7f0dbaf60ff856c0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/sysstat/sysstat/pulls/45/commits","review_comments_url":"https://api.github.com/repos/sysstat/sysstat/pulls/45/comments","review_comment_url":"https://api.github.com/repos/sysstat/sysstat/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sysstat/sysstat/issues/45/comments","statuses_url":"https://api.github.com/repos/sysstat/sysstat/statuses/b1428e6d253825c1ecac7aae567e6a4a95f53887","head":{"label":"stevekay:master","ref":"master","sha":"b1428e6d253825c1ecac7aae567e6a4a95f53887","user":{"login":"stevekay","id":4357610,"avatar_url":"https://avatars.githubusercontent.com/u/4357610?v=3","gravatar_id":"","url":"https://api.github.com/users/stevekay","html_url":"https://github.com/stevekay","followers_url":"https://api.github.com/users/stevekay/followers","following_url":"https://api.github.com/users/stevekay/following{/other_user}","gists_url":"https://api.github.com/users/stevekay/gists{/gist_id}","starred_url":"https://api.github.com/users/stevekay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevekay/subscriptions","organizations_url":"https://api.github.com/users/stevekay/orgs","repos_url":"https://api.github.com/users/stevekay/repos","events_url":"https://api.github.com/users/stevekay/events{/privacy}","received_events_url":"https://api.github.com/users/stevekay/received_events","type":"User","site_admin":false},"repo":{"id":31677274,"name":"sysstat","full_name":"stevekay/sysstat","owner":{"login":"stevekay","id":4357610,"avatar_url":"https://avatars.githubusercontent.com/u/4357610?v=3","gravatar_id":"","url":"https://api.github.com/users/stevekay","html_url":"https://github.com/stevekay","followers_url":"https://api.github.com/users/stevekay/followers","following_url":"https://api.github.com/users/stevekay/following{/other_user}","gists_url":"https://api.github.com/users/stevekay/gists{/gist_id}","starred_url":"https://api.github.com/users/stevekay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevekay/subscriptions","organizations_url":"https://api.github.com/users/stevekay/orgs","repos_url":"https://api.github.com/users/stevekay/repos","events_url":"https://api.github.com/users/stevekay/events{/privacy}","received_events_url":"https://api.github.com/users/stevekay/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/stevekay/sysstat","description":"Performance monitoring tools for Linux","fork":true,"url":"https://api.github.com/repos/stevekay/sysstat","forks_url":"https://api.github.com/repos/stevekay/sysstat/forks","keys_url":"https://api.github.com/repos/stevekay/sysstat/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stevekay/sysstat/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stevekay/sysstat/teams","hooks_url":"https://api.github.com/repos/stevekay/sysstat/hooks","issue_events_url":"https://api.github.com/repos/stevekay/sysstat/issues/events{/number}","events_url":"https://api.github.com/repos/stevekay/sysstat/events","assignees_url":"https://api.github.com/repos/stevekay/sysstat/assignees{/user}","branches_url":"https://api.github.com/repos/stevekay/sysstat/branches{/branch}","tags_url":"https://api.github.com/repos/stevekay/sysstat/tags","blobs_url":"https://api.github.com/repos/stevekay/sysstat/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stevekay/sysstat/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stevekay/sysstat/git/refs{/sha}","trees_url":"https://api.github.com/repos/stevekay/sysstat/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stevekay/sysstat/statuses/{sha}","languages_url":"https://api.github.com/repos/stevekay/sysstat/languages","stargazers_url":"https://api.github.com/repos/stevekay/sysstat/stargazers","contributors_url":"https://api.github.com/repos/stevekay/sysstat/contributors","subscribers_url":"https://api.github.com/repos/stevekay/sysstat/subscribers","subscription_url":"https://api.github.com/repos/stevekay/sysstat/subscription","commits_url":"https://api.github.com/repos/stevekay/sysstat/commits{/sha}","git_commits_url":"https://api.github.com/repos/stevekay/sysstat/git/commits{/sha}","comments_url":"https://api.github.com/repos/stevekay/sysstat/comments{/number}","issue_comment_url":"https://api.github.com/repos/stevekay/sysstat/issues/comments{/number}","contents_url":"https://api.github.com/repos/stevekay/sysstat/contents/{+path}","compare_url":"https://api.github.com/repos/stevekay/sysstat/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stevekay/sysstat/merges","archive_url":"https://api.github.com/repos/stevekay/sysstat/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stevekay/sysstat/downloads","issues_url":"https://api.github.com/repos/stevekay/sysstat/issues{/number}","pulls_url":"https://api.github.com/repos/stevekay/sysstat/pulls{/number}","milestones_url":"https://api.github.com/repos/stevekay/sysstat/milestones{/number}","notifications_url":"https://api.github.com/repos/stevekay/sysstat/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stevekay/sysstat/labels{/name}","releases_url":"https://api.github.com/repos/stevekay/sysstat/releases{/id}","created_at":"2015-03-04T20:04:33Z","updated_at":"2015-03-10T19:17:07Z","pushed_at":"2015-03-06T13:13:16Z","git_url":"git://github.com/stevekay/sysstat.git","ssh_url":"git@github.com:stevekay/sysstat.git","clone_url":"https://github.com/stevekay/sysstat.git","svn_url":"https://github.com/stevekay/sysstat","homepage":"http://sebastien.godard.pagesperso-orange.fr/","size":3018,"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":"sysstat:master","ref":"master","sha":"de89120af0f2e9f78b7583b656298c3cfe498e53","user":{"login":"sysstat","id":4254780,"avatar_url":"https://avatars.githubusercontent.com/u/4254780?v=3","gravatar_id":"","url":"https://api.github.com/users/sysstat","html_url":"https://github.com/sysstat","followers_url":"https://api.github.com/users/sysstat/followers","following_url":"https://api.github.com/users/sysstat/following{/other_user}","gists_url":"https://api.github.com/users/sysstat/gists{/gist_id}","starred_url":"https://api.github.com/users/sysstat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sysstat/subscriptions","organizations_url":"https://api.github.com/users/sysstat/orgs","repos_url":"https://api.github.com/users/sysstat/repos","events_url":"https://api.github.com/users/sysstat/events{/privacy}","received_events_url":"https://api.github.com/users/sysstat/received_events","type":"User","site_admin":false},"repo":{"id":9670198,"name":"sysstat","full_name":"sysstat/sysstat","owner":{"login":"sysstat","id":4254780,"avatar_url":"https://avatars.githubusercontent.com/u/4254780?v=3","gravatar_id":"","url":"https://api.github.com/users/sysstat","html_url":"https://github.com/sysstat","followers_url":"https://api.github.com/users/sysstat/followers","following_url":"https://api.github.com/users/sysstat/following{/other_user}","gists_url":"https://api.github.com/users/sysstat/gists{/gist_id}","starred_url":"https://api.github.com/users/sysstat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sysstat/subscriptions","organizations_url":"https://api.github.com/users/sysstat/orgs","repos_url":"https://api.github.com/users/sysstat/repos","events_url":"https://api.github.com/users/sysstat/events{/privacy}","received_events_url":"https://api.github.com/users/sysstat/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sysstat/sysstat","description":"Performance monitoring tools for Linux","fork":false,"url":"https://api.github.com/repos/sysstat/sysstat","forks_url":"https://api.github.com/repos/sysstat/sysstat/forks","keys_url":"https://api.github.com/repos/sysstat/sysstat/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sysstat/sysstat/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sysstat/sysstat/teams","hooks_url":"https://api.github.com/repos/sysstat/sysstat/hooks","issue_events_url":"https://api.github.com/repos/sysstat/sysstat/issues/events{/number}","events_url":"https://api.github.com/repos/sysstat/sysstat/events","assignees_url":"https://api.github.com/repos/sysstat/sysstat/assignees{/user}","branches_url":"https://api.github.com/repos/sysstat/sysstat/branches{/branch}","tags_url":"https://api.github.com/repos/sysstat/sysstat/tags","blobs_url":"https://api.github.com/repos/sysstat/sysstat/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sysstat/sysstat/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sysstat/sysstat/git/refs{/sha}","trees_url":"https://api.github.com/repos/sysstat/sysstat/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sysstat/sysstat/statuses/{sha}","languages_url":"https://api.github.com/repos/sysstat/sysstat/languages","stargazers_url":"https://api.github.com/repos/sysstat/sysstat/stargazers","contributors_url":"https://api.github.com/repos/sysstat/sysstat/contributors","subscribers_url":"https://api.github.com/repos/sysstat/sysstat/subscribers","subscription_url":"https://api.github.com/repos/sysstat/sysstat/subscription","commits_url":"https://api.github.com/repos/sysstat/sysstat/commits{/sha}","git_commits_url":"https://api.github.com/repos/sysstat/sysstat/git/commits{/sha}","comments_url":"https://api.github.com/repos/sysstat/sysstat/comments{/number}","issue_comment_url":"https://api.github.com/repos/sysstat/sysstat/issues/comments{/number}","contents_url":"https://api.github.com/repos/sysstat/sysstat/contents/{+path}","compare_url":"https://api.github.com/repos/sysstat/sysstat/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sysstat/sysstat/merges","archive_url":"https://api.github.com/repos/sysstat/sysstat/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sysstat/sysstat/downloads","issues_url":"https://api.github.com/repos/sysstat/sysstat/issues{/number}","pulls_url":"https://api.github.com/repos/sysstat/sysstat/pulls{/number}","milestones_url":"https://api.github.com/repos/sysstat/sysstat/milestones{/number}","notifications_url":"https://api.github.com/repos/sysstat/sysstat/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sysstat/sysstat/labels{/name}","releases_url":"https://api.github.com/repos/sysstat/sysstat/releases{/id}","created_at":"2013-04-25T11:23:10Z","updated_at":"2015-04-03T09:11:17Z","pushed_at":"2015-04-03T09:11:16Z","git_url":"git://github.com/sysstat/sysstat.git","ssh_url":"git@github.com:sysstat/sysstat.git","clone_url":"https://github.com/sysstat/sysstat.git","svn_url":"https://github.com/sysstat/sysstat","homepage":"http://sebastien.godard.pagesperso-orange.fr/","size":3479,"stargazers_count":161,"watchers_count":161,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":46,"mirror_url":null,"open_issues_count":8,"forks":46,"open_issues":8,"watchers":161,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sysstat/sysstat/pulls/45"},"html":{"href":"https://github.com/sysstat/sysstat/pull/45"},"issue":{"href":"https://api.github.com/repos/sysstat/sysstat/issues/45"},"comments":{"href":"https://api.github.com/repos/sysstat/sysstat/issues/45/comments"},"review_comments":{"href":"https://api.github.com/repos/sysstat/sysstat/pulls/45/comments"},"review_comment":{"href":"https://api.github.com/repos/sysstat/sysstat/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sysstat/sysstat/pulls/45/commits"},"statuses":{"href":"https://api.github.com/repos/sysstat/sysstat/statuses/b1428e6d253825c1ecac7aae567e6a4a95f53887"}}}}