{"comment":{"url":"https://api.github.com/repos/ramarag/coreclr/comments/12868851","html_url":"https://github.com/ramarag/coreclr/commit/8e66bd33daba75e4d8af6fc5938a9ccf5190a818#commitcomment-12868851","id":12868851,"user":{"login":"brianrob","id":6210322,"avatar_url":"https://avatars.githubusercontent.com/u/6210322?v=3","gravatar_id":"","url":"https://api.github.com/users/brianrob","html_url":"https://github.com/brianrob","followers_url":"https://api.github.com/users/brianrob/followers","following_url":"https://api.github.com/users/brianrob/following{/other_user}","gists_url":"https://api.github.com/users/brianrob/gists{/gist_id}","starred_url":"https://api.github.com/users/brianrob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brianrob/subscriptions","organizations_url":"https://api.github.com/users/brianrob/orgs","repos_url":"https://api.github.com/users/brianrob/repos","events_url":"https://api.github.com/users/brianrob/events{/privacy}","received_events_url":"https://api.github.com/users/brianrob/received_events","type":"User","site_admin":false},"position":90,"line":1705,"path":"src/vm/eventtrace.cpp","commit_id":"8e66bd33daba75e4d8af6fc5938a9ccf5190a818","created_at":"2015-08-24T23:03:45Z","updated_at":"2015-08-24T23:03:45Z","body":"I did a bit of investigation, and it turns out that you should be able to implement allocation sampling pretty cleanly without a callback when LTTng is enabled.  The key is basically to wrap the sampling logic (which is in eventtrace.cpp) in an IsEnabled check for the tracepoints instead of depending on a callback to enable/disable it.  If the state changes, (from enabled to disabled) then we chuck the state.\r\n\r\nThis won't affect the fast allocation helpers, so perf won't be degraded in the case where we never turn on allocation sampling (we only do allocation sampling in the slow helpers)."}}