{"action":"created","comment":{"url":"https://api.github.com/repos/theairkit/zfs/pulls/comments/63471637","id":63471637,"diff_hunk":"@@ -0,0 +1,41 @@\n+#ifndef _LIBIOACCT_H\n+#define _LIBIOACCT_H\n+\n+#ifdef _KERNEL\n+#include <net/sock.h>\n+#include <linux/netlink.h>\n+#include <linux/kernel.h>\n+#include <linux/kthread.h>\n+#include <linux/sysctl.h>\n+#include \"sys/zfs_znode.h\"\n+#endif\n+\n+#ifndef _KERNEL\n+#include \"libzfs.h\"\n+#endif\n+\n+#define ZFS_NL_IO_PROTO\tNETLINK_USERSOCK","path":"include/libioacct.h","position":17,"original_position":17,"commit_id":"b2025707235703544394a604be3e6766b650bbc6","original_commit_id":"b2025707235703544394a604be3e6766b650bbc6","user":{"login":"theairkit","id":16580864,"avatar_url":"https://avatars.githubusercontent.com/u/16580864?v=3","gravatar_id":"","url":"https://api.github.com/users/theairkit","html_url":"https://github.com/theairkit","followers_url":"https://api.github.com/users/theairkit/followers","following_url":"https://api.github.com/users/theairkit/following{/other_user}","gists_url":"https://api.github.com/users/theairkit/gists{/gist_id}","starred_url":"https://api.github.com/users/theairkit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theairkit/subscriptions","organizations_url":"https://api.github.com/users/theairkit/orgs","repos_url":"https://api.github.com/users/theairkit/repos","events_url":"https://api.github.com/users/theairkit/events{/privacy}","received_events_url":"https://api.github.com/users/theairkit/received_events","type":"User","site_admin":false},"body":"с разметкой здесь (на github) не так;  в коде между идентификатором и значением в обоих случаях по одному tab'у; сам обратил на это внимание.","created_at":"2016-05-17T06:49:29Z","updated_at":"2016-05-17T06:49:29Z","html_url":"https://github.com/theairkit/zfs/pull/3#discussion_r63471637","pull_request_url":"https://api.github.com/repos/theairkit/zfs/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/theairkit/zfs/pulls/comments/63471637"},"html":{"href":"https://github.com/theairkit/zfs/pull/3#discussion_r63471637"},"pull_request":{"href":"https://api.github.com/repos/theairkit/zfs/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/theairkit/zfs/pulls/3","id":67858790,"html_url":"https://github.com/theairkit/zfs/pull/3","diff_url":"https://github.com/theairkit/zfs/pull/3.diff","patch_url":"https://github.com/theairkit/zfs/pull/3.patch","issue_url":"https://api.github.com/repos/theairkit/zfs/issues/3","number":3,"state":"open","locked":false,"title":"IO accounting implementation through netlink","user":{"login":"theairkit","id":16580864,"avatar_url":"https://avatars.githubusercontent.com/u/16580864?v=3","gravatar_id":"","url":"https://api.github.com/users/theairkit","html_url":"https://github.com/theairkit","followers_url":"https://api.github.com/users/theairkit/followers","following_url":"https://api.github.com/users/theairkit/following{/other_user}","gists_url":"https://api.github.com/users/theairkit/gists{/gist_id}","starred_url":"https://api.github.com/users/theairkit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theairkit/subscriptions","organizations_url":"https://api.github.com/users/theairkit/orgs","repos_url":"https://api.github.com/users/theairkit/repos","events_url":"https://api.github.com/users/theairkit/events{/privacy}","received_events_url":"https://api.github.com/users/theairkit/received_events","type":"User","site_admin":false},"body":"This patchset introduces per filesystem zfs io accounting.\r\nThis feature is required in my test and production environments for monitoring io per filesystem.\r\n\r\nSome details:\r\n- accounting implementation based on sending netlink multicast messages from zfs kernel module (and may by received in userspace);\r\n- **on each io operation zfs kernel module sends netlink multicast message, which contains full information about it: filesystem, pid, bytes, operation (read, write, mapped read, mapped write);**\r\n- **sending netlink messages from kernel fully non-blocking;**\r\n- accounting implemented on zpl/zfs-layers;\r\n- accounting managed by kernel mode parameter:\r\n```\r\n/sys/module/zfs/parameters/zfs_nl_ioacct # 0 - disable, any other - enable\r\n ```\r\n- this PR consists of two commits:\r\n    - one for kernel module;\r\n    - one for simple userspace utility, zfs_iostat (see below);\r\n- **zfs_iostat** utulity allow to get io statistics in realtime to stdout using next format:\r\n\r\n    ```\r\n    <filesystem> <pid> <bytes> <operation_type>\r\n    ```\r\n    Where _operation_type may_ be:\r\n    ```\r\n    cr - common read\r\n    cw - common write\r\n    mr - mapped read\r\n    mw - mapped write\r\n    ```\r\n     Example output:\r\n    ```\r\n    $ sudo ./cmd/zfs_iostat/zfs_iostat\r\n    zroot/instances/fs-one 31333 4096 cr\r\n    zroot/instances/fs-one 31333 4096 cr\r\n    ```","created_at":"2016-04-26T10:07:12Z","updated_at":"2016-05-17T06:49:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cf21d7b010cab77735705726c0400fee4b8de06c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/theairkit/zfs/pulls/3/commits","review_comments_url":"https://api.github.com/repos/theairkit/zfs/pulls/3/comments","review_comment_url":"https://api.github.com/repos/theairkit/zfs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/theairkit/zfs/issues/3/comments","statuses_url":"https://api.github.com/repos/theairkit/zfs/statuses/b2025707235703544394a604be3e6766b650bbc6","head":{"label":"theairkit:zfs-nl-ioacct","ref":"zfs-nl-ioacct","sha":"b2025707235703544394a604be3e6766b650bbc6","user":{"login":"theairkit","id":16580864,"avatar_url":"https://avatars.githubusercontent.com/u/16580864?v=3","gravatar_id":"","url":"https://api.github.com/users/theairkit","html_url":"https://github.com/theairkit","followers_url":"https://api.github.com/users/theairkit/followers","following_url":"https://api.github.com/users/theairkit/following{/other_user}","gists_url":"https://api.github.com/users/theairkit/gists{/gist_id}","starred_url":"https://api.github.com/users/theairkit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theairkit/subscriptions","organizations_url":"https://api.github.com/users/theairkit/orgs","repos_url":"https://api.github.com/users/theairkit/repos","events_url":"https://api.github.com/users/theairkit/events{/privacy}","received_events_url":"https://api.github.com/users/theairkit/received_events","type":"User","site_admin":false},"repo":{"id":49155063,"name":"zfs","full_name":"theairkit/zfs","owner":{"login":"theairkit","id":16580864,"avatar_url":"https://avatars.githubusercontent.com/u/16580864?v=3","gravatar_id":"","url":"https://api.github.com/users/theairkit","html_url":"https://github.com/theairkit","followers_url":"https://api.github.com/users/theairkit/followers","following_url":"https://api.github.com/users/theairkit/following{/other_user}","gists_url":"https://api.github.com/users/theairkit/gists{/gist_id}","starred_url":"https://api.github.com/users/theairkit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theairkit/subscriptions","organizations_url":"https://api.github.com/users/theairkit/orgs","repos_url":"https://api.github.com/users/theairkit/repos","events_url":"https://api.github.com/users/theairkit/events{/privacy}","received_events_url":"https://api.github.com/users/theairkit/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/theairkit/zfs","description":"Native ZFS for Linux","fork":true,"url":"https://api.github.com/repos/theairkit/zfs","forks_url":"https://api.github.com/repos/theairkit/zfs/forks","keys_url":"https://api.github.com/repos/theairkit/zfs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/theairkit/zfs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/theairkit/zfs/teams","hooks_url":"https://api.github.com/repos/theairkit/zfs/hooks","issue_events_url":"https://api.github.com/repos/theairkit/zfs/issues/events{/number}","events_url":"https://api.github.com/repos/theairkit/zfs/events","assignees_url":"https://api.github.com/repos/theairkit/zfs/assignees{/user}","branches_url":"https://api.github.com/repos/theairkit/zfs/branches{/branch}","tags_url":"https://api.github.com/repos/theairkit/zfs/tags","blobs_url":"https://api.github.com/repos/theairkit/zfs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/theairkit/zfs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/theairkit/zfs/git/refs{/sha}","trees_url":"https://api.github.com/repos/theairkit/zfs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/theairkit/zfs/statuses/{sha}","languages_url":"https://api.github.com/repos/theairkit/zfs/languages","stargazers_url":"https://api.github.com/repos/theairkit/zfs/stargazers","contributors_url":"https://api.github.com/repos/theairkit/zfs/contributors","subscribers_url":"https://api.github.com/repos/theairkit/zfs/subscribers","subscription_url":"https://api.github.com/repos/theairkit/zfs/subscription","commits_url":"https://api.github.com/repos/theairkit/zfs/commits{/sha}","git_commits_url":"https://api.github.com/repos/theairkit/zfs/git/commits{/sha}","comments_url":"https://api.github.com/repos/theairkit/zfs/comments{/number}","issue_comment_url":"https://api.github.com/repos/theairkit/zfs/issues/comments{/number}","contents_url":"https://api.github.com/repos/theairkit/zfs/contents/{+path}","compare_url":"https://api.github.com/repos/theairkit/zfs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/theairkit/zfs/merges","archive_url":"https://api.github.com/repos/theairkit/zfs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/theairkit/zfs/downloads","issues_url":"https://api.github.com/repos/theairkit/zfs/issues{/number}","pulls_url":"https://api.github.com/repos/theairkit/zfs/pulls{/number}","milestones_url":"https://api.github.com/repos/theairkit/zfs/milestones{/number}","notifications_url":"https://api.github.com/repos/theairkit/zfs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/theairkit/zfs/labels{/name}","releases_url":"https://api.github.com/repos/theairkit/zfs/releases{/id}","deployments_url":"https://api.github.com/repos/theairkit/zfs/deployments","created_at":"2016-01-06T18:56:04Z","updated_at":"2016-04-08T07:30:43Z","pushed_at":"2016-05-16T20:21:35Z","git_url":"git://github.com/theairkit/zfs.git","ssh_url":"git@github.com:theairkit/zfs.git","clone_url":"https://github.com/theairkit/zfs.git","svn_url":"https://github.com/theairkit/zfs","homepage":"http://zfsonlinux.org/","size":27935,"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":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"theairkit:master","ref":"master","sha":"2b54cb14517b8b3877716dbe02fe75f12a47eb5e","user":{"login":"theairkit","id":16580864,"avatar_url":"https://avatars.githubusercontent.com/u/16580864?v=3","gravatar_id":"","url":"https://api.github.com/users/theairkit","html_url":"https://github.com/theairkit","followers_url":"https://api.github.com/users/theairkit/followers","following_url":"https://api.github.com/users/theairkit/following{/other_user}","gists_url":"https://api.github.com/users/theairkit/gists{/gist_id}","starred_url":"https://api.github.com/users/theairkit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theairkit/subscriptions","organizations_url":"https://api.github.com/users/theairkit/orgs","repos_url":"https://api.github.com/users/theairkit/repos","events_url":"https://api.github.com/users/theairkit/events{/privacy}","received_events_url":"https://api.github.com/users/theairkit/received_events","type":"User","site_admin":false},"repo":{"id":49155063,"name":"zfs","full_name":"theairkit/zfs","owner":{"login":"theairkit","id":16580864,"avatar_url":"https://avatars.githubusercontent.com/u/16580864?v=3","gravatar_id":"","url":"https://api.github.com/users/theairkit","html_url":"https://github.com/theairkit","followers_url":"https://api.github.com/users/theairkit/followers","following_url":"https://api.github.com/users/theairkit/following{/other_user}","gists_url":"https://api.github.com/users/theairkit/gists{/gist_id}","starred_url":"https://api.github.com/users/theairkit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theairkit/subscriptions","organizations_url":"https://api.github.com/users/theairkit/orgs","repos_url":"https://api.github.com/users/theairkit/repos","events_url":"https://api.github.com/users/theairkit/events{/privacy}","received_events_url":"https://api.github.com/users/theairkit/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/theairkit/zfs","description":"Native ZFS for Linux","fork":true,"url":"https://api.github.com/repos/theairkit/zfs","forks_url":"https://api.github.com/repos/theairkit/zfs/forks","keys_url":"https://api.github.com/repos/theairkit/zfs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/theairkit/zfs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/theairkit/zfs/teams","hooks_url":"https://api.github.com/repos/theairkit/zfs/hooks","issue_events_url":"https://api.github.com/repos/theairkit/zfs/issues/events{/number}","events_url":"https://api.github.com/repos/theairkit/zfs/events","assignees_url":"https://api.github.com/repos/theairkit/zfs/assignees{/user}","branches_url":"https://api.github.com/repos/theairkit/zfs/branches{/branch}","tags_url":"https://api.github.com/repos/theairkit/zfs/tags","blobs_url":"https://api.github.com/repos/theairkit/zfs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/theairkit/zfs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/theairkit/zfs/git/refs{/sha}","trees_url":"https://api.github.com/repos/theairkit/zfs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/theairkit/zfs/statuses/{sha}","languages_url":"https://api.github.com/repos/theairkit/zfs/languages","stargazers_url":"https://api.github.com/repos/theairkit/zfs/stargazers","contributors_url":"https://api.github.com/repos/theairkit/zfs/contributors","subscribers_url":"https://api.github.com/repos/theairkit/zfs/subscribers","subscription_url":"https://api.github.com/repos/theairkit/zfs/subscription","commits_url":"https://api.github.com/repos/theairkit/zfs/commits{/sha}","git_commits_url":"https://api.github.com/repos/theairkit/zfs/git/commits{/sha}","comments_url":"https://api.github.com/repos/theairkit/zfs/comments{/number}","issue_comment_url":"https://api.github.com/repos/theairkit/zfs/issues/comments{/number}","contents_url":"https://api.github.com/repos/theairkit/zfs/contents/{+path}","compare_url":"https://api.github.com/repos/theairkit/zfs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/theairkit/zfs/merges","archive_url":"https://api.github.com/repos/theairkit/zfs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/theairkit/zfs/downloads","issues_url":"https://api.github.com/repos/theairkit/zfs/issues{/number}","pulls_url":"https://api.github.com/repos/theairkit/zfs/pulls{/number}","milestones_url":"https://api.github.com/repos/theairkit/zfs/milestones{/number}","notifications_url":"https://api.github.com/repos/theairkit/zfs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/theairkit/zfs/labels{/name}","releases_url":"https://api.github.com/repos/theairkit/zfs/releases{/id}","deployments_url":"https://api.github.com/repos/theairkit/zfs/deployments","created_at":"2016-01-06T18:56:04Z","updated_at":"2016-04-08T07:30:43Z","pushed_at":"2016-05-16T20:21:35Z","git_url":"git://github.com/theairkit/zfs.git","ssh_url":"git@github.com:theairkit/zfs.git","clone_url":"https://github.com/theairkit/zfs.git","svn_url":"https://github.com/theairkit/zfs","homepage":"http://zfsonlinux.org/","size":27935,"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":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/theairkit/zfs/pulls/3"},"html":{"href":"https://github.com/theairkit/zfs/pull/3"},"issue":{"href":"https://api.github.com/repos/theairkit/zfs/issues/3"},"comments":{"href":"https://api.github.com/repos/theairkit/zfs/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/theairkit/zfs/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/theairkit/zfs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/theairkit/zfs/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/theairkit/zfs/statuses/b2025707235703544394a604be3e6766b650bbc6"}}}}