Skip to content

Commit dbf47d2

Browse files
committed
Revert "[ProfileData] Read and symbolize raw memprof profiles."
This reverts commit 26f978d. This patch added a transitive dependency on libcurl via symbolize. See discussion https://reviews.llvm.org/D116784#inline-1137928 https://reviews.llvm.org/D113717#3295350
1 parent e8485b7 commit dbf47d2

File tree

14 files changed

+28
-706
lines changed

14 files changed

+28
-706
lines changed

llvm/include/llvm/DebugInfo/DIContext.h

-4
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,6 @@ struct DILineInfoSpecifier {
151151
DILineInfoSpecifier(FileLineInfoKind FLIKind = FileLineInfoKind::RawValue,
152152
FunctionNameKind FNKind = FunctionNameKind::None)
153153
: FLIKind(FLIKind), FNKind(FNKind) {}
154-
155-
inline bool operator==(const DILineInfoSpecifier &RHS) const {
156-
return FLIKind == RHS.FLIKind && FNKind == RHS.FNKind;
157-
}
158154
};
159155

160156
/// This is just a helper to programmatically construct DIDumpType.

llvm/include/llvm/ProfileData/MemProf.h

-95
This file was deleted.

llvm/include/llvm/ProfileData/RawMemProfReader.h

+2-64
Original file line numberDiff line numberDiff line change
@@ -12,95 +12,33 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15-
#include "llvm/ADT/DenseMap.h"
16-
#include "llvm/ADT/MapVector.h"
17-
#include "llvm/ADT/StringRef.h"
18-
#include "llvm/DebugInfo/Symbolize/SymbolizableModule.h"
19-
#include "llvm/DebugInfo/Symbolize/Symbolize.h"
20-
#include "llvm/Object/Binary.h"
21-
#include "llvm/Object/ObjectFile.h"
22-
#include "llvm/ProfileData/InstrProfReader.h"
23-
#include "llvm/ProfileData/MemProf.h"
24-
#include "llvm/ProfileData/MemProfData.inc"
2515
#include "llvm/Support/Error.h"
2616
#include "llvm/Support/MemoryBuffer.h"
2717

28-
#include <cstddef>
29-
3018
namespace llvm {
3119
namespace memprof {
3220

33-
// Map from id (recorded from sanitizer stack depot) to virtual addresses for
34-
// each program counter address in the callstack.
35-
using CallStackMap = llvm::DenseMap<uint64_t, llvm::SmallVector<uint64_t, 32>>;
36-
3721
class RawMemProfReader {
3822
public:
3923
RawMemProfReader(std::unique_ptr<MemoryBuffer> DataBuffer)
4024
: DataBuffer(std::move(DataBuffer)) {}
41-
RawMemProfReader(const RawMemProfReader &) = delete;
42-
RawMemProfReader &operator=(const RawMemProfReader &) = delete;
43-
4425
// Prints the contents of the profile in YAML format.
4526
void printYAML(raw_ostream &OS);
4627

4728
// Return true if the \p DataBuffer starts with magic bytes indicating it is
4829
// a raw binary memprof profile.
4930
static bool hasFormat(const MemoryBuffer &DataBuffer);
50-
// Return true if the file at \p Path starts with magic bytes indicating it is
51-
// a raw binary memprof profile.
52-
static bool hasFormat(const StringRef Path);
5331

5432
// Create a RawMemProfReader after sanity checking the contents of the file at
55-
// \p Path. The binary from which the profile has been collected is specified
56-
// via a path in \p ProfiledBinary.
57-
static Expected<std::unique_ptr<RawMemProfReader>>
58-
create(const Twine &Path, const StringRef ProfiledBinary);
59-
60-
Error readNextRecord(MemProfRecord &Record);
61-
62-
using Iterator = InstrProfIterator<MemProfRecord, RawMemProfReader>;
63-
Iterator end() { return Iterator(); }
64-
Iterator begin() {
65-
Iter = ProfileData.begin();
66-
return Iterator(this);
67-
}
68-
69-
// Constructor for unittests only.
70-
RawMemProfReader(std::unique_ptr<llvm::symbolize::SymbolizableModule> Sym,
71-
llvm::SmallVectorImpl<SegmentEntry> &Seg,
72-
llvm::MapVector<uint64_t, MemInfoBlock> &Prof,
73-
CallStackMap &SM)
74-
: Symbolizer(std::move(Sym)), SegmentInfo(Seg.begin(), Seg.end()),
75-
ProfileData(Prof), StackMap(SM) {}
33+
// \p Path.
34+
static Expected<std::unique_ptr<RawMemProfReader>> create(const Twine &Path);
7635

7736
private:
78-
RawMemProfReader(std::unique_ptr<MemoryBuffer> DataBuffer,
79-
object::OwningBinary<object::Binary> &&Bin)
80-
: DataBuffer(std::move(DataBuffer)), Binary(std::move(Bin)) {}
81-
Error initialize();
82-
Error readRawProfile();
83-
84-
object::SectionedAddress getModuleOffset(uint64_t VirtualAddress);
85-
Error fillRecord(const uint64_t Id, const MemInfoBlock &MIB,
86-
MemProfRecord &Record);
8737
// Prints aggregate counts for each raw profile parsed from the DataBuffer in
8838
// YAML format.
8939
void printSummaries(raw_ostream &OS) const;
9040

9141
std::unique_ptr<MemoryBuffer> DataBuffer;
92-
object::OwningBinary<object::Binary> Binary;
93-
std::unique_ptr<llvm::symbolize::SymbolizableModule> Symbolizer;
94-
95-
// The contents of the raw profile.
96-
llvm::SmallVector<SegmentEntry, 16> SegmentInfo;
97-
// A map from callstack id (same as key in CallStackMap below) to the heap
98-
// information recorded for that allocation context.
99-
llvm::MapVector<uint64_t, MemInfoBlock> ProfileData;
100-
CallStackMap StackMap;
101-
102-
// Iterator to read from the ProfileData MapVector.
103-
llvm::MapVector<uint64_t, MemInfoBlock>::iterator Iter = ProfileData.end();
10442
};
10543

10644
} // namespace memprof

llvm/lib/ProfileData/CMakeLists.txt

-2
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,9 @@ add_llvm_component_library(LLVMProfileData
1818

1919
LINK_COMPONENTS
2020
Core
21-
Object
2221
Support
2322
Demangle
2423
Object
25-
Symbolize
2624
DebugInfoDWARF
2725
)
2826

0 commit comments

Comments
 (0)