Skip to content

Commit 1576e5a

Browse files
HerrCai0907atc-github
authored andcommitted
feat(InsertTracePoint): support insert trace point (#128)
1 parent cddfb78 commit 1576e5a

File tree

11 files changed

+447
-7
lines changed

11 files changed

+447
-7
lines changed

docs/.vitepress/config.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ export default defineConfig({
4242
link: "/lower/index",
4343
items: listItems("docs", "lower"),
4444
},
45+
{
46+
text: "Builtin Transform",
47+
link: "/transform/index",
48+
items: listItems("docs", "transform"),
49+
},
4550
{
4651
text: "Optimization Passes",
4752
link: "/opt/index",

docs/index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ hero:
99
- theme: brand
1010
text: Lowering Pass
1111
link: /lower/index.md
12+
- theme: brand
13+
text: Builtin Transform
14+
link: /transform/index.md
1215
- theme: brand
1316
text: Optimization Pass
1417
link: /opt/index.md

docs/transform/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
WARPO integrates some common used transforms.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
WARP support tracing by `builtin.tracePoint` API.
2+
3+
This transform will insert calling `builtin.tracePoint` to statistic execution status of each function.
4+
5+
- For the normal functions, calling `builtin.tracePoint` will be inserted before and after function.
6+
- For the import functions, calling `builtin.tracePoint` will be inserted before and after calling.
7+
8+
### options
9+
10+
#### `--trace-point-mapping-file <file path>`
11+
12+
Enable transform by providing mapping file path.
13+
The trace point mapped function name will be outputted in the mapping file with following format.
14+
15+
```
16+
<trace point number> ' ' <function name>
17+
```

include/warpo/support/Opt.hpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ namespace warpo::cli {
88

99
enum class Category : uint32_t {
1010
None = 0,
11-
Frontend = 1 << 1,
12-
Optimization = 1 << 2,
13-
OnlyForTest = 1 << 3,
11+
OnlyForTest = 1 << 1,
12+
Frontend = 1 << 2,
13+
Optimization = 1 << 3,
14+
Transformation = 1 << 4,
1415
All = static_cast<uint32_t>(-1),
1516
};
1617

include/warpo/support/StatisticsKinds.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#endif
77

88
PERF_ITEM_KIND_TOP(CompilationHIR)
9+
PERF_ITEM_KIND_TOP(Instrument)
910
PERF_ITEM_KIND_TOP(Optimization)
1011
PERF_ITEM_KIND_TOP(Validation)
1112
PERF_ITEM_KIND_TOP(Lowering)

0 commit comments

Comments
 (0)