rwtime.d revision 178477
150476Speter/* 223119Swosch * CDDL HEADER START 323119Swosch * 423119Swosch * The contents of this file are subject to the terms of the 523119Swosch * Common Development and Distribution License (the "License"). 623119Swosch * You may not use this file except in compliance with the License. 723119Swosch * 823119Swosch * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 923119Swosch * or http://www.opensolaris.org/os/licensing. 1023119Swosch * See the License for the specific language governing permissions 1123119Swosch * and limitations under the License. 1223119Swosch * 1323119Swosch * When distributing Covered Code, include this CDDL HEADER in each 1423119Swosch * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 1523119Swosch * If applicable, add the following below this CDDL HEADER, with the 1623119Swosch * fields enclosed by brackets "[]" replaced with your own identifying 1723119Swosch * information: Portions Copyright [yyyy] [name of copyright owner] 1823119Swosch * 1923119Swosch * CDDL HEADER END 2023119Swosch */ 2123119Swosch 2223119Swosch/* 2323119Swosch * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 2423119Swosch * Use is subject to license terms. 2523119Swosch */ 2623119Swosch 2723119Swosch#pragma ident "%Z%%M% %I% %E% SMI" 2823119Swosch 2923119Swosch/* 3023119Swosch * ASSERTION: 3123119Swosch * Verify doc example 7-1 3223119Swosch * 3323119Swosch * SECTION: 3423119Swosch * DocExamples/rwinfo 3523119Swosch */ 3623119Swosch 3723119Swosch 3823119Swoschsyscall::read:entry, 3923119Swoschsyscall::write:entry 4023119Swosch/pid == 100551/ 4123119Swosch{ 4223119Swosch ts[probefunc] = timestamp; 4323119Swosch} 4423119Swosch 4523119Swoschsyscall::read:return, 4623119Swoschsyscall::write:return 4723119Swosch/(ts[probefunc] != 0) && (pid == 100551)/ 4823119Swosch{ 4923119Swosch printf("%d nsecs\n", timestamp - ts[probefunc]); 5023119Swosch} 5123119Swosch