HP Caliper Ktrace Features Guide
1 HP Caliper Ktrace Feature Overview
What Is HP Caliper Ktrace?
HP-UX kernel tracing is a powerful, acclaimed, indispensable facility for debugging
kernel problems and for understanding kernel behavior. It gives insight into kernel
events and activity by capturing data across all CPUS about kernel function call
sequence, parameters, and timing.
The Ktrace features provide additional analysis tools for applications. They provide
tracing of kernel operations for HP-UX applications running on HP Integrity Servers.
They help you to understand the performance and execution of your application and
to identify ways to improve its run-time performance.
The Ktrace features are a combination of two HP Caliper commands, ktracer and
ktracedump. The ktracer program initializes the kernel, telling the kernel how many
traces to place in its circular buffer, and which functions to trace. ktracer is described
in Chapter 2 (page 19). The ktracedump program retrieves the traces from the kernel
and then formats the output according to user specifications. Refer to Chapter 3,
ktracedump for a description of ktracedump.
The ktracer program can trace each kernel function called in the order in which it is
called. It can provide time stamps, function arguments, caller names, and other
information. The ktracedump feature can be used to organize and format the data
collected for analysis. The Ktrace features do not require any special link options or
libraries. They support programs compiled with any compiler option.
The Ktrace features let you do the following tasks:
• Select kernel functions to trace.
• Place a trace point at the beginning of each selected function.
• Record every time a function is called along with the function's address, arguments,
caller, itimer (adjusted Interval Timer), PID (Process ID), TID (Thread ID), Spnd
(spinlock depth), and Sp (stack pointer from Kernel Stack or Interrupt Control
Stack) value.
• Retain the last data collected.
Using the Ktrace features you can observe, investigate, analyze, and learn kernel
behavior to:
• Discover which syscalls are made when and by whom.
• Discover which buffer, file, or socket is frequently used.
• Determine if code of interest is called.
• Determine which PIDs, CPUs and Callers acquire and hold a spinlock or read/write
lock and how long they are held.
• Determine the implications of a kernel design decision.
You can troubleshoot and debug problems:
What Is HP Caliper Ktrace? 11