Add xhprof_frame_begin & xhprof_frame_end#52
Open
bd808 wants to merge 3 commits intophacility:masterfrom
Open
Conversation
Add functions for sub-function profiling. - `xhprof_frame_begin` : Starts an artificial frame. Together with `xhprof_frame_end`, this times one block of code execution as if it were a function call, allowing people to define arbitrary function boundaries. - `xhprof_frame_end` : Ends an artificial frame that `xhprof_frame_begin` started. One has to make sure there are no exceptions in between these two calls, as otherwise, it may report incorrect timings. Also, `xhprof_frame_begin` and `xhprof_frame_end` have to be paired up really well, so not to interfere with regular function's profiling, unless that's the intention. - `XhprofFrame` : Wrapper object that calls `xhprof_frame_begin` in its constructor and `xhprof_frame_end` in 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 `$wrapped` boolean parameter to `xhprof_frame_begin` which is used to fix a bug in the upstream `XhprofFrame` implementation which mis-attibutes function calls in a frame introduced via `XhprofFrame` to `XhprofFrame::__construct` rather than the name provided for the frame.
Author
|
Ping |
extension/tests/xhprof_frame_01.phpt
Outdated
prodedural -> procedural
Author
|
🎂 I meant to ping on 2015-11-28, but better late than never as the Hallmark® cards tell me. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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