View Issue Details

IDProjectCategoryView StatusLast Update
0001904XdebugProfilingpublic2020-12-11 08:27
Reporterlaurin1 Assigned Toderick  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Product Version3.0.0 
Target Version3.0devFixed in Version3.0.1 
Summary0001904: Profile and trace files using %t or %u do not get the right names
DescriptionI have not tested them all, but I know this works with :

xdebug.profiler_output_name=cachegrind.out.%s

But does not work with this:

xdebug.profiler_output_name=cachegrind.out.%s.%t
Steps To ReproduceModify php.ini to enable profiler and configure this value:

xdebug.profiler_output_name=cachegrind.out.%s.%t
Additional InformationThe rest of the xdebug settings that I am using:

[xdebug]
zend_extension=xdebug
xdebug.mode=profile
xdebug.start_with_request=yes
xdebug.client_host=127.0.0.1
xdebug.client_port=9003
xdebug.remote_handler=dbgp
xdebug.profiler_output_name=cachegrind.out.%s.%t
xdebug.output_dir=c:\xdebug_prof
;xdebug.log=c:\xdebug.log
TagsNo tags attached.
Operating SystemWindows 10 x64 20H1
PHP Version7.4.10-7.4.19

Relationships

has duplicate 0001913 closedderick profiler_output_name timestamps are now in a different, less file-friendly, format. 

Activities

laurin1

2020-12-01 15:44

reporter   ~0005559

Kind of a big deal for us, as we don't want the same file used every time - we use %t to create a separate file for each request.

laurin1

2020-12-01 15:45

reporter   ~0005560

Also, not working for %u.

laurin1

2020-12-01 15:50

reporter   ~0005561

%r works, so we can use that for now and then use file modification date to determining timing.

derick

2020-12-03 13:43

administrator   ~0005567

The root cause is that the %t and %u modifiers created file names in the form of '/tmp/cachegrind.out._tmp_foo_php.2020-12-02 18:19:57_081116' ­— instead of using the epoch seconds, it did create a textual string. Because on Windows you can't have files with ":" in it, it then failed to create the file.

I am curious to know though whether the log file (which you have commented out) would included a warning about not being able to create the file. Could you have a look at that please, by making sure your php.ini has "xdebug.log=c:\xdebug.log" and then running:

php -r 'xdebug_info();'

The log file should contain a warning, and the output of the script that you ran as well (it might scroll of your screen).

derick

2020-12-03 15:17

administrator   ~0005568

This is now fixed in the Git repository through https://github.com/xdebug/xdebug/pull/702 — I'm still interested in the output in the log, if there is any.

Issue History

Date Modified Username Field Change
2020-12-01 15:41 laurin1 New Issue
2020-12-01 15:44 laurin1 Note Added: 0005559
2020-12-01 15:45 laurin1 Note Added: 0005560
2020-12-01 15:50 laurin1 Note Added: 0005561
2020-12-03 13:43 derick Status new => assigned
2020-12-03 13:43 derick Target Version => 3.0dev
2020-12-03 13:43 derick Summary Profiler does not work when xdebug.profiler_output_name has a value set using %t (timestamp (seconds)) => Profile and trace files using %t or %u do not get the right names
2020-12-03 13:43 derick Note Added: 0005567
2020-12-03 15:17 derick Assigned To => derick
2020-12-03 15:17 derick Status assigned => closed
2020-12-03 15:17 derick Resolution open => fixed
2020-12-03 15:17 derick Fixed in Version => 3.0.1
2020-12-03 15:17 derick Note Added: 0005568
2020-12-11 08:27 derick Relationship added has duplicate 0001913