Index: llvm/trunk/include/llvm/XRay/InstrumentationMap.h =================================================================== --- llvm/trunk/include/llvm/XRay/InstrumentationMap.h +++ llvm/trunk/include/llvm/XRay/InstrumentationMap.h @@ -38,7 +38,7 @@ 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 @@ 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); } }; Index: llvm/trunk/lib/XRay/InstrumentationMap.cpp =================================================================== --- llvm/trunk/lib/XRay/InstrumentationMap.cpp +++ llvm/trunk/lib/XRay/InstrumentationMap.cpp @@ -104,7 +104,8 @@ static constexpr SledEntry::FunctionKinds Kinds[] = { SledEntry::FunctionKinds::ENTRY, SledEntry::FunctionKinds::EXIT, SledEntry::FunctionKinds::TAIL, - }; + SledEntry::FunctionKinds::LOG_ARGS_ENTER, + SledEntry::FunctionKinds::CUSTOM_EVENT}; if (Kind >= sizeof(Kinds)) return errorCodeToError( std::make_error_code(std::errc::executable_format_error)); Index: llvm/trunk/test/tools/llvm-xray/X86/extract-all-sledtypes.txt =================================================================== --- llvm/trunk/test/tools/llvm-xray/X86/extract-all-sledtypes.txt +++ llvm/trunk/test/tools/llvm-xray/X86/extract-all-sledtypes.txt @@ -0,0 +1,11 @@ +# Test that we can extract all the sled types we know about. This is built with +# a a file with functions always instrumented, and using the built-ins and +# intrinsics supported by clang. Those are built with: +# +# clang++ -c all-sleds.cc -o all-sleds.o -fpic -std=c++11 -fxray-instrument +# +# RUN: llvm-xray extract %S/Inputs/all-sleds.o -s | FileCheck %s +# CHECK-DAG: {{kind:.function-enter}} +# CHECK-DAG: {{kind:.function-exit}} +# CHECK-DAG: {{kind:.custom-event}} +# CHECK-DAG: {{kind:.log-args-enter}}