summaryrefslogtreecommitdiff
path: root/include/llvm/XRay
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/XRay')
-rw-r--r--include/llvm/XRay/InstrumentationMap.h6
-rw-r--r--include/llvm/XRay/XRayRecord.h6
-rw-r--r--include/llvm/XRay/YAMLXRayRecord.h4
3 files changed, 14 insertions, 2 deletions
diff --git a/include/llvm/XRay/InstrumentationMap.h b/include/llvm/XRay/InstrumentationMap.h
index 0342da0a2f0f..42bfca36a20b 100644
--- a/include/llvm/XRay/InstrumentationMap.h
+++ b/include/llvm/XRay/InstrumentationMap.h
@@ -38,7 +38,7 @@ Expected<InstrumentationMap> loadInstrumentationMap(StringRef Filename);
struct SledEntry {
/// Each entry here represents the kinds of supported instrumentation map
/// entries.
- enum class FunctionKinds { ENTRY, EXIT, TAIL };
+ enum class FunctionKinds { ENTRY, EXIT, TAIL, LOG_ARGS_ENTER, CUSTOM_EVENT };
/// The address of the sled.
uint64_t Address;
@@ -106,6 +106,10 @@ template <> struct ScalarEnumerationTraits<xray::SledEntry::FunctionKinds> {
IO.enumCase(Kind, "function-enter", xray::SledEntry::FunctionKinds::ENTRY);
IO.enumCase(Kind, "function-exit", xray::SledEntry::FunctionKinds::EXIT);
IO.enumCase(Kind, "tail-exit", xray::SledEntry::FunctionKinds::TAIL);
+ IO.enumCase(Kind, "log-args-enter",
+ xray::SledEntry::FunctionKinds::LOG_ARGS_ENTER);
+ IO.enumCase(Kind, "custom-event",
+ xray::SledEntry::FunctionKinds::CUSTOM_EVENT);
}
};
diff --git a/include/llvm/XRay/XRayRecord.h b/include/llvm/XRay/XRayRecord.h
index 68c91a40fed1..5c5e9f436f4a 100644
--- a/include/llvm/XRay/XRayRecord.h
+++ b/include/llvm/XRay/XRayRecord.h
@@ -16,6 +16,7 @@
#define LLVM_XRAY_XRAY_RECORD_H
#include <cstdint>
+#include <vector>
namespace llvm {
namespace xray {
@@ -53,7 +54,7 @@ struct XRayFileHeader {
/// This may or may not correspond to actual record types in the raw trace (as
/// the loader implementation may synthesize this information in the process of
/// of loading).
-enum class RecordTypes { ENTER, EXIT };
+enum class RecordTypes { ENTER, EXIT, TAIL_EXIT, ENTER_ARG };
struct XRayRecord {
/// The type of record.
@@ -73,6 +74,9 @@ struct XRayRecord {
/// The thread ID for the currently running thread.
uint32_t TId;
+
+ /// The function call arguments.
+ std::vector<uint64_t> CallArgs;
};
} // namespace xray
diff --git a/include/llvm/XRay/YAMLXRayRecord.h b/include/llvm/XRay/YAMLXRayRecord.h
index 7e1a4112818e..b436aefb1e8f 100644
--- a/include/llvm/XRay/YAMLXRayRecord.h
+++ b/include/llvm/XRay/YAMLXRayRecord.h
@@ -37,6 +37,7 @@ struct YAMLXRayRecord {
std::string Function;
uint64_t TSC;
uint32_t TId;
+ std::vector<uint64_t> CallArgs;
};
struct YAMLXRayTrace {
@@ -54,6 +55,8 @@ template <> struct 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);
+ IO.enumCase(Type, "function-tail-exit", xray::RecordTypes::TAIL_EXIT);
+ IO.enumCase(Type, "function-enter-arg", xray::RecordTypes::ENTER_ARG);
}
};
@@ -73,6 +76,7 @@ template <> struct MappingTraits<xray::YAMLXRayRecord> {
IO.mapRequired("type", Record.RecordType);
IO.mapRequired("func-id", Record.FuncId);
IO.mapOptional("function", Record.Function);
+ IO.mapOptional("args", Record.CallArgs);
IO.mapRequired("cpu", Record.CPU);
IO.mapRequired("thread", Record.TId);
IO.mapRequired("kind", Record.Type);