{"action":"created","issue":{"url":"https://api.github.com/repos/iovisor/bcc/issues/150","labels_url":"https://api.github.com/repos/iovisor/bcc/issues/150/labels{/name}","comments_url":"https://api.github.com/repos/iovisor/bcc/issues/150/comments","events_url":"https://api.github.com/repos/iovisor/bcc/issues/150/events","html_url":"https://github.com/iovisor/bcc/pull/150","id":101758446,"number":150,"title":"some bcc examples and tools","user":{"login":"brendangregg","id":1101211,"avatar_url":"https://avatars.githubusercontent.com/u/1101211?v=3","gravatar_id":"","url":"https://api.github.com/users/brendangregg","html_url":"https://github.com/brendangregg","followers_url":"https://api.github.com/users/brendangregg/followers","following_url":"https://api.github.com/users/brendangregg/following{/other_user}","gists_url":"https://api.github.com/users/brendangregg/gists{/gist_id}","starred_url":"https://api.github.com/users/brendangregg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brendangregg/subscriptions","organizations_url":"https://api.github.com/users/brendangregg/orgs","repos_url":"https://api.github.com/users/brendangregg/repos","events_url":"https://api.github.com/users/brendangregg/events{/privacy}","received_events_url":"https://api.github.com/users/brendangregg/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-18T21:57:19Z","updated_at":"2015-08-18T23:26:55Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/iovisor/bcc/pulls/150","html_url":"https://github.com/iovisor/bcc/pull/150","diff_url":"https://github.com/iovisor/bcc/pull/150.diff","patch_url":"https://github.com/iovisor/bcc/pull/150.patch"},"body":""},"comment":{"url":"https://api.github.com/repos/iovisor/bcc/issues/comments/132389813","html_url":"https://github.com/iovisor/bcc/pull/150#issuecomment-132389813","issue_url":"https://api.github.com/repos/iovisor/bcc/issues/150","id":132389813,"user":{"login":"drzaeus77","id":3770556,"avatar_url":"https://avatars.githubusercontent.com/u/3770556?v=3","gravatar_id":"","url":"https://api.github.com/users/drzaeus77","html_url":"https://github.com/drzaeus77","followers_url":"https://api.github.com/users/drzaeus77/followers","following_url":"https://api.github.com/users/drzaeus77/following{/other_user}","gists_url":"https://api.github.com/users/drzaeus77/gists{/gist_id}","starred_url":"https://api.github.com/users/drzaeus77/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drzaeus77/subscriptions","organizations_url":"https://api.github.com/users/drzaeus77/orgs","repos_url":"https://api.github.com/users/drzaeus77/repos","events_url":"https://api.github.com/users/drzaeus77/events{/privacy}","received_events_url":"https://api.github.com/users/drzaeus77/received_events","type":"User","site_admin":false},"created_at":"2015-08-18T23:26:55Z","updated_at":"2015-08-18T23:26:55Z","body":"Unfortunately, this code is not python 3 compatible. I have been trying to keep BPF working for both versions. I will test a few more files, but so far I have found the following diff necessary:\r\n\r\n```diff\r\ndiff --git a/tools/syncsnoop b/tools/syncsnoop\r\nindex 25f1e8c..78806de 100755\r\n--- a/tools/syncsnoop\r\n+++ b/tools/syncsnoop\r\n@@ -24,13 +24,14 @@ int do_sync(void *ctx) {\r\n BPF.attach_kprobe(b.load_func(\"do_sync\", BPF.KPROBE), \"sys_sync\")\r\n \r\n # header\r\n-print \"%-18s %s\" % (\"TIME(s)\", \"CALL\")\r\n+print(\"%-18s %s\" % (\"TIME(s)\", \"CALL\"))\r\n \r\n # open trace pipe\r\n try:\r\n        trace = open(\"/sys/kernel/debug/tracing/trace_pipe\", \"r\")\r\n except:\r\n-       print >> sys.stderr, \"ERROR: opening trace_pipe\"\r\n+       sys.stdout = sys.stderr\r\n+       print(\"ERROR: opening trace_pipe\")\r\n        exit(1)\r\n \r\n # format output\r\n@@ -43,4 +44,4 @@ while 1:\r\n        prolog, time_s, colon, word = line.rsplit(\" \", 3)\r\n        time_s = time_s[:-1]    # strip trailing \":\"\r\n \r\n-       print \"%-18s %s\" % (time_s, word)\r\n+       print(\"%-18s %s\" % (time_s, word))\r\n```"}}