Created:2024-06-01 Last Modified:2024-06-24

This document was translated by ChatGPT

#1. AutoProfiling

By using eBPF to capture snapshots of application function call stacks, DeepFlow can render CPU Profiling for any process, helping developers quickly identify function performance bottlenecks. In addition to business functions, the function call stack also shows the time consumption of dynamic link libraries, language runtimes, and kernel functions. Moreover, DeepFlow generates a unique identifier when collecting function call stacks, which can be used to correlate with call logs, enabling the integration of distributed tracing and function performance profiling.

CPU Profiling and Network Profiling in DeepFlow

CPU Profiling and Network Profiling in DeepFlow

#2. Capabilities and Limitations

Supported Profiling data types:

  • On-CPU
  • Off-CPU Enterprise Edition Only

Supported process languages:

  • Languages compiled into ELF format executables: Golang, Rust, C/C++
  • Languages using the JVM: Java

Two prerequisites must be met to obtain Profiling data:

  • The process needs to enable Frame Pointer
    • Compiling C/C++: gcc -fno-omit-frame-pointer
    • Compiling Rust: RUSTFLAGS="-C force-frame-pointers=yes"
    • Compiling Golang: Enabled by default, no additional compilation parameters needed
    • Running Java: -XX:+PreserveFramePointer
  • For compiled languages, it is important to retain the symbol table during compilation

The Off-CPU Profiling feature only collects the following call stacks:

  • Call stacks where the process state equals TASK_INTERRUPTIBLE (interruptible sleep) or TASK_UNINTERRUPTIBLE (uninterruptible sleep) when yielding the CPU
  • Call stacks excluding the 0th process (Idle process)
  • Call stacks containing at least one user-mode function
  • Call stacks where the wait time for the CPU does not exceed 1 hour