Skip to main content
Redhat Developers  Logo
  • AI

    Get started with AI

    • Red Hat AI
      Accelerate the development and deployment of enterprise AI solutions.
    • AI learning hub
      Explore learning materials and tools, organized by task.
    • AI interactive demos
      Click through scenarios with Red Hat AI, including training LLMs and more.
    • AI/ML learning paths
      Expand your OpenShift AI knowledge using these learning resources.
    • AI quickstarts
      Focused AI use cases designed for fast deployment on Red Hat AI platforms.
    • No-cost AI training
      Foundational Red Hat AI training.

    Featured resources

    • OpenShift AI learning
    • Open source AI for developers
    • AI product application development
    • Open source-powered AI/ML for hybrid cloud
    • AI and Node.js cheat sheet

    Red Hat AI Factory with NVIDIA

    • Red Hat AI Factory with NVIDIA is a co-engineered, enterprise-grade AI solution for building, deploying, and managing AI at scale across hybrid cloud environments.
    • Explore the solution
  • Learn

    Self-guided

    • Documentation
      Find answers, get step-by-step guidance, and learn how to use Red Hat products.
    • Learning paths
      Explore curated walkthroughs for common development tasks.
    • Guided learning
      Receive custom learning paths powered by our AI assistant.
    • See all learning

    Hands-on

    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.
    • Interactive labs
      Learn by doing in these hands-on, browser-based experiences.
    • Interactive demos
      Click through product features in these guided tours.

    Browse by topic

    • AI/ML
    • Automation
    • Java
    • Kubernetes
    • Linux
    • See all topics

    Training & certifications

    • Courses and exams
    • Certifications
    • Skills assessments
    • Red Hat Academy
    • Learning subscription
    • Explore training
  • Build

    Get started

    • Red Hat build of Podman Desktop
      A downloadable, local development hub to experiment with our products and builds.
    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.

    Download products

    • Access product downloads to start building and testing right away.
    • Red Hat Enterprise Linux
    • Red Hat AI
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Featured

    • Red Hat build of OpenJDK
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat Developer Toolset

    References

    • E-books
    • Documentation
    • Cheat sheets
    • Architecture center
  • Community

    Get involved

    • Events
    • Live AI events
    • Red Hat Summit
    • Red Hat Accelerators
    • Community discussions

    Follow along

    • Articles & blogs
    • Developer newsletter
    • Videos
    • Github

    Get help

    • Customer service
    • Customer support
    • Regional contacts
    • Find a partner

    Join the Red Hat Developer program

    • Download Red Hat products and project builds, access support documentation, learning content, and more.
    • Explore the benefits

Making the Operation of Code More Transparent and Obvious with SystemTap

