{"action":"created","comment":{"url":"https://api.github.com/repos/zfsonlinux/zfs/pulls/comments/59953750","id":59953750,"diff_hunk":"@@ -3210,6 +3210,62 @@ spa_add_spares(spa_t *spa, nvlist_t *config)\n \t}\n }\n \n+/* Update a nvlist with latest extended stats values. */\n+static void\n+spa_update_l2cache_stats_ex(vdev_t *vd, nvlist_t *l2cache) {\n+\n+\tvdev_stat_ex_t *vsx;\n+\tint i;\n+\tuint64_t *ptr;\n+\tuint_t len;\n+\tstruct {\n+\t\tconst char *name;\n+\t\tunsigned int offset;\n+\t} list[] = {\n+\t\t{ZPOOL_CONFIG_QUEUE_ACTIVE,\n+\t\t    offsetof(vdev_stat_ex_t, vsx_queue_active)},\n+\t\t{ZPOOL_CONFIG_TOT_R_LAT_HISTO, offsetof(vdev_stat_ex_t,\n+\t\t    vsx_total_histo[ZIO_TYPE_READ])},\n+\t\t{ZPOOL_CONFIG_TOT_W_LAT_HISTO, offsetof(vdev_stat_ex_t,\n+\t\t    vsx_total_histo[ZIO_TYPE_WRITE])},\n+\t\t{ZPOOL_CONFIG_DISK_R_LAT_HISTO, offsetof(vdev_stat_ex_t,\n+\t\t    vsx_disk_histo[ZIO_TYPE_READ])},\n+\t\t{ZPOOL_CONFIG_DISK_W_LAT_HISTO, offsetof(vdev_stat_ex_t,\n+\t\t    vsx_disk_histo[ZIO_TYPE_WRITE])},\n+\t\t{ZPOOL_CONFIG_SYNC_R_LAT_HISTO, offsetof(vdev_stat_ex_t,\n+\t\t    vsx_queue_histo[ZIO_PRIORITY_SYNC_READ])},\n+\t\t{ZPOOL_CONFIG_SYNC_W_LAT_HISTO, offsetof(vdev_stat_ex_t,\n+\t\t    vsx_queue_histo[ZIO_PRIORITY_SYNC_WRITE])},\n+\t\t{ZPOOL_CONFIG_ASYNC_R_LAT_HISTO, offsetof(vdev_stat_ex_t,\n+\t\t    vsx_queue_histo[ZIO_PRIORITY_ASYNC_READ])},\n+\t\t{ZPOOL_CONFIG_ASYNC_W_LAT_HISTO, offsetof(vdev_stat_ex_t,\n+\t\t    vsx_queue_histo[ZIO_PRIORITY_ASYNC_WRITE])},\n+\t\t{ZPOOL_CONFIG_SCRUB_LAT_HISTO, offsetof(vdev_stat_ex_t,\n+\t\t    vsx_queue_histo[ZIO_PRIORITY_SCRUB])},\n+\t};\n+\n+\tvsx = kmem_alloc(sizeof (*vsx), KM_SLEEP);","path":"module/zfs/spa.c","position":38,"original_position":38,"commit_id":"1cdb2bf09b1291a5dc6f55579000a6d30c619155","original_commit_id":"1cdb2bf09b1291a5dc6f55579000a6d30c619155","user":{"login":"behlendorf","id":148917,"avatar_url":"https://avatars.githubusercontent.com/u/148917?v=3","gravatar_id":"","url":"https://api.github.com/users/behlendorf","html_url":"https://github.com/behlendorf","followers_url":"https://api.github.com/users/behlendorf/followers","following_url":"https://api.github.com/users/behlendorf/following{/other_user}","gists_url":"https://api.github.com/users/behlendorf/gists{/gist_id}","starred_url":"https://api.github.com/users/behlendorf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/behlendorf/subscriptions","organizations_url":"https://api.github.com/users/behlendorf/orgs","repos_url":"https://api.github.com/users/behlendorf/repos","events_url":"https://api.github.com/users/behlendorf/events{/privacy}","received_events_url":"https://api.github.com/users/behlendorf/received_events","type":"User","site_admin":false},"body":"This is a Solaris'ism but kmem_alloc(.., KM_SLEEP) is guaranteed to never fail.  Period.  We'll either get the memory or block here forever, so you can drop the error handling.","created_at":"2016-04-15T23:17:14Z","updated_at":"2016-04-15T23:17:14Z","html_url":"https://github.com/zfsonlinux/zfs/pull/4433#discussion_r59953750","pull_request_url":"https://api.github.com/repos/zfsonlinux/zfs/pulls/4433","_links":{"self":{"href":"https://api.github.com/repos/zfsonlinux/zfs/pulls/comments/59953750"},"html":{"href":"https://github.com/zfsonlinux/zfs/pull/4433#discussion_r59953750"},"pull_request":{"href":"https://api.github.com/repos/zfsonlinux/zfs/pulls/4433"}}},"pull_request":{"url":"https://api.github.com/repos/zfsonlinux/zfs/pulls/4433","id":63446581,"html_url":"https://github.com/zfsonlinux/zfs/pull/4433","diff_url":"https://github.com/zfsonlinux/zfs/pull/4433.diff","patch_url":"https://github.com/zfsonlinux/zfs/pull/4433.patch","issue_url":"https://api.github.com/repos/zfsonlinux/zfs/issues/4433","number":4433,"state":"open","locked":false,"title":"Add -lGhHp options to \"zpool iostat\" for avg latency, histogram, & queue stats","user":{"login":"tonyhutter","id":11469457,"avatar_url":"https://avatars.githubusercontent.com/u/11469457?v=3","gravatar_id":"","url":"https://api.github.com/users/tonyhutter","html_url":"https://github.com/tonyhutter","followers_url":"https://api.github.com/users/tonyhutter/followers","following_url":"https://api.github.com/users/tonyhutter/following{/other_user}","gists_url":"https://api.github.com/users/tonyhutter/gists{/gist_id}","starred_url":"https://api.github.com/users/tonyhutter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tonyhutter/subscriptions","organizations_url":"https://api.github.com/users/tonyhutter/orgs","repos_url":"https://api.github.com/users/tonyhutter/repos","events_url":"https://api.github.com/users/tonyhutter/events{/privacy}","received_events_url":"https://api.github.com/users/tonyhutter/received_events","type":"User","site_admin":false},"body":"Update the zfs module to collect statistics on average latencies, queue sizes,\r\nand keep an internal histogram of all IO latencies.  Along with this, update\r\n\"zpool iostat\" with some new options to print out the stats:\r\n\r\n**-l**: Include average IO latencies stats:\r\n\r\n```\r\n  capacity     operations     bandwidth    total_wait     disk_wait\r\nalloc   free   read  write   read  write   read  write   read  write\r\n-----  -----  -----  -----  -----  -----  -----  -----  -----  -----\r\n 260M   372G      0  2.20K    825   182M      -  384ms      -    2ms\r\n 132M   186G      0    311    275  36.6M      -  315ms      -  630us\r\n 129M   186G      0    309    275  36.4M      -  315ms      -  630us\r\n```\r\n\r\n**-G**: Print out latency histograms:\r\n\r\n```\r\nsdb           total           disk         sync_queue      async_queue\r\nlatency    read   write    read   write    read   write    read   write   scrub\r\n-------  ------  ------  ------  ------  ------  ------  ------  ------  ------\r\n1ns           0       0       0       0       0       0       0       0       0\r\n...\r\n33us          0       0       0       0       0       0       0       0       0\r\n66us          0       0     107    2486       2     788      12      12       0\r\n131us         2     797     359    4499      10     558     184     184       6\r\n262us        22     801     264    1563      10     286     287     287      24\r\n524us        87     575      71   52086      15    1063     136     136      92\r\n1ms         152    1190       5   41292       4    1693     252     252     141\r\n2ms         245    2018       0   50007       0    2322     371     371     220\r\n4ms         189    7455      22  162957       0    3912    6726    6726     199\r\n8ms         108    9461       0  102320       0    5775    2526    2526      86\r\n17ms         23   11287       0   37142       0    8043    1813    1813      19\r\n34ms          0   14725       0   24015       0   11732    3071    3071       0\r\n67ms          0   23597       0    7914       0   18113    5025    5025       0\r\n134ms         0   33798       0     254       0   25755    7326    7326       0\r\n268ms         0   51780       0      12       0   41593   10002   10002       0\r\n537ms         0   77808       0       0       0   64255   13120   13120       0\r\n1s            0  105281       0       0       0   83805   20841   20841       0\r\n2s            0   88248       0       0       0   73772   14006   14006       0\r\n4s            0   47266       0       0       0   29783   17176   17176       0\r\n9s            0   10460       0       0       0    4130    6295    6295       0\r\n17s           0       0       0       0       0       0       0       0       0\r\n34s           0       0       0       0       0       0       0       0       0\r\n69s           0       0       0       0       0       0       0       0       0\r\n137s          0       0       0       0       0       0       0       0       0\r\n-------------------------------------------------------------------------------\r\n```\r\n\r\n**-h**: Help\r\n\r\n**-H**: Scripted mode. Do not display headers, and separate fields by a single\r\n    tab instead of arbitrary space.\r\n\r\n**-q**: Include current number of entries in sync & async read/write queues,\r\n    and scrub queue:\r\n\r\n```\r\n sync_queue    async_queue\r\n read  write   read  write  scrub\r\n-----  -----  -----  -----  -----\r\n    0     10      0      3      0\r\n    0      0      0      3      0\r\n    0      0      0      1      0\r\n    0      0      0      0      0\r\n```\r\n**-p**: Display numbers in parseable (exact) values.\r\n\r\nLastly, update iostat syntax to allow the user to specify specific vdevs\r\nto show statistics for.  The three options for choosing pools/vdevs are:\r\n\r\nDisplay a list of pools:\r\n    _zpool iostat ... [pool ...]_\r\n\r\nDisplay a list of vdevs from a specific pool:\r\n    _zpool iostat ... [pool vdev ...]_\r\n\r\nDisplay a list of vdevs from any pools:\r\n    _zpool iostat ... [vdev ...]_","created_at":"2016-03-18T22:50:24Z","updated_at":"2016-04-15T23:17:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"613360047a2021d220f4a706d5c8949a2e2ea7c6","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/zfsonlinux/zfs/pulls/4433/commits","review_comments_url":"https://api.github.com/repos/zfsonlinux/zfs/pulls/4433/comments","review_comment_url":"https://api.github.com/repos/zfsonlinux/zfs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/zfsonlinux/zfs/issues/4433/comments","statuses_url":"https://api.github.com/repos/zfsonlinux/zfs/statuses/1cdb2bf09b1291a5dc6f55579000a6d30c619155","head":{"label":"tonyhutter:newstats","ref":"newstats","sha":"1cdb2bf09b1291a5dc6f55579000a6d30c619155","user":{"login":"tonyhutter","id":11469457,"avatar_url":"https://avatars.githubusercontent.com/u/11469457?v=3","gravatar_id":"","url":"https://api.github.com/users/tonyhutter","html_url":"https://github.com/tonyhutter","followers_url":"https://api.github.com/users/tonyhutter/followers","following_url":"https://api.github.com/users/tonyhutter/following{/other_user}","gists_url":"https://api.github.com/users/tonyhutter/gists{/gist_id}","starred_url":"https://api.github.com/users/tonyhutter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tonyhutter/subscriptions","organizations_url":"https://api.github.com/users/tonyhutter/orgs","repos_url":"https://api.github.com/users/tonyhutter/repos","events_url":"https://api.github.com/users/tonyhutter/events{/privacy}","received_events_url":"https://api.github.com/users/tonyhutter/received_events","type":"User","site_admin":false},"repo":{"id":52639123,"name":"zfs","full_name":"tonyhutter/zfs","owner":{"login":"tonyhutter","id":11469457,"avatar_url":"https://avatars.githubusercontent.com/u/11469457?v=3","gravatar_id":"","url":"https://api.github.com/users/tonyhutter","html_url":"https://github.com/tonyhutter","followers_url":"https://api.github.com/users/tonyhutter/followers","following_url":"https://api.github.com/users/tonyhutter/following{/other_user}","gists_url":"https://api.github.com/users/tonyhutter/gists{/gist_id}","starred_url":"https://api.github.com/users/tonyhutter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tonyhutter/subscriptions","organizations_url":"https://api.github.com/users/tonyhutter/orgs","repos_url":"https://api.github.com/users/tonyhutter/repos","events_url":"https://api.github.com/users/tonyhutter/events{/privacy}","received_events_url":"https://api.github.com/users/tonyhutter/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tonyhutter/zfs","description":"Native ZFS for Linux","fork":true,"url":"https://api.github.com/repos/tonyhutter/zfs","forks_url":"https://api.github.com/repos/tonyhutter/zfs/forks","keys_url":"https://api.github.com/repos/tonyhutter/zfs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tonyhutter/zfs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tonyhutter/zfs/teams","hooks_url":"https://api.github.com/repos/tonyhutter/zfs/hooks","issue_events_url":"https://api.github.com/repos/tonyhutter/zfs/issues/events{/number}","events_url":"https://api.github.com/repos/tonyhutter/zfs/events","assignees_url":"https://api.github.com/repos/tonyhutter/zfs/assignees{/user}","branches_url":"https://api.github.com/repos/tonyhutter/zfs/branches{/branch}","tags_url":"https://api.github.com/repos/tonyhutter/zfs/tags","blobs_url":"https://api.github.com/repos/tonyhutter/zfs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tonyhutter/zfs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tonyhutter/zfs/git/refs{/sha}","trees_url":"https://api.github.com/repos/tonyhutter/zfs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tonyhutter/zfs/statuses/{sha}","languages_url":"https://api.github.com/repos/tonyhutter/zfs/languages","stargazers_url":"https://api.github.com/repos/tonyhutter/zfs/stargazers","contributors_url":"https://api.github.com/repos/tonyhutter/zfs/contributors","subscribers_url":"https://api.github.com/repos/tonyhutter/zfs/subscribers","subscription_url":"https://api.github.com/repos/tonyhutter/zfs/subscription","commits_url":"https://api.github.com/repos/tonyhutter/zfs/commits{/sha}","git_commits_url":"https://api.github.com/repos/tonyhutter/zfs/git/commits{/sha}","comments_url":"https://api.github.com/repos/tonyhutter/zfs/comments{/number}","issue_comment_url":"https://api.github.com/repos/tonyhutter/zfs/issues/comments{/number}","contents_url":"https://api.github.com/repos/tonyhutter/zfs/contents/{+path}","compare_url":"https://api.github.com/repos/tonyhutter/zfs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tonyhutter/zfs/merges","archive_url":"https://api.github.com/repos/tonyhutter/zfs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tonyhutter/zfs/downloads","issues_url":"https://api.github.com/repos/tonyhutter/zfs/issues{/number}","pulls_url":"https://api.github.com/repos/tonyhutter/zfs/pulls{/number}","milestones_url":"https://api.github.com/repos/tonyhutter/zfs/milestones{/number}","notifications_url":"https://api.github.com/repos/tonyhutter/zfs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tonyhutter/zfs/labels{/name}","releases_url":"https://api.github.com/repos/tonyhutter/zfs/releases{/id}","deployments_url":"https://api.github.com/repos/tonyhutter/zfs/deployments","created_at":"2016-02-26T23:20:12Z","updated_at":"2016-02-26T23:20:16Z","pushed_at":"2016-04-14T21:53:02Z","git_url":"git://github.com/tonyhutter/zfs.git","ssh_url":"git@github.com:tonyhutter/zfs.git","clone_url":"https://github.com/tonyhutter/zfs.git","svn_url":"https://github.com/tonyhutter/zfs","homepage":"http://zfsonlinux.org/","size":30102,"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":"zfsonlinux:master","ref":"master","sha":"edd770ebfb8e389474be41070fc72a066bbcdaa4","user":{"login":"zfsonlinux","id":575083,"avatar_url":"https://avatars.githubusercontent.com/u/575083?v=3","gravatar_id":"","url":"https://api.github.com/users/zfsonlinux","html_url":"https://github.com/zfsonlinux","followers_url":"https://api.github.com/users/zfsonlinux/followers","following_url":"https://api.github.com/users/zfsonlinux/following{/other_user}","gists_url":"https://api.github.com/users/zfsonlinux/gists{/gist_id}","starred_url":"https://api.github.com/users/zfsonlinux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zfsonlinux/subscriptions","organizations_url":"https://api.github.com/users/zfsonlinux/orgs","repos_url":"https://api.github.com/users/zfsonlinux/repos","events_url":"https://api.github.com/users/zfsonlinux/events{/privacy}","received_events_url":"https://api.github.com/users/zfsonlinux/received_events","type":"Organization","site_admin":false},"repo":{"id":437011,"name":"zfs","full_name":"zfsonlinux/zfs","owner":{"login":"zfsonlinux","id":575083,"avatar_url":"https://avatars.githubusercontent.com/u/575083?v=3","gravatar_id":"","url":"https://api.github.com/users/zfsonlinux","html_url":"https://github.com/zfsonlinux","followers_url":"https://api.github.com/users/zfsonlinux/followers","following_url":"https://api.github.com/users/zfsonlinux/following{/other_user}","gists_url":"https://api.github.com/users/zfsonlinux/gists{/gist_id}","starred_url":"https://api.github.com/users/zfsonlinux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zfsonlinux/subscriptions","organizations_url":"https://api.github.com/users/zfsonlinux/orgs","repos_url":"https://api.github.com/users/zfsonlinux/repos","events_url":"https://api.github.com/users/zfsonlinux/events{/privacy}","received_events_url":"https://api.github.com/users/zfsonlinux/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zfsonlinux/zfs","description":"Native ZFS for Linux","fork":false,"url":"https://api.github.com/repos/zfsonlinux/zfs","forks_url":"https://api.github.com/repos/zfsonlinux/zfs/forks","keys_url":"https://api.github.com/repos/zfsonlinux/zfs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zfsonlinux/zfs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zfsonlinux/zfs/teams","hooks_url":"https://api.github.com/repos/zfsonlinux/zfs/hooks","issue_events_url":"https://api.github.com/repos/zfsonlinux/zfs/issues/events{/number}","events_url":"https://api.github.com/repos/zfsonlinux/zfs/events","assignees_url":"https://api.github.com/repos/zfsonlinux/zfs/assignees{/user}","branches_url":"https://api.github.com/repos/zfsonlinux/zfs/branches{/branch}","tags_url":"https://api.github.com/repos/zfsonlinux/zfs/tags","blobs_url":"https://api.github.com/repos/zfsonlinux/zfs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zfsonlinux/zfs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zfsonlinux/zfs/git/refs{/sha}","trees_url":"https://api.github.com/repos/zfsonlinux/zfs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zfsonlinux/zfs/statuses/{sha}","languages_url":"https://api.github.com/repos/zfsonlinux/zfs/languages","stargazers_url":"https://api.github.com/repos/zfsonlinux/zfs/stargazers","contributors_url":"https://api.github.com/repos/zfsonlinux/zfs/contributors","subscribers_url":"https://api.github.com/repos/zfsonlinux/zfs/subscribers","subscription_url":"https://api.github.com/repos/zfsonlinux/zfs/subscription","commits_url":"https://api.github.com/repos/zfsonlinux/zfs/commits{/sha}","git_commits_url":"https://api.github.com/repos/zfsonlinux/zfs/git/commits{/sha}","comments_url":"https://api.github.com/repos/zfsonlinux/zfs/comments{/number}","issue_comment_url":"https://api.github.com/repos/zfsonlinux/zfs/issues/comments{/number}","contents_url":"https://api.github.com/repos/zfsonlinux/zfs/contents/{+path}","compare_url":"https://api.github.com/repos/zfsonlinux/zfs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zfsonlinux/zfs/merges","archive_url":"https://api.github.com/repos/zfsonlinux/zfs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zfsonlinux/zfs/downloads","issues_url":"https://api.github.com/repos/zfsonlinux/zfs/issues{/number}","pulls_url":"https://api.github.com/repos/zfsonlinux/zfs/pulls{/number}","milestones_url":"https://api.github.com/repos/zfsonlinux/zfs/milestones{/number}","notifications_url":"https://api.github.com/repos/zfsonlinux/zfs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zfsonlinux/zfs/labels{/name}","releases_url":"https://api.github.com/repos/zfsonlinux/zfs/releases{/id}","deployments_url":"https://api.github.com/repos/zfsonlinux/zfs/deployments","created_at":"2009-12-14T20:20:34Z","updated_at":"2016-04-14T09:51:39Z","pushed_at":"2016-04-15T20:47:14Z","git_url":"git://github.com/zfsonlinux/zfs.git","ssh_url":"git@github.com:zfsonlinux/zfs.git","clone_url":"https://github.com/zfsonlinux/zfs.git","svn_url":"https://github.com/zfsonlinux/zfs","homepage":"http://zfsonlinux.org/","size":55401,"stargazers_count":1746,"watchers_count":1746,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":453,"mirror_url":null,"open_issues_count":1000,"forks":453,"open_issues":1000,"watchers":1746,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/zfsonlinux/zfs/pulls/4433"},"html":{"href":"https://github.com/zfsonlinux/zfs/pull/4433"},"issue":{"href":"https://api.github.com/repos/zfsonlinux/zfs/issues/4433"},"comments":{"href":"https://api.github.com/repos/zfsonlinux/zfs/issues/4433/comments"},"review_comments":{"href":"https://api.github.com/repos/zfsonlinux/zfs/pulls/4433/comments"},"review_comment":{"href":"https://api.github.com/repos/zfsonlinux/zfs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/zfsonlinux/zfs/pulls/4433/commits"},"statuses":{"href":"https://api.github.com/repos/zfsonlinux/zfs/statuses/1cdb2bf09b1291a5dc6f55579000a6d30c619155"}}}}