Skip to content

Commit f23a5f6

Browse files
committed
Merging changes synced from https://github.com/MicrosoftDocs/cpp-docs-pr (branch live)
2 parents 9b5b88e + 7a23980 commit f23a5f6

File tree

1 file changed

+21
-22
lines changed

1 file changed

+21
-22
lines changed
Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,35 @@
11
---
22
description: "Learn more about: /PROFILE (Performance Tools Profiler)"
33
title: "/PROFILE (Performance Tools Profiler)"
4-
ms.date: "11/04/2016"
4+
ms.date: 10/13/2021
55
f1_keywords: ["VC.Project.VCLinkerTool.Profile"]
66
helpviewer_keywords: ["-PROFILE linker option", "/PROFILE linker option"]
7-
ms.assetid: e676baa1-5063-47a3-a357-ba0d1f0d1699
87
---
9-
# /PROFILE (Performance Tools Profiler)
8+
# `/PROFILE` (Performance Tools Profiler)
109

1110
Produces an output file that can be used with the Performance Tools profiler.
1211

1312
## Syntax
1413

15-
```
16-
/PROFILE
17-
```
14+
> **`/PROFILE`**
1815
1916
## Remarks
2017

2118
/PROFILE implies the following linker options:
2219

23-
- [/OPT:REF](opt-optimizations.md)
20+
- [`/DEBUG:FULL`](debug-generate-debug-info.md)
2421

25-
- /OPT:NOICF
22+
- [`/DEBUGTYPE:cv,fixup`](debugtype-debug-info-options.md)
2623

27-
- [/INCREMENTAL:NO](incremental-link-incrementally.md)
24+
- [`/OPT:REF`](opt-optimizations.md)
2825

29-
- [/FIXED:NO](fixed-fixed-base-address.md)
26+
- [`/OPT:NOICF`](opt-optimizations.md)
3027

31-
/PROFILE causes the linker to generate a relocation section in the program image. A relocation section allows the profiler to transform the program image to get profile data.
28+
- [`/INCREMENTAL:NO`](incremental-link-incrementally.md)
3229

33-
**/PROFILE** is only available only in Enterprise (team development) versions. For more information on PREfast, see [Code Analysis for C/C++ Overview](../../code-quality/code-analysis-for-c-cpp-overview.md).
30+
- [`/FIXED:NO`](fixed-fixed-base-address.md)
31+
32+
**`/PROFILE`** is used to support the Performance Tools for Visual Studio Profiler utility [`VSInstr.exe`](/visualstudio/profiling/vsinstr).
3433

3534
### To set this linker option in the Visual Studio development environment
3635

@@ -44,21 +43,21 @@ Produces an output file that can be used with the Performance Tools profiler.
4443

4544
1. See <xref:Microsoft.VisualStudio.VCProjectEngine.VCLinkerTool.Profile%2A>.
4645

47-
### To set this linker option within Visual Studio CMake project
46+
### To set this linker option in a Visual Studio CMake project
4847

49-
**CMake** project does not have a **Property Pages**, the linker options can be set by modifing the CMakeLists.txt.
48+
Because a **CMake** project doesn't have the usual **Property Pages** support, the linker option can be set by modifying the *`CMakeLists.txt`* file.
5049

51-
1. Open the CMakeLists.txt in the project root directory.
50+
1. Open the *`CMakeLists.txt`* file in the project root directory.
5251

53-
1. Add code below. For details, see [CMake references](https://cmake.org/cmake/help/v3.0/command/set_target_properties.html)
52+
1. Add the code below. For more information, see the CMake [`set_target_properties`](https://cmake.org/cmake/help/latest/command/set_target_properties.html) documentation.
5453

55-
1. Rebuild your solution.
54+
```txt
55+
SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES LINK_FLAGS "/PROFILE")
56+
```
5657

57-
```
58-
SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES LINK_FLAGS "/PROFILE")
59-
```
58+
1. Rebuild your solution.
6059

6160
## See Also
6261

63-
[MSVC linker reference](linking.md)<br/>
64-
[MSVC Linker Options](linker-options.md)
62+
[MSVC linker reference](linking.md)\
63+
[MSVC linker options](linker-options.md)

0 commit comments

Comments
 (0)