1 '\" te
   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"
   7 .SH NAME
   8 tnf_kernel_probes \- TNF kernel probes
   9 .SH DESCRIPTION
  10 .sp
  11 .LP
  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
  16 \fBtnfdump\fR(1).
  17 .sp
  18 .LP
  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.
  24 .SS "Common Members"
  25 .sp
  26 .in +2
  27 .nf
  28 \fBtnf_probe_event\fR    \fItag\fR
  29 \fBtnf_time_delta\fR     \fItime_delta\fR
  30 .fi
  31 .in -2
  32 
  33 .sp
  34 .ne 2
  35 .na
  36 \fB\fItag\fR\fR
  37 .ad
  38 .RS 14n
  39 Encodes  \fBTNF\fR references to two other records:
  40 .sp
  41 .ne 2
  42 .na
  43 \fB\fItag\fR\fR
  44 .ad
  45 .RS 12n
  46 Describes the layout of the event record.
  47 .RE
  48 
  49 .sp
  50 .ne 2
  51 .na
  52 \fB\fIschedule\fR\fR
  53 .ad
  54 .RS 12n
  55 Identifies the writing thread and also contains a 64-bit base time in
  56 nanoseconds.
  57 .RE
  58 
  59 .RE
  60 
  61 .sp
  62 .ne 2
  63 .na
  64 \fB\fItime_delta\fR\fR
  65 .ad
  66 .RS 14n
  67 A 32-bit time offset from the base time; the sum of the two times is the actual
  68 time of the event.
  69 .RE
  70 
  71 .SS "Threads"
  72 .SS "\fBthread_create\fR"
  73 .sp
  74 .in +2
  75 .nf
  76 \fBtnf_kthread_id\fR    \fItid\fR
  77 \fBtnf_pid\fR           \fIpid\fR
  78 \fBtnf_symbol\fR        \fIstart_pc\fR
  79 .fi
  80 .in -2
  81 
  82 .sp
  83 .LP
  84 Thread creation event.
  85 .sp
  86 .ne 2
  87 .na
  88 \fB\fItid\fR\fR
  89 .ad
  90 .RS 12n
  91 The thread identifier for the new thread.
  92 .RE
  93 
  94 .sp
  95 .ne 2
  96 .na
  97 \fB\fIpid\fR\fR
  98 .ad
  99 .RS 12n
 100 The process identifier for the new thread.
 101 .RE
 102 
 103 .sp
 104 .ne 2
 105 .na
 106 \fB\fIstart_pc\fR\fR
 107 .ad
 108 .RS 12n
 109 The kernel address of its start routine.
 110 .RE
 111 
 112 .SS "\fBthread_state\fR"
 113 .sp
 114 .in +2
 115 .nf
 116 \fBtnf_kthread_id\fR    \fItid\fR
 117 \fBtnf_microstate\fR    \fIstate\fR
 118 .fi
 119 .in -2
 120 
 121 .sp
 122 .LP
 123 Thread microstate transition events.
 124 .sp
 125 .ne 2
 126 .na
 127 \fB\fItid\fR\fR
 128 .ad
 129 .RS 9n
 130 Optional; if it is absent, the event is for the writing thread, otherwise the
 131 event is for the specified thread.
 132 .RE
 133 
 134 .sp
 135 .ne 2
 136 .na
 137 \fB\fIstate\fR\fR
 138 .ad
 139 .RS 9n
 140 Indicates the thread state:
 141 .RS +4
 142 .TP
 143 .ie t \(bu
 144 .el o
 145 Running in user mode.
 146 .RE
 147 .RS +4
 148 .TP
 149 .ie t \(bu
 150 .el o
 151 Running in system mode.
 152 .RE
 153 .RS +4
 154 .TP
 155 .ie t \(bu
 156 .el o
 157 Asleep waiting for a user-mode lock.
 158 .RE
 159 .RS +4
 160 .TP
 161 .ie t \(bu
 162 .el o
 163 Asleep on a kernel object.
 164 .RE
 165 .RS +4
 166 .TP
 167 .ie t \(bu
 168 .el o
 169 Runnable (waiting for a cpu).
 170 .RE
 171 .RS +4
 172 .TP
 173 .ie t \(bu
 174 .el o
 175 Stopped.
 176 .RE
 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.
 181 .RE
 182 
 183 .SS "thread_exit"
 184 .sp
 185 .LP
 186 Thread termination event for writing thread.  This probe has no data members
 187 other than the common members.
 188 .SS "Scheduling"
 189 .sp
 190 .LP
 191 \fB\fR
 192 .SS "thread_queue"
 193 .sp
 194 .in +2
 195 .nf
 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
 200 .fi
 201 .in -2
 202 
 203 .sp
 204 .LP
 205 Thread scheduling events.  These are triggered when a runnable thread is placed
 206 on a dispatch queue.
 207 .sp
 208 .ne 2
 209 .na
 210 \fB\fIcpuid\fR\fR
 211 .ad
 212 .RS 16n
 213 Specifies the cpu to which the queue is attached.
 214 .RE
 215 
 216 .sp
 217 .ne 2
 218 .na
 219 \fB\fIpriority\fR\fR
 220 .ad
 221 .RS 16n
 222 The (global) dispatch priority of the thread.
 223 .RE
 224 
 225 .sp
 226 .ne 2
 227 .na
 228 \fB\fIqueue_length\fR\fR
 229 .ad
 230 .RS 16n
 231 The current length of the cpu's dispatch queue.
 232 .RE
 233 
 234 .SS "Blocking"
 235 .SS "\fBthread_block\fR"
 236 .sp
 237 .in +2
 238 .nf
 239 \fBtnf_opaque\fR     \fIreason\fR
 240 \fBtnf_symbols\fR    \fIstack\fR
 241 .fi
 242 .in -2
 243 
 244 .sp
 245 .LP
 246 Thread blockage event.  This probe captures a partial stack backtrace when the
 247 current thread blocks.
 248 .sp
 249 .ne 2
 250 .na
 251 \fB\fIreason\fR\fR
 252 .ad
 253 .RS 11n
 254 The address of the object on which the thread is blocking.
 255 .RE
 256 
 257 .sp
 258 .ne 2
 259 .na
 260 \fB\fIsymbols\fR\fR
 261 .ad
 262 .RS 11n
 263 References a \fBTNF\fR array of kernel addresses representing the PCs on the
 264 stack at the time the thread blocks.
 265 .RE
 266 
 267 .SS "System Calls"
 268 .SS "\fBsyscall_start\fR"
 269 .sp
 270 .in +2
 271 .nf
 272 \fBtnf_sysnum\fR    \fIsysnum\fR
 273 .fi
 274 .in -2
 275 
 276 .sp
 277 .LP
 278 System call entry event.
 279 .sp
 280 .ne 2
 281 .na
 282 \fB\fIsysnum\fR\fR
 283 .ad
 284 .RS 10n
 285 The system call number.  The writing thread implicitly enters the \fIsystem\fR
 286 microstate with this event.
 287 .RE
 288 
 289 .SS "\fBsyscall_end\fR"
 290 .sp
 291 .in +2
 292 .nf
 293 \fBtnf_long\fR    \fIrval1\fR
 294 \fBtnf_long\fR    \fIrval2\fR
 295 \fBtnf_long\fR    \fIerrno\fR
 296 .fi
 297 .in -2
 298 
 299 .sp
 300 .LP
 301 System call exit event.
 302 .sp
 303 .ne 2
 304 .na
 305 \fB\fIrval1\fR and \fIrval2\fR\fR
 306 .ad
 307 .RS 19n
 308 The two return values of the system call
 309 .RE
 310 
 311 .sp
 312 .ne 2
 313 .na
 314 \fB\fIerrno\fR\fR
 315 .ad
 316 .RS 19n
 317 The error return.
 318 .RE
 319 
 320 .sp
 321 .LP
 322 The writing thread implicitly enters the \fIuser\fR microstate with this event.
 323 .SS "Page Faults"
 324 .SS "\fBaddress_fault\fR"
 325 .sp
 326 .in +2
 327 .nf
 328 \fBtnf_opaque\fR      \fIaddress\fR
 329 \fBtnf_fault_type\fR  \fIfault_type\fR
 330 \fBtnf_seg_access\fR  \fIaccess\fR
 331 .fi
 332 .in -2
 333 
 334 .sp
 335 .LP
 336 Address-space fault event.
 337 .sp
 338 .ne 2
 339 .na
 340 \fB\fIaddress\fR\fR
 341 .ad
 342 .RS 14n
 343 Gives the faulting virtual address.
 344 .RE
 345 
 346 .sp
 347 .ne 2
 348 .na
 349 \fB\fIfault_type\fR\fR
 350 .ad
 351 .RS 14n
 352 Gives the fault type: invalid page, protection fault, software requested
 353 locking or unlocking.
 354 .RE
 355 
 356 .sp
 357 .ne 2
 358 .na
 359 \fB\fIaccess\fR\fR
 360 .ad
 361 .RS 14n
 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>.
 364 .RE
 365 
 366 .SS "\fBmajor_fault\fR"
 367 .sp
 368 .in +2
 369 .nf
 370 \fBtnf_opaque\fR    \fIvnode\fR
 371 \fBtnf_offset\fR    \fIoffset\fR
 372 .fi
 373 .in -2
 374 
 375 .sp
 376 .LP
 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
 380 thread.)
 381 .SS "\fBanon_private\fR"
 382 .sp
 383 .in +2
 384 .nf
 385 \fBtnf_opaque\fR    \fIaddress\fR
 386 .fi
 387 .in -2
 388 
 389 .sp
 390 .LP
 391 Copy-on-write page fault event.
 392 .sp
 393 .ne 2
 394 .na
 395 \fB\fIaddress\fR\fR
 396 .ad
 397 .RS 11n
 398 The virtual address at which the new page is mapped.
 399 .RE
 400 
 401 .SS "\fBanon_zero\fR"
 402 .sp
 403 .in +2
 404 .nf
 405 \fBtnf_opaque\fR    \fIaddress\fR
 406 .fi
 407 .in -2
 408 
 409 .sp
 410 .LP
 411 Zero-fill page fault event.
 412 .sp
 413 .ne 2
 414 .na
 415 \fB\fIaddress\fR\fR
 416 .ad
 417 .RS 11n
 418 The virtual address at which the new page is mapped.
 419 .RE
 420 
 421 .SS "\fBpage_unmap\fR"
 422 .sp
 423 .in +2
 424 .nf
 425 \fBtnf_opaque\fR    \fIvnode\fR
 426 \fBtnf_offset\fR    \fIoffset\fR
 427 .fi
 428 .in -2
 429 
 430 .sp
 431 .LP
 432 Page unmapping event.  This probe marks the unmapping of a file system page
 433 from the system.
 434 .sp
 435 .ne 2
 436 .na
 437 \fB\fIvnode\fR and \fIoffset\fR\fR
 438 .ad
 439 .RS 20n
 440 Identifies the file and offset of the page being unmapped.
 441 .RE
 442 
 443 .SS "Pageins and Pageouts"
 444 .SS "\fBpagein\fR"
 445 .sp
 446 .in +2
 447 .nf
 448 \fBtnf_opaque\fR    \fIvnode\fR
 449 \fBtnf_offset\fR    \fIoffset\fR
 450 \fBtnf_size\fR      \fIsize\fR
 451 .fi
 452 .in -2
 453 
 454 .sp
 455 .LP
 456 Pagein start event.  This event signals the initiation of pagein I/O.
 457 .sp
 458 .ne 2
 459 .na
 460 \fB\fIvnode\fRand\fIoffset\fR\fR
 461 .ad
 462 .RS 18n
 463 Identifyies the file and offset to be paged in.
 464 .RE
 465 
 466 .sp
 467 .ne 2
 468 .na
 469 \fB\fIsize\fR\fR
 470 .ad
 471 .RS 18n
 472 Specifies the number of bytes to be paged in.
 473 .RE
 474 
 475 .SS "\fBpageout\fR"
 476 .sp
 477 .in +2
 478 .nf
 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
 483 .fi
 484 .in -2
 485 
 486 .sp
 487 .LP
 488 Pageout completion event.  This event signals the completion of pageout I/O.
 489 .sp
 490 .ne 2
 491 .na
 492 \fB\fIvnode\fR\fR
 493 .ad
 494 .RS 19n
 495 Identifies the file of the pageout request.
 496 .RE
 497 
 498 .sp
 499 .ne 2
 500 .na
 501 \fB\fIpages_pageout\fR\fR
 502 .ad
 503 .RS 19n
 504 The number of pages written out.
 505 .RE
 506 
 507 .sp
 508 .ne 2
 509 .na
 510 \fB\fIpages_freed\fR\fR
 511 .ad
 512 .RS 19n
 513 The number of pages freed after being written out.
 514 .RE
 515 
 516 .sp
 517 .ne 2
 518 .na
 519 \fB\fIpages_reclaimed\fR\fR
 520 .ad
 521 .RS 19n
 522 The number of pages reclaimed after being written out.
 523 .RE
 524 
 525 .SS "Page Daemon (Page Stealer)"
 526 .SS "\fBpageout_scan_start\fR"
 527 .sp
 528 .in +2
 529 .nf
 530 \fBtnf_ulong\fR    \fIpages_free\fR
 531 \fBtnf_ulong\fR    \fIpages_needed\fR
 532 .fi
 533 .in -2
 534 
 535 .sp
 536 .LP
 537 Page daemon scan start event.  This event signals the beginning of one
 538 iteration of the page daemon.
 539 .sp
 540 .ne 2
 541 .na
 542 \fB\fIpages_free\fR\fR
 543 .ad
 544 .RS 16n
 545 The number of free pages in the system.
 546 .RE
 547 
 548 .sp
 549 .ne 2
 550 .na
 551 \fB\fIpages_needed\fR\fR
 552 .ad
 553 .RS 16n
 554 The number of pages desired free.
 555 .RE
 556 
 557 .SS "\fBpageout_scan_end\fR"
 558 .sp
 559 .in +2
 560 .nf
 561 \fBtnf_ulong\fR    \fIpages_free\fR
 562 \fBtnf_ulong\fR    \fIpages_scanned\fR
 563 .fi
 564 .in -2
 565 
 566 .sp
 567 .LP
 568 Page daemon scan end event.  This event signals the end of one iteration of the
 569 page daemon.
 570 .sp
 571 .ne 2
 572 .na
 573 \fB\fIpages_free\fR\fR
 574 .ad
 575 .RS 17n
 576 The number of free pages in the system.
 577 .RE
 578 
 579 .sp
 580 .ne 2
 581 .na
 582 \fB\fIpages_scanned\fR\fR
 583 .ad
 584 .RS 17n
 585 The number of pages examined by the page daemon.  (Potentially more pages will
 586 be freed when any queued pageout requests complete.)
 587 .RE
 588 
 589 .SS "Swapper"
 590 .SS "\fBswapout_process\fR"
 591 .sp
 592 .in +2
 593 .nf
 594 \fBtnf_pid\fR      \fIpid\fR
 595 \fBtnf_ulong\fR    \fIpage_count\fR
 596 .fi
 597 .in -2
 598 
 599 .sp
 600 .LP
 601 Address space swapout event.  This event marks the swapping out of a process
 602 address space.
 603 .sp
 604 .ne 2
 605 .na
 606 \fB\fIpid\fR\fR
 607 .ad
 608 .RS 14n
 609 Identifies the process.
 610 .RE
 611 
 612 .sp
 613 .ne 2
 614 .na
 615 \fB\fIpage_count\fR\fR
 616 .ad
 617 .RS 14n
 618 Reports the number of pages either freed or queued for pageout.
 619 .RE
 620 
 621 .SS "\fBswapout_lwp\fR"
 622 .sp
 623 .in +2
 624 .nf
 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
 629 .fi
 630 .in -2
 631 
 632 .sp
 633 .LP
 634 Light-weight process swapout event.  This event marks the swapping out of an
 635 \fBLWP\fR and its stack.
 636 .sp
 637 .ne 2
 638 .na
 639 \fB\fIpid\fR\fR
 640 .ad
 641 .RS 14n
 642 The  \fBLWP's\fR process identifier
 643 .RE
 644 
 645 .sp
 646 .ne 2
 647 .na
 648 \fB\fIlwpid\fR\fR
 649 .ad
 650 .RS 14n
 651 The \fBLWP\fR identifier
 652 .RE
 653 
 654 .sp
 655 .ne 2
 656 .na
 657 \fB\fItid\fR \fImember\fR\fR
 658 .ad
 659 .RS 14n
 660 The \fBLWP's\fR kernel thread identifier.
 661 .RE
 662 
 663 .sp
 664 .ne 2
 665 .na
 666 \fB\fIpage_count\fR\fR
 667 .ad
 668 .RS 14n
 669 The number of pages swapped out.
 670 .RE
 671 
 672 .SS "\fBswapin_lwp\fR"
 673 .sp
 674 .in +2
 675 .nf
 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
 680 .fi
 681 .in -2
 682 
 683 .sp
 684 .LP
 685 Light-weight process swapin event.  This event marks the swapping in of an
 686 \fBLWP\fR and its stack.
 687 .sp
 688 .ne 2
 689 .na
 690 \fB\fIpid\fR\fR
 691 .ad
 692 .RS 14n
 693 The \fBLWP's\fR process identifier.
 694 .RE
 695 
 696 .sp
 697 .ne 2
 698 .na
 699 \fB\fIlwpid\fR\fR
 700 .ad
 701 .RS 14n
 702 The \fBLWP\fR identifier.
 703 .RE
 704 
 705 .sp
 706 .ne 2
 707 .na
 708 \fB\fItid\fR\fR
 709 .ad
 710 .RS 14n
 711 The \fBLWP's\fR kernel thread identifier.
 712 .RE
 713 
 714 .sp
 715 .ne 2
 716 .na
 717 \fB\fIpage_count\fR\fR
 718 .ad
 719 .RS 14n
 720 The number of pages swapped in.
 721 .RE
 722 
 723 .SS "Local I/O"
 724 .SS "\fBstrategy\fR"
 725 .sp
 726 .in +2
 727 .nf
 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
 733 .fi
 734 .in -2
 735 
 736 .sp
 737 .LP
 738 Block I/O strategy event.  This event marks a call to the \fBstrategy\fR(9E)
 739 function of a block device driver.
 740 .sp
 741 .ne 2
 742 .na
 743 \fB\fIdevice\fR\fR
 744 .ad
 745 .RS 10n
 746 Contains the major and minor numbers of the device.
 747 .RE
 748 
 749 .sp
 750 .ne 2
 751 .na
 752 \fB\fIblock\fR\fR
 753 .ad
 754 .RS 10n
 755 The logical block number to be accessed on the device.
 756 .RE
 757 
 758 .sp
 759 .ne 2
 760 .na
 761 \fB\fIsize\fR\fR
 762 .ad
 763 .RS 10n
 764 The size of the I/O request.
 765 .RE
 766 
 767 .sp
 768 .ne 2
 769 .na
 770 \fB\fIbuf\fR\fR
 771 .ad
 772 .RS 10n
 773 The kernel address of the \fBbuf\fR(9S) structure associated with the transfer.
 774 .RE
 775 
 776 .sp
 777 .ne 2
 778 .na
 779 \fB\fIflags\fR\fR
 780 .ad
 781 .RS 10n
 782 The \fBbuf\fR(9S) flags associated with the transfer.
 783 .RE
 784 
 785 .SS "\fBbiodone\fR"
 786 .sp
 787 .in +2
 788 .nf
 789 \fBtnf_device\fR     \fIdevice\fR
 790 \fBtnf_diskaddr\fR   \fIblock\fR
 791 \fBtnf_opaque\fR     \fIbuf\fR
 792 .fi
 793 .in -2
 794 
 795 .sp
 796 .LP
 797 Buffered I/O completion event.  This event marks calls to the \fBbiodone\fR(9F)
 798 function.
 799 .sp
 800 .ne 2
 801 .na
 802 \fB\fIdevice\fR\fR
 803 .ad
 804 .RS 10n
 805 Contains the major and minor numbers of the device.
 806 .RE
 807 
 808 .sp
 809 .ne 2
 810 .na
 811 \fB\fIblock\fR\fR
 812 .ad
 813 .RS 10n
 814 The logical block number accessed on the device.
 815 .RE
 816 
 817 .sp
 818 .ne 2
 819 .na
 820 \fB\fIbuf\fR\fR
 821 .ad
 822 .RS 10n
 823 The kernel address of the \fBbuf\fR(9S) structure associated with the transfer.
 824 .RE
 825 
 826 .SS "\fBphysio_start\fR"
 827 .sp
 828 .in +2
 829 .nf
 830 \fBtnf_device\fR     \fIdevice\fR
 831 \fBtnf_offset\fR     \fIoffset\fR
 832 \fBtnf_size\fR       \fIsize\fR
 833 \fBtnf_bioflags\fR   \fIrw\fR
 834 .fi
 835 .in -2
 836 
 837 .sp
 838 .LP
 839 Raw I/O start event.  This event marks entry into the \fBphysio\fR(9F)
 840 fufnction which performs unbuffered I/O.
 841 .sp
 842 .ne 2
 843 .na
 844 \fB\fIdevice\fR\fR
 845 .ad
 846 .RS 10n
 847 Contains the major and minor numbers of the device of the transfer.
 848 .RE
 849 
 850 .sp
 851 .ne 2
 852 .na
 853 \fB\fIoffset\fR\fR
 854 .ad
 855 .RS 10n
 856 The logical offset on the device for the transfer.
 857 .RE
 858 
 859 .sp
 860 .ne 2
 861 .na
 862 \fB\fIsize\fR\fR
 863 .ad
 864 .RS 10n
 865 The number of bytes to be transferred.
 866 .RE
 867 
 868 .sp
 869 .ne 2
 870 .na
 871 \fB\fIrw\fR\fR
 872 .ad
 873 .RS 10n
 874 The direction of the transfer: read or write (see \fBbuf\fR(9S)).
 875 .RE
 876 
 877 .SS "\fBphysio_end\fR"
 878 .sp
 879 .in +2
 880 .nf
 881 \fBtnf_device\fR    \fIdevice\fR
 882 .fi
 883 .in -2
 884 
 885 .sp
 886 .LP
 887 Raw I/O end event.  This event marks exit from the \fBphysio\fR(9F) fufnction.
 888 .sp
 889 .ne 2
 890 .na
 891 \fB\fIdevice\fR\fR
 892 .ad
 893 .RS 10n
 894 The major and minor numbers of the device of the transfer.
 895 .RE
 896 
 897 .SH USAGE
 898 .sp
 899 .LP
 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.
 903 .sp
 904 .LP
 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
 907 this.
 908 .sp
 909 .LP
 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.
 912 .sp
 913 .LP
 914 The steps you typically follow to take a kernel trace are:
 915 .RS +4
 916 .TP
 917 1.
 918 Become superuser (\fBsu\fR).
 919 .RE
 920 .RS +4
 921 .TP
 922 2.
 923 Allocate a kernel trace buffer of the desired size (\fBprex\fR).
 924 .RE
 925 .RS +4
 926 .TP
 927 3.
 928 Select the probes you want to trace and enable (\fBprex\fR).
 929 .RE
 930 .RS +4
 931 .TP
 932 4.
 933 Turn kernel tracing on (\fBprex\fR).
 934 .RE
 935 .RS +4
 936 .TP
 937 5.
 938 Run your application.
 939 .RE
 940 .RS +4
 941 .TP
 942 6.
 943 Turn kernel tracing off (\fBprex\fR).
 944 .RE
 945 .RS +4
 946 .TP
 947 7.
 948 Extract the kernel trace buffer (\fBtnfxtract\fR).
 949 .RE
 950 .RS +4
 951 .TP
 952 8.
 953 Disable all probes (\fBprex\fR).
 954 .RE
 955 .RS +4
 956 .TP
 957 9.
 958 Deallocate the kernel trace buffer (\fBprex\fR).
 959 .RE
 960 .RS +4
 961 .TP
 962 10.
 963 Examine the trace file (\fBtnfdump\fR).
 964 .RE
 965 .sp
 966 .LP
 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.
 970 .SH SEE ALSO
 971 .sp
 972 .LP
 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)