Duck! Another blag incoming!

Valgrind pill

2017-02-04

I am sitting the valgrind room. Because I kinda heard everything in the python room. Talk by Philippe Waroquiers. This is going to be new feature overview, so I guess I can follow.

Discussing visualization capabilities of valgrind.

Memory allocation

  • Takes snapshots
  • Display evolution of memory usage
  • Also detailed snapshots are taken
  • Tree view memory feature --xtree-memory=none|allocs|full (3.13or later)
  • Produced on demand in vgdb

Demo xtreememory

overview
  • Convert pdf using LibreOffice

    xtreememory.kcg.4383

  • Output of massive is not easy to read. You have to scan stack-traces (ms_print)

  • massif-visualizer is much better

    • It has a graph of memory usage over time
    • Detail can be zoomed and expanded
    • Traces are easier to read
overview
  • kcachegrind > visualize xtreememory
    • Access to currently blocks/bytes
    • Access to total blocks/bytes
    • Navigate in the stack-trace and see details per frame

Demo smaller app

  • It has a source-browser

  • Shows allocations per line (current and total)

    • Selectable via menu
  • total - current != freed because it can be freed in another stackframe

  • Number of calls are not correct since it does snapshots and will be hidden in feature versions. Massif is not about function calls.

Demo xtree to .ms

  • Use xtreememory and visualize it with massive
  • Give .ms extensions
  • It does't display a evolution of the memory
  • Each snapshot display the same time, but different values
  • You always get 6 snapshots per real snapshot

Other tools

  • Use xtree-memory with helgrind
  • Also gives a memory report
  • Request snapshot for remote process via vgdb

Massif vs xtree-memory format

  • Massif for huge data
  • Not design for more than on time of data
  • LibreOffice generates a 7GB file
  • xtree is somehow compressed
  • xtree-memory=allocs has no impact on the run-time
  • Produce during execution: xgdb xtmemory
    • Supported by msssif/memcheck/helcheck
    • Can even be done with --xtree-memory=none * Will produce m=allocs

Xtree also does leaks

  • --xtree-leaks=yes > xtleak.kcg.%p
  • vgdb leak_check at run-time
    • Produces incremental leak searches if repeated

Future xtree for syscall

  • Same visualization can be used for syscalls
    • Nr of calls
    • Nr of failed calls
    • Syscall time
    • Bytes read/written

This entry was tagged as valgrind fosdem