Add xhprof_frame_begin & xhprof_frame_end #52
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add functions for sub-function profiling.
xhprof_frame_begin: Starts an artificial frame. Together withxhprof_frame_end, this times one block of code execution as if itwere a function call, allowing people to define arbitrary function
boundaries.
xhprof_frame_end: Ends an artificial frame thatxhprof_frame_beginstarted. One has to make sure there are no exceptions in between these
two calls, as otherwise, it may report incorrect timings. Also,
xhprof_frame_beginandxhprof_frame_endhave to be paired upreally well, so not to interfere with regular function's profiling,
unless that's the intention.
XhprofFrame: Wrapper object that callsxhprof_frame_beginin itsconstructor and
xhprof_frame_endin its destructor.This functionality was back ported from HHVM's internal XHProf
implementation. There has been one small change from the HHVM
implementation with the addition of the optional
$wrappedbooleanparameter to
xhprof_frame_beginwhich is used to fix a bug in theupstream
XhprofFrameimplementation which mis-attibutes function callsin a frame introduced via
XhprofFrametoXhprofFrame::__constructrather than the name provided for the frame.
Fixes #51