Diagnostics: dotnet-trace Error: Unable to create file with --format SpeedScope in Linux

Created on 17 Jul 2019  路  7Comments  路  Source: dotnet/diagnostics

I am trying to create a trace in speedscope format and I receive the following error:

[clanderas@Baal ConfigDemo]$ dotnet trace collect -p 20750 --format SpeedScope
Unable to create file.

Creating traces with NetPerf is working without problem.

My SO is Manjaro Linux:

Linux 4.19.56-1-MANJARO 1 SMP PREEMPT Wed Jun 26 03:35:21 UTC 2019 x86_64 GNU/Linux

SDK Version: 3.0.100-preview6-012264
dotnet-trace Version: 1.0.4-preview6.19311.1+caee2e63c16b3ad467620d1d24578aa758e99473

dotnet-trace

Most helpful comment

Thanks for the feedback! When you use the --format flag dotnet-trace still writes the nettrace (netperf pre-preview7) file since it needs it in order to create the .speedscope.json file. The nettrace file isn't deleted after the conversion since it contains more information than the converted format (and so it can be re-used to convert to other formats if converters are added for them).

In preview 6 and older, the tool would not overwrite files. Hence, the ambiguous error you're seeing. This has been changed and in preview 7 the default behavior will be to overwrite files (#374).

All 7 comments

Out of interest, do you have any previous trace files in the folder that you're running that command from? I saw a similar issue and I was able to "fix" it by manually deleting any previous files (i.e. '*.netperf' and '*.speedscope.json')

You are right @mattwarren. If I delete the trace.netperf file the SpeedScope trace is correctly created. I supposed the --format SpeedScope would write to a different file.

Glad it worked for you.

I actually think this issue should be left open. Either that error message should be changed to actually let you know what's going on or it should try and write the file with a different name.

Either way, the existing behaviour is a bit confusing!?

Reopening it, I totally agree with you. Some kind of explanation should be given to the user

/cc @josalem

Thanks for the feedback! When you use the --format flag dotnet-trace still writes the nettrace (netperf pre-preview7) file since it needs it in order to create the .speedscope.json file. The nettrace file isn't deleted after the conversion since it contains more information than the converted format (and so it can be re-used to convert to other formats if converters are added for them).

In preview 6 and older, the tool would not overwrite files. Hence, the ambiguous error you're seeing. This has been changed and in preview 7 the default behavior will be to overwrite files (#374).

Thanks for the detailed explanation @josalem, closing the issue as it's fixed in version 7

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vtortola picture vtortola  路  6Comments

sdmaclea picture sdmaclea  路  7Comments

SachiraChin picture SachiraChin  路  3Comments

jmezach picture jmezach  路  6Comments

noahfalk picture noahfalk  路  9Comments