2 .\" Copyright 1999 Sun Microsystems, Inc. All Rights Reserved.
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH TNF_KERNEL_PROBES 4 "Nov 8, 1999"
8 tnf_kernel_probes \- TNF kernel probes
12 The set of probes (trace instrumentation points) available in the standard
13 kernel. The probes log trace data to a kernel trace buffer in Trace Normal
14 Form (TNF). Kernel probes are controlled by \fBprex\fR(1). A snapshot of the
15 kernel trace buffer can be made using \fBtnfxtract\fR(1) and examined using
19 Each probe has a \fIname\fR and is associated with a set of symbolic
20 \fIkeys\fR, or \fIcategories\fR. These are used to select and control probes
21 from \fBprex\fR(1). A probe that is enabled for tracing generates a \fBTNF\fR
22 record, called an \fIevent record\fR. An event record contains two common
23 members and may contain other probe-specific data members.
28 \fBtnf_probe_event\fR \fItag\fR
29 \fBtnf_time_delta\fR \fItime_delta\fR
39 Encodes \fBTNF\fR references to two other records:
46 Describes the layout of the event record.
55 Identifies the writing thread and also contains a 64-bit base time in
64 \fB\fItime_delta\fR\fR
67 A 32-bit time offset from the base time; the sum of the two times is the actual
72 .SS "\fBthread_create\fR"
76 \fBtnf_kthread_id\fR \fItid\fR
77 \fBtnf_pid\fR \fIpid\fR
78 \fBtnf_symbol\fR \fIstart_pc\fR
84 Thread creation event.
91 The thread identifier for the new thread.
100 The process identifier for the new thread.
109 The kernel address of its start routine.
112 .SS "\fBthread_state\fR"
116 \fBtnf_kthread_id\fR \fItid\fR
117 \fBtnf_microstate\fR \fIstate\fR
123 Thread microstate transition events.
130 Optional; if it is absent, the event is for the writing thread, otherwise the
131 event is for the specified thread.
140 Indicates the thread state:
145 Running in user mode.
151 Running in system mode.
157 Asleep waiting for a user-mode lock.
163 Asleep on a kernel object.
169 Runnable (waiting for a cpu).
177 The values of this member are defined in <\fBsys/msacct.h\fR>. Note that to
178 reduce trace output, transitions between the \fIsystem\fR and \fIuser\fR
179 microstates that are induced by system calls are not traced. This information
180 is implicit in the system call entry and exit events.
186 Thread termination event for writing thread. This probe has no data members
187 other than the common members.
196 \fBtnf_kthread_id\fR \fItid\fR
197 \fBtnf_cpuid\fR \fIcpuid\fR
198 \fBtnf_long\fR \fIpriority\fR
199 \fBtnf_ulong\fR \fIqueue_length\fR
205 Thread scheduling events. These are triggered when a runnable thread is placed
213 Specifies the cpu to which the queue is attached.
222 The (global) dispatch priority of the thread.
228 \fB\fIqueue_length\fR\fR
231 The current length of the cpu's dispatch queue.
235 .SS "\fBthread_block\fR"
239 \fBtnf_opaque\fR \fIreason\fR
240 \fBtnf_symbols\fR \fIstack\fR
246 Thread blockage event. This probe captures a partial stack backtrace when the
247 current thread blocks.
254 The address of the object on which the thread is blocking.
263 References a \fBTNF\fR array of kernel addresses representing the PCs on the
264 stack at the time the thread blocks.
268 .SS "\fBsyscall_start\fR"
272 \fBtnf_sysnum\fR \fIsysnum\fR
278 System call entry event.
285 The system call number. The writing thread implicitly enters the \fIsystem\fR
286 microstate with this event.
289 .SS "\fBsyscall_end\fR"
293 \fBtnf_long\fR \fIrval1\fR
294 \fBtnf_long\fR \fIrval2\fR
295 \fBtnf_long\fR \fIerrno\fR
301 System call exit event.
305 \fB\fIrval1\fR and \fIrval2\fR\fR
308 The two return values of the system call
322 The writing thread implicitly enters the \fIuser\fR microstate with this event.
324 .SS "\fBaddress_fault\fR"
328 \fBtnf_opaque\fR \fIaddress\fR
329 \fBtnf_fault_type\fR \fIfault_type\fR
330 \fBtnf_seg_access\fR \fIaccess\fR
336 Address-space fault event.
343 Gives the faulting virtual address.
349 \fB\fIfault_type\fR\fR
352 Gives the fault type: invalid page, protection fault, software requested
353 locking or unlocking.
362 Gives the desired access protection: read, write, execute or create. The values
363 for these two members are defined in <\fBvm/seg_enum.h\fR>.
366 .SS "\fBmajor_fault\fR"
370 \fBtnf_opaque\fR \fIvnode\fR
371 \fBtnf_offset\fR \fIoffset\fR
377 Major page fault event. The faulting page is mapped to the file given by the
378 \fIvnode\fR member, at the given \fIoffset\fR into the file. (The faulting
379 virtual address is in the most recent \fBaddress_fault\fR event for the writing
381 .SS "\fBanon_private\fR"
385 \fBtnf_opaque\fR \fIaddress\fR
391 Copy-on-write page fault event.
398 The virtual address at which the new page is mapped.
401 .SS "\fBanon_zero\fR"
405 \fBtnf_opaque\fR \fIaddress\fR
411 Zero-fill page fault event.
418 The virtual address at which the new page is mapped.
421 .SS "\fBpage_unmap\fR"
425 \fBtnf_opaque\fR \fIvnode\fR
426 \fBtnf_offset\fR \fIoffset\fR
432 Page unmapping event. This probe marks the unmapping of a file system page
437 \fB\fIvnode\fR and \fIoffset\fR\fR
440 Identifies the file and offset of the page being unmapped.
443 .SS "Pageins and Pageouts"
448 \fBtnf_opaque\fR \fIvnode\fR
449 \fBtnf_offset\fR \fIoffset\fR
450 \fBtnf_size\fR \fIsize\fR
456 Pagein start event. This event signals the initiation of pagein I/O.
460 \fB\fIvnode\fRand\fIoffset\fR\fR
463 Identifyies the file and offset to be paged in.
472 Specifies the number of bytes to be paged in.
479 \fBtnf_opaque\fR \fIvnode\fR
480 \fBtnf_ulong\fR \fIpages_pageout\fR
481 \fBtnf_ulong\fR \fIpages_freed\fR
482 \fBtnf_ulong\fR \fIpages_reclaimed\fR
488 Pageout completion event. This event signals the completion of pageout I/O.
495 Identifies the file of the pageout request.
501 \fB\fIpages_pageout\fR\fR
504 The number of pages written out.
510 \fB\fIpages_freed\fR\fR
513 The number of pages freed after being written out.
519 \fB\fIpages_reclaimed\fR\fR
522 The number of pages reclaimed after being written out.
525 .SS "Page Daemon (Page Stealer)"
526 .SS "\fBpageout_scan_start\fR"
530 \fBtnf_ulong\fR \fIpages_free\fR
531 \fBtnf_ulong\fR \fIpages_needed\fR
537 Page daemon scan start event. This event signals the beginning of one
538 iteration of the page daemon.
542 \fB\fIpages_free\fR\fR
545 The number of free pages in the system.
551 \fB\fIpages_needed\fR\fR
554 The number of pages desired free.
557 .SS "\fBpageout_scan_end\fR"
561 \fBtnf_ulong\fR \fIpages_free\fR
562 \fBtnf_ulong\fR \fIpages_scanned\fR
568 Page daemon scan end event. This event signals the end of one iteration of the
573 \fB\fIpages_free\fR\fR
576 The number of free pages in the system.
582 \fB\fIpages_scanned\fR\fR
585 The number of pages examined by the page daemon. (Potentially more pages will
586 be freed when any queued pageout requests complete.)
590 .SS "\fBswapout_process\fR"
594 \fBtnf_pid\fR \fIpid\fR
595 \fBtnf_ulong\fR \fIpage_count\fR
601 Address space swapout event. This event marks the swapping out of a process
609 Identifies the process.
615 \fB\fIpage_count\fR\fR
618 Reports the number of pages either freed or queued for pageout.
621 .SS "\fBswapout_lwp\fR"
625 \fBtnf_pid\fR \fIpid\fR
626 \fBtnf_lwpid\fR \fIlwpid\fR
627 \fBtnf_kthread_id\fR \fItid\fR
628 \fBtnf_ulong\fR \fIpage_count\fR
634 Light-weight process swapout event. This event marks the swapping out of an
635 \fBLWP\fR and its stack.
642 The \fBLWP's\fR process identifier
651 The \fBLWP\fR identifier
657 \fB\fItid\fR \fImember\fR\fR
660 The \fBLWP's\fR kernel thread identifier.
666 \fB\fIpage_count\fR\fR
669 The number of pages swapped out.
672 .SS "\fBswapin_lwp\fR"
676 \fBtnf_pid\fR \fIpid\fR
677 \fBtnf_lwpid\fR \fIlwpid\fR
678 \fBtnf_kthread_id\fR \fItid\fR
679 \fBtnf_ulong\fR \fIpage_count\fR
685 Light-weight process swapin event. This event marks the swapping in of an
686 \fBLWP\fR and its stack.
693 The \fBLWP's\fR process identifier.
702 The \fBLWP\fR identifier.
711 The \fBLWP's\fR kernel thread identifier.
717 \fB\fIpage_count\fR\fR
720 The number of pages swapped in.
728 \fBtnf_device\fR \fIdevice\fR
729 \fBtnf_diskaddr\fR \fIblock\fR
730 \fBtnf_size\fR \fIsize\fR
731 \fBtnf_opaque\fR \fIbuf\fR
732 \fBtnf_bioflags\fR \fI flags\fR
738 Block I/O strategy event. This event marks a call to the \fBstrategy\fR(9E)
739 function of a block device driver.
746 Contains the major and minor numbers of the device.
755 The logical block number to be accessed on the device.
764 The size of the I/O request.
773 The kernel address of the \fBbuf\fR(9S) structure associated with the transfer.
782 The \fBbuf\fR(9S) flags associated with the transfer.
789 \fBtnf_device\fR \fIdevice\fR
790 \fBtnf_diskaddr\fR \fIblock\fR
791 \fBtnf_opaque\fR \fIbuf\fR
797 Buffered I/O completion event. This event marks calls to the \fBbiodone\fR(9F)
805 Contains the major and minor numbers of the device.
814 The logical block number accessed on the device.
823 The kernel address of the \fBbuf\fR(9S) structure associated with the transfer.
826 .SS "\fBphysio_start\fR"
830 \fBtnf_device\fR \fIdevice\fR
831 \fBtnf_offset\fR \fIoffset\fR
832 \fBtnf_size\fR \fIsize\fR
833 \fBtnf_bioflags\fR \fIrw\fR
839 Raw I/O start event. This event marks entry into the \fBphysio\fR(9F)
840 fufnction which performs unbuffered I/O.
847 Contains the major and minor numbers of the device of the transfer.
856 The logical offset on the device for the transfer.
865 The number of bytes to be transferred.
874 The direction of the transfer: read or write (see \fBbuf\fR(9S)).
877 .SS "\fBphysio_end\fR"
881 \fBtnf_device\fR \fIdevice\fR
887 Raw I/O end event. This event marks exit from the \fBphysio\fR(9F) fufnction.
894 The major and minor numbers of the device of the transfer.
900 Use the \fBprex\fR utility to control kernel probes. The standard \fBprex\fR
901 commands to list and manipulate probes are available to you, along with
902 commands to set up and manage kernel tracing.
905 Kernel probes write trace records into a kernel trace buffer. You must copy the
906 buffer into a TNF file for post-processing; use the \fBtnfxtract\fR utility for
910 You use the \fBtnfdump\fR utility to examine a kernel trace file. This is
911 exactly the same as examining a user-level trace file.
914 The steps you typically follow to take a kernel trace are:
918 Become superuser (\fBsu\fR).
923 Allocate a kernel trace buffer of the desired size (\fBprex\fR).
928 Select the probes you want to trace and enable (\fBprex\fR).
933 Turn kernel tracing on (\fBprex\fR).
938 Run your application.
943 Turn kernel tracing off (\fBprex\fR).
948 Extract the kernel trace buffer (\fBtnfxtract\fR).
953 Disable all probes (\fBprex\fR).
958 Deallocate the kernel trace buffer (\fBprex\fR).
963 Examine the trace file (\fBtnfdump\fR).
967 A convenient way to follow these steps is to use two shell windows; run an
968 interactive \fBprex\fR session in one, and run your application and
969 \fBtnfxtract\fR in the other.
973 \fBprex\fR(1), \fBtnfdump\fR(1), \fBtnfxtract\fR(1), \fBlibtnfctl\fR(3TNF),
974 \fBTNF_PROBE\fR(3TNF), \fBtracing\fR(3TNF), \fBstrategy\fR(9E),
975 \fBbiodone\fR(9F), \fBphysio\fR(9F), \fBbuf\fR(9S)