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 |
Competenza del profiler Valgrind per il rilevamento degli errori di memoria e la profilazione della cache. Da utilizzare durante l'esecuzione di Memcheck per individuare danneggiamenti dell'heap, use-after-free, perdite di memoria o letture non inizializzate; o Cachegrind/Callgrind per la simulazione della cache e la profilazione a livello di funzione. Si attiva su query su valgrind, memcheck, perdite di heap, use-after-free senza disinfettanti, cachegrind, callgrind, KCachegrind o profilazione di memoria massif. Fonte: mohitmishra786/low-level-dev-skills.