-
Notifications
You must be signed in to change notification settings - Fork 523
uftrace for Clang LLVM
Honggyu Kim edited this page Aug 19, 2019
·
7 revisions
1. Download LLVM 8.0.1 and uncompress
$ wget https://github.com/llvm/llvm-project/releases/download/llvmorg-8.0.1/llvm-8.0.1.src.tar.xz
$ wget https://github.com/llvm/llvm-project/releases/download/llvmorg-8.0.1/cfe-8.0.1.src.tar.xz
$ tar xfx llvm-8.0.1.src.tar.xz
$ tar xfx cfe-8.0.1.src.tar.xz
2. Move clang source under llvm/tools
$ mv cfe-8.0.1.src llvm-8.0.1.src/tools/clang
3. Configuration
$ mkdir build.release.pg.g && cd build.release.pg.g
$ cmake -G Ninja ../llvm-8.0.1.src -DLLVM_TARGETS_TO_BUILD="host;ARM;AArch64" \
-DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-pg -g"
4. Build clang
$ ninja clang
5. Test the generated clang image
$ cd ./bin
$ ./clang
clang-8: error: no input files
$ nm clang | grep mcount
U mcount@@GLIBC_2.2.5
6. Run clang execution with uftrace
$ uftrace -F main -D 2 --no-libcall -- ./clang
clang-8: error: no input files
# DURATION TID FUNCTION
[ 98244] | main() {
24.430 us [ 98244] | llvm::InitLLVM::InitLLVM();
0.154 us [ 98244] | llvm::SmallVectorImpl::append();
7.227 us [ 98244] | llvm::sys::Process::FixupStandardFileDescriptors();
0.801 us [ 98244] | LLVMInitializeARMTargetInfo();
0.648 us [ 98244] | LLVMInitializeAArch64TargetInfo();
0.402 us [ 98244] | LLVMInitializeX86TargetInfo();
101.316 us [ 98244] | LLVMInitializeARMTarget();
147.455 us [ 98244] | LLVMInitializeAArch64Target();
201.976 us [ 98244] | LLVMInitializeX86Target();
8.783 us [ 98244] | clang::driver::ToolChain::getTargetAndModeFromProgramName();
0.070 us [ 98244] | llvm::cl::ExpandResponseFiles();
54.055 us [ 98244] | GetExecutablePath::cxx11();
814.121 us [ 98244] | clang::driver::createDriverOptTable();
3.336 us [ 98244] | llvm::opt::OptTable::ParseArgs();
153.992 us [ 98244] | clang::ParseDiagnosticArgs();
0.160 us [ 98244] | llvm::opt::InputArgList::releaseMemory();
1.026 us [ 98244] | llvm::opt::OptTable::~OptTable();
2.214 us [ 98244] | llvm::errs();
0.097 us [ 98244] | clang::TextDiagnosticPrinter::TextDiagnosticPrinter();
0.778 us [ 98244] | llvm::sys::path::stem();
0.194 us [ 98244] | std::__cxx11::basic_string::_M_construct();
0.068 us [ 98244] | clang::DiagnosticIDs::DiagnosticIDs();
6.672 us [ 98244] | clang::DiagnosticsEngine::DiagnosticsEngine();
0.471 us [ 98244] | clang::ProcessWarningOptions();
4.888 us [ 98244] | llvm::sys::getDefaultTargetTriple::cxx11();
647.745 us [ 98244] | clang::driver::Driver::Driver();
0.145 us [ 98244] | llvm::SmallVectorImpl::append();
0.500 us [ 98244] | llvm::sys::path::filename();
11.686 us [ 98244] | llvm::sys::fs::make_absolute();
0.363 us [ 98244] | llvm::sys::path::parent_path();
2.406 us [ 98244] | llvm::sys::fs::access();
1.789 ms [ 98244] | clang::driver::Driver::BuildCompilation();
0.475 us [ 98244] | clang::driver::Driver::ExecuteCompilation();
0.110 us [ 98244] | clang::DiagnosticConsumer::finish();
0.113 us [ 98244] | llvm::errs();
2.266 us [ 98244] | llvm::TimerGroup::printAll();
1.831 us [ 98244] | clang::driver::Compilation::~Compilation();
15.856 us [ 98244] | clang::driver::Driver::~Driver();
1.466 us [ 98244] | clang::DiagnosticsEngine::~DiagnosticsEngine();
0.220 us [ 98244] | llvm::RefCountedBase::Release();
0.454 us [ 98244] | llvm::RefCountedBase::Release();
0.111 us [ 98244] | std::_Rb_tree::_M_erase();
146.974 us [ 98244] | llvm::InitLLVM::~InitLLVM();
4.217 ms [ 98244] | } /* main */
- Home
- Tutorial
- Development
- Practical Use Cases
- GCC
- Clang/LLVM
- Node.js
- Chromium
- MySQL/InnoDB
- FFmpeg
- CPython
- POCO
- Telegram
- yara
- RustPython
- cURL
- bpftrace
- SpiderMonkey
- Apache HTTP Server
- GStreamer
- Squid
- TCPDUMP
- OpenCV
- Libav
- Wireshark
- LXC
- Git
- Radare2
- uftrace on Android
- deno
- parallel sort algorithm
- LevelDB/RocksDB (YCSB)
- Redis
- libjpeg‐turbo (JPEG)
- JM (H.264/AVC)
- HM (HEVC)
- VTM (VVC)
- CUDA
- Erlang/OTP BEAM
- uftrace on Yocto
- TTCN3