Open ljw1004 opened 2 years ago
Apologies about the very slow response!
I don't see anything wrong with that code at first glance, do you have some trace files handy that fail to merge? I wouldn't worry about the "33: " being different: that shows the length of the common prefix between this backtrace and the last, which you'd expect should change when you merge files together. (That field isn't very useful in the dump output and should probably be removed. It was more for debugging memtrace itself)
Since multithreaded-ocaml isn't mature, we're using forked processes to do work in parallel. I can make individual forked process write its own memtrace .ctf file -- but, how to merge them?
It'd be great if there could be a test/merge.ml, to go alongside test/copy.ml.
Here's my attempt. It seems to work. But I had to obliterate the timestamps...
When I tried to respect the original timestamps, (and sort them in order since that's required), then it still produced a trace with the correct number of samples, but its content was incorrect - i.e. it ascribed the wrong backtraces to allocations.
memtrace_dump
reveals that it got the wrong number in a lot of the samples, in the "33" position below. (Unfortunately I couldn't find an explanation of what memtrace_dump produces, and don't know what this number means).Anyway, here's my my incorrect attempt at preserving timestamps: