Skip to content

sd_cmds.d

/*
 * CDDL HEADER START
 *
 * 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.
 *
 * 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.
 *
 * 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]
 *
 * CDDL HEADER END
 *
 * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 *
 */

#define SD_TO_DEVINFO(un) ((struct dev_info *)((un)->un_sd->sd_dev))

#define DEV_NAME(un) \
    stringof(`devnamesp[SD_TO_DEVINFO(un)->devi_major].dn_name) /* ` */

#define DEV_INST(un) (SD_TO_DEVINFO(un)->devi_instance)


sd_start_cmds:entry /base == 0/ { base = timestamp }
::sdintr:entry /base/ {
    this->un = ((struct sd_xbuf *)((struct buf *)args[0]->pkt_private)->b_private)->xb_un;
    this->t = timestamp - base;
    printf("%d.%9.9d %d %d %d cpu %d %s%d\n",
        this->t / 1000000000, this->t % 1000000000,
        this->un->un_ncmds_in_transport,
        this->un->un_throttle,
        this->un->un_ncmds_in_driver ,
        cpu,
        DEV_NAME(this->un),DEV_INST(this->un)) }
sd_start_cmds:entry { self->un = args[0]}
sd_start_cmds:return /self->un/ {
    this->un = self->un;
    self->un =0;
    this->t = timestamp - base;
    printf("%d.%9.9d %d %d %d cpu %d %s%d\n",
        this->t / 1000000000, this->t % 1000000000,
        this->un->un_ncmds_in_transport,
        this->un->un_throttle,
        this->un->un_ncmds_in_driver ,
        cpu,
        DEV_NAME(this->un),DEV_INST(this->un))
}

One Comment

Trackbacks & Pingbacks

  1. Understanding iostat « Chris Gerhard's Blog

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: