-
Notifications
You must be signed in to change notification settings - Fork 474
uftrace for deno
Honggyu Kim edited this page May 5, 2023
·
9 revisions
The deno is a secure JavaScript and TypeScript runtime written in Rust.
$ git clone --recurse-submodules https://github.com/denoland/deno.git
$ cd deno
Make sure export PATH="$HOME/.cargo/bin:$PATH"
is added to your environment variables.
$ curl https://sh.rustup.rs/ -sSf | sh
$ source $HOME/.cargo/env
Nightly compiler is required for using -Z flag options.
$ rustup install nightly
$ rustup default nightly
# The rust-toolchain.toml file overrides nightly toolchain so should be discarded.
$ mv rust-toolchain.toml rust-toolchain.toml.orig
$ export RUSTFLAGS="-Z instrument-mcount -C passes=ee-instrument<post-inline>"
$ cargo build
$ nm ./target/debug/deno | grep mcount
U mcount@@GLIBC_2.2.5
$ uftrace record ./target/debug/deno run cli/tests/testdata/run/002_hello.ts
$ uftrace replay -t 80ms -F ^deno -F ^tokio
# DURATION TID FUNCTION
[357474] | deno::main() {
[357474] | deno_runtime::tokio_util::run_local() {
[357474] | tokio::task::local::LocalSet::block_on() {
[357474] | tokio::runtime::runtime::Runtime::block_on() {
[357474] | tokio::runtime::scheduler::current_thread::CurrentThread::block_on() {
[357474] | tokio::runtime::scheduler::current_thread::CoreGuard::block_on() {
[357474] | tokio::runtime::scheduler::current_thread::CoreGuard::enter() {
[357474] | tokio::macros::scoped_tls::ScopedKey<T>::set() {
[357474] | tokio::runtime::scheduler::current_thread::CoreGuard::enter::_{{closure}}() {
[357474] | tokio::runtime::scheduler::current_thread::CoreGuard::block_on::_{{closure}}() {
[357474] | tokio::runtime::scheduler::current_thread::Context::enter() {
[357474] | tokio::runtime::scheduler::current_thread::CoreGuard::block_on::_{{closure}}::_{{closure}}() {
[357474] | tokio::runtime::scheduler::current_thread::CoreGuard::block_on::_{{closure}}::_{{closure}}::_{{closure}}() {
[357474] | _<core::pin::Pin<P>>::poll() {
[357474] | tokio::task::local::LocalSet::run_until::_{{closure}}() {
[357474] | _<tokio::task::local::RunUntil<T>>::poll() {
[357474] | tokio::task::local::LocalSet::with() {
[357474] | std::thread::local::LocalKey<T>::with() {
[357474] | std::thread::local::LocalKey<T>::try_with() {
[357474] | tokio::task::local::LocalSet::with::_{{closure}}() {
[357474] | _<tokio::task::local::RunUntil<T>>::poll::_{{closure}}() {
94.719 ms [357474] | deno::main::_{{closure}}();
94.752 ms [357474] | } /* _<tokio::task::local::RunUntil<T>>::poll::_{{closure}} */
94.757 ms [357474] | } /* tokio::task::local::LocalSet::with::_{{closure}} */
94.760 ms [357474] | } /* std::thread::local::LocalKey<T>::try_with */
94.760 ms [357474] | } /* std::thread::local::LocalKey<T>::with */
94.760 ms [357474] | } /* tokio::task::local::LocalSet::with */
94.761 ms [357474] | } /* _<tokio::task::local::RunUntil<T>>::poll */
94.767 ms [357474] | } /* tokio::task::local::LocalSet::run_until::_{{closure}} */
94.803 ms [357474] | } /* _<core::pin::Pin<P>>::poll */
94.806 ms [357474] | } /* tokio::runtime::scheduler::current_thread::CoreGuard::block_on::_{{closure}}::_{{closure}}::_{{closure}} */
94.818 ms [357474] | } /* tokio::runtime::scheduler::current_thread::CoreGuard::block_on::_{{closure}}::_{{closure}} */
94.821 ms [357474] | } /* tokio::runtime::scheduler::current_thread::Context::enter */
94.828 ms [357474] | } /* tokio::runtime::scheduler::current_thread::CoreGuard::block_on::_{{closure}} */
94.831 ms [357474] | } /* tokio::runtime::scheduler::current_thread::CoreGuard::enter::_{{closure}} */
94.844 ms [357474] | } /* tokio::macros::scoped_tls::ScopedKey<T>::set */
94.852 ms [357474] | } /* tokio::runtime::scheduler::current_thread::CoreGuard::enter */
94.852 ms [357474] | } /* tokio::runtime::scheduler::current_thread::CoreGuard::block_on */
94.871 ms [357474] | } /* tokio::runtime::scheduler::current_thread::CurrentThread::block_on */
94.918 ms [357474] | } /* tokio::runtime::runtime::Runtime::block_on */
94.968 ms [357474] | } /* tokio::task::local::LocalSet::block_on */
96.317 ms [357474] | } /* deno_runtime::tokio_util::run_local */
[357474] | /* linux:task-exit */
# record
$ uftrace record -t 10us ./target/debug/deno run cli/tests/testdata/run/002_hello.ts
Hello World
# dump in json format
$ uftrace dump --chrome > deno.json
# convert json to html
$ trace2html deno.json
deno.html
- chrome: https://uftrace.github.io/dump/deno.html
- flame-graph: https://uftrace.github.io/dump/deno.svg
- 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