Commit 1932ec0
committed
Components/profiling: improve
Enhance the `_mcount` function documentation in gprof.c with comprehensive
explanations of the RISC-V mcount calling convention and LLVM compiler bug
workaround.
**Changes:**
- Add detailed Doxygen-style function documentation explaining
- Document LLVM bug llvm/llvm-project#121103
**Verification:**
Tested with demo_profiling example using nuclei_llvm toolchain:
# Install required tools
$ pip3 install -U gprof2dot
# Build and run (wait ~60s, then press Ctrl+C to terminate)
$ make TOOLCHAIN=nuclei_llvm DOWNLOAD=ddr clean
$ make TOOLCHAIN=nuclei_llvm DOWNLOAD=ddr -j all
$ make TOOLCHAIN=nuclei_llvm DOWNLOAD=ddr -j run_qemu > demo_profiling.log
Ctrl + C to stop it (after ~30s)
# Parse and generate profiling graph
$ python3 ../../../Components/profiling/parse.py demo_profiling.log
$ riscv64-unknown-elf-gprof demo_profiling.elf gmon.out | gprof2dot | dot -Tpng -o output.png
**Impact:**
- Helps developers understand the RISC-V profiling ABI requirements
- Documents the LLVM workaround for future maintenance
- Provides references to relevant specifications and bug reports
Signed-off-by: Huaqi Fang <578567190@qq.com>_mcount documentation with RISC-V ABI and LLVM bug workaround1 parent af33d6c commit 1932ec0
2 files changed
Lines changed: 55 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
265 | 265 | | |
266 | 266 | | |
267 | 267 | | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
268 | 302 | | |
269 | 303 | | |
270 | | - | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
271 | 324 | | |
272 | 325 | | |
273 | 326 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
| 203 | + | |
203 | 204 | | |
204 | 205 | | |
205 | 206 | | |
| |||
0 commit comments