Guide agents through Valgrind tools: Memcheck for memory errors, Cachegrind for cache simulation, Callgrind for call graphs, and Massif for heap profiling.
Compile with -g -O1 for best results. -O0 is also fine; avoid -O2+ which can produce false positives.
| --leak-check=full | summary | Full leak details | | --show-leak-kinds=all | definite | Show all leak kinds | | --track-origins=yes | no | Show where uninit values came from (slow) | | --error-exitcode=N | 0 | Exit N if errors found (CI integration) | | --log-file=file | stderr | Save report to file | | --suppressions=file | none | Suppress known FPs |
메모리 오류 감지 및 캐시 프로파일링을 위한 Valgrind 프로파일러 기술입니다. Memcheck를 실행할 때 힙 손상, use-after-free, 메모리 누수 또는 초기화되지 않은 읽기를 찾는 데 사용합니다. 또는 캐시 시뮬레이션 및 기능 수준 프로파일링을 위한 Cachegrind/Callgrind. valgrind, memcheck, 힙 누수, 살균제 없는 use-after-free, 캐시그라인드, callgrind, KCachegrind 또는 Massif 메모리 프로파일링에 대한 쿼리에 대해 활성화됩니다. 출처: mohitmishra786/low-level-dev-skills.