{"action":"created","comment":{"url":"https://api.github.com/repos/ofiwg/libfabric/pulls/comments/26629957","id":26629957,"diff_hunk":"@@ -131,6 +158,27 @@ static int fi_register_provider(struct fi_provider *provider, void *dlhandle)\n \n \tprov->dlhandle = dlhandle;\n \tprov->provider = provider;\n+\n+\t/*\n+\t * If context->internal[0] is not set then generate a position to use.\n+\t * If this is the first one then use DYNAMIC_START, if not then check\n+\t * the tail and add 1.\n+\t */\n+\tif (!FI_LOG_CTX(provider)) {\n+\t\tFI_LOG_CTX(provider) = malloc(sizeof(int));\n+\t\tif (prov_tail) {\n+\t\t\t*(int *)FI_LOG_CTX(provider) =\n+\t\t\t    *(int *)FI_LOG_CTX(prov_tail->provider) + 1;\n+\t\t} else {\n+\t\t\t*(int *)FI_LOG_CTX(provider) = DYNAMIC_START;\n+\t\t}\n+\t}","path":"src/fabric.c","position":124,"original_position":124,"commit_id":"657c33dda67ab11c847325946bac29b24d2bc474","original_commit_id":"657c33dda67ab11c847325946bac29b24d2bc474","user":{"login":"shefty","id":3967608,"avatar_url":"https://avatars.githubusercontent.com/u/3967608?v=3","gravatar_id":"","url":"https://api.github.com/users/shefty","html_url":"https://github.com/shefty","followers_url":"https://api.github.com/users/shefty/followers","following_url":"https://api.github.com/users/shefty/following{/other_user}","gists_url":"https://api.github.com/users/shefty/gists{/gist_id}","starred_url":"https://api.github.com/users/shefty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shefty/subscriptions","organizations_url":"https://api.github.com/users/shefty/orgs","repos_url":"https://api.github.com/users/shefty/repos","events_url":"https://api.github.com/users/shefty/events{/privacy}","received_events_url":"https://api.github.com/users/shefty/received_events","type":"User","site_admin":false},"body":"This is a copy-paste of code immediately above it.","created_at":"2015-03-18T00:37:34Z","updated_at":"2015-03-18T00:37:34Z","html_url":"https://github.com/ofiwg/libfabric/pull/711#discussion_r26629957","pull_request_url":"https://api.github.com/repos/ofiwg/libfabric/pulls/711","_links":{"self":{"href":"https://api.github.com/repos/ofiwg/libfabric/pulls/comments/26629957"},"html":{"href":"https://github.com/ofiwg/libfabric/pull/711#discussion_r26629957"},"pull_request":{"href":"https://api.github.com/repos/ofiwg/libfabric/pulls/711"}}},"pull_request":{"url":"https://api.github.com/repos/ofiwg/libfabric/pulls/711","id":30234333,"html_url":"https://github.com/ofiwg/libfabric/pull/711","diff_url":"https://github.com/ofiwg/libfabric/pull/711.diff","patch_url":"https://github.com/ofiwg/libfabric/pull/711.patch","issue_url":"https://api.github.com/repos/ofiwg/libfabric/issues/711","number":711,"state":"open","locked":false,"title":"Implement logging with fine grained control over output.","user":{"login":"bturrubiates","id":2322856,"avatar_url":"https://avatars.githubusercontent.com/u/2322856?v=3","gravatar_id":"","url":"https://api.github.com/users/bturrubiates","html_url":"https://github.com/bturrubiates","followers_url":"https://api.github.com/users/bturrubiates/followers","following_url":"https://api.github.com/users/bturrubiates/following{/other_user}","gists_url":"https://api.github.com/users/bturrubiates/gists{/gist_id}","starred_url":"https://api.github.com/users/bturrubiates/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bturrubiates/subscriptions","organizations_url":"https://api.github.com/users/bturrubiates/orgs","repos_url":"https://api.github.com/users/bturrubiates/repos","events_url":"https://api.github.com/users/bturrubiates/events{/privacy}","received_events_url":"https://api.github.com/users/bturrubiates/received_events","type":"User","site_admin":false},"body":"Not sure if this is ready for merging, but this is the current iteration and a pull request makes it easier to receive feedback. \r\n\r\nThoughts? @shefty, @hppritcha\r\n\r\n- Define three log levels: LOG_WARN (1), LOG_TRACE (3), LOG_INFO (7)\r\n  LOG_WARN: Intended for warnings.\r\n  LOG_TRACE: Intended for non-detailed output meant to trace execution, or\r\n  provide useful information.\r\n  LOG_INFO: Higher traffic logging meant for detailed output.\r\n\r\n- Define 8 subsystems: FABRIC (0), DOMAIN (1), EP_CM (2), EP_DM (3), AV (4), CQ\r\n  (5), EQ (6), MR (7).\r\n\r\n- Define three new environment variables:\r\n  - FI_LOG_LEVEL: Controls log level. Valid values are: \"warn\", \"trace\",\r\n    \"info\". Each level cascades. Level info will also trigger \"warn\" and\r\n    \"trace\" output.\r\n  - FI_LOG_PROV: Controls the provider output.\r\n  - FI_LOG_SUBSYSTEMS: Controls the subsystem output. Valid values are:\r\n  \"fabric\", \"domain\", \"ep_cm\", \"ep_dm\", \"av\", \"cq\", \"eq\", \"mr\".\r\n\r\n- Define new logging macros:\r\n  - FI_ERR, FI_SERR:\r\n    Intended for errors. Always logged.\r\n  - FI_LOG, FI_SLOG:\r\n    Intended for logging. Print if user intended provider and log level match\r\n    log statement. FI_SLOG also depends on the subsystem.\r\n  - FI_DEBUG, FI_SDEBUG:\r\n    Always prints when configured with --enable-debug.\r\n\r\n- Logging from all providers and subsystems is enabled by default.\r\n\r\n- Specific provider and subsystems can be provided using the following syntax:\r\n  - Negating a list of options by preceding it with '^' symbol.\r\n  - Providing a list of options.\r\n\r\nSigned-off-by: Ben Turrubiates <bturrubiates@lanl.gov>","created_at":"2015-03-01T00:50:25Z","updated_at":"2015-03-18T00:37:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f69997981acdc2d0d51f99c7302e746c53b2b744","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ofiwg/libfabric/pulls/711/commits","review_comments_url":"https://api.github.com/repos/ofiwg/libfabric/pulls/711/comments","review_comment_url":"https://api.github.com/repos/ofiwg/libfabric/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ofiwg/libfabric/issues/711/comments","statuses_url":"https://api.github.com/repos/ofiwg/libfabric/statuses/657c33dda67ab11c847325946bac29b24d2bc474","head":{"label":"bturrubiates:topic/subsystems-1","ref":"topic/subsystems-1","sha":"657c33dda67ab11c847325946bac29b24d2bc474","user":{"login":"bturrubiates","id":2322856,"avatar_url":"https://avatars.githubusercontent.com/u/2322856?v=3","gravatar_id":"","url":"https://api.github.com/users/bturrubiates","html_url":"https://github.com/bturrubiates","followers_url":"https://api.github.com/users/bturrubiates/followers","following_url":"https://api.github.com/users/bturrubiates/following{/other_user}","gists_url":"https://api.github.com/users/bturrubiates/gists{/gist_id}","starred_url":"https://api.github.com/users/bturrubiates/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bturrubiates/subscriptions","organizations_url":"https://api.github.com/users/bturrubiates/orgs","repos_url":"https://api.github.com/users/bturrubiates/repos","events_url":"https://api.github.com/users/bturrubiates/events{/privacy}","received_events_url":"https://api.github.com/users/bturrubiates/received_events","type":"User","site_admin":false},"repo":{"id":29930238,"name":"libfabric","full_name":"bturrubiates/libfabric","owner":{"login":"bturrubiates","id":2322856,"avatar_url":"https://avatars.githubusercontent.com/u/2322856?v=3","gravatar_id":"","url":"https://api.github.com/users/bturrubiates","html_url":"https://github.com/bturrubiates","followers_url":"https://api.github.com/users/bturrubiates/followers","following_url":"https://api.github.com/users/bturrubiates/following{/other_user}","gists_url":"https://api.github.com/users/bturrubiates/gists{/gist_id}","starred_url":"https://api.github.com/users/bturrubiates/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bturrubiates/subscriptions","organizations_url":"https://api.github.com/users/bturrubiates/orgs","repos_url":"https://api.github.com/users/bturrubiates/repos","events_url":"https://api.github.com/users/bturrubiates/events{/privacy}","received_events_url":"https://api.github.com/users/bturrubiates/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bturrubiates/libfabric","description":"Open Fabric Interfaces","fork":true,"url":"https://api.github.com/repos/bturrubiates/libfabric","forks_url":"https://api.github.com/repos/bturrubiates/libfabric/forks","keys_url":"https://api.github.com/repos/bturrubiates/libfabric/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bturrubiates/libfabric/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bturrubiates/libfabric/teams","hooks_url":"https://api.github.com/repos/bturrubiates/libfabric/hooks","issue_events_url":"https://api.github.com/repos/bturrubiates/libfabric/issues/events{/number}","events_url":"https://api.github.com/repos/bturrubiates/libfabric/events","assignees_url":"https://api.github.com/repos/bturrubiates/libfabric/assignees{/user}","branches_url":"https://api.github.com/repos/bturrubiates/libfabric/branches{/branch}","tags_url":"https://api.github.com/repos/bturrubiates/libfabric/tags","blobs_url":"https://api.github.com/repos/bturrubiates/libfabric/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bturrubiates/libfabric/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bturrubiates/libfabric/git/refs{/sha}","trees_url":"https://api.github.com/repos/bturrubiates/libfabric/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bturrubiates/libfabric/statuses/{sha}","languages_url":"https://api.github.com/repos/bturrubiates/libfabric/languages","stargazers_url":"https://api.github.com/repos/bturrubiates/libfabric/stargazers","contributors_url":"https://api.github.com/repos/bturrubiates/libfabric/contributors","subscribers_url":"https://api.github.com/repos/bturrubiates/libfabric/subscribers","subscription_url":"https://api.github.com/repos/bturrubiates/libfabric/subscription","commits_url":"https://api.github.com/repos/bturrubiates/libfabric/commits{/sha}","git_commits_url":"https://api.github.com/repos/bturrubiates/libfabric/git/commits{/sha}","comments_url":"https://api.github.com/repos/bturrubiates/libfabric/comments{/number}","issue_comment_url":"https://api.github.com/repos/bturrubiates/libfabric/issues/comments{/number}","contents_url":"https://api.github.com/repos/bturrubiates/libfabric/contents/{+path}","compare_url":"https://api.github.com/repos/bturrubiates/libfabric/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bturrubiates/libfabric/merges","archive_url":"https://api.github.com/repos/bturrubiates/libfabric/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bturrubiates/libfabric/downloads","issues_url":"https://api.github.com/repos/bturrubiates/libfabric/issues{/number}","pulls_url":"https://api.github.com/repos/bturrubiates/libfabric/pulls{/number}","milestones_url":"https://api.github.com/repos/bturrubiates/libfabric/milestones{/number}","notifications_url":"https://api.github.com/repos/bturrubiates/libfabric/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bturrubiates/libfabric/labels{/name}","releases_url":"https://api.github.com/repos/bturrubiates/libfabric/releases{/id}","created_at":"2015-01-27T19:13:34Z","updated_at":"2015-03-11T17:16:41Z","pushed_at":"2015-03-17T00:32:59Z","git_url":"git://github.com/bturrubiates/libfabric.git","ssh_url":"git@github.com:bturrubiates/libfabric.git","clone_url":"https://github.com/bturrubiates/libfabric.git","svn_url":"https://github.com/bturrubiates/libfabric","homepage":"http://ofiwg.github.io/libfabric/","size":5733,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ofiwg:master","ref":"master","sha":"82f4a33f3e1cd431f1830a44819dbb7506da36be","user":{"login":"ofiwg","id":8459445,"avatar_url":"https://avatars.githubusercontent.com/u/8459445?v=3","gravatar_id":"","url":"https://api.github.com/users/ofiwg","html_url":"https://github.com/ofiwg","followers_url":"https://api.github.com/users/ofiwg/followers","following_url":"https://api.github.com/users/ofiwg/following{/other_user}","gists_url":"https://api.github.com/users/ofiwg/gists{/gist_id}","starred_url":"https://api.github.com/users/ofiwg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ofiwg/subscriptions","organizations_url":"https://api.github.com/users/ofiwg/orgs","repos_url":"https://api.github.com/users/ofiwg/repos","events_url":"https://api.github.com/users/ofiwg/events{/privacy}","received_events_url":"https://api.github.com/users/ofiwg/received_events","type":"Organization","site_admin":false},"repo":{"id":22996097,"name":"libfabric","full_name":"ofiwg/libfabric","owner":{"login":"ofiwg","id":8459445,"avatar_url":"https://avatars.githubusercontent.com/u/8459445?v=3","gravatar_id":"","url":"https://api.github.com/users/ofiwg","html_url":"https://github.com/ofiwg","followers_url":"https://api.github.com/users/ofiwg/followers","following_url":"https://api.github.com/users/ofiwg/following{/other_user}","gists_url":"https://api.github.com/users/ofiwg/gists{/gist_id}","starred_url":"https://api.github.com/users/ofiwg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ofiwg/subscriptions","organizations_url":"https://api.github.com/users/ofiwg/orgs","repos_url":"https://api.github.com/users/ofiwg/repos","events_url":"https://api.github.com/users/ofiwg/events{/privacy}","received_events_url":"https://api.github.com/users/ofiwg/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ofiwg/libfabric","description":"Open Fabric Interfaces","fork":false,"url":"https://api.github.com/repos/ofiwg/libfabric","forks_url":"https://api.github.com/repos/ofiwg/libfabric/forks","keys_url":"https://api.github.com/repos/ofiwg/libfabric/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ofiwg/libfabric/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ofiwg/libfabric/teams","hooks_url":"https://api.github.com/repos/ofiwg/libfabric/hooks","issue_events_url":"https://api.github.com/repos/ofiwg/libfabric/issues/events{/number}","events_url":"https://api.github.com/repos/ofiwg/libfabric/events","assignees_url":"https://api.github.com/repos/ofiwg/libfabric/assignees{/user}","branches_url":"https://api.github.com/repos/ofiwg/libfabric/branches{/branch}","tags_url":"https://api.github.com/repos/ofiwg/libfabric/tags","blobs_url":"https://api.github.com/repos/ofiwg/libfabric/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ofiwg/libfabric/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ofiwg/libfabric/git/refs{/sha}","trees_url":"https://api.github.com/repos/ofiwg/libfabric/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ofiwg/libfabric/statuses/{sha}","languages_url":"https://api.github.com/repos/ofiwg/libfabric/languages","stargazers_url":"https://api.github.com/repos/ofiwg/libfabric/stargazers","contributors_url":"https://api.github.com/repos/ofiwg/libfabric/contributors","subscribers_url":"https://api.github.com/repos/ofiwg/libfabric/subscribers","subscription_url":"https://api.github.com/repos/ofiwg/libfabric/subscription","commits_url":"https://api.github.com/repos/ofiwg/libfabric/commits{/sha}","git_commits_url":"https://api.github.com/repos/ofiwg/libfabric/git/commits{/sha}","comments_url":"https://api.github.com/repos/ofiwg/libfabric/comments{/number}","issue_comment_url":"https://api.github.com/repos/ofiwg/libfabric/issues/comments{/number}","contents_url":"https://api.github.com/repos/ofiwg/libfabric/contents/{+path}","compare_url":"https://api.github.com/repos/ofiwg/libfabric/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ofiwg/libfabric/merges","archive_url":"https://api.github.com/repos/ofiwg/libfabric/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ofiwg/libfabric/downloads","issues_url":"https://api.github.com/repos/ofiwg/libfabric/issues{/number}","pulls_url":"https://api.github.com/repos/ofiwg/libfabric/pulls{/number}","milestones_url":"https://api.github.com/repos/ofiwg/libfabric/milestones{/number}","notifications_url":"https://api.github.com/repos/ofiwg/libfabric/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ofiwg/libfabric/labels{/name}","releases_url":"https://api.github.com/repos/ofiwg/libfabric/releases{/id}","created_at":"2014-08-15T16:45:53Z","updated_at":"2015-03-17T23:08:58Z","pushed_at":"2015-03-17T23:08:58Z","git_url":"git://github.com/ofiwg/libfabric.git","ssh_url":"git@github.com:ofiwg/libfabric.git","clone_url":"https://github.com/ofiwg/libfabric.git","svn_url":"https://github.com/ofiwg/libfabric","homepage":"http://ofiwg.github.io/libfabric/","size":10491,"stargazers_count":23,"watchers_count":23,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":28,"mirror_url":null,"open_issues_count":62,"forks":28,"open_issues":62,"watchers":23,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ofiwg/libfabric/pulls/711"},"html":{"href":"https://github.com/ofiwg/libfabric/pull/711"},"issue":{"href":"https://api.github.com/repos/ofiwg/libfabric/issues/711"},"comments":{"href":"https://api.github.com/repos/ofiwg/libfabric/issues/711/comments"},"review_comments":{"href":"https://api.github.com/repos/ofiwg/libfabric/pulls/711/comments"},"review_comment":{"href":"https://api.github.com/repos/ofiwg/libfabric/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ofiwg/libfabric/pulls/711/commits"},"statuses":{"href":"https://api.github.com/repos/ofiwg/libfabric/statuses/657c33dda67ab11c847325946bac29b24d2bc474"}}}}