1#!/usr/sbin/dtrace -s 2/* 3 * uname-a.d - "uname -a" demo in DTrace. 4 * Written using DTrace (Solaris 10 3/05). 5 * 6 * This has been written to demonstrate fetching the "uname -a" info 7 * from a DTrace script, which turns out to be all kernel variables. 8 * This is intended as a starting point for other DTrace scripts, by 9 * beginning with familiar statistics. 10 * 11 * 24-Jul-2005, ver 1.00 12 * 13 * USAGE: uname-a.d 14 * 15 * FIELDS: See uname(1) manpage for documentation. 16 * 17 * SEE ALSO: uname 18 * 19 * COPYRIGHT: Copyright (c) 2005 Brendan Gregg. 20 * 21 * CDDL HEADER START 22 * 23 * The contents of this file are subject to the terms of the 24 * Common Development and Distribution License, Version 1.0 only 25 * (the "License"). You may not use this file except in compliance 26 * with the License. 27 * 28 * You can obtain a copy of the license at Docs/cddl1.txt 29 * or http://www.opensolaris.org/os/licensing. 30 * See the License for the specific language governing permissions 31 * and limitations under the License. 32 * 33 * 24-Jul-2005 Brendan Gregg Created this. 34 */ 35 36#pragma D option quiet 37#pragma D option bufsize=8k 38 39/* print system info */ 40dtrace:::BEGIN 41{ 42 printf("%s %s %s %s %s %s %s", 43 `utsname.sysname, 44 `utsname.nodename, 45 `utsname.release, 46 `utsname.version, 47 `utsname.machine, 48 `architecture, 49 `platform); 50 51 exit(0); 52} 53