Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions llvm/include/llvm/XRay/BlockIndexer.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
#include <cstdint>
#include <vector>

namespace llvm {
namespace xray {
namespace llvm::xray {

// The BlockIndexer will gather all related records associated with a
// process+thread and group them by 'Block'.
Expand Down Expand Up @@ -63,7 +62,6 @@ class LLVM_ABI BlockIndexer : public RecordVisitor {
Error flush();
};

} // namespace xray
} // namespace llvm
} // namespace llvm::xray

#endif // LLVM_XRAY_BLOCKINDEXER_H
6 changes: 2 additions & 4 deletions llvm/include/llvm/XRay/BlockPrinter.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
#include "llvm/XRay/FDRRecords.h"
#include "llvm/XRay/RecordPrinter.h"

namespace llvm {
namespace xray {
namespace llvm::xray {

class LLVM_ABI BlockPrinter : public RecordVisitor {
enum class State {
Expand Down Expand Up @@ -55,7 +54,6 @@ class LLVM_ABI BlockPrinter : public RecordVisitor {
void reset() { CurrentState = State::Start; }
};

} // namespace xray
} // namespace llvm
} // namespace llvm::xray

#endif // LLVM_XRAY_BLOCKPRINTER_H
6 changes: 2 additions & 4 deletions llvm/include/llvm/XRay/BlockVerifier.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
#include "llvm/Support/Compiler.h"
#include "llvm/XRay/FDRRecords.h"

namespace llvm {
namespace xray {
namespace llvm::xray {

class LLVM_ABI BlockVerifier : public RecordVisitor {
public:
Expand Down Expand Up @@ -64,7 +63,6 @@ class LLVM_ABI BlockVerifier : public RecordVisitor {
void reset();
};

} // namespace xray
} // namespace llvm
} // namespace llvm::xray

#endif // LLVM_XRAY_BLOCKVERIFIER_H
6 changes: 2 additions & 4 deletions llvm/include/llvm/XRay/FDRLogBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@

#include "llvm/XRay/FDRRecords.h"

namespace llvm {
namespace xray {
namespace llvm::xray {

/// The LogBuilder class allows for creating ad-hoc collections of records
/// through the `add<...>(...)` function. An example use of this API is in
Expand All @@ -34,7 +33,6 @@ class LogBuilder {
std::vector<std::unique_ptr<Record>> consume() { return std::move(Records); }
};

} // namespace xray
} // namespace llvm
} // namespace llvm::xray

#endif // LLVM_XRAY_FDRLOGBUILDER_H
6 changes: 2 additions & 4 deletions llvm/include/llvm/XRay/FDRRecordConsumer.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
#include <memory>
#include <vector>

namespace llvm {
namespace xray {
namespace llvm::xray {

class RecordConsumer {
public:
Expand Down Expand Up @@ -48,7 +47,6 @@ class LLVM_ABI PipelineConsumer : public RecordConsumer {
Error consume(std::unique_ptr<Record> R) override;
};

} // namespace xray
} // namespace llvm
} // namespace llvm::xray

#endif // LLVM_XRAY_FDRRECORDCONSUMER_H
6 changes: 2 additions & 4 deletions llvm/include/llvm/XRay/FDRRecordProducer.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
#include "llvm/XRay/XRayRecord.h"
#include <memory>

namespace llvm {
namespace xray {
namespace llvm::xray {

class RecordProducer {
public:
Expand Down Expand Up @@ -45,7 +44,6 @@ class LLVM_ABI FileBasedRecordProducer : public RecordProducer {
Expected<std::unique_ptr<Record>> produce() override;
};

} // namespace xray
} // namespace llvm
} // namespace llvm::xray

#endif // LLVM_XRAY_FDRRECORDPRODUCER_H
6 changes: 2 additions & 4 deletions llvm/include/llvm/XRay/FDRRecords.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
#include "llvm/Support/Error.h"
#include "llvm/XRay/XRayRecord.h"

namespace llvm {
namespace xray {
namespace llvm::xray {

class RecordVisitor;
class RecordInitializer;
Expand Down Expand Up @@ -444,7 +443,6 @@ class LLVM_ABI RecordInitializer : public RecordVisitor {
Error visit(TypedEventRecord &) override;
};

} // namespace xray
} // namespace llvm
} // namespace llvm::xray

#endif // LLVM_XRAY_FDRRECORDS_H
6 changes: 2 additions & 4 deletions llvm/include/llvm/XRay/FDRTraceExpander.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
#include "llvm/XRay/FDRRecords.h"
#include "llvm/XRay/XRayRecord.h"

namespace llvm {
namespace xray {
namespace llvm::xray {

class TraceExpander : public RecordVisitor {
// Type-erased callback for handling individual XRayRecord instances.
Expand Down Expand Up @@ -56,7 +55,6 @@ class TraceExpander : public RecordVisitor {
Error flush();
};

} // namespace xray
} // namespace llvm
} // namespace llvm::xray

#endif // LLVM_XRAY_FDRTRACEEXPANDER_H
6 changes: 2 additions & 4 deletions llvm/include/llvm/XRay/FDRTraceWriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
#include "llvm/XRay/FDRRecords.h"
#include "llvm/XRay/XRayRecord.h"

namespace llvm {
namespace xray {
namespace llvm::xray {

/// The FDRTraceWriter allows us to hand-craft an XRay Flight Data Recorder
/// (FDR) mode log file. This is used primarily for testing, generating
Expand Down Expand Up @@ -50,7 +49,6 @@ class LLVM_ABI FDRTraceWriter : public RecordVisitor {
support::endian::Writer OS;
};

} // namespace xray
} // namespace llvm
} // namespace llvm::xray

#endif // LLVM_XRAY_FDRTRACEWRITER_H
6 changes: 2 additions & 4 deletions llvm/include/llvm/XRay/FileHeaderReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,13 @@
#include "llvm/XRay/XRayRecord.h"
#include <cstdint>

namespace llvm {
namespace xray {
namespace llvm::xray {

/// Convenience function for loading the file header given a data extractor at a
/// specified offset.
LLVM_ABI Expected<XRayFileHeader>
readBinaryFormatHeader(DataExtractor &HeaderExtractor, uint64_t &OffsetPtr);

} // namespace xray
} // namespace llvm
} // namespace llvm::xray

#endif // LLVM_XRAY_FILEHEADERREADER_H
7 changes: 3 additions & 4 deletions llvm/include/llvm/XRay/Graph.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
#include "llvm/ADT/iterator.h"
#include "llvm/Support/Error.h"

namespace llvm {
namespace xray {
namespace llvm::xray {

/// A Graph object represents a Directed Graph and is used in XRay to compute
/// and store function call graphs and associated statistical information.
Expand Down Expand Up @@ -485,6 +484,6 @@ class Graph {
return p;
}
};
}
}
} // namespace llvm::xray

#endif
19 changes: 7 additions & 12 deletions llvm/include/llvm/XRay/InstrumentationMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@
#include <unordered_map>
#include <vector>

namespace llvm {

namespace xray {
namespace llvm::xray {

// Forward declare to make a friend.
class InstrumentationMap;
Expand Down Expand Up @@ -102,11 +100,11 @@ class InstrumentationMap {
const SledContainer &sleds() const { return Sleds; };
};

} // end namespace xray

namespace yaml {
} // end namespace llvm::xray

template <> struct ScalarEnumerationTraits<xray::SledEntry::FunctionKinds> {
namespace llvm {
template <>
struct yaml::ScalarEnumerationTraits<xray::SledEntry::FunctionKinds> {
static void enumeration(IO &IO, xray::SledEntry::FunctionKinds &Kind) {
IO.enumCase(Kind, "function-enter", xray::SledEntry::FunctionKinds::ENTRY);
IO.enumCase(Kind, "function-exit", xray::SledEntry::FunctionKinds::EXIT);
Expand All @@ -118,7 +116,7 @@ template <> struct ScalarEnumerationTraits<xray::SledEntry::FunctionKinds> {
}
};

template <> struct MappingTraits<xray::YAMLXRaySledEntry> {
template <> struct yaml::MappingTraits<xray::YAMLXRaySledEntry> {
static void mapping(IO &IO, xray::YAMLXRaySledEntry &Entry) {
IO.mapRequired("id", Entry.FuncId);
IO.mapRequired("address", Entry.Address);
Expand All @@ -131,10 +129,7 @@ template <> struct MappingTraits<xray::YAMLXRaySledEntry> {

static constexpr bool flow = true;
};

} // end namespace yaml

} // end namespace llvm
} // namespace llvm

LLVM_YAML_IS_SEQUENCE_VECTOR(xray::YAMLXRaySledEntry)

Expand Down
6 changes: 2 additions & 4 deletions llvm/include/llvm/XRay/Profile.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
#include <utility>
#include <vector>

namespace llvm {
namespace xray {
namespace llvm::xray {

class Profile;

Expand Down Expand Up @@ -144,7 +143,6 @@ class Profile {
bool empty() const { return Blocks.empty(); }
};

} // namespace xray
} // namespace llvm
} // namespace llvm::xray

#endif
6 changes: 2 additions & 4 deletions llvm/include/llvm/XRay/RecordPrinter.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
#include "llvm/Support/raw_ostream.h"
#include "llvm/XRay/FDRRecords.h"

namespace llvm {
namespace xray {
namespace llvm::xray {

class LLVM_ABI RecordPrinter : public RecordVisitor {
raw_ostream &OS;
Expand All @@ -44,7 +43,6 @@ class LLVM_ABI RecordPrinter : public RecordVisitor {
Error visit(TypedEventRecord &) override;
};

} // namespace xray
} // namespace llvm
} // namespace llvm::xray

#endif // LLVM_XRAY_RECORDPRINTER_H
6 changes: 2 additions & 4 deletions llvm/include/llvm/XRay/Trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
#include "llvm/Support/Error.h"
#include "llvm/XRay/XRayRecord.h"

namespace llvm {
namespace xray {
namespace llvm::xray {

/// A Trace object represents the records that have been loaded from XRay
/// log files generated by instrumented binaries. We encapsulate the logic of
Expand Down Expand Up @@ -76,7 +75,6 @@ LLVM_ABI Expected<Trace> loadTraceFile(StringRef Filename, bool Sort = false);
LLVM_ABI Expected<Trace> loadTrace(const DataExtractor &Extractor,
bool Sort = false);

} // namespace xray
} // namespace llvm
} // namespace llvm::xray

#endif // LLVM_XRAY_TRACE_H
6 changes: 2 additions & 4 deletions llvm/include/llvm/XRay/XRayRecord.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
#include <vector>
#include <string>

namespace llvm {
namespace xray {
namespace llvm::xray {

/// XRay traces all have a header providing some top-matter information useful
/// to help tools determine how to interpret the information available in the
Expand Down Expand Up @@ -98,7 +97,6 @@ struct XRayRecord {
std::string Data;
};

} // namespace xray
} // namespace llvm
} // namespace llvm::xray

#endif // LLVM_XRAY_XRAYRECORD_H
18 changes: 7 additions & 11 deletions llvm/include/llvm/XRay/YAMLXRayRecord.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
#include "llvm/Support/YAMLTraits.h"
#include "llvm/XRay/XRayRecord.h"

namespace llvm {
namespace xray {
namespace llvm::xray {

struct YAMLXRayFileHeader {
uint16_t Version;
Expand Down Expand Up @@ -46,13 +45,12 @@ struct YAMLXRayTrace {
std::vector<YAMLXRayRecord> Records;
};

} // namespace xray

namespace yaml {
} // namespace llvm::xray

namespace llvm {
// YAML Traits
// -----------
template <> struct ScalarEnumerationTraits<xray::RecordTypes> {
template <> struct yaml::ScalarEnumerationTraits<xray::RecordTypes> {
static void enumeration(IO &IO, xray::RecordTypes &Type) {
IO.enumCase(Type, "function-enter", xray::RecordTypes::ENTER);
IO.enumCase(Type, "function-exit", xray::RecordTypes::EXIT);
Expand All @@ -63,7 +61,7 @@ template <> struct ScalarEnumerationTraits<xray::RecordTypes> {
}
};

template <> struct MappingTraits<xray::YAMLXRayFileHeader> {
template <> struct yaml::MappingTraits<xray::YAMLXRayFileHeader> {
static void mapping(IO &IO, xray::YAMLXRayFileHeader &Header) {
IO.mapRequired("version", Header.Version);
IO.mapRequired("type", Header.Type);
Expand All @@ -73,7 +71,7 @@ template <> struct MappingTraits<xray::YAMLXRayFileHeader> {
}
};

template <> struct MappingTraits<xray::YAMLXRayRecord> {
template <> struct yaml::MappingTraits<xray::YAMLXRayRecord> {
static void mapping(IO &IO, xray::YAMLXRayRecord &Record) {
IO.mapRequired("type", Record.RecordType);
IO.mapOptional("func-id", Record.FuncId);
Expand All @@ -90,16 +88,14 @@ template <> struct MappingTraits<xray::YAMLXRayRecord> {
static constexpr bool flow = true;
};

template <> struct MappingTraits<xray::YAMLXRayTrace> {
template <> struct yaml::MappingTraits<llvm::xray::YAMLXRayTrace> {
static void mapping(IO &IO, xray::YAMLXRayTrace &Trace) {
// A trace file contains two parts, the header and the list of all the
// trace records.
IO.mapRequired("header", Trace.Header);
IO.mapRequired("records", Trace.Records);
}
};

} // namespace yaml
} // namespace llvm

LLVM_YAML_IS_SEQUENCE_VECTOR(xray::YAMLXRayRecord)
Expand Down
Loading