Skip to content

Latest commit

 

History

History
43 lines (29 loc) · 1.45 KB

notes.md

File metadata and controls

43 lines (29 loc) · 1.45 KB

Development notes

  • Reboot with dbus

    • sudo busctl call org.freedesktop.systemd1 /org/freedesktop/systemd1 org.freedesktop.systemd1.Manager Reboot
  • Restart systemd-networkd

    • busctl call org.freedesktop.systemd1 /org/freedesktop/systemd1/unit/systemd_2dnetworkd_2eservice org.freedesktop.systemd1.Unit Restart s "fail"
  • setting capabilities for srd binary to create raw sockets (SOCK_RAW)

    • sudo setcap 'CAP_NET_RAW+eip' ./srd

Resources

VM (testing):

  • mount shared folder: sudo mount -t vboxsf -o uid=$USER,gid=vboxsf Desktop /mnt/shared

  • mount guest additions: mkdir /mnt/guest_additions sudo mount /dev/cdrom /mnt/guest_additions

  • stopping when running with valgrind:

    • kill -SIGALRM 276436 (obtained with ps -aux | grep "srd")
  • kill srd (send SIGALRM)

    • ps -aux | grep srd | grep -v "grep" | cut -f 5 -d ' ' | xargs kill -SIGALRM
  • checking memory leaks:

    • valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes ./srd
  • flamegraph

    • ./srd &
    • sudo perf record -F 99 -g [SRD_PID]
    • perf script > out.perf
    • stackcollapse-perf.pl out.perf > perf.data_collapsed
    • flamegraph.pl perf.data_collapsed > out.svg