Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit a346837

Browse files
gfoidlAndyAyersMS
authored andcommitted
Updated steps in 'Viewing JIT Dumps' to see optimized code (#17077)
If one follows the current described steps, one won't see the JIT dump for optimized code in the core lib. This PR adds the necessary step to see optimized code. Cf. https://github.com/dotnet/coreclr/issues/17065#issuecomment-374772011
1 parent 0ebc097 commit a346837

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

Documentation/building/viewing-jit-dumps.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ To make sense of the results, it is recommended you also read the [Reading a Jit
88

99
The first thing we want to do is setup the .NET Core app we want to dump. Here are the steps to do this, if you don't have one ready:
1010

11-
* Perform a debug build of the CoreCLR repo. You don't need to build tests, so you can pass `skiptests` to the build command to make it faster.
12-
* Install the [.NET CLI 2.0 preview](https://github.com/dotnet/corefx/blob/master/Documentation/project-docs/dogfooding.md), which we'll use to compile/publish our app.
11+
* Perform a release build of the CoreCLR repo by passing `release` to the build command. You don't need to build tests, so you can pass `skiptests` to the build command to make it faster. Note: the release build can be skipped, but in order to see optimized in the core library it is needed.
12+
* Perform a debug build of the CoreCLR repo. Tests aren't needed as in the release build, so you can pass `skiptests` to the build command. Note: the debug build is necessary, so that the JIT recognizes the configuration knobs.
13+
* Install the [.NET CLI 2.1 preview](https://github.com/dotnet/corefx/blob/master/Documentation/project-docs/dogfooding.md), which we'll use to compile/publish our app.
1314
* `cd` to where you want your app to be placed, and run `dotnet new console`.
1415
* Modify your `csproj` file so that it contains a RID (runtime ID) corresponding to the OS you're using in the `<RuntimeIdentifier>` tag. For example, for Windows 10 x64 machine, the project file is:
1516

@@ -61,10 +62,12 @@ The first thing we want to do is setup the .NET Core app we want to dump. Here a
6162

6263
```shell
6364
# Windows
64-
robocopy /e <coreclr path>\bin\Product\Windows_NT.<arch>.Debug <app root>\bin\Release\netcoreapp2.0\<rid>\publish > NUL
65+
robocopy /e <coreclr path>\bin\Product\Windows_NT.<arch>.Release <app root>\bin\Release\netcoreapp2.0\<rid>\publish > NUL
66+
copy <coreclr path>\bin\Product\Windows_NT.<arch>.Debug\clrjit.dll <app root>\bin\Release\netcoreapp2.0\<rid>\publish > NUL
6567

6668
# Unix
67-
cp -rT <coreclr path>/bin/Product/<OS>.<arch>.Debug <app root>/bin/Release/netcoreapp2.0/<rid>/publish
69+
cp -rT <coreclr path>/bin/Product/<OS>.<arch>.Release <app root>/bin/Release/netcoreapp2.0/<rid>/publish
70+
cp <coreclr path>/bin/Product/<OS>.<arch>.Debug/libclrjit.so <app root>/bin/Release/netcoreapp2.0/<rid>/publish
6871
```
6972

7073
* Set the configuration knobs you need (see below) and run your published app. The info you want should be dumped to stdout.

0 commit comments

Comments
 (0)