This is an archive of the discontinued LLVM Phabricator instance.

[memprof] Fix frame deserialization on big endian systems.
ClosedPublic

Authored by snehasish on Feb 17 2022, 3:18 PM.

Details

Summary

We write the memprof internal call frame data in little endian format.
However when reading the frame information we were casting it directly
to a MemProfRecord::Frame pointer. In this change we add a separate
deserialization method which uses an endian reader to read the bytes as
little endian.

This fixes https://lab.llvm.org/buildbot/#/builders/100/builds/12940

Diff Detail

Event Timeline

snehasish created this revision.Feb 17 2022, 3:18 PM
snehasish requested review of this revision.Feb 17 2022, 3:18 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 17 2022, 3:18 PM
davidxl added inline comments.Feb 17 2022, 3:21 PM
llvm/include/llvm/ProfileData/MemProf.h
183

add comment on each field arg?

snehasish updated this revision to Diff 409804.Feb 17 2022, 3:25 PM

Add comments for each field.

snehasish marked an inline comment as done.Feb 17 2022, 3:25 PM

PTAL, thanks for the quick review.

snehasish updated this revision to Diff 409805.Feb 17 2022, 3:27 PM

Minor formatting fix.

davidxl accepted this revision.Feb 17 2022, 3:28 PM

lgtm

This revision is now accepted and ready to land.Feb 17 2022, 3:28 PM
This revision was landed with ongoing or failed builds.Feb 17 2022, 3:31 PM
This revision was automatically updated to reflect the committed changes.
dyung added a subscriber: dyung.Feb 17 2022, 3:50 PM

Hi Snehasish, your change is likely causing 3 test failures on the PS4 linux buildbot, can you take a look?

https://lab.llvm.org/buildbot/#/builders/139/builds/17235

Hi Snehasish, your change is likely causing 3 test failures on the PS4 linux buildbot, can you take a look?

https://lab.llvm.org/buildbot/#/builders/139/builds/17235

Yup, reverted the change while I look into it.