Tracking issue: https://github.com/llvm/llvm-project/issues/201242 Migration guide docs: https://llvm.org/docs/SphinxQuickstartTemplate.html#markdown-migration-guidelines RFC: https://discourse.llvm.org/t/rfc-make-myst-markdown-the-llvm-docs-format-rip-rest/90840 This change was produced with rst2myst plus LLM cleanups. I manually paged through all of the linked HTML documents looking for visual artifacts, and I fixed everything I found. To reviewers: Please spot check the generated HTML below, and spot check the diff to look for artifacts. This change is too large to review everything line-by-line, but if you check 10 pages of documentation, and only find one migration bug, I hope you think that this is good enough to land. We have existing reST bugs that this fixes (mostly italic blocks that should be code font spans). ----- Links to the updated HTML for validation: | Source file | Before HTML | After HTML | |---|---|---| | `clang/docs/UsersManual.md` | [before](https://clang.llvm.org/docs/UsersManual.html) | [after](https://llvmdocs.staging.reidkleckner.dev/clang/docs/UsersManual.html) | | `clang/docs/SanitizerStats.md` | [before](https://clang.llvm.org/docs/SanitizerStats.html) | [after](https://llvmdocs.staging.reidkleckner.dev/clang/docs/SanitizerStats.html) | | `clang/docs/SanitizerSpecialCaseList.md` | [before](https://clang.llvm.org/docs/SanitizerSpecialCaseList.html) | [after](https://llvmdocs.staging.reidkleckner.dev/clang/docs/SanitizerSpecialCaseList.html) | | `clang/docs/OverflowBehaviorTypes.md` | [before](https://clang.llvm.org/docs/OverflowBehaviorTypes.html) | [after](https://llvmdocs.staging.reidkleckner.dev/clang/docs/OverflowBehaviorTypes.html) | | `clang/docs/LTOVisibility.md` | [before](https://clang.llvm.org/docs/LTOVisibility.html) | [after](https://llvmdocs.staging.reidkleckner.dev/clang/docs/LTOVisibility.html) | | `clang/docs/PointerAuthentication.md` | [before](https://clang.llvm.org/docs/PointerAuthentication.html) | [after](https://llvmdocs.staging.reidkleckner.dev/clang/docs/PointerAuthentication.html) | | `clang/docs/SafeStack.md` | [before](https://clang.llvm.org/docs/SafeStack.html) | [after](https://llvmdocs.staging.reidkleckner.dev/clang/docs/SafeStack.html) | | `clang/docs/ShadowCallStack.md` | [before](https://clang.llvm.org/docs/ShadowCallStack.html) | [after](https://llvmdocs.staging.reidkleckner.dev/clang/docs/ShadowCallStack.html) | | `clang/docs/StructureProtection.md` | [before](https://clang.llvm.org/docs/StructureProtection.html) | [after](https://llvmdocs.staging.reidkleckner.dev/clang/docs/StructureProtection.html) | | `clang/docs/SourceBasedCodeCoverage.md` | [before](https://clang.llvm.org/docs/SourceBasedCodeCoverage.html) | [after](https://llvmdocs.staging.reidkleckner.dev/clang/docs/SourceBasedCodeCoverage.html) | | `clang/docs/StandardCPlusPlusModules.md` | [before](https://clang.llvm.org/docs/StandardCPlusPlusModules.html) | [after](https://llvmdocs.staging.reidkleckner.dev/clang/docs/StandardCPlusPlusModules.html) | | `clang/docs/Modules.md` | [before](https://clang.llvm.org/docs/Modules.html) | [after](https://llvmdocs.staging.reidkleckner.dev/clang/docs/Modules.html) | | `clang/docs/MSVCCompatibility.md` | [before](https://clang.llvm.org/docs/MSVCCompatibility.html) | [after](https://llvmdocs.staging.reidkleckner.dev/clang/docs/MSVCCompatibility.html) | | `clang/docs/MisExpect.md` | [before](https://clang.llvm.org/docs/MisExpect.html) | [after](https://llvmdocs.staging.reidkleckner.dev/clang/docs/MisExpect.html) | | `clang/docs/OpenCLSupport.md` | [before](https://clang.llvm.org/docs/OpenCLSupport.html) | [after](https://llvmdocs.staging.reidkleckner.dev/clang/docs/OpenCLSupport.html) | | `clang/docs/OpenMPSupport.md` | [before](https://clang.llvm.org/docs/OpenMPSupport.html) | [after](https://llvmdocs.staging.reidkleckner.dev/clang/docs/OpenMPSupport.html) | | `clang/docs/SYCLSupport.md` | [before](https://clang.llvm.org/docs/SYCLSupport.html) | [after](https://llvmdocs.staging.reidkleckner.dev/clang/docs/SYCLSupport.html) | | `clang/docs/HIPSupport.md` | [before](https://clang.llvm.org/docs/HIPSupport.html) | [after](https://llvmdocs.staging.reidkleckner.dev/clang/docs/HIPSupport.html) | | `clang/docs/HLSL/HLSLDocs.md` | [before](https://clang.llvm.org/docs/HLSL/HLSLDocs.html) | [after](https://llvmdocs.staging.reidkleckner.dev/clang/docs/HLSL/HLSLDocs.html) | | `clang/docs/ThinLTO.md` | [before](https://clang.llvm.org/docs/ThinLTO.html) | [after](https://llvmdocs.staging.reidkleckner.dev/clang/docs/ThinLTO.html) | --------- Co-authored-by: Chris B <chris.bieneman@me.com>
1.8 KiB
SanitizerStats
:local:
Introduction
The sanitizers support a simple mechanism for gathering profiling statistics to help understand the overhead associated with sanitizers.
How to build and run
SanitizerStats can currently only be used with {doc}ControlFlowIntegrity.
In addition to -fsanitize=cfi*, pass the -fsanitize-stats flag.
This will cause the program to count the number of times that each control
flow integrity check in the program fires.
At run time, set the SANITIZER_STATS_PATH environment variable to direct
statistics output to a file. The file will be written on process exit.
The following substitutions will be applied to the environment variable:
%b-- The executable basename.%p-- The process ID.
You can also send the SIGUSR2 signal to a process to make it write
sanitizer statistics immediately.
The sanstats program can be used to dump statistics. It takes as a
command line argument the path to a statistics file produced by a program
compiled with -fsanitize-stats.
The output of sanstats is in four columns, separated by spaces. The first
column is the file and line number of the call site. The second column is
the function name. The third column is the type of statistic gathered (in
this case, the type of control flow integrity check). The fourth column is
the call count.
Example:
$ cat -n vcall.cc
1 struct A {
2 virtual void f() {}
3 };
4
5 __attribute__((noinline)) void g(A *a) {
6 a->f();
7 }
8
9 int main() {
10 A a;
11 g(&a);
12 }
$ clang++ -fsanitize=cfi -fvisibility=hidden -flto -fuse-ld=gold vcall.cc -fsanitize-stats -g
$ SANITIZER_STATS_PATH=a.stats ./a.out
$ sanstats a.stats
vcall.cc:6 _Z1gP1A cfi-vcall 1