This is has become a lot easier and more reliable to do now with BPF [0].
I also used the same approach to create a somewhat user-friendly TUI and web dashboard for it [1]. It is also able to hash the executable (even if it was shortlived).
[0] https://www.gcardone.net/2020-07-31-per-process-bandwidth-mo...