{"action":"created","issue":{"url":"https://api.github.com/repos/iovisor/bcc/issues/498","repository_url":"https://api.github.com/repos/iovisor/bcc","labels_url":"https://api.github.com/repos/iovisor/bcc/issues/498/labels{/name}","comments_url":"https://api.github.com/repos/iovisor/bcc/issues/498/comments","events_url":"https://api.github.com/repos/iovisor/bcc/issues/498/events","html_url":"https://github.com/iovisor/bcc/pull/498","id":150131401,"number":498,"title":"[WIP] Native implementation for USDT probes","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},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-04-21T16:53:33Z","updated_at":"2016-04-22T15:52:17Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/iovisor/bcc/pulls/498","html_url":"https://github.com/iovisor/bcc/pull/498","diff_url":"https://github.com/iovisor/bcc/pull/498.diff","patch_url":"https://github.com/iovisor/bcc/pull/498.patch"},"body":"Opening this PR early, as I start porting the USDT probe implementation (`src/python/bcc/usdt.py`) to libbcc itself.\r\n\r\nAs @4ast pointed out on the previous PR, we don't use GTest in the library -- in fact, we didn't have a test framework for C/C++ because we didn't have any C/C++ tests (do note that the behavior of the library is quite thoroughly tested through the Python and Lua tests, however). When porting over the Elf and Process APIs into C, I added `sput` as a small test framework for some basic tests.\r\n\r\nNow, whilst writing more native code, it's becoming obvious that `sput` doesn't quite cut it (it's a very basic test framework), so I've decided to go with Catch (https://github.com/philsquared/Catch), which is the header-only framework I usually use for heavy C++ testing because:\r\n\r\n1. It's lighter than google-test\r\n2. The assert/expect interface is fucking gorgeous (it decomposes the statements to show you the actual test failure).\r\n3. It's a single-header so it can be drag and dropped into projects\r\n\r\nConsequently, I've ported the existing tests for the C API to Catch, and added a new test suite for my ongoing USDT work.\r\n\r\nSo far, I've only implemented parsing the probe arguments (more work on the way). I decided to hand-write a small parser because the original regexps used in the Python implementation were missing a lot of corner cases. I think this new implementation is more accurate and not overly complex -- I'm of course open to feedback.\r\n\r\nI'll keep updating the PR as I implement more USDT functionality natively."},"comment":{"url":"https://api.github.com/repos/iovisor/bcc/issues/comments/213485969","html_url":"https://github.com/iovisor/bcc/pull/498#issuecomment-213485969","issue_url":"https://api.github.com/repos/iovisor/bcc/issues/498","id":213485969,"user":{"login":"4ast","id":12205493,"avatar_url":"https://avatars.githubusercontent.com/u/12205493?v=3","gravatar_id":"","url":"https://api.github.com/users/4ast","html_url":"https://github.com/4ast","followers_url":"https://api.github.com/users/4ast/followers","following_url":"https://api.github.com/users/4ast/following{/other_user}","gists_url":"https://api.github.com/users/4ast/gists{/gist_id}","starred_url":"https://api.github.com/users/4ast/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/4ast/subscriptions","organizations_url":"https://api.github.com/users/4ast/orgs","repos_url":"https://api.github.com/users/4ast/repos","events_url":"https://api.github.com/users/4ast/events{/privacy}","received_events_url":"https://api.github.com/users/4ast/received_events","type":"User","site_admin":false},"created_at":"2016-04-22T15:52:17Z","updated_at":"2016-04-22T15:52:17Z","body":"missing something... why on fedora /lib/stdc++.so used by test program is different from the one statically linked in libbcc.so ?"}}