{"action":"created","comment":{"url":"https://api.github.com/repos/openucx/ucx/pulls/comments/52107072","id":52107072,"diff_hunk":"@@ -91,4 +91,52 @@ void __uct_ib_log_exp_post_send(const char *file, int line, const char *function\n         __uct_ib_log_exp_post_send(__FILE__, __LINE__, __FUNCTION__, _iface, _qp, _wr, _dump_cb); \\\n     }\n \n+\n+#if HAVE_INSTRUMENTATION\n+\n+#define CHECK_RECV_SIGNALED(wr) (1)\n+\n+#define CHECK_SEND_SIGNALED(wr) \\\n+    ((wr->send_flags & IBV_SEND_SIGNALED) && (wr->opcode == IBV_WR_SEND))\n+\n+#define CHECK_SEND_EXP_SIGNALED(wr) \\\n+    ((wr->exp_send_flags & IBV_EXP_SEND_SIGNALED) && \\\n+     (wr->exp_opcode == IBV_EXP_WR_SEND))\n+\n+#define UCS_INSTRUMENT_RECORD_WR_LEN(type, name, wr, check) { \\\n+    typeof(wr) iterator = (wr); \\\n+    while (iterator) { \\\n+        if (check(iterator)) {\\\n+            size_t length = 0; \\\n+            int sge_index; \\\n+            for (sge_index = 0; sge_index < iterator->num_sge; sge_index++) { \\\n+                length += iterator->sg_list[sge_index].length; \\\n+            } \\\n+            UCS_INSTRUMENT_RECORD(type, name, iterator->wr_id, length); \\\n+        } \\\n+        iterator = iterator->next; \\\n+    } \\\n+}\n+\n+#define UCS_INSTRUMENT_RECORD_RECV_WR_LEN(name, wr) \\\n+        UCS_INSTRUMENT_RECORD_WR_LEN(UCS_INSTRUMENT_TYPE_IB_RX, name, wr, \\\n+                                     CHECK_RECV_SIGNALED)\n+\n+#define UCS_INSTRUMENT_RECORD_SEND_WR_LEN(name, wr) \\\n+        UCS_INSTRUMENT_RECORD_WR_LEN(UCS_INSTRUMENT_TYPE_IB_TX, name, wr, \\\n+                                     CHECK_SEND_SIGNALED)\n+\n+#define UCS_INSTRUMENT_RECORD_SEND_EXP_WR_LEN(name, wr) \\\n+        UCS_INSTRUMENT_RECORD_WR_LEN(UCS_INSTRUMENT_TYPE_IB_TX, name, wr, \\\n+                                     CHECK_SEND_EXP_SIGNALED)\n+\n+#else\n+\n+#define UCS_INSTRUMENT_RECORD_WR_LEN          UCS_INSTRUMENT_RECORD","path":"src/uct/ib/base/ib_log.h","position":45,"original_position":45,"commit_id":"4f1d2cee8ddc676141f4e6e2f143d763579072f5","original_commit_id":"4f1d2cee8ddc676141f4e6e2f143d763579072f5","user":{"login":"yosefe","id":2255631,"avatar_url":"https://avatars.githubusercontent.com/u/2255631?v=3","gravatar_id":"","url":"https://api.github.com/users/yosefe","html_url":"https://github.com/yosefe","followers_url":"https://api.github.com/users/yosefe/followers","following_url":"https://api.github.com/users/yosefe/following{/other_user}","gists_url":"https://api.github.com/users/yosefe/gists{/gist_id}","starred_url":"https://api.github.com/users/yosefe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yosefe/subscriptions","organizations_url":"https://api.github.com/users/yosefe/orgs","repos_url":"https://api.github.com/users/yosefe/repos","events_url":"https://api.github.com/users/yosefe/events{/privacy}","received_events_url":"https://api.github.com/users/yosefe/received_events","type":"User","site_admin":false},"body":"why not define to empty?","created_at":"2016-02-06T20:29:57Z","updated_at":"2016-02-06T20:29:57Z","html_url":"https://github.com/openucx/ucx/pull/570#discussion_r52107072","pull_request_url":"https://api.github.com/repos/openucx/ucx/pulls/570","_links":{"self":{"href":"https://api.github.com/repos/openucx/ucx/pulls/comments/52107072"},"html":{"href":"https://github.com/openucx/ucx/pull/570#discussion_r52107072"},"pull_request":{"href":"https://api.github.com/repos/openucx/ucx/pulls/570"}}},"pull_request":{"url":"https://api.github.com/repos/openucx/ucx/pulls/570","id":56756777,"html_url":"https://github.com/openucx/ucx/pull/570","diff_url":"https://github.com/openucx/ucx/pull/570.diff","patch_url":"https://github.com/openucx/ucx/pull/570.patch","issue_url":"https://api.github.com/repos/openucx/ucx/issues/570","number":570,"state":"open","locked":false,"title":"UCT/IB: Added instrumentation capability","user":{"login":"alex--m","id":8146151,"avatar_url":"https://avatars.githubusercontent.com/u/8146151?v=3","gravatar_id":"","url":"https://api.github.com/users/alex--m","html_url":"https://github.com/alex--m","followers_url":"https://api.github.com/users/alex--m/followers","following_url":"https://api.github.com/users/alex--m/following{/other_user}","gists_url":"https://api.github.com/users/alex--m/gists{/gist_id}","starred_url":"https://api.github.com/users/alex--m/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alex--m/subscriptions","organizations_url":"https://api.github.com/users/alex--m/orgs","repos_url":"https://api.github.com/users/alex--m/repos","events_url":"https://api.github.com/users/alex--m/events{/privacy}","received_events_url":"https://api.github.com/users/alex--m/received_events","type":"User","site_admin":false},"body":"This feature was \"dormant\" in the code - now can be enabled per record type. In this case: using \"--enable-ib-tx-instrumentation\" will record post_send and corresponding (tx) completions, and using \"--enable-ib-rx-instrumentation\" will record post_recv and corresponding (rx) completions. There are additional change-sets for parsing the instrumentation result file using python, and other fixes on the way.","created_at":"2016-01-21T14:34:12Z","updated_at":"2016-02-06T20:29:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3f02d19f6da6bad35f98caf5b75eab8f0204b29f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/openucx/ucx/pulls/570/commits","review_comments_url":"https://api.github.com/repos/openucx/ucx/pulls/570/comments","review_comment_url":"https://api.github.com/repos/openucx/ucx/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openucx/ucx/issues/570/comments","statuses_url":"https://api.github.com/repos/openucx/ucx/statuses/4f1d2cee8ddc676141f4e6e2f143d763579072f5","head":{"label":"alex--m:instrumentation","ref":"instrumentation","sha":"4f1d2cee8ddc676141f4e6e2f143d763579072f5","user":{"login":"alex--m","id":8146151,"avatar_url":"https://avatars.githubusercontent.com/u/8146151?v=3","gravatar_id":"","url":"https://api.github.com/users/alex--m","html_url":"https://github.com/alex--m","followers_url":"https://api.github.com/users/alex--m/followers","following_url":"https://api.github.com/users/alex--m/following{/other_user}","gists_url":"https://api.github.com/users/alex--m/gists{/gist_id}","starred_url":"https://api.github.com/users/alex--m/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alex--m/subscriptions","organizations_url":"https://api.github.com/users/alex--m/orgs","repos_url":"https://api.github.com/users/alex--m/repos","events_url":"https://api.github.com/users/alex--m/events{/privacy}","received_events_url":"https://api.github.com/users/alex--m/received_events","type":"User","site_admin":false},"repo":{"id":49874463,"name":"ucx","full_name":"alex--m/ucx","owner":{"login":"alex--m","id":8146151,"avatar_url":"https://avatars.githubusercontent.com/u/8146151?v=3","gravatar_id":"","url":"https://api.github.com/users/alex--m","html_url":"https://github.com/alex--m","followers_url":"https://api.github.com/users/alex--m/followers","following_url":"https://api.github.com/users/alex--m/following{/other_user}","gists_url":"https://api.github.com/users/alex--m/gists{/gist_id}","starred_url":"https://api.github.com/users/alex--m/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alex--m/subscriptions","organizations_url":"https://api.github.com/users/alex--m/orgs","repos_url":"https://api.github.com/users/alex--m/repos","events_url":"https://api.github.com/users/alex--m/events{/privacy}","received_events_url":"https://api.github.com/users/alex--m/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/alex--m/ucx","description":"Unified Communication X  (mailing list - https://elist.ornl.gov/mailman/listinfo/ucx-group): ","fork":true,"url":"https://api.github.com/repos/alex--m/ucx","forks_url":"https://api.github.com/repos/alex--m/ucx/forks","keys_url":"https://api.github.com/repos/alex--m/ucx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alex--m/ucx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alex--m/ucx/teams","hooks_url":"https://api.github.com/repos/alex--m/ucx/hooks","issue_events_url":"https://api.github.com/repos/alex--m/ucx/issues/events{/number}","events_url":"https://api.github.com/repos/alex--m/ucx/events","assignees_url":"https://api.github.com/repos/alex--m/ucx/assignees{/user}","branches_url":"https://api.github.com/repos/alex--m/ucx/branches{/branch}","tags_url":"https://api.github.com/repos/alex--m/ucx/tags","blobs_url":"https://api.github.com/repos/alex--m/ucx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alex--m/ucx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alex--m/ucx/git/refs{/sha}","trees_url":"https://api.github.com/repos/alex--m/ucx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alex--m/ucx/statuses/{sha}","languages_url":"https://api.github.com/repos/alex--m/ucx/languages","stargazers_url":"https://api.github.com/repos/alex--m/ucx/stargazers","contributors_url":"https://api.github.com/repos/alex--m/ucx/contributors","subscribers_url":"https://api.github.com/repos/alex--m/ucx/subscribers","subscription_url":"https://api.github.com/repos/alex--m/ucx/subscription","commits_url":"https://api.github.com/repos/alex--m/ucx/commits{/sha}","git_commits_url":"https://api.github.com/repos/alex--m/ucx/git/commits{/sha}","comments_url":"https://api.github.com/repos/alex--m/ucx/comments{/number}","issue_comment_url":"https://api.github.com/repos/alex--m/ucx/issues/comments{/number}","contents_url":"https://api.github.com/repos/alex--m/ucx/contents/{+path}","compare_url":"https://api.github.com/repos/alex--m/ucx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alex--m/ucx/merges","archive_url":"https://api.github.com/repos/alex--m/ucx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alex--m/ucx/downloads","issues_url":"https://api.github.com/repos/alex--m/ucx/issues{/number}","pulls_url":"https://api.github.com/repos/alex--m/ucx/pulls{/number}","milestones_url":"https://api.github.com/repos/alex--m/ucx/milestones{/number}","notifications_url":"https://api.github.com/repos/alex--m/ucx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alex--m/ucx/labels{/name}","releases_url":"https://api.github.com/repos/alex--m/ucx/releases{/id}","deployments_url":"https://api.github.com/repos/alex--m/ucx/deployments","created_at":"2016-01-18T12:11:10Z","updated_at":"2016-01-18T12:11:12Z","pushed_at":"2016-02-06T13:15:41Z","git_url":"git://github.com/alex--m/ucx.git","ssh_url":"git@github.com:alex--m/ucx.git","clone_url":"https://github.com/alex--m/ucx.git","svn_url":"https://github.com/alex--m/ucx","homepage":" http://www.openucx.org","size":4008,"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":"openucx:master","ref":"master","sha":"0fd2c2786dca8706738846e7055d076047307bf4","user":{"login":"openucx","id":13118737,"avatar_url":"https://avatars.githubusercontent.com/u/13118737?v=3","gravatar_id":"","url":"https://api.github.com/users/openucx","html_url":"https://github.com/openucx","followers_url":"https://api.github.com/users/openucx/followers","following_url":"https://api.github.com/users/openucx/following{/other_user}","gists_url":"https://api.github.com/users/openucx/gists{/gist_id}","starred_url":"https://api.github.com/users/openucx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openucx/subscriptions","organizations_url":"https://api.github.com/users/openucx/orgs","repos_url":"https://api.github.com/users/openucx/repos","events_url":"https://api.github.com/users/openucx/events{/privacy}","received_events_url":"https://api.github.com/users/openucx/received_events","type":"Organization","site_admin":false},"repo":{"id":25379390,"name":"ucx","full_name":"openucx/ucx","owner":{"login":"openucx","id":13118737,"avatar_url":"https://avatars.githubusercontent.com/u/13118737?v=3","gravatar_id":"","url":"https://api.github.com/users/openucx","html_url":"https://github.com/openucx","followers_url":"https://api.github.com/users/openucx/followers","following_url":"https://api.github.com/users/openucx/following{/other_user}","gists_url":"https://api.github.com/users/openucx/gists{/gist_id}","starred_url":"https://api.github.com/users/openucx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openucx/subscriptions","organizations_url":"https://api.github.com/users/openucx/orgs","repos_url":"https://api.github.com/users/openucx/repos","events_url":"https://api.github.com/users/openucx/events{/privacy}","received_events_url":"https://api.github.com/users/openucx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openucx/ucx","description":"Unified Communication X  (mailing list - https://elist.ornl.gov/mailman/listinfo/ucx-group): ","fork":false,"url":"https://api.github.com/repos/openucx/ucx","forks_url":"https://api.github.com/repos/openucx/ucx/forks","keys_url":"https://api.github.com/repos/openucx/ucx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openucx/ucx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openucx/ucx/teams","hooks_url":"https://api.github.com/repos/openucx/ucx/hooks","issue_events_url":"https://api.github.com/repos/openucx/ucx/issues/events{/number}","events_url":"https://api.github.com/repos/openucx/ucx/events","assignees_url":"https://api.github.com/repos/openucx/ucx/assignees{/user}","branches_url":"https://api.github.com/repos/openucx/ucx/branches{/branch}","tags_url":"https://api.github.com/repos/openucx/ucx/tags","blobs_url":"https://api.github.com/repos/openucx/ucx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openucx/ucx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openucx/ucx/git/refs{/sha}","trees_url":"https://api.github.com/repos/openucx/ucx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openucx/ucx/statuses/{sha}","languages_url":"https://api.github.com/repos/openucx/ucx/languages","stargazers_url":"https://api.github.com/repos/openucx/ucx/stargazers","contributors_url":"https://api.github.com/repos/openucx/ucx/contributors","subscribers_url":"https://api.github.com/repos/openucx/ucx/subscribers","subscription_url":"https://api.github.com/repos/openucx/ucx/subscription","commits_url":"https://api.github.com/repos/openucx/ucx/commits{/sha}","git_commits_url":"https://api.github.com/repos/openucx/ucx/git/commits{/sha}","comments_url":"https://api.github.com/repos/openucx/ucx/comments{/number}","issue_comment_url":"https://api.github.com/repos/openucx/ucx/issues/comments{/number}","contents_url":"https://api.github.com/repos/openucx/ucx/contents/{+path}","compare_url":"https://api.github.com/repos/openucx/ucx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openucx/ucx/merges","archive_url":"https://api.github.com/repos/openucx/ucx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openucx/ucx/downloads","issues_url":"https://api.github.com/repos/openucx/ucx/issues{/number}","pulls_url":"https://api.github.com/repos/openucx/ucx/pulls{/number}","milestones_url":"https://api.github.com/repos/openucx/ucx/milestones{/number}","notifications_url":"https://api.github.com/repos/openucx/ucx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openucx/ucx/labels{/name}","releases_url":"https://api.github.com/repos/openucx/ucx/releases{/id}","deployments_url":"https://api.github.com/repos/openucx/ucx/deployments","created_at":"2014-10-17T22:17:24Z","updated_at":"2016-02-01T08:04:14Z","pushed_at":"2016-02-06T13:15:42Z","git_url":"git://github.com/openucx/ucx.git","ssh_url":"git@github.com:openucx/ucx.git","clone_url":"https://github.com/openucx/ucx.git","svn_url":"https://github.com/openucx/ucx","homepage":" http://www.openucx.org","size":5640,"stargazers_count":27,"watchers_count":27,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":23,"mirror_url":null,"open_issues_count":60,"forks":23,"open_issues":60,"watchers":27,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openucx/ucx/pulls/570"},"html":{"href":"https://github.com/openucx/ucx/pull/570"},"issue":{"href":"https://api.github.com/repos/openucx/ucx/issues/570"},"comments":{"href":"https://api.github.com/repos/openucx/ucx/issues/570/comments"},"review_comments":{"href":"https://api.github.com/repos/openucx/ucx/pulls/570/comments"},"review_comment":{"href":"https://api.github.com/repos/openucx/ucx/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openucx/ucx/pulls/570/commits"},"statuses":{"href":"https://api.github.com/repos/openucx/ucx/statuses/4f1d2cee8ddc676141f4e6e2f143d763579072f5"}}}}