Unable to get JetBrains.Profiler.SelfApi working on EC2 Linux instance

Hello,

I'm working on profiling a .NET5 service via the JetBrains.Profiler.SelfApi nuget package.  Our service is deployed to a Linux instance on Amazon EC2.  This service is loaded by a native wrapper that provides interop with our nodeJs services.  If I call DotTrace.EnsurePrerequisites(), I get a segmentation fault:
 

 [1] DLLExports D Starting snapshot capture... 
Segmentation fault

I tried manually copying the prerequisites from the NuGet package (jetbrains.dottrace.commandlinetools.linux-x64\2020.3.2) side-by-side with my assemblies but I get these errors instead:

[1] DLLExports E Failed to initialize snapshot tracing, encountered exception: System.InvalidOperationException: The prerequisite isn't ready, call DownloadAsync() first.

If I run dotTrace.sh directly on the Linux instance, it seems to initialize correctly.  What should I try next to get this working?

0
4 comments

Hello,

What Linux distribution are you using on Amazon EC2?

What do you mean by the correct initialization of dotTrace.sh on the Linux instance? Am I right that you can get a snapshot?

0

Here's our Linux distribution:

[ec2-user@ip-10-0-0-208 jsmith]$ cat /etc/os-release
NAME="Amazon Linux"
VERSION="2"
ID="amzn"
ID_LIKE="centos rhel fedora"
VERSION_ID="2"
PRETTY_NAME="Amazon Linux 2"
ANSI_COLOR="0;33"
CPE_NAME="cpe:2.3:o:amazon:amazon_linux:2"
HOME_URL="https://amazonlinux.com/"

yes I'm able to manually capture a snapshot using dotTrace.sh:

 

[ec2-user@ip-10-0-0-208 Release]$ ./dotTrace.sh attach 11393 --save-to=snapshot.dtp --service-input=stdin
dotTrace Console Profiler 2020.3.2 build 777.0.20201229.110730. Copyright (C) 2020 JetBrains s.r.o.
Profiling in progress...
##dotTrace["ready"]
You can control profiling by sending command messages to stdin. For details, type ##dotTrace["help"]
##dotTrace["connected",{"pid":11393,"path":"/opt/nvm/versions/node/v8.11.1/bin/node"}]
##dotTrace["started",{"pid":11393,"path":"/opt/nvm/versions/node/v8.11.1/bin/node"}]
##dotTrace["get-snapshot"]
##dotTrace["stopped",{"pid":11393,"path":"/opt/nvm/versions/node/v8.11.1/bin/node"}]
##dotTrace["snapshot-saved",{"pid":11393,"filename":"/home/ec2-user/jsmith/wip-packages/bf-game-sim/build/Release/snapshot.dtp"}]
##dotTrace["disconnect"]
##dotTrace["disconnected",{"pid":11393,"path":"/opt/nvm/versions/node/v8.11.1/bin/node"}]
Profiling is finished in 51.166 seconds
Collected snapshot: /home/ec2-user/jsmith/wip-packages/bf-game-sim/build/Release/snapshot.dtp

 

0

Thank you.

Could you please download the console profiler from our site (https://www.jetbrains.com/profiler/download/#section=commandline), unpack it, and specify the corresponding directory in DotTrace.EnsurePrerequisite(string downloadTo=CLTDirectory)? Will it work in this case?

0

nice, this workaround works for me!

0

Please sign in to leave a comment.