Skip to content

Commit 4196d1b

Browse files
committed
[clang-doc] fix ftime trace labels
1 parent 29d6540 commit 4196d1b

File tree

3 files changed

+17
-15
lines changed

3 files changed

+17
-15
lines changed

clang-tools-extra/clang-doc/BitcodeReader.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,7 @@ llvm::Error ClangDocBitcodeReader::readRecord(unsigned ID, T I) {
671671

672672
template <>
673673
llvm::Error ClangDocBitcodeReader::readRecord(unsigned ID, Reference *I) {
674-
llvm::TimeTraceScope("readRecord");
674+
llvm::TimeTraceScope("Reducing infos", "readRecord");
675675
Record R;
676676
llvm::StringRef Blob;
677677
llvm::Expected<unsigned> MaybeRecID = Stream.readRecord(ID, R, &Blob);
@@ -683,7 +683,7 @@ llvm::Error ClangDocBitcodeReader::readRecord(unsigned ID, Reference *I) {
683683
// Read a block of records into a single info.
684684
template <typename T>
685685
llvm::Error ClangDocBitcodeReader::readBlock(unsigned ID, T I) {
686-
llvm::TimeTraceScope("readBlock");
686+
llvm::TimeTraceScope("Reducing infos", "readBlock");
687687
if (llvm::Error Err = Stream.EnterSubBlock(ID))
688688
return Err;
689689

@@ -714,7 +714,7 @@ llvm::Error ClangDocBitcodeReader::readBlock(unsigned ID, T I) {
714714

715715
template <typename T>
716716
llvm::Error ClangDocBitcodeReader::readSubBlock(unsigned ID, T I) {
717-
llvm::TimeTraceScope("readSubBlock");
717+
llvm::TimeTraceScope("Reducing infos", "readSubBlock");
718718
switch (ID) {
719719
// Blocks can only have certain types of sub blocks.
720720
case BI_COMMENT_BLOCK_ID: {
@@ -821,7 +821,7 @@ llvm::Error ClangDocBitcodeReader::readSubBlock(unsigned ID, T I) {
821821

822822
ClangDocBitcodeReader::Cursor
823823
ClangDocBitcodeReader::skipUntilRecordOrBlock(unsigned &BlockOrRecordID) {
824-
llvm::TimeTraceScope("skipUntilRecordOrBlock");
824+
llvm::TimeTraceScope("Reducing infos","skipUntilRecordOrBlock");
825825
BlockOrRecordID = 0;
826826

827827
while (!Stream.AtEndOfStream()) {
@@ -883,7 +883,7 @@ llvm::Error ClangDocBitcodeReader::validateStream() {
883883
}
884884

885885
llvm::Error ClangDocBitcodeReader::readBlockInfoBlock() {
886-
llvm::TimeTraceScope("readBlockInfoBlock");
886+
llvm::TimeTraceScope("Reducing infos", "readBlockInfoBlock");
887887
Expected<std::optional<llvm::BitstreamBlockInfo>> MaybeBlockInfo =
888888
Stream.ReadBlockInfoBlock();
889889
if (!MaybeBlockInfo)
@@ -900,7 +900,7 @@ llvm::Error ClangDocBitcodeReader::readBlockInfoBlock() {
900900
template <typename T>
901901
llvm::Expected<std::unique_ptr<Info>>
902902
ClangDocBitcodeReader::createInfo(unsigned ID) {
903-
llvm::TimeTraceScope("createInfo");
903+
llvm::TimeTraceScope("Reducing infos", "createInfo");
904904
std::unique_ptr<Info> I = std::make_unique<T>();
905905
if (auto Err = readBlock(ID, static_cast<T *>(I.get())))
906906
return std::move(Err);
@@ -909,7 +909,7 @@ ClangDocBitcodeReader::createInfo(unsigned ID) {
909909

910910
llvm::Expected<std::unique_ptr<Info>>
911911
ClangDocBitcodeReader::readBlockToInfo(unsigned ID) {
912-
llvm::TimeTraceScope("readBlockToInfo");
912+
llvm::TimeTraceScope("Reducing infos", "readBlockToInfo");
913913
switch (ID) {
914914
case BI_NAMESPACE_BLOCK_ID:
915915
return createInfo<NamespaceInfo>(ID);

clang-tools-extra/clang-doc/Mapper.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ template <typename T> bool MapASTVisitor::mapDecl(const T *D) {
3535
if (D->getParentFunctionOrMethod())
3636
return true;
3737

38-
llvm::timeTraceProfilerBegin("emitInfo", "emit info from ast node");
38+
llvm::timeTraceProfilerBegin("Mapping declaration",
39+
"emit info from astnode");
3940
llvm::SmallString<128> USR;
4041
// If there is an error generating a USR for the decl, skip this decl.
4142
if (index::generateUSRForDecl(D, USR))
@@ -48,7 +49,8 @@ template <typename T> bool MapASTVisitor::mapDecl(const T *D) {
4849
IsFileInRootDir, CDCtx.PublicOnly);
4950
llvm::timeTraceProfilerEnd();
5051

51-
llvm::timeTraceProfilerBegin("serialize", "serialize info");
52+
llvm::timeTraceProfilerBegin("Mapping declaration",
53+
"serialized info into bitcode");
5254
// A null in place of I indicates that the serializer is skipping this decl
5355
// for some reason (e.g. we're only reporting public decls).
5456
if (I.first)

clang-tools-extra/clang-doc/tool/ClangDocMain.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ Example usage for a project using a compile commands database:
274274
}
275275
}
276276

277-
llvm::timeTraceProfilerBegin("mapping decls", "clang-doc");
277+
llvm::timeTraceProfilerBegin("Mapping declaration", "total runtime");
278278
// Mapping phase
279279
llvm::outs() << "Mapping decls...\n";
280280
auto Err =
@@ -294,7 +294,7 @@ Example usage for a project using a compile commands database:
294294
// Collect values into output by key.
295295
// In ToolResults, the Key is the hashed USR and the value is the
296296
// bitcode-encoded representation of the Info object.
297-
llvm::timeTraceProfilerBegin("collecting infos", "clang-doc");
297+
llvm::timeTraceProfilerBegin("Collect Info", "total runtime");
298298
llvm::outs() << "Collecting infos...\n";
299299
llvm::StringMap<std::vector<StringRef>> USRToBitcode;
300300
Executor->get()->getToolResults()->forEachResult(
@@ -310,7 +310,7 @@ Example usage for a project using a compile commands database:
310310
llvm::StringMap<std::unique_ptr<doc::Info>> USRToInfo;
311311

312312
// First reducing phase (reduce all decls into one info per decl).
313-
llvm::timeTraceProfilerBegin("reducing infos", "clang-doc");
313+
llvm::timeTraceProfilerBegin("Reducing infos", "total runtime");
314314
llvm::outs() << "Reducing " << USRToBitcode.size() << " infos...\n";
315315
std::atomic<bool> Error;
316316
Error = false;
@@ -322,7 +322,7 @@ Example usage for a project using a compile commands database:
322322
if (FTimeTrace)
323323
llvm::timeTraceProfilerInitialize(200, "clang-doc");
324324

325-
llvm::timeTraceProfilerBegin("decoding bitcode", "decoding");
325+
llvm::timeTraceProfilerBegin("Reducing infos", "decoding bitcode");
326326
std::vector<std::unique_ptr<doc::Info>> Infos;
327327
for (auto &Bitcode : Group.getValue()) {
328328
llvm::BitstreamCursor Stream(Bitcode);
@@ -338,7 +338,7 @@ Example usage for a project using a compile commands database:
338338
}
339339
llvm::timeTraceProfilerEnd();
340340

341-
llvm::timeTraceProfilerBegin("merging infos", "clang-doc");
341+
llvm::timeTraceProfilerBegin("Reducing infos", "merging bitcode");
342342
auto Reduced = doc::mergeInfos(Infos);
343343
if (!Reduced) {
344344
llvm::errs() << llvm::toString(Reduced.takeError());
@@ -369,7 +369,7 @@ Example usage for a project using a compile commands database:
369369
if (Error)
370370
return 1;
371371

372-
llvm::timeTraceProfilerBegin("generating docs", "clang-doc");
372+
llvm::timeTraceProfilerBegin("Writing output", "total runtime");
373373
// Ensure the root output directory exists.
374374
if (std::error_code Err = llvm::sys::fs::create_directories(OutDirectory);
375375
Err != std::error_code()) {

0 commit comments

Comments
 (0)