mknames.sh revision 178479
11590Srgrimes#!/bin/sh
21590Srgrimes#
31590Srgrimes# CDDL HEADER START
41590Srgrimes#
51590Srgrimes# The contents of this file are subject to the terms of the
61590Srgrimes# Common Development and Distribution License, Version 1.0 only
71590Srgrimes# (the "License").  You may not use this file except in compliance
81590Srgrimes# with the License.
91590Srgrimes#
101590Srgrimes# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
111590Srgrimes# or http://www.opensolaris.org/os/licensing.
121590Srgrimes# See the License for the specific language governing permissions
131590Srgrimes# and limitations under the License.
141590Srgrimes#
151590Srgrimes# When distributing Covered Code, include this CDDL HEADER in each
161590Srgrimes# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
171590Srgrimes# If applicable, add the following below this CDDL HEADER, with the
181590Srgrimes# fields enclosed by brackets "[]" replaced with your own identifying
191590Srgrimes# information: Portions Copyright [yyyy] [name of copyright owner]
201590Srgrimes#
211590Srgrimes# CDDL HEADER END
221590Srgrimes#
231590Srgrimes#
241590Srgrimes# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
251590Srgrimes# Use is subject to license terms.
261590Srgrimes#
271590Srgrimes#ident	"%Z%%M%	%I%	%E% SMI"
281590Srgrimes
291590SrgrimesBSDECHO=-e
3087701Smarkm
3187701Smarkmecho ${BSDECHO} "\
3287701Smarkm/*\n\
3387701Smarkm * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.\n\
341590Srgrimes * Use is subject to license terms.\n\
3587701Smarkm */\n\
3628370Scharnier\n\
371590Srgrimes#pragma ident\t\"%Z%%M%\t%I%\t%E% SMI\"\n\
381590Srgrimes\n\
3987701Smarkm#include <dtrace.h>\n\
4028370Scharnier\n\
411590Srgrimes/*ARGSUSED*/
421590Srgrimesconst char *\n\
4328370Scharnierdtrace_subrstr(dtrace_hdl_t *dtp, int subr)\n\
4487701Smarkm{\n\
451590Srgrimes	switch (subr) {"
461590Srgrimes
47241737Sednawk '
481590Srgrimes/^#define[ 	]*DIF_SUBR_/ && $2 != "DIF_SUBR_MAX" {
491590Srgrimes	printf("\tcase %s: return (\"%s\");\n", $2, tolower(substr($2, 10)));
501590Srgrimes}'
511590Srgrimes
521590Srgrimesecho ${BSDECHO} "\
531590Srgrimes	default: return (\"unknown\");\n\
541590Srgrimes	}\n\
551590Srgrimes}"
561590Srgrimes