May 14, 2018
William Cohen
Related topics:
LinuxDeveloper tools
Related products:
Red Hat Enterprise Linux

    You can study source code and manually instrument functions as described in the “Use the dynamic tracing tools, Luke” blog article, but why not make it easier to find key points in the software by adding user-space markers to the application code? User-space markers have been available in Linux for quite some time (since 2009). The inactive user-space markers do not significantly slow down the code. Having them available allows you to get a more accurate picture of what the software is doing internally when unexpected issues occur. The diagnostic instrumentation can be more portable with the user-space markers, because the instrumentation does not need to rely on instrumenting particular function names or lines numbers in source code. The naming of the instrumentation points can also make clearer what event is associated with a particular instrumentation point.

    For example, Ruby MRI on Red Hat Enterprise Linux 7 has a number of different instrumentation points made available as a SystemTap tapset. If SystemTap is installed on the system, as described by What is SystemTap and how to use it?, the installed Ruby MRI instrumentation points can be listed with the stap -L" command shown below. These events show the start and end of various operations in the Ruby runtime, such as the start and end of garbage collection (GC) marking and sweeping.

    $ stap -L "ruby.**"
    ruby.array.create size:long file:string line:long $arg1:long $arg2:long $arg3:long
    ruby.cmethod.entry classname:string methodname:string file:string line:long $arg1:long $arg2:long $arg3:long $arg4:long
    ruby.cmethod.return classname:string methodname:string file:string line:long $arg1:long $arg2:long $arg3:long $arg4:long
    ruby.find.require.entry requiredfile:string file:string line:long $arg1:long $arg2:long $arg3:long
    ruby.find.require.return requiredfile:string file:string line:long $arg1:long $arg2:long $arg3:long
    ruby.gc.mark.begin
    ruby.gc.mark.end
    ruby.gc.sweep.begin
    ruby.gc.sweep.end
    ruby.hash.create size:long file:string line:long $arg1:long $arg2:long $arg3:long
    ruby.load.entry loadedfile:string file:string line:long $arg1:long $arg2:long $arg3:long
    ruby.load.return loadedfile:string $arg1:long $arg2:long $arg3:long
    ruby.method.entry classname:string methodname:string file:string line:long $arg1:long $arg2:long $arg3:long $arg4:long
    ruby.method.return classname:string methodname:string file:string line:long $arg1:long $arg2:long $arg3:long $arg4:long
    ruby.object.create classname:string file:string line:long $arg1:long $arg2:long $arg3:long
    ruby.parse.begin parsedfile:string parsedline:long $arg1:long $arg2:long
    ruby.parse.end parsedfile:string parsedline:long $arg1:long $arg2:long
    ruby.raise classname:string file:string line:long $arg1:long $arg2:long $arg3:long
    ruby.require.entry requiredfile:string file:string line:long $arg1:long $arg2:long $arg3:long
    ruby.require.return requiredfile:string $arg1:long $arg2:long $arg3:long
    ruby.string.create size:long file:string line:long $arg1:long $arg2:long $arg3:long
    

    Ruby and other languages provide tools to give some information about aspects of the their operation, such as statistics about garbage collection. However, often these tools are designed just to work within the confines of that language and a single process. These language-specific tools are less useful for examining problems that span code written in different languages or problems between multiple communicating processes. There are existing compiled C libraries that have been plugged into Python, Ruby, and Java code. Having SystemTap tapsets for the operations and events in these shared libraries can make it easier to write diagnostics that give a clearer understanding of what is occurring across multiple software components of complex systems.

    For example, you might have a Ruby program that uses a GUI built on GNOME GLib libraries. You observe pauses when doing the screen updates. You suspect that the pause might be due to Ruby's garbage collection, but also consider that the pauses could be due to issues in the GLib library operations. The developers of the GLib libraries have included a number of instrumentation points in the libraries. Having instrumentation points in both the Ruby runtime and GLib libraries allows you to check both of those different areas of code using a single tool, SystemTap.

    Over time, developers and maintainers of various software packages have added user-space markers to their applications. At Red Hat, we have enabled that instrumentation where possible in the RHEL packages. On RHEL 7.5, a number of RPMs make SystemTap user-space probes available, as seen with a query of files in /usr/share/systemtap/tapset:

    $ cd /usr/share/systemtap/tapset; find -path "*.stp" -exec rpm -qf {} \; |sort |uniq
    glib2-devel-2.54.2-2.el7.x86_64
    java-1.7.0-openjdk-devel-1.7.0.171-2.6.13.2.el7.x86_64
    libvirt-client-3.9.0-14.el7_5.2.x86_64
    nodejs-6.14.0-1.el7.x86_64
    pcp-3.12.2-5.el7.x86_64
    perl-devel-5.16.3-292.el7.x86_64
    python-libs-2.7.5-68.el7.x86_64
    qemu-kvm-1.5.3-156.el7.x86_64
    qemu-system-alpha-2.0.0-1.el7.6.x86_64
    qemu-system-arm-2.0.0-1.el7.6.x86_64
    qemu-system-cris-2.0.0-1.el7.6.x86_64
    qemu-system-lm32-2.0.0-1.el7.6.x86_64
    qemu-system-m68k-2.0.0-1.el7.6.x86_64
    qemu-system-microblaze-2.0.0-1.el7.6.x86_64
    qemu-system-mips-2.0.0-1.el7.6.x86_64
    qemu-system-moxie-2.0.0-1.el7.6.x86_64
    qemu-system-or32-2.0.0-1.el7.6.x86_64
    qemu-system-s390x-2.0.0-1.el7.6.x86_64
    qemu-system-sh4-2.0.0-1.el7.6.x86_64
    qemu-system-unicore32-2.0.0-1.el7.6.x86_64
    qemu-system-x86-2.0.0-1.el7.6.x86_64
    qemu-system-xtensa-2.0.0-1.el7.6.x86_64
    qemu-user-2.0.0-1.el7.6.x86_64
    ruby-libs-2.0.0.648-33.el7_4.x86_64
    sssd-common-1.16.0-19.el7.x86_64
    systemtap-client-3.2-4.el7.x86_64
    systemtap-devel-3.2-4.el7.x86_64

    You should consider adding similar, handy instrumentation probe points to the applications you maintain to make it easier for you and others to investigate issues on complex systems. Adding User Space Probing to an Application (heapsort example) provides information about how to implement this instrumentation.

    Last updated: May 29, 2018

    Recent Posts

    • Protect data offloaded to GPU-accelerated environments with OpenShift sandboxed containers

    • Case study: Measuring energy efficiency on the x64 platform

    • How to prevent AI inference stack silent failures

    • Preventing GPU waste: A guide to JIT checkpointing with Kubeflow Trainer on OpenShift AI

    • How to manage TLS certificates used by OpenShift GitOps operator

    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Platforms

    • Red Hat AI
    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Build

    • Developer Sandbox
    • Developer tools
    • Interactive tutorials
    • API catalog

    Quicklinks

    • Learning resources
    • E-books
    • Cheat sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site status dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2026 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Chat Support

    Please log in with your Red Hat account to access chat support.