{"action":"created","comment":{"url":"https://api.github.com/repos/iovisor/bcc/pulls/comments/58427830","id":58427830,"diff_hunk":"@@ -0,0 +1 @@\n+usr/bin/bcc-lua","path":"debian/bcc-lua.install","position":1,"original_position":1,"commit_id":"e57e1c96f8e28fa3acfd32339662be4ac01e83ab","original_commit_id":"98d1ae3054d074c2b1394b0f733de9b66b50f85c","user":{"login":"vmg","id":42793,"avatar_url":"https://avatars.githubusercontent.com/u/42793?v=3","gravatar_id":"","url":"https://api.github.com/users/vmg","html_url":"https://github.com/vmg","followers_url":"https://api.github.com/users/vmg/followers","following_url":"https://api.github.com/users/vmg/following{/other_user}","gists_url":"https://api.github.com/users/vmg/gists{/gist_id}","starred_url":"https://api.github.com/users/vmg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vmg/subscriptions","organizations_url":"https://api.github.com/users/vmg/orgs","repos_url":"https://api.github.com/users/vmg/repos","events_url":"https://api.github.com/users/vmg/events{/privacy}","received_events_url":"https://api.github.com/users/vmg/received_events","type":"User","site_admin":true},"body":"Done!","created_at":"2016-04-04T18:52:34Z","updated_at":"2016-04-04T18:52:34Z","html_url":"https://github.com/iovisor/bcc/pull/470#discussion_r58427830","pull_request_url":"https://api.github.com/repos/iovisor/bcc/pulls/470","_links":{"self":{"href":"https://api.github.com/repos/iovisor/bcc/pulls/comments/58427830"},"html":{"href":"https://github.com/iovisor/bcc/pull/470#discussion_r58427830"},"pull_request":{"href":"https://api.github.com/repos/iovisor/bcc/pulls/470"}}},"pull_request":{"url":"https://api.github.com/repos/iovisor/bcc/pulls/470","id":64808117,"html_url":"https://github.com/iovisor/bcc/pull/470","diff_url":"https://github.com/iovisor/bcc/pull/470.diff","patch_url":"https://github.com/iovisor/bcc/pull/470.patch","issue_url":"https://api.github.com/repos/iovisor/bcc/issues/470","number":470,"state":"open","locked":false,"title":"Standalone Lua tracing tool","user":{"login":"vmg","id":42793,"avatar_url":"https://avatars.githubusercontent.com/u/42793?v=3","gravatar_id":"","url":"https://api.github.com/users/vmg","html_url":"https://github.com/vmg","followers_url":"https://api.github.com/users/vmg/followers","following_url":"https://api.github.com/users/vmg/following{/other_user}","gists_url":"https://api.github.com/users/vmg/gists{/gist_id}","starred_url":"https://api.github.com/users/vmg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vmg/subscriptions","organizations_url":"https://api.github.com/users/vmg/orgs","repos_url":"https://api.github.com/users/vmg/repos","events_url":"https://api.github.com/users/vmg/events{/privacy}","received_events_url":"https://api.github.com/users/vmg/received_events","type":"User","site_admin":true},"body":"Here's something that @4ast requested. We can package all the lua tooling into its own executable with no dependencies, that can be used in production systems without having to install anything.\r\n\r\nSome notes:\r\n\r\n1. I've simplified the modules in the Lua wrapper to make it easier to package\r\n2. The packaging happens in 3 steps (they can be followed in the `CMakeLists.txt` file for the lua folder)\r\n    1. We use the `squish` tool to pre-compile and minimize all the Lua code into a single file\r\n    2. We run `luajit -b` on the generated lua bundle -- `luajit` is smart enough to write an `.o` object with the compiled bytecode. This object is ready to link into our tool. How cool is that?\r\n    3. We package a simple wrapper for the C API (src/lua/src/main.c`) and our Lua bytecode object into the standalone tool\r\n\r\nObservant minds have probably noticed that we're not statically linking `libbcc.a` into the tool. This is because the LuaJIT FFI kinda expects to be able to `dlopen` the `so`. Since the `so` we're building has no dependencies already, it should be safe to ship with our tool. The tool is capable of finding this shared object if it's in the same folder as the tool itself, or through the `LIBBCC_SO_PATH` environment var, if it's set.\r\n\r\nI'm 90% happy with this solution. It will work reliably in production by simply shipping the tool and the `so` to any machine. I believe a fully standalone solution may be feasible if I could manage to export all the `libbcc` symbols when linking `libbcc.a` into the tool -- then I could trick LuaJIT into `dlopen`-ing itself and it should be able to access the library from Lua. I'm not sure at all of how to accomplish this with CMake, however. I can successfully link against `libbcc.a`, but none of the symbols are exported on the resulting binary.\r\n\r\nFeedback welcome!","created_at":"2016-03-31T15:19:28Z","updated_at":"2016-04-04T18:52:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5d5de3c373c7dfacc743b13595236629e0bc36db","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/iovisor/bcc/pulls/470/commits","review_comments_url":"https://api.github.com/repos/iovisor/bcc/pulls/470/comments","review_comment_url":"https://api.github.com/repos/iovisor/bcc/pulls/comments{/number}","comments_url":"https://api.github.com/repos/iovisor/bcc/issues/470/comments","statuses_url":"https://api.github.com/repos/iovisor/bcc/statuses/e57e1c96f8e28fa3acfd32339662be4ac01e83ab","head":{"label":"vmg:vmg/lua-standalone","ref":"vmg/lua-standalone","sha":"e57e1c96f8e28fa3acfd32339662be4ac01e83ab","user":{"login":"vmg","id":42793,"avatar_url":"https://avatars.githubusercontent.com/u/42793?v=3","gravatar_id":"","url":"https://api.github.com/users/vmg","html_url":"https://github.com/vmg","followers_url":"https://api.github.com/users/vmg/followers","following_url":"https://api.github.com/users/vmg/following{/other_user}","gists_url":"https://api.github.com/users/vmg/gists{/gist_id}","starred_url":"https://api.github.com/users/vmg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vmg/subscriptions","organizations_url":"https://api.github.com/users/vmg/orgs","repos_url":"https://api.github.com/users/vmg/repos","events_url":"https://api.github.com/users/vmg/events{/privacy}","received_events_url":"https://api.github.com/users/vmg/received_events","type":"User","site_admin":true},"repo":{"id":54778024,"name":"bcc","full_name":"vmg/bcc","owner":{"login":"vmg","id":42793,"avatar_url":"https://avatars.githubusercontent.com/u/42793?v=3","gravatar_id":"","url":"https://api.github.com/users/vmg","html_url":"https://github.com/vmg","followers_url":"https://api.github.com/users/vmg/followers","following_url":"https://api.github.com/users/vmg/following{/other_user}","gists_url":"https://api.github.com/users/vmg/gists{/gist_id}","starred_url":"https://api.github.com/users/vmg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vmg/subscriptions","organizations_url":"https://api.github.com/users/vmg/orgs","repos_url":"https://api.github.com/users/vmg/repos","events_url":"https://api.github.com/users/vmg/events{/privacy}","received_events_url":"https://api.github.com/users/vmg/received_events","type":"User","site_admin":true},"private":false,"html_url":"https://github.com/vmg/bcc","description":"BCC - Tools for BPF-based Linux IO analysis, networking, monitoring, and more","fork":true,"url":"https://api.github.com/repos/vmg/bcc","forks_url":"https://api.github.com/repos/vmg/bcc/forks","keys_url":"https://api.github.com/repos/vmg/bcc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vmg/bcc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vmg/bcc/teams","hooks_url":"https://api.github.com/repos/vmg/bcc/hooks","issue_events_url":"https://api.github.com/repos/vmg/bcc/issues/events{/number}","events_url":"https://api.github.com/repos/vmg/bcc/events","assignees_url":"https://api.github.com/repos/vmg/bcc/assignees{/user}","branches_url":"https://api.github.com/repos/vmg/bcc/branches{/branch}","tags_url":"https://api.github.com/repos/vmg/bcc/tags","blobs_url":"https://api.github.com/repos/vmg/bcc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vmg/bcc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vmg/bcc/git/refs{/sha}","trees_url":"https://api.github.com/repos/vmg/bcc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vmg/bcc/statuses/{sha}","languages_url":"https://api.github.com/repos/vmg/bcc/languages","stargazers_url":"https://api.github.com/repos/vmg/bcc/stargazers","contributors_url":"https://api.github.com/repos/vmg/bcc/contributors","subscribers_url":"https://api.github.com/repos/vmg/bcc/subscribers","subscription_url":"https://api.github.com/repos/vmg/bcc/subscription","commits_url":"https://api.github.com/repos/vmg/bcc/commits{/sha}","git_commits_url":"https://api.github.com/repos/vmg/bcc/git/commits{/sha}","comments_url":"https://api.github.com/repos/vmg/bcc/comments{/number}","issue_comment_url":"https://api.github.com/repos/vmg/bcc/issues/comments{/number}","contents_url":"https://api.github.com/repos/vmg/bcc/contents/{+path}","compare_url":"https://api.github.com/repos/vmg/bcc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vmg/bcc/merges","archive_url":"https://api.github.com/repos/vmg/bcc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vmg/bcc/downloads","issues_url":"https://api.github.com/repos/vmg/bcc/issues{/number}","pulls_url":"https://api.github.com/repos/vmg/bcc/pulls{/number}","milestones_url":"https://api.github.com/repos/vmg/bcc/milestones{/number}","notifications_url":"https://api.github.com/repos/vmg/bcc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vmg/bcc/labels{/name}","releases_url":"https://api.github.com/repos/vmg/bcc/releases{/id}","deployments_url":"https://api.github.com/repos/vmg/bcc/deployments","created_at":"2016-03-26T12:27:44Z","updated_at":"2016-04-01T14:24:02Z","pushed_at":"2016-04-04T18:51:41Z","git_url":"git://github.com/vmg/bcc.git","ssh_url":"git@github.com:vmg/bcc.git","clone_url":"https://github.com/vmg/bcc.git","svn_url":"https://github.com/vmg/bcc","homepage":"","size":2424,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"iovisor:master","ref":"master","sha":"31571b4f98e9adb27f91b26cdc44f3fa8b2dcfc2","user":{"login":"iovisor","id":12766186,"avatar_url":"https://avatars.githubusercontent.com/u/12766186?v=3","gravatar_id":"","url":"https://api.github.com/users/iovisor","html_url":"https://github.com/iovisor","followers_url":"https://api.github.com/users/iovisor/followers","following_url":"https://api.github.com/users/iovisor/following{/other_user}","gists_url":"https://api.github.com/users/iovisor/gists{/gist_id}","starred_url":"https://api.github.com/users/iovisor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iovisor/subscriptions","organizations_url":"https://api.github.com/users/iovisor/orgs","repos_url":"https://api.github.com/users/iovisor/repos","events_url":"https://api.github.com/users/iovisor/events{/privacy}","received_events_url":"https://api.github.com/users/iovisor/received_events","type":"Organization","site_admin":false},"repo":{"id":34921116,"name":"bcc","full_name":"iovisor/bcc","owner":{"login":"iovisor","id":12766186,"avatar_url":"https://avatars.githubusercontent.com/u/12766186?v=3","gravatar_id":"","url":"https://api.github.com/users/iovisor","html_url":"https://github.com/iovisor","followers_url":"https://api.github.com/users/iovisor/followers","following_url":"https://api.github.com/users/iovisor/following{/other_user}","gists_url":"https://api.github.com/users/iovisor/gists{/gist_id}","starred_url":"https://api.github.com/users/iovisor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iovisor/subscriptions","organizations_url":"https://api.github.com/users/iovisor/orgs","repos_url":"https://api.github.com/users/iovisor/repos","events_url":"https://api.github.com/users/iovisor/events{/privacy}","received_events_url":"https://api.github.com/users/iovisor/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/iovisor/bcc","description":"BCC - Tools for BPF-based Linux IO analysis, networking, monitoring, and more","fork":false,"url":"https://api.github.com/repos/iovisor/bcc","forks_url":"https://api.github.com/repos/iovisor/bcc/forks","keys_url":"https://api.github.com/repos/iovisor/bcc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/iovisor/bcc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/iovisor/bcc/teams","hooks_url":"https://api.github.com/repos/iovisor/bcc/hooks","issue_events_url":"https://api.github.com/repos/iovisor/bcc/issues/events{/number}","events_url":"https://api.github.com/repos/iovisor/bcc/events","assignees_url":"https://api.github.com/repos/iovisor/bcc/assignees{/user}","branches_url":"https://api.github.com/repos/iovisor/bcc/branches{/branch}","tags_url":"https://api.github.com/repos/iovisor/bcc/tags","blobs_url":"https://api.github.com/repos/iovisor/bcc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/iovisor/bcc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/iovisor/bcc/git/refs{/sha}","trees_url":"https://api.github.com/repos/iovisor/bcc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/iovisor/bcc/statuses/{sha}","languages_url":"https://api.github.com/repos/iovisor/bcc/languages","stargazers_url":"https://api.github.com/repos/iovisor/bcc/stargazers","contributors_url":"https://api.github.com/repos/iovisor/bcc/contributors","subscribers_url":"https://api.github.com/repos/iovisor/bcc/subscribers","subscription_url":"https://api.github.com/repos/iovisor/bcc/subscription","commits_url":"https://api.github.com/repos/iovisor/bcc/commits{/sha}","git_commits_url":"https://api.github.com/repos/iovisor/bcc/git/commits{/sha}","comments_url":"https://api.github.com/repos/iovisor/bcc/comments{/number}","issue_comment_url":"https://api.github.com/repos/iovisor/bcc/issues/comments{/number}","contents_url":"https://api.github.com/repos/iovisor/bcc/contents/{+path}","compare_url":"https://api.github.com/repos/iovisor/bcc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/iovisor/bcc/merges","archive_url":"https://api.github.com/repos/iovisor/bcc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/iovisor/bcc/downloads","issues_url":"https://api.github.com/repos/iovisor/bcc/issues{/number}","pulls_url":"https://api.github.com/repos/iovisor/bcc/pulls{/number}","milestones_url":"https://api.github.com/repos/iovisor/bcc/milestones{/number}","notifications_url":"https://api.github.com/repos/iovisor/bcc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/iovisor/bcc/labels{/name}","releases_url":"https://api.github.com/repos/iovisor/bcc/releases{/id}","deployments_url":"https://api.github.com/repos/iovisor/bcc/deployments","created_at":"2015-05-01T19:52:32Z","updated_at":"2016-04-04T18:28:13Z","pushed_at":"2016-04-04T18:51:42Z","git_url":"git://github.com/iovisor/bcc.git","ssh_url":"git@github.com:iovisor/bcc.git","clone_url":"https://github.com/iovisor/bcc.git","svn_url":"https://github.com/iovisor/bcc","homepage":"","size":3269,"stargazers_count":817,"watchers_count":817,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":89,"mirror_url":null,"open_issues_count":55,"forks":89,"open_issues":55,"watchers":817,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/iovisor/bcc/pulls/470"},"html":{"href":"https://github.com/iovisor/bcc/pull/470"},"issue":{"href":"https://api.github.com/repos/iovisor/bcc/issues/470"},"comments":{"href":"https://api.github.com/repos/iovisor/bcc/issues/470/comments"},"review_comments":{"href":"https://api.github.com/repos/iovisor/bcc/pulls/470/comments"},"review_comment":{"href":"https://api.github.com/repos/iovisor/bcc/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/iovisor/bcc/pulls/470/commits"},"statuses":{"href":"https://api.github.com/repos/iovisor/bcc/statuses/e57e1c96f8e28fa3acfd32339662be4ac01e83ab"}}}}