• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

trace-cmd Command Examples in Linux

by Deepika

trace-cmd is a free and open-source utility for interacting with the Ftrace Linux kernel internal tracer. It allows users to trace and analyze system events, kernel function calls, and other performance metrics in real-time. Trace-cmd is a powerful tool for debugging and performance tuning Linux systems.

Ftrace is a kernel-level tracing framework built into the Linux kernel. It provides a way to collect detailed information about kernel events and function calls, as well as system calls and other performance metrics. Trace-cmd is a utility that provides a command-line interface for interacting with Ftrace.

Using trace-cmd, users can capture and analyze kernel events and function calls in real-time. The tool provides several options for filtering and manipulating trace data, allowing users to focus on specific areas of interest. Additionally, trace-cmd can generate trace reports in various formats, making it easy to share and analyze trace data across different platforms.

It is worth noting that trace-cmd must be run as root, as it requires access to privileged kernel functions and system resources. This is necessary to ensure that trace data is collected accurately and reliably.

trace-cmd Command Examples

1. Display the status of tracing system:

# trace-cmd stat

2. List available tracers:

# trace-cmd list -t

3. Start tracing with a specific plugin:

# trace-cmd start -p timerlat|osnoise|hwlat|blk|mmiotrace|function_graph|wakeup_dl|wakeup_rt|wakeup|function|nop

4. View the trace output:

# trace-cmd show

5. Stop the tracing but retain the buffers:

# trace-cmd stop

6. Clear the trace buffers:

# trace-cmd clear

7. Clear the trace buffers and stop tracing:

# trace-cmd reset

Summary

Overall, trace-cmd is a powerful tool for debugging and performance tuning Linux systems. Its ability to interact with the Ftrace Linux kernel internal tracer makes it an essential tool for developers and system administrators who need to analyze system events and performance metrics in real-time.

Filed Under: Linux

Some more articles you might also be interested in …

  1. rc-update: command not found
  2. groff Command Examples
  3. lilypond Command Examples
  4. lvscan Command Examples in Linux
  5. mkfs.vfat: command not found
  6. lvmdiskscan Command Examples in Linux
  7. qm start Command Examples in Linux
  8. ipaggcreate Command Examples
  9. nitrogen Command Examples in Linux
  10. diffstat: Create a histogram from the output of the diff command

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright