Repository navigation
Split threads by default in memray transform csv - #1056
Conversation
|
@BhargavKumarNath this is your work from #1006, lightly edited. I simplified the tests quite a lot, dropping some things that I think were already adequately exercised by other tests, and switching to building a capture file "by hand" rather than running a test program to generate one to simplify the remaining test. All of the implementation and docs match yours, except that I changed the NotImplementedError to be raised whenever Sorry for not getting around to reviewing #1006 before you deleted your fork 😅 but I'm leaving the commit attribution as you since you did basically all of the work here, and I just tweaked the tests and one exception check / message. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1056 +/- ##
==========================================
- Coverage 92.35% 92.31% -0.04%
==========================================
Files 103 103
Lines 13363 13385 +22
Branches 483 484 +1
==========================================
+ Hits 12341 12357 +16
- Misses 1022 1028 +6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Thanks for picking this up, @godlygeek, and no worries about #1006. I'm glad it's getting in. The simplified tests and the merge_threads == (self.format == "csv") check both look good to me. That condition covers both invalid combinations in one place, which is cleaner than what I had. Let me know if you'd like anything else changed on my side. |
`memray transform` always retrieved allocation records with threads merged, so allocations made on different threads at the same call stack collapsed into a single CSV row and the `tid` / `thread_name` columns no longer identified a single thread. The point of the csv format is to be machine-parseable, so rather than adding an opt-in flag, make `memray transform csv` retrieve records with `merge_threads=False` by default. Each thread's allocations now stay on their own row carrying that thread's real `tid` and `thread_name`, which is also what the csv column documentation has always described. The gprof2dot and speedscope formats have no per-thread dimension and are unchanged. Signed-off-by: Bhargav kumar Nath <bhargavkumarnathh@gmail.com>
ba51f5c to
1ead335
Compare
Closes: #996
memray transformalways retrieved allocation records with threads merged, so allocations made on different threads at the same call stack collapsed into a single CSV row and thetid/thread_namecolumns no longer identified a single thread.The point of the csv format is to be machine-parseable, so rather than adding an opt-in flag, make
memray transform csvretrieve records withmerge_threads=Falseby default. Each thread's allocations now stay on their own row carrying that thread's realtidandthread_name, which is also what the csv column documentation has always described. The gprof2dot and speedscope formats have no per-thread dimension and are unchanged.