Granulate / gprofiler

gProfiler is a system-wide profiler, combining multiple sampling profilers to produce unified visualization of what your CPU is spending time on.
https://profiler.granulate.io
Apache License 2.0
743 stars 54 forks source link

Dotnet trace doesn't work on alpine #795

Open mpozniak95 opened 1 year ago

mpozniak95 commented 1 year ago

Running dotnet profiling in gprofiler_exe on alpine results with:

FileNotFoundError: [Errno 2] No such file or directory: '/tmp/_MEIUIo28e/gprofiler/resources/dotnet/tools/dotnet-trace'

Dotnet-trace needs to run with via_staticx parameter when we invoke it - this way, it runs in staticx context. Also it will require packing additional libraries into the executable

mpozniak95 commented 1 year ago

Adding staticx $LIBS -l gprofiler/resources/dotnet/tools/ dist/gprofiler dist/gprofiler ; \ leads to another exception: stderr: Process terminated. Couldn't find a valid ICU package installed on the system. Please install libicu using your package manager and try again. Alternatively you can set the configuration flag System.Globalization.Invariant to true if you want to run with no globalization support. Please see https://aka.ms/dotnet-missing-libicu for more information. at System.Environment.FailFast(System.String) at System.Globalization.GlobalizationMode+Settings..cctor() at System.Globalization.CultureData.CreateCultureWithInvariantData() at System.Globalization.CultureData.get_Invariant() at System.Globalization.CultureInfo..cctor() at System.Globalization.CultureInfo.get_CurrentCulture() at System.String.StartsWith(System.String, System.StringComparison) at System.String.StartsWith(System.String) at System.CommandLine.Parsing.StringExtensions.RemovePrefix(System.String) at System.CommandLine.Option.AddAliasInner(System.String) at System.CommandLine.Option..ctor(System.String[], System.String) at Microsoft.Diagnostics.Tools.Trace.CommonOptions.ProcessIdOption() at Microsoft.Diagnostics.Tools.Trace.CollectCommandHandler.CollectCommand() at Microsoft.Diagnostics.Tools.Trace.Program.Main(System.String[]) at Microsoft.Diagnostics.Tools.Trace.Program.<Main>(System.String[])