[all-commits] [llvm/llvm-project] fd9f3b: [memprof] Upgrade a unit test to Version 3 (#116516)

Kazu Hirata via All-commits all-commits at lists.llvm.org
Sat Nov 16 19:06:31 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fd9f3beb0f3f1745c0eb71e4dbd29ed7c1d04ff6
      https://github.com/llvm/llvm-project/commit/fd9f3beb0f3f1745c0eb71e4dbd29ed7c1d04ff6
  Author: Kazu Hirata <kazu at google.com>
  Date:   2024-11-16 (Sat, 16 Nov 2024)

  Changed paths:
    M llvm/unittests/ProfileData/InstrProfTest.cpp

  Log Message:
  -----------
  [memprof] Upgrade a unit test to Version 3 (#116516)

I'm planning to remove MemProf Version 1, which is a maintenance
burden because it uses a different set of struct fields in
IndexedAllocationInfo and IndexedMemProfRecord compared to Version 2
and 3.  (FWIW, Version 2 and 3 are much closer to each other.)

Before we remove the old version, we need to upgrade
test_memprof_merge to Version 3.  Here are some remarks:

- Without this patch, we call Writer.addMemProfFrame, which I don't
  think is correct.  This way, we are adding IndexedMemProfRecord to
  Writer2 without any frame.  I'm changing that to
  Writer2.addMemProfFrame.

- This patch adds a call to getCallStackMapping.  Version 2 and 3
  require a map from call stack IDs to call stacks.

- I'm calling makeRecordV2 instead of makeRecord to populate the
  struct fields used by Version 2 and 3.

- Version 1 uses MemProfRecord::MemProfRecord (that is, a constructor)
  to convert IndexedMemProfRecord to MemProfRecord.  Version 2 and 3
  use MemProfRecord::toMemProfRecord, a member function, to do the
  same task.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list