You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to profile our PHPUnit tests. I would like to limit profiling to test methods themselves, which would mean no data would be collected during bootstrapping and finding test cases to run. Simple example:
class MyTest extends TestCase
{
publicfunctionsetUp() : void
{
parent::setUp();
memprof_enable();
}
publicfunctiontearDown() : void
{
memprof_disable();
parent::tearDown();
}
... test methods here ...
}
Then in a PHPUnit extension or similar, I would call memprof_dump_callgrind(...) to generate the dump file.
Problem is, when I call memprof_disable(), all collected data is lost, and the resulting dump is empty.
Is there any way to "pause and resume" memprof data collection, or am I stuck with polluting the dumps with "unrelated" code paths that are of no interest to me?
Can I build a new aggregate dump if I somehow combine dump data via memprof_dump_array(...), or will that result in strange values and invalid call paths?
The text was updated successfully, but these errors were encountered:
There is no way to pause and resume currently, however the current code would allow to implement that easily (we could add a memprof_disable() option that cause it to not free the current profile). This would properly account for memory allocated between enable() and disable(), while also taking into account the memory releases happening after disable().
Aggregating the data from memprof_dump_array() would work as well, except that if some memory has been released after disable() (thus not really leaked), this will not be visible.
I see, I will check the array dump format some more and see if there is a straight forward way to parse that into the wanted format, even at the risk of introducing some drift in the values.
I want to profile our PHPUnit tests. I would like to limit profiling to test methods themselves, which would mean no data would be collected during bootstrapping and finding test cases to run. Simple example:
Then in a PHPUnit extension or similar, I would call
memprof_dump_callgrind(...)
to generate the dump file.Problem is, when I call
memprof_disable()
, all collected data is lost, and the resulting dump is empty.Is there any way to "pause and resume" memprof data collection, or am I stuck with polluting the dumps with "unrelated" code paths that are of no interest to me?
Can I build a new aggregate dump if I somehow combine dump data via
memprof_dump_array(...)
, or will that result in strange values and invalid call paths?The text was updated successfully, but these errors were encountered: