{"action":"created","issue":{"url":"https://api.github.com/repos/iovisor/bcc/issues/369","repository_url":"https://api.github.com/repos/iovisor/bcc","labels_url":"https://api.github.com/repos/iovisor/bcc/issues/369/labels{/name}","comments_url":"https://api.github.com/repos/iovisor/bcc/issues/369/comments","events_url":"https://api.github.com/repos/iovisor/bcc/issues/369/events","html_url":"https://github.com/iovisor/bcc/pull/369","id":133064719,"number":369,"title":"gentrace.py: Trace a function and its parameters into a histogram or raw data collection","user":{"login":"goldshtn","id":1685437,"avatar_url":"https://avatars.githubusercontent.com/u/1685437?v=3","gravatar_id":"","url":"https://api.github.com/users/goldshtn","html_url":"https://github.com/goldshtn","followers_url":"https://api.github.com/users/goldshtn/followers","following_url":"https://api.github.com/users/goldshtn/following{/other_user}","gists_url":"https://api.github.com/users/goldshtn/gists{/gist_id}","starred_url":"https://api.github.com/users/goldshtn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/goldshtn/subscriptions","organizations_url":"https://api.github.com/users/goldshtn/orgs","repos_url":"https://api.github.com/users/goldshtn/repos","events_url":"https://api.github.com/users/goldshtn/events{/privacy}","received_events_url":"https://api.github.com/users/goldshtn/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2016-02-11T19:26:03Z","updated_at":"2016-02-11T20:34:13Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/iovisor/bcc/pulls/369","html_url":"https://github.com/iovisor/bcc/pull/369","diff_url":"https://github.com/iovisor/bcc/pull/369.diff","patch_url":"https://github.com/iovisor/bcc/pull/369.patch"},"body":"gentrace.py attaches to functions and traces their parameter values into a histogram or a raw data collection. A simple command-line syntax specifies the probe point, the parameter values to capture, and whether a histogram or raw data is desired.\r\n\r\nFrom the examples -- print a histogram of buffer sizes passed to `write()` across all processes, where the file descriptor was 1 (STDOUT):\r\n\r\n```\r\n# ./gentrace.py \"hist:c:write(int fd, const void *buf, size_t count):size_t:count:fd==1\"\r\n[11:25:28]\r\nhist:c:write(int fd, const void *buf, size_t count):size_t:count:fd==1\r\n     count               : count     distribution\r\n         0 -> 1          : 0        |                                        |\r\n         2 -> 3          : 0        |                                        |\r\n         4 -> 7          : 0        |                                        |\r\n         8 -> 15         : 1        |****************************************|\r\n        16 -> 31         : 0        |                                        |\r\n        32 -> 63         : 0        |                                        |\r\n        64 -> 127        : 1        |****************************************|\r\n[11:25:29]\r\nhist:c:write(int fd, const void *buf, size_t count):size_t:count:fd==1\r\n     count               : count     distribution\r\n         0 -> 1          : 0        |                                        |\r\n         2 -> 3          : 0        |                                        |\r\n         4 -> 7          : 0        |                                        |\r\n         8 -> 15         : 2        |********                                |\r\n        16 -> 31         : 0        |                                        |\r\n        32 -> 63         : 1        |****                                    |\r\n        64 -> 127        : 9        |****************************************|\r\n[11:25:30]\r\nhist:c:write(int fd, const void *buf, size_t count):size_t:count:fd==1\r\n     count               : count     distribution\r\n         0 -> 1          : 0        |                                        |\r\n         2 -> 3          : 0        |                                        |\r\n         4 -> 7          : 0        |                                        |\r\n         8 -> 15         : 3        |*******                                 |\r\n        16 -> 31         : 0        |                                        |\r\n        32 -> 63         : 2        |****                                    |\r\n        64 -> 127        : 17       |****************************************|\r\n```"},"comment":{"url":"https://api.github.com/repos/iovisor/bcc/issues/comments/183050911","html_url":"https://github.com/iovisor/bcc/pull/369#issuecomment-183050911","issue_url":"https://api.github.com/repos/iovisor/bcc/issues/369","id":183050911,"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},"created_at":"2016-02-11T20:34:13Z","updated_at":"2016-02-11T20:34:13Z","body":"arganalyzer"}}