You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 23, 2023. It is now read-only.
Copy file name to clipboardExpand all lines: Documentation/building/viewing-jit-dumps.md
+78-88Lines changed: 78 additions & 88 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,115 +8,105 @@ To make sense of the results, it is recommended you also read the [Reading a Jit
8
8
9
9
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:
10
10
11
-
* Perform a debug build of the CoreCLR repo
12
-
* Install the [.NET CLI](http://microsoft.com/net/core), which we'll use to compile/publish our app
13
-
*`cd` to where you want your app to be placed, and run `dotnet new`
14
-
* Modify your `project.json` file so that it contains a RID (runtime ID) corresponding to the OS you're using in the `runtimes` section. For example, I have a Windows 10 x64 machine, so here's my project file:
15
-
16
-
```json
17
-
{
18
-
"buildOptions": {
19
-
"emitEntryPoint": true
20
-
},
21
-
"dependencies": {
22
-
"Microsoft.NETCore.App": "1.0.0-*"
23
-
},
24
-
"frameworks": {
25
-
"netcoreapp1.0": {
26
-
"imports": [
27
-
"dnxcore50",
28
-
"portable-net45+win8"
29
-
]
30
-
}
31
-
},
32
-
"runtimes": {
33
-
"win10-x64": {}
34
-
}
35
-
}
36
-
```
11
+
* Perform a debug build of the CoreCLR repo.
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.
13
+
*`cd` to where you want your app to be placed, and run `dotnet new console`.
14
+
* 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:
15
+
16
+
```xml
17
+
<ProjectSdk="Microsoft.NET.Sdk">
37
18
38
-
You can find a list of RIDs and their corresponding OSes [here](https://docs.microsoft.com/en-us/dotnet/articles/core/rid-catalog).
19
+
<PropertyGroup>
20
+
<OutputType>Exe</OutputType>
21
+
<TargetFramework>netcoreapp2.0</TargetFramework>
22
+
<RuntimeIdentifier>win10-x64</RuntimeIdentifier>
23
+
</PropertyGroup>
24
+
25
+
</Project>
26
+
```
27
+
28
+
You can find a list of RIDs and their corresponding OSes [here](https://docs.microsoft.com/en-us/dotnet/articles/core/rid-catalog).
39
29
40
30
* Edit `Program.cs`, and call the method(s) you want to dump in there. Make sure they are, directly or indirectly, called from `Main`. In this example, we'll be looking at the disassembly of our custom function `InefficientJoin`:
* After you've finished editing the code, run `dotnet publish -c Release`. This should drop all of the binaries needed to run your app in `bin/Release/<configuration>/<rid>/publish`.
59
+
* After you've finished editing the code, run `dotnet restore` and `dotnet publish -c Release`. This should drop all of the binaries needed to run your app in `bin/Release/<configuration>/<rid>/publish`.
70
60
* Overwrite the CLR dlls with the ones you've built locally. If you're a fan of the command line, here are some shell commands for doing this:
The behavior of the JIT can be controlled via a number of configuration variables. These are declared in [inc/clrconfigvalues.h](https://github.com/dotnet/coreclr/blob/master/src/inc/clrconfigvalues.h). When used as an environment variable, the string name generally has “COMPlus_” prepended. When used as a registry value name, the configuration name is used directly.
97
+
The behavior of the JIT can be controlled via a number of configuration variables. These are declared in [inc/clrconfigvalues.h](https://github.com/dotnet/coreclr/blob/master/src/inc/clrconfigvalues.h). When used as an environment variable, the string name generally has `COMPlus_` prepended. When used as a registry value name, the configuration name is used directly.
108
98
109
99
These can be set in one of three ways:
110
100
111
-
* Setting the environment variable `COMPlus_<flagname>`. For example, the following will set the `JitDump` flag so that the compilation of all methods named ‘Main’ will be dumped:
101
+
* Setting the environment variable `COMPlus_<flagname>`. For example, the following will set the `JitDump` flag so that the compilation of all methods named `Main` will be dumped:
112
102
113
-
```shell
114
-
# Windows
115
-
set COMPlus_JitDump=Main
103
+
```shell
104
+
# Windows
105
+
set COMPlus_JitDump=Main
116
106
117
-
# Unix
118
-
export COMPlus_JitDump=Main
119
-
```
107
+
# Unix
108
+
export COMPlus_JitDump=Main
109
+
```
120
110
121
111
**Windows-only:* Setting the registry key `HKCU\Software\Microsoft\.NETFramework`, Value `<flagName>`, type `REG_SZ` or `REG_DWORD` (depending on the flag).
122
112
**Windows-only:* Setting the registry key `HKLM\Software\Microsoft\.NETFramework`, Value `<flagName>`, type `REG_SZ` or `REG_DWORD` (depending on the flag).
@@ -143,13 +133,13 @@ Main
143
133
144
134
will match all methods named Main from any class and any number of arguments.
145
135
146
-
<types> is a comma separated list of type names. Note that presently only the number of arguments and not the types themselves are used to distinguish methods. Thus, `Main(Foo, Bar)` and `Main(int, int)` will both match any main method with two arguments.
136
+
`<types>` is a comma separated list of type names. Note that presently only the number of arguments and not the types themselves are used to distinguish methods. Thus, `Main(Foo, Bar)` and `Main(int, int)` will both match any main method with two arguments.
147
137
148
-
The wildcard character ‘*’ can be used for <ClassName> and <MethodName>. In particular * by itself indicates every method.
138
+
The wildcard character `*` can be used for `<ClassName>` and `<MethodName>`. In particular `*` by itself indicates every method.
149
139
150
140
## Useful COMPlus variables
151
141
152
-
Below are some of the most useful `COMPlus` variables. Where {method-list} is specified in the list below, you can supply a space-separated list of either fully-qualified or simple method names (the former is useful when running something that has many methods of the same name), or you can specific ‘*’ to mean all methods.
142
+
Below are some of the most useful `COMPlus` variables. Where {method-list} is specified in the list below, you can supply a space-separated list of either fully-qualified or simple method names (the former is useful when running something that has many methods of the same name), or you can specify `*` to mean all methods.
153
143
154
144
*`COMPlus_JitDump`={method-list} – dump lots of useful information about what the JIT is doing. See [Reading a JitDump](../botr/ryujit-overview.md#reading-a-jitdump) for more on how to analyze this data.
155
145
*`COMPlus_JitDisasm`={method-list} – dump a disassembly listing of each method.
0 commit comments