#!/usr/sbin/dtrace -Fs /* * CDDL HEADER START * * The contents of this file are subject to the terms of the * Common Development and Distribution License, Version 1.0 only * (the "License"). You may not use this file except in compliance * with the License. * * You can obtain a copy of the license at * 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 2005 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ /* * Print page distribution by lgrp, mnode and color. * Also aggregate per individual page_get_xx function. * Run it as lgrp_vm.d -c command */ fbt:unix:page_get_freelist:entry, fbt:unix:page_get_cachelist:entry, fbt:unix:page_get_replacement_page:entry /pid == $target/ { self->func = probefunc; self->trace++; } fbt:unix:page_get_freelist:return, fbt:unix:page_get_cachelist:return, fbt:unix:page_get_replacement_page:return /self->trace/ { self->func = 0; self->trace--; } sdt:unix::page-get /self->trace/ { this->lgrp = (lgrp_t *)arg0; @a["lgrp"] = lquantize(this->lgrp->lgrp_id, 0, 12, 1); @a["mnode"] = lquantize(arg1, 0, 12, 1); @a["color"] = lquantize(arg2, 0, 255, 1); @aa["total pages"] = count(); @b[self->func, "lgrp"] = lquantize(this->lgrp->lgrp_id, 0, 12, 1); @b[self->func, "mnode"] = lquantize(arg1, 0, 12, 1); @b[self->func, "color"] = lquantize(arg2, 0, 255, 1); @bb[self->func, "total pages"] = count(); } fbt:unix:page_get_mnode_freelist:entry, fbt:unix:page_get_contig_pages:entry /self->trace/ { self->mnode = args[0]; } fbt:unix:page_get_mnode_cachelist:entry /self->trace/ { self->mnode = args[0]; } fbt:unix:page_get_mnode_freelist:return, fbt:unix:page_get_contig_pages:return, fbt:unix:page_get_mnode_cachelist:return /self->trace && arg1 != NULL/ { @ok[probefunc, "allocok"] = lquantize(self->mnode, 0, 12, 1); self->mnode = 0; } fbt:unix:page_get_mnode_freelist:return, fbt:unix:page_get_contig_pages:return, fbt:unix:page_get_mnode_cachelist:return /self->trace && arg1 == NULL/ { @fail[probefunc, "allocfail"] = lquantize(self->mnode, 0, 12, 1); self->mnode = 0; }