{"action":"created","issue":{"url":"https://api.github.com/repos/gonzus/Devel-Probe/issues/1","repository_url":"https://api.github.com/repos/gonzus/Devel-Probe","labels_url":"https://api.github.com/repos/gonzus/Devel-Probe/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/gonzus/Devel-Probe/issues/1/comments","events_url":"https://api.github.com/repos/gonzus/Devel-Probe/issues/1/events","html_url":"https://github.com/gonzus/Devel-Probe/pull/1","id":392387413,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM5NjcyMzk5","number":1,"title":"Fire a Perl callback on probe trigger","user":{"login":"kanatohodets","id":2365315,"node_id":"MDQ6VXNlcjIzNjUzMTU=","avatar_url":"https://avatars3.githubusercontent.com/u/2365315?v=4","gravatar_id":"","url":"https://api.github.com/users/kanatohodets","html_url":"https://github.com/kanatohodets","followers_url":"https://api.github.com/users/kanatohodets/followers","following_url":"https://api.github.com/users/kanatohodets/following{/other_user}","gists_url":"https://api.github.com/users/kanatohodets/gists{/gist_id}","starred_url":"https://api.github.com/users/kanatohodets/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kanatohodets/subscriptions","organizations_url":"https://api.github.com/users/kanatohodets/orgs","repos_url":"https://api.github.com/users/kanatohodets/repos","events_url":"https://api.github.com/users/kanatohodets/events{/privacy}","received_events_url":"https://api.github.com/users/kanatohodets/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-12-19T00:05:34Z","updated_at":"2018-12-20T07:12:13Z","closed_at":"2018-12-20T07:06:10Z","author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/gonzus/Devel-Probe/pulls/1","html_url":"https://github.com/gonzus/Devel-Probe/pull/1","diff_url":"https://github.com/gonzus/Devel-Probe/pull/1.diff","patch_url":"https://github.com/gonzus/Devel-Probe/pull/1.patch"},"body":"Please excuse baby's first XS.\r\n\r\nThis adds a setter to bind a callback to probe trigger. That callback can then do whatever makes sense -- invoke PadWalker, shove things into a Sereal payload and dump to disk, etc. \r\n\r\n### Some testing notes / TODOs\r\n\r\n#### SIGHUP as control\r\nGently bumped into an issue here testing with a Mojolicious app; Mojo's webservers use SIGHUP themselves.\r\n\r\n#### Validating that the probe is a coderef\r\nA very immediate improvement to this patch would be validating that the argument to `Devel::Probe::trigger` is a string or coderef, and not something else. Perl will just bark and say \"Not a CODE reference\" if its wrong, but the line number for that message will be all wrong -- it will be the line of the probe, not the code location where the probe is defined.\r\n\r\n#### Exceptions in the probe\r\nAn exception in your probe is very difficult to cope with. It means that literally any line of code might toss an exception. Not sure what to do with this beyond perhaps wrapping the probe in an `eval` regardless of what the user does; it reminds a bit of [the motivation Java had for removing `Thread.stop`](https://docs.oracle.com/javase/6/docs/technotes/guides/concurrency/threadPrimitiveDeprecation.html).\r\n\r\n#### Figuring out the file path\r\nWhile testing with Mojo, my application file path was absolute, which I was not expecting. As a result, my probes did not work initially. In a large application it can be tricky to understand how to name files in the `cfg` file.\r\n\r\n#### \"Infecting\" modules down the stack?\r\nFrom some intrepid `fprintf` debugging, it looks like `Devel::Probe` only witnesses files in modules directly loaded in the same file as `Devel::Probe` itself. This means you cannot place probes on things deeper in the stack. Not sure how to tackle this. I suppose there's a careful balance to be found here between controlling exposure/perf overhead and the debugging power to probe anything at any level."},"comment":{"url":"https://api.github.com/repos/gonzus/Devel-Probe/issues/comments/448897209","html_url":"https://github.com/gonzus/Devel-Probe/pull/1#issuecomment-448897209","issue_url":"https://api.github.com/repos/gonzus/Devel-Probe/issues/1","id":448897209,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0ODg5NzIwOQ==","user":{"login":"gonzus","id":208546,"node_id":"MDQ6VXNlcjIwODU0Ng==","avatar_url":"https://avatars2.githubusercontent.com/u/208546?v=4","gravatar_id":"","url":"https://api.github.com/users/gonzus","html_url":"https://github.com/gonzus","followers_url":"https://api.github.com/users/gonzus/followers","following_url":"https://api.github.com/users/gonzus/following{/other_user}","gists_url":"https://api.github.com/users/gonzus/gists{/gist_id}","starred_url":"https://api.github.com/users/gonzus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gonzus/subscriptions","organizations_url":"https://api.github.com/users/gonzus/orgs","repos_url":"https://api.github.com/users/gonzus/repos","events_url":"https://api.github.com/users/gonzus/events{/privacy}","received_events_url":"https://api.github.com/users/gonzus/received_events","type":"User","site_admin":false},"created_at":"2018-12-20T07:12:13Z","updated_at":"2018-12-20T07:12:13Z","author_association":"OWNER","body":"BTW, could you create separate issues for each of your TODOs? I will do the same for some of the comments I added."}}
{"actor":{"display_login":"gonzus"}}