|
1 | 1 | ---
|
2 | 2 | description: "Learn more about: /GENPROFILE, /FASTGENPROFILE (Generate Profiling Instrumented Build)"
|
3 | 3 | title: "/GENPROFILE, /FASTGENPROFILE (Generate Profiling Instrumented Build)"
|
4 |
| -ms.date: "03/14/2018" |
| 4 | +ms.date: 04/14/2021 |
5 | 5 | f1_keywords: ["GENPROFILE", "FASTGENPROFILE", "/GENPROFILE", "/FASTGENPROFILE"]
|
6 | 6 | helpviewer_keywords: ["GENPROFILE", "FASTGENPROFILE"]
|
7 |
| -ms.assetid: deff5ce7-46f5-448a-b9cd-a7a83a6864c6 |
8 | 7 | ---
|
9 |
| -# /GENPROFILE, /FASTGENPROFILE (Generate Profiling Instrumented Build) |
| 8 | +# `/GENPROFILE`, `/FASTGENPROFILE` (Generate Profiling Instrumented Build) |
10 | 9 |
|
11 |
| -Specifies generation of a .pgd file by the linker to support profile-guided optimization (PGO). **/GENPROFILE** and **/FASTGENPROFILE** use different default parameters. Use **/GENPROFILE** to favor precision over speed and memory usage during profiling. Use **/FASTGENPROFILE** to favor smaller memory usage and speed over precision. |
| 10 | +Specifies generation of a *`.pgd`* file by the linker to support profile-guided optimization (PGO). **`/GENPROFILE`** and **`/FASTGENPROFILE`** use different default parameters. Use **`/GENPROFILE`** to favor precision over speed and memory usage during profiling. Use **`/FASTGENPROFILE`** to favor smaller memory usage and speed over precision. |
12 | 11 |
|
13 | 12 | ## Syntax
|
14 | 13 |
|
15 |
| -> **/GENPROFILE**\[**:**{\[**COUNTER32**\|**COUNTER64**]\|\[**EXACT**\|**NOEXACT**]\|**MEMMAX=**_#_\|**MEMMIN=**_#_\|\[**PATH**\|**NOPATH**]\|\[**TRACKEH** \|**NOTRACKEH** ]\|**PGD=**_filename_}]\ |
16 |
| -> **/FASTGENPROFILE**\[**:**{\[**COUNTER32**\|**COUNTER64**]\|\[**EXACT**\|**NOEXACT**]\|**MEMMAX=**_#_\|**MEMMIN=**_#_\|[**PATH**\|**NOPATH** ]\|\[**TRACKEH** \|**NOTRACKEH** ]\|**PGD=**_filename_}] |
| 14 | +> **`/GENPROFILE`**\[**`:`**_`profile-argument`_\[**`,`**_`profile-argument`_ ...]]\ |
| 15 | +> **`/FASTGENPROFILE`**\[**`:`**_`profile-argument`_\[**`,`**_`profile-argument`_ ...]]\ |
| 16 | +
|
| 17 | +> *`profile-argument`*\ |
| 18 | +>  { **`COUNTER32`** | **`COUNTER64`** }\ |
| 19 | +>  { **`EXACT`** | **`NOEXACT`** }\ |
| 20 | +>  **`MEMMAX=`**_value_\ |
| 21 | +>  **`MEMMIN=`**_value_\ |
| 22 | +>  { **`PATH`** | **`NOPATH`** }\ |
| 23 | +>  { **`TRACKEH`** | **`NOTRACKEH`** }\ |
| 24 | +>  **`PGD=`**_filename_ |
17 | 25 |
|
18 | 26 | ### Arguments
|
19 | 27 |
|
20 |
| -Any of the following arguments may be specified to **/GENPROFILE** or **/FASTGENPROFILE**. Arguments listed here separated by a pipe (**|**) character are mutually exclusive. Use a comma (**,**) character to separate options. |
| 28 | +Any of the *`profile-argument`* arguments may be specified to **`/GENPROFILE`** or **`/FASTGENPROFILE`**. Arguments listed here separated by a pipe character (**`|`**) are mutually exclusive. Use a comma character (**`,`**) to separate arguments. Don't put spaces between arguments, commas, or after the colon (**`:`**). |
21 | 29 |
|
22 |
| -**COUNTER32** | **COUNTER64**<br/> |
23 |
| -Use **COUNTER32** to specify the use of 32-bit probe counters, and **COUNTER64** to specify 64-bit probe counters. When you specify **/GENPROFILE**, the default is **COUNTER64**. When you specify **/FASTGENPROFILE**, the default is **COUNTER32**. |
| 30 | +**`COUNTER32`** | **`COUNTER64`**\ |
| 31 | +Use **`COUNTER32`** to specify the use of 32-bit probe counters, and **`COUNTER64`** to specify 64-bit probe counters. When you specify **`/GENPROFILE`**, the default is **`COUNTER64`**. When you specify **`/FASTGENPROFILE`**, the default is **`COUNTER32`**. |
24 | 32 |
|
25 |
| -**EXACT** | **NOEXACT**<br/> |
26 |
| -Use **EXACT** to specify thread-safe interlocked increments for probes. **NOEXACT** specifies unprotected increment operations for probes. The default is **NOEXACT**. |
| 33 | +**`EXACT`** | **`NOEXACT`**\ |
| 34 | +Use **`EXACT`** to specify thread-safe interlocked increments for probes. **`NOEXACT`** specifies unprotected increment operations for probes. The default is **`NOEXACT`**. |
27 | 35 |
|
28 |
| -**MEMMAX**=*value*, **MEMMIN**=*value*<br/> |
29 |
| -Use **MEMMAX** and **MEMMIN** to specify the maximum and minimum reservation sizes for training data in memory. The value is the amount of memory to reserve in bytes. By default, these values are determined by an internal heuristic. |
| 36 | +**`MEMMAX`**=*value*, **`MEMMIN`**=*value*\ |
| 37 | +Use **`MEMMAX`** and **`MEMMIN`** to specify the maximum and minimum reservation sizes for training data in memory. The value is the amount of memory to reserve in bytes. By default, these values are determined by an internal heuristic. |
30 | 38 |
|
31 |
| -**PATH** | **NOPATH** <br/> |
32 |
| -Use **PATH** to specify a separate set of PGO counters for each unique path to a function. Use **NOPATH** to specify only one set of counters for each function. When you specify **/GENPROFILE**, the default is **PATH** . When you specify **/FASTGENPROFILE**, the default is **NOPATH** . |
| 39 | +**`PATH`** | **`NOPATH`**\ |
| 40 | +Use **`PATH`** to specify a separate set of PGO counters for each unique path to a function. Use **`NOPATH`** to specify only one set of counters for each function. When you specify **`/GENPROFILE`**, the default is **`PATH`** . When you specify **`/FASTGENPROFILE`**, the default is **`NOPATH`** . |
33 | 41 |
|
34 |
| -**TRACKEH** | **NOTRACKEH** <br/> |
35 |
| -Specifies whether to use extra counters to keep an accurate count when exceptions are thrown during training. Use **TRACKEH** to specify extra counters for an exact count. Use **NOTRACKEH** to specify single counters for code that does not use exception handling or that does not encounter exceptions in your training scenarios. When you specify **/GENPROFILE**, the default is **TRACKEH** . When you specify **/FASTGENPROFILE**, the default is **NOTRACKEH** . |
| 42 | +**`TRACKEH`** | **`NOTRACKEH`**\ |
| 43 | +Specifies whether to use extra counters to keep an accurate count when exceptions are thrown during training. Use **`TRACKEH`** to specify extra counters for an exact count. Use **`NOTRACKEH`** to specify single counters for code that doesn't use exception handling or that doesn't run into exceptions in your training scenarios. When you specify **`/GENPROFILE`**, the default is **`TRACKEH`** . When you specify **`/FASTGENPROFILE`**, the default is **`NOTRACKEH`** . |
36 | 44 |
|
37 |
| -**PGD**=*filename*<br/> |
38 |
| -Specifies a base file name for the .pgd file. By default, the linker uses the base executable image file name with a .pgd extension. |
| 45 | +**`PGD`**=*filename*\ |
| 46 | +Specifies a base file name for the *`.pgd`* file. By default, the linker uses the base executable image file name with a *`.pgd`* extension. |
39 | 47 |
|
40 | 48 | ## Remarks
|
41 | 49 |
|
42 |
| -The **/GENPROFILE** and **/FASTGENPROFILE** options tell the linker to generate the profiling instrumentation file needed to support application training for profile-guided optimization (PGO). These options are new in Visual Studio 2015. Prefer these options to the deprecated **/LTCG:PGINSTRUMENT**, **/PGD** and **/POGOSAFEMODE** options and the **PogoSafeMode**, **VCPROFILE_ALLOC_SCALE** and **VCPROFILE_PATH** environment variables. The profiling information generated by application training is used as input to perform targeted whole-program optimizations during builds. You can set additional options to control various profiling features for performance during app training and builds. The default options specified by **/GENPROFILE** give most accurate results, especially for large, complex multi-threaded apps. The **/FASTGENPROFILE** option uses different defaults for a lower memory footprint and faster performance during training, at the expense of accuracy. |
| 50 | +The **`/GENPROFILE`** and **`/FASTGENPROFILE`** options tell the linker to generate the profiling instrumentation file needed to support application training for profile-guided optimization (PGO). These options are new in Visual Studio 2015. Prefer these options to the deprecated **`/LTCG:PGINSTRUMENT`**, **`/PGD`**, and **`/POGOSAFEMODE`** options, and to the **`PogoSafeMode`**, **`VCPROFILE_ALLOC_SCALE`**, and **`VCPROFILE_PATH`** environment variables. The profiling information generated by application training is used as input for targeted whole-program optimizations during builds. You can also set other options to control various profiling features for performance during app training and builds. The default options specified by **`/GENPROFILE`** give the most accurate results, especially for large, complex multi-threaded apps. The **`/FASTGENPROFILE`** option uses different defaults for a lower memory footprint and faster performance during training, at the expense of accuracy. |
43 | 51 |
|
44 |
| -Profiling information is captured when you run the instrumented app after you build by using **/GENPROFILE** of **/FASTGENPROFILE**. This information is captured when you specify the [/USEPROFILE](useprofile.md) linker option to perform the profiling step and then used to guide the optimized build step. For more information on how to train your app and details on the collected data, see [Profile-Guided Optimizations](../profile-guided-optimizations.md). |
| 52 | +Profiling information is captured when you run the instrumented app after you build by using **`/GENPROFILE`** of **`/FASTGENPROFILE`**. This information is captured when you specify the [`/USEPROFILE`](useprofile.md) linker option to do the profiling step and then used to guide the optimized build step. For more information on how to train your app and details on the collected data, see [Profile-guided optimizations](../profile-guided-optimizations.md). |
45 | 53 |
|
46 |
| -You must also specify **/LTCG** when you specify **/GENPROFILE** or **/FASTGENPROFILE**. |
| 54 | +Always specify **`/LTCG`** when you specify **`/GENPROFILE`** or **`/FASTGENPROFILE`**. |
47 | 55 |
|
48 | 56 | ### To set this linker option in the Visual Studio development environment
|
49 | 57 |
|
50 | 58 | 1. Open the project's **Property Pages** dialog box. For details, see [Set C++ compiler and build properties in Visual Studio](../working-with-project-properties.md).
|
51 | 59 |
|
52 | 60 | 1. Select the **Configuration Properties** > **Linker** > **Command Line** property page.
|
53 | 61 |
|
54 |
| -1. Enter the **/GENPROFILE** or **/FASTGENPROFILE** options and arguments into the **Additional Options** box. Choose **OK** to save your changes. |
| 62 | +1. Enter the **`/GENPROFILE`** or **`/FASTGENPROFILE`** options and arguments into the **Additional Options** box. Choose **`OK`** to save your changes. |
55 | 63 |
|
56 | 64 | ### To set this linker option programmatically
|
57 | 65 |
|
58 | 66 | - See <xref:Microsoft.VisualStudio.VCProjectEngine.VCLinkerTool.AdditionalOptions%2A>.
|
59 | 67 |
|
60 | 68 | ## See also
|
61 | 69 |
|
62 |
| -[MSVC linker reference](linking.md)<br/> |
63 |
| -[MSVC Linker Options](linker-options.md)<br/> |
64 |
| -[/LTCG (Link-time Code Generation)](ltcg-link-time-code-generation.md)<br/> |
| 70 | +[MSVC linker reference](linking.md)\ |
| 71 | +[MSVC linker options](linker-options.md)\ |
| 72 | +[`/LTCG` (Link-time code generation)](ltcg-link-time-code-generation.md) |
0 commit comments