How to limit cachegrind files created by xdebug-profiler

2.5k views Asked by At

Is there any way to limit cachegrind files (xdebug profiling output)? I would like to enable xdebug.profile for debugging whole project (not only trigger), but if someone forget to disable it, I don't want disc to be full.

I didn't find any option like that in the profiler documentation.

1

There are 1 answers

0
David Goodwin On

As the documentation states ( http://www.xdebug.org/docs/profiler ) use these settings in your appropriate .ini file - :

xdebug.profiler_enable = 0 
xdebug.profiler_enable_trigger = 1

Then rather than every single request being profiled, only those with an XDEBUG_PROFILE variable in GET/POST/COOKIE will be profiled.

If you don't want to use the trigger approach, then I suppose you'd need a cron job (or similar) to clean up /tmp (or whatever xdebug.profiler_output_dir is set to) quite frequently.