diff options
author | Toomas Soome <tsoome@me.com> | 2021-09-12 13:43:58 +0300 |
---|---|---|
committer | Toomas Soome <tsoome@me.com> | 2022-08-30 19:09:40 +0300 |
commit | 2570281cf351044b6936651ce26dbe1f801dcbd8 (patch) | |
tree | 54957dc5692258b6308df50c8d0f73a334421091 | |
parent | 2ec63ffb3ec249bd7cb4523118c8437e6c6be335 (diff) | |
download | illumos-joyent-2570281cf351044b6936651ce26dbe1f801dcbd8.tar.gz |
14079 remove TNF
Reviewed by: Gordon Ross <gordon.w.ross@gmail.com>
Reviewed by: Igor Kozhukhov <igor@dilos.org>
Approved by: Garrett D'Amore <garrett@damore.org>
319 files changed, 114 insertions, 52233 deletions
diff --git a/usr/src/cmd/Makefile b/usr/src/cmd/Makefile index e455735102..309f70d598 100644 --- a/usr/src/cmd/Makefile +++ b/usr/src/cmd/Makefile @@ -420,7 +420,6 @@ COMMON_SUBDIRS= \ tic \ time \ tip \ - tnf \ touch \ tput \ tr \ @@ -714,7 +713,6 @@ MSGSUBDIRS= \ tar \ tbl \ time \ - tnf \ touch \ tput \ troff \ diff --git a/usr/src/cmd/devfsadm/misc_link.c b/usr/src/cmd/devfsadm/misc_link.c index 46ff016ab7..e5b21a5957 100644 --- a/usr/src/cmd/devfsadm/misc_link.c +++ b/usr/src/cmd/devfsadm/misc_link.c @@ -103,7 +103,7 @@ static devfsadm_create_t misc_cbt[] = { }, { "pseudo", "ddi_pseudo", "(^lockstat$)|(^SUNW,rtvc$)|(^vol$)|(^log$)|(^sy$)|" - "(^ksyms$)|(^clone$)|(^tl$)|(^tnf$)|(^kstat$)|(^mdesc$)|(^eeprom$)|" + "(^ksyms$)|(^clone$)|(^tl$)|(^kstat$)|(^mdesc$)|(^eeprom$)|" "(^ptsl$)|(^mm$)|(^wc$)|(^dump$)|(^cn$)|(^svvslo$)|(^ptm$)|" "(^ptc$)|(^openeepr$)|(^poll$)|(^sysmsg$)|(^random$)|(^trapstat$)|" "(^cryptoadm$)|(^crypto$)|(^pool$)|(^poolctl$)|(^bl$)|(^kmdb$)|" diff --git a/usr/src/cmd/mandoc/lib.in b/usr/src/cmd/mandoc/lib.in index 2baccff6c0..85a103cc16 100644 --- a/usr/src/cmd/mandoc/lib.in +++ b/usr/src/cmd/mandoc/lib.in @@ -74,7 +74,6 @@ LINE("libsocket", "Sockets Library (libsocket, \\-lsocket)") LINE("libstmf", "SCSI Target Mode Framework Library (libstmf, \\-lstmf)") LINE("libsysevet", "System Event Inteface Library (libsysevent, \\-lsysevent)") LINE("libtecla", "Interactive Command Line Input Library (libtecla, \\-ltecla)") -LINE("libtnfctl", "TNF Probe Control Library (libtnfctl, \\-ltnfctl)") LINE("libtsol", "Trusted Extensions Library (libtsol, \\-ltsol)") LINE("libumem", "Object-Caching Memory Allocation Library (libumem, \\-lumem") LINE("libutempter", "UTEMPTER Library (libutempter, \\-lutempter)") diff --git a/usr/src/cmd/tnf/Makefile b/usr/src/cmd/tnf/Makefile deleted file mode 100644 index 82c77e7fed..0000000000 --- a/usr/src/cmd/tnf/Makefile +++ /dev/null @@ -1,49 +0,0 @@ -# -# 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 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 -# -# -#ident "%Z%%M% %I% %E% SMI" -# -# Copyright (c) 1995, by Sun Microsystems, Inc. -# All rights reserved. -# -# cmd/tnf/Makefile -# - -SUBDIRS= prex \ - tnfdump \ - tnfxtract - -all := TARGET= all -install := TARGET= install -clean := TARGET= clean -clobber := TARGET= clobber -lint := TARGET= lint -_msg := TARGET= _msg - -.KEEP_STATE: - -all install clean clobber lint _msg: $(SUBDIRS) - -$(SUBDIRS): FRC - @cd $@; pwd; $(MAKE) $(TARGET) - -FRC: diff --git a/usr/src/cmd/tnf/prex/Makefile b/usr/src/cmd/tnf/prex/Makefile deleted file mode 100644 index 559aea06bf..0000000000 --- a/usr/src/cmd/tnf/prex/Makefile +++ /dev/null @@ -1,66 +0,0 @@ -# -# 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 -# -# -# ident "%Z%%M% %I% %E% SMI" -# -# Copyright 2006 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# -# cmd/tnf/prex/Makefile -# - -PROG= prex - -include ../../Makefile.cmd - -POFILE=prex.po -POFILES=cmd.po fcn.po list.po main.po new.po prbk.po source.po spec.po util.po - -SUBDIRS = $(MACH) -$(BUILD64)SUBDIRS += $(MACH64) - -all := TARGET = all -install := TARGET = install -clean := TARGET = clean -clobber := TARGET = clobber -lint := TARGET = lint - -.KEEP_STATE: - -all: $(SUBDIRS) - -clean clobber lint: $(SUBDIRS) - -install: $(SUBDIRS) - -$(RM) $(ROOTPROG) - -$(LN) $(ISAEXEC) $(ROOTPROG) - - -$(SUBDIRS): FRC - @cd $@; pwd; $(MAKE) $(TARGET) - -$(POFILE): $(POFILES) - rm -f $@ - cat $(POFILES) > $@ - -FRC: - -include ../../Makefile.targ diff --git a/usr/src/cmd/tnf/prex/Makefile.com b/usr/src/cmd/tnf/prex/Makefile.com deleted file mode 100644 index 35d9c42d0f..0000000000 --- a/usr/src/cmd/tnf/prex/Makefile.com +++ /dev/null @@ -1,116 +0,0 @@ -# -# 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 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 1989,2003 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# -# Copyright (c) 2018, Joyent, Inc. - -PROG= prex - -OBJS.c= source.o \ - main.o \ - util.o \ - expr.o \ - spec.o \ - set.o \ - queue.o \ - cmd.o \ - new.o \ - list.o \ - fcn.o \ - prbk.o \ - help.o - -OBJS.yl= prexgram.o \ - prexlex.o - -OBJS= $(OBJS.yl) $(OBJS.c) - -SRCS= $(OBJS.c:%.o=../%.c) $(OBJS.yl:%.o=%.c) - -SRCS.yl = $(OBJS.yl:%.o=%.c) -CLEANFILES = $(SRCS.yl) y.tab.h - -include ../../../Makefile.cmd - -POFILE= prex.po -POFILES= $(OBJS.c:%.o=%.po) - -#YFLAGS= -d -t -v -YFLAGS= -d -LFLAGS= -v -# FOR normal makefile, uncomment the next line -LDLIBS += -lgen -ltnfctl -lelf -lc - -CFLAGS += $(CCVERBOSE) -CERRWARN += -_gcc=-Wno-unused-label -CERRWARN += -_gcc=-Wno-unused-variable -CERRWARN += -_gcc=-Wno-parentheses -CERRWARN += $(CNOWARN_UNINIT) - -# not linted -SMATCH=off - -.KEEP_STATE: - -.PARALLEL: $(OBJS) - -all: $(PROG) - -#OBJS can be built in parallel after all .c (and y.tab.h) are properly built -$(PROG): $(SRCS.yl) .WAIT $(OBJS) - $(LINK.c) $(OBJS) -o $@ $(LDLIBS) - $(POST_PROCESS) - -#This also builds y.tab.h -prexgram.c: ../prexgram.y - $(YACC.y) ../prexgram.y - mv y.tab.c $@ - -prexlex.c: ../prexlex.l - $(RM) $@ - $(LEX.l) ../prexlex.l > $@ - -#Use %.c in priority to ../%.c for prexgram.c and prexlec.c -%.o: %.c - $(COMPILE.c) $< - -%.o: ../%.c - $(COMPILE.c) $< - - -$(ROOTBIN): - $(INS.dir) - -$(POFILE): $(POFILES) - $(RM) $@ - cat $(POFILES) > $@ - -clean: - $(RM) $(OBJS) $(CLEANFILES) - -lint: $(OBJS) - $(LINT.c) $(SRCS) - -include ../../../Makefile.targ diff --git a/usr/src/cmd/tnf/prex/amd64/Makefile b/usr/src/cmd/tnf/prex/amd64/Makefile deleted file mode 100644 index f5c1bee5a7..0000000000 --- a/usr/src/cmd/tnf/prex/amd64/Makefile +++ /dev/null @@ -1,35 +0,0 @@ -# -# 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 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 2004 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# -# ident "%Z%%M% %I% %E% SMI" -# - -include ../Makefile.com -include ../../../Makefile.cmd.64 -CFLAGS64 += -I.. -I. -LINTFLAGS64 += -I.. -I. -prexgram.o prexlex.o := CCVERBOSE= - -install: all $(ROOTPROG64) diff --git a/usr/src/cmd/tnf/prex/cmd.c b/usr/src/cmd/tnf/prex/cmd.c deleted file mode 100644 index 9cc6519dde..0000000000 --- a/usr/src/cmd/tnf/prex/cmd.c +++ /dev/null @@ -1,296 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -/* - * Includes - */ - -#ifndef DEBUG -#define NDEBUG 1 -#endif - -#include <stdio.h> -#include <stdlib.h> -#include <assert.h> -#include <libintl.h> -#include "cmd.h" -#include "set.h" -#include "fcn.h" -#include "new.h" -#include "source.h" - - -/* - * Globals - */ - -static queue_node_t g_cmdlist = { - &g_cmdlist, -&g_cmdlist}; - - -/* - * cmd_set() - creates a cmd using a named set and adds it to the global list - */ - -cmd_t * -cmd_set(char *setname_p, cmd_kind_t kind, char *fcnname_p) -{ - cmd_t *new_p; - set_t *set_p; - - set_p = set_find(setname_p); - if (!set_p) { - semantic_err(gettext("no set named \"$%s\""), setname_p); - return (NULL); - } - if (kind == CMD_CONNECT && !fcn_find(fcnname_p)) { - semantic_err(gettext("no function named \"&%s\""), fcnname_p); - return (NULL); - } - new_p = new(cmd_t); - queue_init(&new_p->qn); -#ifdef LATEBINDSETS - new_p->isnamed = B_TRUE; - new_p->expr.setname_p = setname_p; -#else - new_p->isnamed = B_FALSE; - new_p->expr.expr_p = expr_dup(set_p->exprlist_p); -#endif - new_p->isnew = B_TRUE; - new_p->kind = kind; - new_p->fcnname_p = fcnname_p; - - (void) queue_append(&g_cmdlist, &new_p->qn); - return (new_p); - -} /* end cmd_set */ - - -/* - * cmd_expr() - creates a cmd using a set and adds it to the global list - */ - -cmd_t * -cmd_expr(expr_t * expr_p, cmd_kind_t kind, char *fcnname_p) -{ - cmd_t *new_p; - - if (kind == CMD_CONNECT && !fcn_find(fcnname_p)) { - semantic_err(gettext("no function named \"&%s\""), fcnname_p); - return (NULL); - } - new_p = new(cmd_t); - queue_init(&new_p->qn); - new_p->isnamed = B_FALSE; - new_p->expr.expr_p = expr_p; - new_p->isnew = B_TRUE; - new_p->kind = kind; - new_p->fcnname_p = fcnname_p; - - (void) queue_append(&g_cmdlist, &new_p->qn); - return (new_p); - -} /* end cmd */ - - -#if 0 -/* - * cmd_destroy() - */ - -static void -cmd_destroy(cmd_t * cmd_p) -{ - if (!cmd_p) - return; - - if (!queue_isempty(&cmd_p->qn)) - (void) queue_remove(&cmd_p->qn); - - if (!cmd_p->isnamed) - expr_destroy(cmd_p->expr.expr_p); - - free(cmd_p); - -} /* end cmd_destroy */ -#endif - - -/* - * cmd_list() - pretty prints the global cmdlist - */ - -void -cmd_list(void) -{ - cmd_t *cmd_p; - int i = 0; - char *str_p; - - cmd_p = (cmd_t *) & g_cmdlist; - while ((cmd_p = (cmd_t *) queue_next(&g_cmdlist, &cmd_p->qn))) { - switch (cmd_p->kind) { - case CMD_ENABLE: - str_p = "enable "; - break; - case CMD_DISABLE: - str_p = "disable"; - break; - case CMD_CONNECT: - str_p = "connect"; - break; - case CMD_CLEAR: - str_p = "clear "; - break; - case CMD_TRACE: - str_p = "trace "; - break; - case CMD_UNTRACE: - str_p = "untrace"; - break; - default: - str_p = "???????"; - break; - } - (void) printf("[%d] %s ", i++, str_p); - - if (cmd_p->kind == CMD_CONNECT) { - (void) printf("&%s ", cmd_p->fcnname_p); - } - if (!cmd_p->isnamed) { - expr_print(stdout, cmd_p->expr.expr_p); - } - - (void) printf("\n"); - } - -} /* end cmd_list */ - - -/* - * cmd_traverse() - calls the suppied traversal function on each command. - */ - -tnfctl_errcode_t -cmd_traverse(cmd_traverse_func_t percmdfunc, void *calldata_p) -{ - cmd_t *cmd_p; - tnfctl_errcode_t err = TNFCTL_ERR_NONE; - - cmd_p = (cmd_t *) & g_cmdlist; - while ((cmd_p = (cmd_t *) queue_next(&g_cmdlist, &cmd_p->qn))) { - expr_t *expr_p; - fcn_t *fcn_p; - - if (!cmd_p->isnamed) { - expr_p = cmd_p->expr.expr_p; - } - - if (cmd_p->kind == CMD_CONNECT) { - fcn_p = fcn_find(cmd_p->fcnname_p); - assert(fcn_p); - } - else - fcn_p = NULL; - - err = (*percmdfunc) (expr_p, - cmd_p->kind, - fcn_p, cmd_p->isnew, calldata_p); - if (err) - return (err); - } - return (err); -} /* end cmd_traverse */ - - -/* - * cmd_traverse() - calls the suppied traversal function on each command. - */ - -tnfctl_errcode_t -cmd_callback(cmd_t *cmd_p, cmd_traverse_func_t percmdfunc, void *calldata_p) -{ - tnfctl_errcode_t err = TNFCTL_ERR_NONE; - expr_t *expr_p; - fcn_t *fcn_p; - - if (!cmd_p->isnamed) { - expr_p = cmd_p->expr.expr_p; - } - - if (cmd_p->kind == CMD_CONNECT) { - fcn_p = fcn_find(cmd_p->fcnname_p); - assert(fcn_p); - } - else - fcn_p = NULL; - - err = (*percmdfunc) (expr_p, cmd_p->kind, fcn_p, cmd_p->isnew, - calldata_p); - - return (err); -} - -#ifdef NOTNEEDED -/* - * cmd_mark() - mark all of the commands in the global list as old - */ - -void -cmd_mark(void) -{ - cmd_t *cmd_p; - - cmd_p = (cmd_t *) & g_cmdlist; - while ((cmd_p = (cmd_t *) queue_next(&g_cmdlist, &cmd_p->qn))) { - cmd_p->isnew = B_FALSE; - } - -} /* end cmd_mark */ - -/* - * cmd_delete() - - */ - -void -cmd_delete(int cmdnum) -{ - cmd_t *cmd_p; - int i = 0; - - cmd_p = (cmd_t *) & g_cmdlist; - while ((cmd_p = (cmd_t *) queue_next(&g_cmdlist, &cmd_p->qn))) { - if (cmdnum == i) { - cmd_destroy(cmd_p); - return; - } - i++; - } - -} /* end cmd_delete */ -#endif diff --git a/usr/src/cmd/tnf/prex/cmd.h b/usr/src/cmd/tnf/prex/cmd.h deleted file mode 100644 index 8e67544b93..0000000000 --- a/usr/src/cmd/tnf/prex/cmd.h +++ /dev/null @@ -1,102 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#ifndef _CMD_H -#define _CMD_H - -#pragma ident "%Z%%M% %I% %E% SMI" - -/* - * Includes - */ - -#include <sys/types.h> -#include "queue.h" -#include "expr.h" -#include "set.h" -#include "fcn.h" - -#include <tnf/tnfctl.h> - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Typedefs - */ - -typedef enum cmd_kind { - CMD_ENABLE, - CMD_DISABLE, - CMD_CONNECT, - CMD_CLEAR, - CMD_TRACE, - CMD_UNTRACE -} cmd_kind_t; - -typedef struct cmd { - queue_node_t qn; - boolean_t isnamed; - boolean_t isnew; - union { -#ifdef LATEBINDSETS - char *setname_p; -#endif - expr_t *expr_p; - } expr; - char *fcnname_p; - cmd_kind_t kind; -} cmd_t; - -typedef -tnfctl_errcode_t (*cmd_traverse_func_t) ( - expr_t * expr_p, - cmd_kind_t kind, - fcn_t * fcn_p, - boolean_t isnew, - void *calldata_p); - - -/* - * Declarations - */ - -cmd_t *cmd_set(char *setname_p, cmd_kind_t kind, char *fcnname_p); -cmd_t *cmd_expr(expr_t * expr_p, cmd_kind_t kind, char *fcnname_p); -void cmd_list(void); -#if 0 -void cmd_mark(void); -void cmd_delete(int cmdnum); -#endif -tnfctl_errcode_t cmd_traverse(cmd_traverse_func_t percmdfunc, void *calldata_p); -tnfctl_errcode_t cmd_callback(cmd_t *cmd, cmd_traverse_func_t percmdfunc, - void *calldata_p); - -#ifdef __cplusplus -} -#endif - -#endif /* _CMD_H */ diff --git a/usr/src/cmd/tnf/prex/dbg.h b/usr/src/cmd/tnf/prex/dbg.h deleted file mode 100644 index ae9f6831db..0000000000 --- a/usr/src/cmd/tnf/prex/dbg.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#ifndef _DBG_H -#define _DBG_H - -#pragma ident "%Z%%M% %I% %E% SMI" - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef DEBUG -#define DBG(x) (x) -#else -#define DBG(x) -#endif - -#if defined(DEBUG) || defined(lint) -#include <stdio.h> -extern int __prb_verbose; -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* _DBG_H */ diff --git a/usr/src/cmd/tnf/prex/expr.c b/usr/src/cmd/tnf/prex/expr.c deleted file mode 100644 index 46c14f621f..0000000000 --- a/usr/src/cmd/tnf/prex/expr.c +++ /dev/null @@ -1,262 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -/* - * Includes - */ - -/* we need to define this to get strtok_r from string.h */ -/* SEEMS LIKE A BUG TO ME */ -#define _REENTRANT - -#ifndef DEBUG -#define NDEBUG 1 -#endif - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <libgen.h> -#include <assert.h> -#include "spec.h" -#include "expr.h" -#include "new.h" - - -/* - * Typedefs - */ - -typedef enum { - MATCH_NONE = 0, - MATCH_FALSE, - MATCH_TRUE - - -} match_t; - - -/* - * Declarations - */ - -static boolean_t matchattrs(expr_t * expr_p, const char *attrs); -static void matchvals(spec_t * spec_p, char *attrstr, - char *valstr, void *calldatap); -static void matched(spec_t * spec_p, char *valstr, void *calldatap); - - -/* ---------------------------------------------------------------- */ -/* ----------------------- Public Functions ----------------------- */ -/* ---------------------------------------------------------------- */ - -/* - * expr() - builds an expr - */ - -expr_t * -expr(spec_t * left_p, - spec_t * right_p) -{ - expr_t *new_p; - - new_p = new(expr_t); - queue_init(&new_p->qn); - new_p->left_p = left_p; - new_p->right_p = right_p; - - return (new_p); - -} /* end expr */ - - -/* - * expr_dup() - duplicates an expression list - */ - -expr_t * -expr_dup(expr_t * list_p) -{ - expr_t *expr_p; - expr_t *head_p; - - if (!list_p) - return (NULL); - - /* copy the first node */ - head_p = expr(spec_dup(list_p->left_p), - spec_dup(list_p->right_p)); - - /* append each additional node */ - expr_p = list_p; - while (expr_p = (expr_t *) queue_next(&list_p->qn, &expr_p->qn)) { - expr_t *new_p; - - new_p = expr(spec_dup(expr_p->left_p), - spec_dup(expr_p->right_p)); - (void) queue_append(&head_p->qn, &new_p->qn); - } - - return (head_p); - -} /* end expr_dup */ - - -/* - * expr_destroy() - destroys an expression list - */ - -void -expr_destroy(expr_t * list_p) -{ - expr_t *expr_p; - - while (expr_p = (expr_t *) queue_next(&list_p->qn, &list_p->qn)) { - (void) queue_remove(&expr_p->qn); - - if (expr_p->left_p) - spec_destroy(expr_p->left_p); - if (expr_p->right_p) - spec_destroy(expr_p->right_p); - free(expr_p); - } - - if (list_p->left_p) - spec_destroy(list_p->left_p); - if (list_p->right_p) - spec_destroy(list_p->right_p); - free(list_p); - -} /* end expr_destroy */ - - -/* - * expr_list() - append a expr_t to a list - */ - -expr_t * -expr_list(expr_t * h, - expr_t * f) -{ - /* queue append handles the NULL cases OK */ - return ((expr_t *) queue_append(&h->qn, &f->qn)); - -} /* end expr_list */ - - -/* - * expr_print() - pretty prints an expr list - */ - -void -expr_print(FILE * stream, - expr_t * list_p) -{ - expr_t *expr_p = NULL; - - while ((expr_p = (expr_t *) queue_next(&list_p->qn, &expr_p->qn))) { - spec_print(stream, expr_p->left_p); - (void) fprintf(stream, "="); - spec_print(stream, expr_p->right_p); - (void) fprintf(stream, " "); - } - -} /* end expr_print */ - - -/* - * expr_match() - figures out whether a probe matches in an expression list - */ - -boolean_t -expr_match(expr_t * list_p, - const char *attrs) -{ - expr_t *expr_p = NULL; - - while ((expr_p = (expr_t *) queue_next(&list_p->qn, &expr_p->qn))) { - if (matchattrs(expr_p, attrs)) - return (B_TRUE); - } - - return (B_FALSE); - -} /* end expr_match */ - - -/* ---------------------------------------------------------------- */ -/* ----------------------- Private Functions ---------------------- */ -/* ---------------------------------------------------------------- */ - -typedef struct matchargs { - spec_t *spec_p; - boolean_t match; - -} matchargs_t; - -static boolean_t -matchattrs(expr_t * expr_p, - const char *attrs) -{ - matchargs_t args; - - args.spec_p = expr_p->right_p; - args.match = B_FALSE; - - spec_attrtrav(expr_p->left_p, - (char *) attrs, matchvals, (void *) &args); - - return (args.match); - -} /* end matchattrs */ - - -/*ARGSUSED*/ -static void -matchvals(spec_t * spec_p, - char *attrstr, - char *valstr, - void *calldatap) -{ - matchargs_t *args_p = (matchargs_t *) calldatap; - - spec_valtrav(args_p->spec_p, valstr, matched, calldatap); - -} /* matchvals */ - - -/*ARGSUSED*/ -static void -matched(spec_t * spec_p, - char *valstr, - void *calldatap) -{ - matchargs_t *args_p = (matchargs_t *) calldatap; - - args_p->match = B_TRUE; - -} /* end matched */ diff --git a/usr/src/cmd/tnf/prex/expr.h b/usr/src/cmd/tnf/prex/expr.h deleted file mode 100644 index 96f84af525..0000000000 --- a/usr/src/cmd/tnf/prex/expr.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#ifndef _EXPR_H -#define _EXPR_H - -#pragma ident "%Z%%M% %I% %E% SMI" - -/* - * Includes - */ - -#include <stdio.h> - -#include "queue.h" -#include "spec.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Typedefs - */ - -typedef struct expr { - queue_node_t qn; - spec_t *left_p; - spec_t *right_p; - -} expr_t; - - -/* - * Declarations - */ - -expr_t * expr(spec_t * left_p, spec_t * right_p); -void expr_destroy(expr_t * list_p); -expr_t * expr_list(expr_t * list_p, expr_t * item_p); -void expr_print(FILE * stream, expr_t * list_p); -boolean_t expr_match(expr_t * expr_p, const char *attrs); -expr_t * expr_dup(expr_t * list_p); - -#ifdef __cplusplus -} -#endif - -#endif /* _EXPR_H */ diff --git a/usr/src/cmd/tnf/prex/fcn.c b/usr/src/cmd/tnf/prex/fcn.c deleted file mode 100644 index 527bc5fc20..0000000000 --- a/usr/src/cmd/tnf/prex/fcn.c +++ /dev/null @@ -1,213 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -/* - * Includes - */ - -#include <stdlib.h> -#include <string.h> -#include <libintl.h> -#include "queue.h" -#include "set.h" -#include "fcn.h" -#include "new.h" -#include "source.h" - - -/* - * Globals - */ - -static queue_node_t g_fcnlist = { - &g_fcnlist, -&g_fcnlist}; - -/* - * Forward Declarations - */ - -static void fcn_destroy(fcn_t * fcn_p); -static void fcn_print(FILE * stream, fcn_t * fcn_p); - - -/* - * fcn() - builds a function block and inserts it on the global list. - */ - -#define NSYMS 1 - -void -fcn(char *name_p, char *entry_name_p) -{ - fcn_t *new_p; - fcn_t *old_p; - - /* does this setname exist already? */ - old_p = fcn_find(name_p); - if (old_p) - fcn_destroy(old_p); - - /* create a new set */ - new_p = new(fcn_t); - queue_init(&new_p->qn); - new_p->name_p = name_p; - new_p->entry_name_p = entry_name_p; - -#ifdef OLD - /* - * allocate a target function block, and stuff the init and fini - * addrs - */ - prbstat = prb_targmem_alloc(g_procfd, sizeof (probe_funcs_t), - &new_p->funcs_p); - if (prbstat) { - semantic_err(gettext("problem allocating target memory")); - goto Error; - } - prbstat = prb_proc_write(g_procfd, new_p->funcs_p, - &new_p->funcs, sizeof (probe_funcs_t)); - if (prbstat) { - semantic_err(gettext( - "setup problem, initial/final " - "funcs in target memory")); - goto Error; - } -#endif - - /* append the new set to the global list */ - (void) queue_append(&g_fcnlist, &new_p->qn); - - return; - -Error: - if (new_p) - free(new_p); - return; - -} /* end fcn */ - - -/* - * fcn_destroy() - destroys a fcn and related resources - */ - -static void -fcn_destroy(fcn_t * fcn_p) -{ - if (!fcn_p) - return; - - /* remove ourselves from any list */ - if (!queue_isempty(&fcn_p->qn)) - (void) queue_remove(&fcn_p->qn); - - if (fcn_p->name_p) - free(fcn_p->name_p); - if (fcn_p->entry_name_p) - free(fcn_p->entry_name_p); - - free(fcn_p); - -} /* end fcn_destroy */ - - -/* - * fcn_list() - pretty prints the global fcnlist - */ - -void -fcn_list(void) -{ - fcn_t *fcn_p; - - fcn_p = (fcn_t *) & g_fcnlist; - while ((fcn_p = (fcn_t *) queue_next(&g_fcnlist, &fcn_p->qn))) { - fcn_print(stdout, fcn_p); - } - -} /* end fcn_list */ - - -/* - * fcn_print() - pretty prints a fcn - */ - -static void -fcn_print(FILE * stream, fcn_t * fcn_p) -{ - if (!fcn_p) - return; - - (void) fprintf(stream, "&%-8s %-24s\n", - fcn_p->name_p, fcn_p->entry_name_p); - -} /* end fcn_print */ - - -/* - * fcn_findname() - find the created name, given an entry name - */ - -char * -fcn_findname(const char * const entry_p) -{ - fcn_t *fcn_p; - - if (!entry_p) - return (NULL); - - fcn_p = (fcn_t *) & g_fcnlist; - while ((fcn_p = (fcn_t *) queue_next(&g_fcnlist, &fcn_p->qn))) - if (strcmp(entry_p, fcn_p->entry_name_p) == 0) - return (fcn_p->name_p); - - return (NULL); - -} /* end fcn_findname */ - - -/* - * fcn_find() - finds a fcn by name - */ - -fcn_t * -fcn_find(char *fcnname_p) -{ - fcn_t *fcn_p; - - if (!fcnname_p) - return (NULL); - - fcn_p = (fcn_t *) & g_fcnlist; - while ((fcn_p = (fcn_t *) queue_next(&g_fcnlist, &fcn_p->qn))) - if (strcmp(fcnname_p, fcn_p->name_p) == 0) - return (fcn_p); - - return (NULL); - -} /* end set_find */ diff --git a/usr/src/cmd/tnf/prex/fcn.h b/usr/src/cmd/tnf/prex/fcn.h deleted file mode 100644 index dcf4136ec3..0000000000 --- a/usr/src/cmd/tnf/prex/fcn.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#ifndef _FCN_H -#define _FCN_H - -#pragma ident "%Z%%M% %I% %E% SMI" - -/* - * Includes - */ - -#include "queue.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Typedefs - */ - -typedef struct fcn { - queue_node_t qn; - char *name_p; - char *entry_name_p; -} fcn_t; - - -/* - * Declarations - */ - -void fcn(char *name_p, char *func_entry_p); -void fcn_list(void); -fcn_t *fcn_find(char *name_p); -char *fcn_findname(const char * const entry_p); - -#ifdef __cplusplus -} -#endif - -#endif /* _FCN_H */ diff --git a/usr/src/cmd/tnf/prex/help.c b/usr/src/cmd/tnf/prex/help.c deleted file mode 100644 index 33ca6c8821..0000000000 --- a/usr/src/cmd/tnf/prex/help.c +++ /dev/null @@ -1,624 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#include <stdio.h> -#include <strings.h> -#include "expr.h" -#include "y.tab.h" - -#define NUMHELPTOPICS 6 -static char *helptopics[NUMHELPTOPICS] = { - "intro", "functions", "kernel_mode", "probe_spec", "processes", - "set_spec" }; -static char *helptopicstrings[NUMHELPTOPICS] = { -/* help intro */ -"Introduction to prex\n" -"\n" -"prex is used to control probes in a target process, or in the kernel.\n" -"If you are reading this help text, you have sucessfully invoked prex,\n" -"by either connecting to an existing process (prex -p), a new\n" -"process (prex myprogram), or to the kernel (prex -k).\n" -"\n" -"Most often, the user will want to enable some probes in the target,\n" -"continue the target - either to completion, or until the target is\n" -"interrupted - and then exit from prex to perform analysis on the resulting\n" -"tracefile. An ascii dump of the tracefile can be obtained using the\n" -"tnfdump(1) command.\n" -"\n" -"The tracefile can be found in /tmp/trace-<pid> by default, or in a location\n" -"of your choice, if you specify the -o option when you invoke prex.\n" -"You can query the name of the current trace file by using the command.\n" -"list tracefile.\n" -"\n" -"Upon invocation, prex reads commands from the files ~/.prexrc and\n" -"./.prexrc (in that order). The \"source\" command may be used to take\n" -"commands from an arbitrary file or set of files.\n" -"\n" -"Help is available for a variety of topics, and for each prex command.\n" -"Type help with no arguments for a list of available help topics.\n" -"\n" -"end of help for topic intro\n", -/* help functions */ -"Probe Functions\n" -"\n" -"Note - probe functions are not available from kernel mode\n" -"\n" -"It is possible to use prex to connect functions to probe points, such that\n" -"the function is invoked each time a given probe point is hit. Currently,\n" -"the only function available from prex is the &debug function, which prints\n" -"out the arguments sent in to the probe, as well as the value (if any)\n" -"associated with the sunw%debug attribute in the detail field.\n" -"\n" -"Relevant commands:\n" -" list fcns # list the defined probe functions\n" -" connect &debug name=myprobe # attach probe &debug to probe myprobe\n" -" connect &debug $myset # attach probe &debug to probes in $myset\n" -" clear name=myprobe # disconnect probe functions from myprobe\n" -" clear $myset # disconnect probe functions from $myset\n" -"\n" -"end of help for topic functions\n", -/* help kernel_mode */ -"Controlling Kernel Probes\n" -"\n" -"The Solaris kernel is instrumented with a small number of strategically\n" -"placed probes, documented in tnf_kernel_probes(5). The superuser can\n" -"control these probes by running prex with the \"-k\" option.\n" -"\n" -"In kernel mode, trace output is written to an in-core buffer, rather\n" -"than to a file on disk. This buffer can be extracted with the tnfxtract(1)\n" -"commmand. This buffer must be set up before tracing can begin, through the\n" -"use of the \"buffer alloc\" command. After kernel tracing is complete (and\n" -"after the buffer has been extracted), the buffer can be deallocated from\n" -"prex using the \"buffer dealloc\" command.\n" -"\n" -"As in user mode, kernel probe control is accomplished using the commands\n" -"\"trace\", \"untrace\", \"enable\", and \"disable\". Additionally, in\n" -"kernel mode, a \"master switch\" is provided to turn all tracing activity\n" -"on or off. This switch is toggled using the commands \"ktrace on\" and\n" -"\"ktrace off\". Unlike user mode, where the target is stopped while\n" -"tracing paramaters are manipulated from prex, the kernel does not stop\n" -"running during a tracing session. Using the \"ktrace\" command, one can\n" -"set up all tracing parameters in advance of a session, without actually\n" -"writing trace records until a \"ktrace on\" command is given.\n" -"\n" -"Kernel mode also provides the ability to limit tracing to those kernel\n" -"probes hit on behalf of a specific user process. The pfilter command\n" -"is provided to toggle process filtering on or off, and to specify the\n" -"set of processes that comprise the filter. If pid 0 is a member of the\n" -"filter list, then any threads not associated with a process are included.\n" -"\n" -"Note that after a kernel tracing session, all tracing parameters are left\n" -"as-is. One should re-enter prex to disable and untrace probes, turn off\n" -"process filtering, and deallocate the in-core trace buffer.\n" -"\n" -"Relevant Commands:\n" -" buffer alloc 2m # allocate a 2M in-core buffer\n" -" enable $all # enable all kernel probes\n" -" trace $all # trace all kernel probes\n" -" ktrace on # turn on kernel tracing\n" -" pfilter add 1234 # add pid 1234 to the filter list\n" -" pfilter on # turn on process filtering\n" -" ktrace off # turn off kernel tracing\n" -"Also see tnfxtract(1), which is used to extract the in-core trace buffer\n" -"to an on-disk tracefile.\n" -"\n" -"end of help for topic kernel_mode\n", -/* help probe_spec */ -"Probe Specification\n" -"\n" -"Many prex commands operate on probes or sets of probes. Probes are\n" -"specified by a list of space-separated selectors of the form:\n" -" <attribute>=<value>\n" -"If the \"" -"<attribute>=\" is omitted, the attribute defaults to \"keys=\".\n" -"The \"" -"<value>\" can be either a string or an ed(1) regular expression\n" -"enclosed in slashes. Regular expressions in prex are unanchored, meaning\n" -"that any value that contains the given regex as a substring is a valid\n" -"match, regardless of position. To anchor a regular expression, use \"^\"\n" -"to match the beginning of a line, or \"$\" to match the end of a line.\n" - -"If a list of selectors is specified, an OR operation is applied - the\n" -"resulting probe_spec includes probes that match any of the selectors.\n" -"See the prex(1) man page for a complete specification of the accepted\n" -"grammar.\n" -"\n" -"The \"list\" command is used to view available probes in the target,\n" -"and to display their attributes. The \"trace\" and \"untrace\" commands\n" -"determine whether a probe will write a trace record when hit. The\n" -"\"enable\" and \"disable\" commands indicate whether a probe will perform\n" -"any action (such as a calling a connected function or creating a trace\n" -"record) when hit. Normally, a probe is enabled and traced for tracing,\n" -"and disabled and untraced otherwise. It is possible to enable a probe\n" -"with tracing off to get debug output without writing trace records.\n" -"\n" -"Relevant Commands:\n" -" list probes $all # list probes in set $all (all probes)\n" -" list probes file=test.c # list probes with a specific attribute\n" -" list 'file' probes $all # list the file attribute in all probes\n" -" list probes name=/^thr/ # list probes whose name attribute matches\n" -" # the given regular expression\n" -" list probes name=/^thr/ keys=vm # list probes matching either selector\n" -" enable name=/^thr/ # enable probes whose name matches this regex\n" -" trace $all # trace all probes\n" -" untrace $myset # untrace probes in set $myset\n" -"\n" -"end of help for topic probe_spec\n", -/* help processes */ -"Controlling Processes with prex\n" -"\n" -"Prex is used to control probes in a given process, or in the kernel.\n" -"The process which prex is to control is identified as an argument when\n" -"prex is invoked. If the \"-p" -" <pid>\" switch is used, prex connects to the\n" -"specified process. Otherwise prex exec's the command supplied at the\n" -"end of its argument list. In either case, prex stops the target process\n" -"immediately so that the user may set up probe control.\n" -"\n" -"Once probe control is set up (typically using the \"enable\" and \"trace\"\n" -"commands), the process is continued using the \"continue\" command. Prex\n" -"remains attached to the target, and the user can force the target to\n" -"stop again by typing control-C, at which time additional probe control\n" -"directives may be given.\n" -"\n" -"Upon quitting from prex, the target process is normally resumed if prex\n" -"attached to it, or killed if prex invoked it. An optional argument may\n" -"be given with the \"quit\" command to explicitly specify whether to kill\n" -"the target, continue it, or leave it suspended.\n" -"\n" -"If the target forks, any probe that the child encounters will be logged to\n" -"the same trace file as the parent. If the child calls exec, it will no\n" -"longer be traced.\n" -"\n" -"In kernel mode (prex -k), process filtering may be enabled, to limit\n" -"tracing to those kernel probes hit on behalf of a specific process or\n" -"set of processes. Kernel-mode process filtering is controlled using\n" -"the \"pfilter\" command.\n" -"\n" -"\n" -"Relevant Commands:\n" -" continue # continue target (user mode only)\n" -" Control-C # stop target (user mode only)\n" -" quit resume # quit prex, continue target\n" -" quit suspend # quit prex, suspend target\n" -" quit kill # quit prex, kill target\n" -" quit # quit prex, default action\n" -"# Note: pfilter commands apply only to kernel mode\n" -" pfilter # show pfilter status\n" -" pfilter on # turn on process filter mode\n" -" pfilter off # turn off process filter mode\n" -" pfilter add 1234 # add to process filter pid list\n" -" pfilter delete 1234 # delete from process filter pid list\n" -"\n" -"end of help for topic processes\n", -/* help set_spec */ -"Specifying Probe Sets\n" -"\n" -"Prex provides the ability to define named sets of probes to simplify\n" -"commands operating on multiple probes. The set \"$all\" is predefined,\n" -"as the set of all probes in the target. A set is defined using the\n" -"\"create\" command, and can be used as an argument to the \"list\",\n" -"\"enable\", \"disable\", \"trace\", \"untrace\", \"connect\" and\n" -"\"clear\" commands.\n" -"\n" -"Relevant Commands:\n" -" create $myset name=/^thr/ # create a set\n" -" list probes $myset # list probes in a set\n" -" list sets # list defined sets\n" -" enable $myset # enable a set of probes\n" -" trace $myset # trace a set of probes\n" -"\n" -"end of help for topic set_spec\n" -}; - -static char *helpstr_continue = -"\n" -"Usage: continue\n" -"\n" -"\"continue\" is used to resume execution of the target process. This\n" -"command is not available in kernel mode, since the kernel is never stopped.\n" -"\n" -"end of help for cmd continue\n"; -static char *helpstr_disable = -"\n" -"Usage: disable <probe_spec>|<set_spec>\n" -"\n" -"\"disable\" is used to to turn off all tracing activity associated with a\n" -"probe or a set of probes.\n" -"\n" -"End of help for cmd disable\n"; -static char *helpstr_enable= -"\n" -"Usage: enable <probe_spec>|<set_spec>\n" -"\n" -"\"enable\" is used to specify that any activity associated with the probe\n" -"or probes will be performed when the probe is hit. This includes connected\n" -"probe functions as well as the generation of trace records. Note that in\n" -"order for a probe to generate a trace record, it must be \"traced\" as well\n" -"as enabled.\n" -"\n" -"End of help for cmd enable\n"; -static char *helpstr_help = -"\n" -"Usage: help [<cmd>|<topic>]\n" -"\n" -"\"help\" lists all available help topics when run without any arguments.\n" -"If a valid topic or command-name is supplied as an argument, help text for\n" -"the topic or command is displayed.\n" -"\n" -"End of help for cmd help\n"; -static char *helpstr_list = -"\n" -"Usage: list probes <probe_spec>|<set_spec> \n" -" list <attrs> probes <probe_spec>|<set_spec>\n" -" list sets\n" -" list fcns\n" -" list history\n" -" list tracefile\n" -"\n" -"\"list\" displays information about currently defined probes, sets, and\n" -"probe functions. When listing probes, one can limit the output to a\n" -"desired set of attributes by specifying an attribute list as a set of\n" -"strings. If an attribute is also a reserved word (such as \"trace\", it\n" -"must be enclosed in single quotes. For example:\n" -"\n" -" list file 'trace' probes $all\n" -"\n" -"\"list\" history lists the probe control commands history, and\n" -"\"list\" tracefile displays the current trace file name.\n" -"\n" -"End of help for cmd list\n"; -static char *helpstr_quit = -"\n" -"Usage: quit\n" -" quit kill\n" -" quit resume\n" -" quit suspend\n" -"\n" -"The \"quit\" command exits prex, leaving the target in a state specified\n" -"by the user, or taking a default action if no instructions are specified.\n" -"An optional argument may be used to indicated that the target should be\n" -"killed, resumed, or left suspended. If no argument is supplied, then\n" -"prex's default behavior is to resume a process to which it had attached,\n" -"and to kill a process which it had invoked.\n" -"\n" -"End of help for cmd quit\n"; -static char *helpstr_source = -"\n" -"Usage: source <filename>\n" -"\n" -"The \"source\" command is used to invoke a set of prex commands stored in\n" -"a file. A sourced file may in turn source other files. The files\n" -"~/.prexrc and ./.prexrc are sourced automatically (in that order) when prex\n" -"is invoked, and may be used to store commonly used probe and set\n" -"specifications, or probe control directives. Commands in sourced files\n" -"may override the effects of commands in previously sourced files.\n" -"\n" -"End of help for cmd source\n"; -static char *helpstr_trace = -"\n" -"Usage: trace <probe_spec>|<set_spec>\n" -"\n" -"\"trace\" is used to turn on tracing for the specified probe or probes.\n" -"A \"traced\" probe that is also \"enabled\" will generate a trace record\n" -"when it is hit.\n" -"\n" -"End of help for cmd trace\n"; -static char *helpstr_untrace = -"\n" -"Usage: untrace <probe_spec>|<set_spec>\n" -"\n" -"\"untrace\" turns tracing off for the specified probe or probes. A probe\n" -"will not generate a trace record when it is not traced, although connected\n" -"probe functions will still be invoked as long as a probe is \"enabled\".\n" -"\n" -"End of help for cmd untrace\n"; -static char *helpstr_buffer = -"\n" -"Usage: buffer alloc <size>\n" -" buffer dealloc\n" -"\n" -"Note: Kernel Mode Only\n" -"\n" -"\"buffer\" allocates or deallocates the in-core buffer used to hold\n" -"kernel trace records. Size can be specified in kilobytes or megabytes,\n" -"by appending the character 'k' or 'm' to a numeric value (e.g. \"2m\").\n" -"A buffer must be allocated prior to a kernel tracing session. Once\n" -"allocated, the buffer remains usable until deallocated, even through\n" -"multiple invocations of prex.\n" -"\n" -"Before the buffer is deallocated, data may be extracted to an on-disk\n" -"tracefile using tnfxtract(1).\n" -"\n" -"End of help for cmd buffer\n"; -static char *helpstr_ktrace = -"\n" -"Usage: ktrace on\n" -" ktrace off\n" -"\n" -"Note: Kernel Mode Only\n" -"\n" -"\"ktrace\" toggles the master switch that indicates whether kernel\n" -"tracing is active or inactive. Since the kernel cannot be stopped while\n" -"a tracing experiment is set up, \"ktrace\" is provided so that tracing\n" -"can be set up as desired before any trace records are generated\n" -"\n" -"End of help for cmd ktrace\n"; -static char *helpstr_pfilter = -"\n" -"Usage: pfilter\n" -" pfilter on\n" -" pfilter off\n" -" pfilter add <pidlist>\n" -" pfilter delete <pidlist>\n" -"\n" -"Note: Kernel Mode Only\n" -"\n" -"\"pfilter\" controls process filtering by toggling process-filter mode,\n" -"and maintaining a list of process id's on which to filter. When process\n" -"filtering mode is on, tracing is limited to the kernel events hit on behalf\n" -"of the processes in the pid list. Process id 0 is used to represent all\n" -"threads not associated with a process.\n" - -"When run without arguments, \"pfilter\" displays the current process-filter\n" -"mode and pid list. A process filter pid list can be maintained whether\n" -"or not process filter mode is currently active.\n" -"\n" -"A process must exist in order to be added to the pid list, and the pid list\n" -"is automatically updated to delete any processes that no longer exist. If\n" -"the pid list becomes empty while process filtering is on, prex issues a\n" -"warning. Process filtering mode is persistent between invocations of prex\n" -"so it should be turned off manually when a tracing experiment is complete.\n" -"\n" -"End of help for cmd pfilter\n"; -static char *helpstr_clear = -"\n" -"Usage: clear <probe_spec>|<set_spec>\n" -"\n" -"Note: Not available in Kernel Mode\n" -"\n" -"\"clear\" disconnects any probe functions that have previously been\n" -"connected to a probe or group of probes using the \"connect\" command.\n" -"The \"clear\" command cannot be used in kernel mode, since probe functions\n" -"are not available for kernel probes.\n" -"\n" -"End of help for cmd clear\n"; -static char *helpstr_connect = -"\n" -"Usage: connect <function> <probe_spec>|<set_spec>\n" -"\n" -"Note: Not available in Kernel Mode\n" -"\n" -"\"connect\" connects a probe function to a probe or group of probes.\n" -"Currently, the only probe function available from prex is \"&debug\", which\n" -"prints out the arguments sent in to the probe, as well as the value (if\n" -"any) associated with the sunw%debug attribute in the detail field.\n" -"In order for a probe function to be invoked, the probe to which the\n" -"function is attached must be \"enabled\", but need not be \"traced\".\n" -"\n" -"The \"clear\" command is available to disconnect a probe function from\n" -"a probe or group of probes.\n" -"\n" -"End of help for cmd connect\n"; - -static char *helpstr = -"\n" -"Usage: help [topic|command]\n" -"\n" -"Topics\n" -"\tintro functions kernel_mode\n" -"\tprobe_spec processes set_spec\n" -"\n" -"User and Kernel Mode Commands\n" -"\tdisable enable help list\n" -"\tquit source trace untrace\n" -"\n" -"Additional user-mode-only commands\n" -"\tclear connect continue\n" -"\n" -"Additional kernel-mode-only (prex -k) commands\n" -"\tbuffer ktrace pfilter\n" -; - - -static char *oldhelpstr = -"grammar for non-terminals:\n" -"__________________________\n" -"\n" -"filename ::= QUOTED_STR\n" -"\n" -"selector_list ::= /* empty */ |\n" -" <selector_list> <selector>\n" -"\n" -"spec_list ::= /*empty */ |\n" -" <spec_list> <spec>\n" -"\n" -"selector ::= <spec>=<spec> | /* whitespace around '=' optional */\n" -" <spec> /* keys attribute is default */\n" -"\n" -"spec ::= IDENT |\n" -" QUOTED_STR |\n" -" REGEXP\n" -"\n" -"pidlist ::= <pid> |\n" -" <pid> ',' <pidlist>\n" -"pid ::= INT\n" -"\n" -"Reg-exps to match terminals:\n" -"____________________________\n" -"\n" -"IDENT = [a-zA-Z_\\.%]{[a-zA-Z0-9_\\.%]}+ \n" -"QUOTED_STR = '[^\\n']*' /* any string in single quotes */\n" -"REGEXP = /[^\\n/]/ /* reg-exp's have to be in / / */\n" -"INT = [0-9]+\n" -"\n" -"Commands:\n" -"_________\n" -"\n" -"# set creation and set listing\n" -"create $<set_name> <selector_list>\n" -"list sets # list the defined sets\n" -"\n" -"# function listing\n" -"list fcns # list the defined functions.\n" -"\n" -"# commands to connect and disconnect probe functions\n" -"# (not available in kernel mode)\n" -"connect &<fcn_handle> $<set_name> # eg. connect &debug $all\n" -"connect &<fcn_handle> <selector_list>\n" -"\n" -"# command to disconnect all connected probe functions\n" -"# (not available in kernel mode)\n" -"clear $<set_name>\n" -"clear <selector_list>\n" -"\n" -"# commands to toggle the tracing mode\n" -"trace $<set_name>\n" -"trace <selector_list>\n" -"untrace $<set_name>\n" -"untrace <selector_list>\n" -"\n" -"# commands to enable and disable probes\n" -"enable $<set_name>\n" -"enable <selector_list>\n" -"disable $<set_name>\n" -"disable <selector_list>\n" -"list history # lists probe control commands issued\n" -"list tracefile # lists the current trace file name\n" -"\n" -"# commands to list probes or to list values\n" -"list <spec_list> probes $<set_name> #eg. list probes $all\n" -"list <spec_list> probes <selector_list> #eg. list name probes file=test.c\n" -"list values <spec_list> # eg. list values keys\n" -"\n" -"# help command\n" -"help\n" -"\n" -"# source a file of prex commands\n" -"source <filename>\n" -"\n" -"# process control - ^C stops target and returns to 'prex>' prompt\n" -"# (In kernel mode, `continue' is a no-op, and 'quit' detaches prex\n" -"# from the kernel.)\n" -"continue # continues target\n" -"quit kill # quit prex, kill target\n" -"quit resume # quit prex, continue target\n" -"quit suspend # quit prex, leave target suspended\n" -"quit # quit prex (continue or kill target)\n" -"\n" - -"\n" -"# Kernel mode commands\n" -"# \"master switch\" enabling/disabling all tracing\n" -"ktrace on # Enabled probes will generate trace output\n" -"ktrace off # All trace output suppressed\n" -"# Create, destroy, or show the size of the kernel trace buffer\n" -"buffer [ alloc [ size ] | dealloc ]\n" -"# Control per-process kernel trace filtering\n" -"pfilter off # Filtering off: trace all processes\n" -"pfilter on # Filtering on: trace only processes in filter set\n" -"pfilter add <pidlist> # Add specified process ids to the filter set\n" -"pfilter delete <pidlist> # Drop specified pids from the filter set\n" -"\n" -; - -void -help(void) -{ - (void) fputs(helpstr, stdout); - -} /* end help */ - -void -help_on_topic(char *topic) -{ - int i; - - if (topic && strlen(topic)) { - for (i = 0; i < NUMHELPTOPICS; i++) - if (strcmp(topic, helptopics[i]) == 0) - break; - if (i < NUMHELPTOPICS) - fputs(helptopicstrings[i], stdout); - else { - printf("No help for %s\n", topic); - help(); - } - } -} - - -void -help_on_command(int cmd) -{ - switch (cmd) { - case CONTINUE: - fputs(helpstr_continue, stdout); - break; - case DISABLE: - fputs(helpstr_disable, stdout); - break; - case ENABLE: - fputs(helpstr_enable, stdout); - break; - case HELP: - fputs(helpstr_help, stdout); - break; - case LIST: - fputs(helpstr_list, stdout); - break; - case QUIT: - fputs(helpstr_quit, stdout); - break; - case SOURCE: - fputs(helpstr_source, stdout); - break; - case TRACE: - fputs(helpstr_trace, stdout); - break; - case UNTRACE: - fputs(helpstr_untrace, stdout); - break; - case BUFFER: - fputs(helpstr_buffer, stdout); - break; - case KTRACE: - fputs(helpstr_ktrace, stdout); - break; - case PFILTER: - fputs(helpstr_pfilter, stdout); - break; - case CLEAR: - fputs(helpstr_clear, stdout); - break; - case CONNECT: - fputs(helpstr_connect, stdout); - break; - default: - fputs("No help for this command\n", stdout); - break; - } - -} /* end help */ diff --git a/usr/src/cmd/tnf/prex/i386/Makefile b/usr/src/cmd/tnf/prex/i386/Makefile deleted file mode 100644 index b57ca8205f..0000000000 --- a/usr/src/cmd/tnf/prex/i386/Makefile +++ /dev/null @@ -1,34 +0,0 @@ -# -# 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 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 -# -# -#ident "%Z%%M% %I% %E% SMI" -# -# Copyright (c) 1997, by Sun Microsystems, Inc. -# All rights reserved. -# -# cmd/tnf/prex/sparc/Makefile - -include ../Makefile.com -CFLAGS += -I.. -I. -LINTFLAGS += -I.. -I. - -install: all $(ROOTPROG32) diff --git a/usr/src/cmd/tnf/prex/list.c b/usr/src/cmd/tnf/prex/list.c deleted file mode 100644 index cfecaeef9b..0000000000 --- a/usr/src/cmd/tnf/prex/list.c +++ /dev/null @@ -1,571 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -/* - * Includes - */ - -#ifndef DEBUG -#define NDEBUG 1 -#endif - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <assert.h> -#include <libintl.h> -#include <search.h> - -#include "source.h" -#include "queue.h" -#include "list.h" -#include "spec.h" -#include "new.h" -#include "fcn.h" - -extern caddr_t g_commitfunc; - - -/* - * Typedefs - */ - -typedef struct list_probe_args { - spec_t *speclist_p; - expr_t *exprlist_p; -} list_probe_args_t; - -typedef struct list_attrs_args { - spec_t *speclist_p; - void *attrroot_p; -} list_attrs_args_t; - -typedef struct attr_node { - char *name; - void *valsroot_p; -} attr_node_t; - -typedef struct vals_node { - char *name; -} vals_node_t; - - -/* - * Globals - */ - - -/* - * Declarations - */ - -static tnfctl_errcode_t listprobe(tnfctl_handle_t *hndl, - tnfctl_probe_t *ref_p, void *calldata_p); -static tnfctl_errcode_t probescan(tnfctl_handle_t *hndl, - tnfctl_probe_t *ref_p, void *calldata_p); -static void printattrval(spec_t * spec_p, char *attr, char *value, - void *pdata); -static void attrscan(spec_t * spec_p, char *attr, char *values, void *pdata); -static int attrcompare(const void *node1, const void *node2); -static int valscompare(const void *node1, const void *node2); -static void printattrs(const void *node, VISIT order, int level); -static void printvals(const void *node, VISIT order, int level); - -#if 0 -static void attrnodedel(attr_node_t * an_p); -#endif - -static void valadd(spec_t * spec_p, char *val, void *calldata_p); - - -/* ---------------------------------------------------------------- */ -/* ----------------------- Public Functions ----------------------- */ -/* ---------------------------------------------------------------- */ - -extern tnfctl_handle_t *g_hndl; - -/* - * list_set() - lists all of the current probes in a target process - */ - -void -list_set(spec_t * speclist_p, char *setname_p) -{ - set_t *set_p; - list_probe_args_t args; - tnfctl_errcode_t err; - - set_p = set_find(setname_p); - if (!set_p) { - semantic_err(gettext("missing or invalid set")); - return; - } - args.speclist_p = speclist_p; - args.exprlist_p = set_p->exprlist_p; - err = tnfctl_probe_apply(g_hndl, listprobe, &args); - if (err) { - semantic_err(gettext("listing error : %s"), - tnfctl_strerror(err)); - } -} - - -/* - * list_expr() - lists all of the current probes in an expression list - */ - -void -list_expr(spec_t * speclist_p, expr_t * expr_p) -{ - list_probe_args_t args; - tnfctl_errcode_t err; - - args.speclist_p = speclist_p; - args.exprlist_p = expr_p; - err = tnfctl_probe_apply(g_hndl, listprobe, &args); - if (err) { - semantic_err(gettext("listing error : %s"), - tnfctl_strerror(err)); - } -} - - -/* - * list_values() - list all the values for a supplied spec - */ - -void -list_values(spec_t * speclist_p) -{ - list_attrs_args_t args; - tnfctl_errcode_t err; - - /* setup argument block */ - args.speclist_p = speclist_p; - args.attrroot_p = NULL; - - /* traverse the probes, recording attributes that match */ - err = tnfctl_probe_apply(g_hndl, probescan, &args); - if (err) { - semantic_err(gettext("probe traversal error : %s"), - tnfctl_strerror(err)); - } - - /* pretty print the results */ - twalk(args.attrroot_p, printattrs); - - /* destroy the attribute tree */ - while (args.attrroot_p) { - attr_node_t **aptr; - char *anameptr; - - aptr = (attr_node_t **) args.attrroot_p; - - /* destroy the value tree */ - while ((*aptr)->valsroot_p) { - vals_node_t **vptr; - char *vnameptr; - - vptr = (vals_node_t **) (*aptr)->valsroot_p; - vnameptr = (*vptr)->name; -#ifdef LEAKCHK - (void) fprintf(stderr, "freeing value \"%s\"\n", - vnameptr); -#endif - (void) tdelete((void *) *vptr, &(*aptr)->valsroot_p, - valscompare); - if (vnameptr) free(vnameptr); - } - - anameptr = (*aptr)->name; -#ifdef LEAKCHK - (void) fprintf(stderr, "freeing attr \"%s\"\n", anameptr); -#endif - (void) tdelete((void *) *aptr, &args.attrroot_p, attrcompare); - if (anameptr) free(anameptr); - } - -} /* end list_values */ - - -/* - * list_getattrs() - build an attribute string for this probe. - */ - - -#define BUF_LIMIT 2048 - -char * -list_getattrs(tnfctl_probe_t *probe_p) -{ - tnfctl_errcode_t err; - tnfctl_probe_state_t p_state; - char *attrs; - char buffer[BUF_LIMIT]; - char *buf_p; - char *buf_end; - int str_len; - size_t len; - - err = tnfctl_probe_state_get(g_hndl, probe_p, &p_state); - if (err) { - attrs = malloc(2); - if (attrs) - attrs[0] = '\0'; - return (attrs); - } - - buf_p = buffer; - buf_end = buf_p + BUF_LIMIT; - str_len = sprintf(buf_p, "enable %s; trace %s; ", - (p_state.enabled) ? "on" : "off", - (p_state.traced) ? "on" : "off"); - buf_p += str_len; - if (p_state.obj_name) { - str_len = strlen(p_state.obj_name); - if (buf_p + str_len < buf_end) { - str_len = sprintf(buf_p, "object %s; ", - p_state.obj_name); - buf_p += str_len; - } - } - str_len = sprintf(buf_p, "funcs"); - buf_p += str_len; - - /* REMIND: add limit for string size */ - if (p_state.func_names) { - int i = 0; - char *fcnname; - - while (p_state.func_names[i]) { - (void) strcat(buffer, " "); - - fcnname = fcn_findname(p_state.func_names[i]); - if (fcnname) { - (void) strcat(buffer, "&"); - (void) strcat(buffer, fcnname); - } else - (void) strcat(buffer, p_state.func_names[i]); - i++; - } - } - - (void) strcat(buffer, ";"); - - len = strlen(buffer) + strlen(p_state.attr_string) + 1; - attrs = (char *) malloc(len); - - if (attrs) { - (void) strcpy(attrs, buffer); - (void) strcat(attrs, p_state.attr_string); - } - - return (attrs); -} - - -/* ---------------------------------------------------------------- */ -/* ----------------------- Private Functions ---------------------- */ -/* ---------------------------------------------------------------- */ - -/* - * probescan() - function used as a callback, gathers probe attributes and - * values - */ -/*ARGSUSED*/ -static tnfctl_errcode_t -probescan(tnfctl_handle_t *hndl, tnfctl_probe_t *ref_p, void *calldata_p) -{ - list_attrs_args_t *args_p = (list_attrs_args_t *) calldata_p; - spec_t *speclist_p; - spec_t *spec_p; - char *attrs; - - speclist_p = args_p->speclist_p; - spec_p = NULL; - - attrs = list_getattrs(ref_p); - - while (spec_p = (spec_t *) queue_next(&speclist_p->qn, &spec_p->qn)) { - spec_attrtrav(spec_p, attrs, attrscan, calldata_p); - } - - if (attrs) - free(attrs); - - return (TNFCTL_ERR_NONE); -} - - -/* - * attrscan() - called on each matching attr/values component - */ - -/*ARGSUSED*/ -static void -attrscan(spec_t * spec_p, - char *attr, - char *values, - void *pdata) -{ - list_attrs_args_t *args_p = (list_attrs_args_t *) pdata; - attr_node_t *an_p; - attr_node_t **ret_pp; - static spec_t *allspec = NULL; - - if (!allspec) - allspec = spec(".*", SPEC_REGEXP); - - an_p = new(attr_node_t); - -#ifdef LEAKCHK - (void) fprintf(stderr, "creating attr \"%s\"\n", attr); -#endif - an_p->name = strdup(attr); - an_p->valsroot_p = NULL; - - ret_pp = tfind((void *) an_p, &args_p->attrroot_p, attrcompare); - - if (ret_pp) { - /* - * we already had a node for this attribute; delete ours * - * and point at the original instead. - */ -#ifdef LEAKCHK - (void) fprintf(stderr, "attr already there \"%s\"\n", attr); -#endif - if (an_p->name) - free(an_p->name); - free(an_p); - - an_p = *ret_pp; - } else { - (void) tsearch((void *) an_p, &args_p->attrroot_p, attrcompare); - } - - spec_valtrav(allspec, values, valadd, (void *) an_p); - -} /* end attrscan */ - - -/* - * valadd() - add vals to an attributes tree - */ - -/*ARGSUSED*/ -static void -valadd(spec_t * spec_p, - char *val, - void *calldata_p) -{ - attr_node_t *an_p = (attr_node_t *) calldata_p; - - vals_node_t *vn_p; - vals_node_t **ret_pp; - - vn_p = new(vals_node_t); -#ifdef LEAKCHK - (void) fprintf(stderr, "creating value \"%s\"\n", val); -#endif - vn_p->name = strdup(val); - - ret_pp = tfind((void *) vn_p, &an_p->valsroot_p, valscompare); - - if (ret_pp) { - /* we already had a node for this value */ -#ifdef LEAKCHK - (void) fprintf(stderr, "value already there \"%s\"\n", val); -#endif - if (vn_p->name) - free(vn_p->name); - free(vn_p); - } else { - (void) tsearch((void *) vn_p, &an_p->valsroot_p, valscompare); - } - - -} /* end valadd */ - - -/* - * attrcompare() - compares attribute nodes, alphabetically - */ - -static int -attrcompare(const void *node1, - const void *node2) -{ - return strcmp(((attr_node_t *) node1)->name, - ((attr_node_t *) node2)->name); - -} /* end attrcompare */ - - -/* - * valscompare() - compares attribute nodes, alphabetically - */ - -static int -valscompare(const void *node1, - const void *node2) -{ - return strcmp(((vals_node_t *) node1)->name, - ((vals_node_t *) node2)->name); - -} /* end valscompare */ - - -/* - * printattrs() - prints attributes from the attr tree - */ - -/*ARGSUSED*/ -static void -printattrs(const void *node, - VISIT order, - int level) -{ - attr_node_t *an_p = (*(attr_node_t **) node); - - if (order == postorder || order == leaf) { - (void) printf("%s =\n", an_p->name); - twalk(an_p->valsroot_p, printvals); - } -} /* end printattrs */ - - -/* - * printvals() - prints values from a value tree - */ - -/*ARGSUSED*/ -static void -printvals(const void *node, - VISIT order, - int level) -{ - vals_node_t *vn_p = (*(vals_node_t **) node); - - if (order == postorder || order == leaf) - (void) printf(" %s\n", vn_p->name); - -} /* end printvals */ - - -#if 0 -/* - * attrnodedel() - deletes an attr_node_t after the action - */ - -static void -attrnodedel(attr_node_t * an_p) -{ - if (an_p->name) - free(an_p->name); - - /* destroy the value tree */ - while (an_p->valsroot_p) { - vals_node_t **ptr; - - ptr = (vals_node_t **) an_p->valsroot_p; - (void) tdelete((void *) *ptr, &an_p->valsroot_p, valscompare); - } - - /* We don't need to free this object, since tdelete() appears to */ - /* free(an_p); */ - -} /* end attrnodedel */ -#endif - - -/* - * listprobe() - function used as a callback, pretty prints a probe - */ -/*ARGSUSED*/ -static tnfctl_errcode_t -listprobe(tnfctl_handle_t *hndl, tnfctl_probe_t *ref_p, void *calldata_p) -{ - static spec_t *default_speclist = NULL; - list_probe_args_t *args_p = (list_probe_args_t *) calldata_p; - spec_t *speclist_p; - spec_t *spec_p; - boolean_t sawattr; - char *attrs; - - /* build a default speclist if there is not one built already */ - if (!default_speclist) { - default_speclist = spec_list( - spec_list( - spec_list( - spec_list( - spec_list( - spec("name", - SPEC_EXACT), - spec("enable", - SPEC_EXACT)), - spec("trace", SPEC_EXACT)), - spec("file", SPEC_EXACT)), - spec("line", SPEC_EXACT)), - spec("funcs", SPEC_EXACT)); - } - attrs = list_getattrs(ref_p); - - if (expr_match(args_p->exprlist_p, attrs)) { - speclist_p = args_p->speclist_p; - speclist_p = (speclist_p) ? speclist_p : default_speclist; - - spec_p = NULL; - while (spec_p = (spec_t *) - queue_next(&speclist_p->qn, &spec_p->qn)) { - sawattr = B_FALSE; - spec_attrtrav(spec_p, attrs, printattrval, &sawattr); - if (!sawattr) - (void) printf("<no attr> "); - } - (void) printf("\n"); - } - if (attrs) - free(attrs); - - return (TNFCTL_ERR_NONE); -} - - -/*ARGSUSED*/ -static void -printattrval(spec_t * spec_p, - char *attr, - char *value, - void *pdata) -{ - boolean_t *bptr = (boolean_t *) pdata; - - *bptr = B_TRUE; - - (void) printf("%s=%s ", attr, (value && *value) ? value : "<no value>"); - -} /* end printattrval */ diff --git a/usr/src/cmd/tnf/prex/list.h b/usr/src/cmd/tnf/prex/list.h deleted file mode 100644 index ba131db951..0000000000 --- a/usr/src/cmd/tnf/prex/list.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#ifndef _LIST_H -#define _LIST_H - -#pragma ident "%Z%%M% %I% %E% SMI" - - -/* - * Includes - */ - -#include "expr.h" -#include "set.h" - -#include <tnf/tnfctl.h> - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Declarations - */ -void list_expr(spec_t *speclist_p, expr_t *expr_p); -void list_set(spec_t *speclist_p, char *setname_p); -void list_values(spec_t *speclist_p); - -char *list_getattrs(tnfctl_probe_t *ref_p); - -#ifdef __cplusplus -} -#endif - -#endif /* _LIST_H */ diff --git a/usr/src/cmd/tnf/prex/main.c b/usr/src/cmd/tnf/prex/main.c deleted file mode 100644 index c40ed10267..0000000000 --- a/usr/src/cmd/tnf/prex/main.c +++ /dev/null @@ -1,974 +0,0 @@ -/* - * 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 2006 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -/* - * Includes - */ - -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <string.h> -#include <signal.h> -#include <errno.h> -#include <locale.h> -#include <libintl.h> -#include <fcntl.h> -#include <limits.h> -#include <sys/stat.h> -#include <sys/types.h> -#include <sys/param.h> -#include <sys/procfs.h> -#include <libelf.h> -#include <gelf.h> -#include <sys/systeminfo.h> - -#include <tnf/tnfctl.h> - -#include "set.h" -#include "cmd.h" -#include "spec.h" -#include "expr.h" -#include "source.h" -#include "list.h" -#include "prbk.h" - -/* - * Defines - Project private interfaces - */ - -#define DEBUG_ENTRY "tnf_probe_debug" -#ifdef TESTING -#define EMPTY_ENTRY "tnf_probe_empty" -#endif - -#define USER_OUTSIZE (4*1024*1024) -#define KERNEL_OUTSIZE (384*1024) - -#if defined(__sparc) -#define PREX32DIR "/sparcv7/" -#elif defined(__i386) || defined(__amd64) -#define PREX32DIR "/i86/" -#endif -#define PREX32EXEC "/usr/bin" PREX32DIR "prex" - -/* - * Globals - */ - -char **g_argv; /* copy of argv pointer */ -tnfctl_handle_t *g_hndl; /* handle on target or kernel */ - -static int g_verbose; /* debugging to stderr */ -static char *g_cmdname; /* target command name */ -static char **g_cmdargs; /* target command args */ -static pid_t g_targetpid; /* target process id */ -static volatile boolean_t g_getcmds; /* accept input flag */ -static boolean_t g_testflag; /* asserted in test mode */ -static char *g_preload; /* objects to preload */ -static char *g_outname; /* tracefile name */ -static char *tracefile; /* tracefile name used by list cmd */ -int g_outsize; /* tracefile size */ -boolean_t g_kernelmode; /* -k flag: kernel mode */ -static int prex_dmodel; /* prex data model */ -/* - * Local Declarations - */ - -static void usage(char **argv, const char *msg); -static void scanargs(int argc, char **argv); -static int set_signal(void); -static int get_data_model(pid_t pid); -static int get_elf_class(char *filename); -static int get_executable(char *); -static void prex_isaexec(char **argv, char **envp); -static void check_pid_model(char **argv, char **envp); -static void check_exec_model(char **argv, char **envp); - -/* #### - FIXME - need to put this in a private header file */ -extern void err_fatal(char *s, ...); - -extern int yyparse(void); - -static tnfctl_errcode_t check_trace_error(tnfctl_handle_t *hndl); -static void set_default_cmd(void); -static void get_commands(void); -static tnfctl_errcode_t set_tracefile(tnfctl_handle_t *hndl); -static tnfctl_errcode_t set_probe_discovery_callback(tnfctl_handle_t *hndl); -static void * perprobe(tnfctl_handle_t *hndl, tnfctl_probe_t *probe_p); -static tnfctl_errcode_t perprobe2(tnfctl_handle_t *hndl, - tnfctl_probe_t *probe_p, void *ignored); -static tnfctl_errcode_t percmd(expr_t *expr_p, cmd_kind_t kind, fcn_t *fcn_p, - boolean_t isnew, void *calldata_p); -void quit(boolean_t killtarget, boolean_t runtarget); -void cmd_listtracefile(); - - -/* - * usage() - gives a description of the arguments, and exits - */ - -static void -usage(char *argv[], const char *msg) -{ - if (msg) - (void) fprintf(stderr, - gettext("%s: %s\n"), argv[0], msg); - - (void) fprintf(stderr, gettext( - "usage: %s [options] <cmd> [cmd-args...]\n"), argv[0]); - (void) fprintf(stderr, gettext( - "usage: %s [options] -p <pid>\n"), argv[0]); - (void) fprintf(stderr, gettext( - "usage: %s -s <kbytes-size> -k\n"), argv[0]); - (void) fprintf(stderr, gettext( - "options:\n")); - (void) fprintf(stderr, gettext( - " -o <outfilename> set trace output file name\n")); - (void) fprintf(stderr, gettext( - " -s <kbytes-size> set trace file size\n")); - (void) fprintf(stderr, gettext( - " -l <sharedobjs> shared objects to " - "be preloaded (cmd only)\n")); - - exit(1); -} - - -/* - * main() - - */ - -int -main(int argc, char **argv, char **envp) -{ - tnfctl_errcode_t err = TNFCTL_ERR_NONE; - int sys_err; - tnfctl_trace_attrs_t trace_attrs; - tnfctl_event_t event = TNFCTL_EVENT_EINTR; - pid_t prex_pid; - - /* internationalization stuff */ - (void) setlocale(LC_ALL, ""); -#if !defined(TEXT_DOMAIN) /* Should be defined by cc -D */ -#define TEXT_DOMAIN "SYS_TEST" /* Use this only if it weren't */ -#endif - (void) textdomain(TEXT_DOMAIN); - - g_argv = argv; - - prex_pid = getpid(); -#if defined(DEBUG) - fprintf(stderr, "### prex_pid = %d ###\n", prex_pid); -#endif - prex_dmodel = get_data_model(prex_pid); -#if defined(DEBUG) - fprintf(stderr, "### prex_dmodel = %d ###\n", prex_dmodel); -#endif - scanargs(argc, argv); - - if (g_kernelmode) { - /* prexing the kernel */ - err = tnfctl_kernel_open(&g_hndl); - if (err) { - err_fatal(gettext( - "%s: trouble attaching to the kernel: %s\n"), - argv[0], tnfctl_strerror(err)); - } - } else { - /* prexing a user process */ - if (g_targetpid != 0) { - /* check data model */ - check_pid_model(argv, envp); - /* attach case */ - err = tnfctl_pid_open(g_targetpid, &g_hndl); - if (err == TNFCTL_ERR_NOLIBTNFPROBE) { - err_fatal(gettext( - "%s: missing symbols, is " - "libtnfprobe.so loaded in target?\n"), - argv[0], tnfctl_strerror(err)); - } else if (err) { - err_fatal(gettext( - "%s: trouble attaching to target " - "process: %s\n"), - argv[0], tnfctl_strerror(err)); - } - } else { - /* check elf class model */ - check_exec_model(argv, envp); - /* exec case */ - err = tnfctl_exec_open(g_cmdname, g_cmdargs, NULL, - g_preload, NULL, &g_hndl); - if (err == TNFCTL_ERR_NONE) - err = tnfctl_trace_attrs_get(g_hndl, - &trace_attrs); - if (err) { - err_fatal(gettext( - "%s: trouble creating target process: " - "%s\n"), - argv[0], tnfctl_strerror(err)); - } - g_targetpid = trace_attrs.targ_pid; - } - - sys_err = set_signal(); - if (sys_err) - err_fatal(gettext( - "%s: trouble setting up signal handler: %s\n"), - argv[0], strerror(err)); - } - - /* initialize the source stack for the parser */ - source_init(); - - if (!g_kernelmode) { - /* set the tracefile name and size */ - err = set_tracefile(g_hndl); - if (err) { - (void) fprintf(stderr, gettext( - "%s: trouble initializing tracefile: %s\n"), - argv[0], tnfctl_strerror(err)); - goto Cleanup; - } - err = check_trace_error(g_hndl); - if (err) { - (void) fprintf(stderr, gettext( - "%s: cannot read tracing status : %s\n"), - argv[0], tnfctl_strerror(err)); - goto Cleanup; - } - } - - /* accept commands from stdin the first time through */ - g_getcmds = B_TRUE; - - /* set up default aliases */ - set_default_cmd(); - - /* set up creator/destructor function to call for new probes */ - err = set_probe_discovery_callback(g_hndl); - if (err) { - (void) fprintf(stderr, gettext( - "%s: error in probe discovery : %s\n"), - argv[0], tnfctl_strerror(err)); - goto Cleanup; - } - - if (g_kernelmode) { - prbk_warn_pfilter_empty(); - } - - while (err == TNFCTL_ERR_NONE) { - - if (g_kernelmode || g_getcmds) { - g_getcmds = B_FALSE; - get_commands(); - } - - if (!g_kernelmode && (g_getcmds == B_FALSE)) { - err = tnfctl_continue(g_hndl, &event, NULL); - if (err) { - (void) fprintf(stderr, gettext( - "%s: cannot continue target : %s\n"), - argv[0], tnfctl_strerror(err)); - goto Cleanup; - } - } - err = check_trace_error(g_hndl); - if (err) { - (void) fprintf(stderr, gettext( - "%s: cannot read tracing status : %s\n"), - argv[0], tnfctl_strerror(err)); - goto Cleanup; - } - if (!g_kernelmode) { - if (event == TNFCTL_EVENT_EXEC) { - (void) printf(gettext( - "Target process exec'd\n")); - quit(B_FALSE, B_TRUE); /* quit resume */ - } else if (event == TNFCTL_EVENT_EXIT) { - /* target exited */ - (void) fprintf(stderr, gettext( - "%s: target process exited\n"), - g_argv[0]); - goto Cleanup; - } else if (event == TNFCTL_EVENT_TARGGONE) { - /* target terminated */ - (void) fprintf(stderr, - gettext("%s: target process disappeared (without calling exit)\n"), - g_argv[0]); - goto Cleanup; - } - } - } - -Cleanup: - err = tnfctl_close(g_hndl, TNFCTL_TARG_DEFAULT); - if (err) - (void) fprintf(stderr, gettext( - "%s: error on closing : %s\n"), - argv[0], tnfctl_strerror(err)); - - exit(0); - - return (0); - -} - -/* - * check_trace_error() - checks whether there was an error in tracing - */ -static tnfctl_errcode_t -check_trace_error(tnfctl_handle_t *hndl) -{ - tnfctl_trace_attrs_t trace_attrs; - tnfctl_errcode_t err; - - err = tnfctl_trace_attrs_get(hndl, &trace_attrs); - if (err) - return (err); - - if (trace_attrs.trace_buf_state == TNFCTL_BUF_BROKEN) { - (void) printf(gettext("Tracing shut down in target program " - "due to an internal error - Please restart prex " - "and target\n")); - } - - return (TNFCTL_ERR_NONE); -} - -/* - * set_default_cmd() - set the default debug entry and $all - */ -static void -set_default_cmd(void) -{ - if (!g_kernelmode) - fcn(strdup("debug"), DEBUG_ENTRY); -#ifdef TESTING - fcn(strdup("empty"), EMPTY_ENTRY); -#endif - (void) set(strdup("all"), expr(spec(strdup("keys"), SPEC_EXACT), - spec(strdup(".*"), SPEC_REGEXP))); - -} - -/* - * process() - enable and disable selected probes - */ - -typedef struct { - tnfctl_probe_t *probe_p; - tnfctl_handle_t *hndl; -} process_args_t; - -static tnfctl_errcode_t -percmd(expr_t *expr_p, cmd_kind_t kind, fcn_t *fcn_p, boolean_t isnew, - void *calldata_p) -{ - process_args_t *args_p = (process_args_t *)calldata_p; - tnfctl_handle_t *hndl = args_p->hndl; - tnfctl_probe_t *probe_p = args_p->probe_p; - tnfctl_errcode_t err = TNFCTL_ERR_NONE; - char *attrs; - - attrs = list_getattrs(probe_p); - - if (expr_match(expr_p, attrs)) { -#if defined(DEBUG) || defined(lint) - if (g_verbose) { - char *cmdstr[] = { - "enable", "disable", - "connect", "clear", - "trace", "untrace"}; - - (void) fprintf(stderr, ": %s command: %s ", - (isnew) ? "new" : "old", cmdstr[kind]); - expr_print(stderr, expr_p); - } -#endif - - switch (kind) { - case CMD_ENABLE: - err = tnfctl_probe_enable(hndl, probe_p, NULL); - break; - case CMD_DISABLE: - err = tnfctl_probe_disable(hndl, probe_p, NULL); - break; - case CMD_TRACE: - err = tnfctl_probe_trace(hndl, probe_p, NULL); - break; - case CMD_UNTRACE: - err = tnfctl_probe_untrace(hndl, probe_p, NULL); - break; - case CMD_CONNECT: - err = tnfctl_probe_connect(hndl, probe_p, NULL, - fcn_p->entry_name_p); - break; - case CMD_CLEAR: - err = tnfctl_probe_disconnect_all(hndl, probe_p, NULL); - break; - } - -#if defined(DEBUG) || defined(lint) - if (g_verbose) - (void) fprintf(stderr, "\n"); -#endif - - } - if (attrs) - free(attrs); - - return (err); - -} - -/*ARGSUSED*/ -static void * -perprobe(tnfctl_handle_t *hndl, tnfctl_probe_t *probe_p) -{ - process_args_t args; - tnfctl_errcode_t err; - - args.probe_p = probe_p; - args.hndl = hndl; - err = cmd_traverse(percmd, &args); - if (err) { - (void) fprintf(stderr, gettext( - "%s: error on new (dlopened) probe : %s\n"), - g_argv[0], tnfctl_strerror(err)); - } - return (NULL); -} - -static tnfctl_errcode_t -set_probe_discovery_callback(tnfctl_handle_t *hndl) -{ - tnfctl_errcode_t err; - - err = tnfctl_register_funcs(hndl, perprobe, NULL); - if (err) - return (err); - - return (TNFCTL_ERR_NONE); -} - -static tnfctl_errcode_t -perprobe2(tnfctl_handle_t *hndl, tnfctl_probe_t *probe_p, void *cd) -{ - cmd_t *cmd = cd; - process_args_t args; - tnfctl_errcode_t err; - - args.probe_p = probe_p; - args.hndl = hndl; - err = cmd_callback(cmd, percmd, &args); - if (err) { - (void) fprintf(stderr, gettext( - "%s: error on probe operation: %s\n"), - g_argv[0], tnfctl_strerror(err)); - } - return (err); -} - -void -process_cmd(tnfctl_handle_t *hndl, cmd_t *cmd) -{ -#if defined(DEBUG) || defined(lint) - if (g_verbose) - (void) fprintf(stderr, "processing commands\n"); -#endif - (void) tnfctl_probe_apply(hndl, perprobe2, cmd); -} - -/* - * get_commands() - process commands from stdin - */ -static void -get_commands(void) -{ - /* Read commands from STDIN */ - if (g_kernelmode) { - (void) printf(gettext("Type \"help\" for help ...\n")); - } else { - if (g_testflag) - (void) printf("prex(%ld), target(%ld): ", - getpid(), g_targetpid); - (void) printf(gettext("Target process stopped\n")); - (void) printf(gettext( - "Type \"continue\" to resume the target, " - "\"help\" for help ...\n")); - } - - while (yyparse()); -} - - -/* - * quit() - called to quit the controlling process. The boolean argument - * specifies whether to terminate the target as well. - */ - -void -quit(boolean_t killtarget, boolean_t runtarget) -{ - tnfctl_errcode_t err; - - if (killtarget && runtarget) - err = tnfctl_close(g_hndl, TNFCTL_TARG_DEFAULT); - else if (killtarget && !runtarget) - err = tnfctl_close(g_hndl, TNFCTL_TARG_KILL); - else if (!killtarget && runtarget) - err = tnfctl_close(g_hndl, TNFCTL_TARG_RESUME); - else if (!killtarget && !runtarget) - err = tnfctl_close(g_hndl, TNFCTL_TARG_SUSPEND); - if (err) { - (void) fprintf(stderr, gettext( - "%s: trouble quitting : %s\n"), - g_argv[0], tnfctl_strerror(err)); - exit(1); - } - exit(0); -} - - -/* - * scanargs() - processes the command line arguments - */ - -#define strneq(s1, s2, n) (strncmp(s1, s2, n) == 0) - -static void -scanargs(int argc, - char **argv) -{ - int c; -#if defined(DEBUG) || defined(lint) - char *optstr = "l:o:p:s:tkv:"; /* debugging options */ -#else - char *optstr = "l:o:p:s:tk"; /* production options */ -#endif - - /* set up some defaults */ - g_targetpid = 0; - g_cmdname = NULL; - g_cmdargs = NULL; - g_preload = NULL; - g_outname = NULL; - g_outsize = -1; - - while ((c = getopt(argc, argv, optstr)) != EOF) { - switch (c) { - case 'l': /* preload objects */ - g_preload = optarg; - break; - case 'o': /* tracefile name */ - g_outname = optarg; - break; - case 'p': /* target pid (attach case) */ - g_targetpid = atoi(optarg); - break; - case 's': /* tracefile size */ - g_outsize = atoi(optarg) * 1024; - break; - case 't': /* test flag */ - g_testflag = B_TRUE; - (void) setvbuf(stdout, NULL, _IOLBF, 0); - break; - case 'k': /* kernel mode */ - g_kernelmode = B_TRUE; - break; -#if defined(DEBUG) || defined(lint) - case 'v': /* verbose flag */ - g_verbose = atoi(optarg); - break; -#endif - case '?': /* error case */ - usage(argv, gettext("unrecognized argument")); - } - } - - if (optind < argc) { - g_cmdname = strdup(argv[optind]); - g_cmdargs = &argv[optind]; - } - /* sanity clause */ - if (!g_kernelmode && (g_cmdname == NULL && g_targetpid == 0)) - usage(argv, gettext("need to specify cmd or pid")); - if (g_cmdname != NULL && g_targetpid != 0) - usage(argv, gettext("can't specify both cmd and pid")); - if (g_targetpid && g_preload) - usage(argv, gettext("can't use preload option with attach")); - if (g_kernelmode) { - if (g_outname) - usage(argv, "can't specify a filename in kernel mode"); - if (g_cmdname) - usage(argv, "can't specify a command in kernel mode"); - if (g_targetpid) - usage(argv, "can't specify pid in kernel mode"); - if (g_preload) - usage(argv, "can't use preload option in kernel mode"); - } - /* default output size */ - if (g_outsize == -1) - g_outsize = g_kernelmode ? KERNEL_OUTSIZE : USER_OUTSIZE; - -#ifdef OLD - int i; - - for (i = 1; i < argc; i++) { - if (strneq(argv[i], "-v", 2)) { - int vlevel; - - vlevel = (strlen(argv[i]) > 2)? atoi(&argv[i][2]) : 1; - g_verbose = B_TRUE; - prb_verbose_set(vlevel); - } else if (strneq(argv[i], "-pid", 2)) { - if (++i >= argc) - usage(argv, gettext("missing pid argument")); - g_targetpid = atoi(argv[i]); - } else if (strneq(argv[i], "-t", 2)) { - g_testflag = B_TRUE; - (void) setvbuf(stdout, NULL, _IOLBF, 0); - } else if (argv[i][0] != '-') { - g_cmdname = strdup(argv[i]); - if (!g_cmdname) { - err_fatal(gettext( - "%s: out of memory"), argv[0]); - } - if (g_verbose >= 2) { - (void) fprintf(stderr, - "cmdname=%s\n", g_cmdname); - } - /* - * rest of arguments are the args to the executable - - * by convention argv[0] should be name of - * executable, so we don't increment i - */ - g_cmdargs = &argv[i]; - break; - } else { - usage(argv, gettext("unrecognized argument")); - } - } -#endif - -} /* end scanargs */ - - -/* - * sig_handler() - cleans up if a signal is received - */ - -/*ARGSUSED*/ -static void -sig_handler(int signo) -{ - g_getcmds = B_TRUE; -} /* end sig_handler */ - - -/* - * set_signal() - sets up function to call for clean up - */ - -static int -set_signal(void) -{ - struct sigaction newact; - - newact.sa_handler = sig_handler; - (void) sigemptyset(&newact.sa_mask); - newact.sa_flags = 0; - if (sigaction(SIGINT, &newact, NULL) < 0) { - return (errno); - } - return (0); -} - - -/* - * set_tracefile() - initializes tracefile, sets the tracefile name and size - */ -static tnfctl_errcode_t -set_tracefile(tnfctl_handle_t *hndl) -{ - tnfctl_errcode_t err; - tnfctl_trace_attrs_t attrs; - size_t minoutsize; - char path[MAXPATHLEN]; - char *outfile_name; - char *tmpdir; - - /* Init tracefile name used by list cmd */ - tracefile = NULL; - err = tnfctl_trace_attrs_get(hndl, &attrs); - if (err) - return (err); - - if (attrs.trace_buf_state == TNFCTL_BUF_BROKEN) - return (TNFCTL_ERR_BUFBROKEN); - if (attrs.trace_buf_state == TNFCTL_BUF_OK) { - /* trace file set already - can't change it */ - return (TNFCTL_ERR_NONE); - } - - minoutsize = attrs.trace_min_size; - if (g_outsize < minoutsize) { - (void) fprintf(stderr, - gettext("specified tracefile size smaller then " - "minimum; setting to %d kbytes\n"), - minoutsize / 1024); - g_outsize = minoutsize; - } - - /* where is $TMPDIR? */ - tmpdir = getenv("TMPDIR"); - if (!tmpdir || *tmpdir == '\0') { - tmpdir = "/tmp"; - } - - /* do we have an absolute, relative or no pathname specified? */ - if (g_outname == NULL) { - /* default, no tracefile specified */ - if ((strlen(tmpdir) + 1 + 20) > (size_t)MAXPATHLEN) { - (void) fprintf(stderr, gettext( - "%s: $TMPDIR too long\n"), g_argv[0]); - exit(1); - } - (void) sprintf(path, "%s/trace-%ld", tmpdir, g_targetpid); - outfile_name = path; - } else { - /* filename specified */ - outfile_name = g_outname; - } - tracefile = strdup(outfile_name); - if (tracefile == NULL) { - if ((errno == ENOMEM) || (errno == EAGAIN)) { - return (TNFCTL_ERR_ALLOCFAIL); - } else { - return (TNFCTL_ERR_INTERNAL); - } - } - -#if defined(DEBUG) || defined(lint) - if (g_verbose) - (void) fprintf(stderr, - "setting tracefile name=\"%s\", size=%d\n", - path, g_outsize); -#endif - err = tnfctl_buffer_alloc(hndl, outfile_name, g_outsize); - return (err); -} -/* - * get_data_model() - get the process data model from psinfo - * structure. - */ -#define PROCFORMAT "/proc/%d" -static int -get_data_model(pid_t pid) -{ - char path[MAXPATHLEN]; - int fd, dmodel = -1; - prpsinfo_t psinfo; - - (void) sprintf(path, PROCFORMAT, (int)pid); - fd = open(path, O_RDONLY); - if (fd == -1) - return (dmodel); - if ((dmodel = ioctl(fd, PIOCPSINFO, &psinfo)) == -1) - return (dmodel); - return ((int)psinfo.pr_dmodel); -} -/* - * get_executable - return file descriptor for PATH-resolved - * target file. - * - */ -static int -get_executable(char *name) { - int fd = -1; - - if (name != NULL) { - char path[PATH_MAX + 1]; - char line[MAX_INPUT + 1]; - char *p = line; - char *fname = name; - int N = sizeof (line); - struct stat file_att; - - while (*fname == ' ') fname++; - if (fname[0] == '-' || strchr(fname, '/')) { - fd = open(fname, O_RDONLY); - } else { - int len = strlen(fname); - char *dirlist = getenv("PATH"); - char *dir = NULL; - - if (dirlist != NULL) { - dirlist = strdup(dirlist); - dir = strtok(dirlist, ":"); - } - while (fd < 0 && dir != NULL) { - if ((strlen(dir) + len + 1) < sizeof (path)) { - strcat(strcat(strcpy(path, dir), "/"), fname); - fd = open(path, O_RDONLY); - } - dir = strtok(NULL, ":"); - } - if (dirlist != NULL) free(dirlist); - } - if (fstat(fd, &file_att) || !S_ISREG(file_att.st_mode)) { - if (fd >= 0) - close(fd); - return (-1); - } - if (read(fd, p, 2) && p[0] == '#' && p[1] == '!') { - while (N-- > 1 && read(fd, p, 1) && *p != '\n') - p++; - *p = '\0'; - close(fd); - return (get_executable(line)); - } - if (fd >= 0) lseek(fd, 0, SEEK_SET); - } /* %$#@! cstyle complaint */ - return (fd); -} - -/* - * get_elf_class - get the target executable elf class - * i.e. ELFCLASS64 or ELFCLASS32. - */ -static int -get_elf_class(char *filename) -{ - int elfclass = -1; - int elffd = get_executable(filename); - Elf *elf; - size_t size; - char *ident; - GElf_Ehdr ehdr; - - if (elffd < 0) - return (elfclass); - if (elf_version(EV_CURRENT) == EV_NONE) { - (void) close(elffd); - return (elfclass); - } - elf = elf_begin(elffd, ELF_C_READ, (Elf *) 0); - /* - * verify information in file header - */ - if (gelf_getehdr(elf, &ehdr) == (GElf_Ehdr *) 0) { - close(elffd); - return (elfclass); - } - ident = elf_getident(elf, &size); - if (ident[EI_CLASS] == ELFCLASS32) - elfclass = ELFCLASS32; - if (ident[EI_CLASS] == ELFCLASS64) - elfclass = ELFCLASS64; - close(elffd); - return (elfclass); -} -/* - * check_exec_model() - check the consistency between prex data model - * and target elf class and act accordingly - */ -static void -check_exec_model(char **argv, char **envp) -{ - int elfclass; - - elfclass = get_elf_class(g_cmdname); - if (((elfclass == ELFCLASS32) && (prex_dmodel == PR_MODEL_ILP32)) || - ((elfclass == ELFCLASS64) && (prex_dmodel == PR_MODEL_LP64))) - return; - if ((prex_dmodel == PR_MODEL_ILP32) && - (elfclass == ELFCLASS64)) { - (void) fprintf(stderr, gettext( - "Error: 32 bit prex can not exec 64 bit target\n")); - exit(1); - } - if ((prex_dmodel == PR_MODEL_LP64) && - (elfclass == ELFCLASS32)) - prex_isaexec(argv, envp); -} - -/* - * check_pid_model() - check the consistency between prex data model - * and target data model and act accordingly - */ -static void -check_pid_model(char **argv, char **envp) -{ - int dmodel; - - dmodel = get_data_model(g_targetpid); - if (prex_dmodel == dmodel) - return; - if ((prex_dmodel == PR_MODEL_ILP32) && - (dmodel == PR_MODEL_LP64)) { - (void) fprintf(stderr, gettext( - "Error: 32 bit prex can not exec 64 bit target\n")); - exit(1); - } - if ((prex_dmodel == PR_MODEL_LP64) && - (dmodel == PR_MODEL_ILP32)) - prex_isaexec(argv, envp); -} -/* - * prex_isaexec() - there is only one case this function get called - * 64 bit prex, 32 bit target, need to exec 32 bit - * prex here. - */ -static void -prex_isaexec(char **argv, char **envp) -{ - char path[PATH_MAX + sizeof (PREX32DIR)]; - strcat(strcat(strcpy(path, dirname(dirname(argv[0]))), PREX32DIR), - basename(argv[0])); - if (get_elf_class(path) != ELFCLASS32) - strcpy(path, PREX32EXEC); - argv[0] = path; - (void) execve(path, argv, envp); - (void) fprintf(stderr, - gettext("%s: execve(\"%s\") failed\n"), - argv[0], path); - exit(1); -} -void -cmd_listtracefile() -{ - - if (g_kernelmode) { - (void) fprintf(stderr, - gettext("There is no trace file in kernel mode!\n")); - } else { - (void) printf(gettext("Current trace file is: %s\n"), tracefile); - } -} diff --git a/usr/src/cmd/tnf/prex/new.c b/usr/src/cmd/tnf/prex/new.c deleted file mode 100644 index e54276c7a3..0000000000 --- a/usr/src/cmd/tnf/prex/new.c +++ /dev/null @@ -1,57 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -/* - * Includes - */ - -#include <stdio.h> -#include <stdlib.h> -#include <libintl.h> -#include "new.h" - - -/* - * new_alloc() - allocate and bail if neccessary - */ - -void * -new_alloc(size_t size) -{ - void *ptr; - - ptr = malloc(size); - - if (!ptr) { - (void) fprintf(stderr, - gettext("new; out of memory, aborting\n")); - abort(); - - } - return (ptr); - -} /* new_alloc */ diff --git a/usr/src/cmd/tnf/prex/new.h b/usr/src/cmd/tnf/prex/new.h deleted file mode 100644 index 73bd6fcb66..0000000000 --- a/usr/src/cmd/tnf/prex/new.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#ifndef _NEW_H -#define _NEW_H - -#pragma ident "%Z%%M% %I% %E% SMI" - -/* - * Includes - */ - -#include <sys/types.h> - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Defines - */ - -#define new(t) ((t *) (new_alloc(sizeof (t)))) - - -/* - * Declarations - */ - -void *new_alloc(size_t size); - -#ifdef __cplusplus -} -#endif - -#endif /* _NEW_H */ diff --git a/usr/src/cmd/tnf/prex/prbk.c b/usr/src/cmd/tnf/prex/prbk.c deleted file mode 100644 index 5faf8a39bb..0000000000 --- a/usr/src/cmd/tnf/prex/prbk.c +++ /dev/null @@ -1,387 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <string.h> /* for strerror() */ -#include <sys/types.h> -#include <sys/stat.h> -#include <sys/tnf.h> -#include <fcntl.h> -#include <errno.h> -#include <locale.h> - -#include "prbk.h" - -#include <tnf/tnfctl.h> - -extern tnfctl_handle_t *g_hndl; - -typedef struct _pidlist { - pid_t pid; - struct _pidlist *next; -} pidlist_t; - -static boolean_t check_kernelmode(tnfctl_trace_attrs_t *attrs_p); - -static boolean_t -check_kernelmode(tnfctl_trace_attrs_t *attrs_p) -{ - extern int g_kernelmode; - tnfctl_errcode_t err; - - if (!g_kernelmode) { - (void) fprintf(stderr, gettext( - "This command is only available " - "in kernel mode (prex invoked with the -k flag)\n")); - return (B_TRUE); - } - if (attrs_p) { - err = tnfctl_trace_attrs_get(g_hndl, attrs_p); - if (err) { - (void) fprintf(stderr, gettext( - "error on checking trace attributes : %s\n"), - tnfctl_strerror(err)); - return (B_TRUE); - } - } - return (B_FALSE); -} - -/* - * Print trace buffer status (is one allocated, and if so, how big is it. - */ -void -prbk_buffer_list() -{ - tnfctl_trace_attrs_t attrs; - - if (check_kernelmode(&attrs)) - return; - if (attrs.trace_buf_state == TNFCTL_BUF_NONE) { - (void) printf(gettext("No trace buffer allocated\n")); - } else { - (void) printf(gettext("Trace buffer size is %d bytes\n"), - attrs.trace_buf_size); - if (attrs.trace_buf_state == TNFCTL_BUF_BROKEN) { - (void) printf(gettext("Tracing system has failed -- " - "tracing suspended\n")); - } - } -} - - -/* - * Allocate a trace buffer. Check for reasonable size; reject if there's - * already a buffer. - */ -void -prbk_buffer_alloc(int size) -{ - tnfctl_errcode_t err; - tnfctl_trace_attrs_t attrs; - - if (check_kernelmode(&attrs)) - return; - - if (attrs.trace_buf_state != TNFCTL_BUF_NONE) { - (void) fprintf(stderr, - gettext("There is already a buffer allocated\n")); - return; - } - if (size < attrs.trace_min_size) { - (void) fprintf(stderr, gettext( - "Size %d is less than the minimum buffer size of %d -- " - "buffer size set to %d bytes\n"), - size, attrs.trace_min_size, attrs.trace_min_size); - size = attrs.trace_min_size; - } - - err = tnfctl_buffer_alloc(g_hndl, NULL, size); - if (err) { - (void) fprintf(stderr, - gettext("error in allocating buffer: %s\n"), - tnfctl_strerror(err)); - return; - } - - /* get the trace attributes again */ - if (check_kernelmode(&attrs)) - return; - (void) printf(gettext("Buffer of size %d bytes allocated\n"), - attrs.trace_buf_size); -} - - -/* - * Deallocate the kernel's trace buffer. - */ -void -prbk_buffer_dealloc() -{ - tnfctl_errcode_t err; - - if (check_kernelmode(NULL)) - return; - - err = tnfctl_buffer_dealloc(g_hndl); - switch (err) { - case (TNFCTL_ERR_NONE): - (void) printf(gettext("buffer deallocated\n")); - break; - case (TNFCTL_ERR_NOBUF): - (void) fprintf(stderr, - gettext("There is no buffer to deallocate\n")); - break; - case (TNFCTL_ERR_BADDEALLOC): - (void) fprintf(stderr, - gettext("Can't deallocate the buffer when " - "tracing is active\n")); - break; - default: - (void) fprintf(stderr, - gettext("error in deleting buffer: %s\n"), - tnfctl_strerror(err)); - break; - } -} - - -/* - * Process filter routines. - * - * Process id sets are encoded as "pidlists": a linked list of pids. - * In a feeble attempt at encapsulation, the pidlist_t type is private - * to this file; prexgram.y manipulates pidlists only as opaque handles. - */ - -/* - * Add the given pid (new) to the pidlist (pl). - */ -void * -prbk_pidlist_add(void *pl, int new) - -{ - pidlist_t *npl = (pidlist_t *) malloc(sizeof (*npl)); - - if (npl == NULL) { - (void) fprintf(stderr, - gettext("Out of memory -- can't process pid %d\n"), - new); - return (pl); - } - npl->next = pl; - npl->pid = new; - return (npl); -} - -/* - * Add the pids in the given pidlist to the process filter list. - * For each pid, check whether it's already in the filter list, - * and whether the process exists. - */ -void -prbk_pfilter_add(void *pl) -{ - pidlist_t *ppl = (pidlist_t *) pl; - pidlist_t *tmp; - tnfctl_errcode_t err; - - if (check_kernelmode(NULL)) - return; - while (ppl != NULL) { - err = tnfctl_filter_list_add(g_hndl, ppl->pid); - if (err) { - (void) fprintf(stderr, gettext("Process %ld: %s\n"), - ppl->pid, tnfctl_strerror(err)); - } - tmp = ppl; - ppl = ppl->next; - free(tmp); - } -} - -/* - * Drop the pids in the given pidlist from the process filter list. - * For each pid, complain if it's not in the process filter list; - * and if the process no longer exists (and hence has already implicitly - * been dropped from the process filter list), say so. - */ -void -prbk_pfilter_drop(void *pl) -{ - pidlist_t *ppl = (pidlist_t *) pl; - pidlist_t *tmp; - tnfctl_errcode_t err; - - if (check_kernelmode(NULL)) - return; - - while (ppl != NULL) { - tmp = ppl; - err = tnfctl_filter_list_delete(g_hndl, tmp->pid); - switch (err) { - case (TNFCTL_ERR_NONE): - break; - case (TNFCTL_ERR_BADARG): - (void) fprintf(stderr, - gettext("Process %ld is not being traced\n"), - tmp->pid); - break; - case (TNFCTL_ERR_NOPROCESS): - (void) printf(gettext("Process %ld has exited\n"), - tmp->pid); - break; - default: - (void) fprintf(stderr, gettext("Process %ld: %s\n"), - tmp->pid, tnfctl_strerror(err)); - break; - } - ppl = ppl->next; - free(tmp); - } -} - -/* - * Turn process filter mode on or off. The process filter is maintained - * even when process filtering is off, but has no effect: all processes - * are traced. - */ -void -prbk_set_pfilter_mode(boolean_t onoff) -{ - tnfctl_errcode_t err; - - if (check_kernelmode(NULL)) - return; - err = tnfctl_filter_state_set(g_hndl, onoff); - if (err) { - (void) fprintf(stderr, gettext("pfilter: %s\n"), - tnfctl_strerror(err)); - } -} - - -/* - * Report whether process filter mode is currently on or off, and - * dump the current process filter set. - */ -void -prbk_show_pfilter_mode() -{ - tnfctl_errcode_t err; - tnfctl_trace_attrs_t attrs; - pid_t *pids_p; - int i, pid_count; - pid_t *cur_pid; - - if (check_kernelmode(&attrs)) - return; - (void) printf(gettext("Process filtering is %s\n"), - attrs.filter_state ? "on" : "off"); - err = tnfctl_filter_list_get(g_hndl, &pids_p, &pid_count); - if (err) { - (void) fprintf(stderr, - gettext("error in getting process filter list: %s\n"), - tnfctl_strerror(err)); - return; - } - (void) printf(gettext("Process filter set is ")); - if (pid_count == 0) - (void) printf("empty.\n"); - else { - (void) printf("{"); - cur_pid = pids_p; - for (i = 0; i < pid_count; i++, cur_pid++) { - (void) printf("%ld%s", *cur_pid, - (i != (pid_count - 1)) ? ", " : "}\n"); - } - } -} - -/* - * Check for process filtering on with empty pid filter. - */ -void -prbk_warn_pfilter_empty(void) -{ - tnfctl_errcode_t err; - pid_t *pids_p; - int pid_count; - tnfctl_trace_attrs_t attrs; - - if (check_kernelmode(&attrs)) - return; - if (attrs.filter_state) { - err = tnfctl_filter_list_get(g_hndl, &pids_p, &pid_count); - if (err) { - (void) fprintf(stderr, - gettext("error in getting process filter list: %s\n"), - tnfctl_strerror(err)); - return; - } - if (!pid_count) - (void) fprintf(stderr, - gettext("Warning: Process filtering on, \ -but pid filter list is empty\n")); - } -} - - -/* - * Turn kernel tracing on or off. - */ -void -prbk_set_tracing(boolean_t onoff) -{ - tnfctl_errcode_t err; - - if (check_kernelmode(NULL)) - return; - - err = tnfctl_trace_state_set(g_hndl, onoff); - if (err) { - (void) fprintf(stderr, - gettext("error in setting tracing state: %s\n"), - tnfctl_strerror(err)); - } -} - -/* - * Show whether kernel tracing is currently on or off. - */ -void -prbk_show_tracing() -{ - tnfctl_trace_attrs_t attrs; - - if (check_kernelmode(&attrs)) - return; - (void) printf(gettext("Tracing is %s\n"), - attrs.trace_state ? "on" : "off"); -} diff --git a/usr/src/cmd/tnf/prex/prbk.h b/usr/src/cmd/tnf/prex/prbk.h deleted file mode 100644 index 7b3e0fdb66..0000000000 --- a/usr/src/cmd/tnf/prex/prbk.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#ifndef _PRBK_H -#define _PRBK_H - -#pragma ident "%Z%%M% %I% %E% SMI" - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Declarations - */ - -void prbk_buffer_list(void); -void prbk_buffer_alloc(int size); -void prbk_buffer_dealloc(void); -void *prbk_pidlist_add(void *, int); -void prbk_pfilter_add(void *); -void prbk_pfilter_drop(void *); -void prbk_set_pfilter_mode(boolean_t); -void prbk_show_pfilter_mode(void); -void prbk_set_tracing(boolean_t); -void prbk_show_tracing(void); -void prbk_warn_pfilter_empty(void); - -#ifdef __cplusplus -} -#endif - -#endif /* _PRBK_H */ diff --git a/usr/src/cmd/tnf/prex/prexgram.y b/usr/src/cmd/tnf/prex/prexgram.y deleted file mode 100644 index 3dbe9495fb..0000000000 --- a/usr/src/cmd/tnf/prex/prexgram.y +++ /dev/null @@ -1,382 +0,0 @@ -%{ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" -%} - -%token ADD -%token ALLOC -%token BUFFER -%token CLEAR -%token COMMA -%token CONNECT -%token DEALLOC -%token DELETE -%token FILTER -%token CONTINUE -%token CREATE -%token DISABLE -%token ENABLE -%token EQ -%token FCNNAME -%token FCNS -%token ON -%token OFF -%token HELP -%token KTRACE -%token HISTORY -%token IDENT -%token INVAL -%token KILL -%token LIST -%token NL -%token PFILTER -%token PROBES -%token QUIT -%token REGEXP -%token RESUME -%token SCALED_INT -%token SETNAME -%token SETS -%token SOURCE -%token SUSPEND -%token TRACE -%token TRACEFILE -%token UNTRACE -%token VALSTR -%token VALUES - -%{ -#include <stdio.h> -#include <string.h> -#include <sys/types.h> - -#include "set.h" -#include "cmd.h" -#include "fcn.h" -#include "list.h" -#include "expr.h" -#include "spec.h" -#include "source.h" -#include "prbk.h" - -extern int yylex(); - -extern void help_on_topic(char *topic); -extern void help_on_command(int cmd); -extern boolean_t g_kernelmode; -extern tnfctl_handle_t *g_hndl; - -void quit(boolean_t killtarget, boolean_t runtarget); -extern void help(void); -extern void process_cmd(tnfctl_handle_t *hndl, cmd_t *cmd); -extern void cmd_listtracefile(); -%} - -%union -{ - char * strval; - expr_t * exprval; - spec_t * specval; - void * pidlistval; - int intval; -} - -%type <strval> SETNAME FCNNAME IDENT VALSTR REGEXP -%type <intval> CONTINUE DISABLE ENABLE HELP LIST QUIT SOURCE TRACE UNTRACE BUFFER KTRACE PFILTER CLEAR CONNECT command -%type <exprval> expr exprlist -%type <specval> spec speclist -%type <pidlistval> pidlist -%type <intval> SCALED_INT singlepid - -%% - -file : statement_list - ; - -statement_list : /* empty */ { prompt(); } - | statement_list statement - { - if (g_kernelmode) - prbk_warn_pfilter_empty(); - prompt(); - } - ; - -statement : empty_statement - | help_statement - | continue_statement - | quit_statement - | enable_statement - | disable_statement - | trace_statement - | untrace_statement - | connect_statement - | clear_statement - | pfilter_statement - | ktrace_statement - | buffer_statement - | create_statement - | source_statement - | listsets_statement - | listhistory_statement - | listtracefile_statement - | listfcns_statement - | listprobes_statement - | listvalues_statement - | error NL { yyerrok; } - ; - -empty_statement : NL - ; - -command : CONTINUE { $$ = $1; } /* user&kernel */ - | DISABLE { $$ = $1; } - | ENABLE { $$ = $1; } - | HELP { $$ = $1; } - | LIST { $$ = $1; } - | QUIT { $$ = $1; } - | SOURCE { $$ = $1; } - | TRACE { $$ = $1; } - | UNTRACE { $$ = $1; } - | BUFFER { $$ = $1; } /* kernel only */ - | KTRACE { $$ = $1; } - | PFILTER { $$ = $1; } - | CLEAR { $$ = $1; } /* user only */ - | CONNECT { $$ = $1; } - ; - -help_statement : HELP NL { help(); } - | HELP command NL { help_on_command($2); } - | HELP IDENT NL { help_on_topic($2); } - ; - -continue_statement : CONTINUE NL - { - if (!g_kernelmode) YYACCEPT; - } - ; - -quit_statement : QUIT NL { quit(B_TRUE, B_TRUE); } - | QUIT KILL NL { quit(B_TRUE, B_FALSE); } - | QUIT RESUME NL { quit(B_FALSE, B_TRUE); } - | QUIT SUSPEND NL { quit(B_FALSE, B_FALSE); } - ; - -enable_statement : ENABLE SETNAME NL - { - cmd_t *cmd_p; - cmd_p = cmd_set($2, CMD_ENABLE, NULL); - if (cmd_p) - process_cmd(g_hndl, cmd_p); - } - | ENABLE exprlist NL - { - cmd_t *cmd_p; - cmd_p = cmd_expr($2, CMD_ENABLE, NULL); - if (cmd_p) - process_cmd(g_hndl, cmd_p); - } - ; - -disable_statement : DISABLE SETNAME NL - { - cmd_t *cmd_p; - cmd_p = cmd_set($2, CMD_DISABLE, NULL); - if (cmd_p) - process_cmd(g_hndl, cmd_p); - } - | DISABLE exprlist NL - { - cmd_t *cmd_p; - cmd_p = cmd_expr($2, CMD_DISABLE, NULL); - if (cmd_p) - process_cmd(g_hndl, cmd_p); - } - ; - -trace_statement : TRACE SETNAME NL - { - cmd_t *cmd_p; - cmd_p = cmd_set($2, CMD_TRACE, NULL); - if (cmd_p) - process_cmd(g_hndl, cmd_p); - } - | TRACE exprlist NL - { - cmd_t *cmd_p; - cmd_p = cmd_expr($2, CMD_TRACE, NULL); - if (cmd_p) - process_cmd(g_hndl, cmd_p); - } - ; - -untrace_statement : UNTRACE SETNAME NL - { - cmd_t *cmd_p; - cmd_p = cmd_set($2, CMD_UNTRACE, NULL); - if (cmd_p) - process_cmd(g_hndl, cmd_p); - } - | UNTRACE exprlist NL - { - cmd_t *cmd_p; - cmd_p = cmd_expr($2, CMD_UNTRACE, NULL); - if (cmd_p) - process_cmd(g_hndl, cmd_p); - } - ; - -connect_statement : CONNECT FCNNAME SETNAME NL - { - cmd_t *cmd_p; - cmd_p = cmd_set($3, CMD_CONNECT, $2); - if (cmd_p) - process_cmd(g_hndl, cmd_p); - } - | CONNECT FCNNAME exprlist NL - { - cmd_t *cmd_p; - cmd_p = cmd_expr($3, CMD_CONNECT, $2); - if (cmd_p) - process_cmd(g_hndl, cmd_p); - } - ; - -clear_statement : CLEAR SETNAME NL - { - cmd_t *cmd_p; - cmd_p = cmd_set($2, CMD_CLEAR, NULL); - if (cmd_p) - process_cmd(g_hndl, cmd_p); - } - | CLEAR exprlist NL - { - cmd_t *cmd_p; - cmd_p = cmd_expr($2, CMD_CLEAR, NULL); - if (cmd_p) - process_cmd(g_hndl, cmd_p); - } - ; - -create_statement : CREATE SETNAME exprlist NL { (void) set($2, $3); } - | CREATE FCNNAME IDENT NL { fcn($2, $3); } - ; - -source_statement : SOURCE VALSTR NL { source_file($2); } - | SOURCE IDENT NL { source_file($2); } - ; - -listsets_statement : LIST SETS NL { set_list(); } - ; - -listhistory_statement : LIST HISTORY NL { cmd_list(); } - ; - -listtracefile_statement : LIST TRACEFILE NL { cmd_listtracefile(); } - ; - -listfcns_statement : LIST FCNS NL { fcn_list(); } - ; - - ; - -pfilter_statement : PFILTER ON NL - { prbk_set_pfilter_mode(B_TRUE); } - | PFILTER OFF NL - { prbk_set_pfilter_mode(B_FALSE); } - | PFILTER ADD pidlist NL - { prbk_pfilter_add($3); } - | PFILTER DELETE pidlist NL - { prbk_pfilter_drop($3); } - | PFILTER NL - { prbk_show_pfilter_mode(); } - ; - -ktrace_statement : KTRACE ON NL - { prbk_set_tracing(B_TRUE); } - | KTRACE OFF NL - { prbk_set_tracing(B_FALSE); } - | KTRACE NL - { prbk_show_tracing(); } - ; - -listprobes_statement : LIST speclist PROBES SETNAME NL - { list_set($2, $4); } - | LIST speclist PROBES exprlist NL - { list_expr($2, $4); } - ; - -listvalues_statement : LIST VALUES speclist NL { list_values($3); } - ; - -exprlist : /* empty */ { $$ = NULL; } - | exprlist expr { $$ = expr_list($1, $2); } - ; - -speclist : /* empty */ { $$ = NULL; } - | speclist spec { $$ = spec_list($1, $2); } - ; - -expr : spec EQ spec { $$ = expr($1, $3); } - | spec { $$ = expr(spec(strdup("keys"), - SPEC_EXACT), $1); } - ; - -spec : IDENT { $$ = spec($1, SPEC_EXACT); } - | VALSTR { $$ = spec($1, SPEC_EXACT); } - | REGEXP { $$ = spec($1, SPEC_REGEXP); } - ; - -pidlist : pidlist COMMA singlepid - { $$ = prbk_pidlist_add($1, $3); } - | singlepid - { $$ = prbk_pidlist_add(NULL, $1); } - ; - -singlepid : SCALED_INT - ; - -buffer_statement : BUFFER NL - { - prbk_buffer_list(); - } - | BUFFER ALLOC NL - { - extern int g_outsize; - prbk_buffer_alloc(g_outsize); - } - | BUFFER ALLOC SCALED_INT NL - { - prbk_buffer_alloc($3); - } - | BUFFER DEALLOC NL - { - prbk_buffer_dealloc(); - } - ; - - -%% diff --git a/usr/src/cmd/tnf/prex/prexlex.l b/usr/src/cmd/tnf/prex/prexlex.l deleted file mode 100644 index c307c429a9..0000000000 --- a/usr/src/cmd/tnf/prex/prexlex.l +++ /dev/null @@ -1,169 +0,0 @@ -%{ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" -%} - -%a 10000 -%o 10000 - -%{ -#include "spec.h" -#include "expr.h" -#include "y.tab.h" -#include <stdlib.h> -#include <string.h> - -char * qtstr (char * instr); -char * rgstr (char * instr); - -/* -** we substitute i/o routines defined in main.c for the -** standard fare. This allows us to support the "source" -** function by redirecting the input stream from different -** places -*/ -#include "source.h" -#undef input -#undef unput -#undef output -#define input() source_input() -#define unput(c) source_unput(c) -#define output(c) source_output(c) -%} - -IDFIRST [a-zA-Z_\.%] -IDCHAR ({IDFIRST}|[0-9]) -ID {IDFIRST}{IDCHAR}* - -%% - -#.* ; /* eat comments */ -[ \t]+ ; /* eats whitespace */ - -\n { source_nl(); return NL; } -\\\n { source_nl(); } /* escaped newline */ -= return (EQ); -\, return (COMMA); - -add { yylval.intval = ADD; return (ADD); } -alloc { yylval.intval = ALLOC; return (ALLOC); } -buffer { yylval.intval = BUFFER; return (BUFFER); } -clear { yylval.intval = CLEAR; return (CLEAR); } -connect { yylval.intval = CONNECT; return (CONNECT); } -continue { yylval.intval = CONTINUE; return (CONTINUE); } -create { yylval.intval = CREATE; return (CREATE); } -dealloc { yylval.intval = DEALLOC; return (DEALLOC); } -delete { yylval.intval = DELETE; return (DELETE); } -disable { yylval.intval = DISABLE; return (DISABLE); } -enable { yylval.intval = ENABLE; return (ENABLE); } -fcns { yylval.intval = FCNS; return (FCNS); } -filter { yylval.intval = FILTER; return (FILTER); } -help { yylval.intval = HELP; return (HELP); } -history { yylval.intval = HISTORY; return (HISTORY); } -tracefile { yylval.intval = TRACEFILE; return (TRACEFILE); } -kill { yylval.intval = KILL; return (KILL); } -ktrace { yylval.intval = KTRACE; return (KTRACE); } -list { yylval.intval = LIST; return (LIST); } -off { yylval.intval = OFF; return (OFF); } -on { yylval.intval = ON; return (ON); } -pfilter { yylval.intval = PFILTER; return (PFILTER); } -probes { yylval.intval = PROBES; return (PROBES); } -quit { yylval.intval = QUIT; return (QUIT); } -resume { yylval.intval = RESUME; return (RESUME); } -sets { yylval.intval = SETS; return (SETS); } -source { yylval.intval = SOURCE; return (SOURCE); } -suspend { yylval.intval = SUSPEND; return (SUSPEND); } -trace { yylval.intval = TRACE; return (TRACE); } -untrace { yylval.intval = UNTRACE; return (UNTRACE); } -values { yylval.intval = VALUES; return (VALUES); } - -${ID} { yylval.strval = strdup(&yytext[1]); return SETNAME; } -&{ID} { yylval.strval = strdup(&yytext[1]); return FCNNAME; } -{ID} { yylval.strval = strdup(yytext); return IDENT; } -\'[^'\n]*\' { yylval.strval = qtstr(yytext); return VALSTR; } - -\/([^/\\\n]|\\.)*\/ { yylval.strval = rgstr(yytext); return REGEXP; } - -[0-9]+[KkMm]? { - char scale = yytext[yyleng - 1]; - yylval.intval = atoi(yytext); - if (scale == 'k' || scale == 'K') - yylval.intval *= 1024; - else if (scale == 'm' || scale == 'M') - yylval.intval *= 1024 * 1024; - return (SCALED_INT); - } - -. return (INVAL); /* barf on anything else */ - -%% - -/**************************************************************** -qtstr() - shucks a quoted str, and copies it into new memory -****************************************************************/ - -char * -qtstr (char * instr) -{ - char *ptr; - int indx; - - /* skip the leading quote in the copy */ - ptr = strdup(&instr[1]); - - /* null out the trailing quote */ - indx = strlen(ptr) - 1; - indx = (indx < 0) ? 0 : indx; - ptr[indx] = '\0'; - - return ptr; -} /* end qtstr */ - - -/**************************************************************** -rgstr() - shucks a decorated regular expression, and copies it -into new memory -****************************************************************/ - -char * -rgstr (char * instr) -{ - char *ptr; - int indx; - - /* skip the leading slash in the copy */ - ptr = strdup(&instr[1]); - - /* null out the trailing slash */ - indx = strlen(ptr) - 1; - indx = (indx < 0) ? 0 : indx; - ptr[indx] = '\0'; - - return (ptr); - -} /* end rgstr */ - - diff --git a/usr/src/cmd/tnf/prex/queue.c b/usr/src/cmd/tnf/prex/queue.c deleted file mode 100644 index c2e6867bce..0000000000 --- a/usr/src/cmd/tnf/prex/queue.c +++ /dev/null @@ -1,154 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -/* - * Includes - */ - -#include "queue.h" -#include "new.h" - - -/* - * queue_init() - initializes a queue_node to be unlinked. - */ - -void -queue_init(queue_node_t * q) -{ - q->next_p = q->prev_p = q; - -} /* end queue_init */ - - -/* - * queue_prepend() - prepends a queue_node to another in a list - */ - -queue_node_t * -queue_prepend(queue_node_t * h, queue_node_t * q) -{ - if (!h) - return ((q) ? q : NULL); - - if (q) { - queue_node_t *qtail_p = q->prev_p; - queue_node_t *hnode_p = h->next_p; - - hnode_p->prev_p = qtail_p; - h->next_p = q; - - q->prev_p = h; - qtail_p->next_p = hnode_p; - } - return (h); - -} /* end queue_prepend */ - - -/* - * queue_append() - appends a queue_node to another in a list - */ - -queue_node_t * -queue_append(queue_node_t * h, queue_node_t * q) -{ - if (!h) - return ((q) ? q : NULL); - - if (q) { - queue_node_t *htail_p = h->prev_p; - queue_node_t *qtail_p = q->prev_p; - - h->prev_p = qtail_p; - htail_p->next_p = q; - - q->prev_p = htail_p; - qtail_p->next_p = h; - } - return (h); - -} /* end queue_append */ - - -/* - * queue_remove() - removes a node from a list, returns a pointer to the next - * node in the list. - */ - -queue_node_t * -queue_remove(queue_node_t * q) -{ - queue_node_t *n; - - n = q->next_p; - - if (queue_isempty(q)) - return (NULL); - - q->next_p->prev_p = q->prev_p; - q->prev_p->next_p = q->next_p; - - q->next_p = q->prev_p = q; - - return (n); - -} /* end queue_remove */ - - -/* - * queue_isempty() - */ - -boolean_t -queue_isempty(queue_node_t * q) -{ - return ((q->next_p == q)); - -} /* queue_isempty */ - - -/* - * queue_next() - returns the next element in a queue, or NULL if the - * supplied previous item was the last. - */ - -queue_node_t * -queue_next(queue_node_t * h, queue_node_t * q) -{ - if (!h) - return (NULL); - - if (!q) - return (h); - - if (q->next_p == h) - return (NULL); - - return (q->next_p); - -} /* end queue_next */ diff --git a/usr/src/cmd/tnf/prex/queue.h b/usr/src/cmd/tnf/prex/queue.h deleted file mode 100644 index ee9529c0fa..0000000000 --- a/usr/src/cmd/tnf/prex/queue.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#ifndef _QUEUE_H -#define _QUEUE_H - -#pragma ident "%Z%%M% %I% %E% SMI" - -/* - * Includes - */ - -#include <sys/types.h> - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Typedefs - */ - -typedef struct queue_node queue_node_t; -struct queue_node { - queue_node_t *next_p; - queue_node_t *prev_p; -}; - - -/* - * Declarations - */ - -boolean_t queue_isempty(queue_node_t * q); -queue_node_t *queue_prepend(queue_node_t * h, queue_node_t * q); -queue_node_t *queue_append(queue_node_t * h, queue_node_t * q); -void queue_init(queue_node_t * q); -queue_node_t *queue_next(queue_node_t * h, queue_node_t * q); -queue_node_t *queue_remove(queue_node_t * q); - -#ifdef __cplusplus -} -#endif - -#endif /* _QUEUE_H */ diff --git a/usr/src/cmd/tnf/prex/set.c b/usr/src/cmd/tnf/prex/set.c deleted file mode 100644 index db7f4fb29a..0000000000 --- a/usr/src/cmd/tnf/prex/set.c +++ /dev/null @@ -1,181 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -/* - * Includes - */ - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include "queue.h" -#include "set.h" -#include "new.h" - - -/* - * Globals - */ - -static queue_node_t g_setlist = { - &g_setlist, -&g_setlist}; - - -/* - * Forward Declarations - */ - -static void set_destroy(set_t * set_p); -static void set_print(FILE * stream, set_t * set_p); - - -/* - * set() - creates a set - */ - -set_t * -set(char *setname_p, expr_t * exprlist_p) -{ - set_t *new_p; - set_t *old_p; - - /* does this setname exist already? */ - old_p = set_find(setname_p); - if (old_p) - set_destroy(old_p); - - /* create a new set */ - new_p = new(set_t); - queue_init(&new_p->qn); - new_p->setname_p = setname_p; - new_p->exprlist_p = exprlist_p; - - /* append the new set to the global list */ - (void) queue_append(&g_setlist, &new_p->qn); - - return (new_p); - -} /* end set */ - - -/* - * set_destroy() - destroys a set and related resources - */ - -static void -set_destroy(set_t * set_p) -{ - if (!set_p) - return; - - /* remove ourselves from any list */ - if (!queue_isempty(&set_p->qn)) - (void) queue_remove(&set_p->qn); - - if (set_p->setname_p) - free(set_p->setname_p); - - /* destroy the exprlist */ - expr_destroy(set_p->exprlist_p); - - free(set_p); - -} /* end set_destroy */ - - -/* - * set_list() - pretty prints the global setlist - */ - -void -set_list(void) -{ - set_t *set_p; - - set_p = (set_t *) & g_setlist; - while ((set_p = (set_t *) queue_next(&g_setlist, &set_p->qn))) { - (void) printf("$%-8s ", set_p->setname_p); - set_print(stdout, set_p); - (void) printf("\n"); - } - -} /* end set_list */ - - -/* - * set_print() - pretty prints a set - */ - -static void -set_print(FILE * stream, set_t * set_p) -{ - if (!set_p) - return; - - expr_print(stream, set_p->exprlist_p); - -} /* end set_print */ - - -#ifdef OLD -/* - * set_match() - discerns whether a probe is in a set - */ - -boolean_t -set_match(set_t * set_p, const char *name, const char *keys) -{ - if (!set_p) - return (B_FALSE); - - return (expr_match(set_p->exprlist_p, name, keys)); - -} /* end set_match */ -#endif - - -/* - * set_find() - finds a set by name - */ - -set_t * -set_find(char *setname_p) -{ - set_t *set_p; - - if (!setname_p) - return (NULL); - - set_p = (set_t *) & g_setlist; - while ((set_p = (set_t *) queue_next(&g_setlist, &set_p->qn))) - if (strcmp(setname_p, set_p->setname_p) == 0) - return (set_p); - - return (NULL); - -} /* end set_find */ diff --git a/usr/src/cmd/tnf/prex/set.h b/usr/src/cmd/tnf/prex/set.h deleted file mode 100644 index a3bf53be9d..0000000000 --- a/usr/src/cmd/tnf/prex/set.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#ifndef _SET_H -#define _SET_H - -#pragma ident "%Z%%M% %I% %E% SMI" - -/* - * Includes - */ - -#include <stdio.h> -#include <sys/types.h> - -#include "queue.h" -#include "expr.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Typedefs - */ - -typedef struct set { - queue_node_t qn; - char *setname_p; - expr_t *exprlist_p; - -} set_t; - - -/* - * Declarations - */ - -set_t *set(char *name, expr_t * exprlist_p); -void set_list(void); -set_t *set_find(char *setname_p); -boolean_t set_match(set_t * set_p, const char *name, const char *keys); - -#ifdef __cplusplus -} -#endif - -#endif /* _SET_H */ diff --git a/usr/src/cmd/tnf/prex/source.c b/usr/src/cmd/tnf/prex/source.c deleted file mode 100644 index 140c2bcecd..0000000000 --- a/usr/src/cmd/tnf/prex/source.c +++ /dev/null @@ -1,307 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -/* - * Includes - */ - -#include <unistd.h> -#include <stdio.h> -#include <stdlib.h> -#include <stdarg.h> -#include <string.h> -#include <libintl.h> -#include <sys/stat.h> -#include <sys/types.h> -#include <sys/param.h> - -#include "new.h" -#include "queue.h" -#include "source.h" - - -/* - * Typedefs - */ - -typedef struct source { - queue_node_t qn; - char *path; - FILE *instream; - int linenum; - boolean_t isatty; - -} source_t; - - -/* - * Defines - */ - -#define HOME "HOME" -#define PREXRC ".prexrc" - - -/* - * Globals - */ - -static queue_node_t stack; -static source_t *top; - - -/* - * source_init() - initializes the source stack - */ - -void -source_init(void) -{ - source_t *new_p; - struct stat statbuf; - char *home; - int retval; - - - /* initialize the stack queue head */ - queue_init(&stack); - - /* stick the standard input on the bottom of the stack */ - new_p = new(source_t); - queue_init(&new_p->qn); - new_p->path = strdup("<STDIN>"); - new_p->instream = stdin; - new_p->linenum = 1; - new_p->isatty = isatty(fileno(new_p->instream)); - - (void) queue_prepend(&stack, &new_p->qn); - top = new_p; - - /* - * since we are pushing onto a stack, we invert the search order * - * and push the prexrc in the current directory on next. - */ - retval = stat(PREXRC, &statbuf); - if (retval != -1) { - source_file(PREXRC); - } - home = getenv(HOME); - if (home) { - char path[MAXPATHLEN]; - - if ((strlen(home) + strlen(PREXRC) + 2) < (size_t) MAXPATHLEN) { - (void) sprintf(path, "%s/%s", home, PREXRC); - retval = stat(path, &statbuf); - if (retval != -1) { - source_file(path); - } - } - } -} /* end source_init */ - - -/* - * source_file() - pushes a new source onto the stack - */ - -void -source_file(char *path) -{ - FILE *newfile; - source_t *new_p; - - newfile = fopen(path, "r"); - if (!newfile) { - semantic_err(gettext("cannot open \"%s\""), path); - return; - } - new_p = new(source_t); - queue_init(&new_p->qn); - new_p->path = strdup(path); - new_p->instream = newfile; - new_p->linenum = 1; - new_p->isatty = isatty(fileno(new_p->instream)); - - (void) queue_prepend(&stack, &new_p->qn); - top = new_p; - -} /* end source_file */ - - -/* - * source_input() - lexical analyzer input routine - */ - -extern void quit(boolean_t, boolean_t); - -int -source_input(void) -{ - int c; - - if (!top) - return (0); - - c = getc(top->instream); - - if (c == EOF) { - /* - * If we get an EOF at the top level, we quit if we are * - * non-interactive, pretend we saw a new-line if we are * - * interactive. - */ - if (top->instream == stdin) { - if (top->isatty) { - source_output('\n'); - return ('\n'); - } else - quit(B_TRUE, B_TRUE); - } - /* we've exhausted the current stream, pop it, delete it ... */ - if (top->path) - free(top->path); - (void) fclose(top->instream); - (void) queue_remove(&top->qn); - free(top); - - /* point to the new top level i/o stream */ - top = (source_t *) queue_next(&stack, &stack); - - if (!top) - return (0); - - /* trigger a prompt if neccessary */ - prompt(); - return (source_input()); - } - return (c); - -} /* end source_input */ - - -/* - * source_unput() - lexical analyzer unput routine - */ - -void -source_unput(int c) -{ - if (top) - (void) ungetc(c, top->instream); - -} /* end source_unput */ - - -/* - * source_output() - lexical analyzer output routine - */ - -void -source_output(int c) -{ - (void) putc(c, stdout); - -} /* end source_output */ - - -/* - * source_nl() - increment the line counter - */ - -void -source_nl(void) -{ - if (top) - top->linenum++; - -} /* end source_nl */ - - -/* - * yyerror() - - */ - -extern char yytext[]; -extern int g_linenum; - -void -yyerror(char *s) -{ - (void) fprintf(stderr, - gettext("\"%s\", line %d: %s on or before \"%s\"\n"), - top->path, top->linenum, s, yytext); - -} - - -/* - * yywrap() - - */ - -int -yywrap() -{ - return (1); - -} /* end yywrap */ - - -/* - * prompt() - - */ - -extern char **g_argv; - -void -prompt(void) -{ - if (top && top->isatty) - (void) printf("%s> ", g_argv[0]); - -} /* end g_prompt */ - - -/* - * semantic_err() - reports a semantic error - */ - -void -semantic_err(char *format, ...) -{ - va_list ap; - - va_start(ap, format); - - if (!top) - return; - - (void) fprintf(stderr, gettext("\"%s\", line %d: semantic error: "), - top->path, top->linenum); - (void) vfprintf(stderr, format, ap); - (void) fprintf(stderr, gettext("\n")); - -} /* end semantic_err */ diff --git a/usr/src/cmd/tnf/prex/source.h b/usr/src/cmd/tnf/prex/source.h deleted file mode 100644 index 6979bf9f6c..0000000000 --- a/usr/src/cmd/tnf/prex/source.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#ifndef _SOURCE_H -#define _SOURCE_H - -#pragma ident "%Z%%M% %I% %E% SMI" - -/* - * Declarations - */ - -#ifdef __cplusplus -extern "C" { -#endif - -void source_init(void); -void source_file(char *path); -int source_input(void); -void source_unput(int c); -void source_output(int c); -void source_nl(void); - -void yyerror(char *s); -void prompt(void); -void -semantic_err(char *format, ...); - -#ifdef __cplusplus -} -#endif - -#endif /* _SOURCE_H */ diff --git a/usr/src/cmd/tnf/prex/sparc/Makefile b/usr/src/cmd/tnf/prex/sparc/Makefile deleted file mode 100644 index 5b6e8bf7ff..0000000000 --- a/usr/src/cmd/tnf/prex/sparc/Makefile +++ /dev/null @@ -1,33 +0,0 @@ -# -# 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 -# -# -# ident "%Z%%M% %I% %E% SMI" -# -# Copyright 2006 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# -# cmd/tnf/prex/sparc/Makefile - -include ../Makefile.com -CFLAGS += -I.. -I. -LINTFLAGS += -I.. -I. - -install: all $(ROOTPROG32) diff --git a/usr/src/cmd/tnf/prex/sparcv9/Makefile b/usr/src/cmd/tnf/prex/sparcv9/Makefile deleted file mode 100644 index 1b8392fdbe..0000000000 --- a/usr/src/cmd/tnf/prex/sparcv9/Makefile +++ /dev/null @@ -1,36 +0,0 @@ -# -# 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 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 -# -# -#ident "%Z%%M% %I% %E% SMI" -# -# Copyright (c) 1997, by Sun Microsystems, Inc. -# All rights reserved. -# -# cmd/tnf/prex/sparcv9/Makefile - -include ../Makefile.com -include ../../../Makefile.cmd.64 -CFLAGS64 += -I.. -I. -LINTFLAGS64 += -I.. -I. -prexgram.o prexlex.o := CCVERBOSE= - -install: all $(ROOTPROG64) diff --git a/usr/src/cmd/tnf/prex/spec.c b/usr/src/cmd/tnf/prex/spec.c deleted file mode 100644 index d8d125fa45..0000000000 --- a/usr/src/cmd/tnf/prex/spec.c +++ /dev/null @@ -1,392 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -/* - * Includes - */ - -/* we need to define this to get strtok_r from string.h */ -/* SEEMS LIKE A BUG TO ME */ -#define _REENTRANT - -#ifndef DEBUG -#define NDEBUG 1 -#endif - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <libintl.h> -#include <regexpr.h> -#include <assert.h> -#include <sys/types.h> -#include "spec.h" -#include "new.h" -#include "source.h" - - -static boolean_t spec_match(spec_t * spec_p, char *str); - -/* - * Globals - */ - - - -/* - * spec() - builds a spec - */ - -spec_t * -spec(char *str_p, - spec_type_t type) -{ - spec_t *new_p; - - new_p = new(spec_t); - queue_init(&new_p->qn); - new_p->str = str_p; - new_p->type = type; - new_p->regexp_p = NULL; - - if (type == SPEC_REGEXP) { - new_p->regexp_p = compile(str_p, NULL, NULL); - if (!new_p->regexp_p) { - semantic_err(gettext("invalid regular expression")); - free(new_p); - return (NULL); - } - } - return (new_p); - -} /* end spec */ - - -/* - * spec_dup() - duplicates a spec, NOT A SPEC LIST! - */ - -spec_t * -spec_dup(spec_t * spec_p) -{ - spec_t *new_p; - - new_p = spec(strdup(spec_p->str), spec_p->type); - - return (new_p); - -} /* end spec_dup */ - - -/* - * spec_destroy() - destroys a spec list - */ - -void -spec_destroy(spec_t * list_p) -{ - spec_t *spec_p; - - while ((spec_p = (spec_t *) queue_next(&list_p->qn, &list_p->qn))) { - (void) queue_remove(&spec_p->qn); - - if (spec_p->str) - free(spec_p->str); - if (spec_p->regexp_p) - free(spec_p->regexp_p); - free(spec_p); - } - - if (list_p->str) - free(list_p->str); - if (list_p->regexp_p) - free(list_p->regexp_p); - free(list_p); - -} /* end spec_destroy */ - - -/* - * spec_list() - append a spec_t to a list - */ - -spec_t * -spec_list(spec_t * h, - spec_t * f) -{ - /* queue append handles the NULL cases OK */ - return ((spec_t *) queue_append(&h->qn, &f->qn)); - -} /* end spec_list */ - - -/* - * spec_print() - pretty prints a speclist - */ - -void -spec_print(FILE * stream, - spec_t * list_p) -{ - spec_t *spec_p = NULL; - - while ((spec_p = (spec_t *) queue_next(&list_p->qn, &spec_p->qn))) { - switch (spec_p->type) { - case SPEC_EXACT: - (void) fprintf(stream, "'%s'", spec_p->str); - break; - case SPEC_REGEXP: - (void) fprintf(stream, "/%s/", spec_p->str); - break; - } - } - -} /* end spec_print */ - - -/* - * spec_match() - called with a spec and a string, returns whether they - * match. - */ - -static boolean_t -spec_match(spec_t * spec_p, - char *str) -{ - if (!spec_p) - return (B_FALSE); - - switch (spec_p->type) { - case SPEC_EXACT: - return ((strcmp(spec_p->str, str) == 0)); - - case SPEC_REGEXP: - return ((step(str, spec_p->regexp_p) != 0)); - } - - return (B_FALSE); - -} /* end spec_match */ - - -/* - * spec_attrtrav() - traverse an attribute list, calling the supplied - * function on each matching attribute. - */ - -void -spec_attrtrav(spec_t * spec_p, - char *attrs, - spec_attr_fun_t fun, - void *calldatap) -{ - char *lasts; - char *refptr = NULL; - char *escptr = NULL; - char *pair; - char *s; - boolean_t inquote = B_FALSE; - - /* - * * STRATEGY - we make two copies of the attr string. In one * - * string we escape (translate) all relevant quoted characters to * a - * non-significant character. We use this string to feed to * strtok - * to do the parsing. * Once strtok has parsed the string, we use the - * same fragement * positions from the unescaped string to pass to - * the next level. - */ - - /* make two copies of the string */ - refptr = strdup(attrs); - escptr = strdup(attrs); - - /* escape any quoted ';'s in the escptr string */ - for (s = escptr; *s; s++) { - switch (*s) { - case ';': - if (inquote) - *s = '#'; - break; - - case '\'': - inquote = (inquote) ? B_FALSE : B_TRUE; - break; - - default: - /* nothing on purpose */ - break; - } - } - - /* loop over each attribute section separated by ';' */ - for (pair = strtok_r(escptr, ";", &lasts); pair; - pair = strtok_r(NULL, ";", &lasts)) { - char *escattr; - char *escvals; - char *refattr; - char *refvals; - char emptystr[1]; - - escattr = strtok_r(pair, " \t", &escvals); - - /* - * setup the ref pointers to the same locations as the esc - * ptrs - */ - /* - * null the reference string in the same spots as the esc - * string - */ - refattr = (refptr + (escattr - escptr)); - refattr[strlen(escattr)] = '\0'; - - if (escvals && *escvals) { - refvals = (refptr + (escvals - escptr)); - refvals[strlen(escvals)] = '\0'; - } else { - refvals = NULL; - emptystr[0] = '\0'; - } - - if (spec_match(spec_p, refattr)) { - if (refvals) - (*fun) (spec_p, refattr, refvals, calldatap); - else - (*fun) (spec_p, refattr, emptystr, calldatap); - } - } - -alldone: - if (refptr) - free(refptr); - if (escptr) - free(escptr); - -} /* end spec_attrtrav */ - - -/* - * spec_valtrav() - traverse an value list, calling the supplied function on - * each matching value. - */ - -void -spec_valtrav(spec_t * spec_p, - char *valstr, - spec_val_fun_t fun, - void *calldatap) -{ - char *s0; - char *s; - boolean_t intoken = B_FALSE; - boolean_t inquote = B_FALSE; - - /* return immeadiatly on null pointers */ - if (!valstr) - return; - - /* special case, match once on empty string */ - if (!*valstr) { - if (spec_match(spec_p, valstr)) - (*fun) (spec_p, valstr, calldatap); - return; - } - for (s = s0 = valstr; ; s++) { - switch (*s) { - case '\0': - if (intoken) { - if (spec_match(spec_p, s0)) - (*fun) (spec_p, s0, calldatap); - } - return; /* ALL DONE */ - - case '\'': - if (inquote) { - /* end a quoted string */ - inquote = B_FALSE; - intoken = B_FALSE; - *s = '\0'; - if (spec_match(spec_p, s0)) - (*fun) (spec_p, s0, calldatap); - /* next string starts past the quote */ - s0 = s + 1; - } else { - /* start a quoted string */ - inquote = B_TRUE; - intoken = B_TRUE; - s0 = s + 1; /* point past the quote */ - } - break; - - case ' ': - case '\t': - /* ignore whitespace in quoted strings */ - if (inquote) - break; - - if (intoken) { - /* whitespace ended this token */ - intoken = B_FALSE; - *s = '\0'; - if (spec_match(spec_p, s0)) - (*fun) (spec_p, s0, calldatap); - /* next string starts past the whitespace */ - s0 = s + 1; - } - break; - - default: - /* characters all OK inside quoted string */ - if (inquote) - break; - - if (!intoken) { - /* start of unquoted token */ - intoken = B_TRUE; - s0 = s; /* token starts here */ - } - break; - } - } - - -#ifdef TOOSIMPLE - char *v; - char *ls; - - /* - * #### MISSING - need to handle quoted value strings * containing - * whitespace. - */ - - for (v = strtok_r(valstr, " \t", &ls); v; - v = strtok_r(NULL, " \t", &ls)) { - if (spec_match(spec_p, v)) { - (*fun) (spec_p, v, calldatap); - } - } -#endif - -} /* end spec_valtrav */ diff --git a/usr/src/cmd/tnf/prex/spec.h b/usr/src/cmd/tnf/prex/spec.h deleted file mode 100644 index 5972b351e1..0000000000 --- a/usr/src/cmd/tnf/prex/spec.h +++ /dev/null @@ -1,94 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#ifndef _SPEC_H -#define _SPEC_H - -#pragma ident "%Z%%M% %I% %E% SMI" - -/* - * Includes - */ - -#include <stdio.h> -#include <libgen.h> -#include <sys/types.h> - -#include "queue.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Typedefs - */ - -typedef enum spec_type { - SPEC_EXACT, - SPEC_REGEXP - - -} spec_type_t; - - -typedef struct spec { - queue_node_t qn; - char *str; - spec_type_t type; - char *regexp_p; - -} spec_t; - -typedef void -(*spec_attr_fun_t) (spec_t * spec, char *attr, char *value, void *calldatap); -typedef void -(*spec_val_fun_t) (spec_t * spec, char *value, void *calldatap); - - -/* - * Globals - */ - - -/* - * Declarations - */ - -spec_t * spec(char *str_p, spec_type_t type); -void spec_destroy(spec_t * list_p); -void spec_print(FILE * stream, spec_t * list_p); -spec_t * spec_list(spec_t * list_p, spec_t * item_p); -void spec_attrtrav(spec_t * spec_p, char *attrs, - spec_attr_fun_t fun, void *calldata_p); -void spec_valtrav(spec_t * spec_p, char *valstr, - spec_val_fun_t fun, void *calldata_p); -spec_t *spec_dup(spec_t * spec_p); - -#ifdef __cplusplus -} -#endif - -#endif /* _SPEC_H */ diff --git a/usr/src/cmd/tnf/prex/util.c b/usr/src/cmd/tnf/prex/util.c deleted file mode 100644 index bcb0fa8021..0000000000 --- a/usr/src/cmd/tnf/prex/util.c +++ /dev/null @@ -1,56 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -#include <stdio.h> -#include <stdlib.h> -#include <stdarg.h> -#include <libintl.h> - -void -err_fatal(char *s, ...) -{ - va_list ap; - - va_start(ap, s); - (void) vfprintf(stderr, s, ap); - (void) fprintf(stderr, gettext("\n")); - va_end(ap); - exit(1); -} - -#if 0 -void -err_warning(char *s, ...) -{ - va_list ap; - - va_start(ap, s); - (void) vfprintf(stderr, s, ap); - (void) fprintf(stderr, gettext("\n")); - va_end(ap); -} -#endif diff --git a/usr/src/cmd/tnf/tnfdump/Makefile b/usr/src/cmd/tnf/tnfdump/Makefile deleted file mode 100644 index a4fb64a00c..0000000000 --- a/usr/src/cmd/tnf/tnfdump/Makefile +++ /dev/null @@ -1,66 +0,0 @@ -# -# 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 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 -# -# -#ident "%Z%%M% %I% %E% SMI" -# -# Copyright (c) 1989 by Sun Microsystems, Inc. -# -# cmd/tnf/tnfdump/Makefile -# - -PROG= tnfdump - -OBJS.c= main.o cooked.o table.o -OBJS= $(OBJS.c) - -SRCS= $(OBJS.c:%.o=%.c) - -include ../../Makefile.cmd - -POFILES= $(OBJS.c:%.o=%.po) - -CPPFLAGS += -I../../../lib/libtnfprobe -LDLIBS += -ltnf - -.KEEP_STATE: - -all: $(PROG) - -$(PROG): $(OBJS) - $(LINK.c) $(OBJS) -o $@ $(LDLIBS) - $(POST_PROCESS) - -install: all $(ROOTBIN) $(ROOTPROG) - -$(ROOTBIN): - $(INS.dir) - -$(POFILE): $(POFILES) - $(RM) $@ - cat $(POFILES) > $@ - -clean: - $(RM) $(OBJS) - -lint: $(SRCS) lint_SRCS - -include ../../Makefile.targ diff --git a/usr/src/cmd/tnf/tnfdump/cooked.c b/usr/src/cmd/tnf/tnfdump/cooked.c deleted file mode 100644 index ff63d27ba4..0000000000 --- a/usr/src/cmd/tnf/tnfdump/cooked.c +++ /dev/null @@ -1,337 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -#include <unistd.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <fcntl.h> -#include <sys/mman.h> -#include <stdio.h> -#include <stdarg.h> -#include <string.h> -#include <unistd.h> -#include <tnf/tnf.h> -#include <errno.h> -#include <libintl.h> - -#include "state.h" - -#define STREQ(s1, s2, n) (strncmp(s1, s2, n) == 0) - -#define IS_64BIT(kind) ((1 << kind) & \ - ((1 << TNF_K_UINT64) | (1 << TNF_K_INT64))) - -#define PROBE_TYPE "tnf_probe_type" - -static void print_event (entry_t *ent); -static void insert_event (tnf_datum_t, tnf_datum_t); -static void describe_c_brief (tnf_datum_t); -static void describe_target (tnf_datum_t); -static void describe_c_struct (tnf_datum_t); -static void describe_probe_type (tnf_datum_t); -static void describe_event (tnf_datum_t, tnf_datum_t, hrtime_t); - -static hrtime_t base_time = 0; - -void -print_c_header(void) -{ - (void) printf("%16s %16s %5s %5s %10s %3s %-25s %s\n", - "----------------", "----------------", "-----", "-----", - "----------", "---", "-------------------------", - "------------------------"); - (void) printf("%16s %16s %5s %5s %10s %3s %-25s %s\n", - "Elapsed (ms)", "Delta (ms)", "PID", "LWPID", - " TID ", "CPU", "Probe Name", "Data / Description . . ."); - (void) printf("%16s %16s %5s %5s %10s %3s %-25s %s\n", - "----------------", "----------------", "-----", "-----", - "----------", "---", "-------------------------", - "------------------------"); -} - -static void -print_event(entry_t *ent) -{ - tnf_datum_t evt, sched; - hrtime_t normalized_time; - - evt = ent->record; - sched = tnf_get_tag_arg(evt); - if (sched == TNF_DATUM_NULL) { - /* - * should never happen because it had a schedule - * record earlier - */ - fail(0, gettext("event without a schedule record")); - } - normalized_time = ent->time - base_time; - describe_event(evt, sched, normalized_time); -} - -void -print_sorted_events(void) -{ - entry_t *ent; - - table_sort(); - ent = table_get_entry_indexed(0); - if (ent) { - base_time = ent->time; - } - table_print(&print_event); -} - -void -describe_c_record(tnf_datum_t datum) -{ - char *name_str; - tnf_datum_t schedule_rec; - - switch (tnf_get_kind(datum)) { - - case TNF_K_STRUCT: - /* print only event records */ - schedule_rec = tnf_get_tag_arg(datum); - if (schedule_rec != TNF_DATUM_NULL) { - /* event record */ - insert_event(datum, schedule_rec); - } - break; - case TNF_K_STRING: - case TNF_K_ARRAY: - /* Skip arrays at top level */ - break; - case TNF_K_TYPE: - name_str = tnf_get_type_name(datum); - /* REMIND: filter based on property */ - if (STREQ(name_str, PROBE_TYPE, strlen(name_str))) - describe_probe_type(datum); - break; - default: - fail(0, gettext("illegal record at %x (%d)"), - tnf_get_raw(datum), tnf_get_kind(datum)); - break; - } - -} - -static void -describe_probe_type(tnf_datum_t datum) -{ - unsigned n, i; - char *slotname; - size_t slot_len; - - n = tnf_get_slot_count(datum); -#if 0 - /* print the OUTPUT PAD */ - (void) printf("%16s %14s %5s %5s %8s %3s %-25s", - "-", "-", "-", "-", "-", "-", "-"); -#endif - (void) printf("probe\t"); - for (i = 0; i < n; i++) { - slotname = tnf_get_slot_name(datum, i); - slot_len = strlen(slotname); - - /* print all fields except ... */ - if ((!STREQ(slotname, TNF_N_TAG, slot_len)) && - (!STREQ(slotname, TNF_N_PROPERTIES, slot_len)) && - (!STREQ(slotname, TNF_N_SLOT_TYPES, slot_len)) && - (!STREQ(slotname, TNF_N_TYPE_SIZE, slot_len)) && - (!STREQ(slotname, TNF_N_SLOT_NAMES, slot_len))) { - (void) printf(" "); - (void) printf("%s: ", slotname); - describe_c_brief(tnf_get_slot_indexed(datum, - i)); - } - } - (void) printf("\n"); -} - -static void -insert_event(tnf_datum_t datum, tnf_datum_t schedule_rec) -{ - tnf_datum_t temp; - hrtime_t evt_time; - unsigned time_delta = 0; - entry_t element; - - temp = tnf_get_slot_named(schedule_rec, TNF_N_TIME_BASE); - evt_time = tnf_get_int64(temp); - temp = tnf_get_slot_named(datum, TNF_N_TIME_DELTA); - time_delta = (unsigned) tnf_get_int32(temp); - evt_time = evt_time + time_delta; - - element.time = evt_time; - element.record = datum; - table_insert(&element); -} - -#define K_TID "tnf_kthread_id" -#define CPUID "cpuid" - -static void -describe_event(tnf_datum_t datum, tnf_datum_t schedule_rec, hrtime_t evt_time) -{ - unsigned n, i; - char *slotname, *eventname, *tidtype; - tnf_datum_t temp; - int lwpid = 0, pid = 0; - int start_slots = 0; - static hrtime_t last_time = 0; - unsigned long long tid = 0; - - temp = tnf_get_slot_named(schedule_rec, TNF_N_TID); - if (IS_64BIT(tnf_get_kind(temp))) { - tid = tnf_get_int64(temp); - } else { - tid = (unsigned int)tnf_get_int32(temp); - } - tidtype = tnf_get_type_name(temp); - - temp = tnf_get_slot_named(schedule_rec, TNF_N_LWPID); - lwpid = tnf_get_int32(temp); - temp = tnf_get_slot_named(schedule_rec, TNF_N_PID); - pid = tnf_get_int32(temp); - - /* XXX should use TNF_N_KERNEL_SCHEDULE, TNF_N_USER_SCHEDULE */ - if (strcmp(tidtype, K_TID) == 0) { - int cpuid; - /* XXX Assumes cpuid always exists in kernel schedule */ - cpuid = tnf_get_int32(tnf_get_slot_named(schedule_rec, CPUID)); - /* print the OUTPUT schedule record for Kernel case */ - (void) printf("%16.6f %16.6f %5u %5u 0x%-8llx %3d", - evt_time / 1000000.0, - (evt_time - last_time)/1000000.0, - pid, lwpid, tid, cpuid); - } else { - /* print the OUTPUT schedule record */ - (void) printf("%16.6f %16.6f %5u %5u %10llu %3s", - evt_time / 1000000.0, - (evt_time - last_time)/1000000.0, - pid, lwpid, tid, "-"); - } - /* print the tag */ - eventname = tnf_type_get_name(tnf_get_slot_named(datum, TNF_N_TAG)); - (void) printf(" %-25s", eventname); - - /* heuristic - start of data is after TIME_DELTA field */ - start_slots = tnf_get_slot_index(datum, TNF_N_TIME_DELTA); - start_slots++; - - n = tnf_get_slot_count(datum); - - /* print the rest of the fields */ - for (i = start_slots; i < n; i++) { - (void) printf(" "); - slotname = tnf_get_slot_name(datum, i); - (void) printf("%s: ", slotname); - describe_target(tnf_get_slot_indexed(datum, i)); - } - (void) printf("\n"); - last_time = evt_time; -} - -static void -describe_c_struct(tnf_datum_t datum) -{ - unsigned n, i, tag_index; - char *slotname; - - n = tnf_get_slot_count(datum); - - /* print the tag */ - (void) printf(" "); - (void) printf("%s: ", "type"); - describe_c_brief(tnf_get_slot_named(datum, TNF_N_TAG)); - tag_index = tnf_get_slot_index(datum, TNF_N_TAG); - - for (i = 0; i < n; i++) { - /* print the rest of the members */ - if (i != tag_index) { - (void) printf(" "); - slotname = tnf_get_slot_name(datum, i); - (void) printf("%s: ", slotname); - describe_target(tnf_get_slot_indexed(datum, i)); - } - } -} - -static void -describe_c_brief(tnf_datum_t datum) -{ - if (datum == TNF_DATUM_NULL) /* allowed */ - (void) printf("0x%-8x <NULL>", 0); - - else if (tnf_is_scalar(datum)) - describe_scalar(datum); - - else if (tnf_is_record(datum)) { - - switch (tnf_get_kind(datum)) { - case TNF_K_TYPE: - (void) printf("%s", tnf_type_get_name(datum)); - break; - case TNF_K_STRING: - (void) printf("\"%s\"", tnf_get_chars(datum)); - break; - default: - (void) printf("<%s>", tnf_get_type_name(datum)); - } - } else - fail(0, gettext("inline aggregate slots/elements unhandled")); -} - -static void -describe_target(tnf_datum_t datum) -{ - if (datum == TNF_DATUM_NULL) /* allowed */ - (void) printf("0x%-8x <NULL>", 0); - - else if (tnf_is_scalar(datum)) - describe_scalar(datum); - - else if (tnf_is_record(datum)) { - - switch (tnf_get_kind(datum)) { - case TNF_K_STRUCT: - (void) printf("{"); - describe_c_struct(datum); - (void) printf(" }"); - break; - case TNF_K_TYPE: - (void) printf("%s", tnf_type_get_name(datum)); - break; - case TNF_K_STRING: - (void) printf("\"%s\"", tnf_get_chars(datum)); - break; - default: - (void) printf("<%s>", tnf_get_type_name(datum)); - } - } else - fail(0, gettext("inline aggregate slots/elements unhandled")); -} diff --git a/usr/src/cmd/tnf/tnfdump/main.c b/usr/src/cmd/tnf/tnfdump/main.c deleted file mode 100644 index 4c3d76ad7c..0000000000 --- a/usr/src/cmd/tnf/tnfdump/main.c +++ /dev/null @@ -1,406 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -#include <unistd.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <fcntl.h> -#include <sys/mman.h> -#include <stdio.h> -#include <stdarg.h> -#include <string.h> -#include <tnf/tnf.h> -#include <errno.h> -#include <stdlib.h> -#include <libintl.h> -#include <locale.h> - -#include "state.h" - -static caddr_t g_file_base; /* base address of file */ -static char *g_cmdname; /* name of this command */ -static int g_raw = B_FALSE; /* output format */ -static int g_status = EXIT_SUCCESS; /* exit status (from stdlib.h) */ -static const char *print_unsigned = "%u"; -static const char *print_unsigned64 = "%llu"; - -#define OFF(p) (p - g_file_base) - -static void describe_array (tnf_datum_t); -static void describe_brief (tnf_datum_t); -static void describe_record (tnf_datum_t); -static void describe_struct (tnf_datum_t); -static void describe_type (tnf_datum_t); -static void read_tnf_file (int, char *); -static void usage (void); -static void scanargs (int, char **, int *, char ***); - -int -main(int ac, char *av[]) -{ - int numfiles; /* number of files to be printed */ - char **filenames; /* start of file names list */ - int i; - - /* internationalization stuff */ - (void) setlocale(LC_ALL, ""); -#if !defined(TEXT_DOMAIN) /* Should be defined by cc -D */ -#define TEXT_DOMAIN "SYS_TEST" /* Use this only if it weren't */ -#endif - (void) textdomain(TEXT_DOMAIN); - - g_cmdname = av[0]; - scanargs(ac, av, &numfiles, &filenames); - for (i = 0; i < numfiles; i++) { - read_tnf_file(g_raw, filenames[i]); - } - - if (!g_raw) { - if (table_get_num_elements() > 0) { - print_c_header(); - print_sorted_events(); - } - } - - exit(g_status); - - return (0); -} - -static void -scanargs(int argc, char **argv, int *nfiles, char ***files) -{ - int c; - int errflg = B_FALSE; - char *optstr = "rx"; - - while ((c = getopt(argc, argv, optstr)) != EOF) { - switch (c) { - case 'r': - g_raw = B_TRUE; - break; - case 'x': - print_unsigned = "0x%x"; - print_unsigned64 = "0x%llx"; - break; - case '?': - errflg = B_TRUE; - break; - } - } - *files = &argv[optind]; - *nfiles = argc - optind; - if (*nfiles <= 0) { - errflg = B_TRUE; - } - if (errflg) { - usage(); - } -} - - -static void -read_tnf_file(int raw, char *path) -{ - int fd; - struct stat st; - caddr_t p, curr_p, end_p; - TNF *tnf; - tnf_errcode_t err; - tnf_datum_t record; - void (*desc_func)(tnf_datum_t) = describe_c_record; - - if ((fd = open(path, O_RDONLY, 0777)) == -1) { - (void) fprintf(stderr, gettext("%s: cannot open %s\n"), - g_cmdname, path); - g_status = EXIT_FAILURE; - return; - } - if (fstat(fd, &st) != 0) { - (void) fprintf(stderr, gettext("%s: fstat error on %s\n"), - g_cmdname, path); - (void) close(fd); - g_status = EXIT_FAILURE; - return; - } - if (st.st_size == 0) { - (void) fprintf(stderr, gettext("%s: %s is empty\n"), - g_cmdname, path); - (void) close(fd); - g_status = EXIT_FAILURE; - return; - } - if ((p = mmap(NULL, st.st_size, PROT_READ, MAP_SHARED, fd, 0)) - == (caddr_t)-1) { - (void) fprintf(stderr, gettext("%s: mmap error on %s\n"), - g_cmdname, path); - (void) close(fd); - g_status = EXIT_FAILURE; - return; - } - - if (raw) - g_file_base = p; /* for OFF() */ - - if (*p == 0) { - /* - * magic word is 0 - catch the error if entire file is zero. - * tnf_reader_begin() will catch the "not a TNF file" error. - */ - curr_p = p; - end_p = p + st.st_size; - while ((curr_p < end_p) && (*curr_p == 0)) - curr_p++; - if (curr_p == end_p) { - (void) fprintf(stderr, - gettext("%s: %s is an empty TNF file\n"), - g_cmdname, path); - (void) munmap(p, st.st_size); - (void) close(fd); - return; - } - } - - if ((err = tnf_reader_begin(p, st.st_size, &tnf)) != TNF_ERR_NONE) { - (void) fprintf(stderr, gettext("%s: error in %s: %s\n"), - g_cmdname, path, tnf_error_message(err)); - (void) munmap(p, st.st_size); - (void) close(fd); - g_status = EXIT_FAILURE; - return; - } - - /* Describe file header */ - record = tnf_get_file_header(tnf); - if (raw) { - describe_record(record); - desc_func = describe_record; - } - - /* Describe all other records */ - while ((record = tnf_get_next_record(record)) != TNF_DATUM_NULL) - desc_func(record); - - /* Don't munmap for cooked output because we access records later */ - if (raw) - (void) munmap(p, st.st_size); - (void) close(fd); -} - -static void -describe_record(tnf_datum_t datum) -{ - (void) printf("0x%-8x: {\n", OFF(tnf_get_raw(datum))); - - switch (tnf_get_kind(datum)) { - - case TNF_K_STRUCT: - describe_struct(datum); - break; - case TNF_K_STRING: - case TNF_K_ARRAY: - describe_array(datum); - break; - case TNF_K_TYPE: - describe_type(datum); - break; - default: - fail(0, gettext("illegal record at %x (%d)"), - tnf_get_raw(datum), tnf_get_kind(datum)); - break; - } - - (void) printf("\t}\n"); -} - -void -describe_scalar(tnf_datum_t datum) -{ - switch (tnf_get_kind(datum)) { - - case TNF_K_CHAR: - (void) printf("%c", tnf_get_char(datum)); - break; - case TNF_K_INT8: - (void) printf("%d", tnf_get_int8(datum)); - break; - case TNF_K_UINT8: - (void) printf(print_unsigned, (tnf_uint8_t)tnf_get_int8(datum)); - break; - case TNF_K_INT16: - (void) printf("%d", tnf_get_int16(datum)); - break; - case TNF_K_UINT16: - (void) printf(print_unsigned, - (tnf_uint16_t)tnf_get_int16(datum)); - break; - case TNF_K_INT32: - (void) printf("%d", (int)tnf_get_int32(datum)); - break; - case TNF_K_UINT32: - if ((tnf_type_get_property(tnf_get_type(datum), TNF_N_OPAQUE)) - != TNF_DATUM_NULL) { - /* XXX */ - (void) printf("0x%x", - (tnf_uint32_t)tnf_get_int32(datum)); - } else { - (void) printf(print_unsigned, - (tnf_uint32_t)tnf_get_int32(datum)); - } - break; - case TNF_K_INT64: - /* lint not updated, it complains: malformed format string */ - (void) printf("%lld", tnf_get_int64(datum)); - break; - case TNF_K_UINT64: - if ((tnf_type_get_property(tnf_get_type(datum), TNF_N_OPAQUE)) - != TNF_DATUM_NULL) { - (void) printf("0x%llx", - (tnf_uint64_t)tnf_get_int64(datum)); - } else { - /* lint not updated, it complains: malformed format string */ - (void) printf(print_unsigned64, - (tnf_uint64_t)tnf_get_int64(datum)); - } - break; - case TNF_K_FLOAT32: - (void) printf("%f", tnf_get_float32(datum)); - break; - case TNF_K_FLOAT64: - (void) printf("%f", tnf_get_float64(datum)); - break; - case TNF_K_SCALAR: - (void) printf("unhandled scalar"); - break; - default: - fail(0, gettext("not a scalar")); - break; - } -} - -static void -describe_struct(tnf_datum_t datum) -{ - unsigned n, i; - char *slotname; - - n = tnf_get_slot_count(datum); - for (i = 0; i < n; i++) { - slotname = tnf_get_slot_name(datum, i); - (void) printf("%24s ", slotname); - describe_brief(tnf_get_slot_indexed(datum, i)); - (void) printf("\n"); - /* tag_arg heuristic */ - if ((i == 0) && tnf_is_record(datum)) { - tnf_datum_t tag_arg; - - if ((tag_arg = tnf_get_tag_arg(datum)) - != TNF_DATUM_NULL) { - (void) printf("%24s ", TNF_N_TAG_ARG); - describe_brief(tag_arg); - (void) printf("\n"); - } - } - } -} - -static void -describe_array(tnf_datum_t datum) -{ - unsigned n, i; - - describe_struct(datum); /* XXX */ - - if (tnf_is_string(datum)) - (void) printf("%24s \"%s\"\n", "chars", tnf_get_chars(datum)); - else { - n = tnf_get_element_count(datum); - for (i = 0; i < n; i++) { - (void) printf("%24d ", i); - describe_brief(tnf_get_element(datum, i)); - (void) printf("\n"); - } - } -} - -static void -describe_type(tnf_datum_t datum) -{ - describe_struct(datum); -} - -static void -describe_brief(tnf_datum_t datum) -{ - if (datum == TNF_DATUM_NULL) /* allowed */ - (void) printf("0x%-8x <NULL>", 0); - - else if (tnf_is_scalar(datum)) - describe_scalar(datum); - - else if (tnf_is_record(datum)) { - - (void) printf("0x%-8x ", - OFF(tnf_get_raw(datum))); /* common */ - - switch (tnf_get_kind(datum)) { - case TNF_K_TYPE: - (void) printf("%s", tnf_type_get_name(datum)); - break; - case TNF_K_STRING: - (void) printf("\"%s\"", tnf_get_chars(datum)); - break; - default: - (void) printf("<%s>", tnf_get_type_name(datum)); - } - } else - fail(0, gettext("inline aggregate slots/elements unhandled")); -} - -void -fail(int do_perror, char *message, ...) -{ - va_list args; - - va_start(args, message); - (void) fprintf(stderr, gettext("%s: "), g_cmdname); - (void) vfprintf(stderr, message, args); - va_end(args); - if (do_perror) - (void) fprintf(stderr, gettext(": %s"), strerror(errno)); - (void) fprintf(stderr, gettext("\n")); - exit(EXIT_FAILURE); -} - -static void -usage(void) -{ - (void) fprintf(stderr, - gettext("Usage: %s [-r] <tnf_file> [<tnf_file> ...]\n"), - g_cmdname); - exit(EXIT_FAILURE); -} diff --git a/usr/src/cmd/tnf/tnfdump/state.h b/usr/src/cmd/tnf/tnfdump/state.h deleted file mode 100644 index 3b6a51af8d..0000000000 --- a/usr/src/cmd/tnf/tnfdump/state.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#ifndef _STATE_H -#define _STATE_H - -#pragma ident "%Z%%M% %I% %E% SMI" - -#include <sys/time.h> -#include <tnf/tnf.h> - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * data structures for table of record pointers: - * time: timestamp of record - * record: handle on record - */ -typedef struct entry { - hrtime_t time; - tnf_datum_t record; -} entry_t; - -void print_c_header (void); -void describe_c_record (tnf_datum_t); -void print_sorted_events(void); - -void describe_scalar (tnf_datum_t); - -void fail (int, char *, ...); - -/* routines for manipulating table of records */ -void table_insert (entry_t *); -void table_sort (void); -void table_print (void (*print_elem)(entry_t *)); -int table_get_num_elements(void); -entry_t *table_get_entry_indexed(int); - -#ifdef __cplusplus -} -#endif - -#endif /* _STATE_H */ diff --git a/usr/src/cmd/tnf/tnfdump/table.c b/usr/src/cmd/tnf/tnfdump/table.c deleted file mode 100644 index 581b2b7dd3..0000000000 --- a/usr/src/cmd/tnf/tnfdump/table.c +++ /dev/null @@ -1,122 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -#include <stdlib.h> -#include <locale.h> - -#include "state.h" - -/* - * This file defines routines on a table data structure. There is one - * static table that has the following operations: insert, sort, print, - * and get an element by index. - */ - -static entry_t *table_start = NULL; /* start of table */ -static int table_cur = 0; /* current size of table */ -static int table_size = 0; /* max number of elements */ - -#define GUESS_NUM_ELEM (16 * 1024) - -static void table_grow (int); -static int timecompare (const void *, const void *); - -static void -table_grow(int num_entries) -{ - entry_t *temp; - - if (table_start == NULL) { - table_size = num_entries; - table_start = malloc(table_size * sizeof (struct entry)); - if (table_start == NULL) - fail(1, gettext("malloc:")); - return; - } - table_size += num_entries; - temp = realloc(table_start, table_size * sizeof (struct entry)); - if (temp == NULL) - fail(1, gettext("realloc:")); - table_start = temp; -} - -static int -timecompare(const void *i, const void *j) -{ - hrtime_t result; - - result = ((entry_t *)i)->time - ((entry_t *)j)->time; - if (result < (longlong_t) 0) - return (-1); - else if (result == (longlong_t) 0) - return (0); - else - return (1); -} - -/* - * insert an entry into the table. Automatically grows it if needed - */ -void -table_insert(entry_t *element) -{ - if (table_cur >= table_size) { - table_grow(GUESS_NUM_ELEM); - } - /* copy the structure to the array, increment cur index */ - table_start[table_cur++] = *element; -} - -int -table_get_num_elements(void) -{ - return (table_size); -} - -void -table_sort(void) -{ - qsort(table_start, table_cur, sizeof (struct entry), &timecompare); -} - -void -table_print(void (*print_elem)(entry_t *)) -{ - int i; - - for (i = 0; i < table_cur; i++) { - print_elem(&(table_start[i])); - } -} - -entry_t * -table_get_entry_indexed(int n) -{ - if (n < table_cur) - return (&(table_start[n])); - return (NULL); -} diff --git a/usr/src/cmd/tnf/tnfxtract/Makefile b/usr/src/cmd/tnf/tnfxtract/Makefile deleted file mode 100644 index 543ec63c9b..0000000000 --- a/usr/src/cmd/tnf/tnfxtract/Makefile +++ /dev/null @@ -1,60 +0,0 @@ -# -# 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 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 -# -# -# ident "%Z%%M% %I% %E% SMI" -# -# Copyright 2003 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# -# cmd/tnf/tnfxtract/Makefile -# - -PROG= tnfxtract - -include ../../Makefile.cmd - -$(64ONLY)SUBDIRS = $(MACH) -$(BUILD64)SUBDIRS += $(MACH64) - -all := TARGET = all -install := TARGET = install -clean := TARGET = clean -clobber := TARGET = clobber -lint := TARGET = lint - -.KEEP_STATE: - -all: $(SUBDIRS) - -clean clobber lint: $(SUBDIRS) - -install: $(SUBDIRS) - -$(RM) $(ROOTPROG) - -$(LN) $(ISAEXEC) $(ROOTPROG) - - -$(SUBDIRS): FRC - @cd $@; pwd; $(MAKE) $(TARGET) - -FRC: - -include ../../Makefile.targ diff --git a/usr/src/cmd/tnf/tnfxtract/Makefile.com b/usr/src/cmd/tnf/tnfxtract/Makefile.com deleted file mode 100644 index d7774db366..0000000000 --- a/usr/src/cmd/tnf/tnfxtract/Makefile.com +++ /dev/null @@ -1,61 +0,0 @@ -# -# 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 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 1994, 2002 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# -# Copyright (c) 2018, Joyent, Inc. - -PROG= tnfxtract - -OBJS.c= tnfxtract.o - -OBJS= $(OBJS.c) - -SRCS= $(OBJS.c:%.o=../%.c) - -include ../../../Makefile.cmd - -LFLAGS= -v -LDLIBS += -lkvm -CERRWARN += $(CNOWARN_UNINIT) - -# not linted -SMATCH=off - -.KEEP_STATE: - -all: $(PROG) - -$(PROG): $(OBJS) - $(LINK.c) $(OBJS) -o $@ $(LDLIBS) - $(POST_PROCESS) - -clean: - $(RM) $(OBJS) - -lint: lint_SRCS - -%.o: ../%.c - $(COMPILE.c) $< - -include ../../../Makefile.targ diff --git a/usr/src/cmd/tnf/tnfxtract/amd64/Makefile b/usr/src/cmd/tnf/tnfxtract/amd64/Makefile deleted file mode 100644 index 074aa0891e..0000000000 --- a/usr/src/cmd/tnf/tnfxtract/amd64/Makefile +++ /dev/null @@ -1,32 +0,0 @@ -# -# 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 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 2004 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# -# ident "%Z%%M% %I% %E% SMI" -# - -include ../Makefile.com -include ../../../Makefile.cmd.64 - -install: all $(ROOTPROG64) diff --git a/usr/src/cmd/tnf/tnfxtract/i386/Makefile b/usr/src/cmd/tnf/tnfxtract/i386/Makefile deleted file mode 100644 index 84309e70a3..0000000000 --- a/usr/src/cmd/tnf/tnfxtract/i386/Makefile +++ /dev/null @@ -1,32 +0,0 @@ -# -# 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 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 -# -# -#ident "%Z%%M% %I% %E% SMI" -# -# Copyright (c) 1997, by Sun Microsystems, Inc. -# All rights reserved. -# -# cmd/tnf/tnfxtract/sparc/Makefile - -include ../Makefile.com - -install: all $(ROOTPROG32) diff --git a/usr/src/cmd/tnf/tnfxtract/sparcv9/Makefile b/usr/src/cmd/tnf/tnfxtract/sparcv9/Makefile deleted file mode 100644 index f77e6f4858..0000000000 --- a/usr/src/cmd/tnf/tnfxtract/sparcv9/Makefile +++ /dev/null @@ -1,33 +0,0 @@ -# -# 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 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 -# -# -#ident "%Z%%M% %I% %E% SMI" -# -# Copyright (c) 1997, by Sun Microsystems, Inc. -# All rights reserved. -# -# cmd/tnf/tnfxtract/sparcv9/Makefile - -include ../Makefile.com -include ../../../Makefile.cmd.64 - -install: all $(ROOTPROG64) diff --git a/usr/src/cmd/tnf/tnfxtract/tnfxtract.c b/usr/src/cmd/tnf/tnfxtract/tnfxtract.c deleted file mode 100644 index 9e1ac13d61..0000000000 --- a/usr/src/cmd/tnf/tnfxtract/tnfxtract.c +++ /dev/null @@ -1,421 +0,0 @@ -/* - * 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 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 2004 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -#include <unistd.h> -#include <stdlib.h> -#include <stdio.h> -#include <libintl.h> -#include <unistd.h> -#include <string.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <kvm.h> -#include <fcntl.h> -#include <sys/mman.h> -#include <sys/tnf.h> -#include <sys/tnf_com.h> -#include <nlist.h> -#include <errno.h> - -#define TNFDEV "/dev/tnfmap" - -#define MAXFWTRY 5 - -typedef struct { - boolean_t ever_read; - tnf_uint32_t generation; - tnf_uint16_t bytes_valid; -} BLOCK_STATUS; - -static char *dumpfile; /* Dump file if extracting from crashdump */ -static char *namelist; /* Symbol tbl. if extracting from crashdump */ -static kvm_t *kvm_p; /* Handle for kvm_open, kvm_read, ... */ - -static struct nlist kvm_syms[] = { - { "tnf_buf" }, - { "tnf_trace_file_size" }, - { NULL } -}; - -static uintptr_t dump_bufaddr; -static size_t tnf_bufsize; -static char *program_name; -static int input_fd; -static int output_fd; -static tnf_file_header_t *tnf_header; - -/* - * usage() - gives a description of the arguments, and exits - */ - -static void -usage(char *argv[], const char *msg) -{ - if (msg) - (void) fprintf(stderr, - gettext("%s: %s\n"), argv[0], msg); - - (void) fprintf(stderr, gettext( - "usage: %s [-d <dumpfile> -n <symbolfile> ] " - "<output-filename>\n"), argv[0]); - exit(1); -} /* end usage */ - - -/* - * Write 'size' bytes at offset 'offset' from 'addr' - * to the output file. Bail out unceremoniously if anything goes wrong. - */ -static void -writeout(char *addr, int offset, int size) - -{ - if (lseek(output_fd, offset, SEEK_SET) < 0) { - perror("lseek"); - exit(1); - } - if (write(output_fd, addr, size) != size) { - perror("write"); - exit(1); - } -} - - -static void -dumpfile_init() - -{ - kvm_p = kvm_open(namelist, dumpfile, NULL, O_RDONLY, program_name); - if (kvm_p == NULL) { - /* kvm_open prints an error message */ - exit(1); - } - if (kvm_nlist(kvm_p, kvm_syms) != 0) { - (void) fprintf(stderr, gettext( - "Symbol lookup error in %s\n"), namelist); - exit(1); - } - if (kvm_read(kvm_p, kvm_syms[0].n_value, (char *) &dump_bufaddr, - sizeof (dump_bufaddr)) != sizeof (dump_bufaddr) || - kvm_read(kvm_p, kvm_syms[1].n_value, (char *) &tnf_bufsize, - sizeof (tnf_bufsize)) != sizeof (tnf_bufsize)) { - (void) fprintf(stderr, gettext( - "kvm_read error in %s\n"), dumpfile); - exit(1); - } - if (dump_bufaddr == (uintptr_t)NULL || tnf_bufsize == 0) { - (void) fprintf(stderr, gettext( - "No trace data available in the kernel.\n")); - exit(1); - } -} - -static void -live_kernel_init() - -{ - tifiocstate_t tstate; - - if ((input_fd = open(TNFDEV, O_RDWR)) < 0) { - perror(TNFDEV); - exit(1); - } - if (ioctl(input_fd, TIFIOCGSTATE, &tstate) < 0) { - perror(gettext("Error getting trace system state")); - exit(1); - } - if (tstate.buffer_state != TIFIOCBUF_OK) { - (void) fprintf(stderr, gettext( - "No trace data available in the kernel.\n")); - exit(1); - } - tnf_bufsize = tstate.buffer_size; -} - -static void -read_tnf_header(char *addr) - -{ - if (dumpfile != NULL) { - if (kvm_read(kvm_p, dump_bufaddr, addr, 512) != 512) { - (void) fprintf(stderr, gettext( - "Error reading tnf header from dump file.\n")); - exit(1); - } - } else { - if (ioctl(input_fd, TIFIOCGHEADER, addr) != 0) { - perror(gettext("Error reading tnf header from kernel")); - exit(1); - } - } -} - -static int -read_tnf_block(tnf_block_header_t *addr, int block_num) - -{ - int offset; - tifiocgblock_t ioctl_arg; - - if (dumpfile != NULL) { - offset = tnf_header->directory_size + - block_num * tnf_header->block_size; - if (kvm_read(kvm_p, dump_bufaddr + offset, (char *) addr, - tnf_header->block_size) != tnf_header->block_size) { - (void) fprintf(stderr, gettext( - "Error reading tnf block.\n")); - exit(1); - } - } else { - ioctl_arg.dst_addr = (char *) addr; - ioctl_arg.block_num = block_num; - if (ioctl(input_fd, TIFIOCGBLOCK, &ioctl_arg) < 0) { - if (errno == EBUSY) - return (EBUSY); - perror(gettext("Error reading tnf block")); - exit(1); - } - } - return (0); -} - -static void -read_tnf_fwzone(tnf_ref32_t *dest, int start, int slots) - -{ - int offset; - int len; - tifiocgfw_t ioctl_arg; - - if (dumpfile != NULL) { - /* LINTED assignment of 64-bit integer to 32-bit integer */ - offset = tnf_header->block_size + start * sizeof (tnf_ref32_t); - /* LINTED assignment of 64-bit integer to 32-bit integer */ - len = slots * sizeof (tnf_ref32_t); - if (kvm_read(kvm_p, dump_bufaddr + offset, (char *) dest, - len) != len) { - (void) fprintf(stderr, gettext( - "Error reading tnf forwarding zone.\n")); - exit(1); - } - } else { - /* LINTED pointer cast may result in improper alignment */ - ioctl_arg.dst_addr = (long *) dest; - ioctl_arg.start = start; - ioctl_arg.slots = slots; - if (ioctl(input_fd, TIFIOCGFWZONE, &ioctl_arg) < 0) { - perror(gettext("Error reading tnf block")); - exit(1); - } - } -} - -int -main(int argc, char *argv[]) -{ - const char *optstr = "d:n:"; - const char *outfile; - char *local_buf; - int c; - tnf_uint32_t *magicp; - tnf_block_header_t *block_base, *blockp; - BLOCK_STATUS *block_stat, *bsp; - int block_num; - boolean_t any_unread, any_different, retry; - tnf_ref32_t *fwzone; - int fwzonesize; - int i; - int fwtries; - int block_count; - - program_name = argv[0]; - while ((c = getopt(argc, argv, optstr)) != EOF) { - switch (c) { - case 'd': - dumpfile = optarg; - break; - case 'n': - namelist = optarg; - break; - case '?': - usage(argv, gettext("unrecognized argument")); - } - } - if (optind != argc - 1) { - usage(argv, gettext("too many or too few arguments")); - } else { - outfile = argv[optind]; - } - if ((dumpfile != NULL) ^ (namelist != NULL)) { - usage(argv, gettext("must specify both or neither of the " - "-d and -n options")); - } - - output_fd = open(outfile, O_WRONLY | O_CREAT | O_TRUNC, 0600); - if (output_fd < 0) { - perror(outfile); - exit(1); - } - if (dumpfile != NULL) - dumpfile_init(); - else - live_kernel_init(); - - if ((local_buf = malloc(tnf_bufsize)) == NULL) { - (void) fprintf(stderr, - gettext("tnfxtract memory allocation failure\n")); - exit(1); - } - - /* Read header, get block size, check for version mismatch */ - read_tnf_header(local_buf); - /*LINTED pointer cast may result in improper alignment*/ - magicp = (tnf_uint32_t *) local_buf; - /*LINTED pointer cast may result in improper alignment*/ - tnf_header = (tnf_file_header_t *)(local_buf + sizeof (*magicp)); - if (*magicp != TNF_MAGIC) { - (void) fprintf(stderr, gettext( - "Buffer is not in TNF format.\n")); - exit(1); - } - if (tnf_header->file_version != TNF_FILE_VERSION) { - (void) fprintf(stderr, - gettext("Version mismatch (tnfxtract: %d; buffer: %d)\n"), - TNF_FILE_VERSION, tnf_header->file_version); - exit(1); - } - writeout(local_buf, 0, tnf_header->block_size); - /* LINTED pointer cast may result in improper alignment */ - block_base = (tnf_block_header_t *) - (local_buf + tnf_header->directory_size); - block_count = tnf_header->block_count - - tnf_header->directory_size / tnf_header->block_size; - fwzonesize = tnf_header->directory_size - tnf_header->block_size; - - block_stat = (BLOCK_STATUS *) - calloc(block_count, sizeof (BLOCK_STATUS)); - if (block_stat == NULL) { - (void) fprintf(stderr, - gettext("tnfxtract memory allocation failure\n")); - exit(1); - } - - for (bsp = block_stat; bsp != block_stat + block_count; ++bsp) - bsp->ever_read = B_FALSE; - /* - * Make repeated passes until we've read every non-tag block. - */ - do { - any_unread = B_FALSE; - bsp = block_stat; - block_num = 0; - blockp = block_base; - while (block_num != block_count) { - if (!bsp->ever_read) { - if (read_tnf_block(blockp, block_num) != 0) - any_unread = B_TRUE; - else { - bsp->ever_read = B_TRUE; - bsp->generation = blockp->generation; - bsp->bytes_valid = blockp->bytes_valid; - writeout((char *) blockp, - /* LINTED cast 64 to 32 bit */ - (int)((char *) blockp - local_buf), - tnf_header->block_size); - } - } - ++bsp; - ++block_num; - /* LINTED pointer cast may result in improper alignment */ - blockp = (tnf_block_header_t *) - ((char *) blockp + tnf_header->block_size); - } - } while (any_unread); - - /* - * Then read tag blocks only, until we have two consecutive, - * consistent reads. - */ - do { - any_different = B_FALSE; - bsp = block_stat; - block_num = 0; - blockp = block_base; - while (block_num != block_count) { - if (read_tnf_block(blockp, block_num) == 0 && - blockp->generation == TNF_TAG_GENERATION_NUM && - (bsp->generation != TNF_TAG_GENERATION_NUM || - bsp->bytes_valid != blockp->bytes_valid)) { - bsp->generation = TNF_TAG_GENERATION_NUM; - bsp->bytes_valid = blockp->bytes_valid; - writeout((char *) blockp, - /* LINTED cast 64bit to 32 bit */ - (int)((char *) blockp - local_buf), - tnf_header->block_size); - any_different = B_TRUE; - } - ++bsp; - ++block_num; - /* LINTED pointer cast may result in improper alignment */ - blockp = (tnf_block_header_t *) - ((char *) blockp + tnf_header->block_size); - } - } while (any_different); - - /* - * Then read the forwarding pointers. If any are -1: - * sleep briefly, then make another pass. - */ - /*LINTED pointer cast may result in improper alignment*/ - fwzone = (tnf_ref32_t *)(local_buf + tnf_header->block_size); - - read_tnf_fwzone(fwzone, 0, - /* LINTED cast from 64-bit integer to 32-bit integer */ - (int)(fwzonesize / sizeof (fwzone[0]))); - fwtries = 0; - while (fwtries != MAXFWTRY) { - retry = B_FALSE; - for (i = 0; i != fwzonesize / sizeof (fwzone[0]); ++i) { - if (fwzone[i] == -1) { - read_tnf_fwzone(&fwzone[i], i, 1); - if (!retry) { - retry = B_TRUE; - ++fwtries; - } - } - } - if (!retry) - break; - sleep(2); - } - if (fwtries == MAXFWTRY) { - (void) fprintf(stderr, gettext( - "Warning: forwarding pointers may " - "be invalid.\n")); - } - writeout((char *) fwzone, tnf_header->block_size, fwzonesize); - return (0); -} diff --git a/usr/src/cmd/troff/troff.d/tmac.d/an b/usr/src/cmd/troff/troff.d/tmac.d/an index 2884709215..e05f252633 100644 --- a/usr/src/cmd/troff/troff.d/tmac.d/an +++ b/usr/src/cmd/troff/troff.d/tmac.d/an @@ -284,8 +284,6 @@ .if '\\$2'3tecla' .ds ]D Interactive Command-line Input Library Functions .if '\\$2'3THR' .ds ]D Threads Library Functions .if '\\$2'3thr' .ds ]D Threads Library Functions -.if '\\$2'3TNF' .ds ]D TNF Library Functions -.if '\\$2'3tnf' .ds ]D TNF Library Functions .if '\\$2'3TSOL' .ds ]D Trusted Extensions Library Functions .if '\\$2'3tsol' .ds ]D Trusted Extensions Library Functions .if '\\$2'3UCB' .ds ]D SunOS/BSD Compatibility Library Functions diff --git a/usr/src/cmd/troff/troff.d/tmac.d/ansun b/usr/src/cmd/troff/troff.d/tmac.d/ansun index 0893087b80..41f41dd0cb 100644 --- a/usr/src/cmd/troff/troff.d/tmac.d/ansun +++ b/usr/src/cmd/troff/troff.d/tmac.d/ansun @@ -292,8 +292,6 @@ .if '\\$2'3socket' .ds ]D Sockets Library Functions .if '\\$2'3THR' .ds ]D Threads Library Functions .if '\\$2'3thr' .ds ]D Threads Library Functions -.if '\\$2'3TNF' .ds ]D TNF Library Functions -.if '\\$2'3tnf' .ds ]D TNF Library Functions .if '\\$2'3UCB' .ds ]D SunOS/BSD Compatibility Library Functions .if '\\$2'3ucb' .ds ]D SunOS/BSD Compatibility Library Functions .if '\\$2'3VOLMGT' .ds ]D Volume Management Library Functions diff --git a/usr/src/lib/Makefile b/usr/src/lib/Makefile index 5d7b9fb816..9e65c79ce6 100644 --- a/usr/src/lib/Makefile +++ b/usr/src/lib/Makefile @@ -222,9 +222,6 @@ SUBDIRS += \ libtecla \ libtermcap \ libthread \ - libtnf \ - libtnfctl \ - libtnfprobe \ libtsnet \ libtsol \ libumem \ @@ -465,9 +462,6 @@ HDRSUBDIRS= \ libsysevent \ libtecla \ libtermcap \ - libtnf \ - libtnfctl \ - libtnfprobe \ libtsnet \ libtsol \ libumem \ @@ -678,7 +672,6 @@ libsun_ima: libdevinfo libsysevent libsysevent: libsecdb libtecla: libcurses libtermcap: libcurses -libtnfctl: ../cmd/sgs/libelf libtsalarm: libpcp libtsnet: libtsol libsecdb libtsol: libsecdb diff --git a/usr/src/lib/libc/port/threads/thr.c b/usr/src/lib/libc/port/threads/thr.c index 9308d8277f..0ee28c0c59 100644 --- a/usr/src/lib/libc/port/threads/thr.c +++ b/usr/src/lib/libc/port/threads/thr.c @@ -1215,11 +1215,6 @@ set_thread_vars() } } -/* PROBE_SUPPORT begin */ -#pragma weak __tnf_probe_notify -extern void __tnf_probe_notify(void); -/* PROBE_SUPPORT end */ - /* same as atexit() but private to the library */ extern int _atexit(void (*)(void)); @@ -1529,11 +1524,6 @@ libc_init(void) libc__xpg4 = __xpg4; libc__xpg6 = __xpg6; - /* PROBE_SUPPORT begin */ - if (self->ul_primarymap && __tnf_probe_notify != NULL) - __tnf_probe_notify(); - /* PROBE_SUPPORT end */ - init_sigev_thread(); init_aio(); diff --git a/usr/src/lib/libtnf/Makefile b/usr/src/lib/libtnf/Makefile deleted file mode 100644 index 6bdbfa0f33..0000000000 --- a/usr/src/lib/libtnf/Makefile +++ /dev/null @@ -1,113 +0,0 @@ -# -# 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 2008 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# -# - -LIBRARY= libtnf.a -VERS= .1 -OBJECTS= $(MACH)dep.o \ - ref.o \ - abi.o \ - util.o \ - info.o \ - datum.o \ - record.o \ - scalar.o \ - array.o \ - struct.o \ - type.o \ - error.o \ - access.o \ - reader.o - -include ../Makefile.lib - -SRCDIR = . - -TEXT_DOMAIN= SUNW_OST_OSLIB -XGETFLAGS= -a -POFILE= $(LIBRARY:%.a=%.po) -POFILES= _error.po - -LIBS= $(DYNLIB) - -LDLIBS += -lc - -HDRS= tnf.h -ROOTHDRDIR= $(ROOT)/usr/include/tnf -ROOTHDRS= $(HDRS:%=$(ROOTHDRDIR)/%) -CHECKHDRS= $(HDRS:%.h=%.check) -$(ROOTHDRS) := FILEMODE = 0644 -CHECKHDRS = $(HDRS:%.h=%.check) - -$(ROOTHDRS) := FILEMODE = 644 - -CPPFLAGS += -D_DATUM_MACROS -D_REENTRANT - - -CERRWARN += -_gcc=-Wno-unused-variable - -.KEEP_STATE: - -all: $(LIBS) - -install: all $(ROOTLIBDIR) $(ROOTLIBS) $(ROOTLINKS) - -install_h: $(ROOTHDRDIR) $(ROOTHDRS) - - -check: $(CHECKHDRS) - -$(ROOTLIBDIR) $(ROOTHDRDIR): - $(INS.dir) - -$(ROOTHDRDIR)/% : % - $(INS.file) - -ASFLAGS= $(AS_PICFLAGS) -P -D_SYS_SYS_S -D_LOCORE -D_ASM -DPIC -DLOCORE $(CPPFLAGS) -BUILD.s= $(AS) $(ASFLAGS) $< -o $@ - -pics/%.o: ./%.s - $(BUILD.s) - $(POST_PROCESS_O) - -objs/%.o: ./%.s - $(BUILD.s) - $(POST_PROCESS_O) - -_msg: $(MSGDOMAIN) $(POFILE) - $(RM) $(MSGDOMAIN)/$(POFILE) - $(CP) $(POFILE) $(MSGDOMAIN) - -$(POFILE): $(POFILES) - $(RM) $@ - $(CAT) $(POFILES) > $@ - -$(POFILES): - $(RM) messages.po - $(XGETTEXT) $(XGETFLAGS) `$(GREP) -l gettext *.[ch]*` - $(SED) -e '/^# msg/d' -e '/^domain/d' messages.po > $@ - $(RM) messages.po - -include ../Makefile.targ diff --git a/usr/src/lib/libtnf/abi.c b/usr/src/lib/libtnf/abi.c deleted file mode 100644 index a50068eba5..0000000000 --- a/usr/src/lib/libtnf/abi.c +++ /dev/null @@ -1,578 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -#include "libtnf.h" - -/* - * Operations based on ABI bootstrap assumptions - */ - -#define _GET_TAG(tnf, p) \ - _GET_REF32(tnf, p) - -#define _GET_TAG_ARG(tnf, p) \ - _GET_REF16(tnf, p) - -#define _GET_SELF_SIZE(tnf, p) \ - _GET_UINT32(tnf, &((struct tnf_array_hdr *)(p))->self_size) - -#define _GET_NAME(tnf, p) \ - _GET_REF32(tnf, &((struct tnf_type_hdr *)(p))->name) - -#define _GET_PROPERTIES(tnf, p) \ - _GET_REF32(tnf, &((struct tnf_type_hdr *)(p))->properties) - -#define _GET_SLOT_TYPES(tnf, p) \ - _GET_REF32(tnf, &((struct tnf_struct_type_hdr *)(p))->slot_types) - -#define _GET_TYPE_SIZE(tnf, p) \ - _GET_UINT32(tnf, &((struct tnf_struct_type_hdr *)(p))->type_size) - -#define _GET_HEADER_SIZE(tnf, p) \ - _GET_UINT32(tnf, &((struct tnf_array_type_hdr *)(p))->header_size) - -#define _GET_DERIVED_BASE(tnf, p) \ - _GET_REF32(tnf, &((struct tnf_derived_type_hdr *)(p))->derived_base) - -/* - * Static declarations - */ - -static caddr_t fetch_slot(TNF *, caddr_t, tnf_ref32_t *); - -/* - * retrieve tag slot from a record - */ - -tnf_ref32_t * -_tnf_get_tag(TNF *tnf, tnf_ref32_t *record) -{ - return (_GET_TAG(tnf, record)); -} - -/* - * Retrieve tag_arg from tag slot of a record - */ - -tnf_ref32_t * -_tnf_get_tag_arg(TNF *tnf, tnf_ref32_t *record) -{ - return (_GET_TAG_ARG(tnf, record)); -} - -/* - * Retrieve the self_size slot of an ABI array record - */ - -size_t -_tnf_get_self_size(TNF *tnf, tnf_ref32_t *array) -{ - return (_GET_SELF_SIZE(tnf, array)); -} - -/* - * Calculate the number of elements in ABI array record - */ - -unsigned -_tnf_get_element_count(TNF *tnf, tnf_ref32_t *array, unsigned eltsize) -{ - size_t size, hdrsize; -#ifdef INFINITE_RECURSION_ARRAY - tnf_ref32_t *base_tag; - - size = _tnf_get_self_size(tnf, array); - base_tag = _tnf_get_base_tag(tnf, _tnf_get_tag(tnf, array)); - hdrsize = _tnf_get_header_size(tnf, base_tag); - return (((size - hdrsize) / eltsize)); -#else - size = _tnf_get_self_size(tnf, array); - hdrsize = sizeof (struct tnf_array_hdr); - return (((size - hdrsize) / eltsize)); -#endif -} - -/* - * Retrieve the base pointer of an ABI array record - */ - -caddr_t -/* ARGSUSED */ -_tnf_get_elements(TNF *tnf, tnf_ref32_t *array) -{ -#ifdef INFINITE_RECURSION_ARRAY - size_t hdrsize; - tnf_ref32_t *base_tag; - - base_tag = _tnf_get_base_tag(tnf, _tnf_get_tag(tnf, array)); - hdrsize = _tnf_get_header_size(tnf, base_tag); - return ((caddr_t)((char *)array + hdrsize)); -#else - return ((caddr_t)((char *)array + sizeof (struct tnf_array_hdr))); -#endif -} - -/* - * Retrieve the chars in an ABI string record - */ - -char * -_tnf_get_chars(TNF *tnf, tnf_ref32_t *string) -{ - return ((char *)_tnf_get_elements(tnf, string)); -} - -/* - * Retrieve the string in the name slot of a type record - */ - -char * -_tnf_get_name(TNF *tnf, tnf_ref32_t *tag) -{ - return (_tnf_get_chars(tnf, _GET_NAME(tnf, tag))); -} - -/* - * Retrieve the properties array slot of a type record - */ - -tnf_ref32_t * -_tnf_get_properties(TNF *tnf, tnf_ref32_t *tag) -{ - return (_GET_PROPERTIES(tnf, tag)); -} - -/* - * Retrieve the slot_types slot of struct_type or array_type record - */ - -tnf_ref32_t * -_tnf_get_slot_types(TNF *tnf, tnf_ref32_t *tag) -{ - return (_GET_SLOT_TYPES(tnf, tag)); -} - -/* - * Retrieve the header_size slot of an array_type record - */ - -size_t -_tnf_get_header_size(TNF *tnf, tnf_ref32_t *tag) -{ - return (_GET_HEADER_SIZE(tnf, tag)); -} - -/* - * Retrieve the derived_base slot of a derived_type record - */ - -tnf_ref32_t * -_tnf_get_derived_base(TNF *tnf, tnf_ref32_t *tag) -{ - return (_GET_DERIVED_BASE(tnf, tag)); -} - - -/* - * Find the root (self-tagged) type record - */ - -tnf_ref32_t * -_tnf_get_root_tag(TNF *tnf, tnf_ref32_t *record) -{ - if (tnf->root_tag) - return (tnf->root_tag); - else { - tnf_ref32_t *p1, *p2; - p1 = record; - while ((p2 = _tnf_get_tag(tnf, p1)) != p1) - p1 = p2; - tnf->root_tag = p2; - return (p2); - } -} - -/* - * Search ABI type array for a type named name - */ - -tnf_ref32_t * -_tnf_get_element_named(TNF *tnf, tnf_ref32_t *array, char *name) -{ - unsigned count, i; - tnf_ref32_t *elts; - - count = _tnf_get_element_count(tnf, array, sizeof (tnf_ref32_t)); - /* LINTED pointer cast may result in improper alignment */ - elts = (tnf_ref32_t *)_tnf_get_elements(tnf, array); - - for (i = 0; i < count; i++) { - tnf_ref32_t *type_elt; - - if ((type_elt = _GET_REF32(tnf, &elts[i])) == TNF_NULL) { - /* Can't have missing type records */ - _tnf_error(tnf, TNF_ERR_BADTNF); - return (TNF_NULL); - } - - if (strcmp(name, _tnf_get_name(tnf, type_elt)) == 0) - /* Found a type record named name */ - return (type_elt); - } - return (TNF_NULL); -} - -/* - * Look in type record's properties for named type. - * Recursively look at derived_base properties as well. - */ - -tnf_ref32_t * -_tnf_get_property(TNF *tnf, tnf_ref32_t *tag, char *name) -{ - tnf_ref32_t *properties, *property; - - if (strcmp(name, _tnf_get_name(tnf, tag)) == 0) - /* name is type name */ - return (tag); - - if ((properties = _tnf_get_properties(tnf, tag)) == TNF_NULL) - /* no properties */ - return (TNF_NULL); - - if ((property = _tnf_get_element_named(tnf, properties, name)) - != TNF_NULL) - /* found property named name */ - return (property); - - /* - * Recursively check base type of derived types - */ - if (_tnf_get_element_named(tnf, properties, TNF_N_DERIVED) - != TNF_NULL) { - /* tag is a derived type: check its derived_base */ - tnf_ref32_t *base_tag; - - base_tag = _tnf_get_derived_base(tnf, tag); - /* tnf_derived has derived_base == TNF_NULL */ - if (base_tag != TNF_NULL) - return (_tnf_get_property(tnf, base_tag, name)); - } - - return (TNF_NULL); -} - -/* - * Get the ultimate base type of a type record - */ - -tnf_ref32_t * -_tnf_get_base_tag(TNF *tnf, tnf_ref32_t *tag) -{ - tnf_ref32_t *properties; - - if ((properties = _tnf_get_properties(tnf, tag)) == TNF_NULL) - /* no properties */ - return (tag); - - if (_tnf_get_element_named(tnf, properties, TNF_N_DERIVED) - != TNF_NULL) { - tnf_ref32_t *base_tag; - - if ((base_tag = _tnf_get_derived_base(tnf, tag)) != TNF_NULL) - return (_tnf_get_base_tag(tnf, base_tag)); - } - - return (tag); -} - -/* - * Calculate the reference size of an object with type==tag - */ - -size_t -_tnf_get_ref_size(TNF *tnf, tnf_ref32_t *tag) -{ - if (HAS_PROPERTY(tnf, tag, TNF_N_TAGGED)) { - /* Tagged objects occupy 4 bytes for reference */ - return ((sizeof (tnf_ref32_t))); - } else if (HAS_PROPERTY(tnf, tag, TNF_N_INLINE)) { - /* Inline slots cannot be self sized */ - return (_tnf_get_storage_size(tnf, tag)); - } else { - /* Illegal to have references to abstract objects */ - _tnf_error(tnf, TNF_ERR_BADTNF); - return ((0)); - } -} - -/* - * Calculate storage size of an object with type==tag - */ - -size_t -_tnf_get_storage_size(TNF *tnf, tnf_ref32_t *tag) -{ - if (_tnf_get_tag(tnf, tag) == _tnf_get_root_tag(tnf, tag)) - return (_GET_TYPE_SIZE(tnf, tag)); - else { - tnf_ref32_t *base_tag; /* implementation tag */ - caddr_t sizep; - tnf_ref32_t *slot_types; - -#ifndef INFINITE_RECURSION_SIZE - char *base_name; - static struct n2s { - char *name; - size_t size; - } n2s[] = { - { TNF_N_CHAR, sizeof (tnf_char_t) }, - { TNF_N_INT8, sizeof (tnf_int8_t) }, - { TNF_N_INT16, sizeof (tnf_int16_t) }, - { TNF_N_INT32, sizeof (tnf_int32_t) }, - { TNF_N_UINT8, sizeof (tnf_uint8_t) }, - { TNF_N_UINT16, sizeof (tnf_uint16_t) }, - { TNF_N_UINT32, sizeof (tnf_uint32_t) }, - { TNF_N_INT64, sizeof (tnf_int64_t) }, - { TNF_N_UINT64, sizeof (tnf_uint64_t) }, - { TNF_N_FLOAT32, sizeof (tnf_float32_t) }, - { TNF_N_FLOAT64, sizeof (tnf_float64_t) }, - { NULL, 0 } - }; - struct n2s *p; -#endif - - base_tag = _tnf_get_base_tag(tnf, tag); - -#ifndef INFINITE_RECURSION_SIZE - base_name = _tnf_get_name(tnf, base_tag); - - /* XXX Why are we in this mess? */ - p = n2s; - while (p->name) { - if (strcmp(p->name, base_name) == 0) - return (p->size); - p++; - } -#endif - - sizep = _tnf_get_slot_typed(tnf, base_tag, TNF_N_TYPE_SIZE); - if (sizep) - /* Type sized */ - /* LINTED pointer cast may result in improper alignment */ - return (_GET_UINT32(tnf, (tnf_uint32_t *)sizep)); - - slot_types = (tnf_ref32_t *) - /* LINTED pointer cast may result in improper alignment */ - _tnf_get_slot_typed(tnf, base_tag, TNF_N_SLOT_TYPES); - if (slot_types && - _tnf_get_element_named(tnf, slot_types, TNF_N_SELF_SIZE)) - /* Self sized */ - return ((size_t)-1); - else - /* Abstract */ - return (0); - } -} - -/* - * Return the alignment restriction for any tag - */ - -unsigned -_tnf_get_align(TNF *tnf, tnf_ref32_t *tag) -{ - if (HAS_PROPERTY(tnf, tag, TNF_N_SCALAR)) { - tnf_ref32_t *base_tag; - caddr_t alignp; - - base_tag = _tnf_get_base_tag(tnf, tag); - alignp = _tnf_get_slot_typed(tnf, base_tag, TNF_N_ALIGN); - if (alignp) - /* LINTED pointer cast may result in improper alignment */ - return (_GET_UINT32(tnf, (tnf_uint32_t *)alignp)); - } - /* default: word alignment */ - return ((4)); -} - -/* - * Only works for records - * Doesn't check for slot_names in tag - * Tag records, for example, never have named slots - */ - -caddr_t -_tnf_get_slot_typed(TNF *tnf, tnf_ref32_t *record, char *name) -{ - tnf_ref32_t *tag, *base_tag; - tnf_ref32_t *slot_types, *types; - unsigned count, i; - unsigned offset; - - tag = _tnf_get_tag(tnf, record); - base_tag = _tnf_get_base_tag(tnf, tag); - - /* - * The position of slot_types is ABI fixed - * XXX Assume it is present in tag - */ - slot_types = _tnf_get_slot_types(tnf, base_tag); - count = _tnf_get_element_count(tnf, slot_types, sizeof (tnf_ref32_t)); - /* LINTED pointer cast may result in improper alignment */ - types = (tnf_ref32_t *)_tnf_get_elements(tnf, slot_types); - - offset = 0; - - for (i = 0; i < count; i++) { - tnf_ref32_t *type_elt; - size_t ref_size, align; - - /* Find the type record for slot */ - if ((type_elt = _GET_REF32(tnf, &types[i])) == TNF_NULL) { - /* Can't have missing type records */ - _tnf_error(tnf, TNF_ERR_BADTNF); - return ((caddr_t)NULL); - } - - /* See similar hack in init_slots() */ - - /* Calculate reference size */ - ref_size = _tnf_get_ref_size(tnf, type_elt); - - /* - * Calculate alignment - * XXX Prevent infinite recursion by assuming that - * a reference size of 4 implies word alignment - */ - align = (ref_size == 4)? 4: _tnf_get_align(tnf, type_elt); - - /* Adjust offset to account for alignment, if needed */ - offset = ALIGN(offset, align); - - /* Check whether name corresponds to type name */ - if (strcmp(name, _tnf_get_name(tnf, type_elt)) == 0) - /* Found the slot */ - return (fetch_slot(tnf, (caddr_t)record + offset, - type_elt)); - - /* Bump offset by reference size */ - offset += ref_size; - } - - return ((caddr_t)NULL); -} - -/* - * Only works for records - */ - -caddr_t -_tnf_get_slot_named(TNF *tnf, tnf_ref32_t *record, char *name) -{ - tnf_ref32_t *tag, *base_tag; - tnf_ref32_t *slot_types, *slot_names, *types, *names; - unsigned count, i; - unsigned offset; - - tag = _tnf_get_tag(tnf, record); - base_tag = _tnf_get_base_tag(tnf, tag); - - /* - * slot_names are optional - */ - slot_names = (tnf_ref32_t *) - /* LINTED pointer cast may result in improper alignment */ - _tnf_get_slot_typed(tnf, base_tag, TNF_N_SLOT_NAMES); - - /* no slot_names; use _tnf_get_slot_typed() */ - if (slot_names == TNF_NULL) - return (_tnf_get_slot_typed(tnf, record, name)); - - /* - * The position of slot_types is ABI fixed - * XXX Assume it is present in tag - */ - slot_types = _tnf_get_slot_types(tnf, base_tag); - count = _tnf_get_element_count(tnf, slot_types, sizeof (tnf_ref32_t)); - /* LINTED pointer cast may result in improper alignment */ - types = (tnf_ref32_t *)_tnf_get_elements(tnf, slot_types); - /* LINTED pointer cast may result in improper alignment */ - names = (tnf_ref32_t *)_tnf_get_elements(tnf, slot_names); - - offset = 0; - - for (i = 0; i < count; i++) { - tnf_ref32_t *type_elt, *name_elt; - size_t ref_size, align; - - /* Find the type record for slot */ - if ((type_elt = _GET_REF32(tnf, &types[i])) == TNF_NULL) { - /* Can't have missing type records */ - _tnf_error(tnf, TNF_ERR_BADTNF); - return ((caddr_t)NULL); - } - - /* XXX Keep consistent with init_slots() */ - - /* Calculate reference size */ - ref_size = _tnf_get_ref_size(tnf, type_elt); - - /* - * Calculate alignment - * XXX Prevent infinite recursion by assuming that - * a reference size of 4 implies word alignment - */ - align = (ref_size == 4)? 4: _tnf_get_align(tnf, type_elt); - - /* Adjust offset to account for alignment, if needed */ - offset = ALIGN(offset, align); - - /* First check slot name, then type name */ - if ((((name_elt = _GET_REF32(tnf, &names[i])) != TNF_NULL) && - (strcmp(name, _tnf_get_chars(tnf, name_elt)) == 0)) || - (strcmp(name, _tnf_get_name(tnf, type_elt)) == 0)) - /* Found slot */ - return (fetch_slot(tnf, (caddr_t)record + offset, - type_elt)); - - /* Bump offset by reference size */ - offset += ref_size; - } - - return ((caddr_t)NULL); -} - -static caddr_t -fetch_slot(TNF *tnf, caddr_t p, tnf_ref32_t *tag) -{ - if (HAS_PROPERTY(tnf, tag, TNF_N_INLINE)) - return (p); - else /* XXX assume tagged */ - /* LINTED pointer cast may result in improper alignment */ - return ((caddr_t)_GET_REF32(tnf, (tnf_ref32_t *)p)); -} diff --git a/usr/src/lib/libtnf/access.c b/usr/src/lib/libtnf/access.c deleted file mode 100644 index 817a62ffc7..0000000000 --- a/usr/src/lib/libtnf/access.c +++ /dev/null @@ -1,184 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -#include "libtnf.h" - -/* - * File header operations - */ - -tnf_datum_t -tnf_get_file_header(TNF *tnf) -{ - return (DATUM(tnf->file_header_info, (caddr_t)tnf->file_header)); -} - -/* - * Block access operations - */ - -unsigned -tnf_get_block_count(TNF *tnf) -{ - return (tnf->block_count); -} - -tnf_datum_t -tnf_get_block_absolute(TNF *tnf, unsigned index) -{ - if (index >= tnf->block_count) - /* - * access to non-existent block: - * no error as per spec - */ - return (TNF_DATUM_NULL); - else - /* - * XXX Require a single block header tag - */ - /* LINTED pointer cast may result in improper alignment */ - return (DATUM(tnf->block_header_info, - (caddr_t)_GET_INDEX_BLOCK(tnf, index))); -} - -tnf_datum_t -tnf_get_block_relative(tnf_datum_t datum, int adjust) -{ - TNF *tnf; - tnf_ref32_t *bhdr; - unsigned index; - - CHECK_DATUM(datum); - - tnf = DATUM_TNF(datum); - bhdr = _GET_BLOCK(tnf, DATUM_VAL(datum)); - index = _GET_BLOCK_INDEX(tnf, bhdr); - - return (tnf_get_block_absolute(tnf, index + adjust)); -} - -int -tnf_is_block_header(tnf_datum_t datum) -{ - struct taginfo *info; - caddr_t val; - tnf_ref32_t *bhdr; - - CHECK_DATUM(datum); - - info = DATUM_INFO(datum); - val = DATUM_VAL(datum); - bhdr = _GET_BLOCK(info->tnf, val); - - return (((caddr_t)bhdr == val) && - (info == info->tnf->block_header_info)); -} - -tnf_datum_t -tnf_get_block_header(tnf_datum_t datum) -{ - TNF *tnf; - caddr_t val; - - CHECK_DATUM(datum); - - tnf = DATUM_TNF(datum); - val = DATUM_VAL(datum); - /* - * XXX Require a single block header tag - */ - return (DATUM(tnf->block_header_info, (caddr_t)_GET_BLOCK(tnf, val))); -} - -/* - * Sequential record access - */ - -tnf_datum_t -tnf_get_next_record(tnf_datum_t datum) -{ - TNF *tnf; - tnf_ref32_t *bhdr, *cell, ref32; - caddr_t val, nval, bval, blim; - size_t size, bytes; - - CHECK_RECORD(datum); - - tnf = DATUM_TNF(datum); - val = DATUM_VAL(datum); - - size = tnf_get_size(datum); - nval = val + size; - - /* Check file bounds */ - if (nval < tnf->data_start) - return (tnf_get_block_absolute(tnf, 0)); - else if (nval >= tnf->file_end) - return (TNF_DATUM_NULL); - - /* - * OK, nval is in data area, start looking in block - */ - bhdr = _GET_BLOCK(tnf, nval); - /* LINTED pointer cast may result in improper alignment */ - bytes = _GET_BLOCK_BYTES_VALID(tnf, bhdr); - bval = (caddr_t)bhdr; - blim = bval + bytes; - - /* sequentially examine valid cells in block from nval onwards */ - while (nval < blim) { - /* LINTED pointer cast may result in improper alignment */ - cell = (tnf_ref32_t *)nval; - ref32 = _GET_INT32(tnf, cell); - - switch (TNF_REF32_TYPE(ref32)) { - case TNF_REF32_T_FWD: /* skip forwarding cells */ - nval += sizeof (tnf_ref32_t); - break; - case TNF_REF32_T_RSVD: /* catch bogus cells */ - _tnf_error(tnf, TNF_ERR_BADTNF); - return (TNF_DATUM_NULL); - default: /* PAIR or TAG: record header */ - return (RECORD_DATUM(tnf, cell)); - } - } - - /* - * Couldn't find it: return next non-zero block header - */ - while ((bval += tnf->block_size) < tnf->file_end) - /* Gotta check that there is a real bhdr here */ - /* LINTED pointer cast may result in improper alignment */ - if (*(tnf_ref32_t *)bval != TNF_NULL) - /* LINTED pointer cast may result in improper alignment */ - return (RECORD_DATUM(tnf, (tnf_ref32_t *)bval)); - - /* - * default: we're off the end of the file - */ - return (TNF_DATUM_NULL); -} diff --git a/usr/src/lib/libtnf/array.c b/usr/src/lib/libtnf/array.c deleted file mode 100644 index 09fd89c9e7..0000000000 --- a/usr/src/lib/libtnf/array.c +++ /dev/null @@ -1,205 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -#include "libtnf.h" - -/* - * XXX This module assumes that all arrays are self-sized records. - */ - -/* - * - */ - -static struct taginfo * get_array_info( - tnf_datum_t, - struct taginfo **base, - struct taginfo **elt, - struct taginfo **elt_base); - -/* - * XXX Assumes arrays are (self-sized) records - */ - -void -_tnf_check_array(tnf_datum_t datum) -{ - struct taginfo *info; - - CHECK_RECORD(datum); /* XXX */ - - info = DATUM_INFO(datum); - - if (!INFO_ARRAY(info)) - _tnf_error(DATUM_TNF(datum), TNF_ERR_TYPEMISMATCH); - -} - -/* - * Helper - */ - -static struct taginfo * -get_array_info( - tnf_datum_t datum, - struct taginfo **basep, - struct taginfo **eltp, - struct taginfo **elt_basep) -{ - struct taginfo *info, *base, *elt, *elt_base; - - info = DATUM_INFO(datum); - base = INFO_DERIVED(info) ? info->base : info; - - if (INFO_DERIVED(base) || (!INFO_ARRAY(base))) - _tnf_error(DATUM_TNF(datum), TNF_ERR_INTERNAL); - - elt = base->base; /* XXX base slot is reused for elttype */ - elt_base = INFO_DERIVED(elt) ? elt->base : elt; - - *basep = base; - *eltp = elt; - *elt_basep = elt_base; - return (info); -} - -/* - * Return number of elements in array - */ - -unsigned -tnf_get_element_count(tnf_datum_t datum) -{ - size_t hdr_size, elt_size, self_size; - struct taginfo *base, *elt, *elt_base; - - CHECK_ARRAY(datum); - - (void) get_array_info(datum, &base, &elt, &elt_base); - hdr_size = base->hdrsize; - elt_size = INFO_ELEMENT_SIZE(elt_base); - self_size = _tnf_get_self_size(DATUM_TNF(datum), - /* LINTED pointer cast may result in improper alignment */ - DATUM_RECORD(datum)); - return (((self_size - hdr_size) / elt_size)); -} - -/* - * Fetch indexed element - */ - -tnf_datum_t -tnf_get_element(tnf_datum_t datum, unsigned index) -{ - size_t hdr_size, elt_size, self_size; - struct taginfo *base, *elt, *elt_base; - unsigned count, offset; - - CHECK_ARRAY(datum); - - (void) get_array_info(datum, &base, &elt, &elt_base); - hdr_size = base->hdrsize; - elt_size = INFO_ELEMENT_SIZE(elt_base); - self_size = _tnf_get_self_size(DATUM_TNF(datum), - /* LINTED pointer cast may result in improper alignment */ - DATUM_RECORD(datum)); - - count = (self_size - hdr_size) / elt_size; - - if (index >= count) - _tnf_error(DATUM_TNF(datum), TNF_ERR_BADINDEX); - - offset = hdr_size + (index * elt_size); - - /* - * If tagged, use the tag to construct datum - */ - if (INFO_TAGGED(elt)) { - TNF *tnf; - tnf_ref32_t *rec; - - tnf = DATUM_TNF(datum); - /* LINTED pointer cast may result in improper alignment */ - rec = _GET_REF32(tnf, (tnf_ref32_t *) - (DATUM_VAL(datum) + offset)); - /* NULL elements are allowed */ - return ((rec == TNF_NULL)? TNF_DATUM_NULL : - RECORD_DATUM(tnf, rec)); - } else - return (DATUM(elt, DATUM_VAL(datum) + offset)); -} - -/* - * Return element type of array - */ - -tnf_datum_t -tnf_get_element_type(tnf_datum_t datum) -{ - struct taginfo *base, *elt, *elt_base; - - CHECK_ARRAY(datum); - - (void) get_array_info(datum, &base, &elt, &elt_base); - - return (RECORD_DATUM(DATUM_TNF(datum), elt->tag)); -} - -/* - * Return a char pointer for string record - */ - -char * -tnf_get_chars(tnf_datum_t datum) -{ - struct taginfo *info, *base, *elt, *elt_base; - - CHECK_ARRAY(datum); - - info = get_array_info(datum, &base, &elt, &elt_base); - - if (!INFO_STRING(info)) - _tnf_error(DATUM_TNF(datum), TNF_ERR_TYPEMISMATCH); - - return (DATUM_VAL(datum) + base->hdrsize); -} - -/* - * Return the base pointer of array - */ - -caddr_t -tnf_get_elements(tnf_datum_t datum) -{ - struct taginfo *base, *elt, *elt_base; - - CHECK_ARRAY(datum); - - (void) get_array_info(datum, &base, &elt, &elt_base); - - return ((caddr_t)(DATUM_VAL(datum) + base->hdrsize)); -} diff --git a/usr/src/lib/libtnf/datum.c b/usr/src/lib/libtnf/datum.c deleted file mode 100644 index 0193f23f90..0000000000 --- a/usr/src/lib/libtnf/datum.c +++ /dev/null @@ -1,214 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -#include "libtnf.h" - -/* - * Defines - */ - -#define DATUM_KIND(d) (DATUM_INFO(d)->kind) - -/* - * Declarations - */ - -static int has_prop(tnf_datum_t, tag_props_t); - -/* - * Datum operations: for more debuggability - */ - -#ifndef _DATUM_MACROS - -tnf_datum_t -_tnf_datum(struct taginfo *info, caddr_t val) -{ - return (_DATUM(info, val)); -} - -struct taginfo * -_tnf_datum_info(tnf_datum_t datum) -{ - return ((struct taginfo *)_DATUM_HI(datum)); -} - -caddr_t -_tnf_datum_val(tnf_datum_t datum) -{ - return ((caddr_t)_DATUM_LO(datum)); -} - -#endif - -/* - * Check for valid datum - */ - -void -_tnf_check_datum(tnf_datum_t datum) -{ - caddr_t val; - TNF *tnf; - - if (datum == TNF_DATUM_NULL) - _tnf_error(NULL, TNF_ERR_BADTNF); - - val = DATUM_VAL(datum); - tnf = DATUM_TNF(datum); - - if ((val <= tnf->file_start) || (val >= tnf->file_end)) - _tnf_error(tnf, TNF_ERR_BADDATUM); -} - -/* - * Retrieve datum kind from cached information - */ - -tnf_kind_t -tnf_get_kind(tnf_datum_t datum) -{ - CHECK_DATUM(datum); - /* The kind field is always completely initialized */ - return (DATUM_KIND(datum)); -} - -/* - * Classification predicates: check the cached tag props - */ - -static int -has_prop(tnf_datum_t datum, tag_props_t prop) -{ - CHECK_DATUM(datum); - - /* Note: No need to get base info because props inherited */ - return (INFO_PROP(DATUM_INFO(datum), prop)); -} - -int -tnf_is_inline(tnf_datum_t datum) -{ - return (has_prop(datum, TAG_PROP_INLINE)); -} - -int -tnf_is_scalar(tnf_datum_t datum) -{ - return (has_prop(datum, TAG_PROP_SCALAR)); -} - -int -tnf_is_record(tnf_datum_t datum) /* XXX was: tnf_is_tagged */ -{ - return (has_prop(datum, TAG_PROP_TAGGED)); -} - -int -tnf_is_array(tnf_datum_t datum) -{ - return (has_prop(datum, TAG_PROP_ARRAY)); -} - -int -tnf_is_string(tnf_datum_t datum) -{ - return (has_prop(datum, TAG_PROP_STRING)); -} - -int -tnf_is_struct(tnf_datum_t datum) -{ - return (has_prop(datum, TAG_PROP_STRUCT)); -} - -int -tnf_is_type(tnf_datum_t datum) -{ - return (has_prop(datum, TAG_PROP_TYPE)); -} - -/* - * Get the type datum for any datum - */ - -tnf_datum_t -tnf_get_type(tnf_datum_t datum) -{ - struct taginfo *info; - - CHECK_DATUM(datum); - - info = DATUM_INFO(datum); - return (DATUM(info->meta, (caddr_t)info->tag)); -} - -/* - * Get the type name for any datum - * XXX Beware: this is a pointer into the file - */ - -char * -tnf_get_type_name(tnf_datum_t datum) -{ - CHECK_DATUM(datum); - return (DATUM_INFO(datum)->name); /* cached */ -} - -/* - * Get the size of any datum - */ - -size_t -tnf_get_size(tnf_datum_t datum) -{ - struct taginfo *info; - size_t size; - - CHECK_DATUM(datum); - - info = DATUM_INFO(datum); - size = info->size; - - if (size == (size_t)-1) /* self sized */ - /* XXX tnf_get_slot_named(datum, TNF_N_SELF_SIZE) */ - /* LINTED pointer cast may result in improper alignment */ - return (_tnf_get_self_size(info->tnf, DATUM_RECORD(datum))); - else - return (size); -} - -/* - * Get raw pointer to any datum - */ - -caddr_t -tnf_get_raw(tnf_datum_t datum) -{ - CHECK_DATUM(datum); - return (DATUM_VAL(datum)); -} diff --git a/usr/src/lib/libtnf/error.c b/usr/src/lib/libtnf/error.c deleted file mode 100644 index bad39d7f86..0000000000 --- a/usr/src/lib/libtnf/error.c +++ /dev/null @@ -1,114 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -#include "libtnf.h" -#include <libintl.h> - -#if !defined(TEXT_DOMAIN) -#define TEXT_DOMAIN "SYS_TEST" -#endif - -/* - * - */ - -static tnf_error_handler_t *_err_handler = &tnf_default_error_handler; -static void *_err_arg = 0; - -/* - * - */ - -void -tnf_set_error_handler(tnf_error_handler_t *handler, void *arg) -{ - /* XXX Not MT-safe */ - _err_arg = arg; - _err_handler = handler; -} - -/* - * - */ - -void -_tnf_error(TNF *tnf, tnf_errcode_t err) -{ - (*_err_handler)(_err_arg, tnf, err); -} - -/* - * - */ - -char * -tnf_error_message(tnf_errcode_t err) -{ - if (err == TNF_ERR_NONE) - return (dgettext(TEXT_DOMAIN, "no error")); - else if (err <= TNF_ERRNO_MAX) - return (strerror(err)); - else { - switch (err) { - case TNF_ERR_NOTTNF: - return (dgettext(TEXT_DOMAIN, "not a TNF file")); - case TNF_ERR_BADDATUM: - return (dgettext(TEXT_DOMAIN, - "operation on bad or NULL data handle")); - case TNF_ERR_TYPEMISMATCH: - return (dgettext(TEXT_DOMAIN, "type mismatch")); - case TNF_ERR_BADINDEX: - return (dgettext(TEXT_DOMAIN, "index out of bounds")); - case TNF_ERR_BADSLOT: - return (dgettext(TEXT_DOMAIN, "no such slot")); - case TNF_ERR_BADREFTYPE: - return (dgettext(TEXT_DOMAIN, "bad reference type")); - case TNF_ERR_ALLOCFAIL: - return (dgettext(TEXT_DOMAIN, - "memory allocation failure")); - case TNF_ERR_BADTNF: - return (dgettext(TEXT_DOMAIN, "bad TNF file")); - case TNF_ERR_INTERNAL: - return (dgettext(TEXT_DOMAIN, "internal error")); - default: - return (dgettext(TEXT_DOMAIN, "unknown error code")); - } - } -} - -/* - * - */ - -void -/* ARGSUSED */ -tnf_default_error_handler(void *arg, TNF *tnf, tnf_errcode_t err) -{ - fprintf(stderr, dgettext(TEXT_DOMAIN, "error: libtnf: %d: %s\n"), - err, tnf_error_message(err)); - abort(); -} diff --git a/usr/src/lib/libtnf/i386dep.c b/usr/src/lib/libtnf/i386dep.c deleted file mode 100644 index 7f198ccd43..0000000000 --- a/usr/src/lib/libtnf/i386dep.c +++ /dev/null @@ -1,30 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -/* This file intentionally (almost) blank */ - -static int _zero_ = 0; diff --git a/usr/src/lib/libtnf/info.c b/usr/src/lib/libtnf/info.c deleted file mode 100644 index 8c9829aa79..0000000000 --- a/usr/src/lib/libtnf/info.c +++ /dev/null @@ -1,400 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -#include "libtnf.h" - -#define TAG_INDEX(x) (TNF_TAG16_ABS16(x) / sizeof (tnf_ref32_t)) - -/* - * - */ - -static struct taginfo * add_info(TNF *, tnf_ref32_t *); - -static struct taginfo * -init_abstract_info(TNF *, tnf_ref32_t *, struct taginfo *); - -static struct taginfo * -init_derived_info(TNF *, tnf_ref32_t *, struct taginfo *); - -static struct taginfo * -init_scalar_info(TNF *, tnf_ref32_t *, struct taginfo *); - -static struct taginfo * -init_struct_info(TNF *, tnf_ref32_t *, struct taginfo *); - -static struct taginfo * -init_array_info(TNF *, tnf_ref32_t *, struct taginfo *); - -static void init_slots(TNF *, tnf_ref32_t *, struct taginfo *); - -/* - * Allocate tag table and directory - */ - -tnf_errcode_t -_tnf_init_tags(TNF *tnf) -{ - if ((tnf->tag_table = calloc(TAGTABCNT, sizeof (struct taginfo *))) - == NULL) - return (TNF_ERR_ALLOCFAIL); - if ((tnf->tag_directory = calloc(TAGDIRCNT(tnf->directory_size), - sizeof (struct taginfo *))) - == NULL) - return (TNF_ERR_ALLOCFAIL); - return (TNF_ERR_NONE); -} - -/* - * Deallocate all taginfos and tables associated with TNF handle - */ - -tnf_errcode_t -_tnf_fini_tags(TNF *tnf) -{ - int i; - struct taginfo *info, *link; - - /* - * free taginfos - */ - for (i = 0; i < TAGTABCNT; i++) { - info = tnf->tag_table[i]; - while (info) { - /* remember link */ - link = info->link; - /* free slot information */ - if (info->slotinfo) - free(info->slotinfo); - /* free taginfo */ - free(info); - /* next in hash chain */ - info = link; - } - } - /* - * free the tables - */ - free(tnf->tag_table); - tnf->tag_table = NULL; - free(tnf->tag_directory); - tnf->tag_directory = NULL; - - return (TNF_ERR_NONE); -} - -/* - * Get info for supplied tag - */ - -struct taginfo * -_tnf_get_info(TNF *tnf, tnf_ref32_t *tag) -{ - struct taginfo *bucket, *info; - - bucket = tnf->tag_table[TAGHASH(tnf, tag)]; - for (info = bucket; info; info = info->link) - if (info->tag == tag) - return (info); /* found it */ - - /* default: not there, create */ - return (add_info(tnf, tag)); -} - -/* - * Get info for supplied record - * Use fast lookup, if possible - */ - -struct taginfo * -_tnf_record_info(TNF *tnf, tnf_ref32_t *record) -{ - tnf_ref32_t ref32; - tnf_ref16_t tag16; - tnf_abs16_t index; - struct taginfo *info; - - ref32 = _GET_INT32(tnf, record); - - index = 0; - if (TNF_REF32_IS_PAIR(ref32)) { - tag16 = TNF_REF32_TAG16(ref32); - if (TNF_TAG16_IS_ABS(tag16)) - index = TAG_INDEX(tag16); - } - - if (index) { - if ((info = tnf->tag_directory[index]) != NULL) - return (info); - else { /* not in directory yet */ - info = _tnf_get_info(tnf, _tnf_get_tag(tnf, record)); - /* enter into tag directory */ - return ((tnf->tag_directory[index] = info)); - } - } - - /* default: not referenced via index */ - return (_tnf_get_info(tnf, _tnf_get_tag(tnf, record))); -} - -/* - * Add a new taginfo for tag - */ - -static struct taginfo * -add_info(TNF *tnf, tnf_ref32_t *tag) -{ - struct taginfo *info, *bucket; - unsigned hash; - tnf_ref32_t *meta; - - info = (struct taginfo *)calloc(1, sizeof (struct taginfo)); - - /* Initialize members */ - info->tnf = tnf; - info->tag = tag; - info->name = _tnf_get_name(tnf, tag); - info->props = _tnf_get_props(tnf, tag); - info->kind = _tnf_get_kind(tnf, tag); - info->size = _tnf_get_storage_size(tnf, tag); - info->align = _tnf_get_align(tnf, tag); - - /* Add it to table */ - hash = TAGHASH(tnf, tag); - bucket = tnf->tag_table[hash]; - info->link = bucket; - tnf->tag_table[hash] = info; - - /* Ensure meta info is available */ - meta = _tnf_get_tag(tnf, tag); - info->meta = _tnf_get_info(tnf, meta); - - /* - * Initialize info - * Derived must be first clause due to property inheritance - */ - - if (INFO_DERIVED(info)) - return (init_derived_info(tnf, tag, info)); - else if (INFO_STRUCT(info)) - return (init_struct_info(tnf, tag, info)); - else if (INFO_ARRAY(info)) - return (init_array_info(tnf, tag, info)); - else if (INFO_SCALAR(info)) - return (init_scalar_info(tnf, tag, info)); - else /* XXX assume abstract type */ - return (init_abstract_info(tnf, tag, info)); -} - - -/* - * Initialize info for an abstract tag - */ - -static struct taginfo * -/* ARGSUSED */ -init_abstract_info(TNF *tnf, tnf_ref32_t *tag, struct taginfo *info) -{ - if (INFO_SCALAR(info) || INFO_DERIVED(info) || - INFO_STRUCT(info) || INFO_ARRAY(info)) - _tnf_error(tnf, TNF_ERR_INTERNAL); - if (info->size == (size_t)-1) - _tnf_error(tnf, TNF_ERR_BADTNF); - return (info); -} - -/* - * Initialize info for a derived tag - */ - -static struct taginfo * -init_derived_info(TNF *tnf, tnf_ref32_t *tag, struct taginfo *info) -{ - tnf_ref32_t *base_tag; - - if (!INFO_DERIVED(info)) - _tnf_error(tnf, TNF_ERR_INTERNAL); - - /* Ensure ultimate base information is available */ - base_tag = _tnf_get_base_tag(tnf, tag); - info->base = _tnf_get_info(tnf, base_tag); - - return (info); -} - -/* - * Initialize info for a scalar tag - */ - -static struct taginfo * -/* ARGSUSED */ -init_scalar_info(TNF *tnf, tnf_ref32_t *tag, struct taginfo *info) -{ - if ((!INFO_SCALAR(info)) || - (INFO_DERIVED(info) || INFO_ARRAY(info) || INFO_STRUCT(info))) - _tnf_error(tnf, TNF_ERR_INTERNAL); - if (info->size == (size_t)-1) - _tnf_error(tnf, TNF_ERR_BADTNF); - - /* XXX alignment already done */ - - return (info); -} - -/* - * Initialize info for a struct tag - */ - -static struct taginfo * -init_struct_info(TNF *tnf, tnf_ref32_t *tag, struct taginfo *info) -{ - if ((!INFO_STRUCT(info)) || - (INFO_DERIVED(info) || INFO_ARRAY(info) || INFO_SCALAR(info))) - _tnf_error(tnf, TNF_ERR_INTERNAL); - if (info->size == (size_t)-1) - _tnf_error(tnf, TNF_ERR_BADTNF); - - /* Get slot information */ - init_slots(tnf, tag, info); - - return (info); -} - -/* - * Initialize info for an array tag - */ - -static struct taginfo * -init_array_info(TNF *tnf, tnf_ref32_t *tag, struct taginfo *info) -{ - tnf_ref32_t *elt_tag; - int defeat; - - if ((!INFO_ARRAY(info)) || - (INFO_DERIVED(info) || INFO_STRUCT(info) || INFO_SCALAR(info))) - _tnf_error(tnf, TNF_ERR_INTERNAL); - - /* XXX special-case abstract array tag */ - defeat = (strcmp(info->name, TNF_N_ARRAY) == 0); - - /* Require all arrays to be self-sized records */ - if (!(INFO_TAGGED(info) && (info->size == (size_t)-1))) - if (!defeat) - _tnf_error(tnf, TNF_ERR_BADTNF); - - /* Store array header size */ - info->hdrsize = _tnf_get_header_size(tnf, tag); - /* XXX Temporary sanity check */ - if (info->hdrsize != sizeof (struct tnf_array_hdr)) - if (!defeat) - _tnf_error(tnf, TNF_ERR_BADTNF); - - /* Get slot information */ - init_slots(tnf, tag, info); - - /* Get info for element type */ - elt_tag = (tnf_ref32_t *)_tnf_get_slot_typed(tnf, tag, - /* LINTED pointer cast may result in improper alignment */ - TNF_N_ELEMENT_TYPE); - /* XXX tnf_array has element_type == NULL */ - info->base = elt_tag ? _tnf_get_info(tnf, elt_tag): NULL; - - return (info); -} - -/* - * Initialize slot information for aggregate tag - */ - -static void -init_slots(TNF *tnf, tnf_ref32_t *tag, struct taginfo *info) -{ - tnf_ref32_t *slot_types, *slot_names; - tnf_ref32_t *types, *names; - unsigned count, i, offset; - struct slotinfo *slotinfo; - - slot_types = (tnf_ref32_t *) - /* LINTED pointer cast may result in improper alignment */ - _tnf_get_slot_typed(tnf, tag, TNF_N_SLOT_TYPES); - slot_names = (tnf_ref32_t *) - /* LINTED pointer cast may result in improper alignment */ - _tnf_get_slot_typed(tnf, tag, TNF_N_SLOT_NAMES); - - /* abstract tags have no slots */ - if (slot_types == TNF_NULL) - return; - - count = _tnf_get_element_count(tnf, slot_types, sizeof (tnf_ref32_t)); - /* LINTED pointer cast may result in improper alignment */ - types = (tnf_ref32_t *)_tnf_get_elements(tnf, slot_types); - names = ((slot_names == TNF_NULL) ? TNF_NULL : - /* LINTED pointer cast may result in improper alignment */ - (tnf_ref32_t *)_tnf_get_elements(tnf, slot_names)); - - slotinfo = (struct slotinfo *) - calloc(1, sizeof (unsigned) + (count * sizeof (struct slot))); - if (slotinfo == (struct slotinfo *)NULL) - _tnf_error(tnf, TNF_ERR_ALLOCFAIL); - - slotinfo->slot_count = count; - offset = 0; - - for (i = 0; i < count; i++) { - tnf_ref32_t *type_elt, *name_elt; - struct taginfo *elt_info; - size_t ref_size, align; - - /* XXX No checks here for missing tags */ - type_elt = _GET_REF32(tnf, &types[i]); - name_elt = names ? _GET_REF32(tnf, &names[i]) : TNF_NULL; - - /* Resolve slot tag into taginfo */ - elt_info = _tnf_get_info(tnf, type_elt); - slotinfo->slots[i].slot_type = elt_info; - slotinfo->slots[i].slot_name = - ((name_elt != TNF_NULL) ? - _tnf_get_chars(tnf, name_elt) : - _tnf_get_name(tnf, type_elt)); - - /* Get cached reference size */ - ref_size = INFO_REF_SIZE(elt_info); - - /* Get cached alignment */ - align = INFO_ALIGN(elt_info); /* XXX */ - - /* Adjust offset to account for alignment, if needed */ - offset = ALIGN(offset, align); - - slotinfo->slots[i].slot_offset = offset; - - /* Bump offset by reference size */ - offset += ref_size; - } - - info->slotinfo = slotinfo; -} diff --git a/usr/src/lib/libtnf/libtnf.h b/usr/src/lib/libtnf/libtnf.h deleted file mode 100644 index 777fc2dd5c..0000000000 --- a/usr/src/lib/libtnf/libtnf.h +++ /dev/null @@ -1,342 +0,0 @@ -/* - * 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 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 1994 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -#ifndef _LIBTNF_H -#define _LIBTNF_H - -#pragma ident "%Z%%M% %I% %E% SMI" - -#include <stdio.h> -#include <stdlib.h> -#include <stdarg.h> -#include <string.h> -#include <unistd.h> - -#include "tnf/tnf.h" -#include "machlibtnf.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Info flags - */ - -typedef unsigned long tag_props_t; - -#define TAG_PROP_INLINE (1<<0) -#define TAG_PROP_TAGGED (1<<1) -#define TAG_PROP_SCALAR (1<<2) -#define TAG_PROP_DERIVED (1<<3) -#define TAG_PROP_ARRAY (1<<4) -#define TAG_PROP_STRING (1<<5) -#define TAG_PROP_STRUCT (1<<6) -#define TAG_PROP_TYPE (1<<7) - -/* - * Type tag information - */ - -struct taginfo { - struct taginfo *link; /* hash link */ -#define INFO_MEMBER_0 link - TNF *tnf; /* TNF handle */ - tnf_ref32_t *tag; /* tag record in file */ - char *name; /* chars in file */ - tnf_kind_t kind; /* data classification */ - tag_props_t props; /* tag property flags */ - struct taginfo *meta; /* meta tag info */ - struct taginfo *base; /* last derived base or elttype */ - size_t size; /* storage size or -1 */ - size_t align; /* slot alignment */ - size_t hdrsize; /* array header size */ - struct slotinfo { /* aggregate slot information */ - unsigned slot_count; - /* Embedded array */ - struct slot { - struct taginfo *slot_type; - char *slot_name; - unsigned slot_offset; - } slots[1]; - } *slotinfo; -}; - -#define INFO_PROP(ip, p) ((ip)->props & (p)) - -#define INFO_INLINE(ip) INFO_PROP(ip, TAG_PROP_INLINE) -#define INFO_TAGGED(ip) INFO_PROP(ip, TAG_PROP_TAGGED) -#define INFO_SCALAR(ip) INFO_PROP(ip, TAG_PROP_SCALAR) -#define INFO_DERIVED(ip) INFO_PROP(ip, TAG_PROP_DERIVED) -#define INFO_ARRAY(ip) INFO_PROP(ip, TAG_PROP_ARRAY) -#define INFO_STRING(ip) INFO_PROP(ip, TAG_PROP_STRING) -#define INFO_STRUCT(ip) INFO_PROP(ip, TAG_PROP_STRUCT) -#define INFO_TYPE(ip) INFO_PROP(ip, TAG_PROP_TYPE) - -#define INFO_REF_SIZE(ip) (INFO_TAGGED(ip)? 4: (ip)->size) -#define INFO_ELEMENT_SIZE(ip) INFO_REF_SIZE(ip) - -/* Alignment is stored for all but records and derivations thereof */ -#define INFO_ALIGN(ip) (INFO_TAGGED(ip)? 4: (ip)->align) - -#define ALIGN(n, a) \ - (((a) == 0) ? (n) : (((n) + (a) - 1) & ~((a) - 1))) - -/* - * Tag lookup - */ - -/* Number of directory entries */ -#define TAGDIRCNT(x) ((x) / sizeof (tnf_ref32_t)) - -/* Number of hash table buckets */ -#define TAGTABCNT 1024 -#define TAGTABMASK (TAGTABCNT-1) - -/* A tag is at least 32 bytes; with strings & props, assume 128 bytes */ -#define TAGTABSHIFT 7 - -/* Hash tag by bits 17:7 of offset within data area */ -#define TAGOFF(tnf, p) ((unsigned)((caddr_t)(p) - (tnf)->data_start)) -#define TAGHASH(tnf, p) ((TAGOFF(tnf, p) >> TAGTABSHIFT) & TAGTABMASK) - -/* - * TNF handle - */ - -struct TNF { - /* - * Client-supplied bounds - */ - caddr_t file_start; - size_t file_size; - caddr_t file_end; /* file_start + file_size */ - - /* - * File information - */ - unsigned file_magic; /* magic number of file */ - int file_native; /* endian flag */ - - /* file header */ - tnf_ref32_t *file_header; /* first record in file */ - size_t block_size; /* size of a block */ - size_t directory_size; /* size of directory area */ - - unsigned block_count; /* number of data blocks */ - caddr_t data_start; /* file_start + 64KB */ - - unsigned generation_shift; - unsigned address_mask; - - /* block headers */ - unsigned block_shift; /* index -> bhdr */ - unsigned block_mask; /* ptr -> bhdr */ - unsigned block_generation_offset; - unsigned block_bytes_valid_offset; - - /* root tag */ - tnf_ref32_t *root_tag; - - /* important taginfo */ - struct taginfo *file_header_info; - struct taginfo *block_header_info; - - /* tag lookup tables */ - struct taginfo **tag_table; /* by address */ - struct taginfo **tag_directory; /* by index */ - -}; - -/* - * File operations for reading integers - */ - -#define _GET_UINT32(tnf, ptr) \ - ((tnf)->file_native ? \ - *(tnf_uint32_t *)(ptr) : \ - _tnf_swap32(*(tnf_uint32_t *)(ptr))) - -#define _GET_INT32(tnf, ptr) \ - ((tnf_int32_t)_GET_UINT32(tnf, ptr)) - -#define _GET_UINT16(tnf, ptr) \ - ((tnf)->file_native ? \ - *(tnf_uint16_t *)(ptr) : \ - _tnf_swap16(*(tnf_uint16_t *)(ptr))) - -#define _GET_INT16(tnf, ptr) \ - ((tnf_int16_t)_GET_UINT16(tnf, ptr)) - -/* - * TNF reference-chasing operations - */ - -tnf_ref32_t * _tnf_get_ref32(TNF *, tnf_ref32_t *); -tnf_ref32_t * _tnf_get_ref16(TNF *, tnf_ref32_t *); - -#define _GET_REF32(tnf, ptr) _tnf_get_ref32(tnf, ptr) -#define _GET_REF16(tnf, ptr) _tnf_get_ref16(tnf, ptr) - -/* - * Block header record operations - * Only applicable in data area - */ - -#define _GET_BLOCK(tnf, ptr) \ - ((tnf_ref32_t *)((unsigned)(ptr) & (tnf)->block_mask)) - -#define _GET_BLOCK_INDEX(tnf, bhdr) \ - (((caddr_t)(bhdr) - (tnf)->data_start) >> (tnf)->block_shift) - -#define _GET_INDEX_BLOCK(tnf, index) \ - ((tnf_ref32_t *)((tnf)->data_start + ((index) << (tnf)->block_shift))) - -#define _GET_BLOCK_GENERATION(tnf, bhdr) \ - _GET_UINT32(tnf, (caddr_t)bhdr + tnf->block_generation_offset) - -#define _GET_BLOCK_BYTES_VALID(tnf, bhdr) \ - (!(bhdr) ? 0 : _GET_UINT16(tnf, (caddr_t)bhdr + \ - tnf->block_bytes_valid_offset)) - -/* - * Datum operations - */ - -#ifndef _DATUM_MACROS - -tnf_datum_t _tnf_datum(struct taginfo *, caddr_t); -struct taginfo * _tnf_datum_info(tnf_datum_t); -caddr_t _tnf_datum_val(tnf_datum_t); - -#define DATUM(x, y) _tnf_datum(x, y) -#define DATUM_INFO(x) _tnf_datum_info(x) -#define DATUM_VAL(x) _tnf_datum_val(x) - -#else /* _DATUM_MACROS */ - -/* Some degree of type safety: */ -#define DATUM(x, y) _DATUM((uintptr_t)&(x)->INFO_MEMBER_0, y) -#define DATUM_INFO(d) ((struct taginfo *)_DATUM_HI(d)) -#define DATUM_VAL(d) ((caddr_t)_DATUM_LO(d)) - -#endif /* _DATUM_MACROS */ - -#define _DATUM(hi, lo) (((unsigned long long)(hi) << 32) | (unsigned)(lo)) -#define _DATUM_HI(x) ((unsigned) ((x) >> 32)) -#define _DATUM_LO(x) ((unsigned) (x)) - -#define DATUM_RECORD(x) \ - ((tnf_ref32_t *)DATUM_VAL(x)) - -#define RECORD_DATUM(tnf, rec) \ - DATUM(_tnf_record_info(tnf, rec), (caddr_t)rec) - -#define DATUM_TNF(x) DATUM_INFO(x)->tnf -#define DATUM_TAG(x) DATUM_INFO(x)->tag - -/* - * Type checking operations - */ - -void _tnf_check_datum(tnf_datum_t); -#define CHECK_DATUM(x) _tnf_check_datum(x) - -void _tnf_check_record(tnf_datum_t); -#define CHECK_RECORD(x) _tnf_check_record(x) - -void _tnf_check_slots(tnf_datum_t); -#define CHECK_SLOTS(x) _tnf_check_slots(x) - -void _tnf_check_array(tnf_datum_t); -#define CHECK_ARRAY(x) _tnf_check_array(x) - -void _tnf_check_type(tnf_datum_t); -#define CHECK_TYPE(x) _tnf_check_type(x) - -/* - * Operations based on ABI layouts and bootstrap assumptions - */ - -tnf_ref32_t * _tnf_get_tag(TNF *, tnf_ref32_t *); -tnf_ref32_t * _tnf_get_tag_arg(TNF *, tnf_ref32_t *); -size_t _tnf_get_self_size(TNF *, tnf_ref32_t *); -unsigned _tnf_get_element_count(TNF *, tnf_ref32_t *, unsigned); -caddr_t _tnf_get_elements(TNF *, tnf_ref32_t *); -char * _tnf_get_chars(TNF *, tnf_ref32_t *); -char * _tnf_get_name(TNF *, tnf_ref32_t *); -tnf_ref32_t * _tnf_get_properties(TNF *, tnf_ref32_t *); -tnf_ref32_t * _tnf_get_slot_types(TNF *, tnf_ref32_t *); -size_t _tnf_get_header_size(TNF *, tnf_ref32_t *); -tnf_ref32_t * _tnf_get_derived_base(TNF *, tnf_ref32_t *); - -tnf_ref32_t * _tnf_get_root_tag(TNF *, tnf_ref32_t *); -tnf_ref32_t * _tnf_get_property(TNF *, tnf_ref32_t *, char *); -tnf_ref32_t * _tnf_get_element_named(TNF *, tnf_ref32_t *, char *); -tnf_ref32_t * _tnf_get_base_tag(TNF *, tnf_ref32_t *); - -size_t _tnf_get_storage_size(TNF *, tnf_ref32_t *); -size_t _tnf_get_ref_size(TNF *, tnf_ref32_t *); - -unsigned _tnf_get_align(TNF *, tnf_ref32_t *); - -caddr_t _tnf_get_slot_typed(TNF *, tnf_ref32_t *, char *); -caddr_t _tnf_get_slot_named(TNF *, tnf_ref32_t *, char *); - -#define HAS_PROPERTY(tnf, tag, name) \ - (_tnf_get_property(tnf, tag, name) != TNF_NULL) - -/* - * Call the installed error handler with installed arg - */ - -void _tnf_error(TNF *, tnf_errcode_t); - -/* - * Tag lookup operations - */ - -struct taginfo * _tnf_get_info(TNF *, tnf_ref32_t *); -struct taginfo * _tnf_record_info(TNF *, tnf_ref32_t *); - -tnf_errcode_t _tnf_init_tags(TNF *); -tnf_errcode_t _tnf_fini_tags(TNF *); - -/* - * Classify a tag into its props and data kind - */ - -tag_props_t _tnf_get_props(TNF *, tnf_ref32_t *); -tnf_kind_t _tnf_get_kind(TNF *, tnf_ref32_t *); - -caddr_t _tnf_get_member(TNF *, caddr_t, struct taginfo *); - -#ifdef __cplusplus -} -#endif - -#endif /* _LIBTNF_H */ diff --git a/usr/src/lib/libtnf/machlibtnf.h b/usr/src/lib/libtnf/machlibtnf.h deleted file mode 100644 index a10fc2b219..0000000000 --- a/usr/src/lib/libtnf/machlibtnf.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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 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 2004 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -#ifndef _MACHLIBTNF_H -#define _MACHLIBTNF_H - -#pragma ident "%Z%%M% %I% %E% SMI" - -#include <sys/isa_defs.h> - -#ifdef __cplusplus -extern "C" { -#endif - -#if defined(_BIG_ENDIAN) || defined(__sparc) - -tnf_uint32_t _tnf_swap32(tnf_uint32_t); -tnf_uint16_t _tnf_swap16(tnf_uint16_t); - -#elif defined(_LITTLE_ENDIAN) || defined(__i386) || defined(__amd64) - -#include <sys/byteorder.h> - -#define _tnf_swap32(x) ntohl(x) -#define _tnf_swap16(x) ntohs(x) - -#else - -#error Unknown endian - -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* _MACHLIBTNF_H */ diff --git a/usr/src/lib/libtnf/mapfile-vers b/usr/src/lib/libtnf/mapfile-vers deleted file mode 100644 index 80b4c20b22..0000000000 --- a/usr/src/lib/libtnf/mapfile-vers +++ /dev/null @@ -1,92 +0,0 @@ -# -# 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 (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. -# - -# -# MAPFILE HEADER START -# -# WARNING: STOP NOW. DO NOT MODIFY THIS FILE. -# Object versioning must comply with the rules detailed in -# -# usr/src/lib/README.mapfiles -# -# You should not be making modifications here until you've read the most current -# copy of that file. If you need help, contact a gatekeeper for guidance. -# -# MAPFILE HEADER END -# - -$mapfile_version 2 - -SYMBOL_VERSION SUNWprivate_1.1 { - global: - tnf_default_error_handler; - tnf_error_message; - tnf_get_block_absolute; - tnf_get_block_count; - tnf_get_block_header; - tnf_get_block_relative; - tnf_get_char; - tnf_get_chars; - tnf_get_element; - tnf_get_element_count; - tnf_get_elements; - tnf_get_element_type; - tnf_get_file_header; - tnf_get_float32; - tnf_get_float64; - tnf_get_int16; - tnf_get_int32; - tnf_get_int64; - tnf_get_int8; - tnf_get_kind; - tnf_get_next_record; - tnf_get_raw; - tnf_get_size; - tnf_get_slot_count; - tnf_get_slot_index; - tnf_get_slot_indexed; - tnf_get_slot_name; - tnf_get_slot_named; - tnf_get_tag_arg; - tnf_get_type; - tnf_get_type_name; - tnf_is_array; - tnf_is_block_header; - tnf_is_inline; - tnf_is_record; - tnf_is_scalar; - tnf_is_string; - tnf_is_struct; - tnf_is_type; - tnf_reader_begin; - tnf_reader_end; - tnf_set_error_handler; - tnf_type_get_base; - tnf_type_get_kind; - tnf_type_get_name; - tnf_type_get_property; - tnf_type_get_size; - local: - *; -}; diff --git a/usr/src/lib/libtnf/reader.c b/usr/src/lib/libtnf/reader.c deleted file mode 100644 index c7d3d8fe74..0000000000 --- a/usr/src/lib/libtnf/reader.c +++ /dev/null @@ -1,191 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -#include "libtnf.h" - -/* - * Initiate a reader session - */ - -tnf_errcode_t -tnf_reader_begin(caddr_t base, size_t size, TNF **tnfret) -{ - tnf_uint32_t magic; - int native; - TNF *tnf; - tnf_ref32_t *fhdr, *bhdr; - size_t tmpsz; - caddr_t p, genp, bvp; - tnf_errcode_t err; - - /* - * Check magic number - */ - - /* LINTED pointer cast may result in improper alignment */ - if ((magic = *(tnf_uint32_t *)base) == TNF_MAGIC) - native = 1; /* same endian */ - else if (magic == TNF_MAGIC_1) - native = 0; /* other endian */ - else - return (TNF_ERR_NOTTNF); - - /* - * Allocate TNF struct, initialize members - */ - - if ((tnf = (TNF*)calloc(1, sizeof (*tnf))) == (TNF*)NULL) - return (TNF_ERR_ALLOCFAIL); - - tnf->file_magic = magic; - tnf->file_native = native; - tnf->file_start = base; - tnf->file_size = size; - tnf->file_end = base + size; - - /* - * Examine file header - */ - - /* LINTED pointer cast may result in improper alignment */ - fhdr = (tnf_ref32_t *)(base + sizeof (magic)); /* second word */ - tnf->file_header = fhdr; - - /* Block size */ - p = _tnf_get_slot_named(tnf, fhdr, TNF_N_BLOCK_SIZE); - /* LINTED pointer cast may result in improper alignment */ - tnf->block_size = _GET_UINT32(tnf, (tnf_uint32_t *)p); - - /* Directory size */ - p = _tnf_get_slot_named(tnf, fhdr, TNF_N_DIRECTORY_SIZE); - /* LINTED pointer cast may result in improper alignment */ - tnf->directory_size = _GET_UINT32(tnf, (tnf_uint32_t *)p); - - /* Block count */ - p = _tnf_get_slot_named(tnf, fhdr, TNF_N_BLOCK_COUNT); - /* LINTED pointer cast may result in improper alignment */ - tnf->block_count = _GET_UINT32(tnf, (tnf_uint32_t *)p); - /* - * This member tracks data block count, not total block count - * (unlike the TNF file header). Discount directory blocks. - */ - tnf->block_count -= tnf->directory_size / tnf->block_size; - - /* - * 1196886: Clients may supply file_size information obtained - * by fstat() which is incorrect. Check it now and revise - * downwards if we have to. - */ - tmpsz = tnf->directory_size + tnf->block_count * tnf->block_size; - if (tmpsz != size) { - if (tmpsz > size) - /* missing data? */ - return (TNF_ERR_BADTNF); - else { - tnf->file_size = tmpsz; - tnf->file_end = base + tmpsz; - } - } - - /* Calculate block shift */ - tmpsz = 1; - while (tmpsz != tnf->block_size) { - tmpsz <<= 1; - tnf->block_shift++; - } - - /* Calculate block mask */ - tnf->block_mask = ~(tnf->block_size - 1); - - /* Generation shift */ - p = _tnf_get_slot_named(tnf, fhdr, TNF_N_FILE_LOGICAL_SIZE); - /* LINTED pointer cast may result in improper alignment */ - tnf->generation_shift = _GET_UINT32(tnf, (tnf_uint32_t *)p); - - /* Calculate the address mask */ - /* - * Following lint complaint is unwarranted, probably an - * uninitialized variable in lint or something ... - */ - /* LINTED constant truncated by assignment */ - tnf->address_mask = 0xffffffff; - tnf->address_mask <<= tnf->generation_shift; - tnf->address_mask = ~(tnf->address_mask); - - - /* - * Examine first block header in data area - */ - - tnf->data_start = tnf->file_start + tnf->directory_size; - /* LINTED pointer cast may result in improper alignment */ - bhdr = (tnf_ref32_t *)tnf->data_start; - - /* Block generation offset */ - genp = _tnf_get_slot_named(tnf, bhdr, TNF_N_GENERATION); - tnf->block_generation_offset = genp - (caddr_t)bhdr; - - /* Block bytes valid offset */ - bvp = _tnf_get_slot_named(tnf, bhdr, TNF_N_BYTES_VALID); - tnf->block_bytes_valid_offset = bvp - (caddr_t)bhdr; - - /* - * Bootstrap taginfo system and cache important taginfo - */ - - if ((err = _tnf_init_tags(tnf)) != TNF_ERR_NONE) - return (err); - - tnf->file_header_info = _tnf_get_info(tnf, _tnf_get_tag(tnf, fhdr)); - tnf->block_header_info = _tnf_get_info(tnf, _tnf_get_tag(tnf, bhdr)); - - /* - * Return TNF handle and error status - */ - - *tnfret = tnf; - return (TNF_ERR_NONE); -} - -/* - * Terminate a reader session - */ - -tnf_errcode_t -tnf_reader_end(TNF *tnf) -{ - tnf_errcode_t err; - - /* Deallocate all taginfo */ - if ((err = _tnf_fini_tags(tnf)) != TNF_ERR_NONE) - return (err); - - /* Deallocate TNF */ - free(tnf); - - return (TNF_ERR_NONE); -} diff --git a/usr/src/lib/libtnf/record.c b/usr/src/lib/libtnf/record.c deleted file mode 100644 index b5fabb0287..0000000000 --- a/usr/src/lib/libtnf/record.c +++ /dev/null @@ -1,66 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -#include "libtnf.h" - -/* - * Check a record datum - */ - -void -_tnf_check_record(tnf_datum_t datum) -{ - CHECK_DATUM(datum); - - /* All records must be tagged */ - if (!INFO_TAGGED(DATUM_INFO(datum))) - _tnf_error(DATUM_TNF(datum), TNF_ERR_TYPEMISMATCH); -} - -/* - * Retrieve the tag arg, encoded in low 16 bits of tag word - */ - -tnf_datum_t -tnf_get_tag_arg(tnf_datum_t datum) -{ - TNF *tnf; - tnf_ref32_t *arg; - - CHECK_RECORD(datum); - - tnf = DATUM_TNF(datum); - - /* Should not give an error if not found */ - /* LINTED pointer cast may result in improper alignment */ - arg = _tnf_get_tag_arg(tnf, DATUM_RECORD(datum)); - - if (arg == TNF_NULL) - return (TNF_DATUM_NULL); - else /* repackage the tag arg with its taginfo */ - return (RECORD_DATUM(tnf, arg)); -} diff --git a/usr/src/lib/libtnf/ref.c b/usr/src/lib/libtnf/ref.c deleted file mode 100644 index 07e0ccccfb..0000000000 --- a/usr/src/lib/libtnf/ref.c +++ /dev/null @@ -1,232 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -#include "libtnf.h" - -/* - * Unoptimized versions, always dereference a cell through _GET_INT32() - * - */ - -#define LONG_SIGN_BIT 0x80000000 - -static tnf_ref32_t *vaddr_to_phys(TNF *, tnf_ref32_t *, tnf_ref32_t); - -/* - * Return target cell referred to via src_val from src_cell, after - * checking that target is valid (block was not reused). Return NULL - * otherwise. - * - * NOTE: We must check if the destination is within the valid_bytes - * range of its block, so as to correctly handle tnfxtract'ed files: - * the block containing the target cell may have been copied out - * before the block containing the source cell. - */ - -static tnf_ref32_t * -vaddr_to_phys(TNF *tnf, tnf_ref32_t *src_cell, tnf_ref32_t src_val) -{ - char *base; - unsigned shft, mask; - tnf_uint32_t src_gen, dst_gen, exp_gen; - tnf_int32_t gen_delta; - tnf_ref32_t src_off, exp_off, dst_off, *dst_blk, *dst_cell; - tnf_uint32_t bytes_valid; - - base = tnf->file_start; - shft = tnf->generation_shift; - mask = tnf->address_mask; - - /* Generation of source cell */ - /* LINTED pointer cast */ - src_gen = _GET_BLOCK_GENERATION(tnf, _GET_BLOCK(tnf, src_cell)); - /* Physical file offset of source cell */ - src_off = (tnf_ref32_t)((char *)src_cell - base); - /* Expected (unadjusted) file offset of destination cell */ - exp_off = src_off + src_val; - /* Generation delta */ - gen_delta = (tnf_int32_t)((unsigned)exp_off >> shft); - if ((exp_off & LONG_SIGN_BIT) == LONG_SIGN_BIT) { - /* sign bit was a 1 - so restore sign */ - gen_delta |= ((unsigned)mask << (32 - shft)); - } - /* Expected destination generation */ - exp_gen = src_gen + gen_delta; - /* Physical file offset of destination cell */ - dst_off = (tnf_ref32_t)((unsigned)exp_off & mask); - - /* Destination cell */ - /* LINTED pointer cast */ - dst_cell = (tnf_ref32_t *)(base + dst_off); - /* Destination block */ - /* LINTED pointer cast */ - dst_blk = _GET_BLOCK(tnf, dst_cell); - /* Generation of destination cell */ - /* LINTED pointer cast */ - dst_gen = _GET_BLOCK_GENERATION(tnf, dst_blk); - /* Bytes valid in destination block */ - /* LINTED pointer cast */ - bytes_valid = _GET_BLOCK_BYTES_VALID(tnf, dst_blk); - - if ((src_gen == (tnf_uint32_t)TNF_TAG_GENERATION_NUM) || - (dst_gen == (tnf_uint32_t)TNF_TAG_GENERATION_NUM) || - ((dst_gen == exp_gen) && - ((char *)dst_cell - (char *)dst_blk) < bytes_valid)) - return (dst_cell); - - return ((tnf_ref32_t *)NULL); -} - -/* - * Return the target referent of a cell, chasing forwarding references. - * Return TNF_NULL if cell is a TNF_NULL forwarding reference. - */ - -tnf_ref32_t * -_tnf_get_ref32(TNF *tnf, tnf_ref32_t *cell) -{ - tnf_ref32_t ref32, reftemp; - - ref32 = _GET_INT32(tnf, cell); - - if (TNF_REF32_IS_NULL(ref32)) - return (TNF_NULL); - - if (TNF_REF32_IS_RSVD(ref32)) { - _tnf_error(tnf, TNF_ERR_BADREFTYPE); - return (TNF_NULL); - } - - if (TNF_REF32_IS_PAIR(ref32)) { - /* We chase the high (tag) half */ - tnf_ref16_t tag16; - - tag16 = TNF_REF32_TAG16(ref32); - - if (TNF_TAG16_IS_ABS(tag16)) { - cell = (tnf_ref32_t *) - ((char *)tnf->file_start -/* LINTED pointer cast may result in improper alignment */ - + TNF_TAG16_ABS16(tag16)); - ref32 = _GET_INT32(tnf, cell); - - } else if (TNF_TAG16_IS_REL(tag16)) { - cell = vaddr_to_phys(tnf, cell, - (tnf_ref32_t) TNF_TAG16_REF16(tag16)); - if (cell == TNF_NULL) - return (TNF_NULL); - ref32 = _GET_INT32(tnf, cell); - - } else { - _tnf_error(tnf, TNF_ERR_BADREFTYPE); - return (TNF_NULL); - } - - } else if (TNF_REF32_IS_PERMANENT(ref32)) { - /* permanent space pointer */ - reftemp = TNF_REF32_VALUE(ref32); - reftemp = TNF_REF32_SIGN_EXTEND(reftemp); - /* LINTED pointer cast may result in improper alignment */ - cell = (tnf_ref32_t *) ((char *)tnf->file_start + reftemp); - ref32 = _GET_INT32(tnf, cell); - - } else { /* full/tag reclaimable space reference */ - cell = vaddr_to_phys(tnf, cell, TNF_REF32_VALUE(ref32)); - if (cell == TNF_NULL) - return (TNF_NULL); - ref32 = _GET_INT32(tnf, cell); - } - - /* chase intermediate forwarding references */ - while (ref32 && TNF_REF32_IS_FWD(ref32)) { - if (TNF_REF32_IS_PERMANENT(ref32)) { - reftemp = TNF_REF32_VALUE(ref32); - reftemp = TNF_REF32_SIGN_EXTEND(reftemp); - cell = (tnf_ref32_t *) ((char *)tnf->file_start + - /* LINTED pointer cast may result in improper alignment */ - reftemp); - - } else { - cell = vaddr_to_phys(tnf, cell, TNF_REF32_VALUE(ref32)); - if (cell == TNF_NULL) - return (TNF_NULL); - } - ref32 = _GET_INT32(tnf, cell); - } - - return (cell); -} - -/* - * Return the target referent of ref16 contained in cell. - * Return TNF_NULL if cell doesn't have a ref16. - */ - -tnf_ref32_t * -_tnf_get_ref16(TNF *tnf, tnf_ref32_t *cell) -{ - tnf_ref32_t ref32, reftemp; - - ref32 = _GET_INT32(tnf, cell); - - if (TNF_REF32_IS_PAIR(ref32)) { - tnf_ref16_t ref16; - - ref16 = TNF_REF32_REF16(ref32); - - if (TNF_REF16_VALUE(ref16) == TNF_NULL) - /* No ref16 was stored */ - return (TNF_NULL); - else { - cell = vaddr_to_phys(tnf, cell, - (tnf_ref32_t) TNF_REF16_VALUE(ref16)); - if (cell == TNF_NULL) - return (TNF_NULL); - ref32 = _GET_INT32(tnf, cell); - } - } else /* not a pair pointer */ - return (TNF_NULL); - - /* chase intermediate forwarding references */ - while (ref32 && TNF_REF32_IS_FWD(ref32)) { - if (TNF_REF32_IS_PERMANENT(ref32)) { - reftemp = TNF_REF32_VALUE(ref32); - reftemp = TNF_REF32_SIGN_EXTEND(reftemp); - cell = (tnf_ref32_t *) ((char *)tnf->file_start + - /* LINTED pointer cast may result in improper alignment */ - reftemp); - - } else { - cell = vaddr_to_phys(tnf, cell, TNF_REF32_VALUE(ref32)); - if (cell == TNF_NULL) - return (TNF_NULL); - } - ref32 = _GET_INT32(tnf, cell); - } - - return (cell); -} diff --git a/usr/src/lib/libtnf/scalar.c b/usr/src/lib/libtnf/scalar.c deleted file mode 100644 index 8d37f690a1..0000000000 --- a/usr/src/lib/libtnf/scalar.c +++ /dev/null @@ -1,170 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -#include "libtnf.h" - -/* - * - */ - -#define CHECK_SCALAR(datum) check_scalar(datum) - -#define DATUM_NATIVE(x) DATUM_TNF(datum)->file_native - -/* - * - */ - -static void check_scalar(tnf_datum_t); - -static tnf_uint64_t get_uint64(TNF *tnf, caddr_t val); - -/* - * - */ - -static void -check_scalar(tnf_datum_t datum) -{ - CHECK_DATUM(datum); - if (!INFO_SCALAR(DATUM_INFO(datum))) - _tnf_error(DATUM_TNF(datum), TNF_ERR_TYPEMISMATCH); - /* XXX Need to check for exact scalar type match as well */ -} - -/* - * Exported scalar operations - */ - -/* No swapping required: */ - -char -tnf_get_char(tnf_datum_t datum) -{ - CHECK_SCALAR(datum); - return (*(char *)DATUM_VAL(datum)); -} - -tnf_int8_t -tnf_get_int8(tnf_datum_t datum) -{ - CHECK_SCALAR(datum); - return (*(tnf_int8_t *)DATUM_VAL(datum)); -} - -tnf_int16_t -tnf_get_int16(tnf_datum_t datum) -{ - tnf_int16_t val; - - CHECK_SCALAR(datum); - /* LINTED pointer cast may result in improper alignment */ - val = *(tnf_int16_t *)DATUM_VAL(datum); - return (DATUM_NATIVE(datum) ? val : _tnf_swap16(val)); -} - -/* 32-bit integers: */ - -tnf_int32_t -tnf_get_int32(tnf_datum_t datum) -{ - CHECK_SCALAR(datum); - /* LINTED pointer cast may result in improper alignment */ - return (_GET_INT32(DATUM_TNF(datum), DATUM_VAL(datum))); -} - -/* 64-bit integers: */ - -static tnf_uint64_t -get_uint64(TNF *tnf, caddr_t val) -{ - tnf_uint32_t hi32, lo32; /* XXX both assumed unsigned */ - - /* XXX Can't rely on address alignment */ - /* LINTED pointer cast may result in improper alignment */ - hi32 = *(tnf_uint32_t *)val; - /* LINTED pointer cast may result in improper alignment */ - lo32 = *(tnf_uint32_t *)(val + sizeof (tnf_uint32_t)); - -#ifdef _LONG_LONG_HTOL - /* eg. sparc */ - if (tnf->file_native) - return ((((tnf_uint64_t)hi32) << 32) - + (tnf_uint64_t)lo32); - else - /* XXX Assume words are swapped as well: */ - return ((((tnf_uint64_t)_tnf_swap32(lo32)) << 32) - + (tnf_uint64_t)_tnf_swap32(hi32)); -#else - /* eg. i386 */ - if (tnf->file_native) - return ((((tnf_uint64_t)lo32) << 32) - + (tnf_uint64_t)hi32); - else - /* XXX Assume words are swapped as well: */ - return ((((tnf_uint64_t)_tnf_swap32(hi32)) << 32) - + (tnf_uint64_t)_tnf_swap32(lo32)); -#endif -} - -tnf_int64_t -tnf_get_int64(tnf_datum_t datum) -{ - CHECK_SCALAR(datum); - return (get_uint64(DATUM_TNF(datum), DATUM_VAL(datum))); -} - -/* floats: */ - -tnf_float32_t -tnf_get_float32(tnf_datum_t datum) -{ - union { - tnf_uint32_t i32; - tnf_float32_t f32; - } u; - - CHECK_SCALAR(datum); - - /* LINTED pointer cast may result in improper alignment */ - u.i32 = _GET_UINT32(DATUM_TNF(datum), DATUM_VAL(datum)); /* XXX */ - return (u.f32); -} - -tnf_float64_t -tnf_get_float64(tnf_datum_t datum) -{ - union { - tnf_uint64_t i64; - tnf_float64_t f64; - } u; - - CHECK_SCALAR(datum); - - u.i64 = get_uint64(DATUM_TNF(datum), DATUM_VAL(datum)); /* XXX */ - return (u.f64); -} diff --git a/usr/src/lib/libtnf/sparcdep.c b/usr/src/lib/libtnf/sparcdep.c deleted file mode 100644 index 04d006ad93..0000000000 --- a/usr/src/lib/libtnf/sparcdep.c +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -#include "libtnf.h" - -tnf_uint32_t -_tnf_swap32(tnf_uint32_t x) -{ - return (((x<<24) | (((x>>8)<<24)>>8) | (((x<<8)>>24)<<8) | (x>>24))); -} - -tnf_uint16_t -_tnf_swap16(tnf_uint16_t x) -{ - return (((x<<8) | (x>>8))); -} diff --git a/usr/src/lib/libtnf/struct.c b/usr/src/lib/libtnf/struct.c deleted file mode 100644 index c7aa1e6a95..0000000000 --- a/usr/src/lib/libtnf/struct.c +++ /dev/null @@ -1,220 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -#include "libtnf.h" - -/* - * - */ - -static struct slotinfo *get_slotinfo(tnf_datum_t); -static struct slot * get_slot_named(struct slotinfo *, char *); -static struct slot * get_slot_indexed(struct slotinfo *, unsigned); -static tnf_datum_t get_slot(tnf_datum_t, struct slot *); - -/* - * - */ - -void -_tnf_check_slots(tnf_datum_t datum) -{ - struct taginfo *info; - - CHECK_DATUM(datum); - - info = DATUM_INFO(datum); - - /* Must be an aggregate */ - if (!(INFO_STRUCT(info) || INFO_ARRAY(info))) - _tnf_error(DATUM_TNF(datum), TNF_ERR_TYPEMISMATCH); -} - -/* - * Helpers - */ - -static struct slotinfo * -get_slotinfo(tnf_datum_t datum) -{ - struct taginfo *info, *base_info; - - info = DATUM_INFO(datum); - base_info = INFO_DERIVED(info)? info->base: info; - - /* XXX base must not be a scalar tag */ - if (INFO_SCALAR(base_info)) - _tnf_error(DATUM_TNF(datum), TNF_ERR_BADTNF); - - return (base_info->slotinfo); -} - -static struct slot * -get_slot_indexed(struct slotinfo *slotinfo, unsigned index) -{ - unsigned count; - - count = slotinfo->slot_count; - if (index >= count) - return (NULL); - else - return (&slotinfo->slots[index]); -} - -static struct slot * -get_slot_named(struct slotinfo *slotinfo, char *name) -{ - unsigned count, i; - - count = slotinfo->slot_count; - - for (i = 0; i < count; i++) - if (strcmp(name, slotinfo->slots[i].slot_name) == 0) - return (&slotinfo->slots[i]); - - return (NULL); -} - -static tnf_datum_t -get_slot(tnf_datum_t datum, struct slot *slot) -{ - if (slot == NULL) { - _tnf_error(DATUM_TNF(datum), TNF_ERR_BADSLOT); /* XXX */ - return (TNF_DATUM_NULL); - - } else if (INFO_TAGGED(slot->slot_type)) { - TNF *tnf; - tnf_ref32_t *rec; - - tnf = DATUM_TNF(datum); - /* LINTED pointer cast may result in improper alignment */ - rec = _GET_REF32(tnf, (tnf_ref32_t *) - (DATUM_VAL(datum) + slot->slot_offset)); - /* NULL slots are allowed */ - return ((rec == TNF_NULL)? TNF_DATUM_NULL : - RECORD_DATUM(tnf, rec)); - - } else /* inline */ - return DATUM(slot->slot_type, - DATUM_VAL(datum) + slot->slot_offset); -} - -/* - * - */ - -unsigned -tnf_get_slot_count(tnf_datum_t datum) -{ - struct slotinfo *slotinfo; - - CHECK_SLOTS(datum); - - slotinfo = get_slotinfo(datum); - return (slotinfo->slot_count); -} - -/* - * - */ - -unsigned -tnf_get_slot_index(tnf_datum_t datum, char *name) -{ - struct slotinfo *slotinfo; - struct slot *slot; - - CHECK_SLOTS(datum); - - slotinfo = get_slotinfo(datum); - slot = get_slot_named(slotinfo, name); - - if (slot == NULL) { - _tnf_error(DATUM_TNF(datum), TNF_ERR_BADSLOT); /* XXX */ - return (((unsigned)-1)); - } else - return (((char *)slot - (char *)&slotinfo->slots[0]) - / sizeof (struct slot)); -} - -/* - * - */ - -char * -tnf_get_slot_name(tnf_datum_t datum, unsigned index) -{ - struct slotinfo *slotinfo; - struct slot *slot; - - CHECK_SLOTS(datum); - - slotinfo = get_slotinfo(datum); - slot = get_slot_indexed(slotinfo, index); - - if (slot == NULL) { - _tnf_error(DATUM_TNF(datum), TNF_ERR_BADSLOT); /* XXX */ - return ((char *)NULL); - } else - return (slot->slot_name); -} - -/* - * - */ - -tnf_datum_t -tnf_get_slot_named(tnf_datum_t datum, char *name) -{ - struct slotinfo *slotinfo; - struct slot *slot; - - CHECK_SLOTS(datum); - - slotinfo = get_slotinfo(datum); - slot = get_slot_named(slotinfo, name); - - return (get_slot(datum, slot)); -} - -/* - * - */ - -tnf_datum_t -tnf_get_slot_indexed(tnf_datum_t datum, unsigned index) -{ - struct slotinfo *slotinfo; - struct slot *slot; - - CHECK_SLOTS(datum); - - slotinfo = get_slotinfo(datum); - slot = get_slot_indexed(slotinfo, index); - - return (get_slot(datum, slot)); -} diff --git a/usr/src/lib/libtnf/tnf.h b/usr/src/lib/libtnf/tnf.h deleted file mode 100644 index 3560bbc35a..0000000000 --- a/usr/src/lib/libtnf/tnf.h +++ /dev/null @@ -1,206 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#ifndef _TNF_TNF_H -#define _TNF_TNF_H - -#pragma ident "%Z%%M% %I% %E% SMI" - -#include <sys/types.h> -#include <tnf/com.h> - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Opaque TNF handle - */ - -typedef struct TNF TNF; - -/* - * Opaque data handle - */ - -typedef unsigned long long tnf_datum_t; - -#define TNF_DATUM_NULL ((tnf_datum_t)0) - -/* - * Reader data classification - */ - -typedef enum { - TNF_K_UNKNOWN, /* unknown or error */ - TNF_K_SCALAR, /* unclassified scalar */ - TNF_K_CHAR, /* char */ - TNF_K_INT8, /* int8 */ - TNF_K_INT16, /* int16 */ - TNF_K_INT32, /* int32 */ - TNF_K_UINT8, /* uint8 */ - TNF_K_UINT16, /* uint16 */ - TNF_K_UINT32, /* uint32 */ - TNF_K_INT64, /* int64 */ - TNF_K_UINT64, /* uint64 */ - TNF_K_FLOAT32, /* float32 */ - TNF_K_FLOAT64, /* float64 */ - TNF_K_ARRAY, /* array */ - TNF_K_STRING, /* string */ - TNF_K_STRUCT, /* struct */ - TNF_K_TYPE /* type */ -} tnf_kind_t; - -/* - * Error codes - */ - -typedef enum { - TNF_ERR_NONE = 0, - - /* 1 through 1023 reserved for errno values */ -#define TNF_ERRNO_MAX 1023 - - TNF_ERR_NOTTNF = 1024, /* not TNF file */ - TNF_ERR_BADDATUM = 1025, /* bad or NULL data handle */ - TNF_ERR_TYPEMISMATCH = 1026, /* type mismatch */ - TNF_ERR_BADINDEX = 1027, /* array index out of bounds */ - TNF_ERR_BADSLOT = 1028, /* slot missing */ - TNF_ERR_BADREFTYPE = 1029, /* invalid reference type */ - TNF_ERR_ALLOCFAIL = 1030, /* memory allocation failure */ - TNF_ERR_BADTNF = 1031, /* bad TNF file */ - TNF_ERR_INTERNAL = 1032 /* internal error */ -} tnf_errcode_t; - -typedef void tnf_error_handler_t(void *, TNF *, tnf_errcode_t); - -/* - * TNF file interface - */ - -tnf_errcode_t tnf_reader_begin(caddr_t, size_t, TNF **); -tnf_errcode_t tnf_reader_end(TNF *); - -/* - * Error interface - */ - -void tnf_set_error_handler(tnf_error_handler_t *, void *); -char * tnf_error_message(tnf_errcode_t); - -tnf_error_handler_t tnf_default_error_handler; - -/* - * Data block access - */ - -unsigned tnf_get_block_count(TNF *); -tnf_datum_t tnf_get_block_absolute(TNF *, unsigned); -tnf_datum_t tnf_get_block_relative(tnf_datum_t, int); -int tnf_is_block_header(tnf_datum_t); - -/* - * Record access - */ - -tnf_datum_t tnf_get_next_record(tnf_datum_t); -tnf_datum_t tnf_get_block_header(tnf_datum_t); -tnf_datum_t tnf_get_file_header(TNF *); - -/* - * Data classification predicates - */ - -int tnf_is_inline(tnf_datum_t); -int tnf_is_scalar(tnf_datum_t); -int tnf_is_record(tnf_datum_t); -int tnf_is_array(tnf_datum_t); -int tnf_is_string(tnf_datum_t); -int tnf_is_struct(tnf_datum_t); -int tnf_is_type(tnf_datum_t); - -/* - * Data operations - */ - -tnf_kind_t tnf_get_kind(tnf_datum_t); -size_t tnf_get_size(tnf_datum_t); -tnf_datum_t tnf_get_type(tnf_datum_t); -char * tnf_get_type_name(tnf_datum_t); -caddr_t tnf_get_raw(tnf_datum_t); - -/* - * Record operations - */ - -tnf_datum_t tnf_get_tag_arg(tnf_datum_t); - -/* - * Array operations - */ - -unsigned tnf_get_element_count(tnf_datum_t); -tnf_datum_t tnf_get_element(tnf_datum_t, unsigned); -tnf_datum_t tnf_get_element_type(tnf_datum_t); -caddr_t tnf_get_elements(tnf_datum_t); -char * tnf_get_chars(tnf_datum_t); - -/* - * Struct operations - */ - -unsigned tnf_get_slot_count(tnf_datum_t); -char * tnf_get_slot_name(tnf_datum_t, unsigned); -unsigned tnf_get_slot_index(tnf_datum_t, char *); -tnf_datum_t tnf_get_slot_named(tnf_datum_t, char *); -tnf_datum_t tnf_get_slot_indexed(tnf_datum_t, unsigned); - -/* - * Scalar data conversions - */ - -char tnf_get_char(tnf_datum_t); -tnf_int8_t tnf_get_int8(tnf_datum_t); -tnf_int16_t tnf_get_int16(tnf_datum_t); -tnf_int32_t tnf_get_int32(tnf_datum_t); -tnf_int64_t tnf_get_int64(tnf_datum_t); -tnf_float32_t tnf_get_float32(tnf_datum_t); -tnf_float64_t tnf_get_float64(tnf_datum_t); - -/* - * Type (tag) record operations - */ - -tnf_kind_t tnf_type_get_kind(tnf_datum_t); -char * tnf_type_get_name(tnf_datum_t); -size_t tnf_type_get_size(tnf_datum_t); -tnf_datum_t tnf_type_get_property(tnf_datum_t, char *); -tnf_datum_t tnf_type_get_base(tnf_datum_t); - -#ifdef __cplusplus -} -#endif - -#endif /* _TNF_TNF_H */ diff --git a/usr/src/lib/libtnf/type.c b/usr/src/lib/libtnf/type.c deleted file mode 100644 index bd18e26559..0000000000 --- a/usr/src/lib/libtnf/type.c +++ /dev/null @@ -1,137 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -#include "libtnf.h" - -/* - * All types are struct records - */ - -void -_tnf_check_type(tnf_datum_t datum) -{ - CHECK_RECORD(datum); - CHECK_SLOTS(datum); - - if (!INFO_TYPE(DATUM_INFO(datum))) - _tnf_error(DATUM_TNF(datum), TNF_ERR_TYPEMISMATCH); -} - -/* - * Get data kind of a type record - */ - -tnf_kind_t -tnf_type_get_kind(tnf_datum_t datum) -{ - struct taginfo *info; - - CHECK_TYPE(datum); - - /* Note: DATUM_RECORD(), not DATUM_TAG() */ - /* LINTED pointer cast may result in improper alignment */ - info = _tnf_get_info(DATUM_TNF(datum), DATUM_RECORD(datum)); - return (info->kind); -} - -/* - * Retrieve type name for datum type record - */ - -char * -tnf_type_get_name(tnf_datum_t datum) -{ - CHECK_TYPE(datum); - /* XXX Dispatch to ABI routine; faster than taginfo lookup? */ - /* LINTED pointer cast may result in improper alignment */ - return (_tnf_get_name(DATUM_TNF(datum), DATUM_RECORD(datum))); -} - -/* - * Fetch size member of info for datum type record - */ - -size_t -tnf_type_get_size(tnf_datum_t datum) -{ - struct taginfo *info; - - CHECK_TYPE(datum); - - /* Note: DATUM_RECORD(), not DATUM_TAG() */ - /* LINTED pointer cast may result in improper alignment */ - info = _tnf_get_info(DATUM_TNF(datum), DATUM_RECORD(datum)); - - if (INFO_ARRAY(info)) - /* XXX All arrays are self-sized */ - return ((size_t)-1); - else - return (info->size); -} - -/* - * Get the base type of a type - */ - -tnf_datum_t -tnf_type_get_base(tnf_datum_t datum) -{ - struct taginfo *info; - - CHECK_TYPE(datum); - - /* Note: DATUM_RECORD(), not DATUM_TAG() */ - /* LINTED pointer cast may result in improper alignment */ - info = _tnf_get_info(DATUM_TNF(datum), DATUM_RECORD(datum)); - - if (INFO_DERIVED(info)) - return (DATUM(info->base->meta, (caddr_t)info->base->tag)); - else - return (datum); -} - -/* - * If type record has named property, return a datum for it - */ - -tnf_datum_t -tnf_type_get_property(tnf_datum_t datum, char *name) -{ - tnf_ref32_t *property; - - CHECK_TYPE(datum); - - /* Note: DATUM_RECORD(), not DATUM_TAG() */ - property = _tnf_get_property(DATUM_TNF(datum), - /* LINTED pointer cast may result in improper alignment */ - DATUM_RECORD(datum), name); - - if (property == TNF_NULL) - return (TNF_DATUM_NULL); - else - return (RECORD_DATUM(DATUM_TNF(datum), property)); -} diff --git a/usr/src/lib/libtnf/util.c b/usr/src/lib/libtnf/util.c deleted file mode 100644 index f81b8aa19c..0000000000 --- a/usr/src/lib/libtnf/util.c +++ /dev/null @@ -1,129 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -#include "libtnf.h" - -/* - * - */ - -static struct ntop { - char *name; - tag_props_t prop; -} ntop[] = { -{ TNF_N_INLINE, TAG_PROP_INLINE }, -{ TNF_N_TAGGED, TAG_PROP_TAGGED }, -{ TNF_N_SCALAR, TAG_PROP_SCALAR }, -{ TNF_N_DERIVED, TAG_PROP_DERIVED }, -{ TNF_N_ARRAY, TAG_PROP_ARRAY }, -{ TNF_N_STRING, TAG_PROP_STRING }, -{ TNF_N_STRUCT, TAG_PROP_STRUCT }, -{ TNF_N_TYPE, TAG_PROP_TYPE }, -{ NULL, 0} -}; - -static struct ntok { - char *name; - tnf_kind_t kind; -} scalar_ntok[] = { -{ TNF_N_CHAR, TNF_K_CHAR }, -{ TNF_N_INT8, TNF_K_INT8 }, -{ TNF_N_INT16, TNF_K_INT16 }, -{ TNF_N_INT32, TNF_K_INT32 }, -{ TNF_N_UINT8, TNF_K_UINT8 }, -{ TNF_N_UINT16, TNF_K_UINT16 }, -{ TNF_N_UINT32, TNF_K_UINT32 }, -{ TNF_N_INT64, TNF_K_INT64 }, -{ TNF_N_UINT64, TNF_K_UINT64 }, -{ TNF_N_FLOAT32, TNF_K_FLOAT32 }, -{ TNF_N_FLOAT64, TNF_K_FLOAT64 }, -{ NULL, 0 } -}; - -/* - * Compute tag props - */ - -tag_props_t -_tnf_get_props(TNF *tnf, tnf_ref32_t *tag) -{ - tag_props_t props; - struct ntop *p; - - props = 0; - - p = ntop; - /* No need to get base tag for inherited properties */ - while (p->name) { - if (HAS_PROPERTY(tnf, tag, p->name)) - props |= p->prop; - p++; - } - - return (props); -} - -/* - * Data kind depends on implementation properties of base tag - */ - -tnf_kind_t -_tnf_get_kind(TNF *tnf, tnf_ref32_t *tag) -{ - tnf_ref32_t *base_tag; - char *base_name; - - base_tag = _tnf_get_base_tag(tnf, tag); - base_name = _tnf_get_name(tnf, base_tag); - - if (HAS_PROPERTY(tnf, base_tag, TNF_N_SCALAR)) { - struct ntok *p; - - p = scalar_ntok; - while (p->name) { - if (strcmp(p->name, base_name) == 0) - return (p->kind); - p++; - } - return (TNF_K_SCALAR); - - } else if (HAS_PROPERTY(tnf, base_tag, TNF_N_ARRAY)) { - if (strcmp(base_name, TNF_N_STRING) == 0) - return (TNF_K_STRING); - else - return (TNF_K_ARRAY); - - } else if (HAS_PROPERTY(tnf, base_tag, TNF_N_TYPE)) { - return (TNF_K_TYPE); - - } else if (HAS_PROPERTY(tnf, base_tag, TNF_N_STRUCT)) { - return (TNF_K_STRUCT); - - } else { /* abstract */ - return (TNF_K_UNKNOWN); - } -} diff --git a/usr/src/lib/libtnfctl/Makefile b/usr/src/lib/libtnfctl/Makefile deleted file mode 100644 index dd6423c945..0000000000 --- a/usr/src/lib/libtnfctl/Makefile +++ /dev/null @@ -1,87 +0,0 @@ -# -# 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 2008 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# -# - -include ../Makefile.lib - -SUBDIRS = $(MACH) -$(BUILD64)SUBDIRS += $(MACH64) - -# conditional assignments -all := TARGET = all -install := TARGET = install -clean := TARGET = clean -clobber := TARGET = clobber -_msg := TARGET= _msg - -LIBRARY= libtnfctl.a -TEXT_DOMAIN= SUNW_OST_OSLIB -XGETFLAGS= -a -MSGDIRS= -POFILE= $(LIBRARY:.a=.po) -POFILES= generic.po - -#definitions for install_h target -HDRS= tnfctl.h -ROOTHDRDIR= $(ROOT)/usr/include/tnf -ROOTHDRS= $(HDRS:%=$(ROOTHDRDIR)/%) -CHECKHDRS= $(HDRS:%.h=%.check) -$(ROOTHDRS) := FILEMODE = 0644 -CHECKHDRS = $(HDRS:%.h=%.check) - -.KEEP_STATE: - -all install clean clobber: $(SUBDIRS) - -install_h: $(ROOTHDRDIR) $(ROOTHDRS) - -check: $(CHECKHDRS) - -$(ROOTLIBDIR) $(ROOTHDRDIR): - $(INS.dir) - -$(ROOTHDRDIR)/% : % - $(INS.file) - -$(SUBDIRS): FRC - @cd $@; pwd; $(MAKE) $(TARGET) - -_msg: $(MSGDOMAIN) .WAIT $(POFILE) - $(RM) $(MSGDOMAIN)/$(POFILE) - $(CP) $(POFILE) $(MSGDOMAIN) - -$(POFILE): $(POFILES) - $(RM) $@ - $(CAT) $(POFILES) > $@ - -generic.po: - $(RM) messages.po - $(XGETTEXT) $(XGETFLAGS) `$(GREP) -l gettext *.[ch]* ` - $(SED) -e '/^# msg/d' -e '/^domain/d' messages.po > $@ - $(RM) messages.po - -FRC: - -include ../Makefile.targ diff --git a/usr/src/lib/libtnfctl/Makefile.com b/usr/src/lib/libtnfctl/Makefile.com deleted file mode 100644 index 83cff465bc..0000000000 --- a/usr/src/lib/libtnfctl/Makefile.com +++ /dev/null @@ -1,118 +0,0 @@ -# -# 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 2006 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# -# Copyright (c) 2019, Joyent, Inc. - -LIBRARY= libtnfctl.a -VERS= .1 -OBJECTS.c= open.o \ - prb_child.o \ - prb_shmem.o \ - prb_proc.o \ - prb_lmap.o \ - prb_rtld.o \ - prb_findexec.o \ - prb_status.o \ - util.o \ - traverse.o \ - sym.o \ - elf.o \ - continue.o \ - checklib.o \ - probes.o \ - probes_ext.o \ - close.o \ - targmem.o \ - comb.o \ - kernel_int.o \ - kernel.o \ - internal.o \ - status.o - - -OBJECTS.s= $(MACH)_assm.o - -OBJECTS= $(OBJECTS.c) $(OBJECTS.s) - -include ../../Makefile.lib - -# We omit $(OBJECTS.s:%.o=%.s) in the next line, because lint no like -SRCS= $(OBJECTS.c:%.o=../%.c) - -LIBS= $(DYNLIB) - -HDRS= tnfctl.h -ROOTHDRDIR= $(ROOT)/usr/include/tnf -ROOTHDRS= $(HDRS:%=$(ROOTHDRDIR)/%) -CHECKHDRS= $(HDRS:%.h=%.check) -$(ROOTHDRS) := FILEMODE = 0644 -CHECKHDRS = $(HDRS:%.h=%.check) - -LDLIBS += -lc -lelf - -CPPFLAGS += -I$(SRC)/lib/libtnfprobe -D_REENTRANT -I$(SRC)/cmd/sgs/include - - -CERRWARN += $(CNOWARN_UNINIT) -CERRWARN += -_gcc=-Wno-empty-body -CERRWARN += -_gcc=-Wno-parentheses - -# not linted -SMATCH=off - -ASFLAGS += -P - -$(ROOTHDRS) := FILEMODE = 644 - -.KEEP_STATE: - -all: $(LIBS) - -install_h: $(ROOTHDRDIR) $(ROOTHDRS) - - -check: $(CHECKHDRS) - -$(ROOTLIBDIR) $(ROOTHDRDIR): - $(INS.dir) - -$(ROOTHDRDIR)/% : % - $(INS.file) - -BUILD.s= $(AS) $< -o $@ - -objs/%.o pics/%.o: ../%.s - $(COMPILE.s) -o $@ $< - $(POST_PROCESS_S_O) - -objs/%.o pics/%.o: ../%.c - $(COMPILE.c) -o $@ $< - $(POST_PROCESS_O) - - -%.o: ../%.c - $(COMPILE.c) -o $@ $< - $(POST_PROCESS_O) - -include ../../Makefile.targ diff --git a/usr/src/lib/libtnfctl/amd64/Makefile b/usr/src/lib/libtnfctl/amd64/Makefile deleted file mode 100644 index 3f238e6cae..0000000000 --- a/usr/src/lib/libtnfctl/amd64/Makefile +++ /dev/null @@ -1,33 +0,0 @@ -# -# 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 2006 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# -# ident "%Z%%M% %I% %E% SMI" -# - -include ../Makefile.com -include ../../Makefile.lib.64 - -.KEEP_STATE: - -install: all $(ROOTLIBS64) $(ROOTLINKS64) diff --git a/usr/src/lib/libtnfctl/checklib.c b/usr/src/lib/libtnfctl/checklib.c deleted file mode 100644 index 324cbcfbd1..0000000000 --- a/usr/src/lib/libtnfctl/checklib.c +++ /dev/null @@ -1,135 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -/* - * Functions to sync up library list with that of the run time linker - */ - -#ifndef DEBUG -#define NDEBUG 1 -#endif - -#include <assert.h> - -#include "tnfctl_int.h" -#include "kernel_int.h" -#include "dbg.h" - -tnfctl_errcode_t -tnfctl_check_libs(tnfctl_handle_t *hndl) -{ - tnfctl_errcode_t prexstat; - enum event_op_t dl_evt; - boolean_t lmap_ok; - - if (hndl->mode == KERNEL_MODE) { - prexstat = _tnfctl_refresh_kernel(hndl); - return (prexstat); - } - - /* hndl refers to a process */ - - /* return value of lmap_ok, dl_evt ignored */ - prexstat = _tnfctl_refresh_process(hndl, &lmap_ok, &dl_evt); - assert(lmap_ok == B_TRUE); - return (prexstat); -} - -/* - * _tnfctl_lock_libs() locks the library list maintained in the prex - * handle against it changing by a dlopen or dlclose. - * - * This locking code is between the thread that owns the handle and - * another thread that may be doing a dlopen/dlclose. We do not support - * the situation of having multiple threads operating on the same - * handle - in effect the code per tnfctl_handle can be thought of as - * being single-threaded - that is why we can check "hndl->in_objlist" - * without first obtaining a lock. "in_objlist" is the re-entrancy - * protector on the lock i.e. we can call _tnfctl_lock_libs() safely even if - * this thread has the lock held. The return value "release_lock" indicates - * whether the lock should be released or not. It can be passed into - * _tnfctl_unlock_libs() which will do the right thing. - */ - -tnfctl_errcode_t -_tnfctl_lock_libs(tnfctl_handle_t *hndl, boolean_t *release_lock) -{ - /* this interface is only for INTERNAL_MODE clients */ - assert(hndl->mode == INTERNAL_MODE); - - if (hndl->in_objlist == B_TRUE) { - /* - * already have _tnfctl_lmap_lock held which implies that - * the library list has been sync'ed up - */ - *release_lock = B_FALSE; - return (TNFCTL_ERR_NONE); - } - - /* lock is not currently held, so lock it */ - mutex_lock(&_tnfctl_lmap_lock); - hndl->in_objlist = B_TRUE; - - *release_lock = B_TRUE; - return (TNFCTL_ERR_NONE); -} - -void -_tnfctl_unlock_libs(tnfctl_handle_t *hndl, boolean_t release_lock) -{ - /* this interface is only for INTERNAL_MODE clients */ - assert(hndl->mode == INTERNAL_MODE); - - if (release_lock) { - hndl->in_objlist = B_FALSE; - mutex_unlock(&_tnfctl_lmap_lock); - } -} - -/* - * _tnfctl_syn_lib_list() syncs up the library list maintained - * in the prex handle with the libraries in the process (if needed) - * NOTE: Assumes _tnfctl_lmap_lock is held. - * - */ -tnfctl_errcode_t -_tnfctl_sync_lib_list(tnfctl_handle_t *hndl) -{ - tnfctl_errcode_t prexstat = TNFCTL_ERR_NONE; - enum event_op_t dl_evt; - boolean_t lmap_ok; - - /* this interface is only for INTERNAL_MODE clients */ - assert(hndl->mode == INTERNAL_MODE); - - /* lmap_lock held and in_objlist marked as B_TRUE */ - if (_tnfctl_libs_changed == B_TRUE) { - prexstat = _tnfctl_refresh_process(hndl, &lmap_ok, &dl_evt); - if (prexstat) { - return (prexstat); - } - } - return (TNFCTL_ERR_NONE); -} diff --git a/usr/src/lib/libtnfctl/close.c b/usr/src/lib/libtnfctl/close.c deleted file mode 100644 index a18b6f9d6b..0000000000 --- a/usr/src/lib/libtnfctl/close.c +++ /dev/null @@ -1,162 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -/* - * Interface to close a tnfctl handle - */ - -#include "tnfctl_int.h" -#include "kernel_int.h" -#include "dbg.h" - -#include <stdlib.h> -#include <signal.h> -#include <errno.h> - -/* for bug 1253419 - guard against multiple tracing */ - -extern mutex_t _tnfctl_internalguard_lock; - -/* - * Close a tnfctl handle - close any open fds and free up any memory - * that was allocated. - */ -tnfctl_errcode_t -tnfctl_close(tnfctl_handle_t *hdl, tnfctl_targ_op_t action) -{ - tnfctl_errcode_t prexstat; - prb_status_t prbstat; - prb_proc_ctl_t *proc_p; - tnfctl_probe_t *probe_hdl, *tmp_hdl; - - if (hdl == NULL) - return (TNFCTL_ERR_NONE); - - if (hdl->mode == KERNEL_MODE) { - prexstat = _tnfctl_prbk_close(hdl); - if (prexstat) - return (prexstat); - } - - if (hdl->mode == INTERNAL_MODE) { - _tnfctl_internal_releaselock(); - } else if (hdl->mode != KERNEL_MODE) { - _tnfctl_external_releaselock(hdl); - } - - _tnfctl_free_objs_and_probes(hdl); - - /* free probe handles */ - probe_hdl = hdl->probe_handle_list_head; - while (probe_hdl != NULL) { - /* call the destructor function for client probe data */ - if (hdl->destroy_func) - hdl->destroy_func(probe_hdl->client_registered_data); - tmp_hdl = probe_hdl; - probe_hdl = probe_hdl->next; - free(tmp_hdl); - } - hdl->probe_handle_list_head = NULL; - - if (hdl->mode != DIRECT_MODE) { - /* indirect, internal, or kernel mode */ - free(hdl); - return (TNFCTL_ERR_NONE); - } - - /* DIRECT_MODE */ - - proc_p = hdl->proc_p; - if (proc_p == NULL) { - free(hdl); - return (TNFCTL_ERR_NONE); - } - - switch (action) { - case TNFCTL_TARG_DEFAULT: - break; - case TNFCTL_TARG_KILL: - prbstat = prb_proc_setklc(proc_p, B_TRUE); - if (prbstat) - return (_tnfctl_map_to_errcode(prbstat)); - prbstat = prb_proc_setrlc(proc_p, B_FALSE); - if (prbstat) - return (_tnfctl_map_to_errcode(prbstat)); - break; - case TNFCTL_TARG_RESUME: - prbstat = prb_proc_setklc(proc_p, B_FALSE); - if (prbstat) - return (_tnfctl_map_to_errcode(prbstat)); - prbstat = prb_proc_setrlc(proc_p, B_TRUE); - if (prbstat) - return (_tnfctl_map_to_errcode(prbstat)); - break; - case TNFCTL_TARG_SUSPEND: - prbstat = prb_proc_setklc(proc_p, B_FALSE); - if (prbstat) - return (_tnfctl_map_to_errcode(prbstat)); - prbstat = prb_proc_setrlc(proc_p, B_FALSE); - if (prbstat) - return (_tnfctl_map_to_errcode(prbstat)); - break; - default: - return (TNFCTL_ERR_BADARG); - } - prbstat = prb_proc_close(proc_p); - free(hdl); - return (_tnfctl_map_to_errcode(prbstat)); -} - -tnfctl_errcode_t -_tnfctl_internal_releaselock() -{ - mutex_lock(&_tnfctl_internalguard_lock); - _tnfctl_internal_tracing_flag = 0; - mutex_unlock(&_tnfctl_internalguard_lock); - return (TNFCTL_ERR_NONE); -} - -tnfctl_errcode_t -_tnfctl_external_releaselock(tnfctl_handle_t *hdl) -{ - tnfctl_errcode_t prexstat; - prb_status_t prbstat; - uintptr_t targ_symbol_ptr; - pid_t pidzero = 0; - - prexstat = _tnfctl_sym_find(hdl, TNFCTL_EXTERNAL_TRACEDPID, - &targ_symbol_ptr); - if (prexstat) { - return (prexstat); - } - prbstat = hdl->p_write(hdl->proc_p, targ_symbol_ptr, - &pidzero, sizeof (pidzero)); - if (prbstat) { - return (_tnfctl_map_to_errcode(prbstat)); - } - return (TNFCTL_ERR_NONE); -} diff --git a/usr/src/lib/libtnfctl/comb.c b/usr/src/lib/libtnfctl/comb.c deleted file mode 100644 index e201b3c561..0000000000 --- a/usr/src/lib/libtnfctl/comb.c +++ /dev/null @@ -1,642 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -/* - * Functions that know how to create and decode combinations that are - * used for connecting probe functions. - */ - -#ifndef DEBUG -#define NDEBUG 1 -#endif - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <search.h> -#include <assert.h> -#include <sys/types.h> - -#include "tnfctl_int.h" -#include "dbg.h" - - -/* - * Typedefs - */ - -typedef struct comb_callinfo { - unsigned offset; - unsigned shift; /* shift right <n> bits */ - unsigned mask; - -} comb_callinfo_t; - -typedef struct comb_calltmpl { - uintptr_t entry; - uintptr_t down; - uintptr_t next; - uintptr_t end; - -} comb_calltmpl_t; - -typedef struct comb_key { - comb_op_t op; - uintptr_t down; - uintptr_t next; - uintptr_t comb; -} comb_key_t; - -typedef struct decode_key { - uintptr_t addr; - char **name_ptrs; - uintptr_t *func_addrs; -} decode_key_t; - - -/* - * Global - defined in assembler file - */ -extern comb_callinfo_t prb_callinfo; - -extern void prb_chain_entry(void); -extern void prb_chain_down(void); -extern void prb_chain_next(void); -extern void prb_chain_end(void); - -static comb_calltmpl_t calltmpl[PRB_COMB_COUNT] = { -{ - (uintptr_t)prb_chain_entry, - (uintptr_t)prb_chain_down, - (uintptr_t)prb_chain_next, - (uintptr_t)prb_chain_end} -}; - -/* - * Declarations - */ - -static tnfctl_errcode_t decode(tnfctl_handle_t *hndl, uintptr_t addr, - char ***func_names, uintptr_t **func_addrs); -static boolean_t find(tnfctl_handle_t *hndl, comb_op_t op, uintptr_t down, - uintptr_t next, uintptr_t *comb_p); -static tnfctl_errcode_t build(tnfctl_handle_t *hndl, comb_op_t op, - uintptr_t down, uintptr_t next, uintptr_t *comb_p); -static tnfctl_errcode_t add(tnfctl_handle_t *hndl, comb_op_t op, uintptr_t down, - uintptr_t next, uintptr_t comb); -static int comb_compare(const void *a, const void *b); -static int decode_compare(const void *v0p, const void *v1p); -static tnfctl_errcode_t iscomb(tnfctl_handle_t *hndl, uintptr_t addr, - uintptr_t *down_p, uintptr_t *next_p, boolean_t *ret_val); -static tnfctl_errcode_t findname(tnfctl_handle_t *hndl, uintptr_t addr, - char **ret_name); - - -/* ---------------------------------------------------------------- */ -/* ----------------------- Public Functions ----------------------- */ -/* ---------------------------------------------------------------- */ - -/* - * _tnfctl_comb_build() - finds (or builds) a combination satisfing the op, - * down and next constraints of the caller. - */ -tnfctl_errcode_t -_tnfctl_comb_build(tnfctl_handle_t *hndl, comb_op_t op, - uintptr_t down, uintptr_t next, uintptr_t *comb_p) -{ - tnfctl_errcode_t prexstat; - - *comb_p = 0; - - DBG_TNF_PROBE_0(_tnfctl_comb_build_start, "libtnfctl", - "start _tnfctl_comb_build; sunw%verbosity 1"); - - if (find(hndl, op, down, next, comb_p)) { - - DBG_TNF_PROBE_1(_tnfctl_comb_build_end, "libtnfctl", - "end _tnfctl_comb_build; sunw%verbosity 1", - tnf_opaque, found_comb_at, *comb_p); - - return (TNFCTL_ERR_NONE); - } - prexstat = build(hndl, op, down, next, comb_p); - - DBG_TNF_PROBE_1(_tnfctl_comb_build_end, "libtnfctl", - "end _tnfctl_comb_build; sunw%verbosity 1", - tnf_opaque, built_comb_at, *comb_p); - - return (prexstat); -} - - -/* - * _tnfctl_comb_decode() - returns a string describing the probe functions - * NOTE - the string is for reference purposes ONLY, it should not be freed - * by the client. - */ -tnfctl_errcode_t -_tnfctl_comb_decode(tnfctl_handle_t *hndl, uintptr_t addr, char ***func_names, - uintptr_t **func_addrs) -{ - tnfctl_errcode_t prexstat; - - DBG_TNF_PROBE_0(_tnfctl_comb_decode_start, "libtnfctl", - "start _tnfctl_comb_decode; sunw%verbosity 2"); - - prexstat = decode(hndl, addr, func_names, func_addrs); - - DBG_TNF_PROBE_0(_tnfctl_comb_decode_end, "libtnfctl", - "end _tnfctl_comb_decode; sunw%verbosity 2"); - - return (prexstat); -} - - -/* ---------------------------------------------------------------- */ -/* ----------------------- Private Functions ---------------------- */ -/* ---------------------------------------------------------------- */ - -/* - * if combination has been decoded, return decoded info., else - * decode combination and cache information - */ -static tnfctl_errcode_t -decode(tnfctl_handle_t *hndl, uintptr_t addr, char ***func_names, - uintptr_t **func_addrs) -{ - tnfctl_errcode_t prexstat = TNFCTL_ERR_NONE; - decode_key_t key; - decode_key_t *new_p = NULL; - decode_key_t **find_pp; - uintptr_t down; - uintptr_t next; - char *thisname = NULL; - boolean_t is_combination; - - /* see if we can find the previously decoded answer */ - key.addr = addr; - find_pp = (decode_key_t **)tfind(&key, &hndl->decoderoot, - decode_compare); - if (find_pp) { - DBG_TNF_PROBE_0(decode_1, "libtnfctl", - "sunw%verbosity 2; sunw%debug 'found existing'"); - *func_names = (*find_pp)->name_ptrs; - *func_addrs = (*find_pp)->func_addrs; - return (TNFCTL_ERR_NONE); - } - - new_p = calloc(1, sizeof (decode_key_t)); - if (!new_p) - return (TNFCTL_ERR_ALLOCFAIL); - new_p->addr = addr; - - prexstat = iscomb(hndl, addr, &down, &next, &is_combination); - if (prexstat) - goto Error; - - if (is_combination) { - char **nextnames; - uintptr_t *nextaddrs; - char **name_pp; - uintptr_t *addr_p; - int count, j; - - DBG_TNF_PROBE_2(decode_2, "libtnfctl", "sunw%verbosity 2;", - tnf_opaque, down, down, tnf_opaque, next, next); - - prexstat = findname(hndl, down, &thisname); - if (prexstat == TNFCTL_ERR_USR1) { - /* - * should never happen - combination should not - * point at the end function - */ - prexstat = TNFCTL_ERR_INTERNAL; - goto Error; - } else if (prexstat) - goto Error; - - prexstat = decode(hndl, next, &nextnames, &nextaddrs); - if (prexstat) - goto Error; - - /* count number of elements - caution: empty 'for' loop */ - for (count = 0; nextnames[count]; count++) - ; - count++; /* since it was 0 based */ - - /* allocate one more for new function name */ - new_p->name_ptrs = malloc((count + 1) * - sizeof (new_p->name_ptrs[0])); - if (new_p->name_ptrs == NULL) { - prexstat = TNFCTL_ERR_ALLOCFAIL; - goto Error; - } - new_p->func_addrs = malloc((count + 1) * - sizeof (new_p->func_addrs[0])); - if (new_p->func_addrs == NULL) { - prexstat = TNFCTL_ERR_ALLOCFAIL; - goto Error; - } - name_pp = new_p->name_ptrs; - addr_p = new_p->func_addrs; - addr_p[0] = down; - name_pp[0] = thisname; - for (j = 0; j < count; j++) { - name_pp[j + 1] = nextnames[j]; - addr_p[j + 1] = nextaddrs[j]; - } - } else { - prexstat = findname(hndl, addr, &thisname); - if (prexstat != TNFCTL_ERR_USR1) { - /* - * base case - end function is the only function - * that can be pointed at directly - */ - if (prexstat == TNFCTL_ERR_NONE) - prexstat = TNFCTL_ERR_NONE; - goto Error; - } - new_p->name_ptrs = malloc(sizeof (new_p->name_ptrs[0])); - if (new_p->name_ptrs == NULL) { - prexstat = TNFCTL_ERR_ALLOCFAIL; - goto Error; - } - new_p->func_addrs = malloc(sizeof (new_p->func_addrs[0])); - if (new_p->func_addrs == NULL) { - prexstat = TNFCTL_ERR_ALLOCFAIL; - goto Error; - } - new_p->name_ptrs[0] = NULL; - new_p->func_addrs[0] = 0; - } - - DBG_TNF_PROBE_1(decode_3, "libtnfctl", - "sunw%verbosity 2; sunw%debug 'decode built'", - tnf_string, func_name, (thisname) ? (thisname) : "end_func"); - - find_pp = (decode_key_t **)tsearch(new_p, &hndl->decoderoot, - decode_compare); - assert(*find_pp == new_p); - *func_names = new_p->name_ptrs; - *func_addrs = new_p->func_addrs; - return (TNFCTL_ERR_NONE); - -Error: - if (new_p) { - if (new_p->name_ptrs) - free(new_p->name_ptrs); - if (new_p->func_addrs) - free(new_p->func_addrs); - free(new_p); - } - return (prexstat); -} - - -/* - * iscomb() - determine whether the pointed to function is a combination. If - * it is, return the down and next pointers - */ -static tnfctl_errcode_t -iscomb(tnfctl_handle_t *hndl, uintptr_t addr, uintptr_t *down_p, - uintptr_t *next_p, boolean_t *ret_val) -{ - int type; - boolean_t matched = B_FALSE; - - for (type = 0; type < PRB_COMB_COUNT; type++) { - size_t size; - int miscstat; - char *targ_p; - char *ptr; - char *tptr; - uintptr_t downaddr; - uintptr_t nextaddr; - int num_bits = 0; - int tmp_bits = prb_callinfo.mask; - - /* allocate room to copy the target code */ - size = (size_t)(calltmpl[type].end - calltmpl[type].entry); - targ_p = malloc(size); - if (!targ_p) - return (TNFCTL_ERR_ALLOCFAIL); - - /* copy code from target */ - miscstat = hndl->p_read(hndl->proc_p, addr, targ_p, size); - if (miscstat) { - free(targ_p); - return (TNFCTL_ERR_INTERNAL); - } - - /* find the number of bits before the highest bit in mask */ - while (tmp_bits > 0) { - num_bits++; - tmp_bits <<= 1; - } - - /* loop over all the words */ - tptr = (char *)calltmpl[type].entry; - for (ptr = targ_p; ptr < (targ_p + size); ptr++, tptr++) { - int downbits; - int nextbits; - /* LINTED pointer cast may result in improper alignment */ - int *uptr = (int *)ptr; - - /* - * If we are pointing at one of the words that we - * patch, * (down or next displ) then read that value - * in. * Otherwise make sure the words match. - */ - if ((uintptr_t)tptr == calltmpl[type].down + - prb_callinfo.offset) { - downbits = *uptr; - downbits &= prb_callinfo.mask; - /* sign extend */ - downbits = (downbits << num_bits) >> num_bits; - downbits <<= prb_callinfo.shift; - downaddr = addr + (ptr - targ_p) + downbits; -#if defined(i386) - downaddr += 4; - /* intel is relative to *next* instruction */ -#endif - - ptr += 3; - tptr += 3; - } else if ((uintptr_t)tptr == calltmpl[type].next + - prb_callinfo.offset) { - nextbits = *uptr; - nextbits &= prb_callinfo.mask; - /* sign extend */ - nextbits = (nextbits << num_bits) >> num_bits; - nextbits <<= prb_callinfo.shift; - nextaddr = addr + (ptr - targ_p) + nextbits; -#if defined(i386) - nextaddr += 4; - /* intel is relative to *next* instruction */ -#endif - - ptr += 3; - tptr += 3; - } else { - /* the byte better match or we bail */ - if (*ptr != *tptr) - goto NextComb; - } - } - - /* YOWSA! - its a match */ - matched = B_TRUE; - -NextComb: - /* free allocated memory */ - if (targ_p) - free(targ_p); - - if (matched) { - *down_p = downaddr; - *next_p = nextaddr; - *ret_val = B_TRUE; - return (TNFCTL_ERR_NONE); - } - } - - *ret_val = B_FALSE; - return (TNFCTL_ERR_NONE); -} - - -#define FUNC_BUF_SIZE 32 -/* - * findname() - find a name for a function given its address. - */ -static tnfctl_errcode_t -findname(tnfctl_handle_t *hndl, uintptr_t addr, char **ret_name) -{ - char *symname; - tnfctl_errcode_t prexstat; - - symname = NULL; - prexstat = _tnfctl_sym_findname(hndl, addr, &symname); - if ((prexstat == TNFCTL_ERR_NONE) && (symname != NULL)) { - /* found a name */ - - /* - * SPECIAL CASE - * If we find "tnf_trace_end" then we should not report it - * as this is the "end-cap" function and should be hidden - * from the user. Return a null string instead ... - */ - if (strcmp(symname, TRACE_END_FUNC) == 0) { - return (TNFCTL_ERR_USR1); - } else { - *ret_name = symname; - return (TNFCTL_ERR_NONE); - } - } else { - char *buffer; - - buffer = malloc(FUNC_BUF_SIZE); - if (buffer == NULL) - return (TNFCTL_ERR_ALLOCFAIL); - - /* no name found, use the address */ - (void) sprintf(buffer, "func@0x%p", addr); - *ret_name = buffer; - return (TNFCTL_ERR_NONE); - } -} - - -/* - * find() - try to find an existing combination that satisfies ... - */ -static boolean_t -find(tnfctl_handle_t *hndl, comb_op_t op, uintptr_t down, uintptr_t next, - uintptr_t *comb_p) -{ - comb_key_t key; - comb_key_t **find_pp; - - key.op = op; - key.down = down; - key.next = next; - key.comb = 0; - - find_pp = (comb_key_t **)tfind(&key, &hndl->buildroot, comb_compare); - if (find_pp) { - *comb_p = (*find_pp)->comb; - return (B_TRUE); - } else - return (B_FALSE); -} - - -/* - * add() - adds a combination to combination cache - */ -static tnfctl_errcode_t -add(tnfctl_handle_t *hndl, comb_op_t op, uintptr_t down, uintptr_t next, - uintptr_t comb) -{ - comb_key_t *new_p; - /* LINTED set but not used in function */ - comb_key_t **ret_pp __unused; - - new_p = malloc(sizeof (comb_key_t)); - if (!new_p) - return (TNFCTL_ERR_ALLOCFAIL); - - new_p->op = op; - new_p->down = down; - new_p->next = next; - new_p->comb = comb; - - ret_pp = (comb_key_t **)tsearch(new_p, &hndl->buildroot, - comb_compare); - assert(*ret_pp == new_p); - return (TNFCTL_ERR_NONE); -} - - -/* - * decode_compare() - comparison function used for tree search for - * combinations - */ -static int -decode_compare(const void *v0p, const void *v1p) -{ - const decode_key_t *k0p = v0p; - const decode_key_t *k1p = v1p; - - return (int)((uintptr_t)k1p->addr - (uintptr_t)k0p->addr); -} /* end decode_compare */ - - -/* - * comb_compare() - comparison function used for tree search for combinations - */ -static int -comb_compare(const void *v0p, const void *v1p) -{ - const comb_key_t *k0p = v0p; - const comb_key_t *k1p = v1p; - - if (k0p->op != k1p->op) - return ((k0p->op < k1p->op) ? -1 : 1); - - if (k0p->down != k1p->down) - return ((k0p->down < k1p->down) ? -1 : 1); - - if (k0p->next != k1p->next) - return ((k0p->next < k1p->next) ? -1 : 1); - - return (0); - -} /* end comb_compare */ - -/* - * build() - build a composition - */ -static tnfctl_errcode_t -build(tnfctl_handle_t *hndl, comb_op_t op, uintptr_t down, uintptr_t next, - uintptr_t *comb_p) -{ - size_t size; - uintptr_t addr; - char *buffer_p = NULL; - uintptr_t offset; - uintptr_t contents; - unsigned *word_p; - int miscstat; - tnfctl_errcode_t prexstat; - - *comb_p = 0; - size = calltmpl[op].end - calltmpl[op].entry; - - /* allocate memory in the target process */ - prexstat = _tnfctl_targmem_alloc(hndl, size, &addr); - if (prexstat) { - DBG((void) fprintf(stderr, - "build: trouble allocating target memory:\n")); - goto Error; - } - - /* allocate a scratch buffer, copy the template into it */ - buffer_p = malloc(size); - if (!buffer_p) { - DBG((void) fprintf(stderr, "build: alloc failed\n")); - prexstat = TNFCTL_ERR_ALLOCFAIL; - goto Error; - } - (void) memcpy(buffer_p, (void *) calltmpl[op].entry, size); - - /* poke the down address */ - offset = calltmpl[op].down - calltmpl[op].entry; - /*LINTED pointer cast may result in improper alignment*/ - word_p = (unsigned *)(buffer_p + offset + prb_callinfo.offset); - contents = down - (addr + offset); -#if defined(i386) - contents -= 5; /* intel offset is relative to *next* instr */ -#endif - - DBG_TNF_PROBE_4(build_1, "libtnfctl", "sunw%verbosity 3", - tnf_opaque, down, down, tnf_opaque, contents, contents, - tnf_opaque, word_p, word_p, tnf_long, offset, offset); - - *word_p &= ~prb_callinfo.mask; /* clear the relevant field */ - *word_p |= ((contents >> prb_callinfo.shift) & prb_callinfo.mask); - - /* poke the next address */ - offset = calltmpl[op].next - calltmpl[op].entry; - /*LINTED pointer cast may result in improper alignment*/ - word_p = (unsigned *)(buffer_p + offset + prb_callinfo.offset); - contents = next - (addr + offset); -#if defined(i386) - contents -= 5; /* intel offset is relative to *next* instr */ -#endif - - DBG_TNF_PROBE_4(build_2, "libtnfctl", "sunw%verbosity 3", - tnf_opaque, next, next, tnf_opaque, contents, contents, - tnf_opaque, word_p, word_p, tnf_long, offset, offset); - - *word_p &= ~prb_callinfo.mask; /* clear the relevant field */ - *word_p |= ((contents >> prb_callinfo.shift) & prb_callinfo.mask); - - /* copy the combination template into target memory */ - miscstat = hndl->p_write(hndl->proc_p, addr, buffer_p, size); - if (miscstat) { - DBG((void) fprintf(stderr, - "build: trouble writing combination: \n")); - prexstat = TNFCTL_ERR_INTERNAL; - goto Error; - } - *comb_p = addr; - prexstat = add(hndl, op, down, next, addr); - -Error: - if (buffer_p) - free(buffer_p); - return (prexstat); -} diff --git a/usr/src/lib/libtnfctl/continue.c b/usr/src/lib/libtnfctl/continue.c deleted file mode 100644 index cc4ef319d3..0000000000 --- a/usr/src/lib/libtnfctl/continue.c +++ /dev/null @@ -1,347 +0,0 @@ -/* - * 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 2010 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -/* - * interface to continue a target process (DIRECT_MODE) and helper - * functions needed by this routine. - */ - -#include "tnfctl_int.h" -#include "prb_proc.h" -#include "dbg.h" - - -#include <stdlib.h> -#include <errno.h> - -static tnfctl_errcode_t _tnfctl_continue(tnfctl_handle_t *hndl, - tnfctl_event_t *evt, sigset_t *oldmask, boolean_t watch_forks); -static tnfctl_errcode_t enable_target_state(tnfctl_handle_t *hndl, - boolean_t watch_forks); -static tnfctl_errcode_t disable_target_state(tnfctl_handle_t *hndl); - -/* - * continue the target process and return the evt it stopped on. - * If child_hndl is set and we see a fork, return a handle on child - * process. - */ -tnfctl_errcode_t -tnfctl_continue(tnfctl_handle_t *hndl, tnfctl_event_t *evt, - tnfctl_handle_t **child_hndl) -{ - tnfctl_errcode_t prexstat; - prb_status_t prbstat; - boolean_t lmapok = B_FALSE; - boolean_t watch_forks; - /* set my_evt to something other than TNFCTL_EVENT_TARGGONE */ - tnfctl_event_t my_evt = TNFCTL_EVENT_EINTR; - enum event_op_t dl_evt; - sigset_t newmask, oldmask; - prb_proc_ctl_t *proc_p; - prgreg_t reg0, reg1; - - /* this interface only works for DIRECT_MODE clients */ - if (hndl->mode != DIRECT_MODE) - return (TNFCTL_ERR_BADARG); - - proc_p = hndl->proc_p; - - if (sigfillset(&newmask) == -1) - return (tnfctl_status_map(errno)); - - watch_forks = (child_hndl != NULL); - - /* - * XXXX block all signals. Synchronous signals like SEGV that - * the user could catch and handle will now result in a core dump. - * But, this is very unlikely for 2 reasons - most users don't try - * to handle synchronous signals - it usually just aborts the process. - * And, secondly, the code until we return the original mask is the - * place where this synchronous signal would be generated - and, it - * is not very much code. - */ - if (sigprocmask(SIG_BLOCK, &newmask, &oldmask) == -1) - return (tnfctl_status_map(errno)); - - /* - * Target is stopped on entry because tnfctl_continue() - * only returns with a stopped target. - */ - - /* target process shouldn't be stopped when link maps are incosistent */ - while (lmapok == B_FALSE) { - prexstat = _tnfctl_continue(hndl, &my_evt, &oldmask, - watch_forks); - if (prexstat) { - if (my_evt == TNFCTL_EVENT_TARGGONE || - my_evt == TNFCTL_EVENT_EXIT) { - /* - * target exited - free obj list and probe - * list so that we keep our internal state - * correct, else probe control interfaces will - * have wrong information. - */ - DBG(fprintf(stderr, "target is gone\n")); - _tnfctl_free_objs_and_probes(hndl); - *evt = my_evt; - return (TNFCTL_ERR_NONE); - } else if (my_evt == TNFCTL_EVENT_EXEC) { - *evt = my_evt; - return (TNFCTL_ERR_NONE); - } else if (prexstat == TNFCTL_ERR_FILENOTFOUND) { - return (TNFCTL_ERR_NOPROCESS); - } else { - return (prexstat); - } - } - if (my_evt == TNFCTL_EVENT_FORK) { - /* - * sanity check. we should only get here if child_hndl is set - */ - if (child_hndl) { - *evt = my_evt; - prbstat = prb_proc_get_r0_r1(proc_p, - ®0, ®1); - if (prbstat) { - prexstat = _tnfctl_map_to_errcode(prbstat); - return (prexstat); - } - prexstat = tnfctl_pid_open((pid_t)reg0, - child_hndl); - disable_target_state(*child_hndl); - return (prexstat); - } - return (TNFCTL_ERR_NONE); - } - - /* - * update state in handle - * REMIND: Only need to call _tnfctl_refresh_process on - * dlopen or dlclose. Need to take out other functionality - * of refresh_process into a separate function that should - * be called here. - */ - prexstat = _tnfctl_refresh_process(hndl, &lmapok, &dl_evt); - if (prexstat && (lmapok == B_TRUE)) - return (prexstat); - prexstat = TNFCTL_ERR_NONE; - } - *evt = my_evt; - /* see if we have more detail about the event */ - if (dl_evt == EVT_OPEN) - *evt = TNFCTL_EVENT_DLOPEN; - else if (dl_evt == EVT_CLOSE) - *evt = TNFCTL_EVENT_DLCLOSE; - - return (TNFCTL_ERR_NONE); -} - -/* - * Continues target and waits for it to stop. - * warning: This routine returns TNFCTL_EVENT_DLOPEN for any kind of - * dl activity. Up to the caller to determine the actual DL event. - */ -static tnfctl_errcode_t -_tnfctl_continue(tnfctl_handle_t *hndl, tnfctl_event_t *evt, sigset_t *oldmask, - boolean_t watch_forks) -{ - tnfctl_errcode_t prexstat; - tnfctl_errcode_t ret_prexstat = TNFCTL_ERR_NONE; - prb_status_t prbstat, prbstat2; - prb_proc_ctl_t *proc_p; - prb_proc_state_t state; - - proc_p = hndl->proc_p; - - /* set up state before we run process */ - prexstat = enable_target_state(hndl, watch_forks); - if (prexstat) - return (prexstat); - -again: - - /* resume target */ - prbstat = prb_proc_cont(proc_p); - if (prbstat) { - ret_prexstat = _tnfctl_map_to_errcode(prbstat); - goto end_of_func; - } - - /* wait on target to stop (standby) */ - prbstat = prb_proc_wait(proc_p, B_TRUE, oldmask); - if (prbstat) { - if (prbstat == EINTR) { - *evt = TNFCTL_EVENT_EINTR; - prbstat2 = prb_proc_stop(proc_p); - if (prbstat2) { - ret_prexstat = _tnfctl_map_to_errcode(prbstat2); - goto end_of_func; - } - } else if (prbstat == ENOENT) { - /* target process finished */ - if (hndl->called_exit) - *evt = TNFCTL_EVENT_EXIT; - else - *evt = TNFCTL_EVENT_TARGGONE; - /* return directly - process no longer around */ - return (TNFCTL_ERR_INTERNAL); - } else { - ret_prexstat = _tnfctl_map_to_errcode(prbstat); - goto end_of_func; - } - } - - prbstat = prb_proc_state(proc_p, &state); - if (prbstat) { - ret_prexstat = _tnfctl_map_to_errcode(prbstat); - goto end_of_func; - } - if (state.ps_isbptfault) { - /* dlopen or dlclose */ - prbstat = prb_rtld_advance(proc_p); - if (prbstat) { - ret_prexstat = _tnfctl_map_to_errcode(prbstat); - goto end_of_func; - } - /* - * actually don't know if it is a dlopen or dlclose yet. - * But, we return dlopen here. Up to the caller to determine - * which one it actually is. - */ - *evt = TNFCTL_EVENT_DLOPEN; - } else - if (state.ps_issysentry) { - switch (state.ps_syscallnum) { - case SYS_execve: - *evt = TNFCTL_EVENT_EXEC; - ret_prexstat = TNFCTL_ERR_INTERNAL; - break; - case SYS_exit: - hndl->called_exit = B_TRUE; - goto again; - default: - break; - } - } else if (state.ps_issysexit) { - switch (state.ps_syscallnum) { - case SYS_vfork: - case SYS_forksys: - *evt = TNFCTL_EVENT_FORK; - break; - default: - break; - } - } -end_of_func: - /* - * disable all our sycall tracing and bpt setup in process when it - * is stopped, so that even if the controlling process aborts, - * the target could continue running - */ - prexstat = disable_target_state(hndl); - if (prexstat) - return (prexstat); - return (ret_prexstat); -} - -/* - * enable the system call tracing and dl activity tracing - */ -static tnfctl_errcode_t -enable_target_state(tnfctl_handle_t *hndl, boolean_t watch_forks) -{ - prb_status_t prbstat; - prb_proc_ctl_t *proc_p; - - proc_p = hndl->proc_p; - - /* trace exec */ - prbstat = prb_proc_entry(proc_p, SYS_execve, PRB_SYS_ADD); - if (prbstat) - return (_tnfctl_map_to_errcode(prbstat)); - /* trace exit */ - prbstat = prb_proc_entry(proc_p, SYS_exit, PRB_SYS_ADD); - if (prbstat) - return (_tnfctl_map_to_errcode(prbstat)); - /* trace fork if the caller requests */ - if (watch_forks) { - prbstat = prb_proc_exit(proc_p, SYS_vfork, PRB_SYS_ADD); - if (prbstat) - return (_tnfctl_map_to_errcode(prbstat)); - - prbstat = prb_proc_exit(proc_p, SYS_forksys, PRB_SYS_ADD); - if (prbstat) - return (_tnfctl_map_to_errcode(prbstat)); - - prbstat = prb_proc_setfork(proc_p, B_TRUE); - if (prbstat) - return (_tnfctl_map_to_errcode(prbstat)); - } - /* - * tracing flags for fork and exec will get unset when - * process stops. see disable_target_state() - */ - - /* setup process to stop during dlopen() or dlclose() */ - prbstat = prb_rtld_stalk(proc_p); - return (_tnfctl_map_to_errcode(prbstat)); -} - -/* - * disable the system call tracing and dl activity tracing - */ -static tnfctl_errcode_t -disable_target_state(tnfctl_handle_t *hndl) -{ - prb_status_t prbstat; - prb_proc_ctl_t *proc_p; - - proc_p = hndl->proc_p; - - /* remove the stalking breakpoint while the process is stopped */ - prbstat = prb_rtld_unstalk(proc_p); - if (prbstat) - return (_tnfctl_map_to_errcode(prbstat)); - - /* remove the exec, exit and fork tracing while stopped */ - prbstat = prb_proc_entry(proc_p, SYS_execve, PRB_SYS_DEL); - if (prbstat) - return (_tnfctl_map_to_errcode(prbstat)); - prbstat = prb_proc_entry(proc_p, SYS_exit, PRB_SYS_DEL); - if (prbstat) - return (_tnfctl_map_to_errcode(prbstat)); - prbstat = prb_proc_exit(proc_p, SYS_vfork, PRB_SYS_DEL); - if (prbstat) - return (_tnfctl_map_to_errcode(prbstat)); - prbstat = prb_proc_exit(proc_p, SYS_forksys, PRB_SYS_DEL); - if (prbstat) - return (_tnfctl_map_to_errcode(prbstat)); - prbstat = prb_proc_setfork(proc_p, B_FALSE); - if (prbstat) - return (_tnfctl_map_to_errcode(prbstat)); - - return (TNFCTL_ERR_NONE); -} diff --git a/usr/src/lib/libtnfctl/dbg.h b/usr/src/lib/libtnfctl/dbg.h deleted file mode 100644 index ccc556505f..0000000000 --- a/usr/src/lib/libtnfctl/dbg.h +++ /dev/null @@ -1,85 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#ifndef _DBG_H -#define _DBG_H - -#pragma ident "%Z%%M% %I% %E% SMI" - -/* - * Header file for debugging output. This is compiled in only if the - * code is compiled with -DDEBUG. There are two kinds of debugging output. - * The first is DBG, which is used to print output directly. The second is - * debug probes which can be controlled at run time via prex. - */ - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef DEBUG -#include <stdio.h> - -#define DBG(x) (x) -#else -#define DBG(x) -#endif /* DEBUG */ - -#ifdef DEBUG -#include <tnf/probe.h> - -#define DBG_TNF_PROBE_0(a, b, c) \ - TNF_PROBE_0(a, b, c) -#define DBG_TNF_PROBE_1(a, b, c, t1, n1, v1) \ - TNF_PROBE_1(a, b, c, t1, n1, v1) -#define DBG_TNF_PROBE_2(a, b, c, t1, n1, v1, t2, n2, v2) \ - TNF_PROBE_2(a, b, c, t1, n1, v1, t2, n2, v2) -#define DBG_TNF_PROBE_3(a, b, c, t1, n1, v1, t2, n2, v2, t3, n3, v3) \ - TNF_PROBE_3(a, b, c, t1, n1, v1, t2, n2, v2, t3, n3, v3) -/* CSTYLED */ -#define DBG_TNF_PROBE_4(a, b, c, t1, n1, v1, t2, n2, v2, t3, n3, v3, t4, n4, v4) \ - TNF_PROBE_4(a, b, c, t1, n1, v1, t2, n2, v2, t3, n3, v3, t4, n4, v4) - -#else - -#define DBG_TNF_PROBE_0(a, b, c) \ - ((void)0) -#define DBG_TNF_PROBE_1(a, b, c, t1, n1, v1) \ - ((void)0) -#define DBG_TNF_PROBE_2(a, b, c, t1, n1, v1, t2, n2, v2) \ - ((void)0) -#define DBG_TNF_PROBE_3(a, b, c, t1, n1, v1, t2, n2, v2, t3, n3, v3) \ - ((void)0) -/* CSTYLED */ -#define DBG_TNF_PROBE_4(a, b, c, t1, n1, v1, t2, n2, v2, t3, n3, v3, t4, n4, v4) \ - ((void)0) - -#endif /* DEBUG */ - -#ifdef __cplusplus -} -#endif - -#endif /* _DBG_H */ diff --git a/usr/src/lib/libtnfctl/elf.c b/usr/src/lib/libtnfctl/elf.c deleted file mode 100644 index 41ec1a388a..0000000000 --- a/usr/src/lib/libtnfctl/elf.c +++ /dev/null @@ -1,242 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -/* - * Interfaces for searching for elf specific information - */ - -#include <unistd.h> -#include <stdlib.h> -#include <string.h> -#include <errno.h> -#include <link.h> -#include <sys/procfs.h> - -#include "tnfctl_int.h" -#include "dbg.h" - - -/* - * Declarations - */ - -static tnfctl_errcode_t dynsec_num(tnfctl_handle_t *hndl, uintptr_t baseaddr, - int objfd, int *num_dyn); -static tnfctl_errcode_t elf_dynmatch(Elf *elf, char *strs, Elf_Scn *dyn_scn, - GElf_Shdr *dyn_shdr, Elf_Data *dyn_data, - uintptr_t baseaddr, tnfctl_elf_search_t * search_info_p); -static tnfctl_errcode_t dyn_findtag( - Elf3264_Dyn *start, /* start of dynam table read in */ - Elf3264_Sword tag, /* tag to search for */ - uintptr_t dynam_addr, /* address of _DYNAMIC in target */ - int limit, /* number of entries in table */ - uintptr_t *dentry_address); /* return value */ - - -/* ---------------------------------------------------------------- */ -/* ----------------------- Public Functions ----------------------- */ -/* ---------------------------------------------------------------- */ - -/* - * _tnfctl_elf_dbgent() - this function finds the address of the - * debug struct (DT_DEBUG) in the target process. _DYNAMIC is a symbol - * present in every object. The one in the main executable references - * an array that is tagged with the kind of each member. We search - * for the tag of DT_DEBUG which is where the run time linker maintains - * a structure that references the shared object linked list. - * - * A side effect of searching for DT_DEBUG ensures that the executable is - * a dynamic executable - tracing only works on dynamic executables because - * static executables don't have relocation tables. - */ -tnfctl_errcode_t -_tnfctl_elf_dbgent(tnfctl_handle_t *hndl, uintptr_t * entaddr_p) -{ - tnfctl_errcode_t prexstat = TNFCTL_ERR_NONE; - prb_status_t prbstat = PRB_STATUS_OK; - int miscstat; - int objfd; - int num_dynentries = 0; - uintptr_t dynamic_addr; - uintptr_t baseaddr; - uintptr_t dentry_addr; - Elf3264_Dyn *dynam_tab = NULL; - long dynam_tab_size; - - *entaddr_p = 0; - - prbstat = prb_mainobj_get(hndl->proc_p, &objfd, &baseaddr); - if (prbstat) - return (_tnfctl_map_to_errcode(prbstat)); - - /* find the address of the symbol _DYNAMIC */ - prexstat = _tnfctl_sym_find_in_obj(objfd, baseaddr, "_DYNAMIC", - &dynamic_addr); - if (prexstat) { - prexstat = TNFCTL_ERR_NOTDYNAMIC; - goto Cleanup; - } - - /* find the number of entries in the .dynamic section */ - prexstat = dynsec_num(hndl, baseaddr, objfd, &num_dynentries); - if (prexstat) - goto Cleanup; - - DBG_TNF_PROBE_2(_tnfctl_elf_dbgent_1, "libtnfctl", "sunw%verbosity 2", - tnf_long, num_of_dynentries, num_dynentries, - tnf_opaque, DYNAMIC_address, dynamic_addr); - - /* read in the dynamic table from the image of the process */ - dynam_tab_size = num_dynentries * sizeof (Elf3264_Dyn); - dynam_tab = malloc(dynam_tab_size); - if (!dynam_tab) { - close(objfd); - return (TNFCTL_ERR_ALLOCFAIL); - } - miscstat = hndl->p_read(hndl->proc_p, dynamic_addr, dynam_tab, - dynam_tab_size); - if (miscstat) { - prexstat = TNFCTL_ERR_INTERNAL; - goto Cleanup; - } - - prexstat = dyn_findtag(dynam_tab, DT_DEBUG, dynamic_addr, - num_dynentries, &dentry_addr); - if (prexstat) { - goto Cleanup; - } - *entaddr_p = dentry_addr; - -Cleanup: - close(objfd); - if (dynam_tab) - free(dynam_tab); - return (prexstat); - -} - - -/* ---------------------------------------------------------------- */ -/* ----------------------- Private Functions ---------------------- */ -/* ---------------------------------------------------------------- */ - -/* - * dyn_findtag() - searches tags in _DYNAMIC table - */ -static tnfctl_errcode_t -dyn_findtag(Elf3264_Dyn * start, /* start of dynam table read in */ - Elf3264_Sword tag, /* tag to search for */ - uintptr_t dynam_addr, /* base address of _DYNAMIC in target */ - int limit, /* number of entries in table */ - uintptr_t * dentry_address) -{ /* return value */ - Elf3264_Dyn *dp; - - for (dp = start; dp->d_tag != DT_NULL; dp++) { - - DBG_TNF_PROBE_1(dyn_findtag_1, "libtnfctl", - "sunw%verbosity 3; sunw%debug 'in loop'", - tnf_long, tag, dp->d_tag); - - if (dp->d_tag == tag) { - *dentry_address = dynam_addr + - (dp - start) * sizeof (Elf3264_Dyn); - return (TNFCTL_ERR_NONE); - } - if (--limit <= 0) { - DBG((void) fprintf(stderr, - "dyn_findtag: exceeded limit of table\n")); - return (TNFCTL_ERR_INTERNAL); - } - } - - DBG((void) fprintf(stderr, - "dyn_findtag: couldn't find tag, last tag=%d\n", - (int) dp->d_tag)); - return (TNFCTL_ERR_INTERNAL); -} - - -/* - * dynsec_num() - find the number of entries in the .dynamic section - */ -/*ARGSUSED*/ -static tnfctl_errcode_t -dynsec_num(tnfctl_handle_t *hndl, uintptr_t baseaddr, - int objfd, int *num_dyn) -{ - int num_ent = 0; - tnfctl_errcode_t prexstat; - tnfctl_elf_search_t search_info; - - DBG_TNF_PROBE_0(dynsec_num_1, "libtnfctl", - "sunw%verbosity 2;" - "sunw%debug 'counting number of entries in .dynamic section'"); - - search_info.section_func = elf_dynmatch; - search_info.section_data = &num_ent; - - prexstat = _tnfctl_traverse_object(objfd, baseaddr, &search_info); - if (prexstat) - return (prexstat); - - if (num_ent == 0) - return (TNFCTL_ERR_NOTDYNAMIC); - - *num_dyn = num_ent; - - return (TNFCTL_ERR_NONE); -} - - -/* - * elf_dynmatch() - this function searches for the .dynamic section and - * returns the number of entries in it. - */ -/*ARGSUSED*/ -static tnfctl_errcode_t -elf_dynmatch(Elf * elf, - char *strs, - Elf_Scn * dyn_scn, - GElf_Shdr * dyn_shdr, - Elf_Data * dyn_data, - uintptr_t baseaddr, - tnfctl_elf_search_t *search_info_p) -{ - char *scn_name; - int *ret = (int *) search_info_p->section_data; - - /* bail if this isn't a .dynamic section */ - scn_name = strs + dyn_shdr->sh_name; - if (strcmp(scn_name, ".dynamic") != 0) - return (TNFCTL_ERR_NONE); - - if (dyn_shdr->sh_entsize == 0) { /* no dynamic section */ - *ret = 0; - } else { - *ret = (int) (dyn_shdr->sh_size / dyn_shdr->sh_entsize); - } - return (TNFCTL_ERR_NONE); -} diff --git a/usr/src/lib/libtnfctl/i386/Makefile b/usr/src/lib/libtnfctl/i386/Makefile deleted file mode 100644 index 50dd2a7dd7..0000000000 --- a/usr/src/lib/libtnfctl/i386/Makefile +++ /dev/null @@ -1,32 +0,0 @@ -# -# 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 2006 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# -# ident "%Z%%M% %I% %E% SMI" -# - -include ../Makefile.com - -.KEEP_STATE: - -install: all $(ROOTLIBS) $(ROOTLINKS) diff --git a/usr/src/lib/libtnfctl/i386_assm.s b/usr/src/lib/libtnfctl/i386_assm.s deleted file mode 100644 index 357c368c10..0000000000 --- a/usr/src/lib/libtnfctl/i386_assm.s +++ /dev/null @@ -1,97 +0,0 @@ -/* - * 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 2004 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -/* - * The following c routine has appropriate interface semantics - * for the chaining combination template. On the sparc architecture - * the assembly routine is further tuned to make it tail recursive. - * - * void - * prb_chain_entry(void *a, void *b, void *c) - * { - * prb_chain_down(a, b, c); - * prb_chain_next(a, b, c); - * } - */ - - .file "i386_assm.s" - .data - .align 4 - .globl prb_callinfo -prb_callinfo: - .4byte 1 /* offset */ - .4byte 0 /* shift right */ - .4byte 0xffffffff /* mask */ - - .text - .align 4 - .globl prb_chain_entry - .globl prb_chain_down - .local chain_down - .globl prb_chain_next - .local chain_next - .globl prb_chain_end -prb_chain_entry: -#if defined(__amd64) - /* XX64 -- fix me */ -#else - pushl %ebp - movl %esp, %ebp - pushl %edi - pushl %esi - pushl %ebx - movl 16(%ebp), %ebx - pushl %ebx - movl 12(%ebp), %edi - pushl %edi - movl 8(%ebp), %esi - pushl %esi -#endif -prb_chain_down: -chain_down: -#if defined(__amd64) - /* XX64 -- fix me */ -#else - call chain_down - addl $12, %esp - pushl %ebx - pushl %edi - pushl %esi -#endif -prb_chain_next: -chain_next: -#if defined(__amd64) - /* XX64 -- fix me */ -#else - call chain_next - addl $12, %esp - popl %ebx - popl %esi - popl %edi - leave -#endif - ret -prb_chain_end: - nop diff --git a/usr/src/lib/libtnfctl/inc.flg b/usr/src/lib/libtnfctl/inc.flg deleted file mode 100644 index b75f45cf63..0000000000 --- a/usr/src/lib/libtnfctl/inc.flg +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh -# -# 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 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 -# -#ident "%Z%%M% %I% %E% SMI" - -echo_file usr/src/lib/libtnfprobe/tnf_buf.h -echo_file usr/src/lib/libtnfprobe/prb_internals.h diff --git a/usr/src/lib/libtnfctl/internal.c b/usr/src/lib/libtnfctl/internal.c deleted file mode 100644 index dbe97fc714..0000000000 --- a/usr/src/lib/libtnfctl/internal.c +++ /dev/null @@ -1,397 +0,0 @@ -/* - * 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 2008 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -/* - * Implements the routines that are needed only for internal process - * control. - */ - -#ifndef DEBUG -#define NDEBUG 1 -#endif - -#include "tnfctl_int.h" -#include "kernel_int.h" -#include "dbg.h" - -#include <stdio.h> -#include <sys/types.h> -#include <stdlib.h> -#include <unistd.h> -#include <string.h> -#include <link.h> -#include <sys/stat.h> -#include <fcntl.h> -#include <sys/param.h> -#include <sys/procfs.h> -#include <assert.h> -#include <dlfcn.h> - -static int inprocess_read(void *ignore, - uintptr_t addr, void *buf, size_t size); -static int inprocess_write(void *ignore, - uintptr_t addr, void *buf, size_t size); -static pid_t inprocess_getpid(void *ignore); -static tnfctl_errcode_t inprocess_get_dtdebug(void *hndl, uintptr_t *ret_val); -static int inprocess_loadobj_iter(void *opq, tnfctl_ind_obj_f *obj_func, - void *cd); - -/* - * Cause interposition on dlclose() and dlopen() - */ -#pragma weak dlclose = _tnfctl_dlclose - -#pragma weak dlopen = _tnfctl_dlopen - -/* - * The lock used to protect the _tnfctl_internal_tracing_flag variable. - * - */ -mutex_t _tnfctl_internalguard_lock = DEFAULTMUTEX; -boolean_t _tnfctl_internal_tracing_flag = 0; -pid_t _tnfctl_externally_traced_pid = NOPID; - -/* - * Returns a pointer to a tnfctl handle that can do in process probe control. - */ -tnfctl_errcode_t -tnfctl_internal_open(tnfctl_handle_t **ret_val) -{ - tnfctl_handle_t *hdl; - tnfctl_errcode_t prexstat; - uintptr_t dbgaddr; - - /* allocate hdl and zero fill */ - hdl = calloc(1, sizeof (*hdl)); - if (hdl == NULL) { - return (TNFCTL_ERR_ALLOCFAIL); - } - - hdl->mode = INTERNAL_MODE; - hdl->called_exit = B_FALSE; - - /* plug in inprocess call back functions */ - hdl->p_read = inprocess_read; - hdl->p_write = inprocess_write; - hdl->p_obj_iter = inprocess_loadobj_iter; - hdl->p_getpid = inprocess_getpid; - - /* - * get the address of DT_DEBUG and store it in proc_p - * (the handle on the same process is the dbg address) - */ - prexstat = inprocess_get_dtdebug(hdl, &dbgaddr); - if (prexstat) { - free(hdl); - return (prexstat); - } - hdl->proc_p = (void *) dbgaddr; - - /* initialize state in handle */ - prexstat = _tnfctl_set_state(hdl); - if (prexstat) { - free(hdl); - return (prexstat); - } - /* see if process is already being traced */ - prexstat = _tnfctl_internal_getlock(); - if (prexstat) { - free(hdl); - return (prexstat); - } - *ret_val = hdl; - return (TNFCTL_ERR_NONE); -} - -/* - * reads a block of memory from the same address space. - */ -static int -inprocess_read(void *ignore, uintptr_t addr, void *buf, size_t size) -{ - - DBG_TNF_PROBE_2(inprocess_read_1, "libtnfctl", "sunw%verbosity 3;", - tnf_long, num_bytes, size, - tnf_opaque, from_address, addr); - - (void) memcpy(buf, (void *) addr, size); - return (0); -} - -/* - * writes a block of memory to the same address space. - */ -static int -inprocess_write(void *ignore, uintptr_t addr, void *buf, size_t size) -{ - - DBG_TNF_PROBE_2(inprocess_write_1, "libtnfctl", "sunw%verbosity 3;", - tnf_long, num_bytes, size, - tnf_opaque, to_address, addr); - - (void) memcpy((void *)addr, buf, size); - return (0); -} - -/* - * returns the pid of the process. - */ -static pid_t -inprocess_getpid(void *ignore) -{ - return (getpid()); -} -extern Elf3264_Dyn _DYNAMIC; - -/* - * returns the address of the DT_DEBUG field in the _DYNAMIC array - * of the same address space. - */ -static tnfctl_errcode_t -inprocess_get_dtdebug(void *hndl, uintptr_t *ret_val) -{ - Elf3264_Dyn *dyn = &_DYNAMIC; - Elf3264_Dyn *dp; - - for (dp = dyn; dp->d_tag != DT_NULL; dp++) { - if (dp->d_tag == DT_DEBUG) { - *ret_val = (uintptr_t) dp; - return (TNFCTL_ERR_NONE); - } - } - return (TNFCTL_ERR_INTERNAL); -} - -#define PROCFORMAT "/proc/%d" - -/* - * iterate over all loadobjects in the same address space calling the - * callback function "obj_func". - */ -static int -inprocess_loadobj_iter(void *opq, tnfctl_ind_obj_f *obj_func, void *cd) -{ - Elf3264_Dyn *dtdebug = opq; - struct r_debug *r_dbg; - struct link_map *lmap; - char path[MAXPATHLEN]; - int procfd; - tnfctl_ind_obj_info_t loadobj; - int retval = 0; /* sucessful return */ - - DBG_TNF_PROBE_0(inprocess_loadobj_iter_start, "libtnfctl", - "start inprocess_loadobj_iter; sunw%verbosity 1"); - - r_dbg = (struct r_debug *)dtdebug->d_un.d_ptr; - - DBG_TNF_PROBE_1(inprocess_loadobj_iter_1, "libtnfctl", - "sunw%verbosity 1", - tnf_string, link_map_state, - (r_dbg->r_state == RT_CONSISTENT) ? "RT_CONSISTENT" : - (r_dbg->r_state == RT_ADD) ? "RT_ADD" : "RT_DELETE"); - - /* bail if link map is not consistent */ - if (r_dbg->r_state != RT_CONSISTENT) - return (1); - - (void) sprintf(path, PROCFORMAT, (int) getpid()); - - /* - * opening /proc readonly, so debuggers can still run - * We use /proc in order to get fd on the object. - */ - procfd = open(path, O_RDONLY); - if (procfd == -1) - return (1); - - for (lmap = r_dbg->r_map; lmap; lmap = lmap->l_next) { - loadobj.text_base = lmap->l_addr; - loadobj.data_base = lmap->l_addr; - loadobj.objname = lmap->l_name; - /* - * client of this interface should deal with -1 for objfd, - * so no error checking is needed on this ioctl - */ - loadobj.objfd = ioctl(procfd, PIOCOPENM, &(lmap->l_addr)); - - retval = obj_func(opq, &loadobj, cd); - - /* close the fd */ - if (loadobj.objfd != -1) - close(loadobj.objfd); - - /* check for error */ - if (retval == 1) - goto end_of_func; - } - -end_of_func: - close(procfd); - - DBG_TNF_PROBE_0(inprocess_loadobj_iter_end, "libtnfctl", - "end inprocess_loadobj_iter; sunw%verbosity 1"); - return (retval); -} - -/* - * The lock that prevents a thread from accessing our cached library list - * and a dlopen or dlclose happening at the same time in another thread. - */ -mutex_t _tnfctl_lmap_lock = DEFAULTMUTEX; - -/* - * The flag that indicates that the library list has changed via a - * dlopen or dlclose. - */ -boolean_t _tnfctl_libs_changed = B_FALSE; - -/* - * Thread id of the owner of the lock in order to implement a - * recursive lock i.e. no deadlock if the same thread tries to lock - * a lock it already holds. - */ -static thread_t lock_holder = 0; /* XXX - no tid with 0 */ - -#define LMAP_LOCK (&_tnfctl_lmap_lock) - -/* - * dlclose interposition with a recursive lock so that a .fini section - * can recursively call dlopen or dlclose while holding _tnfctl_lmap_lock - * This interposition serializes access to rtld's loadobject list and - * also updates the flag _tnfctl_libs_changed to indicate a change in - * the library list. This flag is checked by operations that update - * probes so that it can sync up with the new library list and potential - * new/deleted probes. - */ -int -_tnfctl_dlclose(void *handle) -{ - static int (*real_dlclose)(void *handle) = NULL; - int retval; - thread_t tid; - - if (real_dlclose == NULL) { - real_dlclose = (int (*)(void *)) dlsym(RTLD_NEXT, "dlclose"); - } - assert(real_dlclose); - - if (mutex_trylock(LMAP_LOCK) != 0) { - /* don't have lock */ - tid = thr_self(); - if (tid == lock_holder) { - /* recursive dlopen/dlclose by same thread */ - return ((*real_dlclose)(handle)); - } - /* not a recursive dlopen/dlclose - wait on lock */ - mutex_lock(LMAP_LOCK); - } - - /* lock is held now */ - lock_holder = thr_self(); - retval = (*real_dlclose)(handle); - - /* - * reset lock_holder so that if _tnfctl_lmap_lock is held by some - * other part of the code, we don't assume it is a recursive - * dlopen/dlclose - */ - lock_holder = 0; - _tnfctl_libs_changed = B_TRUE; - mutex_unlock(LMAP_LOCK); - - return (retval); -} - -/* - * dlopen interposition with a recursive lock so that a .init section - * can recursively call dlopen or dlclose while holding _tnfctl_lmap_lock - * This interposition serializes access to rtld's loadobject list and - * also updates the flag _tnfctl_libs_changed to indicate a change in - * the library list. This flag is checked by operations that update - * probes so that it can sync up with the new library list and potential - * new/deleted probes. - */ -void * -_tnfctl_dlopen(const char *pathname, int mode) -{ - static void * (*real_dlopen)(const char *, int) = NULL; - void *retval; - thread_t tid; - - if (real_dlopen == NULL) { - real_dlopen = (void * (*)(const char *, int)) - dlsym(RTLD_NEXT, "dlopen"); - } - assert(real_dlopen); - - if (mutex_trylock(LMAP_LOCK) != 0) { - /* don't have lock */ - tid = thr_self(); - if (tid == lock_holder) { - /* recursive dlopen/dlclose by same thread */ - return ((*real_dlopen)(pathname, mode)); - } - /* not a recursive dlopen/dlclose - wait on lock */ - mutex_lock(LMAP_LOCK); - } - - /* lock is held now */ - lock_holder = thr_self(); - retval = (*real_dlopen)(pathname, mode); - - /* - * reset lock_holder so that if _tnfctl_lmap_lock is held by some - * other part of the code, we don't assume it is a recursive - * dlopen/dlclose - */ - lock_holder = 0; - _tnfctl_libs_changed = B_TRUE; - mutex_unlock(LMAP_LOCK); - - return (retval); -} - -tnfctl_errcode_t -_tnfctl_internal_getlock() -{ - mutex_lock(&_tnfctl_internalguard_lock); - if (_tnfctl_internal_tracing_flag == 1) { - /* internal trace control active */ - mutex_unlock(&_tnfctl_internalguard_lock); - return (TNFCTL_ERR_BUSY); - } - _tnfctl_internal_tracing_flag = 1; - if (_tnfctl_externally_traced_pid == getpid()) { - /* external trace control is active */ - _tnfctl_internal_tracing_flag = 0; - mutex_unlock(&_tnfctl_internalguard_lock); - return (TNFCTL_ERR_BUSY); - } - DBG((void) fprintf(stderr, "_tnfctl_internal_getlock: ok to trace %d\n", - getpid())); - mutex_unlock(&_tnfctl_internalguard_lock); - return (TNFCTL_ERR_NONE); -} diff --git a/usr/src/lib/libtnfctl/kernel.c b/usr/src/lib/libtnfctl/kernel.c deleted file mode 100644 index 1e70b87c11..0000000000 --- a/usr/src/lib/libtnfctl/kernel.c +++ /dev/null @@ -1,88 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -/* - * Published kernel specific interfaces for libtnfctl. - * After doing some error checking, these just turn around and call - * internal interfaces that do the real work. - */ - -#include <stdio.h> -#include <errno.h> - -#include "tnfctl_int.h" -#include "kernel_int.h" - -tnfctl_errcode_t -tnfctl_trace_state_set(tnfctl_handle_t *hdl, boolean_t mode) -{ - if (hdl->mode != KERNEL_MODE) - return (TNFCTL_ERR_BADARG); - - /* KERNEL_MODE */ - return (_tnfctl_prbk_set_tracing(hdl, mode)); -} - -tnfctl_errcode_t -tnfctl_filter_state_set(tnfctl_handle_t *hdl, boolean_t mode) -{ - if (hdl->mode != KERNEL_MODE) - return (TNFCTL_ERR_BADARG); - - /* KERNEL_MODE */ - return (_tnfctl_prbk_set_pfilter_mode(hdl, mode)); -} - -tnfctl_errcode_t -tnfctl_filter_list_get(tnfctl_handle_t *hdl, pid_t **pid_list, int *pid_count) -{ - if (hdl->mode != KERNEL_MODE) - return (TNFCTL_ERR_BADARG); - - /* KERNEL_MODE */ - return (_tnfctl_prbk_get_pfilter_list(hdl, pid_list, pid_count)); -} - -tnfctl_errcode_t -tnfctl_filter_list_add(tnfctl_handle_t *hdl, pid_t pid) -{ - if (hdl->mode != KERNEL_MODE) - return (TNFCTL_ERR_BADARG); - - /* KERNEL_MODE */ - return (_tnfctl_prbk_pfilter_add(hdl, pid)); -} - -tnfctl_errcode_t -tnfctl_filter_list_delete(tnfctl_handle_t *hdl, pid_t pid) -{ - if (hdl->mode != KERNEL_MODE) - return (TNFCTL_ERR_BADARG); - - /* KERNEL_MODE */ - return (_tnfctl_prbk_pfilter_delete(hdl, pid)); -} diff --git a/usr/src/lib/libtnfctl/kernel_int.c b/usr/src/lib/libtnfctl/kernel_int.c deleted file mode 100644 index 9580440919..0000000000 --- a/usr/src/lib/libtnfctl/kernel_int.c +++ /dev/null @@ -1,528 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -/* - * Interfaces to control kernel tracing and kernel probes - */ - -#ifndef DEBUG -#define NDEBUG 1 -#endif - -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <string.h> /* for strerror() */ -#include <sys/types.h> -#include <sys/stat.h> -#include <sys/tnf.h> -#include <fcntl.h> -#include <errno.h> -#include <signal.h> -#include <assert.h> - -#include "tnfctl_int.h" -#include "kernel_int.h" - -/* The TNF pseudo-device */ -#define TNFDRIVER "/dev/tnfctl" - -/* Dummy "test" function -- just used to flag enabled probes */ -#define PRBK_DUMMY_TEST ((tnf_probe_test_func_t) 4) - -/* Dummy "commit" function -- just used to flag trace enabled */ -#define PRBK_DUMMY_COMMIT ((tnf_probe_func_t) 8) - -/* Dummy "rollback" function -- just used to flag trace disabled */ -#define PRBK_DUMMY_ROLLBACK ((tnf_probe_func_t) 12) - -/* Dummy "end" function */ -#define PRBK_DUMMY_END ((uintptr_t) 16) - -/* Dummy "alloc" function */ -#define PRBK_DUMMY_ALLOC ((uintptr_t) 20) - -/* Minimum and maximum allowed buffer sizes. */ -/* XXX -- maximum should be some function of physmem. */ -#define KERNEL_MINBUF_SIZE (128 * 1024) -#define KERNEL_MAXBUF_SIZE (128 * 1024 * 1024) - -static tnfctl_errcode_t prbk_get_buf_attrs(tnfctl_handle_t *hdl); -static tnfctl_errcode_t alloc_probe_space(tnfctl_handle_t *hndl, int maxprobe); - -/* - * Initialize the kernel interface: Open the TNF control device, - * and determine the current kernel probes state, including the - * current pidfilter list. - */ -tnfctl_errcode_t -_tnfctl_prbk_init(tnfctl_handle_t *hdl) -{ - tnfctl_errcode_t prexstat; - tifiocstate_t kstate; - int kfd; - - kfd = open(TNFDRIVER, O_RDWR); - if (kfd < 0) { - return (tnfctl_status_map(errno)); - } - if (ioctl(kfd, TIFIOCGSTATE, &kstate) < 0) - return (tnfctl_status_map(errno)); - - hdl->kfd = kfd; - hdl->kpidfilter_state = kstate.pidfilter_mode; - hdl->trace_state = !kstate.trace_stopped; - hdl->trace_min_size = KERNEL_MINBUF_SIZE; - prexstat = prbk_get_buf_attrs(hdl); - if (prexstat) - return (prexstat); - - return (TNFCTL_ERR_NONE); -} - -/* - * Close the TNF control device. - */ -tnfctl_errcode_t -_tnfctl_prbk_close(tnfctl_handle_t *hdl) -{ - if (hdl == NULL) - return (TNFCTL_ERR_NONE); - - if (close(hdl->kfd) == -1) { - return (tnfctl_status_map(errno)); - } - return (TNFCTL_ERR_NONE); -} - -/* - * Returns function addresses that can be plugged into function pointers - * in kernel probes. These are actually dummy values that get - * interpreted by a routine in this file when a probe is flushed. - */ -void -_tnfctl_prbk_get_other_funcs(uintptr_t *allocp, uintptr_t *commitp, - uintptr_t *rollbackp, uintptr_t *endp) -{ - *allocp = PRBK_DUMMY_ALLOC; - *commitp = (uintptr_t) PRBK_DUMMY_COMMIT; - *rollbackp = (uintptr_t) PRBK_DUMMY_ROLLBACK; - *endp = PRBK_DUMMY_END; -} - - -/* - * Returns test function address - */ -void -_tnfctl_prbk_test_func(uintptr_t *outp) -{ - *outp = (uintptr_t) PRBK_DUMMY_TEST; -} - -/* - * Allocate a trace buffer. Check for reasonable size; reject if there's - * already a buffer. - */ -tnfctl_errcode_t -_tnfctl_prbk_buffer_alloc(tnfctl_handle_t *hdl, int size) -{ - tifiocstate_t bufstat; - tnfctl_errcode_t prexstat; - int saved_val; - - if (ioctl(hdl->kfd, TIFIOCGSTATE, &bufstat) < 0) { - return (tnfctl_status_map(errno)); - } - if (bufstat.buffer_state != TIFIOCBUF_NONE) { - return (TNFCTL_ERR_BUFEXISTS); - } - if (size < KERNEL_MINBUF_SIZE) { - return (TNFCTL_ERR_SIZETOOSMALL); - } else if (size > KERNEL_MAXBUF_SIZE) { - /* REMIND: make this an error ? */ - size = KERNEL_MAXBUF_SIZE; - } - if (ioctl(hdl->kfd, TIFIOCALLOCBUF, size) < 0) { - saved_val = errno; - (void) prbk_get_buf_attrs(hdl); - return (tnfctl_status_map(saved_val)); - } - - prexstat = prbk_get_buf_attrs(hdl); - if (prexstat) - return (prexstat); - - return (TNFCTL_ERR_NONE); -} - -/* - * Deallocate the kernel's trace buffer. - */ -tnfctl_errcode_t -_tnfctl_prbk_buffer_dealloc(tnfctl_handle_t *hdl) -{ - tifiocstate_t bufstat; - tnfctl_errcode_t prexstat; - int saved_val; - - if (ioctl(hdl->kfd, TIFIOCGSTATE, &bufstat) < 0) { - return (tnfctl_status_map(errno)); - } - if (bufstat.buffer_state == TIFIOCBUF_NONE) { - return (TNFCTL_ERR_NOBUF); - } - - if (bufstat.buffer_state == TIFIOCBUF_OK && !bufstat.trace_stopped) { - return (TNFCTL_ERR_BADDEALLOC); - } - if (ioctl(hdl->kfd, TIFIOCDEALLOCBUF) < 0) { - saved_val = errno; - (void) prbk_get_buf_attrs(hdl); - return (tnfctl_status_map(saved_val)); - } - - prexstat = prbk_get_buf_attrs(hdl); - if (prexstat) - return (prexstat); - - return (TNFCTL_ERR_NONE); -} - -/* - * Turns kernel global tracing on or off. - */ -tnfctl_errcode_t -_tnfctl_prbk_set_tracing(tnfctl_handle_t *hdl, boolean_t onoff) -{ - if (hdl->trace_state != onoff && - ioctl(hdl->kfd, TIFIOCSTRACING, onoff) < 0) { - if (errno == ENOMEM && onoff) - return (TNFCTL_ERR_NOBUF); - else - return (tnfctl_status_map(errno)); - } - hdl->trace_state = onoff; - return (TNFCTL_ERR_NONE); -} - -/* - * Turn process filter mode on or off. The process filter is maintained - * even when process filtering is off, but has no effect: all processes - * are traced. - */ -tnfctl_errcode_t -_tnfctl_prbk_set_pfilter_mode(tnfctl_handle_t *hdl, boolean_t onoff) -{ - if (hdl->kpidfilter_state != onoff && - ioctl(hdl->kfd, TIFIOCSPIDFILTER, onoff) < 0) { - return (tnfctl_status_map(errno)); - } - hdl->kpidfilter_state = onoff; - return (TNFCTL_ERR_NONE); -} - -/* - * Return the process filter list. - */ -tnfctl_errcode_t -_tnfctl_prbk_get_pfilter_list(tnfctl_handle_t *hdl, pid_t **ret_list_p, - int *ret_count) -{ - tifiocstate_t kstate; - int *filterset; - int i; - pid_t *ret_list; - - if (ioctl(hdl->kfd, TIFIOCGSTATE, &kstate) < 0) - return (tnfctl_status_map(errno)); - - if (kstate.pidfilter_size == 0) { - *ret_count = 0; - *ret_list_p = NULL; - return (TNFCTL_ERR_NONE); - } - - filterset = (int *) malloc((kstate.pidfilter_size + 1) * - sizeof (pid_t)); - if (filterset == NULL) - return (TNFCTL_ERR_ALLOCFAIL); - if (ioctl(hdl->kfd, TIFIOCPIDFILTERGET, filterset) < 0) - return (tnfctl_status_map(errno)); - - /* filterset[0] contains size of array */ - ret_list = malloc(filterset[0] * sizeof (pid_t)); - if (ret_list == NULL) - return (TNFCTL_ERR_ALLOCFAIL); - - for (i = 1; i <= filterset[0]; ++i) - ret_list[i - 1] = filterset[i]; - - *ret_count = filterset[0]; - (void) free(filterset); - *ret_list_p = ret_list; - return (TNFCTL_ERR_NONE); -} - -/* - * Add the pid to the process filter list. - * check whether it's already in the filter list, - * and whether the process exists. - */ -tnfctl_errcode_t -_tnfctl_prbk_pfilter_add(tnfctl_handle_t *hdl, pid_t pid_to_add) -{ - if (ioctl(hdl->kfd, TIFIOCSPIDON, pid_to_add) < 0) { - return (tnfctl_status_map(errno)); - } - return (TNFCTL_ERR_NONE); -} - -/* - * Drop the pid from the process filter list. - */ -tnfctl_errcode_t -_tnfctl_prbk_pfilter_delete(tnfctl_handle_t *hdl, pid_t pid_to_del) -{ - if (ioctl(hdl->kfd, TIFIOCSPIDOFF, pid_to_del) < 0) { - if (errno == ESRCH) { - return (TNFCTL_ERR_NOPROCESS); - } else { - return (tnfctl_status_map(errno)); - } - } - return (TNFCTL_ERR_NONE); -} - -/* - * get the buffer attributes - side effect tnfctl handle - */ -static tnfctl_errcode_t -prbk_get_buf_attrs(tnfctl_handle_t *hdl) -{ - tifiocstate_t bufstat; - - if (ioctl(hdl->kfd, TIFIOCGSTATE, &bufstat) < 0) { - return (tnfctl_status_map(errno)); - } - - hdl->trace_file_name = NULL; - hdl->trace_buf_size = bufstat.buffer_size; - if (bufstat.buffer_state == TIFIOCBUF_NONE) - hdl->trace_buf_state = TNFCTL_BUF_NONE; - else if (bufstat.buffer_state == TIFIOCBUF_BROKEN) - hdl->trace_buf_state = TNFCTL_BUF_BROKEN; - else - hdl->trace_buf_state = TNFCTL_BUF_OK; - return (TNFCTL_ERR_NONE); -} - -/* - * "Flush" a probe: i.e., sync up the kernel state with the - * (desired) state stored in our data structure. - */ -tnfctl_errcode_t -_tnfctl_prbk_flush(tnfctl_handle_t *hndl, prbctlref_t *p) -{ - tnf_probevals_t probebuf; - - probebuf.probenum = p->probe_id; - probebuf.enabled = (p->wrkprbctl.test_func != NULL); - probebuf.traced = (p->wrkprbctl.commit_func == PRBK_DUMMY_COMMIT); - if (ioctl(hndl->kfd, TIFIOCSPROBEVALS, &probebuf) < 0) - return (tnfctl_status_map(errno)); - return (TNFCTL_ERR_NONE); -} - -/* - * Refresh our understanding of the existing probes in the kernel. - */ -tnfctl_errcode_t -_tnfctl_refresh_kernel(tnfctl_handle_t *hndl) -{ - int maxprobe, i; - int pos; - tnfctl_errcode_t prexstat; - tnf_probevals_t probebuf; - objlist_t *obj_p; - prbctlref_t *p = NULL; - - prexstat = prbk_get_buf_attrs(hndl); - if (prexstat) - return (prexstat); - /* - * Here is where you'd set obj_p->new to B_FALSE and obj_p->old to - * B_TRUE for all existing objects. We currently don't need - * it until we get modload/unload working correctly with probes - */ - if (ioctl(hndl->kfd, TIFIOCGMAXPROBE, &maxprobe) < 0) - return (tnfctl_status_map(errno)); - if (maxprobe == hndl->num_probes) { - /* XXX Inadequate in the presence of module unloading */ - return (TNFCTL_ERR_NONE); - } - - prexstat = alloc_probe_space(hndl, maxprobe); - if (prexstat) - return (prexstat); - - obj_p = hndl->objlist; - assert((obj_p != NULL) && (obj_p->probes != NULL)); - - for (i = 1; i <= maxprobe; ++i) { - - if (i >= (obj_p->min_probe_num + obj_p->probecnt)) { - obj_p = obj_p->next; - } - - /* make sure we are in the correct object */ - assert(obj_p != NULL); - assert((i >= obj_p->min_probe_num) && - (i < (obj_p->min_probe_num + obj_p->probecnt))); - - /* get a pointer to correct probe */ - pos = i - obj_p->min_probe_num; - p = &(obj_p->probes[pos]); - assert((p != NULL) && (p->probe_id == i) && (p->probe_handle)); - - probebuf.probenum = i; - if (ioctl(hndl->kfd, TIFIOCGPROBEVALS, &probebuf) < 0) { - if (errno == ENOENT) { - /* - * This probe has vanished due to a module - * unload. - */ - p->probe_handle->valid = B_FALSE; - } else { - return (tnfctl_status_map(errno)); - } - } else { - if (p->probe_handle->valid == B_FALSE) { - /* - * seeing this probe for the first time - * (alloc_probe_space() initialized this - * "valid" field to B_FALSE) - */ - /* Update our info about this probe */ - p->wrkprbctl.test_func = (probebuf.enabled) ? - PRBK_DUMMY_TEST : NULL; - p->wrkprbctl.commit_func = (probebuf.traced) ? - PRBK_DUMMY_COMMIT : PRBK_DUMMY_ROLLBACK; - p->probe_handle->valid = B_TRUE; - if (probebuf.attrsize < sizeof (probebuf)) - probebuf.attrsize = sizeof (probebuf); - p->attr_string = malloc(probebuf.attrsize); - if (p->attr_string == NULL) - return (TNFCTL_ERR_ALLOCFAIL); - /* - * NOTE: the next statement is a structure - * copy and *not* a pointer assignment - */ -/* LINTED pointer cast may result in improper alignment */ - *(tnf_probevals_t *) p->attr_string = probebuf; - if (ioctl(hndl->kfd, TIFIOCGPROBESTRING, - p->attr_string) < 0) - return (tnfctl_status_map(errno)); - if (hndl->create_func) { - p->probe_handle->client_registered_data = - hndl->create_func(hndl, - p->probe_handle); - } - } - } - } - hndl->num_probes = maxprobe; - return (TNFCTL_ERR_NONE); -} - -/* - * check if there are any new probes in the kernel that we aren't aware of. - * If so, allocate space for those probes in our data structure. - */ -static tnfctl_errcode_t -alloc_probe_space(tnfctl_handle_t *hndl, int maxprobe) -{ - objlist_t **o_pp; - objlist_t *obj_p, *nobj_p; - int min_probe_num, i; - prbctlref_t *probe_p; - - /* we know that: hndl->maxprobe != maxprobe */ - obj_p = hndl->objlist; - if (obj_p == NULL) { - /* no objects allocated */ - o_pp = &(hndl->objlist); - min_probe_num = 1; - } else { - /* find last object */ - while (obj_p->next != NULL) { - /* reset new_probe field on modload/unload */ - obj_p->new_probe = B_FALSE; - obj_p = obj_p->next; - } - o_pp = &(obj_p->next); - min_probe_num = obj_p->min_probe_num + obj_p->probecnt; - } - - nobj_p = calloc(1, sizeof (objlist_t)); - if (nobj_p == NULL) - return (TNFCTL_ERR_ALLOCFAIL); - /* add to the linked list */ - *o_pp = nobj_p; - /* NULL, B_FALSE, or 0's not explicitly initialized */ - nobj_p->new_probe = B_TRUE; - nobj_p->new = B_TRUE; - nobj_p->objfd = -1; - nobj_p->min_probe_num = min_probe_num; - nobj_p->probecnt = maxprobe - min_probe_num + 1; - nobj_p->probes = calloc(nobj_p->probecnt, sizeof (prbctlref_t)); - if (nobj_p->probes == NULL) { - free(nobj_p); - return (TNFCTL_ERR_ALLOCFAIL); - } - - probe_p = &(nobj_p->probes[0]); - for (i = min_probe_num; i <= maxprobe; i++) { - probe_p->obj = nobj_p; - probe_p->probe_id = i; - probe_p->probe_handle = calloc(1, sizeof (tnfctl_probe_t)); - if (probe_p->probe_handle == NULL) { - if (nobj_p->probes) - free(nobj_p->probes); - free(nobj_p); - return (TNFCTL_ERR_ALLOCFAIL); - } - probe_p->probe_handle->valid = B_FALSE; - probe_p->probe_handle->probe_p = probe_p; - /* link in probe handle into chain off tnfctl_handle_t */ - probe_p->probe_handle->next = hndl->probe_handle_list_head; - hndl->probe_handle_list_head = probe_p->probe_handle; - - probe_p++; - } - - hndl->num_probes = maxprobe; - return (TNFCTL_ERR_NONE); -} diff --git a/usr/src/lib/libtnfctl/kernel_int.h b/usr/src/lib/libtnfctl/kernel_int.h deleted file mode 100644 index a658ad1e56..0000000000 --- a/usr/src/lib/libtnfctl/kernel_int.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#ifndef _KERNEL_INT_H -#define _KERNEL_INT_H - -#pragma ident "%Z%%M% %I% %E% SMI" - -#ifdef __cplusplus -extern "C" { -#endif - -#include "tnfctl_int.h" - -/* - * interfaces to control kernel tracing and kernel probes - */ - -tnfctl_errcode_t _tnfctl_prbk_init(tnfctl_handle_t *); -tnfctl_errcode_t _tnfctl_prbk_close(tnfctl_handle_t *); -void _tnfctl_prbk_get_other_funcs(uintptr_t *allocp, uintptr_t *commitp, - uintptr_t *rollbackp, uintptr_t *endp); -void _tnfctl_prbk_test_func(uintptr_t *); -tnfctl_errcode_t _tnfctl_prbk_buffer_alloc(tnfctl_handle_t *, int); -tnfctl_errcode_t _tnfctl_prbk_buffer_dealloc(tnfctl_handle_t *); -tnfctl_errcode_t _tnfctl_prbk_set_tracing(tnfctl_handle_t *, boolean_t); -tnfctl_errcode_t _tnfctl_prbk_set_pfilter_mode(tnfctl_handle_t *, boolean_t); -tnfctl_errcode_t _tnfctl_prbk_get_pfilter_list(tnfctl_handle_t *, pid_t **, - int *); -tnfctl_errcode_t _tnfctl_prbk_pfilter_add(tnfctl_handle_t *, pid_t); -tnfctl_errcode_t _tnfctl_prbk_pfilter_delete(tnfctl_handle_t *, pid_t); -tnfctl_errcode_t _tnfctl_prbk_flush(tnfctl_handle_t *, prbctlref_t *); -tnfctl_errcode_t _tnfctl_refresh_kernel(tnfctl_handle_t *hndl); - -#ifdef __cplusplus -} -#endif - -#endif /* _KERNEL_INT_H */ diff --git a/usr/src/lib/libtnfctl/mapfile-vers b/usr/src/lib/libtnfctl/mapfile-vers deleted file mode 100644 index e140f9a48b..0000000000 --- a/usr/src/lib/libtnfctl/mapfile-vers +++ /dev/null @@ -1,89 +0,0 @@ -# -# 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 (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. -# - -# -# MAPFILE HEADER START -# -# WARNING: STOP NOW. DO NOT MODIFY THIS FILE. -# Object versioning must comply with the rules detailed in -# -# usr/src/lib/README.mapfiles -# -# You should not be making modifications here until you've read the most current -# copy of that file. If you need help, contact a gatekeeper for guidance. -# -# MAPFILE HEADER END -# - -$mapfile_version 2 - -SYMBOL_VERSION SUNW_1.1 { - global: - tnfctl_buffer_alloc; - tnfctl_buffer_dealloc; - tnfctl_check_libs; - tnfctl_close; - tnfctl_continue; - tnfctl_exec_open; - tnfctl_filter_list_add; - tnfctl_filter_list_delete; - tnfctl_filter_list_get; - tnfctl_filter_state_set; - tnfctl_indirect_open; - tnfctl_internal_open; - tnfctl_kernel_open; - tnfctl_pid_open; - tnfctl_probe_apply; - tnfctl_probe_apply_ids; - tnfctl_probe_connect; - tnfctl_probe_disable; - tnfctl_probe_disconnect_all; - tnfctl_probe_enable; - tnfctl_probe_state_get; - tnfctl_probe_trace; - tnfctl_probe_untrace; - tnfctl_register_funcs; - tnfctl_strerror; - tnfctl_trace_attrs_get; - tnfctl_trace_state_set; -}; - -SYMBOL_VERSION SUNWprivate_1.1 { - global: - _tnfctl_externally_traced_pid { - ASSERT = { - TYPE = OBJECT; - SIZE = 4; - }; - }; - _tnfctl_internal_tracing_flag { - ASSERT = { - TYPE = OBJECT; - SIZE = 4; - }; - }; - local: - # Reduce all remaining globals to local scope - *; -}; diff --git a/usr/src/lib/libtnfctl/open.c b/usr/src/lib/libtnfctl/open.c deleted file mode 100644 index f3087aa40a..0000000000 --- a/usr/src/lib/libtnfctl/open.c +++ /dev/null @@ -1,541 +0,0 @@ -/* - * 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 2010 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -/* - * Interfaces that return a tnfctl handle back to client (except for - * tnfctl_internal_open()) and helper functions for these interfaces. - * Also has buffer alloc, buffer dealloc, and trace attributes retrieval - * interfaces. - */ - -#include "tnfctl_int.h" -#include "kernel_int.h" -#include "dbg.h" - -#include <stdlib.h> -#include <unistd.h> -#include <signal.h> -#include <errno.h> - -static tnfctl_errcode_t attach_pid(pid_t pid, prb_proc_ctl_t **proc_pp); -static tnfctl_errcode_t step_to_end_of_exec(tnfctl_handle_t *hndl); - -/* - * invokes the target program and executes it till the run time linker (rtld) - * has loaded in the shared objects (but before any .init sections are - * executed). Returns a pointer to a tnfctl handle. - */ -tnfctl_errcode_t -tnfctl_exec_open(const char *pgm_name, char * const *args, char * const *envp, - const char *ld_preload, - const char *libtnfprobe_path, - tnfctl_handle_t **ret_val) -{ - tnfctl_handle_t *hdl; - prb_proc_ctl_t *proc_p = NULL; - prb_status_t prbstat; - uintptr_t dbgaddr; - tnfctl_errcode_t prexstat; - - prbstat = prb_child_create(pgm_name, args, ld_preload, libtnfprobe_path, - envp, &proc_p); - if (prbstat) { - return (_tnfctl_map_to_errcode(prbstat)); - } - - /* allocate hdl and zero fill */ - hdl = calloc(1, sizeof (*hdl)); - if (hdl == NULL) { - (void) prb_proc_close(proc_p); - return (TNFCTL_ERR_ALLOCFAIL); - } - - hdl->proc_p = proc_p; - hdl->mode = DIRECT_MODE; - hdl->called_exit = B_FALSE; - - /* use native /proc on this target */ - hdl->p_read = _tnfctl_read_targ; - hdl->p_write = _tnfctl_write_targ; - hdl->p_obj_iter = _tnfctl_loadobj_iter; - hdl->p_getpid = _tnfctl_pid_get; - - /* - * get the address of DT_DEBUG and send it in to prb_ layer. - * This is needed before before prb_rtld_sync() can be called. - */ - prexstat = _tnfctl_elf_dbgent(hdl, &dbgaddr); - if (prexstat) - goto failure_ret; - - prb_dbgaddr(proc_p, dbgaddr); - - /* sync up to rtld sync point */ - prbstat = prb_rtld_sync_if_needed(proc_p); - if (prbstat) { - prexstat = _tnfctl_map_to_errcode(prbstat); - goto failure_ret; - } - - /* initialize state in handle */ - prexstat = _tnfctl_set_state(hdl); - if (prexstat) - goto failure_ret; - - prexstat = _tnfctl_external_getlock(hdl); - if (prexstat) - goto failure_ret; - - *ret_val = hdl; - /* Successful return */ - return (TNFCTL_ERR_NONE); - -failure_ret: - (void) prb_proc_close(proc_p); - free(hdl); - return (prexstat); -} - - -/* - * attaches to a running process. If the process is in the beginning - * of an exec(2) system call (which is how tnfctl_continue() returns on exec), - * it steps the process till the end of the the exec. If the process hasn't - * reached the rtld sync point, the process is continued until it does - * reach it. Returns a pointer to a tnfctl handle. - */ -tnfctl_errcode_t -tnfctl_pid_open(pid_t pid, tnfctl_handle_t **ret_val) -{ - tnfctl_handle_t *hdl; - prb_proc_ctl_t *proc_p = NULL; - uintptr_t dbgaddr; - prb_status_t prbstat; - tnfctl_errcode_t prexstat; - - prexstat = attach_pid(pid, &proc_p); - if (prexstat) { - return (prexstat); - } - - /* allocate hdl and zero fill */ - hdl = calloc(1, sizeof (*hdl)); - if (hdl == NULL) { - (void) prb_proc_close(proc_p); - return (TNFCTL_ERR_ALLOCFAIL); - } - - hdl->proc_p = proc_p; - hdl->mode = DIRECT_MODE; - hdl->called_exit = B_FALSE; - - /* use native /proc on this target */ - hdl->p_read = _tnfctl_read_targ; - hdl->p_write = _tnfctl_write_targ; - hdl->p_obj_iter = _tnfctl_loadobj_iter; - hdl->p_getpid = _tnfctl_pid_get; - - /* - * Since tnfctl_continue() returns when a process does an exec - * and leaves the process stopped at the beginning of exec, we - * have to be sure to catch this case. - */ - prexstat = step_to_end_of_exec(hdl); - /* proc_p could be side effected by step_to_end_of_exec() */ - proc_p = hdl->proc_p; - if (prexstat) - goto failure_ret; - - /* - * get the address of DT_DEBUG and send it in to prb_ layer. - */ - prexstat = _tnfctl_elf_dbgent(hdl, &dbgaddr); - if (prexstat) - goto failure_ret; - - prb_dbgaddr(proc_p, dbgaddr); - - /* sync up to rtld sync point if target is not there yet */ - prbstat = prb_rtld_sync_if_needed(proc_p); - if (prbstat) { - prexstat = _tnfctl_map_to_errcode(prbstat); - goto failure_ret; - } - - /* initialize state in handle */ - prexstat = _tnfctl_set_state(hdl); - if (prexstat) - goto failure_ret; - - /* set state in target indicating we're tracing externally */ - prexstat = _tnfctl_external_getlock(hdl); - if (prexstat) - goto failure_ret; - - *ret_val = hdl; - - /* Sucessful return */ - return (TNFCTL_ERR_NONE); - -failure_ret: - (void) prb_proc_close(proc_p); - free(hdl); - return (prexstat); -} - -/* - * open a process for tracing without using native /proc on it. The client - * provides a set of callback functions which encapsulate the /proc - * functionality we need. Returns a pointer to a tnfctl handle. - */ -tnfctl_errcode_t -tnfctl_indirect_open(void *prochandle, tnfctl_ind_config_t *config, - tnfctl_handle_t **ret_val) -{ - tnfctl_handle_t *hdl; - tnfctl_errcode_t prexstat; - - /* allocate hdl and zero fill */ - hdl = calloc(1, sizeof (*hdl)); - if (hdl == NULL) { - return (TNFCTL_ERR_ALLOCFAIL); - } - - hdl->proc_p = prochandle; - hdl->mode = INDIRECT_MODE; - hdl->called_exit = B_FALSE; - - /* initialize callback functions */ - hdl->p_read = config->p_read; - hdl->p_write = config->p_write; - hdl->p_obj_iter = config->p_obj_iter; - hdl->p_getpid = config->p_getpid; - - /* initialize state in handle */ - prexstat = _tnfctl_set_state(hdl); - if (prexstat) { - free(hdl); - return (prexstat); - } - /* set state in target indicating we're tracing externally */ - prexstat = _tnfctl_external_getlock(hdl); - if (prexstat) { - free(hdl); - return (prexstat); - } - *ret_val = hdl; - return (TNFCTL_ERR_NONE); -} - -/* - * Returns a pointer to a tnfctl handle that can do kernel trace control - * and kernel probe control. - */ -tnfctl_errcode_t -tnfctl_kernel_open(tnfctl_handle_t **ret_val) -{ - tnfctl_handle_t *hdl; - tnfctl_errcode_t prexstat; - - /* allocate hdl and zero fill */ - hdl = calloc(1, sizeof (*hdl)); - if (hdl == NULL) { - return (TNFCTL_ERR_ALLOCFAIL); - } - - /* initialize kernel tracing */ - prexstat = _tnfctl_prbk_init(hdl); - if (prexstat) - return (prexstat); - - hdl->mode = KERNEL_MODE; - hdl->targ_pid = 0; - - /* initialize function pointers that can be stuffed into a probe */ - _tnfctl_prbk_get_other_funcs(&hdl->allocfunc, &hdl->commitfunc, - &hdl->rollbackfunc, &hdl->endfunc); - _tnfctl_prbk_test_func(&hdl->testfunc); - - /* find the probes in the kernel */ - prexstat = _tnfctl_refresh_kernel(hdl); - if (prexstat) - return (prexstat); - - *ret_val = hdl; - return (TNFCTL_ERR_NONE); -} - -/* - * Returns the trace attributes to the client. Since there can be - * only one controlling agent on a target at a time, our cached information - * is correct and we don't have to actually retrieve any information - * from the target. - */ -tnfctl_errcode_t -tnfctl_trace_attrs_get(tnfctl_handle_t *hdl, tnfctl_trace_attrs_t *attrs) -{ - boolean_t release_lock; - tnfctl_errcode_t prexstat; - - /*LINTED statement has no consequent: else*/ - LOCK_SYNC(hdl, prexstat, release_lock); - - attrs->targ_pid = hdl->targ_pid; - attrs->trace_file_name = hdl->trace_file_name; - attrs->trace_buf_size = hdl->trace_buf_size; - attrs->trace_min_size = hdl->trace_min_size; - attrs->trace_buf_state = hdl->trace_buf_state; - attrs->trace_state = hdl->trace_state; - attrs->filter_state = hdl->kpidfilter_state; - - /*LINTED statement has no consequent: else*/ - UNLOCK(hdl, release_lock); - - return (TNFCTL_ERR_NONE); -} - - -/* - * Allocate a trace buffer of the specified name and size. - */ -tnfctl_errcode_t -tnfctl_buffer_alloc(tnfctl_handle_t *hdl, const char *trace_file_name, - uint_t trace_file_size) -{ - tnfctl_errcode_t prexstat; - - if (hdl->mode == KERNEL_MODE) { - /* trace_file_name is ignored in kernel mode */ - prexstat = _tnfctl_prbk_buffer_alloc(hdl, trace_file_size); - if (prexstat) - return (prexstat); - return (TNFCTL_ERR_NONE); - } - - /* Not KERNEL_MODE */ - if (hdl->trace_file_name != NULL) { - /* buffer already allocated */ - return (TNFCTL_ERR_BUFEXISTS); - } - - prexstat = _tnfctl_create_tracefile(hdl, trace_file_name, - trace_file_size); - if (prexstat) { - return (prexstat); - } - - return (TNFCTL_ERR_NONE); -} - -/* - * Deallocate the trace buffer - only works for kernel mode - */ -tnfctl_errcode_t -tnfctl_buffer_dealloc(tnfctl_handle_t *hdl) -{ - tnfctl_errcode_t prexstat; - - if (hdl->mode != KERNEL_MODE) - return (TNFCTL_ERR_BADARG); - - /* KERNEL_MODE */ - prexstat = _tnfctl_prbk_buffer_dealloc(hdl); - if (prexstat) - return (prexstat); - return (TNFCTL_ERR_NONE); -} - - -/* - * Helper function for attaching to a target process - */ -static tnfctl_errcode_t -attach_pid(pid_t pid, prb_proc_ctl_t **proc_pp) -{ - prb_status_t prbstat; - prb_proc_ctl_t *proc_p; - - if (getpid() == pid) - return (TNFCTL_ERR_BADARG); - - /* check if pid is valid */ - if ((kill(pid, 0) == -1) && errno == ESRCH) { - return (TNFCTL_ERR_NOPROCESS); - } - /* open up /proc fd */ - prbstat = prb_proc_open(pid, proc_pp); - if (prbstat) - return (_tnfctl_map_to_errcode(prbstat)); - - proc_p = *proc_pp; - /* - * default is to run-on-last-close. In case we cannot sync with - * target, we don't want to kill the target. - */ - prbstat = prb_proc_setrlc(proc_p, B_TRUE); - if (prbstat) - goto failure_ret; - prbstat = prb_proc_setklc(proc_p, B_FALSE); - if (prbstat) - goto failure_ret; - - /* stop process */ - prbstat = prb_proc_stop(proc_p); - if (prbstat) - goto failure_ret; - - /* Sucessful return */ - return (TNFCTL_ERR_NONE); - -failure_ret: - (void) prb_proc_close(proc_p); - return (_tnfctl_map_to_errcode(prbstat)); -} - -/* - * Checks if target is at the beginning of an exec system call. If so, - * it runs it till the end of the exec system call. It takes care of - * the case where you're about to exec a setuid program. - * CAUTION: could side effect hndl->proc_p - */ -static tnfctl_errcode_t -step_to_end_of_exec(tnfctl_handle_t *hndl) -{ - prb_proc_ctl_t *proc_p, *oldproc_p; - prb_status_t prbstat, tempstat; - int pid; - prb_proc_state_t pstate; - - proc_p = hndl->proc_p; - pid = hndl->p_getpid(proc_p); - - prbstat = prb_proc_state(proc_p, &pstate); - if (prbstat) - return (_tnfctl_map_to_errcode(prbstat)); - if (!(pstate.ps_issysentry && pstate.ps_syscallnum == SYS_execve)) { - /* not stopped at beginning of exec system call */ - return (TNFCTL_ERR_NONE); - } - - /* we are stopped at beginning of exec system call */ - - prbstat = prb_proc_exit(proc_p, SYS_execve, PRB_SYS_ADD); - if (prbstat) - return (_tnfctl_map_to_errcode(prbstat)); - - prbstat = prb_proc_cont(proc_p); - if (prbstat) - return (_tnfctl_map_to_errcode(prbstat)); - - prbstat = prb_proc_wait(proc_p, B_FALSE, NULL); - switch (prbstat) { - case PRB_STATUS_OK: - break; - case PRB_STATUS_EAGAIN: - /* - * If we had exec'ed a setuid/setgid program PIOCWSTOP - * will return EAGAIN. Reopen the 'fd' and try again. - * Read the last section of /proc man page - we reopen first - * and then close the old fd. - */ - oldproc_p = proc_p; - tempstat = prb_proc_reopen(pid, &proc_p); - if (tempstat) { - /* here EACCES means exec'ed a setuid/setgid program */ - return (_tnfctl_map_to_errcode(tempstat)); - } - - prb_proc_close(oldproc_p); - hndl->proc_p = proc_p; - break; - default: - return (_tnfctl_map_to_errcode(prbstat)); - } - - prbstat = prb_proc_state(proc_p, &pstate); - if (prbstat) - return (_tnfctl_map_to_errcode(prbstat)); - - if (!(pstate.ps_issysexit && pstate.ps_syscallnum == SYS_execve)) { - /* unexpected condition */ - return (tnfctl_status_map(ENOENT)); - } - - /* clear old interest mask */ - prbstat = prb_proc_exit(proc_p, SYS_execve, PRB_SYS_DEL); - if (prbstat) - return (_tnfctl_map_to_errcode(prbstat)); - return (TNFCTL_ERR_NONE); -} - - -tnfctl_errcode_t -_tnfctl_external_getlock(tnfctl_handle_t *hdl) -{ - - tnfctl_errcode_t prexstat; - prb_status_t prbstat; - uintptr_t targ_symbol_ptr; - int internal_tracing_on; - - prexstat = _tnfctl_sym_find(hdl, TNFCTL_INTERNAL_TRACEFLAG, - &targ_symbol_ptr); - if (prexstat) { - /* no libtnfctl in target: success */ - return (TNFCTL_ERR_NONE); - } - prbstat = hdl->p_read(hdl->proc_p, targ_symbol_ptr, - &internal_tracing_on, sizeof (internal_tracing_on)); - - if (prbstat) { - prexstat = _tnfctl_map_to_errcode(prbstat); - goto failure_ret; - } - if (internal_tracing_on) { - /* target process being traced internally */ - prexstat = TNFCTL_ERR_BUSY; - goto failure_ret; - } - prexstat = _tnfctl_sym_find(hdl, TNFCTL_EXTERNAL_TRACEDPID, - &targ_symbol_ptr); - if (prexstat) { - /* this shouldn't happen. we know we have libtnfctl */ - goto failure_ret; - } - prbstat = hdl->p_write(hdl->proc_p, targ_symbol_ptr, - &(hdl->targ_pid), sizeof (hdl->targ_pid)); - if (prbstat) { - prexstat = _tnfctl_map_to_errcode(prbstat); - goto failure_ret; - } - /* success */ - DBG((void) fprintf(stderr, "_tnfctl_external_getlock: ok to trace %d\n", - hdl->targ_pid)); - return (TNFCTL_ERR_NONE); - -failure_ret: - return (prexstat); -} diff --git a/usr/src/lib/libtnfctl/prb_child.c b/usr/src/lib/libtnfctl/prb_child.c deleted file mode 100644 index e5d01a94e5..0000000000 --- a/usr/src/lib/libtnfctl/prb_child.c +++ /dev/null @@ -1,323 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -/* - * interfaces to exec a command and run it till all loadobjects have - * been loaded (rtld sync point). - */ - -#include <unistd.h> -#include <stdlib.h> -#include <string.h> -#include <errno.h> -#include <limits.h> -#include <sys/types.h> -#include <sys/stat.h> - -#include "prb_proc_int.h" -#include "dbg.h" - -/* - * Defines - */ - -#define PRELOAD "LD_PRELOAD" -#define LIBPROBE "libtnfprobe.so.1" - -/* - * Local declarations - */ - -static prb_status_t sync_child(int pid, volatile shmem_msg_t *smp, - prb_proc_ctl_t **proc_pp); - -/* - * prb_child_create() - this routine instantiates and rendevous with the - * target child process. This routine returns an opaque handle for the - * childs /proc entry. - */ -prb_status_t -prb_child_create(const char *cmdname, char * const *cmdargs, - const char *loption, const char *libtnfprobe_path, - char * const *envp, prb_proc_ctl_t **ret_val) -{ - prb_status_t prbstat; - pid_t childpid; - char executable_name[PATH_MAX + 2]; - extern char **environ; - char * const * env_to_use; - size_t loptlen, probepathlen; - volatile shmem_msg_t *smp; - - /* initialize shmem communication buffer to cause child to wait */ - prbstat = prb_shmem_init(&smp); - if (prbstat) - return (prbstat); - - /* fork to create the child process */ - childpid = fork(); - if (childpid == (pid_t)-1) { - DBG(perror("prb_child_create: fork failed")); - return (prb_status_map(errno)); - } - if (childpid == 0) { - char *oldenv; - char *newenv; - - /* ---- CHILD PROCESS ---- */ - - DBG_TNF_PROBE_1(prb_child_create_1, "libtnfctl", - "sunw%verbosity 1; sunw%debug 'child process created'", - tnf_long, pid, getpid()); - - if (envp) { - env_to_use = envp; - goto ContChild; - } - - /* append libtnfprobe.so to the LD_PRELOAD environment */ - loptlen = (loption) ? strlen(loption) : 0; - /* probepathlen has a "/" added in ("+ 1") */ - probepathlen = (libtnfprobe_path) ? - (strlen(libtnfprobe_path) + 1) : 0; - oldenv = getenv(PRELOAD); - if (oldenv) { - newenv = (char *)malloc(strlen(PRELOAD) + - 1 + /* "=" */ - strlen(oldenv) + - 1 + /* " " */ - probepathlen + - strlen(LIBPROBE) + - 1 + /* " " */ - loptlen + - 1); /* NULL */ - - if (!newenv) - goto ContChild; - (void) strcpy(newenv, PRELOAD); - (void) strcat(newenv, "="); - (void) strcat(newenv, oldenv); - (void) strcat(newenv, " "); - if (probepathlen) { - (void) strcat(newenv, libtnfprobe_path); - (void) strcat(newenv, "/"); - } - (void) strcat(newenv, LIBPROBE); - if (loptlen) { - (void) strcat(newenv, " "); - (void) strcat(newenv, loption); - } - } else { - newenv = (char *)malloc(strlen(PRELOAD) + - 1 + /* "=" */ - probepathlen + - strlen(LIBPROBE) + - 1 + /* " " */ - loptlen + - 1); /* NULL */ - if (!newenv) - goto ContChild; - (void) strcpy(newenv, PRELOAD); - (void) strcat(newenv, "="); - if (probepathlen) { - (void) strcat(newenv, libtnfprobe_path); - (void) strcat(newenv, "/"); - } - (void) strcat(newenv, LIBPROBE); - if (loptlen) { - (void) strcat(newenv, " "); - (void) strcat(newenv, loption); - } - } - (void) putenv((char *)newenv); - env_to_use = environ; - /* - * We don't check the return value of putenv because the - * desired libraries might already be in the target, even - * if our effort to change the environment fails. We - * should continue either way ... - */ -ContChild: - /* wait until the parent releases us */ - (void) prb_shmem_wait(smp); - - DBG_TNF_PROBE_1(prb_child_create_2, "libtnfctl", - "sunw%verbosity 2; " - "sunw%debug 'child process about to exec'", - tnf_string, cmdname, cmdname); - - /* - * make the child it's own process group. - * This is so that signals delivered to parent are not - * also delivered to child. - */ - (void) setpgrp(); - prbstat = find_executable(cmdname, executable_name); - if (prbstat) { - DBG((void) fprintf(stderr, "prb_child_create: %s\n", - prb_status_str(prbstat))); - /* parent waits for exit */ - _exit(1); - } - if (execve(executable_name, cmdargs, env_to_use) == -1) { - DBG(perror("prb_child_create: exec failed")); - _exit(1); - } - - /* Never reached */ - _exit(1); - } - /* ---- PARENT PROCESS ---- */ - /* child is waiting for us */ - - prbstat = sync_child(childpid, smp, ret_val); - if (prbstat) { - return (prbstat); - } - - return (PRB_STATUS_OK); - -} - -/* - * interface that registers the address of the debug structure - * in the target process. This is where the linker maintains all - * the information about the loadobjects - */ -void -prb_dbgaddr(prb_proc_ctl_t *proc_p, uintptr_t dbgaddr) -{ - proc_p->dbgaddr = dbgaddr; -} - -/* - * continue the child until the run time linker has loaded in all - * the loadobjects (rtld sync point) - */ -static prb_status_t -sync_child(int childpid, volatile shmem_msg_t *smp, prb_proc_ctl_t **proc_pp) -{ - prb_proc_ctl_t *proc_p, *oldproc_p; - prb_status_t prbstat = PRB_STATUS_OK; - prb_status_t tempstat; - prb_proc_state_t pstate; - - prbstat = prb_proc_open(childpid, proc_pp); - if (prbstat) - return (prbstat); - - proc_p = *proc_pp; - - prbstat = prb_proc_stop(proc_p); - if (prbstat) - goto ret_failure; - - /* - * default is to kill-on-last-close. In case we cannot sync with - * target, we don't want the target to continue. - */ - prbstat = prb_proc_setrlc(proc_p, B_FALSE); - if (prbstat) - goto ret_failure; - - prbstat = prb_proc_setklc(proc_p, B_TRUE); - if (prbstat) - goto ret_failure; - - /* REMIND: do we have to wait on SYS_exec also ? */ - prbstat = prb_proc_exit(proc_p, SYS_execve, PRB_SYS_ADD); - if (prbstat) - goto ret_failure; - - prbstat = prb_proc_entry(proc_p, SYS_exit, PRB_SYS_ADD); - if (prbstat) - goto ret_failure; - - prbstat = prb_shmem_clear(smp); - if (prbstat) - goto ret_failure; - - prbstat = prb_proc_cont(proc_p); - if (prbstat) - goto ret_failure; - - prbstat = prb_proc_wait(proc_p, B_FALSE, NULL); - switch (prbstat) { - case PRB_STATUS_OK: - break; - case EAGAIN: - /* - * If we had exec'ed a setuid/setgid program PIOCWSTOP - * will return EAGAIN. Reopen the 'fd' and try again. - * Read the last section of /proc man page - we reopen first - * and then close the old fd. - */ - oldproc_p = proc_p; - tempstat = prb_proc_reopen(childpid, proc_pp); - proc_p = *proc_pp; - if (tempstat) { - /* here EACCES means exec'ed a setuid/setgid program */ - (void) prb_proc_close(oldproc_p); - return (tempstat); - } - - (void) prb_proc_close(oldproc_p); - break; - default: - goto ret_failure; - } - - prbstat = prb_shmem_free(smp); - if (prbstat) - goto ret_failure; - - prbstat = prb_proc_state(proc_p, &pstate); - if (prbstat) - goto ret_failure; - - if (pstate.ps_issysexit && (pstate.ps_syscallnum == SYS_execve)) { - /* expected condition */ - prbstat = PRB_STATUS_OK; - } else { - prbstat = prb_status_map(ENOENT); - goto ret_failure; - } - - /* clear old interest mask */ - prbstat = prb_proc_exit(proc_p, 0, PRB_SYS_NONE); - if (prbstat) - goto ret_failure; - - prbstat = prb_proc_entry(proc_p, 0, PRB_SYS_NONE); - if (prbstat) - goto ret_failure; - - /* Successful return */ - return (PRB_STATUS_OK); - -ret_failure: - (void) prb_proc_close(proc_p); - return (prbstat); -} diff --git a/usr/src/lib/libtnfctl/prb_findexec.c b/usr/src/lib/libtnfctl/prb_findexec.c deleted file mode 100644 index 17feab3ce8..0000000000 --- a/usr/src/lib/libtnfctl/prb_findexec.c +++ /dev/null @@ -1,106 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -/* - * interfaces to find an executable (from libc code) - */ - -/* Copyright (c) 1988 AT&T */ -/* All Rights Reserved */ - - -#include <unistd.h> -#include <stdlib.h> -#include <string.h> -#include <errno.h> -#include <limits.h> -#include <sys/types.h> -#include <sys/stat.h> - -#include "prb_proc_int.h" - -static const char *exec_cat(const char *s1, const char *s2, char *si); - -prb_status_t -find_executable(const char *name, char *ret_path) -{ - const char *pathstr; - char fname[PATH_MAX + 2]; - const char *cp; - struct stat stat_buf; - - if (*name == '\0') { - return (prb_status_map(ENOENT)); - } - if ((pathstr = getenv("PATH")) == NULL) { - if (geteuid() == 0 || getuid() == 0) - pathstr = "/usr/sbin:/usr/bin"; - else - pathstr = "/usr/bin:"; - } - cp = strchr(name, '/') ? (const char *) "" : pathstr; - - do { - cp = exec_cat(cp, name, fname); - if (stat(fname, &stat_buf) != -1) { - /* successful find of the file */ - (void) strncpy(ret_path, fname, PATH_MAX + 2); - return (PRB_STATUS_OK); - } - } while (cp); - - return (prb_status_map(ENOENT)); -} - - - -static const char * -exec_cat(const char *s1, const char *s2, char *si) -{ - char *s; - /* number of characters in s2 */ - int cnt = PATH_MAX + 1; - - s = si; - while (*s1 && *s1 != ':') { - if (cnt > 0) { - *s++ = *s1++; - cnt--; - } else - s1++; - } - if (si != s && cnt > 0) { - *s++ = '/'; - cnt--; - } - while (*s2 && cnt > 0) { - *s++ = *s2++; - cnt--; - } - *s = '\0'; - return (*s1 ? ++s1 : 0); -} diff --git a/usr/src/lib/libtnfctl/prb_lmap.c b/usr/src/lib/libtnfctl/prb_lmap.c deleted file mode 100644 index 246099d7e9..0000000000 --- a/usr/src/lib/libtnfctl/prb_lmap.c +++ /dev/null @@ -1,151 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -/* - * Interfaces that deal with loadobjects (shared objects) in target - */ - -#include <stdlib.h> -#include <stdio.h> -#include <errno.h> -#include <string.h> -#include <link.h> -#include <unistd.h> -#include <sys/procfs.h> - -#include "tnfctl.h" -#include "prb_proc_int.h" -#include "dbg.h" - -/* - * iterate over all loadobjects calling the callback function "obj_func" - * for every loadobject with information about the loadobject. - */ -prb_status_t -prb_loadobj_iter(prb_proc_ctl_t *proc_p, prb_loadobj_f *obj_func, void *cd) -{ - prb_status_t prbstat; - Elf3264_Dyn dentry; - struct r_debug r_dbg; - uintptr_t lmapaddr; - struct link_map lmap; - prb_loadobj_t loadobj; - int retval = 0; - - DBG_TNF_PROBE_0(prb_loadobj_iter_start, "libtnfctl", - "start prb_loadobj_iter; sunw%verbosity 1"); - - if (proc_p->dbgaddr == 0) { - DBG((void) fprintf(stderr, - "prb_loadobj_iter: dbgaddr not set\n")); - return (PRB_STATUS_BADARG); - } - - prbstat = prb_proc_read(proc_p, proc_p->dbgaddr, &dentry, - sizeof (dentry)); - if (prbstat || !dentry.d_un.d_ptr) { - DBG((void) fprintf(stderr, - "prb_lmap_update: error in d_un.d_ptr\n")); - return (prbstat); - } - /* read in the debug struct that it points to */ - prbstat = prb_proc_read(proc_p, dentry.d_un.d_ptr, - &r_dbg, sizeof (r_dbg)); - if (prbstat) - return (prbstat); - - DBG_TNF_PROBE_1(prb_loadobj_iter_1, "libtnfctl", "sunw%verbosity 1", - tnf_string, link_map_state, - (r_dbg.r_state == RT_CONSISTENT) ? "RT_CONSISTENT" : - (r_dbg.r_state == RT_ADD) ? "RT_ADD" : "RT_DELETE"); - - /* if the link map is not consistent, bail now */ - if (r_dbg.r_state != RT_CONSISTENT) - return (PRB_STATUS_BADLMAPSTATE); - - lmap.l_next = NULL; /* makes lint happy */ - - for (lmapaddr = (uintptr_t) r_dbg.r_map; lmapaddr; - lmapaddr = (uintptr_t) lmap.l_next) { - - prbstat = prb_proc_read(proc_p, lmapaddr, &lmap, sizeof (lmap)); - if (prbstat) - return (prbstat); - - loadobj.text_base = lmap.l_addr; - loadobj.data_base = lmap.l_addr; - loadobj.objname = NULL; - /* - * client of this interface should deal with -1 for objfd, - * so no error checking is needed on this ioctl - */ - loadobj.objfd = ioctl(proc_p->procfd, PIOCOPENM, &lmap.l_addr); - - (void) prb_proc_readstr(proc_p, (uintptr_t) lmap.l_name, - &loadobj.objname); - retval = obj_func(proc_p, &loadobj, cd); - if (loadobj.objname) - free((char *)loadobj.objname); - if (loadobj.objfd != -1) - close(loadobj.objfd); - /* check for error */ - if (retval == 1) - return (PRB_STATUS_BADARG); - } - - DBG_TNF_PROBE_0(prb_loadobj_iter_end, "libtnfctl", - "end prb_loadobj_iter; sunw%verbosity 1"); - return (PRB_STATUS_OK); -} - -/* - * Return a fd for the main executable and also the address of where - * it was mapped. - */ -prb_status_t -prb_mainobj_get(prb_proc_ctl_t *proc_p, int *objfd, uintptr_t *baseaddr) -{ - int procfd; - int retfd; - - - procfd = proc_p->procfd; -again: - retfd = ioctl(procfd, PIOCOPENM, 0); - if (retfd < 0) { - if (errno == EINTR) - goto again; - DBG((void) fprintf(stderr, - "prb_mainobj_get: PIOCOPENM failed: %s\n", - strerror(errno))); - return (prb_status_map(errno)); - } - *objfd = retfd; - *baseaddr = 0; - - return (PRB_STATUS_OK); -} diff --git a/usr/src/lib/libtnfctl/prb_proc.c b/usr/src/lib/libtnfctl/prb_proc.c deleted file mode 100644 index 48e05b088f..0000000000 --- a/usr/src/lib/libtnfctl/prb_proc.c +++ /dev/null @@ -1,1004 +0,0 @@ -/* - * 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 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 (c) 1994-1999 by Sun Microsystems, Inc. - * All rights reserved. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -/* - * This file contains interfaces that are wrappers over the basic - * /proc ioctls - */ - -#include <unistd.h> -#include <string.h> -#include <errno.h> -#include <fcntl.h> -#include <stdlib.h> -#include <stdio.h> -#include <sys/uio.h> -#include <sys/types.h> -#include <sys/param.h> -#include <sys/fault.h> -#include <sys/procfs.h> - -#include "prb_proc_int.h" -#include "dbg.h" - -/* - * Declarations - */ - -#define PROCFORMAT "/proc/%d" - -static prb_status_t -prb_proc_open_general(pid_t pid, prb_proc_ctl_t **proc_pp, int oflg); - -/* - * prb_proc_open_general() - function to open the process file - * system entry for the supplied process. Opens with different - * options based on the 'oflg'. - * Returns a pointer to an opaque structure that contains the fd - * needed for /proc control. - */ - -prb_status_t -prb_proc_open_general(pid_t pid, prb_proc_ctl_t **proc_pp, int oflg) -{ - prb_proc_ctl_t *proc_p; - char path[MAXPATHLEN]; - int retval; - - (void) sprintf(path, PROCFORMAT, (int)pid); - - DBG_TNF_PROBE_1(prb_proc_open_1, "libtnfctl", "sunw%verbosity 2", - tnf_string, opening_proc_on, path); - - retval = open(path, oflg); - if (retval == -1) { - DBG((void) fprintf(stderr, - "proc_open: open of \"%s\" failed: %s\n", - path, strerror(errno))); - return (prb_status_map(errno)); - } - /* allocate proc_p and zero fill */ - proc_p = calloc(1, sizeof (*proc_p)); - if (proc_p == NULL) - return (PRB_STATUS_ALLOCFAIL); - proc_p->procfd = retval; - proc_p->pid = pid; - *proc_pp = proc_p; - return (PRB_STATUS_OK); -} - - -/* - * prb_proc_open() - a wrapper which opens the process file system - * entry for the supplied process. Returns a pointer to an opaque - * structure that contains the fd needed for /proc control. - */ - -prb_status_t -prb_proc_open(pid_t pid, prb_proc_ctl_t **proc_pp) -{ - - return (prb_proc_open_general(pid, - proc_pp, O_RDWR | O_EXCL)); - -} - -/* - * prb_proc_reopen() - re-opens the process, mainly for setuid/setgid files. - * Read the last section of /proc man page for details. - * re-open should not use O_EXCL flag. - */ - -prb_status_t -prb_proc_reopen(pid_t pid, prb_proc_ctl_t **proc_pp) -{ - - return (prb_proc_open_general(pid, - proc_pp, O_RDWR)); - -} - -/* - * prob_proc_close() - close the proc fd and free the memory taken up - * by proc_p - */ -prb_status_t -prb_proc_close(prb_proc_ctl_t *proc_p) -{ - DBG_TNF_PROBE_0(prb_proc_close_1, "libtnfctl", "sunw%verbosity 2"); - - if (proc_p == NULL) - return (PRB_STATUS_OK); - - if (close(proc_p->procfd) == -1) { - DBG((void) fprintf(stderr, - "proc_close: close failed: %s\n", strerror(errno))); - return (prb_status_map(errno)); - } - free(proc_p); - return (PRB_STATUS_OK); -} - -/* - * prb_proc_pid_get() - gets the pid of the proc - */ -pid_t -prb_proc_pid_get(prb_proc_ctl_t *proc_p) -{ - return (proc_p->pid); -} - -/* - * prb_proc_stop() - stops the target process - */ -prb_status_t -prb_proc_stop(prb_proc_ctl_t *proc_p) -{ - int retval; - - DBG_TNF_PROBE_0(prb_proc_stop_1, "libtnfctl", - "sunw%verbosity 2; sunw%debug 'stopping the target process'"); - -again: - retval = ioctl(proc_p->procfd, PIOCSTOP, NULL); - if (retval == -1) { - if (errno == EINTR) - goto again; - DBG((void) fprintf(stderr, - "prb_proc_stop: PIOCSTOP failed: %s\n", - strerror(errno))); - return (prb_status_map(errno)); - } - return (PRB_STATUS_OK); -} - - -/* - * prb_proc_prstop() - runs and stops the process, used to clear a target - * process out of a system call state. - */ -prb_status_t -prb_proc_prstop(prb_proc_ctl_t *proc_p) -{ - int procfd; - int retval; - prrun_t prrun; - prstatus_t prstat; - - DBG_TNF_PROBE_0(prb_proc_prstop_1, "libtnfctl", - "sunw%verbosity 2; sunw%debug 'stepping the target process'"); - - procfd = proc_p->procfd; - (void) memset((char *)&prrun, 0, sizeof (prrun)); - (void) memset((char *)&prstat, 0, sizeof (prstat)); - -again1: - prrun.pr_flags = PRSTOP; - retval = ioctl(procfd, PIOCRUN, &prrun); - if (retval == -1) { - if (errno == EINTR) - goto again1; - DBG((void) fprintf(stderr, - "prb_proc_prstop: PIOCRUN failed: %s\n", - strerror(errno))); - return (prb_status_map(errno)); - } -again2: - retval = ioctl(procfd, PIOCWSTOP, &prstat); - if (retval == -1) { - if (errno == EINTR) - goto again2; - DBG((void) fprintf(stderr, - "prb_proc_prstop: PIOCWSTOP failed: %s\n", - strerror(errno))); - return (prb_status_map(errno)); - } - /* - * if we didn't stop because we requested it (eg. if there was a - * signal in the target ?), we might need to try again - */ - if (prstat.pr_why != PR_REQUESTED) - goto again1; - - return (PRB_STATUS_OK); -} - - -/* - * prb_proc_state() - returns the status pf the process - */ -prb_status_t -prb_proc_state(prb_proc_ctl_t *proc_p, prb_proc_state_t *state_p) -{ - int procfd; - int retval; - prstatus_t prstatus; - - DBG_TNF_PROBE_0(prb_proc_state_1, "libtnfctl", - "sunw%verbosity 2; sunw%debug 'getting the status'"); - - procfd = proc_p->procfd; - - (void) memset(&prstatus, 0, sizeof (prstatus)); - -again: - retval = ioctl(procfd, PIOCSTATUS, &prstatus); - if (retval == -1) { - if (errno == EINTR) - goto again; - DBG((void) fprintf(stderr, - "prb_proc_status: PIOCSTATUS failed: %s\n", - strerror(errno))); - return (prb_status_map(errno)); - } - state_p->ps_isbptfault = (prstatus.pr_flags & PR_FAULTED && - prstatus.pr_what == FLTBPT); - state_p->ps_isstopped = ((prstatus.pr_flags & PR_STOPPED) != 0); - state_p->ps_isinsys = ((prstatus.pr_flags & PR_ASLEEP) != 0); - state_p->ps_isrequested = ((prstatus.pr_why & PR_REQUESTED) != 0); - state_p->ps_issysexit = ((prstatus.pr_why & PR_SYSEXIT) != 0); - state_p->ps_issysentry = ((prstatus.pr_why & PR_SYSENTRY) != 0); - state_p->ps_syscallnum = prstatus.pr_what; - return (PRB_STATUS_OK); -} - - -/* - * prb_proc_wait() - waits for the target process to stop - */ -prb_status_t -prb_proc_wait(prb_proc_ctl_t *proc_p, boolean_t use_sigmask, sigset_t *oldmask) -{ - int procfd; - int retval; - prstatus_t prstat; - sigset_t pendmask; - int i, mask_size; - boolean_t pending_signal = B_FALSE; - - DBG_TNF_PROBE_0(prb_proc_wait_1, "libtnfctl", - "sunw%verbosity 2;" - "sunw%debug 'waiting for the target process to stop'"); - - procfd = proc_p->procfd; - - /* - * This one of the places where we do not resubmit the ioctl if - * if it is terminated by an EINTR (interrupted system call). In - * this case, the caller knows best ... - */ - (void) memset(&prstat, 0, sizeof (prstat)); - - /* if we blocked signals... */ - if (use_sigmask) { - if (sigemptyset(&pendmask) == -1) - return (prb_status_map(errno)); - if (sigpending(&pendmask) == -1) - return (prb_status_map(errno)); - /* - * check if there were any signals pending - - * XXXX libc should provide this interface - */ - mask_size = sizeof (pendmask) / sizeof (pendmask.__sigbits[0]); - for (i = 0; i < mask_size; i++) { - if (pendmask.__sigbits[i] != 0) - pending_signal = B_TRUE; - } - - /* return to original signal mask */ - if (sigprocmask(SIG_SETMASK, oldmask, NULL) == -1) - return (prb_status_map(errno)); - - /* if there was a pending signal, don't call PIOCWSTOP ioctl */ - if (pending_signal) - return (prb_status_map(EINTR)); - - /* - * XXXX - there is a a race between now and when we call - * the PIOCWSTOP ioctl. One solution, is for the user to - * call an interface in libtnfctl from their signal handler. - * This interface will do a longjmp such that it never - * calls the ioctl (the setjmp would be before we restore - * the signal mask above) - */ - } - - retval = ioctl(procfd, PIOCWSTOP, &prstat); - - DBG_TNF_PROBE_2(prb_proc_wait_2, "libtnfctl", "sunw%verbosity 2;", - tnf_opaque, pc, prstat.pr_reg[R_PC], - tnf_opaque, instr, prstat.pr_instr); - - if (retval == -1) { -#ifdef DEBUG - if (errno != EINTR && errno != ENOENT) - (void) fprintf(stderr, - "prb_proc_wait: PIOCWSTOP failed: %s\n", - strerror(errno)); - -#endif - return (prb_status_map(errno)); - } - - return (PRB_STATUS_OK); -} - - -/* - * prb_proc_cont() - continues the target process - */ -prb_status_t -prb_proc_cont(prb_proc_ctl_t *proc_p) -{ - int procfd; - int retval; - prrun_t prrun; - - DBG_TNF_PROBE_0(prb_proc_cont_1, "libtnfctl", - "sunw%verbosity 2; sunw%debug 'starting the target process'"); - procfd = proc_p->procfd; - - (void) memset((char *)&prrun, 0, sizeof (prrun)); - -again: - prrun.pr_flags = PRCFAULT; - retval = ioctl(procfd, PIOCRUN, &prrun); - if (retval == -1) { - if (errno == EINTR) - goto again; - DBG((void) fprintf(stderr, - "prb_proc_cont: PIOCRUN failed: %s\n", - strerror(errno))); - return (prb_status_map(errno)); - } - return (PRB_STATUS_OK); -} - - -/* - * prb_proc_istepbpt() - step the target process one instruction - * - * CAUTION!!!! - this routine is specialized to only be able to single - * step over the breakpoint location. - */ -prb_status_t -prb_proc_istepbpt(prb_proc_ctl_t *proc_p) -{ - int procfd; - int retval; - prrun_t run; - fltset_t faults; - prstatus_t prstat; - - DBG_TNF_PROBE_0(prb_proc_istepbpt_1, "libtnfctl", - "sunw%verbosity 2; " - "sunw%debug 'single stepping over breakpoint'"); - - procfd = proc_p->procfd; - - (void) memset((char *)&run, 0, sizeof (run)); - - /* add trace fault to the list of current traced faults */ -again1: - retval = ioctl(procfd, PIOCGFAULT, &faults); - if (retval == -1) { - if (errno == EINTR) - goto again1; - DBG((void) fprintf(stderr, - "prb_proc_istepbpt: PIOCGFAULT failed: %s\n", - strerror(errno))); - return (prb_status_map(errno)); - } - praddset(&faults, FLTTRACE); - - /* issue the run command with the single-step option */ - run.pr_flags = PRCFAULT | PRSFAULT | PRSTEP; - run.pr_fault = faults; - - /* load the location of the breakpoint */ - run.pr_vaddr = (caddr_t)proc_p->bptaddr; - run.pr_flags |= PRSVADDR; - -again2: - retval = ioctl(procfd, PIOCRUN, &run); - if (retval == -1) { - if (errno == EINTR) - goto again2; - DBG((void) fprintf(stderr, - "prb_proc_istepbpt: PIOCRUN failed: %s\n", - strerror(errno))); - return (prb_status_map(errno)); - } -again3: - retval = ioctl(procfd, PIOCWSTOP, &prstat); - if (retval == -1) { - if (errno == EINTR) - goto again3; - DBG((void) fprintf(stderr, - "prb_proc_istepbpt: PIOCWSTOP failed: %s\n", - strerror(errno))); - return (prb_status_map(errno)); - } - - DBG_TNF_PROBE_2(prb_proc_istepbpt_2, "libtnfctl", "sunw%verbosity 2;", - tnf_opaque, pc, prstat.pr_reg[R_PC], - tnf_opaque, instr, prstat.pr_instr); - - - /* clear any current faults */ -again4: - retval = ioctl(procfd, PIOCCFAULT, NULL); - if (retval == -1) { - if (errno == EINTR) - goto again4; - DBG((void) fprintf(stderr, - "prb_proc_clrbptflt: PIOCCFAULT failed: %s\n", - strerror(errno))); - return (prb_status_map(errno)); - } - /* remove the trace fault from the current traced faults */ - prdelset(&faults, FLTTRACE); -again5: - retval = ioctl(procfd, PIOCSFAULT, &faults); - if (retval == -1) { - if (errno == EINTR) - goto again5; - DBG((void) fprintf(stderr, - "prb_proc_istepbpt: PIOCSFAULT failed: %s\n", - strerror(errno))); - return (prb_status_map(errno)); - } - return (PRB_STATUS_OK); -} - - -/* - * prb_proc_clrbptflt() - clear an encountered breakpoint fault - */ -prb_status_t -prb_proc_clrbptflt(prb_proc_ctl_t *proc_p) -{ - int retval; - int procfd; - - DBG_TNF_PROBE_0(prb_proc_clrbptflt_1, "libtnfctl", "sunw%verbosity 2"); - - procfd = proc_p->procfd; - - /* clear any current faults */ -again: - retval = ioctl(procfd, PIOCCFAULT, NULL); - if (retval == -1) { - if (errno == EINTR) - goto again; - DBG((void) fprintf(stderr, - "prb_proc_clrbptflt: PIOCCFAULT failed: %s\n", - strerror(errno))); - return (prb_status_map(errno)); - } - return (PRB_STATUS_OK); -} - - -/* - * prb_proc_tracebpt() - sets the bpt tracing state. - */ -prb_status_t -prb_proc_tracebpt(prb_proc_ctl_t *proc_p, boolean_t bpt) -{ - int procfd; - int retval; - fltset_t faults; - - DBG_TNF_PROBE_1(prb_proc_tracebpt_1, "libtnfctl", "sunw%verbosity 2;", - tnf_string, bpt_state, (bpt) ? "enabled" : "disabled"); - - procfd = proc_p->procfd; - /* get the current set of traced faults */ -again1: - retval = ioctl(procfd, PIOCGFAULT, &faults); - if (retval == -1) { - if (errno == EINTR) - goto again1; - DBG((void) fprintf(stderr, - "prb_proc_tracebpt: PIOCGFAULT failed: %s\n", - strerror(errno))); - return (prb_status_map(errno)); - } - /* set or clear the breakpoint flag */ - if (bpt) - praddset(&faults, FLTBPT); - else - prdelset(&faults, FLTBPT); - - /* write the fault set back */ -again2: - retval = ioctl(procfd, PIOCSFAULT, &faults); - if (retval == -1) { - if (errno == EINTR) - goto again2; - DBG((void) fprintf(stderr, - "prb_proc_tracebpt: PIOCSFAULT failed: %s\n", - strerror(errno))); - return (prb_status_map(errno)); - } - return (PRB_STATUS_OK); -} - -/* Note - the following 3 functions should be combined */ - -/* - * prb_proc_setrlc() - sets or clears the run-on-last-close flag. - */ -prb_status_t -prb_proc_setrlc(prb_proc_ctl_t *proc_p, boolean_t rlc) -{ - int procfd; - long mode; - int retval; - - DBG_TNF_PROBE_1(prb_proc_setrlc_1, "libtnfctl", "sunw%verbosity 2;", - tnf_string, run_on_last_close, (rlc) ? "setting" : "clearing"); - - procfd = proc_p->procfd; - mode = PR_RLC; - - if (rlc) { -again1: - retval = ioctl(procfd, PIOCSET, &mode); - if (retval == -1) { - if (errno == EINTR) - goto again1; - DBG((void) fprintf(stderr, - "prb_proc_setrlc: PIOCSET failed: %s\n", - strerror(errno))); - return (prb_status_map(errno)); - } - } else { -again2: - retval = ioctl(procfd, PIOCRESET, &mode); - if (retval == -1) { - if (errno == EINTR) - goto again2; - DBG((void) fprintf(stderr, - "prb_proc_setrlc: PIOCRESET failed: %s\n", - strerror(errno))); - return (prb_status_map(errno)); - } - } - - return (PRB_STATUS_OK); - - -} /* end prb_proc_setrlc */ - - -/* - * prb_proc_setklc() - sets or clears the kill-on-last-close flag. - */ -prb_status_t -prb_proc_setklc(prb_proc_ctl_t *proc_p, boolean_t klc) -{ - int procfd; - long mode; - int retval; - - DBG_TNF_PROBE_1(prb_proc_setklc_1, "libtnfctl", "sunw%verbosity 2;", - tnf_string, kill_on_last_close, (klc) ? "setting" : "clearing"); - - procfd = proc_p->procfd; - mode = PR_KLC; - - if (klc) { -again1: - retval = ioctl(procfd, PIOCSET, &mode); - if (retval == -1) { - if (errno == EINTR) - goto again1; - DBG((void) fprintf(stderr, - "prb_proc_setklc: PIOCSET failed: %s\n", - strerror(errno))); - return (prb_status_map(errno)); - } - } else { -again2: - retval = ioctl(procfd, PIOCRESET, &mode); - if (retval == -1) { - if (errno == EINTR) - goto again2; - DBG((void) fprintf(stderr, - "prb_proc_setklc: PIOCRESET failed: %s\n", - strerror(errno))); - return (prb_status_map(errno)); - } - } - - return (PRB_STATUS_OK); - -} /* end prb_proc_setklc */ - -/* - * prb_proc_setfork() - sets or clears the inherit-on-fork flag - */ -prb_status_t -prb_proc_setfork(prb_proc_ctl_t *proc_p, boolean_t inhfork) -{ - int procfd; - long mode; - int retval; - - DBG_TNF_PROBE_1(prb_proc_setfork_1, "libtnfctl", "sunw%verbosity 2;", - tnf_string, kill_on_last_close, - (inhfork) ? "setting" : "clearing"); - - procfd = proc_p->procfd; - mode = PR_FORK; - - if (inhfork) { -again1: - retval = ioctl(procfd, PIOCSET, &mode); - if (retval == -1) { - if (errno == EINTR) - goto again1; - DBG((void) fprintf(stderr, - "prb_proc_setfork: PIOCSET failed: %s\n", - strerror(errno))); - return (prb_status_map(errno)); - } - } else { -again2: - retval = ioctl(procfd, PIOCRESET, &mode); - if (retval == -1) { - if (errno == EINTR) - goto again2; - DBG((void) fprintf(stderr, - "prb_proc_setfork: PIOCRESET failed: %s\n", - strerror(errno))); - return (prb_status_map(errno)); - } - } - - return (PRB_STATUS_OK); - -} /* end prb_proc_setfork */ - -/* - * prb_proc_exit() - if op is PRB_SYS_ALL, sets up the target process to stop - * on exit from all system calls. If op is PRB_SYS_NONE, sets up the target - * process so that it will not stop on exit from any system call. - * PRB_SYS_ADD and PRB_SYS_DEL adds or deletes a particular system call from - * the mask of "interested" system calls respectively. This function can be - * called multiple times to build up the mask. - */ -prb_status_t -prb_proc_exit(prb_proc_ctl_t *proc_p, - uint_t syscall, - prb_syscall_op_t op) -{ - int procfd; - int retval; - sysset_t sysmask; - - DBG_TNF_PROBE_0(prb_proc_exit_1, "libtnfctl", - "sunw%verbosity 2; " - "sunw%debug 'setting up target to stop on exit of syscall'"); - - procfd = proc_p->procfd; - - switch (op) { - case PRB_SYS_ALL: - prfillset(&sysmask); - break; - case PRB_SYS_NONE: - premptyset(&sysmask); - break; - case PRB_SYS_ADD: -again1: - retval = ioctl(procfd, PIOCGEXIT, &sysmask); - if (retval == -1) { - if (errno == EINTR) - goto again1; - DBG((void) fprintf(stderr, - "prb_proc_exit: PIOCGEXIT failed: %s\n", - strerror(errno))); - return (prb_status_map(errno)); - } - praddset(&sysmask, syscall); - break; - case PRB_SYS_DEL: -again2: - retval = ioctl(procfd, PIOCGEXIT, &sysmask); - if (retval == -1) { - if (errno == EINTR) - goto again2; - DBG((void) fprintf(stderr, - "prb_proc_exit: PIOCGEXIT failed: %s\n", - strerror(errno))); - return (prb_status_map(errno)); - } - prdelset(&sysmask, syscall); - break; - default: - DBG((void) fprintf(stderr, "prb_proc_exit: bad input arg\n")); - return (PRB_STATUS_BADARG); - } -again3: - retval = ioctl(procfd, PIOCSEXIT, &sysmask); - if (retval == -1) { - if (errno == EINTR) - goto again3; - DBG((void) fprintf(stderr, - "prb_proc_exit: PIOCSEXIT failed: %s\n", - strerror(errno))); - return (prb_status_map(errno)); - } - return (PRB_STATUS_OK); - -} /* end prb_proc_exit */ - -/* - * prb_proc_entry() - if op is PRB_SYS_ALL, sets up the target process to - * stop on entry from all system calls. If op is PRB_SYS_NONE, sets up the - * target process so that it will not stop on entry from any system call. - * PRB_SYS_ADD and PRB_SYS_DEL adds or deletes a particular system call from - * the mask of "interested" system calls respectively. This function can be - * called multiple times to build up the mask. - */ -prb_status_t -prb_proc_entry(prb_proc_ctl_t *proc_p, - uint_t syscall, - prb_syscall_op_t op) -{ - int procfd; - int retval; - sysset_t sysmask; - - DBG_TNF_PROBE_0(prb_proc_entry_1, "libtnfctl", - "sunw%verbosity 2; " - "sunw%debug 'setting up target to stop on entry of syscall'"); - - procfd = proc_p->procfd; - - switch (op) { - case PRB_SYS_ALL: - prfillset(&sysmask); - break; - case PRB_SYS_NONE: - premptyset(&sysmask); - break; - case PRB_SYS_ADD: -again1: - retval = ioctl(procfd, PIOCGENTRY, &sysmask); - if (retval == -1) { - if (errno == EINTR) - goto again1; - DBG((void) fprintf(stderr, - "prb_proc_entry: PIOCGENTRY failed: %s\n", - strerror(errno))); - return (prb_status_map(errno)); - } - praddset(&sysmask, syscall); - break; - case PRB_SYS_DEL: -again2: - retval = ioctl(procfd, PIOCGENTRY, &sysmask); - if (retval == -1) { - if (errno == EINTR) - goto again2; - DBG((void) fprintf(stderr, - "prb_proc_entry: PIOCGENTRY failed: %s\n", - strerror(errno))); - return (prb_status_map(errno)); - } - prdelset(&sysmask, syscall); - break; - default: - DBG((void) fprintf(stderr, "prb_proc_entry: bad input arg\n")); - return (PRB_STATUS_BADARG); - } -again3: - retval = ioctl(procfd, PIOCSENTRY, &sysmask); - if (retval == -1) { - if (errno == EINTR) - goto again3; - DBG((void) fprintf(stderr, - "prb_proc_entry: PIOCSENTRY failed: %s\n", - strerror(errno))); - return (prb_status_map(errno)); - } - return (PRB_STATUS_OK); -} - -/* - * prb_proc_read() - reads a block of memory from a processes address space. - */ -prb_status_t -prb_proc_read(prb_proc_ctl_t *proc_p, uintptr_t addr, void *buf, size_t size) -{ - int procfd; - ssize_t sz; - off_t offset; - - DBG_TNF_PROBE_2(prb_proc_read_1, "libtnfctl", "sunw%verbosity 3;", - tnf_long, num_bytes, size, - tnf_opaque, from_address, addr); - - procfd = proc_p->procfd; - offset = lseek(procfd, (off_t)addr, SEEK_SET); - if (offset != (off_t)addr) { - DBG(perror("prb_proc_read: lseek failed")); - return (prb_status_map(errno)); - } - sz = read(procfd, buf, size); - if (sz != size) { - DBG(perror("prb_proc_read: read failed")); - return (prb_status_map(errno)); - } - return (PRB_STATUS_OK); -} - - -/* - * prb_proc_write() - writes a block of memory from a processes address - * space. - */ -prb_status_t -prb_proc_write(prb_proc_ctl_t *proc_p, uintptr_t addr, void *buf, size_t size) -{ - int procfd; - ssize_t sz; - off_t offset; - - DBG_TNF_PROBE_2(prb_proc_write_1, "libtnfctl", "sunw%verbosity 3;", - tnf_long, num_bytes, size, - tnf_opaque, to_address, addr); - - procfd = proc_p->procfd; - offset = lseek(procfd, (off_t)addr, SEEK_SET); - if (offset != (off_t)addr) { - DBG(perror("prb_proc_write: lseek failed")); - return (prb_status_map(errno)); - } - sz = write(procfd, buf, size); - if (sz != size) { - DBG(perror("prb_proc_write: write failed")); - return (prb_status_map(errno)); - } - return (PRB_STATUS_OK); -} - - -/* - * prb_proc_readstr() - dereferences a string in the target - * NOTE: There is a similar routine called _tnfctl_readstr_targ() - * used by tnfctl layer. It would be better if there was only - * one of these functions defined. - */ - -#define BUFSZ 256 - -prb_status_t -prb_proc_readstr(prb_proc_ctl_t *proc_p, uintptr_t addr, const char **outstr_pp) -{ - prb_status_t prbstat; - int bufsz = BUFSZ; - char buffer[BUFSZ + 1]; - offset_t offset; - char *ptr, *orig_ptr; - - *outstr_pp = NULL; - offset = 0; - - /* allocate an inital return buffer */ - ptr = (char *)malloc(BUFSZ); - if (!ptr) { - DBG((void) fprintf(stderr, - "prb_proc_readstr: malloc failed\n")); - return (PRB_STATUS_ALLOCFAIL); - } - /*LINTED constant in conditional context*/ - while (1) { - int i; - - /* read a chunk into our buffer */ - prbstat = prb_proc_read(proc_p, addr + offset, buffer, bufsz); - if (prbstat) { - - /* - * if we get into trouble with a large read, try again - * with a single byte. Subsequent failure is real ... - */ - if (bufsz > 1) { - bufsz = 1; - continue; - } - - DBG((void) fprintf(stderr, - "prb_proc_readstr: prb_proc_read failed: %s\n", - prb_status_str(prbstat))); - free(ptr); - return (prbstat); - } - /* copy the chracters into the return buffer */ - for (i = 0; i < bufsz; i++) { - char c = buffer[i]; - - ptr[offset + i] = c; - if (c == '\0') { - /* hooray! we saw the end of the string */ - *outstr_pp = ptr; - return (PRB_STATUS_OK); - } - } - - /* bummer, need to grab another bufsz characters */ - offset += bufsz; - orig_ptr = ptr; - ptr = (char *)realloc(ptr, offset + bufsz); - if (!ptr) { - free(orig_ptr); - DBG((void) fprintf(stderr, - "prb_proc_readstr: realloc failed\n")); - return (PRB_STATUS_ALLOCFAIL); - } - } - -#if defined(lint) - return (PRB_STATUS_OK); -#endif -} - -prb_status_t -prb_proc_get_r0_r1(prb_proc_ctl_t *proc_p, prgreg_t *r0, prgreg_t *r1) -{ - int retval; - int procfd; - prstatus_t prstatus; - - procfd = proc_p->procfd; -again: - retval = ioctl(procfd, PIOCSTATUS, &prstatus); - if (retval == -1) { - if (errno == EINTR) - goto again; - return (prb_status_map(errno)); - } - - /* - * Use R_Rn register definitions for some uniformity - * sparc: define R_R0 R_O0 - * define R_R1 R_O1 - * x86: define R_R0 EAX - * define R_R1 EDX - */ - *r0 = prstatus.pr_reg[R_R0]; - *r1 = prstatus.pr_reg[R_R1]; - DBG((void) fprintf - (stderr, "prb_proc_get_r0_r1: R_R0 = %d, R_R1 = %d\n", *r0, *r1)); - return (PRB_STATUS_OK); -} diff --git a/usr/src/lib/libtnfctl/prb_proc.h b/usr/src/lib/libtnfctl/prb_proc.h deleted file mode 100644 index 9693404e84..0000000000 --- a/usr/src/lib/libtnfctl/prb_proc.h +++ /dev/null @@ -1,165 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#ifndef _PRB_PROC_H -#define _PRB_PROC_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Header file that gives the interfaces to the proc layer. These are the - * interfaces for "native" /proc i.e. when libtnfctl uses /proc directly - * on the target process (tnfctl_exec_open() and tnfctl_pid_open()) - */ - -/* - * Includes - */ - -#include <sys/types.h> -#include <sys/syscall.h> -#include <sys/procfs.h> -#include <sys/errno.h> -#include <signal.h> - -#include <tnf/probe.h> - -/* - * Typedefs - */ - -typedef enum prb_status { - /* successful status */ - PRB_STATUS_OK = 0, - - /* errors */ - /* - * Status values in the range 1 to -1023 are reserved for mapping - * standard errno values. - */ - PRB_STATUS_MINERRNO = 1, /* minimum errno value */ - PRB_STATUS_EAGAIN = EAGAIN, - PRB_STATUS_MAXERRNO = 1023, /* maximum errno value */ - - PRB_STATUS_ALLOCFAIL, /* memory allocation failed */ - PRB_STATUS_BADARG, /* bad input argument */ - PRB_STATUS_BADSYNC, /* couldn't sync with rtld */ - PRB_STATUS_BADLMAPSTATE /* inconsistent link map */ -} prb_status_t; - -typedef enum prb_syscall_op { - PRB_SYS_ALL, /* turn on all system calls */ - PRB_SYS_NONE, /* clears all system calls */ - PRB_SYS_ADD, /* add a system call */ - PRB_SYS_DEL /* delete a system call */ -} prb_syscall_op_t; - -/* - * status of /proc file descriptor - */ -typedef struct prb_proc_state { - boolean_t ps_isstopped; - boolean_t ps_isinsys; - boolean_t ps_isrequested; - boolean_t ps_issysexit; - boolean_t ps_issysentry; - boolean_t ps_isbptfault; - long ps_syscallnum; -} prb_proc_state_t; - -/* - * Opaque /proc handle - */ -typedef struct prb_proc_ctl prb_proc_ctl_t; - -/* - * prb_dbgaddr() has to be called with the address of DT_DEBUG before - * most other interfaces in the prb layer can be used. - */ -void prb_dbgaddr(prb_proc_ctl_t *proc_p, uintptr_t dbgaddr); - -/* - * loadobject iteration callback specification - * WARNING: keep this structure in sync with tnfctl_ind_obj_info_t - */ -typedef struct prb_loadobj { - int objfd; - uintptr_t text_base; - uintptr_t data_base; - const char *objname; -} prb_loadobj_t; - -typedef int prb_loadobj_f(prb_proc_ctl_t *proc_p, const prb_loadobj_t *obj, - void *calldata); -prb_status_t prb_loadobj_iter(prb_proc_ctl_t *, prb_loadobj_f *, void *); -prb_status_t prb_mainobj_get(prb_proc_ctl_t *proc_p, int *objfd, - uintptr_t *baseaddr); - -const char *prb_status_str(prb_status_t prbstat); - -pid_t prb_proc_pid_get(prb_proc_ctl_t *proc_p); - -/* rtld interfaces */ -prb_status_t prb_rtld_sync_if_needed(prb_proc_ctl_t *proc_p); -prb_status_t prb_rtld_stalk(prb_proc_ctl_t *proc_p); -prb_status_t prb_rtld_unstalk(prb_proc_ctl_t *proc_p); -prb_status_t prb_rtld_advance(prb_proc_ctl_t *proc_p); - -/* generic /proc wrapper interfaces */ -prb_status_t prb_proc_open(pid_t pid, prb_proc_ctl_t **proc_pp); -prb_status_t prb_proc_reopen(pid_t pid, prb_proc_ctl_t **proc_pp); -prb_status_t prb_proc_close(prb_proc_ctl_t *proc_p); -prb_status_t prb_proc_stop(prb_proc_ctl_t *proc_p); -prb_status_t prb_proc_wait(prb_proc_ctl_t *proc_p, boolean_t use_sigmask, - sigset_t *oldmask); -prb_status_t prb_proc_cont(prb_proc_ctl_t *proc_p); -prb_status_t prb_proc_state(prb_proc_ctl_t *proc_p, - prb_proc_state_t *state_p); -prb_status_t prb_proc_setrlc(prb_proc_ctl_t *proc_p, boolean_t rlc); -prb_status_t prb_proc_setklc(prb_proc_ctl_t *proc_p, boolean_t klc); -prb_status_t prb_proc_exit(prb_proc_ctl_t *proc_p, uint_t syscall, - prb_syscall_op_t op); -prb_status_t prb_proc_entry(prb_proc_ctl_t *proc_p, uint_t syscall, - prb_syscall_op_t op); -prb_status_t prb_proc_read(prb_proc_ctl_t *proc_p, uintptr_t addr, - void *buf, size_t size); -prb_status_t prb_proc_write(prb_proc_ctl_t *proc_p, uintptr_t addr, - void *buf, size_t size); -prb_status_t prb_proc_setfork(prb_proc_ctl_t *proc_p, boolean_t inhfork); -prb_status_t prb_proc_get_r0_r1(prb_proc_ctl_t *proc_p, - prgreg_t *r0, prgreg_t *r1); - -/* exec a child */ -prb_status_t prb_child_create(const char *cmdname, char * const *cmdargs, - const char *loption, const char *libtnfprobe_path, - char * const *envp, prb_proc_ctl_t **ret_val); - -#ifdef __cplusplus -} -#endif - -#endif /* _PRB_PROC_H */ diff --git a/usr/src/lib/libtnfctl/prb_proc_int.h b/usr/src/lib/libtnfctl/prb_proc_int.h deleted file mode 100644 index 8c4d6bf31d..0000000000 --- a/usr/src/lib/libtnfctl/prb_proc_int.h +++ /dev/null @@ -1,102 +0,0 @@ -/* - * 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 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 2004 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -#ifndef _PRB_PROC_INT_H -#define _PRB_PROC_INT_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Interfaces private to proc layer - */ - -#include <sys/types.h> -#include <sys/syscall.h> - -#include <tnf/probe.h> - -#include "prb_proc.h" - -/* - * size of breakpoint instruction - */ -#if defined(__sparc) -typedef unsigned int bptsave_t; -#elif defined(__i386) || defined(__amd64) -typedef unsigned char bptsave_t; -#endif - -/* - * memory shared between parent and child when exec'ing a child. - * child spins on "spin" member waiting for parent to set it free - */ -typedef struct shmem_msg { - boolean_t spin; -} shmem_msg_t; - -/* - * per /proc handle state - */ -struct prb_proc_ctl { - int procfd; - int pid; - uintptr_t bptaddr; - bptsave_t saveinstr; /* instruction that bpt replaced */ - boolean_t bpt_inserted; /* is bpt inserted ? */ - uintptr_t dbgaddr; -}; - -/* - * Declarations - */ -prb_status_t prb_status_map(int); -prb_status_t find_executable(const char *name, char *ret_path); - -/* shared memory lock interfaces */ -prb_status_t prb_shmem_init(volatile shmem_msg_t **); -prb_status_t prb_shmem_wait(volatile shmem_msg_t *); -prb_status_t prb_shmem_clear(volatile shmem_msg_t *); -prb_status_t prb_shmem_free(volatile shmem_msg_t *smp); - -/* runs and stops the process to clear it out of system call */ -prb_status_t prb_proc_prstop(prb_proc_ctl_t *proc_p); - -/* break point interfaces */ -prb_status_t prb_proc_tracebpt(prb_proc_ctl_t *proc_p, boolean_t bpt); -prb_status_t prb_proc_istepbpt(prb_proc_ctl_t *proc_p); -prb_status_t prb_proc_clrbptflt(prb_proc_ctl_t *proc_p); - -/* read a string from target process */ -prb_status_t prb_proc_readstr(prb_proc_ctl_t *proc_p, uintptr_t addr, - const char **outstr_pp); - -#ifdef __cplusplus -} -#endif - -#endif /* _PRB_PROC_INT_H */ diff --git a/usr/src/lib/libtnfctl/prb_rtld.c b/usr/src/lib/libtnfctl/prb_rtld.c deleted file mode 100644 index 03f9cffa6e..0000000000 --- a/usr/src/lib/libtnfctl/prb_rtld.c +++ /dev/null @@ -1,393 +0,0 @@ -/* - * 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 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 2004 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -/* - * Interfaces to sync up with run time linker (rtld) at process start up time - * and at dlopen() and dlclose() time - * In Solaris 2.6, librtld_db.so should replace this functionality. Issues - * to solve before libtnfctl.so can use librtld_db.so: - * 1. Should libtnfctl.so be usable before Solaris 2.6 - If so, cannot use - * librtld_db.so - * 2. libtnfctl.so will have to provide <proc_service.h> in order to use - * librtld_db.so. If libtnfctl.so is now linked into a debugger that - * also provides <proc_service.h>, how will the two co-exist - will the - * linker get confused, or not ? - */ - -#include <unistd.h> -#include <stdlib.h> -#include <string.h> -#include <errno.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <sys/fcntl.h> -#include <sys/procfs.h> -#include <link.h> - -#include "tnfctl.h" -#include "prb_proc_int.h" -#include "dbg.h" - - -static prb_status_t prb_rtld_setup(prb_proc_ctl_t *proc_p, boolean_t *synced); -static prb_status_t prb_rtld_wait(prb_proc_ctl_t *proc_p); -static prb_status_t bpt(prb_proc_ctl_t *proc_p, uintptr_t addr); -static prb_status_t unbpt(prb_proc_ctl_t *proc_p, uintptr_t addr); - - -/* ---------------------------------------------------------------- */ -/* ----------------------- Public Functions ----------------------- */ -/* ---------------------------------------------------------------- */ - - -/* - * prb_rtld_stalk() - setup for a breakpoint when rtld has opened or closed a - * shared object. - */ -prb_status_t -prb_rtld_stalk(prb_proc_ctl_t *proc_p) -{ - prb_status_t prbstat = PRB_STATUS_OK; - - DBG_TNF_PROBE_0(prb_rtld_stalk_1, "libtnfctl", "sunw%verbosity 2"); - - if (!proc_p->bptaddr) { - Elf3264_Dyn dentry; - struct r_debug r_dbg; - - if (proc_p->dbgaddr == 0) { - DBG((void) fprintf(stderr, - "prb_rtld_stalk: dbgaddr not set\n")); - return (PRB_STATUS_BADARG); - } - - prbstat = prb_proc_read(proc_p, proc_p->dbgaddr, - &dentry, sizeof (dentry)); - if (prbstat || !dentry.d_un.d_ptr) { - DBG((void) fprintf(stderr, - "prb_rtld_stalk: error in d_un.d_ptr\n")); - return (prbstat); - } - /* read in the debug struct that it points to */ - prbstat = prb_proc_read(proc_p, dentry.d_un.d_ptr, - &r_dbg, sizeof (r_dbg)); - if (prbstat) - return (prbstat); - - proc_p->bptaddr = r_dbg.r_brk; - } - /* plant a breakpoint trap in the pointed to function */ - prbstat = bpt(proc_p, proc_p->bptaddr); - if (prbstat) - return (prbstat); - - /* setup process to stop when breakpoint encountered */ - prbstat = prb_proc_tracebpt(proc_p, B_TRUE); - - return (prbstat); - -} - - -/* - * prb_rtld_unstalk() - remove rtld breakpoint - */ -prb_status_t -prb_rtld_unstalk(prb_proc_ctl_t *proc_p) -{ - prb_status_t prbstat; - - DBG_TNF_PROBE_0(prb_rtld_unstalk_1, "libtnfctl", "sunw%verbosity 2"); - - /* turn off BPT tracing while out of the water ... */ - prbstat = prb_proc_tracebpt(proc_p, B_FALSE); - - prbstat = unbpt(proc_p, proc_p->bptaddr); - - return (prbstat); -} - - -/* - * prb_rtld_advance() - we've hit a breakpoint, replace the original - * instruction, istep, put the breakpoint back ... - */ -prb_status_t -prb_rtld_advance(prb_proc_ctl_t *proc_p) -{ - prb_status_t prbstat; - - DBG_TNF_PROBE_0(prb_rtld_advance_1, "libtnfctl", "sunw%verbosity 2"); - - prbstat = prb_proc_clrbptflt(proc_p); - if (prbstat) - return (prbstat); - prbstat = unbpt(proc_p, proc_p->bptaddr); - if (prbstat) - return (prbstat); - - prbstat = prb_proc_istepbpt(proc_p); - if (prbstat) - return (prbstat); - - prbstat = bpt(proc_p, proc_p->bptaddr); - if (prbstat) - return (prbstat); - - return (PRB_STATUS_OK); -} - -/* - * checks if process has reached rtld_sync point or not i.e. has rltld - * loaded in libraries or not ? If not, it lets process run until - * rtld has mapped in all libraries (no user code would have been - * executed, including .init sections) - */ -prb_status_t -prb_rtld_sync_if_needed(prb_proc_ctl_t *proc_p) -{ - prb_status_t prbstat = PRB_STATUS_OK; - boolean_t synced = B_FALSE; - - prbstat = prb_rtld_setup(proc_p, &synced); - if (prbstat) - return (prbstat); - - if (synced == B_FALSE) { - /* wait on target to sync up after rtld maps in all .so's */ - prbstat = prb_rtld_wait(proc_p); - if (prbstat) - return (prbstat); - } - - return (prbstat); -} - -/* ---------------------------------------------------------------- */ -/* ----------------------- Private Functions ---------------------- */ -/* ---------------------------------------------------------------- */ - -/* - * prb_rtld_setup() - turns on the flag in the rtld structure so that rtld - * executes a getpid() stystem call after it done mapping all shared objects - * but before it executes any init code. - */ -static prb_status_t -prb_rtld_setup(prb_proc_ctl_t *proc_p, boolean_t *synced) -{ - prb_status_t prbstat = PRB_STATUS_OK; - Elf3264_Dyn dentry; - - DBG_TNF_PROBE_0(prb_rtld_setup_1, "libtnfctl", "sunw%verbosity 2"); - - if (proc_p->dbgaddr == 0) { - DBG((void) fprintf(stderr, - "prb_rtld_setup: dbgaddr not set\n")); - return (PRB_STATUS_BADARG); - } - - prbstat = prb_proc_read(proc_p, proc_p->dbgaddr, &dentry, - sizeof (dentry)); - if (prbstat) { - DBG((void) fprintf(stderr, - "prb_rtld_setup: error in d_un.d_ptr\n")); - return (prbstat); - } - - if ((dentry.d_un.d_ptr == 0) || (dentry.d_un.d_ptr == 1)) { - *synced = B_FALSE; - } else { - *synced = B_TRUE; - return (PRB_STATUS_OK); - } - - /* modify it - i.e. request rtld to do getpid() */ - dentry.d_un.d_ptr = 1; - prbstat = prb_proc_write(proc_p, proc_p->dbgaddr, &dentry, - sizeof (dentry)); - - return (prbstat); -} - - -/* - * prb_rtld_wait() - waits on target to execute getpid() - */ -static prb_status_t -prb_rtld_wait(prb_proc_ctl_t *proc_p) -{ - prb_proc_state_t pstate; - prb_status_t prbstat; - - DBG_TNF_PROBE_0(prb_rtld_wait_1, "libtnfctl", "sunw%verbosity 2"); - - /* stop on exit of getpid() */ - prbstat = prb_proc_exit(proc_p, SYS_getpid, PRB_SYS_ADD); - if (prbstat) { - DBG((void) fprintf(stderr, - "prb_rtld_wait: couldn't set up child to stop on " - "exit of getpid(): %s\n", prb_status_str(prbstat))); - return (prbstat); - } - /* stop on entry of exit() - i.e. exec failed */ - prbstat = prb_proc_entry(proc_p, SYS_exit, PRB_SYS_ADD); - if (prbstat) { - DBG((void) fprintf(stderr, - "prb_rtld_wait: couldn't set up child to stop on " - "entry of exit(): %s\n", prb_status_str(prbstat))); - return (prbstat); - } - /* continue target and wait for it to stop */ - prbstat = prb_proc_cont(proc_p); - if (prbstat) { - DBG((void) fprintf(stderr, - "prb_rtld_wait: couldn't continue target process: %s\n", - prb_status_str(prbstat))); - return (prbstat); - } - /* wait for target to stop */ - prbstat = prb_proc_wait(proc_p, B_FALSE, NULL); - if (prbstat) { - DBG((void) fprintf(stderr, - "prb_rtld_wait: couldn't wait on target process: %s\n", - prb_status_str(prbstat))); - return (prbstat); - } - /* make sure it did stop on getpid() */ - prbstat = prb_proc_state(proc_p, &pstate); - if (prbstat) { - DBG((void) fprintf(stderr, - "prb_rtld_wait: couldn't get state of target: %s\n", - prb_status_str(prbstat))); - return (prbstat); - } - if (pstate.ps_issysentry && (pstate.ps_syscallnum == SYS_exit)) { - DBG((void) fprintf(stderr, "prb_rtld_wait: target exited\n")); - return (prb_status_map(EACCES)); - } - /* catch any other errors */ - if (!(pstate.ps_issysexit && (pstate.ps_syscallnum == SYS_getpid))) { - DBG((void) fprintf(stderr, - "prb_rtld_wait: target didn't stop on getpid\n")); - return (PRB_STATUS_BADSYNC); - } - /* clear wait on getpid */ - prbstat = prb_proc_exit(proc_p, SYS_getpid, PRB_SYS_DEL); - if (prbstat) { - DBG((void) fprintf(stderr, - "prb_rtld_wait: couldn't clear child to stop on " - "exit of getpid(): %s\n", prb_status_str(prbstat))); - return (prbstat); - } - /* clear wait on exit */ - prbstat = prb_proc_entry(proc_p, SYS_exit, PRB_SYS_DEL); - if (prbstat) { - DBG((void) fprintf(stderr, - "prb_rtld_wait: couldn't clear child to stop on " - "entry of exit(): %s\n", prb_status_str(prbstat))); - return (prbstat); - } - /* start-stop the process to clear it out of the system call */ - prbstat = prb_proc_prstop(proc_p); - if (prbstat) { - DBG((void) fprintf(stderr, - "prb_rtld_wait: couldn't prstop child: %s\n", - prb_status_str(prbstat))); - return (prbstat); - } - return (PRB_STATUS_OK); -} - - -#if defined(__sparc) -#define INS_BPT 0x91d02001 -#elif defined(__i386) || defined(__amd64) -#define INS_BPT 0xcc -#else -#error What is your breakpoint instruction? -#endif - -/* - * plants a breakpoint at the specified location in - * the target process, and saves the existing instruction. - */ -static prb_status_t -bpt(prb_proc_ctl_t *proc_p, uintptr_t addr) -{ - prb_status_t prbstat; - bptsave_t instr; - - if (!proc_p->bpt_inserted) { - - DBG_TNF_PROBE_1(bpt_1, "libtnfctl", "sunw%verbosity 2", - tnf_opaque, bpt_planted_at, addr); - - prbstat = prb_proc_read(proc_p, addr, - &(proc_p->saveinstr), sizeof (proc_p->saveinstr)); - if (prbstat) - return (prbstat); - - DBG_TNF_PROBE_1(bpt_2, "libtnfctl", "sunw%verbosity 2", - tnf_opaque, saved_instr, (unsigned)proc_p->saveinstr); - - instr = INS_BPT; - - prbstat = prb_proc_write(proc_p, addr, - &instr, sizeof (instr)); - if (prbstat) - return (prbstat); - - proc_p->bpt_inserted = B_TRUE; - } - return (PRB_STATUS_OK); -} - -/* - * removes a breakpoint at the specified location in - * the target process, and replaces it with the original instruction. - */ -prb_status_t -unbpt(prb_proc_ctl_t *proc_p, uintptr_t addr) -{ - prb_status_t prbstat; - - if (proc_p->bpt_inserted) { - - DBG_TNF_PROBE_2(unbpt_1, "libtnfctl", "sunw%verbosity 2", - tnf_opaque, unplanting_at, addr, - tnf_opaque, saved_instr, (unsigned)proc_p->saveinstr); - - prbstat = prb_proc_write(proc_p, addr, &(proc_p->saveinstr), - sizeof (proc_p->saveinstr)); - if (prbstat) - return (prbstat); - - proc_p->bpt_inserted = B_FALSE; - } - return (PRB_STATUS_OK); -} diff --git a/usr/src/lib/libtnfctl/prb_shmem.c b/usr/src/lib/libtnfctl/prb_shmem.c deleted file mode 100644 index e2f4d7b5db..0000000000 --- a/usr/src/lib/libtnfctl/prb_shmem.c +++ /dev/null @@ -1,133 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -/* - * Interfaces to allocate, control, and free a shared memory lock - * XXXX Could we use a semaphore or a shared memory condition variable - * instead ? - */ - -#include <unistd.h> -#include <fcntl.h> -#include <errno.h> -#include <stdlib.h> -#include <sys/mman.h> -#include <sys/types.h> - -#include "prb_proc_int.h" -#include "dbg.h" - -static boolean_t getspin(volatile shmem_msg_t *smp); - -/* - * prb_shmem_init() - Allocates and initializes the shared memory region - */ -prb_status_t -prb_shmem_init(volatile shmem_msg_t **ret_val) -{ - int shmem_fd; - volatile shmem_msg_t *smp; - - DBG_TNF_PROBE_0(prb_shmem_init_1, "libtnfctl", "sunw%verbosity 2"); - - shmem_fd = open("/dev/zero", O_RDWR); - if (shmem_fd == -1) { - DBG((void) fprintf(stderr, "couldn't open \"/dev/zero\"")); - return (prb_status_map(errno)); - } - /*LINTED pointer cast may result in improper alignment*/ - smp = (shmem_msg_t *) mmap(0, sizeof (struct shmem_msg), - PROT_READ | PROT_WRITE, MAP_SHARED, - shmem_fd, 0); - if (smp == (struct shmem_msg *) - 1) { - DBG((void) fprintf(stderr, "couldn't mmap \"/dev/zero\"")); - return (prb_status_map(errno)); - } - (void) close(shmem_fd); - - /* sets the shared memory region to cause waiting */ - smp->spin = B_TRUE; - - *ret_val = smp; - - return (PRB_STATUS_OK); -} - -/* - * prb_shmem_wait() - spins until the shared memory flag is cleared - */ -static boolean_t -getspin(volatile shmem_msg_t *smp) -{ - return (smp->spin); -} - -prb_status_t -prb_shmem_wait(volatile shmem_msg_t *smp) -{ - DBG_TNF_PROBE_0(prb_shmem_wait_start, "libtnfctl", - "sunw%verbosity 2; start prb_shmem_wait"); - - while (getspin(smp)); - - DBG_TNF_PROBE_0(prb_shmem_wait_end, "libtnfctl", - "sunw%verbosity 2; end prb_shmem_wait"); - - return (PRB_STATUS_OK); - -} - - -/* - * prb_shmem_clear() - clears the shared memory flag and allows waiters to - * proceed. - */ -prb_status_t -prb_shmem_clear(volatile shmem_msg_t *smp) -{ - DBG_TNF_PROBE_0(prb_shmem_clear_1, "libtnfctl", "sunw%verbosity 2"); - - smp->spin = B_FALSE; - - return (PRB_STATUS_OK); -} - -/* - * prb_shmem_free() - Unmaps the shared memory region. - */ -prb_status_t -prb_shmem_free(volatile shmem_msg_t *smp) -{ - DBG_TNF_PROBE_0(prb_shmem_free_1, "libtnfctl", "sunw%verbosity 2"); - - if (munmap((caddr_t) smp, sizeof (struct shmem_msg)) != 0) { - DBG((void) fprintf(stderr, "couldn't munmap shared memory\n")); - return (prb_status_map(errno)); - } - - return (PRB_STATUS_OK); -} diff --git a/usr/src/lib/libtnfctl/prb_status.c b/usr/src/lib/libtnfctl/prb_status.c deleted file mode 100644 index 6958ed9232..0000000000 --- a/usr/src/lib/libtnfctl/prb_status.c +++ /dev/null @@ -1,84 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -/* - * Interfaces to print error codes and to map an errno to an error code. - */ - -#include <string.h> -#include <libintl.h> - -#include "tnfctl_int.h" -#include "dbg.h" - - -#if !defined(TEXT_DOMAIN) -#define TEXT_DOMAIN "SYS_TEST" -#endif - -/* - * prb_status_str() - this routine returns a pointer to a static string - * describing the error argument. - */ -const char * -prb_status_str(prb_status_t prbstat) -{ - /* if this is in the errno range, use the errno string */ - if (prbstat >= PRB_STATUS_MINERRNO && - prbstat <= PRB_STATUS_MAXERRNO) { - return (strerror(prbstat)); - } else { - switch (prbstat) { - case PRB_STATUS_OK: - return (dgettext(TEXT_DOMAIN, "success")); - case PRB_STATUS_ALLOCFAIL: - return (dgettext(TEXT_DOMAIN, - "memory allocation failed")); - case PRB_STATUS_BADARG: - return (dgettext(TEXT_DOMAIN, "bad input argument")); - case PRB_STATUS_BADSYNC: - return (dgettext(TEXT_DOMAIN, - "couldn't sync with rtld")); - case PRB_STATUS_BADLMAPSTATE: - return (dgettext(TEXT_DOMAIN, "inconsistent link map")); - default: - return (dgettext(TEXT_DOMAIN, - "Unknown libtnfctl.so prb layer error code")); - } - } -} - -/* - * prb_status_map() - this routine converts an errno value into a - * prb_status_t. - */ -prb_status_t -prb_status_map(int val) -{ - return (val); - -} diff --git a/usr/src/lib/libtnfctl/probes.c b/usr/src/lib/libtnfctl/probes.c deleted file mode 100644 index 57d8b139fd..0000000000 --- a/usr/src/lib/libtnfctl/probes.c +++ /dev/null @@ -1,763 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -/* - * Load object and probe discovery in target process. This file is - * not exercised for kernel probes. - */ - -#ifndef DEBUG -#define NDEBUG 1 -#endif - -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <string.h> -#include <stddef.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <fcntl.h> -#include <assert.h> - -#include "tnfctl_int.h" -#include "kernel_int.h" -#include "dbg.h" - -/* - * Defines - Project private interfaces - */ - -#define PROBE_SYMBOL "__tnf_probe_version_1" - -/* - * Typedefs - */ - -typedef struct link_args { - char *la_probename; - int ret_val; -} link_args_t; - -typedef struct link_args2 { - tnfctl_handle_t *la_hndl; - char *la_probename; - objlist_t *la_obj; - ulong_t la_index; - ulong_t la_base; -} link_args2_t; - -static int per_loadobj(void *, const tnfctl_ind_obj_info_t *, void *); -static objlist_t *loadobj_find(tnfctl_handle_t *, - const tnfctl_ind_obj_info_t *); -static tnfctl_errcode_t get_num_probes(tnfctl_handle_t *, objlist_t *, int *); -static tnfctl_errcode_t read_probes_in_obj(tnfctl_handle_t *, objlist_t *, - ulong_t, ulong_t); -static void free_obj_fields(objlist_t *); -static tnfctl_errcode_t count_probes(char *, uintptr_t, void *, - tnfctl_elf_search_t *); -static tnfctl_errcode_t read_a_probe(char *, uintptr_t, void *, - tnfctl_elf_search_t *); -static tnfctl_errcode_t link_targ_obj_probes(tnfctl_handle_t *, objlist_t *); -static tnfctl_errcode_t unlink_targ_obj_probes(tnfctl_handle_t *, objlist_t *); - -/* - * sync up our library list with that of the run time linker's - * Returns an event indicating if a dlopen or dlclose happened. - */ -tnfctl_errcode_t -_tnfctl_lmap_update(tnfctl_handle_t *hndl, boolean_t *lmap_ok, - enum event_op_t *dl_evt) -{ - int miscstat; - objlist_t *cur_obj; - - *lmap_ok = B_TRUE; - - /* reset old and new of current objects */ - for (cur_obj = hndl->objlist; cur_obj; cur_obj = cur_obj->next) { - cur_obj->old = B_TRUE; - cur_obj->new = B_FALSE; - } - - /* read in object list */ - miscstat = hndl->p_obj_iter(hndl->proc_p, per_loadobj, hndl); - /* reset libs_changed global var to indicated sync up done */ - _tnfctl_libs_changed = B_FALSE; - if (miscstat) { - /* - * for INDIRECT_MODE or INTERNAL_MODE, we should never get - * called when linkmaps are not consistent, so this is a real - * error - return without setting lmap_ok. - */ - if ((hndl->mode == INDIRECT_MODE) || - (hndl->mode == INTERNAL_MODE)) - return (TNFCTL_ERR_INTERNAL); - - assert(hndl->mode == DIRECT_MODE); - /* - * in DIRECT_MODE: - * caller needs to call tnfctl_continue on BADLMAPSTATE - * XXXX - the cast from int to prb_status_t is ok as - * we know we are in DIRECT_MODE and we are calling our - * own loadobject iterator function. - */ - if ((prb_status_t) miscstat == PRB_STATUS_BADLMAPSTATE) - *lmap_ok = B_FALSE; - return (_tnfctl_map_to_errcode((prb_status_t) miscstat)); - } - - /* - * find out about dlopens or dlcloses - In direct mode, there - * can only be one since we monitor all dl activity. The dl_evt - * field is only used by tnfctl_continue(). In proc_service - * mode or internal mode, the new_probe member indicates new probes - * correctly. - */ - *dl_evt = EVT_NONE; - for (cur_obj = hndl->objlist; cur_obj; cur_obj = cur_obj->next) { - if (cur_obj->old == B_TRUE) { - *dl_evt = EVT_CLOSE; - break; - } - if (cur_obj->new == B_TRUE) { - *dl_evt = EVT_OPEN; - break; - } - } - - /* - * reset new_probe field only if there was a dlopen or dlclose - */ - if (*dl_evt != EVT_NONE) { - for (cur_obj = hndl->objlist; cur_obj; - cur_obj = cur_obj->next) { - cur_obj->new_probe = cur_obj->new; - } - } - - return (TNFCTL_ERR_NONE); -} - - -/* - * search through all libraries and discover all probes in target - * This function assumes all objects have been found and marked as - * appropriate (new, old, or neither) - */ -tnfctl_errcode_t -_tnfctl_find_all_probes(tnfctl_handle_t *hndl) -{ - tnfctl_errcode_t prexstat; - int num_probes, j; - objlist_t *cur_obj, *prev_obj, *tmp_obj; - boolean_t saw_new_probes = B_FALSE; - - prev_obj = NULL; - cur_obj = hndl->objlist; - while (cur_obj) { - if (cur_obj->old == B_TRUE) { - /* dlclosed library : stitch out probes in target */ - - DBG_TNF_PROBE_3(_tnfctl_find_all_probes_1, "libtnfctl", - "sunw%verbosity 1; sunw%debug 'lib dlclosed'", - tnf_opaque, lib_baseaddr, cur_obj->baseaddr, - tnf_string, lib_name, cur_obj->objname, - tnf_long, lib_fd, cur_obj->objfd); - - prexstat = unlink_targ_obj_probes(hndl, cur_obj); - if (prexstat) - return (prexstat); - free_obj_fields(cur_obj); - /* remove this object from linked list */ - tmp_obj = cur_obj; - cur_obj = cur_obj->next; - if (prev_obj == NULL) - hndl->objlist = cur_obj; - else - prev_obj->next = cur_obj; - free(tmp_obj); - continue; - } - - if (cur_obj->new == B_TRUE) { - /* dlopened library : read in probes */ - prexstat = get_num_probes(hndl, cur_obj, &num_probes); - if (prexstat) - return (prexstat); - if (num_probes) { - saw_new_probes = B_TRUE; - cur_obj->probes = malloc(num_probes * - sizeof (prbctlref_t)); - if (cur_obj->probes == NULL) - return (TNFCTL_ERR_ALLOCFAIL); - prexstat = read_probes_in_obj(hndl, cur_obj, - num_probes, hndl->num_probes); - if (prexstat) - return (prexstat); - cur_obj->min_probe_num = hndl->num_probes; - /* increment num_probes */ - hndl->num_probes += num_probes; - cur_obj->probecnt = num_probes; - prexstat = link_targ_obj_probes(hndl, cur_obj); - if (prexstat) - return (prexstat); - } - } - prev_obj = cur_obj; - cur_obj = cur_obj->next; - } - -#if 0 - for (cur_obj = hndl->objlist; cur_obj; cur_obj = cur_obj->next) { - (void) fprintf(stderr, "%s 0x%08x %s fd=%d\n", - (cur_obj->new) ? "*" : " ", - cur_obj->baseaddr, cur_obj->objname, - cur_obj->objfd); - } -#endif - - /* call create_func for client data if we saw new probes */ - if (saw_new_probes && hndl->create_func) { - for (cur_obj = hndl->objlist; cur_obj; - cur_obj = cur_obj->next) { - tnfctl_probe_t *probe_handle; - - if (cur_obj->new == B_FALSE) - continue; - /* new object */ - for (j = 0; j < cur_obj->probecnt; j++) { - probe_handle = cur_obj->probes[j].probe_handle; - probe_handle->client_registered_data = - hndl->create_func(hndl, probe_handle); - } - } - } - - return (TNFCTL_ERR_NONE); -} - -/* - * _tnfctl_free_objs_and_probes() - cleans up objects and probes - */ -void -_tnfctl_free_objs_and_probes(tnfctl_handle_t *hndl) -{ - objlist_t *obj, *tmp; - - obj = hndl->objlist; - while (obj) { - free_obj_fields(obj); - tmp = obj; - obj = obj->next; - free(tmp); - } - hndl->objlist = NULL; -} - -/* - * Free members of objlist_t - */ -static void -free_obj_fields(objlist_t *obj) -{ - int i; - prbctlref_t *probe_p; - - for (i = 0; i < obj->probecnt; i++) { - probe_p = &(obj->probes[i]); - if (probe_p->attr_string) - free(probe_p->attr_string); - if (probe_p->probe_handle) - probe_p->probe_handle->valid = B_FALSE; - } - if (obj->probes) - free(obj->probes); - obj->probecnt = 0; - if (obj->objname) - free(obj->objname); - if (obj->objfd != -1) - close(obj->objfd); -} - -/* - * _tnfctl_probes_traverse() - iterate over all probes by calling the - * callback function supplied. - */ -tnfctl_errcode_t -_tnfctl_probes_traverse(tnfctl_handle_t *hndl, - _tnfctl_traverse_probe_func_t func_p, void *calldata_p) -{ - tnfctl_errcode_t prexstat; - boolean_t release_lock; - objlist_t *obj; - int j; - - /*LINTED statement has no consequent: else*/ - LOCK_SYNC(hndl, prexstat, release_lock); - - for (obj = hndl->objlist; obj; obj = obj->next) { - for (j = 0; j < obj->probecnt; j++) { - prexstat = (*func_p) (hndl, &(obj->probes[j]), - calldata_p); - if (prexstat) { - /*LINTED statement has no consequent: else*/ - UNLOCK(hndl, release_lock); - return (prexstat); - } - } - } - - /*LINTED statement has no consequent: else*/ - UNLOCK(hndl, release_lock); - - return (TNFCTL_ERR_NONE); -} - -/* - * function that is called by loadobject iterator function for every - * loadobject. If a new loadobject, add it to to our list. - */ -static int -per_loadobj(void *proc_p, const tnfctl_ind_obj_info_t *obj, void *cd) -{ - tnfctl_handle_t *hndl = cd; - objlist_t *entry_p, *cur_p, *next_p; - - if (entry_p = loadobj_find(hndl, obj)) { - /* loadobject already exists */ - entry_p->old = B_FALSE; - /* no need to close the objfd because iterator func will */ - - /* successful return */ - return (0); - } - - /* add new loadobject */ - entry_p = calloc(1, sizeof (objlist_t)); - - entry_p->old = B_FALSE; - entry_p->new = B_TRUE; - entry_p->new_probe = B_TRUE; - entry_p->objname = strdup(obj->objname); - if (entry_p->objname == NULL) - return (1); - entry_p->baseaddr = obj->text_base; - /* may have to actually open the fd */ - if (obj->objfd == -1) { - entry_p->objfd = open(obj->objname, O_RDONLY); - if (entry_p->objfd == -1) - return (1); - } else { - /* dup the fd because iterator function will close it */ - entry_p->objfd = dup(obj->objfd); - if (entry_p->objfd == -1) - return (1); - } - - entry_p->min_probe_num = 0; - entry_p->probecnt = 0; - entry_p->probes = NULL; - entry_p->next = NULL; - - if (hndl->objlist == NULL) { - hndl->objlist = entry_p; - } else { - /* add to end of list */ - next_p = hndl->objlist; - while (next_p) { - cur_p = next_p; - next_p = next_p->next; - } - /* cur_p now points to last element on list */ - cur_p->next = entry_p; - } - - return (0); -} - -/* - * check if this loadobject already exists in our linked list. - */ -static objlist_t * -loadobj_find(tnfctl_handle_t *hndl, const tnfctl_ind_obj_info_t *this_obj) -{ - objlist_t *obj; - - for (obj = hndl->objlist; obj; obj = obj->next) { - if (obj->baseaddr == this_obj->text_base) - return (obj); - } - return (NULL); -} - -/* - * find the number of probes in a loadobject - */ -static tnfctl_errcode_t -get_num_probes(tnfctl_handle_t *hndl, objlist_t *obj, int *num_probes) -{ - tnfctl_errcode_t prexstat; - link_args_t largs; - tnfctl_elf_search_t search_info; - - DBG_TNF_PROBE_0(get_num_probes_1, "libtnfctl", "sunw%verbosity 1"); - - largs.la_probename = PROBE_SYMBOL; - largs.ret_val = 0; - - search_info.section_func = _tnfctl_traverse_rela; - search_info.record_func = count_probes; - search_info.record_data = &largs; - - prexstat = _tnfctl_traverse_object(obj->objfd, obj->baseaddr, - &search_info); - if (prexstat) - return (prexstat); - - DBG_TNF_PROBE_2(get_num_probes_2, "libtnfctl", "sunw%verbosity 1", - tnf_long, num_probes, largs.ret_val, - tnf_string, obj_name, obj->objname); - - *num_probes = largs.ret_val; - return (TNFCTL_ERR_NONE); -} - -/* - * discover all probes in a loadobject and read it into our array. - */ -static tnfctl_errcode_t -read_probes_in_obj(tnfctl_handle_t *hndl, objlist_t *obj, ulong_t num_probes, - ulong_t probe_base_num) -{ - tnfctl_errcode_t prexstat; - link_args2_t largs2; - tnfctl_elf_search_t search_info; - - DBG_TNF_PROBE_0(read_probes_in_obj_1, "libtnfctl", "sunw%verbosity 2"); - - largs2.la_hndl = hndl; - largs2.la_probename = PROBE_SYMBOL; - largs2.la_obj = obj; - largs2.la_index = 0; - largs2.la_base = probe_base_num; - - search_info.section_func = _tnfctl_traverse_rela; - search_info.record_func = read_a_probe; - search_info.record_data = &largs2; - - prexstat = _tnfctl_traverse_object(obj->objfd, obj->baseaddr, - &search_info); - if (prexstat) - return (prexstat); - - return (TNFCTL_ERR_NONE); -} - -/* - * checks if this relocation entry is a probe and if so, - * increments a counter for every probe seen - */ -/*ARGSUSED*/ -static tnfctl_errcode_t -count_probes(char *name, uintptr_t addr, void *rel_entry, - tnfctl_elf_search_t * search_info_p) -{ - link_args_t *largs_p = (link_args_t *) search_info_p->record_data; - - if (strcmp(name, largs_p->la_probename) == 0) { - largs_p->ret_val++; - } - return (TNFCTL_ERR_NONE); -} - -/* - * checks if this relocation entry is a probe and if so, reads in info - * on this probe - */ -/*ARGSUSED*/ -static tnfctl_errcode_t -read_a_probe(char *name, uintptr_t addr, void *rel_entry, - tnfctl_elf_search_t * search_info_p) -{ - link_args2_t *largs2_p = (link_args2_t *) search_info_p->record_data; - ulong_t index = largs2_p->la_index; - prbctlref_t *prbctl_p; - tnfctl_handle_t *hndl = largs2_p->la_hndl; - tnfctl_errcode_t prexstat; - int miscstat; - uintptr_t attrs; - - assert((hndl->mode == INTERNAL_MODE) ? - (MUTEX_HELD(&_tnfctl_lmap_lock)) : 1); - - if (strcmp(name, largs2_p->la_probename) != 0) - return (TNFCTL_ERR_NONE); - - /* found a probe */ - prbctl_p = &(largs2_p->la_obj->probes[index]); - prbctl_p->addr = addr; - prbctl_p->probe_id = largs2_p->la_base + index; - prbctl_p->obj = largs2_p->la_obj; - largs2_p->la_index++; - - /* read in probe structure */ - miscstat = hndl->p_read(hndl->proc_p, addr, - &prbctl_p->wrkprbctl, sizeof (prbctl_p->wrkprbctl)); - if (miscstat) { - DBG((void) fprintf(stderr, - "read_a_probe: read from target failed: %d\n", - miscstat)); - return (TNFCTL_ERR_INTERNAL); - } - - /* - * dereference the attrs (read it into our address space only for - * working copy) - */ - attrs = (uintptr_t) prbctl_p->wrkprbctl.attrs; - prexstat = _tnfctl_readstr_targ(hndl, attrs, &prbctl_p->attr_string); - if (prexstat) { - DBG((void) fprintf(stderr, - "read_a_probe: _tnfctl_readstr_targ (attrs) failed: %s\n", - tnfctl_strerror(prexstat))); - return (prexstat); - } - - DBG_TNF_PROBE_1(read_a_probe_2, "libtnfctl", - "sunw%verbosity 1; sunw%debug 'found a probe'", - tnf_string, probe, prbctl_p->attr_string); - - /* create probe handle */ - prbctl_p->probe_handle = calloc(1, sizeof (tnfctl_probe_t)); - if (prbctl_p->probe_handle == NULL) - return (TNFCTL_ERR_ALLOCFAIL); - prbctl_p->probe_handle->valid = B_TRUE; - prbctl_p->probe_handle->probe_p = prbctl_p; - /* link in probe handle into chain off tnfctl_handle_t */ - prbctl_p->probe_handle->next = hndl->probe_handle_list_head; - hndl->probe_handle_list_head = prbctl_p->probe_handle; - - /* - * if this is a "virgin" probe, set up probe to initial state - * REMIND: Could defer this target write till we link the probes - * together in target process in link_targ_obj_probes() i.e. - * do the "write" only once. - */ - if (prbctl_p->wrkprbctl.commit_func == NULL) { - prbctl_p->wrkprbctl.probe_func = - (tnf_probe_func_t) hndl->endfunc; - prbctl_p->wrkprbctl.commit_func = - (tnf_probe_func_t) hndl->commitfunc; - prbctl_p->wrkprbctl.alloc_func = - (tnf_probe_alloc_func_t) hndl->allocfunc; - /* - * update the probe in target to its initial state - * Since the probe is disabled, it is ok to write it one - * write command as opposed to updating each word individually - */ - miscstat = hndl->p_write(hndl->proc_p, addr, - &prbctl_p->wrkprbctl, sizeof (prbctl_p->wrkprbctl)); - if (miscstat) - return (TNFCTL_ERR_INTERNAL); - } - - return (TNFCTL_ERR_NONE); -} - -/* - * Link all the probes in a linked list in the target image in specified - * object. Also, link probes from previous object and next object into - * this list. The only - * reason this is needed is because internally in the process, - * tnf_probe_notify() that is called from libthread walks through all - * probes substituting the test function - * REMIND: find a way that we don't have to walk through probes internally. - */ -static tnfctl_errcode_t -link_targ_obj_probes(tnfctl_handle_t *hndl, objlist_t *cur) -{ - int i; - prbctlref_t *probe_p; - tnf_probe_control_t *next_probe; - int miscstat; - objlist_t *cur_tmp, *prev_w_probes, *next_w_probes; - uintptr_t next_addr; - - /* find previous object that has probes */ - prev_w_probes = NULL; - cur_tmp = hndl->objlist; - while (cur_tmp != cur) { - if (cur_tmp->probecnt != 0) - prev_w_probes = cur_tmp; - cur_tmp = cur_tmp->next; - } - - /* find next object with probes */ - next_w_probes = NULL; - cur_tmp = cur->next; - while (cur_tmp != NULL) { - if (cur_tmp->probecnt != 0) - next_w_probes = cur_tmp; - cur_tmp = cur_tmp->next; - } - - /* link probes (except for last one) in order */ - for (i = 0; i < (cur->probecnt - 1); i++) { - probe_p = &(cur->probes[i]); - next_probe = (tnf_probe_control_t *) cur->probes[i+1].addr; - probe_p->wrkprbctl.next = next_probe; - miscstat = hndl->p_write(hndl->proc_p, probe_p->addr + - offsetof(struct tnf_probe_control, next), - &next_probe, sizeof (next_probe)); - if (miscstat) - return (TNFCTL_ERR_INTERNAL); - } - - next_probe = (tnf_probe_control_t *) cur->probes[0].addr; - if (prev_w_probes == NULL) { - /* adding as first object in list */ - next_addr = hndl->probelist_head; - } else { - probe_p = &(prev_w_probes->probes[prev_w_probes->probecnt - 1]); - probe_p->wrkprbctl.next = next_probe; - next_addr = probe_p->addr + - offsetof(struct tnf_probe_control, next); - } - - /* point next_addr to first probe in this object */ - miscstat = hndl->p_write(hndl->proc_p, next_addr, - &next_probe, sizeof (next_probe)); - if (miscstat) - return (TNFCTL_ERR_INTERNAL); - - /* link last probe in object */ - if (next_w_probes == NULL) - next_probe = NULL; - else { - next_probe = (tnf_probe_control_t *) - next_w_probes->probes[0].addr; - } - probe_p = &(cur->probes[cur->probecnt - 1]); - probe_p->wrkprbctl.next = next_probe; - miscstat = hndl->p_write(hndl->proc_p, probe_p->addr + - offsetof(struct tnf_probe_control, next), - &next_probe, sizeof (next_probe)); - if (miscstat) - return (TNFCTL_ERR_INTERNAL); - return (TNFCTL_ERR_NONE); -} - -/* - * An object has been closed. Stitch probes around this object in - * target image. - */ -static tnfctl_errcode_t -unlink_targ_obj_probes(tnfctl_handle_t *hndl, objlist_t *cur) -{ - prbctlref_t *probe_p; - tnf_probe_control_t *next_probe; - int miscstat; - objlist_t *cur_tmp, *prev_w_probes, *next_w_probes; - uintptr_t next_addr; - - /* find previous object that has probes */ - prev_w_probes = NULL; - cur_tmp = hndl->objlist; - while (cur_tmp != cur) { - if (cur_tmp->probecnt != 0) - prev_w_probes = cur_tmp; - cur_tmp = cur_tmp->next; - } - - /* find next object with probes */ - next_w_probes = NULL; - cur_tmp = cur->next; - while (cur_tmp != NULL) { - if (cur_tmp->probecnt != 0) - next_w_probes = cur_tmp; - cur_tmp = cur_tmp->next; - } - - if (next_w_probes == NULL) - next_probe = NULL; - else { - next_probe = (tnf_probe_control_t *) - next_w_probes->probes[0].addr; - } - - if (prev_w_probes == NULL) { - /* removing first object in list */ - next_addr = hndl->probelist_head; - } else { - probe_p = &(prev_w_probes->probes[prev_w_probes->probecnt - 1]); - probe_p->wrkprbctl.next = next_probe; - next_addr = probe_p->addr + - offsetof(struct tnf_probe_control, next); - } - - /* point next_addr to next_probe */ - miscstat = hndl->p_write(hndl->proc_p, next_addr, - &next_probe, sizeof (next_probe)); - if (miscstat) - return (TNFCTL_ERR_INTERNAL); - return (TNFCTL_ERR_NONE); -} - -/* - * _tnfctl_flush_a_probe() - write a changed probe into the target process' - * address space. - */ -tnfctl_errcode_t -_tnfctl_flush_a_probe(tnfctl_handle_t *hndl, prbctlref_t *ref_p, size_t offset, - size_t size) -{ - tnfctl_errcode_t prexstat; - int miscstat; - - /* - * For internal control: - * There is *no race* for finding the test function (between the time - * we call find_test_func() and the time we assign it to a probe), - * because tnfctl_internal_open() cannot be called from an init section - * (look at man page of tnfctl_internal_open()). And, after the init - * section of libthread has run, we will always use the MT test - * function. - */ - - if (hndl->mode == KERNEL_MODE) { - prexstat = _tnfctl_prbk_flush(hndl, ref_p); - if (prexstat) - return (prexstat); - } else { - miscstat = hndl->p_write(hndl->proc_p, - ref_p->addr + offset, - ((char *)&(ref_p->wrkprbctl)) + offset, size); - if (miscstat) - return (TNFCTL_ERR_INTERNAL); - } - - return (TNFCTL_ERR_NONE); -} diff --git a/usr/src/lib/libtnfctl/probes_ext.c b/usr/src/lib/libtnfctl/probes_ext.c deleted file mode 100644 index 5c4aed1430..0000000000 --- a/usr/src/lib/libtnfctl/probes_ext.c +++ /dev/null @@ -1,457 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -/* - * Published interfaces for probe control. - */ - -#ifndef DEBUG -#define NDEBUG 1 -#endif - -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <string.h> -#include <assert.h> -#include <stddef.h> - -#include "tnfctl_int.h" -#include "kernel_int.h" -#include "dbg.h" - -struct pr_func_args { - tnfctl_probe_op_t func_p; - void *calldata; -}; - -tnfctl_errcode_t _tnfctl_destructor_wrapper(tnfctl_handle_t *, - prbctlref_t *, void *); -tnfctl_errcode_t _tnfctl_creator_wrapper(tnfctl_handle_t *, - prbctlref_t *, void *); -static tnfctl_errcode_t apply_func(tnfctl_handle_t *, prbctlref_t *, void *); -static tnfctl_errcode_t check_operation(tnfctl_handle_t *, tnfctl_probe_t *); - -tnfctl_errcode_t -tnfctl_register_funcs(tnfctl_handle_t *hndl, - void *(*create_func)(tnfctl_handle_t *, tnfctl_probe_t *), - void (*destroy_func)(void *)) -{ - tnfctl_errcode_t prexstat; - - if (hndl->destroy_func) { - /* - * not the first time the register_funcs() is being called - * First call currently registered destroy_func on all - * probes - */ - prexstat = _tnfctl_probes_traverse(hndl, - _tnfctl_destructor_wrapper, NULL); - if (prexstat) - return (prexstat); - } - - /* set up new creator and destructor functions */ - hndl->create_func = create_func; - hndl->destroy_func = destroy_func; - - /* call new creator function for all current probes */ - if (create_func) { - prexstat = _tnfctl_probes_traverse(hndl, - _tnfctl_creator_wrapper, NULL); - if (prexstat) - return (prexstat); - } - - return (TNFCTL_ERR_NONE); -} - -tnfctl_errcode_t -_tnfctl_destructor_wrapper(tnfctl_handle_t *hndl, prbctlref_t *probe, void *cd) -{ - assert(hndl->destroy_func); - hndl->destroy_func(probe->probe_handle->client_registered_data); - - return (TNFCTL_ERR_NONE); -} - -tnfctl_errcode_t -_tnfctl_creator_wrapper(tnfctl_handle_t *hndl, prbctlref_t *probe, void *cd) -{ - tnfctl_probe_t *p_handle; - - assert(hndl->create_func); - p_handle = probe->probe_handle; - p_handle->client_registered_data = hndl->create_func(hndl, p_handle); - - return (TNFCTL_ERR_NONE); -} - -tnfctl_errcode_t -tnfctl_probe_apply(tnfctl_handle_t *hndl, tnfctl_probe_op_t func_p, - void *calldata) -{ - struct pr_func_args pr_args; - tnfctl_errcode_t prexstat; - - pr_args.func_p = func_p; - pr_args.calldata = calldata; - prexstat = _tnfctl_probes_traverse(hndl, apply_func, &pr_args); - return (prexstat); -} - -tnfctl_errcode_t -tnfctl_probe_apply_ids(tnfctl_handle_t *hndl, ulong_t probe_count, - ulong_t *probe_ids, tnfctl_probe_op_t func_p, - void *calldata) -{ - ulong_t *id_p; - ulong_t i, pos; - objlist_t *obj_p; - prbctlref_t *probe; - tnfctl_errcode_t prexstat = TNFCTL_ERR_NONE; - boolean_t release_lock; - - /*LINTED statement has no consequent: else*/ - LOCK_SYNC(hndl, prexstat, release_lock); - - /* select probes based on numbers */ - id_p = probe_ids; - for (i = 0; i < probe_count; i++, id_p++) { - obj_p = hndl->objlist; - while (obj_p) { - if ((*id_p >= obj_p->min_probe_num) && - (*id_p < (obj_p->min_probe_num + - obj_p->probecnt))) { - break; - } - obj_p = obj_p->next; - } - if (obj_p == NULL) { - prexstat = TNFCTL_ERR_INVALIDPROBE; - goto end_of_func; - } - pos = *id_p - obj_p->min_probe_num; - probe = &(obj_p->probes[pos]); - prexstat = func_p(hndl, probe->probe_handle, calldata); - if (prexstat) - goto end_of_func; - } - -end_of_func: - /*LINTED statement has no consequent: else*/ - UNLOCK(hndl, release_lock); - return (prexstat); -} - -tnfctl_errcode_t -tnfctl_probe_state_get(tnfctl_handle_t *hndl, tnfctl_probe_t *probe_hndl, - tnfctl_probe_state_t *state_p) -{ - tnf_probe_control_t *prbctl_p; - boolean_t release_lock; - tnfctl_errcode_t prexstat = TNFCTL_ERR_NONE; - char **func_names; - uintptr_t *func_addrs; - - if (hndl->mode == KERNEL_MODE) { - prexstat = _tnfctl_refresh_kernel(hndl); - if (prexstat) - return (prexstat); - } - - /*LINTED statement has no consequent: else*/ - LOCK_SYNC(hndl, prexstat, release_lock); - - if (probe_hndl->valid == B_FALSE) { - prexstat = TNFCTL_ERR_INVALIDPROBE; - goto end_of_func; - } - - state_p->id = probe_hndl->probe_p->probe_id; - state_p->attr_string = probe_hndl->probe_p->attr_string; - - prbctl_p = &probe_hndl->probe_p->wrkprbctl; - state_p->enabled = (prbctl_p->test_func) ? B_TRUE : B_FALSE; - state_p->traced = (prbctl_p->commit_func == - (tnf_probe_func_t) hndl->commitfunc) ? B_TRUE : B_FALSE; - state_p->new_probe = probe_hndl->probe_p->obj->new_probe; - state_p->obj_name = probe_hndl->probe_p->obj->objname; - state_p->client_registered_data = probe_hndl->client_registered_data; - - if (hndl->mode == KERNEL_MODE) { - state_p->func_names = NULL; - state_p->func_addrs = NULL; - /* skip code upto label */ - goto end_of_func; - } - - /* process mode - get the probe functions */ - prexstat = _tnfctl_comb_decode(hndl, (uintptr_t) prbctl_p->probe_func, - &func_names, &func_addrs); - if (prexstat) - goto end_of_func; - - /* if there are any probe functions */ - if (func_names[0] != NULL) { - state_p->func_names = (const char * const *) func_names; - state_p->func_addrs = func_addrs; - } else { - state_p->func_names = NULL; - state_p->func_addrs = NULL; - } - -end_of_func: - /*LINTED statement has no consequent: else*/ - UNLOCK(hndl, release_lock); - return (prexstat); -} - -static tnfctl_errcode_t -check_operation(tnfctl_handle_t *hndl, tnfctl_probe_t *probe_hndl) -{ - tnfctl_errcode_t prexstat; - - if (hndl->mode == KERNEL_MODE) { - prexstat = _tnfctl_refresh_kernel(hndl); - if (prexstat) - return (prexstat); - } else if (hndl->trace_buf_state == TNFCTL_BUF_NONE) { - /* process tracing */ - return (TNFCTL_ERR_NOBUF); - } - - if (hndl->trace_buf_state == TNFCTL_BUF_BROKEN) - return (TNFCTL_ERR_BUFBROKEN); - - if (probe_hndl->valid == B_FALSE) { - return (TNFCTL_ERR_INVALIDPROBE); - } - - return (TNFCTL_ERR_NONE); -} - -tnfctl_errcode_t -tnfctl_probe_enable(tnfctl_handle_t *hndl, tnfctl_probe_t *probe_hndl, void *cd) -{ - tnf_probe_control_t *prbctl_p; - boolean_t release_lock; - tnfctl_errcode_t prexstat; - - /*LINTED statement has no consequent: else*/ - LOCK_SYNC(hndl, prexstat, release_lock); - - prexstat = check_operation(hndl, probe_hndl); - if (prexstat) - goto end_of_func; - - prbctl_p = &probe_hndl->probe_p->wrkprbctl; - prbctl_p->test_func = (tnf_probe_test_func_t) hndl->testfunc; - prexstat = _tnfctl_flush_a_probe(hndl, probe_hndl->probe_p, - offsetof(struct tnf_probe_control, test_func), - sizeof (tnf_probe_test_func_t)); -end_of_func: - /*LINTED statement has no consequent: else*/ - UNLOCK(hndl, release_lock); - return (prexstat); -} - -tnfctl_errcode_t -tnfctl_probe_disable(tnfctl_handle_t *hndl, tnfctl_probe_t *probe_hndl, - void *cd) -{ - tnf_probe_control_t *prbctl_p; - boolean_t release_lock; - tnfctl_errcode_t prexstat; - - /*LINTED statement has no consequent: else*/ - LOCK_SYNC(hndl, prexstat, release_lock); - - prexstat = check_operation(hndl, probe_hndl); - if (prexstat) - goto end_of_func; - - prbctl_p = &probe_hndl->probe_p->wrkprbctl; - prbctl_p->test_func = (tnf_probe_test_func_t) NULL; - prexstat = _tnfctl_flush_a_probe(hndl, probe_hndl->probe_p, - offsetof(struct tnf_probe_control, test_func), - sizeof (tnf_probe_test_func_t)); -end_of_func: - /*LINTED statement has no consequent: else*/ - UNLOCK(hndl, release_lock); - return (prexstat); -} - -tnfctl_errcode_t -tnfctl_probe_trace(tnfctl_handle_t *hndl, tnfctl_probe_t *probe_hndl, void *cd) -{ - tnf_probe_control_t *prbctl_p; - boolean_t release_lock; - tnfctl_errcode_t prexstat; - - /*LINTED statement has no consequent: else*/ - LOCK_SYNC(hndl, prexstat, release_lock); - - prexstat = check_operation(hndl, probe_hndl); - if (prexstat) - goto end_of_func; - - prbctl_p = &probe_hndl->probe_p->wrkprbctl; - prbctl_p->commit_func = (tnf_probe_func_t) hndl->commitfunc; - prexstat = _tnfctl_flush_a_probe(hndl, probe_hndl->probe_p, - offsetof(struct tnf_probe_control, commit_func), - sizeof (tnf_probe_func_t)); - -end_of_func: - /*LINTED statement has no consequent: else*/ - UNLOCK(hndl, release_lock); - return (prexstat); -} - -tnfctl_errcode_t -tnfctl_probe_untrace(tnfctl_handle_t *hndl, tnfctl_probe_t *probe_hndl, - void *cd) -{ - tnf_probe_control_t *prbctl_p; - boolean_t release_lock; - tnfctl_errcode_t prexstat; - - /*LINTED statement has no consequent: else*/ - LOCK_SYNC(hndl, prexstat, release_lock); - - prexstat = check_operation(hndl, probe_hndl); - if (prexstat) - goto end_of_func; - - prbctl_p = &probe_hndl->probe_p->wrkprbctl; - prbctl_p->commit_func = (tnf_probe_func_t) hndl->rollbackfunc; - prexstat = _tnfctl_flush_a_probe(hndl, probe_hndl->probe_p, - offsetof(struct tnf_probe_control, commit_func), - sizeof (tnf_probe_func_t)); - -end_of_func: - /*LINTED statement has no consequent: else*/ - UNLOCK(hndl, release_lock); - return (prexstat); -} - -tnfctl_errcode_t -tnfctl_probe_connect(tnfctl_handle_t *hndl, tnfctl_probe_t *probe_hndl, - const char *lib_base_name, const char *func) -{ - tnf_probe_control_t *prbctl_p; - boolean_t release_lock; - tnfctl_errcode_t prexstat; - uintptr_t func_addr; - uintptr_t comb; - - if (hndl->mode == KERNEL_MODE) - return (TNFCTL_ERR_BADARG); - - /*LINTED statement has no consequent: else*/ - LOCK_SYNC(hndl, prexstat, release_lock); - - prexstat = check_operation(hndl, probe_hndl); - if (prexstat) - goto end_of_func; - - if (func == NULL) { - prexstat = TNFCTL_ERR_NONE; - goto end_of_func; - } - - if (lib_base_name) { - prexstat = _tnfctl_sym_obj_find(hndl, lib_base_name, func, - &func_addr); - } else { - prexstat = _tnfctl_sym_find(hndl, func, &func_addr); - } - /* check if function address was found */ - if (prexstat) - goto end_of_func; - - prbctl_p = &probe_hndl->probe_p->wrkprbctl; - prexstat = _tnfctl_comb_build(hndl, PRB_COMB_CHAIN, - func_addr, (uintptr_t) prbctl_p->probe_func, - &comb); - if (prexstat) - goto end_of_func; - prbctl_p->probe_func = (tnf_probe_func_t) comb; - prexstat = _tnfctl_flush_a_probe(hndl, probe_hndl->probe_p, - offsetof(struct tnf_probe_control, probe_func), - sizeof (tnf_probe_func_t)); - -end_of_func: - /*LINTED statement has no consequent: else*/ - UNLOCK(hndl, release_lock); - return (prexstat); -} - -tnfctl_errcode_t -tnfctl_probe_disconnect_all(tnfctl_handle_t *hndl, tnfctl_probe_t *probe_hndl, - void *cd) -{ - tnf_probe_control_t *prbctl_p; - boolean_t release_lock; - tnfctl_errcode_t prexstat; - - if (hndl->mode == KERNEL_MODE) - return (TNFCTL_ERR_BADARG); - - /*LINTED statement has no consequent: else*/ - LOCK_SYNC(hndl, prexstat, release_lock); - - prexstat = check_operation(hndl, probe_hndl); - if (prexstat) - goto end_of_func; - - prbctl_p = &probe_hndl->probe_p->wrkprbctl; - prbctl_p->probe_func = (tnf_probe_func_t) hndl->endfunc; - prexstat = _tnfctl_flush_a_probe(hndl, probe_hndl->probe_p, - offsetof(struct tnf_probe_control, probe_func), - sizeof (tnf_probe_func_t)); - -end_of_func: - /*LINTED statement has no consequent: else*/ - UNLOCK(hndl, release_lock); - return (prexstat); -} - -/* - * Important that this function be tail recursive to minimize depth - * of call chain that is called for every probe - */ -static tnfctl_errcode_t -apply_func(tnfctl_handle_t *hndl, prbctlref_t *probe, void *cd) -{ - struct pr_func_args *args = cd; - tnfctl_errcode_t prexstat; - - /* Call function only if match_func returns true */ - prexstat = (*(args->func_p))(hndl, probe->probe_handle, args->calldata); - return (prexstat); -} diff --git a/usr/src/lib/libtnfctl/sparc/Makefile b/usr/src/lib/libtnfctl/sparc/Makefile deleted file mode 100644 index 50dd2a7dd7..0000000000 --- a/usr/src/lib/libtnfctl/sparc/Makefile +++ /dev/null @@ -1,32 +0,0 @@ -# -# 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 2006 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# -# ident "%Z%%M% %I% %E% SMI" -# - -include ../Makefile.com - -.KEEP_STATE: - -install: all $(ROOTLIBS) $(ROOTLINKS) diff --git a/usr/src/lib/libtnfctl/sparc_assm.s b/usr/src/lib/libtnfctl/sparc_assm.s deleted file mode 100644 index 727fce6d71..0000000000 --- a/usr/src/lib/libtnfctl/sparc_assm.s +++ /dev/null @@ -1,56 +0,0 @@ -! -! Copyright 2005 Sun Microsystems, Inc. All rights reserved. -! Use is subject to license terms. -! -! 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 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 -! - - .file "sparc_assm.s" - .section ".data" - .align 4 - .global prb_callinfo -prb_callinfo: - .word 0 ! offset - .word 2 ! shift right - .word 0x3fffffff ! mask - - .section ".text" - .align 4 - .global prb_chain_entry - .global prb_chain_down - .global prb_chain_next - .global prb_chain_end - .local chain_down - .local chain_next -prb_chain_entry: - save %sp, -80, %sp - or %i0, %g0, %o0 - or %i1, %g0, %o1 -prb_chain_down: -chain_down: - call chain_down - or %i2, %g0, %o2 -prb_chain_next: -chain_next: - call chain_next - restore %g0, %g0, %g0 -prb_chain_end: - nop diff --git a/usr/src/lib/libtnfctl/sparcv9/Makefile b/usr/src/lib/libtnfctl/sparcv9/Makefile deleted file mode 100644 index 3f238e6cae..0000000000 --- a/usr/src/lib/libtnfctl/sparcv9/Makefile +++ /dev/null @@ -1,33 +0,0 @@ -# -# 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 2006 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# -# ident "%Z%%M% %I% %E% SMI" -# - -include ../Makefile.com -include ../../Makefile.lib.64 - -.KEEP_STATE: - -install: all $(ROOTLIBS64) $(ROOTLINKS64) diff --git a/usr/src/lib/libtnfctl/status.c b/usr/src/lib/libtnfctl/status.c deleted file mode 100644 index 4d20c389cb..0000000000 --- a/usr/src/lib/libtnfctl/status.c +++ /dev/null @@ -1,153 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -/* - * Error code manipulation routines - */ - -#include <string.h> -#include <libintl.h> -#include <errno.h> - -#include "tnfctl_int.h" -#include "dbg.h" - -#if !defined(TEXT_DOMAIN) -#define TEXT_DOMAIN "SYS_TEST" -#endif - - -/* - * tnfctl_strerror() - this routine returns a pointer to a static string - * describing the error argument. - */ -const char * -tnfctl_strerror(tnfctl_errcode_t prexstat) -{ - switch (prexstat) { - case TNFCTL_ERR_NONE: - return (dgettext(TEXT_DOMAIN, "Success")); - case TNFCTL_ERR_ACCES: - return (dgettext(TEXT_DOMAIN, "Permission denied")); - case TNFCTL_ERR_NOTARGET: - return (dgettext(TEXT_DOMAIN, "Target process finished")); - case TNFCTL_ERR_ALLOCFAIL: - return (dgettext(TEXT_DOMAIN, "Memory allocation failed")); - case TNFCTL_ERR_INTERNAL: - return (dgettext(TEXT_DOMAIN, "Internal error")); - case TNFCTL_ERR_SIZETOOSMALL: - return (dgettext(TEXT_DOMAIN, "Requested size too small")); - case TNFCTL_ERR_SIZETOOBIG: - return (dgettext(TEXT_DOMAIN, "Requested size too big")); - case TNFCTL_ERR_BADARG: - return (dgettext(TEXT_DOMAIN, "Bad input argument")); - case TNFCTL_ERR_NOTDYNAMIC: - return (dgettext(TEXT_DOMAIN, "Not a dynamic executable")); - case TNFCTL_ERR_NOLIBTNFPROBE: - return (dgettext(TEXT_DOMAIN, - "No libtnfprobe linked in target")); - case TNFCTL_ERR_BUFEXISTS: - return (dgettext(TEXT_DOMAIN, "Buffer already exists")); - case TNFCTL_ERR_NOBUF: - return (dgettext(TEXT_DOMAIN, "No buffer exists")); - case TNFCTL_ERR_BADDEALLOC: - return (dgettext(TEXT_DOMAIN, "Can't deallocate buffer when " - "tracing is active")); - case TNFCTL_ERR_NOPROCESS: - return (dgettext(TEXT_DOMAIN, "Process not found")); - case TNFCTL_ERR_FILENOTFOUND: - return (dgettext(TEXT_DOMAIN, "No such file")); - case TNFCTL_ERR_BUSY: - return (dgettext(TEXT_DOMAIN, - "Device busy - kernel or process already tracing")); - case TNFCTL_ERR_INVALIDPROBE: - return (dgettext(TEXT_DOMAIN, "Invalid probe specified")); - case TNFCTL_ERR_USR1: - return (dgettext(TEXT_DOMAIN, "User error 1")); - case TNFCTL_ERR_USR2: - return (dgettext(TEXT_DOMAIN, "User error 2")); - case TNFCTL_ERR_USR3: - return (dgettext(TEXT_DOMAIN, "User error 3")); - case TNFCTL_ERR_USR4: - return (dgettext(TEXT_DOMAIN, "User error 4")); - case TNFCTL_ERR_USR5: - return (dgettext(TEXT_DOMAIN, "User error 5")); - default: - return (dgettext(TEXT_DOMAIN, - "Unknown libtnfctl.so error code")); - } -} - -/* - * prb_map_to_errocde() - this routine returns maps an internal error code - * to a tnfctl_errcode_t - */ -tnfctl_errcode_t -_tnfctl_map_to_errcode(prb_status_t prbstat) -{ - tnfctl_errcode_t err = TNFCTL_ERR_INTERNAL; - - if (prbstat >= PRB_STATUS_MINERRNO && - prbstat <= PRB_STATUS_MAXERRNO) { - if (prbstat == ENOENT) - err = TNFCTL_ERR_FILENOTFOUND; - else if (prbstat == ESRCH) - err = TNFCTL_ERR_NOPROCESS; - else if (prbstat == EACCES) - err = TNFCTL_ERR_ACCES; - else if (prbstat == EBUSY) - err = TNFCTL_ERR_BUSY; - } else { - if (prbstat == PRB_STATUS_OK) - err = TNFCTL_ERR_NONE; - else if (prbstat == PRB_STATUS_ALLOCFAIL) - err = TNFCTL_ERR_ALLOCFAIL; - } - - return (err); -} - -/* - * tnfctl_status_map() - this routine converts an errno value into a - * tnfctl_errcode_t - */ -tnfctl_errcode_t -tnfctl_status_map(int val) -{ - tnfctl_errcode_t err = TNFCTL_ERR_INTERNAL; - - if (val == ENOENT) - err = TNFCTL_ERR_FILENOTFOUND; - else if (val == ESRCH) - err = TNFCTL_ERR_NOPROCESS; - else if (val == EACCES) - err = TNFCTL_ERR_ACCES; - else if (val == EBUSY) - err = TNFCTL_ERR_BUSY; - - return (err); -} diff --git a/usr/src/lib/libtnfctl/sym.c b/usr/src/lib/libtnfctl/sym.c deleted file mode 100644 index 82730e9f51..0000000000 --- a/usr/src/lib/libtnfctl/sym.c +++ /dev/null @@ -1,368 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -/* - * Routines that - * - return an address for a symbol name - * - return a symbol name for an address - */ - -#ifndef DEBUG -#define NDEBUG 1 -#endif - -#include <stdlib.h> -#include <unistd.h> -#include <string.h> -#include <errno.h> -#include <sys/procfs.h> -#include <sys/stat.h> -#include <assert.h> - -#include "tnfctl_int.h" -#include "dbg.h" - - -/* - * Typedefs - */ - -typedef struct sym_args { - char *sa_name; - uintptr_t sa_addr; -} sym_args_t; - -/* - * Declarations - */ - -static tnfctl_errcode_t sym_findname_in_obj(int objfd, uintptr_t baseaddr, - uintptr_t symaddr, char **symname); - -static tnfctl_errcode_t sym_match(char *name, uintptr_t addr, void *sym_entry, - tnfctl_elf_search_t *search_info_p); - -static tnfctl_errcode_t sym_matchname(char *name, uintptr_t addr, - void *sym_entry, - tnfctl_elf_search_t *search_info_p); - - -/* ---------------------------------------------------------------- */ -/* ----------------------- Public Functions ----------------------- */ -/* ---------------------------------------------------------------- */ - -/* - * _tnfctl_sym_find_in_obj() - determines the virtual address of the supplied - * symbol in the object file specified by fd. - */ -tnfctl_errcode_t -_tnfctl_sym_find_in_obj(int objfd, uintptr_t baseaddr, const char *symname, - uintptr_t *symaddr) -{ - tnfctl_errcode_t prexstat = TNFCTL_ERR_NONE; - sym_args_t symargs; - tnfctl_elf_search_t search_info; - - DBG_TNF_PROBE_1(_tnfctl_sym_find_in_obj_1, "libtnfctl", - "sunw%verbosity 3", - tnf_string, searching_for, symname); - - symargs.sa_name = (char *) symname; - /* clear output argument in advance */ - symargs.sa_addr = 0; - - search_info.section_func = _tnfctl_traverse_dynsym; - search_info.record_func = sym_match; - search_info.record_data = &symargs; - - prexstat = _tnfctl_traverse_object(objfd, baseaddr, &search_info); - if (prexstat) - return (prexstat); - - /* check if we found symbol address */ - if (symargs.sa_addr == 0) { - return (TNFCTL_ERR_BADARG); - } - - *symaddr = symargs.sa_addr; - return (TNFCTL_ERR_NONE); -} - - -/* - * _tnfctl_sym_find() - determines the virtual address of the supplied symbol - * in the process. - */ -tnfctl_errcode_t -_tnfctl_sym_find(tnfctl_handle_t *hndl, const char *symname, uintptr_t *symaddr) -{ - boolean_t release_lock; - tnfctl_errcode_t prexstat = TNFCTL_ERR_NONE; - objlist_t *obj; - - DBG_TNF_PROBE_1(_tnfctl_sym_find_start, "libtnfctl", - "start _tnfctl_sym_find; sunw%verbosity 3", - tnf_string, searching_for, symname); - - /*LINTED statement has no consequent: else*/ - LOCK(hndl, prexstat, release_lock); - - /* for every object in list, search for symbol */ - for (obj = hndl->objlist; obj; obj = obj->next) { - if (obj->old == B_TRUE) - continue; /* don't examine dlclose'd libs */ - - /* return value of TNFCTL_ERR_BADARG means symbol not found */ - prexstat = _tnfctl_sym_find_in_obj(obj->objfd, - obj->baseaddr, symname, symaddr); - if (prexstat == TNFCTL_ERR_NONE) - /* symbol found */ - break; - else if (prexstat != TNFCTL_ERR_BADARG) - /* error condition */ - break; - /* continue loop on TNFCTL_ERR_BADARG */ - } - - /*LINTED statement has no consequent: else*/ - UNLOCK(hndl, release_lock); - - DBG_TNF_PROBE_0(_tnfctl_sym_find_end, "libtnfctl", - "end _tnfctl_sym_find; sunw%verbosity 3"); - - return (prexstat); -} - -/* - * _tnfctl_sym_obj_find() - determines the virtual address of the supplied - * symbol in the object specified by base name - */ -tnfctl_errcode_t -_tnfctl_sym_obj_find(tnfctl_handle_t *hndl, const char *lib_base_name, - const char *symname, uintptr_t *symaddr) -{ - tnfctl_errcode_t prexstat = TNFCTL_ERR_NONE; - objlist_t *obj, *found_obj; - const char *str_ptr; - - assert((hndl->mode == INTERNAL_MODE) ? - (MUTEX_HELD(&_tnfctl_lmap_lock)) : 1); - - DBG_TNF_PROBE_1(_tnfctl_sym_obj_find_start, "libtnfctl", - "start _tnfctl_sym_obj_find; sunw%verbosity 3", - tnf_string, searching_for, symname); - - found_obj = NULL; - /* for every object in list ... */ - for (obj = hndl->objlist; obj; obj = obj->next) { - if (obj->old == B_TRUE) - continue; /* don't examine dlclose'd libs */ - - if (obj->objname == NULL) - continue; - - /* find the last occurrence of / in the name */ - str_ptr = strrchr(obj->objname, '/'); - if (str_ptr == NULL) { - str_ptr = obj->objname; - } else { - str_ptr++; /* bump up past '/' */ - } - - /* XXX - use strcoll ? */ - if (strcmp(str_ptr, lib_base_name) == 0) { - found_obj = obj; - break; - } - } - /* return value of TNFCTL_ERR_BADARG means symbol not found */ - if (found_obj == NULL) - return (TNFCTL_ERR_BADARG); - - prexstat = _tnfctl_sym_find_in_obj(found_obj->objfd, - found_obj->baseaddr, symname, symaddr); - - DBG_TNF_PROBE_0(_tnfctl_sym_obj_find_end, "libtnfctl", - "end _tnfctl_sym_obj_find; sunw%verbosity 3"); - - return (prexstat); -} - -/* - * _tnfctl_sym_findname() - determines the name of a function from its address. - */ -tnfctl_errcode_t -_tnfctl_sym_findname(tnfctl_handle_t *hndl, uintptr_t symaddr, - char **symname) -{ - boolean_t release_lock; - tnfctl_errcode_t prexstat = TNFCTL_ERR_NONE; - objlist_t *obj; - - DBG_TNF_PROBE_1(_tnfctl_sym_findname_start, "libtnfctl", - "start _tnfctl_sym_findname; sunw%verbosity 3", - tnf_opaque, searching_for, symaddr); - - /*LINTED statement has no consequent: else*/ - LOCK(hndl, prexstat, release_lock); - - /* for every object in list, search for name */ - for (obj = hndl->objlist; obj; obj = obj->next) { - if (obj->old == B_TRUE) - continue; /* don't examine dlclose'd libs */ - /* return value of TNFCTL_ERR_BADARG means symbol not found */ - prexstat = sym_findname_in_obj(obj->objfd, - obj->baseaddr, symaddr, symname); - if (prexstat == TNFCTL_ERR_NONE) - /* symbol found */ - break; - else if (prexstat != TNFCTL_ERR_BADARG) - /* error condition */ - break; - /* continue loop on TNFCTL_ERR_BADARG */ - } - - /*LINTED statement has no consequent: else*/ - UNLOCK(hndl, release_lock); - - DBG_TNF_PROBE_0(_tnfctl_sym_findname_end, "libtnfctl", - "end _tnfctl_sym_findname; sunw%verbosity 3"); - - return (prexstat); -} - - -/* ---------------------------------------------------------------- */ -/* ----------------------- Private Functions ---------------------- */ -/* ---------------------------------------------------------------- */ - -/* - * sym_findname_in_obj() - determines the name of the supplied - * address in the specified object file. - */ -static tnfctl_errcode_t -sym_findname_in_obj(int objfd, uintptr_t baseaddr, uintptr_t symaddr, - char **symname) -{ - tnfctl_errcode_t prexstat = TNFCTL_ERR_NONE; - sym_args_t symargs; - tnfctl_elf_search_t search_info; - - DBG_TNF_PROBE_1(sym_findname_in_obj_1, "libtnfctl", - "sunw%verbosity 3", - tnf_opaque, searching_for, symaddr); - - /* clear output argument in advance */ - symargs.sa_name = NULL; - symargs.sa_addr = symaddr; - - search_info.section_func = _tnfctl_traverse_dynsym; - search_info.record_func = sym_matchname; - search_info.record_data = &symargs; - - prexstat = _tnfctl_traverse_object(objfd, baseaddr, &search_info); - if (prexstat) - return (prexstat); - - /* check if we found symbol address */ - if (symargs.sa_name == NULL) { - return (TNFCTL_ERR_BADARG); - } - - *symname = symargs.sa_name; - return (TNFCTL_ERR_NONE); -} - -/* - * sym_match() - function to be called on each symbol in a dynsym section. - * Used to find the address of a symbol. - */ -static tnfctl_errcode_t -sym_match(char *name, uintptr_t addr, void *sym_entry, - tnfctl_elf_search_t *search_info_p) -{ - sym_args_t *symargs_p = (sym_args_t *) search_info_p->record_data; - Elf3264_Sym *sym = (Elf3264_Sym *) sym_entry; -#if 0 - printf("enter sym_match: \n"); - if (symargs_p->sa_name != 0) - printf("(symargs_p->sa_name) = %s\n", symargs_p->sa_name); - else - printf("symargs_p->sa_name = 0\n"); - if (name != 0) - printf("(name) = %s\n", name); - else - printf("name = 0\n"); -#endif - -#ifdef VERYVERBOSE - (void) fprintf(stderr, "sym_match: checking \"%s\"\n", name); -#endif - - if ((sym->st_shndx != SHN_UNDEF) && - (strcmp(name, symargs_p->sa_name) == 0)) { - - DBG_TNF_PROBE_2(sym_match_1, "libtnfctl", - "sunw%verbosity 2; sunw%debug '\tMatched Symbol'", - tnf_string, symbol, name, - tnf_opaque, address_found, addr); - - symargs_p->sa_addr = addr; - } -#if 0 - printf("leaving sym_match\n"); -#endif - return (TNFCTL_ERR_NONE); -} - - -/* - * sym_matchname() - function to be called on each symbol in a dynsym - * section. Used to find the name of a symbol whose address is known. - */ -static tnfctl_errcode_t -sym_matchname(char *name, uintptr_t addr, void *sym_entry, - tnfctl_elf_search_t * search_info_p) -{ - sym_args_t *symargs_p = (sym_args_t *) search_info_p->record_data; - Elf3264_Sym *sym = (Elf3264_Sym *) sym_entry; - -#ifdef VERYVERBOSE - (void) fprintf(stderr, "sym_matchname: checking \"%s\"\n", name); -#endif - - if ((sym->st_shndx != SHN_UNDEF) && - symargs_p->sa_addr == addr) { - - DBG_TNF_PROBE_2(sym_matchname_1, "libtnfctl", - "sunw%verbosity 2; sunw%debug '\tMatched Name'", - tnf_string, symbol_found, name, - tnf_opaque, address, addr); - - symargs_p->sa_name = strdup(name); - } - - return (TNFCTL_ERR_NONE); -} diff --git a/usr/src/lib/libtnfctl/targmem.c b/usr/src/lib/libtnfctl/targmem.c deleted file mode 100644 index a3d8179938..0000000000 --- a/usr/src/lib/libtnfctl/targmem.c +++ /dev/null @@ -1,78 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -/* - * Function to allocate memory in target process (used by combinations). - */ - -#ifndef DEBUG -#define NDEBUG 1 -#endif - -#include <assert.h> -#include "tnfctl_int.h" -#include "prb_internals.h" -#include "dbg.h" - - -/* - * _tnfctl_targmem_alloc() - allocates memory in the target process. - */ -tnfctl_errcode_t -_tnfctl_targmem_alloc(tnfctl_handle_t *hndl, size_t size, uintptr_t *addr_p) -{ - int miscstat; - tnf_memseg_t memseg; - - assert(hndl->memseg_p != NULL); - *addr_p = 0; - - /* read the memseg block from the target process */ - miscstat = hndl->p_read(hndl->proc_p, hndl->memseg_p, &memseg, - sizeof (memseg)); - if (miscstat) - return (TNFCTL_ERR_INTERNAL); - - /* if there is memory left, allocate it */ - if ((memseg.min_p + memseg.i_reqsz) <= (memseg.max_p - size)) { - memseg.max_p -= size; - - miscstat = hndl->p_write(hndl->proc_p, hndl->memseg_p, - &memseg, sizeof (memseg)); - if (miscstat) - return (TNFCTL_ERR_INTERNAL); - - *addr_p = (uintptr_t) memseg.max_p; - - DBG_TNF_PROBE_2(_tnfctl_targmem_alloc_1, "libtnfctl", - "sunw%verbosity 3", - tnf_long, size_allocated, size, - tnf_opaque, at_location, *addr_p); - - return (TNFCTL_ERR_NONE); - } else { - return (TNFCTL_ERR_INTERNAL); - } -} diff --git a/usr/src/lib/libtnfctl/tnfctl.h b/usr/src/lib/libtnfctl/tnfctl.h deleted file mode 100644 index 6cc61ac737..0000000000 --- a/usr/src/lib/libtnfctl/tnfctl.h +++ /dev/null @@ -1,300 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#ifndef _TNFCTL_H -#define _TNFCTL_H - -#pragma ident "%Z%%M% %I% %E% SMI" - -#include <sys/types.h> -#include <gelf.h> - -#ifdef __cplusplus -extern "C" { -#endif - -#define TNFCTL_LIBTNFPROBE "libtnfprobe.so.1" - -/* - * data model dependent defs - */ -#if defined(_LP64) -#define ELF3264_R_SYM GELF_R_SYM -typedef GElf_Shdr Elf3264_Shdr; -typedef GElf_Dyn Elf3264_Dyn; -typedef GElf_Sword Elf3264_Sword; -typedef GElf_Sym Elf3264_Sym; -typedef GElf_Word Elf3264_Word; -typedef GElf_Addr Elf3264_Addr; -typedef GElf_Rela Elf3264_Rela; -typedef GElf_Rel Elf3264_Rel; -#else -#define ELF3264_R_SYM ELF32_R_SYM -typedef Elf32_Shdr Elf3264_Shdr; -typedef Elf32_Dyn Elf3264_Dyn; -typedef Elf32_Sword Elf3264_Sword; -typedef Elf32_Sym Elf3264_Sym; -typedef Elf32_Word Elf3264_Word; -typedef Elf32_Addr Elf3264_Addr; -typedef Elf32_Rela Elf3264_Rela; -typedef Elf32_Rel Elf3264_Rel; -#endif -/* - * Opaque tnfctl handle - */ -typedef struct tnfctl_handle tnfctl_handle_t; - -/* - * Opaque probe handle - */ -typedef struct tnfctl_probe_handle tnfctl_probe_t; - -/* - * Trace attributes and probe state - */ -typedef enum { - TNFCTL_BUF_OK, - TNFCTL_BUF_NONE, - TNFCTL_BUF_BROKEN -} tnfctl_bufstate_t; - -typedef struct tnfctl_trace_attrs { - pid_t targ_pid; /* user process only */ - const char *trace_file_name; /* user process only */ - size_t trace_buf_size; - size_t trace_min_size; - tnfctl_bufstate_t trace_buf_state; - boolean_t trace_state; - boolean_t filter_state; /* kernel mode only */ - long pad; -} tnfctl_trace_attrs_t; - -typedef struct tnfctl_probe_state { - ulong_t id; - const char *attr_string; - boolean_t enabled; - boolean_t traced; - boolean_t new_probe; - const char *obj_name; /* user process only */ - const char * const *func_names; /* array of func names ptrs */ - const uintptr_t *func_addrs; /* array of func addresses */ - void *client_registered_data; - long pad; -} tnfctl_probe_state_t; - -/* - * error codes - */ -typedef enum { - TNFCTL_ERR_NONE = 0, /* success */ - TNFCTL_ERR_ACCES, /* permission denied */ - TNFCTL_ERR_NOTARGET, /* target process finished */ - TNFCTL_ERR_ALLOCFAIL, /* memory allocation failure */ - TNFCTL_ERR_INTERNAL, /* internal error */ - TNFCTL_ERR_SIZETOOSMALL, /* requested trace size is too small */ - TNFCTL_ERR_SIZETOOBIG, /* requested trace size is too big */ - TNFCTL_ERR_BADARG, /* Bad Input Argument */ - TNFCTL_ERR_NOTDYNAMIC, /* Target is not a dynamic executable */ - TNFCTL_ERR_NOLIBTNFPROBE, /* libtnfprobe not linked in target */ - TNFCTL_ERR_BUFBROKEN, /* tracing broken */ - TNFCTL_ERR_BUFEXISTS, /* buffer already exists */ - TNFCTL_ERR_NOBUF, /* no buffer */ - TNFCTL_ERR_BADDEALLOC, /* can't deallocate buffer */ - TNFCTL_ERR_NOPROCESS, /* no such target process */ - TNFCTL_ERR_FILENOTFOUND, /* file not found */ - TNFCTL_ERR_BUSY, /* kernel/process already tracing */ - TNFCTL_ERR_INVALIDPROBE, /* probe no longer valid (dlclos'ed) */ - TNFCTL_ERR_USR1, /* error extensions - semantics */ - TNFCTL_ERR_USR2, /* set by user */ - TNFCTL_ERR_USR3, - TNFCTL_ERR_USR4, - TNFCTL_ERR_USR5 -} tnfctl_errcode_t; - -/* - * event codes - */ -typedef enum { - TNFCTL_EVENT_EINTR, /* target was interrupted by a signal */ - TNFCTL_EVENT_TARGGONE, /* target finished - did not call exit */ - TNFCTL_EVENT_DLOPEN, /* target did a dlopen */ - TNFCTL_EVENT_DLCLOSE, /* target did a dlclose */ - TNFCTL_EVENT_EXEC, /* target did an exec */ - TNFCTL_EVENT_FORK, /* target did a fork */ - TNFCTL_EVENT_EXIT /* target called exit */ -} tnfctl_event_t; - -/* - * action to perform on target process - */ - -typedef enum { - TNFCTL_TARG_DEFAULT, /* kills target if it was started with */ - /* tnfctl_exec_open() */ - TNFCTL_TARG_KILL, /* kills target */ - TNFCTL_TARG_RESUME, /* target is let free */ - TNFCTL_TARG_SUSPEND /* target is suspended */ -} tnfctl_targ_op_t; - -/* - * data structures needed when using tnfctl_indirect_open() interface i.e. for - * clients that will supply callback functions for inspecting target image. - */ -typedef struct tnfctl_ind_obj_info { - int objfd; /* -1 indicates fd not available */ - uintptr_t text_base; /* address where text of loadobj was mapped */ - uintptr_t data_base; /* address where data of loadobj was mapped */ - const char *objname; /* null terminated full pathname to loadobj */ -} tnfctl_ind_obj_info_t; - -typedef int tnfctl_ind_obj_f( - void *, /* opaque prochandle */ - const struct tnfctl_ind_obj_info *, /* info about this object */ - void *); /* client supplied data */ - -typedef struct tnfctl_ind_config { - int (*p_read)(void *, uintptr_t, void *, size_t); - int (*p_write)(void *, uintptr_t, void *, size_t); - pid_t (*p_getpid)(void *); - int (*p_obj_iter)(void *, tnfctl_ind_obj_f *, void * /* client_data */); -} tnfctl_ind_config_t; - -/* - * maps an errcode to a string - */ -const char *tnfctl_strerror(tnfctl_errcode_t); - -/* - * interfaces to open a tnfctl handle - */ -tnfctl_errcode_t tnfctl_pid_open( - pid_t, /* pid */ - tnfctl_handle_t **); /* return value */ - -tnfctl_errcode_t tnfctl_indirect_open( - void *, /* prochandle */ - tnfctl_ind_config_t *, /* config */ - tnfctl_handle_t **); /* return value */ - -tnfctl_errcode_t tnfctl_exec_open( - const char *, /* pgm name */ - char * const *, /* argv */ - char * const *, /* envp */ - const char *, /* ld_preload */ - const char *, /* libtnfprobe_path */ - tnfctl_handle_t **); /* return value */ - -tnfctl_errcode_t tnfctl_internal_open(tnfctl_handle_t **); - -tnfctl_errcode_t tnfctl_kernel_open(tnfctl_handle_t **); - -/* - * direct mode - to continue process - */ -tnfctl_errcode_t tnfctl_continue( - tnfctl_handle_t *, - tnfctl_event_t *, /* return value - why did process stop ? */ - tnfctl_handle_t **); /* return value - if fork, handle on child */ - -/* - * informs libtnfctl that libraries may have changed - */ -tnfctl_errcode_t tnfctl_check_libs(tnfctl_handle_t *); - -/* - * - */ -tnfctl_errcode_t tnfctl_close(tnfctl_handle_t *, tnfctl_targ_op_t); -tnfctl_errcode_t tnfctl_trace_attrs_get( - tnfctl_handle_t *, - tnfctl_trace_attrs_t *); -tnfctl_errcode_t tnfctl_buffer_alloc( - tnfctl_handle_t *, - const char *, /* filename - ignored if kernel handle */ - uint_t); /* buffer size */ - -/* - * kernel tracing only - */ -tnfctl_errcode_t tnfctl_buffer_dealloc(tnfctl_handle_t *); -tnfctl_errcode_t tnfctl_trace_state_set(tnfctl_handle_t *, boolean_t); -tnfctl_errcode_t tnfctl_filter_state_set(tnfctl_handle_t *, boolean_t); -tnfctl_errcode_t tnfctl_filter_list_get(tnfctl_handle_t *, pid_t **, int *); -tnfctl_errcode_t tnfctl_filter_list_add(tnfctl_handle_t *, pid_t); -tnfctl_errcode_t tnfctl_filter_list_delete(tnfctl_handle_t *, pid_t); - -/* - * probe operation interface - */ -typedef tnfctl_errcode_t (*tnfctl_probe_op_t)( - tnfctl_handle_t *, - tnfctl_probe_t *, /* opaque probe handle */ - void *); /* client supplied data */ - -tnfctl_errcode_t tnfctl_probe_apply( - tnfctl_handle_t *, - tnfctl_probe_op_t, /* func to apply to each of the probes */ - void *); /* client data - arg to pass to func */ - -tnfctl_errcode_t tnfctl_probe_apply_ids( - tnfctl_handle_t *, - ulong_t, /* # of probe id's in array */ - ulong_t *, /* array of probe id's */ - tnfctl_probe_op_t, /* func to apply to each those probes */ - void *); /* client data - arg to pass to func */ - -tnfctl_errcode_t tnfctl_register_funcs( - tnfctl_handle_t *, - void *(*)(tnfctl_handle_t *, tnfctl_probe_t *), /* create_func */ - void (*)(void *)); /* destroy_func */ - -tnfctl_errcode_t tnfctl_probe_state_get(tnfctl_handle_t *, tnfctl_probe_t *, - tnfctl_probe_state_t *); - -/* - * supplied probe functions that can be used with tnfctl_probe_apply() - * and tnfctl_probe_apply_ids(). last argument is ignored when it is "void *" - */ -tnfctl_errcode_t tnfctl_probe_enable(tnfctl_handle_t *, tnfctl_probe_t *, - void *); -tnfctl_errcode_t tnfctl_probe_disable(tnfctl_handle_t *, tnfctl_probe_t *, - void *); -tnfctl_errcode_t tnfctl_probe_trace(tnfctl_handle_t *, tnfctl_probe_t *, - void *); -tnfctl_errcode_t tnfctl_probe_untrace(tnfctl_handle_t *, tnfctl_probe_t *, - void *); -tnfctl_errcode_t tnfctl_probe_disconnect_all(tnfctl_handle_t *, - tnfctl_probe_t *, void *); -tnfctl_errcode_t tnfctl_probe_connect( - tnfctl_handle_t *, - tnfctl_probe_t *, - const char *, /* library base name */ - const char *); /* function name */ - -#ifdef __cplusplus -} -#endif - -#endif /* _TNFCTL_H */ diff --git a/usr/src/lib/libtnfctl/tnfctl_int.h b/usr/src/lib/libtnfctl/tnfctl_int.h deleted file mode 100644 index 01f559e03e..0000000000 --- a/usr/src/lib/libtnfctl/tnfctl_int.h +++ /dev/null @@ -1,327 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#ifndef _TNFCTL_INT_H -#define _TNFCTL_INT_H - -/* - * Interfaces private to libtnfctl - * layout of tnfctl handle structure - * layout of probe handle structure - * other misc. interfaces used across source files - */ - -#ifdef __cplusplus -extern "C" { -#endif - -#include "tnfctl.h" -#include <sys/types.h> -#include <gelf.h> -#include <libelf.h> -#include "prb_proc.h" -#include <thread.h> -#include <synch.h> - -/* - * global variables used for INTERNAL_MODE synchronization with - * dlopen's and dlclose's on another thread. - */ -extern mutex_t _tnfctl_lmap_lock; -extern boolean_t _tnfctl_libs_changed; - -/* Project private interface - function name in target */ -#define TRACE_END_FUNC "tnf_trace_end" - -/* All tnfctl handles are in one of the following 4 modes */ -enum proc_mode { - KERNEL_MODE, /* kernel tracing */ - DIRECT_MODE, /* tracing another process (exec or attach) */ - INDIRECT_MODE, /* client provides /proc functions */ - INTERNAL_MODE /* tracing probes in the same process */ -}; - -typedef struct prbctlref prbctlref_t; -typedef struct objlist objlist_t; - -/* per probe state - transient - freed on dlclose() */ -struct prbctlref { - uintptr_t addr; /* probe address in target */ - objlist_t *obj; /* obj that this probe is in */ - ulong_t probe_id; /* assigned id */ - char *attr_string; - tnf_probe_control_t wrkprbctl; /* probe struct from target */ - tnfctl_probe_t *probe_handle; /* handle visible to client */ -}; - -/* per object state */ -struct objlist { - boolean_t new_probe; /* relative to last library change */ - boolean_t new; /* relative to last sync with linker */ - boolean_t old; /* relative to last sync with linker */ - char * objname; - uintptr_t baseaddr; - int objfd; - uint_t min_probe_num; /* first probe id in object */ - uint_t probecnt; /* number of probes in object */ - prbctlref_t *probes; /* pointer to an array of probes */ - objlist_t *next; -}; - -/* per probe state that is freed only on tnfctl_close() */ -struct tnfctl_probe_handle { - boolean_t valid; - prbctlref_t *probe_p; - void *client_registered_data; - struct tnfctl_probe_handle *next; -}; - -/* - * state saved per tnfctl handle - */ -struct tnfctl_handle { - void *proc_p; /* proc handle */ - int kfd; /* kernel handle */ - pid_t targ_pid; /* pid of target */ - enum proc_mode mode; /* mode of handle */ - /* tracing info */ - const char *trace_file_name; - int trace_buf_size; - int trace_min_size; - tnfctl_bufstate_t trace_buf_state; - boolean_t trace_state; - boolean_t kpidfilter_state; - boolean_t called_exit; - /* addresses of functions in target */ - uintptr_t testfunc; - uintptr_t allocfunc; - uintptr_t commitfunc; - uintptr_t endfunc; - uintptr_t rollbackfunc; - uintptr_t probelist_head; - uintptr_t probelist_valid; - uintptr_t trace_error; - uintptr_t memseg_p; - uintptr_t nonthread_test; - uintptr_t thread_test; - uintptr_t thread_sync; - boolean_t mt_target; - uint_t num_probes; /* number of probes in target */ - tnfctl_probe_t *probe_handle_list_head; - /* object info */ - boolean_t in_objlist; /* _tnfctl_lmap_lock reentrancy check */ - objlist_t *objlist; - /* combination info */ - void *buildroot; /* root of built combinations */ - void *decoderoot; /* root of decoded combinations */ - /* per probe create/destroy functions */ - void *(*create_func)(tnfctl_handle_t *, tnfctl_probe_t *); - void (*destroy_func)(void *); - /* functions to inspect target process */ - int (*p_read)(void *prochandle, uintptr_t addr, void *buf, size_t size); - int (*p_write)(void *prochandle, uintptr_t addr, - void *buf, size_t size); - int (*p_obj_iter)(void *prochandle, tnfctl_ind_obj_f *func, - void *client_data); - pid_t (*p_getpid)(void *prochandle); -}; - -typedef enum comb_op { - PRB_COMB_CHAIN = 0, /* call the down, then the next */ - PRB_COMB_COUNT = 1 /* how many? */ -} comb_op_t; - -enum event_op_t { - EVT_NONE, - EVT_OPEN, - EVT_CLOSE -}; - - -/* - * interfaces to search for symbols or to search for relocations - * in an elf file - */ -typedef struct tnfctl_elf_search tnfctl_elf_search_t; - -/* prototype for callback for traversing an elf section */ -typedef tnfctl_errcode_t -(*tnfctl_traverse_section_func_t) (Elf * elf, char *strs, Elf_Scn * scn, - GElf_Shdr * shdr, Elf_Data * data, uintptr_t baseaddr, - tnfctl_elf_search_t * search_info); - -/* prototype for callback for traversing records in an elf section */ -typedef tnfctl_errcode_t -(*tnfctl_record_func_t) (char *name, uintptr_t addr, void *entry, - tnfctl_elf_search_t * search_info); - -struct tnfctl_elf_search { - tnfctl_traverse_section_func_t section_func; - void *section_data; - tnfctl_record_func_t record_func; - void *record_data; -}; - -/* traverse all the sections in an object */ -tnfctl_errcode_t _tnfctl_traverse_object(int objfd, uintptr_t addr, - tnfctl_elf_search_t *search_info_p); -/* search a .rela section */ -tnfctl_errcode_t _tnfctl_traverse_rela(Elf * elf, char *strs, Elf_Scn * rel_scn, - GElf_Shdr * rel_shdr, Elf_Data * rel_data, uintptr_t baseaddr, - tnfctl_elf_search_t * search_info_p); -/* search a .dynsym section */ -tnfctl_errcode_t _tnfctl_traverse_dynsym(Elf * elf, char *elfstrs, - Elf_Scn * scn, GElf_Shdr * shdr, Elf_Data * data, uintptr_t baseaddr, - tnfctl_elf_search_t * search_info_p); - -/* prototype of callback for internal probe traversal function */ -typedef tnfctl_errcode_t -(*_tnfctl_traverse_probe_func_t)(tnfctl_handle_t *, prbctlref_t *, void *); - -/* sync up list of objects with that of the linker */ -tnfctl_errcode_t _tnfctl_lmap_update(tnfctl_handle_t *hndl, boolean_t *lmap_ok, - enum event_op_t *evt); - -/* sync up list of objects and probes */ -tnfctl_errcode_t _tnfctl_refresh_process(tnfctl_handle_t *, boolean_t *, - enum event_op_t *); - -tnfctl_errcode_t _tnfctl_set_state(tnfctl_handle_t *hndl); -tnfctl_errcode_t _tnfctl_create_tracefile(tnfctl_handle_t *hndl, - const char *trace_file_name, uint_t trace_file_size); - -/* probe interfaces */ -tnfctl_errcode_t _tnfctl_find_all_probes(tnfctl_handle_t *hndl); -tnfctl_errcode_t _tnfctl_probes_traverse(tnfctl_handle_t *hndl, - _tnfctl_traverse_probe_func_t func_p, void *calldata_p); -tnfctl_errcode_t _tnfctl_flush_a_probe(tnfctl_handle_t *hndl, - prbctlref_t *ref_p, size_t offset, size_t size); - -/* combination interfaces */ -tnfctl_errcode_t _tnfctl_comb_build(tnfctl_handle_t *hndl, comb_op_t op, - uintptr_t down, uintptr_t next, uintptr_t *comb_p); -tnfctl_errcode_t _tnfctl_comb_decode(tnfctl_handle_t *hndl, uintptr_t addr, - char ***func_names, uintptr_t **func_addrs); - -/* allocate memory in target process */ -tnfctl_errcode_t _tnfctl_targmem_alloc(tnfctl_handle_t *hndl, size_t size, - uintptr_t *addr_p); - -/* inprocess "plug ins" for functions in tnfctl_handle_t structure */ -int _tnfctl_read_targ(void *proc_p, uintptr_t addr, void *buf, size_t size); -int _tnfctl_write_targ(void *proc_p, uintptr_t addr, void *buf, size_t size); -int _tnfctl_loadobj_iter(void *proc_p, tnfctl_ind_obj_f *func, - void *client_data); -pid_t _tnfctl_pid_get(void *proc_p); - -/* read a string from the target process */ -tnfctl_errcode_t _tnfctl_readstr_targ(tnfctl_handle_t *hndl, uintptr_t addr, - char **outstr_pp); - -/* symbol searching interfaces */ -tnfctl_errcode_t _tnfctl_sym_find_in_obj(int objfd, uintptr_t baseaddr, - const char *symname, uintptr_t *symaddr); -tnfctl_errcode_t _tnfctl_sym_obj_find(tnfctl_handle_t *hndl, - const char *lib_base_name, const char *symname, uintptr_t *symaddr); -tnfctl_errcode_t _tnfctl_sym_find(tnfctl_handle_t *hndl, const char *symname, - uintptr_t *symaddr); -tnfctl_errcode_t _tnfctl_sym_findname(tnfctl_handle_t *hndl, uintptr_t symaddr, - char **symname); -tnfctl_errcode_t _tnfctl_elf_dbgent(tnfctl_handle_t *hndl, - uintptr_t * entaddr_p); - -/* free objs and probes */ -void _tnfctl_free_objs_and_probes(tnfctl_handle_t *); - -/* locking interfaces */ -tnfctl_errcode_t _tnfctl_lock_libs(tnfctl_handle_t *hndl, - boolean_t *release_lock); -void _tnfctl_unlock_libs(tnfctl_handle_t *hndl, boolean_t release_lock); -tnfctl_errcode_t _tnfctl_sync_lib_list(tnfctl_handle_t *hndl); - -/* - * BugID 1253419 - * The flags that indicate if in/external trace control is active. - * Used to prevent simultaneous internal and external probe control. - * For external control keep pid of traced process to handle case - * where process forks. (child is not under external control) - */ -#define TNFCTL_INTERNAL_TRACEFLAG "_tnfctl_internal_tracing_flag" -#define TNFCTL_EXTERNAL_TRACEDPID "_tnfctl_externally_traced_pid" -extern boolean_t _tnfctl_internal_tracing_flag; -extern pid_t _tnfctl_externally_traced_pid; -tnfctl_errcode_t _tnfctl_internal_getlock(void); -tnfctl_errcode_t _tnfctl_external_getlock(tnfctl_handle_t *hndl); -tnfctl_errcode_t _tnfctl_internal_releaselock(void); -tnfctl_errcode_t _tnfctl_external_releaselock(tnfctl_handle_t *hndl); - -/* error mapping functions */ -tnfctl_errcode_t _tnfctl_map_to_errcode(prb_status_t prbstat); -tnfctl_errcode_t tnfctl_status_map(int); - - -/* - * LOCK is the macro to lock down the library list so that a dlopen or - * dlclose by another thread will block waiting for the lock to be released. - * - * LOCK_SYNC does the same as LOCK + it syncs up libtnfctl's cache of - * libraries in target process with that of what the run time linker maintains. - * - * These macros do conditional locking because they are needed only by - * INTERNAL_MODE clients. There are 2 versions of these macros so that - * lock_lint won't have to see the conditional locking. - * CAUTION: Be aware that these macros have a return() embedded in them. - */ -#define LOCK(hndl, stat, release) \ - if (hndl->mode == INTERNAL_MODE) { \ - stat = _tnfctl_lock_libs(hndl, &release); \ - if (stat) \ - return (stat); \ - } \ - else - -#define LOCK_SYNC(hndl, stat, release) \ - if (hndl->mode == INTERNAL_MODE) { \ - stat = _tnfctl_lock_libs(hndl, &release); \ - if (stat) \ - return (stat); \ - stat = _tnfctl_sync_lib_list(hndl); \ - if (stat) { \ - _tnfctl_unlock_libs(hndl, release); \ - return (stat); \ - } \ - } \ - else - -#define UNLOCK(hndl, release) \ - if (hndl->mode == INTERNAL_MODE) \ - _tnfctl_unlock_libs(hndl, release_lock); \ - else - -#ifdef __cplusplus -} -#endif - -#endif /* _TNFCTL_INT_H */ diff --git a/usr/src/lib/libtnfctl/traverse.c b/usr/src/lib/libtnfctl/traverse.c deleted file mode 100644 index c8e73041f5..0000000000 --- a/usr/src/lib/libtnfctl/traverse.c +++ /dev/null @@ -1,326 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -/* - * Generic functions that know how to traverse elf sections in an object. - * Also functions that know how to traverse records in a section. - * - */ - -#include <string.h> -#include <stdlib.h> -#include <unistd.h> -#include <errno.h> -#include <sys/procfs.h> -#include <sys/stat.h> - -#include "tnfctl_int.h" -#include "dbg.h" - - -/* - * _tnfctl_traverse_object() - traverses all of the elf sections in an object, - * calling the supplied function on each. - */ -tnfctl_errcode_t -_tnfctl_traverse_object(int objfd, uintptr_t addr, - tnfctl_elf_search_t *search_info_p) -{ - Elf *elf; - GElf_Ehdr *ehdr, ehdr_obj; - char *strs; - GElf_Shdr *shdr, shdr_obj; - Elf_Data *data; - u_int idx; - tnfctl_errcode_t prexstat = TNFCTL_ERR_NONE; - - DBG_TNF_PROBE_1(_tnfctl_traverse_object_1, "libtnfctl", - "sunw%verbosity 3", - tnf_opaque, obj_addr, addr); - - if (elf_version(EV_CURRENT) == EV_NONE) - return (TNFCTL_ERR_INTERNAL); - - /* open elf descriptor on the fd */ - elf = elf_begin(objfd, ELF_C_READ, NULL); - if (elf == NULL || elf_kind(elf) != ELF_K_ELF) { - DBG_TNF_PROBE_0(_tnfctl_traverse_object_2, "libtnfctl", - "sunw%verbosity 3; sunw%debug 'not elf object'"); - return (TNFCTL_ERR_INTERNAL); - } - /* get the elf header */ - if ((ehdr = gelf_getehdr(elf, &ehdr_obj)) == NULL) { - DBG((void) fprintf(stderr, - "_tnfctl_traverse_object: gelf_getehdr failed\n")); - (void) elf_end(elf); - return (TNFCTL_ERR_INTERNAL); - } - if ((ehdr->e_type != ET_EXEC) && (ehdr->e_type != ET_DYN)) { - DBG((void) fprintf(stderr, - "_tnfctl_traverse_object: not an " - "executable or a shared object\n")); - (void) elf_end(elf); - return (TNFCTL_ERR_INTERNAL); - } - /* if an executable file, the base address is 0 */ - if (ehdr->e_type == ET_EXEC) - addr = 0; - /* get a pointer to the elf header string table */ - strs = elf_strptr(elf, ehdr->e_shstrndx, 0); - - DBG_TNF_PROBE_1(_tnfctl_traverse_object_3, "libtnfctl", - "sunw%verbosity 3", - tnf_long, num_sections_found, ehdr->e_shnum); - - for (idx = 1; idx < ehdr->e_shnum; idx++) { - Elf_Scn *scn; - - if ((scn = elf_getscn(elf, idx)) == NULL) { - DBG((void) fprintf(stderr, - "_tnfctl_traverse_object: elf_getscn failed\n")); - prexstat = TNFCTL_ERR_INTERNAL; - break; - } - if ((shdr = gelf_getshdr(scn, &shdr_obj)) == NULL) { - DBG((void) fprintf(stderr, - "_tnfctl_traverse_obj:gelf_getshdr failed\n")); - prexstat = TNFCTL_ERR_INTERNAL; - break; - } - - if ((data = elf_getdata(scn, NULL)) == NULL) { - DBG((void) fprintf(stderr, - "_tnfctl_traverse_obj:gelf_getdata failed\n")); - prexstat = TNFCTL_ERR_INTERNAL; - break; - } - /* call the supplied function */ - prexstat = search_info_p->section_func(elf, - strs, scn, shdr, data, addr, search_info_p); - if (prexstat) - break; - } - - (void) elf_end(elf); - - return (prexstat); - -} /* end _tnfctl_traverse_object */ - - -/* - * _tnfctl_traverse_rela() - this function traverses a .rela section calling the - * supplied function on each relocation record. - */ -/*ARGSUSED*/ -tnfctl_errcode_t -_tnfctl_traverse_rela(Elf * elf, char *strs, Elf_Scn * rel_scn, - GElf_Shdr * rel_shdr, Elf_Data * rel_data, uintptr_t baseaddr, - tnfctl_elf_search_t * search_info_p) -{ - Elf_Scn *sym_scn; - GElf_Shdr *sym_shdr, sym_shdr_obj; - Elf_Data *sym_data; - Elf3264_Sym *sym_table; - Elf_Scn *str_scn; - GElf_Shdr *str_shdr, str_shdr_obj; - Elf_Data *str_data; - char *str_table; - ulong_t nrels; - uint_t i; - boolean_t isrela; - size_t rela_sz; - char *ptr; - - DBG_TNF_PROBE_0(_tnfctl_traverse_rela_1, "libtnfctl", - "sunw%verbosity 4"); - - /* bail if this isn't a rela (or rel) section */ - if (rel_shdr->sh_type == SHT_RELA) { - isrela = B_TRUE; - } else if (rel_shdr->sh_type == SHT_REL) { - isrela = B_FALSE; - } else - return (TNFCTL_ERR_NONE); - - /* find the symbol table section associated with this rela section */ - sym_scn = elf_getscn(elf, rel_shdr->sh_link); - if (sym_scn == NULL) { - DBG((void) fprintf(stderr, - "_tnfctl_traverse_rela:elf_getscn (sym) failed\n")); - return (TNFCTL_ERR_INTERNAL); - } - sym_shdr = gelf_getshdr(sym_scn, &sym_shdr_obj); - if (sym_shdr == NULL) { - DBG((void) fprintf(stderr, - "_tnfctl_traverse_rela:gelf_getshdr (sym) failed\n")); - return (TNFCTL_ERR_INTERNAL); - } - sym_data = elf_getdata(sym_scn, NULL); - if (sym_data == NULL) { - DBG((void) fprintf(stderr, - "_tnfctl_traverse_rela:elf_getdata (sym) failed\n")); - return (TNFCTL_ERR_INTERNAL); - } - sym_table = (Elf3264_Sym *) sym_data->d_buf; - - /* find the string table associated with the symbol table */ - str_scn = elf_getscn(elf, sym_shdr->sh_link); - if (str_scn == NULL) { - DBG((void) fprintf(stderr, - "_tnfctl_traverse_rela:elf_getscn (str) failed\n")); - return (TNFCTL_ERR_INTERNAL); - } - str_shdr = gelf_getshdr(str_scn, &str_shdr_obj); - if (str_shdr == NULL) { - DBG((void) fprintf(stderr, - "_tnfctl_traverse_rela:gelf_getshdr (str) failed\n")); - return (TNFCTL_ERR_INTERNAL); - } - str_data = elf_getdata(str_scn, NULL); - if (str_data == NULL) { - DBG((void) fprintf(stderr, - "_tnfctl_traverse_rela: elf_getdata (str) failed\n")); - return (TNFCTL_ERR_INTERNAL); - } - str_table = (char *) str_data->d_buf; - - /* loop over each relocation record */ - nrels = rel_shdr->sh_size / rel_shdr->sh_entsize; - - DBG_TNF_PROBE_1(_tnfctl_traverse_rela_2, "libtnfctl", - "sunw%verbosity 3", - tnf_long, relocations_found, nrels); - - ptr = rel_data->d_buf; - rela_sz = (isrela) ? sizeof (Elf3264_Rela) : sizeof (Elf3264_Rel); - for (i = 0; i < nrels; i++, ptr += rela_sz) { - Elf3264_Word syminfo; - Elf3264_Sym *sym; - Elf3264_Addr offset; - char *name; - uintptr_t addr; - tnfctl_errcode_t prexstat; - - /* decode the r_info field of the relocation record */ - if (isrela) { - Elf3264_Rela *rela_p; - - /*LINTED pointer cast may result in improper alignment*/ - rela_p = (Elf3264_Rela *) ptr; - syminfo = ELF3264_R_SYM(rela_p->r_info); - offset = rela_p->r_offset; - } else { - Elf3264_Rel *rel_p; - - /*LINTED pointer cast may result in improper alignment*/ - rel_p = (Elf3264_Rel *) ptr; - syminfo = ELF3264_R_SYM(rel_p->r_info); - offset = rel_p->r_offset; - } - - /* find the associated symbol table entry */ - if (!syminfo) - continue; - sym = sym_table + syminfo; - - /* find the associated string table entry */ - if (!sym->st_name) - continue; - name = str_table + sym->st_name; - addr = offset + baseaddr; - - prexstat = search_info_p->record_func(name, addr, ptr, - search_info_p); - if (prexstat) - break; - } - - return (TNFCTL_ERR_NONE); - -} /* end _tnfctl_traverse_rela */ - - -/* - * _tnfctl_traverse_dynsym() - this function traverses a dynsym section calling - * the supplied function on each symbol. - */ - -/*ARGSUSED*/ -tnfctl_errcode_t -_tnfctl_traverse_dynsym(Elf * elf, - char *elfstrs, - Elf_Scn * scn, - GElf_Shdr * shdr, - Elf_Data * data, - uintptr_t baseaddr, - tnfctl_elf_search_t * search_info_p) -{ - ulong_t nsyms; - int i; - char *strs; - tnfctl_errcode_t prexstat; - - Elf3264_Sym *syms; - - /* bail if this isn't a dynsym section */ - if (shdr->sh_type != SHT_DYNSYM) - return (TNFCTL_ERR_NONE); -#if 0 - printf("### entering _tnfctl_traverse_dynsym...\n"); -#endif - syms = data->d_buf; - nsyms = shdr->sh_size / shdr->sh_entsize; - strs = elf_strptr(elf, shdr->sh_link, 0); - - DBG_TNF_PROBE_1(_tnfctl_traverse_dynsym_1, "libtnfctl", - "sunw%verbosity 3", - tnf_long, symbols_found, nsyms); - - for (i = 0; i < nsyms; i++) { - Elf3264_Sym *sym = &syms[i]; - char *name; - uintptr_t addr; - - name = strs + sym->st_name; - addr = baseaddr + sym->st_value; - -#if 0 - if (name != 0) - printf("_tnfctl_traverse_dynsym: name = %s\n", name); - else - printf("_tnfctl_traverse_dynsym: name is 0\n"); -#endif - prexstat = search_info_p->record_func(name, - addr, sym, search_info_p); - if (prexstat) - break; - } -#if 0 - printf("### leaving _tnfctl_traverse_dynsym...\n"); -#endif - return (prexstat); - -} /* end _tnfctl_traverse_dynsym */ diff --git a/usr/src/lib/libtnfctl/util.c b/usr/src/lib/libtnfctl/util.c deleted file mode 100644 index 04d6fabe1b..0000000000 --- a/usr/src/lib/libtnfctl/util.c +++ /dev/null @@ -1,692 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -/* - * Utility functions to initialize tnfctl handle, find functions that - * can be plugged into probes, find trace file information, and create - * a trace file for process tracing. - */ - -#ifndef DEBUG -#define NDEBUG 1 -#endif - -#include "tnfctl_int.h" -#include "dbg.h" - -#include <assert.h> -#include <errno.h> -#include <stdio.h> -#include <string.h> -#include <unistd.h> -#include <stdlib.h> -#include <fcntl.h> -#include <sys/param.h> - -#include "tnf_buf.h" -/* - * Defines - Project private interfaces in libtnfprobe.so - */ - -#define TRACEFILE_NAME "tnf_trace_file_name" -#define TRACEFILE_SIZE "tnf_trace_file_size" -#define TRACEFILE_MIN "tnf_trace_file_min" -#define TRACE_ERROR "_tnfw_b_control" - -#define TRACE_ALLOC "tnf_trace_alloc" -#define TRACE_COMMIT "tnf_trace_commit" -#define TRACE_ROLLBACK "tnf_trace_rollback" -#define DEBUG_ENTRY "tnf_probe_debug" - -#define PROBE_LIST_HEAD "__tnf_probe_list_head" -#define PROBE_LIST_VALID "__tnf_probe_list_valid" - -#define NONTHREAD_TEST "tnf_non_threaded_test_addr" -#define THREAD_TEST "tnf_threaded_test_addr" -#define PROBE_THR_SYNC "__tnf_probe_thr_sync" - -#define MEMSEG_PTR "__tnf_probe_memseg_p" - -/* Project private interfaces in libthread.so */ -#define LIBTHREAD_PRESENT "thr_probe_getfunc_addr" - -/* - * Local declarations - */ - -static tnfctl_errcode_t find_test_func(tnfctl_handle_t *hndl); -static tnfctl_errcode_t find_target_syms(tnfctl_handle_t *hndl); -static tnfctl_errcode_t find_trace_file_info(tnfctl_handle_t *hndl); -static tnfctl_errcode_t check_trace_error(tnfctl_handle_t *hndl); - -/* - * _tnfctl_refresh_process() - search for new shared objects. If any - * found, discover probes in new shared objects. - * NOT to be called in kernel mode. - */ - -tnfctl_errcode_t -_tnfctl_refresh_process(tnfctl_handle_t *hndl, boolean_t *lmap_ok, - enum event_op_t *dl_evt) -{ - tnfctl_errcode_t prexstat = TNFCTL_ERR_NONE; - boolean_t release_lock; - - assert(hndl->mode != KERNEL_MODE); - - /*LINTED statement has no consequent: else*/ - LOCK(hndl, prexstat, release_lock); - - prexstat = check_trace_error(hndl); - if (prexstat) - goto finish_func; - - /* - * update the link map. caller decides what to do on - * inconsistent link map - */ - prexstat = _tnfctl_lmap_update(hndl, lmap_ok, dl_evt); - if (prexstat) - goto finish_func; - - /* link map is ok now */ - prexstat = find_test_func(hndl); - if (prexstat) - goto finish_func; - if (*dl_evt != EVT_NONE) { - prexstat = _tnfctl_find_all_probes(hndl); - if (prexstat) - goto finish_func; - } - -finish_func: - /*LINTED statement has no consequent: else*/ - UNLOCK(hndl, release_lock); - - return (prexstat); -} - -/* - * initialize tnfctl handle for a new target - */ -tnfctl_errcode_t -_tnfctl_set_state(tnfctl_handle_t *hndl) -{ - tnfctl_errcode_t prexstat = TNFCTL_ERR_NONE; - boolean_t lmap_ok; - enum event_op_t dl_evt; - boolean_t release_lock; - - hndl->targ_pid = hndl->p_getpid(hndl->proc_p); - - /*LINTED statement has no consequent: else*/ - LOCK(hndl, prexstat, release_lock); - - /* - * initialize the link map table. If link map is not ok, it is an - * error. - */ - prexstat = _tnfctl_lmap_update(hndl, &lmap_ok, &dl_evt); - if (prexstat) - goto end_func; - - /* find the needed target symbols */ - prexstat = find_target_syms(hndl); - if (prexstat) { - /* is libtnfprobe.so loaded in target ? */ - goto end_func; - } - - prexstat = find_trace_file_info(hndl); - if (prexstat) - goto end_func; - - prexstat = find_test_func(hndl); - if (prexstat) - goto end_func; - - prexstat = _tnfctl_find_all_probes(hndl); - if (prexstat) - goto end_func; - - prexstat = check_trace_error(hndl); - /* fall into end_func */ - -end_func: - /*LINTED statement has no consequent: else*/ - UNLOCK(hndl, release_lock); - - return (prexstat); -} - -/* - * find the test function for a probe. The test function could change - * with time, so we have to repeatedly check for the test function to use - */ -static tnfctl_errcode_t -find_test_func(tnfctl_handle_t *hndl) -{ - long thr_sync; - int miscstat; - - if (hndl->mt_target == B_FALSE) { - /* no libthread linked in */ - hndl->testfunc = hndl->nonthread_test; - } else { - /* - * check whether libthread/libtnfw have synced up. - * If not yet synced up, use non-threaded test function - */ - - /* assume we are going to use threaded test */ - hndl->testfunc = hndl->thread_test; - miscstat = hndl->p_read(hndl->proc_p, hndl->thread_sync, - &thr_sync, sizeof (thr_sync)); - if (miscstat != 0) - return (TNFCTL_ERR_INTERNAL); - /* if not yet synced up, change test func to non-threaded one */ - if (thr_sync == 0) { - hndl->testfunc = hndl->nonthread_test; - } - } - - /* - * Note: the testfunc in the target can change underneath us because - * in an MT program the init section of libthread changes all the - * test functions from the non-threaded one to the threaded one. - * So, every time we write out a probe, we have to make sure that - * we are using the correct test function by not trusting the test - * function in our copy of the probe. A more fool-proof solution - * which will allow other fields in the probe to change internally - * is to refresh every probe on a _tnfctl_refresh_process() - */ - return (TNFCTL_ERR_NONE); -} - -/* - * check_trace_error() - checks whether there was an error in tracing - * side effects trace_buf_state and trace_state in hndl - * note: call this function only after trace_file_name is set up - * in hndl - */ -tnfctl_errcode_t -check_trace_error(tnfctl_handle_t *hndl) -{ - int miscstat; - uintptr_t trace_error_ptr; - TNFW_B_CONTROL trace_error_rec; - - /* read in the value of the control structure pointer */ - miscstat = hndl->p_read(hndl->proc_p, hndl->trace_error, - &trace_error_ptr, sizeof (trace_error_ptr)); - if (miscstat != 0) - return (TNFCTL_ERR_INTERNAL); - - /* read in the value of the control structure */ - miscstat = hndl->p_read(hndl->proc_p, trace_error_ptr, &trace_error_rec, - sizeof (trace_error_rec)); - if (miscstat != 0) - return (TNFCTL_ERR_INTERNAL); - - if (trace_error_rec.tnf_state == TNFW_B_NOBUFFER) { - /* - * massage into correct state for caller - the target might - * not have hit the first probe and hence we got "no buffer". - * So, if the user had given a file name, return BUF_OK. - */ - if (hndl->trace_file_name == NULL) - hndl->trace_buf_state = TNFCTL_BUF_NONE; - else - hndl->trace_buf_state = TNFCTL_BUF_OK; - } else if (trace_error_rec.tnf_state == TNFW_B_BROKEN) { - hndl->trace_buf_state = TNFCTL_BUF_BROKEN; - } else { - hndl->trace_buf_state = TNFCTL_BUF_OK; - } - - if (TNFW_B_IS_STOPPED(trace_error_rec.tnf_state)) - hndl->trace_state = B_FALSE; - else - hndl->trace_state = B_TRUE; - - return (TNFCTL_ERR_NONE); - -} /* end find_alloc_func */ - -/* - * find_target_syms() - finds needed target functions - * sideffects allocfunc, commitfunc, endfunc, rollbackfunc in hndl - */ -static tnfctl_errcode_t -find_target_syms(tnfctl_handle_t *hndl) -{ - tnfctl_errcode_t prexstat; - uintptr_t temp_addr; - int miscstat; - - prexstat = _tnfctl_sym_find(hndl, TRACE_ALLOC, &hndl->allocfunc); - if (prexstat) - goto end_of_func; - - prexstat = _tnfctl_sym_find(hndl, TRACE_COMMIT, &hndl->commitfunc); - if (prexstat) - goto end_of_func; - - prexstat = _tnfctl_sym_find(hndl, TRACE_END_FUNC, &hndl->endfunc); - if (prexstat) - goto end_of_func; - - prexstat = _tnfctl_sym_find(hndl, TRACE_ROLLBACK, &hndl->rollbackfunc); - if (prexstat) - goto end_of_func; - - prexstat = _tnfctl_sym_find(hndl, PROBE_LIST_HEAD, - &hndl->probelist_head); - if (prexstat) - goto end_of_func; - - prexstat = _tnfctl_sym_find(hndl, TRACE_ERROR, &hndl->trace_error); - if (prexstat) - goto end_of_func; - - prexstat = _tnfctl_sym_find(hndl, MEMSEG_PTR, &temp_addr); - if (prexstat) - goto end_of_func; - - /* dereference to get the actual address of structure */ - miscstat = hndl->p_read(hndl->proc_p, temp_addr, &hndl->memseg_p, - sizeof (hndl->memseg_p)); - if (miscstat != 0) - return (TNFCTL_ERR_INTERNAL); - - prexstat = _tnfctl_sym_find(hndl, PROBE_LIST_VALID, - &hndl->probelist_valid); - if (prexstat) - goto end_of_func; - - prexstat = _tnfctl_sym_find(hndl, NONTHREAD_TEST, &temp_addr); - if (prexstat) - goto end_of_func; - - /* dereference to get the actual function address */ - miscstat = hndl->p_read(hndl->proc_p, temp_addr, &hndl->nonthread_test, - sizeof (hndl->nonthread_test)); - if (miscstat != 0) - return (TNFCTL_ERR_INTERNAL); - - prexstat = _tnfctl_sym_find(hndl, THREAD_TEST, &temp_addr); - if (prexstat) - goto end_of_func; - - /* dereference to get the actual function address */ - miscstat = hndl->p_read(hndl->proc_p, temp_addr, &hndl->thread_test, - sizeof (hndl->thread_test)); - if (miscstat != 0) - return (TNFCTL_ERR_INTERNAL); - - prexstat = _tnfctl_sym_find(hndl, PROBE_THR_SYNC, &hndl->thread_sync); - if (prexstat) - goto end_of_func; - - prexstat = _tnfctl_sym_find(hndl, LIBTHREAD_PRESENT, &temp_addr); - if (prexstat) { - if (prexstat == TNFCTL_ERR_BADARG) { - /* no libthread linked in */ - hndl->mt_target = B_FALSE; - /* this is not an error condition */ - prexstat = TNFCTL_ERR_NONE; - } else { - return (prexstat); - } - } else { - hndl->mt_target = B_TRUE; - } - -end_of_func: - if (prexstat == TNFCTL_ERR_BADARG) - prexstat = TNFCTL_ERR_NOLIBTNFPROBE; - - return (prexstat); -} - -/* - * _tnfctl_create_tracefile() - initializes tracefile, sets the tracefile name - * and size - * side effects trace_file_name and trace_buf_size in hndl - */ - -#define ZBUFSZ (64 * 1024) - -tnfctl_errcode_t -_tnfctl_create_tracefile(tnfctl_handle_t *hndl, const char *trace_file_name, - uint_t trace_file_size) -{ - char *preexisting; - tnfctl_errcode_t prexstat; - int miscstat; - char path[MAXPATHLEN]; - uintptr_t name_addr, size_addr; - uint_t outsize; - char zerobuf[ZBUFSZ]; - int fd, sz, i; - - /* find the neccessary symbols in the target */ - prexstat = _tnfctl_sym_find(hndl, TRACEFILE_NAME, &name_addr); - if (prexstat) { - if (prexstat == TNFCTL_ERR_BADARG) - prexstat = TNFCTL_ERR_INTERNAL; - return (prexstat); - } - prexstat = _tnfctl_sym_find(hndl, TRACEFILE_SIZE, &size_addr); - if (prexstat) { - if (prexstat == TNFCTL_ERR_BADARG) - prexstat = TNFCTL_ERR_INTERNAL; - return (prexstat); - } - - /* Double check that a file name doesn't already exist */ - preexisting = NULL; - prexstat = _tnfctl_readstr_targ(hndl, name_addr, &preexisting); - if (prexstat) { - if (preexisting) - free(preexisting); - return (prexstat); - } - - /* There better not be a file name there yet */ - assert(preexisting[0] == '\0'); - - /* paranoia - for optimized compilation */ - if (preexisting[0] != '\0') - return (TNFCTL_ERR_BUFEXISTS); - - /* free memory in preexisting string */ - if (preexisting) - free(preexisting); - - if (trace_file_size < hndl->trace_min_size) { - return (TNFCTL_ERR_SIZETOOSMALL); - } - - /* do we have an absolute, relative or no pathname specified? */ - if (trace_file_name == NULL) { - return (TNFCTL_ERR_BADARG); - } - if (trace_file_name[0] == '/') { - /* absolute path to tracefile specified */ - if ((strlen(trace_file_name) + 1) > (size_t) MAXPATHLEN) { - /* directory specification too long */ - return (TNFCTL_ERR_BADARG); - } - (void) strcpy(path, trace_file_name); - } else { - char *cwd; - - /* relative path to tracefile specified */ - cwd = getcwd(NULL, MAXPATHLEN); - if (!cwd) { - return (tnfctl_status_map(errno)); - } - if ((strlen(cwd) + 1 + strlen(trace_file_name) + 1) > - (size_t) MAXPATHLEN) { - /* path name too long */ - return (TNFCTL_ERR_BADARG); - } - (void) sprintf(path, "%s/%s", cwd, trace_file_name); - - free(cwd); - } - - outsize = trace_file_size; - - DBG_TNF_PROBE_2(_tnfctl_create_tracefile_1, "libtnfctl", - "sunw%verbosity 1; sunw%debug 'setting trace file name'", - tnf_string, tracefile_name, path, - tnf_long, tracefile_size, outsize); - - /* unlink a previous tracefile (if one exists) */ - (void) unlink(path); - - /* create the new tracefile */ - fd = open(path, O_CREAT | O_RDWR | O_TRUNC, 0644); - if (fd < 0) { - return (tnfctl_status_map(errno)); - } - - /* zero fill the file */ - (void) memset(zerobuf, 0, ZBUFSZ); - sz = ZBUFSZ; - for (i = 0; i < outsize; i += sz) { - ulong_t retval; - - sz = ((outsize - i) > ZBUFSZ) ? ZBUFSZ : (outsize - i); - retval = write(fd, zerobuf, sz); - if (retval != sz) { - /* trouble zeroing tracefile */ - return (tnfctl_status_map(errno)); - } - } - - /* close the file */ - (void) close(fd); - - /* write the tracefile name and size into the target process */ - miscstat = hndl->p_write(hndl->proc_p, name_addr, path, - strlen(path) + 1); - if (miscstat != 0) - return (TNFCTL_ERR_INTERNAL); - miscstat = hndl->p_write(hndl->proc_p, size_addr, &outsize, - sizeof (outsize)); - if (miscstat != 0) - return (TNFCTL_ERR_INTERNAL); - - hndl->trace_file_name = strdup(path); - if (hndl->trace_file_name == NULL) - return (TNFCTL_ERR_ALLOCFAIL); - hndl->trace_buf_size = outsize; - hndl->trace_buf_state = TNFCTL_BUF_OK; - return (TNFCTL_ERR_NONE); -} /* end _tnfctl_create_tracefile */ - -/* - * find_trace_file_info() - * finds out information about the trace file. - * side effects trace_buf_size, trace_min_size, trace_file_name in hndl - */ - -static tnfctl_errcode_t -find_trace_file_info(tnfctl_handle_t *hndl) -{ - tnfctl_errcode_t prexstat; - int miscstat; - char *preexisting; - uintptr_t name_addr, size_addr, min_addr; - uint_t outsize, minoutsize; - - /* find the neccessary symbols in the target */ - prexstat = _tnfctl_sym_find(hndl, TRACEFILE_NAME, &name_addr); - if (prexstat) { - if (prexstat == TNFCTL_ERR_BADARG) - prexstat = TNFCTL_ERR_INTERNAL; - return (prexstat); - } - prexstat = _tnfctl_sym_find(hndl, TRACEFILE_SIZE, &size_addr); - if (prexstat) { - if (prexstat == TNFCTL_ERR_BADARG) - prexstat = TNFCTL_ERR_INTERNAL; - return (prexstat); - } - prexstat = _tnfctl_sym_find(hndl, TRACEFILE_MIN, &min_addr); - if (prexstat) { - if (prexstat == TNFCTL_ERR_BADARG) - prexstat = TNFCTL_ERR_INTERNAL; - return (prexstat); - } - - /* read file name */ - preexisting = NULL; - prexstat = _tnfctl_readstr_targ(hndl, name_addr, &preexisting); - if (prexstat) { - if (preexisting) - free(preexisting); - return (prexstat); - } - - /* read the minimum file size from the target */ - miscstat = hndl->p_read(hndl->proc_p, min_addr, &minoutsize, - sizeof (minoutsize)); - if (miscstat != 0) - return (TNFCTL_ERR_INTERNAL); - hndl->trace_min_size = minoutsize; - - /* if there is no filename, we are done */ - if (preexisting[0] == '\0') { - hndl->trace_file_name = NULL; - hndl->trace_buf_size = 0; - } else { - hndl->trace_file_name = preexisting; - /* read size of file */ - miscstat = hndl->p_read(hndl->proc_p, size_addr, - &outsize, sizeof (outsize)); - if (miscstat != 0) - return (TNFCTL_ERR_INTERNAL); - hndl->trace_buf_size = outsize; - } - - return (TNFCTL_ERR_NONE); -} /* end find_trace_file_info */ - -/* - * wrapper functions over native /proc functions implemented by proc - * layer - */ -int -_tnfctl_read_targ(void *proc_p, uintptr_t addr, void *buf, size_t size) -{ - return (prb_proc_read(proc_p, addr, buf, size)); -} - -int -_tnfctl_write_targ(void *proc_p, uintptr_t addr, void *buf, size_t size) -{ - return (prb_proc_write(proc_p, addr, buf, size)); -} - -int -_tnfctl_loadobj_iter(void *proc_p, tnfctl_ind_obj_f *func, void *client_data) -{ - prb_loadobj_f *same_func = (prb_loadobj_f *) func; - - return (prb_loadobj_iter(proc_p, same_func, client_data)); -} - -pid_t -_tnfctl_pid_get(void *proc_p) -{ - return (prb_proc_pid_get(proc_p)); -} - -/* - * _tnfctl_readstr_targ() - dereferences a string in the target - * NOTE: There is a similar routine called prb_proc_readstr() - * used by proc layer. It would be better if there was only - * one of these functions defined. - */ - -#define BUFSZ 256 - -tnfctl_errcode_t -_tnfctl_readstr_targ(tnfctl_handle_t *hndl, uintptr_t addr, char **outstr_pp) -{ - int retstat; - int bufsz = BUFSZ; - char buffer[BUFSZ + 1]; - offset_t offset; - char *ptr, *orig_ptr; - - *outstr_pp = NULL; - offset = 0; - - /* allocate an inital return buffer */ - ptr = (char *) malloc(BUFSZ); - if (!ptr) { - DBG((void) fprintf(stderr, - "_tnfctl_readstr_targ: malloc failed\n")); - return (TNFCTL_ERR_ALLOCFAIL); - } - /*LINTED constant in conditional context*/ - while (1) { - int i; - - /* read a chunk into our buffer */ - retstat = hndl->p_read(hndl->proc_p, addr + offset, buffer, - bufsz); - if (retstat != 0) { - - /* - * if we get into trouble with a large read, try again - * with a single byte. Subsequent failiure is real ... - */ - if (bufsz > 1) { - bufsz = 1; - continue; - } - - DBG((void) fprintf(stderr, - "_tnfctl_readstr_targ: target read failed: \n")); - free(ptr); - return (TNFCTL_ERR_INTERNAL); - } - /* copy the chracters into the return buffer */ - for (i = 0; i < bufsz; i++) { - char c = buffer[i]; - - ptr[offset + i] = c; - if (c == '\0') { - /* hooray! we saw the end of the string */ - *outstr_pp = ptr; - return (TNFCTL_ERR_NONE); - } - } - - /* bummer, need to grab another bufsz characters */ - offset += bufsz; - orig_ptr = ptr; - ptr = (char *) realloc(ptr, offset + bufsz); - if (!ptr) { - free(orig_ptr); - DBG((void) fprintf(stderr, - "_tnfctl_readstr_targ: realloc failed\n")); - return (TNFCTL_ERR_ALLOCFAIL); - } - } - -#if defined(lint) - return (TNFCTL_ERR_NONE); -#endif - -} diff --git a/usr/src/lib/libtnfprobe/Makefile b/usr/src/lib/libtnfprobe/Makefile deleted file mode 100644 index 25c3e8a3ed..0000000000 --- a/usr/src/lib/libtnfprobe/Makefile +++ /dev/null @@ -1,64 +0,0 @@ -# -# 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 2006 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# - -include ../Makefile.lib - -SUBDIRS = $(MACH) -$(BUILD64)SUBDIRS += $(MACH64) - -# conditional assignments -all := TARGET = all -install := TARGET = install -clean := TARGET = clean -clobber := TARGET = clobber - -#definitions for install_h target -HDRS= com.h writer.h probe.h -ROOTHDRDIR= $(ROOT)/usr/include/tnf -ROOTHDRS= $(HDRS:%=$(ROOTHDRDIR)/%) -CHECKHDRS= $(HDRS:%.h=%.check) -$(ROOTHDRS) := FILEMODE = 0644 -CHECKHDRS = $(HDRS:%.h=%.check) - -.KEEP_STATE: - -all install clean clobber: $(SUBDIRS) - -install_h: $(ROOTHDRDIR) $(ROOTHDRS) - -check: $(CHECKHDRS) - -$(ROOTLIBDIR) $(ROOTHDRDIR): - $(INS.dir) - -$(ROOTHDRDIR)/% : % - $(INS.file) - -$(SUBDIRS): FRC - @cd $@; pwd; $(MAKE) $(TARGET) - -FRC: - -include ../Makefile.targ diff --git a/usr/src/lib/libtnfprobe/Makefile.com b/usr/src/lib/libtnfprobe/Makefile.com deleted file mode 100644 index f910244e26..0000000000 --- a/usr/src/lib/libtnfprobe/Makefile.com +++ /dev/null @@ -1,104 +0,0 @@ -# -# 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 (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. -# -# Copyright (c) 2019, Joyent, Inc. - -LIBRARY= libtnfprobe.a -VERS= .1 -OBJECTS.c= tnf_buf.o \ - trace_init.o \ - trace_funcs.o \ - debug_funcs.o \ - probe_mem.o \ - tnf_args.o \ - tnf_trace.o \ - probe_cntl.o - -UFSDIR= $(SRC)/uts/common/tnf -UFSOBJS= tnf_writer.o tnf_probe.o - -OBJECTS.s= $(MACH)_locks.o - -OBJECTS= $(OBJECTS.c) $(UFSOBJS) $(OBJECTS.s) - -include ../../Makefile.lib - -LIBS= $(DYNLIB) - -DYNFLAGS += $(ZINTERPOSE) - -HDRS= com.h writer.h probe.h -ROOTHDRDIR= $(ROOT)/usr/include/tnf -ROOTHDRS= $(HDRS:%=$(ROOTHDRDIR)/%) -CHECKHDRS= $(HDRS:%.h=%.check) -$(ROOTHDRS) := FILEMODE = 0644 -CHECKHDRS = $(HDRS:%.h=%.check) - -# Include .. first to pick up tnf_trace.h in current dir, Include UFSDIR to -# pick up tnf_types.h -CPPFLAGS += -I.. -I$(UFSDIR) -D_REENTRANT -D_TNF_LIBRARY - - -CERRWARN += -_gcc=-Wno-unused-variable -CERRWARN += -_gcc=-Wno-parentheses -CERRWARN += $(CNOWARN_UNINIT) - -# not linted -SMATCH=off - -$(ROOTHDRS) := FILEMODE = 644 - -LDLIBS += -lc - -.KEEP_STATE: - -all: $(LIBS) - -install_h: $(ROOTHDRDIR) $(ROOTHDRS) - - -check: $(CHECKHDRS) - -$(ROOTLIBDIR) $(ROOTHDRDIR): - $(INS.dir) - -$(ROOTHDRDIR)/% : % - $(INS.file) - -#ASFLAGS= $(AS_PICFLAGS) -P -D_SYS_SYS_S -D_LOCORE -D_ASM -DPIC -DLOCORE $(CPPFLAGS) -ASFLAGS= -P -D_SYS_SYS_S -D_LOCORE -D_ASM -DPIC -DLOCORE $(CPPFLAGS) -BUILD.s= $(AS) $(ASFLAGS) $< -o $@ - -objs/%.o pics/%.o: ../%.s - $(COMPILE.s) -o $@ $< - $(POST_PROCESS_S_O) - -pics/%.o objs/%.o: ../%.c - $(COMPILE.c) -o $@ $< - $(POST_PROCESS_O) - -pics/%.o objs/%.o: $(UFSDIR)/%.c - $(COMPILE.c) -o $@ $< - $(POST_PROCESS_O) - -include ../../Makefile.targ diff --git a/usr/src/lib/libtnfprobe/amd64/Makefile b/usr/src/lib/libtnfprobe/amd64/Makefile deleted file mode 100644 index 3f238e6cae..0000000000 --- a/usr/src/lib/libtnfprobe/amd64/Makefile +++ /dev/null @@ -1,33 +0,0 @@ -# -# 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 2006 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# -# ident "%Z%%M% %I% %E% SMI" -# - -include ../Makefile.com -include ../../Makefile.lib.64 - -.KEEP_STATE: - -install: all $(ROOTLIBS64) $(ROOTLINKS64) diff --git a/usr/src/lib/libtnfprobe/com.h b/usr/src/lib/libtnfprobe/com.h deleted file mode 100644 index 62e04c26eb..0000000000 --- a/usr/src/lib/libtnfprobe/com.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#ifndef _TNF_COM_H -#define _TNF_COM_H - -#pragma ident "%Z%%M% %I% %E% SMI" - -#include <sys/tnf_com.h> - -#endif /* _TNF_COM_H */ diff --git a/usr/src/lib/libtnfprobe/debug_funcs.c b/usr/src/lib/libtnfprobe/debug_funcs.c deleted file mode 100644 index d418ecc092..0000000000 --- a/usr/src/lib/libtnfprobe/debug_funcs.c +++ /dev/null @@ -1,211 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -/* - * Includes - */ - -#ifndef DEBUG -#define NDEBUG 1 -#endif - -#include <assert.h> -#include <limits.h> -#include <values.h> -#include <stdio.h> -#include <string.h> -#include <unistd.h> - -#include <tnf/probe.h> -#include "tnf_trace.h" -#include "tnf_args.h" - -/* - * tnf_probe_debug() - a debug final function - */ - -#define BUF_LIMIT 1024 -#define NAME_LIMIT 32 -#define ATTR_LIMIT 128 - -/* - * code coverage comment out - * #pragma covcc !instr - */ - -void -tnf_probe_debug(tnf_probe_setup_t *set_p) -{ - char tmp_buf[BUF_LIMIT]; - char *buf_p; - tnf_probe_control_t *probe_p; - const char *attr_start, *name_start, *name_end; - ulong_t attr_len; - int num_args, i, str_len, name_len; - void *arg_position; - tnf_arg_kind_t arg_type; - void *buffer; - - buf_p = tmp_buf; - probe_p = set_p->probe_p; - buffer = set_p->buffer_p; - - /* get the name of the probe */ - attr_start = tnf_probe_get_value(probe_p, "name", &attr_len); - assert(attr_start); - attr_len = (attr_len > (NAME_LIMIT - 1)) ? (NAME_LIMIT - 1) : attr_len; - str_len = sprintf(buf_p, "probe %.*s; ", attr_len, attr_start); - buf_p += str_len; - - /* get the sunw%debug attribute */ - attr_start = tnf_probe_get_value(probe_p, "sunw%debug", &attr_len); - if (attr_start) { - attr_len = (attr_len > (ATTR_LIMIT - 1)) ? - (ATTR_LIMIT - 1) : attr_len; - str_len = sprintf(buf_p, "sunw%%debug \"%.*s\"; ", - attr_len, attr_start); - buf_p += str_len; - } - - /* number of args ? we are done if there are only standard args */ - num_args = tnf_probe_get_num_args(probe_p); - if (num_args <= 2) { - (void) sprintf(buf_p, "\n"); - (void) write(STDERR_FILENO, tmp_buf, strlen(tmp_buf)); - return; - } - - /* get the slot names */ - name_start = tnf_probe_get_value(probe_p, "slots", &attr_len); - assert(name_start); - - num_args = tnf_probe_get_num_args(probe_p); - if (num_args <= 2) - return; - /* print each of the arguments to the probe */ - for (i = 2; i < num_args; i++) { - /* find slot names - number of spaces is equal to number of args */ - name_end = strchr(name_start, VAL_SEPARATOR); - /* LINTED - result is <= string length */ - name_len = name_end - name_start; - name_len = (name_len > (NAME_LIMIT - 1)) ? - (NAME_LIMIT - 1) : name_len; - str_len = sprintf(buf_p, "%.*s=", name_len, name_start); - buf_p += str_len; - name_start = name_end + 1; - - arg_position = tnf_probe_get_arg_indexed(probe_p, i, buffer); - arg_type = tnf_probe_get_type_indexed(probe_p, i); - - switch (arg_type) { - case TNF_UNKNOWN: - str_len = sprintf(buf_p, "<unknown>; "); - buf_p += str_len; - break; - case TNF_INT32: - str_len = sprintf(buf_p, "%ld; ", - tnf_probe_get_int(arg_position)); - buf_p += str_len; - break; - case TNF_UINT32: - str_len = sprintf(buf_p, "%lu; ", - tnf_probe_get_uint(arg_position)); - buf_p += str_len; - break; - case TNF_INT64: - /* LINTED malformed format string */ - str_len = sprintf(buf_p, "%lld; ", - tnf_probe_get_longlong(arg_position)); - buf_p += str_len; - break; - case TNF_UINT64: - /* LINTED malformed format string */ - str_len = sprintf(buf_p, "%llu; ", - tnf_probe_get_ulonglong(arg_position)); - buf_p += str_len; - break; - case TNF_FLOAT32: - str_len = sprintf(buf_p, "%f; ", - tnf_probe_get_float(arg_position)); - buf_p += str_len; - break; - case TNF_FLOAT64: - str_len = sprintf(buf_p, "%f; ", - tnf_probe_get_double(arg_position)); - buf_p += str_len; - break; - case TNF_STRING: - attr_start = tnf_probe_get_chars(arg_position); - attr_len = strlen(attr_start); - attr_len = (attr_len > (ATTR_LIMIT - 1)) ? (ATTR_LIMIT - 1) : - attr_len; - str_len = sprintf(buf_p, "\"%.*s\"; ", attr_len, attr_start); - buf_p += str_len; - break; - case TNF_ARRAY: - /* no break */ - case TNF_STRUCT: - /* no break */ - case TNF_OPAQUE: - str_len = sprintf(buf_p, "0x%lx; ", - tnf_probe_get_ulong(arg_position)); - buf_p += str_len; - break; - default: - str_len = sprintf(buf_p, "<error>; "); - buf_p += str_len; - break; - } - } - - (void) sprintf(buf_p, "\n"); - (void) write(STDERR_FILENO, tmp_buf, strlen(tmp_buf)); - - return; - -} /* end tnf_probe_debug */ - - -/* - * code coverage comment out - * #pragma covcc instr - */ - -#ifdef TESTING -/* - * tnf_probe_empty() - an empty final function - */ - -/*ARGSUSED0*/ -void -tnf_probe_empty(tnf_probe_setup_t *set_p) -{ - - return; - -} /* end tnf_probe_empty */ -#endif diff --git a/usr/src/lib/libtnfprobe/i386/Makefile b/usr/src/lib/libtnfprobe/i386/Makefile deleted file mode 100644 index 50dd2a7dd7..0000000000 --- a/usr/src/lib/libtnfprobe/i386/Makefile +++ /dev/null @@ -1,32 +0,0 @@ -# -# 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 2006 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# -# ident "%Z%%M% %I% %E% SMI" -# - -include ../Makefile.com - -.KEEP_STATE: - -install: all $(ROOTLIBS) $(ROOTLINKS) diff --git a/usr/src/lib/libtnfprobe/i386_locks.s b/usr/src/lib/libtnfprobe/i386_locks.s deleted file mode 100644 index 6545823b80..0000000000 --- a/usr/src/lib/libtnfprobe/i386_locks.s +++ /dev/null @@ -1,62 +0,0 @@ -/* - * 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 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 2004 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - - .ident "%Z%%M% %I% %E% SMI" - -#include <sys/asm_linkage.h> - .file "i386_locks.s" - ENTRY(tnfw_b_get_lock) -#if defined (__amd64) - /* XX64 - fix me */ -#else - movl 4(%esp), %edx - subl %eax, %eax - lock - btsl $0, (%edx) - jnc .L1 - incl %eax -.L1: -#endif - ret - - ENTRY(tnfw_b_clear_lock) -#if defined (__amd64) - /* XX64 - fix me */ -#else - movl 4(%esp), %eax - movb $0, (%eax) -#endif - ret - - ENTRY(tnfw_b_atomic_swap) -#if defined (__amd64) - /* XX64 - fix me */ -#else - movl 4(%esp), %edx - movl 8(%esp), %eax - xchgl %eax, (%edx) -#endif - ret diff --git a/usr/src/lib/libtnfprobe/inc.flg b/usr/src/lib/libtnfprobe/inc.flg deleted file mode 100644 index ffd340776f..0000000000 --- a/usr/src/lib/libtnfprobe/inc.flg +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh -# -# 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 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 -# -#ident "%Z%%M% %I% %E% SMI" - -echo_file usr/src/uts/common/tnf/tnf_writer.c -echo_file usr/src/uts/common/tnf/tnf_types.h -echo_file usr/src/uts/common/tnf/tnf_probe.c diff --git a/usr/src/lib/libtnfprobe/mapfile-vers b/usr/src/lib/libtnfprobe/mapfile-vers deleted file mode 100644 index e0be7e0492..0000000000 --- a/usr/src/lib/libtnfprobe/mapfile-vers +++ /dev/null @@ -1,281 +0,0 @@ -# -# 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 (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. -# - -# -# MAPFILE HEADER START -# -# WARNING: STOP NOW. DO NOT MODIFY THIS FILE. -# Object versioning must comply with the rules detailed in -# -# usr/src/lib/README.mapfiles -# -# You should not be making modifications here until you've read the most current -# copy of that file. If you need help, contact a gatekeeper for guidance. -# -# MAPFILE HEADER END -# - -$mapfile_version 2 - -SYMBOL_VERSION SUNWprivate_1.1 { - global: - fork { FLAGS = NODIRECT; }; - fork1; - pthread_create; - pthread_exit; - _resume_ret; - thr_create; - thr_exit; - tnf_allocate; - tnf_char_tag_data { - ASSERT = { - TYPE = OBJECT; - SIZE = addrsize; - }; - }; - tnf_float32_tag_data { - ASSERT = { - TYPE = OBJECT; - SIZE = addrsize; - }; - }; - tnf_float64_tag_data { - ASSERT = { - TYPE = OBJECT; - SIZE = addrsize; - }; - }; - tnf_int16_tag_data { - ASSERT = { - TYPE = OBJECT; - SIZE = addrsize; - }; - }; - tnf_int32_tag_data { - ASSERT = { - TYPE = OBJECT; - SIZE = addrsize; - }; - }; - tnf_int64_tag_data { - ASSERT = { - TYPE = OBJECT; - SIZE = addrsize; - }; - }; - tnf_int8_tag_data { - ASSERT = { - TYPE = OBJECT; - SIZE = addrsize; - }; - }; - tnf_lwpid_tag_data { - ASSERT = { - TYPE = OBJECT; - SIZE = addrsize; - }; - }; - tnf_name_tag_data { - ASSERT = { - TYPE = OBJECT; - SIZE = addrsize; - }; - }; - tnf_non_threaded_test_addr { - ASSERT = { - TYPE = OBJECT; - SIZE = addrsize; - }; - }; - tnf_opaque_tag_data { - ASSERT = { - TYPE = OBJECT; - SIZE = addrsize; - }; - }; - tnf_pid_tag_data { - ASSERT = { - TYPE = OBJECT; - SIZE = addrsize; - }; - }; - __tnf_probe_alloc; - tnf_probe_debug; - tnf_probe_event_tag_data { - ASSERT = { - TYPE = OBJECT; - SIZE = addrsize; - }; - }; - tnf_probe_get_arg_indexed; - tnf_probe_get_chars; - tnf_probe_get_num_args; - tnf_probe_get_type_indexed; - tnf_probe_get_value; - __tnf_probe_list_head { - ASSERT = { - TYPE = OBJECT; - SIZE = addrsize; - }; - }; - __tnf_probe_list_valid { - ASSERT = { - TYPE = OBJECT; - SIZE = 4; - }; - }; - __tnf_probe_memseg_p { - ASSERT = { - TYPE = OBJECT; - SIZE = addrsize; - }; - }; - __tnf_probe_notify; - __tnf_probe_thr_sync { - ASSERT = { - TYPE = OBJECT; - SIZE = addrsize; - }; - }; - __tnf_probe_version_1_info { - ASSERT = { - TYPE = OBJECT; - SIZE = addrsize[2]; - }; - }; - tnf_process_disable; - tnf_process_enable; - tnf_ref32_1; - tnf_size_tag_data { - ASSERT = { - TYPE = OBJECT; - SIZE = addrsize; - }; - }; - tnf_string_1; - tnf_string_tag_data { - ASSERT = { - TYPE = OBJECT; - SIZE = addrsize; - }; - }; - tnf_struct_tag_1; - tnf_tag_tag_data { - ASSERT = { - TYPE = OBJECT; - SIZE = addrsize; - }; - }; - __tnf_tag_version_1_info { - ASSERT = { - TYPE = OBJECT; - SIZE = addrsize[2]; - }; - }; - tnf_thread_disable; - tnf_threaded_test_addr { - ASSERT = { - TYPE = OBJECT; - SIZE = addrsize; - }; - }; - tnf_thread_enable; - tnf_time_base_tag_data { - ASSERT = { - TYPE = OBJECT; - SIZE = addrsize; - }; - }; - tnf_time_delta_tag_data { - ASSERT = { - TYPE = OBJECT; - SIZE = addrsize; - }; - }; - tnf_trace_alloc; - tnf_trace_commit; - tnf_trace_end; - tnf_trace_file_min { - ASSERT = { - TYPE = OBJECT; - SIZE = 4; - }; - }; - tnf_trace_file_name { - ASSERT = { - TYPE = OBJECT; - SIZE = 1024; - }; - }; - tnf_trace_file_size { - ASSERT = { - TYPE = OBJECT; - SIZE = 4; - }; - }; - tnf_trace_rollback; - tnf_uint16_tag_data { - ASSERT = { - TYPE = OBJECT; - SIZE = addrsize; - }; - }; - tnf_uint32_tag_data { - ASSERT = { - TYPE = OBJECT; - SIZE = addrsize; - }; - }; - tnf_uint64_tag_data { - ASSERT = { - TYPE = OBJECT; - SIZE = addrsize; - }; - }; - tnf_uint8_tag_data { - ASSERT = { - TYPE = OBJECT; - SIZE = addrsize; - }; - }; - tnf_user_struct_properties { - ASSERT = { - TYPE = OBJECT; - SIZE = addrsize; - }; - }; - _tnfw_b_control { - ASSERT = { - TYPE = OBJECT; - SIZE = addrsize; - }; - }; - -$if _sparc - thr_stksegment; -$endif - - local: - *; -}; diff --git a/usr/src/lib/libtnfprobe/prb_internals.h b/usr/src/lib/libtnfprobe/prb_internals.h deleted file mode 100644 index 8cd672e395..0000000000 --- a/usr/src/lib/libtnfprobe/prb_internals.h +++ /dev/null @@ -1,88 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#ifndef _PRB_INTERNALS_H -#define _PRB_INTERNALS_H - -#pragma ident "%Z%%M% %I% %E% SMI" - -/* - * Includes - */ - -#include <synch.h> - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Notes: - * - * There is a memseg statically allocated in libtnfprobe. This memory is - * consumed by the internal and external probe control fucntions for - * initial_final blocks, and compositions. - * - * There is no mechanism for freeing this memory; it is leaked. This is - * because the overhead involved to protect uses of old memory is too - * high for probes. - * - * The target program internally allocates memory from the bottom edge of - * the segment, and the external program allocates from the high edge of - * the segment. - * - * The i_reqsz field is set by the internal memory allocation routine - * while it is allocating. If the external process happens to freeze the - * target process while it is in the middle of an internal allocation the - * i_reqsz field allows the external process to be extra conservative in - * avoiding a memory collision. - */ - -/* - * Typedefs - */ - -typedef struct tnf_memseg -{ - char * min_p; /* points to min free byte */ - char * max_p; /* points past max free byte */ - - mutex_t i_lock; /* internal sync lock */ - size_t i_reqsz; /* internal request size */ - -} tnf_memseg_t; - - -/* - * Declarations - */ - -char * __tnf_probe_alloc(size_t size); - -#ifdef __cplusplus -} -#endif - -#endif /* _PRB_INTERNALS_H */ diff --git a/usr/src/lib/libtnfprobe/probe.h b/usr/src/lib/libtnfprobe/probe.h deleted file mode 100644 index 6aeb1eafe8..0000000000 --- a/usr/src/lib/libtnfprobe/probe.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#ifndef _TNF_PROBE_H -#define _TNF_PROBE_H - -#pragma ident "%Z%%M% %I% %E% SMI" - -#include <tnf/writer.h> -#include <sys/tnf_probe.h> - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Interface for enabling/disabling tracing for the process. - */ -void tnf_process_disable(void); -void tnf_process_enable(void); - -/* - * Interface for enabling/disabling tracing for the calling thread. - */ -void tnf_thread_disable(void); -void tnf_thread_enable(void); - -#ifdef __cplusplus -} -#endif - -#endif /* _TNF_PROBE_H */ diff --git a/usr/src/lib/libtnfprobe/probe_cntl.c b/usr/src/lib/libtnfprobe/probe_cntl.c deleted file mode 100644 index b7339f6a36..0000000000 --- a/usr/src/lib/libtnfprobe/probe_cntl.c +++ /dev/null @@ -1,806 +0,0 @@ -/* - * 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 2007 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -/* - * Includes - */ - -#ifndef DEBUG -#define NDEBUG 1 -#endif - -#include <thread.h> -#include <pthread.h> -#include <sys/lwp.h> -#include <synch.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <sys/param.h> -#include <fcntl.h> -#include <dlfcn.h> -#include <string.h> -#include <unistd.h> -#include <stdlib.h> -#include <assert.h> -#include <stdio.h> -#include <errno.h> -#ifdef sparc -#include <setjmp.h> -#endif /* sparc */ - -#include "tnf_trace.h" - -/* - * Typedefs - */ - -typedef tnf_ops_t *(*tnf_context_t)(void); - -typedef void * (*start_func_t)(void *arg); - -typedef int (*tnf_thr_create_func_t)(void *stk, - size_t stksize, - start_func_t startfunc, - void *arg, - long flags, - thread_t *newthread); - -typedef int (*tnf_pthread_create_func_t)(pthread_t *thr, - const pthread_attr_t *attr, - start_func_t startfunc, - void * arg); - -typedef void (*tnf_thr_exit_func_t)(void *) __NORETURN; - -typedef void (*tnf_pthread_exit_func_t)(void *) __NORETURN; - -typedef pid_t (*fork_t)(void); - -typedef int (*tnf_thr_stksegment_func_t)(stack_t *s); - -typedef struct args { - start_func_t real_func; - void *real_arg; -} args_t; - -/* - * Local Declarations - */ - -static void * tnf_threaded_test(void *dummy, - tnf_probe_control_t *probe_p, - tnf_probe_setup_t *set_p); -static void * tnf_non_threaded_test(void *dummy, - tnf_probe_control_t *probe_p, - tnf_probe_setup_t *set_p); -static tnf_ops_t *tnf_probe_getfunc(void); -static void *probestart(void *arg); -static pid_t common_fork(fork_t real_fork); -static void probe_setup(void *data); -static tnf_ops_t *tnf_get_ops(); - -/* - * Static Globals - */ - -extern tnf_ops_t tnf_trace_initial_tpd; -static void *tpd = &tnf_trace_initial_tpd; -#ifdef sparc -static size_t tnf_probe_dsize = 0; -#endif /* sparc */ - -/* - * Project Private interfaces: - * These are interfaces between prex and libtnfw, or - * between libtnfw and libtthread. - */ - -/* variable indicates if libtnfw has sync'ed up with libthread or not */ -long __tnf_probe_thr_sync = 0; - -/* head of the list that is used to chain all probes */ -tnf_probe_control_t *__tnf_probe_list_head = NULL; -int __tnf_probe_list_valid = 0; - -/* notify function that libthread calls after primordial thread is created */ -void __tnf_probe_notify(void); - -tnf_probe_test_func_t tnf_threaded_test_addr = tnf_threaded_test; -tnf_probe_test_func_t tnf_non_threaded_test_addr = tnf_non_threaded_test; - - -/* - * Externs - */ -#pragma weak thr_probe_getfunc_addr -extern tnf_context_t thr_probe_getfunc_addr; - -#pragma weak thr_probe_setup -extern void thr_probe_setup(void *); - -/* ---------------------------------------------------------------- */ -/* ----------------------- Public Functions ----------------------- */ -/* ---------------------------------------------------------------- */ - -/* - * probe_setup() - the thread probe setup function for the non-threaded - * case. - */ -static void -probe_setup(void *data) -{ -#ifdef DEBUG - /* #### - TEMPORARY */ - fprintf(stderr, "probe_setup: \n"); -#endif - tpd = data; - -} /* end probe_setup */ - -/* - * __tnf_probe_notify() - libthread calls this function to notify us - * that the primordial thread has been created. - */ - -void -__tnf_probe_notify(void) -{ - tnf_probe_control_t *prbctl_p; - tnf_probe_test_func_t test_func; - - /* paranoia: thr_probe_setup should be defined */ - assert(thr_probe_setup != 0); - if (thr_probe_setup != 0) thr_probe_setup(tpd); - - /* - * no race with prex if we set flag first - * - this is an idempotent operation - */ - __tnf_probe_thr_sync = 1; - -#ifdef DEBUG - { - char tmp_buf[512]; - (void) sprintf(tmp_buf, "__tnf_probe_notify: \n"); - (void) write(2, tmp_buf, strlen(tmp_buf)); - } -#endif - /* - * Use dlsym to test for the present of "thr_probe_getfunc_addr" . - */ - - test_func = (((int(*)())dlsym(RTLD_DEFAULT, - "thr_probe_getfunc_addr")) != NULL) ? tnf_threaded_test : 0; - - assert(test_func); - - /* - * I think in this case that we do not need to check the - * __tnf_probe_list_valid flag since __tnf_probe_notify is - * called very early. - */ - - /* replace all existing test functions with libthread's test func */ - for (prbctl_p = __tnf_probe_list_head; prbctl_p; - prbctl_p = prbctl_p->next) - if (prbctl_p->test_func) - prbctl_p->test_func = test_func; - - return; - -} /* end __tnf_probe_notify */ - -/* - * _tnf_fork_thread_setup - function called by buffering layer - * whenever it finds a thread in the newly forked process that - * hasn't been re-initialized in this process. - */ -void -_tnf_fork_thread_setup(void) -{ - tnf_ops_t *ops; - -#ifdef DEBUGFUNCS - { - char tmp_buf[512]; - (void) sprintf(tmp_buf, "in _tnf_fork_thread_setup: \n"); - (void) write(2, tmp_buf, strlen(tmp_buf)); - } -#endif - /* get the tpd */ - ops = tnf_get_ops(); - if (!ops) - return; - /* null out tag_index, so that a new one is initialized and written */ - ops->schedule.record_p = 0; - return; - -} - -/* ---------------------------------------------------------------- */ -/* ---------------------- Interposed Functions -------------------- */ -/* ---------------------------------------------------------------- */ - -/* - * thr_create() - this function is interposed in front of the - * actual thread create function in libthread. - */ - -int -thr_create(void *stk, - size_t stksize, - void * (*real_func)(void *), - void *real_arg, - long flags, - thread_t *new_thread) -{ - static tnf_thr_create_func_t real_thr_create = NULL; - args_t *arg_p; - -#ifdef VERYVERBOSE - fprintf(stderr, "hello from the interposed thr_create parent\n"); -#endif - - /* use dlsym to find the address of the "real" thr_create function */ - if (real_thr_create == NULL) { - real_thr_create = (tnf_thr_create_func_t) - dlsym(RTLD_NEXT, "thr_create"); - } - assert(real_thr_create); - - /* set up the interposed argument block */ - arg_p = (args_t *)malloc(sizeof (args_t)); - assert(arg_p); - arg_p->real_func = real_func; - arg_p->real_arg = real_arg; - - return ((*real_thr_create)(stk, stksize, probestart, (void *) arg_p, - flags, new_thread)); - -} /* end thr_create */ - - -int -pthread_create(pthread_t *new_thread_id, - const pthread_attr_t *attr, - void * (*real_func)(void *), - void *real_arg) -{ - static tnf_pthread_create_func_t real_pthread_create = NULL; - args_t *arg_p; - -#ifdef VERYVERBOSE - fprintf(stderr, "hello from the interposed pthread_create parent\n"); -#endif - - /* use dlsym to find the address of the "real" pthread_create func */ - if (real_pthread_create == NULL) { - real_pthread_create = (tnf_pthread_create_func_t) - dlsym(RTLD_NEXT, "pthread_create"); - } - assert(real_pthread_create); - - /* set up the interposed argument block */ - arg_p = (args_t *)malloc(sizeof (args_t)); - assert(arg_p); - arg_p->real_func = real_func; - arg_p->real_arg = real_arg; - - return ((*real_pthread_create)(new_thread_id, attr, probestart, - (void *) arg_p)); - -} /* end pthread_create */ - -void -thr_exit(void * status) -{ - static tnf_thr_exit_func_t real_thr_exit = NULL; - /* use dlsym to find the address of the "real" pthread_create func */ - if (real_thr_exit == NULL) { - real_thr_exit = (tnf_thr_exit_func_t) - dlsym(RTLD_NEXT, "thr_exit"); - } - assert(real_thr_exit); - - - /* - * Calling tnf_thread_disable() whenever a thread exits... - * This has the side-effect of unlocking our currently - * locked block in the trace buffer. This keeps a dying - * thread from taking a block with it when it dies, but - * it means that we won't be able to trace events from - * the thread-specific data destructors. We will lose - * out on any events a thread spits out AFTER is calls thr_exit(). - * This code was added to fix a bug where tracing breaks when trying - * to trace a program with large numbers of thread-ids. - * - * Addendum: - * Now you can't get events for thr_exit using an interposition library. - * Since thr_exit is a really helpful event, this is a problem. - * Also, breaking this interposition will probably break - * BAT, the DevPro TNF perf tool. - * - * Addendum: - * Correction: You can get interposition events if the interposition - * library comes BEFORE libtnfprobe.so. But not, if the interp. - * library comes AFTER libtnfprobe.so. This is a more difficult - * constraint that it might sound like because of the following: - * The tnfctl functional interface and the prex command line - * interface provide convenience features where you can supply - * a character string argument which will be put into LD_PRELOAD - * for you. Unfortunately, this string gets appended AFTER - * libtnfprobe.so by the tnfctl library(and also hence by the - * prex -l option). - * Luckily, when libtnfprobe is added by the tnfctl library, it is - * added AFTER an existing contents of the LD_PRELOAD variable. - * - * Therefore, if you are using an interposition library to collect - * thr_exit and pthread_exit events, THEN you should NOT use 'prex -l' - * or the 'ld_preload' argument to tnfctl_exec_open(), instead, you - * should be sure to put the interposition library into the LD_PRELOAD - * variable yourself. - * - */ - - tnf_thread_disable(); - - ((*real_thr_exit)(status)); -} - -void -pthread_exit(void * status) -{ - static tnf_pthread_exit_func_t real_pthread_exit = NULL; - /* use dlsym to find the address of the "real" pthread_create func */ - if (real_pthread_exit == NULL) { - real_pthread_exit = (tnf_pthread_exit_func_t) - dlsym(RTLD_NEXT, "pthread_exit"); - } - assert(real_pthread_exit); - /* see the comment in thr_exit about tnf_thread_disable() */ - tnf_thread_disable(); - ((*real_pthread_exit)(status)); -} - -/* - * function to be interposed in front of _resume. We invalidate the - * schedule record in case the lwpid changes the next time this - * thread is scheduled. - */ - -#pragma weak _resume_ret = _tnf_resume_ret -void -_tnf_resume_ret(void *arg1) -{ - static void (*real_resume_ret)(void *) = NULL; - tnf_ops_t *ops; - - if (real_resume_ret == NULL) { - real_resume_ret = (void (*)(void *)) dlsym(RTLD_NEXT, - "_resume_ret"); - } - assert(real_resume_ret); - - ops = tnf_get_ops(); - if (ops) { - /* - * invalidate the schedule record. This forces it - * to get re-initialized with the new lwpid the next - * time this thread gets scheduled - */ - if (ops->schedule.lwpid != _lwp_self()) - ops->schedule.record_p = 0; - } - - real_resume_ret(arg1); -} - -/* - * Functions to be interposed in front of fork and fork1. - * - * NOTE: we can't handle vfork, because the child would ruin the parent's - * data structures. We therefore don't interpose, letting the child's - * events appear as though they were the parent's. A slightly cleaner - * way to handle vfork would be to interpose on vfork separately to - * change the pid and anything else needed to show any events caused - * by the child as its events, and then interpose on the exec's as - * well to set things back to the way they should be for the parent. - * But this is a lot of work, and it makes almost no difference, since the - * child typically exec's very quickly after a vfork. - */ - -#pragma weak fork = _tnf_fork -pid_t -_tnf_fork(void) -{ - static fork_t real_fork = NULL; - - if (real_fork == NULL) { - real_fork = (fork_t)dlsym(RTLD_NEXT, "fork"); - } - assert(real_fork); - return (common_fork(real_fork)); -} - -#pragma weak fork1 = _tnf_fork1 -pid_t -_tnf_fork1(void) -{ - static fork_t real_fork = NULL; - - if (real_fork == NULL) { - real_fork = (fork_t)dlsym(RTLD_NEXT, "fork1"); - } - assert(real_fork); - return (common_fork(real_fork)); -} - -#ifdef sparc -/* - * Function to be interposed in front of thr_stksegment - * _tnf_thr_stksegment() - used to hide the probestart() allocated data - * on the thread stack, ensuring that the caller receives a pointer to the - * true bottom (ie, usable) portion of the stack, and the size thereof. - * - * NOTE: On sparc systems, failure to allow for the presense of tnf data - * on the stack would cause TNF probes to fail across doorfs calls. The - * i386 version of door_return decides to "skip over some slop", so no - * interpose function is required for x86; if the 512 byte 'slop skip' - * is ever removed from the i386 door_return, then it will also need - * interpose function intervention. - * - * Note: Instead of making this function static, we reduce it to local - * scope in the mapfile. That allows the linker to prevent it from - * appearing in the .SUNW_dynsymsort section. - */ -#pragma weak thr_stksegment = _tnf_thr_stksegment -int -_tnf_thr_stksegment(stack_t *s) -{ - static tnf_thr_stksegment_func_t real_thr_stksegment = NULL; - int err; - -#ifdef VERYVERBOSE - fprintf(stderr, "hello from the interposed thr_stksegment\n"); -#endif - - if (real_thr_stksegment == NULL) { - real_thr_stksegment = (tnf_thr_stksegment_func_t) - dlsym(RTLD_NEXT, "thr_stksegment"); - } - assert(real_thr_stksegment); - - err = ((*real_thr_stksegment)(s)); - if (err == 0) { - s->ss_sp = (void *)((caddr_t)s->ss_sp - tnf_probe_dsize); - s->ss_size -= tnf_probe_dsize; - } - return (err); -} -#endif /* sparc */ - -/* ---------------------------------------------------------------- */ -/* ----------------------- Private Functions ---------------------- */ -/* ---------------------------------------------------------------- */ - -/* - * tnf_probe_getfunc() - default test function if libthread is not - * present - */ -static tnf_ops_t * -tnf_probe_getfunc(void) -{ - /* test function to be used if libthread is not linked in */ -#ifdef DEBUGFUNCS - { - char tmp_buf[512]; - (void) sprintf(tmp_buf, "tnf_probe_getfunc: \n"); - (void) write(2, tmp_buf, strlen(tmp_buf)); - } -#endif - return (tpd); -} /* end tnf_probe_getfunc */ - - -/* - * probestart() - this function is called as the start_func by the - * interposed thr_create() and pthread_create(). It calls the real start - * function. - */ - -static void * -probestart(void * arg) -{ - args_t *args_p = (args_t *)arg; - start_func_t real_func; - void *real_arg; - tnf_ops_t ops; /* allocated on stack */ - void *real_retval; - -#ifdef VERYVERBOSE - fprintf(stderr, "hello from the interposed thr_create child\n"); -#endif -#ifdef sparc - /* - * if the size of the probe data has not yet been calculated, - * initialize a jmpbuffer and calculate the amount of stack space - * used by probestart: %fp - %sp from jmp_buf - * Not expecting anything to actually longjmp here, so that is - * handled as an error condition. - */ - if (tnf_probe_dsize == 0) { - jmp_buf tnf_jmpbuf; - if (setjmp(tnf_jmpbuf) != 0) { - (void) write(2, - "probestart: unexpected longjmp\n", 32); - assert(0); - } - tnf_probe_dsize = (size_t)(tnf_jmpbuf[3] - tnf_jmpbuf[1]); - } -#endif /* sparc */ - - /* initialize ops */ - (void) memset(&ops, 0, sizeof (ops)); /* zero ops */ - ops.mode = TNF_ALLOC_REUSABLE; - ops.alloc = tnfw_b_alloc; - ops.commit = tnfw_b_xcommit; - ops.rollback = tnfw_b_xabort; - - /* copy (and free) the allocated arg block */ - real_func = args_p->real_func; - real_arg = args_p->real_arg; - free(args_p); - - /* paranoia: thr_probe_setup should be defined */ - assert(thr_probe_setup != 0); - if (thr_probe_setup != 0) thr_probe_setup(&ops); - -#ifdef VERYVERBOSE - fprintf(stderr, "in middle of interposed start procedure\n"); -#endif - - real_retval = (*real_func)(real_arg); - - /* - * we need to write a NULL into the tpd pointer to disable - * tracing for this thread. - * CAUTION: never make this function tail recursive because - * tpd is allocated on stack. - */ - - /* This should be handled by the call to tnf_thread_disable() */ - /* if (thr_probe_setup != 0) */ - /* thr_probe_setup(NULL); */ - - /* see the comment in thr_exit about tnf_thread_disable */ - tnf_thread_disable(); - - return (real_retval); - -} /* end probestart */ - - -static thread_key_t tpd_key = THR_ONCE_KEY; -static tnf_ops_t *stashed_tpd = NULL; - -/* - * tnf_thread_disable: API to disable a thread - */ -void -tnf_thread_disable(void) -{ - tnf_ops_t *ops; - - if (thr_probe_setup != 0) { - /* threaded client */ - - /* REMIND: destructor function ? */ - (void) thr_keycreate_once(&tpd_key, NULL); - /* get the tpd */ - ops = thr_probe_getfunc_addr(); - /* check ops to ensure function is idempotent */ - if (ops != NULL) { - /* unlock currently held blocks */ - tnfw_b_release_block(&ops->wcb); - /* disable the thread */ - thr_probe_setup(NULL); - /* stash the tpd */ - (void) thr_setspecific(tpd_key, ops); - } - } else { - /* non-threaded client */ - - /* get the tpd */ - ops = tnf_probe_getfunc(); - if (ops != NULL) { - /* disable the process */ - probe_setup(NULL); - /* stash the tpd */ - stashed_tpd = ops; - } - } -} - -/* - * tnf_thread_enable: API to enable a thread - */ -void -tnf_thread_enable(void) -{ - tnf_ops_t *ops; - - if (thr_probe_setup != 0) { - /* threaded client */ - - ops = pthread_getspecific(tpd_key); - if (ops) - thr_probe_setup(ops); - } else { - /* non-threaded client */ - - ops = stashed_tpd; - if (ops) - probe_setup(ops); - } -} - -/* - * common_fork - code that is common among the interpositions of - * fork, fork1, and vfork - */ -static pid_t -common_fork(fork_t real_fork) -{ - pid_t retval; - tnf_ops_t *ops; - tnf_tag_data_t *metatag_data; - -#ifdef DEBUGFUNCS - { - char tmp_buf[512]; - (void) sprintf(tmp_buf, "in interposed fork: \n"); - (void) write(2, tmp_buf, strlen(tmp_buf)); - } -#endif - if ((_tnfw_b_control->tnf_state == TNFW_B_NOBUFFER) && - (tnf_trace_file_name[0] != '\0')) { - /* - * if no buffer has been allocated yet, and prex plugged in - * name... - */ - ops = tnf_get_ops(); - if (ops == NULL) { - /* - * get it from stashed location - * don't enable thread though - */ - if (thr_probe_setup != 0) { - /* threaded client */ - ops = pthread_getspecific(tpd_key); - } else { - /* non-threaded client */ - ops = stashed_tpd; - } - } - - /* - * ops shouldn't be NULL. But, if it is, then we don't - * initialize tracing. In the child, tracing will be - * set to broken. - */ - if (ops) { - /* initialize tracing */ - ops->busy = 1; - metatag_data = TAG_DATA(tnf_struct_type); - metatag_data->tag_desc(ops, metatag_data); - /* commit the data */ - (void) ops->commit(&(ops->wcb)); - ops->busy = 0; - } - } - - retval = real_fork(); - if (retval == 0) { - /* child process */ - _tnfw_b_control->tnf_pid = getpid(); - if ((_tnfw_b_control->tnf_state == TNFW_B_NOBUFFER) && - (tnf_trace_file_name[0] != '\0')) { - /* - * race condition, prex attached after condition was - * checked in parent, so both parent and child point at - * the same file name and will overwrite each other. - * So, we set tracing to broken in child. We could - * invent a new state called RACE and use prex to - * reset it, if needed... - */ - tnf_trace_file_name[0] = '\0'; - _tnfw_b_control->tnf_state = TNFW_B_BROKEN; - } else if (_tnfw_b_control->tnf_state == TNFW_B_RUNNING) { - /* normal expected condition */ - _tnfw_b_control->tnf_state = TNFW_B_FORKED; - } - } - return (retval); -} - -/* - * tnf_threaded_test - */ -/*ARGSUSED0*/ -static void * -tnf_threaded_test(void *dummy, tnf_probe_control_t *probe_p, - tnf_probe_setup_t *set_p) -{ - tnf_ops_t *tpd_p; - - tpd_p = thr_probe_getfunc_addr(); - if (tpd_p) { - return (probe_p->alloc_func(tpd_p, probe_p, set_p)); - } - return (NULL); -} - - -/* - * tnf_non_threaded_test - */ -/*ARGSUSED0*/ -static void * -tnf_non_threaded_test(void *dummy, tnf_probe_control_t *probe_p, - tnf_probe_setup_t *set_p) -{ - tnf_ops_t *tpd_p; - - tpd_p = tnf_probe_getfunc(); - if (tpd_p) { - return (probe_p->alloc_func(tpd_p, probe_p, set_p)); - } - return (NULL); -} - -/* - * tnf_get_ops() returns the ops pointer (thread-private data), or NULL - * if tracing is disabled for this thread. - */ -static tnf_ops_t * -tnf_get_ops() -{ - tnf_context_t *test_func_p = &thr_probe_getfunc_addr; - tnf_context_t test_func; - - /* - * IMPORTANT: this test to see whether thr_probe_getfunc_addr - * is bound is tricky. The compiler currently has a bug - * (1263684) that causes the test to be optimized away unless - * coded with an intermediate pointer (test_func_p). This - * causes the process to SEGV when the variable is not bound. - */ - - test_func = test_func_p ? *test_func_p : tnf_probe_getfunc; - return ((*test_func)()); -} diff --git a/usr/src/lib/libtnfprobe/probe_mem.c b/usr/src/lib/libtnfprobe/probe_mem.c deleted file mode 100644 index 91e73350ab..0000000000 --- a/usr/src/lib/libtnfprobe/probe_mem.c +++ /dev/null @@ -1,80 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -/* - * Includes - */ - -#include "prb_internals.h" - - -/* - * Globals - * Memory that prex uses to store combinations in target process - */ - -#define INITMEMSZ 2048 - -static char initial_memory[INITMEMSZ]; -static tnf_memseg_t initial_memseg = { - initial_memory, - initial_memory + INITMEMSZ, - DEFAULTMUTEX, - 0 - }; - -tnf_memseg_t * __tnf_probe_memseg_p = &initial_memseg; - - -/* - * __tnf_probe_alloc() - allocates memory from the global pool - */ - -char * -__tnf_probe_alloc(size_t size) -{ - tnf_memseg_t * memseg_p = __tnf_probe_memseg_p; - char * ptr; - - ptr = NULL; - - mutex_lock(&memseg_p->i_lock); - - memseg_p->i_reqsz = size; - - if ((memseg_p->min_p + size) <= memseg_p->max_p) { - ptr = memseg_p->min_p; - memseg_p->min_p += size; - } - - memseg_p->i_reqsz = 0; - - mutex_unlock(&memseg_p->i_lock); - - return (ptr); - -} /* end __tnf_probe_alloc */ diff --git a/usr/src/lib/libtnfprobe/sparc/Makefile b/usr/src/lib/libtnfprobe/sparc/Makefile deleted file mode 100644 index 50dd2a7dd7..0000000000 --- a/usr/src/lib/libtnfprobe/sparc/Makefile +++ /dev/null @@ -1,32 +0,0 @@ -# -# 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 2006 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# -# ident "%Z%%M% %I% %E% SMI" -# - -include ../Makefile.com - -.KEEP_STATE: - -install: all $(ROOTLIBS) $(ROOTLINKS) diff --git a/usr/src/lib/libtnfprobe/sparc_locks.s b/usr/src/lib/libtnfprobe/sparc_locks.s deleted file mode 100644 index 8ca2b71e8b..0000000000 --- a/usr/src/lib/libtnfprobe/sparc_locks.s +++ /dev/null @@ -1,54 +0,0 @@ -/* - * 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 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 - */ -#pragma ident "%Z%%M% %I% %E% SMI" -/* - * Copyright (c) 1994, by Sun Microsytems, Inc. - */ - -#include <sys/asm_linkage.h> - - .file __FILE__ -/* - * int tnfw_b_get_lock(tnf_byte_lock_t *); - */ - ENTRY(tnfw_b_get_lock) - ldstub [%o0], %o1 - jmpl %o7+8, %g0 - mov %o1, %o0 - SET_SIZE(tnfw_b_get_lock) - -/* - * void tnfw_b_clear_lock(tnf_byte_lock_t *); - */ - ENTRY(tnfw_b_clear_lock) - jmpl %o7+8, %g0 - stb %g0, [%o0] - SET_SIZE(tnfw_b_clear_lock) - -/* - * u_long tnfw_b_atomic_swap(u_long *, u_long); - */ - ENTRY(tnfw_b_atomic_swap) - swap [%o0], %o1 - jmpl %o7+8, %g0 - mov %o1, %o0 - SET_SIZE(tnfw_b_atomic_swap) diff --git a/usr/src/lib/libtnfprobe/sparcv9/Makefile b/usr/src/lib/libtnfprobe/sparcv9/Makefile deleted file mode 100644 index 3f238e6cae..0000000000 --- a/usr/src/lib/libtnfprobe/sparcv9/Makefile +++ /dev/null @@ -1,33 +0,0 @@ -# -# 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 2006 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# -# ident "%Z%%M% %I% %E% SMI" -# - -include ../Makefile.com -include ../../Makefile.lib.64 - -.KEEP_STATE: - -install: all $(ROOTLIBS64) $(ROOTLINKS64) diff --git a/usr/src/lib/libtnfprobe/tnf_args.c b/usr/src/lib/libtnfprobe/tnf_args.c deleted file mode 100644 index 92b7451a2f..0000000000 --- a/usr/src/lib/libtnfprobe/tnf_args.c +++ /dev/null @@ -1,197 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -#ifndef DEBUG -#define NDEBUG 1 -#endif - -#include "tnf_trace.h" -#include "tnf_types.h" -#include "tnf_args.h" -#include <string.h> -#include <assert.h> - -/* - * tnf_probe_get_num_args: returns the number of arguments at probe site - * probe_p. This includes the first 2 args (tag and time delta) in the return - * value. - */ -int -tnf_probe_get_num_args(tnf_probe_control_t *probe_p) -{ - int count = 0; - tnf_tag_data_t ***tag_p; - - tag_p = probe_p->slot_types; - while (*tag_p) { - count++; - tag_p++; - } - return (count); -} - -/* - * tnf_probe_get_arg_indexed: returns a pointer into the buffer where - * argument i is stored. Returns NULL on error. Argument numbering is - * zero based i.e. to get the 3rd argument, the input value should be 2. - */ - -/* ALIGN_ROUNDUP: y has to be one less than a power of 2 eg. 3, 7, 15, etc. */ -#define ALIGN_ROUNDUP(x, y) (((x) + (y)) & ~(y)) - -void * -tnf_probe_get_arg_indexed(tnf_probe_control_t *probe_p, int index, void *buffer) -{ - int count = 0; - size_t align; - size_t elem_size = 0; - tnf_tag_data_t ***tag_ppp; - tnf_tag_data_t *tag_p; - unsigned long offset = 0; - - tag_ppp = probe_p->slot_types; - if (!tag_ppp) - return (NULL); - - while (count <= index) { - /* error checking. REMIND: Do we need it ? */ - if (!(*tag_ppp)) - return (NULL); - tag_p = **tag_ppp; - if (!tag_p) - return (NULL); - - offset = offset + elem_size; - align = tag_p->tag_align - 1; - assert(align != 0); - offset = ALIGN_ROUNDUP(offset, align); - /* get size of current element */ - elem_size = tag_p->tag_ref_size; - tag_ppp++; - count++; - } - - return ((void *)((char *)buffer + offset)); -} - -/* - * tnf_probe_get_type_indexed: returns the type of the ith argument. - * returns TNF_UNKNOWN on error. Argument numbering is zero based - * i.e. to get the 3rd argument, the input value should be 2. - */ - -tnf_arg_kind_t -tnf_probe_get_type_indexed(tnf_probe_control_t *probe_p, int index) -{ - tnf_tag_data_t ***tag_ppp; - tnf_tag_data_t *tag_p; - - tag_ppp = probe_p->slot_types + index; - if (!tag_ppp) - return (TNF_UNKNOWN); - if (!(*tag_ppp)) - return (TNF_UNKNOWN); - tag_p = **tag_ppp; - if (!tag_p) - return (TNF_UNKNOWN); - return (tag_p->tag_kind); -} - - -/* - * tnf_probe_get_value: returns the start of the value string that is - * associated with the input attribute. The number of characters in the - * value is also returned as the final argument. The size return value - * indicates the length of the string that is valid. Returns NULL on no - * match or error. - */ - -const char * -tnf_probe_get_value(tnf_probe_control_t *probe_p, char *attribute, -ulong_t *size) -{ - - const char *attr_start, *attr_end, *str_end; - const char *val_start; - int separator; - uint_t attr_len; - size_t input_len; - - input_len = strlen(attribute); - attr_start = probe_p->attrs; - assert(attr_start); - str_end = attr_start + strlen(attr_start); - separator = ATTR_SEPARATOR; - while (attr_start < str_end) { - attr_end = strchr(attr_start, separator); - if (!attr_end) { - /* last attribute */ - attr_end = str_end; - } - /* LINTED - result <= string length */ - attr_len = attr_end - attr_start; - - /* skip over leading white space */ - while (*attr_start && ((*attr_start == ' ') || - (*attr_start == '\t'))) { - attr_start++; - } - /* search for match on attribute */ - if (strncmp(attr_start, attribute, input_len) == 0) { - /* make sure next char is a space or semicolon */ - val_start = attr_start + input_len; - if (*val_start == ATTR_SEPARATOR) { - *size = 0; - return (val_start); - } else if (*val_start == VAL_SEPARATOR) { - /* +1 for val separator */ - *size = attr_len - (input_len + 1); - return (val_start + 1); - } - /* a false match - just continue */ - } - /* skip to next attribute */ - attr_start = attr_end + 1; - } - - /* no match */ - return (NULL); -} - -/* used by in-process argument reader */ -char * -tnf_probe_get_chars(void *slot) -{ - tnf_reference_t ref; - char *str_p; - - ref = *((tnf_reference_t *)slot); - assert(TNF_REF32_IS_FWD(ref)); - str_p = (char *)slot + TNF_REF32_VALUE(ref); - str_p += ARRAY_HDR_SIZE; - return (str_p); -} diff --git a/usr/src/lib/libtnfprobe/tnf_args.h b/usr/src/lib/libtnfprobe/tnf_args.h deleted file mode 100644 index b05356cd68..0000000000 --- a/usr/src/lib/libtnfprobe/tnf_args.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#ifndef _TNF_ARGS_H -#define _TNF_ARGS_H - -#pragma ident "%Z%%M% %I% %E% SMI" - -#include <tnf/probe.h> - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * In process interface for getting probe arguments and types and attributes - */ - -#define tnf_probe_get_int(x) (*((int *)(x))) -#define tnf_probe_get_uint(x) (*((unsigned int *)(x))) -#define tnf_probe_get_long(x) (*((long *)(x))) -#define tnf_probe_get_ulong(x) (*((unsigned long *)(x))) -#define tnf_probe_get_longlong(x) (*((long long *)(x))) -#define tnf_probe_get_ulonglong(x) (*((unsigned long long *)(x))) -#define tnf_probe_get_float(x) (*((float *)(x))) -#define tnf_probe_get_double(x) (*((double *)(x))) - -char * tnf_probe_get_chars(void *); - -int tnf_probe_get_num_args(tnf_probe_control_t *); - -void *tnf_probe_get_arg_indexed(tnf_probe_control_t *, int, void *); - -tnf_arg_kind_t tnf_probe_get_type_indexed(tnf_probe_control_t *, int); - -const char * tnf_probe_get_value(tnf_probe_control_t *, char *, ulong_t *); - -#ifdef __cplusplus -} -#endif - -#endif /* _TNF_ARGS_H */ diff --git a/usr/src/lib/libtnfprobe/tnf_buf.c b/usr/src/lib/libtnfprobe/tnf_buf.c deleted file mode 100644 index 30e2f0c0a6..0000000000 --- a/usr/src/lib/libtnfprobe/tnf_buf.c +++ /dev/null @@ -1,762 +0,0 @@ -/* - * 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 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 1994-2003 Sun Microsytems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -#include <sys/types.h> -#include <sys/param.h> -#ifdef _KERNEL -#include <sys/systm.h> /* for bzero */ -#include <sys/spl.h> -#include <sys/cmn_err.h> -#else /* _KERNEL */ -#include <string.h> /* for memset */ -#endif /* _KERNEL */ - -#include "tnf_buf.h" - -#ifdef TNFWB_DEBUG -#ifdef _KERNEL -#error TNFWB_DEBUG -#else /* _KERNEL */ -#include <stdio.h> -#include <thread.h> -#endif /* _KERNEL */ -#endif /* TNFW_DEBUG */ - -/* - * Defines - */ - -#define TNFW_B_FW_INVALID 0xffffffff -#define TNFW_B_ALLOC_LO_SELECTOR 0x1 -#define TNFW_B_MAXALLOCTRY 200 - -#ifdef TNF_BLOCK_STATS -static struct { - int tnf_block_allocs; - int tnf_block_tries; - int tnf_max_block_tries; - int tnf_tag_blocks; - int tnf_generation_laps; - int tnf_a_locks; - int tnf_b_locks; -} tnf_block_stats; -#endif - -/* - * Regular record tag pointer - CAUTION - has to be in sync with tnf_tag - * macro in writer.h - */ -#define TNFW_B_TAG_DIFF(item, ref) \ - ((TNF_REF32_MAKE_PERMANENT((tnf_ref32_t) \ - ((char *)(item) - (char *)(ref)))) | TNF_REF32_T_TAG) - -/* - * Exported interface by buffering layer to indicate where fowarding ptrs - * for file header and block header are. - */ -static tnf_buf_header_t forwarding_ptrs = {NULL, NULL, NULL}; -tnf_buf_header_t *_tnf_buf_headers_p = &forwarding_ptrs; - -#ifdef _KERNEL -extern volatile caddr_t tnf_buf; - -static kmutex_t hintlock; -#endif - -/* - * (Private) Allocate a new block. Return NULL on failure. 'istag' - * is true if the block is to be non-reclaimable. - */ -static tnf_block_header_t * -tnfw_b_alloc_block(TNFW_B_WCB *wcb, enum tnf_alloc_mode istag) -{ - tnf_block_header_t *block; - uint_t hint_hi, hint_lo; - uint_t new_hint_hi, new_hint_lo; - uint_t generation; - uint_t blocknum; - uint_t prev_gen = 0; - uint_t prev_block = 0; - uint_t i, b; - boolean_t gotit = B_FALSE; - volatile tnf_buf_file_header_t *fh; -#ifdef TNF_BLOCK_STATS - register int tag_blocks = 0, generation_laps = 0, a_locks = 0, - b_locks = 0; -#endif - -#ifdef _TNF_VERBOSE - fprintf(stderr, "tnfw_b_alloc_block: \n"); -#endif - - if (_tnfw_b_control->tnf_state != TNFW_B_RUNNING) { -#ifndef _KERNEL - if (_tnfw_b_control->tnf_state == TNFW_B_NOBUFFER) - if (_tnfw_b_control->tnf_init_callback() == 0) - return (NULL); -#endif /* _KERNEL */ - if (TNFW_B_IS_STOPPED(_tnfw_b_control->tnf_state)) - return (NULL); - if (_tnfw_b_control->tnf_state == TNFW_B_BROKEN) - return (NULL); - } - - /* LINTED pointer cast may result in improper alignment */ - fh = (volatile tnf_buf_file_header_t *)_tnfw_b_control->tnf_buffer; - if (!wcb->tnfw_w_initialized) { - /* Get the block shift and generation shift values. */ - b = 1; - wcb->tnfw_w_block_shift = wcb->tnfw_w_gen_shift = 0; - while (b != fh->com.block_size) { - b <<= 1; - ++wcb->tnfw_w_block_shift; - } - b = 1; - while (b < fh->com.block_count) { - b <<= 1; - ++wcb->tnfw_w_gen_shift; - } - wcb->tnfw_w_pid = _tnfw_b_control->tnf_pid; - wcb->tnfw_w_initialized = B_TRUE; - } - - /* - * If we need a tag block, check the reserved tag block space - * first. fh->next_tag_alloc is only a hint; it is updated - * without concurrency control. - */ - if (istag && fh->next_tag_alloc < TNFW_B_DATA_BLOCK_BEGIN) { - i = fh->next_tag_alloc; - do { - /* LINTED pointer cast */ - block = (tnf_block_header_t *) ((char *) fh + i); - if (!tnfw_b_get_lock(&block->A_lock) && - block->generation == 0) - break; - i += fh->com.block_size; - } while (i < TNFW_B_DATA_BLOCK_BEGIN); - if (i < TNFW_B_DATA_BLOCK_BEGIN) { - if (i > fh->next_tag_alloc) - fh->next_tag_alloc = i; - blocknum = i >> wcb->tnfw_w_block_shift; - if (blocknum > fh->com.blocks_valid) - fh->com.blocks_valid = blocknum; - /* LINTED pointer subtraction casted to 32 bits */ - block->tag = TNFW_B_TAG_DIFF( - forwarding_ptrs.fw_block_header, fh); - /* LINTED constant truncated by assignment */ - block->generation = TNF_TAG_GENERATION_NUM; - block->bytes_valid = sizeof (tnf_block_header_t); - block->next_block = NULL; - tnfw_b_clear_lock(&block->A_lock); - return (block); - } - } - - for (i = 0; !gotit && i != TNFW_B_MAXALLOCTRY; ++i) { - hint_hi = fh->next_alloc.hi; - hint_lo = (hint_hi & TNFW_B_ALLOC_LO_SELECTOR) - ? fh->next_alloc.lo[1] : fh->next_alloc.lo[0]; - generation = (hint_hi << (32 - wcb->tnfw_w_gen_shift)) | - (hint_lo >> wcb->tnfw_w_gen_shift); - blocknum = hint_lo & ((1 << wcb->tnfw_w_gen_shift) - 1); -#ifdef TNFWB_DEBUG - fprintf(stderr, "alloc_block (%d): read hint (%d, %d)\n", - thr_self(), generation, blocknum); -#endif - if ((prev_gen == generation && prev_block > blocknum) || - prev_gen > generation) { - generation = prev_gen; - blocknum = prev_block; - } -#ifdef TNFWB_DEBUG - fprintf(stderr, - "alloc_block (%d): trying blocknum = %d, gen %d\n", - thr_self(), blocknum, generation); -#endif - block = (tnf_block_header_t *) - /* LINTED pointer cast may result in improper alignment */ - ((char *)fh + blocknum * fh->com.block_size); -#ifdef TNF_BLOCK_STATS - if (block->generation == TNF_TAG_GENERATION_NUM) - ++tag_blocks; - else if (block->generation >= generation) - ++generation_laps; - else if (tnfw_b_get_lock(&block->A_lock)) - ++a_locks; - else if (block->generation == TNF_TAG_GENERATION_NUM) - ++tag_blocks; - else if (block->generation >= generation) - ++generation_laps; - else if (tnfw_b_get_lock(&block->B_lock)) { - tnfw_b_clear_lock(&block->A_lock); - ++b_locks; - } else - gotit = B_TRUE; - -#else - if (block->generation < generation && - !tnfw_b_get_lock(&block->A_lock)) { - if (block->generation < generation && - !tnfw_b_get_lock(&block->B_lock)) { - gotit = B_TRUE; - } else { - tnfw_b_clear_lock(&block->A_lock); - } - } -#endif - prev_block = blocknum + 1; - prev_gen = generation; - if (prev_block == fh->com.block_count) { - prev_block = - TNFW_B_DATA_BLOCK_BEGIN >> wcb->tnfw_w_block_shift; - ++prev_gen; - } - if (blocknum > fh->com.blocks_valid) { - fh->com.blocks_valid = blocknum; - } - } - - if (i == TNFW_B_MAXALLOCTRY) { - _tnfw_b_control->tnf_state = TNFW_B_BROKEN; - return (NULL); - } -#ifdef TNFWB_DEBUG - fprintf(stderr, - "alloc_block (%d): got blocknum = %d, gen %d, block at 0x%x\n", - thr_self(), blocknum, generation, block); -#endif - /* LINTED pointer subtraction casted to 32 bits */ - block->tag = TNFW_B_TAG_DIFF(forwarding_ptrs.fw_block_header, fh); - block->generation = (istag) ? TNF_TAG_GENERATION_NUM : generation; - block->bytes_valid = sizeof (tnf_block_header_t); - block->next_block = NULL; - if (istag) { - tnfw_b_clear_lock(&block->A_lock); - } - tnfw_b_clear_lock(&block->B_lock); - - /* - * Read the hint one more time, only update it if we'll be increasing - * it - */ - new_hint_hi = prev_gen >> (32 - wcb->tnfw_w_gen_shift); - new_hint_lo = prev_block | (prev_gen << wcb->tnfw_w_gen_shift); -#ifdef _KERNEL - mutex_enter(&hintlock); -#endif - hint_hi = fh->next_alloc.hi; - hint_lo = (hint_hi & TNFW_B_ALLOC_LO_SELECTOR) ? - fh->next_alloc.lo[1] : fh->next_alloc.lo[0]; - - if ((new_hint_hi == hint_hi && new_hint_lo > hint_lo) || - new_hint_hi > hint_hi) { - /* - * Order is important here! It is the write to next_alloc.hi - * that atomically records the new value. - */ - if (new_hint_hi & TNFW_B_ALLOC_LO_SELECTOR) - fh->next_alloc.lo[1] = new_hint_lo; - else - fh->next_alloc.lo[0] = new_hint_lo; - fh->next_alloc.hi = new_hint_hi; -#ifdef TNFWB_DEBUG - fprintf(stderr, "alloc_block (%d): wrote hint (%d, %d)\n", - thr_self(), prev_gen, prev_block); -#endif - } -#ifdef _KERNEL - mutex_exit(&hintlock); -#endif -#ifdef TNF_BLOCK_STATS - ++tnf_block_stats.tnf_block_allocs; - tnf_block_stats.tnf_block_tries += i; - if (i > tnf_block_stats.tnf_max_block_tries) { - tnf_block_stats.tnf_max_block_tries = i; - tnf_block_stats.tnf_tag_blocks = tag_blocks; - tnf_block_stats.tnf_generation_laps = generation_laps; - tnf_block_stats.tnf_a_locks = a_locks; - tnf_block_stats.tnf_b_locks = b_locks; - } -#endif - return (block); -} - -static void release_block_from_pos(TNFW_B_POS * pos) -{ - if (pos->tnfw_w_block == NULL) - return; - if (pos->tnfw_w_uncommitted != NULL) - return; - tnfw_b_clear_lock(&pos->tnfw_w_block->A_lock); - pos->tnfw_w_block = NULL; -} - -void -tnfw_b_release_block(TNFW_B_WCB * wcb) -{ - if (wcb == NULL) - return; - release_block_from_pos(&wcb->tnfw_w_tag_pos); - release_block_from_pos(&wcb->tnfw_w_pos); -} - -/* - * Initialize a buffer. NOT RE-ENTRANT! Block sizes other than 512 - * are currently rejected. The code "ought to work" with any block - * size that is an integral power of 2. 'zfod' states whether we - * can assume that the buffer is zero-filled (or paged-in zero-fill-on-demand). - */ -TNFW_B_STATUS -tnfw_b_init_buffer(char *buf, int blocks, int block_size, boolean_t zfod) - -{ - int block_shift, gen_shift; - int i; - int file_size; - unsigned b; - tnf_block_header_t *block; - /* LINTED pointer cast may result in improper alignment */ - tnf_buf_file_header_t *fh = (tnf_buf_file_header_t *)buf; - -#ifdef _TNF_VERBOSE - fprintf(stderr, "tnfw_b_init_buffer: \n"); -#endif - - /* Check for 512 could go away. */ - if (block_size != 512 || block_size < sizeof (tnf_buf_file_header_t)) - return (TNFW_B_BAD_BLOCK_SIZE); - /* - * Check to see if block size is a power of 2, and get - * log2(block size). - */ - for (b = (unsigned)block_size, block_shift = 0; (b & 1) == 0; b >>= 1) - ++block_shift; - if (b != 1) - return (TNFW_B_BAD_BLOCK_SIZE); - gen_shift = 0; - while (b < blocks) { - b <<= 1; - ++gen_shift; - } - /* reserve first two words for file header tag and block header tag */ - forwarding_ptrs.fw_file_header = (char *)fh + block_size; - forwarding_ptrs.fw_block_header = (char *)fh + block_size + - sizeof (tnf_ref32_t); - forwarding_ptrs.fw_root = (char *)fh + block_size + - (2 * sizeof (tnf_ref32_t)); - /* LINTED size of tnf_ref_32_t known to be 32 */ - fh->next_fw_alloc = block_size + (3 * sizeof (tnf_ref32_t)); - /* fill in rest of file header */ - fh->magic = TNF_MAGIC; - /* Self relative pointer to tag */ - /* LINTED pointer subtraction casted to 32 bits */ - fh->com.tag = TNFW_B_TAG_DIFF(forwarding_ptrs.fw_file_header, fh); - fh->com.file_version = TNF_FILE_VERSION; - fh->com.file_header_size = sizeof (tnf_file_header_t); - /* fill in fh->com.file_log_size */ - b = 1; - file_size = blocks * block_size; - fh->com.file_log_size = 0; - while (b < file_size) { - b <<= 1; - ++fh->com.file_log_size; - } - - fh->com.block_header_size = sizeof (tnf_block_header_t); - fh->com.block_size = block_size; - fh->com.directory_size = TNFW_B_FW_ZONE; - fh->com.block_count = blocks; - fh->com.blocks_valid = TNFW_B_FW_ZONE >> block_shift; - if (fh->com.blocks_valid == 0) - fh->com.blocks_valid = 1; - fh->next_tag_alloc = TNFW_B_FW_ZONE; - fh->next_alloc.hi = 0; - fh->next_alloc.lo[0] = - (1 << gen_shift) | (TNFW_B_DATA_BLOCK_BEGIN >> block_shift); -#ifdef TNFWB_DEBUG - fprintf(stderr, "gen_shift = %d, blocks_valid = %d\n", - gen_shift, fh->com.blocks_valid); - fprintf(stderr, "alloc hint initialized to (%d, %d, %d)\n", - fh->next_alloc.hi, fh->next_alloc.lo[0], fh->next_alloc.lo[1]); -#endif - if (!zfod) { - for (i = 1; i < (TNFW_B_FW_ZONE >> block_shift); ++i) { -#ifdef _KERNEL - bzero(buf + (i << block_shift), block_size); -#else - (void) memset(buf + (i << block_shift), 0, block_size); -#endif - } - for (; i != blocks; ++i) { - block = (tnf_block_header_t *) - /* LINTED pointer cast */ - (buf + (i << block_shift)); - block->tag = 0; - block->generation = 0; - tnfw_b_clear_lock(&block->A_lock); - tnfw_b_clear_lock(&block->B_lock); - } - } -#ifdef _KERNEL - mutex_init(&hintlock, "tnf buffer hint lock", MUTEX_SPIN_DEFAULT, - (void *) ipltospl(LOCK_LEVEL)); -#endif - return (TNFW_B_OK); -} - -/* - * - */ -void * -tnfw_b_alloc(TNFW_B_WCB *wcb, size_t size, enum tnf_alloc_mode istag) -{ - TNFW_B_POS *pos; - int offset; - void *destp; - volatile tnf_buf_file_header_t *fh; - tnf_block_header_t *block, *new_block; - -#ifdef _TNF_VERBOSE - fprintf(stderr, "tnfw_b_alloc: \n"); -#endif - - if (_tnfw_b_control->tnf_state != TNFW_B_RUNNING) { - if (TNFW_B_IS_STOPPED(_tnfw_b_control->tnf_state)) - return (NULL); - if (_tnfw_b_control->tnf_state == TNFW_B_FORKED && - _tnfw_b_control->tnf_pid != wcb->tnfw_w_pid) { - wcb->tnfw_w_pos.tnfw_w_block = - wcb->tnfw_w_pos.tnfw_w_uncommitted = - wcb->tnfw_w_tag_pos.tnfw_w_block = - wcb->tnfw_w_tag_pos.tnfw_w_uncommitted = NULL; - wcb->tnfw_w_pid = _tnfw_b_control->tnf_pid; - _tnfw_b_control->tnf_fork_callback(); - } - } - - /* Round size up to a multiple of 8. */ - size = (size + 7) & ~7; - - /* LINTED pointer cast may result in improper alignment */ - fh = (volatile tnf_buf_file_header_t *)_tnfw_b_control->tnf_buffer; - pos = (istag) ? &wcb->tnfw_w_tag_pos : &wcb->tnfw_w_pos; - block = pos->tnfw_w_block; - /* Check size within range. */ -#ifdef TNFWB_SAFER - if (size > fh->com.block_size - sizeof (tnf_block_header_t)) - /* TNFW_B_RECORD_TOO_BIG */ - return (NULL); -#endif - offset = pos->tnfw_w_write_off; -#ifdef TNFWB_MAY_RELEASE_A_LOCK - if (block != NULL && wcb->tnfw_w_a_lock_released) { - /* re-acquire the A-lock for the current block */ - if (!tnfw_b_get_lock(&block->A_lock)) { - wcb->tnfw_w_a_lock_released = B_FALSE; - if (wcb->tnfw_w_generation != block->generation) { - tnfw_b_clear_lock(&block->A_lock); - wcb->tnfw_w_pos.tnfw_w_block = NULL; - } - } else { - wcb->tnfw_w_pos.tnfw_w_block = NULL; - } - } -#endif - if (block == NULL || offset + size > fh->com.block_size) { - new_block = tnfw_b_alloc_block(wcb, istag); - if (new_block == NULL) { - /* TNFW_B_ACKPHT */ - return (NULL); - } -#ifdef TNFWB_DEBUG - fprintf(stderr, - "wcb 0x%x: new block at 0x%x, old block is 0x%x, " - "uncommitted is 0x%x\n", - wcb, new_block, block, pos->tnfw_w_uncommitted); -#endif - if (block != NULL) { - /* XXXX is this what we want for padding? */ -#ifdef _KERNEL - (void) bzero((char *)block + offset, - fh->com.block_size - offset); -#else - (void) memset((char *)block + offset, 0, - fh->com.block_size - offset); -#endif - if (pos->tnfw_w_uncommitted == NULL) { -#ifdef TNFWB_MAY_RELEASE_A_LOCK - /* Could still be holding the A-lock on block */ - if (!wcb->tnfw_w_a_lock_released) - tnfw_b_clear_lock(&block->A_lock); -#else - /* Definitely still holding the A-lock */ - tnfw_b_clear_lock(&block->A_lock); -#endif /* TNFWB_MAY_RELEASE_A_LOCK */ - } - } - /* Add new_block to the list of uncommitted blocks. */ - if (pos->tnfw_w_uncommitted == NULL) { - pos->tnfw_w_uncommitted = new_block; - } else { - /* Assert(block != NULL); */ - block->next_block = new_block; - } - pos->tnfw_w_block = new_block; - pos->tnfw_w_write_off = new_block->bytes_valid; - } else if (pos->tnfw_w_uncommitted == NULL) { - pos->tnfw_w_uncommitted = block; - } - destp = (char *)pos->tnfw_w_block + pos->tnfw_w_write_off; - pos->tnfw_w_write_off += size; - /* - * Unconditionally write a 0 into the last word allocated, - * in case we left an alignment gap. (Assume that doing an - * unconditional write is cheaper than testing and branching - * around the write half the time.) - */ - /* LINTED pointer cast may result in improper alignment */ - *((int *)((char *) destp + size - sizeof (int))) = 0; - -#ifdef _TNF_VERBOSE - fprintf(stderr, "tnfw_b_alloc returning %p\n", destp); -#endif - return (destp); -} - -/* - * - */ -TNFW_B_STATUS -tnfw_b_xcommit(TNFW_B_WCB *wcb) -{ - TNFW_B_POS *pos; - tnf_block_header_t *block; - volatile tnf_buf_file_header_t *fh = - /* LINTED pointer cast may result in improper alignment */ - (volatile tnf_buf_file_header_t *)_tnfw_b_control->tnf_buffer; - -#ifdef TNFWB_DEBUG - fprintf(stderr, "tnfw_b_xcommit \n"); -#endif - - /* - * cope with the normal record block(s) first - */ - - pos = &wcb->tnfw_w_pos; - block = pos->tnfw_w_uncommitted; - while (block && (block != pos->tnfw_w_block)) { -#ifdef TNFWB_DEBUG - fprintf(stderr, "commit %d: block = 0x%x, last = 0x%x\n", - block->generation, block, pos->tnfw_w_block); -#endif - block->bytes_valid = fh->com.block_size; - pos->tnfw_w_uncommitted = block->next_block; - tnfw_b_clear_lock(&block->A_lock); - block = pos->tnfw_w_uncommitted; - } - if (block != NULL) { -#ifdef TNFWB_DEBUG - fprintf(stderr, "commit last %d: block = 0x%x, offset = 0x%x\n", - block->generation, block, pos->tnfw_w_write_off); -#endif - block->bytes_valid = pos->tnfw_w_write_off; - } - pos->tnfw_w_uncommitted = NULL; -#ifdef TNFWB_MAY_RELEASE_A_LOCK - if (0) { /* XXXX Do we or don't we clear this lock? */ - wcb->tnfw_w_generation = block->generation; - tnfw_b_clear_lock(&block->A_lock); - wcb->tnfw_w_a_lock_released = B_TRUE; - } -#endif - - /* - * cope with the tag block(s) - */ - - pos = &wcb->tnfw_w_tag_pos; - block = pos->tnfw_w_uncommitted; - while (block && (block != pos->tnfw_w_block)) { -#ifdef TNFWB_DEBUG - fprintf(stderr, "commit %d: block = 0x%x, last = 0x%x\n", - thr_self(), block, pos->tnfw_w_block); -#endif - block->bytes_valid = fh->com.block_size; - pos->tnfw_w_uncommitted = block->next_block; - block = pos->tnfw_w_uncommitted; - } - if (block != NULL) - block->bytes_valid = pos->tnfw_w_write_off; - pos->tnfw_w_uncommitted = NULL; - return (TNFW_B_OK); -} - -/* - * - */ -TNFW_B_STATUS -tnfw_b_xabort(TNFW_B_WCB *wcb) -{ - TNFW_B_POS *pos = &wcb->tnfw_w_pos; - tnf_block_header_t *block, *next; - volatile tnf_buf_file_header_t *fh = - /* LINTED pointer cast may result in improper alignment */ - (volatile tnf_buf_file_header_t *)_tnfw_b_control->tnf_buffer; - - block = pos->tnfw_w_block = pos->tnfw_w_uncommitted; - if (block != NULL) { - pos->tnfw_w_write_off = block->bytes_valid; -#ifdef TNFWB_MAY_RELEASE_A_LOCK - if (0) { /* XXXX */ - tnfw_b_clear_lock(&block->A_lock); - wcb->tnfw_w_generation = block->generation; - wcb->tnfw_w_a_lock_released = B_TRUE; - } -#endif - block = block->next_block; - } - while (block != NULL) { - next = block->next_block; - tnfw_b_clear_lock(&block->A_lock); - block = next; - } - pos->tnfw_w_uncommitted = NULL; - pos = &wcb->tnfw_w_tag_pos; - block = pos->tnfw_w_uncommitted; - while (block && (block != pos->tnfw_w_block)) { - block->bytes_valid = fh->com.block_size; - pos->tnfw_w_uncommitted = block->next_block; - block = pos->tnfw_w_uncommitted; - } - if (block != NULL) - block->bytes_valid = pos->tnfw_w_write_off; - pos->tnfw_w_uncommitted = NULL; - return (TNFW_B_OK); -} - -/* - * The kernel version is different because we can use a spin mutex - * in the kernel, and not all SPARC systems support the SWAP instruction. - */ -#ifdef _KERNEL -/*ARGSUSED0*/ -tnf_uint32_t * -tnfw_b_fw_alloc(TNFW_B_WCB *wcb) -{ - tnf_uint32_t *ret_val; - volatile tnf_buf_file_header_t *fh = - /* LINTED pointer cast may result in improper alignment */ - (volatile tnf_buf_file_header_t *)_tnfw_b_control->tnf_buffer; - tnf_uint32_t *zone_end = (tnf_uint32_t *)((char *)fh + TNFW_B_FW_ZONE); - mutex_enter(&hintlock); - ret_val = (tnf_uint32_t *)((char *)fh + fh->next_fw_alloc); - if (ret_val != zone_end) - fh->next_fw_alloc += sizeof (tnf_uint32_t); - mutex_exit(&hintlock); - return ((ret_val != zone_end) ? ret_val : NULL); -} - -#else - -/*ARGSUSED0*/ -tnf_uint32_t * -tnfw_b_fw_alloc(TNFW_B_WCB *wcb) -{ - volatile tnf_buf_file_header_t *fh = - /* LINTED pointer cast may result in improper alignment */ - (volatile tnf_buf_file_header_t *)_tnfw_b_control->tnf_buffer; - /* LINTED pointer cast may result in improper alignment */ - uint_t *hint = (uint_t *)((uintptr_t)fh + fh->next_fw_alloc); - /* LINTED pointer cast may result in improper alignment */ - ulong_t *zone_end = (ulong_t *)((uintptr_t)fh + TNFW_B_FW_ZONE); - u_long swapin; - char tmp_buf[512]; - tnf_uint32_t *retval; - -#ifdef VERYVERBOSE - sprintf(tmp_buf, "tnfw_b_vw_alloc: begin\n"); - (void) write(2, tmp_buf, strlen(tmp_buf)); -#endif - -#ifdef VERYVERBOSE - sprintf(tmp_buf, "tnfw_b_vw_alloc: (1)hint=%p\n", hint); - (void) write(2, tmp_buf, strlen(tmp_buf)); -#endif - - while ((uintptr_t)hint != (uintptr_t)zone_end) { -#ifdef VERYVERBOSE - sprintf(tmp_buf, "tnfw_b_vw_alloc: (2)hint=%p,zone_end=%p\n", - hint, zone_end); - (void) write(2, tmp_buf, strlen(tmp_buf)); -#endif - -#ifdef VERYVERBOSE - sprintf(tmp_buf, "tnfw_b_fw_alloc: fh = %p, next->alloc = %d\n", - fh, fh->next_fw_alloc); - (void) write(2, tmp_buf, strlen(tmp_buf)); - - sprintf(tmp_buf, "tnfw_b_vw_alloc: about to deref hint\n"); - (void) write(2, tmp_buf, strlen(tmp_buf)); - - sprintf(tmp_buf, "tnfw_b_vw_alloc: *hint=%ld\n", *hint); - (void) write(2, tmp_buf, strlen(tmp_buf)); -#endif - if (*hint == 0) { - swapin = tnfw_b_atomic_swap(hint, TNFW_B_FW_INVALID); - if (swapin != 0) { - if (swapin != (unsigned)TNFW_B_FW_INVALID) { - /* restore */ - *hint = swapin; - } - } else { - break; - } - } - ++hint; -#ifdef VERYVERBOSE - sprintf(tmp_buf, "tnfw_b_vw_alloc: (3)hint=%p\n", hint); - (void) write(2, tmp_buf, strlen(tmp_buf)); -#endif - - } - /* LINTED pointer subtraction casted to 32 bits */ - fh->next_fw_alloc = (uint_t) ((char *)hint - (char *)fh); - retval = (((uintptr_t)hint != (uintptr_t)zone_end) ? - (tnf_uint32_t *)hint : NULL); - -#ifdef VERYVERBOSE - sprintf(tmp_buf, "tnfw_b_vw_alloc: returning %p", retval); - (void) write(2, tmp_buf, strlen(tmp_buf)); -#endif - - return (retval); -} - -#endif /* _KERNEL */ diff --git a/usr/src/lib/libtnfprobe/tnf_buf.h b/usr/src/lib/libtnfprobe/tnf_buf.h deleted file mode 100644 index 408a7d8fb9..0000000000 --- a/usr/src/lib/libtnfprobe/tnf_buf.h +++ /dev/null @@ -1,175 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#ifndef _TNF_BUF_H -#define _TNF_BUF_H - -#pragma ident "%Z%%M% %I% %E% SMI" - -#ifdef _KERNEL -#include <sys/tnf_com.h> -#else /* _KERNEL */ -#include <tnf/com.h> -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Size of the file header and forwarding pointer (directory) area combined. - * Tag and data blocks start this many bytes into the file. - * - * The kernel uses a smaller directory area, and uses the saved space - * as block pool reserved for tag allocations. - */ - -#ifdef _KERNEL -#define TNFW_B_FW_ZONE 0x4000 -#define TNFW_B_TAG_RESERVE 0xc000 -#else -#define TNFW_B_FW_ZONE 0x10000 -#define TNFW_B_TAG_RESERVE 0x8000 -#endif -#define TNFW_B_DATA_BLOCK_BEGIN (TNFW_B_FW_ZONE + TNFW_B_TAG_RESERVE) - -/* - * CAUTION: do not change integer values of TNF_ALLOC_REUSABLE or - * TNF_ALLOC_FIXED - */ -enum tnf_alloc_mode { - TNF_ALLOC_REUSABLE = 0, - TNF_ALLOC_FIXED -}; - -typedef struct { - tnf_uint32_t magic; - tnf_file_header_t com; - struct { - uint_t hi; - uint_t lo[2]; - } next_alloc; - uint_t next_tag_alloc; - uint_t next_fw_alloc; -} tnf_buf_file_header_t; - -typedef struct tnfw_b_pos TNFW_B_POS; - -struct tnfw_b_pos { - tnf_block_header_t *tnfw_w_block; - tnf_block_header_t *tnfw_w_uncommitted; - short tnfw_w_write_off; -}; - -typedef struct { - boolean_t tnfw_w_initialized; - struct tnfw_b_pos tnfw_w_pos; - struct tnfw_b_pos tnfw_w_tag_pos; - int tnfw_w_gen_shift; - int tnfw_w_block_shift; - pid_t tnfw_w_pid; - u_long tnfw_w_block_size; -#ifdef TNFWB_MAY_RELEASE_A_LOCK - u_long tnfw_w_generation; - boolean_t tnfw_w_a_lock_released; -#endif -} TNFW_B_WCB; - -typedef enum { - TNFW_B_OK, - TNFW_B_NOTCONN, - TNFW_B_ACKPHT, - TNFW_B_NO_ALLOC, - TNFW_B_NO_SPACE, - TNFW_B_BAD_BLOCK_SIZE, - TNFW_B_BAD_BLOCK_COUNT, - TNFW_B_RECORD_TOO_BIG -} TNFW_B_STATUS; - -typedef enum { - TNFW_B_RUNNING = 0, - TNFW_B_NOBUFFER, - TNFW_B_FORKED, - TNFW_B_BROKEN -} TNFW_B_STATE; - -/* - * The STOPPED bit may be or-ed into the state field. - */ -#define TNFW_B_STOPPED 16 -#define TNFW_B_SET_STOPPED(state) ((state) |= TNFW_B_STOPPED) -#define TNFW_B_UNSET_STOPPED(state) ((state) &= ~TNFW_B_STOPPED) -#define TNFW_B_IS_STOPPED(state) ((state) & TNFW_B_STOPPED) - - -typedef struct { - TNFW_B_STATE tnf_state; - volatile char *tnf_buffer; - int (*tnf_init_callback)(void); - void (*tnf_fork_callback)(void); - pid_t tnf_pid; -} TNFW_B_CONTROL; - -extern TNFW_B_CONTROL *_tnfw_b_control; - -/* - * structure exported by buffering layer - guaranteed to be filled - * after tnfw_b_init_buffer is called. - */ -typedef struct { - char * fw_file_header; - char * fw_block_header; - char * fw_root; -} tnf_buf_header_t; - -extern tnf_buf_header_t *_tnf_buf_headers_p; - -/* - * External interface - */ - -#define TNFW_B_GIVEBACK(wcb, new_pos) \ - ((wcb)->tnfw_w_pos.tnfw_w_write_off = \ - (((char *)(new_pos) - (char *)((wcb)->tnfw_w_pos.tnfw_w_block) + 7) \ - & ~7), *(int *)(new_pos) = 0) - -TNFW_B_STATUS tnfw_b_init_buffer(char *, int, int, boolean_t); -TNFW_B_STATUS tnfw_b_connect(TNFW_B_WCB *, volatile char *); -void * tnfw_b_alloc(TNFW_B_WCB *, size_t, enum tnf_alloc_mode); -TNFW_B_STATUS tnfw_b_xcommit(TNFW_B_WCB *); -TNFW_B_STATUS tnfw_b_xabort(TNFW_B_WCB *); -tnf_uint32_t *tnfw_b_fw_alloc(TNFW_B_WCB *); -void tnfw_b_release_block(TNFW_B_WCB *); - -/* Declare lock routines written in assembly language. */ -extern int tnfw_b_get_lock(tnf_byte_lock_t *); -extern void tnfw_b_clear_lock(tnf_byte_lock_t *); -extern u_long tnfw_b_atomic_swap(uint_t *, u_long); - -#ifdef __cplusplus -} -#endif - -#endif /* _TNF_BUF_H */ diff --git a/usr/src/lib/libtnfprobe/tnf_trace.c b/usr/src/lib/libtnfprobe/tnf_trace.c deleted file mode 100644 index 3e765a4bc8..0000000000 --- a/usr/src/lib/libtnfprobe/tnf_trace.c +++ /dev/null @@ -1,198 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -#ifndef DEBUG -#define NDEBUG 1 -#endif - -#include <stdlib.h> -#include <string.h> -#include <tnf/com.h> -#include <tnf/writer.h> -#include <tnf/probe.h> -#include <assert.h> - -#include "tnf_types.h" -#include "tnf_trace.h" - -#ifdef TNFWB_DEBUG -#ifdef _KERNEL -#error TNFWB_DEBUG -#else /* _KERNEL */ -#include <stdio.h> -#include <thread.h> -#endif /* _KERNEL */ -#endif /* TNFW_DEBUG */ - - -/* - * Defines - */ - -#ifdef _KERNEL -#define TNF_ASSERT(expr) ASSERT(expr) -#else -#define TNF_ASSERT(expr) assert(expr) -#endif - -/* - * New properties need for tracing - */ - -static tnf_tag_data_t **derived_tagarg_properties[] = { - &TAG_DATA(tnf_derived), - &TAG_DATA(tnf_tag_arg), - 0 -}; - -static tnf_tag_data_t ***derived_tagarg_properties_ptr = - derived_tagarg_properties; - -/* - * New derived types for probes - */ - -TNF_STD_DERIVED_TAG(tnf_probe_event, tnf_tag, - derived_tagarg_properties_ptr, TNF_OPAQUE); - -TNF_STD_DERIVED_TAG(tnf_time_base, tnf_int64, - tnf_derived_properties, TNF_INT64); - -TNF_STD_DERIVED_TAG(tnf_time_delta, tnf_uint32, - tnf_derived_properties, TNF_UINT32); - -TNF_STD_DERIVED_TAG(tnf_pid, tnf_int32, - tnf_derived_properties, TNF_INT32); - -TNF_STD_DERIVED_TAG(tnf_lwpid, tnf_uint32, - tnf_derived_properties, TNF_UINT32); - -/* - * Schedule records -CAUTION- keep in sync with tnf_internal.h - * Note that tnf_schedule_prototype_t has different sizes for - * kernel and user. - */ - -static char *user_schedule_slot_names[] = { - TNF_N_TAG, - TNF_N_TID, - TNF_N_LWPID, - TNF_N_PID, - TNF_N_TIME_BASE, - 0}; - -static tnf_tag_data_t **user_schedule_slots[] = { - &TAG_DATA(tnf_tag), /* tag */ - &TAG_DATA(tnf_uint32), /* tid XXX */ - &TAG_DATA(tnf_lwpid), /* lwpid */ - &TAG_DATA(tnf_pid), /* pid */ - &TAG_DATA(tnf_time_base), /* time_base */ - 0}; - -TNF_STD_STRUCT_TAG(tnf_sched_rec, - user_schedule_slots, - user_schedule_slot_names, - sizeof (tnf_schedule_prototype_t)); - -/* - * Probe type record (metatag) - */ - -static tnf_tag_data_t **probe_type_slots[] = { - &TAG_DATA(tnf_tag), - &TAG_DATA(tnf_name), - &TAG_DATA(tnf_properties), - &TAG_DATA(tnf_slot_types), - &TAG_DATA(tnf_type_size), - &TAG_DATA(tnf_slot_names), - &TAG_DATA(tnf_string), /* detail */ - 0}; - -TNF_STRUCT_TAG(tnf_probe_type, - tnf_type_properties, - probe_type_slots, - 0, - sizeof (tnf_probe_prototype_t)); - -/* - * export all tags - */ - -TAG_EXPORT(tnf_probe_event); -TAG_EXPORT(tnf_time_base); -TAG_EXPORT(tnf_time_delta); -TAG_EXPORT(tnf_pid); -TAG_EXPORT(tnf_lwpid); - -TAG_EXPORT(tnf_sched_rec); -TAG_EXPORT(tnf_probe_type); - -/* - * Write a schedule record - * Can only be written in reusable data space. - */ - -tnf_record_p -tnf_schedule_write(tnf_ops_t *ops, tnf_schedule_t *sched) -{ - tnf_tag_data_t *metatag_data; - tnf_record_p metatag_index; - tnf_schedule_prototype_t *buffer; - -#ifdef _TNF_VERBOSE - fprintf(stderr, "tnf_schedule_write: \n"); -#endif - /* Cannot be called when writing into tag space */ - TNF_ASSERT(ops->mode == TNF_ALLOC_REUSABLE); - ALLOC(ops, sizeof (*buffer), buffer, sched->record_p, ops->mode); - - metatag_data = TAG_DATA(tnf_sched_rec); - - metatag_index = metatag_data->tag_index ? - metatag_data->tag_index : - metatag_data->tag_desc(ops, metatag_data); - - ASSIGN(buffer, tag, metatag_index); - /* LINTED - tid is 32 bits */ - ASSIGN2(buffer, tid, sched->tid, uint32); - /* LINTED - lwpid is 32 bits */ - ASSIGN(buffer, lwpid, sched->lwpid); - /* LINTED - pid is 32 bits */ - ASSIGN(buffer, pid, sched->pid); - ASSIGN(buffer, time_base, sched->time_base); - - /* - * Remember schedule record generation number so the distance - * in virtual space can be calculated from an event record - */ - sched->record_gen = ((tnf_block_header_t *) - ((uintptr_t)buffer & TNF_BLOCK_MASK))->generation; - /* Cannot have been written into tag space */ - TNF_ASSERT(sched->record_gen != TNF_TAG_GENERATION_NUM); - - return ((tnf_record_p) buffer); -} diff --git a/usr/src/lib/libtnfprobe/tnf_trace.h b/usr/src/lib/libtnfprobe/tnf_trace.h deleted file mode 100644 index 7bcf079665..0000000000 --- a/usr/src/lib/libtnfprobe/tnf_trace.h +++ /dev/null @@ -1,148 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#ifndef _TNF_TRACE_H -#define _TNF_TRACE_H - -#pragma ident "%Z%%M% %I% %E% SMI" - -#include <tnf/probe.h> -#include "tnf_buf.h" -#include "tnf_types.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Size of a TNF buffer block - */ - -#define TNF_BLOCK_SIZE 512 -#define TNF_BLOCK_MASK ~(TNF_BLOCK_SIZE - 1) - -/* - * Size of TNF file directory area - */ - -#define TNF_DIRECTORY_SIZE (1 << 16) - -/* - * specification of index field of probe control block - */ - -#define PROBE_INDEX_TYPE_MASK 0x3 -#define PROBE_INDEX_MEM_PTR 0x0 /* index is a normal memory ptr */ -#define PROBE_INDEX_FILE_PTR 0x1 /* index is a file abs ptr */ -#define PROBE_INDEX_LOW_MASK 0xffff0000 -#define PROBE_INDEX_SHIFT 16 - -#define PROBE_IS_FILE_PTR(x) \ - (((x) & PROBE_INDEX_TYPE_MASK) == PROBE_INDEX_FILE_PTR) - -#define ATTR_SEPARATOR ';' -#define VAL_SEPARATOR ' ' - -typedef struct { - tnf_record_p record_p; - tnf_uint32_t record_gen; - unsigned long tid; - unsigned long lwpid; - long pid; - hrtime_t time_base; -} tnf_schedule_t; - -typedef struct { - tnf_tag_t tag; - tnf_uint32_t tid; - tnf_uint32_t lwpid; - pid_t pid; - /* - * time base should be on a double word boundary to avoid pads - */ - tnf_longlong_t time_base; -} tnf_schedule_prototype_t; - -typedef struct { - tnf_tag_t tag; - tnf_name_t name; - tnf_properties_t properties; - tnf_slot_types_t slot_types; - tnf_type_size_t type_size; - tnf_slot_names_t slot_names; - tnf_string_t string; -} tnf_probe_prototype_t; - -/* - * TNF output ops - */ - -/* - * Data structure that is the glue between the tnf layer and the buffering - * layer. - */ -struct _tnf_ops { - /* fields needed by TNF writing layer */ - enum tnf_alloc_mode mode; - void * (*alloc)(TNFW_B_WCB *, size_t, enum tnf_alloc_mode); - TNFW_B_STATUS (*commit)(TNFW_B_WCB *); - TNFW_B_STATUS (*rollback)(TNFW_B_WCB *); - TNFW_B_WCB wcb; - /* fields needed by tracing allocation and final function */ - int busy; - tnf_schedule_t schedule; -}; - -/* - * Tag data variables - */ -extern tnf_tag_data_t *tnf_probe_type_tag_data; -extern tnf_tag_data_t *tnf_sched_rec_tag_data; - -tnf_record_p tnf_schedule_write(tnf_ops_t *ops, tnf_schedule_t *sched); -uintptr_t tnf_probe_tag(tnf_ops_t *ops, tnf_probe_control_t *probe); -void _tnf_sched_init(tnf_schedule_t *, hrtime_t); -int _tnf_trace_initialize(void); -void _tnf_fork_thread_setup(void); - -extern char tnf_trace_file_name[]; - -/* PROJECT PRIVATE interfaces between prex and libtnfprobe */ - -void *tnf_trace_alloc(tnf_ops_t *, tnf_probe_control_t *, tnf_probe_setup_t *); - -void tnf_trace_end(tnf_probe_setup_t *); - -void tnf_trace_commit(tnf_probe_setup_t *); - -void tnf_trace_rollback(tnf_probe_setup_t *); - -void tnf_probe_debug(tnf_probe_setup_t *); - -#ifdef __cplusplus -} -#endif - -#endif /* _TNF_TRACE_H */ diff --git a/usr/src/lib/libtnfprobe/trace_funcs.c b/usr/src/lib/libtnfprobe/trace_funcs.c deleted file mode 100644 index b370b15c83..0000000000 --- a/usr/src/lib/libtnfprobe/trace_funcs.c +++ /dev/null @@ -1,409 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -/* - * Includes - */ - -#ifndef DEBUG -#define NDEBUG 1 -#endif - -#include <assert.h> -#include <limits.h> -#include <values.h> -#include <stdio.h> -#include <string.h> -#include <unistd.h> - -#include "tnf_trace.h" - -/* - * Defines - */ - -#define ASSERT(expr) assert(expr) - -#define ENCODED_TAG(tag, tagarg) \ - (((tag) | ((tagarg) & 0xfffc)) | TNF_REF32_T_PAIR) - -/* - * CAUTION: halfword_accessible assumes that the pointer is to a reclaimable - * block - i.e. negative offsets have a 0 in high bit - */ -#define HALFWORD_ACCESSIBLE(x) \ - ((((x) & 0xffff8000) == 0) || (((x) & 0xffff8000) == 0x7fff8000)) - -/* - * Check that x can be encoded in tagarg slot - * Same as above, but operates on ints (no space bit) - */ -#define TAGARG_CHECK(x) \ - (((x) < 32767) && ((x) > -32768)) - -/* - * Check that hi 32 bits of hrtime are zero - */ -#define TIME_CHECK(x) \ - (((x) >> 32) == 0) - -/* - * CAUTION: Use the following macro only when doing a self relative pointer - * to a target in the same block - */ -#define PTR_DIFF(item, ref) \ - ((tnf_ref32_t)((tnf_record_p)(item) - (tnf_record_p)(ref))) - -/* - * Typedefs - */ - -typedef struct { - tnf_probe_event_t probe_event; - tnf_time_delta_t time_delta; -} probe_event_prototype_t; - -/* - * tnf_trace_alloc - * the probe allocation function - */ - -#define IS_NEWBLOCK(blockArray, dataBuffer) \ - (((caddr_t)&blockArray[1]) == (caddr_t)dataBuffer) - -void * -tnf_trace_alloc(tnf_ops_t *ops, tnf_probe_control_t *probe_p, - tnf_probe_setup_t *set_p) -{ - TNFW_B_WCB *wcb; - volatile char *file_start; - uintptr_t probe_index; - tnf_record_p sched_record_p; - tnf_reference_t sched_offset, tag_disp; - tnf_block_header_t *block; - tnf_uint32_t shift; - probe_event_prototype_t *buffer; - hrtime_t curr_time, time_diff; - tnf_schedule_t *sched; - tnf_ref32_t *fwd_p; - ulong_t size, asize; -#if defined(DEBUG) || defined(VERYVERBOSE) - char tmp_buf[512]; -#endif - - ASSERT(ops != NULL); - - /* check if already in a probe */ - if (ops->busy) - return (NULL); - ops->busy = 1; - - -#ifdef VERYVERBOSE - sprintf(tmp_buf, "tnf_trace_alloc: begin\n"); - (void) write(2, tmp_buf, strlen(tmp_buf)); -#endif - - /* - * CAUTION: Ordering of function calls in this file is critical because - * we call TNFW_B_GIVEBACK. Between the time we allocate space for the - * event and call TNFW_B_GIVEBACK there can be no other allocations!! - */ - - /* - * Write probe tag if needed - */ - probe_index = probe_p->index; -#ifdef VERYVERBOSE - sprintf(tmp_buf, "tnf_trace_alloc: (1) probe_index=%p\n", probe_index); - (void) write(2, tmp_buf, strlen(tmp_buf)); -#endif - if (probe_index == 0) { - if ((probe_index = tnf_probe_tag(ops, probe_p)) == 0) { -#ifdef VERYVERBOSE - sprintf(tmp_buf, "tnf_trace_alloc: (2) probe_index=%p\n", - probe_index); - (void) write(2, tmp_buf, strlen(tmp_buf)); - sprintf(tmp_buf, "tnf_trace_alloc: goto null_ret\n"); - (void) write(2, tmp_buf, strlen(tmp_buf)); - fflush(stderr); - sleep(2); -#endif - goto null_ret; - } -#ifdef VERYVERBOSE - sprintf(tmp_buf, "tnf_trace_alloc: (3) probe_index=%p\n", - probe_index); - (void) write(2, tmp_buf, strlen(tmp_buf)); - fflush(stderr); -#endif - } - /* - * Determine how much memory is required - */ - size = probe_p->tnf_event_size; - asize = size + sizeof (tnf_ref32_t); /* one fwd ptr */ - - if (PROBE_IS_FILE_PTR(probe_index)) { - /* common case - probe_index is a file ptr */ - tag_disp = probe_index & PROBE_INDEX_LOW_MASK; - } else { - /* rare case -- get an extra fwd ptr */ - asize += sizeof (tnf_ref32_t); - } - - /* - * Allocate memory - */ - wcb = &(ops->wcb); - -#ifdef _TNF_VERBOSE - sprintf(tmp_buf, "tnf_trace_alloc, wcb=%p\n", wcb); - (void) write(2, tmp_buf, strlen(tmp_buf)); -#endif - - buffer = ops->alloc(wcb, asize, ops->mode); - -#ifdef _TNF_VERBOSE - sprintf(tmp_buf, "tnf_trace_alloc, buffer=%p\n", buffer); - (void) write(2, tmp_buf, strlen(tmp_buf)); -#endif - if (buffer == NULL) - goto null_ret; - - /* LINTED pointer cast may result in improper alignment */ - fwd_p = (tnf_ref32_t *) ((char *)(buffer) + size); - -#ifdef _TNF_VERBOSE - sprintf(tmp_buf, "tnf_trace_alloc, fwd_pr=%p\n", fwd_p); - (void) write(2, tmp_buf, strlen(tmp_buf)); -#endif - - /* set file_start after calling alloc because it allocs the file */ - file_start = _tnfw_b_control->tnf_buffer; - - /* Check if the probe tag needs more work */ - if (!PROBE_IS_FILE_PTR(probe_index)) { - /* LINTED use up first fwd ptr */ - *fwd_p = TNF_REF32_MAKE_PERMANENT( - /* LINTED ptr subtraction */ - (tnf_record_p)probe_index - (tnf_record_p) file_start); - /* LINTED ptr subtraction */ - tag_disp = PTR_DIFF(fwd_p, buffer); - ASSERT(TAGARG_CHECK(tag_disp)); - tag_disp |= TNF_TAG16_T_REL; - tag_disp = tag_disp << TNF_REF32_TAG16_SHIFT; - fwd_p++; - } - - /* - * Get timestamp - */ - curr_time = gethrtime(); - - /* - * initialize and write schedule record if needed - * watch out for sched->record_p - it has to be checked after alloc is - * called for the event, because it could be side effected by alloc - * if a fork happened. Pre-requisite to our algorithm - if a fork - * happens all other threads have to be quiescent i.e. not in a probe. - */ - sched = &(ops->schedule); - -#ifdef _TNF_VERBOSE - sprintf(tmp_buf, "tnf_trace_alloc, sched=%p\n", sched); - (void) write(2, tmp_buf, strlen(tmp_buf)); -#endif - - /* LINTED pointer cast */ - shift = ((tnf_buf_file_header_t *)file_start)->com.file_log_size; - block = (tnf_block_header_t *)((ulong_t)buffer & TNF_BLOCK_MASK); - - if ((sched_record_p = sched->record_p) == NULL || - IS_NEWBLOCK(block, buffer)) { - /* No record written yet */ - goto new_schedule; - } - - /* - * Note: Don't bother about space bit here, because we'll - * only use bits 15:2 anyway - */ - sched_offset = ((sched->record_gen - block->generation) << shift) + - /* LINTED - ptr subtraction */ - (uint_t) (sched_record_p - (caddr_t)buffer); - - if (!TAGARG_CHECK(sched_offset)) - /* Record too far away to reference */ - goto new_schedule; - - time_diff = curr_time - sched->time_base; - if (!TIME_CHECK(time_diff)) - /* Time delta can't fit in 32 bits */ - goto new_schedule; - - /* - * Can reuse existing schedule record - * Since we did not allocate any more space, can giveback - */ - /* LINTED - GIVEBACK returns a pointer subtraction */ - TNFW_B_GIVEBACK(wcb, fwd_p); - -good_ret: - /* - * Store return params and two common event members, return buffer - */ - set_p->tpd_p = ops; - set_p->buffer_p = buffer; - set_p->probe_p = probe_p; - buffer->probe_event = ENCODED_TAG(tag_disp, sched_offset); - /* LINTED - TIME_CHECK already passed, see above */ - buffer->time_delta = tnf_time_delta(ops, (unsigned long)time_diff, - &buffer->probe_time_delta); - return (buffer); - -new_schedule: - /* - * Write a new schedule record for this thread - */ -#ifdef VERYVERBOSE - sprintf(tmp_buf, " tnf_trace_alloc: initializing " - "new schedule record\n"); - (void) write(2, tmp_buf, strlen(tmp_buf)); -#endif - _tnf_sched_init(sched, curr_time); - time_diff = 0; - if ((sched_record_p = tnf_schedule_write(ops, sched)) != NULL) { - /* use one of the extra alloced words for the forwarding ptr */ - /* LINTED - ptr subtraction */ - *fwd_p = TNF_REF32_MAKE_RECLAIMABLE( - ((sched->record_gen - block->generation) << shift) + - (sched_record_p - (tnf_record_p)fwd_p)); - /* LINTED - ptr subtraction */ - sched_offset = PTR_DIFF(fwd_p, buffer); - ASSERT(TAGARG_CHECK(sched_offset)); - } else { - /* Allocation failed (tracing may have been stopped) */ - sched_offset = 0; - *fwd_p = TNF_NULL; - } - goto good_ret; - -null_ret: - /* - * reset re-entrancy protector, because tnf_trace_end() will - * not be called - */ -#ifdef VERYVERBOSE - sprintf(tmp_buf, "tnf_trace_alloc: null return\n"); - (void) write(2, tmp_buf, strlen(tmp_buf)); -#endif - ops->busy = 0; - return (NULL); -} - -/* - * tnf_trace_end - * the last (usually only) function in the list of probe functions - */ -void -tnf_trace_end(tnf_probe_setup_t *set_p) -{ -#ifdef VERYVERBOSE - char tmp_buf[512]; - - sprintf(tmp_buf, "tnf_trace_end: \n"); - (void) write(2, tmp_buf, strlen(tmp_buf)); -#endif - - (set_p->probe_p->commit_func)(set_p); - set_p->tpd_p->busy = 0; -} - -/* - * tnf_trace_commit - * a probe commit function that really commits trace data - */ -void -tnf_trace_commit(tnf_probe_setup_t *set_p) -{ -#ifdef VERYVERBOSE - char tmp_buf[512]; - - sprintf(tmp_buf, "tnf_trace_commit: \n\n"); - (void) write(2, tmp_buf, strlen(tmp_buf)); -#endif - (void) set_p->tpd_p->commit(&(set_p->tpd_p->wcb)); - - return; - -} - -/* - * tnf_trace_rollback - * a probe commit function that unrolls trace data - */ -void -tnf_trace_rollback(tnf_probe_setup_t *set_p) -{ -#ifdef VERYVERBOSE - char tmp_buf[512]; - - sprintf(tmp_buf, "tnf_trace_rollback: \n\n"); - (void) write(2, tmp_buf, strlen(tmp_buf)); -#endif - (void) set_p->tpd_p->rollback(&(set_p->tpd_p->wcb)); - - return; - -} - -/* - * tnf_allocate - * exported interface for allocating trace memory - */ - -void * -tnf_allocate(tnf_ops_t *ops, size_t size) -{ - void *retval; - char tmp_buf[512]; - -#ifdef _TNF_VERBOSE - sprintf(tmp_buf, "tnf_allocate\n"); - (void) write(2, tmp_buf, strlen(tmp_buf)); -#endif - - retval = ops->alloc(&(ops->wcb), size, ops->mode); - -#ifdef _TNF_VERBOSE - sprintf(tmp_buf, "tnf_allocate, retval=%p\n", retval); - (void) write(2, tmp_buf, strlen(tmp_buf)); -#endif - - return (retval); -} diff --git a/usr/src/lib/libtnfprobe/trace_init.c b/usr/src/lib/libtnfprobe/trace_init.c deleted file mode 100644 index 5f2070990f..0000000000 --- a/usr/src/lib/libtnfprobe/trace_init.c +++ /dev/null @@ -1,246 +0,0 @@ -/* - * 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 2008 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -/* - * Includes - */ - -#ifndef DEBUG -#define NDEBUG 1 -#endif - -#include <assert.h> -#include <limits.h> -#include <values.h> -#include <stdio.h> -#include <string.h> -#include <unistd.h> -#include <stdlib.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <fcntl.h> -#include <dlfcn.h> -#include <sys/mman.h> -#include <sys/param.h> - -#include <thread.h> -#include <sys/lwp.h> -#include <errno.h> - -#include "tnf_trace.h" - - -/* - * Defines - */ -#define TNF_FILE_MODE (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH) - -/* - * Declarations - */ - -extern void thr_probe_setup(void *); -#pragma weak thr_probe_setup - -/* - * Globals - */ - -static TNFW_B_CONTROL __tnfw_b_control_local = { - TNFW_B_NOBUFFER, - NULL, - _tnf_trace_initialize, - _tnf_fork_thread_setup, - 0 -}; - -TNFW_B_CONTROL *_tnfw_b_control = &__tnfw_b_control_local; - -static char *file_start; - -/* - * Two Project Private Interfaces between prex and libtnfprobe - - * tnf_trace_file_name and tnf_trace_file_size (three now ...) - */ -char tnf_trace_file_name[MAXPATHLEN] = ""; -uint_t tnf_trace_file_size = 4194304; /* 4 Meg */ -uint_t tnf_trace_file_min = (128 * 1024); - -tnf_ops_t tnf_trace_initial_tpd = { - TNF_ALLOC_REUSABLE, /* mode */ - tnfw_b_alloc, /* alloc */ - tnfw_b_xcommit, /* commit */ - tnfw_b_xabort, /* rollback */ - { - B_FALSE /* tnfw_w_initialized */ - /* rest of struct is null */ - }, - 0 /* busy */ -}; - -/* - * tnf_process_enable: exported API to turn on tracing for the process - * (on by default). - */ -void -tnf_process_enable(void) -{ - TNFW_B_UNSET_STOPPED(_tnfw_b_control->tnf_state); -} - -/* - * tnf_process_disable: exported API to turn off tracing for the process. - */ -void -tnf_process_disable(void) -{ - TNFW_B_SET_STOPPED(_tnfw_b_control->tnf_state); -} - -/* - * _tnf_trace_initialize - * prex is responsible for creating and zeroing the trace file. So, - * this routine expects the file to be there. It does try to handle - * the case where prex (run as root) for probing a setuid root program - * created the trace file as root. But, by the time the first probe is - * hit (and this function is called), the program has reduced it's - * privilege to its real user id - so the open fails. In this case, - * this function unlinks the trace file and creates it again with its - * current user id. The unlink can fail if the user does not have - * write permission in the directory where the trace file is - if so, - * tracing is set to broken. - */ -int -_tnf_trace_initialize(void) -{ - int fd; - int created_file = 0; - static mutex_t init_mutex = DEFAULTMUTEX; - - /* - * if this is a MT program and the primordial thread hasn't been - * setup yet, can't start tracing yet - THREAD_REG hasn't been - * initialized, so we can't call open() in libthread. - */ - - /* - * Use dlsym to check for the present of thr_probe_setup. - */ - - if ((((int(*)())dlsym(RTLD_DEFAULT, "thr_probe_setup")) != NULL) && - (thr_main() == -1)) { - return (0); - } - - /* - * lock is needed to to prevent multiple threads from - * mmapping the file. - */ - mutex_lock(&init_mutex); - if (_tnfw_b_control->tnf_state != TNFW_B_NOBUFFER) { - mutex_unlock(&init_mutex); - return (1); - } - - _tnfw_b_control->tnf_pid = getpid(); - assert(tnf_trace_file_name[0] != '\0'); - fd = open(tnf_trace_file_name, O_RDWR, TNF_FILE_MODE); - if (fd < 0) { - if (errno == EACCES) { - /* - * fix for bug 1197494: permission denied when - * trying to open the file - happens for setuid root - * programs - prex creates the file with root ownership - */ - if (unlink(tnf_trace_file_name) == -1) { - goto SetBroken; - } - /* try creating it rather than opening it */ - fd = open(tnf_trace_file_name, - O_CREAT | O_RDWR | O_TRUNC, TNF_FILE_MODE); - if (fd < 0) { - goto SetBroken; - } - /* - * expand file to needed size - ftruncate is not - * portable, hence using lseek + write. - */ - if (lseek(fd, tnf_trace_file_size-1, SEEK_SET) == -1) { - goto SetBroken; - } - if (write(fd, "", 1) != 1) { - goto SetBroken; - } - created_file = 1; - } else { - goto SetBroken; - } - } - - /* mmap the file */ - if ((file_start = mmap(0, tnf_trace_file_size, - PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0)) == (caddr_t)-1) { - goto SetBroken; - } - if (created_file == 1) { - /* explicitly zero the file XXX - performance problem */ - (void) memset(file_start, 0, tnf_trace_file_size); - } - _tnfw_b_control->tnf_buffer = file_start; - - if (tnfw_b_init_buffer(file_start, tnf_trace_file_size / TNF_BLOCK_SIZE, - TNF_BLOCK_SIZE, B_TRUE) != TNFW_B_OK) { - goto SetBroken; - } - - /* successful return */ - _tnfw_b_control->tnf_state = TNFW_B_RUNNING; - mutex_unlock(&init_mutex); - return (1); - -SetBroken: - _tnfw_b_control->tnf_state = TNFW_B_BROKEN; - mutex_unlock(&init_mutex); - return (0); - -} - -/* - * _tnf_sched_init - */ - -void -_tnf_sched_init(tnf_schedule_t *sched, hrtime_t t) -{ - thread_t tid = 0; - - sched->time_base = t; - /* thr_self() is stubbed out by libc for a non-threaded pgm */ - tid = thr_self(); - sched->tid = tid; - sched->lwpid = _lwp_self(); - sched->pid = getpid(); -} diff --git a/usr/src/lib/libtnfprobe/writer.h b/usr/src/lib/libtnfprobe/writer.h deleted file mode 100644 index 73b21fbf3e..0000000000 --- a/usr/src/lib/libtnfprobe/writer.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#ifndef _TNF_WRITER_H -#define _TNF_WRITER_H - -#pragma ident "%Z%%M% %I% %E% SMI" - -#include <tnf/com.h> -#include <sys/tnf_writer.h> - -#endif /* _TNF_WRITER_H */ diff --git a/usr/src/man/Makefile b/usr/src/man/Makefile index fe86625dfd..fd58b2ab30 100644 --- a/usr/src/man/Makefile +++ b/usr/src/man/Makefile @@ -80,7 +80,6 @@ SUBDIRS= man1 \ man3stmf \ man3sysevent \ man3tecla \ - man3tnf \ man3tsol \ man3utempter \ man3uuid \ diff --git a/usr/src/man/man1/Makefile b/usr/src/man/man1/Makefile index e98c187773..df95ce213d 100644 --- a/usr/src/man/man1/Makefile +++ b/usr/src/man/man1/Makefile @@ -290,7 +290,6 @@ MANFILES= acctcom.1 \ praliases.1 \ prctl.1 \ preap.1 \ - prex.1 \ print.1 \ printf.1 \ priocntl.1 \ @@ -373,8 +372,6 @@ MANFILES= acctcom.1 \ times.1 \ timex.1 \ tip.1 \ - tnfdump.1 \ - tnfxtract.1 \ touch.1 \ tput.1 \ tr.1 \ diff --git a/usr/src/man/man1/prex.1 b/usr/src/man/man1/prex.1 deleted file mode 100644 index 201ebc68c9..0000000000 --- a/usr/src/man/man1/prex.1 +++ /dev/null @@ -1,1032 +0,0 @@ -'\" te -.\" Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved. -.\" 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] -.TH PREX 1 "Mar 1, 2004" -.SH NAME -prex \- control tracing and manipulate probe points in a process or the kernel -.SH SYNOPSIS -.LP -.nf -\fBprex\fR [\fB-o\fR \fItrace_file_name\fR] [\fB-l\fR \fIlibraries\fR] [\fB-s\fR \fIkbytes_size\fR] \fIcmd\fR - [\fIcmd-args\fR]... -.fi - -.LP -.nf -\fBprex\fR [\fB-o\fR \fItrace_file_name\fR] [\fB-l\fR \fIlibraries\fR] [\fB-s\fR \fIkbytes_size\fR] \fB-p\fR \fIpid\fR -.fi - -.LP -.nf -\fBprex\fR \fB-k\fR [\fB-s\fR \fIkbytes_size\fR] -.fi - -.SH DESCRIPTION -.sp -.LP -The \fBprex\fR command is the part of the Solaris tracing architecture that -controls probes in a process or the kernel. See \fBtracing\fR(3TNF) for an -overview of this tracing architecture, including example source code using it. -.sp -.LP -\fBprex\fR is the application used for external control of probes. It -automatically preloads the \fBlibtnfprobe\fR library. \fBprex\fR locates all -the probes in a target executable or the kernel and provides an interface for -the user to manipulate them. It allows a probe to be turned on for tracing, -debugging, or both. Tracing generates a \fBTNF\fR (Trace Normal Form) trace -file that can be converted to \fBASCII\fR by \fBtnfdump\fR(1) and used for -performance analysis. Debugging generates a line to standard error whenever the -probe is hit at run time. -.sp -.LP -\fBprex\fR does not work on static executables. It only works on dynamic -executables. -.SS "Invoking prex" -.sp -.LP -There are three ways to invoke \fBprex\fR: -.RS +4 -.TP -1. -Use \fBprex\fR to start the target application \fIcmd\fR. In this case, the -target application need not be built with a dependency on \fBlibtnfprobe\fR. -See \fBTNF_PROBE\fR(3TNF). \fBprex\fR sets the environment variable -\fBLD_PRELOAD\fR to load \fBlibtnfprobe\fR into the target process. See -\fBld\fR(1). \fBprex\fR then uses the environment variable \fBPATH\fR to find -the target application. -.RE -.RS +4 -.TP -2. -Attach \fBprex\fR to a running application. In this case, the running target -application should have \fBlibtnfprobe\fR already linked in. Alternatively, the -user may manually set \fBLD_PRELOAD\fR to include \fBlibtnfprobe.so.1\fR prior -to invoking the target. -.RE -.RS +4 -.TP -3. -Use \fBprex\fR with the \fB-k\fR option to set \fBprex\fR to \fBkernel -mode\fR. \fBprex\fR can then be used to control probes in the Solaris kernel. -In kernel mode, additional commands are defined, and some commands that are -valid in other modes are invalid. See \fBKernel\fR \fBMode\fR below. -.RE -.SS "Control File Format and Command Language" -.sp -.LP -In a future release of \fBprex\fR, the command language may be moved to a -syntax that is supported by an existing scripting language like \fBksh\fR(1). -In the meantime, the interface to \fBprex\fR is uncommitted. -.RS +4 -.TP -.ie t \(bu -.el o -Commands should be in \fBASCII\fR. -.RE -.RS +4 -.TP -.ie t \(bu -.el o -Each command is terminated with the NEWLINE character. -.RE -.RS +4 -.TP -.ie t \(bu -.el o -A command can be continued onto the next line by ending the previous line with -the backslash ("\fB\e\fR") character. -.RE -.RS +4 -.TP -.ie t \(bu -.el o -Tokens in a command must be separated by whitespace (one or more spaces or -tabs). -.RE -.RS +4 -.TP -.ie t \(bu -.el o -The "\fB#\fR" character implies that the rest of the line is a comment. -.RE -.SS "Basic prex Commands" -.sp - -.sp -.TS -c c -l l . -Command Result -_ -% \fBprex a.out\fR T{ -Attaches \fBprex\fR to your program and starts \fBprex\fR. -T} -prex> \fBenable $all\fR Enables all the probes. -prex> \fBquit resume\fR T{ -Quits \fBprex\fR and resumes execution of program. -T} -.TE - -.SS "Control File Search Path" -.sp -.LP -There are two different methods of communicating with \fBprex\fR: -.RS +4 -.TP -.ie t \(bu -.el o -By specifications in a control file. During start-up, \fBprex\fR searches for a -file named \fB\&.prexrc\fR in the directories specified below. \fBprex\fR does -not stop at the first one it finds. This way a user can override any defaults -that are set up. The search order is: -.sp -.in +2 -.nf -$HOME/ -\&./ -.fi -.in -2 -.sp - -.RE -.RS +4 -.TP -.ie t \(bu -.el o -By typing commands at the \fBprex\fR prompt. -.RE -.sp -.LP -The command language for both methods is the same and is specified in USAGE. -The commands that return output will not make sense in a control file. The -output will go to standard output. -.sp -.LP -When using \fBprex\fR on a target process, the target will be in one of two -states, running or stopped. This can be detected by the presence or absence of -the \fBprex>\fR prompt. If the prompt is absent, it means that the target -process is running. Typing Control-C will stop the target pr ocess and return -the user to the prompt. There is no guarantee that Control-C will return to a -\fBprex\fR prompt immediately. For example, if the target process is stopped on -a job control stop (\fBSIGSTOP\fR), then Control-C in \fBprex\fR will wait -until the target has been continued (\fBSIGCONT\fR). See \fBSignals to Target -Program\fR below for more information on signals and the target process. -.SH OPTIONS -.sp -.LP -The following options are supported: -.sp -.ne 2 -.na -\fB\fB-k\fR\fR -.ad -.RS 22n -\fBkernel mode\fR: \fBprex\fR is used to control probes in the Solaris kernel. -In kernel mode, additional commands are defined, and some commands valid in -other modes are invalid. See \fBKernel Mode\fR below. -.RE - -.sp -.ne 2 -.na -\fB\fB-l\fR \fIlibraries\fR\fR -.ad -.RS 22n -The \fIlibraries\fR mentioned are linked in to the target application using -\fBLD_PRELOAD\fR (see \fBld\fR(1)). This option cannot be used when attaching -to a running process. The argument to the \fB-l\fR option should be a -space-separated string enclosed in double quotes. Each token in the string is a -library name. It follows the \fBLD_PRELOAD\fR rules on how libraries should be -specified and where they will be found. -.RE - -.sp -.ne 2 -.na -\fB\fB-o\fR \fItrace_file_name\fR\fR -.ad -.RS 22n -File to be used for the trace output. \fItrace_file_name\fR is assumed to be -relative to the current working directory of \fBprex\fR (that is, the directory -that the user was in when \fBprex\fR was started). -.sp -If \fBprex\fR attaches to a process that is already tracing, the new -\fItrace_file_name\fR (if provided) will not be used. If no -\fItrace_file_name\fR is specified, the default is -\fB/$TMPDIR/trace-\fR\fIpid\fR where \fIpid\fR is the process id of the target -program. If \fBTMPDIR\fR is not set, \fB/tmp\fR is used. -.RE - -.sp -.ne 2 -.na -\fB\fB-s\fR \fIkbytes_size\fR\fR -.ad -.RS 22n -Maximum size of the output trace file in Kbytes. The default size of the trace -\fIkbytes_size\fR is \fB4096\fR (2^10) bytes or \fB4\fR Mbytes for normal -usage, and \fB384\fR or \fB384\fR kbytes in kernel mode. The minimum size that -can be specified is \fB128\fR Kbytes. The trace file can be thought of as a -least recently used circular buffer. Once the file has been filled, newer -events will overwrite the older ones. -.RE - -.SH USAGE -.sp -.LP -This section describes the usage of the \fBprex\fR utility. -.SS "Grammar" -.sp -.LP -Probes are specified by a list of space-separated selectors. Selectors are of -the form: -.sp -.in +2 -.nf -\fIattribute\fR=\fIvalue\fR -.fi -.in -2 - -.sp -.LP -(See \fBTNF_PROBE\fR(3TNF)). The "\fIattribute\fR=" is optional. If it is not -specified, it defaults to "\fBkeys=\fR". -.sp -.LP -The \fIattribute\fR or \fIvalue\fR (generically called "spec") can be any of -the following: -.sp -.ne 2 -.na -\fB\fBIDENT\fR\fR -.ad -.RS 14n -Any sequence of letters, digits, _\|, \e\|, ., % not beginning with a digit. -\fBIDENT\fR implies an exact match. -.RE - -.sp -.ne 2 -.na -\fB\fBQUOTED_STR\fR\fR -.ad -.RS 14n -Usually used to escape reserved words (any commands in the command language). -\fBQUOTED_STR\fR implies an exact match and has to be enclosed in single quotes -(' '). -.RE - -.sp -.ne 2 -.na -\fB\fBREGEXP\fR\fR -.ad -.RS 14n -An \fBed\fR(1) regular expression pattern match. \fBREGEXP\fR has to be -enclosed in slashes (/ /), A / can be included in a \fBREGEXP\fR by escaping it -with a backslash \e\|. -.RE - -.sp -.LP -The following grammar explains the syntax. -.sp -.in +2 -.nf -selector_list ::= | /* empty */ - \fIselector_list\fR \fIselector\fR -selector ::= \fIspec\fR=\fIspec\fR | /* whitespace around `=' opt */ - \fIspec\fR -spec ::= IDENT | - QUOTED_STR | - REGEXP -.fi -.in -2 - -.sp -.LP -The terminals in the above grammar are: -.sp -.in +2 -.nf -IDENT = [a-zA-Z_\e.%]{[a-zA-Z0-9_\e.%]}+ -QUOTED_STR = '[^\en']*' /* any string in single quotes */ -REGEXP = /[^\en/]*/ /* regexp's have to be in / / */ -.fi -.in -2 - -.sp -.LP -This is a list of the remaining grammar that is needed to understand the syntax -of the command language (defined in next subsection): -.sp -.in +2 -.nf -filename ::= QUOTED_STR /* QUOTED_STR defined above */ -spec_list ::= /* empty */ | - \fIspec_list\fR \fIspec\fR /* \fIspec\fR defined above */ -fcn_handle ::= &IDENT /* IDENT defined above */ -set_name ::= $IDENT /* IDENT defined above */ -.fi -.in -2 - -.SS "Command Language" -.RS +4 -.TP -1. -Set Creation and Set Listing -.sp -.in +2 -.nf -\fBcreate $\fIset_name\fR \fIselector_list\fR -list sets # list the defined sets\fR -.fi -.in -2 -.sp - -\fBcreate\fR can be used to define a set which contains probes that match the -\fIselector_list\fR. The set \fB$all\fR is pre-defined as /.*/ and it matches -all the probes. -.RE -.RS +4 -.TP -2. -Function Listing -.sp -.in +2 -.nf -\fBlist fcns # list the available \fIfcn_handle\fR\fR -.fi -.in -2 -.sp - -The user can list the different functions that can be connected to probe -points. Currently, only the debug function called \fB&debug\fR is available. -.RE -.RS +4 -.TP -3. -Commands to Connect and Disconnect Probe Functions -.sp -.in +2 -.nf -\fBconnect &\fIfcn_handle\fR $\fIset_name\fR -connect &\fIfcn_handle\fR \fIselector_list\fR -clear $\fIset_name\fR -clear \fIselector_list\fR\fR -.fi -.in -2 -.sp - -The \fBconnect\fR command is used to connect probe functions (which must be -prefixed by `\fB&\fR\&') to probes. The probes are specified either as a single -set (with a `\fB$\fR'), or by explicitly listing the probe selectors in the -command. The probe function has to be one that is listed by the \fBlist fcns\fR -command. This command does not enable the probes. -.sp -The \fBclear\fR command is used to disconnect all connected probe functions -from the specified probes. -.RE -.RS +4 -.TP -4. -Commands to Toggle the Tracing Mode -.sp -.in +2 -.nf -\fBtrace $\fIset_name\fR -trace \fIselector_list\fR -untrace $\fIset_name\fR -untrace \fIselector_list\fR\fR -.fi -.in -2 -.sp - -The \fBtrace\fR and \fBuntrace\fR commands are used to toggle the tracing -action of a probe point (that is, whether a probe will emit a trace record or -not if it is hit). This command does not enable the probes specified. Probes -have tracing on by default. The most efficient way to turn off tracing is by -using the \fBdisable\fR command. \fBuntrace\fR is useful if you want debug -output but no tracing. If so, set the state of the probe to enabled, untraced, -and the debug function connected. -.RE -.RS +4 -.TP -5. -Commands to Enable and Disable Probes -.sp -.in +2 -.nf -\fBenable $\fIset_name\fR -enable \fIselector_list\fR -disable $\fIset_name\fR -disable \fIselector_list\fR\fR -.fi -.in -2 -.sp - -The \fBenable\fR and \fBdisable\fR commands are used to control whether the -probes perform the action that they have been set up for. To trace a probe, it -has to be both enabled and traced (using the \fBtrace\fR command). Probes are -disabled by default. The \fBlist history\fR command is used to list the probe -control commands issued: \fBconnect\fR, \fBclear\fR, \fBtrace\fR, -\fBuntrace\fR, \fBenable\fR, and \fBdisable\fR. These are the commands that -are executed whenever a new shared object is brought in to the target program -by \fBdlopen\fR(3C). See the subsection, \fBdlopen'ed Libraries\fR, below for -more information. -.sp -The following table shows the actions that result from specific combinations of -tracing, enabling, and connecting: -.sp -.in +2 -.nf -Enabled or Tracing State Debug State Results -Disabled (On/Off) (Connected/Cleared) In ------------------------------------------------------------- -Enabled On Connected Tracing and - Debugging - -Enabled On Cleared Tracing only - -Enabled Off Connected Debugging only - -Enabled Off Cleared Nothing - -Disabled On Connected Nothing - -Disabled On Cleared Nothing - -Disabled Off Connected Nothing - -Disabled Off Cleared Nothing -.fi -.in -2 -.sp - -.RE -.RS +4 -.TP -6. -List History -.sp -.in +2 -.nf -\fBlist history # lists probe control command history\fR -.fi -.in -2 -.sp - -The \fBlist history\fR command displays a list of the probe control commands -previously issued in the tracing session, for example, \fBconnect\fR, -\fBclear\fR, \fBtrace\fR, \fBdisable\fR. Commands in the history list are -executed wherever a new shared object is brought into the target program by -\fBdlopen\fR(3C). -.RE -.RS +4 -.TP -7. -Commands to List Probes, List Values, or List Trace File Name -.sp -.in +2 -.nf -\fBlist \fIspec_list\fR probes $\fIset_name\fR # list probes $all -list \fIspec_list\fR probes \fIselector_list\fR # list name probes file=test.c -list values \fIspec_list\fR # list values keys given in \fIspec_list\fR -list tracefile # list tracefile\fR -.fi -.in -2 -.sp - -The first two commands list the selected attributes and values of the specified -probes. They can be used to check the state of a probe. The third command lists -the various values associated with the selected attributes. The fourth command -lists the current tracefile. -.RE -.RS +4 -.TP -8. -Help Command -.sp -.in +2 -.nf -\fBhelp \fItopic\fR\fR -.fi -.in -2 -.sp - -To get a list of the help topics that are available, invoke the \fBhelp\fR -command with no arguments. If a \fItopic\fR argument is specified, help is -printed for that topic. -.RE -.RS +4 -.TP -9. -Source a File -.sp -.in +2 -.nf -\fBsource \fIfilename\fR\fR -.fi -.in -2 -.sp - -The \fBsource\fR command can be used to source a file of \fBprex\fR commands. -\fBsource\fR can be nested (that is, a file can source another file). -\fIfilename\fR is a quoted string. -.RE -.RS +4 -.TP -10. -Process Control -.sp -.in +2 -.nf -\fBcontinue # resumes the target process -quit kill # quit prex, kill target -quit resume # quit prex, continue target -quit suspend # quit prex, leave target suspended -quit # quit prex (continue or kill target)\fR -.fi -.in -2 -.sp - -The default \fBquit\fR will continue the target process if \fBprex\fR attached -to it. Instead, if \fBprex\fR had started the target program, \fBquit\fR will -kill the target process. -.RE -.SS "dlopen'ed Libraries" -.sp -.LP -Probes in shared objects that are brought in by \fBdlopen\fR(3C) are -automatically set up according to the command history of \fBprex\fR. When a -shared object is removed by a \fBdlclose\fR(3C), \fBprex\fR again needs to -refresh its understanding of the probes in the target program. This implies -that there is more work to do for \fBdlopen\fR(3C) and \fBdlclose\fR(3C) \(emso -they will take slightly longer. If a user is not interested in this feature and -doesn't want to interfere with \fBdlopen\fR(3C) and \fBdlclose\fR(3C), detach -\fBprex\fR from the target to inhibit this feature. -.SS "Signals to Target Program" -.sp -.LP -\fBprex\fR does not interfere with signals that are delivered directly to the -target program. However, \fBprex\fR receives all signals normally generated -from the terminal, for example, Control-C (\fBSIGINT\fR), and Control-Z -(\fBSIGSTOP\fR), and does not forward them to the target program. To signal the -target program, use the \fBkill\fR(1) command from a shell. -.SS "Interactions with Other Applications" -.sp -.LP -Process managing applications like \fBdbx\fR, \fBtruss\fR(1), and \fBprex\fR -cannot operate on the same target program simultaneously. \fBprex\fR will not -be able to attach to a target which is being controlled by another application. -A user can trace and debug a program serially by the following method: first -attach \fBprex\fR to target (or start target through \fBprex\fR), set up the -probes using the command language, and then type \fBquit suspend\fR. The user -can then attach \fBdbx\fR to the suspended process and debug it. A user can -also suspend the target by sending it a \fBSIGSTOP\fR signal, and then by -typing \fBquit resume\fR to \fBprex\fR. In this case, the user should also send -a \fBSIGCONT\fR signal after invoking \fBdbx\fR on the stopped process (else -\fBdbx\fR will be hung). -.SS "Failure of Event Writing Operations" -.sp -.LP -There are a few failure points that are possible when writing out events to a -trace file, for example, system call failures. These failures result in a -failure code being set in the target process. The target process continues -normally, but no trace records are written. Whenever a user enters Control-C to -\fBprex\fR to get to a \fBprex\fR prompt, \fBprex\fR will check the failure -code in the target and inform the user if there was a tracing failure. -.SS "Target Executing a Fork or exec" -.sp -.LP -If the target program does a \fBfork\fR(2), any probes that the child -encounters will cause events to be logged to the same trace file. Events are -annotated with a process id, so it will be possible to determine which process -a particular event came from. In multi-threaded programs, there is a race -condition with a thread doing a fork while the other threads are still running. -For the trace file not to get corrupted, the user should either use -\fBfork1\fR(2), or make sure that all other threads are quiescent when doing a -.BR fork (2), -.sp -.LP -If the target program itself (not any children it may \fBfork\fR(2)) does an -\fBexec\fR(2), \fBprex\fR detaches from the target and exits. The user can -reconnect \fBprex\fR with \fBprex\fR \fB-p\fR \fIpid\fR. -.sp -.LP -A \fBvfork\fR(2) is generally followed quickly by an \fBexec\fR(2) in the -child, and in the interim, the child borrows the parent's process while the -parent waits for the \fBexec\fR(2). Any events logged by the child from the -parent process will appear to have been logged by the parent. -.SS "Kernel Mode" -.sp -.LP -Invoking \fBprex\fR with the \fB-k\fR flag causes \fBprex\fR to run in -\fBkernel mode\fR. In kernel mode, \fBprex\fR controls probes in the Solaris -kernel. See \fBtnf_kernel_probes\fR(5) for a list of available probes in the -Solaris kernel. A few \fBprex\fR commands are unavailable in kernel mode; many -other commands are valid in kernel mode only. -.sp -.LP -The \fB-l\fR, \fB-o\fR, and \fB-p\fR command-line options are not valid in -kernel mode (that is, they may not be combined with the \fB-k\fR flag). -.sp -.LP -The rest of this section describes the differences in the \fBprex\fR command -language when running \fBprex\fR in kernel mode. -.RS +4 -.TP -1. -\fBprex\fR will not stop the kernel -.sp -When \fBprex\fR attaches to a running user program, it stops the user program. -Obviously, it cannot do this when attaching to the kernel. Instead, \fBprex\fR -provides a ``tracing master switch'': no probes will have any effect unless the -tracing master switch is on. This allows the user to iteratively select probes -to enable, then enable them all at once by turning on the master switch. -.sp -The command -.sp -.in +2 -.nf -\fBktrace [ on | off ]\fR -.fi -.in -2 -.sp - -is used to inspect and set the value of the master switch. Without an argument, -\fBprex\fR reports the current state of the master switch. -.sp -Since \fBprex\fR will not stop or kill the kernel, the -.sp -.in +2 -.nf -\fBquit resume\fR -.fi -.in -2 -.sp - -and -.sp -.in +2 -.nf -\fBquit kill\fR -.fi -.in -2 -.sp - -commands are not valid in kernel mode. -.RE -.RS +4 -.TP -2. -No functions may be attached to probes in the kernel -.sp -In particular, the debug function is unavailable in kernel mode. -.RE -.RS +4 -.TP -3. -Trace output is written to an in-core buffer -.sp -In kernel mode, a trace output file is not generated directly, in order to -allow probes to be placed in time-critical code. Instead, trace output is -written to an in-core buffer, and copied out by a separate program, -\fBtnfxtract\fR(1). -.sp -The in-core buffer is not automatically created. The following \fBprex\fR -command controls buffer allocation and deallocation: -.sp -.in +2 -.nf -\fBbuffer [ alloc [ \fIsize\fR ] | dealloc ]\fR -.fi -.in -2 -.sp - -Without an argument, the \fBbuffer\fR command reports the size of the currently -allocated buffer, if any. With an argument of \fBalloc\fR [\fIsize\fR], -\fBprex\fR allocates a buffer of the given size. \fIsize\fR is in bytes, with -an optional suffix of '\fBk\fR' or '\fBm\fR' specifying a multiplier of -\fB1024\fR or \fB1048576\fR, respectively. If no \fIsize\fR is specified, the -\fIsize\fR specified on the command line with the \fB-s\fR option is used as a -default. If the \fB-s\fR command line option was not used, the ``default -default'' is 384 kilobytes. -.sp -With an argument of \fBdealloc\fR, \fBprex\fR deallocates the trace buffer in -the kernel. -.sp -\fBprex\fR will reject attempts to turn the tracing master switch on when no -buffer is allocated, and to deallocate the buffer when the tracing master -switch is on. \fBprex\fR will refuse to allocate a buffer when one is already -allocated; use \fBbuffer dealloc\fR first. -.sp -\fBprex\fR will not allocate a buffer larger than one-half of a machine's -physical memory. -.RE -.RS +4 -.TP -4. -\fBprex\fR supports per-process probe enabling in the kernel -.sp -In kernel mode, it is possible to select a set of processes for which probes -are enabled. No trace output will be written when other processes traverse -these probe points. This is called "process filter mode". By default, process -filter mode is off, and all processes cause the generation of trace records -when they hit an enabled probe. -.sp -Some kernel events such as interrupts cannot be associated with a particular -user process. By convention, these events are considered to be generated by -process id 0. -.sp -\fBprex\fR provides commands to turn process filter mode on and off, to get the -current status of the process filter mode switch, to add and delete processes -(by process id) from the process filter set, and to list the current process -filter set. -.sp -The process filter set is maintained even when process filter mode is off, but -has no effect unless process filter mode is on. -.sp -When a process in the process filter set exits, its process id is automatically -deleted from the process filter set. -.sp -The command: -.sp -.in +2 -.nf -\fBpfilter [ on | off | add \fIpidlist\fR | delete \fIpidlist\fR ]\fR -.fi -.in -2 -.sp - -controls the process filter switch, and process filter set membership. With no -arguments, \fBpfilter\fR prints the current process filter set and the state of -the process filter mode switch: -.sp -.ne 2 -.na -\fB\fBon\fR or \fBoff\fR\fR -.ad -.RS 18n -set the state of the process filter mode switch. -.RE - -.sp -.ne 2 -.na -\fB\fBadd\fR \fIpidlist\fR\fR -.ad -.br -.na -\fB\fBdelete\fR \fIpidlist\fR\fR -.ad -.RS 18n -add or delete processes from the process filter set. \fIpidlist\fR is a -comma-separated list of one or more process ids. -.RE - -.RE -.SH EXAMPLES -.sp -.LP -See \fBtracing\fR(3TNF) for complete examples showing, among other things, the -use of \fBprex\fR to do simple probe control. -.sp -.LP -When either the process or kernel is started, all probes are disabled. -.LP -\fBExample 1 \fRSet creation and set listing -.sp -.in +2 -.nf -\fBcreate $out name=/out/ # $out = probes with "out" in - # value of "name" attribute -create $foo /page/ name=biodone # $foo = union of - # probes with "page" in value of keys attribute - # probes with "biodone" as value of "name" attribute -list sets # list the defined sets -list fcns # list the defined probe fcns\fR -.fi -.in -2 -.sp - -.LP -\fBExample 2 \fRCommands to trace and connect probe functions -.sp -.in +2 -.nf -\fBtrace foobar='on' # exact match on foobar attribute -trace $all # trace all probes (predefined set $all) -connect &debug $foo # connect debug func to probes in $foo\fR -.fi -.in -2 -.sp - -.LP -\fBExample 3 \fRCommands to enable and disable probes -.sp -.in +2 -.nf -\fBenable $all # enable all probes -enable /vm/ name=alloc # enable the specified probes -disable $foo # disable probes in set $foo -list history # list probe control commands issued\fR -.fi -.in -2 -.sp - -.LP -\fBExample 4 \fRProcess control -.sp -.in +2 -.nf -\fBcontinue # resumes the target process -^C # stop target; give control to prex -quit resume # exit prex, leave process running - # and resume execution of program\fR -.fi -.in -2 -.sp - -.LP -\fBExample 5 \fRKernel mode -.sp -.in +2 -.nf -\fBbuffer alloc 2m # allocate a 2 Megabyte buffer -enable $all # enable all probes -trace $all # trace all probes -ktrace on # turn tracing on -ktrace off # turn tracing back off -pfilter on # turn process filter mode on -pfilter add 1379 # add pid 1379 to process filter -ktrace on # turn tracing on - # (only pid 1379 will be traced)\fR -.fi -.in -2 -.sp - -.SH FILES -.sp -.ne 2 -.na -\fB\fB\&.prexrc\fR\fR -.ad -.RS 15n -local \fBprex\fR initialization file -.RE - -.sp -.ne 2 -.na -\fB\fB~/.prexrc\fR\fR -.ad -.RS 15n -user's \fBprex\fR initialization file -.RE - -.sp -.ne 2 -.na -\fB\fB/proc/\fInnnnn\fR\fR\fR -.ad -.RS 15n -process files -.RE - -.SH SEE ALSO -.sp -.LP -.BR ed (1), -.BR kill (1), -.BR ksh (1), -.BR ld (1), -.BR tnfdump (1), -.BR tnfxtract (1), -.BR truss (1), -.BR exec (2), -.BR fork (2), -.BR fork1 (2), -.BR vfork (2), -.BR dlclose (3C), -.BR dlopen (3C), -.BR gethrtime (3C), -.BR TNF_DECLARE_RECORD (3TNF), -.BR TNF_PROBE (3TNF), -.BR libtnfctl (3TNF), -.BR tnf_process_disable (3TNF), -.BR tracing (3TNF), -.BR tnf_kernel_probes (5), -.BR attributes (7) -.SH NOTES -.sp -.LP -Currently, the only probe function that is available is the \fB&debug\fR -function. When this function is executed, it prints out the arguments sent in -to the probe as well as the value associated with the \fBsunw%debug\fR -attribute in the detail field (if any) to \fBstderr\fR. -.sp -.LP -For example, for the following probe point: -.sp -.in +2 -.nf -TNF_PROBE_2(input_values, "testapp main", - "sunw%debug 'have read input values successfully'", - tnf_long, int_input, x, - tnf_string, string_input, input); -.fi -.in -2 -.sp - -.sp -.LP -If \fIx\fR was 100 and \fIinput\fR was the string "success", then the output of -the debug probe function would be: -.sp -.in +2 -.nf -probe input_values; sunw%debug "have read input values successfully"; -int_input=100; string_input="success"; -.fi -.in -2 -.sp - -.sp -.LP -Some non-SPARC hardware lacks a true high-resolution timer, causing -\fBgethrtime()\fR to return the same value multiple times in succession. This -can lead to problems in how some tools interpret the trace file. This situation -can be improved by interposing a version of \fBgethrtime()\fR, which causes -these successive values to be artificially incremented by one nanosecond: -.sp -.in +2 -.nf -hrtime_t -gethrtime() -{ - static mutex_t lock; - static hrtime_t (*real_gethrtime)(void) = NULL; - static hrtime_t last_time = 0; - - hrtime_t this_time; - - if (real_gethrtime == NULL) { - real_gethrtime = - (hrtime_t (*)(void)) dlsym(RTLD_NEXT, "gethrtime"); - } - this_time = real_gethrtime(); - - mutex_lock(&lock); - if (this_time <= last_time) - this_time = ++last_time; - else - last_time = this_time; - mutex_unlock(&lock); - - return (this_time); -} -.fi -.in -2 -.sp - -.sp -.LP -Of course, this does not increase the resolution of the timer, so timestamps -for individual events are still relatively inaccurate. But this technique -maintains ordering, so that if event A causes event B, B never appears to -happen before or at the same time as A. -.sp -.LP -\fBdbx\fR is available with the Sun Workshop Products. -.SH BUGS -.sp -.LP -\fBprex\fR should issue a notification when a process id has been automatically -deleted from the filter set. -.sp -.LP -There is a known bug in \fBprex\fR which can result in this message: -.sp -.in +2 -.nf -Tracing shut down in target program due to an internal -error - Please restart prex and target -.fi -.in -2 -.sp - -.sp -.LP -When \fBprex\fR runs as root, and the target process is not root, and the -tracefile is placed in a directory where it cannot be removed and re-created (a -directory with the sticky bit on, like \fB/tmp\fR),mm then the target process -will not be able to open the tracefile when it needs to. This results in -tracing being disabled. -.sp -.LP -Changing any of the circumstances listed above should fix the problem. Either -don't run \fBprex\fR as root, or run the target process as root, or specify the -tracefile in a directory other than \fB/tmp\fR. diff --git a/usr/src/man/man1/tnfdump.1 b/usr/src/man/man1/tnfdump.1 deleted file mode 100644 index 160f2d9e89..0000000000 --- a/usr/src/man/man1/tnfdump.1 +++ /dev/null @@ -1,348 +0,0 @@ -'\" te -.\" Copyright (c) 2001, Sun Microsystems, Inc. -.\" 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] -.TH TNFDUMP 1 "December 28, 2020" -.SH NAME -tnfdump \- convert binary TNF file to ASCII -.SH SYNOPSIS -.nf -\fBtnfdump\fR [\fB-r\fR] [\fB-x\fR] \fItnf_file\fR... -.fi - -.SH DESCRIPTION -The \fBtnfdump\fR utility converts the specified binary \fBTNF\fR trace files -to \fBASCII\fR. The \fBASCII\fR output can be used to do performance analysis. -The default mode (without the \fB-r\fR option) prints all the event records -(that were generated by \fBTNF_PROBE\fR(3TNF)) and the event descriptor records -only. It also orders the events by time. -.SH OPTIONS -The following option is supported: -.sp -.ne 2 -.na -\fB\fB-r\fR\fR -.ad -.RS 6n -Does a raw conversion of \fBTNF\fR to \fBASCII\fR. The output is a literal -translation of the binary \fBTNF\fR file and includes all the records in the -file. This output is useful only if you have a good understanding of -\fBTNF\fR. A sample output is listed in EXAMPLES below. -.RE - -.sp -.ne 2 -.na -\fB\fB-x\fR\fR -.ad -.RS 6n -Prints all \fBTNF\fR unsigned type argument values in hexadecimal format -instead of decimal format. -.RE - -.SH RETURN VALUES -\fBtnfdump\fR returns \fB0\fR on successful exit. -.SH EXAMPLES -\fBExample 1 \fRConverting a file into ASCII -.sp -.LP -To convert the file \fB/tmp/trace-2130\fR into \fBASCII\fR, use the -\fBtnfdump\fR command and the name of the binary trace file. Be aware that the -\fBtnfdump\fR output goes to \fBstdout\fR by default. - -.sp -.in +2 -.nf -example% \fBtnfdump /tmp/trace-2130\fR -.fi -.in -2 -.sp - -.sp -.in +2 -.nf -probe tnf_name: "inloop" tnf_string: "keys cookie main loop;\e - file cookie2.c;line 50;sunw%debug in the loop" -probe tnf_name: "end" tnf_string: "keys cookie main end;\e - file cookie2.c;line 41;sunw%debug exiting program" -------------- ----------- ---- ------ --- ---------- ---------------- -Elapsed (ms) Delta (ms) PID LWPID TID CPU Probe Data/ - Name Description ... -------------- ----------- ---- ------ --- ---------- ---------------- - 0.000000 0.000000 8792 1 0 - inloop loop_count: 0 - total_iterations: 0 - 0.339000 0.339000 8792 1 0 - inloop loop_count: 1 - total_iterations: 1 - 0.350500 0.011500 8792 1 0 - inloop loop_count: 2 - total_iterations: 2 - 0.359500 0.009000 8792 1 0 - inloop loop_count: 3 - total_iterations: 3 - 0.369500 0.010000 8792 1 0 - inloop loop_count: 4 - total_iterations: 4 -7775.969500 7775.600000 8792 1 0 - inloop loop_count: 0 - total_iterations: 5 -7776.016000 0.046500 8792 1 0 - inloop loop_count: 1 - total_iterations: 6 -7776.025000 0.009000 8792 1 0 - inloop loop_count: 2 - total_iterations: 7 -7776.034000 0.009000 8792 1 0 - inloop loop_count: 3 - total_iterations: 8 -7776.043000 0.009000 8792 1 0 - inloop loop_count: 4 - total_iterations: 9 -7776.052000 0.009000 8792 1 0 - inloop loop_count: 5 - total_iterations: 10 -7776.061000 0.009000 8792 1 0 - inloop loop_count: 6 - total_iterations: 11 -9475.979500 1699.918500 8792 1 0 - end node_struct: - { type: node_tnf - cur_sum: 9 max_cnt: 12 } -.fi -.in -2 -.sp - -.sp -.LP -All probes that are encountered during execution have a description of it -printed out. The description is one per line prefixed by the -keyword '\fBprobe\fR'. The name of the probe is in double quotes after the -keyword '\fBtnf_name\fR'. The description of this probe is in double quotes after the -keyword '\fBtnf_string\fR'. - -.sp -.LP -A heading is printed after all the description of the probes are printed. The -first column gives the elapsed time in milli-seconds since the first event. The -second column gives the elapsed time in milli-seconds since the previous event. -The next four columns are the process id, lwp id, thread id, and cpu number. -The next column is the name of the probe that generated this event. This can be -matched to the probe description explained above. The last column is the data -that the event contains, formatted as \fBarg_name_n\fR \fB(see\fR -\fBTNF_PROBE\fR(3TNF)) followed by a colon and the value of that argument. The -format of the value depends on its type. \fBtnf_opaque\fR arguments are printed -in hexadecimal. All other integers are printed in decimal. Strings are printed -in double quotes and user-defined records are enclosed in braces `{ }'. The -first field of a user defined record indicates its \fBTNF\fR type (see -\fBTNF_DECLARE_RECORD\fR(3TNF)). The rest of the fields are the members of the -record. - -.sp -.LP -A `-' in any column indicates that there is no data for that particular column. - -.LP -\fBExample 2 \fRTo do a raw conversion of a file into ASCII -.sp -.LP -To do a raw conversion of the file \fB/tmp/trace-4000\fR into \fBASCII\fR, use: - -.sp -.in +2 -.nf -example% \fBtnfdump -r /tmp/trace-4000\fR -.fi -.in -2 -.sp - -.sp -.LP -The output will look like the following: - -.sp -.in +2 -.nf -0x10e00 : { - tnf_tag 0x109c0 tnf_block_header - generation 1 - bytes_valid 320 - A_lock 0 - B_lock 0 - next_block 0x0 - } -0x10e10 : { - tnf_tag 0x10010 probe1 - tnf_tag_arg 0x10e24 <tnf_sched_rec> - time_delta 128 - test_ulong 4294967295 - test_long -1 - } -0x10e24 : { - tnf_tag 0x10cf4 tnf_sched_rec - tid 0 - lwpid 1 - pid 13568 - time_base 277077875828500 - } -0x10e3c : { - tnf_tag 0x11010 probe2 - tnf_tag_arg 0x10e24 <tnf_sched_rec> - time_delta 735500 - test_str 0x10e48 "string1" - } -0x10e48 : { - tnf_tag 0x1072c tnf_string - tnf_self_size 16 - chars "string1" - } -0x10e58 : { - tnf_tag 0x110ec probe3 - tnf_tag_arg 0x10e24 <tnf_sched_rec> - time_delta 868000 - test_ulonglong 18446744073709551615 - test_longlong -1 - test_float 3.142857 - } -\|.\|.\|. -\|.\|.\|. -\|.\|.\|. -0x110ec : { - tnf_tag 0x10030 tnf_probe_type - tnf_tag_code 42 - tnf_name 0x1110c "probe3" - tnf_properties 0x1111c <tnf_properties> - tnf_slot_types 0x11130 <tnf_slot_types> - tnf_type_size 32 - tnf_slot_names 0x111c4 <tnf_slot_names> - tnf_string 0x11268 "keys targdebug main;\e - file targdebug.c;line 61;" - } -0x1110c : { - tnf_tag 0x10068 tnf_name - tnf_self_size 16 - chars "probe3" - } -0x1111c : { - tnf_tag 0x100b4 tnf_properties - tnf_self_size 20 - 0 0x101a0 tnf_tagged - 1 0x101c4 tnf_struct - 2 0x10b84 tnf_tag_arg - } -0x11130 : { - tnf_tag 0x10210 tnf_slot_types - tnf_self_size 28 - 0 0x10bd0 tnf_probe_event - 1 0x10c20 tnf_time_delta - 2 0x1114c tnf_uint64 - 3 0x10d54 tnf_int64 - 4 0x11188 tnf_float32 - } -.fi -.in -2 -.sp - -.sp -.LP -The first number is the file offset of the record. The record is enclosed in -braces `{ }'. The first column in a record is the slot name (for records whose -fields do not have names, it is the type name). The second column in the record -is the value of that slot if it is a scalar (only scalars that are of type -\fBtnf_opaque\fR are printed in hex), or the offset of the record if it is a -reference to another record. - -.sp -.LP -The third column in a record is optional. It does not exist for scalar slots of -records. If it exists, the third column is a type name with or without angle -brackets, or a string in double quotes. Unadorned names indicate a reference to -the named metatag record (that is, a reference to a record with that name in -the \fBtnf_name\fR field). Type names in angled brackets indicate a reference -to a record that is an instance of that type (that is, a reference to a record -with that name in the \fBtnf_tag\fR field). The content of strings are printed -out in double quotes at the reference site. - -.sp -.LP -Records that are arrays have their array elements follow the header slots, and -are numbered 0, 1, 2, and so on, except strings where the string is written as -the 'chars' (pseudo-name) slot. - -.sp -.LP -Records that are events (generated by \fBTNF_PROBE\fR(3TNF)) will have a slot -name of \fBtnf_tag_arg\fR as their second field which is a reference to the -schedule record. Schedule records describe more information about the event -like the thread-id, process-id, and the \fBtime_base\fR. The \fBtime_delta\fR -of an event can be added to the \fBtime_base\fR of the schedule record that the -event references, to give an absolute time. This time is expressed as -nanoseconds since some arbitrary time in the past (see \fBgethrtime\fR(3C)). - -.LP -\fBExample 3 \fRPrinting TNF unsigned arguments in hexadecimal -.sp -.LP -To print \fBTNF\fR unsigned arguments in hexadecimal for the file -\fB/tmp/trace-2192\fR, use: - -.sp -.in +2 -.nf -example% \fBtnfdump -x /tmp/trace-2192\fR -.fi -.in -2 -.sp - -.sp -.LP -The output will look like the following: - -.sp -.in +2 -.nf -probe tnf_name: "start" tnf_string: "keys cookie main; -file test17.c;line 20;sunw%debug starting main" -probe tnf_name: "inloop" tnf_string: "keys cookie main -loop;file test17.c;line 41;sunw%debug in the loop" -probe tnf_name: "final" tnf_string: "keys cookie main -final;file test17.c;line 32;sunw%debug in the final" ------------- ----------- ---- ----- --- --------- --------------------- - Elapsed Delta PID LWPID TID CPU Probe Data/Description ... - (ms) (ms) Name ------------- ----------- ---- ----- --- --------- --------------------- - 0.000000 0.000000 6280 1 1 - start - 2455.211311 2455.211311 6280 1 1 - inloop loop_count: 0x0 - total_iterations: 0x0 - 2455.215768 0.004457 6280 1 1 - inloop loop_count: 0x1 - total_iterations: 0x1 - 2455.217041 0.001273 6280 1 1 - inloop loop_count: 0x2 - total_iterations: 0x2 - 2455.218285 0.001244 6280 1 1 - inloop loop_count: 0x3 - total_iterations: 0x3 - 2455.219600 0.001315 6280 1 1 - inloop loop_count: 0x4 - total_iterations: 0x4 - 4058.815125 1603.595525 6280 1 1 - inloop loop_count: 0x0 - total_iterations: 0x5 - 4058.818699 0.003574 6280 1 1 - inloop loop_count: 0x1 - total_iterations: 0x6 - 4058.819931 0.001232 6280 1 1 - inloop loop_count: 0x2 - total_iterations: 0x7 - 4058.821264 0.001333 6280 1 1 - inloop loop_count: 0x3 - total_iterations: 0x8 - 4058.822520 0.001256 6280 1 1 - inloop loop_count: 0x4 - total_iterations: 0x9 - 4058.823781 0.001261 6280 1 1 - inloop loop_count: 0x5 - total_iterations: 0xa - 4058.825037 0.001256 6280 1 1 - inloop loop_count: 0x6 - total_iterations: 0xb -13896.655450 9837.830413 6280 1 1 - final loop_count16: 0x258 - total_iterations8: 0xb0 -:: -:: -:: -.fi -.in -2 -.sp - -.sp -.LP -Notice that the \fBloop_count\fR and the \fBtotal_iterations\fR are \fBTNF\fR -unsigned arguments. Their values are printed in hexadecimal when requested by -option \fB-x\fR. - -.SH SEE ALSO -.BR prex (1), -.BR gethrtime (3C), -.BR TNF_DECLARE_RECORD (3TNF), -.BR TNF_PROBE (3TNF), -.BR tnf_process_disable (3TNF), -.BR attributes (7) diff --git a/usr/src/man/man1/tnfxtract.1 b/usr/src/man/man1/tnfxtract.1 deleted file mode 100644 index df74485bdc..0000000000 --- a/usr/src/man/man1/tnfxtract.1 +++ /dev/null @@ -1,140 +0,0 @@ -'\" te -.\" Copyright (c) 2003, Sun Microsystems, Inc. All Rights Reserved -.\" 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] -.TH TNFXTRACT 1 "Aug 19, 2003" -.SH NAME -tnfxtract \- extract kernel probes output into a trace file -.SH SYNOPSIS -.LP -.nf -\fBtnfxtract\fR [\fB-d\fR \fIdumpfile\fR \fB-n\fR \fInamelist\fR] \fItnf_file\fR -.fi - -.SH DESCRIPTION -.sp -.LP -The \fBtnfxtract\fR utility collects kernel trace output from an in-core buffer -in the Solaris kernel, or from the memory image of a crashed system, and -generates a binary \fBTNF\fR trace file like those produced directly by user -programs being traced. -.sp -.LP -Either both or neither of the \fB-d\fR and \fB-n\fR options must be specified. -If neither is specified, trace output is extracted from the running kernel. If -both are specified, the \fB-d\fR argument names the file containing the -(crashed) system memory image, and the \fB-n\fR argument names the file -containing the symbol table for the system memory image. -.sp -.LP -The \fBTNF\fR trace file \fItnf_file\fR produced is exactly the same size as -the in-core buffer; it is essentially a snapshot of that buffer. It is legal -to run \fBtnfxtract\fR while kernel tracing is active, i.e., while the in-core -buffer is being written. \fBtnfxtract\fR insures that the output file it -generates is low-level consistent, that is, that only whole probes are written -out, and that internal data structures in the buffer are not corrupted because -the buffer is being concurrently written. -.sp -.LP -The \fBTNF\fR trace file generated is suitable as input to \fBtnfdump\fR(1), -which will generate an \fBASCII\fR file. -.SH OPTIONS -.sp -.LP -The following options are supported: -.sp -.ne 2 -.na -\fB\fB-d\fR \fIdumpfile\fR\fR -.ad -.RS 15n -Uses \fIdumpfile\fR as the system memory image, instead of the running kernel. -The \fIdumpfile\fR is normally the path name of a file generated by the -\fBsavecore\fR utility. -.RE - -.sp -.ne 2 -.na -\fB\fB-n\fR \fInamelist\fR\fR -.ad -.RS 15n -Uses \fInamelist\fR as the file containing the symbol table information for the -given \fIdumpfile\fR. -.RE - -.SH OPERANDS -.sp -.LP -The following operand is supported: -.sp -.ne 2 -.na -\fB\fItnf_file\fR\fR -.ad -.RS 12n -Output file generated by \fBtnfxtract\fR based on kernel trace output from an -in-core buffer in the Solaris kernel. -.RE - -.SH EXAMPLES -.LP -\fBExample 1 \fRExtracting probes from a running kernel -.sp -.LP -Extract probes from the running kernel into \fBktrace.out\fR: - -.sp -.in +2 -.nf -example% \fBtnfxtract ktrace.out\fR -.fi -.in -2 -.sp - -.LP -\fBExample 2 \fRExtracting probes from a kernel crash dump -.sp -.LP -Extract probes from a kernel crash dump into \fBktrace.out\fR: - -.sp -.in +2 -.nf -example% \fBtnfxtract -d /var/crash/`uname -n`/vmcore.0 \e - -n /var/crash/`uname -n`/unix.0 ktrace.out\fR -.fi -.in -2 -.sp - -.SH EXIT STATUS -.sp -.LP -The following exit values are returned: -.sp -.ne 2 -.na -\fB\fB0\fR\fR -.ad -.RS 6n -Successful completion. -.RE - -.sp -.ne 2 -.na -\fB\fB>0\fR\fR -.ad -.RS 6n -An error occurred. -.RE - -.SH SEE ALSO -.sp -.LP -.BR prex (1), -.BR tnfdump (1), -.BR tnf_kernel_probes (5), -.BR attributes (7), -.BR savecore (8) diff --git a/usr/src/man/man3/Intro.3 b/usr/src/man/man3/Intro.3 index 9ce8548ea9..7ecddc9805 100644 --- a/usr/src/man/man3/Intro.3 +++ b/usr/src/man/man3/Intro.3 @@ -5,7 +5,7 @@ .\" 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] -.TH INTRO 3 "Aug 19, 2019" +.TH INTRO 3 "Sep 12, 2021" .SH NAME Intro, intro \- introduction to functions and libraries .SH DESCRIPTION @@ -903,22 +903,6 @@ See \fBlibtecla\fR(3LIB). .sp .ne 2 .na -\fB(3TNF)\fR -.ad -.sp .6 -.RS 4n -These functions constitute the TNF libraries, \fBlibtnf\fR, \fBlibtnfctl\fR, -and \fBlibtnfprobe\fR. These libraries are implemented as shared objects, -\fBlibtnf.so\fR, \fBlibtnfctl.so\fR, and \fBlibtnfprobe.so\fR, respectively, -but are not automatically linked by the C compilation system. Specify -\fB-ltnf\fR, \fB-ltnfctl\fR, or \fB-ltnfprobe\fR on the \fBcc\fR command line -to link with these libraries. See \fBlibtnfctl\fR(3TNF) and -\fBlibtnfctl\fR(3LIB). -.RE - -.sp -.ne 2 -.na \fB(3TSOL)\fR .ad .sp .6 diff --git a/usr/src/man/man3lib/Makefile b/usr/src/man/man3lib/Makefile index e1ff6e7c7e..1f698ad311 100644 --- a/usr/src/man/man3lib/Makefile +++ b/usr/src/man/man3lib/Makefile @@ -100,7 +100,6 @@ MANFILES= libMPAPI.3lib \ libsysevent.3lib \ libtecla.3lib \ libthread.3lib \ - libtnfctl.3lib \ libtsalarm.3lib \ libtsnet.3lib \ libtsol.3lib \ diff --git a/usr/src/man/man3lib/libtnfctl.3lib b/usr/src/man/man3lib/libtnfctl.3lib deleted file mode 100644 index 47531a168b..0000000000 --- a/usr/src/man/man3lib/libtnfctl.3lib +++ /dev/null @@ -1,100 +0,0 @@ -'\" te -.\" Copyright (c) 2003, Sun Microsystems, Inc. All Rights Reserved. -.\" 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] -.TH LIBTNFCTL 3LIB "May 22, 2003" -.SH NAME -libtnfctl \- TNF probe control library -.SH SYNOPSIS -.LP -.nf -cc [ \fIflag\fR... ] \fIfile\fR.. \fB-ltnfctl\fR [ \fIlibrary\fR... ] -#include <\fBtnf/tnfctl.h\fR> -.fi - -.SH DESCRIPTION -.sp -.LP -Functions in this library provide TNF probe control routines for use by -processes and the kernel. -.SH INTERFACES -.sp -.LP -The shared object \fBlibtnfctl.so.1\fR provides the public interfaces defined -below. See \fBIntro\fR(3) for additional information on shared object -interfaces. -.sp - -.sp -.TS -l l -l l . -\fBtnfctl_buffer_alloc\fR \fBtnfctl_buffer_dealloc\fR -\fBtnfctl_check_libs\fR \fBtnfctl_close\fR -\fBtnfctl_continue\fR \fBtnfctl_exec_open\fR -\fBtnfctl_filter_list_add\fR \fBtnfctl_filter_list_delete\fR -\fBtnfctl_filter_list_get\fR \fBtnfctl_filter_state_set\fR -\fBtnfctl_indirect_open\fR \fBtnfctl_internal_open\fR -\fBtnfctl_kernel_open\fR \fBtnfctl_pid_open\fR -\fBtnfctl_probe_apply\fR \fBtnfctl_probe_apply_ids\fR -\fBtnfctl_probe_connect\fR \fBtnfctl_probe_disable\fR -\fBtnfctl_probe_disconnect_all\fR \fBtnfctl_probe_enable\fR -\fBtnfctl_probe_state_get\fR \fBtnfctl_probe_trace\fR -\fBtnfctl_probe_untrace\fR \fBtnfctl_register_funcs\fR -\fBtnfctl_strerror\fR \fBtnfctl_trace_attrs_get\fR -\fBtnfctl_trace_state_set\fR -.TE - -.SH FILES -.sp -.ne 2 -.na -\fB\fB/usr/lib/libtnfctl.so.1\fR\fR -.ad -.RS 30n -shared object -.RE - -.sp -.ne 2 -.na -\fB\fB/usr/lib/64/libtnfctl.so.1\fR\fR -.ad -.RS 30n -64-bit shared object -.RE - -.SH ATTRIBUTES -.sp -.LP -See \fBattributes\fR(7) for descriptions of the following attributes: -.sp - -.sp -.TS -box; -c | c -l | l . -ATTRIBUTE TYPE ATTRIBUTE VALUE -_ -MT-Level MT-Safe with exceptions -.TE - -.SH SEE ALSO -.sp -.LP -.BR pvs (1), -.BR Intro (3), -.BR libtnfctl (3TNF), -.BR tracing (3TNF), -.BR attributes (7) -.SH NOTES -.sp -.LP -This \fBAPI\fR is MT-Safe. Multiple threads can concurrently operate on -independent \fBtnfctl\fR handles, which is the typical behavior expected. -\fBlibtnfctl\fR does not support multiple threads operating on the same -\fBtnfctl\fR handle. If this is desired, it is the client's responsibility to -implement locking to ensure that two threads that use the same \fBtnfctl\fR -handle are not simultaneously present in a \fBlibtnfctl\fR interface. diff --git a/usr/src/man/man3tnf/Makefile b/usr/src/man/man3tnf/Makefile deleted file mode 100644 index d56a657acb..0000000000 --- a/usr/src/man/man3tnf/Makefile +++ /dev/null @@ -1,124 +0,0 @@ -# -# This file and its contents are supplied under the terms of the -# Common Development and Distribution License ("CDDL"), version 1.0. -# You may only use this file in accordance with the terms of version -# 1.0 of the CDDL. -# -# A full copy of the text of the CDDL should have accompanied this -# source. A copy of the CDDL is also available via the Internet -# at http://www.illumos.org/license/CDDL. -# - -# -# Copyright 2011, Richard Lowe -# Copyright 2013 Nexenta Systems, Inc. All rights reserved. -# - -include $(SRC)/Makefile.master - -MANSECT= 3tnf - -MANFILES= TNF_DECLARE_RECORD.3tnf \ - TNF_PROBE.3tnf \ - libtnfctl.3tnf \ - tnf_process_disable.3tnf \ - tnfctl_buffer_alloc.3tnf \ - tnfctl_close.3tnf \ - tnfctl_indirect_open.3tnf \ - tnfctl_internal_open.3tnf \ - tnfctl_kernel_open.3tnf \ - tnfctl_pid_open.3tnf \ - tnfctl_probe_apply.3tnf \ - tnfctl_probe_state_get.3tnf \ - tnfctl_register_funcs.3tnf \ - tnfctl_strerror.3tnf \ - tnfctl_trace_attrs_get.3tnf \ - tnfctl_trace_state_set.3tnf \ - tracing.3tnf - -MANLINKS= TNF_DEBUG.3tnf \ - TNF_DEFINE_RECORD_1.3tnf \ - TNF_DEFINE_RECORD_2.3tnf \ - TNF_DEFINE_RECORD_3.3tnf \ - TNF_DEFINE_RECORD_4.3tnf \ - TNF_DEFINE_RECORD_5.3tnf \ - TNF_PROBE_0.3tnf \ - TNF_PROBE_0_DEBUG.3tnf \ - TNF_PROBE_1.3tnf \ - TNF_PROBE_1_DEBUG.3tnf \ - TNF_PROBE_2.3tnf \ - TNF_PROBE_2_DEBUG.3tnf \ - TNF_PROBE_3.3tnf \ - TNF_PROBE_3_DEBUG.3tnf \ - TNF_PROBE_4.3tnf \ - TNF_PROBE_4_DEBUG.3tnf \ - TNF_PROBE_5.3tnf \ - TNF_PROBE_5_DEBUG.3tnf \ - tnf_process_enable.3tnf \ - tnf_thread_disable.3tnf \ - tnf_thread_enable.3tnf \ - tnfctl_buffer_dealloc.3tnf \ - tnfctl_check_libs.3tnf \ - tnfctl_continue.3tnf \ - tnfctl_exec_open.3tnf \ - tnfctl_filter_list_add.3tnf \ - tnfctl_filter_list_delete.3tnf \ - tnfctl_filter_list_get.3tnf \ - tnfctl_filter_state_set.3tnf \ - tnfctl_probe_apply_ids.3tnf \ - tnfctl_probe_connect.3tnf \ - tnfctl_probe_disable.3tnf \ - tnfctl_probe_disconnect_all.3tnf \ - tnfctl_probe_enable.3tnf \ - tnfctl_probe_trace.3tnf \ - tnfctl_probe_untrace.3tnf - -TNF_DEFINE_RECORD_1.3tnf := LINKSRC = TNF_DECLARE_RECORD.3tnf -TNF_DEFINE_RECORD_2.3tnf := LINKSRC = TNF_DECLARE_RECORD.3tnf -TNF_DEFINE_RECORD_3.3tnf := LINKSRC = TNF_DECLARE_RECORD.3tnf -TNF_DEFINE_RECORD_4.3tnf := LINKSRC = TNF_DECLARE_RECORD.3tnf -TNF_DEFINE_RECORD_5.3tnf := LINKSRC = TNF_DECLARE_RECORD.3tnf - -TNF_DEBUG.3tnf := LINKSRC = TNF_PROBE.3tnf -TNF_PROBE_0.3tnf := LINKSRC = TNF_PROBE.3tnf -TNF_PROBE_0_DEBUG.3tnf := LINKSRC = TNF_PROBE.3tnf -TNF_PROBE_1.3tnf := LINKSRC = TNF_PROBE.3tnf -TNF_PROBE_1_DEBUG.3tnf := LINKSRC = TNF_PROBE.3tnf -TNF_PROBE_2.3tnf := LINKSRC = TNF_PROBE.3tnf -TNF_PROBE_2_DEBUG.3tnf := LINKSRC = TNF_PROBE.3tnf -TNF_PROBE_3.3tnf := LINKSRC = TNF_PROBE.3tnf -TNF_PROBE_3_DEBUG.3tnf := LINKSRC = TNF_PROBE.3tnf -TNF_PROBE_4.3tnf := LINKSRC = TNF_PROBE.3tnf -TNF_PROBE_4_DEBUG.3tnf := LINKSRC = TNF_PROBE.3tnf -TNF_PROBE_5.3tnf := LINKSRC = TNF_PROBE.3tnf -TNF_PROBE_5_DEBUG.3tnf := LINKSRC = TNF_PROBE.3tnf - -tnf_process_enable.3tnf := LINKSRC = tnf_process_disable.3tnf -tnf_thread_disable.3tnf := LINKSRC = tnf_process_disable.3tnf -tnf_thread_enable.3tnf := LINKSRC = tnf_process_disable.3tnf - -tnfctl_buffer_dealloc.3tnf := LINKSRC = tnfctl_buffer_alloc.3tnf - -tnfctl_check_libs.3tnf := LINKSRC = tnfctl_indirect_open.3tnf - -tnfctl_continue.3tnf := LINKSRC = tnfctl_pid_open.3tnf -tnfctl_exec_open.3tnf := LINKSRC = tnfctl_pid_open.3tnf - -tnfctl_probe_apply_ids.3tnf := LINKSRC = tnfctl_probe_apply.3tnf - -tnfctl_probe_connect.3tnf := LINKSRC = tnfctl_probe_state_get.3tnf -tnfctl_probe_disable.3tnf := LINKSRC = tnfctl_probe_state_get.3tnf -tnfctl_probe_disconnect_all.3tnf := LINKSRC = tnfctl_probe_state_get.3tnf -tnfctl_probe_enable.3tnf := LINKSRC = tnfctl_probe_state_get.3tnf -tnfctl_probe_trace.3tnf := LINKSRC = tnfctl_probe_state_get.3tnf -tnfctl_probe_untrace.3tnf := LINKSRC = tnfctl_probe_state_get.3tnf -tnfctl_filter_list_add.3tnf := LINKSRC = tnfctl_trace_state_set.3tnf -tnfctl_filter_list_delete.3tnf := LINKSRC = tnfctl_trace_state_set.3tnf -tnfctl_filter_list_get.3tnf := LINKSRC = tnfctl_trace_state_set.3tnf -tnfctl_filter_state_set.3tnf := LINKSRC = tnfctl_trace_state_set.3tnf - -.KEEP_STATE: - -include $(SRC)/man/Makefile.man - -install: $(ROOTMANFILES) $(ROOTMANLINKS) diff --git a/usr/src/man/man3tnf/TNF_DECLARE_RECORD.3tnf b/usr/src/man/man3tnf/TNF_DECLARE_RECORD.3tnf deleted file mode 100644 index bb656366f2..0000000000 --- a/usr/src/man/man3tnf/TNF_DECLARE_RECORD.3tnf +++ /dev/null @@ -1,180 +0,0 @@ -'\" te -.\" Copyright 1994 Sun Microsystems Inc. -.\" 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] -.TH TNF_DECLARE_RECORD 3TNF "Dec 31, 1996" -.SH NAME -TNF_DECLARE_RECORD, TNF_DEFINE_RECORD_1, TNF_DEFINE_RECORD_2, -TNF_DEFINE_RECORD_3, TNF_DEFINE_RECORD_4, TNF_DEFINE_RECORD_5 \- TNF type -extension interface for probes -.SH SYNOPSIS -.LP -.nf -\fBcc\fR [ \fIflag\fR ... ] \fIfile\fR ...[ \fB-ltnfprobe\fR ] [ \fIlibrary\fR ... ] -#include <tnf/probe.h> - - - -\fBTNF_DECLARE_RECORD\fR(\fIc_type\fR, \fItnf_type\fR); -.fi - -.LP -.nf -\fBTNF_DEFINE_RECORD_1\fR(\fIc_type\fR, \fItnf_type\fR, \fItnf_member_type_1\fR, \fIc_member_name_1\fR); -.fi - -.LP -.nf -\fBTNF_DEFINE_RECORD_2\fR(\fIc_type\fR, \fItnf_type\fR, \fItnf_member_type_1\fR, \fIc_member_name_1\fR, - \fItnf_member_type_2\fR, \fIc_member_name_2\fR); -.fi - -.LP -.nf -\fBTNF_DEFINE_RECORD_3\fR(\fIc_type\fR, \fItnf_type\fR, \fItnf_member_type_1\fR, \fIc_member_name_1\fR, - \fItnf_member_type_2\fR, \fIc_member_name_2\fR, \fItnf_member_type_3\fR, - \fIc_member_name_3\fR); -.fi - -.LP -.nf -\fBTNF_DEFINE_RECORD_4\fR(\fIc_type\fR, \fItnf_type\fR, \fItnf_member_type_1\fR, \fIc_member_name_1\fR, - \fItnf_member_type_2\fR, \fIc_member_name_2\fR, \fItnf_member_type_3\fR, - \fIc_member_name_3\fR, \fItnf_member_type_4\fR, \fIc_member_name_4\fR); -.fi - -.LP -.nf -\fBTNF_DEFINE_RECORD_5\fR(\fIc_type\fR, \fItnf_type\fR, \fItnf_member_type_1\fR, \fIc_member_name_1\fR, - \fItnf_member_type_2\fR, \fIc_member_name_2\fR, \fItnf_member_type_3\fR, - \fIc_member_name_3\fR,\fItnf_member_type_4\fR, \fIc_member_name_4\fR, - \fItnf_member_type_5\fR, \fIc_member_name_5\fR); -.fi - -.SH DESCRIPTION -.sp -.LP -This macro interface is used to extend the TNF (Trace Normal Form) types that -can be used in \fBTNF_PROBE\fR(3TNF). -.sp -.LP -There should be only one \fBTNF_DECLARE_RECORD\fR and one -\fBTNF_DEFINE_RECORD\fR per new type being defined. The -\fBTNF_DECLARE_RECORD\fR should precede the \fBTNF_DEFINE_RECORD\fR. It can be -in a header file that multiple source files share if those source files need -to use the \fItnf_type\fR being defined. The \fBTNF_DEFINE_RECORD\fR should -only appear in one of the source files. -.sp -.LP -The \fBTNF_DEFINE_RECORD\fR macro interface defines a function as well as a -couple of data structures. Hence, this interface has to be used in a source -file (.c or .cc file) at file scope and not inside a function. -.sp -.LP -Note that there is no semicolon after the \fBTNF_DEFINE_RECORD\fR interface. -Having one will generate a compiler warning. -.sp -.LP -Compiling with the preprocessor option \fB-DNPROBE\fR or with the preprocessor -control statement \fB#define NPROBE\fR ahead of the \fB#include -<tnf/probe.h>\fR statement, will stop the TNF type extension code from being -compiled into the program. -.sp -.LP -The \fIc_type\fR argument must be a C struct type. It is the template from -which the new \fItnf_type\fR is being created. Not all elements of the C -struct need be provided in the TNF type being defined. -.sp -.LP -The \fItnf_type\fR argument is the name being given to the newly created type. -Use of this interface uses the name space prefixed by \fItnf_type\fR. If a new -type called "xxx_type" is defined by a library, then the library should not use -"xxx_type" as a prefix in any other symbols it defines. The policy on managing -the type name space is the same as managing any other name space in a library; -that is, prefix any new TNF types by the unique prefix that the rest of the -symbols in the library use. This would prevent name space collisions when -linking multiple libraries that define new TNF types. For example, if a -library \fBlibpalloc.so\fR uses the prefix "pal" for all symbols it defines, -then it should also use the prefix "pal" for all new TNF types being defined. -.sp -.LP -The \fItnf_member_type_n\fR argument is the TNF type of the \fIn\fRth provided -member of the C structure. -.sp -.LP -The \fItnf_member_name_n\fR argument is the name of the \fIn\fRth provided -member of the C structure. -.SH EXAMPLES -.LP -\fBExample 1 \fRDefining and using a TNF type. -.sp -.LP -The following example demonstrates how a new TNF type is defined and used in a -probe. This code is assumed to be part of a fictitious library called -"libpalloc.so" which uses the prefix "pal" for all it's symbols. - -.sp -.in +2 -.nf -#include <tnf/probe.h> -typedef struct pal_header { - long size; - char * descriptor; - struct pal_header *next; -} pal_header_t; -TNF_DECLARE_RECORD(pal_header_t, pal_tnf_header); -TNF_DEFINE_RECORD_2(pal_header_t, pal_tnf_header, - tnf_long, size, - tnf_string, descriptor) -/* - * Note: name space prefixed by pal_tnf_header should not - * be used by this client anymore. - */ -void -pal_free(pal_header_t *header_p) -{ - int state; - TNF_PROBE_2(pal_free_start, "palloc pal_free", - "sunw%debug entering pal_free", - tnf_long, state_var, state, - pal_tnf_header, header_var, header_p); - ... -} -.fi -.in -2 - -.SH ATTRIBUTES -.sp -.LP -See \fBattributes\fR(7) for descriptions of the following attributes: -.sp - -.sp -.TS -box; -c | c -l | l . -ATTRIBUTE TYPE ATTRIBUTE VALUE -_ -MT-Level MT-Safe -.TE - -.SH SEE ALSO -.sp -.LP -.BR prex (1), -.BR tnfdump (1), -.BR TNF_PROBE (3TNF), -.BR tnf_process_disable (3TNF), -.BR attributes (7) -.SH NOTES -.sp -.LP -It is possible to make a \fItnf_type\fR definition be recursive or mutually -recursive e.g. a structure that uses the "next" field to point to itself (a -linked list). If such a structure is sent in to a \fBTNF_PROBE\fR(3TNF), then -the entire linked list will be logged to the trace file (until the "next" field -is \fINULL\fR). But, if the list is circular, it will result in an infinite -loop. To break the recursion, either do not include the "next" field in the -\fItnf_type\fR, or define the type of the "next" member as \fBtnf_opaque\fR. diff --git a/usr/src/man/man3tnf/TNF_PROBE.3tnf b/usr/src/man/man3tnf/TNF_PROBE.3tnf deleted file mode 100644 index 7f5bd161bf..0000000000 --- a/usr/src/man/man3tnf/TNF_PROBE.3tnf +++ /dev/null @@ -1,332 +0,0 @@ -'\" te -.\" Copyright 2004. Sun Microsystems Inc. -.\" 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] -.TH TNF_PROBE 3TNF "Mar 1, 2004" -.SH NAME -TNF_PROBE, TNF_PROBE_0, TNF_PROBE_1, TNF_PROBE_2, TNF_PROBE_3, TNF_PROBE_4, -TNF_PROBE_5, TNF_PROBE_0_DEBUG, TNF_PROBE_1_DEBUG, TNF_PROBE_2_DEBUG, -TNF_PROBE_3_DEBUG, TNF_PROBE_4_DEBUG, TNF_PROBE_5_DEBUG, TNF_DEBUG \- probe -insertion interface -.SH SYNOPSIS -.LP -.nf -\fBcc\fR [ \fIflag\fR ... ] [ \fB-DTNF_DEBUG\fR ] \fIfile\fR ... [ \fB-ltnfprobe\fR ] [ \fIlibrary\fR ... ] -#include <tnf/probe.h> - -\fBTNF_PROBE_0\fR(\fIname\fR, \fIkeys\fR, \fIdetail\fR); -.fi - -.LP -.nf -\fBTNF_PROBE_1\fR(\fIname\fR, \fIkeys\fR, \fIdetail\fR, \fIarg_type_1\fR, \fIarg_name_1\fR, \fIarg_value_1\fR); -.fi - -.LP -.nf -\fBTNF_PROBE_2\fR(\fIname\fR, \fIkeys\fR, \fIdetail\fR, \fIarg_type_1\fR, \fIarg_name_1\fR, \fIarg_value_1\fR, - \fIarg_type_2\fR, \fIarg_name_2\fR, \fIarg_value_2\fR); -.fi - -.LP -.nf -\fBTNF_PROBE_3\fR(\fIname\fR, \fIkeys\fR, \fIdetail\fR, \fIarg_type_1\fR, \fIarg_name_1\fR,\fIarg_value_1\fR, - \fIarg_type_2\fR, \fIarg_name_2\fR, \fIarg_value_2\fR, - \fIarg_type_3\fR, \fIarg_name_3\fR, \fIarg_value_3\fR); -.fi - -.LP -.nf -\fBTNF_PROBE_4\fR(\fIname\fR, \fIkeys\fR, \fIdetail\fR, \fIarg_type_1\fR, \fIarg_name_1\fR, \fIarg_value_1\fR, - \fIarg_type_2\fR, \fIarg_name_2\fR, \fIarg_value_2\fR, - \fIarg_type_3\fR, \fIarg_name_3\fR, \fIarg_value_3\fR, - \fIarg_type_4\fR, \fIarg_name_4\fR, \fIarg_value_4\fR); -.fi - -.LP -.nf -\fBTNF_PROBE_5\fR(\fIname\fR, \fIkeys\fR, \fIdetail\fR, \fIarg_type_1\fR, \fIarg_name_1\fR, \fIarg_value_1\fR, - \fIarg_type_2\fR, \fIarg_name_2\fR, \fIarg_value_2\fR, - \fIarg_type_3\fR, \fIarg_name_3\fR, \fIarg_value_3\fR, - \fIarg_type_4\fR, \fIarg_name_4\fR, \fIarg_value_4\fR, - \fIarg_type_5\fR, \fIarg_name_5\fR, \fIarg_value_5\fR); -.fi - -.LP -.nf -\fBTNF_PROBE_0_DEBUG\fR(\fIname\fR, \fIkeys\fR, \fIdetail\fR); -.fi - -.LP -.nf -\fBTNF_PROBE_1_DEBUG\fR(\fIname\fR, \fIkeys\fR, \fIdetail\fR, \fIarg_type_1\fR, \fIarg_name_1\fR, \fIarg_value_1\fR); -.fi - -.LP -.nf -\fBTNF_PROBE_2_DEBUG\fR(\fIname\fR, \fIkeys\fR, \fIdetail\fR, \fIarg_type_1\fR, \fIarg_name_1\fR, \fIarg_value_1\fR, - \fIarg_type_2\fR, \fIarg_name_2\fR, \fIarg_value_2\fR); -.fi - -.LP -.nf -\fBTNF_PROBE_3_DEBUG\fR(\fIname\fR, \fIkeys\fR, \fIdetail\fR, \fIarg_type_1\fR, \fIarg_name_1\fR, \fIarg_value_1\fR, - \fIarg_type_2\fR, \fIarg_name_2\fR, \fIarg_value_2\fR, - \fIarg_type_3\fR, \fIarg_name_3\fR, \fIarg_value_3\fR); -.fi - -.LP -.nf -\fBTNF_PROBE_4_DEBUG\fR(\fIname\fR, \fIkeys\fR, \fIdetail\fR, \fIarg_type_1\fR, \fIarg_name_1\fR, \fIarg_value_1\fR, - \fIarg_type_2\fR, \fIarg_name_2\fR, \fIarg_value_2\fR, - \fIarg_type_3\fR, \fIarg_name_3\fR, \fIarg_value_3\fR, - \fIarg_type_4\fR, \fIarg_name_4\fR, \fIarg_value_4\fR); -.fi - -.LP -.nf -\fBTNF_PROBE_5_DEBUG\fR(\fIname\fR, \fIkeys\fR, \fIdetail\fR, \fIarg_type_1\fR, \fIarg_name_1\fR, \fIarg_value_1\fR, - \fIarg_type_2\fR, \fIarg_name_2\fR, \fIarg_value_2\fR, - \fIarg_type_3\fR, \fIarg_name_3\fR, \fIarg_value_3\fR, - \fIarg_type_4\fR, \fIarg_name_4\fR, \fIarg_value_4\fR, - \fIarg_type_5\fR, \fIarg_name_5\fR, \fIarg_value_5\fR); -.fi - -.SH DESCRIPTION -.sp -.LP -This macro interface is used to insert probes into C or C++ code for tracing. -See \fBtracing\fR(3TNF) for a discussion of the Solaris tracing architecture, -including example source code that uses it. -.sp -.LP -You can place probes anywhere in C and C++ programs including .init -sections, .fini sections, multi-threaded code, shared objects, and shared objects opened -by \fBdlopen\fR(3C). Use probes to generate trace data for performance -analysis or to write debugging output to stderr. Probes are controlled at -runtime by \fBprex\fR(1). -.sp -.LP -The trace data is logged to a trace file in Trace Normal Form ( \fBTNF).\fR -The interface for the user to specify the name and size of the trace file is -described in \fBprex\fR(1). Think of the trace file as the least recently used -circular buffer. Once the file has been filled, newer events will overwrite the -older ones. -.sp -.LP -Use \fBTNF_PROBE_0\fR through \fBTNF_PROBE_5\fR to create production probes. -These probes are compiled in by default. Developers are encouraged to embed -such probes strategically, and to leave them compiled within production -software. Such probes facilitate on-site analysis of the software. -.sp -.LP -Use \fBTNF_PROBE_0_DEBUG\fR through \fBTNF_PROBE_5_DEBUG\fR to create debug -probes. These probes are compiled out by default. If you compile the program -with the preprocessor option \fB-DTNF_DEBUG\fR or with the preprocessor -control statement \fB#define\fR \fBTNF_DEBUG\fR ahead of the \fB#include\fR -\fB<tnf/probe.h>\fR statement, the debug probes will be compiled into the -program. When compiled in, debug probes differ in only one way from the -equivalent production probes. They contain an additional "debug" attribute -which may be used to distinguish them from production probes at runtime, for -example, when using \fBprex()\fR. Developers are encouraged to embed any number -of probes for debugging purposes. Disabled probes have such a small runtime -overhead that even large numbers of them do not make a significant impact. -.sp -.LP -If you compile with the preprocessor option \fB-DNPROBE\fR or place the -preprocessor control statement \fB#define\fR \fBNPROBE\fR ahead of the -\fB#include\fR \fB<tnf/probe.h>\fR statement, no probes will be compiled into -the program. -.SS "name" -.sp -.LP -The \fIname\fR of the probe should follow the syntax guidelines for identifiers -in ANSI C. The use of \fIname\fR declares it, hence no separate declaration is -necessary. This is a block scope declaration, so it does not affect the name -space of the program. -.SS "keys" -.sp -.LP -\fIkeys\fR is a string of space-separated keywords that specify the groups that -the probe belongs to. Semicolons, single quotation marks, and the equal -character (=) are not allowed in this string. If any of the groups are enabled, -the probe is enabled. \fIkeys\fR cannot be a variable. It must be a string -constant. -.SS "detail" -.sp -.LP -\fIdetail\fR is a string that consists of <attribute> <value> pairs that are -each separated by a semicolon. The first word (up to the space) is considered -to be the attribute and the rest of the string (up to the semicolon) is -considered the value. Single quotation marks are used to denote a string value. -Besides quotation marks, spaces separate multiple values. The value is -optional. Although semicolons or single quotation marks generally are not -allowed within either the attribute or the value, when text with embedded -spaces is meant to denote a single value, use single quotes surrounding this -text. -.sp -.LP -Use \fIdetail\fR for one of two reasons. First, use \fIdetail\fR to supply -an attribute that a user can type into \fBprex\fR(1) to select probes. For -example, if a user defines an attribute called color, then \fBprex\fR(1) can -select probes based on the value of color. Second, use \fIdetail\fR to annotate -a probe with a string that is written out to a trace file only once. -\fBprex\fR(1) uses spaces to tokenize the value when searching for a match. -Spaces around the semicolon delimiter are allowed. \fIdetail\fR cannot be a -variable; it must be a string constant. For example, the \fIdetail\fR string: -.sp -.in +2 -.nf -"XYZ%debug 'entering function A'; XYZ%exception 'no file'; -XYZ%func_entry; XYZ%color red blue" -.fi -.in -2 - -.sp -.LP -consists of 4 units: -.sp - -.sp -.TS -box; -c c c -l l l . -\fBAttribute\fR \fBValue\fR \fBValues that\fR \fBprex\fR \fBmatches on\fR -_ -XYZ%debug \&'entering function A' \&'entering function A' -XYZ%exception \&'no file' \&'no file' -XYZ%func_entry /.*/ (regular expression) -XYZ%color red blue red <or> blue -.TE - -.sp -.LP -Attribute names must be prefixed by the vendor stock symbol followed by -the '%' character. This avoids conflicts in the attribute name space. All -attributes that do not have a '%' character are reserved. The following -attributes are predefined: -.sp - -.sp -.TS -box; -c c -l l . -\fBAttribute\fR \fBSemantics\fR -_ -name name of probe -keys T{ -keys of the probe (value is space\(mi separated tokens) -T} -file file name of the probe -line line number of the probe -slots T{ -slot names of the probe event (\fIarg_name_n\fR) -T} -object T{ -the executable or shared object that this probe is in. -T} -debug T{ -distinguishes debug probes from production probes -T} -.TE - -.SS "arg_type_n" -.sp -.LP -This is the type of the \fIn\fRth argument. The following are predefined -\fBTNF\fR types: -.sp - -.sp -.TS -box; -c c -l l . -\fBtnf Type\fR \fBAssociated C type (and semantics)\fR -_ -tnf_int int -tnf_uint unsigned int -tnf_long long -tnf_ulong unsigned long -tnf_longlong T{ -long long (if implemented in compilation system) -T} -tnf_ulonglong T{ -unsigned long long (if implemented in compilation system) -T} -tnf_float float -tnf_double double -tnf_string char * -tnf_opaque void * -.TE - -.sp -.LP -To define new \fBTNF\fR types that are records consisting of the predefined -\fBTNF\fR types or references to other user defined types, use the interface -specified in \fBTNF_DECLARE_RECORD\fR(3TNF). -.SS "arg_name_n" -.sp -.LP -\fIarg_name_n\fR is the name that the user associates with the \fIn\fRth -argument. Do not place quotation marks around \fIarg_name_n\fR. Follow the -syntax guidelines for identifiers in ANSI C. The string version of -\fIarg_name_n\fR is stored for every probe and can be accessed as the attribute -"slots". -.SS "arg_value_n" -.sp -.LP -\fIarg_value_n\fR is evaluated to yield a value to be included in the trace -file. A read access is done on any variables that are in mentioned in -\fIarg_value_n\fR. In a multithreaded program, it is the user's responsibility -to place locks around the \fBTNF_PROBE\fR macro if \fIarg_value_n\fR contains -a variable that should be read protected. -.SH EXAMPLES -.LP -\fBExample 1 \fRtracing(3TNF) -.sp -.LP -See \fBtracing\fR(3TNF) for complete examples showing debug and production -probes in source code. - -.SH ATTRIBUTES -.sp -.LP -See \fBattributes\fR(7) for descriptions of the following attributes: -.sp - -.sp -.TS -box; -c | c -l | l . -ATTRIBUTE TYPE ATTRIBUTE VALUE -_ -MT Level MT-Safe -.TE - -.SH SEE ALSO -.sp -.LP -.BR ld (1), -.BR prex (1), -.BR tnfdump (1), -.BR dlopen (3C), -.BR TNF_DECLARE_RECORD (3TNF), -.BR libtnfctl (3TNF), -.BR tnf_process_disable (3TNF), -.BR tracing (3TNF), -.BR attributes (7), -.BR threads (7) -.SH NOTES -.sp -.LP -If attaching to a running program with \fBprex\fR(1) to control the probes, -compile the program with \fB-ltnfprobe\fR or start the program with the -environment variable \fBLD_PRELOAD\fR set to \fBlibtnfprobe.so.1\fR. See -\fBld\fR(1). If \fBlibtnfprobe\fR is explicitly linked into the program, it -must be listed before \fBlibdoor\fR, which in turn must be listed before -\fBlibthread\fR on the link line. diff --git a/usr/src/man/man3tnf/libtnfctl.3tnf b/usr/src/man/man3tnf/libtnfctl.3tnf deleted file mode 100644 index 6e0784413e..0000000000 --- a/usr/src/man/man3tnf/libtnfctl.3tnf +++ /dev/null @@ -1,472 +0,0 @@ -'\" te -.\" Copyright (c) 2004 Sun Microsystems, Inc. All Rights Reserved -.\" 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] -.TH LIBTNFCTL 3TNF "June 20, 2021" -.SH NAME -libtnfctl \- library for TNF probe control in a process or the kernel -.SH SYNOPSIS -.nf -\fBcc\fR [ \fIflag\fR ... ] \fIfile\fR ... \fB-ltnfctl\fR [ \fIlibrary\fR ... ] -#include <tnf/tnfctl.h> -.fi - -.SH DESCRIPTION -The \fBlibtnfctl\fR library provides an \fBAPI\fR to control \fBTNF\fR -("Trace Normal Form") probes within a process or the kernel. See -\fBtracing\fR(3TNF) for an overview of the Solaris tracing architecture. The -client of \fBlibtnfctl\fR controls probes in one of four modes: -.sp -.ne 2 -.na -\fBinternal mode\fR -.ad -.RS 17n -The target is the controlling process itself; that is, the client controls its -own probes. -.RE - -.sp -.ne 2 -.na -\fBdirect mode\fR -.ad -.RS 17n -The target is a separate process; a client can either \fBexec\fR(2) a program -or attach to a running process for probe control. The \fBlibtnfctl\fR library -uses \fBproc\fR(5) on the target process for probe and process control in this -mode, and additionally provides basic process control features. -.RE - -.sp -.ne 2 -.na -\fBindirect mode\fR -.ad -.RS 17n -The target is a separate process, but the controlling process is already using -\fBproc\fR(5) to control the target, and hence \fBlibtnfctl\fR cannot use -those interfaces directly. Use this mode to control probes from within a -debugger. In this mode, the client must provide a set of functions that -\fBlibtnfctl\fR can use to query and update the target process. -.RE - -.sp -.ne 2 -.na -\fBkernel mode\fR -.ad -.RS 17n -The target is the Solaris kernel. -.RE - -.sp -.LP -A process is controlled "externally" if it is being controlled in either direct -mode or indirect mode. Alternatively, a process is controlled "internally" when -it uses internal mode to control its own probes. -.sp -.LP -There can be only one client at a time doing probe control on a given process. -Therefore, it is not possible for a process to be controlled internally while -it is being controlled externally. It is also not possible to have a process -controlled by multiple external processes. Similarly, there can be only one -process at a time doing kernel probe control. Note, however, that while a given -target may only be controlled by one \fBlibtnfctl\fR client, a single client -may control an arbitrary number of targets. That is, it is possible for a -process to simultaneously control its own probes, probes in other processes, -and probes in the kernel. -.sp -.LP -The following tables denotes the modes applicable to all \fBlibtnfctl\fR -interfaces (INT = internal mode; D = direct mode; IND = indirect mode; K = -kernel mode). -.sp -.LP -These interfaces create handles in the specified modes: -.sp - -.sp -.TS -l l l l l -l l l l l . -\fBtnfctl_internal_open()\fR INT -\fBtnfctl_exec_open()\fR D -\fBtnfctl_pid_open()\fR D -\fBtnfctl_indirect_open()\fR IND -\fBtnfctl_kernel_open()\fR K -.TE - -.sp -.LP -These interfaces are used with the specified modes: -.sp - -.sp -.TS -l l l l l -l l l l l . -\fBtnfctl_continue()\fR D -\fBtnfctl_probe_connect()\fR INT D IND -\fBtnfctl_probe_disconnect_all ()\fR INT D IND -\fBtnfctl_trace_attrs_get()\fR INT D IND K -\fBtnfctl_buffer_alloc()\fR INT D IND K -\fBtnfctl_register_funcs()\fR INT D IND K -\fBtnfctl_probe_apply()\fR INT D IND K -\fBtnfctl_probe_apply_ids()\fR INT D IND K -\fBtnfctl_probe_state_get ()\fR INT D IND K -\fBtnfctl_probe_enable()\fR INT D IND K -\fBtnfctl_probe_disable()\fR INT D IND K -\fBtnfctl_probe_trace()\fR INT D IND K -\fBtnfctl_probe_untrace()\fR INT D IND K -\fBtnfctl_check_libs()\fR INT D IND K -\fBtnfctl_close()\fR INT D IND K -\fBtnfctl_strerror()\fR INT D IND K -\fBtnfctl_buffer_dealloc()\fR K -\fBtnfctl_trace_state_set()\fR K -\fBtnfctl_filter_state_set()\fR K -\fBtnfctl_filter_list_get()\fR K -\fBtnfctl_filter_list_add()\fR K -\fBtnfctl_filter_list_delete()\fR K -.TE - -.sp -.LP -When using \fBlibtnfctl\fR, the first task is to create a handle for -controlling probes. The \fBtnfctl_internal_open()\fR function creates an -internal mode handle for controlling probes in the same process, as described -above. The \fBtnfctl_pid_open()\fR and \fBtnfctl_exec_open()\fR functions -create handles in direct mode. The \fBtnfctl_indirect_open()\fR function -creates an indirect mode handle, and the \fBtnfctl_kernel_open()\fR function -creates a kernel mode handle. A handle is required for use in nearly all other -\fBlibtnfctl\fR functions. The \fBtnfctl_close()\fR function releases the -resources associated with a handle. -.sp -.LP -The \fBtnfctl_continue()\fR function is used in direct mode to resume execution -of the target process. -.sp -.LP -The \fBtnfctl_buffer_alloc()\fR function allocates a trace file or, in kernel -mode, a trace buffer. -.sp -.LP -The \fBtnfctl_probe_apply()\fR and \fBtnfctl_probe_apply_ids()\fR functions -call a specified function for each probe or for a designated set of probes. -.sp -.LP -The \fBtnfctl_register_funcs()\fR function registers functions to be called -whenever new probes are seen or probes have disappeared, providing an -opportunity to do one-time processing for each probe. -.sp -.LP -The \fBtnfctl_check_libs()\fR function is used primarily in indirect mode to -check whether any new probes have appeared, that is, they have been made -available by \fBdlopen\fR(3C), or have disappeared, that is, they have -disassociated from the process by \fBdlclose\fR(3C). -.sp -.LP -The \fBtnfctl_probe_enable()\fR and \fBtnfctl_probe_disable()\fR functions -control whether the probe, when hit, will be ignored. -.sp -.LP -The \fBtnfctl_probe_trace()\fR and \fBtnfctl_probe_untrace()\fR functions -control whether an enabled probe, when hit, will cause an entry to be made in -the trace file. -.sp -.LP -The \fBtnfctl_probe_connect()\fR and \fBtnfctl_probe_disconnect_all()\fR -functions control which functions, if any, are called when an enabled probe is -hit. -.sp -.LP -The \fBtnfctl_probe_state_get()\fR function returns information about the -status of a probe, such as whether it is currently enabled. -.sp -.LP -The \fBtnfctl_trace_attrs_get()\fR function returns information about the -tracing session, such as the size of the trace buffer or trace file. -.sp -.LP -The \fBtnfctl_strerror()\fR function maps a \fBtnfctl\fR error code to a -string, for reporting purposes. -.sp -.LP -The remaining functions apply only to kernel mode. -.sp -.LP -The \fBtnfctl_trace_state_set()\fR function controls the master switch for -kernel tracing. See \fBprex\fR(1) for more details. -.sp -.LP -The \fBtnfctl_filter_state_set()\fR, \fBtnfctl_filter_list_get()\fR, -\fBtnfctl_filter_list_add()\fR, and \fBtnfctl_filter_list_delete()\fR functions -allow a set of processes to be specified for which probes will not be ignored -when hit. This prevents kernel activity caused by uninteresting processes from -cluttering up the kernel's trace buffer. -.sp -.LP -The \fBtnfctl_buffer_dealloc()\fR function deallocates the kernel's internal -trace buffer. -.SH RETURN VALUES -Upon successful completion, these functions return \fBTNFCTL_ERR_NONE\fR. -.SH ERRORS -The error codes for \fBlibtnfctl\fR are: -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_ACCES\fR\fR -.ad -.RS 28n -Permission denied. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_NOTARGET\fR\fR -.ad -.RS 28n -The target process completed. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_ALLOCFAIL\fR\fR -.ad -.RS 28n -A memory allocation failure occurred. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_INTERNAL\fR\fR -.ad -.RS 28n -An internal error occurred. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_SIZETOOSMALL\fR\fR -.ad -.RS 28n -The requested trace size is too small. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_SIZETOOBIG\fR\fR -.ad -.RS 28n -The requested trace size is too big. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_BADARG\fR\fR -.ad -.RS 28n -Bad input argument. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_NOTDYNAMIC\fR\fR -.ad -.RS 28n -The target is not a dynamic executable. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_NOLIBTNFPROBE\fR\fR -.ad -.RS 28n -\fBlibtnfprobe.so\fR not linked in target. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_BUFBROKEN\fR\fR -.ad -.RS 28n -Tracing is broken in the target. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_BUFEXISTS\fR\fR -.ad -.RS 28n -A buffer already exists. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_NOBUF\fR\fR -.ad -.RS 28n -No buffer exists. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_BADDEALLOC\fR\fR -.ad -.RS 28n -Cannot deallocate buffer. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_NOPROCESS\fR\fR -.ad -.RS 28n -No such target process exists. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_FILENOTFOUND\fR\fR -.ad -.RS 28n -File not found. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_BUSY\fR\fR -.ad -.RS 28n -Cannot attach to process or kernel because it is already tracing. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_INVALIDPROBE\fR\fR -.ad -.RS 28n -Probe no longer valid. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_USR1\fR\fR -.ad -.RS 28n -Error code reserved for user. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_USR2\fR\fR -.ad -.RS 28n -Error code reserved for user. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_USR3\fR\fR -.ad -.RS 28n -Error code reserved for user. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_USR4\fR\fR -.ad -.RS 28n -Error code reserved for user. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_USR5\fR\fR -.ad -.RS 28n -Error code reserved for user. -.RE - -.SH ATTRIBUTES -See \fBattributes\fR(7) for descriptions of the following attributes: -.sp - -.sp -.TS -box; -c | c -l | l . -ATTRIBUTE TYPE ATTRIBUTE VALUE -_ -MT Level MT-Safe with exceptions -.TE - -.SH SEE ALSO -.BR prex (1), -.BR exec (2), -.BR dlclose (3C), -.BR dlopen (3C), -.BR libtnfctl (3LIB), -.BR TNF_PROBE (3TNF), -.BR tnfctl_buffer_alloc (3TNF), -.BR tnfctl_buffer_dealloc (3TNF), -.BR tnfctl_check_libs (3TNF), -.BR tnfctl_close (3TNF), -.BR tnfctl_continue (3TNF), -.BR tnfctl_exec_open (3TNF), -.BR tnfctl_filter_list_add (3TNF), -.BR tnfctl_filter_list_delete (3TNF), -.BR tnfctl_filter_list_get (3TNF), -.BR tnfctl_filter_state_set (3TNF), -.BR tnfctl_indirect_open (3TNF), -.BR tnfctl_internal_open (3TNF), -.BR tnfctl_kernel_open (3TNF), -.BR tnfctl_pid_open (3TNF), -.BR tnfctl_probe_apply (3TNF), -.BR tnfctl_probe_apply_ids (3TNF), -.BR tnfctl_probe_connect (3TNF), -.BR tnfctl_probe_disable (3TNF), -.BR tnfctl_probe_enable (3TNF), -.BR tnfctl_probe_state_get (3TNF), -.BR tnfctl_probe_trace (3TNF), -.BR tnfctl_probe_untrace (3TNF), -.BR tnfctl_register_funcs (3TNF), -.BR tnfctl_strerror (3TNF), -.BR tnfctl_trace_attrs_get (3TNF), -.BR tnfctl_trace_state_set (3TNF), -.BR proc (5), -.BR attributes (7) -.sp -.LP -\fILinker and Libraries Guide\fR -.SH NOTES -This \fBAPI\fR is MT-Safe. Multiple threads may concurrently operate on -independent \fBtnfctl\fR handles, which is the typical behavior expected. The -\fBlibtnfctl\fR library does not support multiple threads operating on the same -\fBtnfctl\fR handle. If this is desired, it is the client's responsibility to -implement locking to ensure that two threads that use the same \fBtnfctl\fR -handle are not simultaneously in a \fBlibtnfctl\fR interface. diff --git a/usr/src/man/man3tnf/tnf_process_disable.3tnf b/usr/src/man/man3tnf/tnf_process_disable.3tnf deleted file mode 100644 index 2042da9c7f..0000000000 --- a/usr/src/man/man3tnf/tnf_process_disable.3tnf +++ /dev/null @@ -1,119 +0,0 @@ -'\" te -.\" Copyright 2002 Sun Microsystems Inc. -.\" 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] -.TH TNF_PROCESS_DISABLE 3TNF "Feb 5, 2002" -.SH NAME -tnf_process_disable, tnf_process_enable, tnf_thread_disable, tnf_thread_enable -\- probe control internal interface -.SH SYNOPSIS -.LP -.nf -\fBcc\fR [ \fIflag\fR ... ] \fIfile\fR ... \fB-ltnfprobe\fR [ \fIlibrary\fR ... ] -#include <tnf/probe.h> - - - -\fBvoid\fR \fBtnf_process_disable\fR(\fBvoid\fR); -.fi - -.LP -.nf -\fBvoid\fR \fBtnf_process_enable\fR(\fBvoid\fR); -.fi - -.LP -.nf -\fBvoid\fR \fBtnf_thread_disable\fR(\fBvoid\fR); -.fi - -.LP -.nf -\fBvoid\fR \fBtnf_thread_enable\fR(\fBvoid\fR); -.fi - -.SH DESCRIPTION -.sp -.LP -There are three levels of granularity for controlling tracing and probe -functions (called probing from here on): probing for the entire process, a -particular thread, and the probe itself can be disabled or enabled. The first -two (process and thread) are controlled by this interface. The probe is -controlled with the \fBprex\fR(1) utility. -.sp -.LP -The \fBtnf_process_disable()\fR function turns off probing for the process. The -default process state is to have probing enabled. The -\fBtnf_process_enable()\fR function turns on probing for the process. -.sp -.LP -The \fBtnf_thread_disable()\fR function turns off probing for the currently -running thread. Threads are "born" or created with this state enabled. The -\fBtnf_thread_enable()\fR function turns on probing for the currently running -thread. If the program is a non-threaded program, these two thread interfaces -disable or enable probing for the process. -.SH ATTRIBUTES -.sp -.LP -See \fBattributes\fR(7) for descriptions of the following attributes: -.sp - -.sp -.TS -box; -c | c -l | l . -ATTRIBUTE TYPE ATTRIBUTE VALUE -_ -Interface Stability Unstable -_ -MT-Level MT-Safe -.TE - -.SH SEE ALSO -.sp -.LP -.BR prex (1), -.BR tnfdump (1), -.BR TNF_DECLARE_RECORD (3TNF), -.BR TNF_PROBE (3TNF), -.BR attributes (7) -.SH NOTES -.sp -.LP -A probe is considered enabled only if: -.RS +4 -.TP -.ie t \(bu -.el o -\fBprex\fR(1) has enabled the probe AND -.RE -.RS +4 -.TP -.ie t \(bu -.el o -the process has probing enabled, which is the default or could be set with -\fBtnf_process_enable()\fR AND -.RE -.RS +4 -.TP -.ie t \(bu -.el o -the thread that hits the probe has probing enabled, which is every thread's -default or could be set with \fBtnf_thread_enable()\fR. -.RE -.sp -.LP -There is a run time cost associated with determining that the probe is -disabled. To reduce the performance effect of probes, this cost should be -minimized. The quickest way that a probe can be determined to be disabled is -by the enable control that \fBprex\fR(1) uses. Therefore, to disable all the -probes in a process use the \fBdisable\fR command in \fBprex\fR(1) rather than -\fBtnf_process_disable()\fR. -.sp -.LP -The \fBtnf_process_disable()\fR and \fBtnf_process_enable()\fR functions should -only be used to toggle probing based on some internal program condition. The -\fBtnf_thread_disable()\fR function should be used to turn off probing for -threads that are uninteresting. diff --git a/usr/src/man/man3tnf/tnfctl_buffer_alloc.3tnf b/usr/src/man/man3tnf/tnfctl_buffer_alloc.3tnf deleted file mode 100644 index 1d7a7f5666..0000000000 --- a/usr/src/man/man3tnf/tnfctl_buffer_alloc.3tnf +++ /dev/null @@ -1,207 +0,0 @@ -'\" te -.\" Copyright (c) 1996 Sun Microsystems, Inc. All Rights Reserved -.\" 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] -.TH TNFCTL_BUFFER_ALLOC 3TNF "Mar 4, 1997" -.SH NAME -tnfctl_buffer_alloc, tnfctl_buffer_dealloc \- allocate or deallocate a buffer -for trace data -.SH SYNOPSIS -.LP -.nf -\fBcc\fR [ \fIflag\fR ... ] \fIfile\fR ... \fB-ltnfctl\fR [ \fIlibrary\fR ... ] -#include <tnf/tnfctl.h> -\fBtnfctl_errcode_t\fR \fBtnfctl_buffer_alloc\fR(\fBtnfctl_handle_t *\fR\fIhndl\fR, - \fBconst char *\fR\fItrace_file_name\fR, \fBsize_t\fR \fItrace_buffer_size\fR); -.fi - -.LP -.nf -\fB\fR\fBtnfctl_buffer_dealloc\fR(\fBtnfctl_handle_t *\fR\fIhndl\fR); -.fi - -.SH DESCRIPTION -.sp -.LP -\fBtnfctl_buffer_alloc()\fR allocates a buffer to which trace events are -logged. When tracing a process using a \fBtnfctl\fR handle returned by -\fBtnfctl_pid_open\fR(3TNF), \fBtnfctl_exec_open\fR(3TNF), -\fBtnfctl_indirect_open\fR(3TNF), and \fBtnfctl_internal_open\fR(3TNF)), -\fItrace_file_name\fR is the name of the trace file to which trace events -should be logged. It can be an absolute path specification or a relative path -specification. If it is relative, the current working directory of the process -that is calling \fBtnfctl_buffer_alloc()\fR is prefixed to -\fItrace_file_name\fR. If the named trace file already exists, it is -overwritten. For kernel tracing, that is, for a tnfctl handle returned by -\fBtnfctl_kernel_open\fR(3TNF), trace events are logged to a trace buffer in -memory; therefore, \fItrace_file_name\fR is ignored. Use \fBtnfxtract\fR(1) to -extract a kernel buffer into a file. -.sp -.LP -\fItrace_buffer_size\fR is the size in bytes of the trace buffer that should be -allocated. An error is returned if an attempt is made to allocate a buffer when -one already exists. \fBtnfctl_buffer_alloc()\fR affects the trace attributes; -use \fBtnfctl_trace_attrs_get\fR(3TNF) to get the latest trace attributes -after a buffer is allocated. -.sp -.LP -\fBtnfctl_buffer_dealloc()\fR is used to deallocate a kernel trace buffer that -is no longer needed. \fIhndl\fR must be a kernel handle, returned by -\fBtnfctl_kernel_open\fR(3TNF). A process's trace file cannot be deallocated -using \fBtnfctl_buffer_dealloc()\fR. Instead, once the trace file is no longer -needed for analysis and after the process being traced exits, use \fBrm\fR(1) -to remove the trace file. Do not remove the trace file while the process being -traced is still alive. \fBtnfctl_buffer_dealloc()\fR affects the trace -attributes; use \fBtnfctl_trace_attrs_get\fR(3TNF) to get the latest trace -attributes after a buffer is deallocated. -.sp -.LP -For a complete discussion of \fBtnf tracing\fR, see \fBtracing\fR(3TNF). -.SH RETURN VALUES -.sp -.LP -\fBtnfctl_buffer_alloc()\fR and \fBtnfctl_buffer_dealloc()\fR return -\fBTNFCTL_ERR_NONE\fR upon success. -.SH ERRORS -.sp -.LP -The following error codes apply to \fBtnfctl_buffer_alloc()\fR: -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_BUFEXISTS\fR\fR -.ad -.RS 27n -A buffer already exists. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_ACCES\fR\fR -.ad -.RS 27n -Permission denied; could not create a trace file. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_SIZETOOSMALL\fR\fR -.ad -.RS 27n -The \fItrace_buffer_size\fR requested is smaller than the minimum trace buffer -size needed. Use \fBtrace_min_size\fR of trace attributes in -\fBtnfctl_trace_attrs_get\fR(3TNF) to determine the minimum size of the buffer. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_SIZETOOBIG\fR\fR -.ad -.RS 27n -The requested trace file size is too big. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_BADARG\fR\fR -.ad -.RS 27n -\fItrace_file_name\fR is \fINULL\fR or the absolute path name is longer than -\fBMAX\fR\fBPATH\fR\fBLEN.\fR -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_ALLOCFAIL\fR\fR -.ad -.RS 27n -A memory allocation failure occurred. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_INTERNAL\fR\fR -.ad -.RS 27n -An internal error occurred. -.RE - -.sp -.LP -The following error codes apply to \fBtnfctl_buffer_dealloc()\fR: -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_BADARG\fR\fR -.ad -.RS 25n -\fIhndl\fR is not a kernel handle. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_NOBUF\fR\fR -.ad -.RS 25n -No buffer exists to deallocate. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_BADDEALLOC\fR\fR -.ad -.RS 25n -Cannot deallocate a trace buffer unless tracing is stopped. Use -\fBtnfctl_trace_state_set\fR(3TNF) to stop tracing. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_INTERNAL\fR\fR -.ad -.RS 25n -An internal error occurred. -.RE - -.SH ATTRIBUTES -.sp -.LP -See \fBattributes\fR(7) for descriptions of the following attributes: -.sp - -.sp -.TS -box; -c | c -l | l . -ATTRIBUTE TYPE ATTRIBUTE VALUE -_ -MT Level MT-Safe -.TE - -.SH SEE ALSO -.sp -.LP -.BR prex (1), -.BR rm (1), -.BR tnfxtract (1), -.BR TNF_PROBE (3TNF), -.BR libtnfctl (3TNF), -.BR tnfctl_exec_open (3TNF), -.BR tnfctl_indirect_open (3TNF), -.BR tnfctl_internal_open (3TNF), -.BR tnfctl_kernel_open (3TNF), -.BR tnfctl_pid_open (3TNF), -.BR tnfctl_trace_attrs_get (3TNF), -.BR tracing (3TNF), -.BR attributes (7) diff --git a/usr/src/man/man3tnf/tnfctl_close.3tnf b/usr/src/man/man3tnf/tnfctl_close.3tnf deleted file mode 100644 index 1d1a732e05..0000000000 --- a/usr/src/man/man3tnf/tnfctl_close.3tnf +++ /dev/null @@ -1,129 +0,0 @@ -'\" te -.\" Copyright (c) 1996 Sun Microsystems, Inc. All Rights Reserved -.\" 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] -.TH TNFCTL_CLOSE 3TNF "Mar 4, 1997" -.SH NAME -tnfctl_close \- close a tnfctl handle -.SH SYNOPSIS -.LP -.nf -\fBcc\fR [ \fIflag\fR ... ] \fIfile\fR ... \fB-ltnfctl\fR [ \fIlibrary\fR ... ] -#include <tnf/tnfctl.h> -\fBtnfctl_errcode_t\fR \fBtnfctl_close\fR(\fBtnfctl_handle_t *\fR\fIhndl\fR, - \fBtnfctl_targ_op_t\fR \fIaction\fR); -.fi - -.SH DESCRIPTION -.sp -.LP -\fBtnfctl_close()\fR is used to close a tnfctl handle and to free up the memory -associated with the handle. When the handle is closed, the tracing state and -the states of the probes are not changed. \fBtnfctl_close()\fR can be used to -close handles in any mode, that is, whether they were created by -\fBtnfctl_internal_open\fR(3TNF), \fBtnfctl_pid_open\fR(3TNF), -\fBtnfctl_exec_open\fR(3TNF), \fBtnfctl_indirect_open\fR(3TNF), or -\fBtnfctl_kernel_open\fR(3TNF). -.sp -.LP -The \fIaction\fR argument is only used in direct mode, that is, if \fIhndl\fR -was created by \fBtnfctl_exec_open\fR(3TNF) or \fBtnfctl_pid_open\fR(3TNF). In -direct mode, \fIaction\fR specifies whether the process will proceed, be -killed, or remain suspended. \fIaction\fR may have the following values: -.sp -.ne 2 -.na -\fB\fBTNFCTL_TARG_DEFAULT\fR\fR -.ad -.RS 23n -Kills the target process if \fIhndl\fR was created with -\fBtnfctl_exec_open\fR(3TNF), but lets it continue if it was created with -\fBtnfctl_pid_open\fR(3TNF). -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_TARG_KILL\fR\fR -.ad -.RS 23n -Kills the target process. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_TARG_RESUME\fR\fR -.ad -.RS 23n -Allows the target process to continue. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_TARG_SUSPEND\fR\fR -.ad -.RS 23n -Leaves the target process suspended. This is not a job control suspend. It is -possible to attach to the process again with a debugger or with the -\fBtnfctl_pid_open\fR(3TNF) interface. The target process can also be -continued with \fBprun\fR(1). -.RE - -.SH RETURN VALUES -.sp -.LP -\fBtnfctl_close()\fR returns \fBTNFCTL_ERR_NONE\fR upon success. -.SH ERRORS -.sp -.LP -The following error codes apply to \fBtnfctl_close()\fR: -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_BADARG\fR\fR -.ad -.RS 23n -A bad argument was sent in \fIaction\fR. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_INTERNAL\fR\fR -.ad -.RS 23n -An internal error occurred. -.RE - -.SH ATTRIBUTES -.sp -.LP -See \fBattributes\fR(7) for descriptions of the following attributes: -.sp - -.sp -.TS -box; -c | c -l | l . -ATTRIBUTE TYPE ATTRIBUTE VALUE -_ -MT Level MT-Safe -.TE - -.SH SEE ALSO -.sp -.LP -.BR prex (1), -.BR prun (1), -.BR TNF_PROBE (3TNF), -.BR libtnfctl (3TNF), -.BR tnfctl_exec_open (3TNF), -.BR tnfctl_indirect_open (3TNF), -.BR tnfctl_kernel_open (3TNF), -.BR tnfctl_pid_open (3TNF), -.BR tracing (3TNF), -.BR attributes (7) diff --git a/usr/src/man/man3tnf/tnfctl_indirect_open.3tnf b/usr/src/man/man3tnf/tnfctl_indirect_open.3tnf deleted file mode 100644 index 4708ff4948..0000000000 --- a/usr/src/man/man3tnf/tnfctl_indirect_open.3tnf +++ /dev/null @@ -1,210 +0,0 @@ -'\" te -.\" Copyright (c) 2004 Sun Microsystems, Inc. All Rights Reserved -.\" 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] -.TH TNFCTL_INDIRECT_OPEN 3TNF "August 29, 2021" -.SH NAME -tnfctl_indirect_open, tnfctl_check_libs \- control probes of another process -where caller provides /proc functionality -.SH SYNOPSIS -.nf -\fBcc\fR [ \fIflag\fR ... ] \fIfile\fR ... \fB-ltnfctl\fR [ \fIlibrary\fR ... ] -#include <tnf/tnfctl.h> - -\fBtnfctl_errcode_t\fR \fBtnfctl_indirect_open\fR(\fBvoid *\fR\fIprochandle\fR, - \fBtnfctl_ind_config_t *\fR\fIconfig\fR, \fBtnfctl_handle_t **\fR\fIret_val\fR); -.fi - -.LP -.nf -\fBtnfctl_errcode_t\fR \fBtnfctl_check_libs\fR(\fBtnfctl_handle_t *\fR\fIhndl\fR); -.fi - -.SH DESCRIPTION -The interfaces \fBtnfctl_indirect_open()\fR and \fBtnfctl_check_libs()\fR are -used to control probes in another process where the \fBlibtnfctl\fR(3TNF) -client has already opened \fBproc\fR(5) on the target process. An example of -this is when the client is a debugger. Since these clients already use -\fB/proc\fR on the target, \fBlibtnfctl\fR(3TNF) cannot use \fB/proc\fR -directly. Therefore, these clients must provide callback functions that can be -used to inspect and to update the target process. The target process must -load \fBlibtnfprobe.so.1\fR (defined in \fB<tnf/tnfctl.h>\fR as macro -\fBTNFCTL_LIBTNFPROBE).\fR -.sp -.LP -The first argument \fIprochandle\fR is a pointer to an opaque structure that is -used in the callback functions that inspect and update the target process. -This structure should encapsulate the state that the caller needs to use -\fB/proc\fR on the target process (the \fB/proc\fR file descriptor). The -second argument, \fIconfig\fR, is a pointer to -.sp -.in +2 -.nf -typedef -struct tnfctl_ind_config { - int (*p_read)(void *prochandle, paddr_t addr, char *buf, - size_t size); - int (*p_write)(void *prochandle, paddr_t addr, char *buf, - size_t size); - pid_t (*p_getpid)(void *prochandle); - int (*p_obj_iter)(void *prochandle, tnfctl_ind_obj_f *func, - void *client_data); -} tnfctl_ind_config_t; -.fi -.in -2 - -.sp -.LP -The first field \fIp_read\fR is the address of a function that can read -\fBsize\fR bytes at address \fIaddr\fR in the target image into the buffer -\fIbuf\fR. The function should return \fB0\fR upon success. The second field -\fIp_write\fR is the address of a function that can write \fBsize\fR bytes at -address \fIaddr\fR in the target image from the buffer \fIbuf\fR. The function -should return \fB0\fR upon success. The third field \fIp_getpid\fR is the -address of a function that should return the process id of the target process -(\fIprochandle\fR). The fourth field \fIp_obj_iter\fR is the address of a -function that iterates over all load objects and the executable by calling the -callback function \fIfunc\fR with \fIclient_data\fR. If \fIfunc\fR returns -\fB0\fR, \fIp_obj_iter\fR should continue processing link objects. If -\fIfunc\fR returns any other value, \fIp_obj_iter\fR should stop calling the -callback function and return that value. \fIp_obj_iter\fR should return -\fB0\fR if it iterates over all load objects. -.sp -.LP -If a failure is returned by any of the functions in \fIconfig\fR, the error is -propagated back as \fBPREX_ERR_INTERNAL\fR by the \fBlibtnfctl\fR interface -that called it. -.sp -.LP -The definition of \fBtnfctl_ind_obj_f\fR is: -.sp -.in +2 -.nf -typedef int -tnfctl_ind_obj_f(void *prochandle, - const struct tnfctl_ind_obj_info *obj - void *client_data); -typedef struct tnfctl_ind_obj_info { - int objfd; /* -1 indicates fd not available */ - paddr_t text_base; /* virtual addr of text segment */ - paddr_t data_base; /* virtual addr of data segment */ - const char *objname; /* null-term. pathname to loadobj */ -} tnfctl_ind_obj_info_t; -.fi -.in -2 - -.sp -.LP -\fIobjfd\fR should be the file descriptor of the load object or executable. If -it is \fB\(mi1\fR, then \fIobjname\fR should be an absolute pathname to the -load object or executable. If \fIobjfd\fR is not closed by \fBlibtnfctl\fR, it -should be closed by the load object iterator function. \fItext_base\fR and -\fIdata_base\fR are the addresses where the text and data segments of the load -object are mapped in the target process. -.sp -.LP -Whenever the target process opens or closes a dynamic object, the set of -available probes may change. See \fBdlopen\fR(3C) and \fBdlclose\fR(3C). In -indirect mode, call \fBtnfctl_check_libs()\fR when such events occur to make -\fBlibtnfctl\fR aware of any changes. In other modes this is unnecessary but -harmless. It is also harmless to call \fBtnfctl_check_libs()\fR when no such -events have occurred. -.SH RETURN VALUES -\fBtnfctl_indirect_open()\fR and \fBtnfctl_check_libs()\fR return -\fBTNFCTL_ERR_NONE\fR upon success. -.SH ERRORS -The following error codes apply to \fBtnfctl_indirect_open()\fR: -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_ALLOCFAIL\fR\fR -.ad -.RS 28n -A memory allocation failure occurred. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_BUSY\fR\fR -.ad -.RS 28n -Internal tracing is being used. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_NOLIBTNFPROBE\fR\fR -.ad -.RS 28n -\fBlibtnfprobe.so.1\fR is not loaded in the target process. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_INTERNAL\fR\fR -.ad -.RS 28n -An internal error occurred. -.RE - -.sp -.LP -The following error codes apply to \fBtnfctl_check_libs()\fR: -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_ALLOCFAIL\fR\fR -.ad -.RS 24n -A memory allocation failure occurred. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_INTERNAL\fR\fR -.ad -.RS 24n -An internal error occurred. -.RE - -.SH ATTRIBUTES -See \fBattributes\fR(7) for descriptions of the following attributes: -.sp - -.sp -.TS -box; -c | c -l | l . -ATTRIBUTE TYPE ATTRIBUTE VALUE -_ -MT Level MT-Safe -.TE - -.SH SEE ALSO -.BR prex (1), -.BR dlclose (3C), -.BR dlopen (3C), -.BR TNF_PROBE (3TNF), -.BR libtnfctl (3TNF), -.BR tnfctl_probe_enable (3TNF), -.BR tnfctl_probe_trace (3TNF), -.BR tracing (3TNF), -.BR proc (5), -.BR attributes (7) -.sp -.LP -\fILinker and Libraries Guide\fR -.SH NOTES -\fBtnfctl_indirect_open()\fR should only be called after the dynamic linker has -mapped in all the libraries (rtld sync point) and called only after the process -is stopped. Indirect process probe control assumes the target process is -stopped whenever any \fBlibtnfctl\fR interface is used on it. For example, -when used for indirect process probe control, \fBtnfctl_probe_enable\fR(3TNF) -and \fBtnfctl_probe_trace\fR(3TNF) should be called only for a process that is -stopped. diff --git a/usr/src/man/man3tnf/tnfctl_internal_open.3tnf b/usr/src/man/man3tnf/tnfctl_internal_open.3tnf deleted file mode 100644 index c3062712c1..0000000000 --- a/usr/src/man/man3tnf/tnfctl_internal_open.3tnf +++ /dev/null @@ -1,126 +0,0 @@ -'\" te -.\" Copyright (c) 2004 Sun Microsystems, Inc. All Rights Reserved -.\" 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] -.TH TNFCTL_INTERNAL_OPEN 3TNF "Mar 1, 2004" -.SH NAME -tnfctl_internal_open \- create handle for internal process probe control -.SH SYNOPSIS -.LP -.nf -\fBcc\fR [ \fIflag\fR ... ] \fIfile\fR ... \fB-ltnfctl\fR [ \fIlibrary\fR ... ] -#include <tnf/tnfctl.h> - - - -\fBtnfctl_errcode_t\fR \fBtnfctl_internal_open\fR(\fBtnfctl_handle_t **\fR\fIret_val\fR); -.fi - -.SH DESCRIPTION -.sp -.LP -\fBtnfctl_internal_open()\fR returns in \fIret_val\fR a pointer to an opaque -handle that can be used to control probes in the same process as the caller -(internal process probe control). The process must have \fBlibtnfprobe.so.1\fR -loaded. Probes in libraries that are brought in by \fBdlopen\fR(3C) will be -visible after the library has been opened. Probes in libraries closed by a -\fBdlclose\fR(3C) will not be visible after the library has been disassociated. -See the \fBNOTES\fR section for more details. -.SH RETURN VALUES -.sp -.LP -\fBtnfctl_internal_open()\fR returns \fBTNFCTL_ERR_NONE\fR upon success. -.SH ERRORS -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_ALLOCFAIL\fR\fR -.ad -.RS 28n -A memory allocation failure occurred. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_BUSY\fR\fR -.ad -.RS 28n -Another client is already tracing this program (internally or externally). -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_NOLIBTNFPROBE\fR\fR -.ad -.RS 28n -\fBlibtnfprobe.so.1\fR is not linked in the target process. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_INTERNAL\fR\fR -.ad -.RS 28n -An internal error occurred. -.RE - -.SH ATTRIBUTES -.sp -.LP -See \fBattributes\fR(7) for descriptions of the following attributes: -.sp - -.sp -.TS -box; -c | c -l | l . -ATTRIBUTE TYPE ATTRIBUTE VALUE -_ -MT Level MT-Safe -.TE - -.SH SEE ALSO -.sp -.LP -.BR ld (1), -.BR prex (1), -.BR dlclose (3C), -.BR dlopen (3C), -.BR TNF_PROBE (3TNF), -.BR libtnfctl (3TNF), -.BR tracing (3TNF), -.BR attributes (7) -.sp -.LP -\fILinker and Libraries Guide\fR -.SH NOTES -.sp -.LP -\fBlibtnfctl\fR interposes on \fBdlopen\fR(3C) and \fBdlclose\fR(3C) in order -to be notified of libraries being dynamically opened and closed. This -interposition is necessary for internal process probe control to update its -list of probes. In these interposition functions, a lock is acquired to -synchronize on traversal of the library list maintained by the runtime linker. -To avoid deadlocking on this lock, \fBtnfctl_internal_open()\fR should not be -called from within the init section of a library that can be opened by -\fBdlopen\fR(3C). -.sp -.LP -Since interposition does not work as expected when a library is opened -dynamically, \fBtnfctl_internal_open()\fR should not be used if the client -opened \fBlibtnfctl\fR through \fBdlopen\fR(3C). In this case, the client -program should be built with a static dependency on \fBlibtnfctl.\fR Also, if -the client program is explicitly linking in \fB-ldl\fR, it should link -\fB-ltnfctl\fR before \fB-ldl\fR. -.sp -.LP -Probes in filtered libraries (see \fBld\fR(1)) will not be seen because the -filtee (backing library) is loaded lazily on the first symbol reference and not -at process startup or \fBdlopen\fR(3C) time. A workaround is to call -\fBtnfctl_check_libs\fR(3TNF) once the caller is sure that the filtee has been -loaded. diff --git a/usr/src/man/man3tnf/tnfctl_kernel_open.3tnf b/usr/src/man/man3tnf/tnfctl_kernel_open.3tnf deleted file mode 100644 index e9d23afd5a..0000000000 --- a/usr/src/man/man3tnf/tnfctl_kernel_open.3tnf +++ /dev/null @@ -1,117 +0,0 @@ -'\" te -.\" Copyright (c) 1996 Sun Microsystems, Inc. All Rights Reserved -.\" 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] -.TH TNFCTL_KERNEL_OPEN 3TNF "Mar 4, 1997" -.SH NAME -tnfctl_kernel_open \- create handle for kernel probe control -.SH SYNOPSIS -.LP -.nf -\fBcc\fR [ \fIflag\fR ... ] \fIfile\fR ... \fB-ltnfctl\fR [ \fIlibrary\fR ... ] -#include <tnf/tnfctl.h> - - - -\fBtnfctl_errcode_t\fR \fBtnfctl_kernel_open\fR(\fBtnfctl_handle_t **\fR\fIret_val\fR); -.fi - -.SH DESCRIPTION -.sp -.LP -\fBtnfctl_kernel_open()\fR starts a kernel tracing session and returns in -\fBret_val\fR an opaque handle that can be used to control tracing and probes -in the kernel. Only one kernel tracing session is possible at a time on a -given machine. An error code of \fBTNFCTL_ERR_BUSY\fR is returned if there is -another process using kernel tracing. Use the command -.sp -.in +2 -.nf -\fBfuser\fR \fB-f\fR \fB/dev/tnfctl\fR -.fi -.in -2 -.sp - -.sp -.LP -to print the process id of the process currently using kernel tracing. Only a -superuser may use \fBtnfctl_kernel_open()\fR. An error code of -\fBTNFCTL_ERR_ACCES\fR is returned if the caller does not have the necessary -privileges. -.SH RETURN VALUES -.sp -.LP -\fBtnfctl_kernel_open\fR returns \fBTNFCTL_ERR_NONE\fR upon success. -.SH ERRORS -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_ACCES\fR\fR -.ad -.RS 27n -Permission denied. Superuser privileges are needed for kernel tracing. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_BUSY\fR\fR -.ad -.RS 27n -Another client is currently using kernel tracing. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_ALLOCFAIL\fR\fR -.ad -.RS 27n -Memory allocation failed. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_FILENOTFOUND\fR\fR -.ad -.RS 27n -\fB/dev/tnfctl\fR not found. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_INTERNAL\fR\fR -.ad -.RS 27n -Some other failure occurred. -.RE - -.SH ATTRIBUTES -.sp -.LP -See \fBattributes\fR(7) for descriptions of the following attributes: -.sp - -.sp -.TS -box; -c | c -l | l . -ATTRIBUTE TYPE ATTRIBUTE VALUE -_ -MT Level MT-Safe -.TE - -.SH SEE ALSO -.sp -.LP -.BR prex (1), -.BR TNF_PROBE (3TNF), -.BR libtnfctl (3TNF), -.BR tracing (3TNF), -.BR tnf_kernel_probes (5), -.BR attributes (7), -.BR fuser (8) diff --git a/usr/src/man/man3tnf/tnfctl_pid_open.3tnf b/usr/src/man/man3tnf/tnfctl_pid_open.3tnf deleted file mode 100644 index ad6257600a..0000000000 --- a/usr/src/man/man3tnf/tnfctl_pid_open.3tnf +++ /dev/null @@ -1,499 +0,0 @@ -'\" te -.\" Copyright (c) 2004 Sun Microsystems, Inc. All Rights Reserved -.\" 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] -.TH TNFCTL_PID_OPEN 3TNF "Mar 1, 2004" -.SH NAME -tnfctl_pid_open, tnfctl_exec_open, tnfctl_continue \- interfaces for direct -probe and process control for another process -.SH SYNOPSIS -.LP -.nf -\fBcc\fR [ \fIflag\fR ... ] \fIfile\fR ... \fB-ltnfctl\fR [ \fIlibrary\fR ... ] -#include <tnf/tnfctl.h> - -\fBtnfctl_errcode_t\fR \fBtnfctl_pid_open\fR(\fBpid_t\fR \fIpid\fR, \fBtnfctl_handle_t **\fR\fIret_val\fR); -.fi - -.LP -.nf -\fBtnfctl_errcode_t\fR \fBtnfctl_exec_open\fR(\fBconst char *\fR\fIpgm_name\fR, - \fBchar * const *\fR\fIargv\fR, \fBchar * const *\fR\fIenvp\fR, - \fBconst char *\fR\fIlibnfprobe_path\fR, \fBconst char *\fR\fIld_preload\fR, - \fBtnfctl_handle_t **\fR\fIret_val\fR); -.fi - -.LP -.nf -\fBtnfctl_errcode_t\fR \fBtnfctl_continue\fR(\fBtnfctl_handle_t *\fR\fIhndl\fR, - \fBtnfctl_event_t *\fR\fIevt\fR, \fBtnfctl_handle_t **\fR\fIchild_hndl\fR); -.fi - -.SH DESCRIPTION -.sp -.LP -The \fBtnfctl_pid_open()\fR, \fBtnfctl_exec_open()\fR, and -\fBtnfctl_continue()\fR functions create handles to control probes in another -process (direct process probe control). Either \fBtnfctl_pid_open()\fR or -\fBtnfctl_exec_open()\fR will return a handle in \fIret_val\fR that can be used -for probe control. On return of these calls, the process is stopped. -\fBtnfctl_continue()\fR allows the process specified by \fIhndl\fR to continue -execution. -.sp -.LP -The \fBtnfctl_pid_open()\fR function attaches to a running process with process -id of \fIpid\fR. The process is stopped on return of this call. The -\fBtnfctl_pid_open()\fR function returns an error message if \fIpid\fR is the -same as the calling process. See \fBtnfctl_internal_open\fR(3TNF) for -information on internal process probe control. A pointer to an opaque handle is -returned in \fIret_val\fR, which can be used to control the process and the -probes in the process. The target process must have \fBlibtnfprobe.so.1\fR -(defined in <\fBtnf/tnfctl.h\fR> as macro \fBTNFCTL_LIBTNFPROBE)\fR linked in -for probe control to work. -.sp -.LP -The \fBtnfctl_exec_open()\fR function is used to \fBexec\fR(2) a program and -obtain a probe control handle. For probe control to work, the process image to -be \fBexec\fR'd must load \fBlibtnfprobe.so.1\fR. The \fBtnfctl_exec_open()\fR -function makes it simple for the library to be loaded at process start up time. -The \fIpgm_name\fR argument is the command to \fBexec\fR. If \fIpgm_name\fR is -not an absolute path, then the \fB$PATH\fR environment variable is used to -find the \fIpgm_name\fR. \fIargv\fR is a null-terminated argument pointer, that -is, it is a null-terminated array of pointers to null-terminated strings. These -strings constitute the argument list available to the new process image. The -\fIargv\fR argument must have at least one member, and it should point to a -string that is the same as \fIpgm_name\fR. See \fBexecve\fR(2). The -\fIlibnfprobe_path\fR argument is an optional argument, and if set, it should -be the path to the directory that contains \fBlibtnfprobe.so.1\fR. There is no -need for a trailing "/" in this argument. This argument is useful if -\fBlibtnfprobe.so.1\fR is not installed in \fB/usr/lib\fR. \fIld_preload\fR is -a space-separated list of libraries to preload into the target program. This -string should follow the syntax guidelines of the \fBLD_PRELOAD\fR environment -variable. See \fBld.so.1\fR(1). The following illustrates how strings are -concatenated to form the \fBLD_PRELOAD\fR environment variable in the new -process image: -.sp -.in +2 -.nf -<current value of $LD_PRELOAD> + <space> + -libtnfprobe_path + "/libtnfprobe.so.1" +<space> + -ld_preload -.fi -.in -2 - -.sp -.LP -This option is useful for preloading interposition libraries that have probes -in them. -.sp -.LP -\fIenvp\fR is an optional argument, and if set, it is used for the environment -of the target program. It is a null-terminated array of pointers to -null-terminated strings. These strings constitute the environment of the new -process image. See \fBexecve\fR(2). If \fIenvp\fR is set, it overrides -\fIld_preload\fR. In this case, it is the caller's responsibility to ensure -that \fBlibtnfprobe.so.1\fR is loaded into the target program. If \fIenvp\fR -is not set, the new process image inherits the environment of the calling -process, except for \fBLD_PRELOAD\fR. -.sp -.LP -The \fIret_val\fR argument is the handle that can be used to control the -process and the probes within the process. Upon return, the process is stopped -before any user code, including \fB\&.init\fR sections, has been executed. -.sp -.LP -The \fBtnfctl_continue()\fR function is a blocking call and lets the target -process referenced by \fIhndl\fR continue running. It can only be used on -handles returned by \fBtnfctl_pid_open()\fR and \fBtnfctl_exec_open()\fR -(direct process probe control). It returns when the target stops; the reason -that the process stopped is returned in \fIevt\fR. This call is interruptible -by signals. If it is interrupted, the process is stopped, and -\fBTNFCTL_EVENT_EINTR\fR is returned in \fIevt\fR. The client of this library -will have to decide which signal implies a stop to the target and catch that -signal. Since a signal interrupts \fBtnfctl_continue()\fR, it will return, and -the caller can decide whether or not to call \fBtnfctl_continue()\fR again. -.sp -.LP -\fBtnfctl_continue()\fR returns with an event of \fBTNFCTL_EVENT_DLOPEN\fR, -\fBTNFCTL_EVENT_DLCLOSE\fR, \fBTNFCTL_EVENT_EXEC\fR, \fBTNFCTL_EVENT_FORK\fR, -\fBTNFCTL_EVENT_EXIT\fR, or \fBTNFCTL_EVENT_TARGGONE\fR, respectively, when the -target program calls \fBdlopen\fR(3C), \fBdlclose\fR(3C), any flavor of -\fBexec\fR(2), \fBfork\fR(2) (or \fBfork1\fR(2)), \fBexit\fR(2), or terminates -unexpectedly. If the target program called \fBexec\fR(2), the client then needs -to call \fBtnfctl_close\fR(3TNF) on the current handle leaving the target -resumed, suspended, or killed (second argument to \fBtnfctl_close\fR(3TNF)). -No other \fBlibtnfctl\fR interface call can be used on the existing handle. If -the client wants to control the \fBexec\fR'ed image, it should leave the old -handle suspended, and use \fBtnfctl_pid_open()\fR to reattach to the same -process. This new handle can then be used to control the \fBexec\fR'ed image. -See \fBEXAMPLES\fR below for sample code. If the target process did a -\fBfork\fR(2) or \fBfork1\fR(2), and if control of the child process is not -needed, then \fIchild_hndl\fR should be \fINULL\fR. If control of the child -process is needed, then \fIchild_hndl\fR should be set. If it is set, a -pointer to a handle that can be used to control the child process is returned -in \fIchild_hndl\fR. The child process is stopped at the end of the -\fBfork()\fR system call. See \fBEXAMPLES\fR for an example of this event. -.SH RETURN VALUES -.sp -.LP -The \fBtnfctl_pid_open()\fR, \fBtnfctl_exec_open()\fR, and -\fBtnfctl_continue()\fR functions return \fBTNFCTL_ERR_NONE\fR upon success. -.SH ERRORS -.sp -.LP -The following error codes apply to \fBtnfctl_pid_open()\fR: -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_BADARG\fR\fR -.ad -.RS 28n -The \fIpid\fR specified is the same process. Use -\fBtnfctl_internal_open\fR(3TNF) instead. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_ACCES\fR\fR -.ad -.RS 28n -Permission denied. No privilege to connect to a setuid process. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_ALLOCFAIL\fR\fR -.ad -.RS 28n -A memory allocation failure occurred. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_BUSY\fR\fR -.ad -.RS 28n -Another client is already using \fB/proc\fR to control this process or -internal tracing is being used. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_NOTDYNAMIC\fR\fR -.ad -.RS 28n -The process is not a dynamic executable. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_NOPROCESS\fR\fR -.ad -.RS 28n -No such target process exists. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_NOLIBTNFPROBE\fR\fR -.ad -.RS 28n -\fBlibtnfprobe.so.1\fR is not linked in the target process. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_INTERNAL\fR\fR -.ad -.RS 28n -An internal error occurred. -.RE - -.sp -.LP -The following error codes apply to \fBtnfctl_exec_open()\fR: -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_ACCES\fR\fR -.ad -.RS 28n -Permission denied. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_ALLOCFAIL\fR\fR -.ad -.RS 28n -A memory allocation failure occurred. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_NOTDYNAMIC\fR\fR -.ad -.RS 28n -The target is not a dynamic executable. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_NOLIBTNFPROBE\fR\fR -.ad -.RS 28n -\fBlibtnfprobe.so.1\fR is not linked in the target process. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_FILENOTFOUND\fR\fR -.ad -.RS 28n -The program is not found. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_INTERNAL\fR\fR -.ad -.RS 28n -An internal error occurred. -.RE - -.sp -.LP -The following error codes apply to \fBtnfctl_continue()\fR: -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_BADARG\fR\fR -.ad -.RS 24n -Bad input argument. \fIhndl\fR is not a direct process probe control handle. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_INTERNAL\fR\fR -.ad -.RS 24n -An internal error occurred. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_NOPROCESS\fR\fR -.ad -.RS 24n -No such target process exists. -.RE - -.SH EXAMPLES -.LP -\fBExample 1 \fRUsing \fBtnfctl_pid_open()\fR -.sp -.LP -These examples do not include any error-handling code. Only the initial -example includes the declaration of the variables that are used in all of the -examples. - -.sp -.LP -The following example shows how to preload \fBlibtnfprobe.so.1\fR from the -normal location and inherit the parent's environment. - -.sp -.in +2 -.nf -const char *pgm; -char * const *argv; -tnfctl_handle_t *hndl, *new_hndl, *child_hndl; -tnfctl_errcode_t err; -char * const *envptr; -extern char **environ; -tnfctl_event_t evt; -int pid; - -/* assuming argv has been allocated */ -argv[0] = pgm; -/* set up rest of argument vector here */ -err = tnfctl_exec_open(pgm, argv, NULL, NULL, NULL, &hndl); -.fi -.in -2 - -.sp -.LP -This example shows how to preload two user-supplied libraries -\fBlibc_probe.so.1\fR and \fBlibthread_probe.so.1\fR. They interpose on the -corresponding \fBlibc.so\fR and \fBlibthread.so\fR interfaces and have probes -for function entry and exit. \fBlibtnfprobe.so.1\fR is preloaded from the -normal location and the parent's environment is inherited. - -.sp -.in +2 -.nf -/* assuming argv has been allocated */ -argv[0] = pgm; -/* set up rest of argument vector here */ -err = tnfctl_exec_open(pgm, argv, NULL, NULL, - "libc_probe.so.1 libthread_probe.so.1", &hndl); -.fi -.in -2 - -.sp -.LP -This example preloads an interposition library \fBlibc_probe.so.1\fR, and -specifies a different location from which to preload \fBlibtnfprobe.so.1\fR. - -.sp -.in +2 -.nf -/* assuming argv has been allocated */ -argv[0] = pgm; -/* set up rest of argument vector here */ -err = tnfctl_exec_open(pgm, argv, NULL, "/opt/SUNWXXX/lib", - "libc_probe.so.1", &hndl); -.fi -.in -2 - -.sp -.LP -To set up the environment explicitly for probe control to work, the target -process must link \fBlibtnfprobe.so.1\fR. If using \fIenvp\fR, it is the -caller's responsibility to do so. - -.sp -.in +2 -.nf -/* assuming argv has been allocated */ -argv[0] = pgm; -/* set up rest of argument vector here */ -/* envptr set up to caller's needs */ -err = tnfctl_exec_open(pgm, argv, envptr, NULL, NULL, &hndl); -.fi -.in -2 - -.sp -.LP -Use this example to resume a process that does an \fBexec\fR(2) without -controlling it. - -.sp -.in +2 -.nf -err = tnfctl_continue(hndl, &evt, NULL); -switch (evt) { -case TNFCTL_EVENT_EXEC: - /* let target process continue without control */ - err = tnfctl_close(hndl, TNFCTL_TARG_RESUME); - ... - break; -} -.fi -.in -2 - -.sp -.LP -Alternatively, use the next example to control a process that does an -\fBexec\fR(2). - -.sp -.in +2 -.nf -/* - * assume the pid variable has been set by calling - * tnfctl_trace_attrs_get() -*/ -err = tnfctl_continue(hndl, &evt, NULL); -switch (evt) { -case TNFCTL_EVENT_EXEC: - /* suspend the target process */ - err = tnfctl_close(hndl, TNFCTL_TARG_SUSPEND); - /* re-open the exec'ed image */ - err = tnfctl_pid_open(pid, &new_hndl); - /* new_hndl now controls the exec'ed image */ - ... - break; -} -.fi -.in -2 - -.sp -.LP -To let \fBfork\fR'ed children continue without control, use \fINULL\fR as the -last argument to \fBtnfctl_continue(\|).\fR - -.sp -.in +2 -.nf -err = tnfctl_continue(hndl, &evt, NULL); -.fi -.in -2 - -.sp -.LP -The next example is how to control child processes that \fBfork\fR(2) or -\fBfork1\fR(2) create. - -.sp -.in +2 -.nf -err = tnfctl_continue(hndl, &evt, &child_hndl); -switch (evt) { -case TNFCTL_EVENT_FORK: - /* spawn a new thread or process to control child_hndl */ - ... - break; -} -.fi -.in -2 - -.SH ATTRIBUTES -.sp -.LP -See \fBattributes\fR(7) for descriptions of the following attributes: -.sp - -.sp -.TS -box; -c | c -l | l . -ATTRIBUTE TYPE ATTRIBUTE VALUE -_ -MT Level MT-Safe -.TE - -.SH SEE ALSO -.sp -.LP -\fBld\fR(1), \fBprex\fR(1), \fBproc\fR(1), \fBexec\fR(2), \fBexecve\fR(2), -\fBexit\fR(2), \fBfork\fR(2), \fBTNF_PROBE\fR(3TNF), \fBdlclose\fR(3C), -\fBdlopen\fR(3C), \fBlibtnfctl\fR(3TNF), \fBtnfctl_close\fR(3TNF), -\fBtnfctl_internal_open\fR(3TNF), \fBtracing\fR(3TNF) \fBattributes\fR(7) -.sp -.LP -\fILinker and Libraries Guide\fR -.SH NOTES -.sp -.LP -After a call to \fBtnfctl_continue()\fR returns, a client should use -\fBtnfctl_trace_attrs_get\fR(3TNF) to check the \fBtrace_buf_state\fR member of -the trace attributes and make sure that there is no internal error in the -target. diff --git a/usr/src/man/man3tnf/tnfctl_probe_apply.3tnf b/usr/src/man/man3tnf/tnfctl_probe_apply.3tnf deleted file mode 100644 index dbdb0d5ccf..0000000000 --- a/usr/src/man/man3tnf/tnfctl_probe_apply.3tnf +++ /dev/null @@ -1,229 +0,0 @@ -'\" te -.\" Copyright (c) 2004 Sun Microsystems, Inc. All Rights Reserved -.\" 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] -.TH TNFCTL_PROBE_APPLY 3TNF "Mar 1, 2004" -.SH NAME -tnfctl_probe_apply, tnfctl_probe_apply_ids \- iterate over probes -.SH SYNOPSIS -.LP -.nf -\fBcc\fR [ \fIflag\fR ... ] \fIfile\fR ... \fB-ltnfctl\fR [ \fIlibrary\fR ... ] -#include <tnf/tnfctl.h> - -\fBtnfctl_errcode_t\fR \fBtnfctl_probe_apply\fR(\fBtnfctl_handle_t *\fR\fIhndl\fR, - \fBtnfctl_probe_op_t\fR \fIprobe_op\fR, \fBvoid *\fR\fIclientdata\fR); -.fi - -.LP -.nf -\fBtnfctl_errcode_t\fR \fBtnfctl_probe_apply_ids\fR(\fBtnfctl_handle_t *\fR\fIhndl\fR, - \fBulong_t\fR \fIprobe_count\fR, \fBulong_t *\fR\fIprobe_ids\fR, - \fBtnfctl_probe_op_t\fR \fIprobe_op\fR, \fBvoid *\fR\fIclientdata\fR); -.fi - -.SH DESCRIPTION -.sp -.LP -\fBtnfctl_probe_apply()\fR is used to iterate over the probes controlled by -\fIhndl.\fR For every probe, the \fIprobe_op\fR function is called: -.sp -.in +2 -.nf -typedef tnfctl_errcode_t (*tnfctl_probe_op_t)( - tnfctl_handle_t *hndl, - tnfctl_probe_t *probe_hndl, - void *clientdata); -.fi -.in -2 - -.sp -.LP -Several predefined functions are available for use as \fIprobe_op\fR. These -functions are described in \fBtnfctl_probe_state_get\fR(3TNF). -.sp -.LP -The \fIclientdata\fR supplied in \fBtnfctl_probe_apply()\fR is passed in as the -last argument of \fIprobe_op\fR. The \fIprobe_hndl\fR in the probe operation -function can be used to query or change the state of the probe. See -\fBtnfctl_probe_state_get\fR(3TNF). The \fIprobe_op\fR function should return -\fBTNFCTL_ERR_NONE\fR upon success. It can also return an error code, which -will cause \fBtnfctl_probe_apply()\fR to stop processing the rest of the probes -and return with the same error code. Note that there are five (5) error codes -reserved that the client can use for its own semantics. See \fBERRORS\fR. -.sp -.LP -The lifetime of \fIprobe_hndl\fR is the same as the lifetime of \fIhndl\fR. It -is good until \fIhndl\fR is closed by \fBtnfctl_close\fR(3TNF). Do not confuse -a \fIprobe_hndl\fR with \fIhndl\fR. The \fIprobe_hndl\fR refers to a particular -probe, while \fIhndl\fR refers to a process or the kernel. If \fIprobe_hndl\fR -is used in another \fBlibtnfctl\fR(3TNF) interface, and it references a probe -in a library that has been dynamically closed (see \fBdlclose\fR(3C)), then -the error code \fBTNFCTL_ERR_INVALIDPROBE\fR will be returned by that -interface. -.sp -.LP -\fBtnfctl_probe_apply_ids()\fR is very similar to \fBtnfctl_probe_apply()\fR. -The difference is that \fIprobe_op\fR is called only for probes that match a -probe id specified in the array of integers referenced by \fIprobe_ids\fR. The -number of probe ids in the array should be specified in \fIprobe_count\fR. Use -\fBtnfctl_probe_state_get()\fR to get the \fIprobe_id\fR that corresponds to -the \fIprobe_handl\fR. -.SH RETURN VALUES -.sp -.LP -\fBtnfctl_probe_apply()\fR and \fBtnfctl_probe_apply_ids()\fR return -\fBTNFCTL_ERR_NONE\fR upon success. -.SH ERRORS -.sp -.LP -The following errors apply to both \fBtnfctl_probe_apply()\fR and -\fBtnfctl_probe_apply_ids()\fR: -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_INTERNAL\fR\fR -.ad -.RS 23n -An internal error occurred. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_USR1\fR\fR -.ad -.RS 23n -Error code reserved for user. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_USR2\fR\fR -.ad -.RS 23n -Error code reserved for user. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_USR3\fR\fR -.ad -.RS 23n -Error code reserved for user. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_USR4\fR\fR -.ad -.RS 23n -Error code reserved for user. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_USR5\fR\fR -.ad -.RS 23n -Error code reserved for user. -.RE - -.sp -.LP -\fBtnfctl_probe_apply()\fR and \fBtnfctl_probe_apply_ids()\fR also return any -error returned by the callback function \fIprobe_op\fR. -.sp -.LP -The following errors apply only to \fBtnfctl_probe_apply_ids()\fR: -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_INVALIDPROBE\fR\fR -.ad -.RS 27n -The probe handle is no longer valid. For example, the probe is in a library -that has been closed by \fBdlclose\fR(3C). -.RE - -.SH EXAMPLES -.LP -\fBExample 1 \fREnabling Probes -.sp -.LP -To enable all probes: - -.sp -.in +2 -.nf -tnfctl_probe_apply(hndl, tnfctl_probe_enable, NULL); -.fi -.in -2 - -.LP -\fBExample 2 \fRDisabling Probes -.sp -.LP -To disable the probes that match a certain pattern in the probe attribute -string: - -.sp -.in +2 -.nf -/* To disable all probes that contain the string "vm" */ -tnfctl_probe_apply(hndl, select_disable, "vm"); -static tnfctl_errcode_t -select_disable(tnfctl_handle_t *hndl, tnfctl_probe_t *probe_hndl, -void *client_data) -{ - char *pattern = client_data; - tnfctl_probe_state_t probe_state; - tnfctl_probe_state_get(hndl, probe_hndl, &probe_state); - if (strstr(probe_state.attr_string, pattern)) { - tnfctl_probe_disable(hndl, probe_hndl, NULL); - } -} -.fi -.in -2 - -.sp -.LP -Note that these examples do not have any error handling code. - -.SH ATTRIBUTES -.sp -.LP -See \fBattributes\fR(7) for descriptions of the following attributes: -.sp - -.sp -.TS -box; -c | c -l | l . -ATTRIBUTE TYPE ATTRIBUTE VALUE -_ -MT-Level MT-Safe -.TE - -.SH SEE ALSO -.sp -.LP -.BR prex (1), -.BR dlclose (3C), -.BR dlopen (3C), -.BR TNF_PROBE (3TNF), -.BR libtnfctl (3TNF), -.BR tnfctl_close (3TNF), -.BR tnfctl_probe_state_get (3TNF), -.BR tracing (3TNF), -.BR tnf_kernel_probes (5), -.BR attributes (7) -.sp -.LP -\fILinker and Libraries Guide\fR diff --git a/usr/src/man/man3tnf/tnfctl_probe_state_get.3tnf b/usr/src/man/man3tnf/tnfctl_probe_state_get.3tnf deleted file mode 100644 index 51386d7ce0..0000000000 --- a/usr/src/man/man3tnf/tnfctl_probe_state_get.3tnf +++ /dev/null @@ -1,360 +0,0 @@ -'\" te -.\" Copyright (c) 2004 Sun Microsystems, Inc. All Rights Reserved -.\" 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] -.TH TNFCTL_PROBE_STATE_GET 3TNF "Mar 1, 2004" -.SH NAME -tnfctl_probe_state_get, tnfctl_probe_enable, tnfctl_probe_disable, -tnfctl_probe_trace, tnfctl_probe_untrace, tnfctl_probe_connect, -tnfctl_probe_disconnect_all \- interfaces to query and to change the state of a -probe -.SH SYNOPSIS -.LP -.nf -\fBcc\fR [ \fIflag\fR ... ] \fIfile\fR ... \fB-ltnfctl\fR [ \fIlibrary\fR ... ] -#include <tnf/tnfctl.h> - -\fBtnfctl_errcode_t\fR \fBtnfctl_probe_state_get\fR(\fBtnfctl_handle_t *\fR\fIhndl\fR, - \fBtnfctl_probe_t *\fR\fIprobe_hndl\fR, \fBtnfctl_probe_state_t *\fR\fIstate\fR); -.fi - -.LP -.nf -\fBtnfctl_errcode_t\fR \fBtnfctl_probe_enable\fR(\fBtnfctl_handle_t *\fR\fIhndl\fR, - \fBtnfctl_probe_t *\fR\fIprobe_hndl\fR, \fBvoid *\fR\fIignored\fR); -.fi - -.LP -.nf -\fBtnfctl_errcode_t\fR \fBtnfctl_probe_disable\fR(\fBtnfctl_handle_t *\fR\fIhndl\fR, - \fBtnfctl_probe_t *\fR\fIprobe_hndl\fR, \fBvoid *\fR\fIignored\fR); -.fi - -.LP -.nf -\fBtnfctl_errcode_t\fR \fBtnfctl_probe_trace\fR(\fBtnfctl_handle_t *\fR\fIhndl\fR, - \fBtnfctl_probe_t *\fR\fIprobe_hndl\fR, \fBvoid *\fR\fIignored\fR); -.fi - -.LP -.nf -\fBtnfctl_errcode_t\fR \fBtnfctl_probe_untrace\fR(\fBtnfctl_handle_t *\fR\fIhndl\fR, - \fBtnfctl_probe_t *\fR\fIprobe_hndl\fR, \fBvoid *\fR\fIignored\fR); -.fi - -.LP -.nf -\fBtnfctl_errcode_t\fR \fBtnfctl_probe_disconnect_all\fR(\fBtnfctl_handle_t *\fR\fIhndl\fR, - \fBtnfctl_probe_t *\fR\fIprobe_hndl\fR, \fBvoid *\fR\fIignored\fR); -.fi - -.LP -.nf -\fBtnfctl_errcode_t\fR \fBtnfctl_probe_connect\fR(\fBtnfctl_handle_t *\fR\fIhndl\fR, - \fBtnfctl_probe_t *\fR\fIprobe_hndl\fR, \fBconst char *\fR\fIlib_base_name\fR, - \fBconst char *\fR\fIfunc_name\fR); -.fi - -.SH DESCRIPTION -.sp -.LP -\fBtnfctl_probe_state_get()\fR returns the state of the probe specified by -\fIprobe_hndl\fR in the process or kernel specified by \fIhndl\fR. The user -will pass these in to an apply iterator. The caller must also allocate -\fIstate\fR and pass in a pointer to it. The semantics of the individual -members of \fIstate\fR are: -.sp -.ne 2 -.na -\fB\fBid\fR\fR -.ad -.RS 26n -The unique integer assigned to this probe. This number does not change over the -lifetime of this probe. A \fIprobe_hndl\fR can be obtained by using the calls -\fBtnfctl_apply()\fR, \fBtanfctl_apply_ids()\fR, or -\fBtnfctl_register_funcs()\fR. -.RE - -.sp -.ne 2 -.na -\fB\fBattr_string\fR\fR -.ad -.RS 26n -A string that consists of \fIattribute\fR \fIvalue\fR pairs separated by -semicolons. For the syntax of this string, see the syntax of the -\fBdetail\fR argument of the \fBTNF_PROBE\fR(3TNF) macro. The attributes -\fIname\fR, \fIslots\fR, \fIkeys\fR, \fBfile\fR, and \fBline\fR are defined for -every probe. Additional user-defined attributes can be added by using the -\fIdetail\fR argument of the \fBTNF_PROBE\fR(3TNF) macro. An example of -\fIattr_string\fR follows: -.sp -.in +2 -.nf -"name pageout;slots vnode pages_pageout ; -keys vm pageio io;file vm.c;line 25;" -.fi -.in -2 - -.RE - -.sp -.ne 2 -.na -\fB\fBenabled\fR\fR -.ad -.RS 26n -\fBB_TRUE\fR if the probe is enabled, or \fBB_FALSE\fR if the probe is -disabled. Probes are disabled by default. Use \fBtnfctl_probe_enable()\fR or -\fBtnfctl_probe_disable()\fR to change this state. -.RE - -.sp -.ne 2 -.na -\fB\fBtraced\fR\fR -.ad -.RS 26n -\fBB_TRUE\fR if the probe is traced, or \fBB_FALSE\fR if the probe is not -traced. Probes in user processes are traced by default. Kernel probes are -untraced by default. Use \fBtnfctl_probe_trace()\fR or -\fBtnfctl_probe_untrace()\fR to change this state. -.RE - -.sp -.ne 2 -.na -\fB\fBnew_probe\fR\fR -.ad -.RS 26n -\fBB_TRUE\fR if this is a new probe brought in since the last change in -libraries. See \fBdlopen\fR(3C) or \fBdlclose\fR(3C). Otherwise, the value of -\fBnew_probe\fR will be \fBB_FALSE\fR. This field is not meaningful for kernel -probe control. -.RE - -.sp -.ne 2 -.na -\fB\fBobj_name\fR\fR -.ad -.RS 26n -The name of the shared object or executable in which the probe is located. -This string can be freed, so the client should make a copy of the string if it -needs to be saved for use by other \fBlibtnfctl\fR interfaces. In kernel -mode, this string is always \fINULL.\fR -.RE - -.sp -.ne 2 -.na -\fB\fBfunc_names\fR\fR -.ad -.RS 26n -A null-terminated array of pointers to strings that contain the names of -functions connected to this probe. Whenever an enabled probe is encountered at -runtime, these functions are executed. This array also will be freed by the -library when the state of the probe changes. Use \fBtnfctl_probe_connect()\fR -or \fBtnfctl_probe_disconnect_all()\fR to change this state. -.RE - -.sp -.ne 2 -.na -\fB\fBfunc_addrs\fR\fR -.ad -.RS 26n -A null-terminated array of pointers to addresses of functions in the target -image connected to this probe. This array also will be freed by the library -when the state of the probe changes. -.RE - -.sp -.ne 2 -.na -\fB\fBclient_registered_data\fR\fR -.ad -.RS 26n -Data that was registered by the client for this probe by the creator function -in \fBtnfctl_register_funcs\fR(3TNF). -.RE - -.sp -.LP -\fBtnfctl_probe_enable(\|),\fR \fBtnfctl_probe_disable(\|),\fR -\fBtnfctl_probe_trace(\|),\fR \fBtnfctl_probe_untrace(\|),\fR and -\fBtnfctl_probe_disconnect_all()\fR ignore the last argument. This convenient -feature permits these functions to be used in the \fIprobe_op\fR field of -\fBtnfctl_probe_apply\fR(3TNF) and \fBtnfctl_probe_apply_ids\fR(3TNF). -\fBtnfctl_probe_enable()\fR enables the probe specified by \fIprobe_hndl\fR. -This is the master switch on a probe. A probe does not perform any action -until it is enabled. -.sp -.LP -\fBtnfctl_probe_disable()\fR disables the probe specified by \fIprobe_hndl\fR. -.sp -.LP -\fBtnfctl_probe_trace()\fR turns on tracing for the probe specified by -\fIprobe_hndl\fR. Probes emit a trace record only if the probe is traced. -.sp -.LP -\fBtnfctl_probe_untrace()\fR turns off tracing for the probe specified by -\fIprobe_hndl\fR. This is useful if you want to connect probe functions to a -probe without tracing it. -.sp -.LP -\fBtnfctl_probe_connect()\fR connects the function \fIfunc_name\fR which exists -in the library \fIlib_base_name\fR, to the probe specified by -\fIprobe_hndl\fR. \fBtnfctl_probe_connect()\fR returns an error code if used on -a kernel tnfctl handle. \fIlib_base_name\fR is the base name (not a path) of -the library. If it is \fINULL,\fR and multiple functions in the target -process match \fIfunc_name\fR, one of the matching functions is chosen -arbitrarily. A probe function is a function that is in the target's address -space and is written to a certain specification. The specification is not -currently published. -.sp -.LP -\fBtnf_probe_debug()\fR is one function exported by \fBlibtnfprobe.so.1\fR and -is the debug function that \fBprex\fR(1) uses. When the debug function is -executed, it prints out the probe arguments and the value of the -\fBsunw%debug\fR attribute of the probe to \fBstderr\fR. -.sp -.LP -\fBtnfctl_probe_disconnect_all()\fR disconnects all probe functions from the -probe specified by \fIprobe_hndl\fR. -.sp -.LP -Note that no \fBlibtnfctl\fR call returns a probe handle -(\fBtnfctl_probe_t\fR), yet each of the routines described here takes a -\fIprobe_hndl\fR as an argument. These routines may be used by passing them to -one of the \fBtnfctl_probe_apply\fR(3TNF) iterators as the "op" argument. -Alternatively, probe handles may be obtained and saved by a user's "op" -function, and they can be passed later as the \fIprobe_hndl\fR argument when -using any of the functions described here. -.SH RETURN VALUES -.sp -.LP -\fBtnfctl_probe_state_get(\|),\fR \fBtnfctl_probe_enable(\|),\fR -\fBtnfctl_probe_disable(\|),\fR \fBtnfctl_probe_trace(\|),\fR -\fBtnfctl_probe_untrace(\|),\fR \fBtnfctl_probe_disconnect_all()\fR and -\fBtnfctl_probe_connect()\fR return \fBTNFCTL_ERR_NONE\fR upon success. -.SH ERRORS -.sp -.LP -The following error codes apply to \fBtnfctl_probe_state_get()\fR: -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_INVALIDPROBE\fR\fR -.ad -.RS 27n -\fIprobe_hndl\fR is no longer valid. The library that the probe was in could -have been dynamically closed by \fBdlclose\fR(3C). -.RE - -.sp -.LP -The following error codes apply to \fBtnfctl_probe_enable()\fR, -\fBtnfctl_probe_disable()\fR, \fBtnfctl_probe_trace()\fR, -\fBtnfctl_probe_untrace()\fR, and \fBtnfctl_probe_disconnect_all()\fR -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_INVALIDPROBE\fR\fR -.ad -.RS 27n -\fIprobe_hndl\fR is no longer valid. The library that the probe was in could -have been dynamically closed by \fBdlclose\fR(3C). -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_BUFBROKEN\fR\fR -.ad -.RS 27n -Cannot do probe operations because tracing is broken in the target. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_NOBUF\fR\fR -.ad -.RS 27n -Cannot do probe operations until a buffer is allocated. See -\fBtnfctl_buffer_alloc\fR(3TNF). This error code does not apply to kernel -probe control. -.RE - -.sp -.LP -The following error codes apply to \fBtnfctl_probe_connect()\fR: -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_INVALIDPROBE\fR\fR -.ad -.RS 27n -\fIprobe_hndl\fR is no longer valid. The library that the probe was in could -have been dynamically closed by \fBdlclose\fR(3C). -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_BADARG\fR\fR -.ad -.RS 27n -The handle is a kernel handle, or \fIfunc_name\fR could not be found. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_BUFBROKEN\fR\fR -.ad -.RS 27n -Cannot do probe operations because tracing is broken in the target. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_NOBUF\fR\fR -.ad -.RS 27n -Cannot do probe operations until a buffer is allocated. See -\fBtnfctl_buffer_alloc\fR(3TNF). -.RE - -.SH ATTRIBUTES -.sp -.LP -See \fBattributes\fR(7) for description of the following attributes: -.sp - -.sp -.TS -box; -c | c -l | l . -ATTRIBUTE TYPE ATTRIBUTE VALUE -_ -MT Level MT-Safe -.TE - -.SH SEE ALSO -.sp -.LP -.BR prex (1), -.BR TNF_PROBE (3TNF), -.BR libtnfctl (3TNF), -.BR tnfctl_check_libs (3TNF), -.BR tnfctl_continue (3TNF), -.BR tnfctl_probe_apply (3TNF), -.BR tnfctl_probe_apply_ids (3TNF), -.BR tracing (3TNF), -.BR tnf_kernel_probes (5), -.BR attributes (7) diff --git a/usr/src/man/man3tnf/tnfctl_register_funcs.3tnf b/usr/src/man/man3tnf/tnfctl_register_funcs.3tnf deleted file mode 100644 index 55cb11ea8f..0000000000 --- a/usr/src/man/man3tnf/tnfctl_register_funcs.3tnf +++ /dev/null @@ -1,86 +0,0 @@ -'\" te -.\" Copyright (c) 2004 Sun Microsystems, Inc. All Rights Reserved -.\" 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] -.TH TNFCTL_REGISTER_FUNCS 3TNF "Mar 1, 2004" -.SH NAME -tnfctl_register_funcs \- register callbacks for probe creation and destruction -.SH SYNOPSIS -.LP -.nf -\fBcc\fR [ \fIflag\fR ... ] \fIfile\fR ... \fB-ltnfctl\fR [ \fIlibrary\fR ... ] -#include <tnf/tnfctl.h> - -\fBtnfctl_errcode_t\fR \fBtnfctl_register_funcs\fR(\fBtnfctl_handle_t *\fR\fIhndl\fR, \fBvoid * (*\fR\fIcreate_func\fR) - (tnfctl_handle_t *, tnfctl_probe_t *), \fBvoid (*\fR\fIdestroy_func\fR)(void *)); -.fi - -.SH DESCRIPTION -.sp -.LP -The function \fBtnfctl_register_funcs()\fR is used to store client-specific -data on a per-probe basis. It registers a creator and a destructor function -with \fIhndl\fR, either of which can be \fBNULL.\fR The creator function is -called for every probe that currently exists in \fIhndl.\fR Every time a new -probe is discovered, that is brought in by \fBdlopen\fR(3C), \fIcreate_func\fR -is called. -.sp -.LP -The return value of the creator function is stored as part of the probe state -and can be retrieved by \fBtnfctl_probe_state_get\fR(3TNF) in the member field -\fIclient_registered_data\fR. -.sp -.LP -\fIdestroy_func\fR is called for every probe handle that is freed. This does -not necessarily happen at the time \fBdlclose\fR(3C) frees the shared object. -The probe handles are freed only when \fIhndl\fR is closed by -\fBtnfctl_close\fR(3TNF). If \fBtnfctl_register_funcs()\fR is called a second -time for the same \fIhndl,\fR then the previously registered destructor -function is called first for all of the probes. -.SH RETURN VALUES -.sp -.LP -\fBtnfctl_register_funcs()\fR returns \fBTNFCTL_ERR_NONE\fR upon success. -.SH ERRORS -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_INTERNAL\fR\fR -.ad -.RS 23n -An internal error occurred. -.RE - -.SH ATTRIBUTES -.sp -.LP -See \fBattributes\fR(7) for descriptions of the following attributes: -.sp - -.sp -.TS -box; -c | c -l | l . -ATTRIBUTE TYPE ATTRIBUTE VALUE -_ -MT Level MT-Safe -.TE - -.SH SEE ALSO -.sp -.LP -.BR prex (1), -.BR dlclose (3C), -.BR dlopen (3C), -.BR TNF_PROBE (3TNF), -.BR libtnfctl (3TNF), -.BR tnfctl_close (3TNF), -.BR tnfctl_probe_state_get (3TNF), -.BR tracing (3TNF), -.BR tnf_kernel_probes (5), -.BR attributes (7) -.sp -.LP -\fILinker and Libraries Guide\fR diff --git a/usr/src/man/man3tnf/tnfctl_strerror.3tnf b/usr/src/man/man3tnf/tnfctl_strerror.3tnf deleted file mode 100644 index 651a36b6e4..0000000000 --- a/usr/src/man/man3tnf/tnfctl_strerror.3tnf +++ /dev/null @@ -1,54 +0,0 @@ -'\" te -.\" Copyright (c) 1996 Sun Microsystems, Inc. All Rights Reserved -.\" 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] -.TH TNFCTL_STRERROR 3TNF "Mar 4, 1997" -.SH NAME -tnfctl_strerror \- map a tnfctl error code to a string -.SH SYNOPSIS -.LP -.nf -\fBcc\fR [ \fIflag\fR ... ] \fIfile\fR ... \fB-ltnfctl\fR [ \fIlibrary\fR ... ] -#include <tnf/tnfctl.h> - - - -\fBconst char *\fR \fBtnfctl_strerror\fR(\fBtnfctl_errcode_t\fR \fIerrcode\fR); -.fi - -.SH DESCRIPTION -.sp -.LP -\fBtnfctl_strerror()\fR maps the error number in \fIerrcode\fR to an error -message string, and it returns a pointer to that string. The returned string -should not be overwritten or freed. -.SH ERRORS -.sp -.LP -\fBtnfctl_strerror()\fR returns the string "unknown libtnfctl.so error code" if -the error number is not within the legal range. -.SH ATTRIBUTES -.sp -.LP -See \fBattributes\fR(7) for descriptions of the following attributes: -.sp - -.sp -.TS -box; -c | c -l | l . -ATTRIBUTE TYPE ATTRIBUTE VALUE -_ -MT Level MT-Safe -.TE - -.SH SEE ALSO -.sp -.LP -.BR prex (1), -.BR TNF_PROBE (3TNF), -.BR libtnfctl (3TNF), -.BR tracing (3TNF), -.BR attributes (7) diff --git a/usr/src/man/man3tnf/tnfctl_trace_attrs_get.3tnf b/usr/src/man/man3tnf/tnfctl_trace_attrs_get.3tnf deleted file mode 100644 index f22726793a..0000000000 --- a/usr/src/man/man3tnf/tnfctl_trace_attrs_get.3tnf +++ /dev/null @@ -1,184 +0,0 @@ -'\" te -.\" Copyright (c) 1996 Sun Microsystems, Inc. All Rights Reserved -.\" 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] -.TH TNFCTL_TRACE_ATTRS_GET 3TNF "Mar 4, 1997" -.SH NAME -tnfctl_trace_attrs_get \- get the trace attributes from a tnfctl handle -.SH SYNOPSIS -.LP -.nf -\fBcc\fR [ \fIflag\fR... ] \fIfile\fR... \fB-ltnfctl\fR [ \fIlibrary\fR... ] -#include <tnf/tnfctl.h> - -\fBtnfctl_errcode_t\fR \fBtnfctl_trace_attrs_get\fR(\fBtnfctl_handle_t *\fR\fIhndl\fR, - \fBtnfctl_trace_attrs_t *\fR\fIattrs\fR); -.fi - -.SH DESCRIPTION -.sp -.LP -The \fBtnfctl_trace_attrs_get()\fR function returns the trace attributes -associated with \fIhndl\fR in \fIattrs\fR. The trace attributes can be changed -by some of the other interfaces in \fBlibtnfctl\fR(3TNF). It is the client's -responsibility to use \fBtnfctl_trace_attrs_get()\fR to get the new trace -attributes after use of interfaces that change them. Typically, a client will -use \fBtnfctl_trace_attrs_get()\fR after a call to \fBtnfctl_continue\fR(3TNF) -in order to make sure that tracing is still working. See the discussion of -\fBtrace_buf_state\fR that follows. -.sp -.LP -Trace attributes are represented by the \fBstruct tnfctl_trace_attrs\fR -structure defined in <\fBtnf/tnfctl.h\fR>: -.sp -.in +2 -.nf -struct tnfctl_trace_attrs { -pid_t targ_pid; /* not kernel mode */ -const char *trace_file_name; /* not kernel mode */ -size_t trace_buf_size; -size_t trace_min_size; -tnfctl_bufstate_t trace_buf_state; -boolean_t trace_state; -boolean_t filter_state; /* kernel mode only */ -long pad; -}; -.fi -.in -2 - -.sp -.LP -The semantics of the individual members of \fIattrs\fR are: -.sp -.ne 2 -.na -\fB\fBtarg_pid\fR\fR -.ad -.RS 19n -The process id of the target process. This is not valid for kernel tracing. -.RE - -.sp -.ne 2 -.na -\fB\fBtrace_file_name\fR\fR -.ad -.RS 19n -The name of the trace file to which the target writes. \fBtrace_file_name\fR -will be \fBNULL\fR if no trace file exists or if kernel tracing is implemented. -This pointer should not be used after calling other \fBlibtnfctl\fR interfaces. -The client should copy this string if it should be saved for the use of other -\fBlibtnfctl\fR interfaces. -.RE - -.sp -.ne 2 -.na -\fB\fBtrace_buf_size\fR\fR -.ad -.RS 19n -The size of the trace buffer or file in bytes. -.RE - -.sp -.ne 2 -.na -\fB\fBtrace_min_size\fR\fR -.ad -.RS 19n -The minimum size in bytes of the trace buffer that can be allocated by using -the \fBtnfctl_buffer_alloc\fR(3TNF) interface. -.RE - -.sp -.ne 2 -.na -\fB\fBtrace_buf_state\fR\fR -.ad -.RS 19n -The state of the trace buffer. \fBTNFCTL_BUF_OK\fR indicates that a trace -buffer has been allocated. \fBTNFCTL_BUF_NONE\fR indicates that no buffer has -been allocated. \fBTNFCTL_BUF_BROKEN\fR indicates that there is an internal -error in the target for tracing. The target will continue to run correctly, but -no trace records will be written. To fix tracing, restart the process. For -kernel tracing, deallocate the existing buffer with -\fBtnfctl_buffer_dealloc\fR(3TNF) and allocate a new one with -\fBtnfctl_buffer_alloc\fR(3TNF). -.RE - -.sp -.ne 2 -.na -\fB\fBtrace_state\fR\fR -.ad -.RS 19n -The global tracing state of the target. Probes that are enabled will not write -out data unless this state is on. This state is off by default for the kernel -and can be changed by \fBtnfctl_trace_state_set\fR(3TNF). For a process, this -state is on by default and can only be changed by -\fBtnf_process_disable\fR(3TNF) and \fBtnf_process_enable\fR(3TNF). -.RE - -.sp -.ne 2 -.na -\fB\fBfilter_state\fR\fR -.ad -.RS 19n -The state of process filtering. For kernel probe control, it is possible to -select a set of processes for which probes are enabled. See -\fBtnfctl_filter_list_get\fR(3TNF), \fBtnfctl_filter_list_add\fR(3TNF), and -\fBtnfctl_filter_list_delete\fR(3TNF). No trace output will be written when -other processes traverse these probe points. By default process filtering is -off, and all processes cause the generation of trace records when they hit an -enabled probe. Use \fBtnfctl_filter_state_set\fR(3TNF) to change the filter -state. -.RE - -.SH RETURN VALUES -.sp -.LP -The \fBtnfctl_trace_attrs_get()\fR function returns \fBTNFCTL_ERR_NONE\fR upon -success. -.SH ERRORS -.sp -.LP -The \fBtnfctl_trace_attrs_get()\fR function will fail if: -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_INTERNAL\fR\fR -.ad -.RS 23n -An internal error occurred. -.RE - -.SH ATTRIBUTES -.sp -.LP -See \fBattributes\fR(7) for descriptions of the following attributes: -.sp - -.sp -.TS -box; -c | c -l | l . -ATTRIBUTE TYPE ATTRIBUTE VALUE -_ -MT Level MT-Safe -.TE - -.SH SEE ALSO -.sp -.LP -.BR prex (1), -.BR TNF_PROBE (3TNF), -.BR libtnfctl (3TNF), -.BR tnf_process_disable (3TNF), -.BR tnfctl_buffer_alloc (3TNF), -.BR tnfctl_continue (3TNF), -.BR tnfctl_filter_list_get (3TNF), -.BR tracing (3TNF), -.BR attributes (7) diff --git a/usr/src/man/man3tnf/tnfctl_trace_state_set.3tnf b/usr/src/man/man3tnf/tnfctl_trace_state_set.3tnf deleted file mode 100644 index 21f927757b..0000000000 --- a/usr/src/man/man3tnf/tnfctl_trace_state_set.3tnf +++ /dev/null @@ -1,277 +0,0 @@ -'\" te -.\" Copyright (c) 1996 Sun Microsystems, Inc. All Rights Reserved -.\" 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] -.TH TNFCTL_TRACE_STATE_SET 3TNF "Mar 4, 1997" -.SH NAME -tnfctl_trace_state_set, tnfctl_filter_state_set, tnfctl_filter_list_get, -tnfctl_filter_list_add, tnfctl_filter_list_delete \- control kernel tracing and -process filtering -.SH SYNOPSIS -.LP -.nf -\fBcc\fR [ \fIflag\fR ... ] \fIfile\fR ... \fB-ltnfctl\fR [ \fIlibrary\fR ... ] -#include <tnf/tnfctl.h> - -\fBtnfctl_errcode_t\fR \fBtnfctl_trace_state_set\fR(\fBtnfctl_handle_t *\fR\fIhndl\fR, - \fBboolean_t\fR \fItrace_state\fR); -.fi - -.LP -.nf -\fBtnfctl_errcode_t\fR \fBtnfctl_filter_state_set\fR(\fBtnfctl_handle_t *\fR\fIhndl\fR, - \fBboolean_t\fR \fIfilter_state\fR); -.fi - -.LP -.nf -\fBtnfctl_errcode_t\fR \fBtnfctl_filter_list_get\fR(\fBtnfctl_handle_t *\fR\fIhndl\fR, - \fBpid_t **\fR\fIpid_list\fR,\ \fBint *\fR\fIpid_count\fR); -.fi - -.LP -.nf -\fBtnfctl_errcode_t\fR \fBtnfctl_filter_list_add\fR(\fBtnfctl_handle_t *\fR\fIhndl\fR, - \fBpid_t\fR \fIpid_to_add\fR); -.fi - -.LP -.nf -\fBtnfctl_errcode_t\fR \fBtnfctl_filter_list_delete\fR(\fBtnfctl_handle_t *\fR\fIhndl\fR, - \fBpid_t\fR \fIpid_to_delete\fR); -.fi - -.SH DESCRIPTION -.sp -.LP -The interfaces to control kernel tracing and process filtering are used only -with kernel handles, handles created by \fBtnfctl_kernel_open\fR(3TNF). These -interfaces are used to change the tracing and filter states for kernel -tracing. -.sp -.LP -\fBtnfctl_trace_state_set()\fR sets the kernel global tracing state to "on" if -\fItrace_state\fR is \fBB_TRUE,\fR or to "off" if \fItrace_state\fR is -\fBB_FALSE.\fR For the kernel, \fItrace_state\fR is off by default.Probes that -are enabled will not write out data unless this state is on. Use -\fBtnfctl_trace_attrs_get\fR(3TNF) to retrieve the current tracing state. -.sp -.LP -\fBtnfctl_filter_state_set()\fR sets the kernel process filtering state to "on" -if \fIfilter_state\fR is \fBB_TRUE,\fR or to "off" if \fIfilter_state\fR is -\fBB_FALSE.\fR \fIfilter_state\fR is off by default. If it is on, only probe -points encountered by processes in the process filter set by -\fBtnfctl_filter_list_add()\fR will generate trace points. Use -\fBtnfctl_trace_attrs_get\fR(3TNF) to retrieve the current process filtering -state. -.sp -.LP -\fBtnfctl_filter_list_get()\fR returns the process filter list as an array in -\fIpid_list\fR. The count of elements in the process filter list is returned in -\fIpid_count\fR. The caller should use \fBfree\fR(3C) to free memory allocated -for the array \fIpid_list\fR. -.sp -.LP -\fBtnfctl_filter_list_add()\fR adds \fIpid_to_add\fR to the process filter -list. The process filter list is maintained even when the process filtering -state is off, but it has no effect unless the process filtering state is on. -.sp -.LP -\fBtnfctl_filter_list_delete()\fR deletes \fIpid_to_delete\fR from the process -filter list. It returns an error if the process does not exist or is not in -the filter list. -.SH RETURN VALUES -.sp -.LP -The interfaces \fBtnfctl_trace_state_set()\fR, \fBtnfctl_filter_state_set()\fR, -\fBtnfctl_filter_list_add()\fR, \fBtnfctl_filter_list_delete()\fR, and -\fBtnfctl_filter_list_get()\fR return \fBTNFCTL_ERR_NONE\fR upon success. -.SH ERRORS -.sp -.LP -The following error codes apply to \fBtnfctl_trace_state_set\fR: -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_BADARG\fR\fR -.ad -.RS 24n -The handle is not a kernel handle. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_NOBUF\fR\fR -.ad -.RS 24n -Cannot turn on tracing without a buffer being allocated. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_BUFBROKEN\fR\fR -.ad -.RS 24n -Tracing is broken in the target. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_INTERNAL\fR\fR -.ad -.RS 24n -An internal error occurred. -.RE - -.sp -.LP -The following error codes apply to \fBtnfctl_filter_state_set\fR: -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_BADARG\fR\fR -.ad -.RS 23n -The handle is not a kernel handle. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_INTERNAL\fR\fR -.ad -.RS 23n -An internal error occurred. -.RE - -.sp -.LP -The following error codes apply to \fBtnfctl_filter_list_add\fR: -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_BADARG\fR\fR -.ad -.RS 24n -The handle is not a kernel handle. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_NOPROCESS\fR\fR -.ad -.RS 24n -No such process exists. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_ALLOCFAIL\fR\fR -.ad -.RS 24n -A memory allocation failure occurred. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_INTERNAL\fR\fR -.ad -.RS 24n -An internal error occurred. -.RE - -.sp -.LP -The following error codes apply to \fBtnfctl_filter_list_delete\fR: -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_BADARG\fR\fR -.ad -.RS 24n -The handle is not a kernel handle. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_NOPROCESS\fR\fR -.ad -.RS 24n -No such process exists. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_INTERNAL\fR\fR -.ad -.RS 24n -An internal error occurred. -.RE - -.sp -.LP -The following error codes apply to \fBtnfctl_filter_list_get\fR: -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_BADARG\fR\fR -.ad -.RS 24n -The handle is not a kernel handle. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_ALLOCFAIL\fR\fR -.ad -.RS 24n -A memory allocation failure occurred. -.RE - -.sp -.ne 2 -.na -\fB\fBTNFCTL_ERR_INTERNAL\fR\fR -.ad -.RS 24n -An internal error occurred. -.RE - -.SH ATTRIBUTES -.sp -.LP -See \fBattributes\fR(7) for descriptions of the following attributes: -.sp - -.sp -.TS -box; -c | c -l | l . -ATTRIBUTE TYPE ATTRIBUTE VALUE -_ -MT Level MT-Safe -.TE - -.SH SEE ALSO -.sp -.LP -.BR prex (1), -.BR free (3C), -.BR TNF_PROBE (3TNF), -.BR libtnfctl (3TNF), -.BR tnfctl_kernel_open (3TNF), -.BR tnfctl_trace_attrs_get (3TNF), -.BR tracing (3TNF), -.BR tnf_kernel_probes (5), -.BR attributes (7) diff --git a/usr/src/man/man3tnf/tracing.3tnf b/usr/src/man/man3tnf/tracing.3tnf deleted file mode 100644 index 7fee555446..0000000000 --- a/usr/src/man/man3tnf/tracing.3tnf +++ /dev/null @@ -1,313 +0,0 @@ -'\" te -.\" Copyright (c) 1997, Sun Microsystems, Inc. -.\" All Rights Reserved -.\" 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] -.TH TRACING 3TNF "Mar 4, 1997" -.SH NAME -tracing \- overview of tnf tracing system -.SH DESCRIPTION -.sp -.LP -\fBtnf tracing\fR is a set of programs and \fBAPI's\fR that can be used to -present a high-level view of the performance of an executable, a library, or -part of the kernel. \fBtracing\fR is used to analyze a program's performance -and identify the conditions that produced a bug. -.sp -.LP -The core elements of \fBtracing\fR are: -.sp -.ne 2 -.na -\fB\fBTNF_PROBE_*(\|)\fR\fR -.ad -.RS 25n -The \fBTNF_PROBE_*(\|)\fR macros define "probes" to be placed in code which, -when enabled and executed, cause information to be added to a trace file. See -\fBTNF_PROBE\fR(3TNF). If there are insufficient \fBTNF_PROBE_*\fR macros to -store all the data of interest for a probe, data may be grouped into records. -See \fBTNF_DECLARE_RECORD\fR(3TNF). -.RE - -.sp -.ne 2 -.na -\fB\fBprex\fR\fR -.ad -.RS 25n -Displays and controls probes in running software. See prex(1). -.RE - -.sp -.ne 2 -.na -\fB\fBkernel\fR \fBprobes\fR\fR -.ad -.RS 25n -A set of probes built into the Solaris kernel which capture information about -system calls, multithreading, page faults, swapping, memory management, and -I/O. You can use these probes to obtain detailed traces of kernel activity -under your application workloads. See \fBtnf_kernel_probes\fR(5). -.RE - -.sp -.ne 2 -.na -\fB\fBtnfxtract\fR\fR -.ad -.RS 25n -A program that extracts the trace data from the kernel's in-memory buffer into -a file. See \fBtnfxtract\fR(1). -.RE - -.sp -.ne 2 -.na -\fB\fBtnfdump\fR\fR -.ad -.RS 25n -A program that displays the information from a trace file. See -\fBtnfdump\fR(1). -.RE - -.sp -.ne 2 -.na -\fB\fBlibtnfctl\fR\fR -.ad -.RS 25n -A library of interfaces that controls probes in a process. See -\fBlibtnfctl\fR(3TNF). \fBprex\fR(1) also utilizes this library. Other tools -and processes use the \fBlibtnfctl\fR interfaces to exercise fine control over -their own probes. -.RE - -.sp -.ne 2 -.na -\fB\fBtnf_process_enable()\fR\fR -.ad -.RS 25n -A routine called by a process to turn on tracing and probe functions for the -current process. See \fBtnf_process_enable\fR(3TNF). -.RE - -.sp -.ne 2 -.na -\fB\fBtnf_process_disable()\fR\fR -.ad -.RS 25n -A routine called by a process to turn off tracing and probe functions for the -current process. See \fBtnf_process_disable\fR(3TNF). -.RE - -.sp -.ne 2 -.na -\fB\fBtnf_thread_enable()\fR\fR -.ad -.RS 25n -A routine called by a process to turn on tracing and probe functions for the -currently running thread. See \fBtnf_thread_enable\fR(3TNF). -.RE - -.sp -.ne 2 -.na -\fB\fBtnf_thread_disable()\fR\fR -.ad -.RS 25n -A routine called by a process to turn off tracing and probe functions for the -currently running thread. See \fBtnf_thread_disable\fR(3TNF). -.RE - -.SH EXAMPLES -.LP -\fBExample 1 \fRTracing a Process -.sp -.LP -The following function in some daemon process accepts job requests of various -types, queueing them for later execution. There are two "debug probes" and one -"production probe." Note that probes which are intended for debugging will not -be compiled into the final version of the code; however, production probes are -compiled into the final product. - -.sp -.in +2 -.nf - /* - * To compile in all probes (for development): - * cc -DTNF_DEBUG ... - * - * To compile in only production probes (for release): - * cc ... - * - * To compile in no probes at all: - * cc -DNPROBE ... - */ -#include <tnf/probe.h> -void work(long, char *); -enum work_request_type { READ, WRITE, ERASE, UPDATE }; -static char *work_request_name[] = {"read", "write", "erase", "update"}; -main(\|) -{ - long i; - for (i = READ; i <= UPDATE; i++) - work(i, work_request_name[i]); -} -void work(long request_type, char *request_name) -{ - static long q_length; - TNF_PROBE_2_DEBUG(work_start, "work", - "XYZ%debug 'in function work'", - tnf_long, request_type_arg, request_type, - tnf_string, request_name_arg, request_name); - /* assume work request is queued for later processing */ - q_length++; - TNF_PROBE_1(work_queue, "work queue", - "XYZ%work_load heavy", - tnf_long, queue_length, q_length); - TNF_PROBE_0_DEBUG(work_end, "work", ""); -} -.fi -.in -2 - -.sp -.LP -The production probe "work_queue," which remains compiled in the code, will, -when enabled, log the length of the work queue each time a request is received. - -.sp -.LP -The debug probes "work_start" and "work_end, " which are compiled only during -the development phase, track entry to and exit from the \fBwork()\fR function -and measure how much time is spent executing it. Additionally, the debug probe -"work_start" logs the value of the two incoming arguments \fBrequest_type\fR -and \fBrequest_name\fR. The runtime overhead for disabled probes is low enough -that one can liberally embed them in the code with little impact on -performance. - -.sp -.LP -For debugging, the developer would compile with \fB-DTNF_DEBUG\fR, run the -program under control of \fBprex\fR(1), enable the probes of interest (in this -case, all probes), continue the program until exit, and dump the trace file: - -.sp -.in +2 -.nf -% cc --DTNF_DEBUG -o daemon daemon.c # compile in all probes -% prex daemon # run program under prex control -Target process stopped -Type "continue" to resume the target, "help" for help ... -prex> list probes $all # list all probes in program -<probe list output here> -prex> enable $all # enable all probes -prex> continue # let target process execute -<program output here> -prex: target process finished -% ls /tmp/trace-* # trace output is in trace-<pid> -/tmp/trace-4194 -% tnfdump /tmp/trace-4194 # get ascii output of trace file -<trace records output here> -.fi -.in -2 - -.sp -.LP -For the production version of the system, the developer simply compiles without -\fB-DTNF_DEBUG\fR\&. - -.LP -\fBExample 2 \fRTracing the Kernel -.sp -.LP -Kernel tracing is similar to tracing a process; however, there are some -differences. For instance, to trace the kernel, you need superuser privileges. -The following example uses prex(1) and traces the probes in the kernel that -capture system call information. - -.sp -.in +2 -.nf -Allocate kernel -trace buffer and capture trace data: -root# prex -k -Type "help" for help ... -prex> buffer alloc 2m # allocate kernel trace buffer -Buffer of size 2097152 bytes allocated -prex> list probes $all # list all kernel probes -<probe list output here> -prex> list probes syscall # list syscall probes - # (keys=syscall) -<syscall probes list output here> -prex> enable syscall # enable only syscall probes -prex> ktrace on # turn on kernel tracing -<Run your application in another window at this point> -prex> ktrace off # turn off kernel tracing -prex> quit # exit prex -Extract the kernel's trace buffer into a file: -root# tnfxtract /tmp/ktrace # extract kernel trace buffer -Reset kernel tracing: -root# prex -k -prex> disable $all # disable all probes -prex> untrace $all # untrace all probes -prex> buffer dealloc # deallocate kernel trace buffer -prex> quit -.fi -.in -2 - -.sp -.LP -CAUTION: Do not deallocate the trace buffer until you have extracted it into -a trace file. Otherwise, you will lose the trace data that you collected from -your experiment! - -.sp -.LP -Examine the kernel trace file: - -.sp -.in +2 -.nf -root# tnfdump /tmp/ktrace # get ascii dump of trace file -<trace records output here> -.fi -.in -2 - -.sp -.LP -\fBprex\fR can also attach to a running process, list probes, and perform a -variety of other tasks. - -.SH ATTRIBUTES -.sp -.LP -See \fBattributes\fR(7) for descriptions of the following attributes: -.sp - -.sp -.TS -box; -c | c -l | l . -ATTRIBUTE TYPE ATTRIBUTE VALUE -_ -MT Level MT-Safe -.TE - -.SH SEE ALSO -.sp -.LP -.BR prex (1), -.BR tnfdump (1), -.BR tnfxtract (1), -.BR TNF_DECLARE_RECORD (3TNF), -.BR TNF_PROBE (3TNF), -.BR libtnfctl (3TNF), -.BR tnf_process_disable (3TNF), -.BR tnf_kernel_probes (5), -.BR attributes (7) diff --git a/usr/src/man/man5/Makefile b/usr/src/man/man5/Makefile index ead3d03a48..628602dfe2 100644 --- a/usr/src/man/man5/Makefile +++ b/usr/src/man/man5/Makefile @@ -182,7 +182,6 @@ _MANFILES= Intro.5 \ term.5 \ terminfo.5 \ timezone.5 \ - tnf_kernel_probes.5 \ ts_dptbl.5 \ ttydefs.5 \ ttysrch.5 \ diff --git a/usr/src/man/man5/tnf_kernel_probes.5 b/usr/src/man/man5/tnf_kernel_probes.5 deleted file mode 100644 index d01df72197..0000000000 --- a/usr/src/man/man5/tnf_kernel_probes.5 +++ /dev/null @@ -1,949 +0,0 @@ -'\" te -.\" Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. -.\" 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] -.TH TNF_KERNEL_PROBES 5 "June 20, 2021" -.SH NAME -tnf_kernel_probes \- TNF kernel probes -.SH DESCRIPTION -The set of probes (trace instrumentation points) available in the standard -kernel. The probes log trace data to a kernel trace buffer in Trace Normal -Form (TNF). Kernel probes are controlled by \fBprex\fR(1). A snapshot of the -kernel trace buffer can be made using \fBtnfxtract\fR(1) and examined using -\fBtnfdump\fR(1). -.sp -.LP -Each probe has a \fIname\fR and is associated with a set of symbolic -\fIkeys\fR, or \fIcategories\fR. These are used to select and control probes -from \fBprex\fR(1). A probe that is enabled for tracing generates a \fBTNF\fR -record, called an \fIevent record\fR. An event record contains two common -members and may contain other probe-specific data members. -.SS "Common Members" -.in +2 -.nf -\fBtnf_probe_event\fR \fItag\fR -\fBtnf_time_delta\fR \fItime_delta\fR -.fi -.in -2 - -.sp -.ne 2 -.na -\fB\fItag\fR\fR -.ad -.RS 14n -Encodes \fBTNF\fR references to two other records: -.sp -.ne 2 -.na -\fB\fItag\fR\fR -.ad -.RS 12n -Describes the layout of the event record. -.RE - -.sp -.ne 2 -.na -\fB\fIschedule\fR\fR -.ad -.RS 12n -Identifies the writing thread and also contains a 64-bit base time in -nanoseconds. -.RE - -.RE - -.sp -.ne 2 -.na -\fB\fItime_delta\fR\fR -.ad -.RS 14n -A 32-bit time offset from the base time; the sum of the two times is the actual -time of the event. -.RE - -.SS "Threads" -.SS "\fBthread_create\fR" -.in +2 -.nf -\fBtnf_kthread_id\fR \fItid\fR -\fBtnf_pid\fR \fIpid\fR -\fBtnf_symbol\fR \fIstart_pc\fR -.fi -.in -2 - -.sp -.LP -Thread creation event. -.sp -.ne 2 -.na -\fB\fItid\fR\fR -.ad -.RS 12n -The thread identifier for the new thread. -.RE - -.sp -.ne 2 -.na -\fB\fIpid\fR\fR -.ad -.RS 12n -The process identifier for the new thread. -.RE - -.sp -.ne 2 -.na -\fB\fIstart_pc\fR\fR -.ad -.RS 12n -The kernel address of its start routine. -.RE - -.SS "\fBthread_state\fR" -.in +2 -.nf -\fBtnf_kthread_id\fR \fItid\fR -\fBtnf_microstate\fR \fIstate\fR -.fi -.in -2 - -.sp -.LP -Thread microstate transition events. -.sp -.ne 2 -.na -\fB\fItid\fR\fR -.ad -.RS 9n -Optional; if it is absent, the event is for the writing thread, otherwise the -event is for the specified thread. -.RE - -.sp -.ne 2 -.na -\fB\fIstate\fR\fR -.ad -.RS 9n -Indicates the thread state: -.RS +4 -.TP -.ie t \(bu -.el o -Running in user mode. -.RE -.RS +4 -.TP -.ie t \(bu -.el o -Running in system mode. -.RE -.RS +4 -.TP -.ie t \(bu -.el o -Asleep waiting for a user-mode lock. -.RE -.RS +4 -.TP -.ie t \(bu -.el o -Asleep on a kernel object. -.RE -.RS +4 -.TP -.ie t \(bu -.el o -Runnable (waiting for a cpu). -.RE -.RS +4 -.TP -.ie t \(bu -.el o -Stopped. -.RE -The values of this member are defined in <\fBsys/msacct.h\fR>. Note that to -reduce trace output, transitions between the \fIsystem\fR and \fIuser\fR -microstates that are induced by system calls are not traced. This information -is implicit in the system call entry and exit events. -.RE - -.SS "thread_exit" -Thread termination event for writing thread. This probe has no data members -other than the common members. -.SS "Scheduling" -\fB\fR -.SS "thread_queue" -.in +2 -.nf -\fBtnf_kthread_id\fR \fItid\fR -\fBtnf_cpuid\fR \fIcpuid\fR -\fBtnf_long\fR \fIpriority\fR -\fBtnf_ulong\fR \fIqueue_length\fR -.fi -.in -2 - -.sp -.LP -Thread scheduling events. These are triggered when a runnable thread is placed -on a dispatch queue. -.sp -.ne 2 -.na -\fB\fIcpuid\fR\fR -.ad -.RS 16n -Specifies the cpu to which the queue is attached. -.RE - -.sp -.ne 2 -.na -\fB\fIpriority\fR\fR -.ad -.RS 16n -The (global) dispatch priority of the thread. -.RE - -.sp -.ne 2 -.na -\fB\fIqueue_length\fR\fR -.ad -.RS 16n -The current length of the cpu's dispatch queue. -.RE - -.SS "Blocking" -.SS "\fBthread_block\fR" -.in +2 -.nf -\fBtnf_opaque\fR \fIreason\fR -\fBtnf_symbols\fR \fIstack\fR -.fi -.in -2 - -.sp -.LP -Thread blockage event. This probe captures a partial stack backtrace when the -current thread blocks. -.sp -.ne 2 -.na -\fB\fIreason\fR\fR -.ad -.RS 11n -The address of the object on which the thread is blocking. -.RE - -.sp -.ne 2 -.na -\fB\fIsymbols\fR\fR -.ad -.RS 11n -References a \fBTNF\fR array of kernel addresses representing the PCs on the -stack at the time the thread blocks. -.RE - -.SS "System Calls" -.SS "\fBsyscall_start\fR" -.in +2 -.nf -\fBtnf_sysnum\fR \fIsysnum\fR -.fi -.in -2 - -.sp -.LP -System call entry event. -.sp -.ne 2 -.na -\fB\fIsysnum\fR\fR -.ad -.RS 10n -The system call number. The writing thread implicitly enters the \fIsystem\fR -microstate with this event. -.RE - -.SS "\fBsyscall_end\fR" -.in +2 -.nf -\fBtnf_long\fR \fIrval1\fR -\fBtnf_long\fR \fIrval2\fR -\fBtnf_long\fR \fIerrno\fR -.fi -.in -2 - -.sp -.LP -System call exit event. -.sp -.ne 2 -.na -\fB\fIrval1\fR and \fIrval2\fR\fR -.ad -.RS 19n -The two return values of the system call -.RE - -.sp -.ne 2 -.na -\fB\fIerrno\fR\fR -.ad -.RS 19n -The error return. -.RE - -.sp -.LP -The writing thread implicitly enters the \fIuser\fR microstate with this event. -.SS "Page Faults" -.SS "\fBaddress_fault\fR" -.in +2 -.nf -\fBtnf_opaque\fR \fIaddress\fR -\fBtnf_fault_type\fR \fIfault_type\fR -\fBtnf_seg_access\fR \fIaccess\fR -.fi -.in -2 - -.sp -.LP -Address-space fault event. -.sp -.ne 2 -.na -\fB\fIaddress\fR\fR -.ad -.RS 14n -Gives the faulting virtual address. -.RE - -.sp -.ne 2 -.na -\fB\fIfault_type\fR\fR -.ad -.RS 14n -Gives the fault type: invalid page, protection fault, software requested -locking or unlocking. -.RE - -.sp -.ne 2 -.na -\fB\fIaccess\fR\fR -.ad -.RS 14n -Gives the desired access protection: read, write, execute or create. The values -for these two members are defined in <\fBvm/seg_enum.h\fR>. -.RE - -.SS "\fBmajor_fault\fR" -.in +2 -.nf -\fBtnf_opaque\fR \fIvnode\fR -\fBtnf_offset\fR \fIoffset\fR -.fi -.in -2 - -.sp -.LP -Major page fault event. The faulting page is mapped to the file given by the -\fIvnode\fR member, at the given \fIoffset\fR into the file. (The faulting -virtual address is in the most recent \fBaddress_fault\fR event for the writing -thread.) -.SS "\fBanon_private\fR" -.in +2 -.nf -\fBtnf_opaque\fR \fIaddress\fR -.fi -.in -2 - -.sp -.LP -Copy-on-write page fault event. -.sp -.ne 2 -.na -\fB\fIaddress\fR\fR -.ad -.RS 11n -The virtual address at which the new page is mapped. -.RE - -.SS "\fBanon_zero\fR" -.in +2 -.nf -\fBtnf_opaque\fR \fIaddress\fR -.fi -.in -2 - -.sp -.LP -Zero-fill page fault event. -.sp -.ne 2 -.na -\fB\fIaddress\fR\fR -.ad -.RS 11n -The virtual address at which the new page is mapped. -.RE - -.SS "\fBpage_unmap\fR" -.in +2 -.nf -\fBtnf_opaque\fR \fIvnode\fR -\fBtnf_offset\fR \fIoffset\fR -.fi -.in -2 - -.sp -.LP -Page unmapping event. This probe marks the unmapping of a file system page -from the system. -.sp -.ne 2 -.na -\fB\fIvnode\fR and \fIoffset\fR\fR -.ad -.RS 20n -Identifies the file and offset of the page being unmapped. -.RE - -.SS "Pageins and Pageouts" -.SS "\fBpagein\fR" -.in +2 -.nf -\fBtnf_opaque\fR \fIvnode\fR -\fBtnf_offset\fR \fIoffset\fR -\fBtnf_size\fR \fIsize\fR -.fi -.in -2 - -.sp -.LP -Pagein start event. This event signals the initiation of pagein I/O. -.sp -.ne 2 -.na -\fB\fIvnode\fR and \fIoffset\fR\fR -.ad -.RS 18n -Identifies the file and offset to be paged in. -.RE - -.sp -.ne 2 -.na -\fB\fIsize\fR\fR -.ad -.RS 18n -Specifies the number of bytes to be paged in. -.RE - -.SS "\fBpageout\fR" -.in +2 -.nf -\fBtnf_opaque\fR \fIvnode\fR -\fBtnf_ulong\fR \fIpages_pageout\fR -\fBtnf_ulong\fR \fIpages_freed\fR -\fBtnf_ulong\fR \fIpages_reclaimed\fR -.fi -.in -2 - -.sp -.LP -Pageout completion event. This event signals the completion of pageout I/O. -.sp -.ne 2 -.na -\fB\fIvnode\fR\fR -.ad -.RS 19n -Identifies the file of the pageout request. -.RE - -.sp -.ne 2 -.na -\fB\fIpages_pageout\fR\fR -.ad -.RS 19n -The number of pages written out. -.RE - -.sp -.ne 2 -.na -\fB\fIpages_freed\fR\fR -.ad -.RS 19n -The number of pages freed after being written out. -.RE - -.sp -.ne 2 -.na -\fB\fIpages_reclaimed\fR\fR -.ad -.RS 19n -The number of pages reclaimed after being written out. -.RE - -.SS "Page Daemon (Page Stealer)" -.SS "\fBpageout_scan_start\fR" -.in +2 -.nf -\fBtnf_ulong\fR \fIpages_free\fR -\fBtnf_ulong\fR \fIpages_needed\fR -.fi -.in -2 - -.sp -.LP -Page daemon scan start event. This event signals the beginning of one -iteration of the page daemon. -.sp -.ne 2 -.na -\fB\fIpages_free\fR\fR -.ad -.RS 16n -The number of free pages in the system. -.RE - -.sp -.ne 2 -.na -\fB\fIpages_needed\fR\fR -.ad -.RS 16n -The number of pages desired free. -.RE - -.SS "\fBpageout_scan_end\fR" -.in +2 -.nf -\fBtnf_ulong\fR \fIpages_free\fR -\fBtnf_ulong\fR \fIpages_scanned\fR -.fi -.in -2 - -.sp -.LP -Page daemon scan end event. This event signals the end of one iteration of the -page daemon. -.sp -.ne 2 -.na -\fB\fIpages_free\fR\fR -.ad -.RS 17n -The number of free pages in the system. -.RE - -.sp -.ne 2 -.na -\fB\fIpages_scanned\fR\fR -.ad -.RS 17n -The number of pages examined by the page daemon. (Potentially more pages will -be freed when any queued pageout requests complete.) -.RE - -.SS "Swapper" -.SS "\fBswapout_process\fR" -.in +2 -.nf -\fBtnf_pid\fR \fIpid\fR -\fBtnf_ulong\fR \fIpage_count\fR -.fi -.in -2 - -.sp -.LP -Address space swapout event. This event marks the swapping out of a process -address space. -.sp -.ne 2 -.na -\fB\fIpid\fR\fR -.ad -.RS 14n -Identifies the process. -.RE - -.sp -.ne 2 -.na -\fB\fIpage_count\fR\fR -.ad -.RS 14n -Reports the number of pages either freed or queued for pageout. -.RE - -.SS "\fBswapout_lwp\fR" -.in +2 -.nf -\fBtnf_pid\fR \fIpid\fR -\fBtnf_lwpid\fR \fIlwpid\fR -\fBtnf_kthread_id\fR \fItid\fR -\fBtnf_ulong\fR \fIpage_count\fR -.fi -.in -2 - -.sp -.LP -Light-weight process swapout event. This event marks the swapping out of an -\fBLWP\fR and its stack. -.sp -.ne 2 -.na -\fB\fIpid\fR\fR -.ad -.RS 14n -The \fBLWP's\fR process identifier -.RE - -.sp -.ne 2 -.na -\fB\fIlwpid\fR\fR -.ad -.RS 14n -The \fBLWP\fR identifier -.RE - -.sp -.ne 2 -.na -\fB\fItid\fR \fImember\fR\fR -.ad -.RS 14n -The \fBLWP's\fR kernel thread identifier. -.RE - -.sp -.ne 2 -.na -\fB\fIpage_count\fR\fR -.ad -.RS 14n -The number of pages swapped out. -.RE - -.SS "\fBswapin_lwp\fR" -.in +2 -.nf -\fBtnf_pid\fR \fIpid\fR -\fBtnf_lwpid\fR \fIlwpid\fR -\fBtnf_kthread_id\fR \fItid\fR -\fBtnf_ulong\fR \fIpage_count\fR -.fi -.in -2 - -.sp -.LP -Light-weight process swapin event. This event marks the swapping in of an -\fBLWP\fR and its stack. -.sp -.ne 2 -.na -\fB\fIpid\fR\fR -.ad -.RS 14n -The \fBLWP's\fR process identifier. -.RE - -.sp -.ne 2 -.na -\fB\fIlwpid\fR\fR -.ad -.RS 14n -The \fBLWP\fR identifier. -.RE - -.sp -.ne 2 -.na -\fB\fItid\fR\fR -.ad -.RS 14n -The \fBLWP's\fR kernel thread identifier. -.RE - -.sp -.ne 2 -.na -\fB\fIpage_count\fR\fR -.ad -.RS 14n -The number of pages swapped in. -.RE - -.SS "Local I/O" -.SS "\fBstrategy\fR" -.in +2 -.nf -\fBtnf_device\fR \fIdevice\fR -\fBtnf_diskaddr\fR \fIblock\fR -\fBtnf_size\fR \fIsize\fR -\fBtnf_opaque\fR \fIbuf\fR -\fBtnf_bioflags\fR \fI flags\fR -.fi -.in -2 - -.sp -.LP -Block I/O strategy event. This event marks a call to the \fBstrategy\fR(9E) -function of a block device driver. -.sp -.ne 2 -.na -\fB\fIdevice\fR\fR -.ad -.RS 10n -Contains the major and minor numbers of the device. -.RE - -.sp -.ne 2 -.na -\fB\fIblock\fR\fR -.ad -.RS 10n -The logical block number to be accessed on the device. -.RE - -.sp -.ne 2 -.na -\fB\fIsize\fR\fR -.ad -.RS 10n -The size of the I/O request. -.RE - -.sp -.ne 2 -.na -\fB\fIbuf\fR\fR -.ad -.RS 10n -The kernel address of the \fBbuf\fR(9S) structure associated with the transfer. -.RE - -.sp -.ne 2 -.na -\fB\fIflags\fR\fR -.ad -.RS 10n -The \fBbuf\fR(9S) flags associated with the transfer. -.RE - -.SS "\fBbiodone\fR" -.in +2 -.nf -\fBtnf_device\fR \fIdevice\fR -\fBtnf_diskaddr\fR \fIblock\fR -\fBtnf_opaque\fR \fIbuf\fR -.fi -.in -2 - -.sp -.LP -Buffered I/O completion event. This event marks calls to the \fBbiodone\fR(9F) -function. -.sp -.ne 2 -.na -\fB\fIdevice\fR\fR -.ad -.RS 10n -Contains the major and minor numbers of the device. -.RE - -.sp -.ne 2 -.na -\fB\fIblock\fR\fR -.ad -.RS 10n -The logical block number accessed on the device. -.RE - -.sp -.ne 2 -.na -\fB\fIbuf\fR\fR -.ad -.RS 10n -The kernel address of the \fBbuf\fR(9S) structure associated with the transfer. -.RE - -.SS "\fBphysio_start\fR" -.in +2 -.nf -\fBtnf_device\fR \fIdevice\fR -\fBtnf_offset\fR \fIoffset\fR -\fBtnf_size\fR \fIsize\fR -\fBtnf_bioflags\fR \fIrw\fR -.fi -.in -2 - -.sp -.LP -Raw I/O start event. This event marks entry into the \fBphysio\fR(9F) -function which performs unbuffered I/O. -.sp -.ne 2 -.na -\fB\fIdevice\fR\fR -.ad -.RS 10n -Contains the major and minor numbers of the device of the transfer. -.RE - -.sp -.ne 2 -.na -\fB\fIoffset\fR\fR -.ad -.RS 10n -The logical offset on the device for the transfer. -.RE - -.sp -.ne 2 -.na -\fB\fIsize\fR\fR -.ad -.RS 10n -The number of bytes to be transferred. -.RE - -.sp -.ne 2 -.na -\fB\fIrw\fR\fR -.ad -.RS 10n -The direction of the transfer: read or write (see \fBbuf\fR(9S)). -.RE - -.SS "\fBphysio_end\fR" -.in +2 -.nf -\fBtnf_device\fR \fIdevice\fR -.fi -.in -2 - -.sp -.LP -Raw I/O end event. This event marks exit from the \fBphysio\fR(9F) function. -.sp -.ne 2 -.na -\fB\fIdevice\fR\fR -.ad -.RS 10n -The major and minor numbers of the device of the transfer. -.RE - -.SH USAGE -Use the \fBprex\fR utility to control kernel probes. The standard \fBprex\fR -commands to list and manipulate probes are available to you, along with -commands to set up and manage kernel tracing. -.sp -.LP -Kernel probes write trace records into a kernel trace buffer. You must copy the -buffer into a TNF file for post-processing; use the \fBtnfxtract\fR utility for -this. -.sp -.LP -You use the \fBtnfdump\fR utility to examine a kernel trace file. This is -exactly the same as examining a user-level trace file. -.sp -.LP -The steps you typically follow to take a kernel trace are: -.RS +4 -.TP -1. -Become superuser (\fBsu\fR). -.RE -.RS +4 -.TP -2. -Allocate a kernel trace buffer of the desired size (\fBprex\fR). -.RE -.RS +4 -.TP -3. -Select the probes you want to trace and enable (\fBprex\fR). -.RE -.RS +4 -.TP -4. -Turn kernel tracing on (\fBprex\fR). -.RE -.RS +4 -.TP -5. -Run your application. -.RE -.RS +4 -.TP -6. -Turn kernel tracing off (\fBprex\fR). -.RE -.RS +4 -.TP -7. -Extract the kernel trace buffer (\fBtnfxtract\fR). -.RE -.RS +4 -.TP -8. -Disable all probes (\fBprex\fR). -.RE -.RS +4 -.TP -9. -Deallocate the kernel trace buffer (\fBprex\fR). -.RE -.RS +4 -.TP -10. -Examine the trace file (\fBtnfdump\fR). -.RE -.sp -.LP -A convenient way to follow these steps is to use two shell windows; run an -interactive \fBprex\fR session in one, and run your application and -\fBtnfxtract\fR in the other. -.SH SEE ALSO -.BR prex (1), -.BR tnfdump (1), -.BR tnfxtract (1), -.BR TNF_PROBE (3TNF), -.BR libtnfctl (3TNF), -.BR tracing (3TNF), -.BR strategy (9E), -.BR biodone (9F), -.BR physio (9F), -.BR buf (9S) diff --git a/usr/src/pkg/manifests/developer-tnf.p5m b/usr/src/pkg/manifests/developer-tnf.p5m index 44e7799b09..966540a2c9 100644 --- a/usr/src/pkg/manifests/developer-tnf.p5m +++ b/usr/src/pkg/manifests/developer-tnf.p5m @@ -25,105 +25,6 @@ # set name=pkg.fmri value=pkg:/developer/tnf@$(PKGVERS) -set name=pkg.summary value="TNF Developer Components" -set name=pkg.description \ - value="utilities needed by developers using Trace Normal Format (TNF) facilities" -set name=info.classification \ - value=org.opensolaris.category.2008:Development/System +set name=pkg.obsolete value=true +set name=org.opensolaris.noincorp value=true set name=variant.arch value=$(ARCH) -dir path=usr group=sys -dir path=usr/bin -file path=usr/bin/tnfdump mode=0555 -dir path=usr/include -dir path=usr/include/tnf -file path=usr/include/tnf/com.h -file path=usr/include/tnf/probe.h -file path=usr/include/tnf/tnf.h -file path=usr/include/tnf/writer.h -dir path=usr/lib -link path=usr/lib/libtnf.so target=./libtnf.so.1 -file path=usr/lib/libtnf.so.1 -dir path=usr/share/man -dir path=usr/share/man/man1 -file path=usr/share/man/man1/tnfdump.1 -dir path=usr/share/man/man3tnf -link path=usr/share/man/man3tnf/TNF_DEBUG.3tnf target=TNF_PROBE.3tnf -file path=usr/share/man/man3tnf/TNF_DECLARE_RECORD.3tnf -link path=usr/share/man/man3tnf/TNF_DEFINE_RECORD_1.3tnf \ - target=TNF_DECLARE_RECORD.3tnf -link path=usr/share/man/man3tnf/TNF_DEFINE_RECORD_2.3tnf \ - target=TNF_DECLARE_RECORD.3tnf -link path=usr/share/man/man3tnf/TNF_DEFINE_RECORD_3.3tnf \ - target=TNF_DECLARE_RECORD.3tnf -link path=usr/share/man/man3tnf/TNF_DEFINE_RECORD_4.3tnf \ - target=TNF_DECLARE_RECORD.3tnf -link path=usr/share/man/man3tnf/TNF_DEFINE_RECORD_5.3tnf \ - target=TNF_DECLARE_RECORD.3tnf -file path=usr/share/man/man3tnf/TNF_PROBE.3tnf -link path=usr/share/man/man3tnf/TNF_PROBE_0.3tnf target=TNF_PROBE.3tnf -link path=usr/share/man/man3tnf/TNF_PROBE_0_DEBUG.3tnf target=TNF_PROBE.3tnf -link path=usr/share/man/man3tnf/TNF_PROBE_1.3tnf target=TNF_PROBE.3tnf -link path=usr/share/man/man3tnf/TNF_PROBE_1_DEBUG.3tnf target=TNF_PROBE.3tnf -link path=usr/share/man/man3tnf/TNF_PROBE_2.3tnf target=TNF_PROBE.3tnf -link path=usr/share/man/man3tnf/TNF_PROBE_2_DEBUG.3tnf target=TNF_PROBE.3tnf -link path=usr/share/man/man3tnf/TNF_PROBE_3.3tnf target=TNF_PROBE.3tnf -link path=usr/share/man/man3tnf/TNF_PROBE_3_DEBUG.3tnf target=TNF_PROBE.3tnf -link path=usr/share/man/man3tnf/TNF_PROBE_4.3tnf target=TNF_PROBE.3tnf -link path=usr/share/man/man3tnf/TNF_PROBE_4_DEBUG.3tnf target=TNF_PROBE.3tnf -link path=usr/share/man/man3tnf/TNF_PROBE_5.3tnf target=TNF_PROBE.3tnf -link path=usr/share/man/man3tnf/TNF_PROBE_5_DEBUG.3tnf target=TNF_PROBE.3tnf -file path=usr/share/man/man3tnf/libtnfctl.3tnf -file path=usr/share/man/man3tnf/tnf_process_disable.3tnf -link path=usr/share/man/man3tnf/tnf_process_enable.3tnf \ - target=tnf_process_disable.3tnf -link path=usr/share/man/man3tnf/tnf_thread_disable.3tnf \ - target=tnf_process_disable.3tnf -link path=usr/share/man/man3tnf/tnf_thread_enable.3tnf \ - target=tnf_process_disable.3tnf -file path=usr/share/man/man3tnf/tnfctl_buffer_alloc.3tnf -link path=usr/share/man/man3tnf/tnfctl_buffer_dealloc.3tnf \ - target=tnfctl_buffer_alloc.3tnf -link path=usr/share/man/man3tnf/tnfctl_check_libs.3tnf \ - target=tnfctl_indirect_open.3tnf -file path=usr/share/man/man3tnf/tnfctl_close.3tnf -link path=usr/share/man/man3tnf/tnfctl_continue.3tnf target=tnfctl_pid_open.3tnf -link path=usr/share/man/man3tnf/tnfctl_exec_open.3tnf \ - target=tnfctl_pid_open.3tnf -link path=usr/share/man/man3tnf/tnfctl_filter_list_add.3tnf \ - target=tnfctl_trace_state_set.3tnf -link path=usr/share/man/man3tnf/tnfctl_filter_list_delete.3tnf \ - target=tnfctl_trace_state_set.3tnf -link path=usr/share/man/man3tnf/tnfctl_filter_list_get.3tnf \ - target=tnfctl_trace_state_set.3tnf -link path=usr/share/man/man3tnf/tnfctl_filter_state_set.3tnf \ - target=tnfctl_trace_state_set.3tnf -file path=usr/share/man/man3tnf/tnfctl_indirect_open.3tnf -file path=usr/share/man/man3tnf/tnfctl_internal_open.3tnf -file path=usr/share/man/man3tnf/tnfctl_kernel_open.3tnf -file path=usr/share/man/man3tnf/tnfctl_pid_open.3tnf -file path=usr/share/man/man3tnf/tnfctl_probe_apply.3tnf -link path=usr/share/man/man3tnf/tnfctl_probe_apply_ids.3tnf \ - target=tnfctl_probe_apply.3tnf -link path=usr/share/man/man3tnf/tnfctl_probe_connect.3tnf \ - target=tnfctl_probe_state_get.3tnf -link path=usr/share/man/man3tnf/tnfctl_probe_disable.3tnf \ - target=tnfctl_probe_state_get.3tnf -link path=usr/share/man/man3tnf/tnfctl_probe_disconnect_all.3tnf \ - target=tnfctl_probe_state_get.3tnf -link path=usr/share/man/man3tnf/tnfctl_probe_enable.3tnf \ - target=tnfctl_probe_state_get.3tnf -file path=usr/share/man/man3tnf/tnfctl_probe_state_get.3tnf -link path=usr/share/man/man3tnf/tnfctl_probe_trace.3tnf \ - target=tnfctl_probe_state_get.3tnf -link path=usr/share/man/man3tnf/tnfctl_probe_untrace.3tnf \ - target=tnfctl_probe_state_get.3tnf -file path=usr/share/man/man3tnf/tnfctl_register_funcs.3tnf -file path=usr/share/man/man3tnf/tnfctl_strerror.3tnf -file path=usr/share/man/man3tnf/tnfctl_trace_attrs_get.3tnf -file path=usr/share/man/man3tnf/tnfctl_trace_state_set.3tnf -file path=usr/share/man/man3tnf/tracing.3tnf -legacy pkg=SUNWtnfd \ - desc="utilities needed by developers using Trace Normal Format (TNF) facilities" \ - name="TNF Developer Components" -license cr_Sun license=cr_Sun -license lic_CDDL license=lic_CDDL diff --git a/usr/src/pkg/manifests/system-header.p5m b/usr/src/pkg/manifests/system-header.p5m index 7789ee796a..8410cf4a52 100644 --- a/usr/src/pkg/manifests/system-header.p5m +++ b/usr/src/pkg/manifests/system-header.p5m @@ -1426,10 +1426,6 @@ file path=usr/include/sys/timod.h file path=usr/include/sys/tirdwr.h file path=usr/include/sys/tiuser.h file path=usr/include/sys/tl.h -file path=usr/include/sys/tnf.h -file path=usr/include/sys/tnf_com.h -file path=usr/include/sys/tnf_probe.h -file path=usr/include/sys/tnf_writer.h file path=usr/include/sys/todio.h file path=usr/include/sys/tpicommon.h file path=usr/include/sys/trap.h diff --git a/usr/src/pkg/manifests/system-kernel.man5.inc b/usr/src/pkg/manifests/system-kernel.man5.inc index 695417c8fc..7c44daa5d4 100644 --- a/usr/src/pkg/manifests/system-kernel.man5.inc +++ b/usr/src/pkg/manifests/system-kernel.man5.inc @@ -27,5 +27,4 @@ file path=usr/share/man/man5/pseudo.5 file path=usr/share/man/man5/scsi.5 file path=usr/share/man/man5/sock2path.d.5 file path=usr/share/man/man5/system.5 -file path=usr/share/man/man5/tnf_kernel_probes.5 file path=usr/share/man/man5/ts_dptbl.5 diff --git a/usr/src/pkg/manifests/system-tnf.p5m b/usr/src/pkg/manifests/system-tnf.p5m index 6dc1d2f0da..5a4d8b446c 100644 --- a/usr/src/pkg/manifests/system-tnf.p5m +++ b/usr/src/pkg/manifests/system-tnf.p5m @@ -24,48 +24,6 @@ # set name=pkg.fmri value=pkg:/system/tnf@$(PKGVERS) -set name=pkg.summary value="TNF Core Components" -set name=pkg.description \ - value="utilities needed to enable probe points, in the kernel and in applications, that can generate Trace Normal Format (TNF) records in a trace file" -set name=info.classification \ - value=org.opensolaris.category.2008:Development/System +set name=pkg.obsolete value=true +set name=org.opensolaris.noincorp value=true set name=variant.arch value=$(ARCH) -dir path=usr group=sys -dir path=usr/bin -dir path=usr/bin/$(ARCH32) -file path=usr/bin/$(ARCH32)/prex mode=0555 -$(i386_ONLY)file path=usr/bin/$(ARCH32)/tnfxtract mode=0555 -dir path=usr/bin/$(ARCH64) -file path=usr/bin/$(ARCH64)/prex mode=0555 -file path=usr/bin/$(ARCH64)/tnfxtract mode=0555 -hardlink path=usr/bin/prex target=../lib/isaexec -hardlink path=usr/bin/tnfxtract target=../lib/isaexec -dir path=usr/include -dir path=usr/include/tnf -file path=usr/include/tnf/tnfctl.h -dir path=usr/kernel group=sys -dir path=usr/kernel/drv group=sys -dir path=usr/kernel/drv/$(ARCH64) group=sys -file path=usr/kernel/drv/$(ARCH64)/tnf group=sys -file path=usr/kernel/drv/tnf.conf group=sys -dir path=usr/lib -dir path=usr/lib/$(ARCH64) -link path=usr/lib/$(ARCH64)/libtnfctl.so target=libtnfctl.so.1 -file path=usr/lib/$(ARCH64)/libtnfctl.so.1 -link path=usr/lib/$(ARCH64)/libtnfprobe.so target=libtnfprobe.so.1 -file path=usr/lib/$(ARCH64)/libtnfprobe.so.1 -link path=usr/lib/libtnfctl.so target=./libtnfctl.so.1 -file path=usr/lib/libtnfctl.so.1 -link path=usr/lib/libtnfprobe.so target=./libtnfprobe.so.1 -file path=usr/lib/libtnfprobe.so.1 -dir path=usr/share/man/man1 -file path=usr/share/man/man1/prex.1 -file path=usr/share/man/man1/tnfxtract.1 -dir path=usr/share/man/man3lib -file path=usr/share/man/man3lib/libtnfctl.3lib -driver name=tnf perms="tnfctl 0600 root sys" perms="tnfmap 0600 root sys" -legacy pkg=SUNWtnfc \ - desc="utilities needed to enable probe points, in the kernel and in applications, that can generate Trace Normal Format (TNF) records in a trace file" \ - name="TNF Core Components" -license cr_Sun license=cr_Sun -license lic_CDDL license=lic_CDDL diff --git a/usr/src/uts/common/Makefile.files b/usr/src/uts/common/Makefile.files index 506454f404..51392a6b4f 100644 --- a/usr/src/uts/common/Makefile.files +++ b/usr/src/uts/common/Makefile.files @@ -376,7 +376,6 @@ GENUNIX_OBJS += \ timers.o \ thread.o \ tlabel.o \ - tnf_res.o \ turnstile.o \ tty_common.o \ u8_textprep.o \ @@ -944,9 +943,6 @@ SYSMSG_OBJS += sysmsg.o SES_OBJS += ses.o ses_sen.o ses_safte.o ses_ses.o -TNF_OBJS += tnf_buf.o tnf_trace.o tnf_writer.o trace_init.o \ - trace_funcs.o tnf_probe.o tnf.o - LOGINDMUX_OBJS += logindmux.o DEVINFO_OBJS += devinfo.o diff --git a/usr/src/uts/common/Makefile.rules b/usr/src/uts/common/Makefile.rules index 78bee80f0d..83d58e522b 100644 --- a/usr/src/uts/common/Makefile.rules +++ b/usr/src/uts/common/Makefile.rules @@ -1652,10 +1652,6 @@ $(OBJS_DIR)/%.o: $(UTSBASE)/common/syscall/%.c $(COMPILE.c) -o $@ $< $(CTFCONVERT_O) -$(OBJS_DIR)/%.o: $(UTSBASE)/common/tnf/%.c - $(COMPILE.c) -o $@ $< - $(CTFCONVERT_O) - $(OBJS_DIR)/%.o: $(COMMONBASE)/tsol/%.c $(COMPILE.c) -o $@ $< $(CTFCONVERT_O) diff --git a/usr/src/uts/common/disp/disp.c b/usr/src/uts/common/disp/disp.c index ca49d8610a..a9d5f969dc 100644 --- a/usr/src/uts/common/disp/disp.c +++ b/usr/src/uts/common/disp/disp.c @@ -49,7 +49,6 @@ #include <sys/kmem.h> #include <sys/cpuvar.h> #include <sys/vtrace.h> -#include <sys/tnf.h> #include <sys/cpupart.h> #include <sys/lgrp.h> #include <sys/pg.h> @@ -1328,12 +1327,6 @@ setbackdq(kthread_t *tp) TRACE_3(TR_FAC_DISP, TR_BACKQ, "setbackdq:pri %d cpu %p tid %p", tpri, cp, tp); -#ifndef NPROBE - /* Kernel probe */ - if (tnf_tracing_active) - tnf_thread_queue(tp, cp, tpri); -#endif /* NPROBE */ - ASSERT(tpri >= 0 && tpri < dp->disp_npri); THREAD_RUN(tp, &dp->disp_lock); /* set t_state to TS_RUN */ @@ -1484,12 +1477,6 @@ setfrontdq(kthread_t *tp) TRACE_2(TR_FAC_DISP, TR_FRONTQ, "frontq:pri %d tid %p", tpri, tp); DTRACE_SCHED3(enqueue, kthread_t *, tp, disp_t *, dp, int, 1); -#ifndef NPROBE - /* Kernel probe */ - if (tnf_tracing_active) - tnf_thread_queue(tp, cp, tpri); -#endif /* NPROBE */ - ASSERT(tpri >= 0 && tpri < dp->disp_npri); THREAD_RUN(tp, &dp->disp_lock); /* set TS_RUN state and lock */ @@ -1601,12 +1588,6 @@ setkpdq(kthread_t *tp, int borf) disp_lock_enter_high(&cp->cpu_disp->disp_lock); ASSERT((cp->cpu_flags & CPU_QUIESCED) == 0); -#ifndef NPROBE - /* Kernel probe */ - if (tnf_tracing_active) - tnf_thread_queue(tp, cp, tpri); -#endif /* NPROBE */ - if (cp->cpu_chosen_level < tpri) cp->cpu_chosen_level = tpri; cpu_resched(cp, tpri); diff --git a/usr/src/uts/common/disp/fss.c b/usr/src/uts/common/disp/fss.c index 05f358e6d4..5ceeee6689 100644 --- a/usr/src/uts/common/disp/fss.c +++ b/usr/src/uts/common/disp/fss.c @@ -49,7 +49,6 @@ #include <sys/zone.h> #include <vm/rm.h> #include <vm/seg_kmem.h> -#include <sys/tnf_probe.h> #include <sys/policy.h> #include <sys/sdt.h> #include <sys/cpucaps.h> diff --git a/usr/src/uts/common/disp/fx.c b/usr/src/uts/common/disp/fx.c index 3c98c4f916..7fc81e7815 100644 --- a/usr/src/uts/common/disp/fx.c +++ b/usr/src/uts/common/disp/fx.c @@ -45,7 +45,6 @@ #include <sys/systm.h> #include <sys/vtrace.h> #include <sys/schedctl.h> -#include <sys/tnf_probe.h> #include <sys/sunddi.h> #include <sys/spl.h> #include <sys/modctl.h> @@ -1148,9 +1147,6 @@ fx_preempt(kthread_t *t) } else { schedctl_set_nopreempt(t, 0); DTRACE_SCHED1(schedctl__preempt, kthread_t *, t); - TNF_PROBE_2(schedctl_preempt, "schedctl FX fx_preempt", - /* CSTYLED */, tnf_pid, pid, ttoproc(t)->p_pid, - tnf_lwpid, lwpid, t->t_tid); /* * Fall through and be preempted below. */ @@ -1342,10 +1338,6 @@ fx_tick(kthread_t *t) } DTRACE_SCHED1(schedctl__failsafe, kthread_t *, t); - TNF_PROBE_2(schedctl_failsafe, - "schedctl FX fx_tick", /* CSTYLED */, - tnf_pid, pid, ttoproc(t)->p_pid, - tnf_lwpid, lwpid, t->t_tid); } new_pri = fx_dptbl[fxpp->fx_pri].fx_globpri; ASSERT(new_pri >= 0 && new_pri <= fx_maxglobpri); diff --git a/usr/src/uts/common/disp/thread.c b/usr/src/uts/common/disp/thread.c index 6dc47dd80a..764942d4df 100644 --- a/usr/src/uts/common/disp/thread.c +++ b/usr/src/uts/common/disp/thread.c @@ -54,7 +54,6 @@ #include <sys/vtrace.h> #include <sys/callb.h> #include <c2/audit.h> -#include <sys/tnf.h> #include <sys/sobject.h> #include <sys/cpupart.h> #include <sys/pset.h> @@ -446,10 +445,6 @@ thread_create( t->t_dtrace_vtime = 1; /* assure vtimestamp is always non-zero */ CPU_STATS_ADDQ(CPU, sys, nthreads, 1); -#ifndef NPROBE - /* Kernel probe */ - tnf_thread_create(t); -#endif /* NPROBE */ LOCK_INIT_CLEAR(&t->t_lock); /* @@ -602,12 +597,6 @@ thread_exit(void) if (t->t_door) door_slam(); /* in case thread did an upcall */ -#ifndef NPROBE - /* Kernel probe */ - if (t->t_tnf_tpdp) - tnf_thread_exit(); -#endif /* NPROBE */ - thread_rele(t); t->t_preempt++; @@ -747,10 +736,6 @@ thread_free(kthread_t *t) } if (audit_active) audit_thread_free(t); -#ifndef NPROBE - if (t->t_tnf_tpdp) - tnf_thread_free(t); -#endif /* NPROBE */ if (t->t_cldata) { CL_EXITCLASS(t->t_cid, (caddr_t *)t->t_cldata); } diff --git a/usr/src/uts/common/disp/ts.c b/usr/src/uts/common/disp/ts.c index 6a5edb59a3..e06673e6aa 100644 --- a/usr/src/uts/common/disp/ts.c +++ b/usr/src/uts/common/disp/ts.c @@ -51,7 +51,6 @@ #include <sys/vtrace.h> #include <sys/vmsystm.h> #include <sys/schedctl.h> -#include <sys/tnf_probe.h> #include <sys/atomic.h> #include <sys/policy.h> #include <sys/sdt.h> @@ -1425,9 +1424,6 @@ ts_preempt(kthread_t *t) } schedctl_set_nopreempt(t, 0); DTRACE_SCHED1(schedctl__preempt, kthread_t *, t); - TNF_PROBE_2(schedctl_preempt, "schedctl TS ts_preempt", - /* CSTYLED */, tnf_pid, pid, ttoproc(t)->p_pid, - tnf_lwpid, lwpid, t->t_tid); /* * Fall through and be preempted below. */ @@ -1689,10 +1685,6 @@ ts_tick(kthread_t *t) DTRACE_SCHED1(schedctl__failsafe, kthread_t *, t); - TNF_PROBE_2(schedctl_failsafe, - "schedctl TS ts_tick", /* CSTYLED */, - tnf_pid, pid, ttoproc(t)->p_pid, - tnf_lwpid, lwpid, t->t_tid); } tspp->ts_flags &= ~TSRESTORE; tspp->ts_cpupri = ts_dptbl[tspp->ts_cpupri].ts_tqexp; diff --git a/usr/src/uts/common/fs/ufs/lufs_thread.c b/usr/src/uts/common/fs/ufs/lufs_thread.c index da37db94df..e63d799ba9 100644 --- a/usr/src/uts/common/fs/ufs/lufs_thread.c +++ b/usr/src/uts/common/fs/ufs/lufs_thread.c @@ -40,7 +40,6 @@ #include <sys/fs/ufs_bio.h> #include <sys/inttypes.h> #include <sys/callb.h> -#include <sys/tnf_probe.h> /* * Kernel threads for logging @@ -160,8 +159,6 @@ log_roll_read(ml_unit_t *ul, rollbuf_t *rbs, int nmblk, caddr_t roll_bufs, for (i = 0, rbp = rbs; i < nbuf; ++i, ++rbp) { if (P2ALIGN(rbp->rb_bh.b_blkno, MAPBLOCKSIZE / DEV_BSIZE) == mblkno) { - TNF_PROBE_0(trans_roll_new_delta, "lufs", - /* CSTYLED */); trans_roll_new_delta++; /* Flush out the current set of buffers */ goto flush_bufs; diff --git a/usr/src/uts/common/io/1394/adapters/hci1394.c b/usr/src/uts/common/io/1394/adapters/hci1394.c index 6a6e9678cf..0486418200 100644 --- a/usr/src/uts/common/io/1394/adapters/hci1394.c +++ b/usr/src/uts/common/io/1394/adapters/hci1394.c @@ -95,62 +95,29 @@ static struct modlinkage hci1394_modlinkage = { NULL }; -#ifndef NPROBE -extern int tnf_mod_load(void); -extern int tnf_mod_unload(struct modlinkage *mlp); -#endif - int _init() { int status; - -#ifndef NPROBE - (void) tnf_mod_load(); -#endif - TNF_PROBE_0_DEBUG(hci1394_init_enter, HCI1394_TNF_HAL_STACK, ""); - status = ddi_soft_state_init(&hci1394_statep, sizeof (hci1394_state_t), (size_t)HCI1394_INITIAL_STATES); if (status != 0) { - TNF_PROBE_2(hci1394_init_ssi_fail, HCI1394_TNF_HAL_ERROR, "", - tnf_string, errmsg, "failed in ddi_soft_state_init", - tnf_int, error, status); - TNF_PROBE_0_DEBUG(hci1394_init_exit, HCI1394_TNF_HAL_STACK, ""); -#ifndef NPROBE - (void) tnf_mod_unload(&hci1394_modlinkage); -#endif return (status); } /* Call into services layer to init bus-ops */ status = h1394_init(&hci1394_modlinkage); if (status != 0) { - TNF_PROBE_2(hci1394_init_h1394_fail, HCI1394_TNF_HAL_ERROR, "", - tnf_string, errmsg, "failed in h1394_init", - tnf_int, error, status); - TNF_PROBE_0_DEBUG(hci1394_init_exit, HCI1394_TNF_HAL_STACK, ""); -#ifndef NPROBE - (void) tnf_mod_unload(&hci1394_modlinkage); -#endif return (status); } status = mod_install(&hci1394_modlinkage); if (status != 0) { - TNF_PROBE_2(hci1394_init_modi_fail, HCI1394_TNF_HAL_ERROR, "", - tnf_string, errmsg, "failed in mod_install", - tnf_int, error, status); ddi_soft_state_fini(&hci1394_statep); -#ifndef NPROBE - (void) tnf_mod_unload(&hci1394_modlinkage); -#endif return (status); } - TNF_PROBE_0_DEBUG(hci1394_init_exit, HCI1394_TNF_HAL_STACK, ""); - return (status); } @@ -160,9 +127,7 @@ _info(struct modinfo *modinfop) { int status; - TNF_PROBE_0_DEBUG(hci1394_info_enter, HCI1394_TNF_HAL_STACK, ""); status = mod_info(&hci1394_modlinkage, modinfop); - TNF_PROBE_0_DEBUG(hci1394_info_exit, HCI1394_TNF_HAL_STACK, ""); return (status); } @@ -173,14 +138,8 @@ _fini() { int status; - TNF_PROBE_0_DEBUG(hci1394_fini_enter, HCI1394_TNF_HAL_STACK, ""); - status = mod_remove(&hci1394_modlinkage); if (status != 0) { - TNF_PROBE_2(hci1394_fini_modr_fail, HCI1394_TNF_HAL_ERROR, "", - tnf_string, errmsg, "failed in mod_remove", - tnf_int, error, status); - TNF_PROBE_0_DEBUG(hci1394_fini_exit, HCI1394_TNF_HAL_STACK, ""); return (status); } @@ -188,11 +147,5 @@ _fini() h1394_fini(&hci1394_modlinkage); ddi_soft_state_fini(&hci1394_statep); - TNF_PROBE_0_DEBUG(hci1394_fini_exit, HCI1394_TNF_HAL_STACK, ""); - -#ifndef NPROBE - (void) tnf_mod_unload(&hci1394_modlinkage); -#endif - return (status); } diff --git a/usr/src/uts/common/io/1394/adapters/hci1394_async.c b/usr/src/uts/common/io/1394/adapters/hci1394_async.c index 7450dd5035..26c05c8b28 100644 --- a/usr/src/uts/common/io/1394/adapters/hci1394_async.c +++ b/usr/src/uts/common/io/1394/adapters/hci1394_async.c @@ -24,8 +24,6 @@ * All rights reserved. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * hci1394_async.c * These routines manipulate the 1394 asynchronous dma engines. This @@ -157,7 +155,6 @@ hci1394_async_init(hci1394_drvinfo_t *drvinfo, ASSERT(ohci_handle != NULL); ASSERT(csr_handle != NULL); ASSERT(async_handle != NULL); - TNF_PROBE_0_DEBUG(hci1394_async_init_enter, HCI1394_TNF_HAL_STACK, ""); /* alloc the space to keep track of the list */ async = kmem_alloc(sizeof (hci1394_async_t), KM_SLEEP); @@ -215,10 +212,6 @@ hci1394_async_init(hci1394_drvinfo_t *drvinfo, hci1394_tlabel_fini(&async->as_tlabel); kmem_free(async, sizeof (hci1394_async_t)); *async_handle = NULL; - TNF_PROBE_0(hci1394_async_q_init_fail, HCI1394_TNF_HAL_ERROR, - ""); - TNF_PROBE_0_DEBUG(hci1394_async_init_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -238,10 +231,6 @@ hci1394_async_init(hci1394_drvinfo_t *drvinfo, hci1394_q_fini(&async->as_atreq_q); kmem_free(async, sizeof (hci1394_async_t)); *async_handle = NULL; - TNF_PROBE_0(hci1394_async_q_init_fail, HCI1394_TNF_HAL_ERROR, - ""); - TNF_PROBE_0_DEBUG(hci1394_async_init_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -262,10 +251,6 @@ hci1394_async_init(hci1394_drvinfo_t *drvinfo, hci1394_q_fini(&async->as_arresp_q); kmem_free(async, sizeof (hci1394_async_t)); *async_handle = NULL; - TNF_PROBE_0(hci1394_async_q_init_fail, HCI1394_TNF_HAL_ERROR, - ""); - TNF_PROBE_0_DEBUG(hci1394_async_init_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -287,17 +272,11 @@ hci1394_async_init(hci1394_drvinfo_t *drvinfo, hci1394_q_fini(&async->as_arreq_q); kmem_free(async, sizeof (hci1394_async_t)); *async_handle = NULL; - TNF_PROBE_0(hci1394_async_q_init_fail, HCI1394_TNF_HAL_ERROR, - ""); - TNF_PROBE_0_DEBUG(hci1394_async_init_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } *async_handle = async; - TNF_PROBE_0_DEBUG(hci1394_async_init_exit, HCI1394_TNF_HAL_STACK, ""); - return (DDI_SUCCESS); } @@ -315,7 +294,6 @@ hci1394_async_fini(hci1394_async_handle_t *async_handle) ASSERT(async_handle != NULL); - TNF_PROBE_0_DEBUG(hci1394_async_fini_enter, HCI1394_TNF_HAL_STACK, ""); async = (hci1394_async_t *)*async_handle; @@ -331,8 +309,6 @@ hci1394_async_fini(hci1394_async_handle_t *async_handle) /* set handle to null. This helps catch bugs. */ *async_handle = NULL; - - TNF_PROBE_0_DEBUG(hci1394_async_fini_exit, HCI1394_TNF_HAL_STACK, ""); } @@ -346,17 +322,12 @@ void hci1394_async_suspend(hci1394_async_handle_t async_handle) { ASSERT(async_handle != NULL); - TNF_PROBE_0_DEBUG(hci1394_async_suspend_enter, - HCI1394_TNF_HAL_STACK, ""); /* Flush out async DMA Q's */ hci1394_async_flush(async_handle); /* Cancel any scheduled pending timeouts */ hci1394_tlist_timeout_cancel(async_handle->as_pending_list); - - TNF_PROBE_0_DEBUG(hci1394_async_suspend_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -370,17 +341,12 @@ int hci1394_async_resume(hci1394_async_handle_t async_handle) { ASSERT(async_handle != NULL); - TNF_PROBE_0_DEBUG(hci1394_async_resume_enter, - HCI1394_TNF_HAL_STACK, ""); hci1394_q_resume(async_handle->as_atreq_q); hci1394_q_resume(async_handle->as_atresp_q); hci1394_q_resume(async_handle->as_arreq_q); hci1394_q_resume(async_handle->as_arresp_q); - TNF_PROBE_0_DEBUG(hci1394_async_resume_exit, - HCI1394_TNF_HAL_STACK, ""); - return (DDI_SUCCESS); } @@ -408,7 +374,6 @@ void hci1394_async_flush(hci1394_async_handle_t async_handle) { ASSERT(async_handle != NULL); - TNF_PROBE_0_DEBUG(hci1394_async_flush_enter, HCI1394_TNF_HAL_STACK, ""); hci1394_async_atreq_flush(async_handle); hci1394_async_arresp_flush(async_handle); @@ -416,8 +381,6 @@ hci1394_async_flush(hci1394_async_handle_t async_handle) hci1394_async_arreq_flush(async_handle); hci1394_async_atresp_flush(async_handle); hci1394_tlabel_reset(async_handle->as_tlabel); - - TNF_PROBE_0_DEBUG(hci1394_async_flush_exit, HCI1394_TNF_HAL_STACK, ""); } @@ -433,12 +396,8 @@ hci1394_async_pending_timeout_update(hci1394_async_handle_t async_handle, hrtime_t timeout) { ASSERT(async_handle != NULL); - TNF_PROBE_0_DEBUG(hci1394_async_pending_timeout_update_enter, - HCI1394_TNF_HAL_STACK, ""); hci1394_tlist_timeout_update(async_handle->as_pending_list, timeout); hci1394_tlabel_set_reclaim_time(async_handle->as_tlabel, timeout); - TNF_PROBE_0_DEBUG(hci1394_async_pending_timeout_update_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -500,9 +459,6 @@ hci1394_async_atreq_process(hci1394_async_handle_t async_handle, ASSERT(async_handle != NULL); ASSERT(request_available != NULL); - TNF_PROBE_0_DEBUG(hci1394_async_atreq_process_enter, - HCI1394_TNF_HAL_STACK, ""); - /* * Get the next ATREQ that has completed (if one has). Space is free'd * up in atreq_q and atreq_data_q as part of this function call. @@ -515,8 +471,6 @@ hci1394_async_atreq_process(hci1394_async_handle_t async_handle, */ if (qcmd == NULL) { *request_available = B_FALSE; - TNF_PROBE_0_DEBUG(hci1394_async_atreq_process_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_SUCCESS); } @@ -524,9 +478,6 @@ hci1394_async_atreq_process(hci1394_async_handle_t async_handle, *request_available = B_TRUE; hcicmd = (hci1394_async_cmd_t *)qcmd->qc_arg; - TNF_PROBE_1_DEBUG(hci1394_atreq_ack, HCI1394_TNF_HAL, "", tnf_uint, - atreq_ack, qcmd->qc_status); - /* save away the command completed timestamp for the services layer */ hcicmd->ac_priv->ack_tstamp = qcmd->qc_timestamp; @@ -557,17 +508,11 @@ hci1394_async_atreq_process(hci1394_async_handle_t async_handle, async_handle->as_drvinfo->di_sl_private, hcicmd->ac_cmd, H1394_AT_REQ, hcicmd->ac_status); - TNF_PROBE_0_DEBUG(hci1394_async_atreq_process_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_SUCCESS); /* * This is a HW error. Process the ACK like we never saw the * response. We will do this below. */ - } else { - TNF_PROBE_1(hci1394_async_ack_fail, - HCI1394_TNF_HAL_ERROR, "", tnf_string, errmsg, - "response sent to non-pended ack"); } } @@ -582,8 +527,6 @@ hci1394_async_atreq_process(hci1394_async_handle_t async_handle, hcicmd->ac_plist_node.tln_addr = hcicmd; hci1394_tlist_add(async_handle->as_pending_list, &hcicmd->ac_plist_node); - TNF_PROBE_0_DEBUG(hci1394_async_atreq_process_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_SUCCESS); } @@ -608,11 +551,6 @@ hci1394_async_atreq_process(hci1394_async_handle_t async_handle, case OHCI_EVT_MISSING_ACK: case OHCI_EVT_TIMEOUT: - TNF_PROBE_3(hci1394_atreq_ack_err, HCI1394_TNF_HAL_ERROR, - "", tnf_uint, nodeid, - IEEE1394_NODE_NUM(hcicmd->ac_tlabel.tbi_destination), - tnf_uint, tx_tlabel, hcicmd->ac_tlabel.tbi_tlabel, - tnf_uint, atreq_ack, qcmd->qc_status); cmd_status = H1394_CMD_ETIMEOUT; break; @@ -620,56 +558,26 @@ hci1394_async_atreq_process(hci1394_async_handle_t async_handle, case OHCI_ACK_BUSY_A: case OHCI_ACK_BUSY_B: cmd_status = H1394_CMD_EDEVICE_BUSY; - TNF_PROBE_3(hci1394_atreq_ack_err, HCI1394_TNF_HAL_ERROR, - "", tnf_uint, nodeid, - IEEE1394_NODE_NUM(hcicmd->ac_tlabel.tbi_destination), - tnf_uint, tx_tlabel, hcicmd->ac_tlabel.tbi_tlabel, - tnf_uint, atreq_ack, qcmd->qc_status); break; case OHCI_ACK_TARDY: cmd_status = H1394_CMD_EDEVICE_POWERUP; - TNF_PROBE_3(hci1394_atreq_ack_err, HCI1394_TNF_HAL_ERROR, - "", tnf_uint, nodeid, - IEEE1394_NODE_NUM(hcicmd->ac_tlabel.tbi_destination), - tnf_uint, tx_tlabel, hcicmd->ac_tlabel.tbi_tlabel, - tnf_uint, atreq_ack, qcmd->qc_status); break; case OHCI_ACK_DATA_ERROR: cmd_status = H1394_CMD_EDATA_ERROR; - TNF_PROBE_3(hci1394_atreq_ack_err, HCI1394_TNF_HAL_ERROR, - "", tnf_uint, nodeid, - IEEE1394_NODE_NUM(hcicmd->ac_tlabel.tbi_destination), - tnf_uint, tx_tlabel, hcicmd->ac_tlabel.tbi_tlabel, - tnf_uint, atreq_ack, qcmd->qc_status); break; case OHCI_ACK_TYPE_ERROR: cmd_status = H1394_CMD_ETYPE_ERROR; - TNF_PROBE_3(hci1394_atreq_ack_err, HCI1394_TNF_HAL_ERROR, - "", tnf_uint, nodeid, - IEEE1394_NODE_NUM(hcicmd->ac_tlabel.tbi_destination), - tnf_uint, tx_tlabel, hcicmd->ac_tlabel.tbi_tlabel, - tnf_uint, atreq_ack, qcmd->qc_status); break; case OHCI_ACK_CONFLICT_ERROR: cmd_status = H1394_CMD_ERSRC_CONFLICT; - TNF_PROBE_3(hci1394_atreq_ack_err, HCI1394_TNF_HAL_ERROR, - "", tnf_uint, nodeid, - IEEE1394_NODE_NUM(hcicmd->ac_tlabel.tbi_destination), - tnf_uint, tx_tlabel, hcicmd->ac_tlabel.tbi_tlabel, - tnf_uint, atreq_ack, qcmd->qc_status); break; case OHCI_ACK_ADDRESS_ERROR: cmd_status = H1394_CMD_EADDR_ERROR; - TNF_PROBE_3(hci1394_atreq_ack_err, HCI1394_TNF_HAL_ERROR, - "", tnf_uint, nodeid, - IEEE1394_NODE_NUM(hcicmd->ac_tlabel.tbi_destination), - tnf_uint, tx_tlabel, hcicmd->ac_tlabel.tbi_tlabel, - tnf_uint, atreq_ack, qcmd->qc_status); break; case OHCI_EVT_UNDERRUN: @@ -679,11 +587,6 @@ hci1394_async_atreq_process(hci1394_async_handle_t async_handle, case OHCI_EVT_UNKNOWN: default: cmd_status = H1394_CMD_EUNKNOWN_ERROR; - TNF_PROBE_3(hci1394_atreq_ack_err, HCI1394_TNF_HAL_ERROR, - "", tnf_uint, nodeid, - IEEE1394_NODE_NUM(hcicmd->ac_tlabel.tbi_destination), - tnf_uint, tx_tlabel, hcicmd->ac_tlabel.tbi_tlabel, - tnf_uint, atreq_ack, qcmd->qc_status); break; } @@ -710,9 +613,6 @@ hci1394_async_atreq_process(hci1394_async_handle_t async_handle, h1394_cmd_is_complete(async_handle->as_drvinfo->di_sl_private, hcicmd->ac_cmd, H1394_AT_REQ, cmd_status); - TNF_PROBE_0_DEBUG(hci1394_async_atreq_process_exit, - HCI1394_TNF_HAL_STACK, ""); - return (DDI_SUCCESS); } @@ -739,9 +639,6 @@ hci1394_async_arresp_process(hci1394_async_handle_t async_handle, ASSERT(async_handle != NULL); ASSERT(response_available != NULL); - TNF_PROBE_0_DEBUG(hci1394_async_arresp_process_enter, - HCI1394_TNF_HAL_STACK, ""); - /* * See if there were any responses on ARRESP Q. A NULL means there * were no responses on the Q. This call does NOT free up space. We @@ -751,8 +648,6 @@ hci1394_async_arresp_process(hci1394_async_handle_t async_handle, hci1394_q_ar_next(async_handle->as_arresp_q, &addr); if (addr == NULL) { *response_available = B_FALSE; - TNF_PROBE_0_DEBUG(hci1394_async_arresp_process_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_SUCCESS); } @@ -780,10 +675,6 @@ hci1394_async_arresp_process(hci1394_async_handle_t async_handle, "unrecoverable error interrupt detected", async_handle->as_drvinfo->di_instance); hci1394_shutdown(async_handle->as_drvinfo->di_dip); - TNF_PROBE_0(hci1394_async_arresp_read_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_async_arresp_process_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -798,14 +689,9 @@ hci1394_async_arresp_process(hci1394_async_handle_t async_handle, */ if (hcicmd == NULL) { mutex_exit(&async_handle->as_atomic_lookup); - TNF_PROBE_0_DEBUG(hci1394_async_arresp_process_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_SUCCESS); } - TNF_PROBE_1_DEBUG(hci1394_arresp_resp, HCI1394_TNF_HAL, "", tnf_uint, - atresp_resp, hcicmd->ac_status); - /* * Make sure this is in the pending list. There is a small chance that * we will see the response before we see the ACK PENDING. If it is the @@ -821,8 +707,6 @@ hci1394_async_arresp_process(hci1394_async_handle_t async_handle, &hcicmd->ac_plist_node); if (status != DDI_SUCCESS) { mutex_exit(&async_handle->as_atomic_lookup); - TNF_PROBE_0_DEBUG(hci1394_async_arresp_process_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_SUCCESS); } } @@ -878,8 +762,6 @@ hci1394_async_arresp_process(hci1394_async_handle_t async_handle, break; default: cmd_status = H1394_CMD_EUNKNOWN_ERROR; - TNF_PROBE_1(hci1394_async_ack_err, HCI1394_TNF_HAL_ERROR, - "", tnf_uint, arresp_resp, hcicmd->ac_status); break; } @@ -909,9 +791,6 @@ hci1394_async_arresp_process(hci1394_async_handle_t async_handle, hcicmd->ac_status = cmd_status; } - TNF_PROBE_0_DEBUG(hci1394_async_arresp_process_exit, - HCI1394_TNF_HAL_STACK, ""); - return (DDI_SUCCESS); } @@ -937,9 +816,6 @@ hci1394_async_arreq_process(hci1394_async_handle_t async_handle, ASSERT(async_handle != NULL); ASSERT(request_available != NULL); - TNF_PROBE_0_DEBUG(hci1394_async_arreq_process_enter, - HCI1394_TNF_HAL_STACK, ""); - /* * See if there were any requests on ARREQ Q. A NULL means there * were no requests on the Q. This call does NOT free up space. We @@ -949,8 +825,6 @@ hci1394_async_arreq_process(hci1394_async_handle_t async_handle, hci1394_q_ar_next(async_handle->as_arreq_q, &addr); if (addr == NULL) { *request_available = B_FALSE; - TNF_PROBE_0_DEBUG(hci1394_async_arreq_process_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_SUCCESS); } @@ -971,10 +845,6 @@ hci1394_async_arreq_process(hci1394_async_handle_t async_handle, "unrecoverable error interrupt detected", async_handle->as_drvinfo->di_instance); hci1394_shutdown(async_handle->as_drvinfo->di_dip); - TNF_PROBE_0(hci1394_async_arreq_read_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_async_arreq_process_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -988,8 +858,6 @@ hci1394_async_arreq_process(hci1394_async_handle_t async_handle, * still may have other requests on the Q. */ if (hcicmd == NULL) { - TNF_PROBE_0_DEBUG(hci1394_async_arreq_process_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_SUCCESS); } @@ -1002,14 +870,9 @@ hci1394_async_arreq_process(hci1394_async_handle_t async_handle, if (async_handle->as_flushing_arreq == B_TRUE) { hci1394_async_response_complete(async_handle, hcicmd->ac_cmd, hcicmd->ac_priv); - TNF_PROBE_0_DEBUG(hci1394_async_arreq_process_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_SUCCESS); } - TNF_PROBE_1_DEBUG(hci1394_arreq_ack, HCI1394_TNF_HAL, "", tnf_uint, - arreq_ack, hcicmd->ac_status); - /* * We got a valid request that we were able to read in. Call into the * services layer based on the type of request. @@ -1049,14 +912,9 @@ hci1394_async_arreq_process(hci1394_async_handle_t async_handle, /* free alloc'd command */ hci1394_async_response_complete(async_handle, hcicmd->ac_cmd, hcicmd->ac_priv); - TNF_PROBE_1(hci1394_async_arreq_tcode_err, - HCI1394_TNF_HAL_ERROR, "", tnf_uint, arreq_tcode, tcode); break; } - TNF_PROBE_0_DEBUG(hci1394_async_arreq_process_exit, - HCI1394_TNF_HAL_STACK, ""); - return (DDI_SUCCESS); } @@ -1083,9 +941,6 @@ hci1394_async_atresp_process(hci1394_async_handle_t async_handle, ASSERT(async_handle != NULL); ASSERT(response_available != NULL); - TNF_PROBE_0_DEBUG(hci1394_async_atresp_process_enter, - HCI1394_TNF_HAL_STACK, ""); - /* * Get the next ATRESP that has completed (if one has). Space is free'd * up in atresp_q and atresp_data_q as part of this function call. @@ -1098,8 +953,6 @@ hci1394_async_atresp_process(hci1394_async_handle_t async_handle, */ if (qcmd == NULL) { *response_available = B_FALSE; - TNF_PROBE_0_DEBUG(hci1394_async_atresp_process_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_SUCCESS); } @@ -1107,9 +960,6 @@ hci1394_async_atresp_process(hci1394_async_handle_t async_handle, *response_available = B_TRUE; hcicmd = (hci1394_async_cmd_t *)qcmd->qc_arg; - TNF_PROBE_1_DEBUG(hci1394_atresp_ack, HCI1394_TNF_HAL, "", tnf_uint, - atresp_ack, qcmd->qc_status); - /* save away the command completed timestamp for the services layer */ hcicmd->ac_priv->ack_tstamp = qcmd->qc_timestamp; @@ -1135,52 +985,36 @@ hci1394_async_atresp_process(hci1394_async_handle_t async_handle, case OHCI_EVT_MISSING_ACK: case OHCI_EVT_TIMEOUT: cmd_status = H1394_CMD_ETIMEOUT; - TNF_PROBE_1(hci1394_atresp_ack_err, HCI1394_TNF_HAL_ERROR, - "", tnf_uint, atresp_ack, qcmd->qc_status); break; case OHCI_ACK_BUSY_X: case OHCI_ACK_BUSY_A: case OHCI_ACK_BUSY_B: cmd_status = H1394_CMD_EDEVICE_BUSY; - TNF_PROBE_1(hci1394_atresp_ack_err, HCI1394_TNF_HAL_ERROR, - "", tnf_uint, atresp_ack, qcmd->qc_status); break; case OHCI_ACK_TARDY: cmd_status = H1394_CMD_EDEVICE_POWERUP; - TNF_PROBE_1(hci1394_atresp_ack_err, HCI1394_TNF_HAL_ERROR, - "", tnf_uint, atresp_ack, qcmd->qc_status); break; case OHCI_ACK_DATA_ERROR: cmd_status = H1394_CMD_EDATA_ERROR; - TNF_PROBE_1(hci1394_atresp_ack_err, HCI1394_TNF_HAL_ERROR, - "", tnf_uint, atresp_ack, qcmd->qc_status); break; case OHCI_ACK_TYPE_ERROR: cmd_status = H1394_CMD_ETYPE_ERROR; - TNF_PROBE_1(hci1394_atresp_ack_err, HCI1394_TNF_HAL_ERROR, - "", tnf_uint, atresp_ack, qcmd->qc_status); break; case OHCI_ACK_CONFLICT_ERROR: cmd_status = H1394_CMD_ERSRC_CONFLICT; - TNF_PROBE_1(hci1394_atresp_ack_err, HCI1394_TNF_HAL_ERROR, - "", tnf_uint, atresp_ack, qcmd->qc_status); break; case OHCI_ACK_ADDRESS_ERROR: cmd_status = H1394_CMD_EADDR_ERROR; - TNF_PROBE_1(hci1394_atresp_ack_err, HCI1394_TNF_HAL_ERROR, - "", tnf_uint, atresp_ack, qcmd->qc_status); break; case OHCI_EVT_UNKNOWN: cmd_status = H1394_CMD_EUNKNOWN_ERROR; - TNF_PROBE_1(hci1394_atresp_ack_err, HCI1394_TNF_HAL_ERROR, - "", tnf_uint, atresp_ack, qcmd->qc_status); break; case OHCI_EVT_UNDERRUN: @@ -1189,8 +1023,6 @@ hci1394_async_atresp_process(hci1394_async_handle_t async_handle, case OHCI_EVT_DESCRIPTOR_READ: default: cmd_status = H1394_CMD_EUNKNOWN_ERROR; - TNF_PROBE_1(hci1394_atresp_ack_err, HCI1394_TNF_HAL_ERROR, - "", tnf_uint, atresp_ack, qcmd->qc_status); break; } @@ -1198,9 +1030,6 @@ hci1394_async_atresp_process(hci1394_async_handle_t async_handle, h1394_cmd_is_complete(async_handle->as_drvinfo->di_sl_private, hcicmd->ac_cmd, H1394_AT_RESP, cmd_status); - TNF_PROBE_0_DEBUG(hci1394_async_atresp_process_exit, - HCI1394_TNF_HAL_STACK, ""); - return (DDI_SUCCESS); } @@ -1243,9 +1072,6 @@ hci1394_async_arresp_read(hci1394_async_handle_t async_handle, ASSERT(hcicmd != NULL); ASSERT(size != NULL); - TNF_PROBE_0_DEBUG(hci1394_async_arresp_read_enter, - HCI1394_TNF_HAL_STACK, ""); - /* read in the arresp tcode */ quadlet = hci1394_q_ar_get32(async_handle->as_arresp_q, &pkt->q1); *tcode = HCI1394_DESC_TCODE_GET(quadlet); @@ -1254,10 +1080,6 @@ hci1394_async_arresp_read(hci1394_async_handle_t async_handle, status = hci1394_async_arresp_size_get(*tcode, async_handle->as_arresp_q, &pkt->q1, size); if (status != DDI_SUCCESS) { - TNF_PROBE_0(hci1394_async_arresp_read_size_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_async_arresp_read_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -1280,12 +1102,6 @@ hci1394_async_arresp_read(hci1394_async_handle_t async_handle, */ *hcicmd = (hci1394_async_cmd_t *)command; if ((*hcicmd) == NULL) { - TNF_PROBE_2(hci1394_invalid_tlabel, HCI1394_TNF_HAL_ERROR, - "", tnf_uint, nodeid, - IEEE1394_NODE_NUM(ac_tlabel.tbi_destination), tnf_uint, - rx_tlabel, ac_tlabel.tbi_tlabel); - TNF_PROBE_0_DEBUG(hci1394_async_arresp_read_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_SUCCESS); } @@ -1324,16 +1140,9 @@ hci1394_async_arresp_read(hci1394_async_handle_t async_handle, if (ack != OHCI_ACK_COMPLETE) { /* use the ack error instead of rcode for the command status */ (*hcicmd)->ac_status = ack | ASYNC_ARRESP_ACK_ERROR; - TNF_PROBE_1(hci1394_arresp_bad_ack, HCI1394_TNF_HAL_ERROR, - "", tnf_uint, arresp_ack, ack); - TNF_PROBE_0_DEBUG(hci1394_async_arresp_read_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_SUCCESS); } - TNF_PROBE_1_DEBUG(hci1394_atrresp_resp, HCI1394_TNF_HAL, "", tnf_uint, - arresp_resp, rcode); - /* * If we get to this point we have gotten a valid ACK on the response * and have matched up the response with an ATREQ. Now we check the @@ -1341,8 +1150,6 @@ hci1394_async_arresp_read(hci1394_async_handle_t async_handle, * left to look at in the response. Return successfully. */ if (rcode != IEEE1394_RESP_COMPLETE) { - TNF_PROBE_0_DEBUG(hci1394_async_arresp_read_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_SUCCESS); } @@ -1364,12 +1171,6 @@ hci1394_async_arresp_read(hci1394_async_handle_t async_handle, if ((cmd->cmd_type != CMD1394_ASYNCH_WR_QUAD) && (cmd->cmd_type != CMD1394_ASYNCH_WR_BLOCK)) { (*hcicmd)->ac_status = H1394_CMD_EDEVICE_ERROR; - TNF_PROBE_2(hci1394_async_arresp_lockresp_fail, - HCI1394_TNF_HAL_STACK, "", tnf_string, errmsg, - "Invalid response sent for write request", tnf_uint, - arresp_tcode, *tcode); - TNF_PROBE_0_DEBUG(hci1394_async_arresp_read_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_SUCCESS); } break; @@ -1378,12 +1179,6 @@ hci1394_async_arresp_read(hci1394_async_handle_t async_handle, /* make sure the ATREQ was a quadlet read */ if (cmd->cmd_type != CMD1394_ASYNCH_RD_QUAD) { (*hcicmd)->ac_status = H1394_CMD_EDEVICE_ERROR; - TNF_PROBE_2(hci1394_async_arresp_lockresp_fail, - HCI1394_TNF_HAL_STACK, "", tnf_string, errmsg, - "Invalid response sent for qrd request", tnf_uint, - arresp_tcode, *tcode); - TNF_PROBE_0_DEBUG(hci1394_async_arresp_read_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_SUCCESS); } @@ -1400,12 +1195,6 @@ hci1394_async_arresp_read(hci1394_async_handle_t async_handle, /* make sure the ATREQ was a block read */ if (cmd->cmd_type != CMD1394_ASYNCH_RD_BLOCK) { (*hcicmd)->ac_status = H1394_CMD_EDEVICE_ERROR; - TNF_PROBE_2(hci1394_async_arresp_lockresp_fail, - HCI1394_TNF_HAL_STACK, "", tnf_string, errmsg, - "Invalid response sent for brd request", tnf_uint, - arresp_tcode, *tcode); - TNF_PROBE_0_DEBUG(hci1394_async_arresp_read_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_SUCCESS); } @@ -1418,13 +1207,6 @@ hci1394_async_arresp_read(hci1394_async_handle_t async_handle, data_length = HCI1394_DESC_DATALEN_GET(quadlet); if (data_length != cmd_priv->mblk.length) { (*hcicmd)->ac_status = H1394_CMD_EDEVICE_ERROR; - TNF_PROBE_3(hci1394_async_arresp_brdsz_fail, - HCI1394_TNF_HAL_STACK, "", tnf_string, - errmsg, "Block read response size is bad", - tnf_uint, requested_size, cmd_priv->mblk.length, - tnf_uint, response_size, data_length); - TNF_PROBE_0_DEBUG(hci1394_async_arresp_read_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_SUCCESS); } @@ -1446,13 +1228,6 @@ hci1394_async_arresp_read(hci1394_async_handle_t async_handle, */ if (data_length != IEEE1394_QUADLET) { (*hcicmd)->ac_status = H1394_CMD_EDEVICE_ERROR; - TNF_PROBE_2(hci1394_async_arresp_l32sz_fail, - HCI1394_TNF_HAL_STACK, "", tnf_string, - errmsg, "Invalid size for lock32 response", - tnf_uint, data_size, data_length); - TNF_PROBE_0_DEBUG( - hci1394_async_arresp_read_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_SUCCESS); } @@ -1475,13 +1250,6 @@ hci1394_async_arresp_read(hci1394_async_handle_t async_handle, */ if (data_length != IEEE1394_OCTLET) { (*hcicmd)->ac_status = H1394_CMD_EDEVICE_ERROR; - TNF_PROBE_2(hci1394_async_arresp_l64sz_fail, - HCI1394_TNF_HAL_STACK, "", tnf_string, - errmsg, "Invalid size for lock64 response", - tnf_uint, data_size, data_length); - TNF_PROBE_0_DEBUG( - hci1394_async_arresp_read_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_SUCCESS); } @@ -1503,29 +1271,15 @@ hci1394_async_arresp_read(hci1394_async_handle_t async_handle, */ } else { (*hcicmd)->ac_status = H1394_CMD_EDEVICE_ERROR; - TNF_PROBE_2(hci1394_async_arresp_lockresp_fail, - HCI1394_TNF_HAL_STACK, "", tnf_string, errmsg, - "Invalid response sent for lock request", tnf_uint, - arresp_tcode, *tcode); - TNF_PROBE_0_DEBUG(hci1394_async_arresp_read_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_SUCCESS); } break; default: /* we got a tcode that we don't know about. Return error */ - TNF_PROBE_2(hci1394_async_arresp_tcode_err, - HCI1394_TNF_HAL_ERROR, "", tnf_string, errmsg, - "unknown ARRESP received", tnf_uint, arresp_tcode, *tcode); - TNF_PROBE_0_DEBUG(hci1394_async_arresp_read_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } - TNF_PROBE_0_DEBUG(hci1394_async_arresp_read_exit, - HCI1394_TNF_HAL_STACK, ""); - return (DDI_SUCCESS); } @@ -1559,9 +1313,6 @@ hci1394_async_arreq_read(hci1394_async_handle_t async_handle, ASSERT(hcicmd != NULL); ASSERT(size != NULL); - TNF_PROBE_0_DEBUG(hci1394_async_arreq_read_enter, - HCI1394_TNF_HAL_STACK, ""); - /* read in the arresp tcode */ quadlet = hci1394_q_ar_get32(async_handle->as_arreq_q, &pkt->q1); *tcode = HCI1394_DESC_TCODE_GET(quadlet); @@ -1574,10 +1325,6 @@ hci1394_async_arreq_read(hci1394_async_handle_t async_handle, status = h1394_alloc_cmd(async_handle->as_drvinfo->di_sl_private, H1394_ALLOC_CMD_NOSLEEP, &cmd, &cmd_priv); if (status != DDI_SUCCESS) { - TNF_PROBE_0(hci1394_async_arreq_read_cmdalloc_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_async_arreq_read_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -1611,10 +1358,6 @@ hci1394_async_arreq_read(hci1394_async_handle_t async_handle, hci1394_async_response_complete(async_handle, cmd, cmd_priv); *hcicmd = NULL; - TNF_PROBE_0(hci1394_async_arreq_read_qrd_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_async_arreq_read_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_SUCCESS); } break; @@ -1633,10 +1376,6 @@ hci1394_async_arreq_read(hci1394_async_handle_t async_handle, hci1394_async_response_complete(async_handle, cmd, cmd_priv); *hcicmd = NULL; - TNF_PROBE_0(hci1394_async_arreq_read_qwr_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_async_arreq_read_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_SUCCESS); } break; @@ -1655,10 +1394,6 @@ hci1394_async_arreq_read(hci1394_async_handle_t async_handle, hci1394_async_response_complete(async_handle, cmd, cmd_priv); *hcicmd = NULL; - TNF_PROBE_0(hci1394_async_arreq_read_brd_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_async_arreq_read_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_SUCCESS); } break; @@ -1677,10 +1412,6 @@ hci1394_async_arreq_read(hci1394_async_handle_t async_handle, hci1394_async_response_complete(async_handle, cmd, cmd_priv); *hcicmd = NULL; - TNF_PROBE_0(hci1394_async_arreq_read_bwr_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_async_arreq_read_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_SUCCESS); } break; @@ -1699,10 +1430,6 @@ hci1394_async_arreq_read(hci1394_async_handle_t async_handle, hci1394_async_response_complete(async_handle, cmd, cmd_priv); *hcicmd = NULL; - TNF_PROBE_0(hci1394_async_arreq_read_lck_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_async_arreq_read_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_SUCCESS); } break; @@ -1721,10 +1448,6 @@ hci1394_async_arreq_read(hci1394_async_handle_t async_handle, hci1394_async_response_complete(async_handle, cmd, cmd_priv); *hcicmd = NULL; - TNF_PROBE_0(hci1394_async_arreq_read_phy_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_async_arreq_read_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_SUCCESS); } @@ -1737,19 +1460,12 @@ hci1394_async_arreq_read(hci1394_async_handle_t async_handle, hci1394_async_response_complete(async_handle, cmd, cmd_priv); *hcicmd = NULL; - TNF_PROBE_0_DEBUG(hci1394_async_arreq_read_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_SUCCESS); } break; default: /* we got a tcode that we don't know about. Return error */ - TNF_PROBE_2(hci1394_async_arreq_tcode_err, - HCI1394_TNF_HAL_ERROR, "", tnf_string, errmsg, - "unknown ARREQ received", tnf_uint, arreq_tcode, *tcode); - TNF_PROBE_0_DEBUG(hci1394_async_arreq_read_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -1765,10 +1481,6 @@ hci1394_async_arreq_read(hci1394_async_handle_t async_handle, IEEE1394_TCODE_WRITE_BLOCK))) { hci1394_async_response_complete(async_handle, cmd, cmd_priv); *hcicmd = NULL; - TNF_PROBE_0(hci1394_async_arreq_read_bcast_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_async_arreq_read_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_SUCCESS); /* @@ -1780,9 +1492,6 @@ hci1394_async_arreq_read(hci1394_async_handle_t async_handle, cmd->broadcast = 1; } - TNF_PROBE_0_DEBUG(hci1394_async_arreq_read_exit, - HCI1394_TNF_HAL_STACK, ""); - return (DDI_SUCCESS); } @@ -1805,8 +1514,6 @@ hci1394_async_arreq_read_qrd(hci1394_async_handle_t async_handle, ASSERT(pkt != NULL); ASSERT(hcicmd != NULL); ASSERT(size != NULL); - TNF_PROBE_0_DEBUG(hci1394_async_arreq_read_qrd_enter, - HCI1394_TNF_HAL_STACK, ""); /* Setup shortcuts, command type, and size of request */ cmd = hcicmd->ac_cmd; @@ -1831,11 +1538,6 @@ hci1394_async_arreq_read_qrd(hci1394_async_handle_t async_handle, */ if ((hcicmd->ac_status != OHCI_ACK_COMPLETE) && (hcicmd->ac_status != OHCI_ACK_PENDING)) { - TNF_PROBE_1(hci1394_async_arreq_qrd_ack_fail, - HCI1394_TNF_HAL_ERROR, "", tnf_uint, arreq_ack, - hcicmd->ac_status); - TNF_PROBE_0_DEBUG(hci1394_async_arreq_read_qrd_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -1858,9 +1560,6 @@ hci1394_async_arreq_read_qrd(hci1394_async_handle_t async_handle, quadlet = hci1394_q_ar_get32(async_handle->as_arreq_q, &pkt->q3); cmd->cmd_addr |= HCI1394_TO_ADDR_LO(quadlet); - TNF_PROBE_0_DEBUG(hci1394_async_arreq_read_qrd_exit, - HCI1394_TNF_HAL_STACK, ""); - return (DDI_SUCCESS); } @@ -1884,8 +1583,6 @@ hci1394_async_arreq_read_qwr(hci1394_async_handle_t async_handle, ASSERT(pkt != NULL); ASSERT(hcicmd != NULL); ASSERT(size != NULL); - TNF_PROBE_0_DEBUG(hci1394_async_arreq_read_qwr_enter, - HCI1394_TNF_HAL_STACK, ""); /* Setup shortcuts, command type, and size of request */ cmd = hcicmd->ac_cmd; @@ -1910,11 +1607,6 @@ hci1394_async_arreq_read_qwr(hci1394_async_handle_t async_handle, */ if ((hcicmd->ac_status != OHCI_ACK_COMPLETE) && (hcicmd->ac_status != OHCI_ACK_PENDING)) { - TNF_PROBE_1(hci1394_async_arreq_qwr_ack_fail, - HCI1394_TNF_HAL_ERROR, "", tnf_uint, arreq_ack, - hcicmd->ac_status); - TNF_PROBE_0_DEBUG(hci1394_async_arreq_read_qwr_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -1941,9 +1633,6 @@ hci1394_async_arreq_read_qwr(hci1394_async_handle_t async_handle, (uint8_t *)&cmd->cmd_u.q.quadlet_data, (uint8_t *)&pkt->q4, IEEE1394_QUADLET); - TNF_PROBE_0_DEBUG(hci1394_async_arreq_read_qwr_exit, - HCI1394_TNF_HAL_STACK, ""); - return (DDI_SUCCESS); } @@ -1966,8 +1655,6 @@ hci1394_async_arreq_read_brd(hci1394_async_handle_t async_handle, ASSERT(pkt != NULL); ASSERT(hcicmd != NULL); ASSERT(size != NULL); - TNF_PROBE_0_DEBUG(hci1394_async_arreq_read_brd_enter, - HCI1394_TNF_HAL_STACK, ""); /* Setup shortcuts, command type, and size of request */ cmd = hcicmd->ac_cmd; @@ -1992,11 +1679,6 @@ hci1394_async_arreq_read_brd(hci1394_async_handle_t async_handle, */ if ((hcicmd->ac_status != OHCI_ACK_COMPLETE) && (hcicmd->ac_status != OHCI_ACK_PENDING)) { - TNF_PROBE_1(hci1394_async_arreq_brd_ack_fail, - HCI1394_TNF_HAL_ERROR, "", tnf_uint, arreq_ack, - hcicmd->ac_status); - TNF_PROBE_0_DEBUG(hci1394_async_arreq_read_brd_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -2019,17 +1701,10 @@ hci1394_async_arreq_read_brd(hci1394_async_handle_t async_handle, cmd->cmd_u.b.blk_length = HCI1394_DESC_DATALEN_GET(quadlet); cmd->cmd_u.b.data_block = allocb(cmd->cmd_u.b.blk_length, 0); if (cmd->cmd_u.b.data_block == NULL) { - TNF_PROBE_0(hci1394_async_arreq_brd_mblk_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_async_arreq_read_brd_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } hcicmd->ac_mblk_alloc = B_TRUE; - TNF_PROBE_0_DEBUG(hci1394_async_arreq_read_brd_exit, - HCI1394_TNF_HAL_STACK, ""); - return (DDI_SUCCESS); } @@ -2053,8 +1728,6 @@ hci1394_async_arreq_read_bwr(hci1394_async_handle_t async_handle, ASSERT(pkt != NULL); ASSERT(hcicmd != NULL); ASSERT(size != NULL); - TNF_PROBE_0_DEBUG(hci1394_async_arreq_read_bwr_enter, - HCI1394_TNF_HAL_STACK, ""); /* * Setup shortcuts, command type, and size of request. The size of the @@ -2090,11 +1763,6 @@ hci1394_async_arreq_read_bwr(hci1394_async_handle_t async_handle, */ if ((hcicmd->ac_status != OHCI_ACK_COMPLETE) && (hcicmd->ac_status != OHCI_ACK_PENDING)) { - TNF_PROBE_1(hci1394_async_arreq_bwr_ack_fail, - HCI1394_TNF_HAL_ERROR, "", tnf_uint, arreq_ack, - hcicmd->ac_status); - TNF_PROBE_0_DEBUG(hci1394_async_arreq_read_bwr_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -2115,10 +1783,6 @@ hci1394_async_arreq_read_bwr(hci1394_async_handle_t async_handle, cmd->cmd_addr |= HCI1394_TO_ADDR_LO(quadlet); cmd->cmd_u.b.data_block = allocb(cmd->cmd_u.b.blk_length, 0); if (cmd->cmd_u.b.data_block == NULL) { - TNF_PROBE_0(hci1394_async_arreq_bwr_mblk_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_async_arreq_read_bwr_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } hcicmd->ac_mblk_alloc = B_TRUE; @@ -2131,9 +1795,6 @@ hci1394_async_arreq_read_bwr(hci1394_async_handle_t async_handle, /* Update mblk_t wptr */ cmd->cmd_u.b.data_block->b_wptr += cmd->cmd_u.b.blk_length; - TNF_PROBE_0_DEBUG(hci1394_async_arreq_read_bwr_exit, - HCI1394_TNF_HAL_STACK, ""); - return (DDI_SUCCESS); } @@ -2159,8 +1820,6 @@ hci1394_async_arreq_read_lck(hci1394_async_handle_t async_handle, ASSERT(pkt != NULL); ASSERT(hcicmd != NULL); ASSERT(size != NULL); - TNF_PROBE_0_DEBUG(hci1394_async_arreq_read_qrd_enter, - HCI1394_TNF_HAL_STACK, ""); /* * Setup shortcuts, command type, and size of request. The size of the @@ -2182,11 +1841,6 @@ hci1394_async_arreq_read_lck(hci1394_async_handle_t async_handle, cmd->cmd_type = CMD1394_ASYNCH_LOCK_64; cmd->cmd_u.l64.lock_type = HCI1394_DESC_EXTTCODE_GET(quadlet); } else { - TNF_PROBE_2(hci1394_async_arreq_lck_sz_fail, - HCI1394_TNF_HAL_ERROR, "", tnf_string, errmsg, - "unexpected length received", tnf_uint, locklen, length); - TNF_PROBE_0_DEBUG(hci1394_async_arreq_read_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -2210,11 +1864,6 @@ hci1394_async_arreq_read_lck(hci1394_async_handle_t async_handle, */ if ((hcicmd->ac_status != OHCI_ACK_COMPLETE) && (hcicmd->ac_status != OHCI_ACK_PENDING)) { - TNF_PROBE_1(hci1394_async_arreq_read_ack_fail, - HCI1394_TNF_HAL_ERROR, "", tnf_uint, arreq_ack, - hcicmd->ac_status); - TNF_PROBE_0_DEBUG(hci1394_async_arreq_read_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -2274,9 +1923,6 @@ hci1394_async_arreq_read_lck(hci1394_async_handle_t async_handle, cmd->cmd_u.l64.lock_type, cmd->cmd_u.l64.data_value); } - TNF_PROBE_0_DEBUG(hci1394_async_arreq_read_qrd_exit, - HCI1394_TNF_HAL_STACK, ""); - return (DDI_SUCCESS); } @@ -2301,8 +1947,6 @@ hci1394_async_arreq_read_phy(hci1394_async_handle_t async_handle, ASSERT(pkt != NULL); ASSERT(hcicmd != NULL); ASSERT(size != NULL); - TNF_PROBE_0_DEBUG(hci1394_async_arreq_read_phy_enter, - HCI1394_TNF_HAL_STACK, ""); /* Setup shortcuts, command type, and size of request */ cmd = hcicmd->ac_cmd; @@ -2335,8 +1979,6 @@ hci1394_async_arreq_read_phy(hci1394_async_handle_t async_handle, async_handle->as_ohci)) { async_handle->as_flushing_arreq = B_FALSE; } - TNF_PROBE_0_DEBUG(hci1394_async_arreq_read_phy_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_SUCCESS); } @@ -2344,20 +1986,12 @@ hci1394_async_arreq_read_phy(hci1394_async_handle_t async_handle, /* if there is a data error in the PHY packet, return failure */ if (data1 != ~data2) { - TNF_PROBE_2(hci1394_async_arreq_phy_xor_fail, - HCI1394_TNF_HAL_ERROR, "", tnf_opaque, first_quadlet, - data1, tnf_opaque, second_quadlet, data2); - TNF_PROBE_0_DEBUG(hci1394_async_arreq_read_phy_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } /* Copy the PHY quadlet to the command */ cmd->cmd_u.q.quadlet_data = data1; - TNF_PROBE_0_DEBUG(hci1394_async_arreq_read_phy_exit, - HCI1394_TNF_HAL_STACK, ""); - return (DDI_SUCCESS); } @@ -2380,8 +2014,6 @@ hci1394_async_phy(hci1394_async_handle_t async_handle, cmd1394_cmd_t *cmd, ASSERT(cmd_priv != NULL); ASSERT(result != NULL); - TNF_PROBE_0_DEBUG(hci1394_async_phy_enter, HCI1394_TNF_HAL_STACK, ""); - /* * make sure this call is during the current bus generation (i.e. no * bus resets have occured since this request was made. @@ -2389,8 +2021,6 @@ hci1394_async_phy(hci1394_async_handle_t async_handle, cmd1394_cmd_t *cmd, if (cmd_priv->bus_generation != hci1394_ohci_current_busgen( async_handle->as_ohci)) { *result = H1394_STATUS_INVALID_BUSGEN; - TNF_PROBE_0_DEBUG(hci1394_async_phy_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -2412,15 +2042,9 @@ hci1394_async_phy(hci1394_async_handle_t async_handle, cmd1394_cmd_t *cmd, status = hci1394_q_at(async_handle->as_atreq_q, &hcicmd->ac_qcmd, &header, DESC_PKT_HDRLEN_AT_PHY, result); if (status != DDI_SUCCESS) { - TNF_PROBE_0(hci1394_async_phy_q_fail, HCI1394_TNF_HAL_ERROR, - ""); - TNF_PROBE_0_DEBUG(hci1394_async_phy_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } - TNF_PROBE_0_DEBUG(hci1394_async_phy_exit, HCI1394_TNF_HAL_STACK, ""); - return (DDI_SUCCESS); } @@ -2444,8 +2068,6 @@ hci1394_async_write(hci1394_async_handle_t async_handle, cmd1394_cmd_t *cmd, ASSERT(cmd_priv != NULL); ASSERT(result != NULL); - TNF_PROBE_0_DEBUG(hci1394_async_write_enter, HCI1394_TNF_HAL_STACK, ""); - /* * make sure this call is during the current bus generation (i.e. no * bus resets have occured since this request was made. @@ -2453,8 +2075,6 @@ hci1394_async_write(hci1394_async_handle_t async_handle, cmd1394_cmd_t *cmd, if (cmd_priv->bus_generation != hci1394_ohci_current_busgen( async_handle->as_ohci)) { *result = H1394_STATUS_INVALID_BUSGEN; - TNF_PROBE_0_DEBUG(hci1394_async_write_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -2467,10 +2087,6 @@ hci1394_async_write(hci1394_async_handle_t async_handle, cmd1394_cmd_t *cmd, &hcicmd->ac_tlabel); if (status != DDI_SUCCESS) { *result = H1394_STATUS_EMPTY_TLABEL; - TNF_PROBE_0(hci1394_async_write_tlb_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_async_write_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -2512,10 +2128,6 @@ hci1394_async_write(hci1394_async_handle_t async_handle, cmd1394_cmd_t *cmd, &hcicmd->ac_qcmd, &header, DESC_PKT_HDRLEN_AT_WRITEQUAD, result); if (status != DDI_SUCCESS) { - TNF_PROBE_0(hci1394_async_write_q_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_async_write_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -2536,16 +2148,10 @@ hci1394_async_write(hci1394_async_handle_t async_handle, cmd1394_cmd_t *cmd, &hcicmd->ac_qcmd, &header, DESC_PKT_HDRLEN_AT_WRITEBLOCK, &cmd_priv->mblk, result); if (status != DDI_SUCCESS) { - TNF_PROBE_0(hci1394_async_write_qmblk_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_async_write_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } } - TNF_PROBE_0_DEBUG(hci1394_async_write_exit, HCI1394_TNF_HAL_STACK, ""); - return (DDI_SUCCESS); } @@ -2569,8 +2175,6 @@ hci1394_async_read(hci1394_async_handle_t async_handle, cmd1394_cmd_t *cmd, ASSERT(cmd_priv != NULL); ASSERT(result != NULL); - TNF_PROBE_0_DEBUG(hci1394_async_read_enter, HCI1394_TNF_HAL_STACK, ""); - /* * make sure this call is during the current bus generation (i.e. no * bus resets have occured since this request was made. @@ -2578,8 +2182,6 @@ hci1394_async_read(hci1394_async_handle_t async_handle, cmd1394_cmd_t *cmd, if (cmd_priv->bus_generation != hci1394_ohci_current_busgen( async_handle->as_ohci)) { *result = H1394_STATUS_INVALID_BUSGEN; - TNF_PROBE_0_DEBUG(hci1394_async_read_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -2592,10 +2194,6 @@ hci1394_async_read(hci1394_async_handle_t async_handle, cmd1394_cmd_t *cmd, &hcicmd->ac_tlabel); if (status != DDI_SUCCESS) { *result = H1394_STATUS_EMPTY_TLABEL; - TNF_PROBE_0(hci1394_async_read_tlb_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_async_read_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -2633,10 +2231,6 @@ hci1394_async_read(hci1394_async_handle_t async_handle, cmd1394_cmd_t *cmd, &hcicmd->ac_qcmd, &header, DESC_PKT_HDRLEN_AT_READQUAD, result); if (status != DDI_SUCCESS) { - TNF_PROBE_0(hci1394_async_read_q_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_async_read_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -2653,16 +2247,10 @@ hci1394_async_read(hci1394_async_handle_t async_handle, cmd1394_cmd_t *cmd, &hcicmd->ac_qcmd, &header, DESC_PKT_HDRLEN_AT_READBLOCK, result); if (status != DDI_SUCCESS) { - TNF_PROBE_0(hci1394_async_read_qb_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_async_read_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } } - TNF_PROBE_0_DEBUG(hci1394_async_read_exit, HCI1394_TNF_HAL_STACK, ""); - return (DDI_SUCCESS); } @@ -2690,8 +2278,6 @@ hci1394_async_lock(hci1394_async_handle_t async_handle, cmd1394_cmd_t *cmd, ASSERT(cmd_priv != NULL); ASSERT(result != NULL); - TNF_PROBE_0_DEBUG(hci1394_async_lock_enter, HCI1394_TNF_HAL_STACK, ""); - /* * make sure this call is during the current bus generation (i.e. no * bus resets have occured since this request was made. @@ -2699,8 +2285,6 @@ hci1394_async_lock(hci1394_async_handle_t async_handle, cmd1394_cmd_t *cmd, if (cmd_priv->bus_generation != hci1394_ohci_current_busgen( async_handle->as_ohci)) { *result = H1394_STATUS_INVALID_BUSGEN; - TNF_PROBE_0_DEBUG(hci1394_async_lock_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -2713,10 +2297,6 @@ hci1394_async_lock(hci1394_async_handle_t async_handle, cmd1394_cmd_t *cmd, &hcicmd->ac_tlabel); if (status != DDI_SUCCESS) { *result = H1394_STATUS_EMPTY_TLABEL; - TNF_PROBE_0(hci1394_async_lock_tlb_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_async_lock_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -2767,10 +2347,6 @@ hci1394_async_lock(hci1394_async_handle_t async_handle, cmd1394_cmd_t *cmd, datap = (uint8_t *)data64; } else { *result = H1394_STATUS_INTERNAL_ERROR; - TNF_PROBE_0(hci1394_lock_length_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_async_lock_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -2779,15 +2355,9 @@ hci1394_async_lock(hci1394_async_handle_t async_handle, cmd1394_cmd_t *cmd, &hcicmd->ac_qcmd, &header, DESC_PKT_HDRLEN_AT_LOCK, datap, size, result); if (status != DDI_SUCCESS) { - TNF_PROBE_0(hci1394_async_lock_q_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_async_lock_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } - TNF_PROBE_0_DEBUG(hci1394_async_lock_exit, HCI1394_TNF_HAL_STACK, ""); - return (DDI_SUCCESS); } @@ -2812,9 +2382,6 @@ hci1394_async_write_response(hci1394_async_handle_t async_handle, ASSERT(cmd_priv != NULL); ASSERT(result != NULL); - TNF_PROBE_0_DEBUG(hci1394_async_write_response_enter, - HCI1394_TNF_HAL_STACK, ""); - /* * make sure this call is during the current bus generation (i.e. no * bus resets have occured since this request was made. @@ -2822,8 +2389,6 @@ hci1394_async_write_response(hci1394_async_handle_t async_handle, if (cmd_priv->bus_generation != hci1394_ohci_current_busgen( async_handle->as_ohci)) { *result = H1394_STATUS_INVALID_BUSGEN; - TNF_PROBE_0_DEBUG(hci1394_async_write_response_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -2855,16 +2420,9 @@ hci1394_async_write_response(hci1394_async_handle_t async_handle, status = hci1394_q_at(async_handle->as_atresp_q, &hcicmd->ac_qcmd, &header, DESC_PKT_HDRLEN_AT_WRITE_RESP, result); if (status != DDI_SUCCESS) { - TNF_PROBE_0(hci1394_async_write_response_q_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_async_write_response_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } - TNF_PROBE_0_DEBUG(hci1394_async_write_response_exit, - HCI1394_TNF_HAL_STACK, ""); - return (DDI_SUCCESS); } @@ -2889,9 +2447,6 @@ hci1394_async_read_response(hci1394_async_handle_t async_handle, ASSERT(cmd_priv != NULL); ASSERT(result != NULL); - TNF_PROBE_0_DEBUG(hci1394_async_read_response_enter, - HCI1394_TNF_HAL_STACK, ""); - /* * make sure this call is during the current bus generation (i.e. no * bus resets have occured since this request was made. @@ -2899,8 +2454,6 @@ hci1394_async_read_response(hci1394_async_handle_t async_handle, if (cmd_priv->bus_generation != hci1394_ohci_current_busgen( async_handle->as_ohci)) { *result = H1394_STATUS_INVALID_BUSGEN; - TNF_PROBE_0_DEBUG(hci1394_async_read_response_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -2950,10 +2503,6 @@ hci1394_async_read_response(hci1394_async_handle_t async_handle, &hcicmd->ac_qcmd, &header, DESC_PKT_HDRLEN_AT_READQUAD_RESP, result); if (status != DDI_SUCCESS) { - TNF_PROBE_0(hci1394_async_read_response_q_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_async_read_response_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -2978,10 +2527,6 @@ hci1394_async_read_response(hci1394_async_handle_t async_handle, &hcicmd->ac_qcmd, &header, DESC_PKT_HDRLEN_AT_READBLOCK_RESP, result); if (status != DDI_SUCCESS) { - TNF_PROBE_0(hci1394_async_read_response_qbf_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_async_read_response_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -3005,17 +2550,10 @@ hci1394_async_read_response(hci1394_async_handle_t async_handle, &hcicmd->ac_qcmd, &header, DESC_PKT_HDRLEN_AT_READBLOCK_RESP, &cmd_priv->mblk, result); if (status != DDI_SUCCESS) { - TNF_PROBE_0(hci1394_async_read_response_qb_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_async_read_response_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } } - TNF_PROBE_0_DEBUG(hci1394_async_read_response_exit, - HCI1394_TNF_HAL_STACK, ""); - return (DDI_SUCCESS); } @@ -3044,9 +2582,6 @@ hci1394_async_lock_response(hci1394_async_handle_t async_handle, ASSERT(cmd_priv != NULL); ASSERT(result != NULL); - TNF_PROBE_0_DEBUG(hci1394_async_lock_response_enter, - HCI1394_TNF_HAL_STACK, ""); - /* * make sure this call is during the current bus generation (i.e. no * bus resets have occured since this request was made. @@ -3054,8 +2589,6 @@ hci1394_async_lock_response(hci1394_async_handle_t async_handle, if (cmd_priv->bus_generation != hci1394_ohci_current_busgen( async_handle->as_ohci)) { *result = H1394_STATUS_INVALID_BUSGEN; - TNF_PROBE_0_DEBUG(hci1394_async_lock_response_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -3106,14 +2639,8 @@ hci1394_async_lock_response(hci1394_async_handle_t async_handle, &hcicmd->ac_qcmd, &header, DESC_PKT_HDRLEN_AT_LOCK_RESP, result); if (status != DDI_SUCCESS) { - TNF_PROBE_0(hci1394_q_alloc_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_async_lock_response_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } - TNF_PROBE_0_DEBUG(hci1394_async_lock_response_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_SUCCESS); } @@ -3141,9 +2668,6 @@ hci1394_async_lock_response(hci1394_async_handle_t async_handle, datap = (uint8_t *)&data64; } else { *result = H1394_STATUS_INTERNAL_ERROR; - TNF_PROBE_0(hci1394_lock_type_fail, HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_async_lock_response_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -3155,15 +2679,9 @@ hci1394_async_lock_response(hci1394_async_handle_t async_handle, &hcicmd->ac_qcmd, &header, DESC_PKT_HDRLEN_AT_LOCK_RESP, datap, size, result); if (status != DDI_SUCCESS) { - TNF_PROBE_0(hci1394_q_alloc_fail, HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_async_lock_response_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } - TNF_PROBE_0_DEBUG(hci1394_async_lock_response_exit, - HCI1394_TNF_HAL_STACK, ""); - return (DDI_SUCCESS); } @@ -3190,9 +2708,6 @@ hci1394_async_response_complete(hci1394_async_handle_t async_handle, ASSERT(cmd != NULL); ASSERT(cmd_priv != NULL); - TNF_PROBE_0_DEBUG(hci1394_async_response_complete_enter, - HCI1394_TNF_HAL_STACK, ""); - hcicmd = (hci1394_async_cmd_t *)cmd_priv->hal_overhead; /* If we allocated an mblk for this command */ @@ -3209,9 +2724,6 @@ hci1394_async_response_complete(hci1394_async_handle_t async_handle, /* free up the 1394 framework command */ (void) h1394_free_cmd((void *)async_handle->as_drvinfo->di_sl_private, &cmd); - - TNF_PROBE_0_DEBUG(hci1394_async_response_complete_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -3236,8 +2748,6 @@ hci1394_async_pending_timeout(hci1394_tlist_node_t *node, void *arg) async_handle = (hci1394_async_handle_t)arg; ASSERT(async_handle != NULL); ASSERT(node != NULL); - TNF_PROBE_0_DEBUG(hci1394_async_pending_timeout_enter, - HCI1394_TNF_HAL_STACK, ""); hcicmd = (hci1394_async_cmd_t *)node->tln_addr; @@ -3264,9 +2774,6 @@ hci1394_async_pending_timeout(hci1394_tlist_node_t *node, void *arg) /* Tell the Services Layer that the command has timed out */ h1394_cmd_is_complete(async_handle->as_drvinfo->di_sl_private, hcicmd->ac_cmd, H1394_AT_REQ, H1394_CMD_ETIMEOUT); - - TNF_PROBE_0_DEBUG(hci1394_async_pending_timeout_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -3287,10 +2794,6 @@ hci1394_async_timeout_calc(hci1394_async_handle_t async_handle, uint_t carry; uint_t z; - - TNF_PROBE_0_DEBUG(hci1394_async_timeout_calc_enter, - HCI1394_TNF_HAL_STACK, ""); - /* Get the current split timeout */ split_timeout = hci1394_csr_split_timeout_get(async_handle->as_csr); @@ -3330,9 +2833,6 @@ hci1394_async_timeout_calc(hci1394_async_handle_t async_handle, OHCI_CYCLE_SEC_MASK) + (carry << OHCI_CYCLE_SEC_SHIFT) + temp; z = z & OHCI_TIMESTAMP_MASK; - TNF_PROBE_0_DEBUG(hci1394_async_timeout_calc_exit, - HCI1394_TNF_HAL_STACK, ""); - return (z); } @@ -3353,9 +2853,6 @@ hci1394_async_arresp_size_get(uint_t tcode, hci1394_q_handle_t q_handle, ASSERT(addr != NULL); ASSERT(size != NULL); - TNF_PROBE_0_DEBUG(hci1394_get_arresp_size_enter, - HCI1394_TNF_HAL_STACK, ""); - if (tcode == IEEE1394_TCODE_WRITE_RESP) { *size = DESC_PKT_HDRLEN_AT_WRITE_RESP + IEEE1394_QUADLET; } else if (tcode == IEEE1394_TCODE_READ_QUADLET_RESP) { @@ -3381,17 +2878,9 @@ hci1394_async_arresp_size_get(uint_t tcode, hci1394_q_handle_t q_handle, *size = DESC_PKT_HDRLEN_AT_LOCK_RESP + HCI1394_ALIGN_QUAD(data_length) + IEEE1394_QUADLET; } else { - TNF_PROBE_1(hci1394_async_arresp_size_tcode_err, - HCI1394_TNF_HAL_ERROR, - "unknown ARRESP received", tnf_uint, arresp_tcode, tcode); - TNF_PROBE_0_DEBUG(hci1394_get_arresp_size_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } - TNF_PROBE_0_DEBUG(hci1394_get_arresp_size_exit, - HCI1394_TNF_HAL_STACK, ""); - return (DDI_SUCCESS); } @@ -3413,9 +2902,6 @@ hci1394_async_pending_list_flush(hci1394_async_handle_t async_handle) ASSERT(async_handle != NULL); - TNF_PROBE_0_DEBUG(hci1394_async_pending_list_flush_enter, - HCI1394_TNF_HAL_STACK, ""); - do { /* * get the first node on the pending list. This routine also @@ -3437,9 +2923,6 @@ hci1394_async_pending_list_flush(hci1394_async_handle_t async_handle) H1394_CMD_EBUSRESET); } } while (node != NULL); - - TNF_PROBE_0_DEBUG(hci1394_async_pending_list_flush_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -3454,12 +2937,8 @@ hci1394_async_atreq_start(void *async, uint32_t command_ptr) { hci1394_async_handle_t async_handle; ASSERT(async != NULL); - TNF_PROBE_0_DEBUG(hci1394_async_atreq_start_enter, - HCI1394_TNF_HAL_STACK, ""); async_handle = (hci1394_async_handle_t)async; hci1394_ohci_atreq_start(async_handle->as_ohci, command_ptr); - TNF_PROBE_0_DEBUG(hci1394_async_atreq_start_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -3473,12 +2952,8 @@ hci1394_async_atreq_wake(void *async) { hci1394_async_handle_t async_handle; ASSERT(async != NULL); - TNF_PROBE_0_DEBUG(hci1394_async_atreq_wake_enter, - HCI1394_TNF_HAL_STACK, ""); async_handle = (hci1394_async_handle_t)async; hci1394_ohci_atreq_wake(async_handle->as_ohci); - TNF_PROBE_0_DEBUG(hci1394_async_atreq_wake_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -3493,12 +2968,8 @@ void hci1394_async_atreq_reset(hci1394_async_handle_t async_handle) { ASSERT(async_handle != NULL); - TNF_PROBE_0_DEBUG(hci1394_async_atreq_reset_enter, - HCI1394_TNF_HAL_STACK, ""); hci1394_ohci_atreq_stop(async_handle->as_ohci); hci1394_q_stop(async_handle->as_atreq_q); - TNF_PROBE_0_DEBUG(hci1394_async_atreq_reset_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -3511,13 +2982,9 @@ static void hci1394_async_atreq_flush(hci1394_async_handle_t async_handle) { boolean_t request_available; - int status; ASSERT(async_handle != NULL); - TNF_PROBE_0_DEBUG(hci1394_async_atreq_flush_enter, - HCI1394_TNF_HAL_STACK, ""); - /* Clear reqTxComplete interrupt */ hci1394_ohci_intr_clear(async_handle->as_ohci, OHCI_INTR_REQ_TX_CMPLT); @@ -3529,16 +2996,9 @@ hci1394_async_atreq_flush(hci1394_async_handle_t async_handle) */ do { /* Flush the atreq Q. Process all Q'd commands */ - status = hci1394_async_atreq_process(async_handle, + (void) hci1394_async_atreq_process(async_handle, B_TRUE, &request_available); - if (status != DDI_SUCCESS) { - TNF_PROBE_0(hci1394_async_atreq_process_fail, - HCI1394_TNF_HAL_ERROR, ""); - } } while (request_available == B_TRUE); - - TNF_PROBE_0_DEBUG(hci1394_async_atreq_flush_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -3553,12 +3013,8 @@ hci1394_async_arresp_start(void *async, uint32_t command_ptr) { hci1394_async_handle_t async_handle; ASSERT(async != NULL); - TNF_PROBE_0_DEBUG(hci1394_async_arresp_start_enter, - HCI1394_TNF_HAL_STACK, ""); async_handle = (hci1394_async_handle_t)async; hci1394_ohci_arresp_start(async_handle->as_ohci, command_ptr); - TNF_PROBE_0_DEBUG(hci1394_async_arresp_start_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -3572,12 +3028,8 @@ hci1394_async_arresp_wake(void *async) { hci1394_async_handle_t async_handle; ASSERT(async != NULL); - TNF_PROBE_0_DEBUG(hci1394_async_arresp_wake_enter, - HCI1394_TNF_HAL_STACK, ""); async_handle = (hci1394_async_handle_t)async; hci1394_ohci_arresp_wake(async_handle->as_ohci); - TNF_PROBE_0_DEBUG(hci1394_async_arresp_wake_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -3593,29 +3045,17 @@ static void hci1394_async_arresp_flush(hci1394_async_handle_t async_handle) { boolean_t response_available; - int status; - ASSERT(async_handle != NULL); - TNF_PROBE_0_DEBUG(hci1394_async_arresp_flush_enter, - HCI1394_TNF_HAL_STACK, ""); - /* Clear reqTxComplete interrupt */ hci1394_ohci_intr_clear(async_handle->as_ohci, OHCI_INTR_RSPKT); do { /* Flush the arresp Q. Process all received commands */ - status = hci1394_async_arresp_process(async_handle, + (void) hci1394_async_arresp_process(async_handle, &response_available); - if (status != DDI_SUCCESS) { - TNF_PROBE_0(hci1394_async_arresp_process_fail, - HCI1394_TNF_HAL_ERROR, ""); - } } while (response_available == B_TRUE); - - TNF_PROBE_0_DEBUG(hci1394_async_arresp_flush_enter, - HCI1394_TNF_HAL_STACK, ""); } @@ -3630,12 +3070,8 @@ hci1394_async_arreq_start(void *async, uint32_t command_ptr) { hci1394_async_handle_t async_handle; ASSERT(async != NULL); - TNF_PROBE_0_DEBUG(hci1394_async_arreq_start_enter, - HCI1394_TNF_HAL_STACK, ""); async_handle = (hci1394_async_handle_t)async; hci1394_ohci_arreq_start(async_handle->as_ohci, command_ptr); - TNF_PROBE_0_DEBUG(hci1394_async_arreq_start_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -3649,12 +3085,8 @@ hci1394_async_arreq_wake(void *async) { hci1394_async_handle_t async_handle; ASSERT(async != NULL); - TNF_PROBE_0_DEBUG(hci1394_async_arreq_wake_enter, - HCI1394_TNF_HAL_STACK, ""); async_handle = (hci1394_async_handle_t)async; hci1394_ohci_arreq_wake(async_handle->as_ohci); - TNF_PROBE_0_DEBUG(hci1394_async_arreq_wake_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -3668,12 +3100,8 @@ static void hci1394_async_arreq_flush(hci1394_async_handle_t async_handle) { boolean_t request_available; - int status; - ASSERT(async_handle != NULL); - TNF_PROBE_0_DEBUG(hci1394_async_arreq_flush_enter, - HCI1394_TNF_HAL_STACK, ""); /* * If the last bus reset token we have seen in @@ -3685,8 +3113,6 @@ hci1394_async_arreq_flush(hci1394_async_handle_t async_handle) */ if (async_handle->as_phy_reset == hci1394_ohci_current_busgen( async_handle->as_ohci)) { - TNF_PROBE_0_DEBUG(hci1394_async_arreq_flush_exit, - HCI1394_TNF_HAL_STACK, ""); return; } @@ -3703,12 +3129,8 @@ hci1394_async_arreq_flush(hci1394_async_handle_t async_handle) * correct bus reset token. */ do { - status = hci1394_async_arreq_process(async_handle, + (void) hci1394_async_arreq_process(async_handle, &request_available); - if (status != DDI_SUCCESS) { - TNF_PROBE_0(hci1394_isr_arreq_pr_fail, - HCI1394_TNF_HAL_ERROR, ""); - } } while ((request_available == B_TRUE) && (async_handle->as_flushing_arreq == B_TRUE)); @@ -3723,9 +3145,6 @@ hci1394_async_arreq_flush(hci1394_async_handle_t async_handle) if (request_available == B_FALSE) { hci1394_ohci_intr_clear(async_handle->as_ohci, OHCI_INTR_RQPKT); } - - TNF_PROBE_0_DEBUG(hci1394_async_arreq_flush_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -3740,12 +3159,8 @@ hci1394_async_atresp_start(void *async, uint32_t command_ptr) { hci1394_async_handle_t async_handle; ASSERT(async != NULL); - TNF_PROBE_0_DEBUG(hci1394_async_atresp_start_enter, - HCI1394_TNF_HAL_STACK, ""); async_handle = (hci1394_async_handle_t)async; hci1394_ohci_atresp_start(async_handle->as_ohci, command_ptr); - TNF_PROBE_0_DEBUG(hci1394_async_atresp_start_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -3759,12 +3174,8 @@ hci1394_async_atresp_wake(void *async) { hci1394_async_handle_t async_handle; ASSERT(async != NULL); - TNF_PROBE_0_DEBUG(hci1394_async_atresp_wake_enter, - HCI1394_TNF_HAL_STACK, ""); async_handle = (hci1394_async_handle_t)async; hci1394_ohci_atresp_wake(async_handle->as_ohci); - TNF_PROBE_0_DEBUG(hci1394_async_atresp_wake_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -3779,12 +3190,8 @@ void hci1394_async_atresp_reset(hci1394_async_handle_t async_handle) { ASSERT(async_handle != NULL); - TNF_PROBE_0_DEBUG(hci1394_async_atresp_reset_enter, - HCI1394_TNF_HAL_STACK, ""); hci1394_ohci_atresp_stop(async_handle->as_ohci); hci1394_q_stop(async_handle->as_atresp_q); - TNF_PROBE_0_DEBUG(hci1394_async_atresp_reset_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -3798,29 +3205,18 @@ static void hci1394_async_atresp_flush(hci1394_async_handle_t async_handle) { boolean_t response_available; - int status; ASSERT(async_handle != NULL); - TNF_PROBE_0_DEBUG(hci1394_async_atresp_flush_enter, - HCI1394_TNF_HAL_STACK, ""); - /* Clear respTxComplete interrupt */ hci1394_ohci_intr_clear(async_handle->as_ohci, OHCI_INTR_RESP_TX_CMPLT); /* Processes all AT responses */ do { /* Flush the atresp Q. Process all Q'd commands */ - status = hci1394_async_atresp_process(async_handle, + (void) hci1394_async_atresp_process(async_handle, B_TRUE, &response_available); - if (status != DDI_SUCCESS) { - TNF_PROBE_0(hci1394_async_atresp_process_fail, - HCI1394_TNF_HAL_ERROR, ""); - } } while (response_available == B_TRUE); - - TNF_PROBE_0_DEBUG(hci1394_async_atresp_flush_exit, - HCI1394_TNF_HAL_STACK, ""); } /* diff --git a/usr/src/uts/common/io/1394/adapters/hci1394_attach.c b/usr/src/uts/common/io/1394/adapters/hci1394_attach.c index 64726a2498..061253cd98 100644 --- a/usr/src/uts/common/io/1394/adapters/hci1394_attach.c +++ b/usr/src/uts/common/io/1394/adapters/hci1394_attach.c @@ -85,29 +85,16 @@ hci1394_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) int instance; int status; - - TNF_PROBE_0_DEBUG(hci1394_attach_enter, HCI1394_TNF_HAL_STACK, ""); - switch (cmd) { case DDI_ATTACH: instance = ddi_get_instance(dip); status = ddi_soft_state_zalloc(hci1394_statep, instance); if (status != DDI_SUCCESS) { - TNF_PROBE_1(hci1394_attach_ssz_fail, - HCI1394_TNF_HAL_ERROR, "", tnf_string, errmsg, - "ddi_soft_state_zalloc() failed"); - TNF_PROBE_0_DEBUG(hci1394_attach_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } soft_state = ddi_get_soft_state(hci1394_statep, instance); if (soft_state == NULL) { ddi_soft_state_free(hci1394_statep, instance); - TNF_PROBE_1(hci1394_attach_gss_fail, - HCI1394_TNF_HAL_ERROR, "", tnf_string, errmsg, - "ddi_get_soft_state() failed"); - TNF_PROBE_0_DEBUG(hci1394_attach_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } hci1394_statebit_set(&attach_state, STATE_ZALLOC); @@ -118,10 +105,6 @@ hci1394_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) status = hci1394_isr_init(soft_state); if (status != DDI_SUCCESS) { hci1394_cleanup(soft_state, attach_state); - TNF_PROBE_0(hci1394_attach_isr_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_attach_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } hci1394_statebit_set(&attach_state, STATE_ISR_INIT); @@ -130,10 +113,6 @@ hci1394_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) instance, DDI_NT_NEXUS, 0); if (status != DDI_SUCCESS) { hci1394_cleanup(soft_state, attach_state); - TNF_PROBE_0(hci1394_attach_cmn_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_attach_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } hci1394_statebit_set(&attach_state, STATE_MINOR_NODE); @@ -141,10 +120,6 @@ hci1394_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) status = hci1394_hardware_init(soft_state); if (status != DDI_SUCCESS) { hci1394_cleanup(soft_state, attach_state); - TNF_PROBE_0(hci1394_attach_hwi_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_attach_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } hci1394_statebit_set(&attach_state, STATE_HW_INIT); @@ -156,10 +131,6 @@ hci1394_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) status = hci1394_resmap_get(soft_state); if (status != DDI_SUCCESS) { hci1394_cleanup(soft_state, attach_state); - TNF_PROBE_0(hci1394_attach_rmg_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_attach_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -169,10 +140,6 @@ hci1394_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) if (status != DDI_SUCCESS) { hci1394_resmap_free(soft_state); hci1394_cleanup(soft_state, attach_state); - TNF_PROBE_0(hci1394_attach_ha_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_attach_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } /* free the reserved addresses map */ @@ -182,10 +149,6 @@ hci1394_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) status = hci1394_isr_handler_init(soft_state); if (status != DDI_SUCCESS) { hci1394_cleanup(soft_state, attach_state); - TNF_PROBE_0(hci1394_attach_ih_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_attach_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } hci1394_statebit_set(&attach_state, STATE_ISR_HANDLER); @@ -203,14 +166,8 @@ hci1394_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) status = hci1394_ohci_startup(soft_state->ohci); if (status != DDI_SUCCESS) { hci1394_cleanup(soft_state, attach_state); - TNF_PROBE_0(hci1394_attach_str_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_attach_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } - TNF_PROBE_0_DEBUG(hci1394_attach_exit, HCI1394_TNF_HAL_STACK, - ""); return (DDI_SUCCESS); @@ -218,21 +175,11 @@ hci1394_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) instance = ddi_get_instance(dip); soft_state = ddi_get_soft_state(hci1394_statep, instance); if (soft_state == NULL) { - TNF_PROBE_1(hci1394_attach_resgss_fail, - HCI1394_TNF_HAL_ERROR, "", tnf_string, errmsg, - "ddi_get_soft_state() failed"); - TNF_PROBE_0_DEBUG(hci1394_attach_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } status = hci1394_hardware_resume(soft_state); if (status != DDI_SUCCESS) { - TNF_PROBE_1(hci1394_attach_res_hwr_fail, - HCI1394_TNF_HAL_ERROR, "", tnf_string, errmsg, - "hardware failed to resume"); - TNF_PROBE_0_DEBUG(hci1394_attach_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -245,11 +192,6 @@ hci1394_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) /* turn on the link, enable interrupts, reset the bus */ status = hci1394_ohci_startup(soft_state->ohci); if (status != DDI_SUCCESS) { - TNF_PROBE_1(hci1394_attach_res_str_fail, - HCI1394_TNF_HAL_ERROR, "", tnf_string, errmsg, - "hci1394_ohci_startup() failed"); - TNF_PROBE_0_DEBUG(hci1394_attach_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -257,25 +199,15 @@ hci1394_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) status = h1394_attach(&soft_state->halinfo, DDI_RESUME, &soft_state->drvinfo.di_sl_private); if (status != DDI_SUCCESS) { - TNF_PROBE_0(hci1394_attach_res_ha_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_attach_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } - TNF_PROBE_0_DEBUG(hci1394_attach_exit, HCI1394_TNF_HAL_STACK, - ""); return (DDI_SUCCESS); default: - TNF_PROBE_0(h1394_attach_default_fail, HCI1394_TNF_HAL_ERROR, - ""); break; } - TNF_PROBE_0_DEBUG(hci1394_attach_exit, HCI1394_TNF_HAL_STACK, ""); - return (DDI_FAILURE); } @@ -292,8 +224,6 @@ hci1394_soft_state_phase1_init(hci1394_state_t *soft_state, dev_info_t *dip, int instance) { ASSERT(soft_state != NULL); - TNF_PROBE_0_DEBUG(hci1394_soft_state_phase1_init_enter, - HCI1394_TNF_HAL_STACK, ""); soft_state->drvinfo.di_dip = dip; soft_state->drvinfo.di_instance = instance; @@ -323,9 +253,6 @@ hci1394_soft_state_phase1_init(hci1394_state_t *soft_state, dev_info_t *dip, soft_state->halinfo.addr_map_num_entries = HCI1394_ADDR_MAP_SIZE; soft_state->halinfo.addr_map = hci1394_addr_map; hci1394_buf_attr_get(&soft_state->halinfo.dma_attr); - - TNF_PROBE_0_DEBUG(hci1394_soft_state_phase1_init_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -338,8 +265,6 @@ static void hci1394_soft_state_phase2_init(hci1394_state_t *soft_state) { ASSERT(soft_state != NULL); - TNF_PROBE_0_DEBUG(hci1394_soft_state_phase2_init_enter, - HCI1394_TNF_HAL_STACK, ""); /* * Setup our initial driver state. This requires the HW iblock @@ -388,9 +313,6 @@ hci1394_soft_state_phase2_init(hci1394_state_t *soft_state) * called hardware_init(). Therefore, this must be in phase2_init(). */ soft_state->halinfo.hal_overhead = hci1394_async_cmd_overhead(); - - TNF_PROBE_0_DEBUG(hci1394_soft_state_phase2_init_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -406,16 +328,10 @@ hci1394_hardware_init(hci1394_state_t *soft_state) ASSERT(soft_state != NULL); - TNF_PROBE_0_DEBUG(hci1394_hardware_init_enter, HCI1394_TNF_HAL_STACK, - ""); /* Initialize PCI config registers */ status = hci1394_pci_init(soft_state); if (status != DDI_SUCCESS) { - TNF_PROBE_0(hci1394_hardware_init_pci_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_hardware_init_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -424,10 +340,6 @@ hci1394_hardware_init(hci1394_state_t *soft_state) &soft_state->ohci); if (status != DDI_SUCCESS) { hci1394_pci_fini(soft_state); - TNF_PROBE_0(hci1394_hardware_init_ohci_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_hardware_init_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -442,10 +354,6 @@ hci1394_hardware_init(hci1394_state_t *soft_state) hci1394_csr_fini(&soft_state->csr); hci1394_ohci_fini(&soft_state->ohci); hci1394_pci_fini(soft_state); - TNF_PROBE_0(hci1394_hardware_init_asyn_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_hardware_init_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -462,16 +370,9 @@ hci1394_hardware_init(hci1394_state_t *soft_state) hci1394_csr_fini(&soft_state->csr); hci1394_ohci_fini(&soft_state->ohci); hci1394_pci_fini(soft_state); - TNF_PROBE_0(hci1394_hardware_init_vend_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_hardware_init_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } - TNF_PROBE_0_DEBUG(hci1394_hardware_init_exit, - HCI1394_TNF_HAL_STACK, ""); - return (DDI_SUCCESS); } @@ -489,8 +390,6 @@ hci1394_hardware_resume(hci1394_state_t *soft_state) ASSERT(soft_state != NULL); - TNF_PROBE_0_DEBUG(hci1394_hardware_resume_enter, HCI1394_TNF_HAL_STACK, - ""); /* re-enable global byte swap (if we using it) */ hci1394_pci_resume(soft_state); @@ -498,10 +397,6 @@ hci1394_hardware_resume(hci1394_state_t *soft_state) /* Re-init the OpenHCI HW */ status = hci1394_ohci_resume(soft_state->ohci); if (status != DDI_SUCCESS) { - TNF_PROBE_0(hci1394_hardware_resume_ohci_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_hardware_resume_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -511,26 +406,15 @@ hci1394_hardware_resume(hci1394_state_t *soft_state) /* Re-setup the Async Q's */ status = hci1394_async_resume(soft_state->async); if (status != DDI_SUCCESS) { - TNF_PROBE_0(hci1394_hardware_resume_asyn_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_hardware_resume_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } /* Re-setup any Vendor Specific Registers */ status = hci1394_vendor_resume(soft_state->vendor); if (status != DDI_SUCCESS) { - TNF_PROBE_0(hci1394_hardware_resume_vend_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_hardware_resume_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } - TNF_PROBE_0_DEBUG(hci1394_hardware_resume_exit, - HCI1394_TNF_HAL_STACK, ""); - return (DDI_SUCCESS); } @@ -549,16 +433,11 @@ hci1394_pci_init(hci1394_state_t *soft_state) ASSERT(soft_state != NULL); - TNF_PROBE_0_DEBUG(hci1394_pci_init_enter, HCI1394_TNF_HAL_STACK, ""); /* Setup PCI configuration space */ status = pci_config_setup(soft_state->drvinfo.di_dip, &soft_state->pci_config); if (status != DDI_SUCCESS) { - TNF_PROBE_0(hci1394_pci_init_cfg_fail, HCI1394_TNF_HAL_ERROR, - ""); - TNF_PROBE_0_DEBUG(hci1394_pci_init_exit, HCI1394_TNF_HAL_STACK, - ""); return (DDI_FAILURE); } @@ -597,8 +476,6 @@ hci1394_pci_init(hci1394_state_t *soft_state) /* If PCI_Global_Swap bit is not set, it is unsupported */ if ((global_swap & OHCI_PCI_GLOBAL_SWAP) == 0) { - TNF_PROBE_0_DEBUG(hci1394_pci_gbs_npresent, - HCI1394_TNF_HAL_INFO, "global swap not present"); soft_state->drvinfo.di_reg_attr.devacc_attr_version = DDI_DEVICE_ATTR_V0; soft_state->drvinfo.di_reg_attr.devacc_attr_endian_flags = @@ -617,8 +494,6 @@ hci1394_pci_init(hci1394_state_t *soft_state) * for almost all of the adapters. */ } else { - TNF_PROBE_0_DEBUG(hci1394_pci_gbs_present, - HCI1394_TNF_HAL_INFO, "global swap present"); soft_state->drvinfo.di_reg_attr.devacc_attr_version = DDI_DEVICE_ATTR_V0; soft_state->drvinfo.di_reg_attr.devacc_attr_endian_flags = @@ -644,8 +519,6 @@ hci1394_pci_init(hci1394_state_t *soft_state) soft_state->vendor_info.revision_id = (uint_t)pci_config_get8(soft_state->pci_config, PCI_CONF_REVID); - TNF_PROBE_0_DEBUG(hci1394_pci_init_exit, HCI1394_TNF_HAL_STACK, ""); - return (DDI_SUCCESS); } @@ -664,7 +537,6 @@ hci1394_pci_resume(hci1394_state_t *soft_state) ASSERT(soft_state != NULL); - TNF_PROBE_0_DEBUG(hci1394_pci_resume_enter, HCI1394_TNF_HAL_STACK, ""); #ifdef _LITTLE_ENDIAN /* Start of little endian specific code */ @@ -683,7 +555,6 @@ hci1394_pci_resume(hci1394_state_t *soft_state) } /* End of big endian specific code */ #endif - TNF_PROBE_0_DEBUG(hci1394_pci_resume_exit, HCI1394_TNF_HAL_STACK, ""); } @@ -709,7 +580,6 @@ hci1394_resmap_get(hci1394_state_t *soft_state) ASSERT(soft_state != NULL); - TNF_PROBE_0_DEBUG(hci1394_resmap_get_enter, HCI1394_TNF_HAL_STACK, ""); /* * See if the "reserved-addresses" property is defined. The format @@ -729,8 +599,6 @@ hci1394_resmap_get(hci1394_state_t *soft_state) /* the property is not defined, 0 reserved addresses */ soft_state->halinfo.resv_map_num_entries = 0; soft_state->halinfo.resv_map = NULL; - TNF_PROBE_0_DEBUG(hci1394_resmap_get_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_SUCCESS); } else if ((reslen < 3) || ((reslen % 3) != 0)) { /* @@ -775,8 +643,6 @@ hci1394_resmap_get(hci1394_state_t *soft_state) soft_state->halinfo.resv_map_num_entries = resv_num; soft_state->halinfo.resv_map = resv_map; - TNF_PROBE_0_DEBUG(hci1394_resmap_get_exit, HCI1394_TNF_HAL_STACK, ""); - return (DDI_SUCCESS); } @@ -792,7 +658,6 @@ static void hci1394_resmap_free(hci1394_state_t *soft_state) { ASSERT(soft_state != NULL); - TNF_PROBE_0_DEBUG(hci1394_resmap_free_enter, HCI1394_TNF_HAL_STACK, ""); /* * if we have one or more reserved map entries, free up the space that @@ -804,8 +669,6 @@ hci1394_resmap_free(hci1394_state_t *soft_state) (sizeof (h1394_addr_map_t) * soft_state->halinfo.resv_map_num_entries)); } - - TNF_PROBE_0_DEBUG(hci1394_resmap_free_exit, HCI1394_TNF_HAL_STACK, ""); } @@ -855,8 +718,6 @@ hci1394_cleanup(hci1394_state_t *soft_state, uint64_t attach_state) ASSERT(soft_state != NULL); - TNF_PROBE_0_DEBUG(hci1394_cleanup_enter, HCI1394_TNF_HAL_STACK, ""); - status = hci1394_statebit_tst(attach_state, STATE_STARTUP); if (status == B_TRUE) { @@ -910,6 +771,4 @@ hci1394_cleanup(hci1394_state_t *soft_state, uint64_t attach_state) ddi_soft_state_free(hci1394_statep, soft_state->drvinfo.di_instance); } - - TNF_PROBE_0_DEBUG(hci1394_cleanup_exit, HCI1394_TNF_HAL_STACK, ""); } diff --git a/usr/src/uts/common/io/1394/adapters/hci1394_buf.c b/usr/src/uts/common/io/1394/adapters/hci1394_buf.c index 40db81791f..b9cdc2fc03 100644 --- a/usr/src/uts/common/io/1394/adapters/hci1394_buf.c +++ b/usr/src/uts/common/io/1394/adapters/hci1394_buf.c @@ -92,7 +92,6 @@ hci1394_buf_alloc(hci1394_drvinfo_t *drvinfo, hci1394_buf_parms_t *parms, ASSERT(parms != NULL); ASSERT(info != NULL); ASSERT(handle != NULL); - TNF_PROBE_0_DEBUG(hci1394_buf_alloc_enter, HCI1394_TNF_HAL_STACK, ""); /* alloc the space to keep track of the buffer */ buf = kmem_alloc(sizeof (hci1394_buf_t), KM_SLEEP); @@ -114,10 +113,6 @@ hci1394_buf_alloc(hci1394_drvinfo_t *drvinfo, hci1394_buf_parms_t *parms, DDI_DMA_SLEEP, NULL, &buf->bu_dma_handle); if (status != DDI_SUCCESS) { kmem_free(buf, sizeof (hci1394_buf_t)); - TNF_PROBE_0(hci1394_buf_alloc_dah_fail, HCI1394_TNF_HAL_ERROR, - ""); - TNF_PROBE_0_DEBUG(hci1394_buf_alloc_exit, HCI1394_TNF_HAL_STACK, - ""); return (DDI_FAILURE); } @@ -127,10 +122,6 @@ hci1394_buf_alloc(hci1394_drvinfo_t *drvinfo, hci1394_buf_parms_t *parms, if (status != DDI_SUCCESS) { ddi_dma_free_handle(&buf->bu_dma_handle); kmem_free(buf, sizeof (hci1394_buf_t)); - TNF_PROBE_0(hci1394_buf_alloc_dam_fail, HCI1394_TNF_HAL_ERROR, - ""); - TNF_PROBE_0_DEBUG(hci1394_buf_alloc_exit, HCI1394_TNF_HAL_STACK, - ""); return (DDI_FAILURE); } @@ -142,10 +133,6 @@ hci1394_buf_alloc(hci1394_drvinfo_t *drvinfo, hci1394_buf_parms_t *parms, ddi_dma_mem_free(&buf->bu_handle); ddi_dma_free_handle(&buf->bu_dma_handle); kmem_free(buf, sizeof (hci1394_buf_t)); - TNF_PROBE_0(hci1394_buf_alloc_dbh_fail, HCI1394_TNF_HAL_ERROR, - ""); - TNF_PROBE_0_DEBUG(hci1394_buf_alloc_exit, HCI1394_TNF_HAL_STACK, - ""); return (DDI_FAILURE); } @@ -154,8 +141,6 @@ hci1394_buf_alloc(hci1394_drvinfo_t *drvinfo, hci1394_buf_parms_t *parms, info->bi_dma_handle = buf->bu_dma_handle; info->bi_length = parms->bp_length; - TNF_PROBE_0_DEBUG(hci1394_buf_alloc_exit, HCI1394_TNF_HAL_STACK, ""); - return (DDI_SUCCESS); } @@ -171,7 +156,6 @@ hci1394_buf_free(hci1394_buf_handle_t *handle) hci1394_buf_t *buf; ASSERT(handle != NULL); - TNF_PROBE_0_DEBUG(hci1394_buf_free_enter, HCI1394_TNF_HAL_STACK, ""); buf = *handle; (void) ddi_dma_unbind_handle(buf->bu_dma_handle); @@ -183,6 +167,4 @@ hci1394_buf_free(hci1394_buf_handle_t *handle) /* set the handle to NULL to help catch bugs */ *handle = NULL; - - TNF_PROBE_0_DEBUG(hci1394_buf_free_exit, HCI1394_TNF_HAL_STACK, ""); } diff --git a/usr/src/uts/common/io/1394/adapters/hci1394_csr.c b/usr/src/uts/common/io/1394/adapters/hci1394_csr.c index 0bbc70f98a..0ca3a46f48 100644 --- a/usr/src/uts/common/io/1394/adapters/hci1394_csr.c +++ b/usr/src/uts/common/io/1394/adapters/hci1394_csr.c @@ -24,8 +24,6 @@ * All rights reserved. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * hci1394_csr.c * This code contains the code for the CSR registers handled by the HAL in @@ -108,7 +106,6 @@ hci1394_csr_init(hci1394_drvinfo_t *drvinfo, hci1394_ohci_handle_t ohci, ASSERT(drvinfo != NULL); ASSERT(ohci != NULL); ASSERT(csr_handle != NULL); - TNF_PROBE_0_DEBUG(hci1394_csr_init_enter, HCI1394_TNF_HAL_STACK, ""); /* alloc the space to keep track of the csr registers */ csr = kmem_alloc(sizeof (hci1394_csr_t), KM_SLEEP); @@ -122,8 +119,6 @@ hci1394_csr_init(hci1394_drvinfo_t *drvinfo, hci1394_ohci_handle_t ohci, mutex_init(&csr->csr_mutex, NULL, MUTEX_DRIVER, drvinfo->di_iblock_cookie); hci1394_csr_state_init(csr); - - TNF_PROBE_0_DEBUG(hci1394_csr_init_exit, HCI1394_TNF_HAL_STACK, ""); } @@ -138,14 +133,11 @@ hci1394_csr_fini(hci1394_csr_handle_t *csr_handle) ASSERT(csr_handle != NULL); - TNF_PROBE_0_DEBUG(hci1394_csr_fini_enter, HCI1394_TNF_HAL_STACK, ""); csr = (hci1394_csr_t *)*csr_handle; mutex_destroy(&csr->csr_mutex); kmem_free(csr, sizeof (hci1394_csr_t)); *csr_handle = NULL; - - TNF_PROBE_0_DEBUG(hci1394_csr_fini_exit, HCI1394_TNF_HAL_STACK, ""); } @@ -157,9 +149,7 @@ void hci1394_csr_resume(hci1394_csr_handle_t csr_handle) { ASSERT(csr_handle != NULL); - TNF_PROBE_0_DEBUG(hci1394_csr_resume_enter, HCI1394_TNF_HAL_STACK, ""); hci1394_csr_state_init(csr_handle); - TNF_PROBE_0_DEBUG(hci1394_csr_resume_exit, HCI1394_TNF_HAL_STACK, ""); } @@ -173,15 +163,10 @@ hci1394_csr_node_capabilities(hci1394_csr_handle_t csr_handle, { ASSERT(csr_handle != NULL); ASSERT(capabilities != NULL); - TNF_PROBE_0_DEBUG(hci1394_csr_node_capabilities_enter, - HCI1394_TNF_HAL_STACK, ""); mutex_enter(&csr_handle->csr_mutex); *capabilities = csr_handle->csr_capabilities; mutex_exit(&csr_handle->csr_mutex); - - TNF_PROBE_0_DEBUG(hci1394_csr_node_capabilities_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -196,15 +181,10 @@ hci1394_csr_state_get(hci1394_csr_handle_t csr_handle, uint32_t *state) { ASSERT(csr_handle != NULL); ASSERT(state != NULL); - TNF_PROBE_0_DEBUG(hci1394_csr_state_get_enter, HCI1394_TNF_HAL_STACK, - ""); mutex_enter(&csr_handle->csr_mutex); *state = csr_handle->csr_state; mutex_exit(&csr_handle->csr_mutex); - - TNF_PROBE_0_DEBUG(hci1394_csr_state_get_exit, HCI1394_TNF_HAL_STACK, - ""); } @@ -222,8 +202,6 @@ hci1394_csr_state_bset(hci1394_csr_handle_t csr_handle, uint32_t state) ASSERT(csr_handle != NULL); - TNF_PROBE_0_DEBUG(hci1394_csr_state_bset_enter, HCI1394_TNF_HAL_STACK, - ""); mutex_enter(&csr_handle->csr_mutex); @@ -244,9 +222,6 @@ hci1394_csr_state_bset(hci1394_csr_handle_t csr_handle, uint32_t state) csr_handle->csr_state |= supported_state; mutex_exit(&csr_handle->csr_mutex); - - TNF_PROBE_0_DEBUG(hci1394_csr_state_bset_exit, HCI1394_TNF_HAL_STACK, - ""); } @@ -264,8 +239,6 @@ hci1394_csr_state_bclr(hci1394_csr_handle_t csr_handle, uint32_t state) ASSERT(csr_handle != NULL); - TNF_PROBE_0_DEBUG(hci1394_csr_state_bclr_enter, HCI1394_TNF_HAL_STACK, - ""); mutex_enter(&csr_handle->csr_mutex); @@ -286,9 +259,6 @@ hci1394_csr_state_bclr(hci1394_csr_handle_t csr_handle, uint32_t state) csr_handle->csr_state &= ~state; mutex_exit(&csr_handle->csr_mutex); - - TNF_PROBE_0_DEBUG(hci1394_csr_state_bclr_exit, HCI1394_TNF_HAL_STACK, - ""); } @@ -302,16 +272,10 @@ hci1394_csr_split_timeout_hi_get(hci1394_csr_handle_t csr_handle, { ASSERT(csr_handle != NULL); ASSERT(split_timeout_hi != NULL); - TNF_PROBE_0_DEBUG(hci1394_csr_split_timeout_hi_get_enter, - HCI1394_TNF_HAL_STACK, ""); mutex_enter(&csr_handle->csr_mutex); *split_timeout_hi = csr_handle->csr_split_timeout_hi; mutex_exit(&csr_handle->csr_mutex); - - TNF_PROBE_0_DEBUG(hci1394_csr_split_timeout_hi_get_exit, - HCI1394_TNF_HAL_STACK, ""); - } @@ -325,8 +289,6 @@ hci1394_csr_split_timeout_lo_get(hci1394_csr_handle_t csr_handle, { ASSERT(csr_handle != NULL); ASSERT(split_timeout_lo != NULL); - TNF_PROBE_0_DEBUG(hci1394_csr_split_timeout_lo_get_enter, - HCI1394_TNF_HAL_STACK, ""); mutex_enter(&csr_handle->csr_mutex); @@ -338,10 +300,6 @@ hci1394_csr_split_timeout_lo_get(hci1394_csr_handle_t csr_handle, CSR_SPLIT_TIMEOUT_LO_SHIFT; mutex_exit(&csr_handle->csr_mutex); - - TNF_PROBE_0_DEBUG(hci1394_csr_split_timeout_lo_get_exit, - HCI1394_TNF_HAL_STACK, ""); - } @@ -358,8 +316,6 @@ hci1394_csr_split_timeout_hi_set(hci1394_csr_handle_t csr_handle, uint32_t split_timeout_hi) { ASSERT(csr_handle != NULL); - TNF_PROBE_0_DEBUG(hci1394_csr_split_timeout_hi_set_enter, - HCI1394_TNF_HAL_STACK, ""); mutex_enter(&csr_handle->csr_mutex); @@ -373,9 +329,6 @@ hci1394_csr_split_timeout_hi_set(hci1394_csr_handle_t csr_handle, csr_handle->csr_split_timeout_hi, csr_handle->csr_split_timeout_lo); mutex_exit(&csr_handle->csr_mutex); - - TNF_PROBE_0_DEBUG(hci1394_csr_split_timeout_hi_set_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -392,8 +345,6 @@ hci1394_csr_split_timeout_lo_set(hci1394_csr_handle_t csr_handle, uint32_t split_timeout_lo) { ASSERT(csr_handle != NULL); - TNF_PROBE_0_DEBUG(hci1394_csr_split_timeout_lo_set_enter, - HCI1394_TNF_HAL_STACK, ""); mutex_enter(&csr_handle->csr_mutex); @@ -418,9 +369,6 @@ hci1394_csr_split_timeout_lo_set(hci1394_csr_handle_t csr_handle, csr_handle->csr_split_timeout_hi, csr_handle->csr_split_timeout_lo); mutex_exit(&csr_handle->csr_mutex); - - TNF_PROBE_0_DEBUG(hci1394_csr_split_timeout_lo_set_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -437,8 +385,6 @@ hci1394_csr_split_timeout_get(hci1394_csr_handle_t csr_handle) ASSERT(csr_handle != NULL); - TNF_PROBE_0_DEBUG(hci1394_csr_split_timeout_get_enter, - HCI1394_TNF_HAL_STACK, ""); mutex_enter(&csr_handle->csr_mutex); @@ -447,9 +393,6 @@ hci1394_csr_split_timeout_get(hci1394_csr_handle_t csr_handle) mutex_exit(&csr_handle->csr_mutex); - TNF_PROBE_0_DEBUG(hci1394_csr_split_timeout_get_exit, - HCI1394_TNF_HAL_STACK, ""); - return (split_timeout); } @@ -466,8 +409,6 @@ void hci1394_csr_bus_reset(hci1394_csr_handle_t csr_handle) { ASSERT(csr_handle != NULL); - TNF_PROBE_0_DEBUG(hci1394_csr_bus_reset_enter, HCI1394_TNF_HAL_STACK, - ""); mutex_enter(&csr_handle->csr_mutex); @@ -524,9 +465,6 @@ hci1394_csr_bus_reset(hci1394_csr_handle_t csr_handle) */ mutex_exit(&csr_handle->csr_mutex); - - TNF_PROBE_0_DEBUG(hci1394_csr_bus_reset_exit, HCI1394_TNF_HAL_STACK, - ""); } @@ -537,8 +475,6 @@ hci1394_csr_bus_reset(hci1394_csr_handle_t csr_handle) static void hci1394_csr_state_init(hci1394_csr_t *csr) { ASSERT(csr != NULL); - TNF_PROBE_0_DEBUG(hci1394_csr_state_init_enter, HCI1394_TNF_HAL_STACK, - ""); mutex_enter(&csr->csr_mutex); @@ -570,7 +506,4 @@ static void hci1394_csr_state_init(hci1394_csr_t *csr) csr->csr_capabilities = CSR_INITIAL_NODE_CAPABILITIES; mutex_exit(&csr->csr_mutex); - - TNF_PROBE_0_DEBUG(hci1394_csr_state_init_exit, HCI1394_TNF_HAL_STACK, - ""); } diff --git a/usr/src/uts/common/io/1394/adapters/hci1394_detach.c b/usr/src/uts/common/io/1394/adapters/hci1394_detach.c index 2d6cfda0c8..37c9a4bfba 100644 --- a/usr/src/uts/common/io/1394/adapters/hci1394_detach.c +++ b/usr/src/uts/common/io/1394/adapters/hci1394_detach.c @@ -48,15 +48,8 @@ hci1394_detach(dev_info_t *dip, ddi_detach_cmd_t cmd) { hci1394_state_t *soft_state; - - TNF_PROBE_0_DEBUG(hci1394_detach_enter, HCI1394_TNF_HAL_STACK, ""); - soft_state = ddi_get_soft_state(hci1394_statep, ddi_get_instance(dip)); if (soft_state == NULL) { - TNF_PROBE_1(hci1394_detach_ssn_fail, HCI1394_TNF_HAL_ERROR, "", - tnf_string, errmsg, "soft_state = NULL"); - TNF_PROBE_0_DEBUG(hci1394_detach_exit, HCI1394_TNF_HAL_STACK, - ""); return (DDI_FAILURE); } @@ -113,8 +106,6 @@ hci1394_detach(dev_info_t *dip, ddi_detach_cmd_t cmd) ddi_soft_state_free(hci1394_statep, soft_state->drvinfo.di_instance); - TNF_PROBE_0_DEBUG(hci1394_detach_exit, HCI1394_TNF_HAL_STACK, - ""); return (DDI_SUCCESS); case DDI_SUSPEND: @@ -150,18 +141,12 @@ hci1394_detach(dev_info_t *dip, ddi_detach_cmd_t cmd) (void) h1394_detach(&soft_state->drvinfo.di_sl_private, DDI_SUSPEND); - TNF_PROBE_0_DEBUG(hci1394_detach_exit, HCI1394_TNF_HAL_STACK, - ""); return (DDI_SUCCESS); default: - TNF_PROBE_1(hci1394_detach_fail, HCI1394_TNF_HAL_ERROR, "", - tnf_string, errmsg, "in detach default"); break; } - TNF_PROBE_0_DEBUG(hci1394_detach_exit, HCI1394_TNF_HAL_STACK, ""); - return (DDI_FAILURE); } @@ -214,8 +199,6 @@ void hci1394_detach_hardware(hci1394_state_t *soft_state) { ASSERT(soft_state != NULL); - TNF_PROBE_0_DEBUG(hci1394_detach_hardware_enter, HCI1394_TNF_HAL_STACK, - ""); /* free up vendor specific registers */ hci1394_vendor_fini(&soft_state->vendor); @@ -234,9 +217,6 @@ hci1394_detach_hardware(hci1394_state_t *soft_state) /* free up PCI config space */ hci1394_pci_fini(soft_state); - - TNF_PROBE_0_DEBUG(hci1394_detach_hardware_exit, HCI1394_TNF_HAL_STACK, - ""); } @@ -248,9 +228,7 @@ void hci1394_pci_fini(hci1394_state_t *soft_state) { ASSERT(soft_state != NULL); - TNF_PROBE_0_DEBUG(hci1394_pci_fini_enter, HCI1394_TNF_HAL_STACK, ""); pci_config_teardown(&soft_state->pci_config); - TNF_PROBE_0_DEBUG(hci1394_pci_fini_exit, HCI1394_TNF_HAL_STACK, ""); } @@ -262,9 +240,5 @@ void hci1394_soft_state_fini(hci1394_state_t *soft_state) { ASSERT(soft_state != NULL); - TNF_PROBE_0_DEBUG(hci1394_soft_state_fini_enter, HCI1394_TNF_HAL_STACK, - ""); mutex_destroy(&soft_state->drvinfo.di_drvstate.ds_mutex); - TNF_PROBE_0_DEBUG(hci1394_soft_state_fini_exit, HCI1394_TNF_HAL_STACK, - ""); } diff --git a/usr/src/uts/common/io/1394/adapters/hci1394_ioctl.c b/usr/src/uts/common/io/1394/adapters/hci1394_ioctl.c index 162a23a8e5..8a529680fb 100644 --- a/usr/src/uts/common/io/1394/adapters/hci1394_ioctl.c +++ b/usr/src/uts/common/io/1394/adapters/hci1394_ioctl.c @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * hci1394_ioctl.c * Test ioctl's to support test/debug of the 1394 HW. hci1394_ioctl_enum_t is @@ -91,22 +89,13 @@ hci1394_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *credp, int instance; int status; - - TNF_PROBE_0_DEBUG(hci1394_ioctl_enter, HCI1394_TNF_HAL_STACK, ""); - instance = getminor(dev); if (instance == -1) { - TNF_PROBE_0(hci1394_ioctl_gm_fail, HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_ioctl_exit, HCI1394_TNF_HAL_STACK, - ""); return (EBADF); } soft_state = ddi_get_soft_state(hci1394_statep, instance); if (soft_state == NULL) { - TNF_PROBE_0(hci1394_ioctl_gss_fail, HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_ioctl_exit, HCI1394_TNF_HAL_STACK, - ""); return (EBADF); } @@ -161,8 +150,6 @@ hci1394_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *credp, break; } - TNF_PROBE_0_DEBUG(hci1394_ioctl_exit, HCI1394_TNF_HAL_STACK, ""); - return (status); } @@ -176,21 +163,14 @@ hci1394_ioctl_wrreg(hci1394_state_t *soft_state, void *arg, int mode) ASSERT(soft_state != NULL); ASSERT(arg != NULL); - TNF_PROBE_0_DEBUG(hci1394_ioctl_wrreg_enter, HCI1394_TNF_HAL_STACK, ""); status = ddi_copyin(arg, &wrreg, sizeof (hci1394_ioctl_wrreg_t), mode); if (status != 0) { - TNF_PROBE_0(hci1394_ioctl_wrreg_ci_fail, HCI1394_TNF_HAL_ERROR, - ""); - TNF_PROBE_0_DEBUG(hci1394_ioctl_wrreg_exit, - HCI1394_TNF_HAL_STACK, ""); return (EFAULT); } hci1394_ohci_reg_write(soft_state->ohci, wrreg.addr, wrreg.data); - TNF_PROBE_0_DEBUG(hci1394_ioctl_wrreg_exit, HCI1394_TNF_HAL_STACK, ""); - return (0); } @@ -204,14 +184,9 @@ hci1394_ioctl_rdreg(hci1394_state_t *soft_state, void *arg, int mode) ASSERT(soft_state != NULL); ASSERT(arg != NULL); - TNF_PROBE_0_DEBUG(hci1394_ioctl_rdreg_enter, HCI1394_TNF_HAL_STACK, ""); status = ddi_copyin(arg, &rdreg, sizeof (hci1394_ioctl_rdreg_t), mode); if (status != 0) { - TNF_PROBE_0(hci1394_ioctl_rdreg_ci_fail, HCI1394_TNF_HAL_ERROR, - ""); - TNF_PROBE_0_DEBUG(hci1394_ioctl_rdreg_exit, - HCI1394_TNF_HAL_STACK, ""); return (EFAULT); } @@ -219,15 +194,9 @@ hci1394_ioctl_rdreg(hci1394_state_t *soft_state, void *arg, int mode) status = ddi_copyout(&rdreg, arg, sizeof (hci1394_ioctl_rdreg_t), mode); if (status != 0) { - TNF_PROBE_0(hci1394_ioctl_rdreg_c0_fail, HCI1394_TNF_HAL_ERROR, - ""); - TNF_PROBE_0_DEBUG(hci1394_ioctl_rdreg_exit, - HCI1394_TNF_HAL_STACK, ""); return (EFAULT); } - TNF_PROBE_0_DEBUG(hci1394_ioctl_rdreg_exit, HCI1394_TNF_HAL_STACK, ""); - return (0); } @@ -241,31 +210,19 @@ hci1394_ioctl_wrvreg(hci1394_state_t *soft_state, void *arg, int mode) ASSERT(soft_state != NULL); ASSERT(arg != NULL); - TNF_PROBE_0_DEBUG(hci1394_ioctl_wrvreg_enter, HCI1394_TNF_HAL_STACK, - ""); status = ddi_copyin(arg, &wrvreg, sizeof (hci1394_ioctl_wrvreg_t), mode); if (status != 0) { - TNF_PROBE_0(hci1394_ioctl_wrvreg_ci_fail, HCI1394_TNF_HAL_ERROR, - ""); - TNF_PROBE_0_DEBUG(hci1394_ioctl_wrvreg_exit, - HCI1394_TNF_HAL_STACK, ""); return (EFAULT); } status = hci1394_vendor_reg_write(soft_state->vendor, wrvreg.regset, wrvreg.addr, wrvreg.data); if (status != DDI_SUCCESS) { - TNF_PROBE_0(hci1394_ioctl_wrvreg_vrw_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_ioctl_wrvreg_exit, - HCI1394_TNF_HAL_STACK, ""); return (EINVAL); } - TNF_PROBE_0_DEBUG(hci1394_ioctl_wrvreg_exit, HCI1394_TNF_HAL_STACK, ""); - return (0); } @@ -279,41 +236,25 @@ hci1394_ioctl_rdvreg(hci1394_state_t *soft_state, void *arg, int mode) ASSERT(soft_state != NULL); ASSERT(arg != NULL); - TNF_PROBE_0_DEBUG(hci1394_ioctl_rdvreg_enter, HCI1394_TNF_HAL_STACK, - ""); status = ddi_copyin(arg, &rdvreg, sizeof (hci1394_ioctl_rdvreg_t), mode); if (status != 0) { - TNF_PROBE_0(hci1394_ioctl_rdvreg_ci_fail, HCI1394_TNF_HAL_ERROR, - ""); - TNF_PROBE_0_DEBUG(hci1394_ioctl_rdvreg_exit, - HCI1394_TNF_HAL_STACK, ""); return (EFAULT); } status = hci1394_vendor_reg_read(soft_state->vendor, rdvreg.regset, rdvreg.addr, &rdvreg.data); if (status != DDI_SUCCESS) { - TNF_PROBE_0(hci1394_ioctl_rdvreg_vrr_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_ioctl_rdvreg_exit, - HCI1394_TNF_HAL_STACK, ""); return (EINVAL); } status = ddi_copyout(&rdvreg, arg, sizeof (hci1394_ioctl_rdvreg_t), mode); if (status != 0) { - TNF_PROBE_0(hci1394_ioctl_rdvreg_co_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_ioctl_rdvreg_exit, - HCI1394_TNF_HAL_STACK, ""); return (EFAULT); } - TNF_PROBE_0_DEBUG(hci1394_ioctl_rdvreg_exit, HCI1394_TNF_HAL_STACK, ""); - return (0); } @@ -327,24 +268,15 @@ hci1394_ioctl_selfid_cnt(hci1394_state_t *soft_state, void *arg, int mode) ASSERT(soft_state != NULL); ASSERT(arg != NULL); - TNF_PROBE_0_DEBUG(hci1394_ioctl_selfid_cnt_enter, - HCI1394_TNF_HAL_STACK, ""); selfid_cnt.count = soft_state->drvinfo.di_stats.st_selfid_count; status = ddi_copyout(&selfid_cnt, arg, sizeof (hci1394_ioctl_selfid_cnt_t), mode); if (status != 0) { - TNF_PROBE_0(hci1394_ioctl_selfid_cnt_co_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_ioctl_selfid_cnt_exit, - HCI1394_TNF_HAL_STACK, ""); return (EFAULT); } - TNF_PROBE_0_DEBUG(hci1394_ioctl_selfid_cnt_exit, - HCI1394_TNF_HAL_STACK, ""); - return (0); } @@ -358,24 +290,15 @@ hci1394_ioctl_busgen_cnt(hci1394_state_t *soft_state, void *arg, int mode) ASSERT(soft_state != NULL); ASSERT(arg != NULL); - TNF_PROBE_0_DEBUG(hci1394_ioctl_busgen_cnt_enter, - HCI1394_TNF_HAL_STACK, ""); busgen_cnt.count = hci1394_ohci_current_busgen(soft_state->ohci); status = ddi_copyout(&busgen_cnt, arg, sizeof (hci1394_ioctl_busgen_cnt_t), mode); if (status != 0) { - TNF_PROBE_0(hci1394_ioctl_busgen_cnt_co_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_ioctl_busgen_cnt_exit, - HCI1394_TNF_HAL_STACK, ""); return (EFAULT); } - TNF_PROBE_0_DEBUG(hci1394_ioctl_busgen_cnt_exit, - HCI1394_TNF_HAL_STACK, ""); - return (0); } @@ -389,29 +312,18 @@ hci1394_ioctl_wrphy(hci1394_state_t *soft_state, void *arg, int mode) ASSERT(soft_state != NULL); ASSERT(arg != NULL); - TNF_PROBE_0_DEBUG(hci1394_ioctl_wrphy_enter, HCI1394_TNF_HAL_STACK, ""); status = ddi_copyin(arg, &wrphy, sizeof (hci1394_ioctl_wrphy_t), mode); if (status != 0) { - TNF_PROBE_0(hci1394_ioctl_wrphy_ci_fail, HCI1394_TNF_HAL_ERROR, - ""); - TNF_PROBE_0_DEBUG(hci1394_ioctl_wrphy_exit, - HCI1394_TNF_HAL_STACK, ""); return (EFAULT); } status = hci1394_ohci_phy_write(soft_state->ohci, wrphy.addr, wrphy.data); if (status != DDI_SUCCESS) { - TNF_PROBE_0(hci1394_ioctl_wrphy_pw_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_ioctl_wrphy_exit, - HCI1394_TNF_HAL_STACK, ""); return (EINVAL); } - TNF_PROBE_0_DEBUG(hci1394_ioctl_wrphy_exit, HCI1394_TNF_HAL_STACK, ""); - return (0); } @@ -425,38 +337,23 @@ hci1394_ioctl_rdphy(hci1394_state_t *soft_state, void *arg, int mode) ASSERT(soft_state != NULL); ASSERT(arg != NULL); - TNF_PROBE_0_DEBUG(hci1394_ioctl_rdphy_enter, HCI1394_TNF_HAL_STACK, ""); status = ddi_copyin(arg, &rdphy, sizeof (hci1394_ioctl_rdphy_t), mode); if (status != 0) { - TNF_PROBE_0(hci1394_ioctl_rdphy_ci_fail, HCI1394_TNF_HAL_ERROR, - ""); - TNF_PROBE_0_DEBUG(hci1394_ioctl_rdphy_exit, - HCI1394_TNF_HAL_STACK, ""); return (EFAULT); } status = hci1394_ohci_phy_read(soft_state->ohci, rdphy.addr, &rdphy.data); if (status != DDI_SUCCESS) { - TNF_PROBE_0(hci1394_ioctl_rdphy_pr_fail, HCI1394_TNF_HAL_ERROR, - ""); - TNF_PROBE_0_DEBUG(hci1394_ioctl_rdphy_exit, - HCI1394_TNF_HAL_STACK, ""); return (EINVAL); } status = ddi_copyout(&rdphy, arg, sizeof (hci1394_ioctl_rdphy_t), mode); if (status != 0) { - TNF_PROBE_0(hci1394_ioctl_rdphy_co_fail, HCI1394_TNF_HAL_ERROR, - ""); - TNF_PROBE_0_DEBUG(hci1394_ioctl_rdphy_exit, - HCI1394_TNF_HAL_STACK, ""); return (EFAULT); } - TNF_PROBE_0_DEBUG(hci1394_ioctl_rdphy_exit, HCI1394_TNF_HAL_STACK, ""); - return (0); } @@ -470,8 +367,6 @@ hci1394_ioctl_hbainfo(hci1394_state_t *soft_state, void *arg, int mode) ASSERT(soft_state != NULL); ASSERT(arg != NULL); - TNF_PROBE_0_DEBUG(hci1394_ioctl_hbainfo_enter, - HCI1394_TNF_HAL_STACK, ""); hbainfo.pci_vendor_id = soft_state->vendor_info.vendor_id; hbainfo.pci_device_id = soft_state->vendor_info.device_id; @@ -483,16 +378,9 @@ hci1394_ioctl_hbainfo(hci1394_state_t *soft_state, void *arg, int mode) status = ddi_copyout(&hbainfo, arg, sizeof (hci1394_ioctl_hbainfo_t), mode); if (status != 0) { - TNF_PROBE_0(hci1394_ioctl_hbainfo_co_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_ioctl_hbainfo_exit, - HCI1394_TNF_HAL_STACK, ""); return (EFAULT); } - TNF_PROBE_0_DEBUG(hci1394_ioctl_hbainfo_exit, - HCI1394_TNF_HAL_STACK, ""); - return (0); } @@ -511,8 +399,6 @@ hci1394_ioctl_read_selfid(hci1394_state_t *soft_state, void *arg, int mode) ASSERT(soft_state != NULL); ASSERT(arg != NULL); - TNF_PROBE_0_DEBUG(hci1394_ioctl_read_selfid_enter, - HCI1394_TNF_HAL_STACK, ""); #ifdef _MULTI_DATAMODEL switch (ddi_model_convert_from(mode & FMODELS)) { @@ -523,10 +409,6 @@ hci1394_ioctl_read_selfid(hci1394_state_t *soft_state, void *arg, int mode) status = ddi_copyin(arg, &read_selfid32, sizeof (hci1394_ioctl_readselfid32_t), mode); if (status != 0) { - TNF_PROBE_0(hci1394_ioctl_read_selfid_ci_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_ioctl_read_selfid_exit, - HCI1394_TNF_HAL_STACK, ""); return (EFAULT); } @@ -551,10 +433,6 @@ hci1394_ioctl_read_selfid(hci1394_state_t *soft_state, void *arg, int mode) status = ddi_copyin(arg, &read_selfid, sizeof (hci1394_ioctl_read_selfid_t), mode); if (status != 0) { - TNF_PROBE_0(hci1394_ioctl_read_selfid_ci_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_ioctl_read_selfid_exit, - HCI1394_TNF_HAL_STACK, ""); return (EFAULT); } @@ -563,10 +441,6 @@ hci1394_ioctl_read_selfid(hci1394_state_t *soft_state, void *arg, int mode) * can hold. count is in quadlets and max_selfid_size is in bytes. */ if ((read_selfid.count * 4) > OHCI_MAX_SELFID_SIZE) { - TNF_PROBE_0(hci1394_ioctl_read_selfid_cnt_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_ioctl_exit, - HCI1394_TNF_HAL_STACK, ""); return (EINVAL); } @@ -582,17 +456,10 @@ hci1394_ioctl_read_selfid(hci1394_state_t *soft_state, void *arg, int mode) /* copy the selfid word into the user buffer */ status = ddi_copyout(&data, &read_selfid.buf[offset], 4, mode); if (status != 0) { - TNF_PROBE_0(hci1394_ioctl_read_selfid_co_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_ioctl_read_selfid_exit, - HCI1394_TNF_HAL_STACK, ""); return (EFAULT); } } - TNF_PROBE_0_DEBUG(hci1394_ioctl_read_selfid_exit, - HCI1394_TNF_HAL_STACK, ""); - return (0); } @@ -609,18 +476,12 @@ hci1394_ioctl_read_selfid32(hci1394_state_t *soft_state, ASSERT(soft_state != NULL); ASSERT(read_selfid != NULL); - TNF_PROBE_0_DEBUG(hci1394_ioctl_read_selfid32_enter, - HCI1394_TNF_HAL_STACK, ""); /* * make sure we are not trying to copy more data than the selfid buffer * can hold. count is in quadlets and max_selfid_size is in bytes. */ if ((read_selfid->count * 4) > OHCI_MAX_SELFID_SIZE) { - TNF_PROBE_0(hci1394_ioctl_read_selfid32_cnt_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_ioctl_read_selfid32_exit, - HCI1394_TNF_HAL_STACK, ""); return (EINVAL); } @@ -637,17 +498,10 @@ hci1394_ioctl_read_selfid32(hci1394_state_t *soft_state, (void *)(uintptr_t)(read_selfid->buf + (offset * 4)), 4, mode); if (status != 0) { - TNF_PROBE_0(hci1394_ioctl_read_selfid32_co_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_ioctl_read_selfid32_exit, - HCI1394_TNF_HAL_STACK, ""); return (EFAULT); } } - TNF_PROBE_0_DEBUG(hci1394_ioctl_read_selfid32_exit, - HCI1394_TNF_HAL_STACK, ""); - return (0); } #endif diff --git a/usr/src/uts/common/io/1394/adapters/hci1394_isoch.c b/usr/src/uts/common/io/1394/adapters/hci1394_isoch.c index eea2e0b6c7..f262c029a4 100644 --- a/usr/src/uts/common/io/1394/adapters/hci1394_isoch.c +++ b/usr/src/uts/common/io/1394/adapters/hci1394_isoch.c @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * hci1394_isoch.c * HCI HAL isochronous interface routines. Contains routines used @@ -71,8 +69,6 @@ hci1394_isoch_init(hci1394_drvinfo_t *drvinfo, hci1394_ohci_handle_t ohci, ASSERT(drvinfo != NULL); ASSERT(isoch_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_isoch_init_enter, HCI1394_TNF_HAL_STACK_ISOCH, - ""); isochp = kmem_alloc(sizeof (hci1394_isoch_t), KM_SLEEP); @@ -120,9 +116,6 @@ hci1394_isoch_init(hci1394_drvinfo_t *drvinfo, hci1394_ohci_handle_t ohci, drvinfo->di_iblock_cookie); *isoch_hdl = isochp; - - TNF_PROBE_0_DEBUG(hci1394_isoch_init_exit, HCI1394_TNF_HAL_STACK_ISOCH, - ""); } /* @@ -136,8 +129,6 @@ hci1394_isoch_fini(hci1394_isoch_handle_t *isoch_hdl) int i; ASSERT(isoch_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_isoch_fini_enter, HCI1394_TNF_HAL_STACK_ISOCH, - ""); isochp = *isoch_hdl; @@ -151,9 +142,6 @@ hci1394_isoch_fini(hci1394_isoch_handle_t *isoch_hdl) mutex_destroy(&isochp->ctxt_list_mutex); kmem_free(isochp, sizeof (hci1394_isoch_t)); *isoch_hdl = NULL; - - TNF_PROBE_0_DEBUG(hci1394_isoch_fini_exit, HCI1394_TNF_HAL_STACK_ISOCH, - ""); } @@ -165,10 +153,6 @@ hci1394_isoch_fini(hci1394_isoch_handle_t *isoch_hdl) int hci1394_isoch_resume(hci1394_state_t *soft_state) { - TNF_PROBE_0_DEBUG(hci1394_isoch_resume_enter, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - TNF_PROBE_0_DEBUG(hci1394_isoch_resume_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (DDI_SUCCESS); } @@ -192,8 +176,6 @@ hci1394_alloc_isoch_dma(void *hal_private, id1394_isoch_dmainfo_t *idi, ASSERT(soft_statep != NULL); ASSERT(hal_idma_handlep != NULL); - TNF_PROBE_0_DEBUG(hci1394_alloc_isoch_dma_enter, - HCI1394_TNF_HAL_STACK_ISOCH, ""); isochp = soft_statep->isoch; *hal_idma_handlep = NULL; @@ -205,10 +187,6 @@ hci1394_alloc_isoch_dma(void *hal_private, id1394_isoch_dmainfo_t *idi, if ((idi->idma_options & ID1394_TALK) != 0) { /* TRANSMIT */ - TNF_PROBE_1_DEBUG(hci1394_alloc_isoch_dma_transmit, - HCI1394_TNF_HAL_INFO_ISOCH, "", tnf_string, msg, - "Allocating isoch transmit context"); - /* * search through list of hardware supported contexts for * one that's not inuse @@ -222,20 +200,11 @@ hci1394_alloc_isoch_dma(void *hal_private, id1394_isoch_dmainfo_t *idi, /* if there aren't any left, return an error */ if (i >= isochp->ctxt_xmit_count) { - TNF_PROBE_1(hci1394_alloc_isoch_dma_xmit_rsrc_error, - HCI1394_TNF_HAL_ERROR_ISOCH, "", tnf_string, errmsg, - "Out of isoch transmit resources"); - TNF_PROBE_0_DEBUG(hci1394_alloc_isoch_dma_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - mutex_exit(&isochp->ctxt_list_mutex); *resultp = IXL1394_ENO_DMA_RESRCS; return (DDI_FAILURE); } - TNF_PROBE_1_DEBUG(t1394_alloc_isoch_dma_it_ctxtnum, - HCI1394_TNF_HAL_INFO_ISOCH, "", tnf_int, it_ctxt_num, i); - /* mark inuse and set up handle to context */ isochp->ctxt_xmit[i].ctxt_flags |= HCI1394_ISO_CTXT_INUSE; ctxtp = &isochp->ctxt_xmit[i]; @@ -244,10 +213,6 @@ hci1394_alloc_isoch_dma(void *hal_private, id1394_isoch_dmainfo_t *idi, } else { /* RECEIVE */ - TNF_PROBE_1_DEBUG(hci1394_alloc_isoch_dma_receive, - HCI1394_TNF_HAL_INFO_ISOCH, "", tnf_string, msg, - "Allocating isoch receive context"); - /* search thru implemented contexts for one that's available */ for (i = 0; i < isochp->ctxt_recv_count; i++) { if ((isochp->ctxt_recv[i].ctxt_flags & @@ -259,13 +224,6 @@ hci1394_alloc_isoch_dma(void *hal_private, id1394_isoch_dmainfo_t *idi, /* if there aren't any left, return an error */ /* XXX support for multi-chan could go here */ if (i >= isochp->ctxt_recv_count) { - - TNF_PROBE_1(t1394_alloc_isoch_dma_ir_rsrc_error, - HCI1394_TNF_HAL_ERROR_ISOCH, "", tnf_string, errmsg, - "Out of isoch receive resources"); - TNF_PROBE_0_DEBUG(hci1394_alloc_isoch_dma_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - mutex_exit(&isochp->ctxt_list_mutex); *resultp = IXL1394_ENO_DMA_RESRCS; return (DDI_FAILURE); @@ -281,9 +239,6 @@ hci1394_alloc_isoch_dma(void *hal_private, id1394_isoch_dmainfo_t *idi, HCI1394_ISO_CTXT_RHDRS; } - TNF_PROBE_1_DEBUG(hci1394_alloc_isoch_dma_recv_ctxtnum, - HCI1394_TNF_HAL_INFO_ISOCH, "", tnf_int, recv_ctxt_num, i); - /* mark inuse and set up handle to context */ isochp->ctxt_recv[i].ctxt_flags |= HCI1394_ISO_CTXT_INUSE; ctxtp = &isochp->ctxt_recv[i]; @@ -325,11 +280,6 @@ hci1394_alloc_isoch_dma(void *hal_private, id1394_isoch_dmainfo_t *idi, ctxtp->ctxt_flags &= ~HCI1394_ISO_CTXT_INUSE; mutex_exit(&isochp->ctxt_list_mutex); - TNF_PROBE_2(t1394_alloc_isoch_dma_compile_fail, - HCI1394_TNF_HAL_ERROR_ISOCH, "", tnf_string, errmsg, - "IXL compilation error", tnf_int, ixl_error, *resultp); - TNF_PROBE_0_DEBUG(hci1394_alloc_isoch_dma_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (DDI_FAILURE); } @@ -350,9 +300,6 @@ hci1394_alloc_isoch_dma(void *hal_private, id1394_isoch_dmainfo_t *idi, /* No errors, so all set to go. initialize interrupt/execution flags */ ctxtp->intr_flags = 0; - TNF_PROBE_0_DEBUG(hci1394_alloc_isoch_dma_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - *hal_idma_handlep = ctxtp; return (DDI_SUCCESS); } @@ -374,20 +321,12 @@ hci1394_start_isoch_dma(void *hal_private, void *hal_isoch_dma_handle, hci1394_iso_ctxt_t *ctxtp; int tag0, tag1, tag2, tag3; - TNF_PROBE_0_DEBUG(hci1394_start_isoch_dma_enter, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - /* pick up the context pointer from the private idma data */ ctxtp = (hci1394_iso_ctxt_t *)hal_isoch_dma_handle; ASSERT(hal_private != NULL); ASSERT(ctxtp != NULL); ASSERT(idma_ctrlinfop != NULL); - TNF_PROBE_4_DEBUG(hci1394_start_isoch_dma_ctxt_info, - HCI1394_TNF_HAL_INFO_ISOCH, "", tnf_opaque, ctxt_ptr, ctxtp, - tnf_int, ctxt_index, ctxtp->ctxt_index, tnf_opaque, ctxt_flags, - ctxtp->ctxt_flags, tnf_opaque, first_ixl, ctxtp->ixl_firstp); - /* if the context is already running, just exit. else set running */ mutex_enter(&soft_statep->isoch->ctxt_list_mutex); @@ -395,9 +334,6 @@ hci1394_start_isoch_dma(void *hal_private, void *hal_isoch_dma_handle, mutex_exit(&soft_statep->isoch->ctxt_list_mutex); - TNF_PROBE_1_DEBUG(hci1394_start_isoch_dma_exit, - HCI1394_TNF_HAL_STACK_ISOCH, "", tnf_string, msg, - "context already running"); return (DDI_SUCCESS); } ctxtp->ctxt_flags |= HCI1394_ISO_CTXT_RUNNING; @@ -425,10 +361,6 @@ hci1394_start_isoch_dma(void *hal_private, void *hal_isoch_dma_handle, hci1394_ohci_ir_cmd_ptr_set(soft_statep->ohci, ctxtp->ctxt_index, ctxtp->dma_mem_execp); - TNF_PROBE_2_DEBUG(hci1394_start_isoch_dma_index_info, - HCI1394_TNF_HAL_INFO_ISOCH, "", tnf_string, msg, - "starting IR ctxt", tnf_int, ctxt_num, ctxtp->ctxt_index); - /* * determine correct tag values. map target's requested 2-bit * tag into one of the 4 openHCI tag bits. @@ -486,10 +418,6 @@ hci1394_start_isoch_dma(void *hal_private, void *hal_isoch_dma_handle, hci1394_ohci_it_cmd_ptr_set(soft_statep->ohci, ctxtp->ctxt_index, ctxtp->dma_mem_execp); - TNF_PROBE_2_DEBUG(hci1394_start_isoch_dma_index_info, - HCI1394_TNF_HAL_INFO_ISOCH, "", tnf_string, msg, - "starting IT ctxt", tnf_int, ctxt_num, ctxtp->ctxt_index); - /* set desired values in context control register */ HCI1394_ITCTXT_CTRL_SET(soft_statep, ctxtp->ctxt_index, ((flags & ID1394_START_ON_CYCLE) != 0) /* match enable */, @@ -508,8 +436,6 @@ hci1394_start_isoch_dma(void *hal_private, void *hal_isoch_dma_handle, (uint32_t)(0x1 << ctxtp->ctxt_index)); } - TNF_PROBE_0_DEBUG(hci1394_start_isoch_dma_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (DDI_SUCCESS); } @@ -531,10 +457,6 @@ hci1394_update_isoch_dma(void *hal_private, void *hal_isoch_dma_handle, int ii; int err = DDI_SUCCESS; - - TNF_PROBE_0_DEBUG(hci1394_update_isoch_dma_enter, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - /* pick up the context pointer from the private idma data */ ctxtp = (hci1394_iso_ctxt_t *)hal_isoch_dma_handle; @@ -553,13 +475,6 @@ hci1394_update_isoch_dma(void *hal_private, void *hal_isoch_dma_handle, ASSERT(cur_new_ixlp != NULL); ASSERT(cur_orig_ixlp != NULL); - /* lots of debug trace info */ - TNF_PROBE_4_DEBUG(hci1394_update_isoch_dma_ctxt_info, - HCI1394_TNF_HAL_INFO_ISOCH, "", tnf_opaque, ctxt_ptr, ctxtp, - tnf_int, ixlcount, idma_updateinfop->ixl_count, - tnf_opaque, new_ixl, cur_new_ixlp, tnf_opaque, orig_ixl, - cur_orig_ixlp); - for (ii = 0; (ii < idma_updateinfop->ixl_count) && (err == DDI_SUCCESS); ii++) { @@ -568,10 +483,6 @@ hci1394_update_isoch_dma(void *hal_private, void *hal_isoch_dma_handle, *resultp = IXL1394_ECOUNT_MISMATCH; err = DDI_FAILURE; - TNF_PROBE_3_DEBUG(hci1394_update_isoch_dma_mismatch, - HCI1394_TNF_HAL_ERROR_ISOCH, "", tnf_opaque, new, - cur_new_ixlp, tnf_opaque, orig, cur_orig_ixlp, - tnf_int, iteration, ii); break; } @@ -584,8 +495,6 @@ hci1394_update_isoch_dma(void *hal_private, void *hal_isoch_dma_handle, cur_orig_ixlp = cur_orig_ixlp->next_ixlp; } - TNF_PROBE_0_DEBUG(hci1394_update_isoch_dma_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (err); } @@ -604,9 +513,6 @@ hci1394_stop_isoch_dma(void *hal_private, void *hal_isoch_dma_handle, hci1394_state_t *soft_statep = (hci1394_state_t *)hal_private; hci1394_iso_ctxt_t *ctxtp; - TNF_PROBE_0_DEBUG(hci1394_stop_isoch_dma_enter, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - /* pick up the context pointer from the private idma data */ ctxtp = (hci1394_iso_ctxt_t *)hal_isoch_dma_handle; @@ -621,9 +527,6 @@ hci1394_stop_isoch_dma(void *hal_private, void *hal_isoch_dma_handle, * store_timestamps upto date. Don't care about errors. */ hci1394_ixl_interrupt(soft_statep, ctxtp, B_TRUE); - - TNF_PROBE_0_DEBUG(hci1394_stop_isoch_dma_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); } /* @@ -645,23 +548,10 @@ hci1394_do_stop(hci1394_state_t *soft_statep, hci1394_iso_ctxt_t *ctxtp, int count; clock_t upto; - TNF_PROBE_0_DEBUG(hci1394_do_stop_enter, HCI1394_TNF_HAL_STACK_ISOCH, - ""); - - TNF_PROBE_4_DEBUG(hci1394_do_stop_info, - HCI1394_TNF_HAL_INFO_ISOCH, "", tnf_opaque, ctxt_ptr, ctxtp, - tnf_int, ctxt_index, ctxtp->ctxt_index, tnf_opaque, ctxt_flags, - ctxtp->ctxt_flags, tnf_string, reason, - (stop_args == ID1394_DONE) ? "DONE":"FAIL"); - /* already stopped? if yes, done, else set state to not-running */ mutex_enter(&soft_statep->isoch->ctxt_list_mutex); if ((ctxtp->ctxt_flags & HCI1394_ISO_CTXT_RUNNING) == 0) { mutex_exit(&soft_statep->isoch->ctxt_list_mutex); - - TNF_PROBE_1_DEBUG(hci1394_do_stop_exit, - HCI1394_TNF_HAL_STACK_ISOCH, "", tnf_string, msg, - "context already stopped"); return; } ctxtp->ctxt_flags &= ~HCI1394_ISO_CTXT_RUNNING; @@ -706,12 +596,6 @@ hci1394_do_stop(hci1394_state_t *soft_statep, hci1394_iso_ctxt_t *ctxtp, break; } } - - if (ctxtp->intr_flags & HCI1394_ISO_CTXT_ININTR) { - TNF_PROBE_1(hci1394_do_stop_error, - HCI1394_TNF_HAL_ERROR_ISOCH, "", - tnf_string, msg, "intr completion timeout"); - } } mutex_exit(&ctxtp->intrprocmutex); @@ -739,9 +623,6 @@ hci1394_do_stop(hci1394_state_t *soft_statep, hci1394_iso_ctxt_t *ctxtp, soft_statep->drvinfo.di_instance); hci1394_shutdown(soft_statep->drvinfo.di_dip); - TNF_PROBE_1_DEBUG(hci1394_do_stop_exit, - HCI1394_TNF_HAL_STACK_ISOCH, "", tnf_string, msg, - "context timed out trying to stop"); return; } @@ -757,8 +638,6 @@ hci1394_do_stop(hci1394_state_t *soft_statep, hci1394_iso_ctxt_t *ctxtp, ctxtp->idma_evt_arg, stop_args); } } - TNF_PROBE_0_DEBUG(hci1394_do_stop_exit, HCI1394_TNF_HAL_STACK_ISOCH, - ""); } /* @@ -775,9 +654,6 @@ hci1394_free_isoch_dma(void *hal_private, void *hal_isoch_dma_handle) hci1394_iso_ctxt_t *ctxtp; hci1394_isoch_t *isochp; - TNF_PROBE_0_DEBUG(hci1394_free_isoch_dma_enter, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - /* pick up the context pointer from the private idma data */ ctxtp = (hci1394_iso_ctxt_t *)hal_isoch_dma_handle; @@ -786,12 +662,6 @@ hci1394_free_isoch_dma(void *hal_private, void *hal_isoch_dma_handle) isochp = soft_statep->isoch; - /* lots of debug trace info */ - TNF_PROBE_4_DEBUG(hci1394_free_isoch_dma_ctxt_info, - HCI1394_TNF_HAL_INFO_ISOCH, "", tnf_opaque, ctxt_ptr, ctxtp, - tnf_int, ctxt_index, ctxtp->ctxt_index, tnf_opaque, ctxt_flags, - ctxtp->ctxt_flags, tnf_opaque, first_ixl, ctxtp->ixl_firstp); - mutex_enter(&soft_statep->isoch->ctxt_list_mutex); /* delete xfer_ctl structs and pages of allocated hci_desc memory */ @@ -816,9 +686,6 @@ hci1394_free_isoch_dma(void *hal_private, void *hal_isoch_dma_handle) } mutex_exit(&soft_statep->isoch->ctxt_list_mutex); - - TNF_PROBE_0_DEBUG(hci1394_free_isoch_dma_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); } /* @@ -875,9 +742,6 @@ hci1394_isoch_error_ints_enable(hci1394_state_t *soft_statep) { ASSERT(soft_statep); - TNF_PROBE_0_DEBUG(hci1394_isoch_error_ints_enable_enter, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - mutex_enter(&soft_statep->isoch->ctxt_list_mutex); if (soft_statep->isoch->isoch_dma_alloc_cnt != 0) { @@ -889,7 +753,4 @@ hci1394_isoch_error_ints_enable(hci1394_state_t *soft_statep) OHCI_INTR_CYC_LOST | OHCI_INTR_CYC_INCONSISTENT); } mutex_exit(&soft_statep->isoch->ctxt_list_mutex); - - TNF_PROBE_0_DEBUG(hci1394_isoch_error_ints_enable_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); } diff --git a/usr/src/uts/common/io/1394/adapters/hci1394_isr.c b/usr/src/uts/common/io/1394/adapters/hci1394_isr.c index 42c8307447..07ff26d3d2 100644 --- a/usr/src/uts/common/io/1394/adapters/hci1394_isr.c +++ b/usr/src/uts/common/io/1394/adapters/hci1394_isr.c @@ -62,18 +62,11 @@ hci1394_isr_init(hci1394_state_t *soft_state) { int status; - ASSERT(soft_state != NULL); - TNF_PROBE_0_DEBUG(hci1394_isr_init_enter, HCI1394_TNF_HAL_STACK, ""); /* This driver does not support running at a high level interrupt */ status = ddi_intr_hilevel(soft_state->drvinfo.di_dip, 0); if (status != 0) { - TNF_PROBE_1(hci1394_isr_init_hli_fail, - HCI1394_TNF_HAL_ERROR, "", tnf_string, errmsg, - "High Level interrupts not supported"); - TNF_PROBE_0_DEBUG(hci1394_isr_init_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -81,15 +74,9 @@ hci1394_isr_init(hci1394_state_t *soft_state) status = ddi_get_iblock_cookie(soft_state->drvinfo.di_dip, 0, &soft_state->drvinfo.di_iblock_cookie); if (status != DDI_SUCCESS) { - TNF_PROBE_0(hci1394_isr_init_gic_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_isr_init_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } - TNF_PROBE_0_DEBUG(hci1394_isr_init_exit, HCI1394_TNF_HAL_STACK, ""); - return (DDI_SUCCESS); } @@ -103,11 +90,8 @@ void hci1394_isr_fini(hci1394_state_t *soft_state) { ASSERT(soft_state != NULL); - TNF_PROBE_0_DEBUG(hci1394_isr_fini_enter, HCI1394_TNF_HAL_STACK, ""); /* nothing to do right now */ - - TNF_PROBE_0_DEBUG(hci1394_isr_fini_exit, HCI1394_TNF_HAL_STACK, ""); } @@ -125,13 +109,7 @@ hci1394_isr_handler_init(hci1394_state_t *soft_state) /* Initialize interrupt handler */ status = ddi_add_intr(soft_state->drvinfo.di_dip, 0, NULL, NULL, hci1394_isr, (caddr_t)soft_state); - if (status != DDI_SUCCESS) { - TNF_PROBE_0(hci1394_isr_handler_init_fail, - HCI1394_TNF_HAL_ERROR, ""); - return (DDI_FAILURE); - } - - return (DDI_SUCCESS); + return (status); } @@ -159,8 +137,6 @@ void hci1394_isr_mask_setup(hci1394_state_t *soft_state) { ASSERT(soft_state != NULL); - TNF_PROBE_0_DEBUG(hci1394_isr_mask_setup_enter, HCI1394_TNF_HAL_STACK, - ""); /* start off with all interrupts cleared/disabled */ hci1394_ohci_ir_intr_disable(soft_state->ohci, 0xFFFFFFFF); @@ -178,9 +154,6 @@ hci1394_isr_mask_setup(hci1394_state_t *soft_state) OHCI_INTR_RQPKT | OHCI_INTR_RSPKT | OHCI_INTR_ISOCH_TX | OHCI_INTR_ISOCH_RX | OHCI_INTR_POST_WR_ERR | OHCI_INTR_PHY | OHCI_INTR_LOCK_RESP_ERR)); - - TNF_PROBE_0_DEBUG(hci1394_isr_mask_setup_exit, HCI1394_TNF_HAL_STACK, - ""); } @@ -205,7 +178,6 @@ hci1394_isr(caddr_t parm) soft_state = (hci1394_state_t *)parm; ASSERT(soft_state != NULL); - TNF_PROBE_0_DEBUG(hci1394_isr_enter, HCI1394_TNF_HAL_STACK, ""); if (hci1394_state(&soft_state->drvinfo) == HCI1394_SHUTDOWN) return (DDI_INTR_UNCLAIMED); @@ -317,8 +289,6 @@ hci1394_isr(caddr_t parm) HCI1394_BUS_RESET)) { if (soft_state->drvinfo.di_gencnt != hci1394_ohci_current_busgen(soft_state->ohci)) { - TNF_PROBE_0(hci1394_isr_busgen_claim, - HCI1394_TNF_HAL, ""); status = DDI_INTR_CLAIMED; } } @@ -331,8 +301,6 @@ hci1394_isr(caddr_t parm) soft_state->ohci); } while (interrupt_event != 0); - TNF_PROBE_0_DEBUG(hci1394_isr_exit, HCI1394_TNF_HAL_STACK, ""); - return (status); } @@ -350,8 +318,6 @@ hci1394_isr_bus_reset(hci1394_state_t *soft_state) ASSERT(soft_state != NULL); - TNF_PROBE_0_DEBUG(hci1394_isr_bus_reset_enter, - HCI1394_TNF_HAL_STACK, ""); /* * Set the driver state to reset. If we cannot, we have been shutdown. @@ -393,9 +359,6 @@ hci1394_isr_bus_reset(hci1394_state_t *soft_state) /* Inform Services Layer about Bus Reset */ h1394_bus_reset(soft_state->drvinfo.di_sl_private, (void **)&soft_state->sl_selfid_buf); - - TNF_PROBE_0_DEBUG(hci1394_isr_bus_reset_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -421,7 +384,6 @@ hci1394_isr_self_id(hci1394_state_t *soft_state) ASSERT(soft_state != NULL); - TNF_PROBE_0_DEBUG(hci1394_isr_self_id_enter, HCI1394_TNF_HAL_STACK, ""); soft_state->drvinfo.di_stats.st_selfid_count++; @@ -441,18 +403,12 @@ hci1394_isr_self_id(hci1394_state_t *soft_state) * interrupt every bus reset. */ status = hci1394_ohci_phy_read(soft_state->ohci, 5, &phy_status); - if (status != DDI_SUCCESS) { - TNF_PROBE_0(hci1394_isr_self_id_pr_fail, - HCI1394_TNF_HAL_ERROR, ""); - } else { + if (status == DDI_SUCCESS) { phy_status |= OHCI_PHY_LOOP_ERR | OHCI_PHY_PWRFAIL_ERR | OHCI_PHY_TIMEOUT_ERR | OHCI_PHY_PORTEVT_ERR; status = hci1394_ohci_phy_write(soft_state->ohci, 5, phy_status); - if (status != DDI_SUCCESS) { - TNF_PROBE_0(hci1394_isr_self_id_pw_fail, - HCI1394_TNF_HAL_ERROR, ""); - } else { + if (status == DDI_SUCCESS) { /* * Re-enable PHY interrupt. We disable the PHY interrupt * when we get one so that we do not get stuck in the @@ -465,8 +421,6 @@ hci1394_isr_self_id(hci1394_state_t *soft_state) /* See if either AT active bit is set */ if (hci1394_ohci_at_active(soft_state->ohci) == B_TRUE) { - TNF_PROBE_1(hci1394_isr_self_id_as_fail, HCI1394_TNF_HAL_ERROR, - "", tnf_string, errmsg, "AT ACTIVE still set"); saw_error = B_TRUE; } @@ -477,8 +431,6 @@ hci1394_isr_self_id(hci1394_state_t *soft_state) /* Read node info and test for Invalid Node ID */ hci1394_ohci_nodeid_info(soft_state->ohci, &node_id, &nodeid_error); if (nodeid_error == B_TRUE) { - TNF_PROBE_1(hci1394_isr_self_id_ni_fail, HCI1394_TNF_HAL_ERROR, - "", tnf_string, errmsg, "saw invalid NodeID"); saw_error = B_TRUE; } @@ -491,8 +443,6 @@ hci1394_isr_self_id(hci1394_state_t *soft_state) /* Test for selfid error */ if (selfid_error == B_TRUE) { - TNF_PROBE_1(hci1394_isr_self_id_si_fail, HCI1394_TNF_HAL_ERROR, - "", tnf_string, errmsg, "saw invalid SelfID"); saw_error = B_TRUE; } @@ -501,8 +451,6 @@ hci1394_isr_self_id(hci1394_state_t *soft_state) * we should have another selfid int coming later. */ if ((saw_error == B_FALSE) && (selfid_size == 0)) { - TNF_PROBE_0_DEBUG(hci1394_isr_self_id_exit, - HCI1394_TNF_HAL_STACK, ""); return; } @@ -511,8 +459,6 @@ hci1394_isr_self_id(hci1394_state_t *soft_state) * count in register. */ if (hci1394_ohci_selfid_buf_current(soft_state->ohci) == B_FALSE) { - TNF_PROBE_0_DEBUG(hci1394_isr_self_id_exit, - HCI1394_TNF_HAL_STACK, ""); return; } @@ -544,8 +490,6 @@ hci1394_isr_self_id(hci1394_state_t *soft_state) * If we fail reading from PHY, put invalid data into * the selfid buffer so the SL will reset the bus again. */ - TNF_PROBE_0(hci1394_isr_self_id_pi_fail, - HCI1394_TNF_HAL_ERROR, ""); selfid_buf_p[0] = 0xFFFFFFFF; selfid_buf_p[1] = 0xFFFFFFFF; } else { @@ -564,8 +508,6 @@ hci1394_isr_self_id(hci1394_state_t *soft_state) */ if (soft_state->drvinfo.di_gencnt != hci1394_ohci_current_busgen(soft_state->ohci)) { - TNF_PROBE_0_DEBUG(hci1394_isr_self_id_exit, - HCI1394_TNF_HAL_STACK, ""); return; } @@ -642,8 +584,6 @@ hci1394_isr_self_id(hci1394_state_t *soft_state) /* enable bus reset interrupt */ hci1394_ohci_intr_enable(soft_state->ohci, OHCI_INTR_BUS_RESET); - - TNF_PROBE_0_DEBUG(hci1394_isr_self_id_exit, HCI1394_TNF_HAL_STACK, ""); } @@ -664,8 +604,6 @@ hci1394_isr_isoch_ir(hci1394_state_t *soft_state) ASSERT(soft_state != NULL); - TNF_PROBE_0_DEBUG(hci1394_isr_isoch_ir_enter, - HCI1394_TNF_HAL_STACK, ""); num_ir_contexts = hci1394_isoch_recv_count_get(soft_state->isoch); @@ -694,7 +632,6 @@ hci1394_isr_isoch_ir(hci1394_state_t *soft_state) mask <<= 1; } } - TNF_PROBE_0_DEBUG(hci1394_isr_isoch_ir_exit, HCI1394_TNF_HAL_STACK, ""); } @@ -715,8 +652,6 @@ hci1394_isr_isoch_it(hci1394_state_t *soft_state) ASSERT(soft_state != NULL); - TNF_PROBE_0_DEBUG(hci1394_isr_isoch_it_enter, - HCI1394_TNF_HAL_STACK, ""); num_it_contexts = hci1394_isoch_xmit_count_get(soft_state->isoch); @@ -746,7 +681,6 @@ hci1394_isr_isoch_it(hci1394_state_t *soft_state) mask <<= 1; } } - TNF_PROBE_0_DEBUG(hci1394_isr_isoch_it_exit, HCI1394_TNF_HAL_STACK, ""); } @@ -759,12 +693,8 @@ static void hci1394_isr_atreq_complete(hci1394_state_t *soft_state) { boolean_t request_available; - int status; - ASSERT(soft_state != NULL); - TNF_PROBE_0_DEBUG(hci1394_isr_atreq_complete_enter, - HCI1394_TNF_HAL_STACK, ""); hci1394_ohci_intr_clear(soft_state->ohci, OHCI_INTR_REQ_TX_CMPLT); @@ -778,16 +708,9 @@ hci1394_isr_atreq_complete(hci1394_state_t *soft_state) * Process a single request. Do not flush Q. That is only * done during bus reset processing. */ - status = hci1394_async_atreq_process(soft_state->async, B_FALSE, + (void) hci1394_async_atreq_process(soft_state->async, B_FALSE, &request_available); - if (status != DDI_SUCCESS) { - TNF_PROBE_0(hci1394_isr_atreq_complete_pr_fail, - HCI1394_TNF_HAL_ERROR, ""); - } } while (request_available == B_TRUE); - - TNF_PROBE_0_DEBUG(hci1394_isr_atreq_complete_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -802,11 +725,8 @@ static void hci1394_isr_arresp(hci1394_state_t *soft_state) { boolean_t response_available; - int status; - ASSERT(soft_state != NULL); - TNF_PROBE_0_DEBUG(hci1394_isr_arresp_enter, HCI1394_TNF_HAL_STACK, ""); hci1394_ohci_intr_clear(soft_state->ohci, OHCI_INTR_RSPKT); @@ -820,15 +740,9 @@ hci1394_isr_arresp(hci1394_state_t *soft_state) * would still be pending. */ do { - status = hci1394_async_arresp_process(soft_state->async, + (void) hci1394_async_arresp_process(soft_state->async, &response_available); - if (status != DDI_SUCCESS) { - TNF_PROBE_0(hci1394_isr_arresp_pr_fail, - HCI1394_TNF_HAL_ERROR, ""); - } } while (response_available == B_TRUE); - - TNF_PROBE_0_DEBUG(hci1394_isr_arresp_exit, HCI1394_TNF_HAL_STACK, ""); } @@ -841,11 +755,8 @@ static void hci1394_isr_arreq(hci1394_state_t *soft_state) { boolean_t request_available; - int status; - ASSERT(soft_state != NULL); - TNF_PROBE_0_DEBUG(hci1394_isr_arreq_enter, HCI1394_TNF_HAL_STACK, ""); hci1394_ohci_intr_clear(soft_state->ohci, OHCI_INTR_RQPKT); @@ -857,15 +768,9 @@ hci1394_isr_arreq(hci1394_state_t *soft_state) * and processed it. The interrupt would still be pending. */ do { - status = hci1394_async_arreq_process(soft_state->async, + (void) hci1394_async_arreq_process(soft_state->async, &request_available); - if (status != DDI_SUCCESS) { - TNF_PROBE_0(hci1394_isr_arreq_pr_fail, - HCI1394_TNF_HAL_ERROR, ""); - } } while (request_available == B_TRUE); - - TNF_PROBE_0_DEBUG(hci1394_isr_arreq_exit, HCI1394_TNF_HAL_STACK, ""); } @@ -881,12 +786,8 @@ static void hci1394_isr_atresp_complete(hci1394_state_t *soft_state) { boolean_t response_available; - int status; - ASSERT(soft_state != NULL); - TNF_PROBE_0_DEBUG(hci1394_isr_atresp_complete_enter, - HCI1394_TNF_HAL_STACK, ""); hci1394_ohci_intr_clear(soft_state->ohci, OHCI_INTR_RESP_TX_CMPLT); @@ -902,14 +803,7 @@ hci1394_isr_atresp_complete(hci1394_state_t *soft_state) * Process a single response. Do not flush Q. That is only * done during bus reset processing. */ - status = hci1394_async_atresp_process(soft_state->async, + (void) hci1394_async_atresp_process(soft_state->async, B_FALSE, &response_available); - if (status != DDI_SUCCESS) { - TNF_PROBE_0(hci1394_isr_atresp_complete_pr_fail, - HCI1394_TNF_HAL_ERROR, ""); - } } while (response_available == B_TRUE); - - TNF_PROBE_0_DEBUG(hci1394_isr_atresp_complete_exit, - HCI1394_TNF_HAL_STACK, ""); } diff --git a/usr/src/uts/common/io/1394/adapters/hci1394_ixl_comp.c b/usr/src/uts/common/io/1394/adapters/hci1394_ixl_comp.c index 31048d5a4d..5352e6ec03 100644 --- a/usr/src/uts/common/io/1394/adapters/hci1394_ixl_comp.c +++ b/usr/src/uts/common/io/1394/adapters/hci1394_ixl_comp.c @@ -36,9 +36,6 @@ #include <sys/conf.h> #include <sys/ddi.h> #include <sys/sunddi.h> - -#include <sys/tnf_probe.h> - #include <sys/1394/h1394.h> #include <sys/1394/ixl1394.h> #include <sys/1394/adapters/hci1394.h> @@ -119,8 +116,6 @@ hci1394_compile_ixl(hci1394_state_t *soft_statep, hci1394_iso_ctxt_t *ctxtp, ASSERT(soft_statep != NULL); ASSERT(ctxtp != NULL); - TNF_PROBE_0_DEBUG(hci1394_compile_ixl_enter, - HCI1394_TNF_HAL_STACK_ISOCH, ""); /* Initialize compiler working variables */ hci1394_compile_ixl_init(&wv, soft_statep, ctxtp, ixlp); @@ -148,15 +143,9 @@ hci1394_compile_ixl(hci1394_state_t *soft_statep, hci1394_iso_ctxt_t *ctxtp, hci1394_compile_ixl_endup(&wv); *resultp = wv.dma_bld_error; - if (*resultp != 0) { - TNF_PROBE_0_DEBUG(hci1394_compile_ixl_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); + if (*resultp != 0) return (DDI_FAILURE); - } else { - TNF_PROBE_0_DEBUG(hci1394_compile_ixl_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - return (DDI_SUCCESS); - } + return (DDI_SUCCESS); } /* @@ -169,9 +158,6 @@ hci1394_compile_ixl_init(hci1394_comp_ixl_vars_t *wvp, hci1394_state_t *soft_statep, hci1394_iso_ctxt_t *ctxtp, ixl1394_command_t *ixlp) { - TNF_PROBE_0_DEBUG(hci1394_compile_ixl_init_enter, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - /* initialize common recv/xmit compile values */ wvp->soft_statep = soft_statep; wvp->ctxtp = ctxtp; @@ -231,9 +217,6 @@ hci1394_compile_ixl_init(hci1394_comp_ixl_vars_t *wvp, wvp->xmit_pkthdr1 = 0; wvp->xmit_pkthdr2 = 0; /* END XMIT ONLY SECTION */ - - TNF_PROBE_0_DEBUG(hci1394_compile_ixl_init_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); } /* @@ -249,15 +232,8 @@ hci1394_compile_ixl_endup(hci1394_comp_ixl_vars_t *wvp) hci1394_idma_desc_mem_t *dma_nextp; int err; - TNF_PROBE_0_DEBUG(hci1394_compile_ixl_endup_enter, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - /* error if no descriptor blocks found in ixl & created in dma memory */ if ((wvp->dma_bld_error == 0) && (wvp->ixl_xfer_st_cnt == 0)) { - TNF_PROBE_1(hci1394_compile_ixl_endup_nodata_error, - HCI1394_TNF_HAL_ERROR_ISOCH, "", tnf_string, errmsg, - "IXL1394_ENO_DATA_PKTS: prog has no data packets"); - wvp->dma_bld_error = IXL1394_ENO_DATA_PKTS; } @@ -268,10 +244,6 @@ hci1394_compile_ixl_endup(hci1394_comp_ixl_vars_t *wvp) /* error if a label<->jump loop, or no xfer */ if ((err == DDI_FAILURE) || (ixl_exec_stp == NULL)) { - TNF_PROBE_1(hci1394_compile_ixl_endup_error, - HCI1394_TNF_HAL_ERROR_ISOCH, "", tnf_string, errmsg, - "IXL1394_ENO_DATA_PKTS: loop or no xfer detected"); - wvp->dma_bld_error = IXL1394_ENO_DATA_PKTS; } } @@ -285,9 +257,6 @@ hci1394_compile_ixl_endup(hci1394_comp_ixl_vars_t *wvp) if (err != DDI_SUCCESS) { wvp->dma_bld_error = IXL1394_EINTERNAL_ERROR; - TNF_PROBE_1(hci1394_compile_ixl_endup_error, - HCI1394_TNF_HAL_ERROR_ISOCH, "", tnf_string, errmsg, - "IXL1394_INTERNAL_ERROR: dma_sync() failed"); break; } @@ -304,8 +273,6 @@ hci1394_compile_ixl_endup(hci1394_comp_ixl_vars_t *wvp) wvp->ctxtp->dma_firstp = wvp->dma_firstp; hci1394_ixl_cleanup(wvp->soft_statep, wvp->ctxtp); - TNF_PROBE_0_DEBUG(hci1394_compile_ixl_endup_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return; } @@ -328,8 +295,6 @@ hci1394_compile_ixl_endup(hci1394_comp_ixl_vars_t *wvp) wvp->ctxtp->ixl_execp = NULL; /* compile done */ - TNF_PROBE_0_DEBUG(hci1394_compile_ixl_endup_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); } /* @@ -352,9 +317,6 @@ hci1394_parse_ixl(hci1394_comp_ixl_vars_t *wvp, ixl1394_command_t *ixlp) uint32_t pktsize; uint32_t pktcnt; - TNF_PROBE_0_DEBUG(hci1394_parse_ixl_enter, HCI1394_TNF_HAL_STACK_ISOCH, - ""); - /* follow ixl links until reach end or find error */ while ((ixlnextp != NULL) && (wvp->dma_bld_error == 0)) { @@ -376,21 +338,8 @@ hci1394_parse_ixl(hci1394_comp_ixl_vars_t *wvp, ixl1394_command_t *ixlp) /* check if command op failed because it was invalid */ if (hci1394_is_opcode_valid(ixlopcode) != B_TRUE) { - TNF_PROBE_3(hci1394_parse_ixl_bad_opcode_error, - HCI1394_TNF_HAL_ERROR_ISOCH, "", tnf_string, - errmsg, "IXL1394_BAD_IXL_OPCODE", - tnf_opaque, ixl_commandp, ixlcurp, - tnf_opaque, ixl_opcode, ixlopcode); - wvp->dma_bld_error = IXL1394_EBAD_IXL_OPCODE; } else { - TNF_PROBE_3(hci1394_parse_ixl_mode_error, - HCI1394_TNF_HAL_ERROR_ISOCH, "", tnf_string, - errmsg, "IXL1394_EWRONG_XR_CMD_MODE: " - "invalid ixlop in mode", tnf_uint, io_mode, - wvp->ixl_io_mode, tnf_opaque, ixl_opcode, - ixlopcode); - wvp->dma_bld_error = IXL1394_EWRONG_XR_CMD_MODE; } continue; @@ -455,14 +404,6 @@ hci1394_parse_ixl(hci1394_comp_ixl_vars_t *wvp, ixl1394_command_t *ixlp) } if ((pktcnt == 0) || ((pktsize * pktcnt) != cur_xfer_buf_ixlp->size)) { - - TNF_PROBE_3(hci1394_parse_ixl_rat_error, - HCI1394_TNF_HAL_ERROR_ISOCH, "", - tnf_string, errmsg, - "IXL1394_EPKTSIZE_RATIO", tnf_int, - buf_size, cur_xfer_buf_ixlp->size, - tnf_int, pkt_size, pktsize); - wvp->dma_bld_error = IXL1394_EPKTSIZE_RATIO; continue; @@ -491,11 +432,6 @@ hci1394_parse_ixl(hci1394_comp_ixl_vars_t *wvp, ixl1394_command_t *ixlp) /* error if in buffer fill mode */ if ((wvp->ixl_io_mode & HCI1394_ISO_CTXT_BFFILL) != 0) { - TNF_PROBE_1(hci1394_parse_ixl_mode_error, - HCI1394_TNF_HAL_ERROR_ISOCH, "", tnf_string, - errmsg, "IXL1394_EWRONG_XR_CMD_MODE: " - "RECV_PKT_ST used in BFFILL mode"); - wvp->dma_bld_error = IXL1394_EWRONG_XR_CMD_MODE; continue; } @@ -527,22 +463,12 @@ hci1394_parse_ixl(hci1394_comp_ixl_vars_t *wvp, ixl1394_command_t *ixlp) /* error if in buffer fill mode */ if ((wvp->ixl_io_mode & HCI1394_ISO_CTXT_BFFILL) != 0) { - TNF_PROBE_1(hci1394_parse_ixl_mode_error, - HCI1394_TNF_HAL_ERROR_ISOCH, "", tnf_string, - errmsg, "IXL1394_EWRONG_XR_CMD_MODE: " - "RECV_PKT_ST used in BFFILL mode"); - wvp->dma_bld_error = IXL1394_EWRONG_XR_CMD_MODE; continue; } /* error if xfer_state not xfer pkt */ if (wvp->xfer_state != XFER_PKT) { - TNF_PROBE_1(hci1394_parse_ixl_misplacercv_error, - HCI1394_TNF_HAL_ERROR_ISOCH, "", tnf_string, - errmsg, "IXL1394_EMISPLACED_RECV: " - "RECV_PKT without RECV_PKT_ST"); - wvp->dma_bld_error = IXL1394_EMISPLACED_RECV; continue; } @@ -610,13 +536,6 @@ hci1394_parse_ixl(hci1394_comp_ixl_vars_t *wvp, ixl1394_command_t *ixlp) } if ((pktcnt == 0) || ((pktsize * pktcnt) != cur_xfer_buf_ixlp->size)) { - - TNF_PROBE_3(hci1394_parse_ixl_rat_error, - HCI1394_TNF_HAL_ERROR_ISOCH, "", tnf_string, - errmsg, "IXL1394_EPKTSIZE_RATIO", tnf_int, - buf_size, cur_xfer_buf_ixlp->size, tnf_int, - pkt_size, pktsize); - wvp->dma_bld_error = IXL1394_EPKTSIZE_RATIO; continue; } @@ -673,11 +592,6 @@ hci1394_parse_ixl(hci1394_comp_ixl_vars_t *wvp, ixl1394_command_t *ixlp) * else error */ if (cur_xfer_pkt_ixlp->size < 4) { - TNF_PROBE_2(hci1394_parse_ixl_hdr_missing_error, - HCI1394_TNF_HAL_ERROR_ISOCH, "", tnf_string, - errmsg, "IXL1394_EPKT_HDR_MISSING", tnf_int, - pkt_size, cur_xfer_pkt_ixlp->size); - wvp->dma_bld_error = IXL1394_EPKT_HDR_MISSING; continue; } @@ -704,11 +618,6 @@ hci1394_parse_ixl(hci1394_comp_ixl_vars_t *wvp, ixl1394_command_t *ixlp) /* error if xfer_state not xfer pkt */ if (wvp->xfer_state != XFER_PKT) { - TNF_PROBE_1(hci1394_parse_ixl_misplacesnd_error, - HCI1394_TNF_HAL_ERROR_ISOCH, "", tnf_string, - errmsg, "IXL1394_EMISPLACED_SEND: SEND_PKT " - "without SEND_PKT_ST"); - wvp->dma_bld_error = IXL1394_EMISPLACED_SEND; continue; } @@ -777,13 +686,6 @@ hci1394_parse_ixl(hci1394_comp_ixl_vars_t *wvp, ixl1394_command_t *ixlp) if ((cur_jump_ixlp->label != NULL) && (cur_jump_ixlp->label->ixl_opcode != IXL1394_OP_LABEL)) { - TNF_PROBE_3(hci1394_parse_ixl_jumplabel_error, - HCI1394_TNF_HAL_ERROR_ISOCH, "", tnf_string, - errmsg, "IXL1394_EJUMP_NOT_TO_LABEL", - tnf_opaque, jumpixl_commandp, ixlcurp, - tnf_opaque, jumpto_ixl, - cur_jump_ixlp->label); - wvp->dma_bld_error = IXL1394_EJUMP_NOT_TO_LABEL; continue; } @@ -818,12 +720,6 @@ hci1394_parse_ixl(hci1394_comp_ixl_vars_t *wvp, ixl1394_command_t *ixlp) * this xfer */ if (wvp->ixl_setskipmode_cmdp != NULL) { - TNF_PROBE_2(hci1394_parse_ixl_dup_set_error, - HCI1394_TNF_HAL_ERROR_ISOCH, "", tnf_string, - errmsg, "IXL1394_EDUPLICATE_SET_CMD:" - " duplicate set skipmode", tnf_opaque, - ixl_commandp, ixlcurp); - wvp->dma_bld_error = IXL1394_EDUPLICATE_SET_CMD; continue; } @@ -840,13 +736,6 @@ hci1394_parse_ixl(hci1394_comp_ixl_vars_t *wvp, ixl1394_command_t *ixlp) IXL1394_SKIP_TO_STOP) && (wvp->ixl_setskipmode_cmdp->skipmode != IXL1394_SKIP_TO_LABEL)) { - - TNF_PROBE_3(hci1394_parse_ixl_dup_set_error, - HCI1394_TNF_HAL_ERROR_ISOCH, "", tnf_string, - errmsg, "IXL EBAD_SKIPMODE", tnf_opaque, - ixl_commandp, ixlcurp, tnf_int, skip, - wvp->ixl_setskipmode_cmdp->skipmode); - wvp->dma_bld_error = IXL1394_EBAD_SKIPMODE; continue; } @@ -860,14 +749,6 @@ hci1394_parse_ixl(hci1394_comp_ixl_vars_t *wvp, ixl1394_command_t *ixlp) ((wvp->ixl_setskipmode_cmdp->label == NULL) || (wvp->ixl_setskipmode_cmdp->label->ixl_opcode != IXL1394_OP_LABEL))) { - - TNF_PROBE_3(hci1394_parse_ixl_jump_error, - HCI1394_TNF_HAL_ERROR_ISOCH, "", tnf_string, - errmsg, "IXL1394_EJUMP_NOT_TO_LABEL", - tnf_opaque, jumpixl_commandp, ixlcurp, - tnf_opaque, jumpto_ixl, - wvp->ixl_setskipmode_cmdp->label); - wvp->dma_bld_error = IXL1394_EJUMP_NOT_TO_LABEL; continue; } @@ -887,12 +768,6 @@ hci1394_parse_ixl(hci1394_comp_ixl_vars_t *wvp, ixl1394_command_t *ixlp) * for this xfer */ if (wvp->ixl_settagsync_cmdp != NULL) { - TNF_PROBE_2(hci1394_parse_ixl_dup_set_error, - HCI1394_TNF_HAL_ERROR_ISOCH, "", tnf_string, - errmsg, "IXL1394_EDUPLICATE_SET_CMD:" - " duplicate set tagsync", tnf_opaque, - ixl_commandp, ixlcurp); - wvp->dma_bld_error = IXL1394_EDUPLICATE_SET_CMD; continue; } @@ -921,11 +796,6 @@ hci1394_parse_ixl(hci1394_comp_ixl_vars_t *wvp, ixl1394_command_t *ixlp) default: /* error - unknown/unimplemented ixl command */ - TNF_PROBE_3(hci1394_parse_ixl_bad_opcode_error, - HCI1394_TNF_HAL_ERROR_ISOCH, "", tnf_string, errmsg, - "IXL1394_BAD_IXL_OPCODE", tnf_opaque, ixl_commandp, - ixlcurp, tnf_opaque, ixl_opcode, ixlopcode); - wvp->dma_bld_error = IXL1394_EBAD_IXL_OPCODE; continue; } @@ -936,9 +806,6 @@ hci1394_parse_ixl(hci1394_comp_ixl_vars_t *wvp, ixl1394_command_t *ixlp) if (wvp->dma_bld_error == 0) { hci1394_finalize_cur_xfer_desc(wvp); } - - TNF_PROBE_0_DEBUG(hci1394_parse_ixl_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); } /* @@ -973,9 +840,6 @@ hci1394_finalize_all_xfer_desc(hci1394_comp_ixl_vars_t *wvp) int ii; int err; - TNF_PROBE_0_DEBUG(hci1394_finalize_all_xfer_desc_enter, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - /* * If xmit mode and if default skipmode is skip to label - * follow exec path starting at default skipmode label until @@ -988,14 +852,6 @@ hci1394_finalize_all_xfer_desc(hci1394_comp_ixl_vars_t *wvp) err = hci1394_ixl_find_next_exec_xfer(wvp->default_skiplabelp, NULL, &wvp->default_skipxferp); if (err == DDI_FAILURE) { - TNF_PROBE_2(hci1394_finalize_all_xfer_desc_error, - HCI1394_TNF_HAL_ERROR_ISOCH, "", tnf_string, errmsg, - "IXL1394_ENO_DATA_PKTS: label<->jump loop detected " - "for skiplabel default w/no xfers", tnf_opaque, - skipixl_cmdp, wvp->default_skiplabelp); - TNF_PROBE_0_DEBUG(hci1394_finalize_all_xfer_desc_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - wvp->dma_bld_error = IXL1394_ENO_DATA_PKTS; return; } @@ -1058,12 +914,6 @@ hci1394_finalize_all_xfer_desc(hci1394_comp_ixl_vars_t *wvp) /* if label<->jump loop detected, return error */ if (err == DDI_FAILURE) { wvp->dma_bld_error = IXL1394_ENO_DATA_PKTS; - - TNF_PROBE_2(hci1394_finalize_all_xfer_desc_error, - HCI1394_TNF_HAL_ERROR_ISOCH, "", tnf_string, errmsg, - "IXL1394_ENO_DATA_PKTS: label<->jump loop detected " - "w/no xfers", tnf_opaque, ixl_cmdp, - ixlcurp->next_ixlp); continue; } @@ -1226,9 +1076,6 @@ hci1394_finalize_all_xfer_desc(hci1394_comp_ixl_vars_t *wvp) } /* for */ } /* if */ } /* while */ - - TNF_PROBE_0_DEBUG(hci1394_finalize_all_xfer_desc_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); } /* @@ -1244,9 +1091,6 @@ hci1394_finalize_cur_xfer_desc(hci1394_comp_ixl_vars_t *wvp) uint16_t ixlopcode; uint16_t ixlopraw; - TNF_PROBE_0_DEBUG(hci1394_finalize_cur_xfer_desc_enter, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - /* extract opcode from current IXL cmd (if any) */ if (wvp->ixl_cur_cmdp != NULL) { ixlopcode = wvp->ixl_cur_cmdp->ixl_opcode; @@ -1272,40 +1116,17 @@ hci1394_finalize_cur_xfer_desc(hci1394_comp_ixl_vars_t *wvp) if ((wvp->ixl_settagsync_cmdp != NULL) || (wvp->ixl_setskipmode_cmdp != NULL) || (wvp->ixl_setsyncwait_cnt != 0)) { - wvp->dma_bld_error = IXL1394_EUNAPPLIED_SET_CMD; - - TNF_PROBE_2( - hci1394_finalize_cur_xfer_desc_set_error, - HCI1394_TNF_HAL_ERROR_ISOCH, "", tnf_string, - errmsg, "IXL1394_UNAPPLIED_SET_CMD: " - "orphaned set (no associated packet)", - tnf_opaque, ixl_commandp, - wvp->ixl_cur_cmdp); - TNF_PROBE_0_DEBUG( - hci1394_finalize_cur_xfer_desc_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return; } } /* error if finalize is due to updateable jump cmd */ if (ixlopcode == IXL1394_OP_JUMP_U) { - wvp->dma_bld_error = IXL1394_EUPDATE_DISALLOWED; - - TNF_PROBE_2(hci1394_finalize_cur_xfer_desc_upd_error, - HCI1394_TNF_HAL_ERROR_ISOCH, "", tnf_string, errmsg, - "IXL1394_EUPDATE_DISALLOWED: jumpU w/out pkt", - tnf_opaque, ixl_commandp, wvp->ixl_cur_cmdp); - TNF_PROBE_0_DEBUG(hci1394_finalize_cur_xfer_desc_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return; } - TNF_PROBE_0_DEBUG(hci1394_finalize_cur_xfer_desc_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - /* no error, no xfer */ return; } @@ -1350,12 +1171,7 @@ hci1394_finalize_cur_xfer_desc(hci1394_comp_ixl_vars_t *wvp) IXL1394_OPTY_XFER_PKT_ST) != 0) || ((wvp->xfer_hci_flush & (UPDATEABLE_XFER | UPDATEABLE_SET | INITIATING_LBL)) != 0)) { - if (hci1394_flush_hci_cache(wvp) != DDI_SUCCESS) { - TNF_PROBE_0_DEBUG( - hci1394_finalize_cur_xfer_desc_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - /* wvp->dma_bld_error is set by above call */ return; } @@ -1395,18 +1211,11 @@ hci1394_finalize_cur_xfer_desc(hci1394_comp_ixl_vars_t *wvp) default: /* internal compiler error */ - TNF_PROBE_2(hci1394_finalize_cur_xfer_desc_internal_error, - HCI1394_TNF_HAL_ERROR_ISOCH, "", tnf_string, errmsg, - "IXL1394_INTERNAL_ERROR: invalid state", tnf_opaque, - ixl_commandp, wvp->ixl_cur_cmdp); wvp->dma_bld_error = IXL1394_EINTERNAL_ERROR; } /* return if error */ if (wvp->dma_bld_error != 0) { - TNF_PROBE_0_DEBUG(hci1394_finalize_cur_xfer_desc_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - /* wvp->dma_bld_error is set by above call */ return; } @@ -1458,9 +1267,6 @@ hci1394_finalize_cur_xfer_desc(hci1394_comp_ixl_vars_t *wvp) /* set no xmit descriptor block being built */ wvp->xfer_state = XFER_NONE; - - TNF_PROBE_0_DEBUG(hci1394_finalize_cur_xfer_desc_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); } /* @@ -1477,38 +1283,18 @@ hci1394_bld_recv_pkt_desc(hci1394_comp_ixl_vars_t *wvp) uint32_t ii; hci1394_desc_t *wv_descp; /* shorthand to local descrpt */ - TNF_PROBE_0_DEBUG(hci1394_bld_recv_pkt_desc_enter, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - /* * is error if number of descriptors to be built exceeds maximum * descriptors allowed in a descriptor block. */ if ((wvp->descriptors + wvp->xfer_bufcnt) > HCI1394_DESC_MAX_Z) { - wvp->dma_bld_error = IXL1394_EFRAGMENT_OFLO; - - TNF_PROBE_3(hci1394_bld_recv_pkt_desc_fragment_oflo_error, - HCI1394_TNF_HAL_ERROR_ISOCH, "", tnf_string, errmsg, - "IXL1394_EFRAGMENT_OFLO", tnf_opaque, ixl_commandp, - wvp->ixl_cur_xfer_stp, tnf_int, frag_count, - wvp->descriptors + wvp->xfer_bufcnt); - TNF_PROBE_0_DEBUG(hci1394_bld_recv_pkt_desc_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return; } /* allocate an xfer_ctl struct, including 1 xfer_ctl_dma struct */ if ((xctlp = hci1394_alloc_xfer_ctl(wvp, 1)) == NULL) { - wvp->dma_bld_error = IXL1394_EMEM_ALLOC_FAIL; - - TNF_PROBE_2(hci1394_bld_recv_pkt_desc_mem_alloc_fail, - HCI1394_TNF_HAL_ERROR_ISOCH, "", tnf_string, errmsg, - "IXL1394_EMEM_ALLOC_FAIL: for xfer_ctl", tnf_opaque, - ixl_commandp, wvp->ixl_cur_xfer_stp); - TNF_PROBE_0_DEBUG(hci1394_bld_recv_pkt_desc_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return; } @@ -1550,9 +1336,6 @@ hci1394_bld_recv_pkt_desc(hci1394_comp_ixl_vars_t *wvp) /* allocate and copy descriptor block to dma memory */ if (hci1394_bld_dma_mem_desc_blk(wvp, &dma_descp, &dma_desc_bound) != DDI_SUCCESS) { - TNF_PROBE_0_DEBUG(hci1394_bld_recv_pkt_desc_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - /* wvp->dma_bld_error is set by above function call */ return; } @@ -1565,9 +1348,6 @@ hci1394_bld_recv_pkt_desc(hci1394_comp_ixl_vars_t *wvp) xctlp->dma[0].dma_descp = dma_descp + (wvp->xfer_bufcnt - 1) * sizeof (hci1394_desc_t); xctlp->dma[0].dma_buf = &wvp->dma_currentp->mem; - - TNF_PROBE_0_DEBUG(hci1394_bld_recv_pkt_desc_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); } /* @@ -1588,9 +1368,6 @@ hci1394_bld_recv_buf_ppb_desc(hci1394_comp_ixl_vars_t *wvp) uint32_t ii; hci1394_desc_t *wv_descp; /* shorthand to local descriptor */ - TNF_PROBE_0_DEBUG(hci1394_bld_recv_buf_ppb_desc_enter, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - local_ixl_cur_xfer_stp = (ixl1394_xfer_buf_t *)wvp->ixl_cur_xfer_stp; /* determine number and size of pkt desc blocks to create */ @@ -1599,15 +1376,7 @@ hci1394_bld_recv_buf_ppb_desc(hci1394_comp_ixl_vars_t *wvp) /* allocate an xfer_ctl struct including pktcnt xfer_ctl_dma structs */ if ((xctlp = hci1394_alloc_xfer_ctl(wvp, pktcnt)) == NULL) { - wvp->dma_bld_error = IXL1394_EMEM_ALLOC_FAIL; - - TNF_PROBE_2(hci1394_bld_recv_buf_ppb_desc_mem_alloc_fail, - HCI1394_TNF_HAL_ERROR_ISOCH, "", tnf_string, errmsg, - "IXL1394_EMEM_ALLOC_FAIL: for xfer_ctl", tnf_opaque, - ixl_commandp, wvp->ixl_cur_xfer_stp); - TNF_PROBE_0_DEBUG(hci1394_bld_recv_buf_ppb_desc_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return; } @@ -1639,12 +1408,6 @@ hci1394_bld_recv_buf_ppb_desc(hci1394_comp_ixl_vars_t *wvp) DESC_ST_RESCOUNT_MASK; wvp->descriptors++; - /* useful debug trace info - IXL command, and packet count and size */ - TNF_PROBE_3_DEBUG(hci1394_bld_recv_buf_ppb_desc_recv_buf_info, - HCI1394_TNF_HAL_INFO_ISOCH, "", tnf_opaque, ixl_commandp, - wvp->ixl_cur_xfer_stp, tnf_int, pkt_count, pktcnt, tnf_int, - pkt_size, pktsize); - /* * generate as many contiguous descriptor blocks as there are * recv pkts @@ -1656,14 +1419,6 @@ hci1394_bld_recv_buf_ppb_desc(hci1394_comp_ixl_vars_t *wvp) /* check and perform any required hci cache flush */ if (hci1394_flush_end_desc_check(wvp, ii) != DDI_SUCCESS) { - TNF_PROBE_1_DEBUG( - hci1394_bld_recv_buf_ppb_desc_fl_error, - HCI1394_TNF_HAL_INFO_ISOCH, "", tnf_int, - for_ii, ii); - TNF_PROBE_0_DEBUG( - hci1394_bld_recv_buf_ppb_desc_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - /* wvp->dma_bld_error is set by above call */ return; } @@ -1672,10 +1427,6 @@ hci1394_bld_recv_buf_ppb_desc(hci1394_comp_ixl_vars_t *wvp) /* allocate and copy descriptor block to dma memory */ if (hci1394_bld_dma_mem_desc_blk(wvp, &dma_descp, &dma_desc_bound) != DDI_SUCCESS) { - - TNF_PROBE_0_DEBUG(hci1394_bld_recv_buf_ppb_desc_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - /* wvp->dma_bld_error is set by above call */ return; } @@ -1692,8 +1443,6 @@ hci1394_bld_recv_buf_ppb_desc(hci1394_comp_ixl_vars_t *wvp) wvp->descriptor_block[wvp->descriptors - 1].data_addr += pktsize; } - TNF_PROBE_0_DEBUG(hci1394_bld_recv_buf_ppb_desc_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); } /* @@ -1710,23 +1459,12 @@ hci1394_bld_recv_buf_fill_desc(hci1394_comp_ixl_vars_t *wvp) uint32_t wait_for_sync; ixl1394_xfer_buf_t *local_ixl_cur_xfer_stp; - TNF_PROBE_0_DEBUG(hci1394_bld_recv_buf_fill_desc_enter, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - local_ixl_cur_xfer_stp = (ixl1394_xfer_buf_t *)wvp->ixl_cur_xfer_stp; /* allocate an xfer_ctl struct including 1 xfer_ctl_dma structs */ if ((xctlp = hci1394_alloc_xfer_ctl(wvp, 1)) == NULL) { - wvp->dma_bld_error = IXL1394_EMEM_ALLOC_FAIL; - - TNF_PROBE_2(hci1394_bld_recv_buf_fill_desc_mem_alloc_fail, - HCI1394_TNF_HAL_ERROR_ISOCH, "", tnf_string, errmsg, - "IXL1394_EMEM_ALLOC_FAIL: xfer_ctl", tnf_opaque, - ixl_commandp, wvp->ixl_cur_xfer_stp); - TNF_PROBE_0_DEBUG(hci1394_bld_recv_buf_fill_desc_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return; } @@ -1764,9 +1502,6 @@ hci1394_bld_recv_buf_fill_desc(hci1394_comp_ixl_vars_t *wvp) /* check and perform any required hci cache flush */ if (hci1394_flush_end_desc_check(wvp, 0) != DDI_SUCCESS) { - TNF_PROBE_0_DEBUG(hci1394_bld_recv_buf_fill_desc_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - /* wvp->dma_bld_error is set by above call */ return; } @@ -1774,9 +1509,6 @@ hci1394_bld_recv_buf_fill_desc(hci1394_comp_ixl_vars_t *wvp) /* allocate and copy descriptor block to dma memory */ if (hci1394_bld_dma_mem_desc_blk(wvp, &dma_descp, &dma_desc_bound) != DDI_SUCCESS) { - TNF_PROBE_0_DEBUG(hci1394_bld_recv_buf_fill_desc_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - /* wvp->dma_bld_error is set by above call */ return; } @@ -1788,9 +1520,6 @@ hci1394_bld_recv_buf_fill_desc(hci1394_comp_ixl_vars_t *wvp) xctlp->dma[0].dma_bound = dma_desc_bound; xctlp->dma[0].dma_descp = dma_descp; xctlp->dma[0].dma_buf = &wvp->dma_currentp->mem; - - TNF_PROBE_0_DEBUG(hci1394_bld_recv_buf_fill_desc_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); } /* @@ -1807,54 +1536,25 @@ hci1394_bld_xmit_pkt_desc(hci1394_comp_ixl_vars_t *wvp) uint32_t dma_desc_bound; uint32_t ii; - TNF_PROBE_0_DEBUG(hci1394_bld_xmit_pkt_desc_enter, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - /* * is error if number of descriptors to be built exceeds maximum * descriptors allowed in a descriptor block. Add 2 for the overhead * of the OMORE-Immediate. */ if ((wvp->descriptors + 2 + wvp->xfer_bufcnt) > HCI1394_DESC_MAX_Z) { - wvp->dma_bld_error = IXL1394_EFRAGMENT_OFLO; - - TNF_PROBE_3(hci1394_bld_xmit_pkt_desc_fragment_oflo_error, - HCI1394_TNF_HAL_ERROR_ISOCH, "", tnf_string, errmsg, - "IXL1394_EFRAGMENT_OFLO", tnf_opaque, ixl_commandp, - wvp->ixl_cur_xfer_stp, tnf_int, frag_count, - wvp->descriptors + 2 + wvp->xfer_bufcnt); - TNF_PROBE_0_DEBUG(hci1394_bld_xmit_pkt_desc_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return; } /* is error if total packet length exceeds 0xFFFF */ if (wvp->xfer_pktlen > 0xFFFF) { - wvp->dma_bld_error = IXL1394_EPKTSIZE_MAX_OFLO; - - TNF_PROBE_3(hci1394_bld_xmit_pkt_desc_packet_oflo_error, - HCI1394_TNF_HAL_ERROR_ISOCH, "", tnf_string, errmsg, - "IXL1394_EPKTSIZE_MAX_OFLO", tnf_opaque, ixl_commandp, - wvp->ixl_cur_xfer_stp, tnf_int, total_pktlen, - wvp->xfer_pktlen); - TNF_PROBE_0_DEBUG(hci1394_bld_xmit_pkt_desc_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return; } /* allocate an xfer_ctl struct, including 1 xfer_ctl_dma struct */ if ((xctlp = hci1394_alloc_xfer_ctl(wvp, 1)) == NULL) { - wvp->dma_bld_error = IXL1394_EMEM_ALLOC_FAIL; - - TNF_PROBE_2(hci1394_bld_xmit_pkt_desc_mem_alloc_fail, - HCI1394_TNF_HAL_ERROR_ISOCH, "", tnf_string, errmsg, - "IXL1394_EMEM_ALLOC_FAIL: for xfer_ctl", tnf_opaque, - ixl_commandp, wvp->ixl_cur_cmdp); - TNF_PROBE_0_DEBUG(hci1394_bld_xmit_pkt_desc_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return; } @@ -1907,9 +1607,6 @@ hci1394_bld_xmit_pkt_desc(hci1394_comp_ixl_vars_t *wvp) /* allocate and copy descriptor block to dma memory */ if (hci1394_bld_dma_mem_desc_blk(wvp, &dma_descp, &dma_desc_bound) != DDI_SUCCESS) { - TNF_PROBE_0_DEBUG(hci1394_bld_xmit_pkt_desc_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - /* wvp->dma_bld_error is set by above call */ return; } @@ -1922,9 +1619,6 @@ hci1394_bld_xmit_pkt_desc(hci1394_comp_ixl_vars_t *wvp) xctlp->dma[0].dma_descp = dma_descp + (wvp->xfer_bufcnt + 1) * sizeof (hci1394_desc_t); xctlp->dma[0].dma_buf = &wvp->dma_currentp->mem; - - TNF_PROBE_0_DEBUG(hci1394_bld_xmit_pkt_desc_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); } /* @@ -1944,9 +1638,6 @@ hci1394_bld_xmit_buf_desc(hci1394_comp_ixl_vars_t *wvp) uint32_t pktcnt; uint32_t ii; - TNF_PROBE_0_DEBUG(hci1394_bld_xmit_buf_desc_enter, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - local_ixl_cur_xfer_stp = (ixl1394_xfer_buf_t *)wvp->ixl_cur_xfer_stp; /* determine number and size of pkt desc blocks to create */ @@ -1955,15 +1646,7 @@ hci1394_bld_xmit_buf_desc(hci1394_comp_ixl_vars_t *wvp) /* allocate an xfer_ctl struct including pktcnt xfer_ctl_dma structs */ if ((xctlp = hci1394_alloc_xfer_ctl(wvp, pktcnt)) == NULL) { - wvp->dma_bld_error = IXL1394_EMEM_ALLOC_FAIL; - - TNF_PROBE_2(hci1394_bld_xmit_buf_desc_mem_alloc_fail, - HCI1394_TNF_HAL_ERROR_ISOCH, "", tnf_string, errmsg, - "IXL1394_EMEM_ALLOC_FAIL: for xfer_ctl", tnf_opaque, - ixl_commandp, wvp->ixl_cur_cmdp); - TNF_PROBE_0_DEBUG(hci1394_bld_xmit_buf_desc_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return; } @@ -2016,10 +1699,6 @@ hci1394_bld_xmit_buf_desc(hci1394_comp_ixl_vars_t *wvp) /* check and perform any required hci cache flush */ if (hci1394_flush_end_desc_check(wvp, ii) != DDI_SUCCESS) { - TNF_PROBE_0_DEBUG( - hci1394_bld_xmit_buf_desc_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - /* wvp->dma_bld_error is set by above call */ return; } @@ -2028,9 +1707,6 @@ hci1394_bld_xmit_buf_desc(hci1394_comp_ixl_vars_t *wvp) /* allocate and copy descriptor block to dma memory */ if (hci1394_bld_dma_mem_desc_blk(wvp, &dma_descp, &dma_desc_bound) != DDI_SUCCESS) { - TNF_PROBE_0_DEBUG(hci1394_bld_xmit_buf_desc_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - /* wvp->dma_bld_error is set by above call */ return; } @@ -2048,8 +1724,6 @@ hci1394_bld_xmit_buf_desc(hci1394_comp_ixl_vars_t *wvp) wvp->descriptor_block[wvp->descriptors - 1].data_addr += pktsize; } - TNF_PROBE_0_DEBUG(hci1394_bld_xmit_buf_desc_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); } /* @@ -2074,9 +1748,6 @@ hci1394_bld_xmit_hdronly_nopkt_desc(hci1394_comp_ixl_vars_t *wvp) uint32_t repcnt; uint32_t ii; - TNF_PROBE_0_DEBUG(hci1394_bld_xmit_hdronly_nopkt_desc_enter, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - /* determine # of instances of output hdronly/nopkt to generate */ repcnt = ((ixl1394_xmit_special_t *)wvp->ixl_cur_xfer_stp)->count; @@ -2088,12 +1759,6 @@ hci1394_bld_xmit_hdronly_nopkt_desc(hci1394_comp_ixl_vars_t *wvp) wvp->dma_bld_error = IXL1394_EMEM_ALLOC_FAIL; - TNF_PROBE_2(hci1394_bld_xmit_hdronly_nopkt_desc_mem_alloc_fail, - HCI1394_TNF_HAL_ERROR_ISOCH, "", tnf_string, errmsg, - "IXL EMEM_ALLOC_FAIL: for xfer_ctl", tnf_opaque, - ixl_commandp, wvp->ixl_cur_cmdp); - TNF_PROBE_0_DEBUG(hci1394_bld_xmit_hdronly_nopkt_desc_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return; } @@ -2162,10 +1827,6 @@ hci1394_bld_xmit_hdronly_nopkt_desc(hci1394_comp_ixl_vars_t *wvp) /* check and perform any required hci cache flush */ if (hci1394_flush_end_desc_check(wvp, ii) != DDI_SUCCESS) { - TNF_PROBE_0_DEBUG( - hci1394_bld_xmit_hdronly_nopkt_desc_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - /* wvp->dma_bld_error is set by above call */ return; } @@ -2174,10 +1835,6 @@ hci1394_bld_xmit_hdronly_nopkt_desc(hci1394_comp_ixl_vars_t *wvp) /* allocate and copy descriptor block to dma memory */ if (hci1394_bld_dma_mem_desc_blk(wvp, &dma_descp, &dma_desc_bound) != DDI_SUCCESS) { - TNF_PROBE_0_DEBUG( - hci1394_bld_xmit_hdronly_nopkt_desc_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - /* wvp->dma_bld_error is set by above call */ return; } @@ -2190,8 +1847,6 @@ hci1394_bld_xmit_hdronly_nopkt_desc(hci1394_comp_ixl_vars_t *wvp) xctlp->dma[ii].dma_descp = dma_descp + sizeof (hci1394_desc_t); xctlp->dma[ii].dma_buf = &wvp->dma_currentp->mem; } - TNF_PROBE_0_DEBUG(hci1394_bld_xmit_hdronly_nopkt_desc_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); } /* @@ -2204,19 +1859,9 @@ hci1394_bld_dma_mem_desc_blk(hci1394_comp_ixl_vars_t *wvp, caddr_t *dma_descpp, { uint32_t dma_bound; - TNF_PROBE_0_DEBUG(hci1394_bld_dma_mem_desc_blk_enter, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - /* set internal error if no descriptor blocks to build */ if (wvp->descriptors == 0) { - wvp->dma_bld_error = IXL1394_EINTERNAL_ERROR; - - TNF_PROBE_1(hci1394_bld_dma_mem_desc_blk_error, - HCI1394_TNF_HAL_ERROR_ISOCH, "", tnf_string, errmsg, - "IXL1394_INTERNAL_ERROR: no descriptors to build"); - TNF_PROBE_0_DEBUG(hci1394_bld_dma_mem_desc_blk_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (DDI_FAILURE); } @@ -2225,14 +1870,7 @@ hci1394_bld_dma_mem_desc_blk(hci1394_comp_ixl_vars_t *wvp, caddr_t *dma_descpp, sizeof (hci1394_desc_t), &dma_bound); if (*dma_descpp == NULL) { - wvp->dma_bld_error = IXL1394_EMEM_ALLOC_FAIL; - - TNF_PROBE_1(hci1394_bld_dma_mem_desc_blk_fail, - HCI1394_TNF_HAL_ERROR_ISOCH, "", tnf_string, errmsg, - "IXL1394_EMEM_ALLOC_FAIL: for descriptors"); - TNF_PROBE_0_DEBUG(hci1394_bld_dma_mem_desc_blk_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (DDI_FAILURE); } #ifdef _KERNEL @@ -2250,9 +1888,6 @@ hci1394_bld_dma_mem_desc_blk(hci1394_comp_ixl_vars_t *wvp, caddr_t *dma_descpp, */ *dma_desc_bound = (dma_bound & ~DESC_Z_MASK) | wvp->descriptors; - TNF_PROBE_0_DEBUG(hci1394_bld_dma_mem_desc_blk_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - return (DDI_SUCCESS); } @@ -2266,9 +1901,6 @@ hci1394_set_xmit_pkt_hdr(hci1394_comp_ixl_vars_t *wvp) uint16_t tag; uint16_t sync; - TNF_PROBE_0_DEBUG(hci1394_set_xmit_pkt_hdr_enter, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - /* * choose tag and sync bits for header either from default values or * from currently active set tag and sync IXL command @@ -2296,9 +1928,6 @@ hci1394_set_xmit_pkt_hdr(hci1394_comp_ixl_vars_t *wvp) DESC_PKT_TCODE_SHIFT) | (sync << DESC_PKT_SY_SHIFT); wvp->xmit_pkthdr2 = wvp->xfer_pktlen << DESC_PKT_DATALEN_SHIFT; - - TNF_PROBE_0_DEBUG(hci1394_set_xmit_pkt_hdr_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); } /* @@ -2313,9 +1942,6 @@ hci1394_set_xmit_skip_mode(hci1394_comp_ixl_vars_t *wvp) { int err; - TNF_PROBE_0_DEBUG(hci1394_set_xmit_skip_mode_enter, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - if (wvp->ixl_setskipmode_cmdp == NULL) { wvp->skipmode = wvp->default_skipmode; wvp->skiplabelp = wvp->default_skiplabelp; @@ -2328,12 +1954,6 @@ hci1394_set_xmit_skip_mode(hci1394_comp_ixl_vars_t *wvp) err = hci1394_ixl_find_next_exec_xfer(wvp->skiplabelp, NULL, &wvp->skipxferp); if (err == DDI_FAILURE) { - TNF_PROBE_2(hci1394_set_xmit_skip_mode_error, - HCI1394_TNF_HAL_ERROR_ISOCH, "", tnf_string, - errmsg, "IXL1394_ENO_DATA_PKTS: " - "label<->jump loop detected for skiplabel " - "w/no xfers", tnf_opaque, setskip_cmdp, - wvp->ixl_setskipmode_cmdp); wvp->skipxferp = NULL; wvp->dma_bld_error = IXL1394_ENO_DATA_PKTS; } @@ -2341,8 +1961,6 @@ hci1394_set_xmit_skip_mode(hci1394_comp_ixl_vars_t *wvp) wvp->ixl_setskipmode_cmdp->compiler_privatep = (void *)wvp->skipxferp; } - TNF_PROBE_0_DEBUG(hci1394_set_xmit_skip_mode_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); } /* @@ -2354,9 +1972,6 @@ hci1394_set_xmit_skip_mode(hci1394_comp_ixl_vars_t *wvp) static void hci1394_set_xmit_storevalue_desc(hci1394_comp_ixl_vars_t *wvp) { - TNF_PROBE_0_DEBUG(hci1394_set_xmit_storevalue_desc_enter, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - wvp->descriptors++; HCI1394_INIT_IT_STORE(&wvp->descriptor_block[wvp->descriptors - 1], @@ -2365,9 +1980,6 @@ hci1394_set_xmit_storevalue_desc(hci1394_comp_ixl_vars_t *wvp) wvp->storevalue_bufp; wvp->descriptor_block[wvp->descriptors - 1].branch = 0; wvp->descriptor_block[wvp->descriptors - 1].status = 0; - - TNF_PROBE_0_DEBUG(hci1394_set_xmit_storevalue_desc_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); } /* @@ -2380,16 +1992,9 @@ static int hci1394_set_next_xfer_buf(hci1394_comp_ixl_vars_t *wvp, uint32_t bufp, uint16_t size) { - TNF_PROBE_0_DEBUG(hci1394_set_next_xfer_buf_enter, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - /* error if buffer pointer is null (size may be 0) */ if (bufp == 0) { - wvp->dma_bld_error = IXL1394_ENULL_BUFFER_ADDR; - - TNF_PROBE_0_DEBUG(hci1394_set_next_xfer_buf_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (DDI_FAILURE); } @@ -2398,15 +2003,7 @@ hci1394_set_next_xfer_buf(hci1394_comp_ixl_vars_t *wvp, uint32_t bufp, /* error if exceeds maximum xfer buffer components allowed */ if (wvp->xfer_bufcnt > HCI1394_DESC_MAX_Z) { - wvp->dma_bld_error = IXL1394_EFRAGMENT_OFLO; - - TNF_PROBE_2(hci1394_set_next_xfer_buf_error, - HCI1394_TNF_HAL_ERROR_ISOCH, "", tnf_string, errmsg, - "IXL1394_EFRAGMENT_OFLO", tnf_int, frag_count, - wvp->xfer_bufcnt); - TNF_PROBE_0_DEBUG(hci1394_set_next_xfer_buf_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (DDI_FAILURE); } @@ -2417,8 +2014,6 @@ hci1394_set_next_xfer_buf(hci1394_comp_ixl_vars_t *wvp, uint32_t bufp, /* accumulate total packet length */ wvp->xfer_pktlen += size; - TNF_PROBE_0_DEBUG(hci1394_set_next_xfer_buf_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (DDI_SUCCESS); } @@ -2437,28 +2032,18 @@ hci1394_set_next_xfer_buf(hci1394_comp_ixl_vars_t *wvp, uint32_t bufp, static int hci1394_flush_end_desc_check(hci1394_comp_ixl_vars_t *wvp, uint32_t count) { - TNF_PROBE_0_DEBUG(hci1394_flush_end_desc_check_enter, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - if ((count != 0) || ((wvp->xfer_hci_flush & (UPDATEABLE_XFER | UPDATEABLE_SET | INITIATING_LBL)) == 0)) { if (wvp->xfer_hci_flush & UPDATEABLE_JUMP) { if (hci1394_flush_hci_cache(wvp) != DDI_SUCCESS) { - - TNF_PROBE_0_DEBUG( - hci1394_flush_end_desc_check_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - /* wvp->dma_bld_error is set by above call */ return (DDI_FAILURE); } } } - TNF_PROBE_0_DEBUG(hci1394_flush_end_desc_check_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (DDI_SUCCESS); } @@ -2524,24 +2109,12 @@ hci1394_flush_hci_cache(hci1394_comp_ixl_vars_t *wvp) { uint32_t dma_bound; - TNF_PROBE_0_DEBUG(hci1394_flush_hci_cache_enter, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - if (hci1394_alloc_dma_mem(wvp, sizeof (hci1394_desc_t), &dma_bound) == NULL) { - wvp->dma_bld_error = IXL1394_EMEM_ALLOC_FAIL; - - TNF_PROBE_1(hci1394_flush_hci_cache_fail, - HCI1394_TNF_HAL_ERROR_ISOCH, "", tnf_string, errmsg, - "IXL1394_EMEM_ALLOC_FAIL: for flush_hci_cache"); - TNF_PROBE_0_DEBUG(hci1394_flush_hci_cache_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (DDI_FAILURE); } - TNF_PROBE_0_DEBUG(hci1394_flush_hci_cache_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (DDI_SUCCESS); } @@ -2559,26 +2132,12 @@ hci1394_alloc_storevalue_dma_mem(hci1394_comp_ixl_vars_t *wvp) { uint32_t dma_bound; - TNF_PROBE_0_DEBUG(hci1394_alloc_storevalue_dma_mem_enter, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - if (hci1394_alloc_dma_mem(wvp, sizeof (hci1394_desc_t), &dma_bound) == NULL) { - wvp->dma_bld_error = IXL1394_EMEM_ALLOC_FAIL; - - TNF_PROBE_2(hci1394_bld_alloc_storevalue_dma_mem_alloc_fail, - HCI1394_TNF_HAL_ERROR_ISOCH, "", tnf_string, errmsg, - "IXL1394_EMEM_ALLOC_FAIL: for storevalue dma", - tnf_opaque, ixl_commandp, wvp->ixl_cur_cmdp); - TNF_PROBE_0_DEBUG(hci1394_alloc_storevalue_dma_mem_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (0); } - TNF_PROBE_0_DEBUG(hci1394_alloc_storevalue_dma_mem_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - /* return bound address of allocated memory */ return (dma_bound); } @@ -2593,9 +2152,6 @@ hci1394_alloc_xfer_ctl(hci1394_comp_ixl_vars_t *wvp, uint32_t dmacnt) { hci1394_xfer_ctl_t *xcsp; - TNF_PROBE_0_DEBUG(hci1394_alloc_xfer_ctl_enter, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - /* * allocate an xfer_ctl struct which includes dmacnt of * xfer_ctl_dma structs @@ -2605,8 +2161,6 @@ hci1394_alloc_xfer_ctl(hci1394_comp_ixl_vars_t *wvp, uint32_t dmacnt) (sizeof (hci1394_xfer_ctl_t) + (dmacnt - 1) * sizeof (hci1394_xfer_ctl_dma_t)), KM_NOSLEEP)) == NULL) { - TNF_PROBE_0_DEBUG(hci1394_alloc_xfer_ctl_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (NULL); } #else @@ -2617,9 +2171,6 @@ hci1394_alloc_xfer_ctl(hci1394_comp_ixl_vars_t *wvp, uint32_t dmacnt) if ((xcsp = (hci1394_xfer_ctl_t *)calloc(1, sizeof (hci1394_xfer_ctl_t) + (dmacnt - 1) * sizeof (hci1394_xfer_ctl_dma_t))) == NULL) { - - TNF_PROBE_0_DEBUG(hci1394_alloc_xfer_ctl_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (NULL); } #endif @@ -2637,9 +2188,6 @@ hci1394_alloc_xfer_ctl(hci1394_comp_ixl_vars_t *wvp, uint32_t dmacnt) wvp->xcs_currentp = xcsp; } - TNF_PROBE_0_DEBUG(hci1394_alloc_xfer_ctl_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - /* return allocated xfer_ctl structure */ return (xcsp); } @@ -2658,9 +2206,6 @@ hci1394_alloc_dma_mem(hci1394_comp_ixl_vars_t *wvp, uint32_t size, void *dma_mem_ret; int ret; - TNF_PROBE_0_DEBUG(hci1394_alloc_dma_mem_enter, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - /* * if no dma has been allocated or current request exceeds * remaining memory @@ -2675,9 +2220,6 @@ hci1394_alloc_dma_mem(hci1394_comp_ixl_vars_t *wvp, uint32_t size, if ((dma_new = (hci1394_idma_desc_mem_t *) kmem_zalloc(sizeof (hci1394_idma_desc_mem_t), KM_NOSLEEP)) == NULL) { - - TNF_PROBE_0_DEBUG(hci1394_alloc_dma_mem_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (NULL); } @@ -2723,8 +2265,6 @@ hci1394_alloc_dma_mem(hci1394_comp_ixl_vars_t *wvp, uint32_t size, kmem_free(dma_new, sizeof (hci1394_idma_desc_mem_t)); - TNF_PROBE_0_DEBUG(hci1394_alloc_dma_mem_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (NULL); } @@ -2734,8 +2274,6 @@ hci1394_alloc_dma_mem(hci1394_comp_ixl_vars_t *wvp, uint32_t size, kmem_free(dma_new, sizeof (hci1394_idma_desc_mem_t)); - TNF_PROBE_0_DEBUG(hci1394_alloc_dma_mem_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (NULL); } dma_new->offset = 0; @@ -2745,16 +2283,12 @@ hci1394_alloc_dma_mem(hci1394_comp_ixl_vars_t *wvp, uint32_t size, /* allocate another dma_desc_mem struct */ if ((dma_new = (hci1394_idma_desc_mem_t *) calloc(1, sizeof (hci1394_idma_desc_mem_t))) == NULL) { - TNF_PROBE_0_DEBUG(hci1394_alloc_dma_mem_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (NULL); } dma_new->mem.bi_dma_handle = NULL; dma_new->mem.bi_handle = NULL; if ((dma_new->mem.bi_kaddr = (caddr_t)calloc(1, HCI1394_IXL_PAGESIZE)) == NULL) { - TNF_PROBE_0_DEBUG(hci1394_alloc_dma_mem_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (NULL); } dma_new->mem.bi_cookie.dmac_address = @@ -2780,8 +2314,6 @@ hci1394_alloc_dma_mem(hci1394_comp_ixl_vars_t *wvp, uint32_t size, wvp->dma_currentp->used; wvp->dma_currentp->used += size; - TNF_PROBE_0_DEBUG(hci1394_alloc_dma_mem_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (dma_mem_ret); } @@ -2796,9 +2328,6 @@ hci1394_alloc_dma_mem(hci1394_comp_ixl_vars_t *wvp, uint32_t size, static boolean_t hci1394_is_opcode_valid(uint16_t ixlopcode) { - TNF_PROBE_0_DEBUG(hci1394_is_opcode_bad_enter, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - /* if it's not one we know about, then it's bad */ switch (ixlopcode) { case IXL1394_OP_LABEL: @@ -2828,19 +2357,8 @@ hci1394_is_opcode_valid(uint16_t ixlopcode) case IXL1394_OP_SEND_BUF_U: case IXL1394_OP_SET_TAGSYNC_U: case IXL1394_OP_SET_SKIPMODE_U: - TNF_PROBE_1_DEBUG(hci1394_is_opcode_valid_enter, - HCI1394_TNF_HAL_STACK_ISOCH, "", tnf_string, msg, - "ixl opcode is valid"); - TNF_PROBE_0_DEBUG(hci1394_is_opcode_bad_enter, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (B_TRUE); default: - TNF_PROBE_2(hci1394_is_opcode_valid_enter, - HCI1394_TNF_HAL_STACK_ISOCH, "", tnf_string, msg, - "ixl opcode is NOT valid", tnf_opaque, ixl_opcode, - ixlopcode); - TNF_PROBE_0_DEBUG(hci1394_is_opcode_valid_enter, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (B_FALSE); } } diff --git a/usr/src/uts/common/io/1394/adapters/hci1394_ixl_isr.c b/usr/src/uts/common/io/1394/adapters/hci1394_ixl_isr.c index 886b8565f8..fa6ab50bf0 100644 --- a/usr/src/uts/common/io/1394/adapters/hci1394_ixl_isr.c +++ b/usr/src/uts/common/io/1394/adapters/hci1394_ixl_isr.c @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * hci1394_ixl_isr.c * Isochronous IXL Interrupt Service Routines. @@ -37,9 +35,6 @@ #include <sys/types.h> #include <sys/conf.h> - -#include <sys/tnf_probe.h> - #include <sys/1394/h1394.h> #include <sys/1394/ixl1394.h> #include <sys/1394/adapters/hci1394.h> @@ -70,9 +65,6 @@ hci1394_ixl_interrupt(hci1394_state_t *soft_statep, uint_t status; int retcode; - TNF_PROBE_0_DEBUG(hci1394_ixl_interrupt_enter, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - status = 1; /* acquire the interrupt processing context mutex */ @@ -85,32 +77,18 @@ hci1394_ixl_interrupt(hci1394_state_t *soft_statep, if (ctxtp->intr_flags & HCI1394_ISO_CTXT_INUPDATE) { retcode = HCI1394_IXL_INTR_INUPDATE; status = 0; - TNF_PROBE_1_DEBUG(hci1394_ixl_interrupt_error, - HCI1394_TNF_HAL_ERROR_ISOCH, "", tnf_string, errmsg, - "HCI1394_IXL_INTR_INUPDATE"); - } else if (ctxtp->intr_flags & HCI1394_ISO_CTXT_ININTR) { /* else fatal error if inter processing already in progress */ retcode = HCI1394_IXL_INTR_ININTR; status = 0; - TNF_PROBE_1(hci1394_ixl_interrupt_error, - HCI1394_TNF_HAL_ERROR_ISOCH, "", tnf_string, errmsg, - "HCI1394_IXL_INTR_ININTR"); - } else if (ctxtp->intr_flags & HCI1394_ISO_CTXT_INCALL) { /* else fatal error if callback in progress flag is set */ retcode = HCI1394_IXL_INTR_INCALL; status = 0; - TNF_PROBE_1_DEBUG(hci1394_ixl_interrupt_error, - HCI1394_TNF_HAL_ERROR_ISOCH, "", tnf_string, errmsg, - "HCI1394_IXL_INTR_INCALL"); } else if (!in_stop && (ctxtp->intr_flags & HCI1394_ISO_CTXT_STOP)) { /* context is being stopped */ retcode = HCI1394_IXL_INTR_STOP; status = 0; - TNF_PROBE_1_DEBUG(hci1394_ixl_interrupt_error, - HCI1394_TNF_HAL_ERROR_ISOCH, "", tnf_string, errmsg, - "HCI1394_IXL_INTR_STOP"); } /* @@ -144,9 +122,6 @@ hci1394_ixl_interrupt(hci1394_state_t *soft_statep, if (retcode == HCI1394_IXL_INTR_DMALOST) { hci1394_do_stop(soft_statep, ctxtp, B_TRUE, ID1394_FAIL); } - - TNF_PROBE_0_DEBUG(hci1394_ixl_interrupt_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); } /* @@ -170,9 +145,6 @@ hci1394_ixl_dma_sync(hci1394_state_t *soft_statep, hci1394_iso_ctxt_t *ctxtp) void (*callback)(opaque_t, struct ixl1394_callback *); - TNF_PROBE_0_DEBUG(hci1394_ixl_dma_sync_enter, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - ASSERT(MUTEX_NOT_HELD(&ctxtp->intrprocmutex)); /* xfer start ixl cmd where last left off */ @@ -204,8 +176,6 @@ hci1394_ixl_dma_sync(hci1394_state_t *soft_statep, hci1394_iso_ctxt_t *ctxtp) ixlp, &ixlnextp, ×tamp, &donecode); if (isdone == B_TRUE) { - TNF_PROBE_0_DEBUG(hci1394_ixl_dma_sync_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (donecode); } @@ -265,9 +235,6 @@ hci1394_ixl_dma_sync(hci1394_state_t *soft_statep, hci1394_iso_ctxt_t *ctxtp) */ if ((ixlp != NULL) && (ixlp->ixl_opcode == IXL1394_OP_JUMP_U)) { ctxtp->ixl_execp = ixlp; - TNF_PROBE_1_DEBUG(hci1394_ixl_dma_sync_exit, - HCI1394_TNF_HAL_STACK_ISOCH, "", tnf_string, msg, - "INTR_NOERROR"); return (HCI1394_IXL_INTR_NOERROR); } @@ -281,15 +248,10 @@ hci1394_ixl_dma_sync(hci1394_state_t *soft_statep, hci1394_iso_ctxt_t *ctxtp) /* return stopped status if at end of IXL cmds & context stopped */ if (HCI1394_ISOCH_CTXT_ACTIVE(soft_statep, ctxtp) == 0) { - TNF_PROBE_1_DEBUG(hci1394_ixl_dma_sync_exit, - HCI1394_TNF_HAL_STACK_ISOCH, "", tnf_string, msg, - "INTR_DMASTOP"); return (HCI1394_IXL_INTR_DMASTOP); } /* else interrupt processing is lost */ - TNF_PROBE_1_DEBUG(hci1394_ixl_dma_sync_exit, - HCI1394_TNF_HAL_STACK_ISOCH, "", tnf_string, msg, "INTR_DMALOST"); return (HCI1394_IXL_INTR_DMALOST); } @@ -318,10 +280,6 @@ hci1394_ixl_intr_check_xfer(hci1394_state_t *soft_statep, uint16_t ixldepth; uint16_t ixlopcode; - - TNF_PROBE_0_DEBUG(hci1394_ixl_intr_check_xfer_enter, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - *donecodep = 0; dma_advances = 0; ixldepth = ctxtp->ixl_exec_depth; @@ -390,11 +348,6 @@ hci1394_ixl_intr_check_xfer(hci1394_state_t *soft_statep, * processing is lost */ *donecodep = HCI1394_IXL_INTR_DMALOST; - - TNF_PROBE_1_DEBUG( - hci1394_ixl_intr_check_xfer_exit, - HCI1394_TNF_HAL_STACK_ISOCH, "", - tnf_string, msg, "INTR_DMALOST"); return (B_TRUE); } } @@ -414,10 +367,6 @@ hci1394_ixl_intr_check_xfer(hci1394_state_t *soft_statep, ctxtp->rem_noadv_intrs = 0; *donecodep = HCI1394_IXL_INTR_DMASTOP; - - TNF_PROBE_1_DEBUG(hci1394_ixl_intr_check_xfer_exit, - HCI1394_TNF_HAL_STACK_ISOCH, "", tnf_string, msg, - "INTR_DMASTOP"); return (B_TRUE); } @@ -441,11 +390,6 @@ hci1394_ixl_intr_check_xfer(hci1394_state_t *soft_statep, } *donecodep = HCI1394_IXL_INTR_NOERROR; - - TNF_PROBE_1_DEBUG( - hci1394_ixl_intr_check_xfer_exit, - HCI1394_TNF_HAL_STACK_ISOCH, "", - tnf_string, msg, "INTR_NOERROR"); return (B_TRUE); } @@ -473,19 +417,10 @@ hci1394_ixl_intr_check_xfer(hci1394_state_t *soft_statep, */ if (ctxtp->rem_noadv_intrs == 0) { *donecodep = HCI1394_IXL_INTR_NOADV; - - TNF_PROBE_1_DEBUG( - hci1394_ixl_intr_check_xfer_exit, - HCI1394_TNF_HAL_STACK_ISOCH, "", - tnf_string, msg, "INTR_NOADV"); return (B_TRUE); } *donecodep = HCI1394_IXL_INTR_NOERROR; - - TNF_PROBE_1_DEBUG(hci1394_ixl_intr_check_xfer_exit, - HCI1394_TNF_HAL_STACK_ISOCH, "", tnf_string, msg, - "INTR_NOERROR2"); return (B_TRUE); } @@ -521,9 +456,6 @@ hci1394_ixl_intr_check_xfer(hci1394_state_t *soft_statep, ctxtp->rem_noadv_intrs = ctxtp->max_noadv_intrs; } - TNF_PROBE_0_DEBUG(hci1394_ixl_intr_check_xfer_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - /* continue to process next IXL command */ return (B_FALSE); } @@ -546,7 +478,6 @@ hci1394_ixl_intr_check_done(hci1394_state_t *soft_statep, uint32_t desc_status; hci1394_desc_t *hcidescp; off_t hcidesc_off; - int err; uint32_t dma_cmd_cur_loc; uint32_t dma_cmd_last_loc; uint32_t dma_loc_check_enabled; @@ -559,9 +490,6 @@ hci1394_ixl_intr_check_done(hci1394_state_t *soft_statep, ixl1394_command_t *skipdestp; ixl1394_command_t *skipxferp; - TNF_PROBE_0_DEBUG(hci1394_ixl_intr_check_done_enter, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - /* * start looking through the IXL list from the xfer start command where * we last left off (for composite opcodes, need to start from the @@ -607,15 +535,9 @@ hci1394_ixl_intr_check_done(hci1394_state_t *soft_statep, ((dma_cmd_cur_loc >= dmastartp) && (dma_cmd_cur_loc < dmaendp))) { if (HCI1394_ISOCH_CTXT_ACTIVE(soft_statep, ctxtp) == 0) { - TNF_PROBE_1_DEBUG(hci1394_ixl_intr_check_done_exit, - HCI1394_TNF_HAL_STACK_ISOCH, "", tnf_string, msg, - "CHECK_STOP"); return (IXL_CHECK_STOP); } - TNF_PROBE_1_DEBUG(hci1394_ixl_intr_check_done_exit, - HCI1394_TNF_HAL_STACK_ISOCH, "", tnf_string, msg, - "CHECK_DONE"); return (IXL_CHECK_DONE); } @@ -629,21 +551,12 @@ hci1394_ixl_intr_check_done(hci1394_state_t *soft_statep, * else return location indeterminate */ if (HCI1394_ISOCH_CTXT_ACTIVE(soft_statep, ctxtp) == 0) { - TNF_PROBE_1_DEBUG(hci1394_ixl_intr_check_done_exit, - HCI1394_TNF_HAL_STACK_ISOCH, "", tnf_string, msg, - "CHECK_STOP"); return (IXL_CHECK_STOP); } if (!dma_loc_check_enabled) { - TNF_PROBE_1_DEBUG(hci1394_ixl_intr_check_done_exit, - HCI1394_TNF_HAL_STACK_ISOCH, "", tnf_string, msg, - "CHECK_DONE"); return (IXL_CHECK_DONE); } - TNF_PROBE_1_DEBUG(hci1394_ixl_intr_check_done_exit, - HCI1394_TNF_HAL_STACK_ISOCH, "", tnf_string, msg, - "CHECK_LOST"); return (IXL_CHECK_LOST); } @@ -657,13 +570,8 @@ hci1394_ixl_intr_check_done(hci1394_state_t *soft_statep, hcidesc_off = (off_t)hcidescp - (off_t)dma->dma_buf->bi_kaddr; /* Sync the descriptor before we get the status */ - err = ddi_dma_sync(dma_hdl, hcidesc_off, sizeof (hci1394_desc_t), + (void) ddi_dma_sync(dma_hdl, hcidesc_off, sizeof (hci1394_desc_t), DDI_DMA_SYNC_FORCPU); - if (err != DDI_SUCCESS) { - TNF_PROBE_1(hci1394_ixl_intr_check_done_error, - HCI1394_TNF_HAL_ERROR_ISOCH, "", tnf_string, errmsg, - "dma_sync() failed"); - } desc_status = ddi_get32(acc_hdl, &hcidescp->status); if ((desc_status & DESC_XFER_ACTIVE_MASK) != 0) { @@ -672,9 +580,6 @@ hci1394_ixl_intr_check_done(hci1394_state_t *soft_statep, * if status is now set here, return skipped, to cause calling * function to continue, even though location hasn't changed */ - TNF_PROBE_1_DEBUG(hci1394_ixl_intr_check_done_exit, - HCI1394_TNF_HAL_STACK_ISOCH, "", tnf_string, msg, - "CHECK_SKIP"); return (IXL_CHECK_SKIP); } @@ -722,24 +627,13 @@ hci1394_ixl_intr_check_done(hci1394_state_t *soft_statep, */ if (HCI1394_ISOCH_CTXT_ACTIVE(soft_statep, ctxtp) == 0) { - TNF_PROBE_1_DEBUG( - hci1394_ixl_intr_check_done_exit, - HCI1394_TNF_HAL_STACK_ISOCH, "", - tnf_string, msg, "CHECK_STOP"); return (IXL_CHECK_STOP); } if (!dma_loc_check_enabled) { - TNF_PROBE_1_DEBUG( - hci1394_ixl_intr_check_done_exit, - HCI1394_TNF_HAL_STACK_ISOCH, "", - tnf_string, msg, "CHECK_DONE"); return (IXL_CHECK_DONE); } - TNF_PROBE_1_DEBUG(hci1394_ixl_intr_check_done_exit, - HCI1394_TNF_HAL_STACK_ISOCH, "", tnf_string, msg, - "CHECK_LOST"); return (IXL_CHECK_LOST); case IXL1394_SKIP_TO_NEXT: @@ -808,23 +702,12 @@ hci1394_ixl_intr_check_done(hci1394_state_t *soft_statep, */ if (HCI1394_ISOCH_CTXT_ACTIVE(soft_statep, ctxtp) == 0) { - TNF_PROBE_1_DEBUG( - hci1394_ixl_intr_check_done_exit, - HCI1394_TNF_HAL_STACK_ISOCH, "", - tnf_string, msg, "CHECK_STOP"); return (IXL_CHECK_STOP); } if (!dma_loc_check_enabled) { - TNF_PROBE_1_DEBUG( - hci1394_ixl_intr_check_done_exit, - HCI1394_TNF_HAL_STACK_ISOCH, "", - tnf_string, msg, "CHECK_DONE"); return (IXL_CHECK_DONE); } - TNF_PROBE_1_DEBUG(hci1394_ixl_intr_check_done_exit, - HCI1394_TNF_HAL_STACK_ISOCH, "", tnf_string, msg, - "CHECK_LOST"); return (IXL_CHECK_LOST); } @@ -840,13 +723,8 @@ hci1394_ixl_intr_check_done(hci1394_state_t *soft_statep, hcidesc_off = (off_t)hcidescp - (off_t)dma->dma_buf->bi_kaddr; /* Sync the descriptor before we get the status */ - err = ddi_dma_sync(dma_hdl, hcidesc_off, + (void) ddi_dma_sync(dma_hdl, hcidesc_off, sizeof (hci1394_desc_t), DDI_DMA_SYNC_FORCPU); - if (err != DDI_SUCCESS) { - TNF_PROBE_1(hci1394_ixl_intr_check_done_error, - HCI1394_TNF_HAL_ERROR_ISOCH, "", tnf_string, errmsg, - "dma_sync() failed"); - } desc_status = ddi_get32(acc_hdl, &hcidescp->status); if ((desc_status & DESC_XFER_ACTIVE_MASK) != 0) { @@ -860,9 +738,6 @@ hci1394_ixl_intr_check_done(hci1394_state_t *soft_statep, ctxtp->ixl_execp = skipdestp; ctxtp->ixl_exec_depth = skipdepth; - TNF_PROBE_1_DEBUG(hci1394_ixl_intr_check_done_exit, - HCI1394_TNF_HAL_STACK_ISOCH, "", tnf_string, msg, - "CHECK_SKIP"); return (IXL_CHECK_SKIP); } @@ -880,10 +755,6 @@ hci1394_ixl_intr_check_done(hci1394_state_t *soft_statep, /* if the context is stopped, return stopped */ if (HCI1394_ISOCH_CTXT_ACTIVE(soft_statep, ctxtp) == 0) { - TNF_PROBE_1_DEBUG( - hci1394_ixl_intr_check_done_exit, - HCI1394_TNF_HAL_STACK_ISOCH, "", - tnf_string, msg, "CHECK STOP"); return (IXL_CHECK_STOP); } /* @@ -894,9 +765,6 @@ hci1394_ixl_intr_check_done(hci1394_state_t *soft_statep, ctxtp->ixl_execp = skipdestp; ctxtp->ixl_exec_depth = skipdepth; - TNF_PROBE_1_DEBUG(hci1394_ixl_intr_check_done_exit, - HCI1394_TNF_HAL_STACK_ISOCH, "", tnf_string, msg, - "CHECK_SKIP"); return (IXL_CHECK_SKIP); } @@ -921,20 +789,12 @@ hci1394_ixl_intr_check_done(hci1394_state_t *soft_statep, */ if (HCI1394_ISOCH_CTXT_ACTIVE(soft_statep, ctxtp) == 0) { - TNF_PROBE_1_DEBUG(hci1394_ixl_intr_check_done_exit, - HCI1394_TNF_HAL_STACK_ISOCH, "", tnf_string, msg, - "CHECK_STOP"); return (IXL_CHECK_STOP); } if (!dma_loc_check_enabled) { - TNF_PROBE_1_DEBUG(hci1394_ixl_intr_check_done_exit, - HCI1394_TNF_HAL_STACK_ISOCH, "", tnf_string, msg, - "CHECK_DONE"); return (IXL_CHECK_DONE); } - TNF_PROBE_1_DEBUG(hci1394_ixl_intr_check_done_exit, - HCI1394_TNF_HAL_STACK_ISOCH, "", tnf_string, msg, "CHECK_LOST"); return (IXL_CHECK_LOST); } @@ -954,8 +814,6 @@ hci1394_isoch_cycle_inconsistent(hci1394_state_t *soft_statep) hci1394_iso_ctxt_t *ctxtp; /* current context */ ASSERT(soft_statep); - TNF_PROBE_0_DEBUG(hci1394_isoch_cycle_inconsistent_enter, - HCI1394_TNF_HAL_STACK_ISOCH, ""); hci1394_ohci_intr_clear(soft_statep->ohci, OHCI_INTR_CYC_INCONSISTENT); @@ -1022,13 +880,7 @@ hci1394_isoch_cycle_inconsistent(hci1394_state_t *soft_statep) cmn_err(CE_NOTE, "!hci1394(%d): cycle_inconsistent interrupt " "disabled until next bus reset", soft_statep->drvinfo.di_instance); - TNF_PROBE_1(hci1394_isoch_cycle_inconsistent_error, - HCI1394_TNF_HAL_ERROR_ISOCH, "", tnf_string, msg, - "CYCLE_INCONSISTENT intr disabled until next bus reset"); } - - TNF_PROBE_0_DEBUG(hci1394_isoch_cycle_inconsistent_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); } @@ -1047,8 +899,6 @@ hci1394_isoch_cycle_lost(hci1394_state_t *soft_statep) hci1394_iso_ctxt_t *ctxtp; /* current context */ ASSERT(soft_statep); - TNF_PROBE_0_DEBUG(hci1394_isoch_cycle_lost_enter, - HCI1394_TNF_HAL_STACK_ISOCH, ""); hci1394_ohci_intr_clear(soft_statep->ohci, OHCI_INTR_CYC_LOST); @@ -1115,11 +965,5 @@ hci1394_isoch_cycle_lost(hci1394_state_t *soft_statep) cmn_err(CE_NOTE, "!hci1394(%d): cycle_lost interrupt " "disabled until next bus reset", soft_statep->drvinfo.di_instance); - TNF_PROBE_1(hci1394_isoch_cycle_lost_error, - HCI1394_TNF_HAL_ERROR_ISOCH, "", tnf_string, msg, - "CYCLE_LOST intr disabled until next bus reset"); } - - TNF_PROBE_0_DEBUG(hci1394_isoch_cycle_lost_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); } diff --git a/usr/src/uts/common/io/1394/adapters/hci1394_ixl_misc.c b/usr/src/uts/common/io/1394/adapters/hci1394_ixl_misc.c index 845f901898..18007a0d33 100644 --- a/usr/src/uts/common/io/1394/adapters/hci1394_ixl_misc.c +++ b/usr/src/uts/common/io/1394/adapters/hci1394_ixl_misc.c @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * hci1394_ixl_misc.c * Isochronous IXL miscellaneous routines. @@ -36,9 +34,6 @@ #include <sys/kmem.h> #include <sys/types.h> #include <sys/conf.h> - -#include <sys/tnf_probe.h> - #include <sys/1394/h1394.h> #include <sys/1394/ixl1394.h> #include <sys/1394/adapters/hci1394.h> @@ -70,9 +65,6 @@ hci1394_ixl_set_start(hci1394_iso_ctxt_t *ctxtp, ixl1394_command_t *ixlstp) ixl1394_command_t *ixl_exec_startp; - TNF_PROBE_0_DEBUG(hci1394_ixl_set_start_enter, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - /* if ixl start command is null, use first compiled ixl command */ if (ixlstp == NULL) { ixlstp = ctxtp->ixl_firstp; @@ -84,8 +76,6 @@ hci1394_ixl_set_start(hci1394_iso_ctxt_t *ctxtp, ixl1394_command_t *ixlstp) */ if ((ixlstp != ctxtp->ixl_firstp) && (ixlstp->ixl_opcode != IXL1394_OP_LABEL)) { - TNF_PROBE_0_DEBUG(hci1394_ixl_set_start_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (-1); } @@ -107,14 +97,10 @@ hci1394_ixl_set_start(hci1394_iso_ctxt_t *ctxtp, ixl1394_command_t *ixlstp) ctxtp->ixl_execp = ixlstp; ctxtp->rem_noadv_intrs = ctxtp->max_noadv_intrs; - TNF_PROBE_0_DEBUG(hci1394_ixl_set_start_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (0); } /* else no executeable xfer command found, return error */ - TNF_PROBE_0_DEBUG(hci1394_ixl_set_start_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (1); } #ifdef _KERNEL @@ -134,9 +120,6 @@ hci1394_ixl_reset_status(hci1394_iso_ctxt_t *ctxtp) uint_t ixldepth; uint16_t timestamp; - TNF_PROBE_0_DEBUG(hci1394_ixl_reset_status_enter, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - ixlnext = ctxtp->ixl_firstp; /* @@ -169,9 +152,6 @@ hci1394_ixl_reset_status(hci1394_iso_ctxt_t *ctxtp) ixldepth++; } } - - TNF_PROBE_0_DEBUG(hci1394_ixl_reset_status_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); } #endif /* @@ -201,9 +181,6 @@ hci1394_ixl_find_next_exec_xfer(ixl1394_command_t *ixl_start, ixl1394_command_t *ixlp; int ii; - TNF_PROBE_0_DEBUG(hci1394_ixl_find_next_exec_xfer_enter, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - ixlp = ixl_start; xferfound = B_FALSE; ii = HCI1394_IXL_MAX_SEQ_JUMPS; @@ -232,13 +209,6 @@ hci1394_ixl_find_next_exec_xfer(ixl1394_command_t *ixl_start, /* if exceeded tolerance, give up */ if (ii == 0) { - TNF_PROBE_1( - hci1394_ixl_find_next_exec_xfer_error, - HCI1394_TNF_HAL_ERROR_ISOCH, "", tnf_string, - errmsg, "Infinite loop w/no xfers"); - TNF_PROBE_0_DEBUG( - hci1394_ixl_find_next_exec_xfer_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (DDI_FAILURE); } continue; @@ -257,8 +227,6 @@ hci1394_ixl_find_next_exec_xfer(ixl1394_command_t *ixl_start, /* return ixl xfer start command found, if any */ *next_exec_ixlpp = ixlp; - TNF_PROBE_0_DEBUG(hci1394_ixl_find_next_exec_xfer_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (DDI_SUCCESS); } #ifdef _KERNEL @@ -279,10 +247,6 @@ hci1394_ixl_check_status(hci1394_xfer_ctl_dma_t *dma, uint16_t ixlopcode, ddi_dma_handle_t dma_hdl; uint32_t desc_status; uint32_t desc_hdr; - int err; - - TNF_PROBE_0_DEBUG(hci1394_ixl_check_status_enter, - HCI1394_TNF_HAL_STACK_ISOCH, ""); /* last dma descriptor in descriptor block from dma structure */ hcidescp = (hci1394_desc_t *)(dma->dma_descp); @@ -294,13 +258,8 @@ hci1394_ixl_check_status(hci1394_xfer_ctl_dma_t *dma, uint16_t ixlopcode, if ((ixlopcode & IXL1394_OPF_ONXMIT) != 0) { /* Sync the descriptor before we get the status */ - err = ddi_dma_sync(dma_hdl, hcidesc_off, + (void) ddi_dma_sync(dma_hdl, hcidesc_off, sizeof (hci1394_desc_t), DDI_DMA_SYNC_FORCPU); - if (err != DDI_SUCCESS) { - TNF_PROBE_1(hci1394_ixl_check_status_error, - HCI1394_TNF_HAL_ERROR_ISOCH, "", tnf_string, errmsg, - "dma_sync() failed"); - } desc_status = ddi_get32(acc_hdl, &hcidescp->status); /* check if status is set in last dma descriptor in block */ @@ -320,21 +279,12 @@ hci1394_ixl_check_status(hci1394_xfer_ctl_dma_t *dma, uint16_t ixlopcode, ddi_put32(acc_hdl, &hcidescp->status, 0); /* Sync descriptor for device (status was cleared) */ - err = ddi_dma_sync(dma_hdl, hcidesc_off, + (void) ddi_dma_sync(dma_hdl, hcidesc_off, sizeof (hci1394_desc_t), DDI_DMA_SYNC_FORDEV); - if (err != DDI_SUCCESS) { - TNF_PROBE_1(hci1394_ixl_check_status_error, - HCI1394_TNF_HAL_ERROR_ISOCH, "", tnf_string, - errmsg, "dma_sync() failed"); - } - TNF_PROBE_0_DEBUG(hci1394_ixl_check_status_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (1); } /* else, return dma descriptor block status not set */ - TNF_PROBE_0_DEBUG(hci1394_ixl_check_status_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (0); } @@ -350,13 +300,8 @@ hci1394_ixl_check_status(hci1394_xfer_ctl_dma_t *dma, uint16_t ixlopcode, while (hcicnt-- != 0) { /* Sync the descriptor before we get the status */ - err = ddi_dma_sync(dma_hdl, hcidesc_off, + (void) ddi_dma_sync(dma_hdl, hcidesc_off, hcicnt * sizeof (hci1394_desc_t), DDI_DMA_SYNC_FORCPU); - if (err != DDI_SUCCESS) { - TNF_PROBE_1(hci1394_ixl_check_status_error, - HCI1394_TNF_HAL_ERROR_ISOCH, "", tnf_string, errmsg, - "dma_sync() failed"); - } desc_hdr = ddi_get32(acc_hdl, &hcidescp->hdr); @@ -376,8 +321,6 @@ hci1394_ixl_check_status(hci1394_xfer_ctl_dma_t *dma, uint16_t ixlopcode, * descriptor block status set */ if (do_status_reset == B_FALSE) { - TNF_PROBE_0_DEBUG(hci1394_ixl_check_status_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (1); } @@ -389,28 +332,19 @@ hci1394_ixl_check_status(hci1394_xfer_ctl_dma_t *dma, uint16_t ixlopcode, ddi_put32(acc_hdl, &hcidescp->status, desc_status); /* Sync descriptor for device (status was cleared) */ - err = ddi_dma_sync(dma_hdl, hcidesc_off, + (void) ddi_dma_sync(dma_hdl, hcidesc_off, sizeof (hci1394_desc_t), DDI_DMA_SYNC_FORDEV); - if (err != DDI_SUCCESS) { - TNF_PROBE_1(hci1394_ixl_check_status_error, - HCI1394_TNF_HAL_ERROR_ISOCH, "", tnf_string, - errmsg, "dma_sync() failed"); - } - TNF_PROBE_0_DEBUG(hci1394_ixl_check_status_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (1); } else { /* else, set to evaluate next descriptor. */ hcidescp++; hcidesc_off = (off_t)hcidescp - - (off_t)dma->dma_buf->bi_kaddr; + (off_t)dma->dma_buf->bi_kaddr; } } /* return input not complete status */ - TNF_PROBE_0_DEBUG(hci1394_ixl_check_status_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (0); } #endif @@ -421,14 +355,8 @@ hci1394_ixl_check_status(hci1394_xfer_ctl_dma_t *dma, uint16_t ixlopcode, void hci1394_ixl_cleanup(hci1394_state_t *soft_statep, hci1394_iso_ctxt_t *ctxtp) { - TNF_PROBE_0_DEBUG(hci1394_ixl_cleanup_enter, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - hci1394_delete_xfer_ctl((hci1394_xfer_ctl_t *)ctxtp->xcs_firstp); hci1394_delete_dma_desc_mem(soft_statep, ctxtp->dma_firstp); - - TNF_PROBE_0_DEBUG(hci1394_ixl_cleanup_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); } /* @@ -444,9 +372,6 @@ hci1394_delete_dma_desc_mem(hci1394_state_t *soft_statep, { hci1394_idma_desc_mem_t *dma_next; - TNF_PROBE_0_DEBUG(hci1394_delete_dma_desc_mem_enter, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - while (dma_firstp != NULL) { dma_next = dma_firstp->dma_nextp; #ifdef _KERNEL @@ -471,8 +396,6 @@ hci1394_delete_dma_desc_mem(hci1394_state_t *soft_statep, /* advance to next dma memory descriptor */ dma_firstp = dma_next; } - TNF_PROBE_0_DEBUG(hci1394_delete_dma_desc_mem_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); } /* @@ -484,9 +407,6 @@ hci1394_delete_xfer_ctl(hci1394_xfer_ctl_t *xcsp) { hci1394_xfer_ctl_t *delp; - TNF_PROBE_0_DEBUG(hci1394_delete_xfer_ctl_enter, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - while ((delp = xcsp) != NULL) { /* advance ptr to next xfer_ctl struct */ xcsp = xcsp->ctl_nextp; @@ -503,6 +423,4 @@ hci1394_delete_xfer_ctl(hci1394_xfer_ctl_t *xcsp) free(delp); #endif } - TNF_PROBE_0_DEBUG(hci1394_delete_xfer_ctl_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); } diff --git a/usr/src/uts/common/io/1394/adapters/hci1394_ixl_update.c b/usr/src/uts/common/io/1394/adapters/hci1394_ixl_update.c index 45db7e614f..b33ba7213e 100644 --- a/usr/src/uts/common/io/1394/adapters/hci1394_ixl_update.c +++ b/usr/src/uts/common/io/1394/adapters/hci1394_ixl_update.c @@ -34,9 +34,6 @@ #include <sys/types.h> #include <sys/conf.h> #include <sys/disp.h> - -#include <sys/tnf_probe.h> - #include <sys/1394/h1394.h> #include <sys/1394/ixl1394.h> /* IXL opcodes & data structs */ @@ -111,10 +108,6 @@ hci1394_ixl_update(hci1394_state_t *soft_statep, hci1394_iso_ctxt_t *ctxtp, int prepstatus; int ret; - TNF_PROBE_0_DEBUG(hci1394_ixl_update_enter, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - - /* save caller specified values in update work variables structure */ uv.soft_statep = soft_statep; uv.ctxtp = ctxtp; @@ -152,16 +145,9 @@ hci1394_ixl_update(hci1394_state_t *soft_statep, hci1394_iso_ctxt_t *ctxtp, /* if prep evaluation error, return failure */ if (prepstatus != IXL_PREP_SUCCESS) { - TNF_PROBE_1_DEBUG(hci1394_ixl_update_error, - HCI1394_TNF_HAL_ERROR_ISOCH, "", tnf_string, msg, - "IXL_PREP_FAILURE"); - TNF_PROBE_0_DEBUG(hci1394_ixl_update_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (DDI_FAILURE); } /* if no action or update done, return update successful */ - TNF_PROBE_0_DEBUG(hci1394_ixl_update_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (DDI_SUCCESS); } @@ -172,8 +158,6 @@ hci1394_ixl_update(hci1394_state_t *soft_statep, hci1394_iso_ctxt_t *ctxtp, /* error acquiring control of context - return */ *resultp = uv.upd_status; - TNF_PROBE_0_DEBUG(hci1394_ixl_update_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (DDI_FAILURE); } @@ -201,8 +185,6 @@ hci1394_ixl_update(hci1394_state_t *soft_statep, hci1394_iso_ctxt_t *ctxtp, } *resultp = uv.upd_status; - TNF_PROBE_0_DEBUG(hci1394_ixl_update_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (DDI_FAILURE); } @@ -217,8 +199,6 @@ hci1394_ixl_update(hci1394_state_t *soft_statep, hci1394_iso_ctxt_t *ctxtp, *resultp = uv.upd_status; - TNF_PROBE_0_DEBUG(hci1394_ixl_update_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (DDI_FAILURE); } @@ -246,8 +226,6 @@ hci1394_ixl_update(hci1394_state_t *soft_statep, hci1394_iso_ctxt_t *ctxtp, *resultp = uv.upd_status; - TNF_PROBE_0_DEBUG(hci1394_ixl_update_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (DDI_FAILURE); } @@ -257,8 +235,6 @@ hci1394_ixl_update(hci1394_state_t *soft_statep, hci1394_iso_ctxt_t *ctxtp, /* return update completion status */ *resultp = uv.upd_status; - TNF_PROBE_0_DEBUG(hci1394_ixl_update_exit, HCI1394_TNF_HAL_STACK_ISOCH, - ""); return (DDI_SUCCESS); } @@ -275,9 +251,6 @@ hci1394_ixl_update_enable(hci1394_ixl_update_vars_t *uvp) boolean_t retry; uint_t remretries; - TNF_PROBE_0_DEBUG(hci1394_ixl_update_enable_enter, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - retry = B_TRUE; /* set arbitrary number of retries before giving up */ remretries = hci1394_upd_retries_before_fail; @@ -335,8 +308,6 @@ hci1394_ixl_update_enable(hci1394_ixl_update_vars_t *uvp) ASSERT(MUTEX_HELD(&uvp->ctxtp->intrprocmutex)); mutex_exit(&uvp->ctxtp->intrprocmutex); - TNF_PROBE_0_DEBUG(hci1394_ixl_update_enable_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (status); } @@ -352,9 +323,6 @@ hci1394_ixl_update_endup(hci1394_ixl_update_vars_t *uvp) uint_t status; hci1394_iso_ctxt_t *ctxtp; - TNF_PROBE_0_DEBUG(hci1394_ixl_update_endup_enter, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - status = HCI1394_IXL_INTR_NOERROR; ctxtp = uvp->ctxtp; @@ -405,8 +373,6 @@ hci1394_ixl_update_endup(hci1394_ixl_update_vars_t *uvp) hci1394_do_stop(uvp->soft_statep, ctxtp, B_TRUE, ID1394_FAIL); } - TNF_PROBE_0_DEBUG(hci1394_ixl_update_endup_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (status); } @@ -419,17 +385,11 @@ hci1394_ixl_update_prepare(hci1394_ixl_update_vars_t *uvp) { int ret; - TNF_PROBE_0_DEBUG(hci1394_ixl_update_prepare_enter, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - /* both new and old ixl commands must be the same */ if (uvp->ixlnewp->ixl_opcode != uvp->ixloldp->ixl_opcode) { uvp->upd_status = IXL1394_EOPCODE_MISMATCH; - TNF_PROBE_1_DEBUG(hci1394_ixl_update_prepare_exit, - HCI1394_TNF_HAL_STACK_ISOCH, "", tnf_string, msg, - "EOPCODE_MISMATCH"); return (IXL_PREP_FAILURE); } @@ -452,45 +412,33 @@ hci1394_ixl_update_prepare(hci1394_ixl_update_vars_t *uvp) old_callback_ixlp->callback = new_callback_ixlp->callback; /* nothing else to do, return with done ok status */ - TNF_PROBE_0_DEBUG(hci1394_ixl_update_prepare_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (IXL_PREP_SUCCESS); } case IXL1394_OP_JUMP_U: ret = hci1394_ixl_update_prep_jump(uvp); - TNF_PROBE_0_DEBUG(hci1394_ixl_update_prepare_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (ret); case IXL1394_OP_SET_SKIPMODE_U: ret = hci1394_ixl_update_prep_set_skipmode(uvp); - TNF_PROBE_0_DEBUG(hci1394_ixl_update_prepare_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (ret); case IXL1394_OP_SET_TAGSYNC_U: ret = hci1394_ixl_update_prep_set_tagsync(uvp); - TNF_PROBE_0_DEBUG(hci1394_ixl_update_prepare_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (ret); case IXL1394_OP_RECV_PKT_U: case IXL1394_OP_RECV_PKT_ST_U: ret = hci1394_ixl_update_prep_recv_pkt(uvp); - TNF_PROBE_0_DEBUG(hci1394_ixl_update_prepare_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (ret); case IXL1394_OP_RECV_BUF_U: ret = hci1394_ixl_update_prep_recv_buf(uvp); - TNF_PROBE_0_DEBUG(hci1394_ixl_update_prepare_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (ret); case IXL1394_OP_SEND_PKT_U: @@ -498,23 +446,17 @@ hci1394_ixl_update_prepare(hci1394_ixl_update_vars_t *uvp) case IXL1394_OP_SEND_PKT_WHDR_ST_U: ret = hci1394_ixl_update_prep_send_pkt(uvp); - TNF_PROBE_0_DEBUG(hci1394_ixl_update_prepare_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (ret); case IXL1394_OP_SEND_BUF_U: ret = hci1394_ixl_update_prep_send_buf(uvp); - TNF_PROBE_0_DEBUG(hci1394_ixl_update_prepare_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (ret); default: /* ixl command being updated must be one of above, else error */ uvp->upd_status = IXL1394_EOPCODE_DISALLOWED; - TNF_PROBE_0_DEBUG(hci1394_ixl_update_prepare_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (IXL_PREP_FAILURE); } } @@ -537,9 +479,6 @@ hci1394_ixl_update_prep_jump(hci1394_ixl_update_vars_t *uvp) uint32_t desc_hdr; int err; - TNF_PROBE_0_DEBUG(hci1394_ixl_update_prep_jump_enter, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - old_jump_ixlp = (ixl1394_jump_t *)uvp->ixloldp; new_jump_ixlp = (ixl1394_jump_t *)uvp->ixlnewp; @@ -547,8 +486,6 @@ hci1394_ixl_update_prep_jump(hci1394_ixl_update_vars_t *uvp) if (new_jump_ixlp->label == old_jump_ixlp->label) { /* if none, return with done ok status */ - TNF_PROBE_0_DEBUG(hci1394_ixl_update_prep_jump_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (IXL_PREP_SUCCESS); } @@ -559,9 +496,6 @@ hci1394_ixl_update_prep_jump(hci1394_ixl_update_vars_t *uvp) /* if not jumping to label, return an error */ uvp->upd_status = IXL1394_EJUMP_NOT_TO_LABEL; - TNF_PROBE_1_DEBUG(hci1394_ixl_update_prepare_exit, - HCI1394_TNF_HAL_STACK_ISOCH, "", tnf_string, errmsg, - "EJUMP_NOT_TO_LABEL"); return (IXL_PREP_FAILURE); } @@ -592,9 +526,6 @@ hci1394_ixl_update_prep_jump(hci1394_ixl_update_vars_t *uvp) /* if none, return an error */ uvp->upd_status = IXL1394_EORIG_IXL_CORRUPTED; - TNF_PROBE_1_DEBUG(hci1394_ixl_update_prep_jump_exit, - HCI1394_TNF_HAL_STACK_ISOCH, "", tnf_string, errmsg, - "EORIG_IXL_CORRUPTED"); return (IXL_PREP_FAILURE); } @@ -614,9 +545,6 @@ hci1394_ixl_update_prep_jump(hci1394_ixl_update_vars_t *uvp) if (err != DDI_SUCCESS) { uvp->upd_status = IXL1394_EINTERNAL_ERROR; - TNF_PROBE_1_DEBUG(hci1394_ixl_update_prep_jump_exit, - HCI1394_TNF_HAL_STACK_ISOCH, "", tnf_string, errmsg, - "EINTERNAL_ERROR: dma_sync() failed"); return (IXL_PREP_FAILURE); } @@ -685,8 +613,6 @@ hci1394_ixl_update_prep_jump(hci1394_ixl_update_vars_t *uvp) } } } - TNF_PROBE_0_DEBUG(hci1394_ixl_update_prep_jump_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (IXL_PREP_READY); } @@ -702,9 +628,6 @@ hci1394_ixl_update_prep_set_skipmode(hci1394_ixl_update_vars_t *uvp) ixl1394_command_t *ixlp; hci1394_xfer_ctl_t *xferctlp; - TNF_PROBE_0_DEBUG(hci1394_ixl_update_prep_set_skipmode_enter, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - old_set_skipmode_ixlp = (ixl1394_set_skipmode_t *)uvp->ixloldp; new_set_skipmode_ixlp = (ixl1394_set_skipmode_t *)uvp->ixlnewp; @@ -716,11 +639,6 @@ hci1394_ixl_update_prep_set_skipmode(hci1394_ixl_update_vars_t *uvp) IXL1394_SKIP_TO_LABEL) || (old_set_skipmode_ixlp->label == new_set_skipmode_ixlp->label)) { - - TNF_PROBE_0_DEBUG( - hci1394_ixl_update_prep_set_skipmode_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - /* No change, return with done ok status */ return (IXL_PREP_SUCCESS); } @@ -740,9 +658,6 @@ hci1394_ixl_update_prep_set_skipmode(hci1394_ixl_update_vars_t *uvp) uvp->upd_status = IXL1394_EORIG_IXL_CORRUPTED; - TNF_PROBE_1_DEBUG(hci1394_ixl_update_prep_set_skipmode_exit, - HCI1394_TNF_HAL_STACK_ISOCH, "", tnf_string, - errmsg, "EORIG_IXL_CORRUPTED"); return (IXL_PREP_FAILURE); } @@ -755,9 +670,6 @@ hci1394_ixl_update_prep_set_skipmode(hci1394_ixl_update_vars_t *uvp) uvp->upd_status = IXL1394_EORIG_IXL_CORRUPTED; - TNF_PROBE_1_DEBUG(hci1394_ixl_update_prep_set_skipmode_exit, - HCI1394_TNF_HAL_STACK_ISOCH, "", tnf_string, errmsg, - "EORIG_IXL_CORRUPTED"); return (IXL_PREP_FAILURE); } uvp->hci_offset = xferctlp->dma[0].dma_bound & DESC_Z_MASK; @@ -796,9 +708,6 @@ hci1394_ixl_update_prep_set_skipmode(hci1394_ixl_update_vars_t *uvp) /* return an error if invalid mode */ uvp->upd_status = IXL1394_EBAD_SKIPMODE; - TNF_PROBE_1_DEBUG(hci1394_ixl_update_prep_set_skipmode_exit, - HCI1394_TNF_HAL_STACK_ISOCH, "", tnf_string, - errmsg, "EBAD_SKIPMODE"); return (IXL_PREP_FAILURE); } @@ -813,9 +722,6 @@ hci1394_ixl_update_prep_set_skipmode(hci1394_ixl_update_vars_t *uvp) /* Error - not skipping to valid label */ uvp->upd_status = IXL1394_EBAD_SKIP_LABEL; - TNF_PROBE_0_DEBUG( - hci1394_ixl_update_prep_set_skipmode_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (IXL_PREP_FAILURE); } @@ -863,8 +769,6 @@ hci1394_ixl_update_prep_set_skipmode(hci1394_ixl_update_vars_t *uvp) uvp->skipaddr = xferctlp->dma[0].dma_bound; } } - TNF_PROBE_0_DEBUG(hci1394_ixl_update_prep_set_skipmode_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (IXL_PREP_READY); } @@ -879,9 +783,6 @@ hci1394_ixl_update_prep_set_tagsync(hci1394_ixl_update_vars_t *uvp) ixl1394_set_tagsync_t *new_set_tagsync_ixlp; hci1394_xfer_ctl_t *xferctlp; - TNF_PROBE_0_DEBUG(hci1394_ixl_update_prep_set_tagsync_enter, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - old_set_tagsync_ixlp = (ixl1394_set_tagsync_t *)uvp->ixloldp; new_set_tagsync_ixlp = (ixl1394_set_tagsync_t *)uvp->ixlnewp; @@ -889,9 +790,6 @@ hci1394_ixl_update_prep_set_tagsync(hci1394_ixl_update_vars_t *uvp) if ((new_set_tagsync_ixlp->tag == old_set_tagsync_ixlp->tag) && (new_set_tagsync_ixlp->sync == old_set_tagsync_ixlp->sync)) { - TNF_PROBE_0_DEBUG(hci1394_ixl_update_prep_set_tagsync_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - /* no change, return with done ok status */ return (IXL_PREP_SUCCESS); } @@ -910,16 +808,11 @@ hci1394_ixl_update_prep_set_tagsync(hci1394_ixl_update_vars_t *uvp) uvp->upd_status = IXL1394_EORIG_IXL_CORRUPTED; - TNF_PROBE_0_DEBUG(hci1394_ixl_update_prep_set_tagsync_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (IXL_PREP_FAILURE); } /* is IXL xfer command an IXL1394_OP_SEND_NO_PKT? */ if (uvp->ixlxferp->ixl_opcode == IXL1394_OP_SEND_NO_PKT) { - TNF_PROBE_0_DEBUG(hci1394_ixl_update_prep_set_tagsync_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - /* no update needed, return done ok status */ return (IXL_PREP_SUCCESS); } @@ -939,8 +832,6 @@ hci1394_ixl_update_prep_set_tagsync(hci1394_ixl_update_vars_t *uvp) uvp->upd_status = IXL1394_EORIG_IXL_CORRUPTED; - TNF_PROBE_0_DEBUG(hci1394_ixl_update_prep_set_tagsync_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (IXL_PREP_FAILURE); } uvp->hdr_offset = xferctlp->dma[0].dma_bound & DESC_Z_MASK; @@ -968,8 +859,6 @@ hci1394_ixl_update_prep_set_tagsync(hci1394_ixl_update_vars_t *uvp) uvp->ixldepth = 0; uvp->ixlcount = xferctlp->cnt; - TNF_PROBE_0_DEBUG(hci1394_ixl_update_prep_set_tagsync_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (IXL_PREP_READY); } @@ -990,9 +879,6 @@ hci1394_ixl_update_prep_recv_pkt(hci1394_ixl_update_vars_t *uvp) uint32_t desc_hdr; int err; - TNF_PROBE_0_DEBUG(hci1394_ixl_update_prep_recv_pkt_enter, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - old_xfer_pkt_ixlp = (ixl1394_xfer_pkt_t *)uvp->ixloldp; new_xfer_pkt_ixlp = (ixl1394_xfer_pkt_t *)uvp->ixlnewp; @@ -1001,10 +887,6 @@ hci1394_ixl_update_prep_recv_pkt(hci1394_ixl_update_vars_t *uvp) (new_xfer_pkt_ixlp->ixl_buf.ixldmac_addr == old_xfer_pkt_ixlp->ixl_buf.ixldmac_addr) && (new_xfer_pkt_ixlp->mem_bufp == old_xfer_pkt_ixlp->mem_bufp)) { - - TNF_PROBE_0_DEBUG(hci1394_ixl_update_prep_recv_pkt_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - /* no change. return with done ok status */ return (IXL_PREP_SUCCESS); } @@ -1015,8 +897,6 @@ hci1394_ixl_update_prep_recv_pkt(hci1394_ixl_update_vars_t *uvp) uvp->upd_status = IXL1394_EXFER_BUF_MISSING; - TNF_PROBE_0_DEBUG(hci1394_ixl_update_prep_recv_pkt_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (IXL_PREP_FAILURE); } @@ -1030,12 +910,8 @@ hci1394_ixl_update_prep_recv_pkt(hci1394_ixl_update_vars_t *uvp) uvp->ixloldp->compiler_privatep; if (uvp->ixlxferp == NULL) { - /* Error - no IXL xfer start command found */ uvp->upd_status = IXL1394_EORIG_IXL_CORRUPTED; - - TNF_PROBE_0_DEBUG(hci1394_ixl_update_prep_recv_pkt_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (IXL_PREP_FAILURE); } } else { @@ -1046,12 +922,8 @@ hci1394_ixl_update_prep_recv_pkt(hci1394_ixl_update_vars_t *uvp) /* check that xfer_ctl is present in the IXL xfer start command */ if ((xferctlp = (hci1394_xfer_ctl_t *) uvp->ixlxferp->compiler_privatep) == NULL) { - /* Error - no xfer_ctl struct found */ uvp->upd_status = IXL1394_EORIG_IXL_CORRUPTED; - - TNF_PROBE_0_DEBUG(hci1394_ixl_update_prep_recv_pkt_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (IXL_PREP_FAILURE); } @@ -1093,10 +965,6 @@ hci1394_ixl_update_prep_recv_pkt(hci1394_ixl_update_vars_t *uvp) DDI_DMA_SYNC_FORCPU); if (err != DDI_SUCCESS) { uvp->upd_status = IXL1394_EINTERNAL_ERROR; - - TNF_PROBE_1_DEBUG(hci1394_ixl_update_prep_recv_pkt_exit, - HCI1394_TNF_HAL_STACK_ISOCH, "", tnf_string, errmsg, - "EINTERNAL_ERROR: dma_sync() failed"); return (IXL_PREP_FAILURE); } @@ -1108,8 +976,6 @@ hci1394_ixl_update_prep_recv_pkt(hci1394_ixl_update_vars_t *uvp) uvp->hcistatus = (uvp->bufsize << DESC_ST_RESCOUNT_SHIFT) & DESC_ST_RESCOUNT_MASK; - TNF_PROBE_0_DEBUG(hci1394_ixl_update_prep_recv_pkt_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (IXL_PREP_READY); } @@ -1124,9 +990,6 @@ hci1394_ixl_update_prep_recv_buf(hci1394_ixl_update_vars_t *uvp) ixl1394_xfer_buf_t *new_xfer_buf_ixlp; hci1394_xfer_ctl_t *xferctlp; - TNF_PROBE_0_DEBUG(hci1394_ixl_update_prep_recv_buf_enter, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - old_xfer_buf_ixlp = (ixl1394_xfer_buf_t *)uvp->ixloldp; new_xfer_buf_ixlp = (ixl1394_xfer_buf_t *)uvp->ixlnewp; @@ -1139,10 +1002,6 @@ hci1394_ixl_update_prep_recv_buf(hci1394_ixl_update_vars_t *uvp) if (((uvp->ctxtp->ctxt_flags & HCI1394_ISO_CTXT_BFFILL) != 0) || (new_xfer_buf_ixlp->pkt_size == old_xfer_buf_ixlp->pkt_size)) { - - TNF_PROBE_0_DEBUG(hci1394_ixl_update_prep_recv_buf_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - /* no change. return with done ok status */ return (IXL_PREP_SUCCESS); } @@ -1151,11 +1010,7 @@ hci1394_ixl_update_prep_recv_buf(hci1394_ixl_update_vars_t *uvp) /* if new IXL buffer addrs are null, return error */ if ((new_xfer_buf_ixlp->ixl_buf.ixldmac_addr == 0) || (new_xfer_buf_ixlp->mem_bufp == NULL)) { - uvp->upd_status = IXL1394_EXFER_BUF_MISSING; - - TNF_PROBE_0_DEBUG(hci1394_ixl_update_prep_recv_buf_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (IXL_PREP_FAILURE); } @@ -1168,13 +1023,8 @@ hci1394_ixl_update_prep_recv_buf(hci1394_ixl_update_vars_t *uvp) if ((new_xfer_buf_ixlp->pkt_size == 0) || ((new_xfer_buf_ixlp->size / new_xfer_buf_ixlp->pkt_size) != (old_xfer_buf_ixlp->size / old_xfer_buf_ixlp->pkt_size))) { - /* count changes. return an error */ uvp->upd_status = IXL1394_EXFER_BUF_CNT_DIFF; - - TNF_PROBE_0_DEBUG( - hci1394_ixl_update_prep_recv_buf_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (IXL_PREP_FAILURE); } } @@ -1185,12 +1035,8 @@ hci1394_ixl_update_prep_recv_buf(hci1394_ixl_update_vars_t *uvp) /* check that the xfer_ctl struct is present in IXL xfer command */ if ((xferctlp = (hci1394_xfer_ctl_t *)uvp->ixlxferp->compiler_privatep) == NULL) { - /* return an error if no xfer_ctl struct is found for command */ uvp->upd_status = IXL1394_EORIG_IXL_CORRUPTED; - - TNF_PROBE_0_DEBUG(hci1394_ixl_update_prep_recv_buf_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (IXL_PREP_FAILURE); } @@ -1215,8 +1061,6 @@ hci1394_ixl_update_prep_recv_buf(hci1394_ixl_update_vars_t *uvp) uvp->hcistatus = (uvp->bufsize << DESC_ST_RESCOUNT_SHIFT) & DESC_ST_RESCOUNT_MASK; - TNF_PROBE_0_DEBUG(hci1394_ixl_update_prep_recv_buf_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (IXL_PREP_READY); } @@ -1238,9 +1082,6 @@ hci1394_ixl_update_prep_send_pkt(hci1394_ixl_update_vars_t *uvp) uint32_t desc_hdr, desc_hdr2; int err; - TNF_PROBE_0_DEBUG(hci1394_ixl_update_prep_send_pkt_enter, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - old_xfer_pkt_ixlp = (ixl1394_xfer_pkt_t *)uvp->ixloldp; new_xfer_pkt_ixlp = (ixl1394_xfer_pkt_t *)uvp->ixlnewp; @@ -1250,9 +1091,6 @@ hci1394_ixl_update_prep_send_pkt(hci1394_ixl_update_vars_t *uvp) old_xfer_pkt_ixlp->ixl_buf.ixldmac_addr) && (new_xfer_pkt_ixlp->mem_bufp == old_xfer_pkt_ixlp->mem_bufp)) { - TNF_PROBE_0_DEBUG(hci1394_ixl_update_prep_send_pkt_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - /* if none, return with done ok status */ return (IXL_PREP_SUCCESS); } @@ -1263,8 +1101,6 @@ hci1394_ixl_update_prep_send_pkt(hci1394_ixl_update_vars_t *uvp) uvp->upd_status = IXL1394_EXFER_BUF_MISSING; - TNF_PROBE_0_DEBUG(hci1394_ixl_update_prep_send_pkt_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (IXL_PREP_FAILURE); } @@ -1274,8 +1110,6 @@ hci1394_ixl_update_prep_send_pkt(hci1394_ixl_update_vars_t *uvp) uvp->upd_status = IXL1394_EPKT_HDR_MISSING; - TNF_PROBE_0_DEBUG(hci1394_ixl_update_prep_send_pkt_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (IXL_PREP_FAILURE); } @@ -1292,8 +1126,6 @@ hci1394_ixl_update_prep_send_pkt(hci1394_ixl_update_vars_t *uvp) /* error if no IXL xfer start command found */ uvp->upd_status = IXL1394_EORIG_IXL_CORRUPTED; - TNF_PROBE_0_DEBUG(hci1394_ixl_update_prep_send_pkt_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (IXL_PREP_FAILURE); } } else { @@ -1311,8 +1143,6 @@ hci1394_ixl_update_prep_send_pkt(hci1394_ixl_update_vars_t *uvp) uvp->upd_status = IXL1394_EORIG_IXL_CORRUPTED; - TNF_PROBE_0_DEBUG(hci1394_ixl_update_prep_send_pkt_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (IXL_PREP_FAILURE); } @@ -1357,9 +1187,6 @@ hci1394_ixl_update_prep_send_pkt(hci1394_ixl_update_vars_t *uvp) if (err != DDI_SUCCESS) { uvp->upd_status = IXL1394_EINTERNAL_ERROR; - TNF_PROBE_1_DEBUG(hci1394_ixl_update_prep_send_pkt_exit, - HCI1394_TNF_HAL_STACK_ISOCH, "", tnf_string, errmsg, - "EINTERNAL_ERROR: dma_sync() failed"); return (IXL_PREP_FAILURE); } @@ -1380,15 +1207,11 @@ hci1394_ixl_update_prep_send_pkt(hci1394_ixl_update_vars_t *uvp) if (uvp->pkthdr2 > 0xFFFF) { uvp->upd_status = IXL1394_EPKTSIZE_MAX_OFLO; - TNF_PROBE_0_DEBUG(hci1394_ixl_update_prep_send_pkt_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (IXL_PREP_FAILURE); } uvp->pkthdr2 = (uvp->pkthdr2 << DESC_PKT_DATALEN_SHIFT) & DESC_PKT_DATALEN_MASK; - TNF_PROBE_0_DEBUG(hci1394_ixl_update_prep_send_pkt_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (IXL_PREP_READY); } @@ -1403,9 +1226,6 @@ hci1394_ixl_update_prep_send_buf(hci1394_ixl_update_vars_t *uvp) ixl1394_xfer_buf_t *new_xfer_buf_ixlp; hci1394_xfer_ctl_t *xferctlp; - TNF_PROBE_0_DEBUG(hci1394_ixl_update_prep_send_buf_enter, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - old_xfer_buf_ixlp = (ixl1394_xfer_buf_t *)uvp->ixloldp; new_xfer_buf_ixlp = (ixl1394_xfer_buf_t *)uvp->ixlnewp; @@ -1415,10 +1235,6 @@ hci1394_ixl_update_prep_send_buf(hci1394_ixl_update_vars_t *uvp) (new_xfer_buf_ixlp->ixl_buf.ixldmac_addr == old_xfer_buf_ixlp->ixl_buf.ixldmac_addr) && (new_xfer_buf_ixlp->mem_bufp == old_xfer_buf_ixlp->mem_bufp)) { - - TNF_PROBE_0_DEBUG(hci1394_ixl_update_prep_send_buf_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - /* no change, return with done ok status */ return (IXL_PREP_SUCCESS); } @@ -1429,8 +1245,6 @@ hci1394_ixl_update_prep_send_buf(hci1394_ixl_update_vars_t *uvp) uvp->upd_status = IXL1394_EXFER_BUF_MISSING; - TNF_PROBE_0_DEBUG(hci1394_ixl_update_prep_send_buf_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (IXL_PREP_FAILURE); } @@ -1445,8 +1259,6 @@ hci1394_ixl_update_prep_send_buf(hci1394_ixl_update_vars_t *uvp) /* Error - new has different pkt count than old */ uvp->upd_status = IXL1394_EXFER_BUF_CNT_DIFF; - TNF_PROBE_0_DEBUG(hci1394_ixl_update_prep_send_buf_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (IXL_PREP_FAILURE); } @@ -1463,8 +1275,6 @@ hci1394_ixl_update_prep_send_buf(hci1394_ixl_update_vars_t *uvp) uvp->upd_status = IXL1394_EORIG_IXL_CORRUPTED; - TNF_PROBE_0_DEBUG(hci1394_ixl_update_prep_send_buf_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (IXL_PREP_FAILURE); } @@ -1502,8 +1312,6 @@ hci1394_ixl_update_prep_send_buf(hci1394_ixl_update_vars_t *uvp) uvp->pkthdr2 = (uvp->bufsize << DESC_PKT_DATALEN_SHIFT) & DESC_PKT_DATALEN_MASK; - TNF_PROBE_0_DEBUG(hci1394_ixl_update_prep_send_buf_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (IXL_PREP_READY); } @@ -1523,9 +1331,6 @@ hci1394_ixl_update_perform(hci1394_ixl_update_vars_t *uvp) ddi_dma_handle_t dma_hdl; int err; - TNF_PROBE_0_DEBUG(hci1394_ixl_update_perform_enter, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - ctxtp = uvp->ctxtp; /* @@ -1538,9 +1343,6 @@ hci1394_ixl_update_perform(hci1394_ixl_update_vars_t *uvp) uvp->upd_status = IXL1394_EINTERNAL_ERROR; - TNF_PROBE_0_DEBUG(hci1394_ixl_update_perform_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - return (DDI_FAILURE); } @@ -1584,8 +1386,6 @@ hci1394_ixl_update_perform(hci1394_ixl_update_vars_t *uvp) if (err != DDI_SUCCESS) { uvp->upd_status = IXL1394_EINTERNAL_ERROR; - TNF_PROBE_0_DEBUG(hci1394_ixl_update_perform_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (DDI_FAILURE); } @@ -1639,9 +1439,6 @@ hci1394_ixl_update_perform(hci1394_ixl_update_vars_t *uvp) if (err != DDI_SUCCESS) { uvp->upd_status = IXL1394_EINTERNAL_ERROR; - TNF_PROBE_0_DEBUG( - hci1394_ixl_update_perform_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (DDI_FAILURE); } } @@ -1683,9 +1480,6 @@ hci1394_ixl_update_perform(hci1394_ixl_update_vars_t *uvp) if (err != DDI_SUCCESS) { uvp->upd_status = IXL1394_EINTERNAL_ERROR; - TNF_PROBE_0_DEBUG( - hci1394_ixl_update_perform_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (DDI_FAILURE); } } @@ -1724,8 +1518,6 @@ hci1394_ixl_update_perform(hci1394_ixl_update_vars_t *uvp) if (err != DDI_SUCCESS) { uvp->upd_status = IXL1394_EINTERNAL_ERROR; - TNF_PROBE_0_DEBUG(hci1394_ixl_update_perform_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (DDI_FAILURE); } @@ -1741,8 +1533,6 @@ hci1394_ixl_update_perform(hci1394_ixl_update_vars_t *uvp) if (err != DDI_SUCCESS) { uvp->upd_status = IXL1394_EINTERNAL_ERROR; - TNF_PROBE_0_DEBUG(hci1394_ixl_update_perform_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (DDI_FAILURE); } @@ -1791,9 +1581,6 @@ hci1394_ixl_update_perform(hci1394_ixl_update_vars_t *uvp) if (err != DDI_SUCCESS) { uvp->upd_status = IXL1394_EINTERNAL_ERROR; - TNF_PROBE_0_DEBUG( - hci1394_ixl_update_perform_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (DDI_FAILURE); } @@ -1821,9 +1608,6 @@ hci1394_ixl_update_perform(hci1394_ixl_update_vars_t *uvp) if (err != DDI_SUCCESS) { uvp->upd_status = IXL1394_EINTERNAL_ERROR; - TNF_PROBE_0_DEBUG( - hci1394_ixl_update_perform_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (DDI_FAILURE); } } @@ -1868,8 +1652,6 @@ hci1394_ixl_update_perform(hci1394_ixl_update_vars_t *uvp) if (err != DDI_SUCCESS) { uvp->upd_status = IXL1394_EINTERNAL_ERROR; - TNF_PROBE_0_DEBUG(hci1394_ixl_update_perform_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (DDI_FAILURE); } @@ -1916,9 +1698,6 @@ hci1394_ixl_update_perform(hci1394_ixl_update_vars_t *uvp) if (err != DDI_SUCCESS) { uvp->upd_status = IXL1394_EINTERNAL_ERROR; - TNF_PROBE_0_DEBUG( - hci1394_ixl_update_perform_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (DDI_FAILURE); } @@ -1937,9 +1716,6 @@ hci1394_ixl_update_perform(hci1394_ixl_update_vars_t *uvp) if (err != DDI_SUCCESS) { uvp->upd_status = IXL1394_EINTERNAL_ERROR; - TNF_PROBE_0_DEBUG( - hci1394_ixl_update_perform_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (DDI_FAILURE); } } @@ -1959,8 +1735,6 @@ hci1394_ixl_update_perform(hci1394_ixl_update_vars_t *uvp) /* ixl command being updated must be one of above, else error */ uvp->upd_status = IXL1394_EINTERNAL_ERROR; - TNF_PROBE_0_DEBUG(hci1394_ixl_update_perform_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (DDI_FAILURE); } @@ -1974,8 +1748,6 @@ hci1394_ixl_update_perform(hci1394_ixl_update_vars_t *uvp) } /* perform update completed successfully */ - TNF_PROBE_0_DEBUG(hci1394_ixl_update_perform_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (DDI_SUCCESS); } @@ -1992,9 +1764,6 @@ hci1394_ixl_update_evaluate(hci1394_ixl_update_vars_t *uvp) int ixldepth; int ii; - TNF_PROBE_0_DEBUG(hci1394_ixl_update_evaluate_enter, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - ctxtp = uvp->ctxtp; ixlp = NULL; @@ -2034,8 +1803,6 @@ hci1394_ixl_update_evaluate(hci1394_ixl_update_vars_t *uvp) /* return post-perform update failed status */ uvp->upd_status = IXL1394_EPOST_UPD_DMALOST; - TNF_PROBE_0_DEBUG(hci1394_ixl_update_evaluate_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (DDI_FAILURE); } } @@ -2049,8 +1816,6 @@ hci1394_ixl_update_evaluate(hci1394_ixl_update_vars_t *uvp) if ((uvp->locn_info[ii].ixlp == ixlp) && (uvp->locn_info[ii].ixldepth == ixldepth)) { - TNF_PROBE_0_DEBUG(hci1394_ixl_update_evaluate_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (DDI_SUCCESS); } } @@ -2062,8 +1827,6 @@ hci1394_ixl_update_evaluate(hci1394_ixl_update_vars_t *uvp) */ uvp->upd_status = IXL1394_EPOST_UPD_DMALOST; - TNF_PROBE_0_DEBUG(hci1394_ixl_update_evaluate_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (DDI_FAILURE); } @@ -2081,9 +1844,6 @@ hci1394_ixl_update_analysis(hci1394_ixl_update_vars_t *uvp) int ii; int status; - TNF_PROBE_0_DEBUG(hci1394_ixl_update_analysis_enter, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - ctxtp = uvp->ctxtp; ixlp = NULL; @@ -2126,8 +1886,6 @@ hci1394_ixl_update_analysis(hci1394_ixl_update_vars_t *uvp) */ uvp->upd_status = IXL1394_EPRE_UPD_DMALOST; - TNF_PROBE_0_DEBUG(hci1394_ixl_update_analysis_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (DDI_FAILURE); } } @@ -2156,15 +1914,11 @@ hci1394_ixl_update_analysis(hci1394_ixl_update_vars_t *uvp) uvp->upd_status = IXL1394_ERISK_PROHIBITS_UPD; - TNF_PROBE_0_DEBUG(hci1394_ixl_update_analysis_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (DDI_FAILURE); } } /* is save for update to be performed, return ok status */ - TNF_PROBE_0_DEBUG(hci1394_ixl_update_analysis_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); return (DDI_SUCCESS); } @@ -2181,9 +1935,6 @@ hci1394_ixl_update_set_locn_info(hci1394_ixl_update_vars_t *uvp) int ixldepth; int ii; - TNF_PROBE_0_DEBUG(hci1394_ixl_update_set_locn_info_enter, - HCI1394_TNF_HAL_STACK_ISOCH, ""); - /* * find next xfer start ixl command, starting with current ixl command * where execution last left off @@ -2224,6 +1975,4 @@ hci1394_ixl_update_set_locn_info(hci1394_ixl_update_vars_t *uvp) } } } - TNF_PROBE_0_DEBUG(hci1394_ixl_update_set_locn_info_exit, - HCI1394_TNF_HAL_STACK_ISOCH, ""); } diff --git a/usr/src/uts/common/io/1394/adapters/hci1394_misc.c b/usr/src/uts/common/io/1394/adapters/hci1394_misc.c index 3bdefa1169..4f7666bfcf 100644 --- a/usr/src/uts/common/io/1394/adapters/hci1394_misc.c +++ b/usr/src/uts/common/io/1394/adapters/hci1394_misc.c @@ -24,8 +24,6 @@ * All rights reserved. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * hci1394_misc.c * Misc. HBA functions. These include getinfo, open, close, shutdown, and @@ -53,20 +51,12 @@ hci1394_getinfo(dev_info_t *dip, ddi_info_cmd_t cmd, void *arg, void **result) minor_t instance; int status; - - TNF_PROBE_0_DEBUG(hci1394_getinfo_enter, HCI1394_TNF_HAL_STACK, ""); - switch (cmd) { case DDI_INFO_DEVT2DEVINFO: dev = (dev_t)arg; instance = getminor(dev); soft_state = ddi_get_soft_state(hci1394_statep, instance); if (soft_state == NULL) { - TNF_PROBE_1(hci1394_getinfo_gss_fail, - HCI1394_TNF_HAL_ERROR, "", tnf_string, errmsg, - "ddi_get_soft_state() failed"); - TNF_PROBE_0_DEBUG(hci1394_getinfo_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } *result = (void *)soft_state->drvinfo.di_dip; @@ -81,12 +71,9 @@ hci1394_getinfo(dev_info_t *dip, ddi_info_cmd_t cmd, void *arg, void **result) break; default: - TNF_PROBE_1(hci1394_getinfo_def_fail, HCI1394_TNF_HAL_ERROR, "", - tnf_string, errmsg, "reached default in switch"); status = DDI_FAILURE; } - TNF_PROBE_0_DEBUG(hci1394_getinfo_exit, HCI1394_TNF_HAL_STACK, ""); return (status); } @@ -97,18 +84,11 @@ hci1394_open(dev_t *devp, int flag, int otyp, cred_t *credp) { hci1394_state_t *soft_state; - - TNF_PROBE_0_DEBUG(hci1394_open_enter, HCI1394_TNF_HAL_STACK, ""); - soft_state = ddi_get_soft_state(hci1394_statep, getminor(*devp)); if (soft_state == NULL) { - TNF_PROBE_1(hci1394_open_gss_fail, HCI1394_TNF_HAL_ERROR, "", - tnf_string, errmsg, "ddi_get_soft_state() failed"); - TNF_PROBE_0_DEBUG(hci1394_open_exit, HCI1394_TNF_HAL_STACK, ""); return (ENXIO); } - TNF_PROBE_0_DEBUG(hci1394_open_exit, HCI1394_TNF_HAL_STACK, ""); return (0); } @@ -117,10 +97,6 @@ hci1394_open(dev_t *devp, int flag, int otyp, cred_t *credp) int hci1394_close(dev_t dev, int flag, int otyp, cred_t *credp) { - TNF_PROBE_0_DEBUG(hci1394_close_enter, HCI1394_TNF_HAL_STACK, ""); - - TNF_PROBE_0_DEBUG(hci1394_close_exit, HCI1394_TNF_HAL_STACK, ""); - return (0); } @@ -144,14 +120,8 @@ hci1394_shutdown(dev_info_t *dip) ASSERT(0); #endif - TNF_PROBE_0_DEBUG(hci1394_shutdown_enter, HCI1394_TNF_HAL_STACK, ""); - soft_state = ddi_get_soft_state(hci1394_statep, ddi_get_instance(dip)); if (soft_state == NULL) { - TNF_PROBE_1(hci1394_shutdown_gss_fail, HCI1394_TNF_HAL_ERROR, - "", tnf_string, errmsg, "ddi_get_soft_state() failed"); - TNF_PROBE_0_DEBUG(hci1394_shutdown_exit, - HCI1394_TNF_HAL_STACK, ""); return; } @@ -169,8 +139,6 @@ hci1394_shutdown(dev_info_t *dip) /* Flush out async DMA Q's (cancels pendingQ timeouts too) */ hci1394_async_flush(soft_state->async); - - TNF_PROBE_0_DEBUG(hci1394_shutdown_exit, HCI1394_TNF_HAL_STACK, ""); } @@ -183,11 +151,9 @@ hci1394_state(hci1394_drvinfo_t *drvinfo) { hci1394_statevar_t hal_state; - TNF_PROBE_0_DEBUG(hci1394_state_enter, HCI1394_TNF_HAL_STACK, ""); mutex_enter(&drvinfo->di_drvstate.ds_mutex); hal_state = drvinfo->di_drvstate.ds_state; mutex_exit(&drvinfo->di_drvstate.ds_mutex); - TNF_PROBE_0_DEBUG(hci1394_state_exit, HCI1394_TNF_HAL_STACK, ""); return (hal_state); } @@ -202,22 +168,16 @@ hci1394_state(hci1394_drvinfo_t *drvinfo) int hci1394_state_set(hci1394_drvinfo_t *drvinfo, hci1394_statevar_t state) { - TNF_PROBE_0_DEBUG(hci1394_state_set_enter, HCI1394_TNF_HAL_STACK, ""); mutex_enter(&drvinfo->di_drvstate.ds_mutex); /* Do not allow a transition out of shutdown */ if (drvinfo->di_drvstate.ds_state == HCI1394_SHUTDOWN) { mutex_exit(&drvinfo->di_drvstate.ds_mutex); - TNF_PROBE_1(hci1394_state_set_fail, HCI1394_TNF_HAL_STACK, "", - tnf_string, errmsg, "driver shutdown"); - TNF_PROBE_0_DEBUG(hci1394_state_set_exit, HCI1394_TNF_HAL_STACK, - ""); return (DDI_FAILURE); } drvinfo->di_drvstate.ds_state = state; mutex_exit(&drvinfo->di_drvstate.ds_mutex); - TNF_PROBE_0_DEBUG(hci1394_state_set_exit, HCI1394_TNF_HAL_STACK, ""); return (DDI_SUCCESS); } diff --git a/usr/src/uts/common/io/1394/adapters/hci1394_ohci.c b/usr/src/uts/common/io/1394/adapters/hci1394_ohci.c index ed79737f03..e0d9dbdd9c 100644 --- a/usr/src/uts/common/io/1394/adapters/hci1394_ohci.c +++ b/usr/src/uts/common/io/1394/adapters/hci1394_ohci.c @@ -24,8 +24,6 @@ * Copyright (c) 2016 by Delphix. All rights reserved. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * hci1394_ohci.c * Provides access routines to the OpenHCI HW. @@ -89,7 +87,6 @@ hci1394_ohci_init(hci1394_state_t *soft_state, hci1394_drvinfo_t *drvinfo, ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_init_enter, HCI1394_TNF_HAL_STACK, ""); /* alloc the space for ohci */ ohci = kmem_alloc(sizeof (hci1394_ohci_t), KM_SLEEP); @@ -121,10 +118,6 @@ hci1394_ohci_init(hci1394_state_t *soft_state, hci1394_drvinfo_t *drvinfo, mutex_destroy(&ohci->ohci_mutex); kmem_free(ohci, sizeof (hci1394_ohci_t)); *ohci_hdl = NULL; - TNF_PROBE_0(ddi_regs_map_setup_fail, HCI1394_TNF_HAL_ERROR, - ""); - TNF_PROBE_0_DEBUG(hci1394_ohci_init_exit, HCI1394_TNF_HAL_STACK, - ""); return (DDI_FAILURE); } @@ -155,10 +148,6 @@ hci1394_ohci_init(hci1394_state_t *soft_state, hci1394_drvinfo_t *drvinfo, mutex_destroy(&ohci->ohci_mutex); kmem_free(ohci, sizeof (hci1394_ohci_t)); *ohci_hdl = NULL; - TNF_PROBE_0(hci1394_ohci_chip_init_fail, HCI1394_TNF_HAL_ERROR, - ""); - TNF_PROBE_0_DEBUG(hci1394_ohci_init_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -170,10 +159,6 @@ hci1394_ohci_init(hci1394_state_t *soft_state, hci1394_drvinfo_t *drvinfo, mutex_destroy(&ohci->ohci_mutex); kmem_free(ohci, sizeof (hci1394_ohci_t)); *ohci_hdl = NULL; - TNF_PROBE_0(hci1394_ohci_phy_init_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_ohci_init_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -186,10 +171,6 @@ hci1394_ohci_init(hci1394_state_t *soft_state, hci1394_drvinfo_t *drvinfo, mutex_destroy(&ohci->ohci_mutex); kmem_free(ohci, sizeof (hci1394_ohci_t)); *ohci_hdl = NULL; - TNF_PROBE_0(hci1394_ohci_1394a_init_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_ohci_init_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } } @@ -213,10 +194,6 @@ hci1394_ohci_init(hci1394_state_t *soft_state, hci1394_drvinfo_t *drvinfo, mutex_destroy(&ohci->ohci_mutex); kmem_free(ohci, sizeof (hci1394_ohci_t)); *ohci_hdl = NULL; - TNF_PROBE_0(hci1394_ohci_selfid_init_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_ohci_init_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -228,10 +205,6 @@ hci1394_ohci_init(hci1394_state_t *soft_state, hci1394_drvinfo_t *drvinfo, mutex_destroy(&ohci->ohci_mutex); kmem_free(ohci, sizeof (hci1394_ohci_t)); *ohci_hdl = NULL; - TNF_PROBE_0(hci1394_ohci_selfid_init_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_ohci_init_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -244,15 +217,9 @@ hci1394_ohci_init(hci1394_state_t *soft_state, hci1394_drvinfo_t *drvinfo, mutex_destroy(&ohci->ohci_mutex); kmem_free(ohci, sizeof (hci1394_ohci_t)); *ohci_hdl = NULL; - TNF_PROBE_0(hci1394_ohci_cfgrom_init_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_ohci_init_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } - TNF_PROBE_0_DEBUG(hci1394_ohci_init_exit, HCI1394_TNF_HAL_STACK, ""); - return (DDI_SUCCESS); } @@ -268,7 +235,6 @@ hci1394_ohci_fini(hci1394_ohci_handle_t *ohci_hdl) ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_fini_enter, HCI1394_TNF_HAL_STACK, ""); ohci = *ohci_hdl; @@ -289,8 +255,6 @@ hci1394_ohci_fini(hci1394_ohci_handle_t *ohci_hdl) /* Free the OpenHCI state space */ kmem_free(ohci, sizeof (hci1394_ohci_t)); *ohci_hdl = NULL; - - TNF_PROBE_0_DEBUG(hci1394_ohci_fini_exit, HCI1394_TNF_HAL_STACK, ""); } @@ -306,16 +270,10 @@ hci1394_ohci_chip_init(hci1394_ohci_handle_t ohci_hdl) ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_chip_init_enter, HCI1394_TNF_HAL_STACK, - ""); /* Reset 1394 OHCI HW */ status = hci1394_ohci_soft_reset(ohci_hdl); if (status != DDI_SUCCESS) { - TNF_PROBE_0(hci1394_ohci_soft_reset_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_ohci_init_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -429,8 +387,6 @@ hci1394_ohci_chip_init(hci1394_ohci_handle_t ohci_hdl) ddi_put32(ohci_hdl->ohci_reg_handle, &ohci_hdl->ohci_regs->intr_mask_clr, (uint32_t)0xFFFFFFFF); - TNF_PROBE_0_DEBUG(hci1394_ohci_chip_init_exit, HCI1394_TNF_HAL_STACK, - ""); return (DDI_SUCCESS); } @@ -446,8 +402,6 @@ hci1394_ohci_soft_reset(hci1394_ohci_handle_t ohci_hdl) ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_soft_reset_enter, - HCI1394_TNF_HAL_STACK, ""); /* Reset 1394 HW - Reset is bit 16 in HCControl */ ddi_put32(ohci_hdl->ohci_reg_handle, @@ -461,16 +415,9 @@ hci1394_ohci_soft_reset(hci1394_ohci_handle_t ohci_hdl) &ohci_hdl->ohci_regs->hc_ctrl_set); resetStatus = resetStatus & OHCI_HC_SOFT_RESET; if (resetStatus != 0) { - TNF_PROBE_0(hci1394_ohci_reset_not_complete_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_ohci_soft_reset_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } - TNF_PROBE_0_DEBUG(hci1394_ohci_soft_reset_exit, - HCI1394_TNF_HAL_STACK, ""); - return (DDI_SUCCESS); } @@ -489,15 +436,10 @@ hci1394_ohci_reg_read(hci1394_ohci_handle_t ohci_hdl, ASSERT(ohci_hdl != NULL); ASSERT(data != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_reg_read_enter, - HCI1394_TNF_HAL_STACK, ""); addr = (uint32_t *)((uintptr_t)ohci_hdl->ohci_regs + (uintptr_t)(offset & OHCI_REG_ADDR_MASK)); *data = ddi_get32(ohci_hdl->ohci_reg_handle, addr); - - TNF_PROBE_0_DEBUG(hci1394_ohci_reg_read_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -514,15 +456,10 @@ hci1394_ohci_reg_write(hci1394_ohci_handle_t ohci_hdl, ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_reg_read_enter, - HCI1394_TNF_HAL_STACK, ""); addr = (uint32_t *)((uintptr_t)ohci_hdl->ohci_regs + (uintptr_t)(offset & OHCI_REG_ADDR_MASK)); ddi_put32(ohci_hdl->ohci_reg_handle, addr, data); - - TNF_PROBE_0_DEBUG(hci1394_ohci_reg_read_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -536,14 +473,9 @@ void hci1394_ohci_intr_master_enable(hci1394_ohci_handle_t ohci_hdl) { ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_intr_master_enable_enter, - HCI1394_TNF_HAL_STACK, ""); ddi_put32(ohci_hdl->ohci_reg_handle, &ohci_hdl->ohci_regs->intr_mask_set, OHCI_INTR_MASTER_INTR_ENBL); - - TNF_PROBE_0_DEBUG(hci1394_ohci_intr_master_enable_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -557,14 +489,9 @@ void hci1394_ohci_intr_master_disable(hci1394_ohci_handle_t ohci_hdl) { ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_intr_master_disable_enter, - HCI1394_TNF_HAL_STACK, ""); ddi_put32(ohci_hdl->ohci_reg_handle, &ohci_hdl->ohci_regs->intr_mask_clr, OHCI_INTR_MASTER_INTR_ENBL); - - TNF_PROBE_0_DEBUG(hci1394_ohci_intr_master_disable_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -581,8 +508,6 @@ hci1394_ohci_intr_asserted(hci1394_ohci_handle_t ohci_hdl) uint32_t interrupts_asserted; ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_intr_asserted_enter, - HCI1394_TNF_HAL_STACK, ""); /* * Only look at interrupts which are enabled by reading the @@ -591,8 +516,6 @@ hci1394_ohci_intr_asserted(hci1394_ohci_handle_t ohci_hdl) interrupts_asserted = ddi_get32(ohci_hdl->ohci_reg_handle, &ohci_hdl->ohci_regs->intr_event_clr); - TNF_PROBE_0_DEBUG(hci1394_ohci_intr_asserted_exit, - HCI1394_TNF_HAL_STACK, ""); return (interrupts_asserted); } @@ -607,14 +530,9 @@ hci1394_ohci_intr_enable(hci1394_ohci_handle_t ohci_hdl, uint32_t interrupt_mask) { ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_intr_enable_enter, - HCI1394_TNF_HAL_STACK, ""); ddi_put32(ohci_hdl->ohci_reg_handle, &ohci_hdl->ohci_regs->intr_mask_set, interrupt_mask); - - TNF_PROBE_0_DEBUG(hci1394_ohci_intr_enable_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -628,14 +546,9 @@ hci1394_ohci_intr_disable(hci1394_ohci_handle_t ohci_hdl, uint32_t interrupt_mask) { ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_intr_disable_enter, - HCI1394_TNF_HAL_STACK, ""); ddi_put32(ohci_hdl->ohci_reg_handle, &ohci_hdl->ohci_regs->intr_mask_clr, interrupt_mask); - - TNF_PROBE_0_DEBUG(hci1394_ohci_intr_disable_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -650,16 +563,9 @@ hci1394_ohci_intr_clear(hci1394_ohci_handle_t ohci_hdl, uint32_t interrupt_mask) { ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_intr_clear_enter, - HCI1394_TNF_HAL_STACK, ""); ddi_put32(ohci_hdl->ohci_reg_handle, &ohci_hdl->ohci_regs->intr_event_clr, interrupt_mask); - TNF_PROBE_1_DEBUG(hci1394_ohci_intr_clear, HCI1394_TNF_HAL, "", - tnf_uint, intr_mask, interrupt_mask); - - TNF_PROBE_0_DEBUG(hci1394_ohci_intr_clear_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -676,15 +582,11 @@ hci1394_ohci_it_intr_asserted(hci1394_ohci_handle_t ohci_hdl) uint32_t interrupts_asserted; ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_it_intr_asserted_enter, - HCI1394_TNF_HAL_STACK, ""); /* Only look at interrupts which are enabled */ interrupts_asserted = ddi_get32(ohci_hdl->ohci_reg_handle, &ohci_hdl->ohci_regs->it_intr_event_clr); - TNF_PROBE_0_DEBUG(hci1394_ohci_it_intr_asserted_exit, - HCI1394_TNF_HAL_STACK, ""); return (interrupts_asserted); } @@ -700,14 +602,9 @@ hci1394_ohci_it_intr_enable(hci1394_ohci_handle_t ohci_hdl, uint32_t interrupt_mask) { ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_it_intr_enable_enter, - HCI1394_TNF_HAL_STACK, ""); ddi_put32(ohci_hdl->ohci_reg_handle, &ohci_hdl->ohci_regs->it_intr_mask_set, interrupt_mask); - - TNF_PROBE_0_DEBUG(hci1394_ohci_it_intr_enable_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -722,14 +619,9 @@ hci1394_ohci_it_intr_disable(hci1394_ohci_handle_t ohci_hdl, uint32_t interrupt_mask) { ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_it_intr_disable_enter, - HCI1394_TNF_HAL_STACK, ""); ddi_put32(ohci_hdl->ohci_reg_handle, &ohci_hdl->ohci_regs->it_intr_mask_clr, interrupt_mask); - - TNF_PROBE_0_DEBUG(hci1394_ohci_it_intr_disable_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -744,14 +636,9 @@ hci1394_ohci_it_intr_clear(hci1394_ohci_handle_t ohci_hdl, uint32_t interrupt_mask) { ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_it_intr_clear_enter, - HCI1394_TNF_HAL_STACK, ""); ddi_put32(ohci_hdl->ohci_reg_handle, &ohci_hdl->ohci_regs->it_intr_event_clr, interrupt_mask); - - TNF_PROBE_0_DEBUG(hci1394_ohci_it_intr_clear_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -766,8 +653,6 @@ hci1394_ohci_it_ctxt_count_get(hci1394_ohci_handle_t ohci_hdl) int count; ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_it_ctxt_count_get_enter, - HCI1394_TNF_HAL_STACK, ""); /* * hw is required to support contexts 0 to N, where N <= 31 @@ -785,8 +670,6 @@ hci1394_ohci_it_ctxt_count_get(hci1394_ohci_handle_t ohci_hdl) count++; } - TNF_PROBE_0_DEBUG(hci1394_ohci_it_ctxt_count_get_exit, - HCI1394_TNF_HAL_STACK, ""); return (count); } @@ -802,15 +685,10 @@ hci1394_ohci_it_cmd_ptr_set(hci1394_ohci_handle_t ohci_hdl, uint_t context_number, uint32_t io_addr) { ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_it_cmd_ptr_set_enter, - HCI1394_TNF_HAL_STACK, ""); ddi_put32(ohci_hdl->ohci_reg_handle, &ohci_hdl->ohci_regs->it[context_number].cmd_ptrlo, io_addr); - - TNF_PROBE_0_DEBUG(hci1394_ohci_it_cmd_ptr_set_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -827,15 +705,11 @@ hci1394_ohci_ir_intr_asserted(hci1394_ohci_handle_t ohci_hdl) uint32_t interrupts_asserted; ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_ir_intr_asserted_enter, - HCI1394_TNF_HAL_STACK, ""); /* Only look at interrupts which are enabled */ interrupts_asserted = ddi_get32(ohci_hdl->ohci_reg_handle, &ohci_hdl->ohci_regs->ir_intr_event_clr); - TNF_PROBE_0_DEBUG(hci1394_ohci_ir_intr_asserted_exit, - HCI1394_TNF_HAL_STACK, ""); return (interrupts_asserted); } @@ -851,14 +725,9 @@ hci1394_ohci_ir_intr_enable(hci1394_ohci_handle_t ohci_hdl, uint32_t interrupt_mask) { ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_ir_intr_enable_enter, - HCI1394_TNF_HAL_STACK, ""); ddi_put32(ohci_hdl->ohci_reg_handle, &ohci_hdl->ohci_regs->ir_intr_mask_set, interrupt_mask); - - TNF_PROBE_0_DEBUG(hci1394_ohci_ir_intr_enable_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -873,14 +742,9 @@ hci1394_ohci_ir_intr_disable(hci1394_ohci_handle_t ohci_hdl, uint32_t interrupt_mask) { ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_ir_intr_disable_enter, - HCI1394_TNF_HAL_STACK, ""); ddi_put32(ohci_hdl->ohci_reg_handle, &ohci_hdl->ohci_regs->ir_intr_mask_clr, interrupt_mask); - - TNF_PROBE_0_DEBUG(hci1394_ohci_ir_intr_disable_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -895,14 +759,9 @@ hci1394_ohci_ir_intr_clear(hci1394_ohci_handle_t ohci_hdl, uint32_t interrupt_mask) { ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_ir_intr_clear_enter, - HCI1394_TNF_HAL_STACK, ""); ddi_put32(ohci_hdl->ohci_reg_handle, &ohci_hdl->ohci_regs->ir_intr_event_clr, interrupt_mask); - - TNF_PROBE_0_DEBUG(hci1394_ohci_ir_intr_clear_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -917,8 +776,6 @@ hci1394_ohci_ir_ctxt_count_get(hci1394_ohci_handle_t ohci_hdl) int count; ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_ir_ctxt_count_get_enter, - HCI1394_TNF_HAL_STACK, ""); /* * hw is required to support contexts 0 to N, where N <= 31 @@ -936,8 +793,6 @@ hci1394_ohci_ir_ctxt_count_get(hci1394_ohci_handle_t ohci_hdl) count++; } - TNF_PROBE_0_DEBUG(hci1394_ohci_ir_ctxt_count_get_exit, - HCI1394_TNF_HAL_STACK, ""); return (count); } @@ -953,15 +808,10 @@ hci1394_ohci_ir_cmd_ptr_set(hci1394_ohci_handle_t ohci_hdl, uint_t context_number, uint32_t io_addr) { ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_ir_cmd_ptr_set_enter, - HCI1394_TNF_HAL_STACK, ""); ddi_put32(ohci_hdl->ohci_reg_handle, &ohci_hdl->ohci_regs->ir[context_number].cmd_ptrlo, io_addr); - - TNF_PROBE_0_DEBUG(hci1394_ohci_ir_cmd_ptr_set_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -974,14 +824,9 @@ void hci1394_ohci_link_enable(hci1394_ohci_handle_t ohci_hdl) { ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_link_enable_enter, - HCI1394_TNF_HAL_STACK, ""); ddi_put32(ohci_hdl->ohci_reg_handle, &ohci_hdl->ohci_regs->hc_ctrl_set, OHCI_HC_LINK_ENBL); - - TNF_PROBE_0_DEBUG(hci1394_ohci_link_enable_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -995,14 +840,9 @@ void hci1394_ohci_link_disable(hci1394_ohci_handle_t ohci_hdl) { ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_link_disable_enter, - HCI1394_TNF_HAL_STACK, ""); ddi_put32(ohci_hdl->ohci_reg_handle, &ohci_hdl->ohci_regs->hc_ctrl_clr, OHCI_HC_LINK_ENBL); - - TNF_PROBE_0_DEBUG(hci1394_ohci_link_disable_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -1019,8 +859,6 @@ hci1394_ohci_bus_reset(hci1394_ohci_handle_t ohci_hdl) ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_bus_reset_enter, - HCI1394_TNF_HAL_STACK, ""); /* * We want to reset the bus. We also handle the root_holdoff and gap @@ -1043,10 +881,6 @@ hci1394_ohci_bus_reset(hci1394_ohci_handle_t ohci_hdl) */ status = hci1394_ohci_phy_write(ohci_hdl, 0x1, reg); if (status != DDI_SUCCESS) { - TNF_PROBE_0(hci1394_ohci_phy_write_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_ohci_bus_reset_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -1054,9 +888,6 @@ hci1394_ohci_bus_reset(hci1394_ohci_handle_t ohci_hdl) ohci_hdl->ohci_set_root_holdoff = B_FALSE; ohci_hdl->ohci_set_gap_count = B_FALSE; - TNF_PROBE_0_DEBUG(hci1394_ohci_bus_reset_exit, - HCI1394_TNF_HAL_STACK, ""); - return (DDI_SUCCESS); } @@ -1088,10 +919,6 @@ hci1394_ohci_bus_reset_nroot(hci1394_ohci_handle_t ohci_hdl) */ status = hci1394_ohci_phy_write(ohci_hdl, 0x1, reg); if (status != DDI_SUCCESS) { - TNF_PROBE_0(hci1394_ohci_phy_write_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_ohci_bus_reset_nroot_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -1111,8 +938,6 @@ hci1394_ohci_phy_init(hci1394_ohci_handle_t ohci_hdl) ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_phy_init_enter, - HCI1394_TNF_HAL_STACK, ""); /* * if the phy has extended set to 7, the phy is a not a 1394-1995 PHY. @@ -1131,10 +956,6 @@ hci1394_ohci_phy_init(hci1394_ohci_handle_t ohci_hdl) */ status = hci1394_ohci_phy_read(ohci_hdl, 2, &phy_reg); if (status != DDI_SUCCESS) { - TNF_PROBE_0(hci1394_ohci_phy_read_failed, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_ohci_phy_init_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -1149,9 +970,6 @@ hci1394_ohci_phy_init(hci1394_ohci_handle_t ohci_hdl) ohci_hdl->ohci_phy = H1394_PHY_1394A; } - TNF_PROBE_0_DEBUG(hci1394_ohci_phy_init_exit, - HCI1394_TNF_HAL_STACK, ""); - return (DDI_SUCCESS); } @@ -1166,14 +984,8 @@ static int hci1394_ohci_phy_resume(hci1394_ohci_handle_t ohci_hdl) { ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_phy_resume_enter, - HCI1394_TNF_HAL_STACK, ""); /* There is currently nothing to re-initialize here */ - - TNF_PROBE_0_DEBUG(hci1394_ohci_phy_resume_exit, - HCI1394_TNF_HAL_STACK, ""); - return (DDI_SUCCESS); } @@ -1191,8 +1003,6 @@ hci1394_ohci_phy_set(hci1394_ohci_handle_t ohci_hdl, uint_t address, ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_phy_set_enter, - HCI1394_TNF_HAL_STACK, ""); mutex_enter(&ohci_hdl->ohci_mutex); @@ -1200,10 +1010,6 @@ hci1394_ohci_phy_set(hci1394_ohci_handle_t ohci_hdl, uint_t address, status = hci1394_ohci_phy_read_no_lock(ohci_hdl, address, ®); if (status != DDI_SUCCESS) { mutex_exit(&ohci_hdl->ohci_mutex); - TNF_PROBE_0(hci1394_ohci_phy_read_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_ohci_phy_set_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -1212,18 +1018,11 @@ hci1394_ohci_phy_set(hci1394_ohci_handle_t ohci_hdl, uint_t address, status = hci1394_ohci_phy_write_no_lock(ohci_hdl, address, reg); if (status != DDI_SUCCESS) { mutex_exit(&ohci_hdl->ohci_mutex); - TNF_PROBE_0(hci1394_ohci_phy_write_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_ohci_phy_set_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } mutex_exit(&ohci_hdl->ohci_mutex); - TNF_PROBE_0_DEBUG(hci1394_ohci_phy_set_exit, HCI1394_TNF_HAL_STACK, - ""); - return (DDI_SUCCESS); } @@ -1241,8 +1040,6 @@ hci1394_ohci_phy_clr(hci1394_ohci_handle_t ohci_hdl, uint_t address, ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_phy_clr_enter, - HCI1394_TNF_HAL_STACK, ""); mutex_enter(&ohci_hdl->ohci_mutex); @@ -1250,10 +1047,6 @@ hci1394_ohci_phy_clr(hci1394_ohci_handle_t ohci_hdl, uint_t address, status = hci1394_ohci_phy_read_no_lock(ohci_hdl, address, ®); if (status != DDI_SUCCESS) { mutex_exit(&ohci_hdl->ohci_mutex); - TNF_PROBE_0(hci1394_ohci_phy_read_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_ohci_phy_clr_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -1262,18 +1055,10 @@ hci1394_ohci_phy_clr(hci1394_ohci_handle_t ohci_hdl, uint_t address, status = hci1394_ohci_phy_write_no_lock(ohci_hdl, address, reg); if (status != DDI_SUCCESS) { mutex_exit(&ohci_hdl->ohci_mutex); - TNF_PROBE_0(hci1394_ohci_phy_write_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_ohci_phy_clr_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } mutex_exit(&ohci_hdl->ohci_mutex); - - TNF_PROBE_0_DEBUG(hci1394_ohci_phy_clr_exit, HCI1394_TNF_HAL_STACK, - ""); - return (DDI_SUCCESS); } @@ -1289,13 +1074,9 @@ hci1394_ohci_phy_read(hci1394_ohci_handle_t ohci_hdl, uint_t address, int status; ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_phy_read_enter, HCI1394_TNF_HAL_STACK, - ""); mutex_enter(&ohci_hdl->ohci_mutex); status = hci1394_ohci_phy_read_no_lock(ohci_hdl, address, data); mutex_exit(&ohci_hdl->ohci_mutex); - TNF_PROBE_0_DEBUG(hci1394_ohci_phy_read_exit, HCI1394_TNF_HAL_STACK, - ""); return (status); } @@ -1312,13 +1093,9 @@ hci1394_ohci_phy_write(hci1394_ohci_handle_t ohci_hdl, uint_t address, int status; ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_phy_write_enter, HCI1394_TNF_HAL_STACK, - ""); mutex_enter(&ohci_hdl->ohci_mutex); status = hci1394_ohci_phy_write_no_lock(ohci_hdl, address, data); mutex_exit(&ohci_hdl->ohci_mutex); - TNF_PROBE_0_DEBUG(hci1394_ohci_phy_write_exit, HCI1394_TNF_HAL_STACK, - ""); return (status); } @@ -1341,15 +1118,9 @@ hci1394_ohci_phy_read_no_lock(hci1394_ohci_handle_t ohci_hdl, uint_t address, ASSERT(ohci_hdl != NULL); ASSERT(data != NULL); ASSERT(MUTEX_HELD(&ohci_hdl->ohci_mutex)); - TNF_PROBE_0_DEBUG(hci1394_ohci_phy_read_no_lock_enter, - HCI1394_TNF_HAL_STACK, ""); /* You can't read or write PHY register #0 */ if (address == 0) { - TNF_PROBE_1(hci1394_ohci_phy_addr_fail, HCI1394_TNF_HAL_ERROR, - "", tnf_string, errmsg, "can't rd/wr PHY reg #0"); - TNF_PROBE_0_DEBUG(hci1394_ohci_phy_read_no_lock_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -1357,10 +1128,6 @@ hci1394_ohci_phy_read_no_lock(hci1394_ohci_handle_t ohci_hdl, uint_t address, ohci_reg = ddi_get32(ohci_hdl->ohci_reg_handle, &ohci_hdl->ohci_regs->phy_ctrl); if ((ohci_reg & (OHCI_PHYC_RDREG | OHCI_PHYC_WRREG)) != 0) { - TNF_PROBE_1(hci1394_ohci_phy_xfer_fail, HCI1394_TNF_HAL_ERROR, - "", tnf_string, errmsg, "transfer already in progress?"); - TNF_PROBE_0_DEBUG(hci1394_ohci_phy_read_no_lock_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -1408,10 +1175,6 @@ hci1394_ohci_phy_read_no_lock(hci1394_ohci_handle_t ohci_hdl, uint_t address, if (count >= hci1394_phy_delay_uS) { /* we timed out, return failure */ *data = 0; - TNF_PROBE_0(hci1394_ohci_phy_rd_timeout_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_ohci_phy_read_no_lock_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -1420,9 +1183,6 @@ hci1394_ohci_phy_read_no_lock(hci1394_ohci_handle_t ohci_hdl, uint_t address, &ohci_hdl->ohci_regs->phy_ctrl) & OHCI_PHYC_RDDATA_MASK) >> OHCI_PHYC_RDDATA_SHIFT; - TNF_PROBE_0_DEBUG(hci1394_ohci_phy_read_no_lock_exit, - HCI1394_TNF_HAL_STACK, ""); - return (DDI_SUCCESS); } @@ -1443,15 +1203,9 @@ hci1394_ohci_phy_write_no_lock(hci1394_ohci_handle_t ohci_hdl, uint_t address, ASSERT(ohci_hdl != NULL); ASSERT(MUTEX_HELD(&ohci_hdl->ohci_mutex)); - TNF_PROBE_0_DEBUG(hci1394_ohci_phy_write_enter, - HCI1394_TNF_HAL_STACK, ""); /* You can't read or write PHY register #0 */ if (address == 0) { - TNF_PROBE_1(hci1394_ohci_phy_addr_fail, HCI1394_TNF_HAL_ERROR, - "", tnf_string, errmsg, "can't rd/wr PHY reg #0"); - TNF_PROBE_0_DEBUG(hci1394_ohci_phy_write_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -1459,10 +1213,6 @@ hci1394_ohci_phy_write_no_lock(hci1394_ohci_handle_t ohci_hdl, uint_t address, ohci_reg = ddi_get32(ohci_hdl->ohci_reg_handle, &ohci_hdl->ohci_regs->phy_ctrl); if ((ohci_reg & (OHCI_PHYC_RDREG | OHCI_PHYC_WRREG)) != 0) { - TNF_PROBE_1(hci1394_ohci_phy_xfer_fail, HCI1394_TNF_HAL_ERROR, - "", tnf_string, errmsg, "transfer already in progress?"); - TNF_PROBE_0_DEBUG(hci1394_ohci_phy_write_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -1504,16 +1254,9 @@ hci1394_ohci_phy_write_no_lock(hci1394_ohci_handle_t ohci_hdl, uint_t address, /* Check to see if we timed out */ if (count >= hci1394_phy_delay_uS) { /* we timed out, return failure */ - TNF_PROBE_0(hci1394_ohci_phy_wr_timeout_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_ohci_phy_write_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } - TNF_PROBE_0_DEBUG(hci1394_ohci_phy_write_exit, - HCI1394_TNF_HAL_STACK, ""); - return (DDI_SUCCESS); } @@ -1543,8 +1286,6 @@ hci1394_ohci_phy_info(hci1394_ohci_handle_t ohci_hdl, uint32_t *info) ASSERT(ohci_hdl != NULL); ASSERT(info != NULL); ASSERT(ohci_hdl->ohci_phy == H1394_PHY_1995); - TNF_PROBE_0_DEBUG(hci1394_ohci_phy_info_enter, - HCI1394_TNF_HAL_STACK, ""); /* * Set Link on. We are using power class 0 since we have no idea what @@ -1561,10 +1302,6 @@ hci1394_ohci_phy_info(hci1394_ohci_handle_t ohci_hdl, uint32_t *info) /* Add in Gap Count */ status = hci1394_ohci_phy_read(ohci_hdl, 1, ®); if (status != DDI_SUCCESS) { - TNF_PROBE_0(hci1394_ohci_phy_read_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_ohci_phy_info_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } phy_info = phy_info | ((reg << IEEE1394_SELFID_GAP_CNT_SHIFT) & @@ -1573,10 +1310,6 @@ hci1394_ohci_phy_info(hci1394_ohci_handle_t ohci_hdl, uint32_t *info) /* Add in speed & ports */ status = hci1394_ohci_phy_read(ohci_hdl, 2, ®); if (status != DDI_SUCCESS) { - TNF_PROBE_0(hci1394_ohci_phy_read_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_ohci_phy_info_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } phy_info = phy_info | ((reg & 0xC0) << 8); @@ -1584,11 +1317,6 @@ hci1394_ohci_phy_info(hci1394_ohci_handle_t ohci_hdl, uint32_t *info) /* PHY reports that it has 0 ports?? */ if (num_ports == 0) { - TNF_PROBE_1(hci1394_ohci_phy_zero_ports_fail, - HCI1394_TNF_HAL_ERROR, "", tnf_string, errmsg, - "1995 phy has zero ports?"); - TNF_PROBE_0_DEBUG(hci1394_ohci_phy_info_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -1599,10 +1327,6 @@ hci1394_ohci_phy_info(hci1394_ohci_handle_t ohci_hdl, uint32_t *info) status = hci1394_ohci_phy_read(ohci_hdl, count + 3, ®); if (status != DDI_SUCCESS) { - TNF_PROBE_0(hci1394_ohci_phy_read_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_ohci_phy_info_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } /* if port is not connected */ @@ -1632,9 +1356,6 @@ hci1394_ohci_phy_info(hci1394_ohci_handle_t ohci_hdl, uint32_t *info) /* Copy the PHY selfid info to the return parameter */ *info = phy_info; - TNF_PROBE_0_DEBUG(hci1394_ohci_phy_info_exit, - HCI1394_TNF_HAL_STACK, ""); - return (DDI_SUCCESS); } @@ -1651,16 +1372,11 @@ hci1394_ohci_current_busgen(hci1394_ohci_handle_t ohci_hdl) ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_current_busgen_enter, - HCI1394_TNF_HAL_STACK, ""); reg = ddi_get32(ohci_hdl->ohci_reg_handle, &ohci_hdl->ohci_regs->self_id_count); generation_count = (reg & OHCI_SLFC_GEN_MASK) >> OHCI_SLFC_GEN_SHIFT; - TNF_PROBE_0_DEBUG(hci1394_ohci_current_busgen_exit, - HCI1394_TNF_HAL_STACK, ""); - return (generation_count); } @@ -1678,8 +1394,6 @@ hci1394_ohci_startup(hci1394_ohci_handle_t ohci_hdl) ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_startup_enter, - HCI1394_TNF_HAL_STACK, ""); /* * Turn on 1394 link. This allows us to receive 1394 traffic off the @@ -1695,11 +1409,6 @@ hci1394_ohci_startup(hci1394_ohci_handle_t ohci_hdl) */ status = hci1394_ohci_bus_reset(ohci_hdl); if (status != DDI_SUCCESS) { - TNF_PROBE_1_DEBUG(hci1394_ohci_startup_exit, - HCI1394_TNF_HAL_ERROR, "", tnf_string, errmsg, - "failed to reset bus"); - TNF_PROBE_0_DEBUG(hci1394_ohci_startup_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -1707,9 +1416,6 @@ hci1394_ohci_startup(hci1394_ohci_handle_t ohci_hdl) hci1394_isr_mask_setup(ohci_hdl->soft_state); hci1394_ohci_intr_master_enable(ohci_hdl); - TNF_PROBE_0_DEBUG(hci1394_ohci_startup_exit, HCI1394_TNF_HAL_STACK, - ""); - return (DDI_SUCCESS); } @@ -1727,8 +1433,6 @@ hci1394_ohci_postwr_addr(hci1394_ohci_handle_t ohci_hdl, uint64_t *addr) ASSERT(ohci_hdl != NULL); ASSERT(addr != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_postwr_addr_enter, - HCI1394_TNF_HAL_STACK, ""); /* read in the errored address */ reg = ddi_get32(ohci_hdl->ohci_reg_handle, @@ -1743,9 +1447,6 @@ hci1394_ohci_postwr_addr(hci1394_ohci_handle_t ohci_hdl, uint64_t *addr) * See 13.2.8.1 in OpenHCI spec v1.0. */ hci1394_ohci_intr_clear(ohci_hdl, OHCI_INTR_POST_WR_ERR); - - TNF_PROBE_0_DEBUG(hci1394_ohci_postwr_addr_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -1761,7 +1462,6 @@ hci1394_ohci_guid(hci1394_ohci_handle_t ohci_hdl) ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_guid_enter, HCI1394_TNF_HAL_STACK, ""); reg = ddi_get32(ohci_hdl->ohci_reg_handle, &ohci_hdl->ohci_regs->guid_hi); @@ -1770,8 +1470,6 @@ hci1394_ohci_guid(hci1394_ohci_handle_t ohci_hdl) &ohci_hdl->ohci_regs->guid_lo); guid = guid | (uint64_t)reg; - TNF_PROBE_0_DEBUG(hci1394_ohci_guid_exit, HCI1394_TNF_HAL_STACK, ""); - return (guid); } @@ -1794,8 +1492,6 @@ hci1394_ohci_csr_read(hci1394_ohci_handle_t ohci_hdl, uint_t offset, ASSERT(ohci_hdl != NULL); ASSERT(data != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_csr_read_enter, HCI1394_TNF_HAL_STACK, - ""); /* * read the CSR register by doing a cswap with the same compare and @@ -1805,16 +1501,9 @@ hci1394_ohci_csr_read(hci1394_ohci_handle_t ohci_hdl, uint_t offset, status = hci1394_ohci_csr_cswap(ohci_hdl, generation, offset, 0, 0, data); if (status != DDI_SUCCESS) { - TNF_PROBE_0(hci1394_ohci_csr_read_csw_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_ohci_csr_read_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } - TNF_PROBE_0_DEBUG(hci1394_ohci_csr_read_exit, HCI1394_TNF_HAL_STACK, - ""); - return (DDI_SUCCESS); } @@ -1837,18 +1526,12 @@ hci1394_ohci_csr_cswap(hci1394_ohci_handle_t ohci_hdl, uint_t generation, ASSERT(ohci_hdl != NULL); ASSERT(old != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_csr_cswap_enter, - HCI1394_TNF_HAL_STACK, ""); /* * Make sure we have not gotten a bus reset since this action was * started. */ if (generation != hci1394_ohci_current_busgen(ohci_hdl)) { - TNF_PROBE_1(hci1394_ohci_invbusgen_fail, HCI1394_TNF_HAL_ERROR, - "", tnf_string, errmsg, "Invalid Bus Generation"); - TNF_PROBE_0_DEBUG(hci1394_ohci_csr_cswap_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -1892,10 +1575,6 @@ hci1394_ohci_csr_cswap(hci1394_ohci_handle_t ohci_hdl, uint_t generation, if (count >= 2) { *old = 0; mutex_exit(&ohci_hdl->ohci_mutex); - TNF_PROBE_0(hci1394_ohci_phy_csr_timeout_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_ohci_csr_cswap_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -1917,18 +1596,10 @@ hci1394_ohci_csr_cswap(hci1394_ohci_handle_t ohci_hdl, uint_t generation, if (generation != hci1394_ohci_current_busgen(ohci_hdl)) { if (*old == compare) { (void) hci1394_ohci_bus_reset(ohci_hdl); - TNF_PROBE_1(hci1394_ohci_invbusgen_fail, - HCI1394_TNF_HAL_ERROR, "", tnf_string, errmsg, - "Invalid Bus Generation"); - TNF_PROBE_0_DEBUG(hci1394_ohci_csr_cswap_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } } - TNF_PROBE_0_DEBUG(hci1394_ohci_csr_cswap_exit, HCI1394_TNF_HAL_STACK, - ""); - return (DDI_SUCCESS); } @@ -1946,34 +1617,21 @@ hci1394_ohci_contender_enable(hci1394_ohci_handle_t ohci_hdl) ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_contender_enable_enter, - HCI1394_TNF_HAL_STACK, ""); /* * Make sure that phy is not a 1394-1995 phy. Those phy's do not have a * contender bit to set. */ if (ohci_hdl->ohci_phy == H1394_PHY_1995) { - TNF_PROBE_0(hci1394_ohci_phy_type_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_ohci_contender_enable_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } /* Set the Contender Bit */ status = hci1394_ohci_phy_set(ohci_hdl, 0x4, OHCI_PHY_CNTDR); if (status != DDI_SUCCESS) { - TNF_PROBE_0(hci1394_ohci_phy_set_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_ohci_contender_enable_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } - TNF_PROBE_0_DEBUG(hci1394_ohci_contender_enable_exit, - HCI1394_TNF_HAL_STACK, ""); - return (DDI_SUCCESS); } @@ -1988,14 +1646,9 @@ int hci1394_ohci_root_holdoff_enable(hci1394_ohci_handle_t ohci_hdl) { ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_root_holdoff_enable_enter, - HCI1394_TNF_HAL_STACK, ""); ohci_hdl->ohci_set_root_holdoff = B_TRUE; - TNF_PROBE_0_DEBUG(hci1394_ohci_root_holdoff_enable_exit, - HCI1394_TNF_HAL_STACK, ""); - return (DDI_SUCCESS); } @@ -2010,15 +1663,10 @@ int hci1394_ohci_gap_count_set(hci1394_ohci_handle_t ohci_hdl, uint_t gap_count) { ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_gap_count_set_enter, - HCI1394_TNF_HAL_STACK, ""); ohci_hdl->ohci_set_gap_count = B_TRUE; ohci_hdl->ohci_gap_count = gap_count & OHCI_PHY_MAX_GAP; - TNF_PROBE_0_DEBUG(hci1394_ohci_gap_count_set_exit, - HCI1394_TNF_HAL_STACK, ""); - return (DDI_SUCCESS); } @@ -2044,18 +1692,12 @@ hci1394_ohci_phy_filter_set(hci1394_ohci_handle_t ohci_hdl, uint64_t mask, ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_phy_filter_set_enter, - HCI1394_TNF_HAL_STACK, ""); /* * Make sure we have not gotten a bus reset since this action was * started. */ if (generation != hci1394_ohci_current_busgen(ohci_hdl)) { - TNF_PROBE_1(hci1394_ohci_invbusgen_fail, HCI1394_TNF_HAL_ERROR, - "", tnf_string, errmsg, "Invalid Bus Generation"); - TNF_PROBE_0_DEBUG(hci1394_ohci_phy_filter_set_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -2075,16 +1717,9 @@ hci1394_ohci_phy_filter_set(hci1394_ohci_handle_t ohci_hdl, uint64_t mask, */ if (generation != hci1394_ohci_current_busgen(ohci_hdl)) { (void) hci1394_ohci_bus_reset(ohci_hdl); - TNF_PROBE_1(hci1394_ohci_filterrace_fail, HCI1394_TNF_HAL_ERROR, - "", tnf_string, errmsg, "Invalid Bus Generation"); - TNF_PROBE_0_DEBUG(hci1394_ohci_phy_filter_set_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_SUCCESS); } - TNF_PROBE_0_DEBUG(hci1394_ohci_phy_filter_set_exit, - HCI1394_TNF_HAL_STACK, ""); - return (DDI_SUCCESS); } @@ -2102,18 +1737,12 @@ hci1394_ohci_phy_filter_clr(hci1394_ohci_handle_t ohci_hdl, ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_phy_filter_clr_enter, - HCI1394_TNF_HAL_STACK, ""); /* * Make sure we have not gotten a bus reset since this action was * started. */ if (generation != hci1394_ohci_current_busgen(ohci_hdl)) { - TNF_PROBE_1(hci1394_ohci_invbusgen_fail, HCI1394_TNF_HAL_ERROR, - "", tnf_string, errmsg, "Invalid Bus Generation"); - TNF_PROBE_0_DEBUG(hci1394_ohci_phy_filter_clr_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -2124,9 +1753,6 @@ hci1394_ohci_phy_filter_clr(hci1394_ohci_handle_t ohci_hdl, ddi_put32(ohci_hdl->ohci_reg_handle, &ohci_hdl->ohci_regs->phys_req_filterlo_clr, data); - TNF_PROBE_0_DEBUG(hci1394_ohci_phy_filter_clr_exit, - HCI1394_TNF_HAL_STACK, ""); - return (DDI_SUCCESS); } @@ -2142,34 +1768,21 @@ hci1394_ohci_bus_reset_short(hci1394_ohci_handle_t ohci_hdl) int status; ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_bus_reset_short_enter, - HCI1394_TNF_HAL_STACK, ""); /* * Make sure that phy is not a 1394-1995 phy. Those phy's do not have a * contender bit to set. */ if (ohci_hdl->ohci_phy == H1394_PHY_1995) { - TNF_PROBE_0(hci1394_ohci_brs_phy_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_ohci_bus_reset_short_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } /* Initiate the short bus reset */ status = hci1394_ohci_phy_set(ohci_hdl, 0x5, OHCI_PHY_ISBR); if (status != DDI_SUCCESS) { - TNF_PROBE_0(hci1394_ohci_phy_set_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_ohci_bus_reset_short_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } - TNF_PROBE_0_DEBUG(hci1394_ohci_bus_reset_short_exit, - HCI1394_TNF_HAL_STACK, ""); - return (status); } @@ -2191,8 +1804,6 @@ hci1394_ohci_cfgrom_update(hci1394_ohci_handle_t ohci_hdl, void *local_buf, ASSERT(ohci_hdl != NULL); ASSERT(local_buf != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_cfgrom_update_enter, - HCI1394_TNF_HAL_STACK, ""); data = (uint32_t *)local_buf; @@ -2218,9 +1829,6 @@ hci1394_ohci_cfgrom_update(hci1394_ohci_handle_t ohci_hdl, void *local_buf, &ohci_hdl->ohci_regs->bus_options, OHCI_SWAP32(data[2])); ddi_put32(ohci_hdl->ohci_reg_handle, &ohci_hdl->ohci_regs->config_rom_hdr, OHCI_SWAP32(data[0])); - - TNF_PROBE_0_DEBUG(hci1394_ohci_cfgrom_update_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -2235,13 +1843,9 @@ hci1394_ohci_nodeid_get(hci1394_ohci_handle_t ohci_hdl, uint_t *nodeid) ASSERT(ohci_hdl != NULL); ASSERT(nodeid != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_nodeid_get_enter, HCI1394_TNF_HAL_STACK, - ""); reg = ddi_get32(ohci_hdl->ohci_reg_handle, &ohci_hdl->ohci_regs->node_id); *nodeid = (reg & 0xFFFF) << 16; - TNF_PROBE_0_DEBUG(hci1394_ohci_nodeid_get_exit, HCI1394_TNF_HAL_STACK, - ""); } @@ -2257,15 +1861,10 @@ hci1394_ohci_nodeid_set(hci1394_ohci_handle_t ohci_hdl, uint_t nodeid) uint32_t reg; ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_nodeid_set_enter, - HCI1394_TNF_HAL_STACK, ""); reg = ((nodeid & 0xFFC00000) >> 16); ddi_put32(ohci_hdl->ohci_reg_handle, &ohci_hdl->ohci_regs->node_id, reg); - - TNF_PROBE_0_DEBUG(hci1394_ohci_nodeid_set_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -2284,8 +1883,6 @@ hci1394_ohci_nodeid_info(hci1394_ohci_handle_t ohci_hdl, uint_t *nodeid, ASSERT(ohci_hdl != NULL); ASSERT(nodeid != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_nodeid_info_enter, - HCI1394_TNF_HAL_STACK, ""); reg = ddi_get32(ohci_hdl->ohci_reg_handle, &ohci_hdl->ohci_regs->node_id); @@ -2295,9 +1892,6 @@ hci1394_ohci_nodeid_info(hci1394_ohci_handle_t ohci_hdl, uint_t *nodeid, } else { *error = B_FALSE; } - - TNF_PROBE_0_DEBUG(hci1394_ohci_nodeid_info_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -2311,12 +1905,8 @@ hci1394_ohci_cycletime_get(hci1394_ohci_handle_t ohci_hdl, { ASSERT(ohci_hdl != NULL); ASSERT(cycle_time != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_cycletime_get_enter, - HCI1394_TNF_HAL_STACK, ""); *cycle_time = ddi_get32(ohci_hdl->ohci_reg_handle, &ohci_hdl->ohci_regs->isoch_cycle_timer); - TNF_PROBE_0_DEBUG(hci1394_ohci_cycletime_get_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -2329,12 +1919,8 @@ hci1394_ohci_cycletime_set(hci1394_ohci_handle_t ohci_hdl, uint32_t cycle_time) { ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_cycletime_set_enter, - HCI1394_TNF_HAL_STACK, ""); ddi_put32(ohci_hdl->ohci_reg_handle, &ohci_hdl->ohci_regs->isoch_cycle_timer, cycle_time); - TNF_PROBE_0_DEBUG(hci1394_ohci_cycletime_set_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -2352,8 +1938,6 @@ hci1394_ohci_bustime_get(hci1394_ohci_handle_t ohci_hdl, uint32_t *bus_time) ASSERT(ohci_hdl != NULL); ASSERT(bus_time != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_bustime_get_enter, - HCI1394_TNF_HAL_STACK, ""); /* * The bus time is composed of a portion of the cycle time and the @@ -2370,9 +1954,6 @@ hci1394_ohci_bustime_get(hci1394_ohci_handle_t ohci_hdl, uint32_t *bus_time) } while (bus_time1 != bus_time2); *bus_time = (bus_time2 << 7) | (cycle_time >> 25); - - TNF_PROBE_0_DEBUG(hci1394_ohci_bustime_get_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -2384,8 +1965,6 @@ void hci1394_ohci_bustime_set(hci1394_ohci_handle_t ohci_hdl, uint32_t bus_time) { ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_bustime_set_enter, - HCI1394_TNF_HAL_STACK, ""); /* * we will start with the cycle 64 seconds interrupt disabled. If this @@ -2398,9 +1977,6 @@ hci1394_ohci_bustime_set(hci1394_ohci_handle_t ohci_hdl, uint32_t bus_time) hci1394_ohci_intr_enable(ohci_hdl, OHCI_INTR_CYC_64_SECS); } ohci_hdl->ohci_bustime_count = (bus_time >> 7); - - TNF_PROBE_0_DEBUG(hci1394_ohci_bustime_set_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -2416,13 +1992,9 @@ hci1394_ohci_atreq_retries_get(hci1394_ohci_handle_t ohci_hdl, ASSERT(ohci_hdl != NULL); ASSERT(atreq_retries != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_atreq_retries_get_enter, - HCI1394_TNF_HAL_STACK, ""); reg = ddi_get32(ohci_hdl->ohci_reg_handle, &ohci_hdl->ohci_regs->at_retries); *atreq_retries = reg & OHCI_RET_MAX_ATREQ_MASK; - TNF_PROBE_0_DEBUG(hci1394_ohci_atreq_retries_get_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -2438,8 +2010,6 @@ hci1394_ohci_atreq_retries_set(hci1394_ohci_handle_t ohci_hdl, ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_atreq_retries_set_enter, - HCI1394_TNF_HAL_STACK, ""); mutex_enter(&ohci_hdl->ohci_mutex); reg = ddi_get32(ohci_hdl->ohci_reg_handle, @@ -2449,9 +2019,6 @@ hci1394_ohci_atreq_retries_set(hci1394_ohci_handle_t ohci_hdl, ddi_put32(ohci_hdl->ohci_reg_handle, &ohci_hdl->ohci_regs->at_retries, reg); mutex_exit(&ohci_hdl->ohci_mutex); - - TNF_PROBE_0_DEBUG(hci1394_ohci_atreq_retries_set_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -2465,8 +2032,6 @@ hci1394_ohci_isr_cycle64seconds(hci1394_ohci_handle_t ohci_hdl) uint32_t cycle_time; ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_isr_cycle64seconds_enter, - HCI1394_TNF_HAL_STACK, ""); hci1394_ohci_intr_clear(ohci_hdl, OHCI_INTR_CYC_64_SECS); cycle_time = ddi_get32(ohci_hdl->ohci_reg_handle, @@ -2480,9 +2045,6 @@ hci1394_ohci_isr_cycle64seconds(hci1394_ohci_handle_t ohci_hdl) if ((cycle_time & 0x80000000) == 0) { ohci_hdl->ohci_bustime_count++; } - - TNF_PROBE_0_DEBUG(hci1394_ohci_isr_cycle64seconds_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -2498,8 +2060,6 @@ hci1394_ohci_isr_phy(hci1394_ohci_handle_t ohci_hdl) ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_isr_phy_enter, - HCI1394_TNF_HAL_STACK, ""); /* clear the interrupt */ hci1394_ohci_intr_clear(ohci_hdl, OHCI_INTR_PHY); @@ -2512,20 +2072,12 @@ hci1394_ohci_isr_phy(hci1394_ohci_handle_t ohci_hdl) * to read. */ if (ohci_hdl->ohci_phy == H1394_PHY_1995) { - TNF_PROBE_0(hci1394_ohci_phy_isr_1995, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_ohci_isr_phy_exit, - HCI1394_TNF_HAL_STACK, ""); return; } /* See why we got this interrupt */ status = hci1394_ohci_phy_read(ohci_hdl, 5, &phy_status); if (status != DDI_SUCCESS) { - TNF_PROBE_0(hci1394_ohci_phy_read_failed, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_ohci_isr_phy_exit, - HCI1394_TNF_HAL_STACK, ""); return; } @@ -2533,28 +2085,20 @@ hci1394_ohci_isr_phy(hci1394_ohci_handle_t ohci_hdl) ohci_hdl->ohci_drvinfo->di_stats.st_phy_loop_err++; cmn_err(CE_NOTE, "hci1394(%d): ERROR - bus loop detected", ohci_hdl->ohci_drvinfo->di_instance); - TNF_PROBE_0(hci1394_ohci_phy_isr_loop, HCI1394_TNF_HAL, ""); } if (phy_status & OHCI_PHY_PWRFAIL_ERR) { ohci_hdl->ohci_drvinfo->di_stats.st_phy_pwrfail_err++; - TNF_PROBE_0(hci1394_ohci_phy_isr_pwr, HCI1394_TNF_HAL, ""); } if (phy_status & OHCI_PHY_TIMEOUT_ERR) { ohci_hdl->ohci_drvinfo->di_stats.st_phy_timeout_err++; - TNF_PROBE_0(hci1394_ohci_phy_isr_tmout, HCI1394_TNF_HAL, ""); } if (phy_status & OHCI_PHY_PORTEVT_ERR) { ohci_hdl->ohci_drvinfo->di_stats.st_phy_portevt_err++; - TNF_PROBE_0(hci1394_ohci_phy_isr_pevt, HCI1394_TNF_HAL, ""); } /* clear any set status bits */ status = hci1394_ohci_phy_write(ohci_hdl, 5, phy_status); if (status != DDI_SUCCESS) { - TNF_PROBE_0(hci1394_ohci_phy_write_failed, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_ohci_isr_phy_exit, - HCI1394_TNF_HAL_STACK, ""); return; } @@ -2564,9 +2108,6 @@ hci1394_ohci_isr_phy(hci1394_ohci_handle_t ohci_hdl) * we see a selfid complete. */ hci1394_ohci_intr_disable(ohci_hdl, OHCI_INTR_PHY); - - TNF_PROBE_0_DEBUG(hci1394_ohci_isr_phy_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -2582,8 +2123,6 @@ hci1394_ohci_root_check(hci1394_ohci_handle_t ohci_hdl) int status; ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_root_check_enter, HCI1394_TNF_HAL_STACK, - ""); reg = ddi_get32(ohci_hdl->ohci_reg_handle, &ohci_hdl->ohci_regs->node_id); if ((reg & OHCI_REG_NODEID_ROOT) && (reg & OHCI_NDID_IDVALID)) { @@ -2591,8 +2130,6 @@ hci1394_ohci_root_check(hci1394_ohci_handle_t ohci_hdl) } else { status = B_FALSE; } - TNF_PROBE_0_DEBUG(hci1394_ohci_root_check_exit, HCI1394_TNF_HAL_STACK, - ""); return (status); } @@ -2611,8 +2148,6 @@ hci1394_ohci_cmc_check(hci1394_ohci_handle_t ohci_hdl) int status; ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_cmc_check_enter, HCI1394_TNF_HAL_STACK, - ""); reg = ddi_get32(ohci_hdl->ohci_reg_handle, &ohci_hdl->ohci_regs->bus_options); if (reg & OHCI_REG_BUSOPTIONS_CMC) { @@ -2620,8 +2155,6 @@ hci1394_ohci_cmc_check(hci1394_ohci_handle_t ohci_hdl) } else { status = B_FALSE; } - TNF_PROBE_0_DEBUG(hci1394_ohci_cmc_check_exit, HCI1394_TNF_HAL_STACK, - ""); return (status); } @@ -2636,8 +2169,6 @@ void hci1394_ohci_cycle_master_enable(hci1394_ohci_handle_t ohci_hdl) { ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_cycle_master_enable_enter, - HCI1394_TNF_HAL_STACK, ""); /* First make sure that cycleTooLong is clear */ ddi_put32(ohci_hdl->ohci_reg_handle, @@ -2646,9 +2177,6 @@ hci1394_ohci_cycle_master_enable(hci1394_ohci_handle_t ohci_hdl) /* Enable Cycle Master */ ddi_put32(ohci_hdl->ohci_reg_handle, &ohci_hdl->ohci_regs->link_ctrl_set, OHCI_LC_CYC_MAST); - - TNF_PROBE_0_DEBUG(hci1394_ohci_cycle_master_enable_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -2661,15 +2189,10 @@ void hci1394_ohci_cycle_master_disable(hci1394_ohci_handle_t ohci_hdl) { ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_cycle_master_disable_enter, - HCI1394_TNF_HAL_STACK, ""); /* disable cycle master */ ddi_put32(ohci_hdl->ohci_reg_handle, &ohci_hdl->ohci_regs->link_ctrl_clr, OHCI_LC_CYC_MAST); - - TNF_PROBE_0_DEBUG(hci1394_ohci_cycle_master_disable_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -2685,36 +2208,22 @@ hci1394_ohci_resume(hci1394_ohci_handle_t ohci_hdl) ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_resume_enter, - HCI1394_TNF_HAL_STACK, ""); /* Re-initialize the OpenHCI chip */ status = hci1394_ohci_chip_init(ohci_hdl); if (status != DDI_SUCCESS) { - TNF_PROBE_0(hci1394_ohci_chip_init_fail, HCI1394_TNF_HAL_ERROR, - ""); - TNF_PROBE_0_DEBUG(hci1394_ohci_resume_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } /* Re-initialize the PHY */ status = hci1394_ohci_phy_resume(ohci_hdl); if (status != DDI_SUCCESS) { - TNF_PROBE_0(hci1394_ohci_phy_resume_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_ohci_resume_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } /* Re-initialize any 1394A features we are using */ status = hci1394_ohci_1394a_resume(ohci_hdl); if (status != DDI_SUCCESS) { - TNF_PROBE_0(hci1394_ohci_1394a_resume_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_ohci_resume_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -2749,8 +2258,6 @@ hci1394_ohci_resume(hci1394_ohci_handle_t ohci_hdl) ddi_put32(ohci_hdl->ohci_reg_handle, &ohci_hdl->ohci_regs->config_rom_hdr, OHCI_SWAP32(quadlet)); - TNF_PROBE_0_DEBUG(hci1394_ohci_resume_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_SUCCESS); } @@ -2767,7 +2274,6 @@ hci1394_ohci_selfid_init(hci1394_ohci_handle_t ohci_hdl) ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_init_selfid_enter, HCI1394_TNF_HAL_STACK, ""); /* * Setup for 2K buffer, aligned on a 2Kbyte address boundary. Make sure @@ -2780,9 +2286,6 @@ hci1394_ohci_selfid_init(hci1394_ohci_handle_t ohci_hdl) status = hci1394_buf_alloc(ohci_hdl->ohci_drvinfo, &parms, &ohci_hdl->ohci_selfid, &ohci_hdl->ohci_selfid_handle); if (status != DDI_SUCCESS) { - TNF_PROBE_0(hci1394_buf_alloc_fail, HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_init_selfid_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -2794,8 +2297,6 @@ hci1394_ohci_selfid_init(hci1394_ohci_handle_t ohci_hdl) /* Enable selfid DMA engine */ hci1394_ohci_selfid_enable(ohci_hdl); - TNF_PROBE_0_DEBUG(hci1394_init_selfid_exit, HCI1394_TNF_HAL_STACK, ""); - return (DDI_SUCCESS); } @@ -2809,8 +2310,6 @@ void hci1394_ohci_selfid_enable(hci1394_ohci_handle_t ohci_hdl) { ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_selfid_enable_enter, - HCI1394_TNF_HAL_STACK, ""); /* * Allow selfid packets to be received. This should be called during @@ -2821,9 +2320,6 @@ hci1394_ohci_selfid_enable(hci1394_ohci_handle_t ohci_hdl) */ ddi_put32(ohci_hdl->ohci_reg_handle, &ohci_hdl->ohci_regs->link_ctrl_set, OHCI_LC_RCV_SELF); - - TNF_PROBE_0_DEBUG(hci1394_ohci_selfid_enable_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -2837,12 +2333,8 @@ hci1394_ohci_selfid_read(hci1394_ohci_handle_t ohci_hdl, uint_t offset, { ASSERT(ohci_hdl != NULL); ASSERT(data != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_selfid_read_enter, - HCI1394_TNF_HAL_STACK, ""); *data = ddi_get32(ohci_hdl->ohci_selfid.bi_handle, &((uint32_t *)ohci_hdl->ohci_selfid.bi_kaddr)[offset]); - TNF_PROBE_0_DEBUG(hci1394_ohci_selfid_read_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -2862,8 +2354,6 @@ hci1394_ohci_selfid_info(hci1394_ohci_handle_t ohci_hdl, uint_t *busgen, ASSERT(busgen != NULL); ASSERT(size != NULL); ASSERT(error != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_selfid_info_enter, - HCI1394_TNF_HAL_STACK, ""); reg = ddi_get32(ohci_hdl->ohci_reg_handle, &ohci_hdl->ohci_regs->self_id_count); @@ -2874,9 +2364,6 @@ hci1394_ohci_selfid_info(hci1394_ohci_handle_t ohci_hdl, uint_t *busgen, } else { *error = B_TRUE; } - - TNF_PROBE_0_DEBUG(hci1394_ohci_selfid_info_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -2892,8 +2379,6 @@ hci1394_ohci_selfid_buf_current(hci1394_ohci_handle_t ohci_hdl) int status; ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_selfid_buf_current_enter, - HCI1394_TNF_HAL_STACK, ""); /* * if the generation stored in the selfid buffer is not equal to the @@ -2909,9 +2394,6 @@ hci1394_ohci_selfid_buf_current(hci1394_ohci_handle_t ohci_hdl) status = B_TRUE; } - TNF_PROBE_0_DEBUG(hci1394_ohci_selfid_buf_current_exit, - HCI1394_TNF_HAL_STACK, ""); - return (status); } @@ -2924,12 +2406,8 @@ void hci1394_ohci_selfid_sync(hci1394_ohci_handle_t ohci_hdl) { ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_selfid_sync_enter, - HCI1394_TNF_HAL_STACK, ""); (void) ddi_dma_sync(ohci_hdl->ohci_selfid.bi_dma_handle, 0, ohci_hdl->ohci_selfid.bi_length, DDI_DMA_SYNC_FORKERNEL); - TNF_PROBE_0_DEBUG(hci1394_ohci_selfid_sync_exit, HCI1394_TNF_HAL_STACK, - ""); } @@ -2945,8 +2423,6 @@ hci1394_ohci_cfgrom_init(hci1394_ohci_handle_t ohci_hdl) ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_cfgrom_init_enter, - HCI1394_TNF_HAL_STACK, ""); /* * Setup for 1K buffer, aligned at 1K address boundary, and allow no @@ -2960,9 +2436,6 @@ hci1394_ohci_cfgrom_init(hci1394_ohci_handle_t ohci_hdl) status = hci1394_buf_alloc(ohci_hdl->ohci_drvinfo, &parms, &ohci_hdl->ohci_cfgrom, &ohci_hdl->ohci_cfgrom_handle); if (status != DDI_SUCCESS) { - TNF_PROBE_0(hci1394_buf_alloc_fail, HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_ohci_cfgrom_init_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -2971,9 +2444,6 @@ hci1394_ohci_cfgrom_init(hci1394_ohci_handle_t ohci_hdl) &ohci_hdl->ohci_regs->config_rom_maplo, (uint32_t)ohci_hdl->ohci_cfgrom.bi_cookie.dmac_address); - TNF_PROBE_0_DEBUG(hci1394_ohci_cfgrom_init_exit, HCI1394_TNF_HAL_STACK, - ""); - return (DDI_SUCCESS); } @@ -2987,8 +2457,7 @@ hci1394_ohci_bus_capabilities(hci1394_ohci_handle_t ohci_hdl, uint32_t *bus_capabilities) { ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_bus_capabilities_enter, - HCI1394_TNF_HAL_STACK, ""); + /* * read in the bus options register. Set bits saying that we are isoch * resource manager capable, Cycle master capable, and Isoch capable @@ -2996,8 +2465,6 @@ hci1394_ohci_bus_capabilities(hci1394_ohci_handle_t ohci_hdl, *bus_capabilities = ddi_get32(ohci_hdl->ohci_reg_handle, &ohci_hdl->ohci_regs->bus_options) | (OHCI_BOPT_IRMC | OHCI_BOPT_CMC | OHCI_BOPT_ISC); - TNF_PROBE_0_DEBUG(hci1394_ohci_bus_capabilities_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -3014,18 +2481,12 @@ hci1394_ohci_at_active(hci1394_ohci_handle_t ohci_hdl) ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_at_active_enter, - HCI1394_TNF_HAL_STACK, ""); /* see if atreq active bit set */ reg = ddi_get32(ohci_hdl->ohci_reg_handle, &ohci_hdl->ohci_regs->at_req.ctxt_ctrl_set); if (reg & OHCI_CC_ACTIVE_MASK) { /* atreq engine is still active */ - TNF_PROBE_0(hci1394_ohci_atreq_active_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_ohci_at_active_exit, - HCI1394_TNF_HAL_STACK, ""); return (B_TRUE); } @@ -3034,16 +2495,9 @@ hci1394_ohci_at_active(hci1394_ohci_handle_t ohci_hdl) &ohci_hdl->ohci_regs->at_resp.ctxt_ctrl_set); if (reg & OHCI_CC_ACTIVE_MASK) { /* atresp engine is still active */ - TNF_PROBE_0(hci1394_ohci_atresp_active_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_ohci_at_active_exit, - HCI1394_TNF_HAL_STACK, ""); return (B_TRUE); } - TNF_PROBE_0_DEBUG(hci1394_ohci_at_active_exit, - HCI1394_TNF_HAL_STACK, ""); - /* both atreq and atresp active bits are cleared */ return (B_FALSE); } @@ -3058,16 +2512,11 @@ void hci1394_ohci_atreq_start(hci1394_ohci_handle_t ohci_hdl, uint32_t cmdptr) { ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_atreq_start_enter, - HCI1394_TNF_HAL_STACK, ""); ddi_put32(ohci_hdl->ohci_reg_handle, &ohci_hdl->ohci_regs->at_req.cmd_ptrlo, cmdptr); ddi_put32(ohci_hdl->ohci_reg_handle, &ohci_hdl->ohci_regs->at_req.ctxt_ctrl_set, OHCI_CC_RUN_MASK); - - TNF_PROBE_0_DEBUG(hci1394_ohci_atreq_start_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -3081,14 +2530,9 @@ void hci1394_ohci_atreq_wake(hci1394_ohci_handle_t ohci_hdl) { ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_atreq_wake_enter, - HCI1394_TNF_HAL_STACK, ""); ddi_put32(ohci_hdl->ohci_reg_handle, &ohci_hdl->ohci_regs->at_req.ctxt_ctrl_set, OHCI_CC_WAKE_MASK); - - TNF_PROBE_0_DEBUG(hci1394_ohci_atreq_wake_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -3101,14 +2545,9 @@ void hci1394_ohci_atreq_stop(hci1394_ohci_handle_t ohci_hdl) { ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_atreq_stop_enter, - HCI1394_TNF_HAL_STACK, ""); ddi_put32(ohci_hdl->ohci_reg_handle, &ohci_hdl->ohci_regs->at_req.ctxt_ctrl_clr, OHCI_CC_RUN_MASK); - - TNF_PROBE_0_DEBUG(hci1394_ohci_atreq_stop_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -3121,16 +2560,11 @@ void hci1394_ohci_arresp_start(hci1394_ohci_handle_t ohci_hdl, uint32_t cmdptr) { ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_arresp_start_enter, - HCI1394_TNF_HAL_STACK, ""); ddi_put32(ohci_hdl->ohci_reg_handle, &ohci_hdl->ohci_regs->ar_resp.cmd_ptrlo, cmdptr); ddi_put32(ohci_hdl->ohci_reg_handle, &ohci_hdl->ohci_regs->ar_resp.ctxt_ctrl_set, OHCI_CC_RUN_MASK); - - TNF_PROBE_0_DEBUG(hci1394_ohci_arresp_start_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -3144,14 +2578,9 @@ void hci1394_ohci_arresp_wake(hci1394_ohci_handle_t ohci_hdl) { ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_arresp_wake_enter, - HCI1394_TNF_HAL_STACK, ""); ddi_put32(ohci_hdl->ohci_reg_handle, &ohci_hdl->ohci_regs->ar_resp.ctxt_ctrl_set, OHCI_CC_WAKE_MASK); - - TNF_PROBE_0_DEBUG(hci1394_ohci_arresp_wake_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -3164,14 +2593,9 @@ void hci1394_ohci_arresp_stop(hci1394_ohci_handle_t ohci_hdl) { ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_arresp_stop_enter, - HCI1394_TNF_HAL_STACK, ""); ddi_put32(ohci_hdl->ohci_reg_handle, &ohci_hdl->ohci_regs->ar_resp.ctxt_ctrl_clr, OHCI_CC_RUN_MASK); - - TNF_PROBE_0_DEBUG(hci1394_ohci_arresp_stop_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -3184,16 +2608,11 @@ void hci1394_ohci_arreq_start(hci1394_ohci_handle_t ohci_hdl, uint32_t cmdptr) { ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_arreq_start_enter, - HCI1394_TNF_HAL_STACK, ""); ddi_put32(ohci_hdl->ohci_reg_handle, &ohci_hdl->ohci_regs->ar_req.cmd_ptrlo, cmdptr); ddi_put32(ohci_hdl->ohci_reg_handle, &ohci_hdl->ohci_regs->ar_req.ctxt_ctrl_set, OHCI_CC_RUN_MASK); - - TNF_PROBE_0_DEBUG(hci1394_ohci_arreq_start_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -3207,14 +2626,9 @@ void hci1394_ohci_arreq_wake(hci1394_ohci_handle_t ohci_hdl) { ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_arreq_wake_enter, - HCI1394_TNF_HAL_STACK, ""); ddi_put32(ohci_hdl->ohci_reg_handle, &ohci_hdl->ohci_regs->ar_req.ctxt_ctrl_set, OHCI_CC_WAKE_MASK); - - TNF_PROBE_0_DEBUG(hci1394_ohci_arreq_wake_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -3227,14 +2641,9 @@ void hci1394_ohci_arreq_stop(hci1394_ohci_handle_t ohci_hdl) { ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_arreq_stop_enter, - HCI1394_TNF_HAL_STACK, ""); ddi_put32(ohci_hdl->ohci_reg_handle, &ohci_hdl->ohci_regs->ar_req.ctxt_ctrl_clr, OHCI_CC_RUN_MASK); - - TNF_PROBE_0_DEBUG(hci1394_ohci_arreq_stop_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -3247,16 +2656,11 @@ void hci1394_ohci_atresp_start(hci1394_ohci_handle_t ohci_hdl, uint32_t cmdptr) { ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_atresp_start_enter, - HCI1394_TNF_HAL_STACK, ""); ddi_put32(ohci_hdl->ohci_reg_handle, &ohci_hdl->ohci_regs->at_resp.cmd_ptrlo, cmdptr); ddi_put32(ohci_hdl->ohci_reg_handle, &ohci_hdl->ohci_regs->at_resp.ctxt_ctrl_set, OHCI_CC_RUN_MASK); - - TNF_PROBE_0_DEBUG(hci1394_ohci_atresp_start_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -3270,14 +2674,9 @@ void hci1394_ohci_atresp_wake(hci1394_ohci_handle_t ohci_hdl) { ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_atresp_wake_enter, - HCI1394_TNF_HAL_STACK, ""); ddi_put32(ohci_hdl->ohci_reg_handle, &ohci_hdl->ohci_regs->at_resp.ctxt_ctrl_set, OHCI_CC_WAKE_MASK); - - TNF_PROBE_0_DEBUG(hci1394_ohci_atresp_wake_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -3290,14 +2689,9 @@ void hci1394_ohci_atresp_stop(hci1394_ohci_handle_t ohci_hdl) { ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_atresp_stop_enter, - HCI1394_TNF_HAL_STACK, ""); ddi_put32(ohci_hdl->ohci_reg_handle, &ohci_hdl->ohci_regs->at_resp.ctxt_ctrl_clr, OHCI_CC_RUN_MASK); - - TNF_PROBE_0_DEBUG(hci1394_ohci_atresp_stop_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -3313,8 +2707,6 @@ hci1394_ohci_1394a_init(hci1394_ohci_handle_t ohci_hdl) int status; ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_1394a_init_enter, HCI1394_TNF_HAL_STACK, - ""); reg = ddi_get32(ohci_hdl->ohci_reg_handle, &ohci_hdl->ohci_regs->hc_ctrl_set); @@ -3324,16 +2716,10 @@ hci1394_ohci_1394a_init(hci1394_ohci_handle_t ohci_hdl) status = hci1394_ohci_phy_set(ohci_hdl, 5, (OHCI_PHY_ENBL_ACCEL | OHCI_PHY_ENBL_MULTI)); if (status != DDI_SUCCESS) { - TNF_PROBE_0(hci1394_ohci_1394a_init_phy_fail, - HCI1394_TNF_HAL_STACK, ""); - TNF_PROBE_0_DEBUG(hci1394_ohci_1394a_init_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } } - TNF_PROBE_0_DEBUG(hci1394_ohci_1394a_init_exit, HCI1394_TNF_HAL_STACK, - ""); return (DDI_SUCCESS); } @@ -3350,8 +2736,6 @@ hci1394_ohci_1394a_resume(hci1394_ohci_handle_t ohci_hdl) int status; ASSERT(ohci_hdl != NULL); - TNF_PROBE_0_DEBUG(hci1394_ohci_1394a_resume_enter, - HCI1394_TNF_HAL_STACK, ""); reg = ddi_get32(ohci_hdl->ohci_reg_handle, &ohci_hdl->ohci_regs->hc_ctrl_set); @@ -3361,15 +2745,9 @@ hci1394_ohci_1394a_resume(hci1394_ohci_handle_t ohci_hdl) status = hci1394_ohci_phy_set(ohci_hdl, 5, (OHCI_PHY_ENBL_ACCEL | OHCI_PHY_ENBL_MULTI)); if (status != DDI_SUCCESS) { - TNF_PROBE_0(hci1394_ohci_1394a_resume_phy_fail, - HCI1394_TNF_HAL_STACK, ""); - TNF_PROBE_0_DEBUG(hci1394_ohci_1394a_resume_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } } - TNF_PROBE_0_DEBUG(hci1394_ohci_1394a_resume_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_SUCCESS); } diff --git a/usr/src/uts/common/io/1394/adapters/hci1394_q.c b/usr/src/uts/common/io/1394/adapters/hci1394_q.c index 7f4bcfb4a6..891a805f65 100644 --- a/usr/src/uts/common/io/1394/adapters/hci1394_q.c +++ b/usr/src/uts/common/io/1394/adapters/hci1394_q.c @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * hci1394_q.c * This code decouples some of the OpenHCI async descriptor logic/structures @@ -101,7 +99,6 @@ hci1394_q_init(hci1394_drvinfo_t *drvinfo, ASSERT(drvinfo != NULL); ASSERT(qinfo != NULL); ASSERT(q_handle != NULL); - TNF_PROBE_0_DEBUG(hci1394_q_init_enter, HCI1394_TNF_HAL_STACK, ""); /* * allocate the memory to track this Q. Initialize the internal Q @@ -130,9 +127,6 @@ hci1394_q_init(hci1394_drvinfo_t *drvinfo, mutex_destroy(&q->q_mutex); kmem_free(q, sizeof (hci1394_q_t)); *q_handle = NULL; - TNF_PROBE_0(hci1394_q_init_bae_fail, HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_q_init_exit, HCI1394_TNF_HAL_STACK, - ""); return (DDI_FAILURE); } @@ -162,9 +156,6 @@ hci1394_q_init(hci1394_drvinfo_t *drvinfo, mutex_destroy(&q->q_mutex); kmem_free(q, sizeof (hci1394_q_t)); *q_handle = NULL; - TNF_PROBE_0(hci1394_q_init_baa_fail, HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_q_init_exit, HCI1394_TNF_HAL_STACK, - ""); return (DDI_FAILURE); } @@ -220,8 +211,6 @@ hci1394_q_init(hci1394_drvinfo_t *drvinfo, *q_handle = q; - TNF_PROBE_0_DEBUG(hci1394_q_init_exit, HCI1394_TNF_HAL_STACK, ""); - return (DDI_SUCCESS); } @@ -238,7 +227,6 @@ hci1394_q_fini(hci1394_q_handle_t *q_handle) hci1394_q_t *q; ASSERT(q_handle != NULL); - TNF_PROBE_0_DEBUG(hci1394_q_fini_enter, HCI1394_TNF_HAL_STACK, ""); q = *q_handle; if (q->q_info.qi_mode == HCI1394_ATQ) { @@ -249,8 +237,6 @@ hci1394_q_fini(hci1394_q_handle_t *q_handle) hci1394_buf_free(&q->q_data.qb_buf_handle); kmem_free(q, sizeof (hci1394_q_t)); *q_handle = NULL; - - TNF_PROBE_0_DEBUG(hci1394_q_fini_exit, HCI1394_TNF_HAL_STACK, ""); } @@ -263,7 +249,6 @@ static void hci1394_q_buf_setup(hci1394_q_buf_t *qbuf) { ASSERT(qbuf != NULL); - TNF_PROBE_0_DEBUG(hci1394_q_buf_setup_enter, HCI1394_TNF_HAL_STACK, ""); /* start with the first cookie */ qbuf->qb_ptrs.qp_current_buf = 0; @@ -285,8 +270,6 @@ hci1394_q_buf_setup(hci1394_q_buf_t *qbuf) * hci1394_q_reserve() before calling hci1394_q_at_write_O*(). */ qbuf->qb_ptrs.qp_resv_size = 0; - - TNF_PROBE_0_DEBUG(hci1394_q_buf_setup_exit, HCI1394_TNF_HAL_STACK, ""); } @@ -303,7 +286,6 @@ hci1394_q_reset(hci1394_q_handle_t q_handle) int index; ASSERT(q_handle != NULL); - TNF_PROBE_0_DEBUG(hci1394_q_reset_enter, HCI1394_TNF_HAL_STACK, ""); mutex_enter(&q_handle->q_mutex); desc = &q_handle->q_desc; @@ -340,7 +322,6 @@ hci1394_q_reset(hci1394_q_handle_t q_handle) } mutex_exit(&q_handle->q_mutex); - TNF_PROBE_0_DEBUG(hci1394_q_reset_exit, HCI1394_TNF_HAL_STACK, ""); } @@ -354,9 +335,7 @@ void hci1394_q_resume(hci1394_q_handle_t q_handle) { ASSERT(q_handle != NULL); - TNF_PROBE_0_DEBUG(hci1394_q_resume_enter, HCI1394_TNF_HAL_STACK, ""); hci1394_q_reset(q_handle); - TNF_PROBE_0_DEBUG(hci1394_q_resume_exit, HCI1394_TNF_HAL_STACK, ""); } @@ -370,11 +349,9 @@ void hci1394_q_stop(hci1394_q_handle_t q_handle) { ASSERT(q_handle != NULL); - TNF_PROBE_0_DEBUG(hci1394_q_stop_enter, HCI1394_TNF_HAL_STACK, ""); mutex_enter(&q_handle->q_mutex); q_handle->q_dma_running = B_FALSE; mutex_exit(&q_handle->q_mutex); - TNF_PROBE_0_DEBUG(hci1394_q_stop_exit, HCI1394_TNF_HAL_STACK, ""); } @@ -400,7 +377,6 @@ hci1394_q_reserve(hci1394_q_buf_t *qbuf, uint_t size, uint32_t *io_addr) ASSERT(qbuf != NULL); - TNF_PROBE_0_DEBUG(hci1394_q_reserve_enter, HCI1394_TNF_HAL_STACK, ""); /* Save backup of pointers in case we have to unreserve */ qbuf->qb_backup_ptrs = qbuf->qb_ptrs; @@ -436,10 +412,6 @@ hci1394_q_reserve(hci1394_q_buf_t *qbuf, uint_t size, uint32_t *io_addr) */ } else { qbuf->qb_ptrs.qp_resv_size = 0; - TNF_PROBE_0(hci1394_q_reserve_ns_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_q_reserve_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -464,10 +436,6 @@ hci1394_q_reserve(hci1394_q_buf_t *qbuf, uint_t size, uint32_t *io_addr) if ((qbuf->qb_ptrs.qp_current + aligned_size) > qbuf->qb_ptrs.qp_free) { qbuf->qb_ptrs.qp_resv_size = 0; - TNF_PROBE_0(hci1394_q_reserve_ns_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_q_reserve_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); /* * The free pointer is in this buffer. We have enough @@ -508,8 +476,6 @@ hci1394_q_reserve(hci1394_q_buf_t *qbuf, uint_t size, uint32_t *io_addr) qbuf->qb_ptrs.qp_offset); } - TNF_PROBE_0_DEBUG(hci1394_q_reserve_exit, HCI1394_TNF_HAL_STACK, ""); - return (DDI_SUCCESS); } @@ -522,12 +488,9 @@ static void hci1394_q_unreserve(hci1394_q_buf_t *qbuf) { ASSERT(qbuf != NULL); - TNF_PROBE_0_DEBUG(hci1394_q_unreserve_enter, HCI1394_TNF_HAL_STACK, ""); /* Go back to pointer setting before the reserve */ qbuf->qb_ptrs = qbuf->qb_backup_ptrs; - - TNF_PROBE_0_DEBUG(hci1394_q_unreserve_exit, HCI1394_TNF_HAL_STACK, ""); } @@ -540,7 +503,6 @@ void hci1394_q_next_buf(hci1394_q_buf_t *qbuf) { ASSERT(qbuf != NULL); - TNF_PROBE_0_DEBUG(hci1394_q_next_buf_enter, HCI1394_TNF_HAL_STACK, ""); /* * go to the next cookie, if we are >= the cookie count, go back to the @@ -560,8 +522,6 @@ hci1394_q_next_buf(hci1394_q_buf_t *qbuf) qbuf->qb_cookie[qbuf->qb_ptrs.qp_current_buf].dmac_size - 1; qbuf->qb_ptrs.qp_current = qbuf->qb_ptrs.qp_begin; qbuf->qb_ptrs.qp_offset = 0; - - TNF_PROBE_0_DEBUG(hci1394_q_next_buf_exit, HCI1394_TNF_HAL_STACK, ""); } @@ -582,7 +542,6 @@ hci1394_q_at(hci1394_q_handle_t q_handle, hci1394_q_cmd_t *cmd, ASSERT(q_handle != NULL); ASSERT(cmd != NULL); ASSERT(hdr != NULL); - TNF_PROBE_0_DEBUG(hci1394_q_at_enter, HCI1394_TNF_HAL_STACK, ""); mutex_enter(&q_handle->q_mutex); @@ -596,9 +555,6 @@ hci1394_q_at(hci1394_q_handle_t q_handle, hci1394_q_cmd_t *cmd, cmd->qc_generation)) { *result = H1394_STATUS_INVALID_BUSGEN; mutex_exit(&q_handle->q_mutex); - TNF_PROBE_0(hci1394_q_at_st_fail, HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_q_at_exit, HCI1394_TNF_HAL_STACK, - ""); return (DDI_FAILURE); } @@ -614,9 +570,6 @@ hci1394_q_at(hci1394_q_handle_t q_handle, hci1394_q_cmd_t *cmd, if (status != DDI_SUCCESS) { *result = H1394_STATUS_NOMORE_SPACE; mutex_exit(&q_handle->q_mutex); - TNF_PROBE_0(hci1394_q_at_qre_fail, HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_q_at_exit, HCI1394_TNF_HAL_STACK, - ""); return (DDI_FAILURE); } @@ -627,7 +580,6 @@ hci1394_q_at(hci1394_q_handle_t q_handle, hci1394_q_cmd_t *cmd, hci1394_tlist_add(q_handle->q_queued_list, &cmd->qc_node); mutex_exit(&q_handle->q_mutex); - TNF_PROBE_0_DEBUG(hci1394_q_at_exit, HCI1394_TNF_HAL_STACK, ""); return (DDI_SUCCESS); } @@ -676,8 +628,6 @@ hci1394_q_at_with_data(hci1394_q_handle_t q_handle, hci1394_q_cmd_t *cmd, ASSERT(cmd != NULL); ASSERT(hdr != NULL); ASSERT(data != NULL); - TNF_PROBE_0_DEBUG(hci1394_q_at_with_data_enter, HCI1394_TNF_HAL_STACK, - ""); mutex_enter(&q_handle->q_mutex); @@ -691,8 +641,6 @@ hci1394_q_at_with_data(hci1394_q_handle_t q_handle, hci1394_q_cmd_t *cmd, cmd->qc_generation)) { *result = H1394_STATUS_INVALID_BUSGEN; mutex_exit(&q_handle->q_mutex); - TNF_PROBE_0_DEBUG(hci1394_q_at_wd_st_fail, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -709,10 +657,6 @@ hci1394_q_at_with_data(hci1394_q_handle_t q_handle, hci1394_q_cmd_t *cmd, if (status != DDI_SUCCESS) { *result = H1394_STATUS_NOMORE_SPACE; mutex_exit(&q_handle->q_mutex); - TNF_PROBE_0(hci1394_q_at_wd_qre_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_q_at_with_data_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -722,10 +666,6 @@ hci1394_q_at_with_data(hci1394_q_handle_t q_handle, hci1394_q_cmd_t *cmd, *result = H1394_STATUS_NOMORE_SPACE; hci1394_q_unreserve(&q_handle->q_desc); mutex_exit(&q_handle->q_mutex); - TNF_PROBE_0(hci1394_q_at_wd_qra_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_q_at_with_data_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -743,8 +683,6 @@ hci1394_q_at_with_data(hci1394_q_handle_t q_handle, hci1394_q_cmd_t *cmd, hci1394_tlist_add(q_handle->q_queued_list, &cmd->qc_node); mutex_exit(&q_handle->q_mutex); - TNF_PROBE_0_DEBUG(hci1394_q_at_with_data_exit, HCI1394_TNF_HAL_STACK, - ""); return (DDI_SUCCESS); } @@ -773,8 +711,6 @@ hci1394_q_at_with_mblk(hci1394_q_handle_t q_handle, hci1394_q_cmd_t *cmd, ASSERT(cmd != NULL); ASSERT(hdr != NULL); ASSERT(mblk != NULL); - TNF_PROBE_0_DEBUG(hci1394_q_at_with_mblk_enter, HCI1394_TNF_HAL_STACK, - ""); mutex_enter(&q_handle->q_mutex); @@ -788,8 +724,6 @@ hci1394_q_at_with_mblk(hci1394_q_handle_t q_handle, hci1394_q_cmd_t *cmd, cmd->qc_generation)) { *result = H1394_STATUS_INVALID_BUSGEN; mutex_exit(&q_handle->q_mutex); - TNF_PROBE_0_DEBUG(hci1394_q_at_wm_st_fail, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -806,10 +740,6 @@ hci1394_q_at_with_mblk(hci1394_q_handle_t q_handle, hci1394_q_cmd_t *cmd, if (status != DDI_SUCCESS) { *result = H1394_STATUS_NOMORE_SPACE; mutex_exit(&q_handle->q_mutex); - TNF_PROBE_0(hci1394_q_at_wm_qre_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_q_at_with_mblk_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -820,10 +750,6 @@ hci1394_q_at_with_mblk(hci1394_q_handle_t q_handle, hci1394_q_cmd_t *cmd, *result = H1394_STATUS_NOMORE_SPACE; hci1394_q_unreserve(&q_handle->q_desc); mutex_exit(&q_handle->q_mutex); - TNF_PROBE_0(hci1394_q_at_wm_qra_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_q_at_with_mblk_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -841,8 +767,6 @@ hci1394_q_at_with_mblk(hci1394_q_handle_t q_handle, hci1394_q_cmd_t *cmd, hci1394_tlist_add(q_handle->q_queued_list, &cmd->qc_node); mutex_exit(&q_handle->q_mutex); - TNF_PROBE_0_DEBUG(hci1394_q_at_with_mblk_exit, HCI1394_TNF_HAL_STACK, - ""); return (DDI_SUCCESS); } @@ -866,7 +790,6 @@ hci1394_q_at_next(hci1394_q_handle_t q_handle, boolean_t flush_q, ASSERT(q_handle != NULL); ASSERT(cmd != NULL); - TNF_PROBE_0_DEBUG(hci1394_q_at_next_enter, HCI1394_TNF_HAL_STACK, ""); mutex_enter(&q_handle->q_mutex); @@ -883,8 +806,6 @@ hci1394_q_at_next(hci1394_q_handle_t q_handle, boolean_t flush_q, /* There are no more commands left on the queued list */ *cmd = NULL; mutex_exit(&q_handle->q_mutex); - TNF_PROBE_0_DEBUG(hci1394_q_at_next_exit, HCI1394_TNF_HAL_STACK, - ""); return; } @@ -907,8 +828,6 @@ hci1394_q_at_next(hci1394_q_handle_t q_handle, boolean_t flush_q, if (cmd_status == 0) { *cmd = NULL; mutex_exit(&q_handle->q_mutex); - TNF_PROBE_0_DEBUG(hci1394_q_at_next_exit, - HCI1394_TNF_HAL_STACK, ""); return; } } @@ -936,7 +855,6 @@ hci1394_q_at_next(hci1394_q_handle_t q_handle, boolean_t flush_q, (*cmd)->qc_status = cmd_status; mutex_exit(&q_handle->q_mutex); - TNF_PROBE_0_DEBUG(hci1394_q_at_next_exit, HCI1394_TNF_HAL_STACK, ""); } @@ -958,8 +876,6 @@ hci1394_q_at_write_OMI(hci1394_q_handle_t q_handle, hci1394_q_buf_t *qbuf, ASSERT(cmd != NULL); ASSERT(hdr != NULL); ASSERT(MUTEX_HELD(&q_handle->q_mutex)); - TNF_PROBE_0_DEBUG(hci1394_q_at_write_OMI_enter, HCI1394_TNF_HAL_STACK, - ""); /* The only valid "header" sizes for an OMI are 8 bytes or 16 bytes */ ASSERT((hdrsize == 8) || (hdrsize == 16)); @@ -993,9 +909,6 @@ hci1394_q_at_write_OMI(hci1394_q_handle_t q_handle, hci1394_q_buf_t *qbuf, q_handle->q_block_cnt += 2; qbuf->qb_ptrs.qp_resv_size -= sizeof (hci1394_desc_imm_t); qbuf->qb_ptrs.qp_current += sizeof (hci1394_desc_imm_t); - - TNF_PROBE_0_DEBUG(hci1394_q_at_write_OMI_exit, HCI1394_TNF_HAL_STACK, - ""); } @@ -1019,8 +932,6 @@ hci1394_q_at_write_OLI(hci1394_q_handle_t q_handle, hci1394_q_buf_t *qbuf, ASSERT(cmd != NULL); ASSERT(hdr != NULL); ASSERT(MUTEX_HELD(&q_handle->q_mutex)); - TNF_PROBE_0_DEBUG(hci1394_q_at_write_OLI_enter, HCI1394_TNF_HAL_STACK, - ""); /* The only valid "header" sizes for an OLI are 8, 12, 16 bytes */ ASSERT((hdrsize == 8) || (hdrsize == 12) || (hdrsize == 16)); @@ -1119,9 +1030,6 @@ hci1394_q_at_write_OLI(hci1394_q_handle_t q_handle, hci1394_q_buf_t *qbuf, } else { q_handle->q_info.qi_wake(q_handle->q_info.qi_callback_arg); } - - TNF_PROBE_0_DEBUG(hci1394_q_at_write_OLI_exit, HCI1394_TNF_HAL_STACK, - ""); } @@ -1145,8 +1053,6 @@ hci1394_q_at_write_OL(hci1394_q_handle_t q_handle, hci1394_q_buf_t *qbuf, ASSERT(qbuf != NULL); ASSERT(cmd != NULL); ASSERT(MUTEX_HELD(&q_handle->q_mutex)); - TNF_PROBE_0_DEBUG(hci1394_q_at_write_OL_enter, HCI1394_TNF_HAL_STACK, - ""); /* make sure enough room for OL */ ASSERT(qbuf->qb_ptrs.qp_resv_size >= sizeof (hci1394_desc_t)); @@ -1219,9 +1125,6 @@ hci1394_q_at_write_OL(hci1394_q_handle_t q_handle, hci1394_q_buf_t *qbuf, } else { q_handle->q_info.qi_wake(q_handle->q_info.qi_callback_arg); } - - TNF_PROBE_0_DEBUG(hci1394_q_at_write_OL_exit, HCI1394_TNF_HAL_STACK, - ""); } @@ -1238,8 +1141,6 @@ hci1394_q_at_rep_put8(hci1394_q_buf_t *qbuf, hci1394_q_cmd_t *cmd, ASSERT(qbuf != NULL); ASSERT(cmd != NULL); ASSERT(data != NULL); - TNF_PROBE_0_DEBUG(hci1394_q_at_rep_put8_enter, HCI1394_TNF_HAL_STACK, - ""); /* Make sure enough room for data */ ASSERT(qbuf->qb_ptrs.qp_resv_size >= datasize); @@ -1262,9 +1163,6 @@ hci1394_q_at_rep_put8(hci1394_q_buf_t *qbuf, hci1394_q_cmd_t *cmd, /* Sync data buffer */ (void) ddi_dma_sync(qbuf->qb_buf.bi_dma_handle, 0, qbuf->qb_buf.bi_length, DDI_DMA_SYNC_FORDEV); - - TNF_PROBE_0_DEBUG(hci1394_q_at_rep_put8_exit, HCI1394_TNF_HAL_STACK, - ""); } @@ -1288,8 +1186,6 @@ hci1394_q_at_copy_from_mblk(hci1394_q_buf_t *qbuf, hci1394_q_cmd_t *cmd, ASSERT(qbuf != NULL); ASSERT(cmd != NULL); ASSERT(mblk != NULL); - TNF_PROBE_0_DEBUG(hci1394_q_at_copy_from_mblk_enter, - HCI1394_TNF_HAL_STACK, ""); /* We return these variables to the Services Layer when we are done */ mblk->next_offset = mblk->curr_offset; @@ -1347,9 +1243,6 @@ hci1394_q_at_copy_from_mblk(hci1394_q_buf_t *qbuf, hci1394_q_cmd_t *cmd, mblk->next_offset = mblk->next_mblk->b_rptr; } } while (bytes_left > 0); - - TNF_PROBE_0_DEBUG(hci1394_q_at_copy_from_mblk_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -1369,7 +1262,6 @@ hci1394_q_ar_next(hci1394_q_handle_t q_handle, uint32_t **q_addr) ASSERT(q_handle != NULL); ASSERT(q_addr != NULL); - TNF_PROBE_0_DEBUG(hci1394_q_ar_next_enter, HCI1394_TNF_HAL_STACK, ""); descb = &q_handle->q_desc; datab = &q_handle->q_data; @@ -1388,8 +1280,6 @@ hci1394_q_ar_next(hci1394_q_handle_t q_handle, uint32_t **q_addr) if (residual_count >= q_handle->q_space_left) { /* No new packets received */ *q_addr = NULL; - TNF_PROBE_0_DEBUG(hci1394_q_ar_next_exit, - HCI1394_TNF_HAL_STACK, ""); return; } @@ -1402,8 +1292,6 @@ hci1394_q_ar_next(hci1394_q_handle_t q_handle, uint32_t **q_addr) * packet. */ *q_addr = (uint32_t *)datab->qb_ptrs.qp_current; - - TNF_PROBE_0_DEBUG(hci1394_q_ar_next_exit, HCI1394_TNF_HAL_STACK, ""); } @@ -1422,7 +1310,6 @@ hci1394_q_ar_free(hci1394_q_handle_t q_handle, uint_t size) ASSERT(q_handle != NULL); - TNF_PROBE_0_DEBUG(hci1394_q_ar_free_enter, HCI1394_TNF_HAL_STACK, ""); descb = &q_handle->q_desc; datab = &q_handle->q_data; @@ -1462,8 +1349,6 @@ hci1394_q_ar_free(hci1394_q_handle_t q_handle, uint_t size) q_handle->q_space_left -= size; datab->qb_ptrs.qp_current += size; } - - TNF_PROBE_0_DEBUG(hci1394_q_ar_free_exit, HCI1394_TNF_HAL_STACK, ""); } @@ -1485,7 +1370,6 @@ hci1394_q_ar_get32(hci1394_q_handle_t q_handle, uint32_t *addr) ASSERT(q_handle != NULL); ASSERT(addr != NULL); - TNF_PROBE_0_DEBUG(hci1394_q_get32_enter, HCI1394_TNF_HAL_STACK, ""); data = &q_handle->q_data; @@ -1503,8 +1387,6 @@ hci1394_q_ar_get32(hci1394_q_handle_t q_handle, uint32_t *addr) data32 = ddi_get32(data->qb_buf.bi_handle, addr); } - TNF_PROBE_0_DEBUG(hci1394_q_get32_exit, HCI1394_TNF_HAL_STACK, ""); - return (data32); } @@ -1531,8 +1413,6 @@ hci1394_q_ar_rep_get8(hci1394_q_handle_t q_handle, uint8_t *dest, ASSERT(q_handle != NULL); ASSERT(dest != NULL); ASSERT(q_addr != NULL); - TNF_PROBE_0_DEBUG(hci1394_q_ar_rep_get8_enter, HCI1394_TNF_HAL_STACK, - ""); data = &q_handle->q_data; @@ -1575,9 +1455,6 @@ hci1394_q_ar_rep_get8(hci1394_q_handle_t q_handle, uint8_t *dest, ddi_rep_get8(data->qb_buf.bi_handle, dest, q_addr, size, DDI_DEV_AUTOINCR); } - - TNF_PROBE_0_DEBUG(hci1394_q_ar_rep_get8_exit, HCI1394_TNF_HAL_STACK, - ""); } @@ -1605,8 +1482,6 @@ hci1394_q_ar_copy_to_mblk(hci1394_q_handle_t q_handle, uint8_t *addr, ASSERT(q_handle != NULL); ASSERT(addr != NULL); ASSERT(mblk != NULL); - TNF_PROBE_0_DEBUG(hci1394_q_copy_to_mblk_enter, - HCI1394_TNF_HAL_STACK, ""); /* We return these variables to the Services Layer when we are done */ mblk->next_offset = mblk->curr_offset; @@ -1675,9 +1550,6 @@ hci1394_q_ar_copy_to_mblk(hci1394_q_handle_t q_handle, uint8_t *addr, mblk->next_offset = mblk->next_mblk->b_wptr; } } while (bytes_left > 0); - - TNF_PROBE_0_DEBUG(hci1394_q_copy_to_mblk_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -1698,8 +1570,6 @@ hci1394_q_ar_write_IM(hci1394_q_handle_t q_handle, hci1394_q_buf_t *qbuf, ASSERT(q_handle != NULL); ASSERT(qbuf != NULL); - TNF_PROBE_0_DEBUG(hci1394_q_ar_write_IM_enter, HCI1394_TNF_HAL_STACK, - ""); /* Make sure enough room for IM */ if ((qbuf->qb_ptrs.qp_current + sizeof (hci1394_desc_t)) > @@ -1760,7 +1630,4 @@ hci1394_q_ar_write_IM(hci1394_q_handle_t q_handle, hci1394_q_buf_t *qbuf, } else { q_handle->q_info.qi_wake(q_handle->q_info.qi_callback_arg); } - - TNF_PROBE_0_DEBUG(hci1394_q_ar_write_IM_exit, HCI1394_TNF_HAL_STACK, - ""); } diff --git a/usr/src/uts/common/io/1394/adapters/hci1394_s1394if.c b/usr/src/uts/common/io/1394/adapters/hci1394_s1394if.c index 80948d8d9e..20a66ea5fb 100644 --- a/usr/src/uts/common/io/1394/adapters/hci1394_s1394if.c +++ b/usr/src/uts/common/io/1394/adapters/hci1394_s1394if.c @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * hci1394_s1394if.c * The interface into the HAL from the services layer. @@ -128,14 +126,9 @@ hci1394_s1394if_shutdown(void *hal_private) ASSERT(hal_private != NULL); - TNF_PROBE_0_DEBUG(hci1394_s1394if_shutdown_enter, - HCI1394_TNF_HAL_STACK, ""); soft_state = (hci1394_state_t *)hal_private; hci1394_shutdown(soft_state->drvinfo.di_dip); - - TNF_PROBE_0_DEBUG(hci1394_s1394if_shutdown_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -153,8 +146,6 @@ hci1394_s1394if_phy(void *hal_private, cmd1394_cmd_t *cmd_id, ASSERT(hal_private != NULL); - TNF_PROBE_0_DEBUG(hci1394_s1394if_phy_enter, - HCI1394_TNF_HAL_STACK, ""); soft_state = (hci1394_state_t *)hal_private; @@ -165,24 +156,15 @@ hci1394_s1394if_phy(void *hal_private, cmd1394_cmd_t *cmd_id, } else { *result = H1394_STATUS_INTERNAL_ERROR; } - TNF_PROBE_0(hci1394_state_fail, HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_s1394if_phy_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } status = hci1394_async_phy(soft_state->async, cmd_id, cmd_private, result); if (status != DDI_SUCCESS) { - TNF_PROBE_0(hci1394_async_phy_fail, HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_s1394if_phy_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } - TNF_PROBE_0_DEBUG(hci1394_s1394if_phy_exit, - HCI1394_TNF_HAL_STACK, ""); - return (DDI_SUCCESS); } @@ -201,8 +183,6 @@ hci1394_s1394if_write(void *hal_private, cmd1394_cmd_t *cmd_id, ASSERT(hal_private != NULL); - TNF_PROBE_0_DEBUG(hci1394_s1394if_write_enter, - HCI1394_TNF_HAL_STACK, ""); soft_state = (hci1394_state_t *)hal_private; @@ -213,25 +193,15 @@ hci1394_s1394if_write(void *hal_private, cmd1394_cmd_t *cmd_id, } else { *result = H1394_STATUS_INTERNAL_ERROR; } - TNF_PROBE_0(hci1394_state_fail, HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_s1394if_write_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } status = hci1394_async_write(soft_state->async, cmd_id, cmd_private, result); if (status != DDI_SUCCESS) { - TNF_PROBE_0(hci1394_async_write_fail, HCI1394_TNF_HAL_ERROR, - ""); - TNF_PROBE_0_DEBUG(hci1394_s1394if_write_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } - TNF_PROBE_0_DEBUG(hci1394_s1394if_write_exit, - HCI1394_TNF_HAL_STACK, ""); - return (DDI_SUCCESS); } @@ -250,8 +220,6 @@ hci1394_s1394if_read(void *hal_private, cmd1394_cmd_t *cmd_id, ASSERT(hal_private != NULL); - TNF_PROBE_0_DEBUG(hci1394_s1394if_read_enter, - HCI1394_TNF_HAL_STACK, ""); soft_state = (hci1394_state_t *)hal_private; @@ -262,24 +230,15 @@ hci1394_s1394if_read(void *hal_private, cmd1394_cmd_t *cmd_id, } else { *result = H1394_STATUS_INTERNAL_ERROR; } - TNF_PROBE_0(hci1394_state_fail, HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_s1394if_read_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } status = hci1394_async_read(soft_state->async, cmd_id, cmd_private, result); if (status != DDI_SUCCESS) { - TNF_PROBE_0(hci1394_async_read_fail, HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_s1394if_read_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } - TNF_PROBE_0_DEBUG(hci1394_s1394if_read_exit, - HCI1394_TNF_HAL_STACK, ""); - return (DDI_SUCCESS); } @@ -300,8 +259,6 @@ hci1394_s1394if_lock(void *hal_private, cmd1394_cmd_t *cmd_id, ASSERT(hal_private != NULL); - TNF_PROBE_0_DEBUG(hci1394_s1394if_lock_enter, - HCI1394_TNF_HAL_STACK, ""); soft_state = (hci1394_state_t *)hal_private; @@ -312,24 +269,15 @@ hci1394_s1394if_lock(void *hal_private, cmd1394_cmd_t *cmd_id, } else { *result = H1394_STATUS_INTERNAL_ERROR; } - TNF_PROBE_0(hci1394_state_fail, HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_s1394if_lock_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } status = hci1394_async_lock(soft_state->async, cmd_id, cmd_private, result); if (status != DDI_SUCCESS) { - TNF_PROBE_0(hci1394_async_lock_fail, HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_s1394if_lock_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } - TNF_PROBE_0_DEBUG(hci1394_s1394if_lock_exit, - HCI1394_TNF_HAL_STACK, ""); - return (DDI_SUCCESS); } @@ -348,8 +296,6 @@ hci1394_s1394if_write_response(void *hal_private, cmd1394_cmd_t *cmd_id, ASSERT(hal_private != NULL); - TNF_PROBE_0_DEBUG(hci1394_s1394if_write_response_enter, - HCI1394_TNF_HAL_STACK, ""); soft_state = (hci1394_state_t *)hal_private; @@ -360,25 +306,15 @@ hci1394_s1394if_write_response(void *hal_private, cmd1394_cmd_t *cmd_id, } else { *result = H1394_STATUS_INTERNAL_ERROR; } - TNF_PROBE_0(hci1394_state_fail, HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_s1394if_write_response_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } status = hci1394_async_write_response(soft_state->async, cmd_id, cmd_private, result); if (status != DDI_SUCCESS) { - TNF_PROBE_0(hci1394_async_write_response_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_s1394if_write_response_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } - TNF_PROBE_0_DEBUG(hci1394_s1394if_write_response_exit, - HCI1394_TNF_HAL_STACK, ""); - return (DDI_SUCCESS); } @@ -397,8 +333,6 @@ hci1394_s1394if_read_response(void *hal_private, cmd1394_cmd_t *cmd_id, ASSERT(hal_private != NULL); - TNF_PROBE_0_DEBUG(hci1394_s1394if_read_response_enter, - HCI1394_TNF_HAL_STACK, ""); soft_state = (hci1394_state_t *)hal_private; @@ -409,25 +343,15 @@ hci1394_s1394if_read_response(void *hal_private, cmd1394_cmd_t *cmd_id, } else { *result = H1394_STATUS_INTERNAL_ERROR; } - TNF_PROBE_0(hci1394_state_fail, HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_s1394if_read_response_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } status = hci1394_async_read_response(soft_state->async, cmd_id, cmd_private, result); if (status != DDI_SUCCESS) { - TNF_PROBE_0(hci1394_async_read_response_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_s1394if_read_response_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } - TNF_PROBE_0_DEBUG(hci1394_s1394if_read_response_exit, - HCI1394_TNF_HAL_STACK, ""); - return (DDI_SUCCESS); } @@ -448,8 +372,6 @@ hci1394_s1394if_lock_response(void *hal_private, cmd1394_cmd_t *cmd_id, ASSERT(hal_private != NULL); - TNF_PROBE_0_DEBUG(hci1394_s1394if_lock_response_enter, - HCI1394_TNF_HAL_STACK, ""); soft_state = (hci1394_state_t *)hal_private; @@ -460,25 +382,15 @@ hci1394_s1394if_lock_response(void *hal_private, cmd1394_cmd_t *cmd_id, } else { *result = H1394_STATUS_INTERNAL_ERROR; } - TNF_PROBE_0(hci1394_state_fail, HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_s1394if_lock_response_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } status = hci1394_async_lock_response(soft_state->async, cmd_id, cmd_private, result); if (status != DDI_SUCCESS) { - TNF_PROBE_0(hci1394_async_lock_response_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_s1394if_lock_response_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } - TNF_PROBE_0_DEBUG(hci1394_s1394if_lock_response_exit, - HCI1394_TNF_HAL_STACK, ""); - return (DDI_SUCCESS); } @@ -499,12 +411,8 @@ hci1394_s1394if_response_complete(void *hal_private, cmd1394_cmd_t *cmd_id, hci1394_state_t *soft_state; ASSERT(hal_private != NULL); - TNF_PROBE_0_DEBUG(hci1394_s1394if_response_complete_enter, - HCI1394_TNF_HAL_STACK, ""); soft_state = (hci1394_state_t *)hal_private; hci1394_async_response_complete(soft_state->async, cmd_id, cmd_private); - TNF_PROBE_0_DEBUG(hci1394_s1394if_response_complete_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -521,31 +429,19 @@ hci1394_s1394if_reset_bus(void *hal_private) ASSERT(hal_private != NULL); - TNF_PROBE_0_DEBUG(hci1394_s1394if_reset_bus_enter, - HCI1394_TNF_HAL_STACK, ""); soft_state = (hci1394_state_t *)hal_private; /* make sure we are not shutdown */ if (hci1394_state(&soft_state->drvinfo) == HCI1394_SHUTDOWN) { - TNF_PROBE_0(hci1394_state_fail, HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_s1394if_reset_bus_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } status = hci1394_ohci_bus_reset(soft_state->ohci); if (status != DDI_SUCCESS) { - TNF_PROBE_0(hci1394_s1394if_reset_bus_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_s1394if_reset_bus_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } - TNF_PROBE_0_DEBUG(hci1394_s1394if_reset_bus_exit, - HCI1394_TNF_HAL_STACK, ""); - return (DDI_SUCCESS); } @@ -564,39 +460,23 @@ hci1394_s1394if_set_contender_bit(void *hal_private) ASSERT(hal_private != NULL); - TNF_PROBE_0_DEBUG(hci1394_s1394if_set_contender_bit_enter, - HCI1394_TNF_HAL_STACK, ""); soft_state = (hci1394_state_t *)hal_private; /* make sure we are not shutdown */ if (hci1394_state(&soft_state->drvinfo) == HCI1394_SHUTDOWN) { - TNF_PROBE_0(hci1394_state_fail, HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_s1394if_set_contender_bit_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } if (soft_state->halinfo.phy == H1394_PHY_1995) { - TNF_PROBE_0(hci1394_s1394if_set_contender_bit_phyver_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_s1394if_set_root_holdoff_bit_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } status = hci1394_ohci_contender_enable(soft_state->ohci); if (status != DDI_SUCCESS) { - TNF_PROBE_0(hci1394_s1394if_set_contender_bit_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_s1394if_set_contender_bit_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } - TNF_PROBE_0_DEBUG(hci1394_s1394if_set_contender_bit_exit, - HCI1394_TNF_HAL_STACK, ""); - return (DDI_SUCCESS); } @@ -621,31 +501,19 @@ hci1394_s1394if_set_root_holdoff_bit(void *hal_private) ASSERT(hal_private != NULL); - TNF_PROBE_0_DEBUG(hci1394_s1394if_set_root_holdoff_bit_enter, - HCI1394_TNF_HAL_STACK, ""); soft_state = (hci1394_state_t *)hal_private; /* make sure we are not shutdown */ if (hci1394_state(&soft_state->drvinfo) == HCI1394_SHUTDOWN) { - TNF_PROBE_0(hci1394_state_fail, HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_s1394if_set_root_holdoff_bit_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } status = hci1394_ohci_root_holdoff_enable(soft_state->ohci); if (status != DDI_SUCCESS) { - TNF_PROBE_0(hci1394_s1394if_set_root_holdoff_bit_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_s1394if_set_root_holdoff_bit_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } - TNF_PROBE_0_DEBUG(hci1394_s1394if_set_root_holdoff_bit_exit, - HCI1394_TNF_HAL_STACK, ""); - return (DDI_SUCCESS); } @@ -670,31 +538,19 @@ hci1394_s1394if_set_gap_count(void *hal_private, uint_t gap_count) ASSERT(hal_private != NULL); - TNF_PROBE_0_DEBUG(hci1394_s1394if_set_gap_count_enter, - HCI1394_TNF_HAL_STACK, ""); soft_state = (hci1394_state_t *)hal_private; /* make sure we are not shutdown */ if (hci1394_state(&soft_state->drvinfo) == HCI1394_SHUTDOWN) { - TNF_PROBE_0(hci1394_state_fail, HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_s1394if_set_gap_count_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } status = hci1394_ohci_gap_count_set(soft_state->ohci, gap_count); if (status != DDI_SUCCESS) { - TNF_PROBE_0(hci1394_s1394if_set_gap_count_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_s1394if_set_gap_count_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } - TNF_PROBE_0_DEBUG(hci1394_s1394if_set_gap_count_exit, - HCI1394_TNF_HAL_STACK, ""); - return (DDI_SUCCESS); } @@ -727,32 +583,20 @@ hci1394_s1394if_phy_filter_set(void *hal_private, ASSERT(hal_private != NULL); - TNF_PROBE_0_DEBUG(hci1394_s1394if_phy_filter_set_enter, - HCI1394_TNF_HAL_STACK, ""); soft_state = (hci1394_state_t *)hal_private; /* make sure we are not shutdown */ if (hci1394_state(&soft_state->drvinfo) == HCI1394_SHUTDOWN) { - TNF_PROBE_0(hci1394_state_fail, HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_s1394if_phy_filter_set_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } status = hci1394_ohci_phy_filter_set(soft_state->ohci, mask, generation); if (status != DDI_SUCCESS) { - TNF_PROBE_0(hci1394_s1394if_phy_filter_set_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_s1394if_phy_filter_set_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } - TNF_PROBE_0_DEBUG(hci1394_s1394if_phy_filter_set_exit, - HCI1394_TNF_HAL_STACK, ""); - return (DDI_SUCCESS); } @@ -788,32 +632,20 @@ hci1394_s1394if_phy_filter_clr(void *hal_private, ASSERT(hal_private != NULL); - TNF_PROBE_0_DEBUG(hci1394_s1394if_phy_filter_clr_enter, - HCI1394_TNF_HAL_STACK, ""); soft_state = (hci1394_state_t *)hal_private; /* make sure we are not shutdown */ if (hci1394_state(&soft_state->drvinfo) == HCI1394_SHUTDOWN) { - TNF_PROBE_0(hci1394_state_fail, HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_s1394if_phy_filter_clr_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } status = hci1394_ohci_phy_filter_clr(soft_state->ohci, mask, generation); if (status != DDI_SUCCESS) { - TNF_PROBE_0(hci1394_s1394if_phy_filter_clr_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_s1394if_phy_filter_clr_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } - TNF_PROBE_0_DEBUG(hci1394_s1394if_phy_filter_clr_exit, - HCI1394_TNF_HAL_STACK, ""); - return (DDI_SUCCESS); } @@ -832,39 +664,23 @@ hci1394_s1394if_short_bus_reset(void *hal_private) ASSERT(hal_private != NULL); - TNF_PROBE_0_DEBUG(hci1394_s1394if_short_bus_reset_enter, - HCI1394_TNF_HAL_STACK, ""); soft_state = (hci1394_state_t *)hal_private; /* make sure we are not shutdown */ if (hci1394_state(&soft_state->drvinfo) == HCI1394_SHUTDOWN) { - TNF_PROBE_0(hci1394_state_fail, HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_s1394if_short_bus_reset_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } if (soft_state->halinfo.phy == H1394_PHY_1995) { - TNF_PROBE_0(hci1394_s1394if_short_bus_reset_phyver_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_s1394if_set_root_holdoff_bit_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } status = hci1394_ohci_bus_reset_short(soft_state->ohci); if (status != DDI_SUCCESS) { - TNF_PROBE_0(hci1394_s1394if_short_bus_reset_fail, - HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_s1394if_short_bus_reset_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } - TNF_PROBE_0_DEBUG(hci1394_s1394if_short_bus_reset_exit, - HCI1394_TNF_HAL_STACK, ""); - return (DDI_SUCCESS); } @@ -885,24 +701,16 @@ hci1394_s1394if_update_config_rom(void *hal_private, ASSERT(hal_private != NULL); ASSERT(local_buf != NULL); - TNF_PROBE_0_DEBUG(hci1394_s1394if_update_config_rom_enter, - HCI1394_TNF_HAL_STACK, ""); soft_state = (hci1394_state_t *)hal_private; /* make sure we are not shutdown */ if (hci1394_state(&soft_state->drvinfo) == HCI1394_SHUTDOWN) { - TNF_PROBE_0(hci1394_state_fail, HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_s1394if_update_config_rom_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } hci1394_ohci_cfgrom_update(soft_state->ohci, local_buf, quadlet_count); - TNF_PROBE_0_DEBUG(hci1394_s1394if_update_config_rom_exit, - HCI1394_TNF_HAL_STACK, ""); - return (DDI_SUCCESS); } @@ -926,16 +734,11 @@ hci1394_s1394if_csr_read(void *hal_private, uint_t offset, uint32_t *data) ASSERT(hal_private != NULL); ASSERT(data != NULL); - TNF_PROBE_0_DEBUG(hci1394_s1394if_csr_read_enter, - HCI1394_TNF_HAL_STACK, ""); soft_state = (hci1394_state_t *)hal_private; /* make sure we are not shutdown */ if (hci1394_state(&soft_state->drvinfo) == HCI1394_SHUTDOWN) { - TNF_PROBE_0(hci1394_state_fail, HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_s1394if_csr_read_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -999,14 +802,6 @@ hci1394_s1394if_csr_read(void *hal_private, uint_t offset, uint32_t *data) break; } - if (status != DDI_SUCCESS) { - TNF_PROBE_1(hci1394_s1394if_csr_read_fail, - HCI1394_TNF_HAL_ERROR, "", tnf_uint, csr_address, offset); - } - - TNF_PROBE_0_DEBUG(hci1394_s1394if_csr_read_exit, - HCI1394_TNF_HAL_STACK, ""); - return (status); } @@ -1029,16 +824,11 @@ hci1394_s1394if_csr_write(void *hal_private, uint_t offset, uint32_t data) ASSERT(hal_private != NULL); - TNF_PROBE_0_DEBUG(hci1394_s1394if_csr_write_enter, - HCI1394_TNF_HAL_STACK, ""); soft_state = (hci1394_state_t *)hal_private; /* make sure we are not shutdown */ if (hci1394_state(&soft_state->drvinfo) == HCI1394_SHUTDOWN) { - TNF_PROBE_0(hci1394_state_fail, HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_s1394if_csr_write_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -1123,14 +913,6 @@ hci1394_s1394if_csr_write(void *hal_private, uint_t offset, uint32_t data) break; } - if (status != DDI_SUCCESS) { - TNF_PROBE_1(hci1394_s1394if_csr_write_fail, - HCI1394_TNF_HAL_ERROR, "", tnf_uint, csr_address, offset); - } - - TNF_PROBE_0_DEBUG(hci1394_s1394if_csr_write_exit, - HCI1394_TNF_HAL_STACK, ""); - return (status); } @@ -1155,16 +937,11 @@ hci1394_s1394if_csr_cswap32(void *hal_private, uint_t generation, uint_t offset, ASSERT(hal_private != NULL); ASSERT(old != NULL); - TNF_PROBE_0_DEBUG(hci1394_s1394if_csr_cswap32_enter, - HCI1394_TNF_HAL_STACK, ""); soft_state = (hci1394_state_t *)hal_private; /* make sure we are not shutdown */ if (hci1394_state(&soft_state->drvinfo) == HCI1394_SHUTDOWN) { - TNF_PROBE_0(hci1394_state_fail, HCI1394_TNF_HAL_ERROR, ""); - TNF_PROBE_0_DEBUG(hci1394_s1394if_csr_cswap32_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -1230,14 +1007,6 @@ hci1394_s1394if_csr_cswap32(void *hal_private, uint_t generation, uint_t offset, break; } - if (status != DDI_SUCCESS) { - TNF_PROBE_1(hci1394_s1394if_csr_read_fail, - HCI1394_TNF_HAL_ERROR, "", tnf_uint, csr_address, offset); - } - - TNF_PROBE_0_DEBUG(hci1394_s1394if_csr_cswap32_exit, - HCI1394_TNF_HAL_STACK, ""); - return (status); } diff --git a/usr/src/uts/common/io/1394/adapters/hci1394_tlabel.c b/usr/src/uts/common/io/1394/adapters/hci1394_tlabel.c index f96a48f66d..c06c7402f2 100644 --- a/usr/src/uts/common/io/1394/adapters/hci1394_tlabel.c +++ b/usr/src/uts/common/io/1394/adapters/hci1394_tlabel.c @@ -24,8 +24,6 @@ * All rights reserved. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * hci1394_tlabel.h * These routines track the tlabel usage for a 1394 adapter. @@ -56,7 +54,6 @@ hci1394_tlabel_init(hci1394_drvinfo_t *drvinfo, hrtime_t reclaim_time_nS, ASSERT(tlabel_handle != NULL); - TNF_PROBE_0_DEBUG(hci1394_tlabel_init_enter, HCI1394_TNF_HAL_STACK, ""); /* alloc space for tlabel data */ tstruct = kmem_alloc(sizeof (hci1394_tlabel_t), KM_SLEEP); @@ -84,8 +81,6 @@ hci1394_tlabel_init(hci1394_drvinfo_t *drvinfo, hrtime_t reclaim_time_nS, * initialization) */ hci1394_tlabel_reset(tstruct); - - TNF_PROBE_0_DEBUG(hci1394_tlabel_init_exit, HCI1394_TNF_HAL_STACK, ""); } @@ -102,7 +97,6 @@ hci1394_tlabel_fini(hci1394_tlabel_handle_t *tlabel_handle) ASSERT(tlabel_handle != NULL); - TNF_PROBE_0_DEBUG(hci1394_tlabel_fini_enter, HCI1394_TNF_HAL_STACK, ""); tstruct = (hci1394_tlabel_t *)*tlabel_handle; @@ -111,8 +105,6 @@ hci1394_tlabel_fini(hci1394_tlabel_handle_t *tlabel_handle) /* set handle to null. This helps catch bugs. */ *tlabel_handle = NULL; - - TNF_PROBE_0_DEBUG(hci1394_tlabel_fini_exit, HCI1394_TNF_HAL_STACK, ""); } @@ -136,8 +128,6 @@ hci1394_tlabel_alloc(hci1394_tlabel_handle_t tlabel_handle, uint_t destination, ASSERT(tlabel_handle != NULL); ASSERT(tlabel_info != NULL); - TNF_PROBE_0_DEBUG(hci1394_tlabel_alloc_enter, - HCI1394_TNF_HAL_STACK, ""); /* copy destination into tlabel_info */ tlabel_info->tbi_destination = destination; @@ -178,10 +168,6 @@ hci1394_tlabel_alloc(hci1394_tlabel_handle_t tlabel_handle, uint_t destination, /* clear the bad list */ bad = 0; - - TNF_PROBE_1(hci1394_tlabel_free_bad, - HCI1394_TNF_HAL_ERROR, "", tnf_uint, nodeid, - node_number); } } @@ -198,11 +184,6 @@ hci1394_tlabel_alloc(hci1394_tlabel_handle_t tlabel_handle, uint_t destination, /* we are using this tlabel */ tlabel_info->tbi_tlabel = last; - TNF_PROBE_2_DEBUG(hci1394_tlabel_alloc, - HCI1394_TNF_HAL_TLABEL, "", tnf_uint, nodeid, - node_number, tnf_uint, alloced_tlabel, - tlabel_info->tbi_tlabel); - /* take it out of the free list */ free = free & ~((uint64_t)1 << last); @@ -224,9 +205,6 @@ hci1394_tlabel_alloc(hci1394_tlabel_handle_t tlabel_handle, uint_t destination, /* unlock the tlabel structure */ mutex_exit(&tlabel_handle->tb_mutex); - - TNF_PROBE_0_DEBUG(hci1394_tlabel_alloc_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_SUCCESS); } @@ -249,10 +227,6 @@ hci1394_tlabel_alloc(hci1394_tlabel_handle_t tlabel_handle, uint_t destination, mutex_exit(&tlabel_handle->tb_mutex); - TNF_PROBE_1(hci1394_tlabel_alloc_empty, HCI1394_TNF_HAL_ERROR, "", - tnf_string, errmsg, "No more tlabels left to alloc"); - TNF_PROBE_0_DEBUG(hci1394_tlabel_alloc_exit, HCI1394_TNF_HAL_STACK, ""); - return (DDI_FAILURE); } @@ -273,16 +247,11 @@ hci1394_tlabel_free(hci1394_tlabel_handle_t tlabel_handle, ASSERT(tlabel_handle != NULL); ASSERT(tlabel_info != NULL); ASSERT(tlabel_info->tbi_tlabel <= TLABEL_MASK); - TNF_PROBE_0_DEBUG(hci1394_tlabel_free_enter, HCI1394_TNF_HAL_STACK, ""); /* figure out what node and tlabel we are using */ node_number = IEEE1394_NODE_NUM(tlabel_info->tbi_destination); tlabel = tlabel_info->tbi_tlabel; - TNF_PROBE_2_DEBUG(hci1394_tlabel_free, - HCI1394_TNF_HAL_TLABEL, "", tnf_uint, nodeid, node_number, - tnf_uint, freed_tlabel, tlabel_info->tbi_tlabel); - mutex_enter(&tlabel_handle->tb_mutex); /* @@ -295,8 +264,6 @@ hci1394_tlabel_free(hci1394_tlabel_handle_t tlabel_handle, tlabel_handle->tb_free[node_number] |= ((uint64_t)1 << tlabel); mutex_exit(&tlabel_handle->tb_mutex); - - TNF_PROBE_0_DEBUG(hci1394_tlabel_free_exit, HCI1394_TNF_HAL_STACK, ""); } @@ -316,8 +283,6 @@ hci1394_tlabel_register(hci1394_tlabel_handle_t tlabel_handle, ASSERT(tlabel_handle != NULL); ASSERT(tlabel_info != NULL); ASSERT(tlabel_info->tbi_tlabel <= TLABEL_MASK); - TNF_PROBE_0_DEBUG(hci1394_tlabel_register_enter, - HCI1394_TNF_HAL_STACK, ""); /* figure out what node and tlabel we are using */ node_number = IEEE1394_NODE_NUM(tlabel_info->tbi_destination); @@ -329,9 +294,6 @@ hci1394_tlabel_register(hci1394_tlabel_handle_t tlabel_handle, tlabel_handle->tb_lookup[node_number][tlabel] = cmd; mutex_exit(&tlabel_handle->tb_mutex); - - TNF_PROBE_0_DEBUG(hci1394_tlabel_register_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -353,8 +315,6 @@ hci1394_tlabel_lookup(hci1394_tlabel_handle_t tlabel_handle, ASSERT(tlabel_info != NULL); ASSERT(cmd != NULL); ASSERT(tlabel_info->tbi_tlabel <= TLABEL_MASK); - TNF_PROBE_0_DEBUG(hci1394_tlabel_lookup_enter, - HCI1394_TNF_HAL_STACK, ""); /* figure out what node and tlabel we are using */ node_number = IEEE1394_NODE_NUM(tlabel_info->tbi_destination); @@ -369,13 +329,6 @@ hci1394_tlabel_lookup(hci1394_tlabel_handle_t tlabel_handle, *cmd = tlabel_handle->tb_lookup[node_number][tlabel]; mutex_exit(&tlabel_handle->tb_mutex); - - TNF_PROBE_2_DEBUG(hci1394_tlabel_lookup, - HCI1394_TNF_HAL_TLABEL, "", tnf_uint, nodeid, node_number, - tnf_uint, lookup_tlabel, tlabel_info->tbi_tlabel); - - TNF_PROBE_0_DEBUG(hci1394_tlabel_lookup_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -396,7 +349,6 @@ hci1394_tlabel_bad(hci1394_tlabel_handle_t tlabel_handle, ASSERT(tlabel_handle != NULL); ASSERT(tlabel_info != NULL); - TNF_PROBE_0_DEBUG(hci1394_tlabel_bad_enter, HCI1394_TNF_HAL_STACK, ""); /* figure out what node and tlabel we are using */ node_number = IEEE1394_NODE_NUM(tlabel_info->tbi_destination); @@ -404,9 +356,6 @@ hci1394_tlabel_bad(hci1394_tlabel_handle_t tlabel_handle, mutex_enter(&tlabel_handle->tb_mutex); - TNF_PROBE_2(hci1394_tlabel_timeout, HCI1394_TNF_HAL_ERROR, "", tnf_uint, - nodeid, node_number, tnf_uint, bad_tlabel, tlabel_info->tbi_tlabel); - /* * Put the tlabel in the bad list and NULL out the (void *) in the * lookup structure. We may see this tlabel shortly if the device is @@ -421,8 +370,6 @@ hci1394_tlabel_bad(hci1394_tlabel_handle_t tlabel_handle, tlabel_handle->tb_lookup[node_number][tlabel] = NULL; mutex_exit(&tlabel_handle->tb_mutex); - - TNF_PROBE_0_DEBUG(hci1394_tlabel_bad_exit, HCI1394_TNF_HAL_STACK, ""); } @@ -440,13 +387,9 @@ hci1394_tlabel_reset(hci1394_tlabel_handle_t tlabel_handle) ASSERT(tlabel_handle != NULL); - TNF_PROBE_0_DEBUG(hci1394_tlabel_reset_enter, - HCI1394_TNF_HAL_STACK, ""); mutex_enter(&tlabel_handle->tb_mutex); - TNF_PROBE_0_DEBUG(hci1394_tlabel_reset, HCI1394_TNF_HAL_TLABEL, ""); - /* Bus reset optimization. handle broadcast writes separately */ if (tlabel_handle->tb_bcast_sent == B_TRUE) { tlabel_handle->tb_free[IEEE1394_BROADCAST_NODEID] = @@ -481,8 +424,6 @@ hci1394_tlabel_reset(hci1394_tlabel_handle_t tlabel_handle) tlabel_handle->tb_bcast_sent = B_FALSE; mutex_exit(&tlabel_handle->tb_mutex); - - TNF_PROBE_0_DEBUG(hci1394_tlabel_reset_exit, HCI1394_TNF_HAL_STACK, ""); } @@ -504,8 +445,6 @@ hci1394_tlabel_set_reclaim_time(hci1394_tlabel_handle_t tlabel_handle, hrtime_t reclaim_time_nS) { ASSERT(tlabel_handle != NULL); - TNF_PROBE_0_DEBUG(hci1394_tlabel_set_reclaim_time_enter, - HCI1394_TNF_HAL_STACK, ""); /* * We do not need to lock the tlabel structure in this because we are @@ -513,7 +452,4 @@ hci1394_tlabel_set_reclaim_time(hci1394_tlabel_handle_t tlabel_handle, * we may need to add calls to lock() and unlock(). */ tlabel_handle->tb_reclaim_time = reclaim_time_nS; - - TNF_PROBE_0_DEBUG(hci1394_tlabel_set_reclaim_time_exit, - HCI1394_TNF_HAL_STACK, ""); } diff --git a/usr/src/uts/common/io/1394/adapters/hci1394_tlist.c b/usr/src/uts/common/io/1394/adapters/hci1394_tlist.c index e32ab382c0..7308e46f45 100644 --- a/usr/src/uts/common/io/1394/adapters/hci1394_tlist.c +++ b/usr/src/uts/common/io/1394/adapters/hci1394_tlist.c @@ -24,8 +24,6 @@ * All rights reserved. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * hci1394_tlist.c * This implements a timed double linked list. @@ -77,7 +75,6 @@ hci1394_tlist_init(hci1394_drvinfo_t *drvinfo, hci1394_tlist_timer_t *timer, ASSERT(tlist_handle != NULL); - TNF_PROBE_0_DEBUG(hci1394_tlist_init_enter, HCI1394_TNF_HAL_STACK, ""); /* try to alloc the space to keep track of the list */ list = kmem_alloc(sizeof (hci1394_tlist_t), KM_SLEEP); @@ -99,8 +96,6 @@ hci1394_tlist_init(hci1394_drvinfo_t *drvinfo, hci1394_tlist_timer_t *timer, } mutex_init(&list->tl_mutex, NULL, MUTEX_DRIVER, drvinfo->di_iblock_cookie); - - TNF_PROBE_0_DEBUG(hci1394_tlist_init_exit, HCI1394_TNF_HAL_STACK, ""); } @@ -117,7 +112,6 @@ hci1394_tlist_fini(hci1394_tlist_handle_t *tlist_handle) ASSERT(tlist_handle != NULL); - TNF_PROBE_0_DEBUG(hci1394_tlist_fini_enter, HCI1394_TNF_HAL_STACK, ""); list = (hci1394_tlist_t *)*tlist_handle; hci1394_tlist_timeout_cancel(list); @@ -126,8 +120,6 @@ hci1394_tlist_fini(hci1394_tlist_handle_t *tlist_handle) /* set handle to null. This helps catch bugs. */ *tlist_handle = NULL; - - TNF_PROBE_0_DEBUG(hci1394_tlist_fini_exit, HCI1394_TNF_HAL_STACK, ""); } @@ -142,7 +134,6 @@ hci1394_tlist_add(hci1394_tlist_handle_t tlist_handle, { ASSERT(tlist_handle != NULL); ASSERT(node != NULL); - TNF_PROBE_0_DEBUG(hci1394_tlist_add_enter, HCI1394_TNF_HAL_STACK, ""); mutex_enter(&tlist_handle->tl_mutex); @@ -185,8 +176,6 @@ hci1394_tlist_add(hci1394_tlist_handle_t tlist_handle, } mutex_exit(&tlist_handle->tl_mutex); - - TNF_PROBE_0_DEBUG(hci1394_tlist_add_exit, HCI1394_TNF_HAL_STACK, ""); } @@ -202,8 +191,6 @@ hci1394_tlist_delete(hci1394_tlist_handle_t tlist_handle, { ASSERT(tlist_handle != NULL); ASSERT(node != NULL); - TNF_PROBE_0_DEBUG(hci1394_tlist_delete_enter, - HCI1394_TNF_HAL_STACK, ""); mutex_enter(&tlist_handle->tl_mutex); @@ -215,15 +202,12 @@ hci1394_tlist_delete(hci1394_tlist_handle_t tlist_handle, */ if (node->tln_on_list == B_FALSE) { mutex_exit(&tlist_handle->tl_mutex); - TNF_PROBE_0_DEBUG(hci1394_tlist_delete_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } hci1394_tlist_remove(tlist_handle, node); mutex_exit(&tlist_handle->tl_mutex); - TNF_PROBE_0_DEBUG(hci1394_tlist_delete_exit, HCI1394_TNF_HAL_STACK, ""); return (DDI_SUCCESS); } @@ -239,7 +223,6 @@ hci1394_tlist_get(hci1394_tlist_handle_t tlist_handle, { ASSERT(tlist_handle != NULL); ASSERT(node != NULL); - TNF_PROBE_0_DEBUG(hci1394_tlist_get_enter, HCI1394_TNF_HAL_STACK, ""); mutex_enter(&tlist_handle->tl_mutex); @@ -252,8 +235,6 @@ hci1394_tlist_get(hci1394_tlist_handle_t tlist_handle, } mutex_exit(&tlist_handle->tl_mutex); - - TNF_PROBE_0_DEBUG(hci1394_tlist_get_exit, HCI1394_TNF_HAL_STACK, ""); } @@ -268,13 +249,10 @@ hci1394_tlist_peek(hci1394_tlist_handle_t tlist_handle, { ASSERT(tlist_handle != NULL); ASSERT(node != NULL); - TNF_PROBE_0_DEBUG(hci1394_tlist_peek_enter, HCI1394_TNF_HAL_STACK, ""); mutex_enter(&tlist_handle->tl_mutex); *node = tlist_handle->tl_head; mutex_exit(&tlist_handle->tl_mutex); - - TNF_PROBE_0_DEBUG(hci1394_tlist_peek_exit, HCI1394_TNF_HAL_STACK, ""); } @@ -290,14 +268,9 @@ hci1394_tlist_timeout_update(hci1394_tlist_handle_t tlist_handle, hrtime_t timeout) { ASSERT(tlist_handle != NULL); - TNF_PROBE_0_DEBUG(hci1394_tlist_update_timeout_enter, - HCI1394_TNF_HAL_STACK, ""); /* set timeout to the new timeout */ tlist_handle->tl_timer_info.tlt_timeout = timeout; - - TNF_PROBE_0_DEBUG(hci1394_tlist_update_timeout_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -311,8 +284,6 @@ void hci1394_tlist_timeout_cancel(hci1394_tlist_handle_t tlist_handle) { ASSERT(tlist_handle != NULL); - TNF_PROBE_0_DEBUG(hci1394_tlist_timeout_cancel_enter, - HCI1394_TNF_HAL_STACK, ""); /* * Cancel the timeout. Do NOT use the tlist mutex here. It could cause a @@ -322,9 +293,6 @@ hci1394_tlist_timeout_cancel(hci1394_tlist_handle_t tlist_handle) (void) untimeout(tlist_handle->tl_timeout_id); tlist_handle->tl_state = HCI1394_TLIST_TIMEOUT_OFF; } - - TNF_PROBE_0_DEBUG(hci1394_tlist_timeout_cancel_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -344,8 +312,6 @@ hci1394_tlist_callback(void *tlist_handle) ASSERT(tlist_handle != NULL); - TNF_PROBE_0_DEBUG(hci1394_tlist_callback_enter, - HCI1394_TNF_HAL_STACK, ""); list = (hci1394_tlist_t *)tlist_handle; @@ -444,9 +410,6 @@ hci1394_tlist_callback(void *tlist_handle) } mutex_exit(&list->tl_mutex); - - TNF_PROBE_0_DEBUG(hci1394_tlist_callback_exit, - HCI1394_TNF_HAL_STACK, ""); } @@ -462,8 +425,6 @@ hci1394_tlist_remove(hci1394_tlist_t *list, hci1394_tlist_node_t *node) ASSERT(node != NULL); ASSERT(node->tln_on_list == B_TRUE); ASSERT(MUTEX_HELD(&list->tl_mutex)); - TNF_PROBE_0_DEBUG(hci1394_tlist_remove_enter, - HCI1394_TNF_HAL_STACK, ""); /* if this is the only node on the list */ if ((list->tl_head == node) && @@ -493,8 +454,6 @@ hci1394_tlist_remove(hci1394_tlist_t *list, hci1394_tlist_node_t *node) /* cleanup the node's link pointers */ node->tln_prev = NULL; node->tln_next = NULL; - - TNF_PROBE_0_DEBUG(hci1394_tlist_remove_exit, HCI1394_TNF_HAL_STACK, ""); } diff --git a/usr/src/uts/common/io/1394/adapters/hci1394_vendor.c b/usr/src/uts/common/io/1394/adapters/hci1394_vendor.c index cba68f5629..106590e0b7 100644 --- a/usr/src/uts/common/io/1394/adapters/hci1394_vendor.c +++ b/usr/src/uts/common/io/1394/adapters/hci1394_vendor.c @@ -24,8 +24,6 @@ * All rights reserved. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * hci1394_vendor.c * These routines provide initialization, cleanup, and general access to @@ -87,7 +85,6 @@ hci1394_vendor_init(hci1394_drvinfo_t *drvinfo, hci1394_ohci_handle_t ohci, ASSERT(drvinfo != NULL); ASSERT(vendor_info != NULL); ASSERT(vendor_handle != NULL); - TNF_PROBE_0_DEBUG(hci1394_vendor_init_enter, HCI1394_TNF_HAL_STACK, ""); /* * alloc the space to keep track of the vendor registers. @@ -114,11 +111,6 @@ hci1394_vendor_init(hci1394_drvinfo_t *drvinfo, hci1394_ohci_handle_t ohci, kmem_free(vendor, sizeof (hci1394_vendor_t)); *vendor_handle = NULL; - TNF_PROBE_1(hci1394_vendor_init_rio_fail, - HCI1394_TNF_HAL_ERROR, "", tnf_string, - errmsg, "hci1394_rio_init() failed"); - TNF_PROBE_0_DEBUG(hci1394_vendor_init_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } break; @@ -140,8 +132,6 @@ hci1394_vendor_init(hci1394_drvinfo_t *drvinfo, hci1394_ohci_handle_t ohci, vendor_info->vendor_reg_count = vendor->ve_reg_count; - TNF_PROBE_0_DEBUG(hci1394_vendor_init_exit, HCI1394_TNF_HAL_STACK, ""); - return (DDI_SUCCESS); } @@ -165,7 +155,6 @@ hci1394_vendor_fini(hci1394_vendor_handle_t *vendor_handle) ASSERT(vendor_handle != NULL); - TNF_PROBE_0_DEBUG(hci1394_vendor_fini_enter, HCI1394_TNF_HAL_STACK, ""); for (index = 0; index < (*vendor_handle)->ve_reg_count; index++) { ddi_regs_map_free(&(*vendor_handle)-> @@ -175,8 +164,6 @@ hci1394_vendor_fini(hci1394_vendor_handle_t *vendor_handle) /* Set the vendor_handle to NULL to help catch bugs */ *vendor_handle = NULL; - - TNF_PROBE_0_DEBUG(hci1394_vendor_fini_exit, HCI1394_TNF_HAL_STACK, ""); } @@ -193,8 +180,6 @@ hci1394_vendor_resume(hci1394_vendor_handle_t vendor_handle) ASSERT(vendor_handle != NULL); - TNF_PROBE_0_DEBUG(hci1394_vendor_resume_enter, HCI1394_TNF_HAL_STACK, - ""); vendor_info = &vendor_handle->ve_info; @@ -209,11 +194,6 @@ hci1394_vendor_resume(hci1394_vendor_handle_t vendor_handle) case VENDOR_DID_RIO_1394: status = hci1394_rio_resume(vendor_handle); if (status != DDI_SUCCESS) { - TNF_PROBE_1(hci1394_vendor_resume_rio_fail, - HCI1394_TNF_HAL_ERROR, "", tnf_string, - errmsg, "hci1394_rio_resume() failed"); - TNF_PROBE_0_DEBUG(hci1394_vendor_resume_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } break; @@ -231,9 +211,6 @@ hci1394_vendor_resume(hci1394_vendor_handle_t vendor_handle) break; } - TNF_PROBE_0_DEBUG(hci1394_vendor_resume_exit, HCI1394_TNF_HAL_STACK, - ""); - return (DDI_SUCCESS); } @@ -255,15 +232,8 @@ hci1394_vendor_reg_write(hci1394_vendor_handle_t vendor_handle, ASSERT(vendor_handle != NULL); - TNF_PROBE_0_DEBUG(hci1394_vendor_reg_write_enter, - HCI1394_TNF_HAL_STACK, ""); if (vendor_handle->ve_reg_count < (reg_set + 1)) { - TNF_PROBE_1(hci1394_vendor_reg_write_fail, - HCI1394_TNF_HAL_ERROR, "", tnf_string, errmsg, - "reg_set not present"); - TNF_PROBE_0_DEBUG(hci1394_vendor_reg_read_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -273,9 +243,6 @@ hci1394_vendor_reg_write(hci1394_vendor_handle_t vendor_handle, ddi_put32(venreg->vr_reg_handle, regaddr, data); - TNF_PROBE_0_DEBUG(hci1394_vendor_reg_write_exit, - HCI1394_TNF_HAL_STACK, ""); - return (DDI_SUCCESS); } @@ -298,15 +265,8 @@ hci1394_vendor_reg_read(hci1394_vendor_handle_t vendor_handle, uint_t reg_set, ASSERT(vendor_handle != NULL); ASSERT(data != NULL); - TNF_PROBE_0_DEBUG(hci1394_vendor_reg_read_enter, - HCI1394_TNF_HAL_STACK, ""); if (vendor_handle->ve_reg_count < (reg_set + 1)) { - TNF_PROBE_1(hci1394_vendor_reg_read_fail, - HCI1394_TNF_HAL_ERROR, "", tnf_string, errmsg, - "reg_set not present"); - TNF_PROBE_0_DEBUG(hci1394_vendor_reg_read_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } @@ -316,9 +276,6 @@ hci1394_vendor_reg_read(hci1394_vendor_handle_t vendor_handle, uint_t reg_set, *data = ddi_get32(venreg->vr_reg_handle, regaddr); - TNF_PROBE_0_DEBUG(hci1394_vendor_reg_read_exit, - HCI1394_TNF_HAL_STACK, ""); - return (DDI_SUCCESS); } @@ -333,7 +290,6 @@ hci1394_rio_init(hci1394_vendor_t *vendor) ASSERT(vendor != NULL); - TNF_PROBE_0_DEBUG(hci1394_rio_init_enter, HCI1394_TNF_HAL_STACK, ""); vendor->ve_reg_count = 1; vendor->ve_reg_array[0] = kmem_alloc(sizeof (hci1394_vendor_reg_t), @@ -347,10 +303,6 @@ hci1394_rio_init(hci1394_vendor_t *vendor) vendor->ve_reg_count = 0; kmem_free(vendor->ve_reg_array[0], sizeof (hci1394_vendor_reg_t)); - TNF_PROBE_0(hci1394_rio_init_rms_fail, HCI1394_TNF_HAL_ERROR, - ""); - TNF_PROBE_0_DEBUG(hci1394_rio_init_exit, HCI1394_TNF_HAL_STACK, - ""); return (DDI_FAILURE); } @@ -363,18 +315,12 @@ hci1394_rio_init(hci1394_vendor_t *vendor) kmem_free(vendor->ve_reg_array[0], sizeof (hci1394_vendor_reg_t)); vendor->ve_reg_array[0] = NULL; - TNF_PROBE_0(hci1394_rio_init_vrw_fail, HCI1394_TNF_HAL_ERROR, - ""); - TNF_PROBE_0_DEBUG(hci1394_rio_init_exit, - HCI1394_TNF_HAL_STACK, ""); return (DDI_FAILURE); } /* Setup GUID on RIO without firmware support */ hci1394_rio_guid_init(vendor); - TNF_PROBE_0_DEBUG(hci1394_rio_init_exit, HCI1394_TNF_HAL_STACK, ""); - return (DDI_SUCCESS); } @@ -390,24 +336,17 @@ hci1394_rio_resume(hci1394_vendor_t *vendor) ASSERT(vendor != NULL); - TNF_PROBE_0_DEBUG(hci1394_rio_init_enter, HCI1394_TNF_HAL_STACK, ""); /* Setup RIO Host Control Register */ status = hci1394_vendor_reg_write(vendor, 0, RIOREG_HOST_CONTROL, RIOREG_HOST_CONTROL_SETTING); if (status != DDI_SUCCESS) { - TNF_PROBE_0(hci1394_rio_resume_vrw_fail, HCI1394_TNF_HAL_ERROR, - ""); - TNF_PROBE_0_DEBUG(hci1394_rio_init_exit, HCI1394_TNF_HAL_STACK, - ""); return (DDI_FAILURE); } /* Setup GUID on RIO PPX */ hci1394_rio_guid_init(vendor); - TNF_PROBE_0_DEBUG(hci1394_rio_init_exit, HCI1394_TNF_HAL_STACK, ""); - return (DDI_SUCCESS); } @@ -425,8 +364,6 @@ hci1394_rio_guid_init(hci1394_vendor_t *vendor) hrtime_t guid_timestamp; ASSERT(vendor != NULL); - TNF_PROBE_0_DEBUG(hci1394_rio_guid_init_enter, HCI1394_TNF_HAL_STACK, - ""); if (hci1394_set_rio_guid != 0) { guid_timestamp = gethrtime(); @@ -445,7 +382,4 @@ hci1394_rio_guid_init(hci1394_vendor_t *vendor) &vendor->ve_ohci->ohci_regs->guid_lo, (uint32_t)(guid_timestamp & 0xFFFFFFFF)); } - - TNF_PROBE_0_DEBUG(hci1394_rio_guid_init_exit, HCI1394_TNF_HAL_STACK, - ""); } diff --git a/usr/src/uts/common/io/1394/h1394.c b/usr/src/uts/common/io/1394/h1394.c index 09b888ee45..fb1d673ede 100644 --- a/usr/src/uts/common/io/1394/h1394.c +++ b/usr/src/uts/common/io/1394/h1394.c @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * h1394.c * 1394 Services Layer HAL Interface @@ -46,8 +44,6 @@ #include <sys/disp.h> #include <sys/time.h> #include <sys/devctl.h> -#include <sys/tnf_probe.h> - #include <sys/1394/t1394.h> #include <sys/1394/s1394.h> #include <sys/1394/h1394.h> @@ -74,12 +70,9 @@ h1394_init(struct modlinkage *modlp) { struct dev_ops *devops; - TNF_PROBE_0_DEBUG(h1394_init_enter, S1394_TNF_SL_STACK, ""); - devops = ((struct modldrv *)(modlp->ml_linkage[0]))->drv_dev_ops; devops->devo_bus_ops = &nx1394_busops; - TNF_PROBE_0_DEBUG(h1394_init_exit, S1394_TNF_SL_STACK, ""); return (0); } @@ -98,12 +91,8 @@ h1394_fini(struct modlinkage *modlp) { struct dev_ops *devops; - TNF_PROBE_0_DEBUG(h1394_fini_enter, S1394_TNF_SL_STACK, ""); - devops = ((struct modldrv *)(modlp->ml_linkage[0]))->drv_dev_ops; devops->devo_bus_ops = NULL; - - TNF_PROBE_0_DEBUG(h1394_fini_enter, S1394_TNF_SL_STACK, ""); } /* @@ -130,8 +119,6 @@ h1394_attach(h1394_halinfo_t *halinfo, ddi_attach_cmd_t cmd, void **sl_private) char buf[32]; uint_t cmd_size; - TNF_PROBE_0_DEBUG(h1394_attach_enter, S1394_TNF_SL_STACK, ""); - ASSERT(sl_private != NULL); /* If this is a DDI_RESUME, return success */ @@ -141,15 +128,8 @@ h1394_attach(h1394_halinfo_t *halinfo, ddi_attach_cmd_t cmd, void **sl_private) if (hal->halinfo.phy == H1394_PHY_1394A) (void) HAL_CALL(hal).set_contender_bit( hal->halinfo.hal_private); - TNF_PROBE_0_DEBUG(h1394_attach_exit, S1394_TNF_SL_STACK, - ""); return (DDI_SUCCESS); } else if (cmd != DDI_ATTACH) { - TNF_PROBE_2(h1394_attach_error, S1394_TNF_SL_ERROR, "", - tnf_string, msg, "Invalid ddi_attach_cmd received", - tnf_uint, attach_cmd, (uint_t)cmd); - TNF_PROBE_0_DEBUG(h1394_attach_exit, S1394_TNF_SL_STACK, - ""); return (DDI_FAILURE); } @@ -216,10 +196,6 @@ h1394_attach(h1394_halinfo_t *halinfo, ddi_attach_cmd_t cmd, void **sl_private) /* Clean up before leaving */ s1394_cleanup_for_detach(hal, H1394_CLEANUP_LEVEL0); - TNF_PROBE_1(h1394_attach_error, S1394_TNF_SL_ERROR, "", - tnf_string, msg, "Unable to define attach events"); - TNF_PROBE_0_DEBUG(h1394_attach_exit, S1394_TNF_SL_STACK, - ""); return (DDI_FAILURE); } @@ -258,10 +234,6 @@ h1394_attach(h1394_halinfo_t *halinfo, ddi_attach_cmd_t cmd, void **sl_private) /* Clean up before leaving */ s1394_cleanup_for_detach(hal, H1394_CLEANUP_LEVEL3); - TNF_PROBE_1(h1394_attach_error, S1394_TNF_SL_ERROR, "", - tnf_string, msg, "Failure in s1394_kstat_init"); - TNF_PROBE_0_DEBUG(h1394_attach_exit, S1394_TNF_SL_STACK, - ""); return (DDI_FAILURE); } hal->hal_kstats->guid = hal->halinfo.guid; @@ -276,9 +248,6 @@ h1394_attach(h1394_halinfo_t *halinfo, ddi_attach_cmd_t cmd, void **sl_private) /* Clean up before leaving */ s1394_cleanup_for_detach(hal, H1394_CLEANUP_LEVEL4); - TNF_PROBE_1(h1394_attach_error, S1394_TNF_SL_ERROR, "", - tnf_string, msg, "Failure in s1394_init_local_config_rom"); - TNF_PROBE_0_DEBUG(h1394_attach_exit, S1394_TNF_SL_STACK, ""); return (DDI_FAILURE); } @@ -288,10 +257,6 @@ h1394_attach(h1394_halinfo_t *halinfo, ddi_attach_cmd_t cmd, void **sl_private) /* Clean up before leaving */ s1394_cleanup_for_detach(hal, H1394_CLEANUP_LEVEL5); - TNF_PROBE_1(h1394_attach_error, S1394_TNF_SL_ERROR, "", - tnf_string, msg, "Invalid 1394 address space"); - TNF_PROBE_0_DEBUG(h1394_attach_exit, S1394_TNF_SL_STACK, - ""); return (DDI_FAILURE); } @@ -301,10 +266,6 @@ h1394_attach(h1394_halinfo_t *halinfo, ddi_attach_cmd_t cmd, void **sl_private) /* Clean up before leaving */ s1394_cleanup_for_detach(hal, H1394_CLEANUP_LEVEL6); - TNF_PROBE_1(h1394_attach_error, S1394_TNF_SL_ERROR, "", - tnf_string, msg, "FCP initialization failure"); - TNF_PROBE_0_DEBUG(h1394_attach_exit, S1394_TNF_SL_STACK, - ""); return (DDI_FAILURE); } @@ -332,7 +293,6 @@ h1394_attach(h1394_halinfo_t *halinfo, ddi_attach_cmd_t cmd, void **sl_private) /* Fill in services layer private info */ *sl_private = (void *)hal; - TNF_PROBE_0_DEBUG(h1394_attach_exit, S1394_TNF_SL_STACK, ""); return (DDI_SUCCESS); } @@ -356,8 +316,6 @@ h1394_detach(void **sl_private, ddi_detach_cmd_t cmd) { s1394_hal_t *hal; - TNF_PROBE_0_DEBUG(h1394_detach_enter, S1394_TNF_SL_STACK, ""); - hal = (s1394_hal_t *)(*sl_private); switch (cmd) { @@ -376,14 +334,9 @@ h1394_detach(void **sl_private, ddi_detach_cmd_t cmd) break; default: - TNF_PROBE_2(h1394_attach_error, S1394_TNF_SL_ERROR, "", - tnf_string, msg, "Invalid ddi_detach_cmd_t type specified", - tnf_uint, detach_cmd, (uint_t)cmd); - TNF_PROBE_0_DEBUG(h1394_detach_exit, S1394_TNF_SL_STACK, ""); return (DDI_FAILURE); } - TNF_PROBE_0_DEBUG(h1394_detach_exit, S1394_TNF_SL_STACK, ""); return (DDI_SUCCESS); } @@ -412,16 +365,9 @@ h1394_alloc_cmd(void *sl_private, uint_t flags, cmd1394_cmd_t **cmdp, s1394_hal_t *hal; s1394_cmd_priv_t *s_priv; - TNF_PROBE_0_DEBUG(h1394_alloc_cmd_enter, S1394_TNF_SL_ARREQ_STACK, - ""); - hal = (s1394_hal_t *)sl_private; if (s1394_alloc_cmd(hal, flags, cmdp) != DDI_SUCCESS) { - TNF_PROBE_1(h1394_alloc_cmd_error, S1394_TNF_SL_ARREQ_ERROR, "", - tnf_string, msg, "Failed to allocate command structure"); - TNF_PROBE_0_DEBUG(h1394_alloc_cmd_exit, - S1394_TNF_SL_ARREQ_STACK, ""); return (DDI_FAILURE); } @@ -430,8 +376,6 @@ h1394_alloc_cmd(void *sl_private, uint_t flags, cmd1394_cmd_t **cmdp, *hal_priv_ptr = &s_priv->hal_cmd_private; - TNF_PROBE_0_DEBUG(h1394_alloc_cmd_exit, S1394_TNF_SL_ARREQ_STACK, - ""); return (DDI_SUCCESS); } @@ -455,9 +399,6 @@ h1394_free_cmd(void *sl_private, cmd1394_cmd_t **cmdp) s1394_hal_t *hal; s1394_cmd_priv_t *s_priv; - TNF_PROBE_0_DEBUG(h1394_free_cmd_enter, S1394_TNF_SL_ARREQ_STACK, - ""); - hal = (s1394_hal_t *)sl_private; /* Get the Services Layer private area */ @@ -465,10 +406,6 @@ h1394_free_cmd(void *sl_private, cmd1394_cmd_t **cmdp) /* Check that command isn't in use */ if (s_priv->cmd_in_use == B_TRUE) { - TNF_PROBE_1(h1394_free_cmd_error, S1394_TNF_SL_ARREQ_ERROR, "", - tnf_string, msg, "Attempted to free an in-use command"); - TNF_PROBE_0_DEBUG(h1394_free_cmd_exit, S1394_TNF_SL_ARREQ_STACK, - ""); ASSERT(s_priv->cmd_in_use == B_FALSE); return (DDI_FAILURE); } @@ -481,8 +418,6 @@ h1394_free_cmd(void *sl_private, cmd1394_cmd_t **cmdp) /* kstats - number of cmds freed */ hal->hal_kstats->cmd_free++; - TNF_PROBE_0_DEBUG(h1394_free_cmd_exit, S1394_TNF_SL_ARREQ_STACK, - ""); return (DDI_SUCCESS); } @@ -511,9 +446,6 @@ h1394_cmd_is_complete(void *sl_private, cmd1394_cmd_t *command_id, s1394_hal_t *hal; dev_info_t *dip; - TNF_PROBE_0_DEBUG(h1394_cmd_is_complete_enter, - S1394_TNF_SL_ATREQ_ATRESP_STACK, ""); - hal = (s1394_hal_t *)sl_private; /* Is it AT_RESP or AT_REQ? */ @@ -536,14 +468,8 @@ h1394_cmd_is_complete(void *sl_private, cmd1394_cmd_t *command_id, /* Disable the HAL */ s1394_hal_shutdown(hal, B_TRUE); - TNF_PROBE_1(h1394_cmd_is_complete_error, - S1394_TNF_SL_ATREQ_ATRESP_ERROR, "", - tnf_string, msg, "Invalid command type specified"); break; } - - TNF_PROBE_0_DEBUG(h1394_cmd_is_complete_exit, - S1394_TNF_SL_ATREQ_ATRESP_STACK, ""); } /* @@ -563,8 +489,6 @@ h1394_bus_reset(void *sl_private, void **selfid_buf_addr) { s1394_hal_t *hal; - TNF_PROBE_0_DEBUG(h1394_bus_reset_enter, S1394_TNF_SL_BR_STACK, ""); - hal = (s1394_hal_t *)sl_private; mutex_enter(&hal->topology_tree_mutex); @@ -581,11 +505,6 @@ h1394_bus_reset(void *sl_private, void **selfid_buf_addr) hal->initiated_bus_reset = B_FALSE; if (hal->num_bus_reset_till_fail > 0) { hal->num_bus_reset_till_fail--; - } else { - TNF_PROBE_2(h1394_bus_reset_error, - S1394_TNF_SL_BR_ERROR, "", - tnf_string, msg, "Bus reset fail (too many resets)", - tnf_uint, br_type, hal->initiated_br_reason); } } else { hal->num_bus_reset_till_fail = NUM_BR_FAIL; @@ -615,8 +534,6 @@ h1394_bus_reset(void *sl_private, void **selfid_buf_addr) mutex_enter(&hal->bus_mgr_node_mutex); hal->bus_mgr_node = -1; mutex_exit(&hal->bus_mgr_node_mutex); - - TNF_PROBE_0_DEBUG(h1394_bus_reset_exit, S1394_TNF_SL_BR_STACK, ""); } /* @@ -655,17 +572,12 @@ h1394_self_ids(void *sl_private, void *selfid_buf_addr, uint32_t selfid_size, * able to build the topology tree. * tree_processed indicates we read the config ROMs as needed. */ - TNF_PROBE_1_DEBUG(h1394_self_ids_enter, S1394_TNF_SL_BR_STACK, "", - tnf_uint, hal_generation, generation_count); - hal = (s1394_hal_t *)sl_private; /* Lock the topology tree */ mutex_enter(&hal->topology_tree_mutex); if (hal->hal_state == S1394_HAL_SHUTDOWN) { mutex_exit(&hal->topology_tree_mutex); - TNF_PROBE_0_DEBUG(h1394_self_ids_exit, S1394_TNF_SL_BR_STACK, - ""); return; } @@ -689,8 +601,6 @@ h1394_self_ids(void *sl_private, void *selfid_buf_addr, uint32_t selfid_size, */ if ((hal->topology_tree_valid == B_TRUE) && (hal->topology_tree_processed == B_TRUE)) { - TNF_PROBE_0_DEBUG(h1394_self_ids_tree_copy, - S1394_TNF_SL_BR_STACK, ""); /* Trees are switched after the copy completes */ s1394_copy_old_tree(hal); tree_copied = B_TRUE; @@ -705,9 +615,6 @@ h1394_self_ids(void *sl_private, void *selfid_buf_addr, uint32_t selfid_size, hal->topology_tree_processed = B_FALSE; hal->cfgroms_being_read = 0; - TNF_PROBE_0_DEBUG(h1394_self_ids_parse_selfid, S1394_TNF_SL_BR_STACK, - ""); - /* * Save the number of nodes prior to parsing the self id buffer. * We need this saved value while initializing the topology tree @@ -720,10 +627,6 @@ h1394_self_ids(void *sl_private, void *selfid_buf_addr, uint32_t selfid_size, DDI_SUCCESS) { /* Unlock the topology tree */ mutex_exit(&hal->topology_tree_mutex); - TNF_PROBE_1(h1394_self_ids_error, S1394_TNF_SL_BR_ERROR, "", - tnf_string, msg, "Unable to parse selfID buffer"); - TNF_PROBE_0_DEBUG(h1394_self_ids_exit, S1394_TNF_SL_BR_STACK, - ""); /* kstats - SelfID buffer error */ hal->hal_kstats->selfid_buffer_error++; @@ -732,8 +635,6 @@ h1394_self_ids(void *sl_private, void *selfid_buf_addr, uint32_t selfid_size, /* Sort the SelfID packets by node number (if it's a 1995 PHY) */ if (hal->halinfo.phy == H1394_PHY_1995) { - TNF_PROBE_0_DEBUG(h1394_self_ids_sort, S1394_TNF_SL_BR_STACK, - ""); s1394_sort_selfids(hal); } @@ -753,8 +654,6 @@ h1394_self_ids(void *sl_private, void *selfid_buf_addr, uint32_t selfid_size, mutex_exit(&hal->cm_timer_mutex); } - TNF_PROBE_0_DEBUG(h1394_self_ids_init_topology, S1394_TNF_SL_BR_STACK, - ""); s1394_init_topology_tree(hal, tree_copied, saved_number_of_nodes); /* Determine the 1394 bus gap count */ @@ -763,10 +662,6 @@ h1394_self_ids(void *sl_private, void *selfid_buf_addr, uint32_t selfid_size, if (hal->gap_count == -1) { /* Unlock the topology tree */ mutex_exit(&hal->topology_tree_mutex); - TNF_PROBE_1(h1394_self_ids_error, S1394_TNF_SL_BR_ERROR, "", - tnf_string, msg, "Invalid gap counts in SelfID pkts"); - TNF_PROBE_0_DEBUG(h1394_self_ids_exit, S1394_TNF_SL_BR_STACK, - ""); /* kstats - SelfID buffer error (invalid gap counts) */ hal->hal_kstats->selfid_buffer_error++; @@ -780,35 +675,19 @@ h1394_self_ids(void *sl_private, void *selfid_buf_addr, uint32_t selfid_size, } } - TNF_PROBE_1_DEBUG(h1394_self_ids_get_gap_count, S1394_TNF_SL_BR_STACK, - "", tnf_uint, gap_count, hal->gap_count); - /* Determine the Isoch Resource Manager */ hal->IRM_node = s1394_get_isoch_rsrc_mgr(hal); - TNF_PROBE_1_DEBUG(h1394_self_ids_IRM_node, S1394_TNF_SL_BR_STACK, "", - tnf_int, IRM_node, hal->IRM_node); - - TNF_PROBE_0_DEBUG(h1394_self_ids_build_topology_tree, - S1394_TNF_SL_BR_STACK, ""); - /* Build the topology tree */ if (s1394_topology_tree_build(hal) != DDI_SUCCESS) { /* Unlock the topology tree */ mutex_exit(&hal->topology_tree_mutex); - TNF_PROBE_1(h1394_self_ids_error, S1394_TNF_SL_BR_ERROR, "", - tnf_string, msg, "Error building the topology tree"); - TNF_PROBE_0_DEBUG(h1394_self_ids_exit, S1394_TNF_SL_BR_STACK, - ""); /* kstats - SelfID buffer error (Invalid topology tree) */ hal->hal_kstats->selfid_buffer_error++; return; /* Error building topology tree from SelfIDs */ } - TNF_PROBE_0_DEBUG(h1394_self_ids_topology_CSRs, S1394_TNF_SL_BR_STACK, - ""); - /* Update the CSR topology_map */ s1394_CSR_topology_map_update(hal); @@ -818,12 +697,6 @@ h1394_self_ids(void *sl_private, void *selfid_buf_addr, uint32_t selfid_size, /* Determine the optimum gap count */ hal->optimum_gap_count = s1394_gap_count_optimize(diameter); - TNF_PROBE_1_DEBUG(h1394_self_ids_diameter_and_gap_count, - S1394_TNF_SL_BR_STACK, "", - tnf_uint, optimum_gap, hal->optimum_gap_count); - - TNF_PROBE_0_DEBUG(h1394_self_ids_speed_map, S1394_TNF_SL_BR_STACK, ""); - /* Fill in the speed map */ s1394_speed_map_fill(hal); @@ -843,8 +716,6 @@ h1394_self_ids(void *sl_private, void *selfid_buf_addr, uint32_t selfid_size, /* If only one bus reset occurred, match the trees */ if (((hal->old_generation_count + 1) % gen_rollover) == generation_count) { - TNF_PROBE_0_DEBUG(h1394_self_ids_tree_matching, - S1394_TNF_SL_BR_STACK, ""); s1394_match_tree_nodes(hal); } } @@ -855,9 +726,6 @@ h1394_self_ids(void *sl_private, void *selfid_buf_addr, uint32_t selfid_size, /* Wake up the bus reset processing thread */ s1394_tickle_bus_reset_thread(hal); - - TNF_PROBE_0_DEBUG(h1394_self_ids_exit, - S1394_TNF_SL_BR_STACK, ""); } /* @@ -890,9 +758,6 @@ h1394_read_request(void *sl_private, cmd1394_cmd_t *req) uchar_t *tmp_ptr; void (*recv_read_req)(cmd1394_cmd_t *); - TNF_PROBE_0_DEBUG(h1394_read_request_enter, S1394_TNF_SL_ARREQ_STACK, - ""); - hal = (s1394_hal_t *)sl_private; /* Get the Services Layer private area */ @@ -921,11 +786,6 @@ h1394_read_request(void *sl_private, cmd1394_cmd_t *req) /* Disable the HAL */ s1394_hal_shutdown(hal, B_TRUE); - TNF_PROBE_1(h1394_read_request_error, - S1394_TNF_SL_ARREQ_ERROR, "", - tnf_string, msg, "Invalid command type specified"); - TNF_PROBE_0_DEBUG(h1394_read_request_exit, - S1394_TNF_SL_ARREQ_STACK, ""); return; } @@ -935,17 +795,12 @@ h1394_read_request(void *sl_private, cmd1394_cmd_t *req) /* Has the 1394 address been allocated? */ addr_blk = s1394_used_tree_search(hal, req->cmd_addr); - TNF_PROBE_0_DEBUG(h1394_read_request_addr_search, - S1394_TNF_SL_ARREQ_STACK, ""); - /* If it wasn't found, it isn't owned... */ if (addr_blk == NULL) { /* Unlock the "used" tree */ mutex_exit(&hal->addr_space_used_mutex); req->cmd_result = IEEE1394_RESP_ADDRESS_ERROR; (void) s1394_send_response(hal, req); - TNF_PROBE_0_DEBUG(h1394_read_request_exit, - S1394_TNF_SL_ARREQ_STACK, ""); return; } @@ -956,8 +811,6 @@ h1394_read_request(void *sl_private, cmd1394_cmd_t *req) mutex_exit(&hal->addr_space_used_mutex); req->cmd_result = IEEE1394_RESP_ADDRESS_ERROR; (void) s1394_send_response(hal, req); - TNF_PROBE_0_DEBUG(h1394_read_request_exit, - S1394_TNF_SL_ARREQ_STACK, ""); return; } @@ -967,8 +820,6 @@ h1394_read_request(void *sl_private, cmd1394_cmd_t *req) mutex_exit(&hal->addr_space_used_mutex); req->cmd_result = IEEE1394_RESP_TYPE_ERROR; (void) s1394_send_response(hal, req); - TNF_PROBE_0_DEBUG(h1394_read_request_exit, - S1394_TNF_SL_ARREQ_STACK, ""); return; } @@ -980,8 +831,6 @@ h1394_read_request(void *sl_private, cmd1394_cmd_t *req) mutex_exit(&hal->addr_space_used_mutex); req->cmd_result = IEEE1394_RESP_TYPE_ERROR; (void) s1394_send_response(hal, req); - TNF_PROBE_0_DEBUG(h1394_read_request_exit, - S1394_TNF_SL_ARREQ_STACK, ""); return; } @@ -1018,11 +867,6 @@ h1394_read_request(void *sl_private, cmd1394_cmd_t *req) /* Disable the HAL */ s1394_hal_shutdown(hal, B_TRUE); - TNF_PROBE_1(h1394_read_request_error, - S1394_TNF_SL_ARREQ_ERROR, "", tnf_string, - msg, "Error - mblk too small for request"); - TNF_PROBE_0_DEBUG(h1394_read_request_exit, - S1394_TNF_SL_ARREQ_STACK, ""); return; } break; @@ -1040,11 +884,6 @@ h1394_read_request(void *sl_private, cmd1394_cmd_t *req) /* Disable the HAL */ s1394_hal_shutdown(hal, B_TRUE); - TNF_PROBE_1(h1394_read_request_error, - S1394_TNF_SL_ARREQ_ERROR, "", tnf_string, msg, - "Invalid command type specified"); - TNF_PROBE_0_DEBUG(h1394_read_request_exit, - S1394_TNF_SL_ARREQ_STACK, ""); return; } } @@ -1063,19 +902,12 @@ h1394_read_request(void *sl_private, cmd1394_cmd_t *req) * HAL. */ if (recv_read_req != NULL) { - TNF_PROBE_0_DEBUG(h1394_read_request_do_callback, - S1394_TNF_SL_ARREQ_STACK, ""); recv_read_req(req); } else { req->cmd_result = IEEE1394_RESP_COMPLETE; (void) s1394_send_response(hal, req); - TNF_PROBE_0_DEBUG(h1394_read_request_exit, - S1394_TNF_SL_ARREQ_STACK, ""); return; } - - TNF_PROBE_0_DEBUG(h1394_read_request_exit, S1394_TNF_SL_ARREQ_STACK, - ""); } /* @@ -1111,9 +943,6 @@ h1394_write_request(void *sl_private, cmd1394_cmd_t *req) boolean_t write_error = B_FALSE; void (*recv_write_req)(cmd1394_cmd_t *); - TNF_PROBE_0_DEBUG(h1394_write_request_enter, S1394_TNF_SL_ARREQ_STACK, - ""); - hal = (s1394_hal_t *)sl_private; /* Get the Services Layer private area */ @@ -1143,11 +972,6 @@ h1394_write_request(void *sl_private, cmd1394_cmd_t *req) /* Disable the HAL */ s1394_hal_shutdown(hal, B_TRUE); - TNF_PROBE_1(h1394_write_request_error, - S1394_TNF_SL_ARREQ_ERROR, "", tnf_string, msg, - "Invalid command type specified"); - TNF_PROBE_0_DEBUG(h1394_write_request_exit, - S1394_TNF_SL_ARREQ_STACK, ""); return; } @@ -1157,9 +981,6 @@ h1394_write_request(void *sl_private, cmd1394_cmd_t *req) /* Has the 1394 address been allocated? */ addr_blk = s1394_used_tree_search(hal, req->cmd_addr); - TNF_PROBE_0_DEBUG(h1394_write_request_addr_search, - S1394_TNF_SL_ARREQ_STACK, ""); - /* Is this a posted write request? */ posted_write = s1394_is_posted_write(hal, req->cmd_addr); @@ -1207,13 +1028,9 @@ write_error_check: /* Free the command - Pass it back to the HAL */ HAL_CALL(hal).response_complete( hal->halinfo.hal_private, req, h_priv); - TNF_PROBE_0_DEBUG(h1394_write_request_exit, - S1394_TNF_SL_ARREQ_STACK, ""); return; } else { (void) s1394_send_response(hal, req); - TNF_PROBE_0_DEBUG(h1394_write_request_exit, - S1394_TNF_SL_ARREQ_STACK, ""); return; } } @@ -1248,11 +1065,6 @@ write_error_check: /* Disable the HAL */ s1394_hal_shutdown(hal, B_TRUE); - TNF_PROBE_1(h1394_write_request_error, - S1394_TNF_SL_ARREQ_ERROR, "", tnf_string, - msg, "Error - mblk too small for request"); - TNF_PROBE_0_DEBUG(h1394_write_request_exit, - S1394_TNF_SL_ARREQ_STACK, ""); return; } break; @@ -1270,11 +1082,6 @@ write_error_check: /* Disable the HAL */ s1394_hal_shutdown(hal, B_TRUE); - TNF_PROBE_1(h1394_write_request_error, - S1394_TNF_SL_ARREQ_ERROR, "", tnf_string, msg, - "Invalid command type specified"); - TNF_PROBE_0_DEBUG(h1394_write_request_exit, - S1394_TNF_SL_ARREQ_STACK, ""); return; } } @@ -1296,19 +1103,12 @@ write_error_check: * HAL. */ if (recv_write_req != NULL) { - TNF_PROBE_0_DEBUG(h1394_write_request_do_callback, - S1394_TNF_SL_ARREQ_STACK, ""); recv_write_req(req); } else { req->cmd_result = IEEE1394_RESP_COMPLETE; (void) s1394_send_response(hal, req); - TNF_PROBE_0_DEBUG(h1394_write_request_exit, - S1394_TNF_SL_ARREQ_STACK, ""); return; } - - TNF_PROBE_0_DEBUG(h1394_write_request_exit, - S1394_TNF_SL_ARREQ_STACK, ""); } /* @@ -1338,9 +1138,6 @@ h1394_lock_request(void *sl_private, cmd1394_cmd_t *req) cmd1394_lock_type_t lock_type; void (*recv_lock_req)(cmd1394_cmd_t *); - TNF_PROBE_0_DEBUG(h1394_lock_request_enter, - S1394_TNF_SL_ARREQ_STACK, ""); - hal = (s1394_hal_t *)sl_private; /* Get the Services Layer private area */ @@ -1360,8 +1157,6 @@ h1394_lock_request(void *sl_private, cmd1394_cmd_t *req) mutex_exit(&hal->addr_space_used_mutex); req->cmd_result = IEEE1394_RESP_ADDRESS_ERROR; (void) s1394_send_response(hal, req); - TNF_PROBE_0_DEBUG(h1394_lock_request_exit, - S1394_TNF_SL_ARREQ_STACK, ""); return; } @@ -1392,11 +1187,6 @@ h1394_lock_request(void *sl_private, cmd1394_cmd_t *req) /* Disable the HAL */ s1394_hal_shutdown(hal, B_TRUE); - TNF_PROBE_1(h1394_lock_request_error, - S1394_TNF_SL_ARREQ_ERROR, "", tnf_string, msg, - "Invalid command type specified"); - TNF_PROBE_0_DEBUG(h1394_lock_request_exit, - S1394_TNF_SL_ARREQ_STACK, ""); return; } @@ -1405,8 +1195,6 @@ h1394_lock_request(void *sl_private, cmd1394_cmd_t *req) mutex_exit(&hal->addr_space_used_mutex); req->cmd_result = IEEE1394_RESP_ADDRESS_ERROR; (void) s1394_send_response(hal, req); - TNF_PROBE_0_DEBUG(h1394_lock_request_exit, - S1394_TNF_SL_ARREQ_STACK, ""); return; } @@ -1416,8 +1204,6 @@ h1394_lock_request(void *sl_private, cmd1394_cmd_t *req) mutex_exit(&hal->addr_space_used_mutex); req->cmd_result = IEEE1394_RESP_TYPE_ERROR; (void) s1394_send_response(hal, req); - TNF_PROBE_0_DEBUG(h1394_lock_request_exit, - S1394_TNF_SL_ARREQ_STACK, ""); return; } @@ -1517,11 +1303,6 @@ h1394_lock_request(void *sl_private, cmd1394_cmd_t *req) mutex_exit(&hal->addr_space_used_mutex); req->cmd_result = IEEE1394_RESP_TYPE_ERROR; (void) s1394_send_response(hal, req); - TNF_PROBE_1(h1394_lock_request_error, - S1394_TNF_SL_ARREQ_ERROR, "", tnf_string, - msg, "Invalid lock_type"); - TNF_PROBE_0_DEBUG(h1394_lock_request_exit, - S1394_TNF_SL_ARREQ_STACK, ""); return; } } else { @@ -1616,11 +1397,6 @@ h1394_lock_request(void *sl_private, cmd1394_cmd_t *req) mutex_exit(&hal->addr_space_used_mutex); req->cmd_result = IEEE1394_RESP_TYPE_ERROR; (void) s1394_send_response(hal, req); - TNF_PROBE_1(h1394_lock_request_error, - S1394_TNF_SL_ARREQ_ERROR, "", tnf_string, - msg, "Invalid lock_type"); - TNF_PROBE_0_DEBUG(h1394_lock_request_exit, - S1394_TNF_SL_ARREQ_STACK, ""); return; } } @@ -1640,19 +1416,12 @@ h1394_lock_request(void *sl_private, cmd1394_cmd_t *req) * HAL. */ if (recv_lock_req != NULL) { - TNF_PROBE_0_DEBUG(h1394_lock_request_do_callback, - S1394_TNF_SL_ARREQ_STACK, ""); recv_lock_req(req); } else { req->cmd_result = IEEE1394_RESP_COMPLETE; (void) s1394_send_response(hal, req); - TNF_PROBE_0_DEBUG(h1394_lock_request_exit, - S1394_TNF_SL_ARREQ_STACK, ""); return; } - - TNF_PROBE_0_DEBUG(h1394_lock_request_exit, - S1394_TNF_SL_ARREQ_STACK, ""); } /* @@ -1676,16 +1445,12 @@ h1394_ioctl(void *sl_private, int cmd, intptr_t arg, int mode, cred_t *cred_p, { int status; - TNF_PROBE_0_DEBUG(h1394_ioctl_enter, S1394_TNF_SL_IOCTL_STACK, ""); - if ((cmd & DEVCTL_IOC) != DEVCTL_IOC) return (EINVAL); status = s1394_ioctl((s1394_hal_t *)sl_private, cmd, arg, mode, cred_p, rval_p); - TNF_PROBE_1_DEBUG(h1394_ioctl_exit, S1394_TNF_SL_IOCTL_STACK, "", - tnf_int, status, status); return (status); } @@ -1711,13 +1476,7 @@ void h1394_phy_packet(void *sl_private, uint32_t *packet_data, uint_t quadlet_count, uint_t timestamp) { - TNF_PROBE_0_DEBUG(h1394_phy_packet_enter, S1394_TNF_SL_STACK, ""); - /* This interface is not yet implemented */ - TNF_PROBE_1_DEBUG(h1394_phy_packet, S1394_TNF_SL_STACK, "", - tnf_string, msg, "h1394_phy_packet: Received"); - - TNF_PROBE_0_DEBUG(h1394_phy_packet_exit, S1394_TNF_SL_STACK, ""); } /* @@ -1739,14 +1498,10 @@ h1394_error_detected(void *sl_private, h1394_error_t type, void *arg) uint_t hal_node_num; uint_t IRM_node_num; - TNF_PROBE_0_DEBUG(h1394_error_detected_enter, S1394_TNF_SL_STACK, ""); - hal = (s1394_hal_t *)sl_private; switch (type) { case H1394_LOCK_RESP_ERR: - TNF_PROBE_1(h1394_error_detected, S1394_TNF_SL_ERROR, "", - tnf_string, msg, "Lock response error"); /* If we are the IRM, then initiate a bus reset */ mutex_enter(&hal->topology_tree_mutex); hal_node_num = IEEE1394_NODE_NUM(hal->node_id); @@ -1757,14 +1512,9 @@ h1394_error_detected(void *sl_private, h1394_error_t type, void *arg) break; case H1394_POSTED_WR_ERR: - TNF_PROBE_2(h1394_error_detected, S1394_TNF_SL_ERROR, "", - tnf_string, msg, "Posted write error detected", - tnf_opaque, addr, ((h1394_posted_wr_err_t *)arg)->addr); break; case H1394_SELF_INITIATED_SHUTDOWN: - TNF_PROBE_1(h1394_error_detected, S1394_TNF_SL_ERROR, "", - tnf_string, msg, "HAL self-initiated shutdown"); s1394_hal_shutdown(hal, B_FALSE); break; @@ -1776,16 +1526,9 @@ h1394_error_detected(void *sl_private, h1394_error_t type, void *arg) hal->cm_timer = timeout(s1394_cycle_too_long_callback, hal, drv_usectohz(CYCLE_MASTER_TIMER * 1000)); - TNF_PROBE_1(h1394_error_detected, S1394_TNF_SL_ERROR, "", - tnf_string, msg, "Isochronous cycle too long error"); break; default: - TNF_PROBE_2(h1394_error_detected, S1394_TNF_SL_ERROR, "", - tnf_string, msg, "Unknown error type received", - tnf_uint, type, type); break; } - - TNF_PROBE_0_DEBUG(h1394_error_detected_exit, S1394_TNF_SL_STACK, ""); } diff --git a/usr/src/uts/common/io/1394/nx1394.c b/usr/src/uts/common/io/1394/nx1394.c index 216b70a319..21dec50620 100644 --- a/usr/src/uts/common/io/1394/nx1394.c +++ b/usr/src/uts/common/io/1394/nx1394.c @@ -40,9 +40,6 @@ #include <sys/cmn_err.h> #include <sys/types.h> #include <sys/ddi_impldefs.h> - -#include <sys/tnf_probe.h> - #include <sys/1394/t1394.h> #include <sys/1394/s1394.h> #include <sys/1394/h1394.h> @@ -137,16 +134,12 @@ nx1394_bus_ctl(dev_info_t *dip, dev_info_t *rdip, ddi_ctl_enum_t op, void *arg, { int status; - TNF_PROBE_0_DEBUG(nx1394_bus_ctl_enter, S1394_TNF_SL_NEXUS_STACK, ""); - switch (op) { case DDI_CTLOPS_REPORTDEV: { dev_info_t *pdip = ddi_get_parent(rdip); cmn_err(CE_CONT, "?%s%d at %s%d", ddi_node_name(rdip), ddi_get_instance(rdip), ddi_node_name(pdip), ddi_get_instance(pdip)); - TNF_PROBE_0_DEBUG(nx1394_bus_ctl_exit, S1394_TNF_SL_NEXUS_STACK, - ""); return (DDI_SUCCESS); } @@ -157,9 +150,6 @@ nx1394_bus_ctl(dev_info_t *dip, dev_info_t *rdip, ddi_ctl_enum_t op, void *arg, uint32_t *regptr; char addr[MAXNAMELEN]; - TNF_PROBE_1(nx1394_bus_ctl_init_child, - S1394_TNF_SL_HOTPLUG_STACK, "", tnf_opaque, dip, cdip); - i = ddi_prop_lookup_int_array(DDI_DEV_T_ANY, cdip, DDI_PROP_DONTPASS, "reg", (int **)®ptr, (uint_t *)®len); @@ -167,12 +157,6 @@ nx1394_bus_ctl(dev_info_t *dip, dev_info_t *rdip, ddi_ctl_enum_t op, void *arg, if (i != DDI_PROP_SUCCESS) { cmn_err(CE_NOTE, "!%s(%d): \"reg\" property not found", ddi_node_name(cdip), ddi_get_instance(cdip)); - TNF_PROBE_2(nx1394_bus_ctl, - S1394_TNF_SL_NEXUS_ERROR, "", tnf_string, msg, - "Reg property not found", tnf_int, reason, i); - TNF_PROBE_1_DEBUG(nx1394_bus_ctl_exit, - S1394_TNF_SL_NEXUS_STACK, "", tnf_string, op, - "initchild"); return (DDI_NOT_WELL_FORMED); } @@ -200,12 +184,6 @@ nx1394_bus_ctl(dev_info_t *dip, dev_info_t *rdip, ddi_ctl_enum_t op, void *arg, "!%s(%d): Duplicate dev_info node found %s@%s", ddi_node_name(cdip), ddi_get_instance(cdip), ddi_node_name(ocdip), addr); - TNF_PROBE_1(nx1394_bus_ctl, - S1394_TNF_SL_NEXUS_ERROR, "", tnf_string, msg, - "Duplicate nodes"); - TNF_PROBE_1_DEBUG(nx1394_bus_ctl_exit, - S1394_TNF_SL_NEXUS_STACK, "", tnf_string, op, - "initchild"); ddi_set_name_addr(cdip, NULL); return (DDI_NOT_WELL_FORMED); } @@ -224,35 +202,22 @@ nx1394_bus_ctl(dev_info_t *dip, dev_info_t *rdip, ddi_ctl_enum_t op, void *arg, "\"active-dma-flush\" property", ddi_node_name(cdip), ddi_get_instance(cdip)); - TNF_PROBE_1(nx1394_bus_ctl, - S1394_TNF_SL_NEXUS_ERROR, "", tnf_string, - msg, "Unable to add \"active-dma-flush\" " - "property"); - TNF_PROBE_1_DEBUG(nx1394_bus_ctl_exit, - S1394_TNF_SL_NEXUS_STACK, "", tnf_string, - op, "initchild"); ddi_set_name_addr(cdip, NULL); return (DDI_NOT_WELL_FORMED); } } - TNF_PROBE_1_DEBUG(nx1394_bus_ctl_exit, - S1394_TNF_SL_NEXUS_STACK, "", tnf_string, op, "initchild"); return (DDI_SUCCESS); } case DDI_CTLOPS_UNINITCHILD: { ddi_prop_remove_all((dev_info_t *)arg); ddi_set_name_addr((dev_info_t *)arg, NULL); - TNF_PROBE_1_DEBUG(nx1394_bus_ctl_exit, S1394_TNF_SL_NEXUS_STACK, - "", tnf_string, op, "uninitchild"); return (DDI_SUCCESS); } case DDI_CTLOPS_IOMIN: { status = ddi_ctlops(dip, rdip, op, arg, result); - TNF_PROBE_1_DEBUG(nx1394_bus_ctl_exit, S1394_TNF_SL_NEXUS_STACK, - "", tnf_string, op, "iomin"); return (status); } @@ -276,10 +241,6 @@ nx1394_bus_ctl(dev_info_t *dip, dev_info_t *rdip, ddi_ctl_enum_t op, void *arg, cmn_err(CE_CONT, "!%s(%d): invalid op (%d) from %s(%d)", ddi_node_name(dip), ddi_get_instance(dip), op, ddi_node_name(rdip), ddi_get_instance(rdip)); - TNF_PROBE_2(nx1394_bus_ctl, S1394_TNF_SL_NEXUS_ERROR, "", - tnf_string, msg, "invalid op", tnf_int, op, op); - TNF_PROBE_0_DEBUG(nx1394_bus_ctl_exit, S1394_TNF_SL_NEXUS_STACK, - ""); return (DDI_FAILURE); } @@ -288,8 +249,6 @@ nx1394_bus_ctl(dev_info_t *dip, dev_info_t *rdip, ddi_ctl_enum_t op, void *arg, */ default: { status = ddi_ctlops(dip, rdip, op, arg, result); - TNF_PROBE_0_DEBUG(nx1394_bus_ctl_exit, S1394_TNF_SL_NEXUS_STACK, - ""); return (status); } } @@ -311,9 +270,6 @@ nx1394_dma_allochdl(dev_info_t *dip, dev_info_t *rdip, ddi_dma_attr_t *attr, _NOTE(SCHEME_PROTECTS_DATA("unique (per thread)", ddi_dma_attr_t)) - TNF_PROBE_0_DEBUG(nx1394_dma_allochdl_enter, S1394_TNF_SL_NEXUS_STACK, - ""); - /* * If hal calls ddi_dma_alloc_handle, dip == rdip == hal dip. * Unfortunately, we cannot verify this (by way of looking up for hal @@ -327,8 +283,6 @@ nx1394_dma_allochdl(dev_info_t *dip, dev_info_t *rdip, ddi_dma_attr_t *attr, ddi_dma_attr_merge(attr, hal_attr); } status = ddi_dma_allochdl(dip, rdip, attr, waitfnp, arg, handlep); - TNF_PROBE_1_DEBUG(nx1394_dma_allochdl_exit, S1394_TNF_SL_NEXUS_STACK, - "", tnf_int, status, status); return (status); } @@ -344,20 +298,12 @@ nx1394_get_event_cookie(dev_info_t *dip, dev_info_t *rdip, char *name, int ret; s1394_hal_t *hal; - TNF_PROBE_1_DEBUG(nx1394_get_event_cookie_enter, - S1394_TNF_SL_NEXUS_STACK, "", tnf_string, name, name); - hal = s1394_dip_to_hal(dip); ASSERT(hal); ret = ndi_event_retrieve_cookie(hal->hal_ndi_event_hdl, rdip, name, event_cookiep, 0); - TNF_PROBE_4_DEBUG(nx1394_get_event_cookie_exit, - S1394_TNF_SL_NEXUS_STACK, "", tnf_opaque, parent_dip, (void *)dip, - tnf_opaque, requestor_dip, (void *)rdip, tnf_string, event_name, - name, tnf_int, request_status, ret); - return (ret); } @@ -384,9 +330,6 @@ nx1394_add_eventcall(dev_info_t *dip, dev_info_t *rdip, hal = s1394_dip_to_hal(dip); ASSERT(hal); - TNF_PROBE_0_DEBUG(nx1394_add_eventcall_enter, S1394_TNF_SL_NEXUS_STACK, - ""); - ret = ndi_event_add_callback(hal->hal_ndi_event_hdl, rdip, cookie, callback, arg, NDI_NOSLEEP, cb_id); #if defined(DEBUG) @@ -394,10 +337,6 @@ nx1394_add_eventcall(dev_info_t *dip, dev_info_t *rdip, if (event_name == NULL) event_name = ""; #endif - TNF_PROBE_4_DEBUG(nx1394_add_eventcall_exit, S1394_TNF_SL_NEXUS_STACK, - "", tnf_opaque, parent_dip, (void *)dip, tnf_opaque, requestor_dip, - (void *)rdip, tnf_string, event_name, event_name, tnf_int, - request_status, ret); return (ret); } @@ -423,9 +362,6 @@ nx1394_remove_eventcall(dev_info_t *dip, ddi_callback_id_t cb_id) hal = s1394_dip_to_hal(dip); ASSERT(hal); - TNF_PROBE_0_DEBUG(nx1394_remove_eventcall_enter, - S1394_TNF_SL_NEXUS_STACK, ""); - ret = ndi_event_remove_callback(hal->hal_ndi_event_hdl, cb_id); #if defined(DEBUG) @@ -433,10 +369,6 @@ nx1394_remove_eventcall(dev_info_t *dip, ddi_callback_id_t cb_id) if (event_name == NULL) event_name = ""; - TNF_PROBE_4_DEBUG(nx1394_remove_eventcall_exit, - S1394_TNF_SL_NEXUS_STACK, "", tnf_opaque, parent_dip, (void *)dip, - tnf_opaque, callback_id, (void *)cb_id, tnf_string, event_name, - event_name, tnf_int, request_status, ret); #endif return (ret); @@ -464,9 +396,6 @@ nx1394_post_event(dev_info_t *dip, dev_info_t *rdip, ddi_eventcookie_t cookie, hal = s1394_dip_to_hal(dip); ASSERT(hal); - TNF_PROBE_0_DEBUG(nx1394_post_event_enter, S1394_TNF_SL_NEXUS_STACK, - ""); - name = ndi_event_cookie_to_name(hal->hal_ndi_event_hdl, cookie); /* name is NULL if we don't generate the event */ if (name != NULL) { @@ -480,18 +409,11 @@ nx1394_post_event(dev_info_t *dip, dev_info_t *rdip, ddi_eventcookie_t cookie, ret = ndi_event_run_callbacks(hal->hal_ndi_event_hdl, rdip, cookie, impl_data); - TNF_PROBE_4_DEBUG(nx1394_post_event_exit, - S1394_TNF_SL_NEXUS_STACK, "", tnf_opaque, parent_dip, - (void *)dip, tnf_opaque, requestor_dip, (void *)rdip, - tnf_string, event_name, name, tnf_int, request_status, ret); return (ret); } else { ret = ndi_post_event(ddi_get_parent(dip), rdip, cookie, impl_data); - TNF_PROBE_2_DEBUG(nx1394_post_event_exit, - S1394_TNF_SL_NEXUS_STACK, "", tnf_string, msg, - "Not our event", tnf_int, ret, ret); return (ret); } } @@ -505,32 +427,19 @@ nx1394_define_events(s1394_hal_t *hal) { int ret; - TNF_PROBE_0_DEBUG(nx1394_define_events_enter, S1394_TNF_SL_NEXUS_STACK, - ""); - /* get event handle */ ret = ndi_event_alloc_hdl(hal->halinfo.dip, hal->halinfo.hw_interrupt, &hal->hal_ndi_event_hdl, NDI_SLEEP); - if (ret != NDI_SUCCESS) { - TNF_PROBE_1(nx1394_define_events_alloc_fail, - S1394_TNF_SL_NEXUS_ERROR, "", tnf_int, ret, ret); - } else { + if (ret == NDI_SUCCESS) { /* and bind to it */ ret = ndi_event_bind_set(hal->hal_ndi_event_hdl, &nx1394_events, NDI_SLEEP); if (ret != NDI_SUCCESS) { - TNF_PROBE_1(nx1394_define_events_bind_fail, - S1394_TNF_SL_NEXUS_ERROR, "", tnf_int, ret, ret); (void) ndi_event_free_hdl(hal->hal_ndi_event_hdl); - TNF_PROBE_0_DEBUG(nx1394_define_events_exit, - S1394_TNF_SL_NEXUS_STACK, ""); return (DDI_FAILURE); } } - TNF_PROBE_0_DEBUG(nx1394_define_events_exit, S1394_TNF_SL_NEXUS_STACK, - ""); - return (DDI_SUCCESS); } @@ -543,22 +452,8 @@ nx1394_undefine_events(s1394_hal_t *hal) { int ret; - TNF_PROBE_0_DEBUG(nx1394_undefine_events_enter, - S1394_TNF_SL_NEXUS_STACK, ""); - ret = ndi_event_unbind_set(hal->hal_ndi_event_hdl, &nx1394_events, NDI_SLEEP); - if (ret != NDI_SUCCESS) { - TNF_PROBE_1(nx1394_undefine_events_unbind_fail, - S1394_TNF_SL_NEXUS_ERROR, "", tnf_int, ret, ret); - } else { + if (ret == NDI_SUCCESS) ret = ndi_event_free_hdl(hal->hal_ndi_event_hdl); - if (ret != NDI_SUCCESS) { - TNF_PROBE_1(nx1394_undefine_events_free_hdl_fail, - S1394_TNF_SL_NEXUS_ERROR, "", tnf_int, ret, ret); - } - } - - TNF_PROBE_0_DEBUG(nx1394_undefine_events_exit, - S1394_TNF_SL_NEXUS_STACK, ""); } diff --git a/usr/src/uts/common/io/1394/s1394.c b/usr/src/uts/common/io/1394/s1394.c index a3dcd4b5be..13f1bb3603 100644 --- a/usr/src/uts/common/io/1394/s1394.c +++ b/usr/src/uts/common/io/1394/s1394.c @@ -24,8 +24,6 @@ * All rights reserved. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * s1394.c * 1394 Services Layer Initialization and Cleanup Routines @@ -37,8 +35,6 @@ #include <sys/sunddi.h> #include <sys/types.h> #include <sys/kmem.h> -#include <sys/tnf_probe.h> - #include <sys/1394/t1394.h> #include <sys/1394/s1394.h> #include <sys/1394/h1394.h> @@ -62,37 +58,17 @@ static struct modlinkage s1394_modlinkage = { static int s1394_init(); static void s1394_fini(); -#ifndef NPROBE -extern int tnf_mod_load(void); -extern int tnf_mod_unload(struct modlinkage *mlp); -#endif - int _init() { int status; -#ifndef NPROBE - (void) tnf_mod_load(); -#endif status = s1394_init(); if (status != 0) { - TNF_PROBE_1(_init_error, S1394_TNF_SL_ERROR, "", - tnf_string, msg, "s1394: failed in s1394_init"); -#ifndef NPROBE - (void) tnf_mod_unload(&s1394_modlinkage); -#endif return (status); } status = mod_install(&s1394_modlinkage); - if (status != 0) { - TNF_PROBE_1(_init_error, S1394_TNF_SL_ERROR, "", - tnf_string, msg, "s1394: failed in mod_install"); -#ifndef NPROBE - (void) tnf_mod_unload(&s1394_modlinkage); -#endif - } return (status); } @@ -109,15 +85,10 @@ _fini() status = mod_remove(&s1394_modlinkage); if (status != 0) { - TNF_PROBE_1(_fini_error, S1394_TNF_SL_ERROR, "", - tnf_string, msg, "s1394: failed in mod_remove"); return (status); } s1394_fini(); -#ifndef NPROBE - (void) tnf_mod_unload(&s1394_modlinkage); -#endif return (status); } @@ -129,15 +100,12 @@ _fini() static int s1394_init() { - TNF_PROBE_0_DEBUG(s1394_init_enter, S1394_TNF_SL_STACK, ""); - s1394_statep = kmem_zalloc(sizeof (s1394_state_t), KM_SLEEP); s1394_statep->hal_head = NULL; s1394_statep->hal_tail = NULL; mutex_init(&s1394_statep->hal_list_mutex, NULL, MUTEX_DRIVER, NULL); - TNF_PROBE_0_DEBUG(s1394_init_exit, S1394_TNF_SL_STACK, ""); return (0); } @@ -149,11 +117,7 @@ s1394_init() static void s1394_fini() { - TNF_PROBE_0_DEBUG(s1394_fini_enter, S1394_TNF_SL_STACK, ""); - mutex_destroy(&s1394_statep->hal_list_mutex); kmem_free(s1394_statep, sizeof (s1394_state_t)); - - TNF_PROBE_0_DEBUG(s1394_fini_exit, S1394_TNF_SL_STACK, ""); } diff --git a/usr/src/uts/common/io/1394/s1394_addr.c b/usr/src/uts/common/io/1394/s1394_addr.c index 4ff928bb14..29fa405635 100644 --- a/usr/src/uts/common/io/1394/s1394_addr.c +++ b/usr/src/uts/common/io/1394/s1394_addr.c @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * s1394_addr.c * 1394 Address Space Routines @@ -38,8 +36,6 @@ #include <sys/sunddi.h> #include <sys/types.h> #include <sys/kmem.h> -#include <sys/tnf_probe.h> - #include <sys/1394/t1394.h> #include <sys/1394/s1394.h> #include <sys/1394/h1394.h> @@ -90,9 +86,6 @@ s1394_request_addr_blk(s1394_hal_t *hal, t1394_alloc_addr_t *addr_allocp) s1394_addr_space_blk_t *new_blk; uint64_t amount_free; - TNF_PROBE_0_DEBUG(s1394_request_addr_blk_enter, - S1394_TNF_SL_ARREQ_STACK, ""); - ASSERT(hal != NULL); /* Lock the address space "free" list */ @@ -104,11 +97,6 @@ s1394_request_addr_blk(s1394_hal_t *hal, t1394_alloc_addr_t *addr_allocp) /* Unlock the address space "free" list */ mutex_exit(&hal->addr_space_free_mutex); - TNF_PROBE_1(s1394_request_addr_blk_error, - S1394_TNF_SL_ARREQ_ERROR, "", tnf_string, msg, - "1394 address space - no more memory"); - TNF_PROBE_0_DEBUG(s1394_request_addr_blk_exit, - S1394_TNF_SL_ARREQ_STACK, ""); return (DDI_FAILURE); } @@ -134,8 +122,6 @@ s1394_request_addr_blk(s1394_hal_t *hal, t1394_alloc_addr_t *addr_allocp) s1394_addr_alloc_kstat(hal, addr_allocp->aa_address); - TNF_PROBE_0_DEBUG(s1394_request_addr_blk_exit, - S1394_TNF_SL_ARREQ_STACK, ""); return (DDI_SUCCESS); } else { @@ -145,10 +131,6 @@ s1394_request_addr_blk(s1394_hal_t *hal, t1394_alloc_addr_t *addr_allocp) if (new_blk == NULL) { /* Unlock the address space "free" list */ mutex_exit(&hal->addr_space_free_mutex); - TNF_PROBE_0(s1394_request_addr_blk_error, - S1394_TNF_SL_ARREQ_ERROR, ""); - TNF_PROBE_0_DEBUG(s1394_request_addr_blk_exit, - S1394_TNF_SL_ARREQ_STACK, ""); return (DDI_FAILURE); } @@ -174,8 +156,6 @@ s1394_request_addr_blk(s1394_hal_t *hal, t1394_alloc_addr_t *addr_allocp) s1394_addr_alloc_kstat(hal, addr_allocp->aa_address); - TNF_PROBE_0_DEBUG(s1394_request_addr_blk_exit, - S1394_TNF_SL_ARREQ_STACK, ""); return (DDI_SUCCESS); } } @@ -196,9 +176,6 @@ s1394_claim_addr_blk(s1394_hal_t *hal, t1394_alloc_addr_t *addr_allocp) s1394_addr_space_blk_t *middle_blk; uint64_t upper_bound; - TNF_PROBE_0_DEBUG(s1394_claim_addr_blk_enter, - S1394_TNF_SL_ARREQ_STACK, ""); - ASSERT(hal != NULL); /* Lock the address space "free" list */ @@ -212,11 +189,6 @@ s1394_claim_addr_blk(s1394_hal_t *hal, t1394_alloc_addr_t *addr_allocp) /* Unlock the address space free list */ mutex_exit(&hal->addr_space_free_mutex); - TNF_PROBE_1(s1394_claim_addr_blk_error, - S1394_TNF_SL_ARREQ_ERROR, "", tnf_string, msg, - "1394 address space - address unavailable"); - TNF_PROBE_0_DEBUG(s1394_claim_addr_blk_exit, - S1394_TNF_SL_ARREQ_STACK, ""); return (DDI_FAILURE); } @@ -251,8 +223,6 @@ s1394_claim_addr_blk(s1394_hal_t *hal, t1394_alloc_addr_t *addr_allocp) s1394_addr_alloc_kstat(hal, addr_allocp->aa_address); - TNF_PROBE_0_DEBUG(s1394_claim_addr_blk_exit, - S1394_TNF_SL_ARREQ_STACK, ""); return (DDI_SUCCESS); } else { @@ -268,11 +238,6 @@ s1394_claim_addr_blk(s1394_hal_t *hal, t1394_alloc_addr_t *addr_allocp) if (new_blk == NULL) { /* Unlock the addr space "free" list */ mutex_exit(&hal->addr_space_free_mutex); - TNF_PROBE_0(s1394_claim_addr_blk_error, - S1394_TNF_SL_ARREQ_ERROR, ""); - TNF_PROBE_0_DEBUG( - s1394_claim_addr_blk_exit, - S1394_TNF_SL_ARREQ_STACK, ""); return (DDI_FAILURE); } @@ -298,8 +263,6 @@ s1394_claim_addr_blk(s1394_hal_t *hal, t1394_alloc_addr_t *addr_allocp) s1394_addr_alloc_kstat(hal, addr_allocp->aa_address); - TNF_PROBE_0_DEBUG(s1394_claim_addr_blk_exit, - S1394_TNF_SL_ARREQ_STACK, ""); return (DDI_SUCCESS); } @@ -317,11 +280,6 @@ s1394_claim_addr_blk(s1394_hal_t *hal, t1394_alloc_addr_t *addr_allocp) if (new_blk == NULL) { /* Unlock the addr space "free" list */ mutex_exit(&hal->addr_space_free_mutex); - TNF_PROBE_0(s1394_claim_addr_blk_error, - S1394_TNF_SL_ARREQ_ERROR, ""); - TNF_PROBE_0_DEBUG - (s1394_claim_addr_blk_exit, - S1394_TNF_SL_ARREQ_STACK, ""); return (DDI_FAILURE); } @@ -347,8 +305,6 @@ s1394_claim_addr_blk(s1394_hal_t *hal, t1394_alloc_addr_t *addr_allocp) s1394_addr_alloc_kstat(hal, addr_allocp->aa_address); - TNF_PROBE_0_DEBUG(s1394_claim_addr_blk_exit, - S1394_TNF_SL_ARREQ_STACK, ""); return (DDI_SUCCESS); } else { @@ -364,11 +320,6 @@ s1394_claim_addr_blk(s1394_hal_t *hal, t1394_alloc_addr_t *addr_allocp) if (new_blk == NULL) { /* Unlock the addr space "free" list */ mutex_exit(&hal->addr_space_free_mutex); - TNF_PROBE_0(s1394_claim_addr_blk_error, - S1394_TNF_SL_ARREQ_ERROR, ""); - TNF_PROBE_0_DEBUG( - s1394_claim_addr_blk_exit, - S1394_TNF_SL_ARREQ_STACK, ""); return (DDI_FAILURE); } @@ -380,11 +331,6 @@ s1394_claim_addr_blk(s1394_hal_t *hal, t1394_alloc_addr_t *addr_allocp) mutex_exit(&hal->addr_space_free_mutex); kmem_free(new_blk, sizeof (s1394_addr_space_blk_t)); - TNF_PROBE_0(s1394_claim_addr_blk_error, - S1394_TNF_SL_ARREQ_ERROR, ""); - TNF_PROBE_0_DEBUG - (s1394_claim_addr_blk_exit, - S1394_TNF_SL_ARREQ_STACK, ""); return (DDI_FAILURE); } @@ -420,8 +366,6 @@ s1394_claim_addr_blk(s1394_hal_t *hal, t1394_alloc_addr_t *addr_allocp) s1394_addr_alloc_kstat(hal, addr_allocp->aa_address); - TNF_PROBE_0_DEBUG(s1394_claim_addr_blk_exit, - S1394_TNF_SL_ARREQ_STACK, ""); return (DDI_SUCCESS); } } @@ -431,8 +375,6 @@ claim_error: /* Unlock the address space free list */ mutex_exit(&hal->addr_space_free_mutex); - TNF_PROBE_0_DEBUG(s1394_claim_addr_blk_exit, - S1394_TNF_SL_ARREQ_STACK, ""); return (DDI_FAILURE); } @@ -444,9 +386,6 @@ claim_error: int s1394_free_addr_blk(s1394_hal_t *hal, s1394_addr_space_blk_t *blk) { - TNF_PROBE_0_DEBUG(s1394_free_addr_blk_enter, S1394_TNF_SL_ARREQ_STACK, - ""); - /* Lock the address space "free" list */ mutex_enter(&hal->addr_space_free_mutex); @@ -456,11 +395,6 @@ s1394_free_addr_blk(s1394_hal_t *hal, s1394_addr_space_blk_t *blk) if (blk == NULL) { /* Unlock the address space "free" list */ mutex_exit(&hal->addr_space_free_mutex); - TNF_PROBE_1(s1394_free_addr_blk_error, - S1394_TNF_SL_ARREQ_ERROR, "", tnf_string, msg, - "Can't free block not found in used list"); - TNF_PROBE_0_DEBUG(s1394_free_addr_blk_exit, - S1394_TNF_SL_ARREQ_STACK, ""); return (DDI_FAILURE); } @@ -470,8 +404,6 @@ s1394_free_addr_blk(s1394_hal_t *hal, s1394_addr_space_blk_t *blk) /* Unlock the address space "free" list */ mutex_exit(&hal->addr_space_free_mutex); - TNF_PROBE_0_DEBUG(s1394_free_addr_blk_exit, S1394_TNF_SL_ARREQ_STACK, - ""); return (DDI_SUCCESS); } @@ -492,9 +424,6 @@ s1394_reserve_addr_blk(s1394_hal_t *hal, t1394_alloc_addr_t *addr_allocp) s1394_addr_space_blk_t *middle_blk; uint64_t upper_bound; - TNF_PROBE_0_DEBUG(s1394_reserve_addr_blk_enter, - S1394_TNF_SL_ARREQ_STACK, ""); - ASSERT(hal != NULL); /* Lock the address space "free" list */ @@ -507,11 +436,6 @@ s1394_reserve_addr_blk(s1394_hal_t *hal, t1394_alloc_addr_t *addr_allocp) /* Unlock the address space free list */ mutex_exit(&hal->addr_space_free_mutex); - TNF_PROBE_1(s1394_reserve_addr_blk_error, - S1394_TNF_SL_ARREQ_ERROR, "", tnf_string, msg, - "1394 address space - address unavailable"); - TNF_PROBE_0_DEBUG(s1394_reserve_addr_blk_exit, - S1394_TNF_SL_ARREQ_STACK, ""); return (DDI_FAILURE); } @@ -520,8 +444,6 @@ s1394_reserve_addr_blk(s1394_hal_t *hal, t1394_alloc_addr_t *addr_allocp) /* Unlock the address space free list */ mutex_exit(&hal->addr_space_free_mutex); - TNF_PROBE_0_DEBUG(s1394_reserve_addr_blk_exit, - S1394_TNF_SL_ARREQ_STACK, ""); return (DDI_FAILURE); } @@ -539,8 +461,6 @@ s1394_reserve_addr_blk(s1394_hal_t *hal, t1394_alloc_addr_t *addr_allocp) /* Unlock the address space "free" list */ mutex_exit(&hal->addr_space_free_mutex); - TNF_PROBE_0_DEBUG(s1394_reserve_addr_blk_exit, - S1394_TNF_SL_ARREQ_STACK, ""); return (DDI_SUCCESS); } else { @@ -551,12 +471,6 @@ s1394_reserve_addr_blk(s1394_hal_t *hal, t1394_alloc_addr_t *addr_allocp) if (new_blk == NULL) { /* Unlock the addr space "free" list */ mutex_exit(&hal->addr_space_free_mutex); - TNF_PROBE_0( - s1394_reserve_addr_blk_error, - S1394_TNF_SL_ARREQ_ERROR, ""); - TNF_PROBE_0_DEBUG( - s1394_reserve_addr_blk_exit, - S1394_TNF_SL_ARREQ_STACK, ""); return (DDI_FAILURE); } @@ -573,8 +487,6 @@ s1394_reserve_addr_blk(s1394_hal_t *hal, t1394_alloc_addr_t *addr_allocp) /* Unlock the address space free list */ mutex_exit(&hal->addr_space_free_mutex); - TNF_PROBE_0_DEBUG(s1394_reserve_addr_blk_exit, - "stacktrace 1394 s1394 arreq", ""); return (DDI_SUCCESS); } @@ -587,12 +499,6 @@ s1394_reserve_addr_blk(s1394_hal_t *hal, t1394_alloc_addr_t *addr_allocp) if (new_blk == NULL) { /* Unlock the addr space "free" list */ mutex_exit(&hal->addr_space_free_mutex); - TNF_PROBE_0( - s1394_reserve_addr_blk_error, - S1394_TNF_SL_ARREQ_ERROR, ""); - TNF_PROBE_0_DEBUG( - s1394_reserve_addr_blk_exit, - S1394_TNF_SL_ARREQ_STACK, ""); return (DDI_FAILURE); } @@ -609,8 +515,6 @@ s1394_reserve_addr_blk(s1394_hal_t *hal, t1394_alloc_addr_t *addr_allocp) /* Unlock the address space free list */ mutex_exit(&hal->addr_space_free_mutex); - TNF_PROBE_0_DEBUG(s1394_reserve_addr_blk_exit, - S1394_TNF_SL_ARREQ_STACK, ""); return (DDI_SUCCESS); } else { @@ -621,12 +525,6 @@ s1394_reserve_addr_blk(s1394_hal_t *hal, t1394_alloc_addr_t *addr_allocp) if (new_blk == NULL) { /* Unlock the addr space "free" list */ mutex_exit(&hal->addr_space_free_mutex); - TNF_PROBE_0( - s1394_reserve_addr_blk_error, - S1394_TNF_SL_ARREQ_ERROR, ""); - TNF_PROBE_0_DEBUG( - s1394_reserve_addr_blk_exit, - S1394_TNF_SL_ARREQ_STACK, ""); return (DDI_FAILURE); } @@ -638,12 +536,6 @@ s1394_reserve_addr_blk(s1394_hal_t *hal, t1394_alloc_addr_t *addr_allocp) mutex_exit(&hal->addr_space_free_mutex); kmem_free(new_blk, sizeof (s1394_addr_space_blk_t)); - TNF_PROBE_0( - s1394_reserve_addr_blk_error, - S1394_TNF_SL_ARREQ_ERROR, ""); - TNF_PROBE_0_DEBUG( - s1394_reserve_addr_blk_exit, - S1394_TNF_SL_ARREQ_STACK, ""); return (DDI_FAILURE); } @@ -666,8 +558,6 @@ s1394_reserve_addr_blk(s1394_hal_t *hal, t1394_alloc_addr_t *addr_allocp) /* Unlock the address space free list */ mutex_exit(&hal->addr_space_free_mutex); - TNF_PROBE_0_DEBUG(s1394_reserve_addr_blk_exit, - S1394_TNF_SL_ARREQ_STACK, ""); return (DDI_SUCCESS); } } @@ -676,8 +566,6 @@ s1394_reserve_addr_blk(s1394_hal_t *hal, t1394_alloc_addr_t *addr_allocp) /* Unlock the address space free list */ mutex_exit(&hal->addr_space_free_mutex); - TNF_PROBE_0_DEBUG(s1394_reserve_addr_blk_exit, - S1394_TNF_SL_ARREQ_STACK, ""); return (DDI_FAILURE); } @@ -703,9 +591,6 @@ s1394_init_addr_space(s1394_hal_t *hal) int i; int ret; - TNF_PROBE_0_DEBUG(s1394_init_addr_space_enter, - S1394_TNF_SL_ARREQ_STACK, ""); - /* Setup Address Space */ mutex_init(&hal->addr_space_free_mutex, NULL, MUTEX_DRIVER, NULL); @@ -777,11 +662,6 @@ s1394_init_addr_space(s1394_hal_t *hal) /* Unlock the address space free list */ mutex_exit(&hal->addr_space_free_mutex); s1394_destroy_addr_space(hal); - TNF_PROBE_1(s1394_init_addr_space_error, - S1394_TNF_SL_ARREQ_ERROR, "", tnf_string, msg, - "Invalid addr_type specified"); - TNF_PROBE_0_DEBUG(s1394_init_addr_space_exit, - S1394_TNF_SL_ARREQ_STACK, ""); return (DDI_FAILURE); } s1394_free_list_insert(hal, addr_blk); @@ -793,11 +673,6 @@ s1394_init_addr_space(s1394_hal_t *hal) /* Setup the necessary CSR space */ if (s1394_setup_CSR_space(hal) != DDI_SUCCESS) { s1394_destroy_addr_space(hal); - TNF_PROBE_1(s1394_init_addr_space_error, - S1394_TNF_SL_ARREQ_ERROR, "", tnf_string, msg, - "Failed in s1394_setup_CSR_space()"); - TNF_PROBE_0_DEBUG(s1394_init_addr_space_exit, - S1394_TNF_SL_ARREQ_STACK, ""); return (DDI_FAILURE); } @@ -813,11 +688,6 @@ s1394_init_addr_space(s1394_hal_t *hal) if ((lo >= hal->physical_addr_lo) && (hi <= hal->physical_addr_hi)) { s1394_destroy_addr_space(hal); - TNF_PROBE_1(s1394_init_addr_space_error, - S1394_TNF_SL_ARREQ_ERROR, "", tnf_string, msg, - "Attempted to reserve physical memory"); - TNF_PROBE_0_DEBUG(s1394_init_addr_space_exit, - S1394_TNF_SL_ARREQ_STACK, ""); return (DDI_FAILURE); } @@ -826,17 +696,10 @@ s1394_init_addr_space(s1394_hal_t *hal) ret = s1394_reserve_addr_blk(hal, &addr_alloc); if (ret != DDI_SUCCESS) { s1394_destroy_addr_space(hal); - TNF_PROBE_1(s1394_init_addr_space_error, - S1394_TNF_SL_ARREQ_ERROR, "", tnf_string, msg, - "Unable to reserve 1394 address"); - TNF_PROBE_0_DEBUG(s1394_init_addr_space_exit, - S1394_TNF_SL_ARREQ_STACK, ""); return (DDI_FAILURE); } } - TNF_PROBE_0_DEBUG(s1394_init_addr_space_exit, S1394_TNF_SL_ARREQ_STACK, - ""); return (DDI_SUCCESS); } @@ -857,9 +720,6 @@ s1394_destroy_addr_space(s1394_hal_t *hal) uint64_t hi; uint_t length; - TNF_PROBE_0_DEBUG(s1394_destroy_addr_space_enter, - S1394_TNF_SL_ARREQ_STACK, ""); - /* Lock the address space "used" tree */ mutex_enter(&hal->addr_space_used_mutex); @@ -917,9 +777,6 @@ s1394_destroy_addr_space(s1394_hal_t *hal) /* Unlock & destroy the address space "free" list */ mutex_exit(&hal->addr_space_free_mutex); mutex_destroy(&hal->addr_space_free_mutex); - - TNF_PROBE_0_DEBUG(s1394_destroy_addr_space_exit, - S1394_TNF_SL_ARREQ_STACK, ""); } /* @@ -936,9 +793,6 @@ s1394_free_list_insert(s1394_hal_t *hal, s1394_addr_space_blk_t *new_blk) s1394_addr_space_blk_t *left_blk; s1394_addr_space_blk_t *right_blk; - TNF_PROBE_0_DEBUG(s1394_free_list_insert_enter, - S1394_TNF_SL_ARREQ_STACK, ""); - ASSERT(MUTEX_HELD(&hal->addr_space_free_mutex)); /* Start at the head of the "free" list */ @@ -1006,9 +860,6 @@ s1394_free_list_insert(s1394_hal_t *hal, s1394_addr_space_blk_t *new_blk) new_blk->addr_enable = 0; new_blk->kmem_bufp = NULL; new_blk->addr_arg = NULL; - - TNF_PROBE_0_DEBUG(s1394_free_list_insert_exit, - S1394_TNF_SL_ARREQ_STACK, ""); } /* @@ -1021,9 +872,6 @@ s1394_free_list_search(s1394_hal_t *hal, uint64_t addr) { s1394_addr_space_blk_t *curr_blk; - TNF_PROBE_0_DEBUG(s1394_free_list_search_enter, - S1394_TNF_SL_ARREQ_STACK, ""); - ASSERT(MUTEX_HELD(&hal->addr_space_free_mutex)); /* Start at the head of the list */ @@ -1035,8 +883,6 @@ s1394_free_list_search(s1394_hal_t *hal, uint64_t addr) curr_blk = curr_blk->asb_right; } - TNF_PROBE_0_DEBUG(s1394_free_list_search_exit, - S1394_TNF_SL_ARREQ_STACK, ""); return (curr_blk); } @@ -1051,9 +897,6 @@ s1394_free_list_find(s1394_hal_t *hal, uint32_t type, uint32_t length) s1394_addr_space_blk_t *curr_blk; uint64_t size; - TNF_PROBE_0_DEBUG(s1394_free_list_find_enter, S1394_TNF_SL_ARREQ_STACK, - ""); - ASSERT(MUTEX_HELD(&hal->addr_space_free_mutex)); /* Start at the head of the list */ @@ -1079,8 +922,6 @@ s1394_free_list_find(s1394_hal_t *hal, uint32_t type, uint32_t length) curr_blk = curr_blk->asb_right; } - TNF_PROBE_0_DEBUG(s1394_free_list_find_exit, S1394_TNF_SL_ARREQ_STACK, - ""); return (curr_blk); } @@ -1095,9 +936,6 @@ s1394_free_list_delete(s1394_hal_t *hal, s1394_addr_space_blk_t *del_blk) s1394_addr_space_blk_t *left_blk; s1394_addr_space_blk_t *right_blk; - TNF_PROBE_0_DEBUG(s1394_free_list_delete_enter, - S1394_TNF_SL_ARREQ_STACK, ""); - ASSERT(MUTEX_HELD(&hal->addr_space_free_mutex)); left_blk = del_blk->asb_left; @@ -1114,8 +952,6 @@ s1394_free_list_delete(s1394_hal_t *hal, s1394_addr_space_blk_t *del_blk) if (right_blk != NULL) right_blk->asb_left = left_blk; - TNF_PROBE_0_DEBUG(s1394_free_list_delete_exit, - S1394_TNF_SL_ARREQ_STACK, ""); return (del_blk); } @@ -1137,9 +973,6 @@ s1394_used_tree_insert(s1394_hal_t *hal, s1394_addr_space_blk_t *x) s1394_addr_space_blk_t *y; s1394_addr_space_blk_t **root; - TNF_PROBE_0_DEBUG(s1394_used_tree_insert_enter, - S1394_TNF_SL_ARREQ_STACK, ""); - /* Lock the "used" tree */ mutex_enter(&hal->addr_space_used_mutex); @@ -1197,9 +1030,6 @@ s1394_used_tree_insert(s1394_hal_t *hal, s1394_addr_space_blk_t *x) /* Unlock the "used" tree */ mutex_exit(&hal->addr_space_used_mutex); - - TNF_PROBE_0_DEBUG(s1394_used_tree_insert_exit, - S1394_TNF_SL_ARREQ_STACK, ""); } /* @@ -1214,9 +1044,6 @@ s1394_tree_insert(s1394_addr_space_blk_t **root, s1394_addr_space_blk_t *z) s1394_addr_space_blk_t *y = NULL; s1394_addr_space_blk_t *x = *root; - TNF_PROBE_0_DEBUG(s1394_tree_insert_enter, S1394_TNF_SL_ARREQ_STACK, - ""); - while (x != NULL) { y = x; if (z->addr_lo < x->addr_lo) @@ -1235,9 +1062,6 @@ s1394_tree_insert(s1394_addr_space_blk_t **root, s1394_addr_space_blk_t *z) y->asb_left = z; else y->asb_right = z; - - TNF_PROBE_0_DEBUG(s1394_tree_insert_exit, S1394_TNF_SL_ARREQ_STACK, - ""); } /* @@ -1251,16 +1075,11 @@ s1394_used_tree_search(s1394_hal_t *hal, uint64_t addr) { s1394_addr_space_blk_t *curr_blk; - TNF_PROBE_0_DEBUG(s1394_used_tree_search_enter, - S1394_TNF_SL_ARREQ_STACK, ""); - ASSERT(MUTEX_HELD(&hal->addr_space_used_mutex)); /* Search the HAL's "used" tree for this address */ curr_blk = s1394_tree_search(hal->addr_space_used_tree, addr); - TNF_PROBE_0_DEBUG(s1394_used_tree_search_exit, - S1394_TNF_SL_ARREQ_STACK, ""); return (curr_blk); } @@ -1272,9 +1091,6 @@ s1394_used_tree_search(s1394_hal_t *hal, uint64_t addr) static s1394_addr_space_blk_t * s1394_tree_search(s1394_addr_space_blk_t *x, uint64_t address) { - TNF_PROBE_0_DEBUG(s1394_tree_search_enter, S1394_TNF_SL_ARREQ_STACK, - ""); - while (x != NULL) { if (x->addr_lo > address) x = x->asb_left; @@ -1284,8 +1100,6 @@ s1394_tree_search(s1394_addr_space_blk_t *x, uint64_t address) break; } - TNF_PROBE_0_DEBUG(s1394_tree_search_exit, S1394_TNF_SL_ARREQ_STACK, - ""); return (x); } @@ -1307,9 +1121,6 @@ s1394_used_tree_delete(s1394_hal_t *hal, s1394_addr_space_blk_t *z) int old_color; int side_of_x; - TNF_PROBE_0_DEBUG(s1394_used_tree_delete_enter, - S1394_TNF_SL_ARREQ_STACK, ""); - /* Lock the "used" tree */ mutex_enter(&hal->addr_space_used_mutex); @@ -1396,8 +1207,6 @@ s1394_used_tree_delete(s1394_hal_t *hal, s1394_addr_space_blk_t *z) /* Unlock the "used" tree */ mutex_exit(&hal->addr_space_used_mutex); - TNF_PROBE_0_DEBUG(s1394_used_tree_delete_exit, - S1394_TNF_SL_ARREQ_STACK, ""); return (z); } @@ -1413,9 +1222,6 @@ s1394_used_tree_delete_fixup(s1394_addr_space_blk_t **root, { boolean_t first_time; - TNF_PROBE_0_DEBUG(s1394_used_tree_delete_fixup_enter, - S1394_TNF_SL_ARREQ_STACK, ""); - first_time = B_TRUE; while ((x != *root) && ((x == NULL) || (x->asb_color == BLACK))) { if (((first_time == B_TRUE) && (side_of_x == LEFT)) || @@ -1510,9 +1316,6 @@ s1394_used_tree_delete_fixup(s1394_addr_space_blk_t **root, } if (x != NULL) x->asb_color = BLACK; - - TNF_PROBE_0_DEBUG(s1394_used_tree_delete_fixup_exit, - S1394_TNF_SL_ARREQ_STACK, ""); } /* @@ -1526,9 +1329,6 @@ s1394_left_rotate(s1394_addr_space_blk_t **root, s1394_addr_space_blk_t *x) { s1394_addr_space_blk_t *y; - TNF_PROBE_0_DEBUG(s1394_left_rotate_enter, S1394_TNF_SL_ARREQ_STACK, - ""); - y = x->asb_right; x->asb_right = y->asb_left; @@ -1545,9 +1345,6 @@ s1394_left_rotate(s1394_addr_space_blk_t **root, s1394_addr_space_blk_t *x) y->asb_left = x; x->asb_parent = y; - - TNF_PROBE_0_DEBUG(s1394_left_rotate_exit, S1394_TNF_SL_ARREQ_STACK, - ""); } /* @@ -1561,9 +1358,6 @@ s1394_right_rotate(s1394_addr_space_blk_t **root, s1394_addr_space_blk_t *x) { s1394_addr_space_blk_t *y; - TNF_PROBE_0_DEBUG(s1394_right_rotate_enter, S1394_TNF_SL_ARREQ_STACK, - ""); - y = x->asb_left; x->asb_left = y->asb_right; @@ -1580,9 +1374,6 @@ s1394_right_rotate(s1394_addr_space_blk_t **root, s1394_addr_space_blk_t *x) y->asb_right = x; x->asb_parent = y; - - TNF_PROBE_0_DEBUG(s1394_right_rotate_exit, S1394_TNF_SL_ARREQ_STACK, - ""); } /* @@ -1592,14 +1383,9 @@ s1394_right_rotate(s1394_addr_space_blk_t **root, s1394_addr_space_blk_t *x) static s1394_addr_space_blk_t * s1394_tree_minimum(s1394_addr_space_blk_t *x) { - TNF_PROBE_0_DEBUG(s1394_tree_minimum_enter, S1394_TNF_SL_ARREQ_STACK, - ""); - while (x->asb_left != NULL) x = x->asb_left; - TNF_PROBE_0_DEBUG(s1394_tree_minimum_exit, S1394_TNF_SL_ARREQ_STACK, - ""); return (x); } @@ -1613,14 +1399,9 @@ s1394_tree_successor(s1394_addr_space_blk_t *x) { s1394_addr_space_blk_t *y; - TNF_PROBE_0_DEBUG(s1394_tree_successor_enter, S1394_TNF_SL_ARREQ_STACK, - ""); - if (x->asb_right != NULL) { y = s1394_tree_minimum(x->asb_right); - TNF_PROBE_0_DEBUG(s1394_tree_successor_exit, - S1394_TNF_SL_ARREQ_STACK, ""); return (y); } @@ -1630,8 +1411,6 @@ s1394_tree_successor(s1394_addr_space_blk_t *x) y = y->asb_parent; } - TNF_PROBE_0_DEBUG(s1394_tree_successor_exit, S1394_TNF_SL_ARREQ_STACK, - ""); return (y); } diff --git a/usr/src/uts/common/io/1394/s1394_asynch.c b/usr/src/uts/common/io/1394/s1394_asynch.c index 66e3a6cc13..b8901aa949 100644 --- a/usr/src/uts/common/io/1394/s1394_asynch.c +++ b/usr/src/uts/common/io/1394/s1394_asynch.c @@ -23,8 +23,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * s1394_asynch.c * 1394 Services Layer Asynchronous Communications Routines @@ -38,8 +36,6 @@ #include <sys/types.h> #include <sys/kmem.h> #include <sys/disp.h> -#include <sys/tnf_probe.h> - #include <sys/1394/t1394.h> #include <sys/1394/s1394.h> #include <sys/1394/h1394.h> @@ -72,16 +68,10 @@ s1394_alloc_cmd(s1394_hal_t *hal, uint_t flags, cmd1394_cmd_t **cmdp) uint_t cmd_size; int alloc_sleep; - TNF_PROBE_0_DEBUG(s1394_alloc_cmd_enter, S1394_TNF_SL_STACK, ""); - alloc_sleep = (flags & T1394_ALLOC_CMD_NOSLEEP) ? KM_NOSLEEP : KM_SLEEP; if ((alloc_sleep == KM_SLEEP) && (servicing_interrupt())) { - TNF_PROBE_1(s1394_alloc_cmd_error, S1394_TNF_SL_ATREQ_ERROR, - "", tnf_string, msg, "Tried to sleep in intr context"); - TNF_PROBE_0_DEBUG(s1394_alloc_cmd_exit, - S1394_TNF_SL_ATREQ_STACK, ""); ASSERT(alloc_sleep != KM_SLEEP); /* fail */ return (DDI_FAILURE); } @@ -90,17 +80,11 @@ s1394_alloc_cmd(s1394_hal_t *hal, uint_t flags, cmd1394_cmd_t **cmdp) if ((flags & (T1394_ALLOC_CMD_FCP_COMMAND | T1394_ALLOC_CMD_FCP_RESPONSE)) == (T1394_ALLOC_CMD_FCP_COMMAND | T1394_ALLOC_CMD_FCP_RESPONSE)) { - TNF_PROBE_1(s1394_alloc_cmd_error, S1394_TNF_SL_ATREQ_ERROR, - "", tnf_string, msg, "Both FCP cmd and resp flags"); - TNF_PROBE_0_DEBUG(s1394_alloc_cmd_exit, - S1394_TNF_SL_ATREQ_STACK, ""); return (DDI_FAILURE); } *cmdp = kmem_cache_alloc(hal->hal_kmem_cachep, alloc_sleep); if (*cmdp == NULL) { - TNF_PROBE_0_DEBUG(s1394_alloc_cmd_exit, - S1394_TNF_SL_STACK, ""); return (DDI_FAILURE); } cmd_size = sizeof (cmd1394_cmd_t) + @@ -124,13 +108,9 @@ s1394_alloc_cmd(s1394_hal_t *hal, uint_t flags, cmd1394_cmd_t **cmdp) hal_overhead = (uchar_t *)s_priv + sizeof (s1394_cmd_priv_t); s_priv->hal_cmd_private.hal_overhead = (void *)hal_overhead; - TNF_PROBE_1_DEBUG(s1394_alloc_cmd, S1394_TNF_SL_STACK, "", - tnf_opaque, cmd, *cmdp); - /* kstats - number of cmd allocs */ hal->hal_kstats->cmd_alloc++; - TNF_PROBE_0_DEBUG(s1394_alloc_cmd_exit, S1394_TNF_SL_STACK, ""); return (DDI_SUCCESS); } @@ -144,21 +124,14 @@ s1394_free_cmd(s1394_hal_t *hal, cmd1394_cmd_t **cmdp) { s1394_cmd_priv_t *s_priv; - TNF_PROBE_0_DEBUG(s1394_free_cmd_enter, S1394_TNF_SL_STACK, ""); - /* Get the Services Layer private area */ s_priv = S1394_GET_CMD_PRIV(*cmdp); /* Check that command isn't in use */ if (s_priv->cmd_in_use == B_TRUE) { - TNF_PROBE_1(s1394_free_cmd_error, S1394_TNF_SL_ERROR, "", - tnf_string, msg, "Attempted to free an in-use command"); - TNF_PROBE_0_DEBUG(s1394_free_cmd_exit, S1394_TNF_SL_STACK, ""); ASSERT(s_priv->cmd_in_use == B_FALSE); return (DDI_FAILURE); } - TNF_PROBE_1_DEBUG(s1394_free_cmd, S1394_TNF_SL_STACK, "", - tnf_opaque, cmd, *cmdp); /* kstats - number of cmd allocs */ kmem_cache_free(hal->hal_kmem_cachep, *cmdp); @@ -169,7 +142,6 @@ s1394_free_cmd(s1394_hal_t *hal, cmd1394_cmd_t **cmdp) /* kstats - number of cmd frees */ hal->hal_kstats->cmd_free++; - TNF_PROBE_0_DEBUG(s1394_free_cmd_exit, S1394_TNF_SL_STACK, ""); return (DDI_SUCCESS); } @@ -190,9 +162,6 @@ s1394_xfer_asynch_command(s1394_hal_t *hal, cmd1394_cmd_t *cmd, int *err) int result_from_hal; int ret; - TNF_PROBE_0_DEBUG(s1394_xfer_asynch_command_enter, - S1394_TNF_SL_ATREQ_STACK, ""); - ASSERT(MUTEX_NOT_HELD(&hal->topology_tree_mutex)); mutex_enter(&hal->topology_tree_mutex); @@ -201,8 +170,6 @@ s1394_xfer_asynch_command(s1394_hal_t *hal, cmd1394_cmd_t *cmd, int *err) (hal->disable_requests_bit == 1)) { *err = s1394_HAL_asynch_error(hal, cmd, state); mutex_exit(&hal->topology_tree_mutex); - TNF_PROBE_0_DEBUG(s1394_xfer_asynch_command_exit, - S1394_TNF_SL_ATREQ_STACK, ""); return (DDI_FAILURE); } mutex_exit(&hal->topology_tree_mutex); @@ -269,17 +236,9 @@ s1394_xfer_asynch_command(s1394_hal_t *hal, cmd1394_cmd_t *cmd, int *err) default: *err = CMD1394_EUNKNOWN_ERROR; - TNF_PROBE_1(s1394_xfer_asynch_command_error, - S1394_TNF_SL_ATREQ_ERROR, "", tnf_string, msg, - "Invalid command type specified"); - TNF_PROBE_0_DEBUG(s1394_xfer_asynch_command_exit, - S1394_TNF_SL_ATREQ_STACK, ""); return (DDI_FAILURE); } - TNF_PROBE_0_DEBUG(s1394_xfer_asynch_command_return_from_HAL, - S1394_TNF_SL_ATREQ_STACK, ""); - if (ret == DDI_FAILURE) { switch (result_from_hal) { case H1394_STATUS_EMPTY_TLABEL: @@ -324,18 +283,12 @@ s1394_xfer_asynch_command(s1394_hal_t *hal, cmd1394_cmd_t *cmd, int *err) break; } - TNF_PROBE_2_DEBUG(s1394_xfer_asynch_command_exit, - S1394_TNF_SL_ATREQ_STACK, "", - tnf_int, result_from_hal, result_from_hal, - tnf_int, err, *err); return (DDI_FAILURE); } /* No errors, return success */ *err = CMD1394_NOSTATUS; - TNF_PROBE_0_DEBUG(s1394_xfer_asynch_command_exit, - S1394_TNF_SL_ATREQ_STACK, ""); return (DDI_SUCCESS); } @@ -361,9 +314,6 @@ s1394_setup_asynch_command(s1394_hal_t *hal, s1394_target_t *target, uint_t max_rec; uint_t max_blk; - TNF_PROBE_0_DEBUG(s1394_setup_asynch_command_enter, - S1394_TNF_SL_ATREQ_STACK, ""); - ASSERT(MUTEX_HELD(&hal->topology_tree_mutex)); switch (cmd->cmd_type) { @@ -377,19 +327,12 @@ s1394_setup_asynch_command(s1394_hal_t *hal, s1394_target_t *target, default: *err = CMD1394_EINVALID_COMMAND; - TNF_PROBE_1(s1394_setup_asynch_command_error, - S1394_TNF_SL_ATREQ_ERROR, "", tnf_string, msg, - "Invalid command type specified"); - TNF_PROBE_0_DEBUG(s1394_setup_asynch_command_exit, - S1394_TNF_SL_ATREQ_STACK, ""); return (DDI_FAILURE); } /* Check for potential address roll-over */ if (s1394_address_rollover(cmd) != B_FALSE) { *err = CMD1394_EADDRESS_ERROR; - TNF_PROBE_0_DEBUG(s1394_setup_asynch_command_exit, - S1394_TNF_SL_ATREQ_STACK, ""); return (DDI_FAILURE); } @@ -413,8 +356,6 @@ s1394_setup_asynch_command(s1394_hal_t *hal, s1394_target_t *target, if (cmd->bus_generation != hal->generation_count) { *err = CMD1394_ESTALE_GENERATION; - TNF_PROBE_0_DEBUG(s1394_setup_asynch_command_exit, - S1394_TNF_SL_ATREQ_STACK, ""); return (DDI_FAILURE); } @@ -431,8 +372,6 @@ s1394_setup_asynch_command(s1394_hal_t *hal, s1394_target_t *target, target->on_node == NULL) { rw_exit(&hal->target_list_rwlock); *err = CMD1394_EDEVICE_REMOVED; - TNF_PROBE_0_DEBUG(s1394_setup_asynch_command_exit, - S1394_TNF_SL_ATREQ_STACK, ""); return (DDI_FAILURE); } @@ -464,8 +403,6 @@ s1394_setup_asynch_command(s1394_hal_t *hal, s1394_target_t *target, if (cmd->cmd_options & CMD1394_OVERRIDE_SPEED) { if (cmd->cmd_speed > IEEE1394_S400) { *err = CMD1394_EINVALID_COMMAND; - TNF_PROBE_0_DEBUG(s1394_setup_asynch_command_exit, - S1394_TNF_SL_ATREQ_STACK, ""); return (DDI_FAILURE); } else { @@ -484,16 +421,12 @@ s1394_setup_asynch_command(s1394_hal_t *hal, s1394_target_t *target, if (cmd->cmd_u.b.data_block == NULL) { *err = CMD1394_ENULL_MBLK; - TNF_PROBE_0_DEBUG(s1394_setup_asynch_command_exit, - S1394_TNF_SL_ATREQ_STACK, ""); return (DDI_FAILURE); } /* Also need to check for MBLK_TOO_SMALL */ if (s1394_mblk_too_small(cmd) != B_FALSE) { *err = CMD1394_EMBLK_TOO_SMALL; - TNF_PROBE_0_DEBUG(s1394_setup_asynch_command_exit, - S1394_TNF_SL_ATREQ_STACK, ""); return (DDI_FAILURE); } @@ -563,8 +496,6 @@ s1394_setup_asynch_command(s1394_hal_t *hal, s1394_target_t *target, /* Put command on the HAL's outstanding request Q */ s1394_insert_q_asynch_cmd(hal, cmd); - TNF_PROBE_0_DEBUG(s1394_setup_asynch_command_exit, - S1394_TNF_SL_ATREQ_STACK, ""); return (DDI_SUCCESS); } @@ -580,9 +511,6 @@ s1394_insert_q_asynch_cmd(s1394_hal_t *hal, cmd1394_cmd_t *cmd) s1394_cmd_priv_t *c_priv; cmd1394_cmd_t *temp_cmd; - TNF_PROBE_0_DEBUG(s1394_insert_q_asynch_cmd_enter, - S1394_TNF_SL_ATREQ_STACK, ""); - mutex_enter(&hal->outstanding_q_mutex); /* Get the Services Layer private area */ @@ -610,9 +538,6 @@ s1394_insert_q_asynch_cmd(s1394_hal_t *hal, cmd1394_cmd_t *cmd) } mutex_exit(&hal->outstanding_q_mutex); - - TNF_PROBE_0_DEBUG(s1394_insert_q_asynch_cmd_exit, - S1394_TNF_SL_ATREQ_STACK, ""); } /* @@ -628,9 +553,6 @@ s1394_remove_q_asynch_cmd(s1394_hal_t *hal, cmd1394_cmd_t *cmd) cmd1394_cmd_t *prev_cmd; cmd1394_cmd_t *next_cmd; - TNF_PROBE_0_DEBUG(s1394_remove_q_asynch_cmd_enter, - S1394_TNF_SL_ATREQ_STACK, ""); - mutex_enter(&hal->outstanding_q_mutex); /* Get the Services Layer private area */ @@ -663,9 +585,6 @@ s1394_remove_q_asynch_cmd(s1394_hal_t *hal, cmd1394_cmd_t *cmd) } mutex_exit(&hal->outstanding_q_mutex); - - TNF_PROBE_0_DEBUG(s1394_remove_q_asynch_cmd_exit, - S1394_TNF_SL_ATREQ_STACK, ""); } /* @@ -686,9 +605,6 @@ s1394_atreq_cmd_complete(s1394_hal_t *hal, cmd1394_cmd_t *req, int status) int cmd_result; int err; - TNF_PROBE_0_DEBUG(s1394_atreq_cmd_complete_enter, - S1394_TNF_SL_ATREQ_STACK, ""); - /* Get the Services Layer private area */ s_priv = S1394_GET_CMD_PRIV(req); @@ -738,8 +654,6 @@ s1394_atreq_cmd_complete(s1394_hal_t *hal, cmd1394_cmd_t *req, int status) } s1394_remove_q_asynch_cmd(hal, req); s1394_pending_q_insert(hal, req, S1394_PENDING_Q_REAR); - TNF_PROBE_0_DEBUG(s1394_atreq_cmd_complete_exit, - S1394_TNF_SL_ATREQ_STACK, ""); return; /* ack_busy_X */ @@ -797,12 +711,6 @@ s1394_atreq_cmd_complete(s1394_hal_t *hal, cmd1394_cmd_t *req, int status) /* Disable the HAL */ s1394_hal_shutdown(hal, B_TRUE); - TNF_PROBE_2(s1394_atreq_cmd_complete_error, - S1394_TNF_SL_ATREQ_ERROR, "", tnf_string, msg, - "Unrecognized cmd status code", - tnf_int, status, status); - TNF_PROBE_0_DEBUG(s1394_atreq_cmd_complete_exit, - S1394_TNF_SL_ATREQ_STACK, ""); return; } @@ -821,20 +729,14 @@ s1394_atreq_cmd_complete(s1394_hal_t *hal, cmd1394_cmd_t *req, int status) cv_signal(&s_priv->blocking_cv); mutex_exit(&s_priv->blocking_mutex); - TNF_PROBE_0_DEBUG(s1394_atreq_cmd_complete_exit, - S1394_TNF_SL_ATREQ_STACK, ""); return; } /* Call the target's completion_callback() */ if (req->completion_callback != NULL) { - TNF_PROBE_0_DEBUG(s1394_atreq_cmd_complete_do_callback, - S1394_TNF_SL_ATREQ_STACK, ""); req->completion_callback(req); } - TNF_PROBE_0_DEBUG(s1394_atreq_cmd_complete_exit, - S1394_TNF_SL_ATREQ_STACK, ""); return; } @@ -884,8 +786,6 @@ s1394_atreq_cmd_complete(s1394_hal_t *hal, cmd1394_cmd_t *req, int status) ret = s1394_xfer_asynch_command(hal, req, &err); if (ret == DDI_SUCCESS) { - TNF_PROBE_0_DEBUG(s1394_atreq_cmd_complete_exit, - S1394_TNF_SL_ATREQ_STACK, ""); return; } else if (err == CMD1394_ESTALE_GENERATION) { @@ -894,8 +794,6 @@ s1394_atreq_cmd_complete(s1394_hal_t *hal, cmd1394_cmd_t *req, int status) s1394_pending_q_insert(hal, req, S1394_PENDING_Q_REAR); - TNF_PROBE_0_DEBUG(s1394_atreq_cmd_complete_exit, - S1394_TNF_SL_ATREQ_STACK, ""); return; } } @@ -917,26 +815,16 @@ s1394_atreq_cmd_complete(s1394_hal_t *hal, cmd1394_cmd_t *req, int status) cv_signal(&s_priv->blocking_cv); mutex_exit(&s_priv->blocking_mutex); - TNF_PROBE_0_DEBUG(s1394_atreq_cmd_complete_exit, - S1394_TNF_SL_ATREQ_STACK, ""); return; } /* Set status and call completion_callback() */ if (req->completion_callback != NULL) { - TNF_PROBE_0_DEBUG(s1394_atreq_cmd_complete_do_callback, - S1394_TNF_SL_ATREQ_STACK, ""); - req->completion_callback(req); - TNF_PROBE_0_DEBUG(s1394_atreq_cmd_complete_exit, - S1394_TNF_SL_ATREQ_STACK, ""); return; } - - TNF_PROBE_0_DEBUG(s1394_atreq_cmd_complete_exit, - S1394_TNF_SL_ATREQ_STACK, ""); } /* @@ -956,9 +844,6 @@ s1394_atresp_cmd_complete(s1394_hal_t *hal, cmd1394_cmd_t *resp, int status) boolean_t valid_addr_blk; int target_status; - TNF_PROBE_0_DEBUG(s1394_atresp_cmd_complete_enter, - S1394_TNF_SL_ATRESP_STACK, ""); - target_status = CMD1394_CMDSUCCESS; /* If not an ack_complete */ @@ -1027,12 +912,6 @@ s1394_atresp_cmd_complete(s1394_hal_t *hal, cmd1394_cmd_t *resp, int status) /* Disable the HAL */ s1394_hal_shutdown(hal, B_TRUE); - TNF_PROBE_2(s1394_atresp_cmd_complete_error, - S1394_TNF_SL_ATRESP_ERROR, "", tnf_string, msg, - "Unrecognized cmd status code", - tnf_int, status, status); - TNF_PROBE_0_DEBUG(s1394_atresp_cmd_complete_exit, - S1394_TNF_SL_ATRESP_STACK, ""); return; } } @@ -1054,9 +933,6 @@ s1394_atresp_cmd_complete(s1394_hal_t *hal, cmd1394_cmd_t *resp, int status) case S1394_CMD_WRITE: case S1394_CMD_LOCK: if (resp->completion_callback != NULL) { - TNF_PROBE_0_DEBUG( - s1394_atresp_cmd_complete_do_callback, - S1394_TNF_SL_ATRESP_STACK, ""); resp->completion_callback(resp); } break; @@ -1071,23 +947,12 @@ s1394_atresp_cmd_complete(s1394_hal_t *hal, cmd1394_cmd_t *resp, int status) /* Disable the HAL */ s1394_hal_shutdown(hal, B_TRUE); - TNF_PROBE_1(s1394_atresp_cmd_complete_error, - S1394_TNF_SL_ATRESP_ERROR, "", tnf_string, msg, - "Unrecognized transfer type"); - TNF_PROBE_0_DEBUG(s1394_atresp_cmd_complete_exit, - S1394_TNF_SL_ATRESP_STACK, ""); return; } } - TNF_PROBE_0_DEBUG(s1394_atresp_cmd_complete_call_hal_cmplt, - S1394_TNF_SL_ATRESP_STACK, ""); - /* Free the command - Pass it back to the HAL */ HAL_CALL(hal).response_complete(hal->halinfo.hal_private, resp, h_priv); - - TNF_PROBE_1_DEBUG(s1394_atresp_cmd_complete_exit, - S1394_TNF_SL_ATRESP_STACK, "", tnf_int, status, target_status); } /* @@ -1111,9 +976,6 @@ s1394_send_response(s1394_hal_t *hal, cmd1394_cmd_t *resp) int ret; int result; - TNF_PROBE_0_DEBUG(s1394_send_response_enter, S1394_TNF_SL_ATRESP_STACK, - ""); - /* Get the Services Layer private area */ s_priv = S1394_GET_CMD_PRIV(resp); @@ -1128,21 +990,13 @@ s1394_send_response(s1394_hal_t *hal, cmd1394_cmd_t *resp) ((resp->cmd_result == CMD1394_ASYNCH_WR_QUAD) || (resp->cmd_result == CMD1394_ASYNCH_WR_BLOCK)))) { - TNF_PROBE_0_DEBUG(s1394_send_response_call_hal_cmplt, - S1394_TNF_SL_ATRESP_STACK, ""); - /* Free the command - Pass it back to the HAL */ HAL_CALL(hal).response_complete(hal->halinfo.hal_private, resp, h_priv); - TNF_PROBE_0_DEBUG(s1394_send_response_exit, - S1394_TNF_SL_ATRESP_STACK, ""); return (DDI_SUCCESS); } - TNF_PROBE_0_DEBUG(s1394_send_response_call_hal_resp, - S1394_TNF_SL_ATRESP_STACK, ""); - /* kstats - number of failure responses sent */ if (resp->cmd_result != IEEE1394_RESP_COMPLETE) { switch (resp->cmd_type) { @@ -1208,43 +1062,18 @@ s1394_send_response(s1394_hal_t *hal, cmd1394_cmd_t *resp) /* Disable the HAL */ s1394_hal_shutdown(hal, B_TRUE); - TNF_PROBE_1(s1394_send_response_error, - S1394_TNF_SL_ATRESP_ERROR, "", tnf_string, msg, - "Unrecognized transfer type"); - TNF_PROBE_0_DEBUG(s1394_send_response_exit, - S1394_TNF_SL_ATRESP_STACK, ""); return (DDI_FAILURE); } /* Unable to send a response */ if (ret != DDI_SUCCESS) { - if (result == H1394_STATUS_INVALID_BUSGEN) { - TNF_PROBE_1(s1394_send_response_error, - S1394_TNF_SL_ATRESP_ERROR, "", tnf_string, msg, - "Invalid generation in response"); - } else if (result == H1394_STATUS_NOMORE_SPACE) { - TNF_PROBE_1(s1394_send_response_error, - S1394_TNF_SL_ATRESP_ERROR, "", tnf_string, msg, - "No more space on AT response queue"); - } else { - TNF_PROBE_1(s1394_send_response_error, - S1394_TNF_SL_ATRESP_ERROR, "", tnf_string, msg, - "Unknown problem in s1394_send_response"); - } - TNF_PROBE_0_DEBUG(s1394_send_response_call_hal_cmplt, - S1394_TNF_SL_ATRESP_STACK, ""); - /* Free the command - Pass it back to the HAL */ HAL_CALL(hal).response_complete(hal->halinfo.hal_private, resp, h_priv); - TNF_PROBE_0_DEBUG(s1394_send_response_exit, - S1394_TNF_SL_ATRESP_STACK, ""); return (DDI_FAILURE); } - TNF_PROBE_0_DEBUG(s1394_send_response_exit, S1394_TNF_SL_ATRESP_STACK, - ""); return (DDI_SUCCESS); } @@ -1262,9 +1091,6 @@ s1394_compare_swap(s1394_hal_t *hal, s1394_target_t *target, cmd1394_cmd_t *cmd) int err; int ret; - TNF_PROBE_0_DEBUG(s1394_compare_swap_enter, S1394_TNF_SL_ATREQ_STACK, - ""); - ASSERT(MUTEX_NOT_HELD(&hal->topology_tree_mutex)); /* Lock the topology tree - protect from bus reset */ @@ -1284,10 +1110,6 @@ s1394_compare_swap(s1394_hal_t *hal, s1394_target_t *target, cmd1394_cmd_t *cmd) /* Copy error code into result */ cmd->cmd_result = err; - TNF_PROBE_0(s1394_compare_swap_error_in_setup_asynch, - S1394_TNF_SL_ATREQ_ERROR, ""); - TNF_PROBE_0_DEBUG(s1394_compare_swap_exit, - S1394_TNF_SL_ATREQ_STACK, ""); return (DDI_FAILURE); } @@ -1309,11 +1131,6 @@ s1394_compare_swap(s1394_hal_t *hal, s1394_target_t *target, cmd1394_cmd_t *cmd) cmd->cmd_result = CMD1394_EINVALID_CONTEXT; - TNF_PROBE_1(s1394_compare_swap_error, - S1394_TNF_SL_ATREQ_ERROR, "", tnf_string, - msg, "CMD1394_BLOCKING in bus reset ctxt"); - TNF_PROBE_0_DEBUG(s1394_compare_swap_exit, - S1394_TNF_SL_ATREQ_STACK, ""); return (DDI_FAILURE); } } @@ -1324,8 +1141,6 @@ s1394_compare_swap(s1394_hal_t *hal, s1394_target_t *target, cmd1394_cmd_t *cmd) /* Block (if necessary) */ s1394_block_on_asynch_cmd(cmd); - TNF_PROBE_0_DEBUG(t1394_write_exit, S1394_TNF_SL_ATREQ_STACK, - ""); return (DDI_SUCCESS); } mutex_exit(&hal->topology_tree_mutex); @@ -1342,8 +1157,6 @@ s1394_compare_swap(s1394_hal_t *hal, s1394_target_t *target, cmd1394_cmd_t *cmd) /* Block (if necessary) */ s1394_block_on_asynch_cmd(cmd); - TNF_PROBE_0_DEBUG(s1394_compare_swap_exit, - S1394_TNF_SL_ATREQ_STACK, ""); return (DDI_SUCCESS); } else { @@ -1355,18 +1168,12 @@ s1394_compare_swap(s1394_hal_t *hal, s1394_target_t *target, cmd1394_cmd_t *cmd) /* Copy error code into result */ cmd->cmd_result = err; - TNF_PROBE_0(s1394_compare_swap_error_in_xfer, - S1394_TNF_SL_ATREQ_ERROR, ""); - TNF_PROBE_0_DEBUG(s1394_compare_swap_exit, - S1394_TNF_SL_ATREQ_STACK, ""); return (DDI_FAILURE); } } else { /* Block (if necessary) */ s1394_block_on_asynch_cmd(cmd); - TNF_PROBE_0_DEBUG(s1394_compare_swap_exit, - S1394_TNF_SL_ATREQ_STACK, ""); return (DDI_SUCCESS); } } @@ -1385,18 +1192,11 @@ s1394_split_lock_req(s1394_hal_t *hal, s1394_target_t *target, s1394_cmd_priv_t *s_priv; cmd1394_cmd_t *tmp_cmd; - TNF_PROBE_0_DEBUG(s1394_split_lock_req_enter, - S1394_TNF_SL_ATREQ_STACK, ""); - /* Allocate a temporary command */ if (s1394_alloc_cmd(hal, T1394_ALLOC_CMD_NOSLEEP, &tmp_cmd) != DDI_SUCCESS) { cmd->cmd_result = CMD1394_EUNKNOWN_ERROR; - TNF_PROBE_0(s1394_split_lock_req_error_alloc_cmd, - S1394_TNF_SL_ATREQ_ERROR, ""); - TNF_PROBE_0_DEBUG(s1394_split_lock_req_exit, - S1394_TNF_SL_ATREQ_STACK, ""); return (DDI_FAILURE); } @@ -1442,16 +1242,12 @@ s1394_split_lock_req(s1394_hal_t *hal, s1394_target_t *target, if (s1394_free_cmd(hal, &tmp_cmd) != DDI_SUCCESS) cmd->cmd_result = CMD1394_EUNKNOWN_ERROR; - TNF_PROBE_0_DEBUG(s1394_split_lock_req_exit, - S1394_TNF_SL_ATREQ_STACK, ""); return (DDI_FAILURE); } /* Block (if necessary) */ s1394_block_on_asynch_cmd(cmd); - TNF_PROBE_0_DEBUG(s1394_split_lock_req_exit, - S1394_TNF_SL_ATREQ_STACK, ""); return (DDI_SUCCESS); } @@ -1473,10 +1269,6 @@ s1394_handle_lock(cmd1394_cmd_t *cmd) int tcmd_result; int ret; - - TNF_PROBE_0_DEBUG(s1394_handle_lock_enter, S1394_TNF_SL_ATREQ_STACK, - ""); - /* Get the Services Layer private area */ s_priv = S1394_GET_CMD_PRIV(cmd); @@ -1510,8 +1302,6 @@ lock_req_step_0: tcmd_result = cmd->cmd_result; goto lock_req_done; } else { - TNF_PROBE_0_DEBUG(s1394_handle_lock_exit, - S1394_TNF_SL_ATREQ_STACK, ""); return; } } else { @@ -1540,10 +1330,7 @@ lock_req_step_0: } lock_req_done: - if (s1394_free_cmd(to_hal, &cmd) != DDI_SUCCESS) { - TNF_PROBE_0(s1394_handle_lock_error_in_freecmd, - S1394_TNF_SL_ATREQ_ERROR, ""); - } + (void) s1394_free_cmd(to_hal, &cmd); /* Get the Services Layer private area */ s_priv = S1394_GET_CMD_PRIV(target_cmd); @@ -1560,17 +1347,12 @@ lock_req_done: cv_signal(&s_priv->blocking_cv); mutex_exit(&s_priv->blocking_mutex); - TNF_PROBE_0_DEBUG(s1394_handle_lock_exit, - S1394_TNF_SL_ATREQ_STACK, ""); return; } /* Call the target's completion_callback() */ if (target_cmd->completion_callback != NULL) target_cmd->completion_callback(target_cmd); - - TNF_PROBE_0_DEBUG(s1394_handle_lock_exit, - S1394_TNF_SL_ATREQ_STACK, ""); } /* @@ -1587,9 +1369,6 @@ s1394_pending_q_insert(s1394_hal_t *hal, cmd1394_cmd_t *cmd, uint_t flags) s1394_cmd_priv_t *s_priv; s1394_cmd_priv_t *c_priv; - TNF_PROBE_0_DEBUG(s1394_pending_q_insert_enter, - S1394_TNF_SL_ATREQ_STACK, ""); - mutex_enter(&hal->pending_q_mutex); /* Get the Services Layer private area */ @@ -1630,9 +1409,6 @@ s1394_pending_q_insert(s1394_hal_t *hal, cmd1394_cmd_t *cmd, uint_t flags) /* kstats - number of pending Q insertions */ hal->hal_kstats->pending_q_insert++; - - TNF_PROBE_0_DEBUG(s1394_pending_q_insert_exit, - S1394_TNF_SL_ATREQ_STACK, ""); } /* @@ -1648,16 +1424,11 @@ s1394_pending_q_remove(s1394_hal_t *hal) cmd1394_cmd_t *cmd; cmd1394_cmd_t *prev_cmd; - TNF_PROBE_0_DEBUG(s1394_pending_q_remove_enter, - S1394_TNF_SL_ATREQ_STACK, ""); - mutex_enter(&hal->pending_q_mutex); cmd = (cmd1394_cmd_t *)hal->pending_q_tail; if (cmd == NULL) { mutex_exit(&hal->pending_q_mutex); - TNF_PROBE_0_DEBUG(s1394_pending_q_remove_exit, - S1394_TNF_SL_ATREQ_STACK, ""); return (NULL); } @@ -1681,8 +1452,6 @@ s1394_pending_q_remove(s1394_hal_t *hal) mutex_exit(&hal->pending_q_mutex); - TNF_PROBE_0_DEBUG(s1394_pending_q_remove_exit, - S1394_TNF_SL_ATREQ_STACK, ""); return (cmd); } @@ -1696,9 +1465,6 @@ s1394_resend_pending_cmds(s1394_hal_t *hal) { int done; - TNF_PROBE_0_DEBUG(s1394_resend_pending_cmds_enter, - S1394_TNF_SL_BR_STACK, ""); - ASSERT(MUTEX_NOT_HELD(&hal->topology_tree_mutex)); do { @@ -1706,9 +1472,6 @@ s1394_resend_pending_cmds(s1394_hal_t *hal) } while (done == B_FALSE); ASSERT(MUTEX_NOT_HELD(&hal->topology_tree_mutex)); - - TNF_PROBE_0_DEBUG(s1394_resend_pending_cmds_exit, - S1394_TNF_SL_BR_STACK, ""); } /* @@ -1733,17 +1496,12 @@ s1394_process_pending_q(s1394_hal_t *hal) uint_t current_max_payload; int ret; - TNF_PROBE_0_DEBUG(s1394_process_pending_q_enter, - S1394_TNF_SL_BR_STACK, ""); - ASSERT(MUTEX_NOT_HELD(&hal->topology_tree_mutex)); /* Pull a command from the Pending Q */ cmd = s1394_pending_q_remove(hal); if (cmd == NULL) { - TNF_PROBE_0_DEBUG(s1394_process_pending_q_exit, - S1394_TNF_SL_BR_STACK, ""); return (B_TRUE); } @@ -1772,8 +1530,6 @@ s1394_process_pending_q(s1394_hal_t *hal) cv_signal(&s_priv->blocking_cv); mutex_exit(&s_priv->blocking_mutex); - TNF_PROBE_0_DEBUG(s1394_process_pending_q_exit, - S1394_TNF_SL_BR_STACK, ""); return (B_FALSE); } @@ -1782,8 +1538,6 @@ s1394_process_pending_q(s1394_hal_t *hal) cmd->completion_callback(cmd); } - TNF_PROBE_0_DEBUG(s1394_process_pending_q_exit, - S1394_TNF_SL_BR_STACK, ""); return (B_FALSE); } } else { @@ -1829,10 +1583,6 @@ s1394_process_pending_q(s1394_hal_t *hal) cv_signal(&s_priv->blocking_cv); mutex_exit(&s_priv->blocking_mutex); - TNF_PROBE_0_DEBUG( - s1394_process_pending_q_exit, - S1394_TNF_SL_BR_STACK, - ""); return (B_FALSE); } @@ -1840,15 +1590,9 @@ s1394_process_pending_q(s1394_hal_t *hal) if (cmd->completion_callback != NULL) { s1394_unlock_tree(hal); cmd->completion_callback(cmd); - TNF_PROBE_0_DEBUG( - s1394_process_pending_q_exit, - S1394_TNF_SL_BR_STACK, ""); return (B_FALSE); } else { s1394_unlock_tree(hal); - TNF_PROBE_0_DEBUG( - s1394_process_pending_q_exit, - S1394_TNF_SL_BR_STACK, ""); return (B_FALSE); } } @@ -1914,8 +1658,6 @@ s1394_process_pending_q(s1394_hal_t *hal) } s1394_unlock_tree(hal); ret = s1394_pending_q_helper(hal, cmd); - TNF_PROBE_0_DEBUG(s1394_process_pending_q_exit, - S1394_TNF_SL_BR_STACK, ""); return (ret); } } @@ -1933,9 +1675,6 @@ s1394_pending_q_helper(s1394_hal_t *hal, cmd1394_cmd_t *cmd) int err; int ret; - TNF_PROBE_0_DEBUG(s1394_pending_q_helper_enter, - S1394_TNF_SL_BR_STACK, ""); - ASSERT(MUTEX_NOT_HELD(&hal->topology_tree_mutex)); /* Get the Services Layer private area */ @@ -1953,8 +1692,6 @@ s1394_pending_q_helper(s1394_hal_t *hal, cmd1394_cmd_t *cmd) s1394_remove_q_asynch_cmd(hal, cmd); s1394_pending_q_insert(hal, cmd, S1394_PENDING_Q_FRONT); - TNF_PROBE_0_DEBUG(s1394_pending_q_helper_exit, - S1394_TNF_SL_BR_STACK, ""); return (B_TRUE); } else { /* Remove cmd from outstanding request Q */ @@ -1972,27 +1709,19 @@ s1394_pending_q_helper(s1394_hal_t *hal, cmd1394_cmd_t *cmd) cv_signal(&s_priv->blocking_cv); mutex_exit(&s_priv->blocking_mutex); - TNF_PROBE_0_DEBUG(s1394_pending_q_helper_exit, - S1394_TNF_SL_BR_STACK, ""); return (B_FALSE); } /* Call target completion_callback() */ if (cmd->completion_callback != NULL) { cmd->completion_callback(cmd); - TNF_PROBE_0_DEBUG(s1394_pending_q_helper_exit, - S1394_TNF_SL_BR_STACK, ""); return (B_FALSE); } else { - TNF_PROBE_0_DEBUG(s1394_pending_q_helper_exit, - S1394_TNF_SL_BR_STACK, ""); return (B_FALSE); } } } - TNF_PROBE_0_DEBUG(s1394_pending_q_helper_exit, - S1394_TNF_SL_BR_STACK, ""); return (B_FALSE); } @@ -2016,9 +1745,6 @@ s1394_process_split_lock(cmd1394_cmd_t *cmd, cmd1394_cmd_t *target_cmd) uint32_t old_value32; uint32_t temp_value32; - TNF_PROBE_0_DEBUG(s1394_process_split_lock_enter, - S1394_TNF_SL_ATREQ_STACK, ""); - if (cmd->cmd_type == CMD1394_ASYNCH_LOCK_32) { old_value32 = cmd->cmd_u.l32.old_value; data_value32 = target_cmd->cmd_u.l32.data_value; @@ -2078,9 +1804,6 @@ s1394_process_split_lock(cmd1394_cmd_t *cmd, cmd1394_cmd_t *target_cmd) target_cmd->cmd_u.l32.old_value = T1394_DATA32(cmd->cmd_u.l32.old_value); target_cmd->cmd_result = CMD1394_CMDSUCCESS; - TNF_PROBE_0_DEBUG( - s1394_process_split_lock_exit, - S1394_TNF_SL_ATREQ_STACK, ""); return (DDI_FAILURE); } break; @@ -2097,9 +1820,6 @@ s1394_process_split_lock(cmd1394_cmd_t *cmd, cmd1394_cmd_t *target_cmd) target_cmd->cmd_u.l32.old_value = T1394_DATA32(cmd->cmd_u.l32.old_value); target_cmd->cmd_result = CMD1394_CMDSUCCESS; - TNF_PROBE_0_DEBUG( - s1394_process_split_lock_exit, - S1394_TNF_SL_ATREQ_STACK, ""); return (DDI_FAILURE); } break; @@ -2189,9 +1909,6 @@ s1394_process_split_lock(cmd1394_cmd_t *cmd, cmd1394_cmd_t *target_cmd) target_cmd->cmd_u.l64.old_value = T1394_DATA64(cmd->cmd_u.l64.old_value); target_cmd->cmd_result = CMD1394_CMDSUCCESS; - TNF_PROBE_0_DEBUG( - s1394_process_split_lock_exit, - S1394_TNF_SL_ATREQ_STACK, ""); return (DDI_FAILURE); } break; @@ -2208,9 +1925,6 @@ s1394_process_split_lock(cmd1394_cmd_t *cmd, cmd1394_cmd_t *target_cmd) target_cmd->cmd_u.l64.old_value = T1394_DATA64(cmd->cmd_u.l64.old_value); target_cmd->cmd_result = CMD1394_CMDSUCCESS; - TNF_PROBE_0_DEBUG( - s1394_process_split_lock_exit, - S1394_TNF_SL_ATREQ_STACK, ""); return (DDI_FAILURE); } break; @@ -2243,8 +1957,6 @@ s1394_process_split_lock(cmd1394_cmd_t *cmd, cmd1394_cmd_t *target_cmd) cmd->cmd_u.l64.data_value = new_value64; } - TNF_PROBE_0_DEBUG(s1394_process_split_lock_exit, - S1394_TNF_SL_ATREQ_STACK, ""); return (DDI_SUCCESS); } @@ -2260,9 +1972,6 @@ s1394_finish_split_lock(cmd1394_cmd_t *cmd, cmd1394_cmd_t *target_cmd) uint64_t tmp_value64; uint32_t tmp_value32; - TNF_PROBE_0_DEBUG(s1394_finish_split_lock_enter, - S1394_TNF_SL_ATREQ_STACK, ""); - /* Get the Services Layer private area */ s_priv = S1394_GET_CMD_PRIV(cmd); @@ -2312,8 +2021,6 @@ s1394_finish_split_lock(cmd1394_cmd_t *cmd, cmd1394_cmd_t *target_cmd) } /* Set status */ target_cmd->cmd_result = CMD1394_CMDSUCCESS; - TNF_PROBE_0_DEBUG(s1394_finish_split_lock_exit, - S1394_TNF_SL_ATREQ_STACK, ""); return (DDI_SUCCESS); } else { if (s_priv->temp_num_retries > 0) { @@ -2323,17 +2030,11 @@ s1394_finish_split_lock(cmd1394_cmd_t *cmd, cmd1394_cmd_t *target_cmd) /* Reset lock_req_step */ s_priv->lock_req_step = 0; - TNF_PROBE_0_DEBUG(s1394_finish_split_lock_start_over, - S1394_TNF_SL_ATREQ_STACK, ""); /* Resend... start at step 0 again */ - TNF_PROBE_0_DEBUG(s1394_finish_split_lock_exit, - S1394_TNF_SL_ATREQ_STACK, ""); return (DDI_FAILURE); } else { /* Failed... RETRIES_EXCEEDED */ target_cmd->cmd_result = CMD1394_ERETRIES_EXCEEDED; - TNF_PROBE_0_DEBUG(s1394_finish_split_lock_exit, - S1394_TNF_SL_ATREQ_STACK, ""); return (DDI_SUCCESS); } } diff --git a/usr/src/uts/common/io/1394/s1394_bus_reset.c b/usr/src/uts/common/io/1394/s1394_bus_reset.c index 70d95f8031..274625d04e 100644 --- a/usr/src/uts/common/io/1394/s1394_bus_reset.c +++ b/usr/src/uts/common/io/1394/s1394_bus_reset.c @@ -24,8 +24,6 @@ * All rights reserved. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * s1394_bus_reset.c * 1394 Services Layer Bus Reset Routines @@ -37,8 +35,6 @@ #include <sys/sunddi.h> #include <sys/types.h> #include <sys/kmem.h> -#include <sys/tnf_probe.h> - #include <sys/1394/t1394.h> #include <sys/1394/s1394.h> #include <sys/1394/h1394.h> @@ -94,18 +90,11 @@ s1394_parse_selfid_buffer(s1394_hal_t *hal, void *selfid_buf_addr, boolean_t error = B_FALSE; int valid_pkt_id; - TNF_PROBE_0_DEBUG(s1394_parse_selfid_buffer_enter, - S1394_TNF_SL_BR_STACK, ""); - ASSERT(MUTEX_HELD(&hal->topology_tree_mutex)); data = (uint32_t *)selfid_buf_addr; if (selfid_size == 0) { - TNF_PROBE_1(s1394_parse_selfid_buffer_error, - S1394_TNF_SL_BR_ERROR, "", tnf_string, msg, - "SelfID buffer error - zero size"); - /* Initiate a bus reset */ s1394_initiate_hal_reset(hal, CRITICAL); @@ -147,12 +136,6 @@ s1394_parse_selfid_buffer(s1394_hal_t *hal, void *selfid_buf_addr, IEEE1394_SELFID_PCKT_ID_VALID)) { j += 2; } else { - TNF_PROBE_1( - s1394_parse_selfid_buffer_error, - S1394_TNF_SL_BR_ERROR, "", - tnf_string, msg, "SelfID packet " - "error - invalid inverse"); - /* Initiate a bus reset */ s1394_initiate_hal_reset(hal, CRITICAL); @@ -165,10 +148,6 @@ s1394_parse_selfid_buffer(s1394_hal_t *hal, void *selfid_buf_addr, } i++; } else { - TNF_PROBE_1(s1394_parse_selfid_buffer_error, - S1394_TNF_SL_BR_ERROR, "", tnf_string, msg, - "SelfID packet error - invalid inverse"); - /* Initiate a bus reset */ s1394_initiate_hal_reset(hal, CRITICAL); @@ -183,8 +162,6 @@ s1394_parse_selfid_buffer(s1394_hal_t *hal, void *selfid_buf_addr, hal->number_of_nodes = i; parse_buffer_done: - TNF_PROBE_0_DEBUG(s1394_parse_selfid_buffer_exit, - S1394_TNF_SL_BR_STACK, ""); if (error == B_TRUE) return (DDI_FAILURE); else @@ -204,8 +181,6 @@ s1394_sort_selfids(s1394_hal_t *hal) int i; int j; - TNF_PROBE_0_DEBUG(s1394_sort_selfids_enter, S1394_TNF_SL_BR_STACK, ""); - ASSERT(MUTEX_HELD(&hal->topology_tree_mutex)); number_of_nodes = hal->number_of_nodes; @@ -267,8 +242,6 @@ s1394_sort_selfids(s1394_hal_t *hal) } } } - - TNF_PROBE_0_DEBUG(s1394_sort_selfids_exit, S1394_TNF_SL_BR_STACK, ""); } /* @@ -334,13 +307,6 @@ selfid_port_type(s1394_selfid_pkt_t *s, int port) int block; int offset = IEEE1394_SELFID_PORT_OFFSET_FIRST; - if (port > selfid_num_ports(s)) { - TNF_PROBE_1(selfid_port_type_error, - "1394 s1394 error", - "Invalid port number requested for node", - tnf_uint, node_num, IEEE1394_SELFID_PHYID(s)); - } - if (port > 2) { /* Calculate which quadlet and bits for this port */ port -= 3; @@ -375,9 +341,6 @@ s1394_init_topology_tree(s1394_hal_t *hal, boolean_t copied, uint_t tree_size; int i; - TNF_PROBE_0_DEBUG(s1394_init_topology_tree_enter, - S1394_TNF_SL_BR_STACK, ""); - ASSERT(MUTEX_HELD(&hal->topology_tree_mutex)); /* @@ -399,18 +362,8 @@ s1394_init_topology_tree(s1394_hal_t *hal, boolean_t copied, config_rom = node->cfgrom; if (config_rom != NULL) { if (CFGROM_NEW_ALLOC(node) == B_TRUE) { - TNF_PROBE_2_DEBUG( - s1394_init_top_tree_free_cfgrom, - S1394_TNF_SL_BR_STACK, - "cfgrom free", tnf_int, node_num, i, - tnf_opaque, cfgrom, config_rom); kmem_free((void *)config_rom, IEEE1394_CONFIG_ROM_SZ); - } else { - TNF_PROBE_2_DEBUG(s1394_init_top_tree, - S1394_TNF_SL_BR_STACK, "", - tnf_int, node_num, i, - tnf_opaque, cfgrom, config_rom); } } } @@ -418,9 +371,6 @@ s1394_init_topology_tree(s1394_hal_t *hal, boolean_t copied, tree_size = hal->number_of_nodes * sizeof (s1394_node_t); bzero((void *)hal->topology_tree, tree_size); - - TNF_PROBE_0_DEBUG(s1394_init_topology_tree_exit, - S1394_TNF_SL_BR_STACK, ""); } /* @@ -447,9 +397,6 @@ s1394_topology_tree_build(s1394_hal_t *hal) * nodes which have yet to find their Parent node. */ - TNF_PROBE_0_DEBUG(s1394_topology_tree_build_enter, - S1394_TNF_SL_BR_STACK, ""); - ASSERT(MUTEX_HELD(&hal->topology_tree_mutex)); number_of_nodes = hal->number_of_nodes; @@ -461,15 +408,9 @@ s1394_topology_tree_build(s1394_hal_t *hal) for (i = 0; i < number_of_nodes; i++) { /* Make sure that node numbers are correct */ if (i != IEEE1394_SELFID_PHYID(hal->selfid_ptrs[i])) { - TNF_PROBE_1(s1394_topology_tree_build_error, - S1394_TNF_SL_BR_ERROR, "", tnf_string, msg, - "SelfIDs - Invalid node numbering"); - /* Initiate a bus reset */ s1394_initiate_hal_reset(hal, CRITICAL); - TNF_PROBE_0_DEBUG(s1394_topology_tree_build_exit, - S1394_TNF_SL_BR_STACK, ""); return (DDI_FAILURE); } @@ -504,18 +445,9 @@ s1394_topology_tree_build(s1394_hal_t *hal) found_parent = B_TRUE; } else { - TNF_PROBE_1( - s1394_topology_tree_build_error, - S1394_TNF_SL_BR_ERROR, "", - tnf_string, msg, "SelfID packet - " - "Has multiple parents"); - /* Initiate a bus reset */ s1394_initiate_hal_reset(hal, CRITICAL); - TNF_PROBE_0_DEBUG( - s1394_topology_tree_build_exit, - S1394_TNF_SL_BR_STACK, ""); return (DDI_FAILURE); } } else if (selfid_port_type(hal->selfid_ptrs[i], j) == @@ -524,18 +456,9 @@ s1394_topology_tree_build(s1394_hal_t *hal) found_connection = B_TRUE; tmp = (s1394_node_t *)s1394_hal_stack_pop(hal); if (tmp == NULL) { - TNF_PROBE_1( - s1394_topology_tree_build_error, - S1394_TNF_SL_BR_ERROR, "", - tnf_string, msg, "Topology Tree " - "invalid - Tree build failed"); - /* Initiate a bus reset */ s1394_initiate_hal_reset(hal, CRITICAL); - TNF_PROBE_0_DEBUG( - s1394_topology_tree_build_exit, - S1394_TNF_SL_BR_STACK, ""); return (DDI_FAILURE); } @@ -548,15 +471,9 @@ s1394_topology_tree_build(s1394_hal_t *hal) /* If current node has no parents or children - Invalid */ if ((found_connection == B_FALSE) && (number_of_nodes > 1)) { - TNF_PROBE_1(s1394_topology_tree_build_error, - S1394_TNF_SL_BR_ERROR, "", tnf_string, msg, - "SelfID packet - Has no connections"); - /* Initiate a bus reset */ s1394_initiate_hal_reset(hal, CRITICAL); - TNF_PROBE_0_DEBUG(s1394_topology_tree_build_exit, - S1394_TNF_SL_BR_STACK, ""); return (DDI_FAILURE); } @@ -569,23 +486,15 @@ s1394_topology_tree_build(s1394_hal_t *hal) /* If the stack is not empty, then something has gone seriously wrong */ if (hal->hal_stack_depth != -1) { - TNF_PROBE_1(s1394_topology_tree_build_error, - S1394_TNF_SL_BR_ERROR, "", tnf_string, msg, - "Topology Tree invalid - Tree build failed"); - /* Initiate a bus reset */ s1394_initiate_hal_reset(hal, CRITICAL); - TNF_PROBE_0_DEBUG(s1394_topology_tree_build_exit, - S1394_TNF_SL_BR_STACK, ""); return (DDI_FAILURE); } /* New topology tree is now valid */ hal->topology_tree_valid = B_TRUE; - TNF_PROBE_0_DEBUG(s1394_topology_tree_build_exit, - S1394_TNF_SL_BR_STACK, ""); return (DDI_SUCCESS); } @@ -598,23 +507,10 @@ s1394_topology_tree_build(s1394_hal_t *hal) static void s1394_hal_stack_push(s1394_hal_t *hal, void *obj) { - TNF_PROBE_0_DEBUG(s1394_hal_stack_push_enter, - S1394_TNF_SL_BR_STACK, ""); - if (hal->hal_stack_depth < IEEE1394_MAX_NODES - 1) { hal->hal_stack_depth++; hal->hal_stack[hal->hal_stack_depth] = obj; - } else { - TNF_PROBE_1(s1394_hal_stack_push_error, - S1394_TNF_SL_BR_ERROR, "", tnf_string, msg, - "HAL stack - Overflow"); - TNF_PROBE_0_DEBUG(s1394_hal_stack_push_exit, - S1394_TNF_SL_BR_STACK, ""); - return; } - - TNF_PROBE_0_DEBUG(s1394_hal_stack_push_exit, - S1394_TNF_SL_BR_STACK, ""); } /* @@ -626,21 +522,11 @@ s1394_hal_stack_push(s1394_hal_t *hal, void *obj) static void * s1394_hal_stack_pop(s1394_hal_t *hal) { - TNF_PROBE_0_DEBUG(s1394_hal_stack_pop_enter, - S1394_TNF_SL_BR_STACK, ""); - if (hal->hal_stack_depth > -1) { hal->hal_stack_depth--; - TNF_PROBE_0_DEBUG(s1394_hal_stack_pop_exit, - S1394_TNF_SL_BR_STACK, ""); return (hal->hal_stack[hal->hal_stack_depth + 1]); } else { - TNF_PROBE_1(s1394_hal_stack_pop_error, - S1394_TNF_SL_BR_ERROR, "", tnf_string, msg, - "HAL stack - Underflow"); - TNF_PROBE_0_DEBUG(s1394_hal_stack_pop_exit, - S1394_TNF_SL_BR_STACK, ""); return (NULL); } } @@ -654,26 +540,14 @@ s1394_hal_stack_pop(s1394_hal_t *hal) static void s1394_hal_queue_insert(s1394_hal_t *hal, void *obj) { - TNF_PROBE_0_DEBUG(s1394_hal_queue_insert_enter, - S1394_TNF_SL_BR_STACK, ""); - if (((hal->hal_queue_front + 1) % IEEE1394_MAX_NODES) == hal->hal_queue_back) { - TNF_PROBE_1(s1394_hal_queue_insert_error, - S1394_TNF_SL_BR_ERROR, "", tnf_string, msg, - "HAL Queue - Overflow"); - TNF_PROBE_0_DEBUG(s1394_hal_queue_insert_exit, - S1394_TNF_SL_BR_STACK, ""); return; - } else { hal->hal_queue[hal->hal_queue_front] = obj; hal->hal_queue_front = (hal->hal_queue_front + 1) % IEEE1394_MAX_NODES; } - - TNF_PROBE_0_DEBUG(s1394_hal_queue_insert_exit, - S1394_TNF_SL_BR_STACK, ""); } @@ -688,23 +562,12 @@ s1394_hal_queue_remove(s1394_hal_t *hal) { void *tmp; - TNF_PROBE_0_DEBUG(s1394_hal_queue_remove_enter, - S1394_TNF_SL_BR_STACK, ""); - if (hal->hal_queue_back == hal->hal_queue_front) { - TNF_PROBE_1(s1394_hal_queue_remove_error, - S1394_TNF_SL_BR_ERROR, "", tnf_string, msg, - "HAL Queue - Underflow"); - TNF_PROBE_0_DEBUG(s1394_hal_queue_remove_exit, - S1394_TNF_SL_BR_STACK, ""); return (NULL); - } else { tmp = hal->hal_queue[hal->hal_queue_back]; hal->hal_queue_back = (hal->hal_queue_back + 1) % IEEE1394_MAX_NODES; - TNF_PROBE_0_DEBUG(s1394_hal_queue_remove_exit, - S1394_TNF_SL_BR_STACK, ""); return (tmp); } } @@ -720,23 +583,12 @@ s1394_hal_queue_remove(s1394_hal_t *hal) static void s1394_node_number_list_add(s1394_hal_t *hal, int node_num) { - TNF_PROBE_1_DEBUG(s1394_node_number_list_add_enter, - S1394_TNF_SL_BR_STACK, "", tnf_int, node_num, node_num); - if (hal->hal_node_number_list_size >= IEEE1394_MAX_NODES - 1) { - TNF_PROBE_1(s1394_node_number_list_add_error, - S1394_TNF_SL_BR_ERROR, "", tnf_string, msg, - "Node Number List - Overflow"); - TNF_PROBE_0_DEBUG(s1394_node_number_list_add_exit, - S1394_TNF_SL_BR_STACK, ""); return; } hal->hal_node_number_list[hal->hal_node_number_list_size] = node_num; hal->hal_node_number_list_size++; - - TNF_PROBE_0_DEBUG(s1394_node_number_list_add_exit, - S1394_TNF_SL_BR_STACK, ""); } /* @@ -750,17 +602,11 @@ s1394_topology_tree_mark_all_unvisited(s1394_hal_t *hal) uint_t number_of_nodes; int i; - TNF_PROBE_0_DEBUG(s1394_topology_tree_mark_all_unvisited_enter, - S1394_TNF_SL_BR_STACK, ""); - ASSERT(MUTEX_HELD(&hal->topology_tree_mutex)); number_of_nodes = hal->number_of_nodes; for (i = 0; i < number_of_nodes; i++) CLEAR_NODE_VISITED(&hal->topology_tree[i]); - - TNF_PROBE_0_DEBUG(s1394_topology_tree_mark_all_unvisited_exit, - S1394_TNF_SL_BR_STACK, ""); } /* @@ -774,17 +620,11 @@ s1394_old_tree_mark_all_unvisited(s1394_hal_t *hal) uint_t number_of_nodes; int i; - TNF_PROBE_0_DEBUG(s1394_old_tree_mark_all_unvisited_enter, - S1394_TNF_SL_BR_STACK, ""); - ASSERT(MUTEX_HELD(&hal->topology_tree_mutex)); number_of_nodes = hal->old_number_of_nodes; for (i = 0; i < number_of_nodes; i++) CLEAR_NODE_VISITED(&hal->old_tree[i]); - - TNF_PROBE_0_DEBUG(s1394_old_tree_mark_all_unvisited_exit, - S1394_TNF_SL_BR_STACK, ""); } /* @@ -798,18 +638,12 @@ s1394_old_tree_mark_all_unmatched(s1394_hal_t *hal) uint_t number_of_nodes; int i; - TNF_PROBE_0_DEBUG(s1394_old_tree_mark_all_unmatched_enter, - S1394_TNF_SL_BR_STACK, ""); - ASSERT(MUTEX_HELD(&hal->topology_tree_mutex)); number_of_nodes = hal->old_number_of_nodes; for (i = 0; i < number_of_nodes; i++) CLEAR_NODE_MATCHED(&hal->old_tree[i]); - - TNF_PROBE_0_DEBUG(s1394_old_tree_mark_all_unmatched_exit, - S1394_TNF_SL_BR_STACK, ""); } /* @@ -821,9 +655,6 @@ s1394_copy_old_tree(s1394_hal_t *hal) { s1394_node_t *temp; - TNF_PROBE_0_DEBUG(s1394_copy_old_tree_enter, - S1394_TNF_SL_BR_STACK, ""); - ASSERT(MUTEX_HELD(&hal->topology_tree_mutex)); temp = hal->old_tree; @@ -836,9 +667,6 @@ s1394_copy_old_tree(s1394_hal_t *hal) /* Old tree is now valid and filled also */ hal->old_tree_valid = B_TRUE; - - TNF_PROBE_0_DEBUG(s1394_copy_old_tree_exit, - S1394_TNF_SL_BR_STACK, ""); } @@ -863,9 +691,6 @@ s1394_match_tree_nodes(s1394_hal_t *hal) int i; int port_type; - TNF_PROBE_0_DEBUG(s1394_match_tree_nodes_enter, - S1394_TNF_SL_BR_STACK, ""); - ASSERT(MUTEX_HELD(&hal->topology_tree_mutex)); /* To ensure that the queue is empty */ @@ -938,9 +763,6 @@ s1394_match_tree_nodes(s1394_hal_t *hal) } } } - - TNF_PROBE_0_DEBUG(s1394_match_tree_nodes_exit, - S1394_TNF_SL_BR_STACK, ""); } /* @@ -963,9 +785,6 @@ s1394_topology_tree_calculate_diameter(s1394_hal_t *hal) int diameter = 0; int local_diameter = 0; - TNF_PROBE_0_DEBUG(s1394_topology_tree_calculate_diameter_enter, - S1394_TNF_SL_BR_STACK, ""); - ASSERT(MUTEX_HELD(&hal->topology_tree_mutex)); number_of_nodes = hal->number_of_nodes; @@ -1028,8 +847,6 @@ s1394_topology_tree_calculate_diameter(s1394_hal_t *hal) } } while (done == B_FALSE); - TNF_PROBE_0_DEBUG(s1394_topology_tree_calculate_diameter_exit, - S1394_TNF_SL_BR_STACK, ""); return (diameter); } @@ -1063,9 +880,6 @@ s1394_get_current_gap_count(s1394_hal_t *hal) int i; int gap_count = -1; - TNF_PROBE_0_DEBUG(s1394_get_current_gap_count_enter, - S1394_TNF_SL_BR_STACK, ""); - ASSERT(MUTEX_HELD(&hal->topology_tree_mutex)); /* Grab the first gap_count in the SelfID packets */ @@ -1077,23 +891,15 @@ s1394_get_current_gap_count(s1394_hal_t *hal) IEEE1394_SELFID_GAP_CNT(hal->selfid_ptrs[i])) { /* Inconsistent gap counts */ - TNF_PROBE_1(s1394_get_current_gap_count_error, - S1394_TNF_SL_BR_ERROR, "", tnf_string, msg, - "Inconsistent gap count"); - if (s1394_ignore_invalid_gap_cnt == 0) { /* Initiate a bus reset */ s1394_initiate_hal_reset(hal, CRITICAL); } - TNF_PROBE_0_DEBUG(s1394_get_current_gap_count_exit, - S1394_TNF_SL_BR_STACK, ""); return (-1); } } - TNF_PROBE_0_DEBUG(s1394_get_current_gap_count_exit, - S1394_TNF_SL_BR_STACK, ""); return (gap_count); } @@ -1122,9 +928,6 @@ s1394_speed_map_fill(s1394_hal_t *hal) int j; int node_num; - TNF_PROBE_0_DEBUG(s1394_speed_map_fill_enter, - S1394_TNF_SL_BR_STACK, ""); - ASSERT(MUTEX_HELD(&hal->topology_tree_mutex)); number_of_nodes = hal->number_of_nodes; @@ -1156,9 +959,6 @@ s1394_speed_map_fill(s1394_hal_t *hal) hal->speed_map[i][i] = selfid_speed(hal->topology_tree[i].selfid_packet); } - - TNF_PROBE_0_DEBUG(s1394_speed_map_fill_exit, - S1394_TNF_SL_BR_STACK, ""); } /* @@ -1179,9 +979,6 @@ s1394_speed_map_fill_speed_N(s1394_hal_t *hal, int min_spd) int size; int ix_a, ix_b; - TNF_PROBE_0_DEBUG(s1394_speed_map_fill_speed_N_enter, - S1394_TNF_SL_BR_STACK, ""); - ASSERT(MUTEX_HELD(&hal->topology_tree_mutex)); number_of_nodes = hal->number_of_nodes; @@ -1246,9 +1043,6 @@ s1394_speed_map_fill_speed_N(s1394_hal_t *hal, int min_spd) hal->hal_node_number_list_size = 0; } } - - TNF_PROBE_0_DEBUG(s1394_speed_map_fill_speed_N_exit, - S1394_TNF_SL_BR_STACK, ""); } /* @@ -1263,9 +1057,6 @@ s1394_speed_map_initialize(s1394_hal_t *hal) uint_t number_of_nodes; int i, j; - TNF_PROBE_0_DEBUG(s1394_speed_map_initialize_enter, - S1394_TNF_SL_BR_STACK, ""); - ASSERT(MUTEX_HELD(&hal->topology_tree_mutex)); number_of_nodes = hal->number_of_nodes; @@ -1277,9 +1068,6 @@ s1394_speed_map_initialize(s1394_hal_t *hal) hal->speed_map[i][j] = SPEED_MAP_INVALID; } } - - TNF_PROBE_0_DEBUG(s1394_speed_map_initialize_exit, - S1394_TNF_SL_BR_STACK, ""); } /* @@ -1313,9 +1101,6 @@ s1394_update_speed_map_link_speeds(s1394_hal_t *hal) uint_t number_of_nodes; int i, j; - TNF_PROBE_0_DEBUG(s1394_update_speed_map_link_speeds_enter, - S1394_TNF_SL_BR_STACK, ""); - ASSERT(MUTEX_HELD(&hal->topology_tree_mutex)); number_of_nodes = hal->number_of_nodes; @@ -1353,9 +1138,6 @@ s1394_update_speed_map_link_speeds(s1394_hal_t *hal) } } } - - TNF_PROBE_0_DEBUG(s1394_update_speed_map_link_speeds_exit, - S1394_TNF_SL_BR_STACK, ""); } /* @@ -1370,25 +1152,17 @@ s1394_get_isoch_rsrc_mgr(s1394_hal_t *hal) { int i; - TNF_PROBE_0_DEBUG(s1394_get_isoch_rsrc_mgr_enter, S1394_TNF_SL_BR_STACK, - ""); - ASSERT(MUTEX_HELD(&hal->topology_tree_mutex)); for (i = hal->number_of_nodes - 1; i >= 0; i--) { /* Highest numbered node with L=1 and C=1 */ if ((IEEE1394_SELFID_ISLINKON(hal->selfid_ptrs[i])) && (IEEE1394_SELFID_ISCONTENDER(hal->selfid_ptrs[i]))) { - - TNF_PROBE_0_DEBUG(s1394_get_isoch_rsrc_mgr_exit, - S1394_TNF_SL_BR_STACK, ""); return (i); } } /* No Isochronous Resource Manager */ - TNF_PROBE_0_DEBUG(s1394_get_isoch_rsrc_mgr_exit, S1394_TNF_SL_BR_STACK, - ""); return (-1); } @@ -1407,9 +1181,6 @@ s1394_physical_arreq_setup_all(s1394_hal_t *hal) uint32_t node_num; uint_t generation; - TNF_PROBE_0_DEBUG(s1394_physical_arreq_setup_all_enter, - S1394_TNF_SL_BR_STACK, ""); - ASSERT(MUTEX_NOT_HELD(&hal->topology_tree_mutex)); mutex_enter(&hal->topology_tree_mutex); @@ -1436,9 +1207,6 @@ s1394_physical_arreq_setup_all(s1394_hal_t *hal) */ (void) HAL_CALL(hal).physical_arreq_enable_set( hal->halinfo.hal_private, mask, generation); - - TNF_PROBE_0_DEBUG(s1394_physical_arreq_setup_all_exit, - S1394_TNF_SL_BR_STACK, ""); } /* @@ -1455,9 +1223,6 @@ s1394_physical_arreq_set_one(s1394_target_t *target) uint32_t node_num; uint_t generation; - TNF_PROBE_0_DEBUG(s1394_physical_arreq_set_one_enter, - S1394_TNF_SL_STACK, ""); - /* Find the HAL this target resides on */ hal = target->on_hal; @@ -1488,9 +1253,6 @@ s1394_physical_arreq_set_one(s1394_target_t *target) rw_exit(&hal->target_list_rwlock); mutex_exit(&hal->topology_tree_mutex); } - - TNF_PROBE_0_DEBUG(s1394_physical_arreq_set_one_exit, - S1394_TNF_SL_STACK, ""); } /* @@ -1507,9 +1269,6 @@ s1394_physical_arreq_clear_one(s1394_target_t *target) uint32_t node_num; uint_t generation; - TNF_PROBE_0_DEBUG(s1394_physical_arreq_clear_one_enter, - S1394_TNF_SL_STACK, ""); - /* Find the HAL this target resides on */ hal = target->on_hal; @@ -1540,10 +1299,6 @@ s1394_physical_arreq_clear_one(s1394_target_t *target) rw_exit(&hal->target_list_rwlock); mutex_exit(&hal->topology_tree_mutex); } - - - TNF_PROBE_0_DEBUG(s1394_physical_arreq_clear_one_exit, - S1394_TNF_SL_STACK, ""); } /* @@ -1554,13 +1309,7 @@ s1394_physical_arreq_clear_one(s1394_target_t *target) s1394_node_t * s1394_topology_tree_get_root_node(s1394_hal_t *hal) { - TNF_PROBE_0_DEBUG(s1394_topology_tree_get_root_node_enter, - S1394_TNF_SL_STACK, ""); - ASSERT(MUTEX_HELD(&hal->topology_tree_mutex)); - TNF_PROBE_0_DEBUG(s1394_topology_tree_get_root_node_exit, - S1394_TNF_SL_STACK, ""); - return (&hal->topology_tree[hal->number_of_nodes - 1]); } diff --git a/usr/src/uts/common/io/1394/s1394_cmp.c b/usr/src/uts/common/io/1394/s1394_cmp.c index 05944d7379..3168b440bb 100644 --- a/usr/src/uts/common/io/1394/s1394_cmp.c +++ b/usr/src/uts/common/io/1394/s1394_cmp.c @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * s1394_cmp.c * 1394 Services Layer Connection Management Procedures Support Routines @@ -37,8 +35,6 @@ #include <sys/cmn_err.h> #include <sys/types.h> #include <sys/kmem.h> -#include <sys/tnf_probe.h> - #include <sys/1394/t1394.h> #include <sys/1394/s1394.h> #include <sys/1394/h1394.h> @@ -90,8 +86,6 @@ s1394_cmp_register(s1394_target_t *target, t1394_cmp_evts_t *evts) s1394_hal_t *hal = target->on_hal; static t1394_cmp_evts_t default_evts = { NULL, NULL }; - TNF_PROBE_0_DEBUG(s1394_cmp_register_enter, S1394_TNF_SL_CMP_STACK, ""); - rw_enter(&hal->target_list_rwlock, RW_WRITER); /* * if registering the first target, claim and initialize addresses @@ -123,7 +117,6 @@ s1394_cmp_register(s1394_target_t *target, t1394_cmp_evts_t *evts) rw_exit(&hal->target_list_rwlock); - TNF_PROBE_0_DEBUG(s1394_cmp_register_exit, S1394_TNF_SL_CMP_STACK, ""); return (DDI_SUCCESS); } @@ -132,9 +125,6 @@ s1394_cmp_unregister(s1394_target_t *target) { s1394_hal_t *hal = target->on_hal; - TNF_PROBE_0_DEBUG(s1394_cmp_unregister_enter, S1394_TNF_SL_CMP_STACK, - ""); - rw_enter(&hal->target_list_rwlock, RW_WRITER); if (s1394_fa_list_remove(hal, target, @@ -144,15 +134,10 @@ s1394_cmp_unregister(s1394_target_t *target) s1394_fa_free_addr(hal, S1394_FA_TYPE_CMP_IMPR); s1394_cmp_fini(hal); } - } else { - TNF_PROBE_0(s1394_cmp_unregister_common_error_list, - S1394_TNF_SL_CMP_ERROR, ""); } rw_exit(&hal->target_list_rwlock); - TNF_PROBE_0_DEBUG(s1394_cmp_unregister_exit, S1394_TNF_SL_CMP_STACK, - ""); return (DDI_SUCCESS); } @@ -163,8 +148,6 @@ s1394_cmp_read(s1394_target_t *target, t1394_cmp_reg_t reg, uint32_t *valp) s1394_cmp_hal_t *cmp = &hal->hal_cmp; int ret = DDI_FAILURE; - TNF_PROBE_0_DEBUG(s1394_cmp_read_enter, S1394_TNF_SL_CMP_STACK, ""); - if (reg == T1394_CMP_OMPR) { rw_enter(&cmp->cmp_ompr_rwlock, RW_READER); *valp = cmp->cmp_ompr_val; @@ -177,7 +160,6 @@ s1394_cmp_read(s1394_target_t *target, t1394_cmp_reg_t reg, uint32_t *valp) ret = DDI_SUCCESS; } - TNF_PROBE_0_DEBUG(s1394_cmp_read_exit, S1394_TNF_SL_CMP_STACK, ""); return (ret); } @@ -189,8 +171,6 @@ s1394_cmp_cas(s1394_target_t *target, t1394_cmp_reg_t reg, uint32_t arg_val, s1394_cmp_hal_t *cmp = &hal->hal_cmp; int ret = DDI_SUCCESS; - TNF_PROBE_0_DEBUG(s1394_cmp_cas_enter, S1394_TNF_SL_CMP_STACK, ""); - if (reg == T1394_CMP_OMPR) { rw_enter(&cmp->cmp_ompr_rwlock, RW_WRITER); *old_valp = cmp->cmp_ompr_val; @@ -214,7 +194,6 @@ s1394_cmp_cas(s1394_target_t *target, t1394_cmp_reg_t reg, uint32_t arg_val, s1394_cmp_notify_reg_change(hal, reg, target); } - TNF_PROBE_0_DEBUG(s1394_cmp_cas_exit, S1394_TNF_SL_CMP_STACK, ""); return (ret); } @@ -248,9 +227,6 @@ s1394_cmp_ompr_recv_read_request(cmd1394_cmd_t *req) s1394_hal_t *hal = req->cmd_callback_arg; s1394_cmp_hal_t *cmp = &hal->hal_cmp; - TNF_PROBE_0_DEBUG(s1394_cmp_ompr_recv_read_request_enter, - S1394_TNF_SL_CMP_STACK, ""); - if (req->cmd_type != CMD1394_ASYNCH_RD_QUAD) { req->cmd_result = IEEE1394_RESP_TYPE_ERROR; } else { @@ -261,9 +237,6 @@ s1394_cmp_ompr_recv_read_request(cmd1394_cmd_t *req) } (void) s1394_send_response(hal, req); - - TNF_PROBE_0_DEBUG(s1394_cmp_ompr_recv_read_request_exit, - S1394_TNF_SL_CMP_STACK, ""); } static void @@ -272,9 +245,6 @@ s1394_cmp_impr_recv_read_request(cmd1394_cmd_t *req) s1394_hal_t *hal = req->cmd_callback_arg; s1394_cmp_hal_t *cmp = &hal->hal_cmp; - TNF_PROBE_0_DEBUG(s1394_cmp_impr_recv_read_request_enter, - S1394_TNF_SL_CMP_STACK, ""); - if (req->cmd_type != CMD1394_ASYNCH_RD_QUAD) { req->cmd_result = IEEE1394_RESP_TYPE_ERROR; } else { @@ -285,9 +255,6 @@ s1394_cmp_impr_recv_read_request(cmd1394_cmd_t *req) } (void) s1394_send_response(hal, req); - - TNF_PROBE_0_DEBUG(s1394_cmp_impr_recv_read_request_exit, - S1394_TNF_SL_CMP_STACK, ""); } static void @@ -297,9 +264,6 @@ s1394_cmp_ompr_recv_lock_request(cmd1394_cmd_t *req) s1394_cmp_hal_t *cmp = &hal->hal_cmp; boolean_t notify = B_TRUE; - TNF_PROBE_0_DEBUG(s1394_cmp_ompr_recv_lock_request_enter, - S1394_TNF_SL_CMP_STACK, ""); - if ((req->cmd_type != CMD1394_ASYNCH_LOCK_32) || (req->cmd_u.l32.lock_type != CMD1394_LOCK_COMPARE_SWAP)) { req->cmd_result = IEEE1394_RESP_TYPE_ERROR; @@ -323,9 +287,6 @@ s1394_cmp_ompr_recv_lock_request(cmd1394_cmd_t *req) if (notify) { s1394_cmp_notify_reg_change(hal, T1394_CMP_OMPR, NULL); } - - TNF_PROBE_0_DEBUG(s1394_cmp_ompr_recv_lock_request_exit, - S1394_TNF_SL_CMP_STACK, ""); } static void @@ -335,9 +296,6 @@ s1394_cmp_impr_recv_lock_request(cmd1394_cmd_t *req) s1394_cmp_hal_t *cmp = &hal->hal_cmp; boolean_t notify = B_TRUE; - TNF_PROBE_0_DEBUG(s1394_cmp_impr_recv_lock_request_enter, - S1394_TNF_SL_CMP_STACK, ""); - if ((req->cmd_type != CMD1394_ASYNCH_LOCK_32) || (req->cmd_u.l32.lock_type != CMD1394_LOCK_COMPARE_SWAP)) { req->cmd_result = IEEE1394_RESP_TYPE_ERROR; @@ -361,9 +319,6 @@ s1394_cmp_impr_recv_lock_request(cmd1394_cmd_t *req) if (notify) { s1394_cmp_notify_reg_change(hal, T1394_CMP_IMPR, NULL); } - - TNF_PROBE_0_DEBUG(s1394_cmp_impr_recv_lock_request_exit, - S1394_TNF_SL_CMP_STACK, ""); } /* @@ -380,9 +335,6 @@ s1394_cmp_notify_reg_change(s1394_hal_t *hal, t1394_cmp_reg_t reg, void (*cb)(opaque_t, t1394_cmp_reg_t); opaque_t arg; - TNF_PROBE_0_DEBUG(s1394_cmp_notify_reg_change_enter, - S1394_TNF_SL_CMP_STACK, ""); - rw_enter(&hal->target_list_rwlock, RW_READER); start: @@ -419,10 +371,6 @@ start: * target than receiving same notification more than once */ if (saved_gen != s1394_fa_list_gen(hal, S1394_FA_TYPE_CMP)) { - TNF_PROBE_2(s1394_cmp_notify_reg_change_error, - S1394_TNF_SL_CMP_ERROR, "", - tnf_string, msg, "list gen changed", - tnf_opaque, num_retries, num_retries); if (++num_retries <= s1394_cmp_notify_retry_cnt) { goto start; } else { @@ -432,7 +380,4 @@ start: } rw_exit(&hal->target_list_rwlock); - - TNF_PROBE_0_DEBUG(s1394_cmp_notify_reg_change_exit, - S1394_TNF_SL_CMP_STACK, ""); } diff --git a/usr/src/uts/common/io/1394/s1394_csr.c b/usr/src/uts/common/io/1394/s1394_csr.c index 306a800886..46eb1d55cf 100644 --- a/usr/src/uts/common/io/1394/s1394_csr.c +++ b/usr/src/uts/common/io/1394/s1394_csr.c @@ -24,8 +24,6 @@ * All rights reserved. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * s1394_csr.c * 1394 Services Layer CSR and Config ROM Routines @@ -40,8 +38,6 @@ #include <sys/sunddi.h> #include <sys/types.h> #include <sys/kmem.h> -#include <sys/tnf_probe.h> - #include <sys/1394/t1394.h> #include <sys/1394/s1394.h> #include <sys/1394/h1394.h> @@ -96,9 +92,6 @@ s1394_setup_CSR_space(s1394_hal_t *hal) t1394_addr_enable_t rw_flags; int result; - TNF_PROBE_0_DEBUG(s1394_setup_CSR_space_enter, S1394_TNF_SL_CSR_STACK, - ""); - /* * Although they are not freed up in this routine, if * one of the s1394_claim_addr_blk() routines fails, @@ -125,11 +118,6 @@ s1394_setup_CSR_space(s1394_hal_t *hal) addr.aa_arg = hal; result = s1394_claim_addr_blk(hal, &addr); if (result != DDI_SUCCESS) { - TNF_PROBE_1(s1394_setup_CSR_space_error, - S1394_TNF_SL_CSR_ERROR, "", tnf_string, msg, - "STATE_CLEAR: CSR setup failed"); - TNF_PROBE_0_DEBUG(s1394_setup_CSR_space_exit, - S1394_TNF_SL_CSR_STACK, ""); return (DDI_FAILURE); } @@ -149,11 +137,6 @@ s1394_setup_CSR_space(s1394_hal_t *hal) addr.aa_arg = hal; result = s1394_claim_addr_blk(hal, &addr); if (result != DDI_SUCCESS) { - TNF_PROBE_1(s1394_setup_CSR_space_error, - S1394_TNF_SL_CSR_ERROR, "", tnf_string, msg, - "STATE_SET: CSR setup failed"); - TNF_PROBE_0_DEBUG(s1394_setup_CSR_space_exit, - S1394_TNF_SL_CSR_STACK, ""); return (DDI_FAILURE); } @@ -173,11 +156,6 @@ s1394_setup_CSR_space(s1394_hal_t *hal) addr.aa_arg = hal; result = s1394_claim_addr_blk(hal, &addr); if (result != DDI_SUCCESS) { - TNF_PROBE_1(s1394_setup_CSR_space_error, - S1394_TNF_SL_CSR_ERROR, "", tnf_string, msg, - "NODE_IDS: CSR setup failed"); - TNF_PROBE_0_DEBUG(s1394_setup_CSR_space_exit, - S1394_TNF_SL_CSR_STACK, ""); return (DDI_FAILURE); } @@ -197,11 +175,6 @@ s1394_setup_CSR_space(s1394_hal_t *hal) addr.aa_arg = hal; result = s1394_claim_addr_blk(hal, &addr); if (result != DDI_SUCCESS) { - TNF_PROBE_1(s1394_setup_CSR_space_error, - S1394_TNF_SL_CSR_ERROR, "", tnf_string, msg, - "RESET_START: CSR setup failed"); - TNF_PROBE_0_DEBUG(s1394_setup_CSR_space_exit, - S1394_TNF_SL_CSR_STACK, ""); return (DDI_FAILURE); } @@ -221,11 +194,6 @@ s1394_setup_CSR_space(s1394_hal_t *hal) addr.aa_arg = hal; result = s1394_claim_addr_blk(hal, &addr); if (result != DDI_SUCCESS) { - TNF_PROBE_1(s1394_setup_CSR_space_error, - S1394_TNF_SL_CSR_ERROR, "", tnf_string, msg, - "SPLIT_TIMEOUT: CSR setup failed"); - TNF_PROBE_0_DEBUG(s1394_setup_CSR_space_exit, - S1394_TNF_SL_CSR_STACK, ""); return (DDI_FAILURE); } @@ -245,11 +213,6 @@ s1394_setup_CSR_space(s1394_hal_t *hal) addr.aa_arg = hal; result = s1394_claim_addr_blk(hal, &addr); if (result != DDI_SUCCESS) { - TNF_PROBE_1(s1394_setup_CSR_space_error, - S1394_TNF_SL_CSR_ERROR, "", tnf_string, msg, - "ARGUMENT registers: CSR setup failed"); - TNF_PROBE_0_DEBUG(s1394_setup_CSR_space_exit, - S1394_TNF_SL_CSR_STACK, ""); return (DDI_FAILURE); } @@ -269,11 +232,6 @@ s1394_setup_CSR_space(s1394_hal_t *hal) addr.aa_arg = hal; result = s1394_claim_addr_blk(hal, &addr); if (result != DDI_SUCCESS) { - TNF_PROBE_1(s1394_setup_CSR_space_error, - S1394_TNF_SL_CSR_ERROR, "", tnf_string, msg, - "TEST registers: CSR setup failed"); - TNF_PROBE_0_DEBUG(s1394_setup_CSR_space_exit, - S1394_TNF_SL_CSR_STACK, ""); return (DDI_FAILURE); } @@ -293,11 +251,6 @@ s1394_setup_CSR_space(s1394_hal_t *hal) addr.aa_arg = hal; result = s1394_claim_addr_blk(hal, &addr); if (result != DDI_SUCCESS) { - TNF_PROBE_1(s1394_setup_CSR_space_error, - S1394_TNF_SL_CSR_ERROR, "", tnf_string, msg, - "INTERRUPT registers: CSR setup failed"); - TNF_PROBE_0_DEBUG(s1394_setup_CSR_space_exit, - S1394_TNF_SL_CSR_STACK, ""); return (DDI_FAILURE); } @@ -317,11 +270,6 @@ s1394_setup_CSR_space(s1394_hal_t *hal) addr.aa_arg = hal; result = s1394_claim_addr_blk(hal, &addr); if (result != DDI_SUCCESS) { - TNF_PROBE_1(s1394_setup_CSR_space_error, - S1394_TNF_SL_CSR_ERROR, "", tnf_string, msg, - "CLOCK registers: CSR setup failed"); - TNF_PROBE_0_DEBUG(s1394_setup_CSR_space_exit, - S1394_TNF_SL_CSR_STACK, ""); return (DDI_FAILURE); } @@ -341,11 +289,6 @@ s1394_setup_CSR_space(s1394_hal_t *hal) addr.aa_arg = hal; result = s1394_claim_addr_blk(hal, &addr); if (result != DDI_SUCCESS) { - TNF_PROBE_1(s1394_setup_CSR_space_error, - S1394_TNF_SL_CSR_ERROR, "", tnf_string, msg, - "MESSAGE registers: CSR setup failed"); - TNF_PROBE_0_DEBUG(s1394_setup_CSR_space_exit, - S1394_TNF_SL_CSR_STACK, ""); return (DDI_FAILURE); } @@ -364,11 +307,6 @@ s1394_setup_CSR_space(s1394_hal_t *hal) addr.aa_arg = hal; result = s1394_claim_addr_blk(hal, &addr); if (result != DDI_SUCCESS) { - TNF_PROBE_1(s1394_setup_CSR_space_error, - S1394_TNF_SL_CSR_ERROR, "", tnf_string, msg, - "CYCLE_TIME: CSR setup failed"); - TNF_PROBE_0_DEBUG(s1394_setup_CSR_space_exit, - S1394_TNF_SL_CSR_STACK, ""); return (DDI_FAILURE); } @@ -387,11 +325,6 @@ s1394_setup_CSR_space(s1394_hal_t *hal) addr.aa_arg = hal; result = s1394_claim_addr_blk(hal, &addr); if (result != DDI_SUCCESS) { - TNF_PROBE_1(s1394_setup_CSR_space_error, - S1394_TNF_SL_CSR_ERROR, "", tnf_string, msg, - "BUS_TIME: CSR setup failed"); - TNF_PROBE_0_DEBUG(s1394_setup_CSR_space_exit, - S1394_TNF_SL_CSR_STACK, ""); return (DDI_FAILURE); } @@ -410,11 +343,6 @@ s1394_setup_CSR_space(s1394_hal_t *hal) addr.aa_arg = hal; result = s1394_claim_addr_blk(hal, &addr); if (result != DDI_SUCCESS) { - TNF_PROBE_1(s1394_setup_CSR_space_error, - S1394_TNF_SL_CSR_ERROR, "", tnf_string, msg, - "BUSY_TIMEOUT: CSR setup failed"); - TNF_PROBE_0_DEBUG(s1394_setup_CSR_space_exit, - S1394_TNF_SL_CSR_STACK, ""); return (DDI_FAILURE); } @@ -435,11 +363,6 @@ s1394_setup_CSR_space(s1394_hal_t *hal) addr.aa_arg = hal; result = s1394_claim_addr_blk(hal, &addr); if (result != DDI_SUCCESS) { - TNF_PROBE_1(s1394_setup_CSR_space_error, - S1394_TNF_SL_CSR_ERROR, "", tnf_string, msg, - "IRM registers: CSR setup failed"); - TNF_PROBE_0_DEBUG(s1394_setup_CSR_space_exit, - S1394_TNF_SL_CSR_STACK, ""); return (DDI_FAILURE); } @@ -451,11 +374,6 @@ s1394_setup_CSR_space(s1394_hal_t *hal) addr.aa_length = IEEE1394_CONFIG_ROM_SZ; result = s1394_reserve_addr_blk(hal, &addr); if (result != DDI_SUCCESS) { - TNF_PROBE_1(s1394_setup_CSR_space_error, - S1394_TNF_SL_CSR_ERROR, "", tnf_string, msg, - "Unable to reserve Config ROM"); - TNF_PROBE_0_DEBUG(s1394_setup_CSR_space_exit, - S1394_TNF_SL_CSR_STACK, ""); return (DDI_FAILURE); } @@ -478,11 +396,6 @@ s1394_setup_CSR_space(s1394_hal_t *hal) if (result != DDI_SUCCESS) { kmem_free((void *)hal->CSR_topology_map, IEEE1394_UCSR_TOPOLOGY_MAP_SZ); - TNF_PROBE_1(s1394_setup_CSR_space_error, - S1394_TNF_SL_CSR_ERROR, "", tnf_string, msg, - "TOPOLOGY_MAP: CSR setup failed"); - TNF_PROBE_0_DEBUG(s1394_setup_CSR_space_exit, - S1394_TNF_SL_CSR_STACK, ""); return (DDI_FAILURE); } curr_blk = (s1394_addr_space_blk_t *)(addr.aa_hdl); @@ -498,11 +411,6 @@ s1394_setup_CSR_space(s1394_hal_t *hal) addr.aa_length = IEEE1394_UCSR_SPEED_MAP_SZ; result = s1394_reserve_addr_blk(hal, &addr); if (result != DDI_SUCCESS) { - TNF_PROBE_1(s1394_setup_CSR_space_error, - S1394_TNF_SL_CSR_ERROR, "", tnf_string, msg, - "SPEED_MAP: CSR setup failed"); - TNF_PROBE_0_DEBUG(s1394_setup_CSR_space_exit, - S1394_TNF_SL_CSR_STACK, ""); return (DDI_FAILURE); } @@ -519,16 +427,9 @@ s1394_setup_CSR_space(s1394_hal_t *hal) addr.aa_length = IEEE1394_QUADLET; result = s1394_reserve_addr_blk(hal, &addr); if (result != DDI_SUCCESS) { - TNF_PROBE_1(s1394_setup_CSR_space_error, - S1394_TNF_SL_CSR_ERROR, "", tnf_string, msg, - "Unable to reserve boundary quadlet"); - TNF_PROBE_0_DEBUG(s1394_setup_CSR_space_exit, - "stacktrace 1394 s1394", ""); return (DDI_FAILURE); } - TNF_PROBE_0_DEBUG(s1394_setup_CSR_space_exit, S1394_TNF_SL_CSR_STACK, - ""); return (DDI_SUCCESS); } @@ -548,9 +449,6 @@ s1394_CSR_state_clear(cmd1394_cmd_t *req) uint_t should_be_from; int result; - TNF_PROBE_0_DEBUG(s1394_CSR_state_clear_enter, S1394_TNF_SL_CSR_STACK, - ""); - hal = (s1394_hal_t *)req->cmd_callback_arg; /* Register offset */ @@ -560,8 +458,6 @@ s1394_CSR_state_clear(cmd1394_cmd_t *req) if ((offset & 0x3) != 0) { req->cmd_result = IEEE1394_RESP_TYPE_ERROR; (void) s1394_send_response(hal, req); - TNF_PROBE_0_DEBUG(s1394_CSR_state_clear_exit, - S1394_TNF_SL_CSR_STACK, ""); return; } @@ -639,8 +535,6 @@ s1394_CSR_state_clear(cmd1394_cmd_t *req) } (void) s1394_send_response(hal, req); - TNF_PROBE_0_DEBUG(s1394_CSR_state_clear_exit, S1394_TNF_SL_CSR_STACK, - ""); } /* @@ -661,9 +555,6 @@ s1394_CSR_state_set(cmd1394_cmd_t *req) uint_t hal_number_of_nodes; int result; - TNF_PROBE_0_DEBUG(s1394_CSR_state_set_enter, S1394_TNF_SL_CSR_STACK, - ""); - hal = (s1394_hal_t *)req->cmd_callback_arg; /* Register offset */ @@ -673,8 +564,6 @@ s1394_CSR_state_set(cmd1394_cmd_t *req) if ((offset & 0x3) != 0) { req->cmd_result = IEEE1394_RESP_TYPE_ERROR; (void) s1394_send_response(hal, req); - TNF_PROBE_0_DEBUG(s1394_CSR_state_set_exit, - S1394_TNF_SL_CSR_STACK, ""); return; } @@ -739,8 +628,6 @@ s1394_CSR_state_set(cmd1394_cmd_t *req) } (void) s1394_send_response(hal, req); - TNF_PROBE_0_DEBUG(s1394_CSR_state_set_exit, S1394_TNF_SL_CSR_STACK, - ""); } /* @@ -753,13 +640,9 @@ s1394_CSR_node_ids(cmd1394_cmd_t *req) { s1394_hal_t *hal; - TNF_PROBE_0_DEBUG(s1394_CSR_node_ids_enter, S1394_TNF_SL_CSR_STACK, ""); - hal = (s1394_hal_t *)req->cmd_callback_arg; s1394_common_CSR_routine(hal, req); - - TNF_PROBE_0_DEBUG(s1394_CSR_node_ids_exit, S1394_TNF_SL_CSR_STACK, ""); } /* @@ -774,9 +657,6 @@ s1394_CSR_reset_start(cmd1394_cmd_t *req) uint32_t data; uint_t offset; - TNF_PROBE_0_DEBUG(s1394_CSR_reset_start_enter, S1394_TNF_SL_CSR_STACK, - ""); - hal = (s1394_hal_t *)req->cmd_callback_arg; /* RESET_START register offset */ @@ -786,8 +666,6 @@ s1394_CSR_reset_start(cmd1394_cmd_t *req) if ((offset & 0x3) != 0) { req->cmd_result = IEEE1394_RESP_TYPE_ERROR; (void) s1394_send_response(hal, req); - TNF_PROBE_0_DEBUG(s1394_CSR_reset_start_exit, - S1394_TNF_SL_CSR_STACK, ""); return; } @@ -811,8 +689,6 @@ s1394_CSR_reset_start(cmd1394_cmd_t *req) } (void) s1394_send_response(hal, req); - TNF_PROBE_0_DEBUG(s1394_CSR_reset_start_exit, S1394_TNF_SL_CSR_STACK, - ""); } /* @@ -825,15 +701,9 @@ s1394_CSR_split_timeout(cmd1394_cmd_t *req) { s1394_hal_t *hal; - TNF_PROBE_0_DEBUG(s1394_CSR_split_timeout_enter, - S1394_TNF_SL_CSR_STACK, ""); - hal = (s1394_hal_t *)req->cmd_callback_arg; s1394_common_CSR_routine(hal, req); - - TNF_PROBE_0_DEBUG(s1394_CSR_split_timeout_exit, - S1394_TNF_SL_CSR_STACK, ""); } /* @@ -846,15 +716,9 @@ s1394_CSR_argument_regs(cmd1394_cmd_t *req) { s1394_hal_t *hal; - TNF_PROBE_0_DEBUG(s1394_CSR_argument_regs_enter, - S1394_TNF_SL_CSR_STACK, ""); - hal = (s1394_hal_t *)req->cmd_callback_arg; s1394_common_CSR_routine(hal, req); - - TNF_PROBE_0_DEBUG(s1394_CSR_argument_regs_exit, - S1394_TNF_SL_CSR_STACK, ""); } /* @@ -868,9 +732,6 @@ s1394_CSR_test_regs(cmd1394_cmd_t *req) s1394_hal_t *hal; uint_t offset; - TNF_PROBE_0_DEBUG(s1394_CSR_test_regs_enter, - S1394_TNF_SL_CSR_STACK, ""); - hal = (s1394_hal_t *)req->cmd_callback_arg; /* TEST register offset */ @@ -884,9 +745,6 @@ s1394_CSR_test_regs(cmd1394_cmd_t *req) } else { s1394_common_CSR_routine(hal, req); } - - TNF_PROBE_0_DEBUG(s1394_CSR_test_regs_exit, - S1394_TNF_SL_CSR_STACK, ""); } /* @@ -899,15 +757,9 @@ s1394_CSR_interrupt_regs(cmd1394_cmd_t *req) { s1394_hal_t *hal; - TNF_PROBE_0_DEBUG(s1394_CSR_interrupt_regs_enter, - S1394_TNF_SL_CSR_STACK, ""); - hal = (s1394_hal_t *)req->cmd_callback_arg; s1394_common_CSR_routine(hal, req); - - TNF_PROBE_0_DEBUG(s1394_CSR_interrupt_regs_exit, - S1394_TNF_SL_CSR_STACK, ""); } /* @@ -920,15 +772,9 @@ s1394_CSR_clock_regs(cmd1394_cmd_t *req) { s1394_hal_t *hal; - TNF_PROBE_0_DEBUG(s1394_CSR_clock_regs_enter, - S1394_TNF_SL_CSR_STACK, ""); - hal = (s1394_hal_t *)req->cmd_callback_arg; s1394_common_CSR_routine(hal, req); - - TNF_PROBE_0_DEBUG(s1394_CSR_clock_regs_exit, - S1394_TNF_SL_CSR_STACK, ""); } /* @@ -941,15 +787,9 @@ s1394_CSR_message_regs(cmd1394_cmd_t *req) { s1394_hal_t *hal; - TNF_PROBE_0_DEBUG(s1394_CSR_message_regs_enter, - S1394_TNF_SL_CSR_STACK, ""); - hal = (s1394_hal_t *)req->cmd_callback_arg; s1394_common_CSR_routine(hal, req); - - TNF_PROBE_0_DEBUG(s1394_CSR_message_regs_exit, - S1394_TNF_SL_CSR_STACK, ""); } /* @@ -964,9 +804,6 @@ s1394_CSR_cycle_time(cmd1394_cmd_t *req) uint_t offset; int result; - TNF_PROBE_0_DEBUG(s1394_CSR_cycle_time_enter, - S1394_TNF_SL_CSR_STACK, ""); - hal = (s1394_hal_t *)req->cmd_callback_arg; /* CYCLE_TIME register offset */ @@ -976,8 +813,6 @@ s1394_CSR_cycle_time(cmd1394_cmd_t *req) if ((offset & 0x3) != 0) { req->cmd_result = IEEE1394_RESP_TYPE_ERROR; (void) s1394_send_response(hal, req); - TNF_PROBE_0_DEBUG(s1394_CSR_cycle_time_exit, - S1394_TNF_SL_CSR_STACK, ""); return; } @@ -1028,8 +863,6 @@ s1394_CSR_cycle_time(cmd1394_cmd_t *req) } (void) s1394_send_response(hal, req); - TNF_PROBE_0_DEBUG(s1394_CSR_cycle_time_exit, - S1394_TNF_SL_CSR_STACK, ""); } /* @@ -1048,8 +881,6 @@ s1394_CSR_bus_time(cmd1394_cmd_t *req) uint_t should_be_from; int result; - TNF_PROBE_0_DEBUG(s1394_CSR_bus_time_enter, S1394_TNF_SL_CSR_STACK, ""); - hal = (s1394_hal_t *)req->cmd_callback_arg; /* BUS_TIME register offset */ @@ -1059,8 +890,6 @@ s1394_CSR_bus_time(cmd1394_cmd_t *req) if ((offset & 0x3) != 0) { req->cmd_result = IEEE1394_RESP_TYPE_ERROR; (void) s1394_send_response(hal, req); - TNF_PROBE_0_DEBUG(s1394_CSR_bus_time_exit, - S1394_TNF_SL_CSR_STACK, ""); return; } @@ -1126,7 +955,6 @@ s1394_CSR_bus_time(cmd1394_cmd_t *req) } (void) s1394_send_response(hal, req); - TNF_PROBE_0_DEBUG(s1394_CSR_bus_time_exit, S1394_TNF_SL_CSR_STACK, ""); } /* @@ -1139,15 +967,9 @@ s1394_CSR_busy_timeout(cmd1394_cmd_t *req) { s1394_hal_t *hal; - TNF_PROBE_0_DEBUG(s1394_CSR_busy_timeout_enter, - S1394_TNF_SL_CSR_STACK, ""); - hal = (s1394_hal_t *)req->cmd_callback_arg; s1394_common_CSR_routine(hal, req); - - TNF_PROBE_0_DEBUG(s1394_CSR_busy_timeout_exit, - S1394_TNF_SL_CSR_STACK, ""); } /* @@ -1168,8 +990,6 @@ s1394_CSR_IRM_regs(cmd1394_cmd_t *req) uint_t offset; int result; - TNF_PROBE_0_DEBUG(s1394_CSR_IRM_regs_enter, S1394_TNF_SL_CSR_STACK, ""); - hal = (s1394_hal_t *)req->cmd_callback_arg; /* IRM register offset */ @@ -1179,8 +999,6 @@ s1394_CSR_IRM_regs(cmd1394_cmd_t *req) if ((offset & 0x3) != 0) { req->cmd_result = IEEE1394_RESP_TYPE_ERROR; (void) s1394_send_response(hal, req); - TNF_PROBE_0_DEBUG(s1394_CSR_IRM_regs_exit, - S1394_TNF_SL_CSR_STACK, ""); return; } @@ -1241,7 +1059,6 @@ s1394_CSR_IRM_regs(cmd1394_cmd_t *req) } (void) s1394_send_response(hal, req); - TNF_PROBE_0_DEBUG(s1394_CSR_IRM_regs_exit, S1394_TNF_SL_CSR_STACK, ""); } /* @@ -1255,9 +1072,6 @@ s1394_CSR_topology_map(cmd1394_cmd_t *req) { s1394_hal_t *hal; - TNF_PROBE_0_DEBUG(s1394_CSR_topology_map_enter, - S1394_TNF_SL_CSR_STACK, ""); - hal = (s1394_hal_t *)req->cmd_callback_arg; /* Make sure it's a quadlet read request */ @@ -1267,9 +1081,6 @@ s1394_CSR_topology_map(cmd1394_cmd_t *req) req->cmd_result = IEEE1394_RESP_TYPE_ERROR; (void) s1394_send_response(hal, req); - - TNF_PROBE_0_DEBUG(s1394_CSR_topology_map_exit, - S1394_TNF_SL_CSR_STACK, ""); } /* @@ -1291,9 +1102,6 @@ s1394_CSR_topology_map_update(s1394_hal_t *hal) uint32_t length; int i, j, c; - TNF_PROBE_0_DEBUG(s1394_CSR_topology_map_update_enter, - S1394_TNF_SL_BR_CSR_STACK, ""); - ASSERT(MUTEX_HELD(&hal->topology_tree_mutex)); tm_ptr = (uint32_t *)hal->CSR_topology_map; @@ -1324,9 +1132,6 @@ s1394_CSR_topology_map_update(s1394_hal_t *hal) length = self_id_count + 2; CRC = s1394_CRC16(&(tm_ptr[1]), length); tm_ptr[0] = (length << IEEE1394_TOP_MAP_LEN_SHIFT) | CRC; - - TNF_PROBE_0_DEBUG(s1394_CSR_topology_map_update_exit, - S1394_TNF_SL_BR_CSR_STACK, ""); } /* @@ -1340,18 +1145,12 @@ s1394_CSR_topology_map_disable(s1394_hal_t *hal) { uint32_t *tm_ptr; - TNF_PROBE_0_DEBUG(s1394_CSR_topology_map_disable_enter, - S1394_TNF_SL_BR_CSR_STACK, ""); - ASSERT(MUTEX_HELD(&hal->topology_tree_mutex)); tm_ptr = (uint32_t *)hal->CSR_topology_map; /* Set length = 0 */ tm_ptr[0] = tm_ptr[0] & IEEE1394_TOP_MAP_LEN_MASK; - - TNF_PROBE_0_DEBUG(s1394_CSR_topology_map_disable_exit, - S1394_TNF_SL_BR_CSR_STACK, ""); } /* @@ -1367,9 +1166,6 @@ s1394_common_CSR_routine(s1394_hal_t *hal, cmd1394_cmd_t *req) uint_t offset; int result; - TNF_PROBE_0_DEBUG(s1394_common_CSR_routine_enter, - S1394_TNF_SL_CSR_STACK, ""); - /* Register offset */ offset = (req->cmd_addr & IEEE1394_CSR_OFFSET_MASK); @@ -1419,8 +1215,6 @@ s1394_common_CSR_routine(s1394_hal_t *hal, cmd1394_cmd_t *req) } (void) s1394_send_response(hal, req); - TNF_PROBE_0_DEBUG(s1394_common_CSR_routine_exit, - S1394_TNF_SL_CSR_STACK, ""); } /* @@ -1447,9 +1241,6 @@ s1394_init_local_config_rom(s1394_hal_t *hal) uint32_t CRC; int status, i, ret; - TNF_PROBE_0_DEBUG(s1394_init_local_config_rom_enter, - S1394_TNF_SL_CFGROM_STACK, ""); - /* Setup Config ROM mutex */ mutex_init(&hal->local_config_rom_mutex, NULL, MUTEX_DRIVER, hal->halinfo.hw_interrupt); @@ -1477,11 +1268,6 @@ s1394_init_local_config_rom(s1394_hal_t *hal) kmem_free((void *)hal->local_config_rom, IEEE1394_CONFIG_ROM_SZ); mutex_destroy(&hal->local_config_rom_mutex); - TNF_PROBE_1(s1394_init_local_config_rom_error, - S1394_TNF_SL_CFGROM_ERROR, "", tnf_string, msg, - "Failed in s1394_init_config_rom_structures()"); - TNF_PROBE_0_DEBUG(s1394_init_local_config_rom_exit, - S1394_TNF_SL_CFGROM_STACK, ""); return (DDI_FAILURE); } /* Build the Bus_Info_Block - see IEEE 1394-1995, Section 8.3.2.5.4 */ @@ -1577,11 +1363,6 @@ s1394_init_local_config_rom(s1394_hal_t *hal) kmem_free((void *)hal->local_config_rom, IEEE1394_CONFIG_ROM_SZ); mutex_destroy(&hal->local_config_rom_mutex); - TNF_PROBE_1(s1394_init_local_config_rom_error, - S1394_TNF_SL_CFGROM_ERROR, "", tnf_string, msg, - "Failure in kmem_zalloc"); - TNF_PROBE_0_DEBUG(s1394_init_local_config_rom_exit, - S1394_TNF_SL_CFGROM_STACK, ""); return (DDI_FAILURE); } kmem_free((void *)text_leaf, S1394_ROOT_TEXT_LEAF_SZ); @@ -1614,11 +1395,6 @@ s1394_init_local_config_rom(s1394_hal_t *hal) kmem_free((void *)hal->local_config_rom, IEEE1394_CONFIG_ROM_SZ); mutex_destroy(&hal->local_config_rom_mutex); - TNF_PROBE_1(s1394_init_local_config_rom_error, - S1394_TNF_SL_CFGROM_ERROR, "", tnf_string, msg, - "Failure in kmem_zalloc"); - TNF_PROBE_0_DEBUG(s1394_init_local_config_rom_exit, - S1394_TNF_SL_CFGROM_STACK, ""); return (DDI_FAILURE); } kmem_free((void *)node_unique_id_leaf, S1394_NODE_UNIQUE_ID_SZ); @@ -1666,11 +1442,6 @@ s1394_init_local_config_rom(s1394_hal_t *hal) kmem_free((void *)hal->local_config_rom, IEEE1394_CONFIG_ROM_SZ); mutex_destroy(&hal->local_config_rom_mutex); - TNF_PROBE_1(s1394_init_local_config_rom_error, - S1394_TNF_SL_CFGROM_ERROR, "", tnf_string, msg, - "Failure in kmem_zalloc"); - TNF_PROBE_0_DEBUG(s1394_init_local_config_rom_exit, - S1394_TNF_SL_CFGROM_STACK, ""); return (DDI_FAILURE); } kmem_free((void *)unit_dir, S1394_UNIT_DIR_SZ); @@ -1688,8 +1459,6 @@ s1394_init_local_config_rom(s1394_hal_t *hal) (void) HAL_CALL(hal).update_config_rom(hal->halinfo.hal_private, config_rom, IEEE1394_CONFIG_ROM_QUAD_SZ); - TNF_PROBE_0_DEBUG(s1394_init_local_config_rom_exit, - S1394_TNF_SL_CFGROM_STACK, ""); return (DDI_SUCCESS); } @@ -1703,9 +1472,6 @@ s1394_init_local_config_rom(s1394_hal_t *hal) void s1394_destroy_local_config_rom(s1394_hal_t *hal) { - TNF_PROBE_0_DEBUG(s1394_destroy_local_config_rom_enter, - S1394_TNF_SL_CFGROM_STACK, ""); - /* Lock the Config ROM buffer */ mutex_enter(&hal->local_config_rom_mutex); @@ -1722,9 +1488,6 @@ s1394_destroy_local_config_rom(s1394_hal_t *hal) /* Setup Config ROM mutex */ mutex_destroy(&hal->local_config_rom_mutex); - - TNF_PROBE_0_DEBUG(s1394_destroy_local_config_rom_exit, - S1394_TNF_SL_CFGROM_STACK, ""); } /* @@ -1738,9 +1501,6 @@ s1394_init_config_rom_structures(s1394_hal_t *hal) s1394_config_rom_t *root_directory; s1394_config_rom_t *rest_of_config_rom; - TNF_PROBE_0_DEBUG(s1394_init_config_rom_structures_enter, - S1394_TNF_SL_CFGROM_STACK, ""); - ASSERT(MUTEX_HELD(&hal->local_config_rom_mutex)); root_directory = (s1394_config_rom_t *)kmem_zalloc( @@ -1766,8 +1526,6 @@ s1394_init_config_rom_structures(s1394_hal_t *hal) hal->free_space = IEEE1394_CONFIG_ROM_QUAD_SZ - (rest_of_config_rom->cfgrom_addr_lo); - TNF_PROBE_0_DEBUG(s1394_init_config_rom_structures_exit, - S1394_TNF_SL_CFGROM_STACK, ""); return (DDI_SUCCESS); } @@ -1782,9 +1540,6 @@ s1394_destroy_config_rom_structures(s1394_hal_t *hal) s1394_config_rom_t *curr_blk; s1394_config_rom_t *next_blk; - TNF_PROBE_0_DEBUG(s1394_destroy_config_rom_structures_enter, - S1394_TNF_SL_CFGROM_STACK, ""); - ASSERT(MUTEX_HELD(&hal->local_config_rom_mutex)); curr_blk = hal->root_directory; @@ -1795,8 +1550,6 @@ s1394_destroy_config_rom_structures(s1394_hal_t *hal) curr_blk = next_blk; } - TNF_PROBE_0_DEBUG(s1394_destroy_config_rom_structures_exit, - S1394_TNF_SL_CFGROM_STACK, ""); return (DDI_SUCCESS); } @@ -1824,16 +1577,11 @@ s1394_add_config_rom_entry(s1394_hal_t *hal, uint8_t key, uint32_t *buffer, uint_t last_entry_offset; int i; - TNF_PROBE_0_DEBUG(s1394_add_config_rom_entry_enter, - "stacktrace 1394 s1394", ""); - ASSERT(MUTEX_HELD(&hal->local_config_rom_mutex)); if (size > hal->free_space) { /* Out of space */ *status = CMD1394_ERSRC_CONFLICT; - TNF_PROBE_0_DEBUG(s1394_add_config_rom_entry_exit, - S1394_TNF_SL_CFGROM_STACK, ""); return (DDI_FAILURE); } @@ -1891,8 +1639,6 @@ s1394_add_config_rom_entry(s1394_hal_t *hal, uint8_t key, uint32_t *buffer, new_blk = (s1394_config_rom_t *)kmem_zalloc( sizeof (s1394_config_rom_t), KM_SLEEP); if (new_blk == NULL) { - TNF_PROBE_0_DEBUG(s1394_add_config_rom_entry_exit, - S1394_TNF_SL_CFGROM_STACK, ""); return (DDI_FAILURE); } @@ -1943,8 +1689,6 @@ s1394_add_config_rom_entry(s1394_hal_t *hal, uint8_t key, uint32_t *buffer, *status = T1394_NOERROR; - TNF_PROBE_0_DEBUG(s1394_add_config_rom_entry_exit, - S1394_TNF_SL_CFGROM_STACK, ""); return (DDI_SUCCESS); } @@ -1973,9 +1717,6 @@ s1394_remove_config_rom_entry(s1394_hal_t *hal, void **handle, int *status) uint_t tmp_size; int i; - TNF_PROBE_0_DEBUG(s1394_remove_config_rom_entry_enter, - S1394_TNF_SL_CFGROM_STACK, ""); - ASSERT(MUTEX_HELD(&hal->local_config_rom_mutex)); del_blk = (s1394_config_rom_t *)(*handle); @@ -2060,8 +1801,6 @@ s1394_remove_config_rom_entry(s1394_hal_t *hal, void **handle, int *status) free_blk = (s1394_config_rom_t *)kmem_zalloc( sizeof (s1394_config_rom_t), KM_SLEEP); if (free_blk == NULL) { - TNF_PROBE_0_DEBUG(s1394_remove_config_rom_entry_exit, - S1394_TNF_SL_CFGROM_STACK, ""); return (DDI_FAILURE); } @@ -2107,8 +1846,6 @@ s1394_remove_config_rom_entry(s1394_hal_t *hal, void **handle, int *status) *status = T1394_NOERROR; - TNF_PROBE_0_DEBUG(s1394_remove_config_rom_entry_exit, - S1394_TNF_SL_CFGROM_STACK, ""); return (DDI_SUCCESS); } @@ -2129,10 +1866,7 @@ s1394_update_config_rom_callback(void *arg) uint32_t g; uint_t CRC; uint_t last_entry_offset; - int i, ret; - - TNF_PROBE_0_DEBUG(s1394_update_config_rom_callback_enter, - S1394_TNF_SL_CFGROM_STACK, ""); + int i; hal = (s1394_hal_t *)arg; @@ -2186,13 +1920,5 @@ s1394_update_config_rom_callback(void *arg) config_rom, last_entry_offset); /* Initiate a bus reset */ - ret = HAL_CALL(hal).bus_reset(hal->halinfo.hal_private); - if (ret != DDI_SUCCESS) { - TNF_PROBE_1(s1394_update_config_rom_callback_error, - S1394_TNF_SL_ERROR, "", tnf_string, msg, - "Error initiating bus reset"); - } - - TNF_PROBE_0_DEBUG(s1394_update_config_rom_callback_exit, - S1394_TNF_SL_CFGROM_STACK, ""); + (void) HAL_CALL(hal).bus_reset(hal->halinfo.hal_private); } diff --git a/usr/src/uts/common/io/1394/s1394_dev_disc.c b/usr/src/uts/common/io/1394/s1394_dev_disc.c index 08bb639647..3a254d5ddd 100644 --- a/usr/src/uts/common/io/1394/s1394_dev_disc.c +++ b/usr/src/uts/common/io/1394/s1394_dev_disc.c @@ -54,8 +54,6 @@ #include <sys/kstat.h> #include <sys/varargs.h> -#include <sys/tnf_probe.h> - #include <sys/1394/t1394.h> #include <sys/1394/s1394.h> #include <sys/1394/h1394.h> @@ -177,9 +175,6 @@ static int s1394_enable_rio_pass1_workarounds = 0; void s1394_br_thread(s1394_hal_t *hal) { - TNF_PROBE_0_DEBUG(s1394_br_thread_enter, S1394_TNF_SL_HOTPLUG_STACK, - ""); - ASSERT(MUTEX_NOT_HELD(&hal->topology_tree_mutex)); /* Initialize the Bus Mgr timers */ @@ -196,17 +191,10 @@ s1394_br_thread(s1394_hal_t *hal) for (;;) { ASSERT(MUTEX_NOT_HELD(&hal->topology_tree_mutex)); - TNF_PROBE_0_DEBUG(s1394_br_thread_wait, - S1394_TNF_SL_HOTPLUG_STACK, ""); - s1394_wait_for_events(hal, 0); ASSERT(MUTEX_NOT_HELD(&hal->topology_tree_mutex)); - TNF_PROBE_1_DEBUG(s1394_br_thread_restart, - S1394_TNF_SL_HOTPLUG_STACK, "", - tnf_int, hal_instance, ddi_get_instance(hal->halinfo.dip)); - /* stop bus manager timeouts, if needed */ s1394_bus_mgr_timers_stop(hal, &hal->bus_mgr_query_timeout_id, &hal->bus_mgr_timeout_id); @@ -221,37 +209,19 @@ s1394_br_thread(s1394_hal_t *hal) s1394_isoch_rsrc_realloc(hal); if (s1394_cfgrom_scan_phase1(hal) != DDI_SUCCESS) { - TNF_PROBE_0_DEBUG(br_thread_phase1_restart, - S1394_TNF_SL_HOTPLUG_STACK, ""); continue; } - TNF_PROBE_1_DEBUG(s1394_br_thread_phase1_done, - S1394_TNF_SL_HOTPLUG_STACK, "", - tnf_int, hal_instance, ddi_get_instance(hal->halinfo.dip)); - if (s1394_bus_mgr_processing(hal) != DDI_SUCCESS) { - TNF_PROBE_0_DEBUG(br_thread_bus_mgr_restart, - S1394_TNF_SL_HOTPLUG_STACK, ""); continue; } - TNF_PROBE_1_DEBUG(s1394_br_thread_bus_mgr_proc_done, - S1394_TNF_SL_HOTPLUG_STACK, "", - tnf_int, hal_instance, ddi_get_instance(hal->halinfo.dip)); - ASSERT(MUTEX_NOT_HELD(&hal->topology_tree_mutex)); if (s1394_cfgrom_scan_phase2(hal) != DDI_SUCCESS) { - TNF_PROBE_0_DEBUG(br_thread_phase2_restart, - S1394_TNF_SL_HOTPLUG_STACK, ""); continue; } - TNF_PROBE_1_DEBUG(s1394_br_thread_done, - S1394_TNF_SL_HOTPLUG_STACK, "", - tnf_int, hal_instance, ddi_get_instance(hal->halinfo.dip)); - ASSERT(MUTEX_NOT_HELD(&hal->topology_tree_mutex)); } } @@ -272,9 +242,6 @@ s1394_wait_for_events(s1394_hal_t *hal, int firsttime) { uint_t event; - TNF_PROBE_0_DEBUG(s1394_wait_for_events_enter, - S1394_TNF_SL_HOTPLUG_STACK, ""); - ASSERT(MUTEX_NOT_HELD(&hal->br_thread_mutex)); ASSERT(MUTEX_NOT_HELD(&hal->topology_tree_mutex)); @@ -291,37 +258,22 @@ s1394_wait_for_events(s1394_hal_t *hal, int firsttime) } if (event & BR_THR_GO_AWAY) { - TNF_PROBE_1(s1394_wait_for_events, S1394_TNF_SL_HOTPLUG_STACK, - "", tnf_string, msg, "Go away set"); s1394_br_thread_exit(hal); - TNF_PROBE_0_DEBUG(s1394_wait_for_events_exit, - S1394_TNF_SL_HOTPLUG_STACK, ""); /*NOTREACHED*/ return; } if (firsttime) { - TNF_PROBE_0_DEBUG(s1394_wait_for_events_exit, - S1394_TNF_SL_HOTPLUG_STACK, ""); mutex_exit(&hal->br_thread_mutex); return; } mutex_enter(&hal->topology_tree_mutex); - if (event & BR_THR_CFGROM_SCAN) { - TNF_PROBE_2_DEBUG(s1394_wait_for_events_scan, - S1394_TNF_SL_HOTPLUG_STACK, "", - tnf_int, br_thread_gen, hal->br_cfgrom_read_gen, - tnf_int, hal_generation, hal->generation_count); - } hal->br_cfgrom_read_gen = hal->generation_count; hal->br_thread_ev_type &= ~BR_THR_CFGROM_SCAN; mutex_exit(&hal->topology_tree_mutex); mutex_exit(&hal->br_thread_mutex); - - TNF_PROBE_0_DEBUG(s1394_wait_for_events_exit, - S1394_TNF_SL_HOTPLUG_STACK, ""); } /* @@ -347,9 +299,6 @@ s1394_wait_for_cfgrom_callbacks(s1394_hal_t *hal, uint_t wait_gen, ASSERT(MUTEX_NOT_HELD(&hal->topology_tree_mutex)); - TNF_PROBE_1_DEBUG(s1394_wait_for_cfgrom_callbacks_enter, - S1394_TNF_SL_HOTPLUG_STACK, "", tnf_uint, wait_gen, wait_gen); - ret = DDI_SUCCESS; while (!done) { @@ -365,17 +314,9 @@ s1394_wait_for_cfgrom_callbacks(s1394_hal_t *hal, uint_t wait_gen, ASSERT(MUTEX_HELD(&hal->topology_tree_mutex)); if (wait_gen != hal->generation_count || (hal->br_thread_ev_type & BR_THR_GO_AWAY) != 0) { - -#if !defined(NPROBE) && defined(TNF_DEBUG) - int hal_gen = hal->generation_count; -#endif - mutex_exit(&hal->topology_tree_mutex); mutex_exit(&hal->br_cmplq_mutex); s1394_flush_cmplq(hal); - TNF_PROBE_1_DEBUG(s1394_wait_for_cfgrom_callbacks_exit, - S1394_TNF_SL_HOTPLUG_STACK, "", tnf_int, hal_gen, - hal_gen); return (DDI_FAILURE); } mutex_exit(&hal->topology_tree_mutex); @@ -391,19 +332,10 @@ s1394_wait_for_cfgrom_callbacks(s1394_hal_t *hal, uint_t wait_gen, if (cmd != NULL) { if (cmd->bus_generation != wait_gen) { - TNF_PROBE_3( - s1394_wait_for_cfgrom_callbacks, - S1394_TNF_SL_HOTPLUG_STACK, "", - tnf_string, msg, "command gen != wait_gen", - tnf_uint, cmd_gen, cmd->bus_generation, - tnf_uint, wait_gen, wait_gen); (void) s1394_free_cmd(hal, &cmd); continue; } cmdret = (*handle_cmd_fn)(hal, cmd); - TNF_PROBE_2_DEBUG(s1394_wait_for_cfgrom_callbacks, - S1394_TNF_SL_HOTPLUG_STACK, "", - tnf_opaque, cmd, cmd, tnf_int, cmdret, cmdret); ASSERT(cmdret != S1394_HCMD_INVALID); if (cmdret == S1394_HCMD_LOCK_FAILED) { /* flush completion queue */ @@ -422,9 +354,6 @@ s1394_wait_for_cfgrom_callbacks(s1394_hal_t *hal, uint_t wait_gen, } } - TNF_PROBE_0_DEBUG(s1394_wait_for_cfgrom_callbacks_exit, - S1394_TNF_SL_HOTPLUG_STACK, ""); - return (ret); } @@ -440,9 +369,6 @@ s1394_flush_cmplq(s1394_hal_t *hal) ASSERT(MUTEX_NOT_HELD(&hal->topology_tree_mutex)); - TNF_PROBE_0_DEBUG(s1394_flush_cmplq_enter, S1394_TNF_SL_HOTPLUG_STACK, - ""); - cmd = NULL; do { @@ -455,9 +381,6 @@ s1394_flush_cmplq(s1394_hal_t *hal) s_priv = S1394_GET_CMD_PRIV(cmd); tcmd = s_priv->cmd_priv_next; - TNF_PROBE_2_DEBUG(s1394_flush_cmplq, - S1394_TNF_SL_HOTPLUG_STACK, "", tnf_opaque, cmd, - cmd, tnf_uint, cmd_gen, cmd->bus_generation); (void) s1394_free_cmd(hal, &cmd); cmd = tcmd; } @@ -467,10 +390,6 @@ s1394_flush_cmplq(s1394_hal_t *hal) mutex_exit(&hal->br_cmplq_mutex); } while (cmd != NULL); - - TNF_PROBE_0_DEBUG(s1394_flush_cmplq_exit, S1394_TNF_SL_HOTPLUG_STACK, - ""); - } /* @@ -483,7 +402,6 @@ s1394_br_thread_exit(s1394_hal_t *hal) { ASSERT(MUTEX_HELD(&hal->br_thread_mutex)); ASSERT(MUTEX_NOT_HELD(&hal->topology_tree_mutex)); - TNF_PROBE_0(s1394_br_thread_exit_enter, S1394_TNF_SL_HOTPLUG_STACK, ""); s1394_flush_cmplq(hal); #ifndef __lock_lint CALLB_CPR_EXIT(&hal->hal_cprinfo); @@ -505,19 +423,12 @@ s1394_target_bus_reset_notifies(s1394_hal_t *hal, t1394_localinfo_t *localinfo) ASSERT(MUTEX_NOT_HELD(&hal->topology_tree_mutex)); - TNF_PROBE_2_DEBUG(s1394_target_bus_reset_notifies_enter, - S1394_TNF_SL_HOTPLUG_STACK, "", tnf_uint, bus_gen, - localinfo->bus_generation, tnf_uint, node_id, - localinfo->local_nodeID); - if (ndi_event_retrieve_cookie(hal->hal_ndi_event_hdl, NULL, DDI_DEVI_BUS_RESET_EVENT, &cookie, NDI_EVENT_NOPASS) == NDI_SUCCESS) { (void) ndi_event_run_callbacks(hal->hal_ndi_event_hdl, NULL, cookie, localinfo); } - TNF_PROBE_0_DEBUG(s1394_target_bus_reset_notifies_exit, - S1394_TNF_SL_HOTPLUG_STACK, ""); } /* @@ -534,9 +445,6 @@ s1394_alloc_cfgrom(s1394_hal_t *hal, s1394_node_t *node, s1394_status_t *status) ASSERT(MUTEX_HELD(&hal->topology_tree_mutex)); - TNF_PROBE_0_DEBUG(s1394_alloc_cfgrom_enter, S1394_TNF_SL_HOTPLUG_STACK, - ""); - *status = S1394_NOSTATUS; /* @@ -559,19 +467,12 @@ s1394_alloc_cfgrom(s1394_hal_t *hal, s1394_node_t *node, s1394_status_t *status) if (s1394_lock_tree(hal) != DDI_SUCCESS) { kmem_free(cfgrom, IEEE1394_CONFIG_ROM_SZ); *status |= S1394_LOCK_FAILED; - TNF_PROBE_1(s1394_alloc_cfgrom, S1394_TNF_SL_HOTPLUG_ERROR, - "", tnf_string, msg, "cannot relock the tree"); - TNF_PROBE_0_DEBUG(s1394_alloc_cfgrom_exit, - S1394_TNF_SL_HOTPLUG_STACK, ""); return (DDI_FAILURE); } node->cfgrom = cfgrom; node->cfgrom_size = IEEE1394_CONFIG_ROM_QUAD_SZ; SET_CFGROM_NEW_ALLOC(node); ASSERT(MUTEX_HELD(&hal->topology_tree_mutex)); - TNF_PROBE_3(s1394_alloc_cfgrom_exit, S1394_TNF_SL_HOTPLUG_STACK, - "cfgrom alloc", tnf_uint, hal_gen, hal->generation_count, tnf_uint, - node_num, node->node_num, tnf_opaque, cfgrom, cfgrom); return (DDI_SUCCESS); } @@ -586,9 +487,6 @@ s1394_free_cfgrom(s1394_hal_t *hal, s1394_node_t *node, ASSERT(MUTEX_HELD(&hal->topology_tree_mutex)); ASSERT(node->cfgrom != NULL); - TNF_PROBE_0_DEBUG(s1394_free_cfgrom_enter, S1394_TNF_SL_HOTPLUG_STACK, - ""); - if (options == S1394_FREE_CFGROM_BOTH) { /* * free in both old and new trees; will be called with @@ -599,12 +497,6 @@ s1394_free_cfgrom(s1394_hal_t *hal, s1394_node_t *node, if (NODE_MATCHED(node) == B_TRUE && onode->cfgrom != NULL) ASSERT(onode->cfgrom == node->cfgrom); - TNF_PROBE_4(s1394_free_cfgrom_both, - S1394_TNF_SL_HOTPLUG_STACK, "cfgrom free", tnf_uint, - hal_gen, hal->generation_count, tnf_int, node_num, - node->node_num, tnf_opaque, old_cfgrom, onode->cfgrom, - tnf_opaque, cfgrom, node->cfgrom); - if (onode != NULL && onode->cfgrom != NULL && onode->cfgrom != node->cfgrom) kmem_free(onode->cfgrom, IEEE1394_CONFIG_ROM_SZ); @@ -618,11 +510,6 @@ s1394_free_cfgrom(s1394_hal_t *hal, s1394_node_t *node, } else if (options == S1394_FREE_CFGROM_NEW) { - TNF_PROBE_2(s1394_free_cfgrom_new, - S1394_TNF_SL_HOTPLUG_STACK, "cfgrom free", - tnf_int, node_num, node->node_num, - tnf_opaque, cfgrom, node->cfgrom); - ASSERT(CFGROM_NEW_ALLOC(node) == B_TRUE); kmem_free(node->cfgrom, IEEE1394_CONFIG_ROM_SZ); CLEAR_CFGROM_NEW_ALLOC(node); @@ -632,17 +519,10 @@ s1394_free_cfgrom(s1394_hal_t *hal, s1394_node_t *node, } else if (options == S1394_FREE_CFGROM_OLD) { /* freeing in old tree */ - TNF_PROBE_2_DEBUG(s1394_free_cfgrom_old, - S1394_TNF_SL_HOTPLUG_STACK, "cfgrom free", - tnf_int, node_num, node->node_num, - tnf_opaque, cfgrom, node->cfgrom); kmem_free(node->cfgrom, IEEE1394_CONFIG_ROM_SZ); node->cfgrom = NULL; CLEAR_CFGROM_STATE(node); } - - TNF_PROBE_0_DEBUG(s1394_free_cfgrom_exit, S1394_TNF_SL_HOTPLUG_STACK, - ""); } /* @@ -656,10 +536,6 @@ s1394_free_cfgrom(s1394_hal_t *hal, s1394_node_t *node, void s1394_copy_cfgrom(s1394_node_t *to, s1394_node_t *from) { - TNF_PROBE_3_DEBUG(s1394_copy_cfgrom_enter, S1394_TNF_SL_HOTPLUG_STACK, - "", tnf_int, to_node, to->node_num, tnf_int, - from_node, from->node_num, tnf_opaque, from_cfgrom, from->cfgrom); - ASSERT(to->cfgrom == NULL); to->cfgrom = from->cfgrom; @@ -687,8 +563,6 @@ s1394_copy_cfgrom(s1394_node_t *to, s1394_node_t *from) * have been config rom allocated. */ ASSERT(from->cfgrom == NULL); - TNF_PROBE_0_DEBUG(s1394_copy_cfgrom_exit, - S1394_TNF_SL_HOTPLUG_STACK, ""); return; } else { s1394_selfid_pkt_t *selfid_pkt = to->selfid_packet; @@ -696,9 +570,6 @@ s1394_copy_cfgrom(s1394_node_t *to, s1394_node_t *from) if (IEEE1394_SELFID_ISLINKON(selfid_pkt)) SET_LINK_ACTIVE(to); } - - TNF_PROBE_0_DEBUG(s1394_copy_cfgrom_exit, - S1394_TNF_SL_HOTPLUG_STACK, ""); } /* @@ -720,10 +591,6 @@ s1394_read_bus_info_blk(s1394_hal_t *hal, s1394_node_t *node, node_num = node->node_num; - TNF_PROBE_2_DEBUG(s1394_read_bus_info_blk_enter, - S1394_TNF_SL_HOTPLUG_STACK, "", tnf_uint, hal_gen, - hal->generation_count, tnf_int, node_num, node_num); - /* * drop the topology lock around command allocation. Return failure * if either command allocation fails or cannot reacquire the lock @@ -732,21 +599,15 @@ s1394_read_bus_info_blk(s1394_hal_t *hal, s1394_node_t *node, *status = S1394_NOSTATUS; if (s1394_alloc_cmd(hal, 0, &cmd) != DDI_SUCCESS) { - TNF_PROBE_1(s1394_read_bus_info_blk, S1394_TNF_SL_HOTPLUG_ERROR, - "", tnf_string, msg, "command allocation failed"); *status |= S1394_CMD_ALLOC_FAILED; } if (s1394_lock_tree(hal) != DDI_SUCCESS) { *status |= S1394_LOCK_FAILED; - TNF_PROBE_1(s1394_read_bus_info_blk, S1394_TNF_SL_HOTPLUG_ERROR, - "", tnf_string, msg, "unable to relock the tree"); /* free the cmd allocated above */ if (((*status) & S1394_CMD_ALLOC_FAILED) != 0) (void) s1394_free_cmd(hal, (cmd1394_cmd_t **)&cmd); } if (((*status) & (S1394_CMD_ALLOC_FAILED | S1394_LOCK_FAILED)) != 0) { - TNF_PROBE_0_DEBUG(s1394_read_bus_info_blk_exit, - S1394_TNF_SL_HOTPLUG_STACK, ""); return (DDI_FAILURE); } @@ -756,10 +617,6 @@ s1394_read_bus_info_blk(s1394_hal_t *hal, s1394_node_t *node, ASSERT(((*status) & S1394_LOCK_FAILED) != 0); (void) s1394_free_cmd(hal, (cmd1394_cmd_t **)&cmd); ASSERT(MUTEX_NOT_HELD(&hal->topology_tree_mutex)); - TNF_PROBE_1(s1394_read_bus_info_blk, S1394_TNF_SL_HOTPLUG_ERROR, - "", tnf_string, msg, "config rom allocation failed"); - TNF_PROBE_0_DEBUG(s1394_read_bus_info_blk_exit, - S1394_TNF_SL_HOTPLUG_STACK, ""); return (DDI_FAILURE); } @@ -784,22 +641,8 @@ s1394_read_bus_info_blk(s1394_hal_t *hal, s1394_node_t *node, QUAD_TO_CFGROM_ADDR(IEEE1394_LOCAL_BUS, node_num, quadlet, cmd->cmd_addr); - TNF_PROBE_3_DEBUG(s1394_read_bus_info_blk, - S1394_TNF_SL_HOTPLUG_STACK, "", tnf_uint, hal_gen, - hal->generation_count, tnf_int, node_num, node_num, tnf_uint, - quadlet, quadlet); - - TNF_PROBE_5_DEBUG(s1394_read_bus_info_blk, - S1394_TNF_SL_HOTPLUG_STACK, "", tnf_int, - node_num, node_num, tnf_int, parsed, CFGROM_PARSED(node), tnf_int, - matched, NODE_MATCHED(node), tnf_int, visited, - NODE_VISITED(node), tnf_int, generation_changed, - CFGROM_GEN_CHANGED(node)); - SETUP_QUAD_READ(node, 1, quadlet, 1); if (s1394_read_config_quadlet(hal, cmd, status) != DDI_SUCCESS) { - TNF_PROBE_1(s1394_read_bus_info_blk, S1394_TNF_SL_HOTPLUG_ERROR, - "", tnf_string, msg, "Unable to start read"); /* free the command if it wasn't handed over to the HAL */ if (((*status) & S1394_CMD_INFLIGHT) == 0) { (void) s1394_free_cmd(hal, (cmd1394_cmd_t **)&cmd); @@ -807,18 +650,12 @@ s1394_read_bus_info_blk(s1394_hal_t *hal, s1394_node_t *node, if (((*status) & S1394_LOCK_FAILED) != 0) { ASSERT(MUTEX_NOT_HELD(&hal->topology_tree_mutex)); } - TNF_PROBE_0_DEBUG(s1394_read_bus_info_blk_exit, - S1394_TNF_SL_HOTPLUG_STACK, ""); return (DDI_FAILURE); } hal->cfgroms_being_read++; ASSERT(MUTEX_HELD(&hal->topology_tree_mutex)); - TNF_PROBE_1_DEBUG(s1394_read_bus_info_blk_exit, - S1394_TNF_SL_HOTPLUG_STACK, "", tnf_int, cfgrom_read_cnt, - hal->cfgroms_being_read); - return (DDI_SUCCESS); } @@ -838,10 +675,6 @@ s1394_read_rest_of_cfgrom(s1394_hal_t *hal, s1394_node_t *node, ASSERT(MUTEX_HELD(&hal->topology_tree_mutex)); ASSERT(LINK_ACTIVE(node) == B_TRUE); - TNF_PROBE_2_DEBUG(s1394_read_rest_of_cfgrom_enter, - S1394_TNF_SL_HOTPLUG_STACK, "", tnf_uint, hal_gen, - hal->generation_count, tnf_int, node_num, node_num); - /* * drop the topology lock around command allocation. Return failure * if either command allocation fails or cannot reacquire the lock @@ -851,22 +684,14 @@ s1394_read_rest_of_cfgrom(s1394_hal_t *hal, s1394_node_t *node, if (s1394_alloc_cmd(hal, 0, &cmd) != DDI_SUCCESS) { *status |= S1394_CMD_ALLOC_FAILED; - TNF_PROBE_1(s1394_read_rest_of_cfgrom, - S1394_TNF_SL_HOTPLUG_ERROR, "", tnf_string, msg, - "command allocation failed"); } if (s1394_lock_tree(hal) != DDI_SUCCESS) { *status |= S1394_LOCK_FAILED; /* free if we allocated a cmd above */ if (((*status) & S1394_CMD_ALLOC_FAILED) == 0) (void) s1394_free_cmd(hal, (cmd1394_cmd_t **)&cmd); - TNF_PROBE_1(s1394_read_rest_of_cfgrom, - S1394_TNF_SL_HOTPLUG_ERROR, "", tnf_string, msg, - "unable to relock the tree"); } if (((*status) & (S1394_CMD_ALLOC_FAILED | S1394_LOCK_FAILED)) != 0) { - TNF_PROBE_0_DEBUG(s1394_read_rest_of_cfgrom_exit, - S1394_TNF_SL_HOTPLUG_STACK, ""); return (DDI_FAILURE); } @@ -876,17 +701,10 @@ s1394_read_rest_of_cfgrom(s1394_hal_t *hal, s1394_node_t *node, CMD1394_OVERRIDE_ADDR); cmd->cmd_type = CMD1394_ASYNCH_RD_QUAD; - TNF_PROBE_2_DEBUG(s1394_read_rest_of_cfgrom, S1394_TNF_SL_HOTPLUG_STACK, - "", tnf_uint, hal_gen, hal->generation_count, tnf_int, node_num, - node->node_num); - QUAD_TO_CFGROM_ADDR(IEEE1394_LOCAL_BUS, node_num, node->cfgrom_quad_to_read, cmd->cmd_addr); SETUP_QUAD_READ(node, 1, node->cfgrom_quad_to_read, 1); if (s1394_read_config_quadlet(hal, cmd, status) != DDI_SUCCESS) { - TNF_PROBE_1(s1394_read_rest_of_cfgrom_exit, - S1394_TNF_SL_HOTPLUG_ERROR, "", tnf_string, msg, - "unable to start read"); /* free the command if it wasn't handed over to the HAL */ if (((*status) & S1394_CMD_INFLIGHT) == 0) { (void) s1394_free_cmd(hal, (cmd1394_cmd_t **)&cmd); @@ -894,18 +712,12 @@ s1394_read_rest_of_cfgrom(s1394_hal_t *hal, s1394_node_t *node, if (((*status) & S1394_LOCK_FAILED) != 0) { ASSERT(MUTEX_NOT_HELD(&hal->topology_tree_mutex)); } - TNF_PROBE_0_DEBUG(s1394_read_rest_of_cfgrom_exit, - S1394_TNF_SL_HOTPLUG_STACK, ""); return (DDI_FAILURE); } hal->cfgroms_being_read++; ASSERT(MUTEX_HELD(&hal->topology_tree_mutex)); - TNF_PROBE_1_DEBUG(s1394_read_rest_of_cfgrom_exit, - S1394_TNF_SL_HOTPLUG_STACK, "", tnf_int, cfgrom_read_cnt, - hal->cfgroms_being_read); - return (DDI_SUCCESS); } @@ -930,14 +742,9 @@ s1394_cfgrom_scan_phase1(s1394_hal_t *hal) s1394_selfid_pkt_t *selfid_pkt; s1394_status_t status; - TNF_PROBE_0_DEBUG(s1394_cfgrom_scan_phase1_enter, - S1394_TNF_SL_HOTPLUG_STACK, ""); - ASSERT(MUTEX_NOT_HELD(&hal->topology_tree_mutex)); if (s1394_lock_tree(hal) != DDI_SUCCESS) { - TNF_PROBE_0_DEBUG(s1394_cfgrom_scan_phase1_exit, - S1394_TNF_SL_HOTPLUG_STACK, ""); return (DDI_FAILURE); } wait_for_cbs = 0; @@ -1007,12 +814,6 @@ s1394_cfgrom_scan_phase1(s1394_hal_t *hal) if (NODE_MATCHED(nnode) == B_TRUE && LINK_ACTIVE(onode) == B_TRUE) { CLEAR_CFGROM_STATE(nnode); - TNF_PROBE_3(s1394_cfgrom_scan_phase1, - S1394_TNF_SL_HOTPLUG_ERROR, - "", tnf_string, msg, - "link lost power", tnf_int, node, - node, tnf_int, onode, - onode->node_num); } } } else { @@ -1033,9 +834,6 @@ s1394_cfgrom_scan_phase1(s1394_hal_t *hal) ASSERT(MUTEX_NOT_HELD(&hal->topology_tree_mutex)); if ((status & S1394_LOCK_FAILED) != 0) { - TNF_PROBE_1(s1394_cfrom_scan_phase1_exit, - S1394_TNF_SL_HOTPLUG_STACK, "", - tnf_string, msg, "Generations changed"); return (DDI_FAILURE); } @@ -1049,9 +847,6 @@ s1394_cfgrom_scan_phase1(s1394_hal_t *hal) ASSERT(MUTEX_NOT_HELD(&hal->topology_tree_mutex)); - TNF_PROBE_0_DEBUG(s1394_cfrom_scan_phase1_exit, - S1394_TNF_SL_HOTPLUG_STACK, ""); - return (ret); } @@ -1088,18 +883,12 @@ s1394_br_thread_handle_cmd_phase1(s1394_hal_t *hal, cmd1394_cmd_t *cmd) s1394_get_quad_info(cmd, &node_num, &quadlet, &data); ASSERT(quadlet == 0 || quadlet < IEEE1394_BIB_QUAD_SZ); - TNF_PROBE_0_DEBUG(s1394_br_thread_handle_cmd_phase1_enter, - S1394_TNF_SL_HOTPLUG_STACK, ""); - cmdret = S1394_HCMD_NODE_EXPECT_MORE; locked = 1; freecmd = 1; if (s1394_lock_tree(hal) != DDI_SUCCESS) { - TNF_PROBE_1(s1394_br_thread_handle_cmd_phase1, - S1394_TNF_SL_HOTPLUG_STACK, "", tnf_string, msg, - "unable to lock tree"); locked = 0; goto bail; } @@ -1147,13 +936,6 @@ s1394_br_thread_handle_cmd_phase1(s1394_hal_t *hal, cmd1394_cmd_t *cmd) done++; } else { - TNF_PROBE_4(s1394_br_thread_handle_cmd_phase1, - S1394_TNF_SL_HOTPLUG_STACK, "", tnf_string, - msg, "config rom generation changed", - tnf_int, node_num, node_num, - tnf_int, cur_gen, cur_gen, tnf_int, old_gen, - CONFIG_ROM_GEN(node->cfgrom)); - SET_CFGROM_GEN_CHANGED(node); if (onode != NULL) SET_CFGROM_GEN_CHANGED(onode); @@ -1217,13 +999,6 @@ s1394_br_thread_handle_cmd_phase1(s1394_hal_t *hal, cmd1394_cmd_t *cmd) CFGROM_READ_PAUSE(readdelay); /* get next quadlet */ if (s1394_lock_tree(hal) != DDI_SUCCESS) { - TNF_PROBE_3( - s1394_br_thread_handle_cmd_phase1, - S1394_TNF_SL_HOTPLUG_STACK, "", - tnf_string, msg, - "unable to relock tree", tnf_uint, - node_num, node_num, tnf_int, - quad_to_read, quadlet); locked = 0; } else if (s1394_read_config_quadlet(hal, cmd, &status) != DDI_SUCCESS) { @@ -1233,13 +1008,6 @@ s1394_br_thread_handle_cmd_phase1(s1394_hal_t *hal, cmd1394_cmd_t *cmd) * don't free it (it will get freed * later in the callback). */ - TNF_PROBE_3( - s1394_br_thread_handle_cmd_phase1, - S1394_TNF_SL_HOTPLUG_STACK, "", - tnf_string, msg, - "unable to read", tnf_uint, - node_num, node_num, tnf_int, - quad_to_read, quadlet); if ((status & S1394_CMD_INFLIGHT) != 0) { freecmd = 0; @@ -1268,12 +1036,6 @@ s1394_br_thread_handle_cmd_phase1(s1394_hal_t *hal, cmd1394_cmd_t *cmd) SET_CFGROM_ALL_READ(node); node->cfgrom_quad_to_read = quadlet; done++; - TNF_PROBE_3_DEBUG( - s1394_br_thread_handle_cmd_phase1, - S1394_TNF_SL_HOTPLUG_STACK, - "", tnf_string, msg, "read bus info blk", - tnf_int, node_num, node->node_num, - tnf_opaque, cfgrom, node->cfgrom); } } } else { @@ -1288,13 +1050,6 @@ s1394_br_thread_handle_cmd_phase1(s1394_hal_t *hal, cmd1394_cmd_t *cmd) s1394_unlock_tree(hal); CFGROM_READ_PAUSE(readdelay); if (s1394_lock_tree(hal) != DDI_SUCCESS) { - TNF_PROBE_3( - s1394_br_thread_handle_cmd_phase1, - S1394_TNF_SL_HOTPLUG_ERROR, "", - tnf_string, msg, - "unable to relock tree", tnf_uint, - node_num, node_num, tnf_int, - quad_to_read, quadlet); locked = 0; } else if (s1394_read_config_quadlet(hal, cmd, &status) != DDI_SUCCESS) { @@ -1304,12 +1059,6 @@ s1394_br_thread_handle_cmd_phase1(s1394_hal_t *hal, cmd1394_cmd_t *cmd) * don't free it (it will get freed * later in the callback). */ - TNF_PROBE_3( - s1394_br_thread_handle_cmd_phase1, - S1394_TNF_SL_HOTPLUG_ERROR, "", tnf_string, - msg, "unable to re-read", tnf_uint, - node_num, node_num, tnf_int, quad_to_read, - quadlet); if ((status & S1394_CMD_INFLIGHT) != 0) { freecmd = 0; } @@ -1328,11 +1077,6 @@ s1394_br_thread_handle_cmd_phase1(s1394_hal_t *hal, cmd1394_cmd_t *cmd) freecmd = 0; } } else { - TNF_PROBE_4(s1394_br_thread_handle_cmd_phase1, - S1394_TNF_SL_HOTPLUG_STACK, "", tnf_string, msg, - "retries exceeded", tnf_int, node_num, node_num, - tnf_int, quadlet, quadlet, tnf_opaque, cfgrom, - node->cfgrom); if (CFGROM_NEW_ALLOC(node) == B_TRUE) { s1394_free_cfgrom(hal, node, S1394_FREE_CFGROM_NEW); @@ -1348,9 +1092,6 @@ bail: if (done) { cmdret = S1394_HCMD_NODE_DONE; - TNF_PROBE_2_DEBUG(s1394_br_thread_handle_cmd_phase1, - S1394_TNF_SL_HOTPLUG_STACK, "", tnf_string, msg, - "done with node", tnf_int, node_num, node_num); } /* if we are bailing out because locking failed, locked == 0 */ @@ -1359,9 +1100,6 @@ bail: else s1394_unlock_tree(hal); - TNF_PROBE_0_DEBUG(s1394_br_thread_handle_cmd_phase1_exit, - S1394_TNF_SL_HOTPLUG_STACK, ""); - return (cmdret); } @@ -1392,12 +1130,7 @@ s1394_cfgrom_scan_phase2(s1394_hal_t *hal) ASSERT(MUTEX_NOT_HELD(&hal->topology_tree_mutex)); - TNF_PROBE_0_DEBUG(s1394_cfgrom_scan_phase2_enter, - S1394_TNF_SL_HOTPLUG_STACK, ""); - if (s1394_lock_tree(hal) != DDI_SUCCESS) { - TNF_PROBE_0_DEBUG(s1394_cfgrom_scan_phase2_exit, - S1394_TNF_SL_HOTPLUG_STACK, ""); return (DDI_FAILURE); } @@ -1407,20 +1140,10 @@ s1394_cfgrom_scan_phase2(s1394_hal_t *hal) if (s1394_process_old_tree(hal) != DDI_SUCCESS) { ASSERT(MUTEX_NOT_HELD(&hal->topology_tree_mutex)); - TNF_PROBE_1(s1394_cfgrom_scan_phase2, - S1394_TNF_SL_HOTPLUG_ERROR, "", tnf_string, msg, - "non-success return from process_old_tree"); - TNF_PROBE_0_DEBUG(s1394_cfgrom_scan_phase2_exit, - S1394_TNF_SL_HOTPLUG_STACK, ""); return (DDI_FAILURE); } if (s1394_lock_tree(hal) != DDI_SUCCESS) { - TNF_PROBE_1(s1394_cfgrom_scan_phase2, - S1394_TNF_SL_HOTPLUG_ERROR, "", tnf_string, msg, - "unable to relock the tree"); - TNF_PROBE_0_DEBUG(s1394_cfgrom_scan_phase2_exit, - S1394_TNF_SL_HOTPLUG_STACK, ""); return (DDI_FAILURE); } @@ -1435,11 +1158,6 @@ s1394_cfgrom_scan_phase2(s1394_hal_t *hal) /* Notify targets of the end of bus reset processing */ if (s1394_lock_tree(hal) != DDI_SUCCESS) { - TNF_PROBE_1(s1394_cfgrom_scan_phase2, - S1394_TNF_SL_HOTPLUG_ERROR, "", tnf_string, msg, - "unable to relock the tree after isoch notify"); - TNF_PROBE_0_DEBUG(s1394_cfgrom_scan_phase2_exit, - S1394_TNF_SL_HOTPLUG_STACK, ""); return (DDI_FAILURE); } @@ -1449,11 +1167,6 @@ s1394_cfgrom_scan_phase2(s1394_hal_t *hal) s1394_unlock_tree(hal); s1394_target_bus_reset_notifies(hal, &localinfo); if (s1394_lock_tree(hal) != DDI_SUCCESS) { - TNF_PROBE_1(s1394_cfgrom_scan_phase2, - S1394_TNF_SL_HOTPLUG_ERROR, "", tnf_string, msg, - "unable to relock the tree after reset notify"); - TNF_PROBE_0_DEBUG(s1394_cfgrom_scan_phase2_exit, - S1394_TNF_SL_HOTPLUG_STACK, ""); return (DDI_FAILURE); } @@ -1469,21 +1182,11 @@ s1394_cfgrom_scan_phase2(s1394_hal_t *hal) s1394_resend_pending_cmds(hal); if (s1394_process_topology_tree(hal, &wait_for_cbs, &wait_gen)) { - TNF_PROBE_1(s1394_cfgrom_scan_phase2, - S1394_TNF_SL_HOTPLUG_ERROR, "", tnf_string, msg, - "non-success return from process_topology_tree"); - TNF_PROBE_0_DEBUG(s1394_cfgrom_scan_phase2_exit, - S1394_TNF_SL_HOTPLUG_STACK, ""); ASSERT(MUTEX_NOT_HELD(&hal->topology_tree_mutex)); return (DDI_FAILURE); } if (s1394_lock_tree(hal) != DDI_SUCCESS) { - TNF_PROBE_1(s1394_cfgrom_scan_phase2, - S1394_TNF_SL_HOTPLUG_ERROR, "", tnf_string, msg, - "unable to relock after processing topology tree"); - TNF_PROBE_0_DEBUG(s1394_cfgrom_scan_phase2_exit, - S1394_TNF_SL_HOTPLUG_STACK, ""); return (DDI_FAILURE); } @@ -1501,18 +1204,10 @@ s1394_cfgrom_scan_phase2(s1394_hal_t *hal) if (wait_for_cbs != 0) { ret = s1394_wait_for_cfgrom_callbacks(hal, wait_gen, s1394_br_thread_handle_cmd_phase2); - - TNF_PROBE_2_DEBUG(s1394_cfgrom_scan_phase2, - S1394_TNF_SL_HOTPLUG_STACK, "", tnf_string, msg, - "returned from waiting for cfgrom callbacks", tnf_int, ret, - ret); } ASSERT(MUTEX_NOT_HELD(&hal->topology_tree_mutex)); - TNF_PROBE_0_DEBUG(s1394_cfgrom_scan_phase2_exit, - S1394_TNF_SL_HOTPLUG_STACK, ""); - return (ret); } @@ -1539,9 +1234,6 @@ s1394_br_thread_handle_cmd_phase2(s1394_hal_t *hal, cmd1394_cmd_t *cmd) uchar_t readdelay; s1394_status_t status; - TNF_PROBE_0_DEBUG(s1394_br_thread_handle_cmd_phase2_enter, - S1394_TNF_SL_HOTPLUG_STACK, ""); - /* * we end up here if this is a brand new node or if it is a known node * but the config ROM changed (and triggered a re-read). @@ -1556,10 +1248,6 @@ s1394_br_thread_handle_cmd_phase2(s1394_hal_t *hal, cmd1394_cmd_t *cmd) update_devinfo = 0; if (s1394_lock_tree(hal) != DDI_SUCCESS) { - TNF_PROBE_3(s1394_br_thread_handle_cmd_phase2, - S1394_TNF_SL_HOTPLUG_ERROR, "", tnf_string, msg, - "unable to lock tree", tnf_int, node_num, node_num, - tnf_int, quadlet, quadlet); locked = 0; goto bail; } @@ -1577,12 +1265,6 @@ s1394_br_thread_handle_cmd_phase2(s1394_hal_t *hal, cmd1394_cmd_t *cmd) * Done with this node. Mark config rom valid and * update the devinfo tree for this node. */ - TNF_PROBE_4_DEBUG(s1394_br_thread_handle_cmd_phase2, - S1394_TNF_SL_HOTPLUG_STACK, "", tnf_string, msg, - "all read", tnf_int, node_num, node->node_num, - tnf_opaque, cfgrom, node->cfgrom, tnf_int, quadlet, - quadlet); - node->cfgrom_valid_size = quadlet + 1; if (s1394_valid_cfgrom(hal, node) == B_TRUE) { SET_CFGROM_ALL_READ(node); @@ -1598,20 +1280,9 @@ s1394_br_thread_handle_cmd_phase2(s1394_hal_t *hal, cmd1394_cmd_t *cmd) CFGROM_READ_PAUSE(readdelay); if (s1394_lock_tree(hal) != DDI_SUCCESS) { locked = 0; - TNF_PROBE_3(s1394_br_thread_handle_cmd_phase2, - S1394_TNF_SL_HOTPLUG_ERROR, "", tnf_string, - msg, "unable to relock the tree", - tnf_int, node_num, node->node_num, - tnf_int, quadlet, quadlet); } else if (s1394_read_config_quadlet(hal, cmd, &status) != DDI_SUCCESS) { /* give up on this guy */ - TNF_PROBE_3(s1394_br_thread_handle_cmd_phase2, - S1394_TNF_SL_HOTPLUG_ERROR, "", tnf_string, - msg, "cannot start quadlet read", tnf_int, - node_num, node_num, tnf_int, quadlet, - quadlet); - if ((status & S1394_CMD_INFLIGHT) != 0) { freecmd = 0; } @@ -1646,11 +1317,6 @@ s1394_br_thread_handle_cmd_phase2(s1394_hal_t *hal, cmd1394_cmd_t *cmd) CFGROM_READ_PAUSE(readdelay); if (s1394_lock_tree(hal) != DDI_SUCCESS) { locked = 0; - TNF_PROBE_3(s1394_br_thread_handle_cmd_phase2, - S1394_TNF_SL_HOTPLUG_ERROR, "", tnf_string, - msg, "unable to relock for reread", - tnf_int, node_num, node->node_num, - tnf_int, quadlet, quadlet); } else if (s1394_read_config_quadlet(hal, cmd, &status) != DDI_SUCCESS) { if ((status & S1394_CMD_INFLIGHT) != 0) { @@ -1660,13 +1326,6 @@ s1394_br_thread_handle_cmd_phase2(s1394_hal_t *hal, cmd1394_cmd_t *cmd) locked = 0; } else { /* stop further reads */ - TNF_PROBE_4( - s1394_br_thread_handle_cmd_phase2, - S1394_TNF_SL_HOTPLUG_ERROR, "", - tnf_string, msg, "unable to retry", - tnf_int, node_num, node->node_num, - tnf_int, quadlet, quadlet, - tnf_opaque, cfgrom, node->cfgrom); node->cfgrom_valid_size = quadlet + 1; if (s1394_valid_cfgrom(hal, node) == B_TRUE) { @@ -1683,13 +1342,6 @@ s1394_br_thread_handle_cmd_phase2(s1394_hal_t *hal, cmd1394_cmd_t *cmd) freecmd = 0; } } else { - - TNF_PROBE_4(s1394_br_thread_handle_cmd_phase2, - S1394_TNF_SL_HOTPLUG_ERROR, "", tnf_string, msg, - "retries exceeded", tnf_int, node_num, node_num, - tnf_int, quadlet, quadlet, tnf_opaque, cfgrom, - node->cfgrom); - node->cfgrom_valid_size = quadlet + 1; if (s1394_valid_cfgrom(hal, node) == B_TRUE) { SET_CFGROM_ALL_READ(node); @@ -1707,9 +1359,6 @@ bail: if (done) { cmdret = S1394_HCMD_NODE_DONE; - TNF_PROBE_2_DEBUG(s1394_br_thread_handle_cmd_phase2, - S1394_TNF_SL_HOTPLUG_STACK, "", tnf_string, msg, - "done with a node", tnf_int, node_num, node_num); } if (update_devinfo) { @@ -1723,10 +1372,6 @@ bail: if (s1394_update_devinfo_tree(hal, node) != DDI_SUCCESS) { ASSERT(MUTEX_NOT_HELD(&hal->topology_tree_mutex)); locked = 0; - TNF_PROBE_2(s1394_br_thread_handle_cmd_phase2, - S1394_TNF_SL_HOTPLUG_ERROR, "", tnf_string, msg, - "update devinfo returned failure", tnf_int, - node_num, node_num); } } @@ -1736,9 +1381,6 @@ bail: else s1394_unlock_tree(hal); - TNF_PROBE_1_DEBUG(s1394_br_thread_handle_cmd_phase2_exit, - S1394_TNF_SL_HOTPLUG_STACK, "", tnf_int, cmdret, (int)cmdret); - return (cmdret); } @@ -1760,10 +1402,6 @@ s1394_read_config_quadlet(s1394_hal_t *hal, cmd1394_cmd_t *cmd, node = &hal->topology_tree[node_num]; quadlet = node->cfgrom_quad_to_read; - TNF_PROBE_2_DEBUG(s1394_read_config_quadlet_enter, - S1394_TNF_SL_HOTPLUG_STACK, "", tnf_uint, node_num, node_num, - tnf_uint, quadlet, quadlet); - /* Calculate the 64-bit address */ QUAD_TO_CFGROM_ADDR(IEEE1394_LOCAL_BUS, node_num, quadlet, cmd->cmd_addr); @@ -1775,12 +1413,6 @@ s1394_read_config_quadlet(s1394_hal_t *hal, cmd1394_cmd_t *cmd, if (ret != DDI_SUCCESS) { *status |= S1394_UNKNOWN; ASSERT(MUTEX_HELD(&hal->topology_tree_mutex)); - TNF_PROBE_3(s1394_read_config_quadlet, - S1394_TNF_SL_HOTPLUG_ERROR, "", tnf_string, msg, - "failure from setup asynch command", tnf_uint, node_num, - node_num, tnf_uint, quadlet, quadlet); - TNF_PROBE_0_DEBUG(s1394_read_config_quadlet_exit, - S1394_TNF_SL_HOTPLUG_STACK, ""); return (DDI_FAILURE); } @@ -1794,11 +1426,6 @@ s1394_read_config_quadlet(s1394_hal_t *hal, cmd1394_cmd_t *cmd, s1394_cmd_priv_t *s_priv; - TNF_PROBE_3(s1394_read_config_quadlet, - S1394_TNF_SL_HOTPLUG_ERROR, "", tnf_string, msg, - "failure from xfer asynch command", - tnf_int, quadlet, quadlet, tnf_int, node_num, node_num); - /* Remove from queue */ s1394_remove_q_asynch_cmd(hal, cmd); s_priv = S1394_GET_CMD_PRIV(cmd); @@ -1812,14 +1439,8 @@ s1394_read_config_quadlet(s1394_hal_t *hal, cmd1394_cmd_t *cmd, if (s1394_lock_tree(hal) != DDI_SUCCESS) { *status |= S1394_LOCK_FAILED; ret = DDI_FAILURE; - TNF_PROBE_1(s1394_read_config_quadlet, - S1394_TNF_SL_HOTPLUG_ERROR, "", tnf_string, msg, - "unable to relock the tree"); } - TNF_PROBE_0_DEBUG(s1394_read_config_quadlet_exit, - S1394_TNF_SL_HOTPLUG_STACK, ""); - return (ret); } @@ -1840,9 +1461,6 @@ s1394_cfgrom_read_callback(cmd1394_cmd_t *cmd) uint32_t node_num, quadlet, data; #endif - TNF_PROBE_0_DEBUG(s1394_cfgrom_read_callback_enter, - S1394_TNF_SL_HOTPLUG_STACK, ""); - /* Get the Services Layer private area */ s_priv = S1394_GET_CMD_PRIV(cmd); @@ -1852,11 +1470,6 @@ s1394_cfgrom_read_callback(cmd1394_cmd_t *cmd) s1394_get_quad_info(cmd, &node_num, &quadlet, &data); - TNF_PROBE_5_DEBUG(s1394_cfgrom_read_callback, - S1394_TNF_SL_HOTPLUG_STACK, "", tnf_uint, gen, cmd->bus_generation, - tnf_int, quadlet, quadlet, - tnf_int, node_num, node_num, - tnf_int, data, data, tnf_int, result, cmd->cmd_result); #endif if (cmd->cmd_result == CMD1394_EBUSRESET) { @@ -1880,9 +1493,6 @@ s1394_cfgrom_read_callback(cmd1394_cmd_t *cmd) cv_signal(&hal->br_cmplq_cv); mutex_exit(&hal->br_cmplq_mutex); } - - TNF_PROBE_0_DEBUG(s1394_cfgrom_read_callback_exit, - S1394_TNF_SL_HOTPLUG_STACK, ""); } /* @@ -1897,11 +1507,7 @@ void s1394_cfgrom_parse_unit_dir(uint32_t *unit_dir, uint32_t *addr_hi, uint32_t *addr_lo, uint32_t *size_hi, uint32_t *size_lo) { - TNF_PROBE_0_DEBUG(s1394_cfgrom_parse_unit_dir_enter, - S1394_TNF_SL_HOTPLUG_STACK, ""); *addr_hi = *addr_lo = *size_hi = *size_lo = 0; - TNF_PROBE_0_DEBUG(s1394_cfgrom_parse_unit_dir_exit, - S1394_TNF_SL_HOTPLUG_STACK, ""); } /* @@ -1914,18 +1520,12 @@ s1394_get_quad_info(cmd1394_cmd_t *cmd, uint32_t *node_num, uint32_t *quadlet, { uint64_t addr; - TNF_PROBE_0_DEBUG(s1394_get_quad_info_enter, - S1394_TNF_SL_HOTPLUG_STACK, ""); - addr = cmd->cmd_addr; *node_num = IEEE1394_ADDR_PHY_ID(addr); *quadlet = ((addr & IEEE1394_ADDR_OFFSET_MASK) - IEEE1394_CONFIG_ROM_ADDR); *quadlet = (*quadlet >> 2); *data = T1394_DATA32(cmd->cmd_u.q.quadlet_data); - - TNF_PROBE_0_DEBUG(s1394_get_quad_info_exit, - S1394_TNF_SL_HOTPLUG_STACK, ""); } /* @@ -1948,9 +1548,6 @@ s1394_match_GUID(s1394_hal_t *hal, s1394_node_t *nnode) s1394_target_t *t; int ret = DDI_SUCCESS; - TNF_PROBE_0_DEBUG(s1394_match_GUID_enter, S1394_TNF_SL_HOTPLUG_STACK, - ""); - ASSERT(nnode->cfgrom != NULL); ASSERT(CFGROM_BIB_READ(nnode)); @@ -1969,12 +1566,6 @@ s1394_match_GUID(s1394_hal_t *hal, s1394_node_t *nnode) if ((old_a == new_a) && (old_b == new_b)) { if (NODE_MATCHED(onode) == B_TRUE) { - TNF_PROBE_4(s1394_match_GUID_duplicate, - S1394_TNF_SL_HOTPLUG_ERROR, "", - tnf_uint, guid_hi, old_a, - tnf_uint, guid_lo, old_b, - tnf_uint, old_node_num, old_node, - tnf_uint, node_num, nnode->node_num); cmn_err(CE_NOTE, "!Duplicate GUIDs: %08x%08x", old_a, old_b); /* offline the new node that last matched */ @@ -1996,13 +1587,6 @@ s1394_match_GUID(s1394_hal_t *hal, s1394_node_t *nnode) (CONFIG_ROM_GEN(onode->cfgrom) != CONFIG_ROM_GEN(nnode->cfgrom))) { gen_changed = 1; - TNF_PROBE_4_DEBUG(s1394_match_GUID_gen_change, - S1394_TNF_SL_HOTPLUG_STACK, "", - tnf_opaque, old_cfgrom, onode->cfgrom, - tnf_int, old_gen, - CONFIG_ROM_GEN(onode->cfgrom), tnf_opaque, - cfgrom, nnode->cfgrom, tnf_int, new_gen, - CONFIG_ROM_GEN(nnode->cfgrom)); } else { gen_changed = 0; } @@ -2026,10 +1610,6 @@ s1394_match_GUID(s1394_hal_t *hal, s1394_node_t *nnode) ret = DDI_FAILURE; break; } - TNF_PROBE_2(s1394_match_GUID_gen_freecfg, - S1394_TNF_SL_HOTPLUG_STACK, "", - tnf_opaque, old_cfgrom, onode->cfgrom, - tnf_opaque, new_cfgrom, nnode->cfgrom); s1394_free_cfgrom(hal, onode, S1394_FREE_CFGROM_OLD); CLEAR_CFGROM_PARSED(nnode); @@ -2045,16 +1625,6 @@ s1394_match_GUID(s1394_hal_t *hal, s1394_node_t *nnode) * point it at the same config rom as the old one. */ if (onode->cfgrom != nnode->cfgrom) { - - TNF_PROBE_5_DEBUG(s1394_match_GUID, - S1394_TNF_SL_HOTPLUG_STACK, "", - tnf_int, node_num, nnode->node_num, - tnf_opaque, cfgrom, nnode->cfgrom, - tnf_int, old_node_num, old_node, - tnf_opaque, old_cfgrom, onode->cfgrom, - tnf_uint, cfgrom_state, - nnode->cfgrom_state); - ASSERT(CFGROM_NEW_ALLOC(nnode) == B_TRUE); s1394_free_cfgrom(hal, nnode, S1394_FREE_CFGROM_NEW); @@ -2086,9 +1656,6 @@ s1394_match_GUID(s1394_hal_t *hal, s1394_node_t *nnode) } } - TNF_PROBE_0_DEBUG(s1394_match_GUID_exit, S1394_TNF_SL_HOTPLUG_STACK, - ""); - return (ret); } @@ -2105,9 +1672,6 @@ s1394_match_all_GUIDs(s1394_hal_t *hal) int ret = DDI_SUCCESS; s1394_node_t *nnode; - TNF_PROBE_0_DEBUG(s1394_match_all_GUIDs_enter, - S1394_TNF_SL_HOTPLUG_STACK, ""); - ASSERT(MUTEX_HELD(&hal->topology_tree_mutex)); for (node = 0; node < hal->number_of_nodes; node++) { @@ -2137,9 +1701,6 @@ s1394_match_all_GUIDs(s1394_hal_t *hal) } } - TNF_PROBE_0_DEBUG(s1394_match_all_GUIDs_exit, - S1394_TNF_SL_HOTPLUG_STACK, ""); - return (ret); } @@ -2154,16 +1715,10 @@ s1394_valid_cfgrom(s1394_hal_t *hal, s1394_node_t *node) { uint32_t crc_len, crc_value, CRC, CRC_old, quad0; - TNF_PROBE_0_DEBUG(s1394_valid_cfgrom_enter, S1394_TNF_SL_HOTPLUG_STACK, - ""); - ASSERT(MUTEX_HELD(&hal->topology_tree_mutex)); ASSERT(node->cfgrom); if (s1394_enable_crc_validation == 0) { - TNF_PROBE_1_DEBUG(s1394_valid_cfgrom_exit, - S1394_TNF_SL_HOTPLUG_STACK, "", tnf_string, msg, - "validation turned off"); return (B_TRUE); } @@ -2173,14 +1728,6 @@ s1394_valid_cfgrom(s1394_hal_t *hal, s1394_node_t *node) crc_value = quad0 & IEEE1394_CFG_ROM_CRC_VALUE_MASK; if (node->cfgrom_valid_size < crc_len + 1) { - TNF_PROBE_4(s1394_valid_cfgrom_not_enough, - S1394_TNF_SL_HOTPLUG_ERROR, "", - tnf_uint, node_guid_hi, node->node_guid_hi, - tnf_uint, node_guid_lo, node->node_guid_lo, - tnf_uint, crc_len, crc_len, - tnf_uint, valid_size, node->cfgrom_valid_size); - TNF_PROBE_0_DEBUG(s1394_valid_cfgrom_exit, - S1394_TNF_SL_HOTPLUG_STACK, ""); return (B_FALSE); } @@ -2189,14 +1736,6 @@ s1394_valid_cfgrom(s1394_hal_t *hal, s1394_node_t *node) if (CRC != crc_value) { CRC_old = s1394_CRC16_old(&node->cfgrom[1], crc_len); if (CRC_old == crc_value) { - TNF_PROBE_4_DEBUG(s1394_valid_cfgrom_busted_crc, - S1394_TNF_SL_HOTPLUG_ERROR, "", - tnf_uint, node_guid_hi, node->node_guid_hi, - tnf_uint, node_guid_lo, node->node_guid_lo, - tnf_uint, node_num, node->node_num, - tnf_uint, crc_len, crc_len); - TNF_PROBE_0_DEBUG(s1394_valid_cfgrom_exit, - S1394_TNF_SL_HOTPLUG_STACK, ""); return (B_TRUE); } @@ -2204,21 +1743,9 @@ s1394_valid_cfgrom(s1394_hal_t *hal, s1394_node_t *node) "!Bad CRC in config rom (node's GUID %08x%08x)", node->node_guid_hi, node->node_guid_lo); - TNF_PROBE_5(s1394_valid_cfgrom_bad_crc, - S1394_TNF_SL_HOTPLUG_ERROR, "", - tnf_uint, node_guid_hi, node->node_guid_hi, - tnf_uint, node_guid_lo, node->node_guid_lo, - tnf_uint, crc_len, crc_len, - tnf_uint, crc, crc_value, tnf_uint, crc_computed, CRC); - TNF_PROBE_0_DEBUG(s1394_valid_cfgrom_exit, - S1394_TNF_SL_HOTPLUG_STACK, ""); return (B_FALSE); } - TNF_PROBE_3_DEBUG(s1394_valid_cfgrom_exit, S1394_TNF_SL_HOTPLUG_STACK, - "", tnf_uint, node_num, node->node_num, tnf_uint, crc_len, crc_len, - tnf_uint, crc, crc_value); - return (B_TRUE); } @@ -2234,9 +1761,6 @@ s1394_valid_dir(s1394_hal_t *hal, s1394_node_t *node, { uint32_t dir_len, crc_value, CRC, CRC_old, quad0; - TNF_PROBE_0_DEBUG(s1394_valid_dir_enter, S1394_TNF_SL_HOTPLUG_STACK, - ""); - /* * Ideally, we would like to do crc validations for the entire cfgrom * as well as the individual directories. However, we have seen devices @@ -2245,9 +1769,6 @@ s1394_valid_dir(s1394_hal_t *hal, s1394_node_t *node, * is sad, but unfortunately, real world! */ if (s1394_enable_crc_validation == 0) { - TNF_PROBE_1_DEBUG(s1394_valid_dir_exit, - S1394_TNF_SL_HOTPLUG_STACK, "", tnf_string, msg, - "validation turned off"); return (B_TRUE); } @@ -2263,35 +1784,12 @@ s1394_valid_dir(s1394_hal_t *hal, s1394_node_t *node, if (CRC != crc_value) { CRC_old = s1394_CRC16_old(&dir[1], dir_len); if (CRC_old == crc_value) { - TNF_PROBE_5_DEBUG(s1394_valid_dir_crc_old, - S1394_TNF_SL_HOTPLUG_STACK, "", - tnf_uint, node_guid_hi, node->node_guid_hi, - tnf_uint, node_guid_lo, node->node_guid_lo, - tnf_uint, node_num, node->node_num, - tnf_uint, key, key, tnf_uint, dir_len, dir_len); - TNF_PROBE_0_DEBUG(s1394_valid_dir_exit, - S1394_TNF_SL_HOTPLUG_STACK, ""); return (B_TRUE); } - TNF_PROBE_5(s1394_valid_dir_bad_crc, - S1394_TNF_SL_HOTPLUG_STACK, "", - tnf_uint, node_guid_hi, node->node_guid_hi, - tnf_uint, node_guid_lo, node->node_guid_lo, - tnf_uint, node_num, node->node_num, - tnf_uint, key, key, tnf_uint, dir_len, dir_len); - - TNF_PROBE_0_DEBUG(s1394_valid_dir_exit, - S1394_TNF_SL_HOTPLUG_STACK, ""); return (B_FALSE); } - TNF_PROBE_4_DEBUG(s1394_valid_dir, - S1394_TNF_SL_HOTPLUG_STACK, "", - tnf_uint, node_guid_hi, node->node_guid_hi, - tnf_uint, node_guid_lo, node->node_guid_lo, - tnf_uint, node_num, node->node_num, tnf_uint, key, key); - return (B_TRUE); } @@ -2322,9 +1820,6 @@ s1394_become_bus_mgr(void *arg) int err; int ret; - TNF_PROBE_0_DEBUG(s1394_become_bus_mgr_enter, S1394_TNF_SL_BR_STACK, - ""); - hal = (s1394_hal_t *)arg; /* Lock the topology tree */ @@ -2343,8 +1838,6 @@ s1394_become_bus_mgr(void *arg) /* Make sure we aren't already the Bus Manager */ if (bm_node != -1) { - TNF_PROBE_0_DEBUG(s1394_become_bus_mgr_exit, - S1394_TNF_SL_BR_STACK, ""); return; } @@ -2357,11 +1850,6 @@ s1394_become_bus_mgr(void *arg) IEEE1394_CSR_OFFSET_MASK), S1394_INVALID_NODE_NUM, hal_node_num, &old_value); if (ret != DDI_SUCCESS) { - TNF_PROBE_1(s1394_become_bus_mgr_error, - S1394_TNF_SL_BR_ERROR, "", tnf_string, msg, - "Error in cswap32"); - TNF_PROBE_0_DEBUG(s1394_become_bus_mgr_exit, - S1394_TNF_SL_BR_STACK, ""); return; } curr_bus_mgr = IEEE1394_NODE_NUM(old_value); @@ -2382,11 +1870,6 @@ s1394_become_bus_mgr(void *arg) /* Remote */ if (s1394_alloc_cmd(hal, T1394_ALLOC_CMD_NOSLEEP, &cmd) != DDI_SUCCESS) { - TNF_PROBE_1(s1394_become_bus_mgr_error, - S1394_TNF_SL_BR_ERROR, "", tnf_string, msg, - "Error in s1394_alloc_cmd()"); - TNF_PROBE_0_DEBUG(s1394_become_bus_mgr_exit, - S1394_TNF_SL_BR_STACK, ""); return; } @@ -2421,11 +1904,6 @@ s1394_become_bus_mgr(void *arg) if (ret != DDI_SUCCESS) { /* Need to free the command */ (void) s1394_free_cmd(hal, (cmd1394_cmd_t **)&cmd); - TNF_PROBE_1(s1394_become_bus_mgr_error, - S1394_TNF_SL_BR_ERROR, "", tnf_string, msg, - "Error in s1394_setup_asynch_command()"); - TNF_PROBE_0_DEBUG(s1394_become_bus_mgr_exit, - S1394_TNF_SL_BR_STACK, ""); return; } @@ -2451,9 +1929,6 @@ s1394_become_bus_mgr(void *arg) (void) s1394_free_cmd(hal, (cmd1394_cmd_t **)&cmd); } } - - TNF_PROBE_0_DEBUG(s1394_become_bus_mgr_exit, S1394_TNF_SL_BR_STACK, - ""); } /* @@ -2474,9 +1949,6 @@ s1394_become_bus_mgr_callback(cmd1394_cmd_t *cmd) uint32_t temp; uint_t curr_bus_mgr; - TNF_PROBE_0_DEBUG(s1394_become_bus_mgr_callback_enter, - S1394_TNF_SL_BR_STACK, ""); - /* Get the Services Layer private area */ s_priv = S1394_GET_CMD_PRIV(cmd); @@ -2506,11 +1978,6 @@ s1394_become_bus_mgr_callback(cmd1394_cmd_t *cmd) mutex_exit(&hal->bus_mgr_node_mutex); } else { - TNF_PROBE_2(s1394_become_bus_mgr_callback_error, - S1394_TNF_SL_BR_ERROR, "", tnf_string, msg, - "Error while attempting to become bus manager", - tnf_uint, status, cmd->cmd_result); - mutex_enter(&hal->bus_mgr_node_mutex); /* Don't know who the bus_mgr is */ @@ -2526,9 +1993,6 @@ s1394_become_bus_mgr_callback(cmd1394_cmd_t *cmd) /* Unlock the topology tree */ mutex_exit(&hal->topology_tree_mutex); - - TNF_PROBE_0_DEBUG(s1394_become_bus_mgr_callback_exit, - S1394_TNF_SL_BR_STACK, ""); } /* @@ -2546,9 +2010,6 @@ s1394_bus_mgr_processing(s1394_hal_t *hal) int ret; int IRM_node_num; - TNF_PROBE_0_DEBUG(s1394_bus_mgr_processing_enter, - S1394_TNF_SL_BR_STACK, ""); - ASSERT(MUTEX_NOT_HELD(&hal->topology_tree_mutex)); if (s1394_lock_tree(hal) != DDI_SUCCESS) { @@ -2570,8 +2031,6 @@ s1394_bus_mgr_processing(s1394_hal_t *hal) ASSERT(MUTEX_NOT_HELD(&hal->topology_tree_mutex)); - TNF_PROBE_0_DEBUG(s1394_bus_mgr_processing_exit, - S1394_TNF_SL_BR_STACK, ""); return (ret); } @@ -2597,9 +2056,6 @@ s1394_do_bus_mgr_processing(s1394_hal_t *hal) uint_t hal_node_num, number_of_nodes; int new_root, new_gap_cnt; - TNF_PROBE_0_DEBUG(s1394_do_bus_mgr_processing_enter, - S1394_TNF_SL_BR_STACK, ""); - ASSERT(MUTEX_NOT_HELD(&hal->topology_tree_mutex)); /* Wait for Bus Manager to be determined */ @@ -2615,8 +2071,6 @@ s1394_do_bus_mgr_processing(s1394_hal_t *hal) mutex_exit(&hal->br_thread_mutex); mutex_exit(&hal->bus_mgr_node_mutex); - TNF_PROBE_0_DEBUG(s1394_do_bus_mgr_processing_exit, - S1394_TNF_SL_BR_STACK, ""); return (1); } mutex_exit(&hal->br_thread_mutex); @@ -2670,15 +2124,11 @@ s1394_do_bus_mgr_processing(s1394_hal_t *hal) ret = s1394_do_phy_config_pkt(hal, new_root, new_gap_cnt, IRM_flags); } - TNF_PROBE_0_DEBUG(s1394_do_bus_mgr_processing_exit, - S1394_TNF_SL_BR_STACK, ""); return (ret); } s1394_unlock_tree(hal); - TNF_PROBE_0_DEBUG(s1394_do_bus_mgr_processing_exit, - S1394_TNF_SL_BR_STACK, ""); return (ret); } @@ -2691,9 +2141,6 @@ static void s1394_bus_mgr_timers_stop(s1394_hal_t *hal, timeout_id_t *bus_mgr_query_tid, timeout_id_t *bus_mgr_tid) { - TNF_PROBE_0_DEBUG(s1394_bus_mgr_timers_stop_enter, - S1394_TNF_SL_BR_STACK, ""); - /* Cancel the Bus Mgr timeouts (if necessary) */ if (*bus_mgr_tid != 0) { (void) untimeout(*bus_mgr_tid); @@ -2703,9 +2150,6 @@ s1394_bus_mgr_timers_stop(s1394_hal_t *hal, timeout_id_t *bus_mgr_query_tid, (void) untimeout(*bus_mgr_query_tid); *bus_mgr_query_tid = 0; } - - TNF_PROBE_0_DEBUG(s1394_bus_mgr_timers_stop_exit, - S1394_TNF_SL_BR_STACK, ""); } /* @@ -2720,9 +2164,6 @@ s1394_bus_mgr_timers_start(s1394_hal_t *hal, timeout_id_t *bus_mgr_query_tid, uint_t hal_node_num; int IRM_node_num; - TNF_PROBE_0_DEBUG(s1394_bus_mgr_timers_start_enter, - S1394_TNF_SL_BR_STACK, ""); - mutex_enter(&hal->topology_tree_mutex); IRM_node_num = hal->IRM_node; @@ -2740,9 +2181,6 @@ s1394_bus_mgr_timers_start(s1394_hal_t *hal, timeout_id_t *bus_mgr_query_tid, */ if (IRM_node_num == IEEE1394_NODE_NUM(hal_node_num)) { - TNF_PROBE_0_DEBUG(s1394_bus_mgr_timers_625ms, - S1394_TNF_SL_BR_STACK, ""); - mutex_exit(&hal->topology_tree_mutex); /* Wait 625ms, then check bus manager */ @@ -2765,9 +2203,6 @@ s1394_bus_mgr_timers_start(s1394_hal_t *hal, timeout_id_t *bus_mgr_query_tid, } else { hal->abdicate_bus_mgr_bit = 0; - TNF_PROBE_0_DEBUG(s1394_bus_mgr_timers_125ms, - S1394_TNF_SL_BR_STACK, ""); - mutex_exit(&hal->topology_tree_mutex); /* Wait 125ms, then try to become bus manager */ @@ -2785,9 +2220,6 @@ s1394_bus_mgr_timers_start(s1394_hal_t *hal, timeout_id_t *bus_mgr_query_tid, } mutex_exit(&hal->topology_tree_mutex); - - TNF_PROBE_0_DEBUG(s1394_bus_mgr_timers_start_exit, - S1394_TNF_SL_BR_STACK, ""); } /* @@ -2816,9 +2248,6 @@ s1394_get_maxpayload(s1394_target_t *target, uint_t *dev_max_payload, uint_t speed_max_blk; uint_t temp; - TNF_PROBE_0_DEBUG(s1394_get_maxpayload_enter, - S1394_TNF_SL_HOTPLUG_STACK, ""); - /* Find the HAL this target resides on */ hal = target->on_hal; @@ -2869,9 +2298,6 @@ s1394_get_maxpayload(s1394_target_t *target, uint_t *dev_max_payload, (*dev_max_payload) = local_max_blk; (*current_max_payload) = local_max_blk; } - - TNF_PROBE_0_DEBUG(s1394_get_maxpayload_exit, - S1394_TNF_SL_HOTPLUG_STACK, ""); } /* @@ -2888,9 +2314,6 @@ s1394_cycle_master_capable(s1394_hal_t *hal) int cycle_master_capable; uint_t hal_node_num; - TNF_PROBE_0_DEBUG(s1394_cycle_master_capable_enter, - S1394_TNF_SL_HOTPLUG_STACK, ""); - ASSERT(MUTEX_HELD(&hal->topology_tree_mutex)); hal_node_num = IEEE1394_NODE_NUM(hal->node_id); @@ -2900,9 +2323,6 @@ s1394_cycle_master_capable(s1394_hal_t *hal) /* Ignore, if we are already root */ if (root == &hal->topology_tree[hal_node_num]) { - TNF_PROBE_2_DEBUG(s1394_cmstr_capable_hal, - S1394_TNF_SL_HOTPLUG_STACK, "", tnf_int, - node_num, hal_node_num, tnf_int, ret, 1); return (1); } @@ -2913,12 +2333,6 @@ s1394_cycle_master_capable(s1394_hal_t *hal) if (LINK_ACTIVE(root) == B_FALSE || root->cfgrom == NULL || CFGROM_BIB_READ(root) == 0) { - TNF_PROBE_4_DEBUG(s1394_cmstr_capable_not_hal, - S1394_TNF_SL_HOTPLUG_STACK, "", tnf_int, - root, root->node_num, tnf_int, link_active, - LINK_ACTIVE(root), tnf_opaque, cfgrom, root->cfgrom, - tnf_int, bib, CFGROM_BIB_READ(root)); - return (0); } @@ -2927,14 +2341,8 @@ s1394_cycle_master_capable(s1394_hal_t *hal) IEEE1394_BIB_CMC_MASK; if (cycle_master_capable) { - TNF_PROBE_1_DEBUG(s1394_cmstr_capable_root, - S1394_TNF_SL_HOTPLUG_STACK, "", tnf_int, - root, root->node_num); return (1); } else { - TNF_PROBE_1(s1394_cmstr_not_capable_root, - S1394_TNF_SL_HOTPLUG_STACK, "", tnf_int, - root, root->node_num); return (0); } } @@ -2962,9 +2370,6 @@ s1394_do_phy_config_pkt(s1394_hal_t *hal, int new_root, int new_gap_cnt, int ret, result; uint_t flags = 0; - TNF_PROBE_0_DEBUG(s1394_do_phy_config_pkt_enter, - S1394_TNF_SL_HOTPLUG_STACK, ""); - /* Gap count needs to be optimized */ if (IRM_flags & GAP_COUNT) { @@ -2994,19 +2399,12 @@ s1394_do_phy_config_pkt(s1394_hal_t *hal, int new_root, int new_gap_cnt, if (IRM_flags) { if (s1394_alloc_cmd(hal, flags, &cmd) != DDI_SUCCESS) { - TNF_PROBE_1_DEBUG(s1394_do_phy_config_pkt_error, - S1394_TNF_SL_HOTPLUG_STACK, "", tnf_string, msg, - "Unable to allocate PHY config packet"); - TNF_PROBE_0_DEBUG(s1394_do_phy_config_pkt_exit, - S1394_TNF_SL_HOTPLUG_STACK, ""); return (0); } if (s1394_lock_tree(hal) != DDI_SUCCESS) { /* lock tree failure indicates a bus gen change */ (void) s1394_free_cmd(hal, (cmd1394_cmd_t **)&cmd); - TNF_PROBE_0_DEBUG(s1394_do_phy_config_pkt_exit, - S1394_TNF_SL_HOTPLUG_STACK, ""); return (1); } @@ -3045,15 +2443,8 @@ s1394_do_phy_config_pkt(s1394_hal_t *hal, int new_root, int new_gap_cnt, (h1394_cmd_priv_t *)&s_priv->hal_cmd_private, &result); if (ret != DDI_SUCCESS) { - TNF_PROBE_2_DEBUG(s1394_do_phy_config_pkt_error, - S1394_TNF_SL_HOTPLUG_STACK, "", tnf_string, msg, - "Unable to send PHY config packet", - tnf_int, result, result); - (void) s1394_free_cmd(hal, (cmd1394_cmd_t **)&cmd); - TNF_PROBE_0_DEBUG(s1394_do_phy_config_pkt_exit, - S1394_TNF_SL_HOTPLUG_STACK, ""); return (0); } else { @@ -3066,8 +2457,6 @@ s1394_do_phy_config_pkt(s1394_hal_t *hal, int new_root, int new_gap_cnt, } } - TNF_PROBE_0_DEBUG(s1394_do_phy_config_pkt_exit, - S1394_TNF_SL_HOTPLUG_STACK, ""); return (0); } @@ -3085,9 +2474,6 @@ s1394_phy_config_callback(cmd1394_cmd_t *cmd) s1394_hal_t *hal; uint32_t IRM_flags; - TNF_PROBE_0_DEBUG(s1394_phy_config_callback_enter, - S1394_TNF_SL_HOTPLUG_STACK, ""); - /* Get the Services Layer private area */ s_priv = S1394_GET_CMD_PRIV(cmd); @@ -3096,10 +2482,6 @@ s1394_phy_config_callback(cmd1394_cmd_t *cmd) IRM_flags = (uint32_t)(uintptr_t)cmd->cmd_callback_arg; if (cmd->cmd_result != CMD1394_CMDSUCCESS) { - TNF_PROBE_2_DEBUG(s1394_do_phy_config_pkt_error, - S1394_TNF_SL_HOTPLUG_STACK, "", tnf_string, msg, - "Error sending PHY config packet", - tnf_int, result, cmd->cmd_result); (void) s1394_free_cmd(hal, &cmd); } else { (void) s1394_free_cmd(hal, &cmd); @@ -3109,9 +2491,6 @@ s1394_phy_config_callback(cmd1394_cmd_t *cmd) s1394_initiate_hal_reset(hal, NON_CRITICAL); } } - - TNF_PROBE_0_DEBUG(s1394_phy_config_callback_exit, - S1394_TNF_SL_HOTPLUG_STACK, ""); } /* @@ -3128,32 +2507,16 @@ s1394_lock_tree(s1394_hal_t *hal) ASSERT(MUTEX_NOT_HELD(&hal->br_thread_mutex)); ASSERT(MUTEX_NOT_HELD(&hal->topology_tree_mutex)); - TNF_PROBE_0_DEBUG(s1394_lock_tree_enter, S1394_TNF_SL_HOTPLUG_STACK, - ""); - mutex_enter(&hal->br_thread_mutex); ndi_devi_enter(hal->halinfo.dip, &circular); mutex_enter(&hal->topology_tree_mutex); if ((hal->br_thread_ev_type & BR_THR_GO_AWAY) != 0) { - TNF_PROBE_2(s1394_lock_tree_go_away, - S1394_TNF_SL_HOTPLUG_STACK, "", - tnf_int, hal_generation, hal->generation_count, - tnf_int, br_thread_gen, hal->br_cfgrom_read_gen); - TNF_PROBE_0_DEBUG(s1394_lock_tree_exit, - S1394_TNF_SL_HOTPLUG_STACK, ""); mutex_exit(&hal->br_thread_mutex); mutex_exit(&hal->topology_tree_mutex); ndi_devi_exit(hal->halinfo.dip, circular); return (DDI_FAILURE); } else if (hal->br_cfgrom_read_gen != hal->generation_count) { - TNF_PROBE_2(s1394_lock_tree_gen_changed, - S1394_TNF_SL_HOTPLUG_STACK, "", - tnf_int, hal_generation, hal->generation_count, - tnf_int, br_thread_gen, hal->br_cfgrom_read_gen); - - TNF_PROBE_0_DEBUG(s1394_lock_tree_exit, - S1394_TNF_SL_HOTPLUG_STACK, ""); mutex_exit(&hal->br_thread_mutex); mutex_exit(&hal->topology_tree_mutex); ndi_devi_exit(hal->halinfo.dip, circular); @@ -3162,8 +2525,6 @@ s1394_lock_tree(s1394_hal_t *hal) mutex_exit(&hal->br_thread_mutex); - TNF_PROBE_0_DEBUG(s1394_lock_tree_exit, S1394_TNF_SL_HOTPLUG_STACK, ""); - return (DDI_SUCCESS); } @@ -3174,15 +2535,9 @@ s1394_lock_tree(s1394_hal_t *hal) void s1394_unlock_tree(s1394_hal_t *hal) { - TNF_PROBE_0_DEBUG(s1394_unlock_tree_enter, S1394_TNF_SL_HOTPLUG_STACK, - ""); - ASSERT(MUTEX_HELD(&hal->topology_tree_mutex)); mutex_exit(&hal->topology_tree_mutex); ndi_devi_exit(hal->halinfo.dip, 0); - - TNF_PROBE_0_DEBUG(s1394_unlock_tree_exit, S1394_TNF_SL_HOTPLUG_STACK, - ""); } /* @@ -3206,16 +2561,9 @@ s1394_calc_next_quad(s1394_hal_t *hal, s1394_node_t *node, uint32_t quadlet, ASSERT(MUTEX_HELD(&hal->topology_tree_mutex)); - TNF_PROBE_4_DEBUG(s1394_calc_next_quad_enter, - S1394_TNF_SL_HOTPLUG_STACK, "", tnf_uint, node_num, node->node_num, - tnf_uint, quadlet, quadlet, tnf_int, cfgrom_size, node->cfgrom_size, - tnf_uint, hal_gen, hal->generation_count); - if (((quadlet + 1) >= node->cfgrom_size) || (CFGROM_SIZE_IS_CRCSIZE(node) == B_TRUE && (quadlet + 1) >= node->cfgrom_valid_size)) { - TNF_PROBE_0_DEBUG(s1394_calc_next_quad_exit, - S1394_TNF_SL_HOTPLUG_STACK, ""); return (1); } @@ -3223,10 +2571,6 @@ s1394_calc_next_quad(s1394_hal_t *hal, s1394_node_t *node, uint32_t quadlet, B_TRUE) { quadlet++; *nextquadp = quadlet; - TNF_PROBE_3_DEBUG(s1394_calc_next_quad_exit, - S1394_TNF_SL_HOTPLUG_STACK, "", tnf_string, msg, - "dir stack turned off", tnf_uint, quadlet, quadlet, - tnf_opaque, cfgrom, node->cfgrom); return (0); } @@ -3246,10 +2590,6 @@ s1394_calc_next_quad(s1394_hal_t *hal, s1394_node_t *node, uint32_t quadlet, */ if (node->expected_dir_quad == quadlet) { if (type != 0 || key != 0) { - TNF_PROBE_3_DEBUG(s1394_calc_next_quad, - S1394_TNF_SL_HOTPLUG_ERROR, "", tnf_string, msg, - "bad directory turning off stack", tnf_uint, - quadlet, quadlet, tnf_uint, data, data); SET_CFGROM_DIR_STACK_OFF(node); quadlet = IEEE1212_ROOT_DIR_QUAD; } else { @@ -3278,10 +2618,6 @@ s1394_calc_next_quad(s1394_hal_t *hal, s1394_node_t *node, uint32_t quadlet, if (node->expected_type == IEEE1212_LEAF_TYPE) { node->expected_type = IEEE1212_IMMEDIATE_TYPE; done_with_cur_dir = B_TRUE; - TNF_PROBE_2_DEBUG(s1394_calc_next_quad, - S1394_TNF_SL_HOTPLUG_STACK, "", - tnf_string, msg, "done with a leaf", - tnf_uint, quadlet, quadlet); goto donewithcurdir; } @@ -3305,16 +2641,7 @@ s1394_calc_next_quad(s1394_hal_t *hal, s1394_node_t *node, uint32_t quadlet, ((node->cfgrom[0] >> IEEE1394_CFG_ROM_CRC_LEN_SHIFT) & IEEE1394_CFG_ROM_CRC_LEN_MASK); - TNF_PROBE_2(s1394_calc_next_quad, - S1394_TNF_SL_HOTPLUG_ERROR, "", - tnf_string, msg, "crc sz is cfg sz", - tnf_uint, size, - node->cfgrom_valid_size); } - TNF_PROBE_2_DEBUG(s1394_calc_next_quad_exit, - S1394_TNF_SL_HOTPLUG_STACK, "", tnf_string, - msg, "crc error", tnf_uint, quadlet, - quadlet); *nextquadp = IEEE1212_ROOT_DIR_QUAD; return (0); } @@ -3340,26 +2667,12 @@ s1394_calc_next_quad(s1394_hal_t *hal, s1394_node_t *node, uint32_t quadlet, */ top = ++node->dir_stack_top; if (top == S1394_DIR_STACK_SIZE) { - - TNF_PROBE_2_DEBUG( - s1394_calc_next_quad_exit, - S1394_TNF_SL_HOTPLUG_STACK, - "", tnf_string, msg, - "dir stack overflow", - tnf_uint, quadlet, quadlet); SET_CFGROM_DIR_STACK_OFF(node); *nextquadp = IEEE1212_ROOT_DIR_QUAD; return (0); } - TNF_PROBE_3_DEBUG( - s1394_calc_next_quad, - S1394_TNF_SL_HOTPLUG_STACK, "", - tnf_string, msg, "push dir stack", - tnf_uint, quadlet, quadlet, - tnf_int, top, top); - node->dir_stack[top].dir_start = node->cur_dir_start; node->dir_stack[top].dir_size = @@ -3383,12 +2696,6 @@ s1394_calc_next_quad(s1394_hal_t *hal, s1394_node_t *node, uint32_t quadlet, * all done with cur dir; pop it off the stack */ if (node->dir_stack_top >= 0) { - TNF_PROBE_3_DEBUG( - s1394_calc_next_quad_exit, - S1394_TNF_SL_HOTPLUG_STACK, "", - tnf_string, msg, "pop dir stack", - tnf_uint, quadlet, quadlet, - tnf_int, top, node->dir_stack_top); top = node->dir_stack_top--; node->cur_dir_start = node->dir_stack[top].dir_start; @@ -3401,10 +2708,6 @@ s1394_calc_next_quad(s1394_hal_t *hal, s1394_node_t *node, uint32_t quadlet, * if empty stack, we are at the top * level; declare done. */ - TNF_PROBE_1_DEBUG( - s1394_calc_next_quad_exit, - S1394_TNF_SL_HOTPLUG_STACK, "", - tnf_string, msg, "all done"); return (1); } } @@ -3415,8 +2718,5 @@ s1394_calc_next_quad(s1394_hal_t *hal, s1394_node_t *node, uint32_t quadlet, } *nextquadp = quadlet; - TNF_PROBE_1_DEBUG(s1394_calc_next_quad_exit, S1394_TNF_SL_HOTPLUG_STACK, - "", tnf_uint, next_quad, quadlet); - return (0); } diff --git a/usr/src/uts/common/io/1394/s1394_fa.c b/usr/src/uts/common/io/1394/s1394_fa.c index 04a6f4ec7f..bb1692df9e 100644 --- a/usr/src/uts/common/io/1394/s1394_fa.c +++ b/usr/src/uts/common/io/1394/s1394_fa.c @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * s1394_fa.c * 1394 Services Layer Fixed Address Support Routines @@ -38,7 +36,6 @@ #include <sys/cmn_err.h> #include <sys/types.h> #include <sys/kmem.h> -#include <sys/tnf_probe.h> #include <sys/1394/t1394.h> #include <sys/1394/s1394.h> @@ -58,12 +55,8 @@ s1394_fa_claim_addr(s1394_hal_t *hal, s1394_fa_type_t type, s1394_fa_hal_t *falp = &hal->hal_fa[type]; int ret; - TNF_PROBE_0_DEBUG(s1394_fa_claim_addr_enter, S1394_TNF_SL_FA_STACK, ""); - /* Might have been claimed already */ if (falp->fal_addr_blk != NULL) { - TNF_PROBE_0_DEBUG(s1394_fa_claim_addr_exit, - S1394_TNF_SL_FA_STACK, ""); return (DDI_SUCCESS); } @@ -78,14 +71,10 @@ s1394_fa_claim_addr(s1394_hal_t *hal, s1394_fa_type_t type, addr.aa_arg = hal; ret = s1394_claim_addr_blk(hal, &addr); - if (ret != DDI_SUCCESS) { - TNF_PROBE_2(s1394_fa_claim_addr_error, S1394_TNF_SL_FA_ERROR, - "", tnf_int, type, type, tnf_int, ret, ret); - } else { + if (ret == DDI_SUCCESS) { falp->fal_addr_blk = (s1394_addr_space_blk_t *)addr.aa_hdl; } - TNF_PROBE_0_DEBUG(s1394_fa_claim_addr_exit, S1394_TNF_SL_FA_STACK, ""); return (ret); } @@ -97,21 +86,12 @@ void s1394_fa_free_addr(s1394_hal_t *hal, s1394_fa_type_t type) { s1394_fa_hal_t *falp = &hal->hal_fa[type]; - int ret; - - TNF_PROBE_0_DEBUG(s1394_fa_free_addr_enter, S1394_TNF_SL_FA_STACK, ""); /* Might have been freed already */ if (falp->fal_addr_blk != NULL) { - ret = s1394_free_addr_blk(hal, falp->fal_addr_blk); - if (ret != DDI_SUCCESS) { - TNF_PROBE_1(s1394_fa_free_addr_error, - S1394_TNF_SL_FA_STACK, "", tnf_int, ret, ret); - } + (void) s1394_free_addr_blk(hal, falp->fal_addr_blk); falp->fal_addr_blk = NULL; } - - TNF_PROBE_0_DEBUG(s1394_fa_free_addr_exit, S1394_TNF_SL_FA_STACK, ""); } /* @@ -254,15 +234,9 @@ s1394_fa_completion_cb(cmd1394_cmd_t *cmd) { s1394_hal_t *hal = cmd->cmd_callback_arg; - TNF_PROBE_0_DEBUG(s1394_fa_completion_cb_enter, - S1394_TNF_SL_FA_STACK, ""); - s1394_fa_restore_cmd(hal, cmd); if (cmd->completion_callback) { cmd->completion_callback(cmd); } - - TNF_PROBE_0_DEBUG(s1394_fa_completion_cb_exit, - S1394_TNF_SL_FA_STACK, ""); } diff --git a/usr/src/uts/common/io/1394/s1394_fcp.c b/usr/src/uts/common/io/1394/s1394_fcp.c index 51617043db..f2035d2e6f 100644 --- a/usr/src/uts/common/io/1394/s1394_fcp.c +++ b/usr/src/uts/common/io/1394/s1394_fcp.c @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * s1394_fcp.c * 1394 Services Layer FCP Support Routines @@ -37,7 +35,6 @@ #include <sys/cmn_err.h> #include <sys/types.h> #include <sys/kmem.h> -#include <sys/tnf_probe.h> #include <sys/1394/t1394.h> #include <sys/1394/s1394.h> @@ -83,8 +80,6 @@ s1394_fcp_hal_init(s1394_hal_t *hal) { int ret = DDI_SUCCESS; - TNF_PROBE_0_DEBUG(s1394_fcp_hal_init_enter, S1394_TNF_SL_FCP_STACK, ""); - if ((ddi_prop_exists(DDI_DEV_T_ANY, hal->halinfo.dip, DDI_PROP_DONTPASS, "h1394-fcp-claim-on-demand")) == 0) { /* if not on-demand, claim addresses now */ @@ -99,7 +94,6 @@ s1394_fcp_hal_init(s1394_hal_t *hal) } } - TNF_PROBE_0_DEBUG(s1394_fcp_hal_init_exit, S1394_TNF_SL_FCP_STACK, ""); return (ret); } @@ -170,9 +164,6 @@ s1394_fcp_unregister_common(s1394_target_t *target, s1394_fa_type_t type) if (s1394_fa_list_is_empty(hal, type)) { s1394_fa_free_addr(hal, type); } - } else { - TNF_PROBE_0(s1394_fcp_unregister_common_error_list, - S1394_TNF_SL_FCP_ERROR, ""); } rw_exit(&hal->target_list_rwlock); @@ -195,8 +186,6 @@ s1394_fcp_write_check_cmd(cmd1394_cmd_t *cmd) len = cmd->cmd_u.b.blk_length; if (len == 4) { cmd->cmd_result = CMD1394_ETYPE_ERROR; - TNF_PROBE_0(t1394_write_error_type, - S1394_TNF_SL_FCP_ERROR, ""); return (DDI_FAILURE); } } else { @@ -210,14 +199,12 @@ s1394_fcp_write_check_cmd(cmd1394_cmd_t *cmd) if ((cmd->cmd_addr & IEEE1394_ADDR_OFFSET_MASK) + len > IEC61883_FCP_CMD_SIZE) { cmd->cmd_result = CMD1394_EADDRESS_ERROR; - TNF_PROBE_0(t1394_write_error_addr, S1394_TNF_SL_FCP_ERROR, ""); return (DDI_FAILURE); } /* some options don't make sense for FCP commands */ if (cmd->cmd_options & CMD1394_OVERRIDE_ADDR) { cmd->cmd_result = CMD1394_EINVALID_COMMAND; - TNF_PROBE_0(t1394_write_error_opt, S1394_TNF_SL_FCP_ERROR, ""); return (DDI_FAILURE); } @@ -252,9 +239,6 @@ s1394_fcp_recv_write_request(cmd1394_cmd_t *req, s1394_fa_type_t type) boolean_t restored = B_FALSE; int ret = T1394_REQ_UNCLAIMED; - TNF_PROBE_0_DEBUG(s1394_fcp_recv_write_request_enter, - S1394_TNF_SL_FCP_STACK, ""); - rw_enter(&hal->target_list_rwlock, RW_READER); start: @@ -291,10 +275,6 @@ start: * target than receiving same request more than once */ if (saved_gen != s1394_fa_list_gen(hal, type)) { - TNF_PROBE_2(s1394_fcp_recv_write_request_error, - S1394_TNF_SL_FCP_ERROR, "", - tnf_string, msg, "list gen changed", - tnf_opaque, num_retries, num_retries); num_retries++; if (num_retries <= s1394_fcp_notify_retry_cnt) { goto start; @@ -310,16 +290,11 @@ start: rw_exit(&hal->target_list_rwlock); if (ret != T1394_REQ_CLAIMED) { - TNF_PROBE_0(s1394_fcp_recv_write_request_error_unclaimed, - S1394_TNF_SL_FCP_ERROR, ""); if (restored) { s1394_fa_convert_cmd(hal, req); } s1394_fcp_recv_write_unclaimed(hal, req); } - - TNF_PROBE_0_DEBUG(s1394_fcp_recv_write_request_exit, - S1394_TNF_SL_FCP_STACK, ""); } /* diff --git a/usr/src/uts/common/io/1394/s1394_hotplug.c b/usr/src/uts/common/io/1394/s1394_hotplug.c index 1be480d96a..817d00019f 100644 --- a/usr/src/uts/common/io/1394/s1394_hotplug.c +++ b/usr/src/uts/common/io/1394/s1394_hotplug.c @@ -41,9 +41,6 @@ #include <sys/sunddi.h> #include <sys/ddi_impldefs.h> #include <sys/types.h> - -#include <sys/tnf_probe.h> - #include <sys/1394/t1394.h> #include <sys/1394/s1394.h> #include <sys/1394/h1394.h> @@ -73,18 +70,12 @@ s1394_send_remove_event(s1394_hal_t *hal, dev_info_t *dip, (void) sprintf(name, "%s%d", ddi_driver_name(dip), ddi_get_instance(dip)); - TNF_PROBE_1_DEBUG(s1394_send_remove_event_enter, - S1394_TNF_SL_HOTPLUG_STACK, "", tnf_string, device, - name); - if (ndi_event_retrieve_cookie(hal->hal_ndi_event_hdl, dip, DDI_DEVI_REMOVE_EVENT, &cookie, NDI_EVENT_NOPASS) == NDI_SUCCESS) { (void) ndi_event_run_callbacks(hal->hal_ndi_event_hdl, dip, cookie, localinfo); } - TNF_PROBE_0_DEBUG(s1394_send_remove_event_exit, - S1394_TNF_SL_HOTPLUG_STACK, ""); } /* @@ -102,18 +93,11 @@ s1394_send_insert_event(s1394_hal_t *hal, dev_info_t *dip, (void) sprintf(name, "%s%d", ddi_driver_name(dip), ddi_get_instance(dip)); - TNF_PROBE_1_DEBUG(s1394_send_insert_event_enter, - S1394_TNF_SL_HOTPLUG_STACK, "", tnf_string, device, - name); - if (ndi_event_retrieve_cookie(hal->hal_ndi_event_hdl, dip, DDI_DEVI_INSERT_EVENT, &cookie, NDI_EVENT_NOPASS) == NDI_SUCCESS) (void) ndi_event_run_callbacks(hal->hal_ndi_event_hdl, dip, cookie, localinfo); - - TNF_PROBE_0_DEBUG(s1394_send_insert_event_exit, - S1394_TNF_SL_HOTPLUG_STACK, ""); } /* @@ -155,10 +139,6 @@ s1394_create_devinfo(s1394_hal_t *hal, s1394_node_t *node, uint32_t *unit_dir, ASSERT(MUTEX_HELD(&hal->topology_tree_mutex)); - TNF_PROBE_2_DEBUG(s1394_create_devinfo_enter, - S1394_TNF_SL_HOTPLUG_STACK, "", tnf_uint, guid_hi, - node->node_guid_hi, tnf_uint, guid_lo, node->node_guid_lo); - hal_dip = hal->halinfo.dip; /* Allocate and init a new device node instance. */ @@ -169,11 +149,6 @@ s1394_create_devinfo(s1394_hal_t *hal, s1394_node_t *node, uint32_t *unit_dir, cmn_err(CE_NOTE, "!Unable to create devinfo" " (node's GUID %08x%08x)", node->node_guid_hi, node->node_guid_lo); - TNF_PROBE_2(s1394_create_devinfo_fail_alloc, - S1394_TNF_SL_HOTPLUG_ERROR, "", tnf_uint, guid_hi, - node->node_guid_hi, tnf_uint, guid_lo, node->node_guid_lo); - TNF_PROBE_0_DEBUG(s1394_create_devinfo_exit, - S1394_TNF_SL_HOTPLUG_STACK, ""); return (NULL); } @@ -186,14 +161,8 @@ s1394_create_devinfo(s1394_hal_t *hal, s1394_node_t *node, uint32_t *unit_dir, #if defined(DEBUG) cmn_err(CE_CONT, "!Error code %d", result); #endif - TNF_PROBE_3(s1394_create_devinfo_hp_node, - S1394_TNF_SL_HOTPLUG_ERROR, "", tnf_uint, guid_hi, - node->node_guid_hi, tnf_uint, guid_lo, node->node_guid_lo, - tnf_int, error, result); ndi_prop_remove_all(target_dip); (void) ndi_devi_free(target_dip); - TNF_PROBE_0_DEBUG(s1394_create_devinfo_exit, - S1394_TNF_SL_HOTPLUG_STACK, ""); return (NULL); } @@ -345,22 +314,9 @@ s1394_create_devinfo(s1394_hal_t *hal, s1394_node_t *node, uint32_t *unit_dir, #endif ndi_prop_remove_all(target_dip); (void) ndi_devi_free(target_dip); - TNF_PROBE_4(s1394_create_devinfo_fail_compat, - S1394_TNF_SL_HOTPLUG_ERROR, "", tnf_uint, guid_hi, - node->node_guid_hi, tnf_uint, guid_lo, node->node_guid_lo, - tnf_int, error, result, tnf_int, nelements, i); - TNF_PROBE_0_DEBUG(s1394_create_devinfo_exit, - S1394_TNF_SL_HOTPLUG_STACK, ""); return (NULL); } - for (j = 0; j < i; j++) { - TNF_PROBE_2_DEBUG(s1394_create_devinfo_props, - S1394_TNF_SL_HOTPLUG_STACK, "", - tnf_int, compat_index, j, - tnf_string, compat_prop, buf[j]); - } - /* GUID,ADDR */ reg[0] = node->node_guid_hi; reg[1] = node->node_guid_lo; @@ -381,19 +337,9 @@ s1394_create_devinfo(s1394_hal_t *hal, s1394_node_t *node, uint32_t *unit_dir, #endif ndi_prop_remove_all(target_dip); (void) ndi_devi_free(target_dip); - TNF_PROBE_3(s1394_create_devinfo_fail_reg, - S1394_TNF_SL_HOTPLUG_ERROR, "", tnf_uint, guid_hi, - node->node_guid_hi, tnf_uint, guid_lo, node->node_guid_lo, - tnf_int, error, result); - TNF_PROBE_0_DEBUG(s1394_create_devinfo_exit, - S1394_TNF_SL_HOTPLUG_STACK, ""); return (NULL); } - TNF_PROBE_1_DEBUG(s1394_create_devinfo_exit, - S1394_TNF_SL_HOTPLUG_STACK, "", - tnf_opaque, target_dip, target_dip); - return (target_dip); } @@ -422,9 +368,6 @@ s1394_devi_find(dev_info_t *pdip, char *name, char *caddr) ASSERT((name != NULL) && (caddr != NULL)); - TNF_PROBE_1_DEBUG(s1394_devi_find_enter, S1394_TNF_SL_HOTPLUG_STACK, - "", tnf_string, addr, caddr); - /* * for each child of this parent, find name and addr and match with * name and caddr passed in. @@ -458,13 +401,6 @@ s1394_devi_find(dev_info_t *pdip, char *name, char *caddr) } } - if (cdip == NULL) { - TNF_PROBE_1(s1394_devi_find_no_match, - S1394_TNF_SL_HOTPLUG_ERROR, "", tnf_string, addr, caddr); - } - - TNF_PROBE_0_DEBUG(s1394_devi_find_exit, S1394_TNF_SL_HOTPLUG_STACK, ""); - return (cdip); } @@ -500,10 +436,6 @@ s1394_update_devinfo_tree(s1394_hal_t *hal, s1394_node_t *node) ASSERT(CFGROM_PARSED(node) == B_FALSE); ASSERT(node->cfgrom != NULL); - TNF_PROBE_2_DEBUG(s1394_update_devinfo_tree_enter, - S1394_TNF_SL_HOTPLUG_STACK, "", tnf_int, node_num, - node->node_num, tnf_opaque, cfgrom, node->cfgrom); - /* scan through config rom looking for unit dirs */ root_dir = CFGROM_ROOT_DIR(node->cfgrom); @@ -518,10 +450,6 @@ s1394_update_devinfo_tree(s1394_hal_t *hal, s1394_node_t *node) "!Bad root directory in config rom (node's GUID %08x%08x)", node->node_guid_hi, node->node_guid_lo); - TNF_PROBE_1_DEBUG(s1394_update_devinfo_tree_exit, - S1394_TNF_SL_HOTPLUG_STACK, "", tnf_string, msg, - "bad directory"); - SET_CFGROM_PARSED(node); CLEAR_CFGROM_GEN_CHANGED(node); /* if set */ CLEAR_CFGROM_NEW_ALLOC(node); @@ -540,10 +468,6 @@ s1394_update_devinfo_tree(s1394_hal_t *hal, s1394_node_t *node) cmn_err(CE_NOTE, "!Bad unit directory in config" " rom (node's GUID %08x%08x)", node->node_guid_hi, node->node_guid_lo); - TNF_PROBE_2(s1394_update_devinfo_tree_bad_dir, - S1394_TNF_SL_HOTPLUG_ERROR, "", tnf_uint, - guid_hi, node->node_guid_hi, tnf_uint, - guid_lo, node->node_guid_lo); } } } @@ -624,12 +548,6 @@ s1394_update_devinfo_tree(s1394_hal_t *hal, s1394_node_t *node) s1394_unlock_tree(hal); s1394_send_insert_event(hal, devinfo_ptrs[j], &linfo); if (s1394_lock_tree(hal) != DDI_SUCCESS) { - TNF_PROBE_4(s1394_update_devinfo_tree_lock_fail, - S1394_TNF_SL_HOTPLUG_ERROR, "", - tnf_int, node_num, node->node_num, - tnf_opaque, cfgrom, node->cfgrom, - tnf_int, unit, j, - tnf_opaque, devinfo, devinfo_ptrs[j]); lockfail = 1; break; } @@ -637,8 +555,6 @@ s1394_update_devinfo_tree(s1394_hal_t *hal, s1394_node_t *node) } if (lockfail) { - TNF_PROBE_0_DEBUG(s1394_update_devinfo_tree_exit, - S1394_TNF_SL_HOTPLUG_ERROR, ""); return (DDI_FAILURE); } @@ -646,9 +562,6 @@ s1394_update_devinfo_tree(s1394_hal_t *hal, s1394_node_t *node) CLEAR_CFGROM_GEN_CHANGED(node); /* if set */ CLEAR_CFGROM_NEW_ALLOC(node); - TNF_PROBE_0_DEBUG(s1394_update_devinfo_tree_exit, - S1394_TNF_SL_HOTPLUG_STACK, ""); - return (DDI_SUCCESS); } @@ -670,25 +583,16 @@ s1394_offline_node(s1394_hal_t *hal, s1394_node_t *node) uint32_t *unit_dir_ptrs[32]; dev_info_t *devinfo_ptrs[32]; t1394_localinfo_t linfo; - uint_t node_num; uint32_t *ptr, *root_dir, dir_len; uint32_t hi, lo, size_hi, size_lo, type, key, value; char caddr[32]; - node_num = node->node_num; - - TNF_PROBE_1_DEBUG(s1394_offline_node_enter, S1394_TNF_SL_HOTPLUG_STACK, - "", tnf_uint, node_num, node_num); - ASSERT(MUTEX_HELD(&hal->topology_tree_mutex)); d = 0; rw_enter(&hal->target_list_rwlock, RW_WRITER); t = node->target_list; while (t != NULL) { - TNF_PROBE_2(s1394_process_old_tree_mark, - S1394_TNF_SL_HOTPLUG_STACK, "", tnf_int, node_num, node_num, - tnf_opaque, target, t); t->target_state |= S1394_TARG_GONE; t->on_node = NULL; t = t->target_sibling; @@ -708,7 +612,7 @@ s1394_offline_node(s1394_hal_t *hal, s1394_node_t *node) for (units = 0, j = 1; j <= dir_len; j++) { CFGROM_TYPE_KEY_VALUE(root_dir[j], type, key, value); if (key == IEEE1212_UNIT_DIRECTORY && type == - IEEE1212_DIRECTORY_TYPE) { + IEEE1212_DIRECTORY_TYPE) { ptr = &root_dir[j] + value; if (s1394_valid_dir(hal, node, key, ptr) == B_TRUE) { unit_dir_ptrs[units++] = ptr; @@ -719,20 +623,20 @@ s1394_offline_node(s1394_hal_t *hal, s1394_node_t *node) for (d = 0, j = 0; j < units; j++) { s1394_cfgrom_parse_unit_dir(unit_dir_ptrs[j], - &hi, &lo, &size_hi, &size_lo); + &hi, &lo, &size_hi, &size_lo); lo = j; if (hi || lo) { (void) sprintf(caddr, "%08x%08x,%04x%08x", - node->node_guid_hi, node->node_guid_lo, hi, lo); + node->node_guid_hi, node->node_guid_lo, hi, lo); } else { (void) sprintf(caddr, "%08x%08x", - node->node_guid_hi, node->node_guid_lo); + node->node_guid_hi, node->node_guid_lo); } if ((tdip = s1394_devi_find(hal->halinfo.dip, "unit", caddr)) != - NULL) + NULL) devinfo_ptrs[d++] = tdip; } @@ -744,26 +648,14 @@ s1394_offline_node(s1394_hal_t *hal, s1394_node_t *node) for (j = 0; j < d; j++) { s1394_unlock_tree(hal); - TNF_PROBE_2(s1394_offline_node, - S1394_TNF_SL_HOTPLUG_STACK, "", tnf_int, node_num, node_num, - tnf_opaque, devinfo, devinfo_ptrs[j]); - s1394_send_remove_event(hal, devinfo_ptrs[j], &linfo); (void) ndi_devi_offline(devinfo_ptrs[j], NDI_DEVI_REMOVE); if (s1394_lock_tree(hal) != DDI_SUCCESS) { - TNF_PROBE_2(s1394_offline_node, - S1394_TNF_SL_HOTPLUG_ERROR, "", tnf_string, msg, - "unlock to relock tree", tnf_uint, node_num, - node_num); - TNF_PROBE_0_DEBUG(s1394_offline_node_exit, - S1394_TNF_SL_HOTPLUG_STACK, ""); return (DDI_FAILURE); } } ASSERT(MUTEX_HELD(&hal->topology_tree_mutex)); - TNF_PROBE_0_DEBUG(s1394_offline_node_exit, S1394_TNF_SL_HOTPLUG_STACK, - ""); return (DDI_SUCCESS); } @@ -792,14 +684,7 @@ s1394_process_topology_tree(s1394_hal_t *hal, int *wait_for_cbs, ASSERT(MUTEX_NOT_HELD(&hal->topology_tree_mutex)); - TNF_PROBE_0_DEBUG(s1394_process_topology_tree_enter, - S1394_TNF_SL_HOTPLUG_STACK, ""); - if (s1394_lock_tree(hal) != DDI_SUCCESS) { - TNF_PROBE_0(s1394_process_topology_tree_lock_failed, - S1394_TNF_SL_HOTPLUG_ERROR, ""); - TNF_PROBE_0_DEBUG(s1394_process_topology_tree_exit, - S1394_TNF_SL_HOTPLUG_STACK, ""); return (DDI_FAILURE); } @@ -817,13 +702,6 @@ s1394_process_topology_tree(s1394_hal_t *hal, int *wait_for_cbs, } node = &hal->topology_tree[i]; - TNF_PROBE_4_DEBUG(s1394_process_topology_tree, - S1394_TNF_SL_HOTPLUG_STACK, "", - tnf_int, node_num, i, - tnf_int, parsed, CFGROM_PARSED(node), - tnf_int, matched, NODE_MATCHED(node), - tnf_int, visited, NODE_VISITED(node)); - if (LINK_ACTIVE(node) == B_FALSE) { s1394_unlock_tree(hal); continue; @@ -841,14 +719,6 @@ s1394_process_topology_tree(s1394_hal_t *hal, int *wait_for_cbs, * onode->cfgrom != node->cfgrom should have been * handled by s1394_match_GUID()!!! */ - if (onode->cfgrom != node->cfgrom) - TNF_PROBE_5(s1394_process_topology_tree_err, - S1394_TNF_SL_HOTPLUG_ERROR, "", - tnf_int, node_num, i, tnf_int, gen_changed, - CFGROM_GEN_CHANGED(node), tnf_int, parsed, - CFGROM_PARSED(node), tnf_opaque, old_cfgrom, - onode->cfgrom, tnf_opaque, new_cfgrom, - node->cfgrom); ASSERT(onode->cfgrom == node->cfgrom); } @@ -864,30 +734,18 @@ s1394_process_topology_tree(s1394_hal_t *hal, int *wait_for_cbs, DDI_FAILURE) { ASSERT(MUTEX_NOT_HELD( &hal->topology_tree_mutex)); - TNF_PROBE_1(s1394_process_topology_tree, - S1394_TNF_SL_HOTPLUG_ERROR, "", tnf_string, - msg, "failure from update devinfo"); - TNF_PROBE_0_DEBUG( - s1394_process_topology_tree_exit, - S1394_TNF_SL_HOTPLUG_STACK, ""); return (DDI_FAILURE); } } else if (CFGROM_PARSED(node) == B_FALSE && CFGROM_BIB_READ( node) == B_TRUE) { if (s1394_read_rest_of_cfgrom(hal, node, &status) != DDI_SUCCESS) { - TNF_PROBE_1(s1394_process_topology_tree, - S1394_TNF_SL_HOTPLUG_ERROR, "", tnf_string, - msg, "failure reading rest of cfgrom"); if ((status & S1394_LOCK_FAILED) == 0) { ASSERT(MUTEX_HELD(&hal-> topology_tree_mutex)); *wait_for_cbs = 0; s1394_unlock_tree(hal); } - TNF_PROBE_0_DEBUG( - s1394_process_topology_tree_exit, - S1394_TNF_SL_HOTPLUG_STACK, ""); return (DDI_FAILURE); } else { *wait_for_cbs = 1; @@ -903,20 +761,11 @@ s1394_process_topology_tree(s1394_hal_t *hal, int *wait_for_cbs, * this, we will use tree matching. */ if (s1394_lock_tree(hal) != DDI_SUCCESS) { - TNF_PROBE_1(s1394_process_topology_tree, - S1394_TNF_SL_HOTPLUG_ERROR, "", tnf_string, - msg, "relock failed while marking tree processed"); - TNF_PROBE_0_DEBUG(s1394_process_topology_tree_exit, - S1394_TNF_SL_HOTPLUG_STACK, ""); return (DDI_FAILURE); } hal->topology_tree_processed = B_TRUE; s1394_unlock_tree(hal); - TNF_PROBE_1_DEBUG(s1394_process_topology_tree_exit, - S1394_TNF_SL_HOTPLUG_STACK, "", tnf_int, hal_instance, - ddi_get_instance(hal->halinfo.dip)); - return (DDI_SUCCESS); } @@ -937,9 +786,6 @@ s1394_process_old_tree(s1394_hal_t *hal) uint_t hal_node_num_old, old_number_of_nodes; s1394_node_t *onode; - TNF_PROBE_0_DEBUG(s1394_process_old_tree_enter, - S1394_TNF_SL_HOTPLUG_STACK, ""); - /* * NODE_MATCHED(onode) == 0 indicates this node doesn't exist * any more. @@ -947,10 +793,6 @@ s1394_process_old_tree(s1394_hal_t *hal) ASSERT(MUTEX_NOT_HELD(&hal->topology_tree_mutex)); if (s1394_lock_tree(hal) != DDI_SUCCESS) { - TNF_PROBE_0(s1394_process_old_tree_lock_failed, - S1394_TNF_SL_HOTPLUG_ERROR, ""); - TNF_PROBE_0_DEBUG(s1394_process_old_tree_exit, - S1394_TNF_SL_HOTPLUG_STACK, ""); return (DDI_FAILURE); } hal_node_num_old = IEEE1394_NODE_NUM(hal->old_node_id); @@ -962,12 +804,6 @@ s1394_process_old_tree(s1394_hal_t *hal) if (i == hal_node_num_old) continue; if (s1394_lock_tree(hal) != DDI_SUCCESS) { - TNF_PROBE_2(s1394_process_old_tree, - S1394_TNF_SL_HOTPLUG_ERROR, "", tnf_string, msg, - "lock failed while processing node", tnf_uint, - node_num, i); - TNF_PROBE_0_DEBUG(s1394_process_old_tree_exit, - S1394_TNF_SL_HOTPLUG_STACK, ""); return (DDI_FAILURE); } @@ -979,17 +815,6 @@ s1394_process_old_tree(s1394_hal_t *hal) continue; } - TNF_PROBE_1_DEBUG(s1394_process_old_tree, - S1394_TNF_SL_HOTPLUG_STACK, "", tnf_opaque, - cfgrom, onode->cfgrom); - - TNF_PROBE_5_DEBUG(s1394_process_old_tree, - S1394_TNF_SL_HOTPLUG_STACK, "", tnf_int, - node_num, i, tnf_int, parsed, CFGROM_PARSED(onode), tnf_int, - matched, NODE_MATCHED(onode), tnf_int, visited, - NODE_VISITED(onode), tnf_int, generation_changed, - CFGROM_GEN_CHANGED(onode)); - /* * onode->cur_node == NULL iff we couldn't read cfgrom in the * current generation in non-tree matching case (and thus @@ -1001,28 +826,7 @@ s1394_process_old_tree(s1394_hal_t *hal) (LINK_ACTIVE(onode) == B_TRUE && LINK_ACTIVE(onode-> cur_node) == B_FALSE)))) { - if (onode->cur_node != NULL && CFGROM_VALID(onode) == - B_TRUE && - CFGROM_VALID(onode->cur_node) == B_FALSE) { - TNF_PROBE_1_DEBUG( - s1394_process_old_tree_invalid_cfgrom, - S1394_TNF_SL_HOTPLUG_STACK, "", - tnf_int, node_num, i); - } - if (onode->cur_node != NULL && LINK_ACTIVE(onode) == - B_TRUE && LINK_ACTIVE(onode->cur_node) == B_FALSE) { - TNF_PROBE_1_DEBUG( - s1394_process_old_tree_link_off, - S1394_TNF_SL_HOTPLUG_STACK, - "", tnf_int, node_num, i); - } if (s1394_offline_node(hal, onode) != DDI_SUCCESS) { - TNF_PROBE_2(s1394_process_old_tree, - S1394_TNF_SL_HOTPLUG_ERROR, "", tnf_string, - msg, "failure from offline node", tnf_uint, - node_num, i); - TNF_PROBE_0_DEBUG(s1394_process_old_tree_exit, - S1394_TNF_SL_HOTPLUG_STACK, ""); return (DDI_FAILURE); } s1394_free_cfgrom(hal, onode, S1394_FREE_CFGROM_OLD); @@ -1033,9 +837,6 @@ s1394_process_old_tree(s1394_hal_t *hal) ASSERT(MUTEX_NOT_HELD(&hal->topology_tree_mutex)); - TNF_PROBE_0_DEBUG(s1394_process_old_tree_exit, - S1394_TNF_SL_HOTPLUG_STACK, ""); - return (DDI_SUCCESS); } @@ -1053,12 +854,8 @@ s1394_update_unit_dir_location(s1394_hal_t *hal, dev_info_t *tdip, ASSERT(MUTEX_HELD(&hal->topology_tree_mutex)); ASSERT(tdip != NULL); - TNF_PROBE_1_DEBUG(s1394_update_unit_dir_location_enter, - S1394_TNF_SL_HOTPLUG_STACK, "", tnf_uint, offset, offset); (void) ndi_prop_update_int(DDI_DEV_T_NONE, tdip, "unit-dir-offset", offset); - TNF_PROBE_0_DEBUG(s1394_update_unit_dir_location_exit, - S1394_TNF_SL_HOTPLUG_STACK, ""); } /* @@ -1078,9 +875,6 @@ s1394_add_target_to_node(s1394_target_t *target) char name[MAXNAMELEN]; char *ptr; - TNF_PROBE_0_DEBUG(s1394_add_target_to_node_enter, - S1394_TNF_SL_HOTPLUG_STACK, ""); - hal = target->on_hal; ASSERT(hal != NULL); @@ -1091,8 +885,6 @@ s1394_add_target_to_node(s1394_target_t *target) ASSERT(rw_read_locked(&target->on_hal->target_list_rwlock) == 0); if ((ptr = ddi_get_name_addr(target->target_dip)) == NULL) { - TNF_PROBE_0_DEBUG(s1394_add_target_to_node_exit_no_name, - S1394_TNF_SL_HOTPLUG_STACK, ""); return; } @@ -1140,9 +932,6 @@ s1394_add_target_to_node(s1394_target_t *target) } } } - - TNF_PROBE_0_DEBUG(s1394_add_target_to_node_exit, - S1394_TNF_SL_HOTPLUG_STACK, ""); } /* @@ -1155,9 +944,6 @@ s1394_remove_target_from_node(s1394_target_t *target) s1394_target_t *t, *t1; s1394_hal_t *hal; - TNF_PROBE_0_DEBUG(s1394_remove_target_from_node_enter, - S1394_TNF_SL_HOTPLUG_STACK, ""); - hal = target->on_hal; ASSERT(hal != NULL); @@ -1167,12 +953,6 @@ s1394_remove_target_from_node(s1394_target_t *target) /* target_list_rwlock should be held in write mode */ ASSERT(rw_read_locked(&target->on_hal->target_list_rwlock) == 0); - if (target->on_node == NULL) { - TNF_PROBE_1_DEBUG(s1394_remove_target_from_node_NULL, - S1394_TNF_SL_HOTPLUG_STACK, "", - tnf_uint, target_state, target->target_state); - } - t = target->target_list; t1 = NULL; while (t != NULL) { @@ -1199,7 +979,4 @@ s1394_remove_target_from_node(s1394_target_t *target) target->on_node = NULL; target->target_sibling = NULL; - - TNF_PROBE_0_DEBUG(s1394_remove_target_from_node_exit, - S1394_TNF_SL_HOTPLUG_STACK, ""); } diff --git a/usr/src/uts/common/io/1394/s1394_isoch.c b/usr/src/uts/common/io/1394/s1394_isoch.c index 2df89157ca..bed4840794 100644 --- a/usr/src/uts/common/io/1394/s1394_isoch.c +++ b/usr/src/uts/common/io/1394/s1394_isoch.c @@ -24,8 +24,6 @@ * All rights reserved. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * s1394_isoch.c * 1394 Services Layer Isochronous Communication Routines @@ -38,8 +36,6 @@ #include <sys/ddi.h> #include <sys/sunddi.h> #include <sys/types.h> -#include <sys/tnf_probe.h> - #include <sys/1394/t1394.h> #include <sys/1394/s1394.h> #include <sys/1394/h1394.h> @@ -62,9 +58,6 @@ s1394_isoch_rsrc_realloc(s1394_hal_t *hal) int err; int ret; - TNF_PROBE_0_DEBUG(s1394_isoch_rsrc_realloc_enter, - S1394_TNF_SL_ISOCH_STACK, ""); - /* * Get the current generation number - don't need the * topology tree mutex here because it is read-only, and @@ -170,14 +163,6 @@ s1394_isoch_rsrc_realloc(s1394_hal_t *hal) /* Try to free up the bandwidth */ ret = s1394_bandwidth_free(hal, bw_alloc_units, generation, &err); - if ((ret == DDI_FAILURE) && - (err != CMD1394_EBUSRESET)) { - TNF_PROBE_1( - s1394_isoch_rsrc_realloc_error, - S1394_TNF_SL_ISOCH_ERROR, - "", tnf_string, msg, - "Unable to free bandwidth"); - } /* Try the next Isoch CEC */ goto next_isoch_cec; } @@ -194,8 +179,6 @@ next_isoch_cec: /* Unlock the Isoch CEC list */ mutex_exit(&hal->isoch_cec_list_mutex); - TNF_PROBE_0_DEBUG(s1394_isoch_rsrc_realloc_exit, - S1394_TNF_SL_ISOCH_STACK, ""); } /* @@ -214,9 +197,6 @@ s1394_isoch_rsrc_realloc_notify(s1394_hal_t *hal) void (*rsrc_fail_callback)(t1394_isoch_cec_handle_t, opaque_t, t1394_isoch_rsrc_error_t); - TNF_PROBE_0_DEBUG(s1394_isoch_rsrc_realloc_notify_enter, - S1394_TNF_SL_ISOCH_STACK, ""); - /* Lock the Isoch CEC list */ mutex_enter(&hal->isoch_cec_list_mutex); @@ -297,8 +277,6 @@ s1394_isoch_rsrc_realloc_notify(s1394_hal_t *hal) /* Unlock the Isoch CEC list */ mutex_exit(&hal->isoch_cec_list_mutex); - TNF_PROBE_0_DEBUG(s1394_isoch_rsrc_realloc_notify_exit, - S1394_TNF_SL_ISOCH_STACK, ""); } /* @@ -325,9 +303,6 @@ s1394_channel_alloc(s1394_hal_t *hal, uint32_t channel_mask, uint_t generation, int i; int num_retries = S1394_ISOCH_ALLOC_RETRIES; - TNF_PROBE_0_DEBUG(s1394_channel_alloc_enter, - S1394_TNF_SL_ISOCH_STACK, ""); - /* Lock the topology tree */ mutex_enter(&hal->topology_tree_mutex); @@ -340,11 +315,6 @@ s1394_channel_alloc(s1394_hal_t *hal, uint32_t channel_mask, uint_t generation, /* Make sure there is a valid IRM on the bus */ if (IRM_node == -1) { *result = CMD1394_ERETRIES_EXCEEDED; - TNF_PROBE_1(s1394_channel_alloc_error, - S1394_TNF_SL_ISOCH_ERROR, "", tnf_string, msg, - "No IRM on the 1394 bus"); - TNF_PROBE_0_DEBUG(s1394_channel_alloc_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_FAILURE); } @@ -368,8 +338,6 @@ s1394_channel_alloc(s1394_hal_t *hal, uint32_t channel_mask, uint_t generation, /* Check that the generation has not changed */ if (generation != hal->generation_count) { *result = CMD1394_EBUSRESET; - TNF_PROBE_0_DEBUG(s1394_channel_alloc_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_FAILURE); } @@ -381,21 +349,11 @@ s1394_channel_alloc(s1394_hal_t *hal, uint32_t channel_mask, uint_t generation, offset, compare, swap, &old_value); if (ret != DDI_SUCCESS) { *result = CMD1394_EBUSRESET; - TNF_PROBE_1(s1394_channel_alloc_error, - S1394_TNF_SL_ISOCH_ERROR, "", tnf_string, - msg, "Error in cswap32"); - TNF_PROBE_0_DEBUG(s1394_channel_alloc_exit, - "stacktrace 1394 s1394", ""); return (DDI_FAILURE); } if ((~old_value & channel_mask) != 0) { *result = CMD1394_ERETRIES_EXCEEDED; - TNF_PROBE_1(s1394_channel_alloc_error, - S1394_TNF_SL_ISOCH_ERROR, "", tnf_string, - msg, "Channels already taken"); - TNF_PROBE_0_DEBUG(s1394_channel_alloc_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_FAILURE); } @@ -403,29 +361,17 @@ s1394_channel_alloc(s1394_hal_t *hal, uint32_t channel_mask, uint_t generation, *result = CMD1394_CMDSUCCESS; *old_channels = old_value; - TNF_PROBE_0_DEBUG(s1394_channel_alloc_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_SUCCESS); } } while (i--); *result = CMD1394_ERETRIES_EXCEEDED; - TNF_PROBE_1(s1394_channel_alloc_error, - S1394_TNF_SL_ISOCH_ERROR, "", tnf_string, msg, - "Retries exceeded"); - TNF_PROBE_0_DEBUG(s1394_channel_alloc_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_FAILURE); } else { /* Remote */ if (s1394_alloc_cmd(hal, 0, &cmd) != DDI_SUCCESS) { *result = CMD1394_EUNKNOWN_ERROR; - TNF_PROBE_1(s1394_channel_alloc_error, - S1394_TNF_SL_ISOCH_ERROR, "", tnf_string, msg, - "Unable to allocate command"); - TNF_PROBE_0_DEBUG(s1394_channel_alloc_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_FAILURE); } @@ -460,13 +406,6 @@ s1394_channel_alloc(s1394_hal_t *hal, uint32_t channel_mask, uint_t generation, if ((~(*old_channels) & channel_mask) != 0) { *result = CMD1394_ERETRIES_EXCEEDED; - TNF_PROBE_1(s1394_channel_alloc_error, - S1394_TNF_SL_ISOCH_ERROR, "", - tnf_string, msg, - "Channels already taken"); - TNF_PROBE_0_DEBUG( - s1394_channel_alloc_exit, - S1394_TNF_SL_ISOCH_STACK, ""); ret = DDI_FAILURE; } else { *result = cmd->cmd_result; @@ -475,8 +414,6 @@ s1394_channel_alloc(s1394_hal_t *hal, uint32_t channel_mask, uint_t generation, /* Need to free the command */ (void) s1394_free_cmd(hal, &cmd); - TNF_PROBE_0_DEBUG(s1394_channel_alloc_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (ret); } else { @@ -484,11 +421,6 @@ s1394_channel_alloc(s1394_hal_t *hal, uint32_t channel_mask, uint_t generation, /* Need to free the command */ (void) s1394_free_cmd(hal, &cmd); - TNF_PROBE_1(s1394_channel_alloc_error, - S1394_TNF_SL_ISOCH_ERROR, "", tnf_string, - msg, "Error allocating isoch channel"); - TNF_PROBE_0_DEBUG(s1394_channel_alloc_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_FAILURE); } } else { @@ -497,11 +429,6 @@ s1394_channel_alloc(s1394_hal_t *hal, uint32_t channel_mask, uint_t generation, /* Need to free the command */ (void) s1394_free_cmd(hal, &cmd); - TNF_PROBE_1(s1394_channel_alloc_error, - S1394_TNF_SL_ISOCH_ERROR, "", tnf_string, msg, - "Error allocating isoch channel"); - TNF_PROBE_0_DEBUG(s1394_channel_alloc_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_FAILURE); } } @@ -531,9 +458,6 @@ s1394_channel_free(s1394_hal_t *hal, uint32_t channel_mask, uint_t generation, int i; int num_retries = S1394_ISOCH_ALLOC_RETRIES; - TNF_PROBE_0_DEBUG(s1394_channel_free_enter, - S1394_TNF_SL_ISOCH_STACK, ""); - /* Lock the topology tree */ mutex_enter(&hal->topology_tree_mutex); @@ -546,11 +470,6 @@ s1394_channel_free(s1394_hal_t *hal, uint32_t channel_mask, uint_t generation, /* Make sure there is a valid IRM on the bus */ if (IRM_node == -1) { *result = CMD1394_ERETRIES_EXCEEDED; - TNF_PROBE_1(s1394_channel_free_error, - S1394_TNF_SL_ISOCH_ERROR, "", tnf_string, msg, - "No IRM on the 1394 bus"); - TNF_PROBE_0_DEBUG(s1394_channel_free_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_FAILURE); } @@ -574,8 +493,6 @@ s1394_channel_free(s1394_hal_t *hal, uint32_t channel_mask, uint_t generation, /* Check that the generation has not changed */ if (generation != hal->generation_count) { *result = CMD1394_EBUSRESET; - TNF_PROBE_0_DEBUG(s1394_channel_free_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_FAILURE); } @@ -587,40 +504,23 @@ s1394_channel_free(s1394_hal_t *hal, uint32_t channel_mask, uint_t generation, offset, compare, swap, &old_value); if (ret != DDI_SUCCESS) { *result = CMD1394_EBUSRESET; - TNF_PROBE_1(s1394_channel_free_error, - S1394_TNF_SL_ISOCH_ERROR, "", tnf_string, - msg, "Error in cswap32"); - TNF_PROBE_0_DEBUG(s1394_channel_free_exit, - "stacktrace 1394 s1394", ""); return (DDI_FAILURE); } if (old_value == compare) { *result = CMD1394_CMDSUCCESS; *old_channels = old_value; - TNF_PROBE_0_DEBUG(s1394_channel_free_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_SUCCESS); } } while (i--); *result = CMD1394_ERETRIES_EXCEEDED; - TNF_PROBE_1(s1394_channel_free_error, - S1394_TNF_SL_ISOCH_ERROR, "", tnf_string, msg, - "Retries exceeded"); - TNF_PROBE_0_DEBUG(s1394_channel_free_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_FAILURE); } else { /* Remote */ if (s1394_alloc_cmd(hal, 0, &cmd) != DDI_SUCCESS) { *result = CMD1394_EUNKNOWN_ERROR; - TNF_PROBE_1(s1394_channel_free_error, - S1394_TNF_SL_ISOCH_ERROR, "", tnf_string, msg, - "Unable to allocate command"); - TNF_PROBE_0_DEBUG(s1394_channel_free_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_FAILURE); } @@ -658,8 +558,6 @@ s1394_channel_free(s1394_hal_t *hal, uint32_t channel_mask, uint_t generation, /* Need to free the command */ (void) s1394_free_cmd(hal, &cmd); - TNF_PROBE_0_DEBUG(s1394_channel_free_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_SUCCESS); } else { @@ -668,11 +566,6 @@ s1394_channel_free(s1394_hal_t *hal, uint32_t channel_mask, uint_t generation, /* Need to free the command */ (void) s1394_free_cmd(hal, &cmd); - TNF_PROBE_1(s1394_channel_free_error, - S1394_TNF_SL_ISOCH_ERROR, "", tnf_string, - msg, "Error freeing isoch channel"); - TNF_PROBE_0_DEBUG(s1394_channel_free_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_FAILURE); } } else { @@ -680,11 +573,6 @@ s1394_channel_free(s1394_hal_t *hal, uint32_t channel_mask, uint_t generation, /* Need to free the command */ (void) s1394_free_cmd(hal, &cmd); - TNF_PROBE_1(s1394_channel_free_error, - S1394_TNF_SL_ISOCH_ERROR, "", tnf_string, msg, - "Error freeing isoch channel"); - TNF_PROBE_0_DEBUG(s1394_channel_free_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_FAILURE); } } @@ -715,9 +603,6 @@ s1394_bandwidth_alloc(s1394_hal_t *hal, uint32_t bw_alloc_units, int i; int num_retries = S1394_ISOCH_ALLOC_RETRIES; - TNF_PROBE_0_DEBUG(s1394_bandwidth_alloc_enter, - S1394_TNF_SL_ISOCH_STACK, ""); - /* Lock the topology tree */ mutex_enter(&hal->topology_tree_mutex); @@ -730,11 +615,6 @@ s1394_bandwidth_alloc(s1394_hal_t *hal, uint32_t bw_alloc_units, /* Make sure there is a valid IRM on the bus */ if (IRM_node == -1) { *result = CMD1394_ERETRIES_EXCEEDED; - TNF_PROBE_1(s1394_bandwidth_alloc_error, - S1394_TNF_SL_ISOCH_ERROR, "", tnf_string, msg, - "No IRM on the 1394 bus"); - TNF_PROBE_0_DEBUG(s1394_bandwidth_alloc_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_FAILURE); } @@ -753,8 +633,6 @@ s1394_bandwidth_alloc(s1394_hal_t *hal, uint32_t bw_alloc_units, */ if (generation != hal->generation_count) { *result = CMD1394_EBUSRESET; - TNF_PROBE_0_DEBUG(s1394_bandwidth_alloc_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_FAILURE); } @@ -765,11 +643,6 @@ s1394_bandwidth_alloc(s1394_hal_t *hal, uint32_t bw_alloc_units, swap = (uint32_t)temp_value; } else { *result = CMD1394_ERETRIES_EXCEEDED; - TNF_PROBE_1(s1394_bandwidth_alloc_error, - S1394_TNF_SL_ISOCH_ERROR, "", tnf_string, - msg, "Retries exceeded"); - TNF_PROBE_0_DEBUG(s1394_bandwidth_alloc_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_FAILURE); } @@ -780,39 +653,22 @@ s1394_bandwidth_alloc(s1394_hal_t *hal, uint32_t bw_alloc_units, &old_value); if (ret != DDI_SUCCESS) { *result = CMD1394_EBUSRESET; - TNF_PROBE_1(s1394_bandwidth_alloc_error, - S1394_TNF_SL_ISOCH_ERROR, "", tnf_string, - msg, "Error in cswap32"); - TNF_PROBE_0_DEBUG(s1394_bandwidth_alloc_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_FAILURE); } if (old_value == compare) { *result = CMD1394_CMDSUCCESS; - TNF_PROBE_0_DEBUG(s1394_bandwidth_alloc_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_SUCCESS); } } while (i--); *result = CMD1394_ERETRIES_EXCEEDED; - TNF_PROBE_1(s1394_bandwidth_alloc_error, - S1394_TNF_SL_ISOCH_ERROR, "", tnf_string, msg, - "Too many retries"); - TNF_PROBE_0_DEBUG(s1394_bandwidth_alloc_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_FAILURE); } else { /* Remote */ if (s1394_alloc_cmd(hal, 0, &cmd) != DDI_SUCCESS) { *result = CMD1394_EUNKNOWN_ERROR; - TNF_PROBE_1(s1394_bandwidth_alloc_error, - S1394_TNF_SL_ISOCH_ERROR, "", tnf_string, msg, - "Unable to allocate command"); - TNF_PROBE_0_DEBUG(s1394_bandwidth_alloc_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_FAILURE); } @@ -837,8 +693,6 @@ s1394_bandwidth_alloc(s1394_hal_t *hal, uint32_t bw_alloc_units, /* Need to free the command */ (void) s1394_free_cmd(hal, &cmd); - TNF_PROBE_0_DEBUG(s1394_bandwidth_alloc_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_SUCCESS); } else { @@ -846,11 +700,6 @@ s1394_bandwidth_alloc(s1394_hal_t *hal, uint32_t bw_alloc_units, /* Need to free the command */ (void) s1394_free_cmd(hal, &cmd); - TNF_PROBE_1(s1394_bandwidth_alloc_error, - S1394_TNF_SL_ISOCH_ERROR, "", tnf_string, - msg, "Error allocating isoch bandwidth"); - TNF_PROBE_0_DEBUG(s1394_bandwidth_alloc_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_FAILURE); } } else { @@ -858,11 +707,6 @@ s1394_bandwidth_alloc(s1394_hal_t *hal, uint32_t bw_alloc_units, /* Need to free the command */ (void) s1394_free_cmd(hal, &cmd); - TNF_PROBE_1(s1394_bandwidth_alloc_error, - S1394_TNF_SL_ISOCH_ERROR, "", tnf_string, msg, - "Error allocating isoch bandwidth"); - TNF_PROBE_0_DEBUG(s1394_bandwidth_alloc_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_FAILURE); } } @@ -937,9 +781,6 @@ s1394_bandwidth_free(s1394_hal_t *hal, uint32_t bw_alloc_units, int i; int num_retries = S1394_ISOCH_ALLOC_RETRIES; - TNF_PROBE_0_DEBUG(s1394_bandwidth_free_enter, - S1394_TNF_SL_ISOCH_STACK, ""); - /* Lock the topology tree */ mutex_enter(&hal->topology_tree_mutex); @@ -952,11 +793,6 @@ s1394_bandwidth_free(s1394_hal_t *hal, uint32_t bw_alloc_units, /* Make sure there is a valid IRM on the bus */ if (IRM_node == -1) { *result = CMD1394_ERETRIES_EXCEEDED; - TNF_PROBE_1(s1394_bandwidth_free_error, - S1394_TNF_SL_ISOCH_ERROR, "", tnf_string, msg, - "No IRM on the 1394 bus"); - TNF_PROBE_0_DEBUG(s1394_bandwidth_free_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_FAILURE); } @@ -972,8 +808,6 @@ s1394_bandwidth_free(s1394_hal_t *hal, uint32_t bw_alloc_units, /* Check that the generation has not changed */ if (generation != hal->generation_count) { *result = CMD1394_EBUSRESET; - TNF_PROBE_0_DEBUG(s1394_bandwidth_free_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_FAILURE); } @@ -984,11 +818,6 @@ s1394_bandwidth_free(s1394_hal_t *hal, uint32_t bw_alloc_units, swap = temp_value; } else { *result = CMD1394_ERETRIES_EXCEEDED; - TNF_PROBE_1(s1394_bandwidth_free_error, - S1394_TNF_SL_ISOCH_ERROR, "", tnf_string, - msg, "Too many retries"); - TNF_PROBE_0_DEBUG(s1394_bandwidth_free_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_FAILURE); } @@ -999,39 +828,22 @@ s1394_bandwidth_free(s1394_hal_t *hal, uint32_t bw_alloc_units, &old_value); if (ret != DDI_SUCCESS) { *result = CMD1394_EBUSRESET; - TNF_PROBE_1(s1394_bandwidth_free_error, - S1394_TNF_SL_ISOCH_ERROR, "", tnf_string, - msg, "Error in cswap32"); - TNF_PROBE_0_DEBUG(s1394_bandwidth_free_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_FAILURE); } if (old_value == compare) { *result = CMD1394_CMDSUCCESS; - TNF_PROBE_0_DEBUG(s1394_bandwidth_free_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_SUCCESS); } } while (i--); *result = CMD1394_ERETRIES_EXCEEDED; - TNF_PROBE_1(s1394_bandwidth_free_error, - S1394_TNF_SL_ISOCH_ERROR, "", tnf_string, msg, - "Retries exceeded"); - TNF_PROBE_0_DEBUG(s1394_bandwidth_free_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_FAILURE); } else { /* Remote */ if (s1394_alloc_cmd(hal, 0, &cmd) != DDI_SUCCESS) { *result = CMD1394_EUNKNOWN_ERROR; - TNF_PROBE_1(s1394_bandwidth_free_error, - S1394_TNF_SL_ISOCH_ERROR, "", tnf_string, msg, - "Unable to allocate command"); - TNF_PROBE_0_DEBUG(s1394_bandwidth_free_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_FAILURE); } @@ -1057,8 +869,6 @@ s1394_bandwidth_free(s1394_hal_t *hal, uint32_t bw_alloc_units, /* Need to free the command */ (void) s1394_free_cmd(hal, &cmd); - TNF_PROBE_0_DEBUG(s1394_bandwidth_free_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_SUCCESS); } else { @@ -1066,11 +876,6 @@ s1394_bandwidth_free(s1394_hal_t *hal, uint32_t bw_alloc_units, /* Need to free the command */ (void) s1394_free_cmd(hal, &cmd); - TNF_PROBE_1(s1394_bandwidth_free_error, - S1394_TNF_SL_ISOCH_ERROR, "", tnf_string, - msg, "Error freeing isoch bandwidth"); - TNF_PROBE_0_DEBUG(s1394_bandwidth_free_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_FAILURE); } } else { @@ -1078,11 +883,6 @@ s1394_bandwidth_free(s1394_hal_t *hal, uint32_t bw_alloc_units, /* Need to free the command */ (void) s1394_free_cmd(hal, &cmd); - TNF_PROBE_1(s1394_bandwidth_free_error, - S1394_TNF_SL_ISOCH_ERROR, "", tnf_string, msg, - "Error freeing isoch bandwidth"); - TNF_PROBE_0_DEBUG(s1394_bandwidth_free_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_FAILURE); } } @@ -1097,9 +897,6 @@ s1394_isoch_cec_list_insert(s1394_hal_t *hal, s1394_isoch_cec_t *cec) { s1394_isoch_cec_t *cec_temp; - TNF_PROBE_0_DEBUG(s1394_isoch_cec_list_insert_enter, - S1394_TNF_SL_ISOCH_STACK, ""); - ASSERT(MUTEX_HELD(&hal->isoch_cec_list_mutex)); /* Is the Isoch CEC list empty? */ @@ -1120,9 +917,6 @@ s1394_isoch_cec_list_insert(s1394_hal_t *hal, s1394_isoch_cec_t *cec) hal->isoch_cec_list_head = cec; } - - TNF_PROBE_0_DEBUG(s1394_isoch_cec_list_insert_exit, - S1394_TNF_SL_ISOCH_STACK, ""); } /* @@ -1135,9 +929,6 @@ s1394_isoch_cec_list_remove(s1394_hal_t *hal, s1394_isoch_cec_t *cec) s1394_isoch_cec_t *prev_cec; s1394_isoch_cec_t *next_cec; - TNF_PROBE_0_DEBUG(s1394_isoch_cec_list_remove_enter, - S1394_TNF_SL_ISOCH_STACK, ""); - ASSERT(MUTEX_HELD(&hal->isoch_cec_list_mutex)); prev_cec = cec->cec_prev; @@ -1160,9 +951,6 @@ s1394_isoch_cec_list_remove(s1394_hal_t *hal, s1394_isoch_cec_t *cec) if (hal->isoch_cec_list_tail == cec) hal->isoch_cec_list_tail = prev_cec; } - - TNF_PROBE_0_DEBUG(s1394_isoch_cec_list_remove_exit, - S1394_TNF_SL_ISOCH_STACK, ""); } /* @@ -1177,9 +965,6 @@ s1394_isoch_cec_member_list_insert(s1394_hal_t *hal, s1394_isoch_cec_t *cec, { s1394_isoch_cec_member_t *member_temp; - TNF_PROBE_0_DEBUG(s1394_isoch_cec_member_list_insert_enter, - S1394_TNF_SL_ISOCH_STACK, ""); - ASSERT(MUTEX_HELD(&cec->isoch_cec_mutex)); /* Is the Isoch CEC member list empty? */ @@ -1207,9 +992,6 @@ s1394_isoch_cec_member_list_insert(s1394_hal_t *hal, s1394_isoch_cec_t *cec, member_temp->cec_mem_next = member; cec->cec_member_list_tail = member; } - - TNF_PROBE_0_DEBUG(s1394_isoch_cec_member_list_insert_exit, - S1394_TNF_SL_ISOCH_STACK, ""); } /* @@ -1225,9 +1007,6 @@ s1394_isoch_cec_member_list_remove(s1394_hal_t *hal, s1394_isoch_cec_t *cec, s1394_isoch_cec_member_t *prev_member; s1394_isoch_cec_member_t *next_member; - TNF_PROBE_0_DEBUG(s1394_isoch_cec_member_list_remove_enter, - S1394_TNF_SL_ISOCH_STACK, ""); - ASSERT(MUTEX_HELD(&cec->isoch_cec_mutex)); prev_member = member->cec_mem_prev; @@ -1251,7 +1030,4 @@ s1394_isoch_cec_member_list_remove(s1394_hal_t *hal, s1394_isoch_cec_t *cec, if (cec->cec_member_list_tail == member) cec->cec_member_list_tail = prev_member; } - - TNF_PROBE_0_DEBUG(s1394_isoch_cec_member_list_remove_exit, - S1394_TNF_SL_ISOCH_STACK, ""); } diff --git a/usr/src/uts/common/io/1394/s1394_misc.c b/usr/src/uts/common/io/1394/s1394_misc.c index 685d775f3a..44efdadbdd 100644 --- a/usr/src/uts/common/io/1394/s1394_misc.c +++ b/usr/src/uts/common/io/1394/s1394_misc.c @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * s1394_misc.c * 1394 Services Layer Miscellaneous Routines @@ -40,8 +38,6 @@ #include <sys/types.h> #include <sys/kmem.h> #include <sys/kstat.h> -#include <sys/tnf_probe.h> - #include <sys/1394/t1394.h> #include <sys/1394/s1394.h> #include <sys/1394/h1394.h> @@ -62,9 +58,6 @@ void s1394_cleanup_for_detach(s1394_hal_t *hal, uint_t cleanup_level) { - TNF_PROBE_0_DEBUG(s1394_cleanup_for_detach_enter, S1394_TNF_SL_STACK, - ""); - switch (cleanup_level) { case H1394_CLEANUP_LEVEL7: /* remove HAL from the global HAL list */ @@ -152,14 +145,8 @@ s1394_cleanup_for_detach(s1394_hal_t *hal, uint_t cleanup_level) default: /* Error */ - TNF_PROBE_1(s1394_cleanup_for_detach_error, - S1394_TNF_SL_ERROR, "", tnf_string, msg, - "Invalid cleanup_level"); break; } - - TNF_PROBE_0_DEBUG(s1394_cleanup_for_detach_exit, S1394_TNF_SL_STACK, - ""); } /* @@ -176,8 +163,6 @@ s1394_hal_shutdown(s1394_hal_t *hal, boolean_t disable_hal) ddi_eventcookie_t cookie; t1394_localinfo_t localinfo; - TNF_PROBE_0_DEBUG(s1394_hal_shutdown_enter, S1394_TNF_SL_STACK, ""); - mutex_enter(&hal->topology_tree_mutex); if (hal->hal_state == S1394_HAL_SHUTDOWN) { @@ -185,8 +170,6 @@ s1394_hal_shutdown(s1394_hal_t *hal, boolean_t disable_hal) if (disable_hal == B_TRUE) HAL_CALL(hal).shutdown(hal->halinfo.hal_private); - TNF_PROBE_0_DEBUG(s1394_hal_shutdown_exit_already, - S1394_TNF_SL_STACK, ""); return; } @@ -209,8 +192,6 @@ s1394_hal_shutdown(s1394_hal_t *hal, boolean_t disable_hal) NDI_SUCCESS) (void) ndi_event_run_callbacks(hal->hal_ndi_event_hdl, NULL, cookie, &localinfo); - - TNF_PROBE_0_DEBUG(s1394_hal_shutdown_exit, S1394_TNF_SL_STACK, ""); } /* @@ -222,29 +203,16 @@ s1394_hal_shutdown(s1394_hal_t *hal, boolean_t disable_hal) void s1394_initiate_hal_reset(s1394_hal_t *hal, int reason) { - int ret; - - TNF_PROBE_0_DEBUG(s1394_initiate_hal_reset_enter, S1394_TNF_SL_BR_STACK, - ""); - if (hal->num_bus_reset_till_fail > 0) { hal->initiated_bus_reset = B_TRUE; hal->initiated_br_reason = reason; /* Reset the bus */ - ret = HAL_CALL(hal).bus_reset(hal->halinfo.hal_private); - if (ret != DDI_SUCCESS) { - TNF_PROBE_1(s1394_initiate_hal_reset_error, - S1394_TNF_SL_ERROR, "", tnf_string, msg, - "Error initiating bus reset"); - } + (void) HAL_CALL(hal).bus_reset(hal->halinfo.hal_private); } else { cmn_err(CE_NOTE, "Unable to reenumerate the 1394 bus - If new" " devices have recently been added, remove them."); } - - TNF_PROBE_0_DEBUG(s1394_initiate_hal_reset_exit, S1394_TNF_SL_BR_STACK, - ""); } /* @@ -269,9 +237,6 @@ s1394_on_br_thread(s1394_hal_t *hal) void s1394_destroy_br_thread(s1394_hal_t *hal) { - TNF_PROBE_0_DEBUG(s1394_destroy_br_thread_enter, S1394_TNF_SL_STACK, - ""); - /* Send the signal to the reset thread to go away */ mutex_enter(&hal->br_thread_mutex); hal->br_thread_ev_type |= BR_THR_GO_AWAY; @@ -291,9 +256,6 @@ s1394_destroy_br_thread(s1394_hal_t *hal) /* Wait for the br_thread to be done */ while (hal->br_thread_ev_type & BR_THR_GO_AWAY) delay(drv_usectohz(10)); - - TNF_PROBE_0_DEBUG(s1394_destroy_br_thread_exit, S1394_TNF_SL_STACK, - ""); } /* @@ -333,9 +295,6 @@ s1394_block_on_asynch_cmd(cmd1394_cmd_t *cmd) { s1394_cmd_priv_t *s_priv; - TNF_PROBE_0_DEBUG(s1394_block_on_asynch_cmd_enter, - S1394_TNF_SL_ATREQ_STACK, ""); - /* Get the Services Layer private area */ s_priv = S1394_GET_CMD_PRIV(cmd); @@ -348,9 +307,6 @@ s1394_block_on_asynch_cmd(cmd1394_cmd_t *cmd) s_priv->blocking_flag = B_FALSE; mutex_exit(&s_priv->blocking_mutex); } - - TNF_PROBE_0_DEBUG(s1394_block_on_asynch_cmd_exit, - S1394_TNF_SL_ATREQ_STACK, ""); } /* @@ -399,9 +355,6 @@ s1394_mblk_too_small(cmd1394_cmd_t *cmd) size_t msgb_len; size_t size; - TNF_PROBE_0_DEBUG(s1394_mblk_too_small_enter, S1394_TNF_SL_ATREQ_STACK, - ""); - curr_blk = cmd->cmd_u.b.data_block; msgb_len = 0; flag = B_TRUE; @@ -423,8 +376,6 @@ s1394_mblk_too_small(cmd1394_cmd_t *cmd) curr_blk = curr_blk->b_cont; } - TNF_PROBE_0_DEBUG(s1394_mblk_too_small_exit, S1394_TNF_SL_ATREQ_STACK, - ""); return (flag); } @@ -440,9 +391,6 @@ s1394_address_rollover(cmd1394_cmd_t *cmd) uint64_t addr_after; size_t length; - TNF_PROBE_0_DEBUG(s1394_address_rollover_enter, - S1394_TNF_SL_ATREQ_STACK, ""); - switch (cmd->cmd_type) { case CMD1394_ASYNCH_RD_QUAD: case CMD1394_ASYNCH_WR_QUAD: @@ -464,13 +412,9 @@ s1394_address_rollover(cmd1394_cmd_t *cmd) addr_after = (addr_before + length) & IEEE1394_ADDR_OFFSET_MASK; if (addr_after < addr_before) { - TNF_PROBE_0_DEBUG(s1394_address_rollover_exit, - S1394_TNF_SL_ATREQ_STACK, ""); return (B_TRUE); } - TNF_PROBE_0_DEBUG(s1394_address_rollover_exit, - S1394_TNF_SL_ATREQ_STACK, ""); return (B_FALSE); } @@ -515,8 +459,6 @@ s1394_CRC16(uint_t *d, uint_t crc_length) int shift; int i; - TNF_PROBE_0_DEBUG(s1394_CRC16_enter, S1394_TNF_SL_STACK, ""); - for (i = 0; i < crc_length; i++) { data = d[i]; @@ -529,8 +471,6 @@ s1394_CRC16(uint_t *d, uint_t crc_length) CRC = next & IEEE1394_CRC16_MASK; } - TNF_PROBE_1_DEBUG(s1394_CRC16_exit, S1394_TNF_SL_STACK, "", - tnf_uint, crc, CRC); return (CRC); } @@ -552,8 +492,6 @@ s1394_CRC16_old(uint_t *d, uint_t crc_length) int shift; int i; - TNF_PROBE_0_DEBUG(s1394_CRC16_old_enter, S1394_TNF_SL_STACK, ""); - for (i = 0; i < crc_length; i++) { data = d[i]; for (next = CRC, shift = 28; shift > 0; shift -= 4) { @@ -563,8 +501,6 @@ s1394_CRC16_old(uint_t *d, uint_t crc_length) CRC = next & IEEE1394_CRC16_MASK; } - TNF_PROBE_1_DEBUG(s1394_CRC16_old_exit, S1394_TNF_SL_STACK, "", - tnf_uint, crc, CRC); return (CRC); } @@ -581,9 +517,6 @@ s1394_ioctl(s1394_hal_t *hal, int cmd, intptr_t arg, int mode, cred_t *cred_p, struct devctl_iocdata *dcp; dev_info_t *self; int rv = 0; - int ret; - - TNF_PROBE_0_DEBUG(s1394_ioctl_enter, S1394_TNF_SL_IOCTL_STACK, ""); self = hal->halinfo.dip; @@ -601,8 +534,6 @@ s1394_ioctl(s1394_hal_t *hal, int cmd, intptr_t arg, int mode, cred_t *cred_p, /* Read devctl ioctl data */ if (ndi_dc_allochdl((void *)arg, &dcp) != NDI_SUCCESS) { - TNF_PROBE_0_DEBUG(s1394_ioctl_exit, S1394_TNF_SL_IOCTL_STACK, - ""); return (EFAULT); } @@ -626,20 +557,11 @@ s1394_ioctl(s1394_hal_t *hal, int cmd, intptr_t arg, int mode, cred_t *cred_p, case DEVCTL_BUS_RESET: case DEVCTL_BUS_RESETALL: if (hal->halinfo.phy == H1394_PHY_1394A) { - ret = HAL_CALL(hal).short_bus_reset( + (void) HAL_CALL(hal).short_bus_reset( hal->halinfo.hal_private); - if (ret != DDI_SUCCESS) { - TNF_PROBE_1(s1394_ioctl_error, - S1394_TNF_SL_ERROR, "", tnf_string, msg, - "Error initiating short bus reset"); - } } else { - ret = HAL_CALL(hal).bus_reset(hal->halinfo.hal_private); - if (ret != DDI_SUCCESS) { - TNF_PROBE_1(t1394_initiate_bus_reset_error, - S1394_TNF_SL_ERROR, "", tnf_string, msg, - "Error initiating bus reset"); - } + (void) + HAL_CALL(hal).bus_reset(hal->halinfo.hal_private); } break; @@ -649,7 +571,6 @@ s1394_ioctl(s1394_hal_t *hal, int cmd, intptr_t arg, int mode, cred_t *cred_p, ndi_dc_freehdl(dcp); - TNF_PROBE_0_DEBUG(s1394_ioctl_exit, S1394_TNF_SL_IOCTL_STACK, ""); return (rv); } @@ -662,8 +583,6 @@ s1394_kstat_init(s1394_hal_t *hal) { int instance; - TNF_PROBE_0_DEBUG(s1394_kstat_init_enter, S1394_TNF_SL_STACK, ""); - hal->hal_kstats = (s1394_kstat_t *)kmem_zalloc(sizeof (s1394_kstat_t), KM_SLEEP); @@ -676,13 +595,9 @@ s1394_kstat_init(s1394_hal_t *hal) hal->hal_ksp->ks_update = s1394_kstat_update; kstat_install(hal->hal_ksp); - TNF_PROBE_0_DEBUG(s1394_kstat_init_exit, S1394_TNF_SL_STACK, - ""); return (DDI_SUCCESS); } else { kmem_free((void *)hal->hal_kstats, sizeof (s1394_kstat_t)); - TNF_PROBE_0_DEBUG(s1394_kstat_init_exit, S1394_TNF_SL_STACK, - ""); return (DDI_FAILURE); } } @@ -695,12 +610,9 @@ s1394_kstat_init(s1394_hal_t *hal) int s1394_kstat_delete(s1394_hal_t *hal) { - TNF_PROBE_0_DEBUG(s1394_kstat_delete_enter, S1394_TNF_SL_STACK, ""); - kstat_delete(hal->hal_ksp); kmem_free((void *)hal->hal_kstats, sizeof (s1394_kstat_t)); - TNF_PROBE_0_DEBUG(s1394_kstat_delete_exit, S1394_TNF_SL_STACK, ""); return (DDI_SUCCESS); } @@ -714,19 +626,14 @@ s1394_kstat_update(kstat_t *ksp, int rw) { s1394_hal_t *hal; - TNF_PROBE_0_DEBUG(s1394_kstat_update_enter, S1394_TNF_SL_STACK, ""); - hal = ksp->ks_private; if (rw == KSTAT_WRITE) { - TNF_PROBE_0_DEBUG(s1394_kstat_update_exit, S1394_TNF_SL_STACK, - ""); return (EACCES); } else { ksp->ks_data = hal->hal_kstats; } - TNF_PROBE_0_DEBUG(s1394_kstat_update_exit, S1394_TNF_SL_STACK, ""); return (0); } @@ -834,9 +741,6 @@ s1394_dip_to_hal(dev_info_t *hal_dip) { s1394_hal_t *current_hal = NULL; - TNF_PROBE_0_DEBUG(s1394_dip_to_hal_enter, - S1394_TNF_SL_HOTPLUG_STACK, ""); - mutex_enter(&s1394_statep->hal_list_mutex); /* Search the HAL list for this dip */ @@ -850,8 +754,6 @@ s1394_dip_to_hal(dev_info_t *hal_dip) mutex_exit(&s1394_statep->hal_list_mutex); - TNF_PROBE_0_DEBUG(s1394_dip_to_hal_exit, - S1394_TNF_SL_HOTPLUG_STACK, ""); return (current_hal); } @@ -869,9 +771,6 @@ s1394_target_from_dip_locked(s1394_hal_t *hal, dev_info_t *tdip) { s1394_target_t *temp; - TNF_PROBE_0_DEBUG(s1394_target_from_dip_locked_enter, - S1394_TNF_SL_STACK, ""); - temp = hal->target_head; while (temp != NULL) { if (temp->target_dip == tdip) { @@ -880,8 +779,6 @@ s1394_target_from_dip_locked(s1394_hal_t *hal, dev_info_t *tdip) temp = temp->target_next; } - TNF_PROBE_0_DEBUG(s1394_target_from_dip_locked_exit, - S1394_TNF_SL_STACK, ""); return (NULL); } /* @@ -894,13 +791,10 @@ s1394_target_from_dip(s1394_hal_t *hal, dev_info_t *tdip) { s1394_target_t *target; - TNF_PROBE_0_DEBUG(s1394_target_from_dip_enter, S1394_TNF_SL_STACK, ""); - rw_enter(&hal->target_list_rwlock, RW_READER); target = s1394_target_from_dip_locked(hal, tdip); rw_exit(&hal->target_list_rwlock); - TNF_PROBE_0_DEBUG(s1394_target_from_dip_exit, S1394_TNF_SL_STACK, ""); return (target); } @@ -954,9 +848,6 @@ s1394_cycle_too_long_callback(void *arg) uint32_t data; uint_t offset; - TNF_PROBE_0_DEBUG(s1394_cycle_too_long_callback_enter, - S1394_TNF_SL_STACK, ""); - hal = (s1394_hal_t *)arg; /* Clear the cm_timer_cet bit */ @@ -977,7 +868,4 @@ s1394_cycle_too_long_callback(void *arg) (void) HAL_CALL(hal).csr_write(hal->halinfo.hal_private, offset, data); } - - TNF_PROBE_0_DEBUG(s1394_cycle_too_long_callback_exit, - S1394_TNF_SL_STACK, ""); } diff --git a/usr/src/uts/common/io/1394/t1394.c b/usr/src/uts/common/io/1394/t1394.c index 4cc56bac29..ea47e59e7d 100644 --- a/usr/src/uts/common/io/1394/t1394.c +++ b/usr/src/uts/common/io/1394/t1394.c @@ -37,8 +37,6 @@ #include <sys/types.h> #include <sys/kmem.h> #include <sys/disp.h> -#include <sys/tnf_probe.h> - #include <sys/1394/t1394.h> #include <sys/1394/s1394.h> #include <sys/1394/h1394.h> @@ -82,24 +80,14 @@ t1394_attach(dev_info_t *dip, int version, uint_t flags, ASSERT(t1394_hdl != NULL); ASSERT(attachinfo != NULL); - TNF_PROBE_0_DEBUG(t1394_attach_enter, S1394_TNF_SL_HOTPLUG_STACK, ""); - *t1394_hdl = NULL; if (version != T1394_VERSION_V1) { - TNF_PROBE_1(t1394_attach_error, S1394_TNF_SL_HOTPLUG_ERROR, "", - tnf_string, msg, "Invalid version"); - TNF_PROBE_0_DEBUG(t1394_attach_exit, - S1394_TNF_SL_HOTPLUG_STACK, ""); return (DDI_FAILURE); } hal = s1394_dip_to_hal(ddi_get_parent(dip)); if (hal == NULL) { - TNF_PROBE_1(t1394_attach_error, S1394_TNF_SL_HOTPLUG_ERROR, "", - tnf_string, msg, "No parent dip found for target"); - TNF_PROBE_0_DEBUG(t1394_attach_exit, - S1394_TNF_SL_HOTPLUG_STACK, ""); return (DDI_FAILURE); } @@ -134,11 +122,6 @@ t1394_attach(dev_info_t *dip, int version, uint_t flags, rw_exit(&target->on_hal->target_list_rwlock); mutex_exit(&hal->topology_tree_mutex); kmem_free(target, sizeof (s1394_target_t)); - TNF_PROBE_1(t1394_attach_error, - S1394_TNF_SL_HOTPLUG_ERROR, "", tnf_string, msg, - "on_node == NULL"); - TNF_PROBE_0_DEBUG(t1394_attach_exit, - S1394_TNF_SL_HOTPLUG_STACK, ""); return (DDI_FAILURE); } @@ -190,7 +173,6 @@ t1394_attach(dev_info_t *dip, int version, uint_t flags, mutex_exit(&hal->topology_tree_mutex); - TNF_PROBE_0_DEBUG(t1394_attach_exit, S1394_TNF_SL_HOTPLUG_STACK, ""); return (DDI_SUCCESS); } @@ -214,8 +196,6 @@ t1394_detach(t1394_handle_t *t1394_hdl, uint_t flags) s1394_target_t *target; uint_t num_cmds; - TNF_PROBE_0_DEBUG(t1394_detach_enter, S1394_TNF_SL_HOTPLUG_STACK, ""); - ASSERT(t1394_hdl != NULL); target = (s1394_target_t *)(*t1394_hdl); @@ -231,10 +211,6 @@ t1394_detach(t1394_handle_t *t1394_hdl, uint_t flags) if (num_cmds != 0) { rw_exit(&target->on_hal->target_list_rwlock); mutex_exit(&target->on_hal->topology_tree_mutex); - TNF_PROBE_1(t1394_detach_error, S1394_TNF_SL_HOTPLUG_ERROR, "", - tnf_string, msg, "Must free all commands before detach()"); - TNF_PROBE_0_DEBUG(t1394_detach_exit, - S1394_TNF_SL_HOTPLUG_STACK, ""); return (DDI_FAILURE); } @@ -267,7 +243,6 @@ t1394_detach(t1394_handle_t *t1394_hdl, uint_t flags) *t1394_hdl = NULL; - TNF_PROBE_0_DEBUG(t1394_detach_exit, S1394_TNF_SL_HOTPLUG_STACK, ""); return (DDI_SUCCESS); } @@ -296,8 +271,6 @@ t1394_alloc_cmd(t1394_handle_t t1394_hdl, uint_t flags, cmd1394_cmd_t **cmdp) s1394_cmd_priv_t *s_priv; uint_t num_cmds; - TNF_PROBE_0_DEBUG(t1394_alloc_cmd_enter, S1394_TNF_SL_ATREQ_STACK, ""); - ASSERT(t1394_hdl != NULL); target = (s1394_target_t *)t1394_hdl; @@ -312,11 +285,6 @@ t1394_alloc_cmd(t1394_handle_t t1394_hdl, uint_t flags, cmd1394_cmd_t **cmdp) if (num_cmds >= MAX_NUMBER_ALLOC_CMDS) { rw_exit(&hal->target_list_rwlock); - TNF_PROBE_1(t1394_alloc_cmd_error, S1394_TNF_SL_ATREQ_ERROR, - "", tnf_string, msg, "Attempted to alloc > " - "MAX_NUMBER_ALLOC_CMDS"); - TNF_PROBE_0_DEBUG(t1394_alloc_cmd_exit, - S1394_TNF_SL_ATREQ_STACK, ""); /* kstats - cmd alloc failures */ hal->hal_kstats->cmd_alloc_fail++; return (DDI_FAILURE); @@ -328,10 +296,6 @@ t1394_alloc_cmd(t1394_handle_t t1394_hdl, uint_t flags, cmd1394_cmd_t **cmdp) if (s1394_alloc_cmd(hal, flags, cmdp) != DDI_SUCCESS) { target->target_num_cmds = num_cmds; /* Undo increment */ rw_exit(&hal->target_list_rwlock); - TNF_PROBE_1(t1394_alloc_cmd_error, S1394_TNF_SL_ATREQ_ERROR, "", - tnf_string, msg, "Failed to allocate command structure"); - TNF_PROBE_0_DEBUG(t1394_alloc_cmd_exit, - S1394_TNF_SL_ATREQ_STACK, ""); /* kstats - cmd alloc failures */ hal->hal_kstats->cmd_alloc_fail++; return (DDI_FAILURE); @@ -349,7 +313,6 @@ t1394_alloc_cmd(t1394_handle_t t1394_hdl, uint_t flags, cmd1394_cmd_t **cmdp) /* Initialize the command's blocking condition variable */ cv_init(&s_priv->blocking_cv, NULL, CV_DRIVER, NULL); - TNF_PROBE_0_DEBUG(t1394_alloc_cmd_exit, S1394_TNF_SL_ATREQ_STACK, ""); return (DDI_SUCCESS); } @@ -377,8 +340,6 @@ t1394_free_cmd(t1394_handle_t t1394_hdl, uint_t flags, cmd1394_cmd_t **cmdp) s1394_cmd_priv_t *s_priv; uint_t num_cmds; - TNF_PROBE_0_DEBUG(t1394_free_cmd_enter, S1394_TNF_SL_ATREQ_STACK, ""); - ASSERT(t1394_hdl != NULL); target = (s1394_target_t *)t1394_hdl; @@ -393,11 +354,6 @@ t1394_free_cmd(t1394_handle_t t1394_hdl, uint_t flags, cmd1394_cmd_t **cmdp) if (num_cmds == 0) { rw_exit(&hal->target_list_rwlock); - TNF_PROBE_2(t1394_free_cmd_error, S1394_TNF_SL_ATREQ_ERROR, "", - tnf_string, msg, "No commands left to be freed " - "(num_cmds <= 0)", tnf_uint, num_cmds, num_cmds); - TNF_PROBE_0_DEBUG(t1394_free_cmd_exit, - S1394_TNF_SL_ATREQ_STACK, ""); ASSERT(num_cmds != 0); return (DDI_FAILURE); } @@ -408,10 +364,6 @@ t1394_free_cmd(t1394_handle_t t1394_hdl, uint_t flags, cmd1394_cmd_t **cmdp) /* Check that command isn't in use */ if (s_priv->cmd_in_use == B_TRUE) { rw_exit(&hal->target_list_rwlock); - TNF_PROBE_1(t1394_free_cmd_error, S1394_TNF_SL_ATREQ_ERROR, "", - tnf_string, msg, "Attempted to free an in-use command"); - TNF_PROBE_0_DEBUG(t1394_free_cmd_exit, - S1394_TNF_SL_ATREQ_STACK, ""); ASSERT(s_priv->cmd_in_use == B_FALSE); return (DDI_FAILURE); } @@ -435,7 +387,6 @@ t1394_free_cmd(t1394_handle_t t1394_hdl, uint_t flags, cmd1394_cmd_t **cmdp) /* kstats - number of cmd frees */ hal->hal_kstats->cmd_free++; - TNF_PROBE_0_DEBUG(t1394_free_cmd_exit, S1394_TNF_SL_ATREQ_STACK, ""); return (DDI_SUCCESS); } @@ -461,8 +412,6 @@ t1394_read(t1394_handle_t t1394_hdl, cmd1394_cmd_t *cmd) int ret; int err; - TNF_PROBE_0_DEBUG(t1394_read_enter, S1394_TNF_SL_ATREQ_STACK, ""); - ASSERT(t1394_hdl != NULL); ASSERT(cmd != NULL); @@ -471,10 +420,6 @@ t1394_read(t1394_handle_t t1394_hdl, cmd1394_cmd_t *cmd) /* Is this command currently in use? */ if (s_priv->cmd_in_use == B_TRUE) { - TNF_PROBE_1(t1394_read_error, S1394_TNF_SL_ATREQ_ERROR, "", - tnf_string, msg, "Attempted to resend an in-use command"); - TNF_PROBE_0_DEBUG(t1394_read_exit, S1394_TNF_SL_ATREQ_STACK, - ""); ASSERT(s_priv->cmd_in_use == B_FALSE); return (DDI_FAILURE); } @@ -491,10 +436,6 @@ t1394_read(t1394_handle_t t1394_hdl, cmd1394_cmd_t *cmd) if ((cmd->cmd_type != CMD1394_ASYNCH_RD_QUAD) && (cmd->cmd_type != CMD1394_ASYNCH_RD_BLOCK)) { cmd->cmd_result = CMD1394_EINVALID_COMMAND; - TNF_PROBE_1(t1394_read_error, S1394_TNF_SL_ATREQ_ERROR, "", - tnf_string, msg, "Invalid command type specified"); - TNF_PROBE_0_DEBUG(t1394_read_exit, - S1394_TNF_SL_ATREQ_STACK, ""); return (DDI_FAILURE); } @@ -502,11 +443,6 @@ t1394_read(t1394_handle_t t1394_hdl, cmd1394_cmd_t *cmd) if ((cmd->cmd_options & CMD1394_BLOCKING) && (servicing_interrupt())) { cmd->cmd_result = CMD1394_EINVALID_CONTEXT; - TNF_PROBE_1(t1394_read_error, S1394_TNF_SL_ATREQ_ERROR, "", - tnf_string, msg, "Tried to use CMD1394_BLOCKING in " - "intr context"); - TNF_PROBE_0_DEBUG(t1394_read_exit, - S1394_TNF_SL_ATREQ_STACK, ""); return (DDI_FAILURE); } @@ -529,10 +465,6 @@ t1394_read(t1394_handle_t t1394_hdl, cmd1394_cmd_t *cmd) /* Copy error code into result */ cmd->cmd_result = err; mutex_exit(&to_hal->topology_tree_mutex); - TNF_PROBE_1(t1394_read_error, S1394_TNF_SL_ATREQ_ERROR, "", - tnf_string, msg, "Failed in s1394_setup_asynch_command()"); - TNF_PROBE_0_DEBUG(t1394_read_exit, - S1394_TNF_SL_ATREQ_STACK, ""); return (DDI_FAILURE); } @@ -550,12 +482,6 @@ t1394_read(t1394_handle_t t1394_hdl, cmd1394_cmd_t *cmd) mutex_exit(&to_hal->topology_tree_mutex); s_priv->cmd_in_use = B_FALSE; cmd->cmd_result = CMD1394_EINVALID_CONTEXT; - TNF_PROBE_1(t1394_read_error, - S1394_TNF_SL_ATREQ_ERROR, "", tnf_string, - msg, "CMD1394_BLOCKING in bus reset " - "context"); - TNF_PROBE_0_DEBUG(t1394_read_exit, - S1394_TNF_SL_ATREQ_STACK, ""); return (DDI_FAILURE); } } @@ -590,11 +516,6 @@ t1394_read(t1394_handle_t t1394_hdl, cmd1394_cmd_t *cmd) /* Copy error code into result */ cmd->cmd_result = err; - TNF_PROBE_1(t1394_read_error, S1394_TNF_SL_ATREQ_ERROR, - "", tnf_string, msg, "Failed in " - "s1394_xfer_asynch_command()"); - TNF_PROBE_0_DEBUG(t1394_read_exit, - S1394_TNF_SL_ATREQ_STACK, ""); return (DDI_FAILURE); } } else { @@ -605,8 +526,6 @@ t1394_read(t1394_handle_t t1394_hdl, cmd1394_cmd_t *cmd) block_on_asynch_cmd: s1394_block_on_asynch_cmd(cmd); - TNF_PROBE_0_DEBUG(t1394_read_exit, - S1394_TNF_SL_ATREQ_STACK, ""); return (DDI_SUCCESS); } @@ -632,8 +551,6 @@ t1394_write(t1394_handle_t t1394_hdl, cmd1394_cmd_t *cmd) int ret; int err; - TNF_PROBE_0_DEBUG(t1394_write_enter, S1394_TNF_SL_ATREQ_STACK, ""); - ASSERT(t1394_hdl != NULL); ASSERT(cmd != NULL); @@ -642,10 +559,6 @@ t1394_write(t1394_handle_t t1394_hdl, cmd1394_cmd_t *cmd) /* Is this command currently in use? */ if (s_priv->cmd_in_use == B_TRUE) { - TNF_PROBE_1(t1394_write_error, S1394_TNF_SL_ATREQ_ERROR, "", - tnf_string, msg, "Attempted to resend an in-use command"); - TNF_PROBE_0_DEBUG(t1394_write_exit, S1394_TNF_SL_ATREQ_STACK, - ""); ASSERT(s_priv->cmd_in_use == B_FALSE); return (DDI_FAILURE); } @@ -659,8 +572,6 @@ t1394_write(t1394_handle_t t1394_hdl, cmd1394_cmd_t *cmd) if (s_priv->cmd_ext_type == S1394_CMD_EXT_FA) { if (S1394_IS_CMD_FCP(s_priv) && (s1394_fcp_write_check_cmd(cmd) != DDI_SUCCESS)) { - TNF_PROBE_0_DEBUG(t1394_write_exit, - S1394_TNF_SL_ATREQ_STACK, ""); return (DDI_FAILURE); } s1394_fa_convert_cmd(to_hal, cmd); @@ -674,10 +585,6 @@ t1394_write(t1394_handle_t t1394_hdl, cmd1394_cmd_t *cmd) (cmd->cmd_type != CMD1394_ASYNCH_WR_BLOCK)) { cmd->cmd_result = CMD1394_EINVALID_COMMAND; s1394_fa_check_restore_cmd(to_hal, cmd); - TNF_PROBE_1(t1394_write_error, S1394_TNF_SL_ATREQ_ERROR, "", - tnf_string, msg, "Invalid command type specified"); - TNF_PROBE_0_DEBUG(t1394_write_exit, S1394_TNF_SL_ATREQ_STACK, - ""); return (DDI_FAILURE); } @@ -686,11 +593,6 @@ t1394_write(t1394_handle_t t1394_hdl, cmd1394_cmd_t *cmd) (servicing_interrupt())) { cmd->cmd_result = CMD1394_EINVALID_CONTEXT; s1394_fa_check_restore_cmd(to_hal, cmd); - TNF_PROBE_1(t1394_write_error, S1394_TNF_SL_ATREQ_ERROR, "", - tnf_string, msg, "Tried to use CMD1394_BLOCKING in intr " - "context"); - TNF_PROBE_0_DEBUG(t1394_write_exit, S1394_TNF_SL_ATREQ_STACK, - ""); return (DDI_FAILURE); } @@ -715,10 +617,6 @@ t1394_write(t1394_handle_t t1394_hdl, cmd1394_cmd_t *cmd) cmd->cmd_result = err; mutex_exit(&to_hal->topology_tree_mutex); s1394_fa_check_restore_cmd(to_hal, cmd); - TNF_PROBE_1(t1394_write_error, S1394_TNF_SL_ATREQ_ERROR, "", - tnf_string, msg, "Failed in s1394_setup_asynch_command()"); - TNF_PROBE_0_DEBUG(t1394_write_exit, S1394_TNF_SL_ATREQ_STACK, - ""); return (DDI_FAILURE); } @@ -737,11 +635,6 @@ t1394_write(t1394_handle_t t1394_hdl, cmd1394_cmd_t *cmd) s_priv->cmd_in_use = B_FALSE; cmd->cmd_result = CMD1394_EINVALID_CONTEXT; s1394_fa_check_restore_cmd(to_hal, cmd); - TNF_PROBE_1(t1394_write_error, - S1394_TNF_SL_ATREQ_ERROR, "", tnf_string, - msg, "CMD1394_BLOCKING in bus reset cntxt"); - TNF_PROBE_0_DEBUG(t1394_write_exit, - S1394_TNF_SL_ATREQ_STACK, ""); return (DDI_FAILURE); } } @@ -752,8 +645,6 @@ t1394_write(t1394_handle_t t1394_hdl, cmd1394_cmd_t *cmd) /* Block (if necessary) */ s1394_block_on_asynch_cmd(cmd); - TNF_PROBE_0_DEBUG(t1394_write_exit, S1394_TNF_SL_ATREQ_STACK, - ""); return (DDI_SUCCESS); } mutex_exit(&to_hal->topology_tree_mutex); @@ -771,8 +662,6 @@ t1394_write(t1394_handle_t t1394_hdl, cmd1394_cmd_t *cmd) /* Block (if necessary) */ s1394_block_on_asynch_cmd(cmd); - TNF_PROBE_0_DEBUG(t1394_write_exit, - S1394_TNF_SL_ATREQ_STACK, ""); return (DDI_SUCCESS); } else { /* Remove cmd from outstanding request Q */ @@ -784,19 +673,12 @@ t1394_write(t1394_handle_t t1394_hdl, cmd1394_cmd_t *cmd) cmd->cmd_result = err; s1394_fa_check_restore_cmd(to_hal, cmd); - TNF_PROBE_1(t1394_write_error, - S1394_TNF_SL_ATREQ_ERROR, "", tnf_string, msg, - "Failed in s1394_xfer_asynch_command()"); - TNF_PROBE_0_DEBUG(t1394_write_exit, - S1394_TNF_SL_ATREQ_STACK, ""); return (DDI_FAILURE); } } else { /* Block (if necessary) */ s1394_block_on_asynch_cmd(cmd); - TNF_PROBE_0_DEBUG(t1394_write_exit, S1394_TNF_SL_ATREQ_STACK, - ""); return (DDI_SUCCESS); } } @@ -824,8 +706,6 @@ t1394_lock(t1394_handle_t t1394_hdl, cmd1394_cmd_t *cmd) uint_t num_retries; int ret; - TNF_PROBE_0_DEBUG(t1394_lock_enter, S1394_TNF_SL_ATREQ_STACK, ""); - ASSERT(t1394_hdl != NULL); ASSERT(cmd != NULL); @@ -834,10 +714,6 @@ t1394_lock(t1394_handle_t t1394_hdl, cmd1394_cmd_t *cmd) /* Is this command currently in use? */ if (s_priv->cmd_in_use == B_TRUE) { - TNF_PROBE_1(t1394_lock_error, S1394_TNF_SL_ATREQ_ERROR, "", - tnf_string, msg, "Attempted to resend an in-use command"); - TNF_PROBE_0_DEBUG(t1394_lock_exit, S1394_TNF_SL_ATREQ_STACK, - ""); ASSERT(s_priv->cmd_in_use == B_FALSE); return (DDI_FAILURE); } @@ -863,11 +739,6 @@ t1394_lock(t1394_handle_t t1394_hdl, cmd1394_cmd_t *cmd) if ((cmd->cmd_type != CMD1394_ASYNCH_LOCK_32) && (cmd->cmd_type != CMD1394_ASYNCH_LOCK_64)) { cmd->cmd_result = CMD1394_EINVALID_COMMAND; - TNF_PROBE_1(t1394_lock_error, S1394_TNF_SL_ATREQ_ERROR, "", - tnf_string, msg, "Invalid command type sent to " - "t1394_lock()"); - TNF_PROBE_0_DEBUG(t1394_lock_exit, S1394_TNF_SL_ATREQ_STACK, - ""); return (DDI_FAILURE); } @@ -878,11 +749,6 @@ t1394_lock(t1394_handle_t t1394_hdl, cmd1394_cmd_t *cmd) if ((cmd->cmd_options & CMD1394_BLOCKING) && (servicing_interrupt())) { cmd->cmd_result = CMD1394_EINVALID_CONTEXT; - TNF_PROBE_1(t1394_lock_error, S1394_TNF_SL_ATREQ_ERROR, "", - tnf_string, msg, "Tried to use CMD1394_BLOCKING in intr " - "context"); - TNF_PROBE_0_DEBUG(t1394_lock_exit, S1394_TNF_SL_ATREQ_STACK, - ""); return (DDI_FAILURE); } @@ -922,14 +788,11 @@ t1394_lock(t1394_handle_t t1394_hdl, cmd1394_cmd_t *cmd) break; default: - TNF_PROBE_1(t1394_lock_error, S1394_TNF_SL_ATREQ_ERROR, "", - tnf_string, msg, "Invalid lock_type in command"); cmd->cmd_result = CMD1394_EINVALID_COMMAND; ret = DDI_FAILURE; break; } - TNF_PROBE_0_DEBUG(t1394_lock_exit, S1394_TNF_SL_ATREQ_STACK, ""); return (ret); } @@ -967,9 +830,6 @@ t1394_alloc_addr(t1394_handle_t t1394_hdl, t1394_alloc_addr_t *addr_allocp, uint64_t addr_hi; int err; - TNF_PROBE_0_DEBUG(t1394_alloc_addr_enter, S1394_TNF_SL_ARREQ_STACK, - ""); - ASSERT(t1394_hdl != NULL); ASSERT(addr_allocp != NULL); @@ -996,13 +856,6 @@ t1394_alloc_addr(t1394_handle_t t1394_hdl, t1394_alloc_addr_t *addr_allocp, */ *result = T1394_EINVALID_PARAM; - TNF_PROBE_1(t1394_alloc_addr_error, - S1394_TNF_SL_ARREQ_ERROR, "", tnf_string, msg, - "Invalid flags " - "(RDs on, notify off, no backing store)"); - TNF_PROBE_0_DEBUG(t1394_alloc_addr_exit, - S1394_TNF_SL_ARREQ_STACK, ""); - /* kstats - addr alloc failures */ hal->hal_kstats->addr_alloc_fail++; return (DDI_FAILURE); @@ -1024,13 +877,6 @@ t1394_alloc_addr(t1394_handle_t t1394_hdl, t1394_alloc_addr_t *addr_allocp, */ *result = T1394_EINVALID_PARAM; - TNF_PROBE_1(t1394_alloc_addr_error, - S1394_TNF_SL_ARREQ_ERROR, "", tnf_string, msg, - "Invalid flags " - "(WRs on, notify off, no backing store)"); - TNF_PROBE_0_DEBUG(t1394_alloc_addr_exit, - S1394_TNF_SL_ARREQ_STACK, ""); - /* kstats - addr alloc failures */ hal->hal_kstats->addr_alloc_fail++; return (DDI_FAILURE); @@ -1052,13 +898,6 @@ t1394_alloc_addr(t1394_handle_t t1394_hdl, t1394_alloc_addr_t *addr_allocp, */ *result = T1394_EINVALID_PARAM; - TNF_PROBE_1(t1394_alloc_addr_error, - S1394_TNF_SL_ARREQ_ERROR, "", tnf_string, msg, - "Invalid flags " - "(LKs on, notify off, no backing store)"); - TNF_PROBE_0_DEBUG(t1394_alloc_addr_exit, - S1394_TNF_SL_ARREQ_STACK, ""); - /* kstats - addr alloc failures */ hal->hal_kstats->addr_alloc_fail++; return (DDI_FAILURE); @@ -1078,8 +917,6 @@ t1394_alloc_addr(t1394_handle_t t1394_hdl, t1394_alloc_addr_t *addr_allocp, } else { *result = T1394_NOERROR; } - TNF_PROBE_0_DEBUG(t1394_alloc_addr_exit, - S1394_TNF_SL_ARREQ_STACK, ""); return (err); } else { err = s1394_claim_addr_blk((s1394_hal_t *)target->on_hal, @@ -1100,8 +937,6 @@ t1394_alloc_addr(t1394_handle_t t1394_hdl, t1394_alloc_addr_t *addr_allocp, s1394_physical_arreq_set_one(target); } } - TNF_PROBE_0_DEBUG(t1394_alloc_addr_exit, - S1394_TNF_SL_ARREQ_STACK, ""); return (err); } } @@ -1129,8 +964,6 @@ t1394_free_addr(t1394_handle_t t1394_hdl, t1394_addr_handle_t *addr_hdl, s1394_hal_t *hal; s1394_target_t *target; - TNF_PROBE_0_DEBUG(t1394_free_addr_enter, S1394_TNF_SL_ARREQ_STACK, ""); - ASSERT(t1394_hdl != NULL); ASSERT(addr_hdl != NULL); @@ -1142,8 +975,6 @@ t1394_free_addr(t1394_handle_t t1394_hdl, t1394_addr_handle_t *addr_hdl, curr_blk = (s1394_addr_space_blk_t *)(*addr_hdl); if (s1394_free_addr_blk(hal, curr_blk) != DDI_SUCCESS) { - TNF_PROBE_0_DEBUG(t1394_free_addr_exit, - S1394_TNF_SL_ARREQ_STACK, ""); return (DDI_FAILURE); } @@ -1158,7 +989,6 @@ t1394_free_addr(t1394_handle_t t1394_hdl, t1394_addr_handle_t *addr_hdl, /* kstats - number of addr frees */ hal->hal_kstats->addr_space_free++; - TNF_PROBE_0_DEBUG(t1394_free_addr_exit, S1394_TNF_SL_ARREQ_STACK, ""); return (DDI_SUCCESS); } @@ -1200,9 +1030,6 @@ t1394_recv_request_done(t1394_handle_t t1394_hdl, cmd1394_cmd_t *resp, boolean_t write_cmd = B_FALSE; boolean_t mblk_too_small; - TNF_PROBE_0_DEBUG(t1394_recv_request_done_enter, - S1394_TNF_SL_ARREQ_STACK, ""); - ASSERT(t1394_hdl != NULL); ASSERT(resp != NULL); @@ -1242,8 +1069,6 @@ t1394_recv_request_done(t1394_handle_t t1394_hdl, cmd1394_cmd_t *resp, /* Free the command - Pass it back to the HAL */ HAL_CALL(hal).response_complete(hal->halinfo.hal_private, resp, h_priv); - TNF_PROBE_0_DEBUG(t1394_recv_request_done_exit, - S1394_TNF_SL_ARREQ_STACK, ""); return (DDI_SUCCESS); } @@ -1260,11 +1085,6 @@ t1394_recv_request_done(t1394_handle_t t1394_hdl, cmd1394_cmd_t *resp, mblk_too_small = B_TRUE; if (curr_blk == NULL) { - TNF_PROBE_1(t1394_recv_request_done_error, - S1394_TNF_SL_ARREQ_ERROR, "", tnf_string, - msg, "mblk_t is NULL in response"); - TNF_PROBE_0_DEBUG(t1394_recv_request_done_exit, - S1394_TNF_SL_ARREQ_STACK, ""); /* * Free the command - Pass it back * to the HAL @@ -1287,11 +1107,6 @@ t1394_recv_request_done(t1394_handle_t t1394_hdl, cmd1394_cmd_t *resp, } if (mblk_too_small == B_TRUE) { - TNF_PROBE_1(t1394_recv_request_done_error, - S1394_TNF_SL_ARREQ_ERROR, "", tnf_string, - msg, "mblk_t too small in response"); - TNF_PROBE_0_DEBUG(t1394_recv_request_done_exit, - S1394_TNF_SL_ARREQ_STACK, ""); /* * Free the command - Pass it back * to the HAL @@ -1308,16 +1123,9 @@ t1394_recv_request_done(t1394_handle_t t1394_hdl, cmd1394_cmd_t *resp, case IEEE1394_RESP_TYPE_ERROR: case IEEE1394_RESP_ADDRESS_ERROR: ret = s1394_send_response(hal, resp); - TNF_PROBE_0_DEBUG(t1394_recv_request_done_exit, - S1394_TNF_SL_ARREQ_STACK, ""); return (ret); default: - TNF_PROBE_1(t1394_recv_request_done_error, - S1394_TNF_SL_ARREQ_ERROR, "", tnf_string, msg, - "Invalid response code"); - TNF_PROBE_0_DEBUG(t1394_recv_request_done_exit, - S1394_TNF_SL_ARREQ_STACK, ""); return (DDI_FAILURE); } } @@ -1346,15 +1154,10 @@ t1394_fcp_register_controller(t1394_handle_t t1394_hdl, t1394_fcp_evts_t *evts, { int result; - TNF_PROBE_0_DEBUG(t1394_fcp_register_controller_enter, - S1394_TNF_SL_FCP_STACK, ""); - ASSERT(t1394_hdl != NULL); result = s1394_fcp_register_ctl((s1394_target_t *)t1394_hdl, evts); - TNF_PROBE_0_DEBUG(t1394_fcp_register_controller_exit, - S1394_TNF_SL_FCP_STACK, ""); return (result); } @@ -1375,15 +1178,10 @@ t1394_fcp_unregister_controller(t1394_handle_t t1394_hdl) { int result; - TNF_PROBE_0_DEBUG(t1394_fcp_unregister_controller_enter, - S1394_TNF_SL_FCP_STACK, ""); - ASSERT(t1394_hdl != NULL); result = s1394_fcp_unregister_ctl((s1394_target_t *)t1394_hdl); - TNF_PROBE_0_DEBUG(t1394_fcp_unregister_controller_exit, - S1394_TNF_SL_FCP_STACK, ""); return (result); } @@ -1410,15 +1208,10 @@ t1394_fcp_register_target(t1394_handle_t t1394_hdl, t1394_fcp_evts_t *evts, { int result; - TNF_PROBE_0_DEBUG(t1394_fcp_register_target_enter, - S1394_TNF_SL_FCP_STACK, ""); - ASSERT(t1394_hdl != NULL); result = s1394_fcp_register_tgt((s1394_target_t *)t1394_hdl, evts); - TNF_PROBE_0_DEBUG(t1394_fcp_register_target_exit, - S1394_TNF_SL_FCP_STACK, ""); return (result); } @@ -1439,15 +1232,10 @@ t1394_fcp_unregister_target(t1394_handle_t t1394_hdl) { int result; - TNF_PROBE_0_DEBUG(t1394_fcp_unregister_target_enter, - S1394_TNF_SL_FCP_STACK, ""); - ASSERT(t1394_hdl != NULL); result = s1394_fcp_unregister_tgt((s1394_target_t *)t1394_hdl); - TNF_PROBE_0_DEBUG(t1394_fcp_unregister_target_exit, - S1394_TNF_SL_FCP_STACK, ""); return (result); } @@ -1472,13 +1260,10 @@ t1394_cmp_register(t1394_handle_t t1394_hdl, t1394_cmp_evts_t *evts, { int result; - TNF_PROBE_0_DEBUG(t1394_cmp_register_enter, S1394_TNF_SL_CMP_STACK, ""); - ASSERT(t1394_hdl != NULL); result = s1394_cmp_register((s1394_target_t *)t1394_hdl, evts); - TNF_PROBE_0_DEBUG(t1394_cmp_register_exit, S1394_TNF_SL_CMP_STACK, ""); return (result); } @@ -1501,15 +1286,10 @@ t1394_cmp_unregister(t1394_handle_t t1394_hdl) { int result; - TNF_PROBE_0_DEBUG(t1394_cmp_unregister_enter, S1394_TNF_SL_CMP_STACK, - ""); - ASSERT(t1394_hdl != NULL); result = s1394_cmp_unregister((s1394_target_t *)t1394_hdl); - TNF_PROBE_0_DEBUG(t1394_cmp_unregister_exit, S1394_TNF_SL_CMP_STACK, - ""); return (result); } @@ -1531,13 +1311,10 @@ t1394_cmp_read(t1394_handle_t t1394_hdl, t1394_cmp_reg_t reg, uint32_t *valp) { int result; - TNF_PROBE_0_DEBUG(t1394_cmp_read_enter, S1394_TNF_SL_CMP_STACK, ""); - ASSERT(t1394_hdl != NULL); result = s1394_cmp_read((s1394_target_t *)t1394_hdl, reg, valp); - TNF_PROBE_0_DEBUG(t1394_cmp_read_exit, S1394_TNF_SL_CMP_STACK, ""); return (result); } @@ -1562,14 +1339,11 @@ t1394_cmp_cas(t1394_handle_t t1394_hdl, t1394_cmp_reg_t reg, uint32_t arg_val, { int result; - TNF_PROBE_0_DEBUG(t1394_cmp_read_enter, S1394_TNF_SL_CMP_STACK, ""); - ASSERT(t1394_hdl != NULL); result = s1394_cmp_cas((s1394_target_t *)t1394_hdl, reg, arg_val, new_val, old_valp); - TNF_PROBE_0_DEBUG(t1394_cmp_read_exit, S1394_TNF_SL_CMP_STACK, ""); return (result); } @@ -1609,9 +1383,6 @@ t1394_alloc_isoch_single(t1394_handle_t t1394_hdl, int ret; int err; - TNF_PROBE_0_DEBUG(t1394_alloc_isoch_single_enter, - S1394_TNF_SL_ISOCH_STACK, ""); - ASSERT(t1394_hdl != NULL); ASSERT(t1394_single_hdl != NULL); ASSERT(sii != NULL); @@ -1620,32 +1391,17 @@ t1394_alloc_isoch_single(t1394_handle_t t1394_hdl, /* Check for invalid channel_mask */ if (sii->si_channel_mask == 0) { - TNF_PROBE_1(t1394_alloc_isoch_single_error, - S1394_TNF_SL_ISOCH_ERROR, "", tnf_string, msg, - "Invalid channel mask"); - TNF_PROBE_0_DEBUG(t1394_alloc_isoch_single_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_FAILURE); } /* Check for invalid bandwidth */ if ((sii->si_bandwidth <= IEEE1394_BANDWIDTH_MIN) || (sii->si_bandwidth > IEEE1394_BANDWIDTH_MAX)) { - TNF_PROBE_1(t1394_alloc_isoch_single_error, - S1394_TNF_SL_ISOCH_ERROR, "", tnf_string, msg, - "Invalid bandwidth requirements"); - TNF_PROBE_0_DEBUG(t1394_alloc_isoch_single_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_FAILURE); } /* Verify that rsrc_fail_target() callback is non-NULL */ if (sii->rsrc_fail_target == NULL) { - TNF_PROBE_1(t1394_alloc_isoch_single_error, - S1394_TNF_SL_ISOCH_ERROR, "", tnf_string, msg, - "Invalid callback specified"); - TNF_PROBE_0_DEBUG(t1394_alloc_isoch_single_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_FAILURE); } @@ -1705,25 +1461,16 @@ t1394_alloc_isoch_single(t1394_handle_t t1394_hdl, (t1394_isoch_cec_handle_t)cec_new, 0, &jii); if (ret != DDI_SUCCESS) { - TNF_PROBE_1(t1394_alloc_isoch_single_error, - S1394_TNF_SL_ISOCH_ERROR, "", tnf_string, msg, - "Unexpected error from t1394_join_isoch_cec()"); - ret = t1394_free_isoch_cec(t1394_hdl, flags, (t1394_isoch_cec_handle_t *)&cec_new); if (ret != DDI_SUCCESS) { /* Unable to free the Isoch CEC */ - TNF_PROBE_1(t1394_alloc_isoch_single_error, - S1394_TNF_SL_ISOCH_ERROR, "", tnf_string, msg, - "Unexpected error from t1394_free_isoch_cec()"); ASSERT(0); } /* Handle is nulled out before returning */ *t1394_single_hdl = NULL; - TNF_PROBE_0_DEBUG(t1394_alloc_isoch_single_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_FAILURE); } @@ -1734,10 +1481,6 @@ t1394_alloc_isoch_single(t1394_handle_t t1394_hdl, (t1394_isoch_cec_handle_t)cec_new, 0, &err); if (ret != DDI_SUCCESS) { - TNF_PROBE_1(t1394_alloc_isoch_single_error, - S1394_TNF_SL_ISOCH_ERROR, "", tnf_string, msg, - "Unexpected error from t1394_setup_isoch_cec()"); - *result = err; /* Leave the Isoch CEC */ @@ -1745,9 +1488,6 @@ t1394_alloc_isoch_single(t1394_handle_t t1394_hdl, (t1394_isoch_cec_handle_t)cec_new, 0); if (ret != DDI_SUCCESS) { /* Unable to leave the Isoch CEC */ - TNF_PROBE_1(t1394_alloc_isoch_single_error, - S1394_TNF_SL_ISOCH_ERROR, "", tnf_string, msg, - "Unexpected error from t1394_leave_isoch_cec()"); ASSERT(0); } @@ -1756,17 +1496,12 @@ t1394_alloc_isoch_single(t1394_handle_t t1394_hdl, (t1394_isoch_cec_handle_t *)&cec_new); if (ret != DDI_SUCCESS) { /* Unable to free the Isoch CEC */ - TNF_PROBE_1(t1394_alloc_isoch_single_error, - S1394_TNF_SL_ISOCH_ERROR, "", tnf_string, msg, - "Unexpected error from t1394_free_isoch_cec()"); ASSERT(0); } /* Handle is nulled out before returning */ *t1394_single_hdl = NULL; - TNF_PROBE_0_DEBUG(t1394_alloc_isoch_single_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_FAILURE); } @@ -1778,8 +1513,6 @@ t1394_alloc_isoch_single(t1394_handle_t t1394_hdl, /* Update the handle */ *t1394_single_hdl = (t1394_isoch_single_handle_t)cec_new; - TNF_PROBE_0_DEBUG(t1394_alloc_isoch_single_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_SUCCESS); } @@ -1805,9 +1538,6 @@ t1394_free_isoch_single(t1394_handle_t t1394_hdl, s1394_isoch_cec_t *cec_curr; int ret; - TNF_PROBE_0_DEBUG(t1394_free_isoch_single_enter, - S1394_TNF_SL_ISOCH_STACK, ""); - ASSERT(t1394_hdl != NULL); ASSERT(t1394_single_hdl != NULL); @@ -1821,9 +1551,6 @@ t1394_free_isoch_single(t1394_handle_t t1394_hdl, (t1394_isoch_cec_handle_t)cec_curr, 0); if (ret != DDI_SUCCESS) { /* Unable to teardown the Isoch CEC */ - TNF_PROBE_1(t1394_free_isoch_single_error, - S1394_TNF_SL_ISOCH_ERROR, "", tnf_string, msg, - "Unexpected error from t1394_teardown_isoch_cec()"); ASSERT(0); } @@ -1834,9 +1561,6 @@ t1394_free_isoch_single(t1394_handle_t t1394_hdl, (t1394_isoch_cec_handle_t)cec_curr, 0); if (ret != DDI_SUCCESS) { /* Unable to leave the Isoch CEC */ - TNF_PROBE_1(t1394_free_isoch_single_error, - S1394_TNF_SL_ISOCH_ERROR, "", tnf_string, msg, - "Unexpected error from t1394_leave_isoch_cec()"); ASSERT(0); } @@ -1847,17 +1571,11 @@ t1394_free_isoch_single(t1394_handle_t t1394_hdl, (t1394_isoch_cec_handle_t *)&cec_curr); if (ret != DDI_SUCCESS) { /* Unable to free the Isoch CEC */ - TNF_PROBE_1(t1394_free_isoch_single_error, - S1394_TNF_SL_ISOCH_ERROR, "", tnf_string, msg, - "Unexpected error from t1394_free_isoch_cec()"); ASSERT(0); } /* Handle is nulled out before returning */ *t1394_single_hdl = NULL; - - TNF_PROBE_0_DEBUG(t1394_free_isoch_single_exit, - S1394_TNF_SL_ISOCH_STACK, ""); } /* @@ -1885,9 +1603,6 @@ t1394_alloc_isoch_cec(t1394_handle_t t1394_hdl, t1394_isoch_cec_props_t *props, s1394_isoch_cec_t *cec_new; uint64_t temp; - TNF_PROBE_0_DEBUG(t1394_alloc_isoch_cec_enter, - S1394_TNF_SL_ISOCH_STACK, ""); - ASSERT(t1394_hdl != NULL); ASSERT(t1394_isoch_cec_hdl != NULL); ASSERT(props != NULL); @@ -1896,11 +1611,6 @@ t1394_alloc_isoch_cec(t1394_handle_t t1394_hdl, t1394_isoch_cec_props_t *props, /* Check for invalid channel_mask */ if (props->cec_channel_mask == 0) { - TNF_PROBE_1(t1394_alloc_isoch_cec_error, - S1394_TNF_SL_ISOCH_ERROR, "", tnf_string, msg, - "Invalid channel mask"); - TNF_PROBE_0_DEBUG(t1394_alloc_isoch_cec_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_FAILURE); } @@ -1909,21 +1619,11 @@ t1394_alloc_isoch_cec(t1394_handle_t t1394_hdl, t1394_isoch_cec_props_t *props, if (props->cec_options & T1394_NO_IRM_ALLOC) { /* If T1394_NO_IRM_ALLOC, then only one bit should be set */ if (!ISP2(temp)) { - TNF_PROBE_1(t1394_alloc_isoch_cec_error, - S1394_TNF_SL_ISOCH_ERROR, "", tnf_string, msg, - "Invalid channel mask"); - TNF_PROBE_0_DEBUG(t1394_alloc_isoch_cec_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_FAILURE); } /* If T1394_NO_IRM_ALLOC, then speeds should be equal */ if (props->cec_min_speed != props->cec_max_speed) { - TNF_PROBE_1(t1394_alloc_isoch_cec_error, - S1394_TNF_SL_ISOCH_ERROR, "", tnf_string, msg, - "Invalid speeds (min != max)"); - TNF_PROBE_0_DEBUG(t1394_alloc_isoch_cec_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_FAILURE); } } @@ -1931,11 +1631,6 @@ t1394_alloc_isoch_cec(t1394_handle_t t1394_hdl, t1394_isoch_cec_props_t *props, /* Check for invalid bandwidth */ if ((props->cec_bandwidth <= IEEE1394_BANDWIDTH_MIN) || (props->cec_bandwidth > IEEE1394_BANDWIDTH_MAX)) { - TNF_PROBE_1(t1394_alloc_isoch_cec_error, - S1394_TNF_SL_ISOCH_ERROR, "", tnf_string, msg, - "Invalid bandwidth requirements"); - TNF_PROBE_0_DEBUG(t1394_alloc_isoch_cec_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_FAILURE); } @@ -1975,8 +1670,6 @@ t1394_alloc_isoch_cec(t1394_handle_t t1394_hdl, t1394_isoch_cec_props_t *props, /* Update the handle and return */ *t1394_isoch_cec_hdl = (t1394_isoch_cec_handle_t)cec_new; - TNF_PROBE_0_DEBUG(t1394_alloc_isoch_cec_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_SUCCESS); } @@ -2003,9 +1696,6 @@ t1394_free_isoch_cec(t1394_handle_t t1394_hdl, uint_t flags, s1394_hal_t *hal; s1394_isoch_cec_t *cec_curr; - TNF_PROBE_0_DEBUG(t1394_free_isoch_cec_enter, - S1394_TNF_SL_ISOCH_STACK, ""); - ASSERT(t1394_hdl != NULL); ASSERT(t1394_isoch_cec_hdl != NULL); @@ -2021,11 +1711,6 @@ t1394_free_isoch_cec(t1394_handle_t t1394_hdl, uint_t flags, if (CEC_IN_ANY_CALLBACKS(cec_curr)) { /* Unlock the Isoch CEC member list */ mutex_exit(&cec_curr->isoch_cec_mutex); - TNF_PROBE_1(t1394_free_isoch_cec_error, - S1394_TNF_SL_ISOCH_ERROR, "", tnf_string, msg, - "Not allowed to free Isoch CEC (in callbacks)"); - TNF_PROBE_0_DEBUG(t1394_free_isoch_cec_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_FAILURE); } @@ -2033,11 +1718,6 @@ t1394_free_isoch_cec(t1394_handle_t t1394_hdl, uint_t flags, if (CEC_TRANSITION_LEGAL(cec_curr, ISOCH_CEC_FREE) == 0) { /* Unlock the Isoch CEC member list */ mutex_exit(&cec_curr->isoch_cec_mutex); - TNF_PROBE_1(t1394_free_isoch_cec_error, - S1394_TNF_SL_ISOCH_ERROR, "", tnf_string, msg, - "Not allowed to free Isoch CEC"); - TNF_PROBE_0_DEBUG(t1394_free_isoch_cec_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_FAILURE); } mutex_exit(&cec_curr->isoch_cec_mutex); @@ -2059,8 +1739,6 @@ t1394_free_isoch_cec(t1394_handle_t t1394_hdl, uint_t flags, /* Update the handle and return */ *t1394_isoch_cec_hdl = NULL; - TNF_PROBE_0_DEBUG(t1394_free_isoch_cec_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_SUCCESS); } @@ -2098,9 +1776,6 @@ t1394_join_isoch_cec(t1394_handle_t t1394_hdl, uint64_t check_mask; uint_t curr_max_speed; - TNF_PROBE_0_DEBUG(t1394_join_isoch_cec_enter, - S1394_TNF_SL_ISOCH_STACK, ""); - ASSERT(t1394_hdl != NULL); ASSERT(t1394_isoch_cec_hdl != NULL); @@ -2127,11 +1802,6 @@ t1394_join_isoch_cec(t1394_handle_t t1394_hdl, kmem_free(member_new, sizeof (s1394_isoch_cec_member_t)); /* Unlock the Isoch CEC member list */ mutex_exit(&cec_curr->isoch_cec_mutex); - TNF_PROBE_1(t1394_join_isoch_cec_error, - S1394_TNF_SL_ISOCH_ERROR, "", tnf_string, msg, - "Not allowed to join Isoch CEC"); - TNF_PROBE_0_DEBUG(t1394_join_isoch_cec_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_FAILURE); } @@ -2142,11 +1812,6 @@ t1394_join_isoch_cec(t1394_handle_t t1394_hdl, kmem_free(member_new, sizeof (s1394_isoch_cec_member_t)); /* Unlock the Isoch CEC member list */ mutex_exit(&cec_curr->isoch_cec_mutex); - TNF_PROBE_1(t1394_join_isoch_cec_error, - S1394_TNF_SL_ISOCH_ERROR, "", tnf_string, msg, - "Inconsistent channel mask specified"); - TNF_PROBE_0_DEBUG(t1394_join_isoch_cec_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_FAILURE); } @@ -2155,11 +1820,6 @@ t1394_join_isoch_cec(t1394_handle_t t1394_hdl, kmem_free(member_new, sizeof (s1394_isoch_cec_member_t)); /* Unlock the Isoch CEC member list */ mutex_exit(&cec_curr->isoch_cec_mutex); - TNF_PROBE_1(t1394_join_isoch_cec_error, - S1394_TNF_SL_ISOCH_ERROR, "", tnf_string, msg, - "Inconsistent speed specified"); - TNF_PROBE_0_DEBUG(t1394_join_isoch_cec_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_FAILURE); } else if (join_isoch_info->req_max_speed < cec_curr->filter_current_speed) { @@ -2174,11 +1834,6 @@ t1394_join_isoch_cec(t1394_handle_t t1394_hdl, kmem_free(member_new, sizeof (s1394_isoch_cec_member_t)); /* Unlock the Isoch CEC member list */ mutex_exit(&cec_curr->isoch_cec_mutex); - TNF_PROBE_1(t1394_join_isoch_cec_error, - S1394_TNF_SL_ISOCH_ERROR, "", tnf_string, msg, - "Multiple talkers specified"); - TNF_PROBE_0_DEBUG(t1394_join_isoch_cec_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_FAILURE); } @@ -2191,11 +1846,6 @@ t1394_join_isoch_cec(t1394_handle_t t1394_hdl, (join_isoch_info->isoch_cec_evts.teardown_target == NULL))) { /* Unlock the Isoch CEC member list */ mutex_exit(&cec_curr->isoch_cec_mutex); - TNF_PROBE_1(t1394_join_isoch_cec_error, - S1394_TNF_SL_ISOCH_ERROR, "", tnf_string, msg, - "Invalid callbacks specified"); - TNF_PROBE_0_DEBUG(t1394_join_isoch_cec_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_FAILURE); } @@ -2228,8 +1878,6 @@ t1394_join_isoch_cec(t1394_handle_t t1394_hdl, /* Unlock the Isoch CEC member list */ mutex_exit(&cec_curr->isoch_cec_mutex); - TNF_PROBE_0_DEBUG(t1394_join_isoch_cec_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_SUCCESS); } @@ -2264,9 +1912,6 @@ t1394_leave_isoch_cec(t1394_handle_t t1394_hdl, uint64_t temp_channel_mask; uint_t temp_max_speed; - TNF_PROBE_0_DEBUG(t1394_leave_isoch_cec_enter, - S1394_TNF_SL_ISOCH_STACK, ""); - ASSERT(t1394_hdl != NULL); ASSERT(t1394_isoch_cec_hdl != NULL); @@ -2289,11 +1934,6 @@ t1394_leave_isoch_cec(t1394_handle_t t1394_hdl, if (CEC_TRANSITION_LEGAL(cec_curr, ISOCH_CEC_LEAVE) == 0) { /* Unlock the Isoch CEC member list */ mutex_exit(&cec_curr->isoch_cec_mutex); - TNF_PROBE_1(t1394_leave_isoch_cec_error, - S1394_TNF_SL_ISOCH_ERROR, "", tnf_string, msg, - "Not allowed to leave Isoch CEC"); - TNF_PROBE_0_DEBUG(t1394_leave_isoch_cec_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_FAILURE); } @@ -2320,11 +1960,6 @@ t1394_leave_isoch_cec(t1394_handle_t t1394_hdl, if (found == B_FALSE) { /* Unlock the Isoch CEC member list */ mutex_exit(&cec_curr->isoch_cec_mutex); - TNF_PROBE_1(t1394_leave_isoch_cec_error, - S1394_TNF_SL_ISOCH_ERROR, "", tnf_string, msg, - "Target not found in Isoch CEC member list"); - TNF_PROBE_0_DEBUG(t1394_leave_isoch_cec_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_FAILURE); } else { /* This member's departure may change filter constraints */ @@ -2358,8 +1993,6 @@ t1394_leave_isoch_cec(t1394_handle_t t1394_hdl, /* Free the Isoch CEC member structure */ kmem_free(member_temp, sizeof (s1394_isoch_cec_member_t)); - TNF_PROBE_0_DEBUG(t1394_leave_isoch_cec_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_SUCCESS); } @@ -2403,9 +2036,6 @@ t1394_setup_isoch_cec(t1394_handle_t t1394_hdl, int (*setup_callback)(t1394_isoch_cec_handle_t, opaque_t, t1394_setup_target_args_t *); - TNF_PROBE_0_DEBUG(t1394_setup_isoch_cec_enter, - S1394_TNF_SL_ISOCH_STACK, ""); - ASSERT(t1394_hdl != NULL); ASSERT(t1394_isoch_cec_hdl != NULL); @@ -2421,11 +2051,6 @@ t1394_setup_isoch_cec(t1394_handle_t t1394_hdl, if (CEC_IN_ANY_CALLBACKS(cec_curr)) { /* Unlock the Isoch CEC member list */ mutex_exit(&cec_curr->isoch_cec_mutex); - TNF_PROBE_1(t1394_setup_isoch_cec_error, - S1394_TNF_SL_ISOCH_ERROR, "", tnf_string, msg, - "Not allowed to setup Isoch CEC (in callbacks)"); - TNF_PROBE_0_DEBUG(t1394_setup_isoch_cec_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_FAILURE); } @@ -2433,11 +2058,6 @@ t1394_setup_isoch_cec(t1394_handle_t t1394_hdl, if (CEC_TRANSITION_LEGAL(cec_curr, ISOCH_CEC_SETUP) == 0) { /* Unlock the Isoch CEC member list */ mutex_exit(&cec_curr->isoch_cec_mutex); - TNF_PROBE_1(t1394_setup_isoch_cec_error, - S1394_TNF_SL_ISOCH_ERROR, "", tnf_string, msg, - "Not allowed to setup Isoch CEC"); - TNF_PROBE_0_DEBUG(t1394_setup_isoch_cec_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_FAILURE); } @@ -2481,11 +2101,6 @@ t1394_setup_isoch_cec(t1394_handle_t t1394_hdl, *result = T1394_ENO_BANDWIDTH; /* Unlock the Isoch CEC member list */ mutex_exit(&cec_curr->isoch_cec_mutex); - TNF_PROBE_1(t1394_setup_isoch_cec_error, - S1394_TNF_SL_ISOCH_ERROR, "", tnf_string, - msg, "Unable to allocate isoch bandwidth"); - TNF_PROBE_0_DEBUG(t1394_setup_isoch_cec_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_FAILURE); } } @@ -2566,21 +2181,11 @@ t1394_setup_isoch_cec(t1394_handle_t t1394_hdl, if (ret == DDI_FAILURE) { if (err == CMD1394_EBUSRESET) { continue; - } else { - TNF_PROBE_1(t1394_setup_isoch_cec_error, - S1394_TNF_SL_ISOCH_ERROR, "", - tnf_string, msg, - "Unable to free isoch bandwidth"); } } /* Unlock the Isoch CEC member list */ mutex_exit(&cec_curr->isoch_cec_mutex); - TNF_PROBE_1(t1394_setup_isoch_cec_error, - S1394_TNF_SL_ISOCH_ERROR, "", tnf_string, msg, - "Unable to allocate isoch channel"); - TNF_PROBE_0_DEBUG(t1394_setup_isoch_cec_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_FAILURE); } @@ -2596,11 +2201,6 @@ t1394_setup_isoch_cec(t1394_handle_t t1394_hdl, *result = T1394_ENO_BANDWIDTH; /* Unlock the Isoch CEC member list */ mutex_exit(&cec_curr->isoch_cec_mutex); - TNF_PROBE_1(t1394_setup_isoch_cec_error, - S1394_TNF_SL_ISOCH_ERROR, "", tnf_string, msg, - "Unable to allocate isoch channel"); - TNF_PROBE_0_DEBUG(t1394_setup_isoch_cec_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_FAILURE); } @@ -2657,16 +2257,9 @@ setup_do_callbacks: /* Return DDI_FAILURE if any targets failed setup */ if (*result != 0) { - TNF_PROBE_1(t1394_setup_isoch_cec_error, - S1394_TNF_SL_ISOCH_ERROR, "", tnf_string, msg, - "Target returned error in setup_target()"); - TNF_PROBE_0_DEBUG(t1394_setup_isoch_cec_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_FAILURE); } - TNF_PROBE_0_DEBUG(t1394_setup_isoch_cec_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_SUCCESS); } @@ -2698,9 +2291,6 @@ t1394_start_isoch_cec(t1394_handle_t t1394_hdl, boolean_t err; int (*start_callback)(t1394_isoch_cec_handle_t, opaque_t); - TNF_PROBE_0_DEBUG(t1394_start_isoch_cec_enter, - S1394_TNF_SL_ISOCH_STACK, ""); - ASSERT(t1394_hdl != NULL); ASSERT(t1394_isoch_cec_hdl != NULL); @@ -2714,11 +2304,6 @@ t1394_start_isoch_cec(t1394_handle_t t1394_hdl, if (CEC_IN_ANY_CALLBACKS(cec_curr)) { /* Unlock the Isoch CEC member list */ mutex_exit(&cec_curr->isoch_cec_mutex); - TNF_PROBE_1(t1394_start_isoch_cec_error, - S1394_TNF_SL_ISOCH_ERROR, "", tnf_string, msg, - "Not allowed to start Isoch CEC (in callbacks)"); - TNF_PROBE_0_DEBUG(t1394_start_isoch_cec_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_FAILURE); } @@ -2726,11 +2311,6 @@ t1394_start_isoch_cec(t1394_handle_t t1394_hdl, if (CEC_TRANSITION_LEGAL(cec_curr, ISOCH_CEC_START) == 0) { /* Unlock the Isoch CEC member list */ mutex_exit(&cec_curr->isoch_cec_mutex); - TNF_PROBE_1(t1394_start_isoch_cec_error, - S1394_TNF_SL_ISOCH_ERROR, "", tnf_string, msg, - "Not allowed to start Isoch CEC"); - TNF_PROBE_0_DEBUG(t1394_start_isoch_cec_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_FAILURE); } @@ -2781,16 +2361,9 @@ t1394_start_isoch_cec(t1394_handle_t t1394_hdl, /* Return DDI_FAILURE if any targets failed start */ if (err == B_TRUE) { - TNF_PROBE_1(t1394_start_isoch_cec_error, - S1394_TNF_SL_ISOCH_ERROR, "", tnf_string, msg, - "Target returned error in start_target()"); - TNF_PROBE_0_DEBUG(t1394_start_isoch_cec_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_FAILURE); } - TNF_PROBE_0_DEBUG(t1394_start_isoch_cec_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_SUCCESS); } @@ -2822,9 +2395,6 @@ t1394_stop_isoch_cec(t1394_handle_t t1394_hdl, s1394_isoch_cec_member_t *member_curr; void (*stop_callback)(t1394_isoch_cec_handle_t, opaque_t); - TNF_PROBE_0_DEBUG(t1394_stop_isoch_cec_enter, - S1394_TNF_SL_ISOCH_STACK, ""); - ASSERT(t1394_hdl != NULL); ASSERT(t1394_isoch_cec_hdl != NULL); @@ -2838,11 +2408,6 @@ t1394_stop_isoch_cec(t1394_handle_t t1394_hdl, if (CEC_IN_ANY_CALLBACKS(cec_curr)) { /* Unlock the Isoch CEC member list */ mutex_exit(&cec_curr->isoch_cec_mutex); - TNF_PROBE_1(t1394_stop_isoch_cec_error, - S1394_TNF_SL_ISOCH_ERROR, "", tnf_string, msg, - "Not allowed to stop Isoch CEC (in callbacks)"); - TNF_PROBE_0_DEBUG(t1394_stop_isoch_cec_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_FAILURE); } @@ -2850,11 +2415,6 @@ t1394_stop_isoch_cec(t1394_handle_t t1394_hdl, if (CEC_TRANSITION_LEGAL(cec_curr, ISOCH_CEC_STOP) == 0) { /* Unlock the Isoch CEC member list */ mutex_exit(&cec_curr->isoch_cec_mutex); - TNF_PROBE_1(t1394_stop_isoch_cec_error, - S1394_TNF_SL_ISOCH_ERROR, "", tnf_string, msg, - "Not allowed to stop Isoch CEC"); - TNF_PROBE_0_DEBUG(t1394_stop_isoch_cec_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_FAILURE); } @@ -2900,8 +2460,6 @@ t1394_stop_isoch_cec(t1394_handle_t t1394_hdl, /* Unlock the Isoch CEC member list */ mutex_exit(&cec_curr->isoch_cec_mutex); - TNF_PROBE_0_DEBUG(t1394_stop_isoch_cec_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_SUCCESS); } @@ -2941,9 +2499,6 @@ t1394_teardown_isoch_cec(t1394_handle_t t1394_hdl, int err; void (*teardown_callback)(t1394_isoch_cec_handle_t, opaque_t); - TNF_PROBE_0_DEBUG(t1394_teardown_isoch_cec_enter, - S1394_TNF_SL_ISOCH_STACK, ""); - ASSERT(t1394_hdl != NULL); ASSERT(t1394_isoch_cec_hdl != NULL); @@ -2959,11 +2514,6 @@ t1394_teardown_isoch_cec(t1394_handle_t t1394_hdl, if (CEC_IN_ANY_CALLBACKS(cec_curr)) { /* Unlock the Isoch CEC member list */ mutex_exit(&cec_curr->isoch_cec_mutex); - TNF_PROBE_1(t1394_teardown_isoch_cec_error, - S1394_TNF_SL_ISOCH_ERROR, "", tnf_string, msg, - "Not allowed to teardown Isoch CEC (in callbacks)"); - TNF_PROBE_0_DEBUG(t1394_teardown_isoch_cec_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_FAILURE); } @@ -2971,11 +2521,6 @@ t1394_teardown_isoch_cec(t1394_handle_t t1394_hdl, if (CEC_TRANSITION_LEGAL(cec_curr, ISOCH_CEC_TEARDOWN) == 0) { /* Unlock the Isoch CEC member list */ mutex_exit(&cec_curr->isoch_cec_mutex); - TNF_PROBE_1(t1394_teardown_isoch_cec_error, - S1394_TNF_SL_ISOCH_ERROR, "", tnf_string, msg, - "Not allowed to teardown Isoch CEC"); - TNF_PROBE_0_DEBUG(t1394_teardown_isoch_cec_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_FAILURE); } @@ -3019,10 +2564,6 @@ t1394_teardown_isoch_cec(t1394_handle_t t1394_hdl, if (ret == DDI_FAILURE) { if (err == CMD1394_EBUSRESET) { goto teardown_do_callbacks; - } else { - TNF_PROBE_1(t1394_teardown_isoch_cec_error, - S1394_TNF_SL_ISOCH_ERROR, "", tnf_string, msg, - "Unable to free allocated bandwidth"); } } @@ -3041,16 +2582,6 @@ t1394_teardown_isoch_cec(t1394_handle_t t1394_hdl, /* Lock the Isoch CEC member list */ mutex_enter(&cec_curr->isoch_cec_mutex); - if (ret == DDI_FAILURE) { - if (err == CMD1394_EBUSRESET) { - goto teardown_do_callbacks; - } else { - TNF_PROBE_1(t1394_teardown_isoch_cec_error, - S1394_TNF_SL_ISOCH_ERROR, "", tnf_string, msg, - "Unable to free allocated bandwidth"); - } - } - teardown_do_callbacks: /* From here on reallocation is unnecessary */ cec_curr->realloc_valid = B_FALSE; @@ -3100,8 +2631,6 @@ teardown_do_callbacks: /* Unlock the Isoch CEC member list */ mutex_exit(&cec_curr->isoch_cec_mutex); - TNF_PROBE_0_DEBUG(t1394_teardown_isoch_cec_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (DDI_SUCCESS); } @@ -3134,9 +2663,6 @@ t1394_alloc_isoch_dma(t1394_handle_t t1394_hdl, s1394_hal_t *hal; int ret; - TNF_PROBE_0_DEBUG(t1394_alloc_isoch_dma_enter, - S1394_TNF_SL_ISOCH_STACK, ""); - ASSERT(t1394_hdl != NULL); ASSERT(idi != NULL); ASSERT(t1394_idma_hdl != NULL); @@ -3147,12 +2673,6 @@ t1394_alloc_isoch_dma(t1394_handle_t t1394_hdl, /* Sanity check dma options. If talk enabled, listen should be off */ if ((idi->idma_options & ID1394_TALK) && (idi->idma_options != ID1394_TALK)) { - TNF_PROBE_1(t1394_alloc_isoch_dma_talk_conflict_error, - S1394_TNF_SL_ISOCH_ERROR, "", tnf_string, msg, - "conflicting idma options; talker and listener"); - TNF_PROBE_0_DEBUG(t1394_alloc_isoch_dma_exit, - S1394_TNF_SL_ISOCH_STACK, ""); - *result = T1394_EIDMA_CONFLICT; return (DDI_FAILURE); } @@ -3160,12 +2680,6 @@ t1394_alloc_isoch_dma(t1394_handle_t t1394_hdl, /* Only one listen mode allowed */ if ((idi->idma_options & ID1394_LISTEN_PKT_MODE) && (idi->idma_options & ID1394_LISTEN_BUF_MODE)) { - TNF_PROBE_1(t1394_alloc_isoch_dma_listen_conflict_error, - S1394_TNF_SL_ISOCH_ERROR, "", tnf_string, msg, - "conflicting idma options; both listener modes set"); - TNF_PROBE_0_DEBUG(t1394_alloc_isoch_dma_exit, - S1394_TNF_SL_ISOCH_STACK, ""); - *result = T1394_EIDMA_CONFLICT; return (DDI_FAILURE); } @@ -3175,16 +2689,11 @@ t1394_alloc_isoch_dma(t1394_handle_t t1394_hdl, (void **)t1394_idma_hdl, result); if (ret != DDI_SUCCESS) { - TNF_PROBE_1(t1394_alloc_isoch_dma_hal_error, - S1394_TNF_SL_ISOCH_ERROR, "", tnf_string, msg, - "HAL alloc_isoch_dma error, maybe IXL compilation"); if (*result == IXL1394_ENO_DMA_RESRCS) { *result = T1394_EIDMA_NO_RESRCS; } } - TNF_PROBE_0_DEBUG(t1394_alloc_isoch_dma_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (ret); } @@ -3208,9 +2717,6 @@ t1394_free_isoch_dma(t1394_handle_t t1394_hdl, uint_t flags, { s1394_hal_t *hal; - TNF_PROBE_0_DEBUG(t1394_free_isoch_dma_enter, - S1394_TNF_SL_ISOCH_STACK, ""); - ASSERT(t1394_hdl != NULL); ASSERT(*t1394_idma_hdl != NULL); @@ -3222,9 +2728,6 @@ t1394_free_isoch_dma(t1394_handle_t t1394_hdl, uint_t flags, /* Null out isoch handle */ *t1394_idma_hdl = NULL; - - TNF_PROBE_0_DEBUG(t1394_free_isoch_dma_exit, - S1394_TNF_SL_ISOCH_STACK, ""); } /* @@ -3254,9 +2757,6 @@ t1394_start_isoch_dma(t1394_handle_t t1394_hdl, s1394_hal_t *hal; int ret; - TNF_PROBE_0_DEBUG(t1394_start_isoch_dma_enter, - S1394_TNF_SL_ISOCH_STACK, ""); - ASSERT(t1394_hdl != NULL); ASSERT(t1394_idma_hdl != NULL); ASSERT(idma_ctrlinfo != NULL); @@ -3267,8 +2767,6 @@ t1394_start_isoch_dma(t1394_handle_t t1394_hdl, ret = HAL_CALL(hal).start_isoch_dma(hal->halinfo.hal_private, (void *)t1394_idma_hdl, idma_ctrlinfo, flags, result); - TNF_PROBE_0_DEBUG(t1394_start_isoch_dma_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (ret); } @@ -3293,9 +2791,6 @@ t1394_stop_isoch_dma(t1394_handle_t t1394_hdl, s1394_hal_t *hal; int result; - TNF_PROBE_0_DEBUG(t1394_stop_isoch_dma_enter, - S1394_TNF_SL_ISOCH_STACK, ""); - ASSERT(t1394_hdl != NULL); ASSERT(t1394_idma_hdl != NULL); @@ -3304,9 +2799,6 @@ t1394_stop_isoch_dma(t1394_handle_t t1394_hdl, HAL_CALL(hal).stop_isoch_dma(hal->halinfo.hal_private, (void *)t1394_idma_hdl, &result); - - TNF_PROBE_0_DEBUG(t1394_stop_isoch_dma_exit, - S1394_TNF_SL_ISOCH_STACK, ""); } /* @@ -3337,9 +2829,6 @@ t1394_update_isoch_dma(t1394_handle_t t1394_hdl, s1394_hal_t *hal; int ret; - TNF_PROBE_0_DEBUG(t1394_update_isoch_dma_enter, - S1394_TNF_SL_ISOCH_STACK, ""); - ASSERT(t1394_hdl != NULL); ASSERT(t1394_idma_hdl != NULL); ASSERT(idma_updateinfo != NULL); @@ -3350,8 +2839,6 @@ t1394_update_isoch_dma(t1394_handle_t t1394_hdl, ret = HAL_CALL(hal).update_isoch_dma(hal->halinfo.hal_private, (void *)t1394_idma_hdl, idma_updateinfo, flags, result); - TNF_PROBE_0_DEBUG(t1394_update_isoch_dma_exit, - S1394_TNF_SL_ISOCH_STACK, ""); return (ret); } @@ -3372,10 +2859,6 @@ void t1394_initiate_bus_reset(t1394_handle_t t1394_hdl, uint_t flags) { s1394_hal_t *hal; - int ret; - - TNF_PROBE_0_DEBUG(t1394_initiate_bus_reset_enter, - S1394_TNF_SL_BR_STACK, ""); ASSERT(t1394_hdl != NULL); @@ -3384,23 +2867,10 @@ t1394_initiate_bus_reset(t1394_handle_t t1394_hdl, uint_t flags) /* Reset the bus */ if (hal->halinfo.phy == H1394_PHY_1394A) { - ret = HAL_CALL(hal).short_bus_reset(hal->halinfo.hal_private); - if (ret != DDI_SUCCESS) { - TNF_PROBE_1(t1394_initiate_bus_reset_error, - S1394_TNF_SL_ERROR, "", tnf_string, msg, - "Error initiating short bus reset"); - } + (void) HAL_CALL(hal).short_bus_reset(hal->halinfo.hal_private); } else { - ret = HAL_CALL(hal).bus_reset(hal->halinfo.hal_private); - if (ret != DDI_SUCCESS) { - TNF_PROBE_1(t1394_initiate_bus_reset_error, - S1394_TNF_SL_ERROR, "", tnf_string, msg, - "Error initiating bus reset"); - } + (void) HAL_CALL(hal).bus_reset(hal->halinfo.hal_private); } - - TNF_PROBE_0_DEBUG(t1394_initiate_bus_reset_exit, - S1394_TNF_SL_BR_STACK, ""); } /* @@ -3429,9 +2899,6 @@ t1394_get_topology_map(t1394_handle_t t1394_hdl, uint_t bus_generation, uint32_t *tm_ptr; uint_t length; - TNF_PROBE_0_DEBUG(t1394_get_topology_map_enter, S1394_TNF_SL_CSR_STACK, - ""); - ASSERT(t1394_hdl != NULL); /* Find the HAL this target resides on */ @@ -3444,11 +2911,6 @@ t1394_get_topology_map(t1394_handle_t t1394_hdl, uint_t bus_generation, if (bus_generation != hal->generation_count) { /* Unlock the topology tree */ mutex_exit(&hal->topology_tree_mutex); - TNF_PROBE_1(t1394_get_topology_map_error, - S1394_TNF_SL_CSR_ERROR, "", tnf_string, msg, - "Generation mismatch"); - TNF_PROBE_0_DEBUG(t1394_get_topology_map_exit, - S1394_TNF_SL_CSR_STACK, ""); return (DDI_FAILURE); } @@ -3461,11 +2923,6 @@ t1394_get_topology_map(t1394_handle_t t1394_hdl, uint_t bus_generation, if (length > (uint_t)tm_length) { /* Unlock the topology tree */ mutex_exit(&hal->topology_tree_mutex); - TNF_PROBE_1(t1394_get_topology_map_error, - S1394_TNF_SL_CSR_ERROR, "", tnf_string, msg, - "Buffer size too small"); - TNF_PROBE_0_DEBUG(t1394_get_topology_map_exit, - S1394_TNF_SL_CSR_STACK, ""); return (DDI_FAILURE); } @@ -3474,8 +2931,6 @@ t1394_get_topology_map(t1394_handle_t t1394_hdl, uint_t bus_generation, /* Unlock the topology tree */ mutex_exit(&hal->topology_tree_mutex); - TNF_PROBE_0_DEBUG(t1394_get_topology_map_exit, S1394_TNF_SL_CSR_STACK, - ""); return (DDI_SUCCESS); } @@ -3499,11 +2954,8 @@ t1394_CRC16(uint32_t *d, size_t crc_length, uint_t flags) /* ANSI/IEEE Std 1212, 1994 - 8.1.5 */ uint_t ret; - TNF_PROBE_0_DEBUG(t1394_CRC16_enter, S1394_TNF_SL_STACK, ""); - ret = s1394_CRC16((uint_t *)d, (uint_t)crc_length); - TNF_PROBE_0_DEBUG(t1394_CRC16_exit, S1394_TNF_SL_STACK, ""); return (ret); } @@ -3539,9 +2991,6 @@ t1394_add_cfgrom_entry(t1394_handle_t t1394_hdl, uint_t size; uint32_t *buffer; - TNF_PROBE_0_DEBUG(t1394_add_cfgrom_entry_enter, - S1394_TNF_SL_CFGROM_STACK, ""); - ASSERT(t1394_hdl != NULL); target = (s1394_target_t *)t1394_hdl; @@ -3553,22 +3002,12 @@ t1394_add_cfgrom_entry(t1394_handle_t t1394_hdl, /* Check for a valid size */ if (size == 0) { *result = T1394_EINVALID_PARAM; - TNF_PROBE_1_DEBUG(t1394_add_cfgrom_entry_error, - S1394_TNF_SL_CFGROM_ERROR, "", tnf_string, msg, - "Invalid size of Config ROM buffer (== 0)"); - TNF_PROBE_0_DEBUG(t1394_add_cfgrom_entry_exit, - S1394_TNF_SL_CFGROM_STACK, ""); return (DDI_FAILURE); } /* Check for a valid key type */ if (((key << IEEE1212_KEY_VALUE_SHIFT) & IEEE1212_KEY_TYPE_MASK) == 0) { *result = T1394_EINVALID_PARAM; - TNF_PROBE_1_DEBUG(t1394_add_cfgrom_entry_error, - S1394_TNF_SL_CFGROM_ERROR, "", tnf_string, msg, - "Invalid key_type in Config ROM key"); - TNF_PROBE_0_DEBUG(t1394_add_cfgrom_entry_exit, - S1394_TNF_SL_CFGROM_STACK, ""); return (DDI_FAILURE); } @@ -3578,8 +3017,6 @@ t1394_add_cfgrom_entry(t1394_handle_t t1394_hdl, /* Is this on the interrupt stack? */ if (servicing_interrupt()) { *result = T1394_EINVALID_CONTEXT; - TNF_PROBE_0_DEBUG(t1394_add_cfgrom_entry_exit, - S1394_TNF_SL_CFGROM_STACK, ""); return (DDI_FAILURE); } @@ -3593,11 +3030,6 @@ t1394_add_cfgrom_entry(t1394_handle_t t1394_hdl, *result = T1394_ECFGROM_FULL; mutex_exit(&hal->local_config_rom_mutex); - TNF_PROBE_1(t1394_add_cfgrom_entry_error, - S1394_TNF_SL_CFGROM_ERROR, "", tnf_string, msg, - "Failed in s1394_add_cfgrom_entry()"); - TNF_PROBE_0_DEBUG(t1394_add_cfgrom_entry_exit, - "stacktrace 1394 s1394", ""); return (ret); } @@ -3612,8 +3044,6 @@ t1394_add_cfgrom_entry(t1394_handle_t t1394_hdl, mutex_exit(&hal->local_config_rom_mutex); } - TNF_PROBE_0_DEBUG(t1394_add_cfgrom_entry_exit, - S1394_TNF_SL_CFGROM_STACK, ""); return (ret); } @@ -3640,9 +3070,6 @@ t1394_rem_cfgrom_entry(t1394_handle_t t1394_hdl, uint_t flags, s1394_target_t *target; int ret; - TNF_PROBE_0_DEBUG(t1394_rem_cfgrom_entry_enter, - S1394_TNF_SL_CFGROM_STACK, ""); - ASSERT(t1394_hdl != NULL); target = (s1394_target_t *)t1394_hdl; @@ -3653,8 +3080,6 @@ t1394_rem_cfgrom_entry(t1394_handle_t t1394_hdl, uint_t flags, /* Is this on the interrupt stack? */ if (servicing_interrupt()) { *result = T1394_EINVALID_CONTEXT; - TNF_PROBE_0_DEBUG(t1394_rem_cfgrom_entry_exit, - S1394_TNF_SL_CFGROM_STACK, ""); return (DDI_FAILURE); } @@ -3665,11 +3090,6 @@ t1394_rem_cfgrom_entry(t1394_handle_t t1394_hdl, uint_t flags, result); if (ret != DDI_SUCCESS) { mutex_exit(&hal->local_config_rom_mutex); - TNF_PROBE_1(t1394_rem_cfgrom_entry_error, - S1394_TNF_SL_CFGROM_ERROR, "", tnf_string, msg, - "Failed in s1394_remove_cfgrom_entry()"); - TNF_PROBE_0_DEBUG(t1394_rem_cfgrom_entry_exit, - "stacktrace 1394 s1394", ""); return (ret); } @@ -3684,8 +3104,6 @@ t1394_rem_cfgrom_entry(t1394_handle_t t1394_hdl, uint_t flags, mutex_exit(&hal->local_config_rom_mutex); } - TNF_PROBE_0_DEBUG(t1394_rem_cfgrom_entry_exit, - S1394_TNF_SL_CFGROM_STACK, ""); return (ret); } @@ -3715,8 +3133,6 @@ t1394_get_targetinfo(t1394_handle_t t1394_hdl, uint_t bus_generation, uint_t from_node; uint_t to_node; - TNF_PROBE_0_DEBUG(t1394_get_targetinfo_enter, S1394_TNF_SL_STACK, ""); - ASSERT(t1394_hdl != NULL); /* Find the HAL this target resides on */ @@ -3731,10 +3147,6 @@ t1394_get_targetinfo(t1394_handle_t t1394_hdl, uint_t bus_generation, if (bus_generation != hal->generation_count) { /* Unlock the topology tree */ mutex_exit(&hal->topology_tree_mutex); - TNF_PROBE_3(t1394_get_targetinfo_error, S1394_TNF_SL_STACK, "", - tnf_string, msg, "Generation mismatch", - tnf_uint, gen, bus_generation, - tnf_uint, current_gen, hal->generation_count); return (DDI_FAILURE); } @@ -3747,8 +3159,6 @@ t1394_get_targetinfo(t1394_handle_t t1394_hdl, uint_t bus_generation, if (((target->target_state & S1394_TARG_GONE) != 0) || (target->on_node == NULL)) { targetinfo->target_nodeID = T1394_INVALID_NODEID; - TNF_PROBE_1_DEBUG(t1394_get_targetinfo_exit, - S1394_TNF_SL_STACK, "", tnf_string, msg, "No device"); } else { targetinfo->target_nodeID = (target->on_hal->node_id & IEEE1394_BUS_NUM_MASK) | @@ -3763,12 +3173,6 @@ t1394_get_targetinfo(t1394_handle_t t1394_hdl, uint_t bus_generation, /* Get current_max_payload */ s1394_get_maxpayload(target, &dev, &curr); targetinfo->current_max_payload = curr; - - TNF_PROBE_3_DEBUG(t1394_get_targetinfo_exit, - S1394_TNF_SL_STACK, "", - tnf_uint, payload, targetinfo->current_max_payload, - tnf_uint, speed, targetinfo->current_max_speed, - tnf_uint, nodeid, targetinfo->target_nodeID); } rw_exit(&hal->target_list_rwlock); diff --git a/usr/src/uts/common/io/1394/t1394_errmsg.c b/usr/src/uts/common/io/1394/t1394_errmsg.c index 1dc85807d8..4c9632bc05 100644 --- a/usr/src/uts/common/io/1394/t1394_errmsg.c +++ b/usr/src/uts/common/io/1394/t1394_errmsg.c @@ -24,16 +24,12 @@ * All rights reserved. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * t1394_errmsg.c * Utility function that targets can use to convert an error code into a * printable string. */ -#include <sys/tnf_probe.h> - #include <sys/1394/t1394.h> #include <sys/1394/s1394.h> #include <sys/1394/cmd1394.h> @@ -151,14 +147,7 @@ t1394_errmsg(int result, uint_t flags) int err; const char *msg = T1394_ERRMSG_EMPTY_STRING; - TNF_PROBE_1_DEBUG(t1394_errmsg_enter, S1394_TNF_SL_STACK, "", - tnf_int, argument, result); - if (result > 0) { - TNF_PROBE_2(t1394_errmsg, S1394_TNF_SL_ERROR, "", - tnf_string, msg, "invalid result argument", - tnf_int, result, result); - TNF_PROBE_0_DEBUG(t1394_errmsg_exit, S1394_TNF_SL_STACK, ""); return (T1394_ERRMSG_EMPTY_STRING); } @@ -187,13 +176,7 @@ t1394_errmsg(int result, uint_t flags) (result <= -T1394_ECFG_LAST)) { err = result - (-T1394_ECFG_FIRST); msg = cfgrom_error_string[err]; - } else { - TNF_PROBE_2(t1394_errmsg, S1394_TNF_SL_ERROR, "", - tnf_string, msg, "invalid result argument", - tnf_int, result, result); } - TNF_PROBE_0_DEBUG(t1394_errmsg_exit, S1394_TNF_SL_STACK, ""); - return (msg); } diff --git a/usr/src/uts/common/io/1394/targets/av1394/av1394.c b/usr/src/uts/common/io/1394/targets/av1394/av1394.c index 9fd4c9896e..833b190f5f 100644 --- a/usr/src/uts/common/io/1394/targets/av1394/av1394.c +++ b/usr/src/uts/common/io/1394/targets/av1394/av1394.c @@ -120,21 +120,10 @@ static struct modlinkage av1394_modlinkage = { static void *av1394_statep; -#ifndef NPROBE -extern int tnf_mod_load(void); -extern int tnf_mod_unload(struct modlinkage *mlp); -#endif - #define AV1394_INST2STATE(inst) (ddi_get_soft_state(av1394_statep, inst)) #define AV1394_DEV2STATE(dev) \ (ddi_get_soft_state(av1394_statep, AV1394_DEV2INST(dev))) -#define AV1394_TNF_ENTER(func) \ - TNF_PROBE_0_DEBUG(func##_enter, AV1394_TNF_INST_STACK, ""); - -#define AV1394_TNF_EXIT(func) \ - TNF_PROBE_0_DEBUG(func##_exit, AV1394_TNF_INST_STACK, ""); - /* * * --- DDI/DKI entry points @@ -145,22 +134,13 @@ _init(void) { int error; -#ifndef NPROBE - (void) tnf_mod_load(); -#endif error = ddi_soft_state_init(&av1394_statep, sizeof (av1394_inst_t), 1); if (error != 0) { -#ifndef NPROBE - (void) tnf_mod_unload(&av1394_modlinkage); -#endif return (error); } if ((error = mod_install(&av1394_modlinkage)) != 0) { ddi_soft_state_fini(&av1394_statep); -#ifndef NPROBE - (void) tnf_mod_unload(&av1394_modlinkage); -#endif } return (error); @@ -173,9 +153,6 @@ _fini(void) if ((error = mod_remove(&av1394_modlinkage)) == 0) { ddi_soft_state_fini(&av1394_statep); -#ifndef NPROBE - (void) tnf_mod_unload(&av1394_modlinkage); -#endif } return (error); @@ -196,8 +173,6 @@ av1394_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) int instance = ddi_get_instance(dip); av1394_inst_t *avp; - AV1394_TNF_ENTER(av1394_attach); - switch (cmd) { case DDI_ATTACH: break; @@ -207,21 +182,16 @@ av1394_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) } return (av1394_cpr_resume(avp)); default: - AV1394_TNF_EXIT(av1394_attach); return (DDI_FAILURE); } if (ddi_soft_state_zalloc(av1394_statep, instance) != 0) { - TNF_PROBE_0(av1394_attach_error_soft_state_zalloc, - AV1394_TNF_INST_ERROR, ""); - AV1394_TNF_EXIT(av1394_attach); return (DDI_FAILURE); } avp = AV1394_INST2STATE(instance); if (av1394_t1394_attach(avp, dip) != DDI_SUCCESS) { av1394_cleanup(avp, 1); - AV1394_TNF_EXIT(av1394_attach); return (DDI_FAILURE); } @@ -235,19 +205,16 @@ av1394_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) if (av1394_add_events(avp) != DDI_SUCCESS) { av1394_cleanup(avp, 2); - AV1394_TNF_EXIT(av1394_attach); return (DDI_FAILURE); } if (av1394_isoch_attach(avp) != DDI_SUCCESS) { av1394_cleanup(avp, 3); - AV1394_TNF_EXIT(av1394_attach); return (DDI_FAILURE); } if (av1394_async_attach(avp) != DDI_SUCCESS) { av1394_cleanup(avp, 4); - AV1394_TNF_EXIT(av1394_attach); return (DDI_FAILURE); } @@ -257,7 +224,6 @@ av1394_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) ddi_report_dev(dip); - AV1394_TNF_EXIT(av1394_attach); return (DDI_SUCCESS); } @@ -267,24 +233,17 @@ av1394_detach(dev_info_t *dip, ddi_detach_cmd_t cmd) int instance = ddi_get_instance(dip); av1394_inst_t *avp; - AV1394_TNF_ENTER(av1394_detach); - if ((avp = AV1394_INST2STATE(instance)) == NULL) { - TNF_PROBE_0(av1394_detach_error_instance, - AV1394_TNF_INST_ERROR, ""); - AV1394_TNF_EXIT(av1394_detach); return (DDI_FAILURE); } switch (cmd) { case DDI_DETACH: av1394_cleanup(avp, AV1394_CLEANUP_LEVEL_MAX); - AV1394_TNF_EXIT(av1394_detach); return (DDI_SUCCESS); case DDI_SUSPEND: return (av1394_cpr_suspend(avp)); default: - AV1394_TNF_EXIT(av1394_detach); return (DDI_FAILURE); } } @@ -323,7 +282,6 @@ av1394_open(dev_t *dev, int flag, int otyp, cred_t *cr) av1394_inst_t *avp = AV1394_DEV2STATE(*dev); int ret = ENXIO; - AV1394_TNF_ENTER(av1394_open); if (avp != NULL) { if (AV1394_DEV_IS_ISOCH(*dev)) { ret = 0; @@ -331,7 +289,6 @@ av1394_open(dev_t *dev, int flag, int otyp, cred_t *cr) ret = av1394_async_open(avp, flag); } } - AV1394_TNF_EXIT(av1394_open); return (ret); } @@ -342,7 +299,6 @@ av1394_close(dev_t dev, int flag, int otyp, cred_t *cr) av1394_inst_t *avp = AV1394_DEV2STATE(dev); int ret = ENXIO; - AV1394_TNF_ENTER(av1394_close); if (avp != NULL) { if (AV1394_DEV_IS_ISOCH(dev)) { ret = av1394_isoch_close(avp, flag); @@ -350,7 +306,6 @@ av1394_close(dev_t dev, int flag, int otyp, cred_t *cr) ret = av1394_async_close(avp, flag); } } - AV1394_TNF_EXIT(av1394_close); return (ret); } @@ -361,7 +316,6 @@ av1394_read(dev_t dev, struct uio *uiop, cred_t *cr) av1394_inst_t *avp = AV1394_DEV2STATE(dev); int ret = ENXIO; - AV1394_TNF_ENTER(av1394_read); if (avp != NULL) { if (AV1394_DEV_IS_ISOCH(dev)) { ret = av1394_isoch_read(avp, uiop); @@ -369,7 +323,6 @@ av1394_read(dev_t dev, struct uio *uiop, cred_t *cr) ret = av1394_async_read(avp, uiop); } } - AV1394_TNF_EXIT(av1394_read); return (ret); } @@ -380,7 +333,6 @@ av1394_write(dev_t dev, struct uio *uiop, cred_t *cr) av1394_inst_t *avp = AV1394_DEV2STATE(dev); int ret = ENXIO; - AV1394_TNF_ENTER(av1394_write); if (avp != NULL) { if (AV1394_DEV_IS_ISOCH(dev)) { ret = av1394_isoch_write(avp, uiop); @@ -388,7 +340,6 @@ av1394_write(dev_t dev, struct uio *uiop, cred_t *cr) ret = av1394_async_write(avp, uiop); } } - AV1394_TNF_EXIT(av1394_write); return (ret); } @@ -399,7 +350,6 @@ av1394_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *cr, int *rvalp) av1394_inst_t *avp = AV1394_DEV2STATE(dev); int ret = ENXIO; - AV1394_TNF_ENTER(av1394_ioctl); if (avp != NULL) { if (AV1394_DEV_IS_ISOCH(dev)) { ret = av1394_isoch_ioctl(avp, cmd, arg, mode, rvalp); @@ -407,7 +357,6 @@ av1394_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *cr, int *rvalp) ret = av1394_async_ioctl(avp, cmd, arg, mode, rvalp); } } - AV1394_TNF_EXIT(av1394_ioctl); return (ret); } @@ -419,11 +368,9 @@ av1394_devmap(dev_t dev, devmap_cookie_t dhp, offset_t off, size_t len, av1394_inst_t *avp = AV1394_DEV2STATE(dev); int ret = ENXIO; - AV1394_TNF_ENTER(av1394_devmap); if ((avp != NULL) && (AV1394_DEV_IS_ISOCH(dev))) { ret = av1394_isoch_devmap(avp, dhp, off, len, maplen, model); } - AV1394_TNF_EXIT(av1394_devmap); return (ret); } @@ -434,11 +381,9 @@ av1394_poll(dev_t dev, short events, int anyyet, short *reventsp, av1394_inst_t *avp = AV1394_DEV2STATE(dev); int ret = ENXIO; - AV1394_TNF_ENTER(av1394_poll); if ((avp != NULL) && AV1394_DEV_IS_ASYNC(dev)) { ret = av1394_async_poll(avp, events, anyyet, reventsp, phpp); } - AV1394_TNF_EXIT(av1394_poll); return (ret); } @@ -455,7 +400,6 @@ av1394_cleanup(av1394_inst_t *avp, int level) { ASSERT((level > 0) && (level <= AV1394_CLEANUP_LEVEL_MAX)); - AV1394_TNF_ENTER(av1394_cleanup); switch (level) { default: av1394_async_detach(avp); @@ -473,7 +417,6 @@ av1394_cleanup(av1394_inst_t *avp, int level) case 1: ddi_soft_state_free(av1394_statep, avp->av_instance); } - AV1394_TNF_EXIT(av1394_cleanup); } static int @@ -481,28 +424,16 @@ av1394_t1394_attach(av1394_inst_t *avp, dev_info_t *dip) { int ret; - AV1394_TNF_ENTER(av1394_t1394_attach); - ret = t1394_attach(dip, T1394_VERSION_V1, 0, &avp->av_attachinfo, &avp->av_t1394_hdl); - if (ret != DDI_SUCCESS) { - TNF_PROBE_1(av1394_t1394_attach_error, AV1394_TNF_INST_ERROR, - "", tnf_int, ret, ret); - } - - AV1394_TNF_EXIT(av1394_t1394_attach); return (ret); } static void av1394_t1394_detach(av1394_inst_t *avp) { - AV1394_TNF_ENTER(av1394_t1394_detach); - (void) t1394_detach(&avp->av_t1394_hdl, 0); - - AV1394_TNF_EXIT(av1394_t1394_detach); } static int @@ -512,29 +443,21 @@ av1394_add_events(av1394_inst_t *avp) if (ddi_get_eventcookie(avp->av_dip, DDI_DEVI_BUS_RESET_EVENT, &br_evc) != DDI_SUCCESS) { - TNF_PROBE_0(av1394_add_events_error_bus_reset_cookie, - AV1394_TNF_INST_ERROR, ""); return (DDI_FAILURE); } if (ddi_add_event_handler(avp->av_dip, br_evc, av1394_bus_reset, avp, &avp->av_reset_cb) != DDI_SUCCESS) { - TNF_PROBE_0(av1394_add_events_error_bus_reset_event, - AV1394_TNF_INST_ERROR, ""); return (DDI_FAILURE); } if (ddi_get_eventcookie(avp->av_dip, DDI_DEVI_REMOVE_EVENT, &rem_evc) != DDI_SUCCESS) { (void) ddi_remove_event_handler(avp->av_reset_cb); - TNF_PROBE_0(av1394_add_events_error_remove_cookie, - AV1394_TNF_INST_ERROR, ""); return (DDI_FAILURE); } if (ddi_add_event_handler(avp->av_dip, rem_evc, av1394_disconnect, avp, &avp->av_remove_cb) != DDI_SUCCESS) { (void) ddi_remove_event_handler(avp->av_reset_cb); - TNF_PROBE_0(av1394_add_events_error_remove_event, - AV1394_TNF_INST_ERROR, ""); return (DDI_FAILURE); } @@ -542,16 +465,12 @@ av1394_add_events(av1394_inst_t *avp) &ins_evc) != DDI_SUCCESS) { (void) ddi_remove_event_handler(avp->av_remove_cb); (void) ddi_remove_event_handler(avp->av_reset_cb); - TNF_PROBE_0(av1394_add_events_error_insert_cookie, - AV1394_TNF_INST_ERROR, ""); return (DDI_FAILURE); } if (ddi_add_event_handler(avp->av_dip, ins_evc, av1394_reconnect, avp, &avp->av_insert_cb) != DDI_SUCCESS) { (void) ddi_remove_event_handler(avp->av_remove_cb); (void) ddi_remove_event_handler(avp->av_reset_cb); - TNF_PROBE_0(av1394_add_events_error_insert_event, - AV1394_TNF_INST_ERROR, ""); return (DDI_FAILURE); } @@ -589,8 +508,6 @@ av1394_cpr_suspend(av1394_inst_t *avp) { int ret; - AV1394_TNF_ENTER(av1394_cpr_suspend); - ret = av1394_isoch_cpr_suspend(avp); if (ret == DDI_SUCCESS) { @@ -600,7 +517,6 @@ av1394_cpr_suspend(av1394_inst_t *avp) mutex_exit(&avp->av_mutex); } - AV1394_TNF_EXIT(av1394_cpr_suspend); return (ret); } @@ -610,15 +526,12 @@ av1394_cpr_suspend(av1394_inst_t *avp) static int av1394_cpr_resume(av1394_inst_t *avp) { - AV1394_TNF_ENTER(av1394_cpr_resume); - mutex_enter(&avp->av_mutex); avp->av_dev_state = avp->av_prev_dev_state; mutex_exit(&avp->av_mutex); (void) av1394_async_cpr_resume(avp); - AV1394_TNF_EXIT(av1394_cpr_resume); return (DDI_SUCCESS); } @@ -633,10 +546,7 @@ av1394_bus_reset(dev_info_t *dip, ddi_eventcookie_t evc, void *arg, void *data) { av1394_inst_t *avp = arg; - AV1394_TNF_ENTER(av1394_bus_reset); - if (avp == NULL) { - AV1394_TNF_EXIT(av1394_bus_reset); return; } @@ -646,8 +556,6 @@ av1394_bus_reset(dev_info_t *dip, ddi_eventcookie_t evc, void *arg, void *data) av1394_async_bus_reset(avp); av1394_cmp_bus_reset(avp); - - AV1394_TNF_EXIT(av1394_bus_reset); } /*ARGSUSED*/ @@ -656,18 +564,13 @@ av1394_disconnect(dev_info_t *dip, ddi_eventcookie_t evc, void *arg, void *data) { av1394_inst_t *avp = arg; - AV1394_TNF_ENTER(av1394_disconnect); - if (avp == NULL) { - AV1394_TNF_EXIT(av1394_disconnect); return; } mutex_enter(&avp->av_mutex); avp->av_dev_state = AV1394_DEV_DISCONNECTED; mutex_exit(&avp->av_mutex); - - AV1394_TNF_EXIT(av1394_disconnect); } /*ARGSUSED*/ @@ -676,10 +579,7 @@ av1394_reconnect(dev_info_t *dip, ddi_eventcookie_t evc, void *arg, void *data) { av1394_inst_t *avp = arg; - AV1394_TNF_ENTER(av1394_disconnect); - if (avp == NULL) { - AV1394_TNF_EXIT(av1394_disconnect); return; } @@ -689,6 +589,4 @@ av1394_reconnect(dev_info_t *dip, ddi_eventcookie_t evc, void *arg, void *data) mutex_exit(&avp->av_mutex); av1394_async_reconnect(avp); - - AV1394_TNF_EXIT(av1394_disconnect); } diff --git a/usr/src/uts/common/io/1394/targets/av1394/av1394_async.c b/usr/src/uts/common/io/1394/targets/av1394/av1394_async.c index 31b6e33344..86a0f553f0 100644 --- a/usr/src/uts/common/io/1394/targets/av1394/av1394_async.c +++ b/usr/src/uts/common/io/1394/targets/av1394/av1394_async.c @@ -48,12 +48,6 @@ static void av1394_async_putbq(av1394_queue_t *, mblk_t *); static int av1394_ioctl_arq_get_ibuf_size(av1394_inst_t *, void *, int); static int av1394_ioctl_arq_set_ibuf_size(av1394_inst_t *, void *, int); -#define AV1394_TNF_ENTER(func) \ - TNF_PROBE_0_DEBUG(func##_enter, AV1394_TNF_ASYNC_STACK, ""); - -#define AV1394_TNF_EXIT(func) \ - TNF_PROBE_0_DEBUG(func##_exit, AV1394_TNF_ASYNC_STACK, ""); - /* tunables */ int av1394_ibuf_size_default = 64 * 1024; /* default ibuf size */ int av1394_ibuf_size_max = 1024 * 1024; /* max ibuf size */ @@ -69,47 +63,36 @@ av1394_async_attach(av1394_inst_t *avp) av1394_async_t *ap = &avp->av_a; ddi_iblock_cookie_t ibc = avp->av_attachinfo.iblock_cookie; - AV1394_TNF_ENTER(av1394_async_attach); - mutex_init(&ap->a_mutex, NULL, MUTEX_DRIVER, ibc); av1394_initq(&ap->a_rq, ibc, av1394_ibuf_size_default); if (av1394_fcp_attach(avp) != DDI_SUCCESS) { av1394_async_cleanup(avp, 1); - AV1394_TNF_EXIT(av1394_async_attach); return (DDI_FAILURE); } if (av1394_cfgrom_init(avp) != DDI_SUCCESS) { av1394_async_cleanup(avp, 2); - AV1394_TNF_EXIT(av1394_async_attach); return (DDI_FAILURE); } if (av1394_async_create_minor_node(avp) != DDI_SUCCESS) { av1394_async_cleanup(avp, 3); - AV1394_TNF_EXIT(av1394_async_attach); return (DDI_FAILURE); } if (av1394_async_update_targetinfo(avp) != DDI_SUCCESS) { av1394_async_cleanup(avp, 4); - AV1394_TNF_EXIT(av1394_async_attach); return (DDI_FAILURE); } - AV1394_TNF_EXIT(av1394_async_attach); return (DDI_SUCCESS); } void av1394_async_detach(av1394_inst_t *avp) { - AV1394_TNF_ENTER(av1394_async_detach); - av1394_async_cleanup(avp, AV1394_CLEANUP_LEVEL_MAX); - - AV1394_TNF_EXIT(av1394_async_detach); } void @@ -118,8 +101,6 @@ av1394_async_bus_reset(av1394_inst_t *avp) av1394_async_t *ap = &avp->av_a; mblk_t *bp; - AV1394_TNF_ENTER(av1394_async_bus_reset); - (void) av1394_async_update_targetinfo(avp); mutex_enter(&ap->a_mutex); @@ -130,15 +111,10 @@ av1394_async_bus_reset(av1394_inst_t *avp) mutex_exit(&ap->a_mutex); /* queue up a bus reset message */ - if ((bp = allocb(1, BPRI_HI)) == NULL) { - TNF_PROBE_0(av1394_async_bus_reset_error_allocb, - AV1394_TNF_ASYNC_ERROR, ""); - } else { + if ((bp = allocb(1, BPRI_HI)) != NULL) { DB_TYPE(bp) = AV1394_M_BUS_RESET; av1394_async_putq_rq(avp, bp); } - - AV1394_TNF_EXIT(av1394_async_bus_reset); } int @@ -146,22 +122,15 @@ av1394_async_cpr_resume(av1394_inst_t *avp) { int ret; - AV1394_TNF_ENTER(av1394_async_cpr_resume); - ret = av1394_async_update_targetinfo(avp); - AV1394_TNF_EXIT(av1394_async_cpr_resume); return (ret); } void av1394_async_reconnect(av1394_inst_t *avp) { - AV1394_TNF_ENTER(av1394_async_reconnect); - (void) av1394_async_update_targetinfo(avp); - - AV1394_TNF_EXIT(av1394_async_reconnect); } int @@ -169,8 +138,6 @@ av1394_async_open(av1394_inst_t *avp, int flag) { av1394_async_t *ap = &avp->av_a; - AV1394_TNF_ENTER(av1394_async_open); - mutex_enter(&ap->a_mutex); if (ap->a_nopen == 0) { ap->a_pollevents = 0; @@ -179,7 +146,6 @@ av1394_async_open(av1394_inst_t *avp, int flag) ap->a_oflag = flag; mutex_exit(&ap->a_mutex); - AV1394_TNF_EXIT(av1394_async_open); return (0); } @@ -189,8 +155,6 @@ av1394_async_close(av1394_inst_t *avp, int flag) { av1394_async_t *ap = &avp->av_a; - AV1394_TNF_ENTER(av1394_async_close); - av1394_cfgrom_close(avp); av1394_flushq(&ap->a_rq); @@ -200,7 +164,6 @@ av1394_async_close(av1394_inst_t *avp, int flag) ap->a_pollevents = 0; mutex_exit(&ap->a_mutex); - AV1394_TNF_EXIT(av1394_async_close); return (0); } @@ -215,8 +178,6 @@ av1394_async_read(av1394_inst_t *avp, struct uio *uiop) int dbtype; int len; - AV1394_TNF_ENTER(av1394_async_read); - /* copyout as much as we can */ while ((uiop->uio_resid > 0) && (ret == 0)) { /* @@ -225,7 +186,6 @@ av1394_async_read(av1394_inst_t *avp, struct uio *uiop) */ if ((mp = av1394_getq(q)) == NULL) { if (ap->a_oflag & FNDELAY) { - AV1394_TNF_EXIT(av1394_async_read); return (EAGAIN); } if (av1394_qwait_sig(q) <= 0) { @@ -285,7 +245,6 @@ av1394_async_read(av1394_inst_t *avp, struct uio *uiop) } } - AV1394_TNF_EXIT(av1394_async_read); return (0); } @@ -295,8 +254,6 @@ av1394_async_write(av1394_inst_t *avp, struct uio *uiop) iec61883_arq_t arq; int ret; - AV1394_TNF_ENTER(av1394_async_write); - /* all data should arrive in ARQ format */ while (uiop->uio_resid >= sizeof (arq)) { if ((ret = uiomove(&arq, sizeof (arq), UIO_WRITE, uiop)) != 0) { @@ -316,7 +273,6 @@ av1394_async_write(av1394_inst_t *avp, struct uio *uiop) } } - AV1394_TNF_EXIT(av1394_async_write); return (ret); } @@ -327,8 +283,6 @@ av1394_async_ioctl(av1394_inst_t *avp, int cmd, intptr_t arg, int mode, { int ret = EINVAL; - AV1394_TNF_ENTER(av1394_async_ioctl); - switch (cmd) { case IEC61883_ARQ_GET_IBUF_SIZE: ret = av1394_ioctl_arq_get_ibuf_size(avp, (void *)arg, mode); @@ -346,7 +300,6 @@ av1394_async_ioctl(av1394_inst_t *avp, int cmd, intptr_t arg, int mode, ret = av1394_ioctl_node_get_text_leaf(avp, (void *)arg, mode); } - AV1394_TNF_EXIT(av1394_async_ioctl); return (ret); } @@ -357,8 +310,6 @@ av1394_async_poll(av1394_inst_t *avp, short events, int anyyet, short *reventsp, av1394_async_t *ap = &avp->av_a; av1394_queue_t *rq = &ap->a_rq; - AV1394_TNF_ENTER(av1394_async_poll); - if (events & (POLLIN | POLLET)) { if ((events & POLLIN) && av1394_peekq(rq)) { *reventsp |= POLLIN; @@ -374,7 +325,6 @@ av1394_async_poll(av1394_inst_t *avp, short events, int anyyet, short *reventsp, } } - AV1394_TNF_EXIT(av1394_async_poll); return (0); } @@ -389,8 +339,6 @@ av1394_async_putq_rq(av1394_inst_t *avp, mblk_t *mp) if (!av1394_putq(&ap->a_rq, mp)) { freemsg(mp); - TNF_PROBE_0(av1394_async_putq_rq_error_putq, - AV1394_TNF_ASYNC_ERROR, ""); } else { mutex_enter(&ap->a_mutex); if (ap->a_pollevents & POLLIN) { @@ -445,10 +393,6 @@ av1394_async_create_minor_node(av1394_inst_t *avp) ret = ddi_create_minor_node(avp->av_dip, "async", S_IFCHR, AV1394_ASYNC_INST2MINOR(avp->av_instance), DDI_NT_AV_ASYNC, 0); - if (ret != DDI_SUCCESS) { - TNF_PROBE_0(av1394_async_create_minor_node_error, - AV1394_TNF_ASYNC_ERROR, ""); - } return (ret); } @@ -511,8 +455,6 @@ av1394_async_putbq(av1394_queue_t *q, mblk_t *mp) { if (!av1394_putbq(q, mp)) { freemsg(mp); - TNF_PROBE_0(av1394_async_putbq_error, - AV1394_TNF_ASYNC_ERROR, ""); } } @@ -524,15 +466,12 @@ av1394_ioctl_arq_get_ibuf_size(av1394_inst_t *avp, void *arg, int mode) int sz; int ret = 0; - AV1394_TNF_ENTER(av1394_ioctl_arq_get_ibuf_size); - sz = av1394_getmaxq(&ap->a_rq); if (ddi_copyout(&sz, arg, sizeof (sz), mode) != 0) { ret = EFAULT; } - AV1394_TNF_EXIT(av1394_ioctl_arq_get_ibuf_size); return (ret); } @@ -544,8 +483,6 @@ av1394_ioctl_arq_set_ibuf_size(av1394_inst_t *avp, void *arg, int mode) int sz; int ret = 0; - AV1394_TNF_ENTER(av1394_ioctl_arq_set_ibuf_size); - sz = (int)(intptr_t)arg; if ((sz < 0) || (sz > av1394_ibuf_size_max)) { @@ -554,6 +491,5 @@ av1394_ioctl_arq_set_ibuf_size(av1394_inst_t *avp, void *arg, int mode) av1394_setmaxq(&ap->a_rq, sz); } - AV1394_TNF_EXIT(av1394_ioctl_arq_set_ibuf_size); return (ret); } diff --git a/usr/src/uts/common/io/1394/targets/av1394/av1394_cfgrom.c b/usr/src/uts/common/io/1394/targets/av1394/av1394_cfgrom.c index a8804d1f7e..4640010db2 100644 --- a/usr/src/uts/common/io/1394/targets/av1394/av1394_cfgrom.c +++ b/usr/src/uts/common/io/1394/targets/av1394/av1394_cfgrom.c @@ -53,23 +53,14 @@ static int av1394_cfgrom_rq(av1394_inst_t *, cmd1394_cmd_t *, goto catch; \ } -#define AV1394_TNF_ENTER(func) \ - TNF_PROBE_0_DEBUG(func##_enter, AV1394_TNF_ASYNC_STACK, ""); - -#define AV1394_TNF_EXIT(func) \ - TNF_PROBE_0_DEBUG(func##_exit, AV1394_TNF_ASYNC_STACK, ""); - int av1394_cfgrom_init(av1394_inst_t *avp) { av1394_cfgrom_t *crp = &avp->av_a.a_cfgrom; ddi_iblock_cookie_t ibc = avp->av_attachinfo.iblock_cookie; - AV1394_TNF_ENTER(av1394_cfgrom_init); - rw_init(&crp->cr_rwlock, NULL, RW_DRIVER, ibc); - AV1394_TNF_EXIT(av1394_cfgrom_init); return (DDI_SUCCESS); } @@ -78,11 +69,7 @@ av1394_cfgrom_fini(av1394_inst_t *avp) { av1394_cfgrom_t *crp = &avp->av_a.a_cfgrom; - AV1394_TNF_ENTER(av1394_cfgrom_fini); - rw_destroy(&crp->cr_rwlock); - - AV1394_TNF_EXIT(av1394_cfgrom_fini); } void @@ -90,15 +77,11 @@ av1394_cfgrom_close(av1394_inst_t *avp) { av1394_cfgrom_t *crp = &avp->av_a.a_cfgrom; - AV1394_TNF_ENTER(av1394_cfgrom_close); - rw_enter(&crp->cr_rwlock, RW_WRITER); if (crp->cr_parsed) { av1394_cfgrom_unparse_rom(avp); } rw_exit(&crp->cr_rwlock); - - AV1394_TNF_EXIT(av1394_cfgrom_close); } int @@ -109,11 +92,8 @@ av1394_ioctl_node_get_bus_name(av1394_inst_t *avp, void *arg, int mode) int err; int ret = 0; - AV1394_TNF_ENTER(av1394_ioctl_node_get_bus_name); - err = t1394_alloc_cmd(avp->av_t1394_hdl, 0, &cmd); if (err != DDI_SUCCESS) { - AV1394_TNF_EXIT(av1394_ioctl_node_get_bus_name); return (ENOMEM); } @@ -127,7 +107,6 @@ av1394_ioctl_node_get_bus_name(av1394_inst_t *avp, void *arg, int mode) err = t1394_free_cmd(avp->av_t1394_hdl, 0, &cmd); ASSERT(err == DDI_SUCCESS); - AV1394_TNF_EXIT(av1394_ioctl_node_get_bus_name); return (ret); } @@ -140,11 +119,8 @@ av1394_ioctl_node_get_uid(av1394_inst_t *avp, void *arg, int mode) int err; int ret = 0; - AV1394_TNF_ENTER(av1394_ioctl_node_get_uid); - err = t1394_alloc_cmd(avp->av_t1394_hdl, 0, &cmd); if (err != DDI_SUCCESS) { - AV1394_TNF_EXIT(av1394_ioctl_node_get_uid); return (ENOMEM); } @@ -160,7 +136,6 @@ catch: err = t1394_free_cmd(avp->av_t1394_hdl, 0, &cmd); ASSERT(err == DDI_SUCCESS); - AV1394_TNF_EXIT(av1394_ioctl_node_get_uid); return (ret); } @@ -180,13 +155,10 @@ av1394_ioctl_node_get_text_leaf(av1394_inst_t *avp, void *arg, int mode) uint32_t spec, lang_id, desc_entry; int ret = 0; - AV1394_TNF_ENTER(av1394_ioctl_node_get_text_leaf); - /* copyin arguments */ #ifdef _MULTI_DATAMODEL if (ddi_model_convert_from(mode & FMODELS) == DDI_MODEL_ILP32) { if (ddi_copyin(arg, &tl32, sizeof (tl32), mode) != 0) { - AV1394_TNF_EXIT(av1394_ioctl_node_get_text_leaf); return (EFAULT); } n = tl32.tl_num; @@ -194,7 +166,6 @@ av1394_ioctl_node_get_text_leaf(av1394_inst_t *avp, void *arg, int mode) } else { #endif if (ddi_copyin(arg, &tl, sizeof (tl), mode) != 0) { - AV1394_TNF_EXIT(av1394_ioctl_node_get_text_leaf); return (EFAULT); } n = tl.tl_num; @@ -214,7 +185,6 @@ av1394_ioctl_node_get_text_leaf(av1394_inst_t *avp, void *arg, int mode) ret = av1394_cfgrom_parse_rom(avp); if (ret != 0) { rw_exit(&crp->cr_rwlock); - AV1394_TNF_EXIT(av1394_ioctl_node_get_text_leaf); return (ret); } } @@ -232,7 +202,6 @@ av1394_ioctl_node_get_text_leaf(av1394_inst_t *avp, void *arg, int mode) ret = av1394_cfgrom_read_leaf(avp, pd->pd_tl[n].tl_addr, &bp); if (ret != 0) { rw_exit(&crp->cr_rwlock); - AV1394_TNF_EXIT(av1394_ioctl_node_get_text_leaf); return (ret); } leaf_len = MBLKL(bp) / 4 - 2; @@ -283,7 +252,6 @@ av1394_ioctl_node_get_text_leaf(av1394_inst_t *avp, void *arg, int mode) freemsg(bp); - AV1394_TNF_EXIT(av1394_ioctl_node_get_text_leaf); return (ret); } @@ -495,7 +463,6 @@ av1394_cfgrom_read_leaf(av1394_inst_t *avp, uint64_t leaf_addr, mblk_t **bpp) err = t1394_alloc_cmd(avp->av_t1394_hdl, 0, &cmd); if (err != DDI_SUCCESS) { - AV1394_TNF_EXIT(av1394_ioctl_node_get_text_leaf); return (ENOMEM); } @@ -510,8 +477,6 @@ av1394_cfgrom_read_leaf(av1394_inst_t *avp, uint64_t leaf_addr, mblk_t **bpp) } if ((bp = allocb(leaf_len * 4, BPRI_HI)) == NULL) { - TNF_PROBE_0(aav1394_cfgrom_read_leaf_error_allocb, - AV1394_TNF_ASYNC_ERROR, ""); return (ENOMEM); } @@ -555,9 +520,6 @@ av1394_cfgrom_rq(av1394_inst_t *avp, cmd1394_cmd_t *cmd, uint64_t addr, *rval = cmd->cmd_u.q.quadlet_data; return (0); } else { - TNF_PROBE_2(av1394_cfgrom_rq_error, - AV1394_TNF_ASYNC_ERROR, "", tnf_int, err, err, - tnf_int, result, cmd->cmd_result); return (EIO); } } diff --git a/usr/src/uts/common/io/1394/targets/av1394/av1394_cmp.c b/usr/src/uts/common/io/1394/targets/av1394/av1394_cmp.c index 38efe58da5..9ec3fdb897 100644 --- a/usr/src/uts/common/io/1394/targets/av1394/av1394_cmp.c +++ b/usr/src/uts/common/io/1394/targets/av1394/av1394_cmp.c @@ -61,13 +61,6 @@ static int av1394_pcr_remote_read(av1394_inst_t *, int, uint32_t *); static int av1394_pcr_remote_cas(av1394_inst_t *, int, uint32_t *, uint32_t, uint32_t); -#define AV1394_TNF_ENTER(func) \ - TNF_PROBE_0_DEBUG(func##_enter, AV1394_TNF_CMP_STACK, ""); - -#define AV1394_TNF_EXIT(func) \ - TNF_PROBE_0_DEBUG(func##_exit, AV1394_TNF_CMP_STACK, ""); - - int av1394_cmp_init(av1394_inst_t *avp) { @@ -75,26 +68,19 @@ av1394_cmp_init(av1394_inst_t *avp) ddi_iblock_cookie_t ibc = avp->av_attachinfo.iblock_cookie; int ret; - AV1394_TNF_ENTER(av1394_cmp_init); - ret = t1394_cmp_register(avp->av_t1394_hdl, NULL, 0); if (ret == DDI_SUCCESS) { rw_init(&cmp->cmp_pcr_rwlock, NULL, RW_DRIVER, ibc); } - AV1394_TNF_EXIT(av1394_cmp_init); return (ret); } void av1394_cmp_fini(av1394_inst_t *avp) { - AV1394_TNF_ENTER(av1394_cmp_fini); - av1394_cmp_cleanup(avp); - - AV1394_TNF_EXIT(av1394_cmp_fini); } void @@ -103,8 +89,6 @@ av1394_cmp_bus_reset(av1394_inst_t *avp) av1394_cmp_t *cmp = &avp->av_i.i_cmp; int i; - AV1394_TNF_ENTER(av1394_cmp_bus_reset); - /* reset PCR values */ rw_enter(&cmp->cmp_pcr_rwlock, RW_WRITER); for (i = 0; i < NELEM(cmp->cmp_pcr); i++) { @@ -122,8 +106,6 @@ av1394_cmp_bus_reset(av1394_inst_t *avp) } } rw_exit(&cmp->cmp_pcr_rwlock); - - AV1394_TNF_EXIT(av1394_cmp_bus_reset); } /* @@ -490,8 +472,6 @@ av1394_pcr_alloc_addr(av1394_inst_t *avp, uint64_t addr, int ret; int result; - AV1394_TNF_ENTER(av1394_pcr_addr_alloc); - bzero(&aa, sizeof (aa)); aa.aa_address = addr; aa.aa_length = 4; @@ -502,14 +482,10 @@ av1394_pcr_alloc_addr(av1394_inst_t *avp, uint64_t addr, aa.aa_arg = avp; ret = t1394_alloc_addr(avp->av_t1394_hdl, &aa, 0, &result); - if (ret != DDI_SUCCESS) { - TNF_PROBE_2(av1394_pcr_alloc_addr_error, AV1394_TNF_CMP_ERROR, - "", tnf_int, ret, ret, tnf_int, result, result); - } else { + if (ret == DDI_SUCCESS) { *hdlp = aa.aa_hdl; } - AV1394_TNF_EXIT(av1394_pcr_addr_alloc); return (ret); } @@ -519,13 +495,7 @@ av1394_pcr_alloc_addr(av1394_inst_t *avp, uint64_t addr, static void av1394_pcr_free_addr(av1394_inst_t *avp, t1394_addr_handle_t *hdlp) { - int ret; - - ret = t1394_free_addr(avp->av_t1394_hdl, hdlp, 0); - if (ret != DDI_SUCCESS) { - TNF_PROBE_1(av1394_pcr_free_addr_error, AV1394_TNF_CMP_ERROR, - "", tnf_int, ret, ret); - } + (void) t1394_free_addr(avp->av_t1394_hdl, hdlp, 0); } /* @@ -641,9 +611,6 @@ av1394_pcr_recv_read_request(cmd1394_cmd_t *req) av1394_cmp_t *cmp = &avp->av_i.i_cmp; int idx; /* PCR index */ av1394_pcr_t *pcr; - int err; - - AV1394_TNF_ENTER(av1394_pcr_recv_read_request); idx = (req->cmd_addr - AV1394_PCR_ADDR_START) / 4; @@ -661,13 +628,7 @@ av1394_pcr_recv_read_request(cmd1394_cmd_t *req) req->cmd_result = IEEE1394_RESP_COMPLETE; } - err = t1394_recv_request_done(avp->av_t1394_hdl, req, 0); - if (err != DDI_SUCCESS) { - TNF_PROBE_1(av1394_pcr_recv_read_request_done_error, - AV1394_TNF_CMP_ERROR, "", tnf_int, err, err); - } - - AV1394_TNF_EXIT(av1394_pcr_recv_read_request); + (void) t1394_recv_request_done(avp->av_t1394_hdl, req, 0); } static void @@ -677,9 +638,6 @@ av1394_pcr_recv_lock_request(cmd1394_cmd_t *req) av1394_cmp_t *cmp = &avp->av_i.i_cmp; int idx; /* PCR index */ av1394_pcr_t *pcr; - int err; - - AV1394_TNF_ENTER(av1394_pcr_recv_lock_request); idx = (req->cmd_addr - AV1394_PCR_ADDR_START) / 4; @@ -701,14 +659,7 @@ av1394_pcr_recv_lock_request(cmd1394_cmd_t *req) req->cmd_result = IEEE1394_RESP_COMPLETE; } - err = t1394_recv_request_done(avp->av_t1394_hdl, req, 0); - if (err != DDI_SUCCESS) { - TNF_PROBE_2(av1394_pcr_recv_lock_request_done_error, - AV1394_TNF_CMP_ERROR, "", tnf_int, err, err, - tnf_int, result, req->cmd_result); - } - - AV1394_TNF_EXIT(av1394_pcr_recv_lock_request); + (void) t1394_recv_request_done(avp->av_t1394_hdl, req, 0); } @@ -738,8 +689,6 @@ av1394_pcr_remote_read(av1394_inst_t *avp, int ph, uint32_t *valp) (cmd->cmd_result == CMD1394_CMDSUCCESS)) { *valp = cmd->cmd_u.q.quadlet_data; } else { - TNF_PROBE_2(av1394_pcr_remote_read_error, AV1394_TNF_CMP_ERROR, - "", tnf_int, err, err, tnf_int, result, cmd->cmd_result); ret = EIO; } @@ -777,8 +726,6 @@ av1394_pcr_remote_cas(av1394_inst_t *avp, int ph, uint32_t *old_valuep, (cmd->cmd_result == CMD1394_CMDSUCCESS)) { *old_valuep = cmd->cmd_u.l32.old_value; } else { - TNF_PROBE_2(av1394_pcr_remote_cas_error, AV1394_TNF_CMP_ERROR, - "", tnf_int, err, err, tnf_int, result, cmd->cmd_result); ret = EIO; } diff --git a/usr/src/uts/common/io/1394/targets/av1394/av1394_fcp.c b/usr/src/uts/common/io/1394/targets/av1394/av1394_fcp.c index a551bad1db..090ad0b762 100644 --- a/usr/src/uts/common/io/1394/targets/av1394/av1394_fcp.c +++ b/usr/src/uts/common/io/1394/targets/av1394/av1394_fcp.c @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * av1394 FCP module */ @@ -54,12 +52,6 @@ static void av1394_fcp_common_write_request_cb(cmd1394_cmd_t *, int); static int av1394_fcp_copyin_block(iec61883_arq_t *, mblk_t *, struct uio *); -#define AV1394_TNF_ENTER(func) \ - TNF_PROBE_0_DEBUG(func##_enter, AV1394_TNF_FCP_STACK, ""); - -#define AV1394_TNF_EXIT(func) \ - TNF_PROBE_0_DEBUG(func##_exit, AV1394_TNF_FCP_STACK, ""); - /* * * --- configuration entry points @@ -71,32 +63,26 @@ av1394_fcp_attach(av1394_inst_t *avp) av1394_fcp_t *fcp = &avp->av_a.a_fcp; int ret; - AV1394_TNF_ENTER(av1394_fcp_attach); - /* register FCP controller */ if ((ret = av1394_fcp_ctl_register(avp)) != DDI_SUCCESS) { - AV1394_TNF_EXIT(av1394_fcp_attach); return (ret); } /* allocate FCP controller command */ if ((ret = av1394_fcp_ctl_alloc_cmd(avp)) != DDI_SUCCESS) { av1394_fcp_cleanup(avp, 1); - AV1394_TNF_EXIT(av1394_fcp_attach); return (ret); } /* register FCP target */ if ((ret = av1394_fcp_tgt_register(avp)) != DDI_SUCCESS) { av1394_fcp_cleanup(avp, 2); - AV1394_TNF_EXIT(av1394_fcp_attach); return (ret); } /* allocate FCP target command */ if ((ret = av1394_fcp_tgt_alloc_cmd(avp)) != DDI_SUCCESS) { av1394_fcp_cleanup(avp, 3); - AV1394_TNF_EXIT(av1394_fcp_attach); return (ret); } @@ -105,18 +91,13 @@ av1394_fcp_attach(av1394_inst_t *avp) cv_init(&fcp->fcp_resp.fc_xmit_cv, NULL, CV_DRIVER, NULL); cv_init(&fcp->fcp_resp.fc_busy_cv, NULL, CV_DRIVER, NULL); - AV1394_TNF_EXIT(av1394_fcp_attach); return (ret); } void av1394_fcp_detach(av1394_inst_t *avp) { - AV1394_TNF_ENTER(av1394_fcp_detach); - av1394_fcp_cleanup(avp, AV1394_CLEANUP_LEVEL_MAX); - - AV1394_TNF_EXIT(av1394_fcp_detach); } int @@ -130,29 +111,22 @@ av1394_fcp_write(av1394_inst_t *avp, iec61883_arq_t *arq, struct uio *uiop) mblk_t *mp = NULL; int ret; - AV1394_TNF_ENTER(av1394_fcp_write); - ASSERT((arq->arq_type == IEC61883_ARQ_FCP_CMD) || (arq->arq_type == IEC61883_ARQ_FCP_RESP)); /* check arguments */ if ((len == 0) || (len > AV1394_FCP_ARQ_LEN_MAX) || (len % IEEE1394_QUADLET != 0)) { - TNF_PROBE_1(av1394_fcp_write_error, - AV1394_TNF_FCP_ERROR, "", tnf_int, len, len); - AV1394_TNF_EXIT(av1394_fcp_write); return (EINVAL); } /* block write requires an mblk */ if (len > IEEE1394_QUADLET) { if ((mp = allocb(len, BPRI_HI)) == NULL) { - AV1394_TNF_EXIT(av1394_fcp_write); return (ENOMEM); } if ((ret = av1394_fcp_copyin_block(arq, mp, uiop)) != 0) { freemsg(mp); - AV1394_TNF_EXIT(av1394_fcp_write); return (ret); } } @@ -167,7 +141,6 @@ av1394_fcp_write(av1394_inst_t *avp, iec61883_arq_t *arq, struct uio *uiop) if (cv_wait_sig(&fc->fc_busy_cv, &ap->a_mutex) == 0) { mutex_exit(&ap->a_mutex); freemsg(mp); - AV1394_TNF_EXIT(av1394_fcp_write); return (EINTR); } } @@ -194,7 +167,6 @@ av1394_fcp_write(av1394_inst_t *avp, iec61883_arq_t *arq, struct uio *uiop) freemsg(mp); - AV1394_TNF_EXIT(av1394_fcp_write); return (ret); } @@ -213,10 +185,6 @@ av1394_fcp_ctl_register(av1394_inst_t *avp) evts.fcp_arg = avp; ret = t1394_fcp_register_controller(avp->av_t1394_hdl, &evts, 0); - if (ret != DDI_SUCCESS) { - TNF_PROBE_1(av1394_fcp_ctl_register_error, - AV1394_TNF_FCP_ERROR, "", tnf_int, ret, ret); - } return (ret); } @@ -230,10 +198,6 @@ av1394_fcp_tgt_register(av1394_inst_t *avp) evts.fcp_arg = avp; ret = t1394_fcp_register_target(avp->av_t1394_hdl, &evts, 0); - if (ret != DDI_SUCCESS) { - TNF_PROBE_1(av1394_fcp_tgt_register_error, - AV1394_TNF_FCP_ERROR, "", tnf_int, ret, ret); - } return (ret); } @@ -245,10 +209,6 @@ av1394_fcp_ctl_alloc_cmd(av1394_inst_t *avp) ret = t1394_alloc_cmd(avp->av_t1394_hdl, T1394_ALLOC_CMD_FCP_COMMAND, &fc->fc_cmd); - if (ret != DDI_SUCCESS) { - TNF_PROBE_1(av1394_fcp_ctl_alloc_cmd_error, - AV1394_TNF_FCP_ERROR, "", tnf_int, ret, ret); - } return (ret); } @@ -256,13 +216,8 @@ static void av1394_fcp_ctl_free_cmd(av1394_inst_t *avp) { av1394_fcp_cmd_t *fc = &avp->av_a.a_fcp.fcp_cmd; - int ret; - ret = t1394_free_cmd(avp->av_t1394_hdl, 0, &fc->fc_cmd); - if (ret != DDI_SUCCESS) { - TNF_PROBE_1(av1394_fcp_ctl_free_cmd_error, - AV1394_TNF_FCP_ERROR, "", tnf_int, ret, ret); - } + (void) t1394_free_cmd(avp->av_t1394_hdl, 0, &fc->fc_cmd); } static int @@ -273,10 +228,6 @@ av1394_fcp_tgt_alloc_cmd(av1394_inst_t *avp) ret = t1394_alloc_cmd(avp->av_t1394_hdl, T1394_ALLOC_CMD_FCP_RESPONSE, &fc->fc_cmd); - if (ret != DDI_SUCCESS) { - TNF_PROBE_1(av1394_fcp_tgt_alloc_cmd_error, - AV1394_TNF_FCP_ERROR, "", tnf_int, ret, ret); - } return (ret); } @@ -284,13 +235,8 @@ static void av1394_fcp_tgt_free_cmd(av1394_inst_t *avp) { av1394_fcp_cmd_t *fc = &avp->av_a.a_fcp.fcp_resp; - int ret; - ret = t1394_free_cmd(avp->av_t1394_hdl, 0, &fc->fc_cmd); - if (ret != DDI_SUCCESS) { - TNF_PROBE_1(av1394_fcp_tgt_free_cmd_error, - AV1394_TNF_FCP_ERROR, "", tnf_int, ret, ret); - } + (void) t1394_free_cmd(avp->av_t1394_hdl, 0, &fc->fc_cmd); } static void @@ -346,9 +292,6 @@ av1394_fcp_cmd_write_sync(av1394_inst_t *avp, av1394_fcp_cmd_t *fc) /* immediate error? */ if (ret != DDI_SUCCESS) { fc->fc_xmit = B_FALSE; - TNF_PROBE_2(av1394_fcp_cmd_write_sync_error, - AV1394_TNF_FCP_ERROR, "", tnf_int, ret, ret, - tnf_int, cmd_result, cmd->cmd_result); return (EIO); } @@ -360,9 +303,6 @@ av1394_fcp_cmd_write_sync(av1394_inst_t *avp, av1394_fcp_cmd_t *fc) } if (cmd->cmd_result != CMD1394_CMDSUCCESS) { - TNF_PROBE_1(av1394_fcp_cmd_write_sync_error, - AV1394_TNF_FCP_ERROR, "", - tnf_int, cmd_result, cmd->cmd_result); if (cmd->cmd_result == CMD1394_EDEVICE_BUSY) { return (EBUSY); } else { @@ -381,8 +321,6 @@ av1394_fcp_cmd_completion_cb(struct cmd1394_cmd *cmd) av1394_fcp_t *fcp = &ap->a_fcp; av1394_fcp_cmd_t *fc; - AV1394_TNF_ENTER(av1394_fcp_cmd_completion_cb); - mutex_enter(&ap->a_mutex); /* is this FCP command or response */ if (cmd == fcp->fcp_cmd.fc_cmd) { @@ -396,8 +334,6 @@ av1394_fcp_cmd_completion_cb(struct cmd1394_cmd *cmd) fc->fc_xmit = B_FALSE; cv_signal(&fc->fc_xmit_cv); mutex_exit(&ap->a_mutex); - - AV1394_TNF_EXIT(av1394_fcp_cmd_completion_cb); } /* @@ -410,22 +346,18 @@ av1394_fcp_resp_write_request_cb(cmd1394_cmd_t *req) av1394_inst_t *avp = req->cmd_callback_arg; av1394_async_t *ap = &avp->av_a; - AV1394_TNF_ENTER(av1394_fcp_resp_write_request_cb); - mutex_enter(&ap->a_mutex); if ((ap->a_nopen == 0) || (req->bus_generation != ap->a_bus_generation) || (req->nodeID != ap->a_targetinfo.target_nodeID)) { mutex_exit(&ap->a_mutex); - AV1394_TNF_EXIT(av1394_fcp_resp_write_request_cb); return (T1394_REQ_UNCLAIMED); } mutex_exit(&ap->a_mutex); av1394_fcp_common_write_request_cb(req, AV1394_M_FCP_RESP); - AV1394_TNF_EXIT(av1394_fcp_resp_write_request_cb); return (T1394_REQ_CLAIMED); } @@ -439,20 +371,16 @@ av1394_fcp_cmd_write_request_cb(cmd1394_cmd_t *req) av1394_inst_t *avp = req->cmd_callback_arg; av1394_async_t *ap = &avp->av_a; - AV1394_TNF_ENTER(av1394_fcp_cmd_write_request_cb); - mutex_enter(&ap->a_mutex); if (ap->a_nopen == 0) { mutex_exit(&ap->a_mutex); - AV1394_TNF_EXIT(av1394_fcp_cmd_write_request_cb); return (T1394_REQ_UNCLAIMED); } mutex_exit(&ap->a_mutex); av1394_fcp_common_write_request_cb(req, AV1394_M_FCP_CMD); - AV1394_TNF_EXIT(av1394_fcp_cmd_write_request_cb); return (T1394_REQ_CLAIMED); } @@ -462,9 +390,6 @@ av1394_fcp_common_write_request_cb(cmd1394_cmd_t *req, int mtype) av1394_inst_t *avp = req->cmd_callback_arg; mblk_t *mp; uint32_t quadlet_data; - int err; - - AV1394_TNF_ENTER(av1394_fcp_common_write_request_cb); ASSERT((req->cmd_type == CMD1394_ASYNCH_WR_QUAD) || (req->cmd_type == CMD1394_ASYNCH_WR_BLOCK)); @@ -480,21 +405,12 @@ av1394_fcp_common_write_request_cb(cmd1394_cmd_t *req, int mtype) /* complete request */ req->cmd_result = IEEE1394_RESP_COMPLETE; - err = t1394_recv_request_done(avp->av_t1394_hdl, req, 0); - if (err != DDI_SUCCESS) { - TNF_PROBE_2(av1394_fcp_common_write_request_cb_done_error, - AV1394_TNF_FCP_ERROR, "", tnf_int, err, err, - tnf_int, result, req->cmd_result); - } + (void) t1394_recv_request_done(avp->av_t1394_hdl, req, 0); /* allocate mblk and copy quadlet into it */ if (req->cmd_type == CMD1394_ASYNCH_WR_QUAD) { mp = allocb(IEEE1394_QUADLET, BPRI_HI); if (mp == NULL) { - TNF_PROBE_0( - av1394_fcp_common_write_request_cb_allocb_error, - AV1394_TNF_FCP_ERROR, ""); - AV1394_TNF_EXIT(av1394_fcp_common_write_request_cb); return; } *(uint32_t *)mp->b_rptr = quadlet_data; @@ -504,8 +420,6 @@ av1394_fcp_common_write_request_cb(cmd1394_cmd_t *req, int mtype) /* queue up the data */ DB_TYPE(mp) = mtype; av1394_async_putq_rq(avp, mp); - - AV1394_TNF_EXIT(av1394_fcp_common_write_request_cb); } /* @@ -532,8 +446,6 @@ av1394_fcp_copyin_block(iec61883_arq_t *arq, mblk_t *mp, struct uio *uiop) if (copylen > 0) { ret = uiomove(mp->b_wptr, copylen, UIO_WRITE, uiop); if (ret != 0) { - TNF_PROBE_1(av1394_fcp_copyin_block_error, - AV1394_TNF_FCP_ERROR, "", tnf_int, ret, ret); return (ret); } mp->b_wptr += copylen; diff --git a/usr/src/uts/common/io/1394/targets/av1394/av1394_isoch.c b/usr/src/uts/common/io/1394/targets/av1394/av1394_isoch.c index 8e05ffcf9b..9a16a26454 100644 --- a/usr/src/uts/common/io/1394/targets/av1394/av1394_isoch.c +++ b/usr/src/uts/common/io/1394/targets/av1394/av1394_isoch.c @@ -72,27 +72,18 @@ int av1394_isoch_autorecv_framesz = 250; int av1394_isoch_autoxmit_nframes = 50; int av1394_isoch_autoxmit_framesz = 250; -#define AV1394_TNF_ENTER(func) \ - TNF_PROBE_0_DEBUG(func##_enter, AV1394_TNF_ISOCH_STACK, ""); - -#define AV1394_TNF_EXIT(func) \ - TNF_PROBE_0_DEBUG(func##_exit, AV1394_TNF_ISOCH_STACK, ""); - int av1394_isoch_attach(av1394_inst_t *avp) { av1394_isoch_t *ip = &avp->av_i; ddi_iblock_cookie_t ibc = avp->av_attachinfo.iblock_cookie; - AV1394_TNF_ENTER(av1394_isoch_attach); - mutex_init(&ip->i_mutex, NULL, MUTEX_DRIVER, ibc); mutex_enter(&ip->i_mutex); if (av1394_isoch_create_minor_node(avp) != DDI_SUCCESS) { mutex_exit(&ip->i_mutex); av1394_isoch_cleanup(avp, 1); - AV1394_TNF_EXIT(av1394_isoch_attach); return (DDI_FAILURE); } @@ -100,32 +91,25 @@ av1394_isoch_attach(av1394_inst_t *avp) 0, 0, av1394_isoch_softintr, (caddr_t)avp) != DDI_SUCCESS) { mutex_exit(&ip->i_mutex); av1394_isoch_cleanup(avp, 2); - AV1394_TNF_EXIT(av1394_isoch_attach); return (DDI_FAILURE); } if (av1394_cmp_init(avp) != DDI_SUCCESS) { mutex_exit(&ip->i_mutex); av1394_isoch_cleanup(avp, 3); - AV1394_TNF_EXIT(av1394_isoch_attach); return (DDI_FAILURE); } av1394_as_init(&ip->i_mmap_as); mutex_exit(&ip->i_mutex); - AV1394_TNF_EXIT(av1394_isoch_attach); return (DDI_SUCCESS); } void av1394_isoch_detach(av1394_inst_t *avp) { - AV1394_TNF_ENTER(av1394_isoch_detach); - av1394_isoch_cleanup(avp, AV1394_CLEANUP_LEVEL_MAX); - - AV1394_TNF_EXIT(av1394_isoch_detach); } int @@ -136,8 +120,6 @@ av1394_isoch_cpr_suspend(av1394_inst_t *avp) int i; int ret = DDI_SUCCESS; - AV1394_TNF_ENTER(av1394_isoch_cpr_suspend); - /* * suspend only if there are no active channels */ @@ -154,7 +136,6 @@ av1394_isoch_cpr_suspend(av1394_inst_t *avp) } mutex_exit(&ip->i_mutex); - AV1394_TNF_EXIT(av1394_isoch_cpr_suspend); return (ret); } @@ -164,12 +145,9 @@ av1394_isoch_close(av1394_inst_t *avp, int flag) { int ret; - AV1394_TNF_ENTER(av1394_isoch_close); - ret = av1394_ic_close(avp, flag); av1394_cmp_close(avp); - AV1394_TNF_EXIT(av1394_isoch_close); return (ret); } @@ -179,13 +157,10 @@ av1394_isoch_read(av1394_inst_t *avp, struct uio *uiop) av1394_ic_t *icp; int ret; - AV1394_TNF_ENTER(av1394_isoch_read); - /* use broadcast channel */ icp = avp->av_i.i_ic[63]; if (icp == NULL) { if ((ret = av1394_isoch_autorecv_init(avp, &icp)) != 0) { - AV1394_TNF_EXIT(av1394_isoch_read); return (ret); } } else if (icp->ic_dir != AV1394_IR) { @@ -197,7 +172,6 @@ av1394_isoch_read(av1394_inst_t *avp, struct uio *uiop) ret = av1394_ir_read(icp, uiop); } - AV1394_TNF_EXIT(av1394_isoch_read); return (ret); } @@ -207,24 +181,19 @@ av1394_isoch_write(av1394_inst_t *avp, struct uio *uiop) av1394_ic_t *icp; int ret; - AV1394_TNF_ENTER(av1394_isoch_write); - /* use broadcast channel */ icp = avp->av_i.i_ic[63]; if (icp == NULL) { if ((ret = av1394_isoch_autoxmit_init(avp, &icp, uiop)) != 0) { - AV1394_TNF_EXIT(av1394_isoch_write); return (ret); } } else if (icp->ic_dir != AV1394_IT) { /* channel already used for recv */ - AV1394_TNF_EXIT(av1394_isoch_write); return (EBUSY); } ret = av1394_it_write(icp, uiop); - AV1394_TNF_EXIT(av1394_isoch_write); return (ret); } @@ -278,14 +247,11 @@ av1394_isoch_devmap(av1394_inst_t *avp, devmap_cookie_t dhp, offset_t off, { av1394_isoch_seg_t *isp; - AV1394_TNF_ENTER(av1394_isoch_devmap); - *maplen = 0; /* find segment */ isp = av1394_isoch_find_seg(avp, off, ptob(btopr(len))); if (isp == NULL) { - AV1394_TNF_EXIT(av1394_isoch_devmap); return (EINVAL); } @@ -293,14 +259,10 @@ av1394_isoch_devmap(av1394_inst_t *avp, devmap_cookie_t dhp, offset_t off, if (devmap_umem_setup(dhp, avp->av_dip, &av1394_isoch_devmap_ops, isp->is_umem_cookie, 0, isp->is_umem_size, PROT_ALL, 0, &avp->av_attachinfo.acc_attr) != 0) { - TNF_PROBE_0(av1394_isoch_devmap_error_umem_setup, - AV1394_TNF_ISOCH_ERROR, ""); - AV1394_TNF_EXIT(av1394_isoch_devmap); return (EINVAL); } *maplen = isp->is_umem_size; - AV1394_TNF_EXIT(av1394_isoch_devmap); return (0); } @@ -319,10 +281,6 @@ av1394_isoch_create_minor_node(av1394_inst_t *avp) ret = ddi_create_minor_node(avp->av_dip, "isoch", S_IFCHR, AV1394_ISOCH_INST2MINOR(avp->av_instance), DDI_NT_AV_ISOCH, 0); - if (ret != DDI_SUCCESS) { - TNF_PROBE_0(av1394_isoch_create_minor_node_error, - AV1394_TNF_ISOCH_ERROR, ""); - } return (ret); } @@ -393,8 +351,6 @@ av1394_isoch_find_seg(av1394_inst_t *avp, offset_t off, size_t len) icp = NULL; } if (icp == NULL) { - TNF_PROBE_0(av1394_isoch_find_seg_error_nochan, - AV1394_TNF_ISOCH_ERROR, ""); return (NULL); } @@ -410,15 +366,11 @@ av1394_isoch_find_seg(av1394_inst_t *avp, offset_t off, size_t len) isp = NULL; } if (isp == NULL) { - TNF_PROBE_0(av1394_isoch_find_seg_error_noseg, - AV1394_TNF_ISOCH_ERROR, ""); return (NULL); } /* only whole segments can be mapped */ if (len != isp->is_umem_size) { - TNF_PROBE_0(av1394_isoch_devmap_error_whole, - AV1394_TNF_ISOCH_ERROR, ""); return (NULL); } return (isp); @@ -433,8 +385,6 @@ av1394_isoch_autorecv_init(av1394_inst_t *avp, av1394_ic_t **icpp) iec61883_isoch_init_t ii; int ret = 0; - AV1394_TNF_ENTER(av1394_isoch_autorecv_init); - bzero(&ii, sizeof (ii)); ii.ii_version = IEC61883_V1_0; ii.ii_pkt_size = 512; @@ -446,7 +396,6 @@ av1394_isoch_autorecv_init(av1394_inst_t *avp, av1394_ic_t **icpp) ret = av1394_ic_init(avp, &ii, icpp); - AV1394_TNF_EXIT(av1394_isoch_autorecv_init); return (ret); } @@ -462,13 +411,9 @@ av1394_isoch_autoxmit_init(av1394_inst_t *avp, av1394_ic_t **icpp, uint_t fmt, dbs, fn, f5060, stype; /* CIP fields */ int ret = 0; - AV1394_TNF_ENTER(av1394_isoch_autoxmit_init); - /* copyin the first CIP header */ axp->ax_copy_ciph = B_FALSE; if (uiop->uio_resid < AV1394_CIPSZ) { - TNF_PROBE_0_DEBUG(av1394_isoch_autoxmit_init_error_cipsz, - AV1394_TNF_ISOCH_ERROR, ""); return (EINVAL); } ret = uiomove(axp->ax_ciph, AV1394_CIPSZ, UIO_WRITE, uiop); @@ -519,7 +464,6 @@ av1394_isoch_autoxmit_init(av1394_inst_t *avp, av1394_ic_t **icpp, ret = av1394_ic_init(avp, &ii, icpp); - AV1394_TNF_EXIT(av1394_isoch_autoxmit_init); return (ret); } @@ -541,17 +485,13 @@ av1394_ioctl_isoch_init(av1394_inst_t *avp, void *arg, int mode) av1394_ic_t *icp; int ret; - AV1394_TNF_ENTER(av1394_ioctl_isoch_init); - if (ddi_copyin(arg, &ii, sizeof (ii), mode) != 0) { - AV1394_TNF_EXIT(av1394_ioctl_isoch_init); return (EFAULT); } ret = av1394_ic_init(avp, &ii, &icp); if (ret != 0) { - AV1394_TNF_EXIT(av1394_ioctl_isoch_init); #ifdef _MULTI_DATAMODEL if (ddi_model_convert_from(mode & FMODELS) == DDI_MODEL_ILP32) { bcopy(&ii, &ii32, sizeof (ii32)); @@ -575,11 +515,9 @@ av1394_ioctl_isoch_init(av1394_inst_t *avp, void *arg, int mode) #endif ret = ddi_copyout(&ii, arg, sizeof (ii), mode); if (ret != 0) { - AV1394_TNF_EXIT(av1394_ioctl_isoch_init); return (ENOMEM); } - AV1394_TNF_EXIT(av1394_ioctl_isoch_init); return (ret); } @@ -590,14 +528,8 @@ av1394_ioctl_isoch_handle2ic(av1394_inst_t *avp, void *arg) av1394_isoch_t *ip = &avp->av_i; if (num >= NELEM(ip->i_ic)) { - TNF_PROBE_0(av1394_ioctl_isoch_handle2ic_error_range, - AV1394_TNF_ISOCH_ERROR, ""); return (NULL); } - if (ip->i_ic[num] == NULL) { - TNF_PROBE_0(av1394_ioctl_isoch_handle2ic_error_null, - AV1394_TNF_ISOCH_ERROR, ""); - } return (ip->i_ic[num]); } @@ -607,13 +539,10 @@ av1394_ioctl_isoch_fini(av1394_inst_t *avp, void *arg, int mode) { av1394_ic_t *icp; - AV1394_TNF_ENTER(av1394_ioctl_isoch_fini); - if ((icp = av1394_ioctl_isoch_handle2ic(avp, arg)) != NULL) { av1394_ic_fini(icp); } - AV1394_TNF_EXIT(av1394_ioctl_isoch_fini); return (0); } @@ -624,13 +553,10 @@ av1394_ioctl_start(av1394_inst_t *avp, void *arg, int mode) av1394_ic_t *icp; int ret = EINVAL; - AV1394_TNF_ENTER(av1394_ioctl_start); - if ((icp = av1394_ioctl_isoch_handle2ic(avp, arg)) != NULL) { ret = av1394_ic_start(icp); } - AV1394_TNF_EXIT(av1394_ioctl_start); return (ret); } @@ -641,13 +567,10 @@ av1394_ioctl_stop(av1394_inst_t *avp, void *arg, int mode) av1394_ic_t *icp; int ret = EINVAL; - AV1394_TNF_ENTER(av1394_ioctl_stop); - if ((icp = av1394_ioctl_isoch_handle2ic(avp, arg)) != NULL) { ret = av1394_ic_stop(icp); } - AV1394_TNF_EXIT(av1394_ioctl_stop); return (ret); } @@ -666,15 +589,9 @@ av1394_ioctl_recv(av1394_inst_t *avp, void *arg, int mode) } num = recv.rx_handle; if (num >= NELEM(ip->i_ic)) { - TNF_PROBE_0(av1394_ioctl_recv_error_range, - AV1394_TNF_ISOCH_ERROR, ""); return (EINVAL); } icp = ip->i_ic[num]; - if (icp == NULL) { - TNF_PROBE_0(av1394_ioctl_recv_error_null, - AV1394_TNF_ISOCH_ERROR, ""); - } /* now call the actual handler */ if (icp->ic_dir != AV1394_IR) { @@ -708,15 +625,9 @@ av1394_ioctl_xmit(av1394_inst_t *avp, void *arg, int mode) } num = xmit.tx_handle; if (num >= NELEM(ip->i_ic)) { - TNF_PROBE_0(av1394_ioctl_xmit_error_range, - AV1394_TNF_ISOCH_ERROR, ""); return (EINVAL); } icp = ip->i_ic[num]; - if (icp == NULL) { - TNF_PROBE_0(av1394_ioctl_xmit_error_null, - AV1394_TNF_ISOCH_ERROR, ""); - } /* now call the actual handler */ if (icp->ic_dir != AV1394_IT) { diff --git a/usr/src/uts/common/io/1394/targets/av1394/av1394_isoch_chan.c b/usr/src/uts/common/io/1394/targets/av1394/av1394_isoch_chan.c index e2a85f6c3a..ece9068c4f 100644 --- a/usr/src/uts/common/io/1394/targets/av1394/av1394_isoch_chan.c +++ b/usr/src/uts/common/io/1394/targets/av1394/av1394_isoch_chan.c @@ -53,12 +53,6 @@ static void av1394_ic_rsrc_fail(t1394_isoch_single_handle_t t1394_sii_hdl, uint64_t av1394_ic_bitreverse(uint64_t); boolean_t av1394_ic_onebit(uint64_t); -#define AV1394_TNF_ENTER(func) \ - TNF_PROBE_0_DEBUG(func##_enter, AV1394_TNF_ISOCH_STACK, ""); - -#define AV1394_TNF_EXIT(func) \ - TNF_PROBE_0_DEBUG(func##_exit, AV1394_TNF_ISOCH_STACK, ""); - /* tunables */ extern int av1394_rate_n_dv_ntsc; extern int av1394_rate_d_dv_ntsc; @@ -73,8 +67,6 @@ av1394_ic_close(av1394_inst_t *avp, int flags) av1394_ic_t *icp; int i; - AV1394_TNF_ENTER(av1394_ic_close); - /* cleanup channels in case application didn't */ for (i = 0; i < NELEM(ip->i_ic); i++) { icp = ip->i_ic[i]; @@ -84,7 +76,6 @@ av1394_ic_close(av1394_inst_t *avp, int flags) } } - AV1394_TNF_EXIT(av1394_ic_close); return (0); } @@ -104,14 +95,11 @@ av1394_ic_init(av1394_inst_t *avp, iec61883_isoch_init_t *ii, int ret; ddi_iblock_cookie_t ibc = avp->av_attachinfo.iblock_cookie; - AV1394_TNF_ENTER(av1394_ic_init); - ii->ii_frame_rcnt = 0; ii->ii_rchannel = 0; ii->ii_error = 0; if ((ret = av1394_ic_validate_init_params(ii)) != 0) { - AV1394_TNF_EXIT(av1394_ic_init); return (ret); } @@ -134,7 +122,6 @@ av1394_ic_init(av1394_inst_t *avp, iec61883_isoch_init_t *ii, if (ret != DDI_SUCCESS) { ii->ii_error = IEC61883_ERR_NOCHANNEL; av1394_ic_cleanup(icp, 1); - AV1394_TNF_EXIT(av1394_ic_init); return (EINVAL); } } @@ -149,9 +136,6 @@ av1394_ic_init(av1394_inst_t *avp, iec61883_isoch_init_t *ii, mutex_exit(&ip->i_mutex); ii->ii_error = IEC61883_ERR_NOCHANNEL; av1394_ic_cleanup(icp, 2); - TNF_PROBE_0(av1394_ic_init_error_chan_used, - AV1394_TNF_ISOCH_ERROR, ""); - AV1394_TNF_EXIT(av1394_ic_init); return (EINVAL); } ip->i_ic[num] = icp; @@ -168,7 +152,6 @@ av1394_ic_init(av1394_inst_t *avp, iec61883_isoch_init_t *ii, if (ret != 0) { av1394_ic_cleanup(icp, 3); - AV1394_TNF_EXIT(av1394_ic_init); return (ret); } @@ -188,21 +171,13 @@ av1394_ic_init(av1394_inst_t *avp, iec61883_isoch_init_t *ii, mutex_exit(&icp->ic_mutex); mutex_exit(&ip->i_mutex); - TNF_PROBE_2_DEBUG(av1394_ic_init, AV1394_TNF_ISOCH, "", - tnf_string, msg, "channel allocated", tnf_int, num, icp->ic_num); - - AV1394_TNF_EXIT(av1394_ic_init); return (0); } void av1394_ic_fini(av1394_ic_t *icp) { - AV1394_TNF_ENTER(av1394_ic_fini); - av1394_ic_cleanup(icp, AV1394_CLEANUP_LEVEL_MAX); - - AV1394_TNF_EXIT(av1394_ic_fini); } /* @@ -252,28 +227,20 @@ av1394_ic_validate_init_params(iec61883_isoch_init_t *ii) IEC61883_IMPL_VER_MAJOR(AV1394_IEC61883_VER)) || (IEC61883_IMPL_VER_MINOR(ii->ii_version) > IEC61883_IMPL_VER_MINOR(AV1394_IEC61883_VER))) { - TNF_PROBE_0(av1394_ic_validate_init_params_ver_error, - AV1394_TNF_ISOCH_ERROR, ""); ii->ii_error = IEC61883_ERR_VERSION; return (EINVAL); } if ((ii->ii_pkt_size % 4) || (ii->ii_pkt_size > 512)) { - TNF_PROBE_0(av1394_ic_validate_init_params_pktsz_error, - AV1394_TNF_ISOCH_ERROR, ""); ii->ii_error = IEC61883_ERR_PKT_SIZE; return (EINVAL); } framesz = ii->ii_frame_size * ii->ii_pkt_size; if (framesz > AV1394_IC_FRAME_SIZE_MAX) { - TNF_PROBE_0(av1394_ic_validate_init_params_frsz_error, - AV1394_TNF_ISOCH_ERROR, ""); ii->ii_error = IEC61883_ERR_NOMEM; return (EINVAL); } if ((ii->ii_direction != IEC61883_DIR_RECV) && (ii->ii_direction != IEC61883_DIR_XMIT)) { - TNF_PROBE_0(av1394_ic_validate_init_params_dir_error, - AV1394_TNF_ISOCH_ERROR, ""); ii->ii_error = IEC61883_ERR_INVAL; return (EINVAL); } @@ -281,29 +248,21 @@ av1394_ic_validate_init_params(iec61883_isoch_init_t *ii) (ii->ii_frame_cnt < AV1394_IR_NFRAMES_MIN)) || ((ii->ii_direction == IEC61883_DIR_XMIT) && (ii->ii_frame_cnt < AV1394_IT_NFRAMES_MIN))) { - TNF_PROBE_0(av1394_ic_validate_init_params_frcnt_error, - AV1394_TNF_ISOCH_ERROR, ""); ii->ii_error = IEC61883_ERR_INVAL; return (EINVAL); } if ((ii->ii_bus_speed != IEC61883_S100) && (ii->ii_bus_speed != IEC61883_S200) && (ii->ii_bus_speed != IEC61883_S400)) { - TNF_PROBE_0(av1394_ic_validate_init_params_speed_error, - AV1394_TNF_ISOCH_ERROR, ""); ii->ii_error = IEC61883_ERR_INVAL; return (EINVAL); } if (ii->ii_channel == 0) { - TNF_PROBE_0(av1394_ic_validate_init_params_chan_error, - AV1394_TNF_ISOCH_ERROR, ""); ii->ii_error = IEC61883_ERR_INVAL; return (EINVAL); } if ((ii->ii_flags & IEC61883_PRIV_ISOCH_NOALLOC) && !av1394_ic_onebit(ii->ii_channel)) { - TNF_PROBE_0(av1394_ic_validate_init_params_chan_onebit_error, - AV1394_TNF_ISOCH_ERROR, ""); ii->ii_error = IEC61883_ERR_INVAL; return (EINVAL); } @@ -316,15 +275,11 @@ av1394_ic_validate_init_params(iec61883_isoch_init_t *ii) (ii->ii_rate_n != IEC61883_RATE_N_DV_PAL)) && ((ii->ii_rate_d <= 0) || (ii->ii_rate_n < 0) || ((ii->ii_rate_n != 0) && (ii->ii_rate_d / ii->ii_rate_n < 2)))) { - TNF_PROBE_0(av1394_ic_validate_init_params_rate_error, - AV1394_TNF_ISOCH_ERROR, ""); ii->ii_error = IEC61883_ERR_INVAL; return (EINVAL); } if (AV1394_TS_MODE_GET_OFF(ii->ii_ts_mode) + AV1394_TS_MODE_GET_SIZE(ii->ii_ts_mode) > ii->ii_pkt_size) { - TNF_PROBE_0(av1394_ic_validate_init_params_ts_error, - AV1394_TNF_ISOCH_ERROR, ""); ii->ii_error = IEC61883_ERR_INVAL; return (EINVAL); } @@ -389,10 +344,7 @@ av1394_ic_alloc_channel(av1394_ic_t *icp, uint64_t mask, int *num) ret = t1394_alloc_isoch_single(avp->av_t1394_hdl, &sii, 0, &so, &icp->ic_sii_hdl, &result); - if (ret != DDI_SUCCESS) { - TNF_PROBE_1(av1394_ic_alloc_channel_error, - AV1394_TNF_ISOCH_ERROR, "", tnf_int, result, result); - } else { + if (ret == DDI_SUCCESS) { *num = so.channel_num; } return (ret); @@ -436,16 +388,11 @@ av1394_ic_alloc_pool(av1394_isoch_pool_t *pool, size_t framesz, int cnt, int i; int ret; - AV1394_TNF_ENTER(av1394_ic_alloc_pool); - totalsz = framesz * cnt; ASSERT(totalsz > 0); /* request should be reasonable */ if (btopr(totalsz) > physmem / AV1394_MEM_MAX_PERCENT) { - TNF_PROBE_0(av1394_ic_alloc_pool_error_physmem, - AV1394_TNF_ISOCH_ERROR, ""); - AV1394_TNF_EXIT(av1394_ic_alloc_pool); return (0); } @@ -476,8 +423,6 @@ av1394_ic_alloc_pool(av1394_isoch_pool_t *pool, size_t framesz, int cnt, seg->is_kaddr = ddi_umem_alloc(seg->is_umem_size, DDI_UMEM_SLEEP, &seg->is_umem_cookie); if (seg->is_kaddr == NULL) { - TNF_PROBE_0(av1394_ic_alloc_pool_error_umem_alloc, - AV1394_TNF_ISOCH_ERROR, ""); break; } seg->is_size = segsz; @@ -490,13 +435,10 @@ av1394_ic_alloc_pool(av1394_isoch_pool_t *pool, size_t framesz, int cnt, /* number of frames the pool can hold */ ret = pool->ip_size / framesz; if (ret < mincnt) { - TNF_PROBE_0(av1394_ic_alloc_pool_error_mincnt, - AV1394_TNF_ISOCH_ERROR, ""); av1394_ic_free_pool(pool); ret = 0; } - AV1394_TNF_EXIT(av1394_ic_alloc_pool); return (ret); } @@ -505,8 +447,6 @@ av1394_ic_free_pool(av1394_isoch_pool_t *pool) { int i; - AV1394_TNF_ENTER(av1394_ic_free_pool); - if (pool->ip_seg != NULL) { for (i = 0; i < pool->ip_nsegs; i++) { ddi_umem_free(pool->ip_seg[i].is_umem_cookie); @@ -514,8 +454,6 @@ av1394_ic_free_pool(av1394_isoch_pool_t *pool) kmem_free(pool->ip_seg, pool->ip_alloc_size); pool->ip_seg = NULL; } - - AV1394_TNF_EXIT(av1394_ic_free_pool); } int @@ -528,8 +466,6 @@ av1394_ic_dma_setup(av1394_ic_t *icp, av1394_isoch_pool_t *pool) int i; int j; - AV1394_TNF_ENTER(av1394_ic_dma_setup); - dma_dir = (icp->ic_dir == AV1394_IR) ? DDI_DMA_READ : DDI_DMA_WRITE; /* * Alloc and bind a DMA handle for each segment. @@ -544,10 +480,7 @@ av1394_ic_dma_setup(av1394_ic_t *icp, av1394_isoch_pool_t *pool) &avp->av_attachinfo.dma_attr, DDI_DMA_DONTWAIT, NULL, &isp->is_dma_hdl); if (ret != DDI_SUCCESS) { - TNF_PROBE_0(av1394_ic_dma_setup_error_alloc_hdl, - AV1394_TNF_ISOCH_ERROR, ""); av1394_ic_dma_cleanup(icp, pool); - AV1394_TNF_EXIT(av1394_ic_dma_setup); return (ret); } @@ -557,18 +490,12 @@ av1394_ic_dma_setup(av1394_ic_t *icp, av1394_isoch_pool_t *pool) &isp->is_dma_cookie[0], &isp->is_dma_ncookies); if (ret != DDI_DMA_MAPPED) { - TNF_PROBE_0(av1394_ic_dma_setup_error_bind_hdl, - AV1394_TNF_ISOCH_ERROR, ""); av1394_ic_dma_cleanup(icp, pool); - AV1394_TNF_EXIT(av1394_ic_dma_setup); return (DDI_FAILURE); } if (isp->is_dma_ncookies > COOKIES) { - TNF_PROBE_0(av1394_ic_dma_setup_error_ncookies, - AV1394_TNF_ISOCH_ERROR, ""); av1394_ic_dma_cleanup(icp, pool); - AV1394_TNF_EXIT(av1394_ic_dma_setup); return (DDI_FAILURE); } @@ -577,7 +504,6 @@ av1394_ic_dma_setup(av1394_ic_t *icp, av1394_isoch_pool_t *pool) &isp->is_dma_cookie[j]); } - AV1394_TNF_EXIT(av1394_ic_dma_setup); return (DDI_SUCCESS); } @@ -588,8 +514,6 @@ av1394_ic_dma_cleanup(av1394_ic_t *icp, av1394_isoch_pool_t *pool) av1394_isoch_seg_t *seg; int i; - AV1394_TNF_ENTER(av1394_ic_dma_cleanup); - for (i = 0; i < pool->ip_nsegs; i++) { seg = &pool->ip_seg[i]; if (seg->is_dma_hdl != NULL) { @@ -599,8 +523,6 @@ av1394_ic_dma_cleanup(av1394_ic_t *icp, av1394_isoch_pool_t *pool) ddi_dma_free_handle(&seg->is_dma_hdl); } } - - AV1394_TNF_EXIT(av1394_ic_dma_cleanup); } /* @@ -669,13 +591,9 @@ static void av1394_ic_rsrc_fail(t1394_isoch_single_handle_t t1394_sii_hdl, opaque_t arg, t1394_isoch_rsrc_error_t fail_args) { - AV1394_TNF_ENTER(av1394_ic_rsrc_fail); - /* XXX this could be handled more gracefully */ cmn_err(CE_CONT, "av1394: can't reallocate isochronous resources" " after bus reset\n"); - - AV1394_TNF_EXIT(av1394_ic_rsrc_fail); } /* diff --git a/usr/src/uts/common/io/1394/targets/av1394/av1394_isoch_recv.c b/usr/src/uts/common/io/1394/targets/av1394/av1394_isoch_recv.c index fdce717a68..e9c599cea2 100644 --- a/usr/src/uts/common/io/1394/targets/av1394/av1394_isoch_recv.c +++ b/usr/src/uts/common/io/1394/targets/av1394/av1394_isoch_recv.c @@ -62,12 +62,6 @@ int av1394_ir_hiwat_sub = 2; int av1394_ir_lowat_sub = 3; int av1394_ir_dump_ixl = 0; -#define AV1394_TNF_ENTER(func) \ - TNF_PROBE_0_DEBUG(func##_enter, AV1394_TNF_ISOCH_STACK, ""); - -#define AV1394_TNF_EXIT(func) \ - TNF_PROBE_0_DEBUG(func##_exit, AV1394_TNF_ISOCH_STACK, ""); - int av1394_ir_init(av1394_ic_t *icp, int *error) { @@ -75,13 +69,10 @@ av1394_ir_init(av1394_ic_t *icp, int *error) av1394_isoch_pool_t *pool = &irp->ir_data_pool; int nframes; - AV1394_TNF_ENTER(av1394_ir_init); - nframes = av1394_ic_alloc_pool(pool, icp->ic_framesz, icp->ic_nframes, AV1394_IR_NFRAMES_MIN); if (nframes == 0) { *error = IEC61883_ERR_NOMEM; - AV1394_TNF_EXIT(av1394_ir_init); return (EINVAL); } mutex_enter(&icp->ic_mutex); @@ -93,7 +84,6 @@ av1394_ir_init(av1394_ic_t *icp, int *error) mutex_exit(&icp->ic_mutex); *error = IEC61883_ERR_NOMEM; av1394_ir_cleanup(icp, 1); - AV1394_TNF_EXIT(av1394_ir_init); return (EINVAL); } @@ -101,7 +91,6 @@ av1394_ir_init(av1394_ic_t *icp, int *error) mutex_exit(&icp->ic_mutex); *error = IEC61883_ERR_NOMEM; av1394_ir_cleanup(icp, 2); - AV1394_TNF_EXIT(av1394_ir_init); return (EINVAL); } mutex_exit(&icp->ic_mutex); @@ -109,22 +98,16 @@ av1394_ir_init(av1394_ic_t *icp, int *error) if (av1394_ir_alloc_isoch_dma(icp) != DDI_SUCCESS) { *error = IEC61883_ERR_NOMEM; av1394_ir_cleanup(icp, 3); - AV1394_TNF_EXIT(av1394_ir_init); return (EINVAL); } - AV1394_TNF_EXIT(av1394_ir_init); return (0); } void av1394_ir_fini(av1394_ic_t *icp) { - AV1394_TNF_ENTER(av1394_ir_fini); - av1394_ir_cleanup(icp, AV1394_CLEANUP_LEVEL_MAX); - - AV1394_TNF_ENTER(av1394_ir_fini); } int @@ -137,8 +120,6 @@ av1394_ir_start(av1394_ic_t *icp) int err; int ret = 0; - AV1394_TNF_ENTER(av1394_ir_start); - mutex_enter(&icp->ic_mutex); if (icp->ic_state != AV1394_IC_IDLE) { mutex_exit(&icp->ic_mutex); @@ -159,12 +140,9 @@ av1394_ir_start(av1394_ic_t *icp) icp->ic_state = AV1394_IC_DMA; mutex_exit(&icp->ic_mutex); } else { - TNF_PROBE_1(av1394_ir_start_error, AV1394_TNF_ISOCH_ERROR, "", - tnf_int, result, result); ret = EIO; } - AV1394_TNF_EXIT(av1394_ir_start); return (ret); } @@ -173,8 +151,6 @@ av1394_ir_stop(av1394_ic_t *icp) { av1394_inst_t *avp = icp->ic_avp; - AV1394_TNF_ENTER(av1394_ir_stop); - mutex_enter(&icp->ic_mutex); if (icp->ic_state != AV1394_IC_IDLE) { mutex_exit(&icp->ic_mutex); @@ -184,7 +160,6 @@ av1394_ir_stop(av1394_ic_t *icp) } mutex_exit(&icp->ic_mutex); - AV1394_TNF_EXIT(av1394_ir_stop); return (0); } @@ -200,8 +175,6 @@ av1394_ir_recv(av1394_ic_t *icp, iec61883_recv_t *recv) /* check arguments */ if ((idx < 0) || (idx >= icp->ic_nframes) || (cnt < 0) || (cnt > icp->ic_nframes)) { - TNF_PROBE_2(av1394_ir_recv_error_args, AV1394_TNF_ISOCH_ERROR, - "", tnf_int, idx, idx, tnf_int, cnt, cnt); return (EINVAL); } @@ -229,8 +202,6 @@ av1394_ir_read(av1394_ic_t *icp, struct uio *uiop) int ret = 0; int empty_cnt; - AV1394_TNF_ENTER(av1394_ir_read); - mutex_enter(&icp->ic_mutex); while (uiop->uio_resid) { /* wait for full frames, if necessary */ @@ -240,7 +211,6 @@ av1394_ir_read(av1394_ic_t *icp, struct uio *uiop) &irp->ir_read_idx, &irp->ir_read_cnt); if (ret != 0) { mutex_exit(&icp->ic_mutex); - AV1394_TNF_EXIT(av1394_ir_read); return (ret); } } @@ -260,7 +230,6 @@ av1394_ir_read(av1394_ic_t *icp, struct uio *uiop) } mutex_exit(&icp->ic_mutex); - AV1394_TNF_EXIT(av1394_ir_read); return (ret); } @@ -340,8 +309,6 @@ av1394_ir_build_ixl(av1394_ic_t *icp) int fi; /* frame index */ int bi; /* buffer index */ - AV1394_TNF_ENTER(av1394_ir_build_ixl); - /* allocate space for IXL data blocks */ irp->ir_ixl_data = kmem_zalloc(icp->ic_nframes * sizeof (av1394_ir_ixl_data_t), KM_SLEEP); @@ -503,7 +470,6 @@ av1394_ir_build_ixl(av1394_ic_t *icp) av1394_ic_ixl_dump(irp->ir_ixlp); } - AV1394_TNF_EXIT(av1394_ir_build_ixl); return (DDI_SUCCESS); } @@ -557,8 +523,6 @@ av1394_ir_destroy_ixl(av1394_ic_t *icp) { av1394_ir_t *irp = &icp->ic_ir; - AV1394_TNF_ENTER(av1394_ir_destroy_ixl); - mutex_enter(&icp->ic_mutex); kmem_free(irp->ir_ixl_buf, irp->ir_ixl_nbufs * sizeof (ixl1394_xfer_buf_t)); @@ -569,8 +533,6 @@ av1394_ir_destroy_ixl(av1394_ic_t *icp) irp->ir_ixl_buf = NULL; irp->ir_ixl_data = NULL; mutex_exit(&icp->ic_mutex); - - AV1394_TNF_EXIT(av1394_ir_destroy_ixl); } static int @@ -582,8 +544,6 @@ av1394_ir_alloc_isoch_dma(av1394_ic_t *icp) int result; int ret; - AV1394_TNF_ENTER(av1394_ir_alloc_isoch_dma); - di.ixlp = irp->ir_ixlp; di.channel_num = icp->ic_num; di.global_callback_arg = icp; @@ -591,13 +551,9 @@ av1394_ir_alloc_isoch_dma(av1394_ic_t *icp) di.isoch_dma_stopped = av1394_ir_dma_stopped_cb; di.idma_evt_arg = icp; - if ((ret = t1394_alloc_isoch_dma(avp->av_t1394_hdl, &di, 0, - &icp->ic_isoch_hdl, &result)) != DDI_SUCCESS) { - TNF_PROBE_1(av1394_ir_alloc_isoch_dma_error, - AV1394_TNF_ISOCH_ERROR, "", tnf_int, result, result); - } + ret = t1394_alloc_isoch_dma(avp->av_t1394_hdl, &di, 0, + &icp->ic_isoch_hdl, &result); - AV1394_TNF_EXIT(av1394_ir_alloc_isoch_dma); return (ret); } @@ -606,11 +562,7 @@ av1394_ir_free_isoch_dma(av1394_ic_t *icp) { av1394_inst_t *avp = icp->ic_avp; - AV1394_TNF_ENTER(av1394_ir_free_isoch_rsrc); - t1394_free_isoch_dma(avp->av_t1394_hdl, 0, &icp->ic_isoch_hdl); - - AV1394_TNF_EXIT(av1394_ir_free_isoch_rsrc); } static void @@ -633,8 +585,6 @@ av1394_ir_ixl_frame_cb(opaque_t arg, struct ixl1394_callback *cb) av1394_isoch_t *ip = &icp->ic_avp->av_i; av1394_ir_t *irp = &icp->ic_ir; - AV1394_TNF_ENTER(av1394_ir_ixl_frame_cb); - mutex_enter(&ip->i_mutex); mutex_enter(&icp->ic_mutex); if (irp->ir_nfull < icp->ic_nframes) { @@ -653,8 +603,6 @@ av1394_ir_ixl_frame_cb(opaque_t arg, struct ixl1394_callback *cb) } mutex_exit(&icp->ic_mutex); mutex_exit(&ip->i_mutex); - - AV1394_TNF_EXIT(av1394_ir_ixl_frame_cb); } /* @@ -672,8 +620,6 @@ av1394_ir_overflow(av1394_ic_t *icp) int err; int result; - AV1394_TNF_ENTER(av1394_ir_overflow); - /* * in the circular IXL chain overflow means overwriting the least * recent data. to avoid that, we suspend the transfer by NULL'ing @@ -699,13 +645,7 @@ av1394_ir_overflow(av1394_ic_t *icp) if (err == DDI_SUCCESS) { irp->ir_overflow_idx = idx; icp->ic_state = AV1394_IC_SUSPENDED; - } else { - TNF_PROBE_2(av1394_ir_overflow_error_update, - AV1394_TNF_ISOCH_ERROR, "", tnf_int, err, err, - tnf_int, result, result); } - - AV1394_TNF_EXIT(av1394_ir_overflow); } /* @@ -723,8 +663,6 @@ av1394_ir_overflow_resume(av1394_ic_t *icp) int err; int result; - AV1394_TNF_ENTER(av1394_ir_overflow_resume); - /* * restore the jump command we NULL'ed in av1394_ir_overflow() */ @@ -748,13 +686,7 @@ av1394_ir_overflow_resume(av1394_ic_t *icp) if (err == DDI_SUCCESS) { icp->ic_state = AV1394_IC_DMA; - } else { - TNF_PROBE_2(av1394_ir_overflow_resume_error_update, - AV1394_TNF_ISOCH_ERROR, "", tnf_int, err, err, - tnf_int, result, result); } - - AV1394_TNF_EXIT(av1394_ir_overflow_resume); } /*ARGSUSED*/ @@ -764,13 +696,9 @@ av1394_ir_dma_stopped_cb(t1394_isoch_dma_handle_t t1394_idma_hdl, { av1394_ic_t *icp = idma_evt_arg; - AV1394_TNF_ENTER(av1394_ir_dma_stopped_cb); - mutex_enter(&icp->ic_mutex); icp->ic_state = AV1394_IC_IDLE; mutex_exit(&icp->ic_mutex); - - AV1394_TNF_EXIT(av1394_ir_dma_stopped_cb); } @@ -788,8 +716,6 @@ av1394_ir_add_frames(av1394_ic_t *icp, int idx, int cnt) /* can only add to the tail */ if (idx != ((irp->ir_last_empty + 1) % icp->ic_nframes)) { - TNF_PROBE_1(av1394_ir_add_frames_error, - AV1394_TNF_ISOCH_ERROR, "", tnf_int, idx, idx); return (EINVAL); } diff --git a/usr/src/uts/common/io/1394/targets/av1394/av1394_isoch_xmit.c b/usr/src/uts/common/io/1394/targets/av1394/av1394_isoch_xmit.c index 8dca362c1c..7d32ff068d 100644 --- a/usr/src/uts/common/io/1394/targets/av1394/av1394_isoch_xmit.c +++ b/usr/src/uts/common/io/1394/targets/av1394/av1394_isoch_xmit.c @@ -81,12 +81,6 @@ int av1394_it_start_thre = 3; /* xmit start threshold */ int av1394_it_syt_off = 3; /* SYT offset in cycles */ int av1394_it_dump_ixl = 0; -#define AV1394_TNF_ENTER(func) \ - TNF_PROBE_0_DEBUG(func##_enter, AV1394_TNF_ISOCH_STACK, ""); - -#define AV1394_TNF_EXIT(func) \ - TNF_PROBE_0_DEBUG(func##_exit, AV1394_TNF_ISOCH_STACK, ""); - int av1394_it_init(av1394_ic_t *icp, int *error) { @@ -94,13 +88,10 @@ av1394_it_init(av1394_ic_t *icp, int *error) av1394_isoch_pool_t *pool = &itp->it_data_pool; int nframes; - AV1394_TNF_ENTER(av1394_it_init); - nframes = av1394_ic_alloc_pool(pool, icp->ic_framesz, icp->ic_nframes, AV1394_IT_NFRAMES_MIN); if (nframes == 0) { *error = IEC61883_ERR_NOMEM; - AV1394_TNF_EXIT(av1394_it_init); return (EINVAL); } mutex_enter(&icp->ic_mutex); @@ -115,7 +106,6 @@ av1394_it_init(av1394_ic_t *icp, int *error) mutex_exit(&icp->ic_mutex); *error = IEC61883_ERR_NOMEM; av1394_it_cleanup(icp, 1); - AV1394_TNF_EXIT(av1394_it_init); return (EINVAL); } @@ -123,7 +113,6 @@ av1394_it_init(av1394_ic_t *icp, int *error) mutex_exit(&icp->ic_mutex); *error = IEC61883_ERR_NOMEM; av1394_it_cleanup(icp, 2); - AV1394_TNF_EXIT(av1394_it_init); return (EINVAL); } mutex_exit(&icp->ic_mutex); @@ -131,22 +120,16 @@ av1394_it_init(av1394_ic_t *icp, int *error) if (av1394_it_alloc_isoch_dma(icp) != DDI_SUCCESS) { *error = IEC61883_ERR_NOMEM; av1394_it_cleanup(icp, 3); - AV1394_TNF_EXIT(av1394_it_init); return (EINVAL); } - AV1394_TNF_EXIT(av1394_it_init); return (0); } void av1394_it_fini(av1394_ic_t *icp) { - AV1394_TNF_ENTER(av1394_it_fini); - av1394_it_cleanup(icp, AV1394_CLEANUP_LEVEL_MAX); - - AV1394_TNF_ENTER(av1394_it_fini); } int @@ -155,8 +138,6 @@ av1394_it_start(av1394_ic_t *icp) av1394_it_t *itp = &icp->ic_it; int ret = 0; - AV1394_TNF_ENTER(av1394_it_start); - mutex_enter(&icp->ic_mutex); ASSERT(icp->ic_state == AV1394_IC_IDLE); @@ -166,7 +147,6 @@ av1394_it_start(av1394_ic_t *icp) } mutex_exit(&icp->ic_mutex); - AV1394_TNF_EXIT(av1394_it_start); return (ret); } @@ -186,8 +166,6 @@ av1394_it_start_common(av1394_ic_t *icp) if (err == DDI_SUCCESS) { icp->ic_state = AV1394_IC_DMA; } else { - TNF_PROBE_1(av1394_it_start_common_error, - AV1394_TNF_ISOCH_ERROR, "", tnf_int, result, result); ret = EIO; } @@ -201,8 +179,6 @@ av1394_it_stop(av1394_ic_t *icp) av1394_inst_t *avp = icp->ic_avp; av1394_it_t *itp = &icp->ic_it; - AV1394_TNF_ENTER(av1394_it_stop); - mutex_enter(&icp->ic_mutex); if (icp->ic_state != AV1394_IC_IDLE) { mutex_exit(&icp->ic_mutex); @@ -217,7 +193,6 @@ av1394_it_stop(av1394_ic_t *icp) } mutex_exit(&icp->ic_mutex); - AV1394_TNF_EXIT(av1394_it_stop); return (0); } @@ -235,8 +210,6 @@ av1394_it_xmit(av1394_ic_t *icp, iec61883_xmit_t *xmit) /* check arguments */ if ((idx < 0) || (cnt < 0) || (cnt > itp->it_nempty)) { mutex_exit(&icp->ic_mutex); - TNF_PROBE_2(av1394_it_xmit_error_args, AV1394_TNF_ISOCH_ERROR, - "", tnf_int, idx, idx, tnf_int, cnt, cnt); return (EINVAL); } @@ -275,8 +248,6 @@ av1394_it_write(av1394_ic_t *icp, struct uio *uiop) int full_cnt; int miss_cnt; - AV1394_TNF_ENTER(av1394_it_write); - mutex_enter(&icp->ic_mutex); dv = (axp->ax_fmt & AV1394_ISOCH_AUTOXMIT_DV); @@ -316,14 +287,12 @@ av1394_it_write(av1394_ic_t *icp, struct uio *uiop) (itp->it_nfull >= itp->it_start_thre)) { if ((ret = av1394_it_start_common(icp)) != 0) { mutex_exit(&icp->ic_mutex); - AV1394_TNF_EXIT(av1394_it_write); return (ret); } } } mutex_exit(&icp->ic_mutex); - AV1394_TNF_EXIT(av1394_it_write); return (ret); } @@ -365,11 +334,8 @@ av1394_it_bld_ixl(av1394_ic_t *icp) av1394_it_t *itp = &icp->ic_it; int ret; - AV1394_TNF_ENTER(av1394_it_bld_ixl); - /* data block */ if ((ret = av1394_it_ixl_bld_data(icp)) != DDI_SUCCESS) { - AV1394_TNF_EXIT(av1394_it_bld_ixl); return (ret); } @@ -387,7 +353,6 @@ av1394_it_bld_ixl(av1394_ic_t *icp) av1394_ic_ixl_dump(itp->it_ixlp); } - AV1394_TNF_EXIT(av1394_it_bld_ixl); return (ret); } @@ -737,8 +702,6 @@ av1394_it_alloc_isoch_dma(av1394_ic_t *icp) int result; int ret; - AV1394_TNF_ENTER(av1394_it_alloc_isoch_dma); - di.ixlp = itp->it_ixlp; di.channel_num = icp->ic_num; di.idma_options = ID1394_TALK; @@ -754,13 +717,9 @@ av1394_it_alloc_isoch_dma(av1394_ic_t *icp) di.isoch_dma_stopped = av1394_it_dma_stopped_cb; di.idma_evt_arg = icp; - if ((ret = t1394_alloc_isoch_dma(avp->av_t1394_hdl, &di, 0, - &icp->ic_isoch_hdl, &result)) != DDI_SUCCESS) { - TNF_PROBE_1(av1394_it_alloc_isoch_dma_error, - AV1394_TNF_ISOCH_ERROR, "", tnf_int, result, result); - } + ret = t1394_alloc_isoch_dma(avp->av_t1394_hdl, &di, 0, + &icp->ic_isoch_hdl, &result); - AV1394_TNF_EXIT(av1394_it_alloc_isoch_dma); return (ret); } @@ -769,11 +728,7 @@ av1394_it_free_isoch_dma(av1394_ic_t *icp) { av1394_inst_t *avp = icp->ic_avp; - AV1394_TNF_ENTER(av1394_it_free_isoch_rsrc); - t1394_free_isoch_dma(avp->av_t1394_hdl, 0, &icp->ic_isoch_hdl); - - AV1394_TNF_EXIT(av1394_it_free_isoch_rsrc); } static void @@ -797,8 +752,6 @@ av1394_it_ixl_begin_cb(opaque_t arg, struct ixl1394_callback *cb) uint16_t syt; int first; - AV1394_TNF_ENTER(av1394_it_ixl_begin_cb); - mutex_enter(&icp->ic_mutex); /* save initial timestamp value */ itp->it_ts_init.ts_syt = av1394_it_ts_cyc2syt(*cycp); @@ -809,7 +762,6 @@ av1394_it_ixl_begin_cb(opaque_t arg, struct ixl1394_callback *cb) if ((itp->it_nfull <= 0) || (AV1394_TS_MODE_GET_SIZE(icp->ic_param.cp_ts_mode) == 0)) { mutex_exit(&icp->ic_mutex); - AV1394_TNF_EXIT(av1394_it_ixl_begin_cb); return; } ASSERT(itp->it_nfull <= icp->ic_nframes); @@ -820,8 +772,6 @@ av1394_it_ixl_begin_cb(opaque_t arg, struct ixl1394_callback *cb) icp->ic_nframes; av1394_it_update_frame_syt(icp, first, itp->it_nfull, syt); mutex_exit(&icp->ic_mutex); - - AV1394_TNF_EXIT(av1394_it_ixl_begin_cb); } /*ARGSUSED*/ @@ -830,11 +780,9 @@ av1394_it_ixl_buf_cb(opaque_t arg, struct ixl1394_callback *cb) { av1394_it_ixl_buf_t *bp = cb->callback_arg; - AV1394_TNF_ENTER(av1394_it_ixl_buf_cb); if (bp->tb_flags & AV1394_IT_IXL_BUF_EOF) { av1394_it_ixl_eof_cb(bp); } - AV1394_TNF_EXIT(av1394_it_ixl_buf_cb); } static void @@ -844,8 +792,6 @@ av1394_it_ixl_eof_cb(av1394_it_ixl_buf_t *bp) av1394_isoch_t *ip = &icp->ic_avp->av_i; av1394_it_t *itp = &icp->ic_it; - AV1394_TNF_ENTER(av1394_it_ixl_eof_cb); - mutex_enter(&ip->i_mutex); mutex_enter(&icp->ic_mutex); if (itp->it_nempty < icp->ic_nframes) { @@ -861,8 +807,6 @@ av1394_it_ixl_eof_cb(av1394_it_ixl_buf_t *bp) } mutex_exit(&icp->ic_mutex); mutex_exit(&ip->i_mutex); - - AV1394_TNF_EXIT(av1394_it_ixl_eof_cb); } void @@ -877,8 +821,6 @@ av1394_it_underrun(av1394_ic_t *icp) int err; int result; - AV1394_TNF_ENTER(av1394_it_underrun); - /* * update the last full frame's jump to NULL */ @@ -904,13 +846,7 @@ av1394_it_underrun(av1394_ic_t *icp) itp->it_underrun_idx = idx; icp->ic_state = AV1394_IC_SUSPENDED; cv_signal(&icp->ic_xfer_cv); - } else { - TNF_PROBE_2(av1394_it_underrun_error_update, - AV1394_TNF_ISOCH_ERROR, "", tnf_int, err, err, - tnf_int, result, result); } - - AV1394_TNF_EXIT(av1394_it_underrun); } /* @@ -929,8 +865,6 @@ av1394_it_underrun_resume(av1394_ic_t *icp) int err; int result; - AV1394_TNF_ENTER(av1394_it_underrun_resume); - /* * resuming the transfer it a lot like starting the transfer: * first the IXL begin block needs to be executed, then the rest @@ -963,10 +897,6 @@ av1394_it_underrun_resume(av1394_ic_t *icp) mutex_enter(&icp->ic_mutex); if (err != DDI_SUCCESS) { - TNF_PROBE_2(av1394_it_underrun_resume_error_update1, - AV1394_TNF_ISOCH_ERROR, "", tnf_int, err, err, - tnf_int, result, result); - AV1394_TNF_EXIT(av1394_it_underrun_resume); return (EIO); } @@ -990,16 +920,11 @@ av1394_it_underrun_resume(av1394_ic_t *icp) mutex_enter(&icp->ic_mutex); if (err != DDI_SUCCESS) { - TNF_PROBE_2(av1394_it_underrun_resume_error_update2, - AV1394_TNF_ISOCH_ERROR, "", tnf_int, err, err, - tnf_int, result, result); - AV1394_TNF_EXIT(av1394_it_underrun_resume); return (EIO); } icp->ic_state = AV1394_IC_DMA; - AV1394_TNF_EXIT(av1394_it_underrun_resume); return (0); } @@ -1010,13 +935,9 @@ av1394_it_dma_stopped_cb(t1394_isoch_dma_handle_t t1394_idma_hdl, { av1394_ic_t *icp = idma_evt_arg; - AV1394_TNF_ENTER(av1394_it_dma_stopped_cb); - mutex_enter(&icp->ic_mutex); icp->ic_state = AV1394_IC_IDLE; mutex_exit(&icp->ic_mutex); - - AV1394_TNF_EXIT(av1394_it_dma_stopped_cb); } @@ -1038,8 +959,6 @@ av1394_it_add_frames(av1394_ic_t *icp, int idx, int cnt) /* can only add to tail */ if (idx != ((itp->it_last_full + 1) % icp->ic_nframes)) { - TNF_PROBE_1(av1394_it_add_frames_error, - AV1394_TNF_ISOCH_ERROR, "", tnf_int, idx, idx); return (EINVAL); } diff --git a/usr/src/uts/common/io/1394/targets/dcam1394/dcam.c b/usr/src/uts/common/io/1394/targets/dcam1394/dcam.c index c300e987d8..924b6344b4 100644 --- a/usr/src/uts/common/io/1394/targets/dcam1394/dcam.c +++ b/usr/src/uts/common/io/1394/targets/dcam1394/dcam.c @@ -52,7 +52,6 @@ #include <sys/uio.h> #include <sys/devops.h> #include <sys/1394/t1394.h> -#include <sys/tnf_probe.h> #include <sys/dcam/dcam1394_io.h> #include <sys/1394/targets/dcam1394/dcam.h> @@ -60,12 +59,6 @@ #include <sys/1394/targets/dcam1394/dcam_param.h> #include <sys/1394/targets/dcam1394/dcam_frame.h> -#ifndef NPROBE -extern int tnf_mod_load(void); -extern int tnf_mod_unload(struct modlinkage *mlp); -#endif /* ! NPROBE */ - - /* for power management (we have only one component) */ static char *dcam_pmc[] = { "NAME=dcam1394", @@ -155,18 +148,8 @@ _init(void) return (err); } -#ifndef NPROBE - (void) tnf_mod_load(); -#endif /* ! NPROBE */ - if (err = mod_install(&modlinkage)) { - -#ifndef NPROBE - (void) tnf_mod_unload(&modlinkage); -#endif /* ! NPROBE */ - ddi_soft_state_fini(&dcam_state_p); - } return (err); @@ -192,10 +175,6 @@ _fini(void) return (err); } -#ifndef NPROBE - (void) tnf_mod_unload(&modlinkage); -#endif /* ! NPROBE */ - ddi_soft_state_fini(&dcam_state_p); return (err); diff --git a/usr/src/uts/common/io/1394/targets/dcam1394/dcam_frame.c b/usr/src/uts/common/io/1394/targets/dcam1394/dcam_frame.c index e7caf28a01..056df0b7c8 100644 --- a/usr/src/uts/common/io/1394/targets/dcam1394/dcam_frame.c +++ b/usr/src/uts/common/io/1394/targets/dcam1394/dcam_frame.c @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * dcam_frame.c * @@ -38,7 +36,6 @@ #include <sys/cmn_err.h> #include <sys/1394/targets/dcam1394/dcam.h> #include <sys/1394/targets/dcam1394/dcam_frame.h> -#include <sys/tnf_probe.h> #include <sys/dcam/dcam1394_io.h> #include <sys/1394/targets/dcam1394/dcam_reg.h> diff --git a/usr/src/uts/common/io/1394/targets/dcam1394/dcam_param.c b/usr/src/uts/common/io/1394/targets/dcam1394/dcam_param.c index 445d3ae04d..1770dca6ac 100644 --- a/usr/src/uts/common/io/1394/targets/dcam1394/dcam_param.c +++ b/usr/src/uts/common/io/1394/targets/dcam1394/dcam_param.c @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * dcam_param.c * @@ -35,7 +33,6 @@ #include <sys/1394/targets/dcam1394/dcam.h> #include <sys/1394/targets/dcam1394/dcam_param.h> #include <sys/1394/targets/dcam1394/dcam_reg.h> -#include <sys/tnf_probe.h> /* index by vid_mode */ int g_frame_num_bytes[] = { diff --git a/usr/src/uts/common/io/1394/targets/dcam1394/dcam_reg.c b/usr/src/uts/common/io/1394/targets/dcam1394/dcam_reg.c index 096a632291..c35881f1f7 100644 --- a/usr/src/uts/common/io/1394/targets/dcam1394/dcam_reg.c +++ b/usr/src/uts/common/io/1394/targets/dcam1394/dcam_reg.c @@ -24,15 +24,12 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * dcam_reg.c * * dcam1394 driver. Control register access support. */ -#include <sys/tnf_probe.h> #include <sys/1394/targets/dcam1394/dcam_reg.h> diff --git a/usr/src/uts/common/io/1394/targets/dcam1394/dcam_ring_buff.c b/usr/src/uts/common/io/1394/targets/dcam1394/dcam_ring_buff.c index 0c0fe0aba9..4f1214d5e1 100644 --- a/usr/src/uts/common/io/1394/targets/dcam1394/dcam_ring_buff.c +++ b/usr/src/uts/common/io/1394/targets/dcam1394/dcam_ring_buff.c @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * dcam_ring_buff.c * @@ -37,7 +35,6 @@ #include <sys/ddidmareq.h> #include <sys/types.h> #include <sys/inttypes.h> -#include <sys/tnf_probe.h> #include <sys/cmn_err.h> #include <sys/1394/targets/dcam1394/dcam.h> diff --git a/usr/src/uts/common/io/fibre-channel/ulp/fcip.c b/usr/src/uts/common/io/fibre-channel/ulp/fcip.c index 416bc3cb55..3c14f5ae31 100644 --- a/usr/src/uts/common/io/fibre-channel/ulp/fcip.c +++ b/usr/src/uts/common/io/fibre-channel/ulp/fcip.c @@ -116,13 +116,6 @@ #include <sys/fibre-channel/impl/fc_ulpif.h> #include <sys/fibre-channel/ulp/fcip.h> -/* - * TNF Probe/trace facility include - */ -#if defined(lint) || defined(FCIP_TNF_ENABLED) -#include <sys/tnf_probe.h> -#endif - #define FCIP_ESBALLOC /* @@ -614,8 +607,6 @@ _init(void) { int rval; - FCIP_TNF_LOAD(); - /* * Initialize the mutexs used by port attach and other callbacks. * The transport can call back into our port_attach_callback @@ -665,7 +656,6 @@ _init(void) rval = ENODEV; break; } - FCIP_TNF_UNLOAD(&modlinkage); return (rval); } @@ -675,12 +665,10 @@ _init(void) cv_destroy(&fcip_global_cv); rw_destroy(&fcipstruplock); (void) fc_ulp_remove(&fcip_modinfo); - FCIP_TNF_UNLOAD(&modlinkage); return (rval); } if ((rval = mod_install(&modlinkage)) != 0) { - FCIP_TNF_UNLOAD(&modlinkage); (void) fc_ulp_remove(&fcip_modinfo); mutex_destroy(&fcip_global_mutex); cv_destroy(&fcip_global_cv); @@ -743,8 +731,6 @@ _fini(void) cv_destroy(&fcip_global_cv); ddi_soft_state_fini(&fcip_softp); - FCIP_TNF_UNLOAD(&modlinkage); - return (rval); } @@ -792,9 +778,6 @@ fcip_port_attach(opaque_t ulp_handle, fc_ulp_port_info_t *port_info, */ ww_pn = &port_info->port_pwwn; - FCIP_TNF_PROBE_2((fcip_port_attach, "fcip io", /* CSTYLED */, - tnf_string, msg, "port id bits", - tnf_opaque, nport_id, ww_pn->w.nport_id)); FCIP_DEBUG(FCIP_DEBUG_ATTACH, (CE_NOTE, "port id bits: 0x%x", ww_pn->w.nport_id)); /* @@ -1025,9 +1008,6 @@ fcip_port_attach(opaque_t ulp_handle, fc_ulp_port_info_t *port_info, goto done; default: - FCIP_TNF_PROBE_2((fcip_port_attach, "fcip io", /* CSTYLED */, - tnf_string, msg, "unknown command type", - tnf_uint, cmd, cmd)); FCIP_DEBUG(FCIP_DEBUG_ATTACH, (CE_WARN, "unknown cmd type 0x%x in port_attach", cmd)); rval = FC_FAILURE; @@ -1280,10 +1260,6 @@ fcip_rt_update(struct fcip *fptr, fc_portmap_t *devlist, uint32_t listlen) fc_portmap_t *pmap; char wwn_buf[20]; - FCIP_TNF_PROBE_2((fcip_rt_update, "fcip io", /* CSTYLED */, - tnf_string, msg, "enter", - tnf_int, listlen, listlen)); - ASSERT(!mutex_owned(&fptr->fcip_mutex)); mutex_enter(&fptr->fcip_rt_mutex); @@ -1353,11 +1329,6 @@ add_new_entry: ASSERT(hash_bucket < FCIP_RT_HASH_ELEMS); - FCIP_TNF_PROBE_2((fcip_rt_update, "cfip io", /* CSTYLED */, - tnf_string, msg, - "add new entry", - tnf_int, hashbucket, hash_bucket)); - frp = (struct fcip_routing_table *) kmem_zalloc(sizeof (struct fcip_routing_table), KM_SLEEP); /* insert at beginning of hash bucket */ @@ -1405,9 +1376,6 @@ update_entry: (void) fcip_do_plogi(fptr, frp); } - FCIP_TNF_BYTE_ARRAY(fcip_rt_update, "fcip io", "detail", - "new wwn in rt", pwwn, - &frp->fcipr_pwwn, sizeof (la_wwn_t)); } mutex_exit(&fptr->fcip_rt_mutex); } @@ -1422,35 +1390,18 @@ fcip_lookup_rtable(struct fcip *fptr, la_wwn_t *wwn, int matchflag) struct fcip_routing_table *frp = NULL; int hash_bucket; - - FCIP_TNF_PROBE_1((fcip_lookup_rtable, "fcip io", /* CSTYLED */, - tnf_string, msg, "enter")); - FCIP_TNF_BYTE_ARRAY(fcip_lookup_rtable, "fcip io", "detail", - "rtable lookup for", wwn, - &wwn->raw_wwn, sizeof (la_wwn_t)); - FCIP_TNF_PROBE_2((fcip_lookup_rtable, "fcip io", /* CSTYLED */, - tnf_string, msg, "match by", - tnf_int, matchflag, matchflag)); - ASSERT(mutex_owned(&fptr->fcip_rt_mutex)); hash_bucket = FCIP_RT_HASH(wwn->raw_wwn); frp = fptr->fcip_rtable[hash_bucket]; while (frp != NULL) { - FCIP_TNF_BYTE_ARRAY(fcip_lookup_rtable, "fcip io", "detail", - "rtable entry", nwwn, - &(frp->fcipr_nwwn.raw_wwn), sizeof (la_wwn_t)); - if (fcip_wwn_compare(&frp->fcipr_pwwn, wwn, matchflag) == 0) { break; } frp = frp->fcipr_next; } - FCIP_TNF_PROBE_2((fcip_lookup_rtable, "fcip io", /* CSTYLED */, - tnf_string, msg, "lookup result", - tnf_opaque, frp, frp)); return (frp); } @@ -1544,11 +1495,6 @@ fcip_detach(dev_info_t *dip, ddi_detach_cmd_t cmd) FCIP_IN_CALLBACK | FCIP_ATTACHING | FCIP_SUSPENDED | FCIP_POWER_DOWN | FCIP_REG_INPROGRESS)) { - FCIP_TNF_PROBE_1((fcip_detach, - "fcip io", /* CSTYLED */, - tnf_string, msg, - "fcip instance busy")); - mutex_exit(&fptr->fcip_mutex); FCIP_DEBUG(FCIP_DEBUG_DETACH, (CE_WARN, "fcip instance busy")); @@ -1641,10 +1587,6 @@ fcip_detach(dev_info_t *dip, ddi_detach_cmd_t cmd) FCIP_DEBUG(FCIP_DEBUG_DETACH, (CE_NOTE, "detaching port")); - - FCIP_TNF_PROBE_1((fcip_detach, - "fcip io", /* CSTYLED */, tnf_string, - msg, "detaching port")); } /* @@ -2277,11 +2219,6 @@ fcip_statec_cb(opaque_t ulp_handle, opaque_t phandle, instance = ddi_get_instance(fport->fcipp_dip); - FCIP_TNF_PROBE_4((fcip_statec_cb, "fcip io", /* CSTYLED */, - tnf_string, msg, "state change callback", - tnf_uint, instance, instance, - tnf_uint, S_ID, sid, - tnf_int, count, listlen)); FCIP_DEBUG(FCIP_DEBUG_ELS, (CE_NOTE, "fcip%d, state change callback: state:0x%x, " "S_ID:0x%x, count:0x%x", instance, port_state, sid, listlen)); @@ -2552,10 +2489,6 @@ fcip_els_cb(opaque_t ulp_handle, opaque_t phandle, fptr->fcip_flags |= FCIP_IN_ELS_CB; mutex_exit(&fptr->fcip_mutex); - FCIP_TNF_PROBE_2((fcip_els_cb, "fcip io", /* CSTYLED */, - tnf_string, msg, "ELS callback", - tnf_uint, instance, instance)); - FCIP_DEBUG(FCIP_DEBUG_ELS, (CE_NOTE, "fcip%d, ELS callback , ", instance)); @@ -2740,10 +2673,6 @@ fcip_handle_farp_request(struct fcip *fptr, la_els_farp_t *fcmd) rval = fc_ulp_issue_els(fport->fcipp_handle, fc_pkt); if (rval != FC_SUCCESS) { - FCIP_TNF_PROBE_2((fcip_handle_farp_request, "fcip io", - /* CSTYLED */, tnf_string, msg, - "fcip_transport of farp reply failed", - tnf_uint, rval, rval)); FCIP_DEBUG(FCIP_DEBUG_ELS, (CE_WARN, "fcip_transport of farp reply failed 0x%x", rval)); } @@ -2864,9 +2793,6 @@ fcip_data_cb(opaque_t ulp_handle, opaque_t phandle, fptr->fcip_flags |= FCIP_IN_DATA_CB; mutex_exit(&fptr->fcip_mutex); - FCIP_TNF_PROBE_2((fcip_data_cb, "fcip io", /* CSTYLED */, - tnf_string, msg, "data callback", - tnf_int, instance, ddi_get_instance(fport->fcipp_dip))); FCIP_DEBUG(FCIP_DEBUG_UPSTREAM, (CE_NOTE, "fcip%d, data callback", ddi_get_instance(fport->fcipp_dip))); @@ -3084,8 +3010,6 @@ fcip_sendup_alloc_enque(struct fcip *fptr, mblk_t *mp, struct fcipstr *(*f)()) struct fcip_sendup_elem *msg_elem; int rval = FC_FAILURE; - FCIP_TNF_PROBE_1((fcip_sendup_alloc_enque, "fcip io", /* CSTYLED */, - tnf_string, msg, "sendup msg enque")); msg_elem = kmem_cache_alloc(fptr->fcip_sendup_cache, KM_NOSLEEP); if (msg_elem == NULL) { /* drop pkt to floor - update stats */ @@ -3196,9 +3120,6 @@ fcip_sendup_thr(void *arg) break; } - FCIP_TNF_PROBE_1((fcip_sendup_thr, "fcip io", /* CSTYLED */, - tnf_string, msg, "fcip sendup thr - new msg")); - msg_elem = fptr->fcip_sendup_head; fptr->fcip_sendup_head = msg_elem->fcipsu_next; msg_elem->fcipsu_next = NULL; @@ -3308,8 +3229,6 @@ fcip_sendup(struct fcip *fptr, mblk_t *mp, struct fcipstr *(*acceptfunc)()) fcph_network_hdr_t *nhdr; llc_snap_hdr_t *snaphdr; - FCIP_TNF_PROBE_1((fcip_sendup, "fcip io", /* CSTYLED */, - tnf_string, msg, "fcip sendup")); nhdr = (fcph_network_hdr_t *)mp->b_rptr; snaphdr = (llc_snap_hdr_t *)(mp->b_rptr + sizeof (fcph_network_hdr_t)); @@ -3330,8 +3249,6 @@ fcip_sendup(struct fcip *fptr, mblk_t *mp, struct fcipstr *(*acceptfunc)()) if ((slp = (*acceptfunc)(fcipstrup, fptr, type, dhostp)) == NULL) { rw_exit(&fcipstruplock); - FCIP_TNF_PROBE_1((fcip_sendup, "fcip io", /* CSTYLED */, - tnf_string, msg, "fcip sendup - no slp")); freemsg(mp); return; } @@ -3373,8 +3290,6 @@ fcip_sendup(struct fcip *fptr, mblk_t *mp, struct fcipstr *(*acceptfunc)()) } else { freemsg(mp); } - FCIP_TNF_PROBE_1((fcip_sendup, "fcip io", /* CSTYLED */, - tnf_string, msg, "fcip sendup done")); rw_exit(&fcipstruplock); } @@ -3392,9 +3307,6 @@ fcip_accept(struct fcipstr *slp, struct fcip *fptr, int type, la_wwn_t *dhostp) { t_uscalar_t sap; - FCIP_TNF_PROBE_1((fcip_accept, "fcip io", /* CSTYLED */, - tnf_string, msg, "fcip accept")); - for (; slp; slp = slp->sl_nextp) { sap = slp->sl_sap; FCIP_DEBUG(FCIP_DEBUG_UPSTREAM, (CE_CONT, @@ -3427,9 +3339,6 @@ fcip_addudind(struct fcip *fptr, mblk_t *mp, fcph_network_hdr_t *nhdr, hdrlen = (sizeof (llc_snap_hdr_t) + sizeof (fcph_network_hdr_t)); mp->b_rptr += hdrlen; - FCIP_TNF_PROBE_1((fcip_addudind, "fcip io", /* CSTYLED */, - tnf_string, msg, "fcip addudind")); - /* * Allocate an M_PROTO mblk for the DL_UNITDATA_IND. */ @@ -3486,8 +3395,6 @@ fcip_open(queue_t *rq, dev_t *devp, int flag, int sflag, cred_t *credp) minor_t minor; FCIP_DEBUG(FCIP_DEBUG_DOWNSTREAM, (CE_NOTE, "in fcip_open")); - FCIP_TNF_PROBE_1((fcip_open, "fcip io", /* CSTYLED */, - tnf_string, msg, "enter")); /* * We need to ensure that the port driver is loaded before * we proceed @@ -3577,8 +3484,6 @@ fcip_close(queue_t *rq, int flag, cred_t *credp) struct fcipstr **prevslp; FCIP_DEBUG(FCIP_DEBUG_DOWNSTREAM, (CE_NOTE, "in fcip_close")); - FCIP_TNF_PROBE_1((fcip_close, "fcip io", /* CSTYLED */, - tnf_string, msg, "enter")); ASSERT(rq); /* we should also have the active stream pointer in q_ptr */ ASSERT(rq->q_ptr); @@ -3635,8 +3540,6 @@ fcip_dodetach(struct fcipstr *slp) struct fcip *fptr; FCIP_DEBUG(FCIP_DEBUG_DETACH, (CE_NOTE, "in fcip_dodetach")); - FCIP_TNF_PROBE_1((fcip_dodetach, "fcip io", /* CSTYLED */, - tnf_string, msg, "enter")); ASSERT(slp->sl_fcip != NULL); fptr = slp->sl_fcip; @@ -3741,8 +3644,6 @@ fcip_ioctl(queue_t *wq, mblk_t *mp) FCIP_DEBUG(FCIP_DEBUG_DOWNSTREAM, (CE_NOTE, "in fcip ioctl : %d", iocp->ioc_cmd)); - FCIP_TNF_PROBE_1((fcip_ioctl, "fcip io", /* CSTYLED */, - tnf_string, msg, "enter")); switch (iocp->ioc_cmd) { case DLIOCRAW: @@ -3887,110 +3788,77 @@ fcip_proto(queue_t *wq, mblk_t *mp) dlp = (union DL_primitives *)mp->b_rptr; prim = dlp->dl_primitive; /* the DLPI command */ - FCIP_TNF_PROBE_5((fcip_proto, "fcip io", /* CSTYLED */, - tnf_string, msg, "enter", - tnf_opaque, wq, wq, - tnf_opaque, mp, mp, - tnf_opaque, MP_DB_TYPE, DB_TYPE(mp), - tnf_opaque, dl_primitive, dlp->dl_primitive)); - FCIP_DEBUG(FCIP_DEBUG_INIT, (CE_NOTE, "dl_primitve : %x", prim)); mutex_enter(&slp->sl_lock); switch (prim) { case DL_UNITDATA_REQ: - FCIP_TNF_PROBE_1((fcip_proto, "fcip io", /* CSTYLED */, - tnf_string, msg, "unit data request")); FCIP_DEBUG(FCIP_DEBUG_DLPI, (CE_NOTE, "unit data request")); fcip_udreq(wq, mp); break; case DL_ATTACH_REQ: - FCIP_TNF_PROBE_1((fcip_proto, "fcip io", /* CSTYLED */, - tnf_string, msg, "Attach request")); FCIP_DEBUG(FCIP_DEBUG_DLPI, (CE_NOTE, "Attach request")); fcip_areq(wq, mp); break; case DL_DETACH_REQ: - FCIP_TNF_PROBE_1((fcip_proto, "fcip io", /* CSTYLED */, - tnf_string, msg, "Detach request")); FCIP_DEBUG(FCIP_DEBUG_DLPI, (CE_NOTE, "Detach request")); fcip_dreq(wq, mp); break; case DL_BIND_REQ: FCIP_DEBUG(FCIP_DEBUG_DLPI, (CE_NOTE, "Bind request")); - FCIP_TNF_PROBE_1((fcip_proto, "fcip io", /* CSTYLED */, - tnf_string, msg, "Bind request")); fcip_breq(wq, mp); break; case DL_UNBIND_REQ: - FCIP_TNF_PROBE_1((fcip_proto, "fcip io", /* CSTYLED */, - tnf_string, msg, "unbind request")); FCIP_DEBUG(FCIP_DEBUG_DLPI, (CE_NOTE, "unbind request")); fcip_ubreq(wq, mp); break; case DL_INFO_REQ: - FCIP_TNF_PROBE_1((fcip_proto, "fcip io", /* CSTYLED */, - tnf_string, msg, "Info request")); FCIP_DEBUG(FCIP_DEBUG_DLPI, (CE_NOTE, "Info request")); fcip_ireq(wq, mp); break; case DL_SET_PHYS_ADDR_REQ: - FCIP_TNF_PROBE_1((fcip_proto, "fcip io", /* CSTYLED */, - tnf_string, msg, "set phy addr request")); FCIP_DEBUG(FCIP_DEBUG_DLPI, (CE_NOTE, "set phy addr request")); fcip_spareq(wq, mp); break; case DL_PHYS_ADDR_REQ: - FCIP_TNF_PROBE_1((fcip_proto, "fcip io", /* CSTYLED */, - tnf_string, msg, "phy addr request")); FCIP_DEBUG(FCIP_DEBUG_DLPI, (CE_NOTE, "phy addr request")); fcip_pareq(wq, mp); break; case DL_ENABMULTI_REQ: - FCIP_TNF_PROBE_1((fcip_proto, "fcip io", /* CSTYLED */, - tnf_string, msg, "Enable Multicast request")); FCIP_DEBUG(FCIP_DEBUG_DLPI, (CE_NOTE, "Enable Multicast request")); dlerrorack(wq, mp, prim, DL_UNSUPPORTED, 0); break; case DL_DISABMULTI_REQ: - FCIP_TNF_PROBE_1((fcip_proto, "fcip io", /* CSTYLED */, - tnf_string, msg, "Disable Multicast request")); FCIP_DEBUG(FCIP_DEBUG_DLPI, (CE_NOTE, "Disable Multicast request")); dlerrorack(wq, mp, prim, DL_UNSUPPORTED, 0); break; case DL_PROMISCON_REQ: - FCIP_TNF_PROBE_1((fcip_proto, "fcip io", /* CSTYLED */, - tnf_string, msg, "Promiscuous mode ON request")); FCIP_DEBUG(FCIP_DEBUG_DLPI, (CE_NOTE, "Promiscuous mode ON request")); dlerrorack(wq, mp, prim, DL_UNSUPPORTED, 0); break; case DL_PROMISCOFF_REQ: - FCIP_TNF_PROBE_1((fcip_proto, "fcip io", /* CSTYLED */, - tnf_string, msg, "Promiscuous mode OFF request")); FCIP_DEBUG(FCIP_DEBUG_DLPI, (CE_NOTE, "Promiscuous mode OFF request")); dlerrorack(wq, mp, prim, DL_UNSUPPORTED, 0); break; default: - FCIP_TNF_PROBE_1((fcip_proto, "fcip io", /* CSTYLED */, - tnf_string, msg, "Unsupported request")); dlerrorack(wq, mp, prim, DL_UNSUPPORTED, 0); break; } @@ -4022,9 +3890,6 @@ fcip_wsrv(queue_t *wq) slp = (struct fcipstr *)wq->q_ptr; fptr = slp->sl_fcip; - FCIP_TNF_PROBE_2((fcip_wsrv, "fcip io", /* CSTYLED */, - tnf_string, msg, "enter", - tnf_opaque, wq, wq)); FCIP_DEBUG(FCIP_DEBUG_DOWNSTREAM, (CE_NOTE, "fcip wsrv")); while (mp = getq(wq)) { @@ -4080,10 +3945,6 @@ fcip_start(queue_t *wq, mblk_t *mp, struct fcip *fptr, fcip_port_info_t *fport = fptr->fcip_port_info; size_t datalen; - FCIP_TNF_PROBE_4((fcip_start, "fcip io", /* CSTYLED */, - tnf_string, msg, "enter", tnf_opaque, wq, wq, - tnf_opaque, mp, mp, - tnf_opaque, MP_DB_TYPE, DB_TYPE(mp))); FCIP_DEBUG(FCIP_DEBUG_DOWNSTREAM, (CE_NOTE, "in fcipstart")); ASSERT(fdestp != NULL); @@ -4225,8 +4086,6 @@ static void fcip_fdestp_enqueue_pkt(struct fcip_dest *fdestp, fcip_pkt_t *fcip_pkt) { ASSERT(mutex_owned(&fdestp->fcipd_mutex)); - FCIP_TNF_PROBE_1((fcip_fdestp_enqueue_pkt, "fcip io", /* CSTYLED */, - tnf_string, msg, "destp enq pkt")); /* * Just hang it off the head of packet list @@ -4325,9 +4184,6 @@ fcip_transport(fcip_pkt_t *fcip_pkt) int rval = FC_FAILURE; struct fcip_routing_table *frp = NULL; - FCIP_TNF_PROBE_1((fcip_transport, "fcip io", /* CSTYLED */, - tnf_string, msg, "enter")); - fptr = fcip_pkt->fcip_pkt_fptr; fport = fptr->fcip_port_info; fc_pkt = FCIP_PKT_TO_FC_PKT(fcip_pkt); @@ -4346,13 +4202,9 @@ fcip_transport(fcip_pkt_t *fcip_pkt) if ((fc_pkt->pkt_tran_type != FC_PKT_BROADCAST) && (fc_pkt->pkt_pd == NULL)) { mutex_exit(&fptr->fcip_mutex); - FCIP_TNF_PROBE_1((fcip_transport, "fcip io", /* CSTYLED */, - tnf_string, msg, "fcip transport no pd")); return (rval); } else if (fptr->fcip_port_state == FCIP_PORT_OFFLINE) { mutex_exit(&fptr->fcip_mutex); - FCIP_TNF_PROBE_1((fcip_transport, "fcip io", /* CSTYLED */, - tnf_string, msg, "fcip transport port offline")); return (FC_TRAN_BUSY); } mutex_exit(&fptr->fcip_mutex); @@ -4370,16 +4222,8 @@ fcip_transport(fcip_pkt_t *fcip_pkt) mutex_exit(&fptr->fcip_rt_mutex); if (frp && (frp->fcipr_state == FCIP_RT_INVALID)) { - FCIP_TNF_PROBE_1((fcip_transport, - "fcip io", /* CSTYLED */, - tnf_string, msg, - "fcip transport - TRANBUSY")); return (FC_TRAN_BUSY); } else { - FCIP_TNF_PROBE_1((fcip_transport, - "fcip io", /* CSTYLED */, - tnf_string, msg, - "fcip transport: frp unavailable")); return (rval); } } @@ -4417,8 +4261,6 @@ fcip_transport(fcip_pkt_t *fcip_pkt) } } - FCIP_TNF_PROBE_1((fcip_transport, "fcip io", /* CSTYLED */, - tnf_string, msg, "fcip transport done")); return (rval); } @@ -4465,8 +4307,6 @@ fcip_pkt_callback(fc_packet_t *fc_pkt) fcip_pkt_free(fcip_pkt, 1); } - FCIP_TNF_PROBE_1((fcip_pkt_callback, "fcip io", /* CSTYLED */, - tnf_string, msg, "pkt callback done")); FCIP_DEBUG(FCIP_DEBUG_DOWNSTREAM, (CE_NOTE, "pkt callback done")); } @@ -4509,10 +4349,6 @@ fcip_handle_topology(struct fcip *fptr) * topologies - we would probably not have a name server */ - FCIP_TNF_PROBE_3((fcip_handle_topology, "fcip io", /* CSTYLED */, - tnf_string, msg, "enter", - tnf_uint, port_state, fport->fcipp_pstate, - tnf_uint, topology, fport->fcipp_topology)); FCIP_DEBUG(FCIP_DEBUG_INIT, (CE_NOTE, "port state: %x, topology %x", fport->fcipp_pstate, fport->fcipp_topology)); @@ -4688,8 +4524,6 @@ fcip_init_port(struct fcip *fptr) ASSERT(fport != NULL); - FCIP_TNF_PROBE_1((fcip_init_port, "fcip io", /* CSTYLED */, - tnf_string, msg, "enter")); mutex_enter(&fptr->fcip_mutex); /* @@ -4721,10 +4555,6 @@ fcip_init_port(struct fcip *fptr) fptr->fcip_ub_nbufs = fcip_ub_nbufs; tok_buf_size = sizeof (*fptr->fcip_ub_tokens) * fcip_ub_nbufs; - FCIP_TNF_PROBE_2((fcip_init_port, "fcip io", /* CSTYLED */, - tnf_string, msg, "debug", - tnf_int, tokBufsize, tok_buf_size)); - FCIP_DEBUG(FCIP_DEBUG_INIT, (CE_WARN, "tokBufsize: 0x%lx", tok_buf_size)); @@ -4756,8 +4586,6 @@ fcip_init_port(struct fcip *fptr) goto done; case FC_UB_ERROR: - FCIP_TNF_PROBE_1((fcip_init_port, "fcip io", /* CSTYLED */, - tnf_string, msg, "invalid ub alloc request")); FCIP_DEBUG(FCIP_DEBUG_INIT, (CE_WARN, "invalid ub alloc request !!")); rval = FC_FAILURE; @@ -4800,9 +4628,6 @@ fcip_init_port(struct fcip *fptr) 8, fcip_sendup_constructor, NULL, NULL, (void *)fport, NULL, 0); if (fptr->fcip_xmit_cache == NULL) { - FCIP_TNF_PROBE_2((fcip_init_port, "fcip io", /* CSTYLED */, - tnf_string, msg, "unable to allocate xmit cache", - tnf_int, instance, fptr->fcip_instance)); FCIP_DEBUG(FCIP_DEBUG_INIT, (CE_WARN, "fcip%d unable to allocate xmit cache", fptr->fcip_instance)); @@ -5134,9 +4959,6 @@ fcip_ireq(queue_t *wq, mblk_t *mp) FCIP_DEBUG(FCIP_DEBUG_DLPI, (CE_NOTE, "fcip_ireq: info request req rcvd")); - FCIP_TNF_PROBE_1((fcip_ireq, "fcip io", /* CSTYLED */, - tnf_string, msg, "fcip ireq entered")); - if (MBLKL(mp) < DL_INFO_REQ_SIZE) { dlerrorack(wq, mp, DL_INFO_REQ, DL_BADPRIM, 0); return; @@ -5199,9 +5021,6 @@ fcip_udreq(queue_t *wq, mblk_t *mp) FCIP_DEBUG(FCIP_DEBUG_DLPI, (CE_NOTE, "inside fcip_udreq")); - FCIP_TNF_PROBE_1((fcip_udreq, "fcip io", /* CSTYLED */, - tnf_string, msg, "fcip udreq entered")); - slp = (struct fcipstr *)wq->q_ptr; if (slp->sl_state != DL_IDLE) { @@ -6915,8 +6734,6 @@ fcip_init_broadcast_pkt(fcip_pkt_t *fcip_pkt, void (*comp) (), int is_els) uint32_t sid; uint32_t did; - FCIP_TNF_PROBE_1((fcip_init_broadcast_pkt, "fcip io", /* CSTYLED */, - tnf_string, msg, "enter")); fc_pkt = FCIP_PKT_TO_FC_PKT(fcip_pkt); fr_hdr = &fc_pkt->pkt_cmd_fhdr; sid = fport->fcipp_sid.port_id; @@ -7103,10 +6920,6 @@ fcip_get_broadcast_did(struct fcip *fptr) uint32_t did = 0; uint32_t sid; - FCIP_TNF_PROBE_2((fcip_get_broadcast_did, "fcip io", /* CSTYLED */, - tnf_string, msg, "enter", - tnf_opaque, fptr, fptr)); - sid = fport->fcipp_sid.port_id; switch (fport->fcipp_topology) { @@ -7172,9 +6985,6 @@ fcip_get_broadcast_did(struct fcip *fptr) fptr->fcip_instance)); break; } - FCIP_TNF_PROBE_2((fcip_get_broadcast_did, "fcip io", /* CSTYLED */, - tnf_string, msg, "return", - tnf_opaque, did, did)); return (did); } @@ -7486,12 +7296,6 @@ fcip_rte_remove_deferred(void *arg) fdestp->fcipd_rtable = NULL; mutex_exit(&fdestp->fcipd_mutex); - FCIP_TNF_PROBE_2((fcip_rte_remove_deferred, - "fcip io", /* CSTYLED */, - tnf_string, msg, - "remove retired routing entry", - tnf_int, index, index)); - if (frtp_prev == NULL) { /* first element */ fptr->fcip_rtable[index] = diff --git a/usr/src/uts/common/io/ib/adapters/tavor/tavor.c b/usr/src/uts/common/io/ib/adapters/tavor/tavor.c index 6fb110d9e4..ec2f0127ac 100644 --- a/usr/src/uts/common/io/ib/adapters/tavor/tavor.c +++ b/usr/src/uts/common/io/ib/adapters/tavor/tavor.c @@ -160,12 +160,6 @@ static struct modlinkage tavor_modlinkage = { */ extern ibc_operations_t tavor_ibc_ops; -#ifndef NPROBE -extern int tnf_mod_load(void); -extern int tnf_mod_unload(struct modlinkage *mlp); -#endif - - /* * _init() */ @@ -174,48 +168,27 @@ _init() { int status; -#ifndef NPROBE - (void) tnf_mod_load(); -#endif - TAVOR_TNF_ENTER(tavor_init); - status = ddi_soft_state_init(&tavor_statep, sizeof (tavor_state_t), (size_t)TAVOR_INITIAL_STATES); if (status != 0) { - TNF_PROBE_0(tavor_init_ssi_fail, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_init); -#ifndef NPROBE - (void) tnf_mod_unload(&tavor_modlinkage); -#endif return (status); } status = ibc_init(&tavor_modlinkage); if (status != 0) { - TNF_PROBE_0(tavor_init_ibc_init_fail, TAVOR_TNF_ERROR, ""); ddi_soft_state_fini(&tavor_statep); - TAVOR_TNF_EXIT(tavor_init); -#ifndef NPROBE - (void) tnf_mod_unload(&tavor_modlinkage); -#endif return (status); } status = mod_install(&tavor_modlinkage); if (status != 0) { - TNF_PROBE_0(tavor_init_modi_fail, TAVOR_TNF_ERROR, ""); ibc_fini(&tavor_modlinkage); ddi_soft_state_fini(&tavor_statep); - TAVOR_TNF_EXIT(tavor_init); -#ifndef NPROBE - (void) tnf_mod_unload(&tavor_modlinkage); -#endif return (status); } /* Initialize the Tavor "userland resources database" */ tavor_umap_db_init(); - TAVOR_TNF_EXIT(tavor_init); return (status); } @@ -228,9 +201,7 @@ _info(struct modinfo *modinfop) { int status; - TAVOR_TNF_ENTER(tavor_info); status = mod_info(&tavor_modlinkage, modinfop); - TAVOR_TNF_EXIT(tavor_info); return (status); } @@ -243,12 +214,8 @@ _fini() { int status; - TAVOR_TNF_ENTER(tavor_fini); - status = mod_remove(&tavor_modlinkage); if (status != 0) { - TNF_PROBE_0(tavor_fini_modr_fail, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_fini); return (status); } @@ -257,10 +224,6 @@ _fini() ibc_fini(&tavor_modlinkage); ddi_soft_state_fini(&tavor_statep); -#ifndef NPROBE - (void) tnf_mod_unload(&tavor_modlinkage); -#endif - TAVOR_TNF_EXIT(tavor_fini); return (status); } @@ -276,17 +239,12 @@ tavor_getinfo(dev_info_t *dip, ddi_info_cmd_t cmd, void *arg, void **result) tavor_state_t *state; minor_t instance; - TAVOR_TNF_ENTER(tavor_getinfo); - switch (cmd) { case DDI_INFO_DEVT2DEVINFO: dev = (dev_t)arg; instance = TAVOR_DEV_INSTANCE(dev); state = ddi_get_soft_state(tavor_statep, instance); if (state == NULL) { - TNF_PROBE_0(tavor_getinfo_gss_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_getinfo); return (DDI_FAILURE); } *result = (void *)state->ts_dip; @@ -299,11 +257,9 @@ tavor_getinfo(dev_info_t *dip, ddi_info_cmd_t cmd, void *arg, void **result) return (DDI_SUCCESS); default: - TNF_PROBE_0(tavor_getinfo_default_fail, TAVOR_TNF_ERROR, ""); break; } - TAVOR_TNF_EXIT(tavor_getinfo); return (DDI_FAILURE); } @@ -324,13 +280,9 @@ tavor_open(dev_t *devp, int flag, int otyp, cred_t *credp) dev_t dev; int status; - TAVOR_TNF_ENTER(tavor_open); - instance = TAVOR_DEV_INSTANCE(*devp); state = ddi_get_soft_state(tavor_statep, instance); if (state == NULL) { - TNF_PROBE_0(tavor_open_gss_fail, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_open); return (ENXIO); } @@ -340,8 +292,6 @@ tavor_open(dev_t *devp, int flag, int otyp, cred_t *credp) */ if ((otyp != OTYP_CHR) || ((flag & FEXCL) && secpolicy_excl_open(credp) != 0)) { - TNF_PROBE_0(tavor_open_invflags_fail, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_open); return (EINVAL); } @@ -398,9 +348,6 @@ tavor_open(dev_t *devp, int flag, int otyp, cred_t *credp) if (status != DDI_SUCCESS) { mutex_exit( &tavor_userland_rsrc_db.tdl_umapdb_lock); - TNF_PROBE_0(tavor_open_rsrcalloc_uarpg_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_open); return (EAGAIN); } @@ -419,9 +366,6 @@ tavor_open(dev_t *devp, int flag, int otyp, cred_t *credp) if (TAVOR_IS_OPERATIONAL(state->ts_operational_mode)) { tavor_rsrc_free(state, &rsrcp); } - TNF_PROBE_0(tavor_open_umap_db_alloc_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_open); return (EAGAIN); } @@ -447,9 +391,6 @@ tavor_open(dev_t *devp, int flag, int otyp, cred_t *credp) if (TAVOR_IS_OPERATIONAL(state->ts_operational_mode)) { tavor_rsrc_free(state, &rsrcp); } - TNF_PROBE_0(tavor_open_umap_db_alloc_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_open); return (EAGAIN); } @@ -471,7 +412,6 @@ tavor_open(dev_t *devp, int flag, int otyp, cred_t *credp) *devp = dev; - TAVOR_TNF_EXIT(tavor_open); return (0); } @@ -491,13 +431,9 @@ tavor_close(dev_t dev, int flag, int otyp, cred_t *credp) uint64_t key, value; int status; - TAVOR_TNF_ENTER(tavor_close); - instance = TAVOR_DEV_INSTANCE(dev); state = ddi_get_soft_state(tavor_statep, instance); if (state == NULL) { - TNF_PROBE_0(tavor_close_gss_fail, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_close); return (ENXIO); } @@ -566,7 +502,6 @@ tavor_close(dev_t dev, int flag, int otyp, cred_t *credp) } mutex_exit(&tavor_userland_rsrc_db.tdl_umapdb_lock); - TAVOR_TNF_EXIT(tavor_close); return (0); } @@ -584,8 +519,6 @@ tavor_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) int instance; int status; - TAVOR_TNF_ENTER(tavor_attach); - #ifdef __lock_lint (void) tavor_quiesce(dip); #endif @@ -595,7 +528,6 @@ tavor_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) instance = ddi_get_instance(dip); status = ddi_soft_state_zalloc(tavor_statep, instance); if (status != DDI_SUCCESS) { - TNF_PROBE_0(tavor_attach_ssz_fail, TAVOR_TNF_ERROR, ""); cmn_err(CE_NOTE, "tavor%d: driver failed to attach: " "attach_ssz_fail", instance); goto fail_attach_nomsg; @@ -604,7 +536,6 @@ tavor_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) state = ddi_get_soft_state(tavor_statep, instance); if (state == NULL) { ddi_soft_state_free(tavor_statep, instance); - TNF_PROBE_0(tavor_attach_gss_fail, TAVOR_TNF_ERROR, ""); cmn_err(CE_NOTE, "tavor%d: driver failed to attach: " "attach_gss_fail", instance); goto fail_attach_nomsg; @@ -627,8 +558,6 @@ tavor_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) status = tavor_drv_init(state, dip, instance); if ((status != DDI_SUCCESS) && (TAVOR_IS_OPERATIONAL(state->ts_operational_mode))) { - TNF_PROBE_0(tavor_attach_drvinit_fail, - TAVOR_TNF_ERROR, ""); goto fail_attach; } @@ -639,8 +568,6 @@ tavor_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) tavor_drv_fini(state); TAVOR_ATTACH_MSG(state->ts_attach_buf, "attach_create_mn_fail"); - TNF_PROBE_0(tavor_attach_create_mn_fail, - TAVOR_TNF_ERROR, ""); goto fail_attach; } @@ -658,8 +585,6 @@ tavor_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) if (ibc_status != IBC_SUCCESS) { ddi_remove_minor_node(dip, "devctl"); tavor_drv_fini(state); - TNF_PROBE_0(tavor_attach_ibcattach_fail, - TAVOR_TNF_ERROR, ""); TAVOR_ATTACH_MSG(state->ts_attach_buf, "attach_ibcattach_fail"); goto fail_attach; @@ -686,8 +611,6 @@ tavor_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) ibc_detach(tmp_ibtfpriv); ddi_remove_minor_node(dip, "devctl"); tavor_drv_fini(state); - TNF_PROBE_0(tavor_attach_agentinit_fail, - TAVOR_TNF_ERROR, ""); TAVOR_ATTACH_MSG(state->ts_attach_buf, "attach_agentinit_fail"); goto fail_attach; @@ -706,16 +629,13 @@ tavor_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) "(for maintenance mode only)", state->ts_instance); } - TAVOR_TNF_EXIT(tavor_attach); return (DDI_SUCCESS); case DDI_RESUME: /* Add code here for DDI_RESUME XXX */ - TAVOR_TNF_EXIT(tavor_attach); return (DDI_FAILURE); default: - TNF_PROBE_0(tavor_attach_default_fail, TAVOR_TNF_ERROR, ""); break; } @@ -725,7 +645,6 @@ fail_attach: tavor_drv_fini2(state); ddi_soft_state_free(tavor_statep, instance); fail_attach_nomsg: - TAVOR_TNF_EXIT(tavor_attach); return (DDI_FAILURE); } @@ -742,13 +661,9 @@ tavor_detach(dev_info_t *dip, ddi_detach_cmd_t cmd) ibc_status_t ibc_status; int instance, status; - TAVOR_TNF_ENTER(tavor_detach); - instance = ddi_get_instance(dip); state = ddi_get_soft_state(tavor_statep, instance); if (state == NULL) { - TNF_PROBE_0(tavor_detach_gss_fail, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_detach); return (DDI_FAILURE); } @@ -764,9 +679,6 @@ tavor_detach(dev_info_t *dip, ddi_detach_cmd_t cmd) /* Unregister agents from IB Mgmt Framework (IBMF) */ status = tavor_agent_handlers_fini(state); if (status != DDI_SUCCESS) { - TNF_PROBE_0(tavor_detach_agentfini_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_detach); return (DDI_FAILURE); } @@ -785,9 +697,6 @@ tavor_detach(dev_info_t *dip, ddi_detach_cmd_t cmd) TAVOR_WARNING(state, "failed to " "restart Tavor agents"); } - TNF_PROBE_0(tavor_detach_ibcpredetach_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_detach); return (DDI_FAILURE); } @@ -831,20 +740,16 @@ tavor_detach(dev_info_t *dip, ddi_detach_cmd_t cmd) tavor_drv_fini2(state); ddi_soft_state_free(tavor_statep, instance); - TAVOR_TNF_EXIT(tavor_detach); return (DDI_SUCCESS); case DDI_SUSPEND: /* Add code here for DDI_SUSPEND XXX */ - TAVOR_TNF_EXIT(tavor_detach); return (DDI_FAILURE); default: - TNF_PROBE_0(tavor_detach_default_fail, TAVOR_TNF_ERROR, ""); break; } - TAVOR_TNF_EXIT(tavor_detach); return (DDI_FAILURE); } @@ -858,8 +763,6 @@ tavor_drv_init(tavor_state_t *state, dev_info_t *dip, int instance) { int status; - TAVOR_TNF_ENTER(tavor_drv_init); - /* Save away devinfo and instance */ state->ts_dip = dip; state->ts_instance = instance; @@ -885,9 +788,6 @@ tavor_drv_init(tavor_state_t *state, dev_info_t *dip, int instance) } else { state->ts_operational_mode = 0; /* invalid operational mode */ TAVOR_WARNING(state, "unexpected device type detected"); - TNF_PROBE_0(tavor_hw_init_unexpected_dev_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_hw_init); return (DDI_FAILURE); } @@ -905,8 +805,6 @@ tavor_drv_init(tavor_state_t *state, dev_info_t *dip, int instance) state->ts_operational_mode = TAVOR_MAINTENANCE_MODE; cmn_err(CE_NOTE, "tavor%d: error during attach: %s", instance, state->ts_attach_buf); - TNF_PROBE_0(tavor_drv_init_hwinit_fail, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_drv_init); return (DDI_FAILURE); } @@ -914,8 +812,6 @@ tavor_drv_init(tavor_state_t *state, dev_info_t *dip, int instance) status = tavor_isr_init(state); if (status != DDI_SUCCESS) { tavor_hw_fini(state, TAVOR_DRV_CLEANUP_ALL); - TNF_PROBE_0(tavor_drv_init_isrinit_fail, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_drv_init); return (DDI_FAILURE); } @@ -924,12 +820,9 @@ tavor_drv_init(tavor_state_t *state, dev_info_t *dip, int instance) if (status != DDI_SUCCESS) { tavor_isr_fini(state); tavor_hw_fini(state, TAVOR_DRV_CLEANUP_ALL); - TNF_PROBE_0(tavor_drv_init_ssiinit_fail, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_drv_init); return (DDI_FAILURE); } - TAVOR_TNF_EXIT(tavor_drv_init); return (DDI_SUCCESS); } @@ -941,8 +834,6 @@ tavor_drv_init(tavor_state_t *state, dev_info_t *dip, int instance) static void tavor_drv_fini(tavor_state_t *state) { - TAVOR_TNF_ENTER(tavor_drv_fini); - /* Cleanup Tavor softstate */ tavor_soft_state_fini(state); @@ -951,8 +842,6 @@ tavor_drv_fini(tavor_state_t *state) /* Cleanup Tavor resources and shutdown hardware */ tavor_hw_fini(state, TAVOR_DRV_CLEANUP_ALL); - - TAVOR_TNF_EXIT(tavor_drv_fini); } /* @@ -962,8 +851,6 @@ tavor_drv_fini(tavor_state_t *state) static void tavor_drv_fini2(tavor_state_t *state) { - TAVOR_TNF_ENTER(tavor_drv_fini2); - /* TAVOR_DRV_CLEANUP_LEVEL1 */ if (state->ts_reg_cmdhdl) { ddi_regs_map_free(&state->ts_reg_cmdhdl); @@ -975,8 +862,6 @@ tavor_drv_fini2(tavor_state_t *state) pci_config_teardown(&state->ts_pci_cfghdl); state->ts_pci_cfghdl = NULL; } - - TAVOR_TNF_EXIT(tavor_drv_fini2); } /* @@ -988,16 +873,12 @@ tavor_isr_init(tavor_state_t *state) { int status; - TAVOR_TNF_ENTER(tavor_isr_init); - /* * Add a handler for the interrupt or MSI */ status = ddi_intr_add_handler(state->ts_intrmsi_hdl, tavor_isr, (caddr_t)state, NULL); if (status != DDI_SUCCESS) { - TNF_PROBE_0(tavor_isr_init_addhndlr_fail, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_isr_init); return (DDI_FAILURE); } @@ -1010,17 +891,11 @@ tavor_isr_init(tavor_state_t *state) if (state->ts_intrmsi_cap & DDI_INTR_FLAG_BLOCK) { status = ddi_intr_block_enable(&state->ts_intrmsi_hdl, 1); if (status != DDI_SUCCESS) { - TNF_PROBE_0(tavor_isr_init_blockenable_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_isr_init); return (DDI_FAILURE); } } else { status = ddi_intr_enable(state->ts_intrmsi_hdl); if (status != DDI_SUCCESS) { - TNF_PROBE_0(tavor_isr_init_intrenable_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_isr_init); return (DDI_FAILURE); } } @@ -1031,7 +906,6 @@ tavor_isr_init(tavor_state_t *state) */ tavor_eq_arm_all(state); - TAVOR_TNF_EXIT(tavor_isr_init); return (DDI_SUCCESS); } @@ -1043,8 +917,6 @@ tavor_isr_init(tavor_state_t *state) static void tavor_isr_fini(tavor_state_t *state) { - TAVOR_TNF_ENTER(tavor_isr_fini); - /* Disable the software interrupt */ if (state->ts_intrmsi_cap & DDI_INTR_FLAG_BLOCK) { (void) ddi_intr_block_disable(&state->ts_intrmsi_hdl, 1); @@ -1056,8 +928,6 @@ tavor_isr_fini(tavor_state_t *state) * Remove the software handler for the interrupt or MSI */ (void) ddi_intr_remove_handler(state->ts_intrmsi_hdl); - - TAVOR_TNF_EXIT(tavor_isr_fini); } @@ -1100,8 +970,6 @@ tavor_hw_init(tavor_state_t *state) int status; int retries; - TAVOR_TNF_ENTER(tavor_hw_init); - /* This is where driver initialization begins */ cleanup = TAVOR_DRV_CLEANUP_LEVEL0; @@ -1126,10 +994,8 @@ tavor_hw_init(tavor_state_t *state) &state->ts_reg_cmdhdl); if (status != DDI_SUCCESS) { tavor_hw_fini(state, cleanup); - TNF_PROBE_0(tavor_hw_init_CMD_ddirms_fail, TAVOR_TNF_ERROR, ""); TAVOR_ATTACH_MSG(state->ts_attach_buf, "hw_init_CMD_ddirms_fail"); - TAVOR_TNF_EXIT(tavor_hw_init); return (DDI_FAILURE); } cleanup = TAVOR_DRV_CLEANUP_LEVEL1; @@ -1139,10 +1005,8 @@ tavor_hw_init(tavor_state_t *state) &state->ts_reg_uarhdl); if (status != DDI_SUCCESS) { tavor_hw_fini(state, cleanup); - TNF_PROBE_0(tavor_hw_init_UAR_ddirms_fail, TAVOR_TNF_ERROR, ""); TAVOR_ATTACH_MSG(state->ts_attach_buf, "hw_init_UAR_ddirms_fail"); - TAVOR_TNF_EXIT(tavor_hw_init); return (DDI_FAILURE); } cleanup = TAVOR_DRV_CLEANUP_LEVEL2; @@ -1152,11 +1016,8 @@ tavor_hw_init(tavor_state_t *state) cmn_err(CE_CONT, "Tavor: ddi_dev_regsize() failed " "(check HCA-attached DIMM memory?)\n"); tavor_hw_fini(state, cleanup); - TNF_PROBE_0(tavor_hw_init_DDR_ddi_regsize_fail, - TAVOR_TNF_ERROR, ""); TAVOR_ATTACH_MSG(state->ts_attach_buf, "hw_init_DDR_ddi_regsize_fail"); - TAVOR_TNF_EXIT(tavor_hw_init); return (DDI_FAILURE); } @@ -1202,8 +1063,6 @@ tavor_hw_init(tavor_state_t *state) * Set the updated config profile setting here. */ if (status == DDI_SUCCESS) { - TNF_PROBE_0(tavor_hw_init_DDR_128mb_fallback_success, - TAVOR_TNF_TRACE, ""); state->ts_cfg_profile_setting = TAVOR_DDR_SIZE_128; } } @@ -1214,10 +1073,8 @@ tavor_hw_init(tavor_state_t *state) "(check HCA-attached DIMM memory?)\n"); } tavor_hw_fini(state, cleanup); - TNF_PROBE_0(tavor_hw_init_DDR_ddirms_fail, TAVOR_TNF_ERROR, ""); TAVOR_ATTACH_MSG(state->ts_attach_buf, "hw_init_DDR_ddirms_fail"); - TAVOR_TNF_EXIT(tavor_hw_init); return (DDI_FAILURE); } cleanup = TAVOR_DRV_CLEANUP_LEVEL3; @@ -1244,9 +1101,7 @@ tavor_hw_init(tavor_state_t *state) status = tavor_cfg_profile_init_phase1(state); if (status != DDI_SUCCESS) { tavor_hw_fini(state, cleanup); - TNF_PROBE_0(tavor_hw_init_cfginit_fail, TAVOR_TNF_ERROR, ""); TAVOR_ATTACH_MSG(state->ts_attach_buf, "hw_init_cfginit_fail"); - TAVOR_TNF_EXIT(tavor_hw_init); return (DDI_FAILURE); } cleanup = TAVOR_DRV_CLEANUP_LEVEL4; @@ -1255,9 +1110,7 @@ tavor_hw_init(tavor_state_t *state) status = tavor_sw_reset(state); if (status != TAVOR_CMD_SUCCESS) { tavor_hw_fini(state, cleanup); - TNF_PROBE_0(tavor_hw_init_sw_reset_fail, TAVOR_TNF_ERROR, ""); TAVOR_ATTACH_MSG(state->ts_attach_buf, "hw_init_sw_reset_fail"); - TAVOR_TNF_EXIT(tavor_hw_init); return (DDI_FAILURE); } @@ -1275,11 +1128,8 @@ tavor_hw_init(tavor_state_t *state) "0x%" PRIx64 "\n", status, errorcode); } tavor_hw_fini(state, cleanup); - TNF_PROBE_0(tavor_hw_init_sys_en_cmd_fail, - TAVOR_TNF_ERROR, ""); TAVOR_ATTACH_MSG(state->ts_attach_buf, "hw_init_sys_en_cmd_fail"); - TAVOR_TNF_EXIT(tavor_hw_init); return (DDI_FAILURE); } cleanup = TAVOR_DRV_CLEANUP_LEVEL5; @@ -1288,10 +1138,8 @@ tavor_hw_init(tavor_state_t *state) status = tavor_rsrc_init_phase1(state); if (status != DDI_SUCCESS) { tavor_hw_fini(state, cleanup); - TNF_PROBE_0(tavor_hw_init_rsrcinit1_fail, TAVOR_TNF_ERROR, ""); TAVOR_ATTACH_MSG(state->ts_attach_buf, "hw_init_rsrcinit1_fail"); - TAVOR_TNF_EXIT(tavor_hw_init); return (DDI_FAILURE); } cleanup = TAVOR_DRV_CLEANUP_LEVEL6; @@ -1304,11 +1152,8 @@ tavor_hw_init(tavor_state_t *state) cmn_err(CE_CONT, "Tavor: QUERY_DDR command failed: %08x\n", status); tavor_hw_fini(state, cleanup); - TNF_PROBE_0(tavor_hw_init_query_ddr_cmd_fail, - TAVOR_TNF_ERROR, ""); TAVOR_ATTACH_MSG(state->ts_attach_buf, "hw_init_query_ddr_cmd_fail"); - TAVOR_TNF_EXIT(tavor_hw_init); return (DDI_FAILURE); } @@ -1319,21 +1164,15 @@ tavor_hw_init(tavor_state_t *state) cmn_err(CE_CONT, "Tavor: QUERY_FW command failed: %08x\n", status); tavor_hw_fini(state, cleanup); - TNF_PROBE_0(tavor_hw_init_query_fw_cmd_fail, - TAVOR_TNF_ERROR, ""); TAVOR_ATTACH_MSG(state->ts_attach_buf, "hw_init_query_fw_cmd_fail"); - TAVOR_TNF_EXIT(tavor_hw_init); return (DDI_FAILURE); } if (tavor_fix_error_buf(state) != DDI_SUCCESS) { tavor_hw_fini(state, cleanup); - TNF_PROBE_0(tavor_hw_init_fixerrorbuf_fail, - TAVOR_TNF_ERROR, ""); TAVOR_ATTACH_MSG(state->ts_attach_buf, "hw_init_fixerrorbuf_fail"); - TAVOR_TNF_EXIT(tavor_hw_init); return (DDI_FAILURE); } @@ -1368,11 +1207,8 @@ tavor_hw_init(tavor_state_t *state) state->ts_fw.fw_rev_subminor); } tavor_hw_fini(state, cleanup); - TNF_PROBE_0(tavor_hw_init_checkfwver_fail, - TAVOR_TNF_ERROR, ""); TAVOR_ATTACH_MSG(state->ts_attach_buf, "hw_init_checkfwver_fail"); - TAVOR_TNF_EXIT(tavor_hw_init); return (DDI_FAILURE); } @@ -1390,11 +1226,8 @@ retry: cmn_err(CE_CONT, "Tavor: MOD_STAT_CFG command failed: %08x\n", status); tavor_hw_fini(state, cleanup); - TNF_PROBE_0(tavor_hw_init_mod_stat_cfg_cmd_fail, - TAVOR_TNF_ERROR, ""); TAVOR_ATTACH_MSG(state->ts_attach_buf, "hw_init_mod_stat_cfg_cmd_fail"); - TAVOR_TNF_EXIT(tavor_hw_init); return (DDI_FAILURE); } @@ -1406,11 +1239,8 @@ retry: cmn_err(CE_CONT, "Tavor: QUERY_DEV_LIM command failed: %08x\n", status); tavor_hw_fini(state, cleanup); - TNF_PROBE_0(tavor_hw_init_query_devlim_cmd_fail, - TAVOR_TNF_ERROR, ""); TAVOR_ATTACH_MSG(state->ts_attach_buf, "hw_init_query_devlim_cmd_fail"); - TAVOR_TNF_EXIT(tavor_hw_init); return (DDI_FAILURE); } @@ -1418,9 +1248,7 @@ retry: status = tavor_cfg_profile_init_phase2(state); if (status != DDI_SUCCESS) { tavor_hw_fini(state, cleanup); - TNF_PROBE_0(tavor_hw_init_cfginit2_fail, TAVOR_TNF_ERROR, ""); TAVOR_ATTACH_MSG(state->ts_attach_buf, "hw_init_cfginit2_fail"); - TAVOR_TNF_EXIT(tavor_hw_init); return (DDI_FAILURE); } @@ -1428,10 +1256,8 @@ retry: status = tavor_rsrc_init_phase2(state); if (status != DDI_SUCCESS) { tavor_hw_fini(state, cleanup); - TNF_PROBE_0(tavor_hw_init_rsrcinit2_fail, TAVOR_TNF_ERROR, ""); TAVOR_ATTACH_MSG(state->ts_attach_buf, "hw_init_rsrcinit2_fail"); - TAVOR_TNF_EXIT(tavor_hw_init); return (DDI_FAILURE); } cleanup = TAVOR_DRV_CLEANUP_LEVEL7; @@ -1444,11 +1270,8 @@ retry: cmn_err(CE_CONT, "Tavor: QUERY_ADAPTER command failed: %08x\n", status); tavor_hw_fini(state, cleanup); - TNF_PROBE_0(tavor_hw_init_query_adapter_cmd_fail, - TAVOR_TNF_ERROR, ""); TAVOR_ATTACH_MSG(state->ts_attach_buf, "hw_init_query_adapter_cmd_fail"); - TAVOR_TNF_EXIT(tavor_hw_init); return (DDI_FAILURE); } @@ -1462,11 +1285,8 @@ retry: cmn_err(CE_CONT, "Tavor: INIT_HCA command failed: %08x\n", status); tavor_hw_fini(state, cleanup); - TNF_PROBE_0(tavor_hw_init_init_hca_cmd_fail, - TAVOR_TNF_ERROR, ""); TAVOR_ATTACH_MSG(state->ts_attach_buf, "hw_init_init_hca_cmd_fail"); - TAVOR_TNF_EXIT(tavor_hw_init); return (DDI_FAILURE); } cleanup = TAVOR_DRV_CLEANUP_LEVEL8; @@ -1475,11 +1295,8 @@ retry: status = tavor_pd_alloc(state, &state->ts_pdhdl_internal, TAVOR_SLEEP); if (status != DDI_SUCCESS) { tavor_hw_fini(state, cleanup); - TNF_PROBE_0(tavor_hw_init_internal_pd_alloc_fail, - TAVOR_TNF_ERROR, ""); TAVOR_ATTACH_MSG(state->ts_attach_buf, "hw_init_internal_pd_alloc_fail"); - TAVOR_TNF_EXIT(tavor_hw_init); return (DDI_FAILURE); } cleanup = TAVOR_DRV_CLEANUP_LEVEL9; @@ -1488,11 +1305,8 @@ retry: status = tavor_internal_uarpgs_init(state); if (status != DDI_SUCCESS) { tavor_hw_fini(state, cleanup); - TNF_PROBE_0(tavor_hw_init_internal_uarpgs_alloc_fail, - TAVOR_TNF_ERROR, ""); TAVOR_ATTACH_MSG(state->ts_attach_buf, "hw_init_internal_uarpgs_alloc_fail"); - TAVOR_TNF_EXIT(tavor_hw_init); return (DDI_FAILURE); } cleanup = TAVOR_DRV_CLEANUP_LEVEL10; @@ -1501,11 +1315,8 @@ retry: status = tavor_intr_or_msi_init(state); if (status != DDI_SUCCESS) { tavor_hw_fini(state, cleanup); - TNF_PROBE_0(tavor_intr_or_msi_init_fail, - TAVOR_TNF_ERROR, ""); TAVOR_ATTACH_MSG(state->ts_attach_buf, "intr_or_msi_init_fail"); - TAVOR_TNF_EXIT(tavor_hw_init); return (DDI_FAILURE); } cleanup = TAVOR_DRV_CLEANUP_LEVEL11; @@ -1514,10 +1325,8 @@ retry: status = tavor_eq_init_all(state); if (status != DDI_SUCCESS) { tavor_hw_fini(state, cleanup); - TNF_PROBE_0(tavor_hw_init_eqinitall_fail, TAVOR_TNF_ERROR, ""); TAVOR_ATTACH_MSG(state->ts_attach_buf, "hw_init_eqinitall_fail"); - TAVOR_TNF_EXIT(tavor_hw_init); return (DDI_FAILURE); } cleanup = TAVOR_DRV_CLEANUP_LEVEL12; @@ -1526,11 +1335,8 @@ retry: status = tavor_special_qp_contexts_reserve(state); if (status != DDI_SUCCESS) { tavor_hw_fini(state, cleanup); - TNF_PROBE_0(tavor_hw_init_reserve_special_qp_fail, - TAVOR_TNF_ERROR, ""); TAVOR_ATTACH_MSG(state->ts_attach_buf, "hw_init_reserve_special_qp_fail"); - TAVOR_TNF_EXIT(tavor_hw_init); return (DDI_FAILURE); } cleanup = TAVOR_DRV_CLEANUP_LEVEL13; @@ -1539,9 +1345,7 @@ retry: status = tavor_mcg_init(state); if (status != DDI_SUCCESS) { tavor_hw_fini(state, cleanup); - TNF_PROBE_0(tavor_hw_init_mcg_init_fail, TAVOR_TNF_ERROR, ""); TAVOR_ATTACH_MSG(state->ts_attach_buf, "hw_init_mcg_init_fail"); - TAVOR_TNF_EXIT(tavor_hw_init); return (DDI_FAILURE); } cleanup = TAVOR_DRV_CLEANUP_LEVEL14; @@ -1550,11 +1354,8 @@ retry: status = tavor_hca_port_init(state); if (status != DDI_SUCCESS) { tavor_hw_fini(state, cleanup); - TNF_PROBE_0(tavor_hw_init_hca_port_init_fail, - TAVOR_TNF_ERROR, ""); TAVOR_ATTACH_MSG(state->ts_attach_buf, "hw_init_hca_port_init_fail"); - TAVOR_TNF_EXIT(tavor_hw_init); return (DDI_FAILURE); } cleanup = TAVOR_DRV_CLEANUP_ALL; @@ -1566,11 +1367,8 @@ retry: cmn_err(CE_CONT, "Tavor: GetNodeInfo command failed: %08x\n", status); tavor_hw_fini(state, cleanup); - TNF_PROBE_0(tavor_hw_init_getnodeinfo_cmd_fail, - TAVOR_TNF_ERROR, ""); TAVOR_ATTACH_MSG(state->ts_attach_buf, "hw_init_getnodeinfo_cmd_fail"); - TAVOR_TNF_EXIT(tavor_hw_init); return (DDI_FAILURE); } @@ -1619,15 +1417,11 @@ retry: cmn_err(CE_CONT, "Tavor: GetNodeDesc command failed: %08x\n", status); tavor_hw_fini(state, cleanup); - TNF_PROBE_0(tavor_hw_init_getnodedesc_cmd_fail, - TAVOR_TNF_ERROR, ""); TAVOR_ATTACH_MSG(state->ts_attach_buf, "hw_init_getnodedesc_cmd_fail"); - TAVOR_TNF_EXIT(tavor_hw_init); return (DDI_FAILURE); } - TAVOR_TNF_EXIT(tavor_hw_init); return (DDI_SUCCESS); } @@ -1642,8 +1436,6 @@ tavor_hw_fini(tavor_state_t *state, tavor_drv_cleanup_level_t cleanup) uint_t num_ports; int status; - TAVOR_TNF_ENTER(tavor_hw_fini); - switch (cleanup) { /* * If we add more driver initialization steps that should be cleaned @@ -1675,9 +1467,6 @@ tavor_hw_fini(tavor_state_t *state, tavor_drv_cleanup_level_t cleanup) status = tavor_eq_fini_all(state); if (status != DDI_SUCCESS) { TAVOR_WARNING(state, "failed to teardown EQs"); - TNF_PROBE_0(tavor_hw_fini_eqfiniall_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_hw_fini); return; } /* FALLTHROUGH */ @@ -1686,9 +1475,6 @@ tavor_hw_fini(tavor_state_t *state, tavor_drv_cleanup_level_t cleanup) status = tavor_intr_or_msi_fini(state); if (status != DDI_SUCCESS) { TAVOR_WARNING(state, "failed to free intr/MSI"); - TNF_PROBE_0(tavor_hw_fini_intrmsifini_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_hw_fini); return; } /* FALLTHROUGH */ @@ -1707,9 +1493,6 @@ tavor_hw_fini(tavor_state_t *state, tavor_drv_cleanup_level_t cleanup) status = tavor_pd_free(state, &state->ts_pdhdl_internal); if (status != DDI_SUCCESS) { TAVOR_WARNING(state, "failed to free internal PD"); - TNF_PROBE_0(tavor_hw_fini_internal_pd_free_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_hw_fini); return; } /* FALLTHROUGH */ @@ -1724,9 +1507,6 @@ tavor_hw_fini(tavor_state_t *state, tavor_drv_cleanup_level_t cleanup) TAVOR_CMD_NOSLEEP_SPIN); if (status != TAVOR_CMD_SUCCESS) { TAVOR_WARNING(state, "failed to shutdown HCA"); - TNF_PROBE_0(tavor_hw_fini_closehcacmd_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_hw_fini); return; } /* FALLTHROUGH */ @@ -1751,9 +1531,6 @@ tavor_hw_fini(tavor_state_t *state, tavor_drv_cleanup_level_t cleanup) status = tavor_sys_dis_cmd_post(state, TAVOR_CMD_NOSLEEP_SPIN); if (status != TAVOR_CMD_SUCCESS) { TAVOR_WARNING(state, "failed to shutdown hardware"); - TNF_PROBE_0(tavor_hw_fini_sys_dis_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_hw_fini); return; } /* FALLTHROUGH */ @@ -1781,12 +1558,8 @@ tavor_hw_fini(tavor_state_t *state, tavor_drv_cleanup_level_t cleanup) default: TAVOR_WARNING(state, "unexpected driver cleanup level"); - TNF_PROBE_0(tavor_hw_fini_default_fail, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_hw_fini); return; } - - TAVOR_TNF_EXIT(tavor_hw_fini); } @@ -1802,8 +1575,6 @@ tavor_soft_state_init(tavor_state_t *state) ibt_hca_flags_t caps = IBT_HCA_NO_FLAGS; int status; - TAVOR_TNF_ENTER(tavor_soft_state_init); - /* * The ibc_hca_info_t struct is passed to the IBTF. This is the * routine where we initialize it. Many of the init values come from @@ -1875,12 +1646,8 @@ tavor_soft_state_init(tavor_state_t *state) val = ((uint64_t)1 << state->ts_cfg_profile->cp_log_max_qp_sz); if (val > maxval) { kmem_free(hca_attr, sizeof (ibt_hca_attr_t)); - TNF_PROBE_2(tavor_soft_state_init_maxqpsz_toobig_fail, - TAVOR_TNF_ERROR, "", tnf_string, errmsg, "max QP size " - "exceeds device maximum", tnf_uint, maxsz, maxval); TAVOR_ATTACH_MSG(state->ts_attach_buf, "soft_state_init_maxqpsz_toobig_fail"); - TAVOR_TNF_EXIT(tavor_soft_state_init); return (DDI_FAILURE); } hca_attr->hca_max_qp_sz = val; @@ -1890,12 +1657,8 @@ tavor_soft_state_init(tavor_state_t *state) val = state->ts_cfg_profile->cp_wqe_max_sgl; if (val > maxval) { kmem_free(hca_attr, sizeof (ibt_hca_attr_t)); - TNF_PROBE_2(tavor_soft_state_init_toomanysgl_fail, - TAVOR_TNF_ERROR, "", tnf_string, errmsg, "number of sgl " - "exceeds device maximum", tnf_uint, maxsgl, maxval); TAVOR_ATTACH_MSG(state->ts_attach_buf, "soft_state_init_toomanysgl_fail"); - TAVOR_TNF_EXIT(tavor_soft_state_init); return (DDI_FAILURE); } /* If the rounded value for max SGL is too large, cap it */ @@ -1922,12 +1685,8 @@ tavor_soft_state_init(tavor_state_t *state) val = ((uint64_t)1 << state->ts_cfg_profile->cp_log_max_cq_sz) - 1; if (val > maxval) { kmem_free(hca_attr, sizeof (ibt_hca_attr_t)); - TNF_PROBE_2(tavor_soft_state_init_maxcqsz_toobig_fail, - TAVOR_TNF_ERROR, "", tnf_string, errmsg, "max CQ size " - "exceeds device maximum", tnf_uint, maxsz, maxval); TAVOR_ATTACH_MSG(state->ts_attach_buf, "soft_state_init_maxcqsz_toobig_fail"); - TAVOR_TNF_EXIT(tavor_soft_state_init); return (DDI_FAILURE); } hca_attr->hca_max_cq_sz = val; @@ -1946,12 +1705,8 @@ tavor_soft_state_init(tavor_state_t *state) if (val > maxval) { kmem_free(hca_attr, sizeof (ibt_hca_attr_t)); - TNF_PROBE_2(tavor_soft_state_init_maxsrqsz_toobig_fail, - TAVOR_TNF_ERROR, "", tnf_string, errmsg, "max SRQ size " - "exceeds device maximum", tnf_uint, maxsz, maxval); TAVOR_ATTACH_MSG(state->ts_attach_buf, "soft_state_init_maxsrqsz_toobig_fail"); - TAVOR_TNF_EXIT(tavor_soft_state_init); return (DDI_FAILURE); } hca_attr->hca_max_srqs_sz = val; @@ -1960,12 +1715,8 @@ tavor_soft_state_init(tavor_state_t *state) maxval = state->ts_devlim.max_sg; if (val > maxval) { kmem_free(hca_attr, sizeof (ibt_hca_attr_t)); - TNF_PROBE_2(tavor_soft_state_init_toomanysrqsgl_fail, - TAVOR_TNF_ERROR, "", tnf_string, errmsg, "number of srq " - "sgl exceeds device maximum", tnf_uint, maxsgl, maxval); TAVOR_ATTACH_MSG(state->ts_attach_buf, "soft_state_init_toomanysrqsgl_fail"); - TAVOR_TNF_EXIT(tavor_soft_state_init); return (DDI_FAILURE); } hca_attr->hca_max_srq_sgl = val; @@ -1994,12 +1745,8 @@ tavor_soft_state_init(tavor_state_t *state) val = state->ts_cfg_profile->cp_log_max_mrw_sz; if (val > maxval) { kmem_free(hca_attr, sizeof (ibt_hca_attr_t)); - TNF_PROBE_2(tavor_soft_state_init_maxmrwsz_toobig_fail, - TAVOR_TNF_ERROR, "", tnf_string, errmsg, "max mrw size " - "exceeds device maximum", tnf_uint, maxsz, maxval); TAVOR_ATTACH_MSG(state->ts_attach_buf, "soft_state_init_maxmrwsz_toobig_fail"); - TAVOR_TNF_EXIT(tavor_soft_state_init); return (DDI_FAILURE); } hca_attr->hca_max_memr_len = ((uint64_t)1 << val); @@ -2036,12 +1783,8 @@ tavor_soft_state_init(tavor_state_t *state) if (val > maxval) { kmem_free(hca_attr, sizeof (ibt_hca_attr_t)); - TNF_PROBE_2(tavor_soft_state_init_toomanypkey_fail, - TAVOR_TNF_ERROR, "", tnf_string, errmsg, "number of PKeys " - "exceeds device maximum", tnf_uint, maxpkey, maxval); TAVOR_ATTACH_MSG(state->ts_attach_buf, "soft_state_init_toomanypkey_fail"); - TAVOR_TNF_EXIT(tavor_soft_state_init); return (DDI_FAILURE); } hca_attr->hca_max_partitions = val; @@ -2051,12 +1794,8 @@ tavor_soft_state_init(tavor_state_t *state) val = state->ts_cfg_profile->cp_num_ports; if ((val > maxval) || (val == 0)) { kmem_free(hca_attr, sizeof (ibt_hca_attr_t)); - TNF_PROBE_2(tavor_soft_state_init_toomanyports_fail, - TAVOR_TNF_ERROR, "", tnf_string, errmsg, "number of ports " - "exceeds device maximum", tnf_uint, maxports, maxval); TAVOR_ATTACH_MSG(state->ts_attach_buf, "soft_state_init_toomanyports_fail"); - TAVOR_TNF_EXIT(tavor_soft_state_init); return (DDI_FAILURE); } hca_attr->hca_nports = val; @@ -2082,12 +1821,8 @@ tavor_soft_state_init(tavor_state_t *state) val = ((uint64_t)1 << state->ts_cfg_profile->cp_log_num_pd); if (val > maxval) { kmem_free(hca_attr, sizeof (ibt_hca_attr_t)); - TNF_PROBE_2(tavor_soft_state_init_toomanypd_fail, - TAVOR_TNF_ERROR, "", tnf_string, errmsg, "number of PD " - "exceeds device maximum", tnf_uint, maxpd, maxval); TAVOR_ATTACH_MSG(state->ts_attach_buf, "soft_state_init_toomanypd_fail"); - TAVOR_TNF_EXIT(tavor_soft_state_init); return (DDI_FAILURE); } hca_attr->hca_max_pd = val; @@ -2097,12 +1832,8 @@ tavor_soft_state_init(tavor_state_t *state) val = ((uint64_t)1 << state->ts_cfg_profile->cp_log_num_ah); if (val > maxval) { kmem_free(hca_attr, sizeof (ibt_hca_attr_t)); - TNF_PROBE_2(tavor_soft_state_init_toomanyah_fail, - TAVOR_TNF_ERROR, "", tnf_string, errmsg, "number of AH " - "exceeds device maximum", tnf_uint, maxah, maxval); TAVOR_ATTACH_MSG(state->ts_attach_buf, "soft_state_init_toomanyah_fail"); - TAVOR_TNF_EXIT(tavor_soft_state_init); return (DDI_FAILURE); } hca_attr->hca_max_ah = val; @@ -2135,15 +1866,11 @@ tavor_soft_state_init(tavor_state_t *state) mutex_destroy(&state->ts_fw_flashlock); mutex_destroy(&state->ts_uar_lock); kmem_free(hca_attr, sizeof (ibt_hca_attr_t)); - TNF_PROBE_0(tavor_soft_state_init_kstatinit_fail, - TAVOR_TNF_ERROR, ""); TAVOR_ATTACH_MSG(state->ts_attach_buf, "soft_state_init_kstatinit_fail"); - TAVOR_TNF_EXIT(tavor_soft_state_init); return (DDI_FAILURE); } - TAVOR_TNF_EXIT(tavor_soft_state_init); return (DDI_SUCCESS); } @@ -2155,8 +1882,6 @@ tavor_soft_state_init(tavor_state_t *state) static void tavor_soft_state_fini(tavor_state_t *state) { - TAVOR_TNF_ENTER(tavor_soft_state_fini); - /* Teardown the kstat info */ tavor_kstat_fini(state); @@ -2174,8 +1899,6 @@ tavor_soft_state_fini(tavor_state_t *state) /* Free up the hca_attr struct */ kmem_free(state->ts_ibtfinfo.hca_attr, sizeof (ibt_hca_attr_t)); - - TAVOR_TNF_EXIT(tavor_soft_state_fini); } @@ -2192,8 +1915,6 @@ tavor_hca_config_setup(tavor_state_t *state, uint64_t offset, addr; uint_t mcg_size; - TAVOR_TNF_ENTER(tavor_hca_config_setup); - /* Set "host endianness". Default is big endian */ #ifdef _LITTLE_ENDIAN inithca->big_endian = 0; @@ -2295,8 +2016,6 @@ tavor_hca_config_setup(tavor_state_t *state, inithca->uar.uarscr_baseaddr = addr; inithca->uar.uar_pg_sz = PAGESHIFT - 0xC; - - TAVOR_TNF_EXIT(tavor_hca_config_setup); } @@ -2314,8 +2033,6 @@ tavor_hca_port_init(tavor_state_t *state) uint64_t maxval, val; uint64_t sysimgguid, nodeguid, portguid; - TAVOR_TNF_ENTER(tavor_hca_port_init); - cfgprof = state->ts_cfg_profile; /* Get number of HCA ports */ @@ -2363,11 +2080,6 @@ tavor_hca_port_init(tavor_state_t *state) maxval = state->ts_devlim.max_mtu; val = cfgprof->cp_max_mtu; if (val > maxval) { - TNF_PROBE_2(tavor_hca_port_init_maxmtu_fail, - TAVOR_TNF_ERROR, "", tnf_string, errmsg, "max " - "MTU size exceeds device maximum", tnf_uint, - maxmtu, maxval); - TAVOR_TNF_EXIT(tavor_hca_port_init); goto init_ports_fail; } initib->mtu_cap = val; @@ -2376,11 +2088,6 @@ tavor_hca_port_init(tavor_state_t *state) maxval = state->ts_devlim.max_port_width; val = cfgprof->cp_max_port_width; if (val > maxval) { - TNF_PROBE_2(tavor_hca_port_init_maxportwidth_fail, - TAVOR_TNF_ERROR, "", tnf_string, errmsg, "max " - "port width exceeds device maximum", tnf_uint, - maxportwidth, maxval); - TAVOR_TNF_EXIT(tavor_hca_port_init); goto init_ports_fail; } initib->port_width_cap = val; @@ -2389,11 +2096,6 @@ tavor_hca_port_init(tavor_state_t *state) maxval = state->ts_devlim.max_vl; val = cfgprof->cp_max_vlcap; if (val > maxval) { - TNF_PROBE_2(tavor_hca_port_init_maxvlcap_fail, - TAVOR_TNF_ERROR, "", tnf_string, errmsg, "max " - "VLcap size exceeds device maximum", tnf_uint, - maxvlcap, maxval); - TAVOR_TNF_EXIT(tavor_hca_port_init); goto init_ports_fail; } initib->vl_cap = val; @@ -2402,11 +2104,6 @@ tavor_hca_port_init(tavor_state_t *state) maxval = ((uint64_t)1 << state->ts_devlim.log_max_gid); val = ((uint64_t)1 << cfgprof->cp_log_max_gidtbl); if (val > maxval) { - TNF_PROBE_2(tavor_hca_port_init_gidtable_fail, - TAVOR_TNF_ERROR, "", tnf_string, errmsg, "max " - "GID table size exceeds device maximum", tnf_uint, - maxgidtbl, maxval); - TAVOR_TNF_EXIT(tavor_hca_port_init); goto init_ports_fail; } initib->max_gid = val; @@ -2415,11 +2112,6 @@ tavor_hca_port_init(tavor_state_t *state) maxval = ((uint64_t)1 << state->ts_devlim.log_max_pkey); val = ((uint64_t)1 << cfgprof->cp_log_max_pkeytbl); if (val > maxval) { - TNF_PROBE_2(tavor_hca_port_init_pkeytable_fail, - TAVOR_TNF_ERROR, "", tnf_string, errmsg, "max " - "PKey table size exceeds device maximum", tnf_uint, - maxpkeytbl, maxval); - TAVOR_TNF_EXIT(tavor_hca_port_init); goto init_ports_fail; } initib->max_pkey = val; @@ -2434,17 +2126,12 @@ tavor_hca_port_init(tavor_state_t *state) if (status != TAVOR_CMD_SUCCESS) { cmn_err(CE_CONT, "Tavor: INIT_IB (port %02d) command " "failed: %08x\n", i + 1, status); - TNF_PROBE_2(tavor_hca_port_init_init_ib_cmd_fail, - TAVOR_TNF_ERROR, "", tnf_uint, cmd_status, status, - tnf_uint, port, i + 1); - TAVOR_TNF_EXIT(tavor_hca_port_init); goto init_ports_fail; } } /* Free up the memory for Tavor port init struct(s), return success */ kmem_free(portinits, num_ports * sizeof (tavor_hw_initib_t)); - TAVOR_TNF_EXIT(tavor_hca_port_init); return (DDI_SUCCESS); init_ports_fail: @@ -2455,7 +2142,6 @@ init_ports_fail: kmem_free(portinits, num_ports * sizeof (tavor_hw_initib_t)); (void) tavor_hca_ports_shutdown(state, i); - TAVOR_TNF_EXIT(tavor_hca_port_init); return (DDI_FAILURE); } @@ -2469,31 +2155,22 @@ tavor_hca_ports_shutdown(tavor_state_t *state, uint_t num_init) { int i, status; - TAVOR_TNF_ENTER(tavor_hca_ports_shutdown); - /* * Post commands to shutdown all init'd Tavor HCA ports. Note: if * any of these commands fail for any reason, it would be entirely * unexpected and probably indicative a serious problem (HW or SW). * Although we do return void from this function, this type of failure - * should not go unreported. That is why we have the warning message - * and the detailed TNF information. + * should not go unreported. */ for (i = 0; i < num_init; i++) { status = tavor_close_ib_cmd_post(state, i + 1, TAVOR_CMD_NOSLEEP_SPIN); if (status != TAVOR_CMD_SUCCESS) { TAVOR_WARNING(state, "failed to shutdown HCA port"); - TNF_PROBE_2(tavor_hca_ports_shutdown_close_ib_cmd_fail, - TAVOR_TNF_ERROR, "", tnf_uint, cmd_status, status, - tnf_uint, port, i + 1); - TAVOR_TNF_EXIT(tavor_hca_ports_shutdown); return (status); } } - TAVOR_TNF_EXIT(tavor_hca_ports_shutdown); - return (TAVOR_CMD_SUCCESS); } @@ -2507,8 +2184,6 @@ tavor_internal_uarpgs_init(tavor_state_t *state) { int status; - TAVOR_TNF_ENTER(tavor_internal_uarpgs_init); - /* * Save away reserved Tavor UAR page #0. This UAR page is not to * be used by software. @@ -2516,8 +2191,6 @@ tavor_internal_uarpgs_init(tavor_state_t *state) status = tavor_rsrc_alloc(state, TAVOR_UARPG, 1, TAVOR_SLEEP, &state->ts_uarpg0_rsrc_rsrvd); if (status != DDI_SUCCESS) { - TNF_PROBE_0(tavor_uarpg0_rsrcalloc_fail, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_internal_uarpgs_init); return (DDI_FAILURE); } @@ -2530,15 +2203,12 @@ tavor_internal_uarpgs_init(tavor_state_t *state) &state->ts_uarpg1_rsrc); if (status != DDI_SUCCESS) { tavor_rsrc_free(state, &state->ts_uarpg0_rsrc_rsrvd); - TNF_PROBE_0(tavor_uarpg1_rsrcalloc_fail, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_internal_uarpgs_init); return (DDI_FAILURE); } /* Setup pointer to UAR page #1 doorbells */ state->ts_uar = (tavor_hw_uar_t *)state->ts_uarpg1_rsrc->tr_addr; - TAVOR_TNF_EXIT(tavor_internal_uarpgs_init); return (DDI_SUCCESS); } @@ -2550,15 +2220,11 @@ tavor_internal_uarpgs_init(tavor_state_t *state) static void tavor_internal_uarpgs_fini(tavor_state_t *state) { - TAVOR_TNF_ENTER(tavor_internal_uarpgs_fini); - /* Free up Tavor UAR page #1 (kernel driver doorbells) */ tavor_rsrc_free(state, &state->ts_uarpg1_rsrc); /* Free up Tavor UAR page #0 (reserved) */ tavor_rsrc_free(state, &state->ts_uarpg0_rsrc_rsrvd); - - TAVOR_TNF_EXIT(tavor_internal_uarpgs_fini); } @@ -2572,8 +2238,6 @@ tavor_special_qp_contexts_reserve(tavor_state_t *state) tavor_rsrc_t *qp0_rsrc, *qp1_rsrc; int status; - TAVOR_TNF_ENTER(tavor_special_qp_contexts_reserve); - /* Initialize the lock used for special QP rsrc management */ mutex_init(&state->ts_spec_qplock, NULL, MUTEX_DRIVER, DDI_INTR_PRI(state->ts_intrmsi_pri)); @@ -2587,9 +2251,6 @@ tavor_special_qp_contexts_reserve(tavor_state_t *state) status = tavor_rsrc_alloc(state, TAVOR_QPC, 2, TAVOR_SLEEP, &qp0_rsrc); if (status != DDI_SUCCESS) { mutex_destroy(&state->ts_spec_qplock); - TNF_PROBE_0(tavor_special_qp_contexts_reserve_qp0_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_special_qp_contexts_reserve); return (DDI_FAILURE); } state->ts_spec_qp0 = qp0_rsrc; @@ -2604,14 +2265,10 @@ tavor_special_qp_contexts_reserve(tavor_state_t *state) if (status != DDI_SUCCESS) { tavor_rsrc_free(state, &qp0_rsrc); mutex_destroy(&state->ts_spec_qplock); - TNF_PROBE_0(tavor_special_qp_contexts_reserve_qp1_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_special_qp_contexts_reserve); return (DDI_FAILURE); } state->ts_spec_qp1 = qp1_rsrc; - TAVOR_TNF_EXIT(tavor_special_qp_contexts_reserve); return (DDI_SUCCESS); } @@ -2623,8 +2280,6 @@ tavor_special_qp_contexts_reserve(tavor_state_t *state) static void tavor_special_qp_contexts_unreserve(tavor_state_t *state) { - TAVOR_TNF_ENTER(tavor_special_qp_contexts_unreserve); - /* Unreserve contexts for QP1 */ tavor_rsrc_free(state, &state->ts_spec_qp1); @@ -2633,8 +2288,6 @@ tavor_special_qp_contexts_unreserve(tavor_state_t *state) /* Destroy the lock used for special QP rsrc management */ mutex_destroy(&state->ts_spec_qplock); - - TAVOR_TNF_EXIT(tavor_special_qp_contexts_unreserve); } @@ -2650,15 +2303,12 @@ tavor_sw_reset(tavor_state_t *state) uint32_t reset_delay; int status, i; - TAVOR_TNF_ENTER(tavor_sw_reset); - /* * If the configured software reset delay is set to zero, then we * will not attempt a software reset of the Tavor device. */ reset_delay = state->ts_cfg_profile->cp_sw_reset_delay; if (reset_delay == 0) { - TAVOR_TNF_EXIT(tavor_sw_reset); return (DDI_SUCCESS); } @@ -2692,9 +2342,6 @@ tavor_sw_reset(tavor_state_t *state) */ status = pci_config_setup(pdip, &phdl); if (status != DDI_SUCCESS) { - TNF_PROBE_0(tavor_sw_reset_pcicfg_p_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_sw_reset); return (DDI_FAILURE); } @@ -2779,7 +2426,6 @@ tavor_sw_reset(tavor_state_t *state) } } - TAVOR_TNF_EXIT(tavor_sw_reset); return (DDI_SUCCESS); } @@ -2793,8 +2439,6 @@ tavor_mcg_init(tavor_state_t *state) { uint_t mcg_tmp_sz; - TAVOR_TNF_ENTER(tavor_mcg_init); - /* * Allocate space for the MCG temporary copy buffer. This is * used by the Attach/Detach Multicast Group code @@ -2810,7 +2454,6 @@ tavor_mcg_init(tavor_state_t *state) mutex_init(&state->ts_mcglock, NULL, MUTEX_DRIVER, DDI_INTR_PRI(state->ts_intrmsi_pri)); - TAVOR_TNF_EXIT(tavor_mcg_init); return (DDI_SUCCESS); } @@ -2824,16 +2467,12 @@ tavor_mcg_fini(tavor_state_t *state) { uint_t mcg_tmp_sz; - TAVOR_TNF_ENTER(tavor_mcg_fini); - /* Free up the space used for the MCG temporary copy buffer */ mcg_tmp_sz = TAVOR_MCGMEM_SZ(state); kmem_free(state->ts_mcgtmp, mcg_tmp_sz); /* Destroy the multicast group mutex */ mutex_destroy(&state->ts_mcglock); - - TAVOR_TNF_EXIT(tavor_mcg_fini); } @@ -2931,8 +2570,6 @@ tavor_pci_capability_list(tavor_state_t *state, ddi_acc_handle_t hdl) { uint_t offset, data; - TAVOR_TNF_ENTER(tavor_pci_capability_list); - /* * Check for the "PCI Capabilities" bit in the "Status Register". * Bit 4 in this register indicates the presence of a "PCI @@ -2940,8 +2577,6 @@ tavor_pci_capability_list(tavor_state_t *state, ddi_acc_handle_t hdl) */ data = pci_config_get16(hdl, 0x6); if ((data & 0x10) == 0) { - TNF_PROBE_0(tavor_pci_capab_list_fail, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_pci_capability_list); return; } @@ -2980,8 +2615,6 @@ tavor_pci_capability_list(tavor_state_t *state, ddi_acc_handle_t hdl) /* Get offset of next entry in list */ offset = pci_config_get8(hdl, offset + 1); } - - TAVOR_TNF_EXIT(tavor_pci_capability_list); } /* @@ -2998,8 +2631,6 @@ tavor_pci_read_vpd(ddi_acc_handle_t hdl, uint_t offset, uint32_t addr, int vpd_addr = offset + 2; int vpd_data = offset + 4; - TAVOR_TNF_ENTER(tavor_pci_read_vpd); - /* * In order to read a 32-bit value from VPD, we are to write down * the address (offset in the VPD itself) to the address register. @@ -3013,13 +2644,10 @@ tavor_pci_read_vpd(ddi_acc_handle_t hdl, uint_t offset, uint32_t addr, val = pci_config_get16(hdl, vpd_addr); if ((val >> 15) & 0x01) { *data = pci_config_get32(hdl, vpd_data); - TAVOR_TNF_EXIT(tavor_pci_read_vpd); return (DDI_SUCCESS); } } while (--retry); - TNF_PROBE_0(tavor_pci_read_vpd_fail, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_pci_read_vpd); return (DDI_FAILURE); } @@ -3046,8 +2674,6 @@ tavor_pci_capability_vpd(tavor_state_t *state, ddi_acc_handle_t hdl, uchar_t vpd_char[TAVOR_VPD_HDR_BSIZE]; } vpd; - TAVOR_TNF_ENTER(tavor_pci_capability_vpd); - /* * Read Vital Product Data (VPD) from PCI-X capability. */ @@ -3118,12 +2744,9 @@ tavor_pci_capability_vpd(tavor_state_t *state, ddi_acc_handle_t hdl, vpd.vpd_char[0]); goto out; } - TAVOR_TNF_EXIT(tavor_pci_capability_vpd); return; out: state->ts_hca_pn_len = 0; - TNF_PROBE_0(tavor_pci_capability_vpd_fail, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_pci_capability_vpd); } /* @@ -3138,8 +2761,6 @@ tavor_pci_capability_pcix(tavor_state_t *state, ddi_acc_handle_t hdl, int max_out_splt_trans, max_mem_rd_byte_cnt; int designed_max_out_splt_trans, designed_max_mem_rd_byte_cnt; - TAVOR_TNF_ENTER(tavor_pci_capability_pcix); - /* * Query the current values for the PCI-X Command Register and * the PCI-X Status Register. @@ -3228,8 +2849,6 @@ tavor_pci_capability_pcix(tavor_state_t *state, ddi_acc_handle_t hdl, * values. */ pci_config_put16(hdl, offset + 2, command); - - TAVOR_TNF_EXIT(tavor_pci_capability_pcix); } @@ -3242,15 +2861,10 @@ tavor_intr_or_msi_init(tavor_state_t *state) { int status; - TAVOR_TNF_ENTER(tavor_intr_or_msi_init); - /* Query for the list of supported interrupt event types */ status = ddi_intr_get_supported_types(state->ts_dip, &state->ts_intr_types_avail); if (status != DDI_SUCCESS) { - TNF_PROBE_0(tavor_intr_or_msi_init_gettypes_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_intr_or_msi_init); return (DDI_FAILURE); } @@ -3267,7 +2881,6 @@ tavor_intr_or_msi_init(tavor_state_t *state) status = tavor_add_intrs(state, DDI_INTR_TYPE_MSI); if (status == DDI_SUCCESS) { state->ts_intr_type_chosen = DDI_INTR_TYPE_MSI; - TAVOR_TNF_EXIT(tavor_intr_or_msi_init); return (DDI_SUCCESS); } } @@ -3280,7 +2893,6 @@ tavor_intr_or_msi_init(tavor_state_t *state) status = tavor_add_intrs(state, DDI_INTR_TYPE_FIXED); if (status == DDI_SUCCESS) { state->ts_intr_type_chosen = DDI_INTR_TYPE_FIXED; - TAVOR_TNF_EXIT(tavor_intr_or_msi_init); return (DDI_SUCCESS); } } @@ -3288,7 +2900,6 @@ tavor_intr_or_msi_init(tavor_state_t *state) /* * Neither MSI or legacy interrupts were successful. return failure. */ - TAVOR_TNF_EXIT(tavor_intr_or_msi_setup); return (DDI_FAILURE); } @@ -3301,15 +2912,10 @@ tavor_add_intrs(tavor_state_t *state, int intr_type) { int status; - TAVOR_TNF_ENTER(tavor_add_intrs); - /* Get number of interrupts/MSI supported */ status = ddi_intr_get_nintrs(state->ts_dip, intr_type, &state->ts_intrmsi_count); if (status != DDI_SUCCESS) { - TNF_PROBE_0(tavor_add_intrs_getnintrs_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_add_intrs); return (DDI_FAILURE); } @@ -3317,17 +2923,11 @@ tavor_add_intrs(tavor_state_t *state, int intr_type) status = ddi_intr_get_navail(state->ts_dip, intr_type, &state->ts_intrmsi_avail); if (status != DDI_SUCCESS) { - TNF_PROBE_0(tavor_add_intrs_getnavail_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_add_intrs); return (DDI_FAILURE); } /* Ensure that we have at least one (1) usable MSI or interrupt */ if ((state->ts_intrmsi_avail < 1) || (state->ts_intrmsi_count < 1)) { - TNF_PROBE_0(tavor_add_intrs_notenoughts_intrmsi_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_add_intrs); return (DDI_FAILURE); } @@ -3336,17 +2936,11 @@ tavor_add_intrs(tavor_state_t *state, int intr_type) intr_type, 0, 1, &state->ts_intrmsi_allocd, DDI_INTR_ALLOC_STRICT); if (status != DDI_SUCCESS) { - TNF_PROBE_0(tavor_add_intrs_intralloc_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_add_intrs); return (DDI_FAILURE); } /* Ensure that we have allocated at least one (1) MSI or interrupt */ if (state->ts_intrmsi_allocd < 1) { - TNF_PROBE_0(tavor_add_intrs_noallocts_intrmsi_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_add_intrs); return (DDI_FAILURE); } @@ -3360,9 +2954,6 @@ tavor_add_intrs(tavor_state_t *state, int intr_type) /* Free the allocated interrupt/MSI handle */ (void) ddi_intr_free(state->ts_intrmsi_hdl); - TNF_PROBE_0(tavor_add_intrs_getpri_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_add_intrs); return (DDI_FAILURE); } @@ -3371,9 +2962,6 @@ tavor_add_intrs(tavor_state_t *state, int intr_type) /* Free the allocated interrupt/MSI handle */ (void) ddi_intr_free(state->ts_intrmsi_hdl); - TNF_PROBE_0(tavor_add_intrs_hilevelpri_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_add_intrs); return (DDI_FAILURE); } @@ -3384,13 +2972,9 @@ tavor_add_intrs(tavor_state_t *state, int intr_type) /* Free the allocated interrupt/MSI handle */ (void) ddi_intr_free(state->ts_intrmsi_hdl); - TNF_PROBE_0(tavor_add_intrs_getcap_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_add_intrs); return (DDI_FAILURE); } - TAVOR_TNF_EXIT(tavor_add_intrs); return (DDI_SUCCESS); } @@ -3404,18 +2988,12 @@ tavor_intr_or_msi_fini(tavor_state_t *state) { int status; - TAVOR_TNF_ENTER(tavor_intr_or_msi_fini); - /* Free the allocated interrupt/MSI handle */ status = ddi_intr_free(state->ts_intrmsi_hdl); if (status != DDI_SUCCESS) { - TNF_PROBE_0(tavor_intr_or_msi_fini_freehdl_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_intr_or_msi_fini); return (DDI_FAILURE); } - TAVOR_TNF_EXIT(tavor_intr_or_msi_fini); return (DDI_SUCCESS); } diff --git a/usr/src/uts/common/io/ib/adapters/tavor/tavor_agents.c b/usr/src/uts/common/io/ib/adapters/tavor/tavor_agents.c index eda0d0c31b..1aae24b050 100644 --- a/usr/src/uts/common/io/ib/adapters/tavor/tavor_agents.c +++ b/usr/src/uts/common/io/ib/adapters/tavor/tavor_agents.c @@ -63,14 +63,11 @@ int tavor_agent_handlers_init(tavor_state_t *state) { int status; - char *errormsg, *rsrc_name; - - TAVOR_TNF_ENTER(tavor_agent_handlers_init); + char *rsrc_name; /* Determine if we need to register any agents with the IBMF */ if ((state->ts_cfg_profile->cp_qp0_agents_in_fw) && (state->ts_cfg_profile->cp_qp1_agents_in_fw)) { - TAVOR_TNF_EXIT(tavor_agent_handlers_init); return (DDI_SUCCESS); } @@ -84,8 +81,6 @@ tavor_agent_handlers_init(tavor_state_t *state) /* Initialize the Tavor IB management agent list */ status = tavor_agent_list_init(state); if (status != DDI_SUCCESS) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(DDI_FAILURE, "failed agent list init"); goto agentsinit_fail; } @@ -99,8 +94,6 @@ tavor_agent_handlers_init(tavor_state_t *state) rsrc_name, TAVOR_TASKQ_NTHREADS, TASKQ_DEFAULTPRI, 0); if (state->ts_taskq_agents == NULL) { tavor_agent_list_fini(state); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(DDI_FAILURE, "failed task queue"); goto agentsinit_fail; } @@ -109,20 +102,14 @@ tavor_agent_handlers_init(tavor_state_t *state) if (status != DDI_SUCCESS) { ddi_taskq_destroy(state->ts_taskq_agents); tavor_agent_list_fini(state); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(DDI_FAILURE, "failed IBMF register"); goto agentsinit_fail; } kmem_free(rsrc_name, TAVOR_RSRC_NAME_MAXLEN); - TAVOR_TNF_EXIT(tavor_agent_handlers_init); return (DDI_SUCCESS); agentsinit_fail: kmem_free(rsrc_name, TAVOR_RSRC_NAME_MAXLEN); - TNF_PROBE_1(tavor_agent_handlers_init_fail, TAVOR_TNF_ERROR, "", - tnf_string, msg, errormsg); - TAVOR_TNF_EXIT(tavor_agent_handlers_init); return (status); } @@ -136,21 +123,15 @@ tavor_agent_handlers_fini(tavor_state_t *state) { int status; - TAVOR_TNF_ENTER(tavor_agent_handlers_fini); - /* Determine if we need to unregister any agents from the IBMF */ if ((state->ts_cfg_profile->cp_qp0_agents_in_fw) && (state->ts_cfg_profile->cp_qp1_agents_in_fw)) { - TAVOR_TNF_EXIT(tavor_agent_handlers_fini); return (DDI_SUCCESS); } /* Now attempt to unregister all of the agents from the IBMF */ status = tavor_agent_unregister_all(state, state->ts_num_agents); if (status != DDI_SUCCESS) { - TNF_PROBE_0(tavor_agent_handlers_fini_unreg_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_agent_handlers_fini); return (DDI_FAILURE); } @@ -167,7 +148,6 @@ tavor_agent_handlers_fini(tavor_state_t *state) /* Teardown the Tavor IB management agent list */ tavor_agent_list_fini(state); - TAVOR_TNF_EXIT(tavor_agent_handlers_fini); return (DDI_SUCCESS); } @@ -184,9 +164,6 @@ tavor_agent_request_cb(ibmf_handle_t ibmf_handle, ibmf_msg_t *msgp, tavor_agent_list_t *curr; tavor_state_t *state; int status; - int ibmf_status; - - TAVOR_TNF_ENTER(tavor_agent_request_cb); curr = (tavor_agent_list_t *)args; state = curr->agl_state; @@ -200,15 +177,7 @@ tavor_agent_request_cb(ibmf_handle_t ibmf_handle, ibmf_msg_t *msgp, cb_args = (tavor_agent_handler_arg_t *)kmem_zalloc( sizeof (tavor_agent_handler_arg_t), KM_NOSLEEP); if (cb_args == NULL) { - ibmf_status = ibmf_free_msg(ibmf_handle, &msgp); - if (ibmf_status != IBMF_SUCCESS) { - TNF_PROBE_1(tavor_agent_request_cb_ibmf_free_msg_fail, - TAVOR_TNF_ERROR, "", tnf_uint, ibmf_status, - ibmf_status); - } - TNF_PROBE_0(tavor_agent_request_cb_kma_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_agent_request_cb); + (void) ibmf_free_msg(ibmf_handle, &msgp); return; } _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*cb_args)) @@ -227,16 +196,8 @@ tavor_agent_request_cb(ibmf_handle_t ibmf_handle, ibmf_msg_t *msgp, tavor_agent_handle_req, cb_args, DDI_NOSLEEP); if (status == DDI_FAILURE) { kmem_free(cb_args, sizeof (tavor_agent_handler_arg_t)); - ibmf_status = ibmf_free_msg(ibmf_handle, &msgp); - if (ibmf_status != IBMF_SUCCESS) { - TNF_PROBE_1(tavor_agent_request_cb_ibmf_free_msg_fail, - TAVOR_TNF_ERROR, "", tnf_uint, ibmf_status, - ibmf_status); - } - TNF_PROBE_0(tavor_agent_request_cb_taskq_fail, - TAVOR_TNF_ERROR, ""); + (void) ibmf_free_msg(ibmf_handle, &msgp); } - TAVOR_TNF_EXIT(tavor_agent_request_cb); } /* @@ -257,8 +218,6 @@ tavor_agent_handle_req(void *cb_args) uint_t port; int status; - TAVOR_TNF_ENTER(tavor_agent_handle_req); - /* Extract the necessary info from the callback args parameter */ agent_args = (tavor_agent_handler_arg_t *)cb_args; ibmf_handle = agent_args->ahd_ibmfhdl; @@ -314,9 +273,6 @@ tavor_agent_handle_req(void *cb_args) (status != TAVOR_CMD_INSUFF_RSRC)) { cmn_err(CE_CONT, "Tavor: MAD_IFC (port %02d) " "command failed: %08x\n", port, status); - TNF_PROBE_1(tavor_agent_handle_req_madifc_fail, - TAVOR_TNF_ERROR, "", tnf_uint, cmd_status, - status); } /* finish cleanup */ @@ -349,27 +305,18 @@ tavor_agent_handle_req(void *cb_args) status = ibmf_msg_transport(ibmf_handle, IBMF_QP_HANDLE_DEFAULT, msgp, &retrans, tavor_agent_response_cb, state, 0); if (status != IBMF_SUCCESS) { - TNF_PROBE_1(tavor_ibmf_send_msg_fail, TAVOR_TNF_ERROR, "", - tnf_uint, ibmf_status, status); goto tavor_agent_handle_req_skip_response; } /* Free up the callback args parameter */ kmem_free(agent_args, sizeof (tavor_agent_handler_arg_t)); - TAVOR_TNF_EXIT(tavor_agent_handle_req); return; tavor_agent_handle_req_skip_response: /* Free up the ibmf message */ status = ibmf_free_msg(ibmf_handle, &msgp); - if (status != IBMF_SUCCESS) { - TNF_PROBE_1(tavor_agent_handle_req_ibmf_free_msg_fail, - TAVOR_TNF_ERROR, "", tnf_uint, ibmf_status, - status); - } /* Free up the callback args parameter */ kmem_free(agent_args, sizeof (tavor_agent_handler_arg_t)); - TAVOR_TNF_EXIT(tavor_agent_handle_req); } @@ -382,22 +329,12 @@ static void tavor_agent_response_cb(ibmf_handle_t ibmf_handle, ibmf_msg_t *msgp, void *args) { - int status; - - TAVOR_TNF_ENTER(tavor_agent_response_cb); - /* * It is the responsibility of each IBMF callback recipient to free * the packets that it has been given. Now that we are in the * response callback, we can be assured that it is safe to do so. */ - status = ibmf_free_msg(ibmf_handle, &msgp); - if (status != IBMF_SUCCESS) { - TNF_PROBE_1(tavor_agent_response_cb_ibmf_free_msg_fail, - TAVOR_TNF_ERROR, "", tnf_uint, ibmf_status, status); - } - - TAVOR_TNF_EXIT(tavor_agent_response_cb); + (void) ibmf_free_msg(ibmf_handle, &msgp); } @@ -416,8 +353,6 @@ tavor_agent_list_init(tavor_state_t *state) uint_t do_qp0, do_qp1; int i, j, indx; - TAVOR_TNF_ENTER(tavor_agent_list_init); - /* * Calculate the number of registered agents for each port * (SMA, PMA, and BMA) and determine whether or not to register @@ -457,9 +392,6 @@ tavor_agent_list_init(tavor_state_t *state) state->ts_agents = (tavor_agent_list_t *)kmem_zalloc(num_agents * sizeof (tavor_agent_list_t), KM_SLEEP); if (state->ts_agents == NULL) { - TNF_PROBE_0(tavor_agent_list_init_kma_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_agent_list_init); return (DDI_FAILURE); } @@ -490,7 +422,6 @@ tavor_agent_list_init(tavor_state_t *state) } } - TAVOR_TNF_EXIT(tavor_agent_list_init); return (DDI_SUCCESS); } @@ -502,13 +433,9 @@ tavor_agent_list_init(tavor_state_t *state) static void tavor_agent_list_fini(tavor_state_t *state) { - TAVOR_TNF_ENTER(tavor_agent_list_fini); - /* Free up the memory for the agent list entries */ kmem_free(state->ts_agents, state->ts_num_agents * sizeof (tavor_agent_list_t)); - - TAVOR_TNF_EXIT(tavor_agent_list_fini); } @@ -525,8 +452,6 @@ tavor_agent_register_all(tavor_state_t *state) ib_guid_t nodeguid; int i, status, num_registered; - TAVOR_TNF_ENTER(tavor_agent_register_all); - /* Get the Tavor NodeGUID from the softstate */ nodeguid = state->ts_ibtfinfo.hca_attr->hca_node_guid; @@ -548,8 +473,6 @@ tavor_agent_register_all(tavor_state_t *state) status = ibmf_register(&ibmf_reg, IBMF_VERSION, 0, NULL, NULL, &curr->agl_ibmfhdl, &impl_caps); if (status != IBMF_SUCCESS) { - TNF_PROBE_0(tavor_agent_register_all_ibmf_reg_fail, - TAVOR_TNF_ERROR, ""); goto agents_reg_fail; } @@ -558,19 +481,15 @@ tavor_agent_register_all(tavor_state_t *state) IBMF_QP_HANDLE_DEFAULT, tavor_agent_request_cb, curr, 0); if (status != IBMF_SUCCESS) { (void) ibmf_unregister(&curr->agl_ibmfhdl, 0); - TNF_PROBE_0(tavor_agent_register_all_ibmf_cb_fail, - TAVOR_TNF_ERROR, ""); goto agents_reg_fail; } num_registered++; } - TAVOR_TNF_EXIT(tavor_agent_register_all); return (DDI_SUCCESS); agents_reg_fail: (void) tavor_agent_unregister_all(state, num_registered); - TAVOR_TNF_EXIT(tavor_agent_register_all); return (DDI_FAILURE); } @@ -585,8 +504,6 @@ tavor_agent_unregister_all(tavor_state_t *state, int num_reg) tavor_agent_list_t *curr; int i, status; - TAVOR_TNF_ENTER(tavor_agent_unregister_all); - /* * For each registered agent in the agent list, teardown the * callbacks from the IBMF and unregister. @@ -598,23 +515,16 @@ tavor_agent_unregister_all(tavor_state_t *state, int num_reg) status = ibmf_tear_down_async_cb(curr->agl_ibmfhdl, IBMF_QP_HANDLE_DEFAULT, 0); if (status != IBMF_SUCCESS) { - TNF_PROBE_0(tavor_agents_unreg_teardown_cb_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_agent_unregister_all); return (DDI_FAILURE); } /* Unregister the agent from the IBMF */ status = ibmf_unregister(&curr->agl_ibmfhdl, 0); if (status != IBMF_SUCCESS) { - TNF_PROBE_0(tavor_agents_unreg_ibmf_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_agent_unregister_all); return (DDI_FAILURE); } } - TAVOR_TNF_EXIT(tavor_agent_unregister_all); return (DDI_SUCCESS); } diff --git a/usr/src/uts/common/io/ib/adapters/tavor/tavor_cfg.c b/usr/src/uts/common/io/ib/adapters/tavor/tavor_cfg.c index 319e396b88..73ffec621c 100644 --- a/usr/src/uts/common/io/ib/adapters/tavor/tavor_cfg.c +++ b/usr/src/uts/common/io/ib/adapters/tavor/tavor_cfg.c @@ -268,8 +268,6 @@ tavor_cfg_profile_init_phase1(tavor_state_t *state) { tavor_cfg_profile_t *cp; - TAVOR_TNF_ENTER(tavor_cfg_profile_init_phase1); - /* * Allocate space for the configuration profile structure */ @@ -350,8 +348,6 @@ tavor_cfg_profile_init_phase1(tavor_state_t *state) cp->cp_log_max_srq_sz = TAVOR_SRQ_SZ_SHIFT_MIN; } else { - TNF_PROBE_0(tavor_cfg_profile_invalid_dimmsz_fail, - TAVOR_TNF_ERROR, ""); return (DDI_FAILURE); } @@ -365,8 +361,6 @@ tavor_cfg_profile_init_phase1(tavor_state_t *state) /* Can't do both "streaming" and IOMMU bypass */ if (tavor_iommu_bypass != 0) { - TNF_PROBE_0(tavor_cfg_profile_streamingbypass_fail, - TAVOR_TNF_ERROR, ""); kmem_free(cp, sizeof (tavor_cfg_profile_t)); return (DDI_FAILURE); } @@ -383,7 +377,6 @@ tavor_cfg_profile_init_phase1(tavor_state_t *state) /* Attach the configuration profile to Tavor softstate */ state->ts_cfg_profile = cp; - TAVOR_TNF_EXIT(tavor_cfg_profile_init_phase1); return (DDI_SUCCESS); } @@ -396,8 +389,6 @@ tavor_cfg_profile_init_phase2(tavor_state_t *state) { tavor_cfg_profile_t *cp; - TAVOR_TNF_ENTER(tavor_cfg_profile_init_phase2); - /* Read the configuration profile from Tavor softstate */ cp = state->ts_cfg_profile; @@ -576,8 +567,6 @@ tavor_cfg_profile_init_phase2(tavor_state_t *state) cp->cp_max_mem_rd_byte_cnt = tavor_max_mem_rd_byte_cnt; } else { - TNF_PROBE_0(tavor_cfg_profile_invalid_dimmsz_fail, - TAVOR_TNF_ERROR, ""); return (DDI_FAILURE); } @@ -609,7 +598,6 @@ tavor_cfg_profile_init_phase2(tavor_state_t *state) /* Determine additional configuration from optional properties */ tavor_cfg_prop_lookup(state, cp); - TAVOR_TNF_EXIT(tavor_cfg_profile_init_phase2); return (DDI_SUCCESS); } @@ -621,14 +609,10 @@ tavor_cfg_profile_init_phase2(tavor_state_t *state) void tavor_cfg_profile_fini(tavor_state_t *state) { - TAVOR_TNF_ENTER(tavor_cfg_profile_fini); - /* * Free up the space for configuration profile */ kmem_free(state->ts_cfg_profile, sizeof (tavor_cfg_profile_t)); - - TAVOR_TNF_EXIT(tavor_cfg_profile_fini); } diff --git a/usr/src/uts/common/io/ib/adapters/tavor/tavor_ci.c b/usr/src/uts/common/io/ib/adapters/tavor/tavor_ci.c index d6278c87b1..002fed8453 100644 --- a/usr/src/uts/common/io/ib/adapters/tavor/tavor_ci.c +++ b/usr/src/uts/common/io/ib/adapters/tavor/tavor_ci.c @@ -368,13 +368,8 @@ tavor_ci_query_hca_ports(ibc_hca_hdl_t hca, uint8_t query_port, uint_t start, end, port; int status, indx; - TAVOR_TNF_ENTER(tavor_ci_query_hca_ports); - /* Check for valid HCA handle */ if (hca == NULL) { - TNF_PROBE_0(tavor_ci_query_hca_ports_invhca_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_query_port); return (IBT_HCA_HDL_INVALID); } @@ -398,14 +393,10 @@ tavor_ci_query_hca_ports(ibc_hca_hdl_t hca, uint8_t query_port, for (port = start, indx = 0; port <= end; port++, indx++) { status = tavor_port_query(state, port, &info_p[indx]); if (status != DDI_SUCCESS) { - TNF_PROBE_1(tavor_port_query_fail, TAVOR_TNF_ERROR, - "", tnf_uint, status, status); - TAVOR_TNF_EXIT(tavor_ci_query_hca_ports); return (status); } } - TAVOR_TNF_EXIT(tavor_ci_query_hca_ports); return (IBT_SUCCESS); } @@ -422,13 +413,8 @@ tavor_ci_modify_ports(ibc_hca_hdl_t hca, uint8_t port, tavor_state_t *state; int status; - TAVOR_TNF_ENTER(tavor_ci_modify_ports); - /* Check for valid HCA handle */ if (hca == NULL) { - TNF_PROBE_0(tavor_ci_modify_ports_invhca_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_modify_ports); return (IBT_HCA_HDL_INVALID); } @@ -438,13 +424,9 @@ tavor_ci_modify_ports(ibc_hca_hdl_t hca, uint8_t port, /* Modify the port(s) */ status = tavor_port_modify(state, port, flags, init_type); if (status != DDI_SUCCESS) { - TNF_PROBE_1(tavor_ci_modify_ports_fail, - TAVOR_TNF_ERROR, "", tnf_uint, status, status); - TAVOR_TNF_EXIT(tavor_ci_modify_ports); return (status); } - TAVOR_TNF_EXIT(tavor_ci_modify_ports); return (IBT_SUCCESS); } @@ -457,8 +439,6 @@ tavor_ci_modify_ports(ibc_hca_hdl_t hca, uint8_t port, static ibt_status_t tavor_ci_modify_system_image(ibc_hca_hdl_t hca, ib_guid_t sys_guid) { - TAVOR_TNF_ENTER(tavor_ci_modify_system_image); - /* * This is an unsupported interface for the Tavor driver. This * interface is necessary to support modification of the System @@ -466,7 +446,6 @@ tavor_ci_modify_system_image(ibc_hca_hdl_t hca, ib_guid_t sys_guid) * once (during driver initialization). */ - TAVOR_TNF_EXIT(tavor_ci_modify_system_image); return (IBT_NOT_SUPPORTED); } @@ -483,15 +462,10 @@ tavor_ci_alloc_pd(ibc_hca_hdl_t hca, ibt_pd_flags_t flags, ibc_pd_hdl_t *pd_p) tavor_pdhdl_t pdhdl; int status; - TAVOR_TNF_ENTER(tavor_ci_alloc_pd); - ASSERT(pd_p != NULL); /* Check for valid HCA handle */ if (hca == NULL) { - TNF_PROBE_0(tavor_ci_alloc_pd_invhca_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_alloc_pd); return (IBT_HCA_HDL_INVALID); } @@ -501,16 +475,12 @@ tavor_ci_alloc_pd(ibc_hca_hdl_t hca, ibt_pd_flags_t flags, ibc_pd_hdl_t *pd_p) /* Allocate the PD */ status = tavor_pd_alloc(state, &pdhdl, TAVOR_NOSLEEP); if (status != DDI_SUCCESS) { - TNF_PROBE_1(tavor_ci_alloc_pd_fail, TAVOR_TNF_ERROR, "", - tnf_uint, status, status); - TAVOR_TNF_EXIT(tavor_ci_alloc_pd); return (status); } /* Return the Tavor PD handle */ *pd_p = (ibc_pd_hdl_t)pdhdl; - TAVOR_TNF_EXIT(tavor_ci_alloc_pd); return (IBT_SUCCESS); } @@ -527,21 +497,13 @@ tavor_ci_free_pd(ibc_hca_hdl_t hca, ibc_pd_hdl_t pd) tavor_pdhdl_t pdhdl; int status; - TAVOR_TNF_ENTER(tavor_ci_free_pd); - /* Check for valid HCA handle */ if (hca == NULL) { - TNF_PROBE_0(tavor_ci_free_pd_invhca_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_free_pd); return (IBT_HCA_HDL_INVALID); } /* Check for valid PD handle pointer */ if (pd == NULL) { - TNF_PROBE_0(tavor_ci_free_pd_invpdhdl_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_free_pd); return (IBT_PD_HDL_INVALID); } @@ -552,13 +514,9 @@ tavor_ci_free_pd(ibc_hca_hdl_t hca, ibc_pd_hdl_t pd) /* Free the PD */ status = tavor_pd_free(state, &pdhdl); if (status != DDI_SUCCESS) { - TNF_PROBE_1(tavor_ci_free_pd_fail, TAVOR_TNF_ERROR, "", - tnf_uint, status, status); - TAVOR_TNF_EXIT(tavor_ci_free_pd); return (status); } - TAVOR_TNF_EXIT(tavor_ci_free_pd); return (IBT_SUCCESS); } @@ -573,15 +531,12 @@ static ibt_status_t tavor_ci_alloc_rdd(ibc_hca_hdl_t hca, ibc_rdd_flags_t flags, ibc_rdd_hdl_t *rdd_p) { - TAVOR_TNF_ENTER(tavor_ci_alloc_rdd); - /* * This is an unsupported interface for the Tavor driver. This * interface is necessary to support Reliable Datagram (RD) * operations. Tavor does not support RD. */ - TAVOR_TNF_EXIT(tavor_ci_alloc_rdd); return (IBT_NOT_SUPPORTED); } @@ -595,15 +550,12 @@ tavor_ci_alloc_rdd(ibc_hca_hdl_t hca, ibc_rdd_flags_t flags, static ibt_status_t tavor_ci_free_rdd(ibc_hca_hdl_t hca, ibc_rdd_hdl_t rdd) { - TAVOR_TNF_ENTER(tavor_ci_free_rdd); - /* * This is an unsupported interface for the Tavor driver. This * interface is necessary to support Reliable Datagram (RD) * operations. Tavor does not support RD. */ - TAVOR_TNF_EXIT(tavor_ci_free_rdd); return (IBT_NOT_SUPPORTED); } @@ -623,21 +575,13 @@ tavor_ci_alloc_ah(ibc_hca_hdl_t hca, ibt_ah_flags_t flags, ibc_pd_hdl_t pd, tavor_pdhdl_t pdhdl; int status; - TAVOR_TNF_ENTER(tavor_ci_alloc_ah); - /* Check for valid HCA handle */ if (hca == NULL) { - TNF_PROBE_0(tavor_ci_alloc_ah_invhca_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_alloc_ah); return (IBT_HCA_HDL_INVALID); } /* Check for valid PD handle pointer */ if (pd == NULL) { - TNF_PROBE_0(tavor_ci_alloc_ah_invpdhdl_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_alloc_ah); return (IBT_PD_HDL_INVALID); } @@ -648,16 +592,12 @@ tavor_ci_alloc_ah(ibc_hca_hdl_t hca, ibt_ah_flags_t flags, ibc_pd_hdl_t pd, /* Allocate the AH */ status = tavor_ah_alloc(state, pdhdl, attr_p, &ahhdl, TAVOR_NOSLEEP); if (status != DDI_SUCCESS) { - TNF_PROBE_1(tavor_ci_alloc_ah_fail, TAVOR_TNF_ERROR, "", - tnf_uint, status, status); - TAVOR_TNF_EXIT(tavor_ci_alloc_ah); return (status); } /* Return the Tavor AH handle */ *ah_p = (ibc_ah_hdl_t)ahhdl; - TAVOR_TNF_EXIT(tavor_ci_alloc_ah); return (IBT_SUCCESS); } @@ -674,21 +614,13 @@ tavor_ci_free_ah(ibc_hca_hdl_t hca, ibc_ah_hdl_t ah) tavor_ahhdl_t ahhdl; int status; - TAVOR_TNF_ENTER(tavor_ci_free_ah); - /* Check for valid HCA handle */ if (hca == NULL) { - TNF_PROBE_0(tavor_ci_free_ah_invhca_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_free_ah); return (IBT_HCA_HDL_INVALID); } /* Check for valid address handle pointer */ if (ah == NULL) { - TNF_PROBE_0(tavor_ci_free_ah_invahhdl_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_free_ah); return (IBT_AH_HDL_INVALID); } @@ -699,13 +631,9 @@ tavor_ci_free_ah(ibc_hca_hdl_t hca, ibc_ah_hdl_t ah) /* Free the AH */ status = tavor_ah_free(state, &ahhdl, TAVOR_NOSLEEP); if (status != DDI_SUCCESS) { - TNF_PROBE_1(tavor_ci_free_ah_fail, TAVOR_TNF_ERROR, "", - tnf_uint, status, status); - TAVOR_TNF_EXIT(tavor_ci_free_ah); return (status); } - TAVOR_TNF_EXIT(tavor_ci_free_ah); return (IBT_SUCCESS); } @@ -724,21 +652,13 @@ tavor_ci_query_ah(ibc_hca_hdl_t hca, ibc_ah_hdl_t ah, ibc_pd_hdl_t *pd_p, tavor_pdhdl_t pdhdl; int status; - TAVOR_TNF_ENTER(tavor_ci_query_ah); - /* Check for valid HCA handle */ if (hca == NULL) { - TNF_PROBE_0(tavor_ci_query_ah_invhca_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_query_ah); return (IBT_HCA_HDL_INVALID); } /* Check for valid address handle pointer */ if (ah == NULL) { - TNF_PROBE_0(tavor_ci_query_ah_invahhdl_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_query_ah); return (IBT_AH_HDL_INVALID); } @@ -749,16 +669,12 @@ tavor_ci_query_ah(ibc_hca_hdl_t hca, ibc_ah_hdl_t ah, ibc_pd_hdl_t *pd_p, /* Query the AH */ status = tavor_ah_query(state, ahhdl, &pdhdl, attr_p); if (status != DDI_SUCCESS) { - TNF_PROBE_1(tavor_ci_query_ah_fail, TAVOR_TNF_ERROR, "", - tnf_uint, status, status); - TAVOR_TNF_EXIT(tavor_ci_query_ah); return (status); } /* Return the Tavor PD handle */ *pd_p = (ibc_pd_hdl_t)pdhdl; - TAVOR_TNF_EXIT(tavor_ci_query_ah); return (IBT_SUCCESS); } @@ -775,21 +691,13 @@ tavor_ci_modify_ah(ibc_hca_hdl_t hca, ibc_ah_hdl_t ah, ibt_adds_vect_t *attr_p) tavor_ahhdl_t ahhdl; int status; - TAVOR_TNF_ENTER(tavor_ci_modify_ah); - /* Check for valid HCA handle */ if (hca == NULL) { - TNF_PROBE_0(tavor_ci_modify_ah_invhca_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_modify_ah); return (IBT_HCA_HDL_INVALID); } /* Check for valid address handle pointer */ if (ah == NULL) { - TNF_PROBE_0(tavor_ci_modify_ah_invahhdl_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_modify_ah); return (IBT_AH_HDL_INVALID); } @@ -800,13 +708,9 @@ tavor_ci_modify_ah(ibc_hca_hdl_t hca, ibc_ah_hdl_t ah, ibt_adds_vect_t *attr_p) /* Modify the AH */ status = tavor_ah_modify(state, ahhdl, attr_p); if (status != DDI_SUCCESS) { - TNF_PROBE_1(tavor_ci_modify_ah_fail, TAVOR_TNF_ERROR, "", - tnf_uint, status, status); - TAVOR_TNF_EXIT(tavor_ci_modify_ah); return (status); } - TAVOR_TNF_EXIT(tavor_ci_modify_ah); return (IBT_SUCCESS); } @@ -826,16 +730,11 @@ tavor_ci_alloc_qp(ibc_hca_hdl_t hca, ibtl_qp_hdl_t ibt_qphdl, tavor_qp_options_t op; int status; - TAVOR_TNF_ENTER(tavor_ci_alloc_qp); - _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*attr_p)) _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*queue_sizes_p)) /* Check for valid HCA handle */ if (hca == NULL) { - TNF_PROBE_0(tavor_ci_alloc_qp_invhca_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_alloc_qp); return (IBT_HCA_HDL_INVALID); } @@ -851,16 +750,12 @@ tavor_ci_alloc_qp(ibc_hca_hdl_t hca, ibtl_qp_hdl_t ibt_qphdl, op.qpo_wq_loc = state->ts_cfg_profile->cp_qp_wq_inddr; status = tavor_qp_alloc(state, &qpinfo, TAVOR_NOSLEEP, &op); if (status != DDI_SUCCESS) { - TNF_PROBE_1(tavor_ci_alloc_qp_fail, TAVOR_TNF_ERROR, "", - tnf_uint, status, status); - TAVOR_TNF_EXIT(tavor_ci_alloc_qp); return (status); } /* Return the Tavor QP handle */ *qp_p = (ibc_qp_hdl_t)qpinfo.qpi_qphdl; - TAVOR_TNF_EXIT(tavor_ci_alloc_qp); return (IBT_SUCCESS); } @@ -881,16 +776,11 @@ tavor_ci_alloc_special_qp(ibc_hca_hdl_t hca, uint8_t port, tavor_qp_options_t op; int status; - TAVOR_TNF_ENTER(tavor_ci_alloc_special_qp); - _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*attr_p)) _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*queue_sizes_p)) /* Check for valid HCA handle */ if (hca == NULL) { - TNF_PROBE_0(tavor_ci_alloc_special_qp_invhca_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_alloc_special_qp); return (IBT_HCA_HDL_INVALID); } @@ -906,16 +796,12 @@ tavor_ci_alloc_special_qp(ibc_hca_hdl_t hca, uint8_t port, op.qpo_wq_loc = state->ts_cfg_profile->cp_qp_wq_inddr; status = tavor_special_qp_alloc(state, &qpinfo, TAVOR_NOSLEEP, &op); if (status != DDI_SUCCESS) { - TNF_PROBE_1(tavor_ci_alloc_special_qp_fail, TAVOR_TNF_ERROR, - "", tnf_uint, status, status); - TAVOR_TNF_EXIT(tavor_ci_alloc_special_qp); return (status); } /* Return the Tavor QP handle */ *qp_p = (ibc_qp_hdl_t)qpinfo.qpi_qphdl; - TAVOR_TNF_EXIT(tavor_ci_alloc_special_qp); return (IBT_SUCCESS); } @@ -944,21 +830,13 @@ tavor_ci_free_qp(ibc_hca_hdl_t hca, ibc_qp_hdl_t qp, tavor_qphdl_t qphdl; int status; - TAVOR_TNF_ENTER(tavor_ci_free_qp); - /* Check for valid HCA handle */ if (hca == NULL) { - TNF_PROBE_0(tavor_ci_free_qp_invhca_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_free_qp); return (IBT_HCA_HDL_INVALID); } /* Check for valid QP handle pointer */ if (qp == NULL) { - TNF_PROBE_0(tavor_ci_free_qp_invqphdl_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_free_qp); return (IBT_QP_HDL_INVALID); } @@ -970,13 +848,9 @@ tavor_ci_free_qp(ibc_hca_hdl_t hca, ibc_qp_hdl_t qp, status = tavor_qp_free(state, &qphdl, free_qp_flags, qpnh_p, TAVOR_NOSLEEP); if (status != DDI_SUCCESS) { - TNF_PROBE_1(tavor_ci_free_qp_fail, TAVOR_TNF_ERROR, "", - tnf_uint, status, status); - TAVOR_TNF_EXIT(tavor_ci_free_qp); return (status); } - TAVOR_TNF_EXIT(tavor_ci_free_qp); return (IBT_SUCCESS); } @@ -992,21 +866,13 @@ tavor_ci_release_qpn(ibc_hca_hdl_t hca, ibc_qpn_hdl_t qpnh) tavor_state_t *state; tavor_qpn_entry_t *entry; - TAVOR_TNF_ENTER(tavor_ci_release_qpn); - /* Check for valid HCA handle */ if (hca == NULL) { - TNF_PROBE_0(tavor_ci_release_qpn_invhca_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_release_qpn); return (IBT_HCA_HDL_INVALID); } /* Check for valid QP handle pointer */ if (qpnh == NULL) { - TNF_PROBE_0(tavor_ci_release_qpn_invqpnhdl_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_release_qpn); return (IBT_QP_HDL_INVALID); } @@ -1017,7 +883,6 @@ tavor_ci_release_qpn(ibc_hca_hdl_t hca, ibc_qpn_hdl_t qpnh) /* Release the QP number */ tavor_qp_release_qpn(state, entry, TAVOR_QPN_RELEASE); - TAVOR_TNF_EXIT(tavor_ci_release_qpn); return (IBT_SUCCESS); } @@ -1035,21 +900,13 @@ tavor_ci_query_qp(ibc_hca_hdl_t hca, ibc_qp_hdl_t qp, tavor_qphdl_t qphdl; int status; - TAVOR_TNF_ENTER(tavor_ci_query_qp); - /* Check for valid HCA handle */ if (hca == NULL) { - TNF_PROBE_0(tavor_ci_query_qp_invhca_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_query_qp); return (IBT_HCA_HDL_INVALID); } /* Check for valid QP handle */ if (qp == NULL) { - TNF_PROBE_0(tavor_ci_query_qp_invqphdl_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_query_qp); return (IBT_QP_HDL_INVALID); } @@ -1060,13 +917,9 @@ tavor_ci_query_qp(ibc_hca_hdl_t hca, ibc_qp_hdl_t qp, /* Query the QP */ status = tavor_qp_query(state, qphdl, attr_p); if (status != DDI_SUCCESS) { - TNF_PROBE_1(tavor_ci_query_qp_fail, TAVOR_TNF_ERROR, "", - tnf_uint, status, status); - TAVOR_TNF_EXIT(tavor_ci_query_qp); return (status); } - TAVOR_TNF_EXIT(tavor_ci_query_qp); return (IBT_SUCCESS); } @@ -1085,21 +938,13 @@ tavor_ci_modify_qp(ibc_hca_hdl_t hca, ibc_qp_hdl_t qp, tavor_qphdl_t qphdl; int status; - TAVOR_TNF_ENTER(tavor_ci_modify_qp); - /* Check for valid HCA handle */ if (hca == NULL) { - TNF_PROBE_0(tavor_ci_modify_qp_invhca_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_modify_qp); return (IBT_HCA_HDL_INVALID); } /* Check for valid QP handle */ if (qp == NULL) { - TNF_PROBE_0(tavor_ci_modify_qp_invqphdl_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_modify_qp); return (IBT_QP_HDL_INVALID); } @@ -1110,13 +955,9 @@ tavor_ci_modify_qp(ibc_hca_hdl_t hca, ibc_qp_hdl_t qp, /* Modify the QP */ status = tavor_qp_modify(state, qphdl, flags, info_p, actual_sz); if (status != DDI_SUCCESS) { - TNF_PROBE_1(tavor_ci_modify_qp_fail, TAVOR_TNF_ERROR, "", - tnf_uint, status, status); - TAVOR_TNF_EXIT(tavor_ci_modify_qp); return (status); } - TAVOR_TNF_EXIT(tavor_ci_modify_qp); return (IBT_SUCCESS); } @@ -1135,13 +976,8 @@ tavor_ci_alloc_cq(ibc_hca_hdl_t hca, ibt_cq_hdl_t ibt_cqhdl, tavor_cqhdl_t cqhdl; int status; - TAVOR_TNF_ENTER(tavor_ci_alloc_cq); - /* Check for valid HCA handle */ if (hca == NULL) { - TNF_PROBE_0(tavor_ci_alloc_cq_invhca_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_alloc_cq); return (IBT_HCA_HDL_INVALID); } @@ -1152,16 +988,12 @@ tavor_ci_alloc_cq(ibc_hca_hdl_t hca, ibt_cq_hdl_t ibt_cqhdl, status = tavor_cq_alloc(state, ibt_cqhdl, attr_p, actual_size, &cqhdl, TAVOR_NOSLEEP); if (status != DDI_SUCCESS) { - TNF_PROBE_1(tavor_ci_alloc_cq_fail, TAVOR_TNF_ERROR, "", - tnf_uint, status, status); - TAVOR_TNF_EXIT(tavor_ci_alloc_cq); return (status); } /* Return the Tavor CQ handle */ *cq_p = (ibc_cq_hdl_t)cqhdl; - TAVOR_TNF_EXIT(tavor_ci_alloc_cq); return (IBT_SUCCESS); } @@ -1178,22 +1010,13 @@ tavor_ci_free_cq(ibc_hca_hdl_t hca, ibc_cq_hdl_t cq) tavor_cqhdl_t cqhdl; int status; - TAVOR_TNF_ENTER(tavor_ci_free_cq); - - /* Check for valid HCA handle */ if (hca == NULL) { - TNF_PROBE_0(tavor_ci_free_cq_invhca_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_free_cq); return (IBT_HCA_HDL_INVALID); } /* Check for valid CQ handle pointer */ if (cq == NULL) { - TNF_PROBE_0(tavor_ci_free_cq_invcqhdl_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_free_cq); return (IBT_CQ_HDL_INVALID); } @@ -1204,13 +1027,9 @@ tavor_ci_free_cq(ibc_hca_hdl_t hca, ibc_cq_hdl_t cq) /* Free the CQ */ status = tavor_cq_free(state, &cqhdl, TAVOR_NOSLEEP); if (status != DDI_SUCCESS) { - TNF_PROBE_1(tavor_ci_free_cq_fail, TAVOR_TNF_ERROR, "", - tnf_uint, status, status); - TAVOR_TNF_EXIT(tavor_ci_free_cq); return (status); } - TAVOR_TNF_EXIT(tavor_ci_free_cq); return (IBT_SUCCESS); } @@ -1226,21 +1045,13 @@ tavor_ci_query_cq(ibc_hca_hdl_t hca, ibc_cq_hdl_t cq, uint_t *entries_p, { tavor_cqhdl_t cqhdl; - TAVOR_TNF_ENTER(tavor_ci_query_cq); - /* Check for valid HCA handle */ if (hca == NULL) { - TNF_PROBE_0(tavor_ci_query_cq_invhca_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_query_cq); return (IBT_HCA_HDL_INVALID); } /* Check for valid CQ handle pointer */ if (cq == NULL) { - TNF_PROBE_0(tavor_ci_query_cq_invcqhdl, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_query_cq); return (IBT_CQ_HDL_INVALID); } @@ -1255,7 +1066,6 @@ tavor_ci_query_cq(ibc_hca_hdl_t hca, ibc_cq_hdl_t cq, uint_t *entries_p, *usec_p = 0; *hid_p = 0; - TAVOR_TNF_EXIT(tavor_ci_query_cq); return (IBT_SUCCESS); } @@ -1273,21 +1083,13 @@ tavor_ci_resize_cq(ibc_hca_hdl_t hca, ibc_cq_hdl_t cq, uint_t size, tavor_cqhdl_t cqhdl; int status; - TAVOR_TNF_ENTER(tavor_ci_resize_cq); - /* Check for valid HCA handle */ if (hca == NULL) { - TNF_PROBE_0(tavor_ci_resize_cq_invhca_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_resize_cq); return (IBT_HCA_HDL_INVALID); } /* Check for valid CQ handle pointer */ if (cq == NULL) { - TNF_PROBE_0(tavor_ci_resize_cq_invcqhdl_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_resize_cq); return (IBT_CQ_HDL_INVALID); } @@ -1299,13 +1101,9 @@ tavor_ci_resize_cq(ibc_hca_hdl_t hca, ibc_cq_hdl_t cq, uint_t size, status = tavor_cq_resize(state, cqhdl, size, actual_size, TAVOR_NOSLEEP); if (status != DDI_SUCCESS) { - TNF_PROBE_1(tavor_ci_resize_cq_fail, TAVOR_TNF_ERROR, "", - tnf_uint, status, status); - TAVOR_TNF_EXIT(tavor_ci_resize_cq); return (status); } - TAVOR_TNF_EXIT(tavor_ci_resize_cq); return (IBT_SUCCESS); } @@ -1375,15 +1173,12 @@ static ibt_status_t tavor_ci_alloc_eec(ibc_hca_hdl_t hca, ibc_eec_flags_t flags, ibt_eec_hdl_t ibt_eec, ibc_rdd_hdl_t rdd, ibc_eec_hdl_t *eec_p) { - TAVOR_TNF_ENTER(tavor_ci_alloc_eec); - /* * This is an unsupported interface for the Tavor driver. This * interface is necessary to support Reliable Datagram (RD) * operations. Tavor does not support RD. */ - TAVOR_TNF_EXIT(tavor_ci_alloc_eec); return (IBT_NOT_SUPPORTED); } @@ -1397,15 +1192,12 @@ tavor_ci_alloc_eec(ibc_hca_hdl_t hca, ibc_eec_flags_t flags, static ibt_status_t tavor_ci_free_eec(ibc_hca_hdl_t hca, ibc_eec_hdl_t eec) { - TAVOR_TNF_ENTER(tavor_ci_free_eec); - /* * This is an unsupported interface for the Tavor driver. This * interface is necessary to support Reliable Datagram (RD) * operations. Tavor does not support RD. */ - TAVOR_TNF_EXIT(tavor_ci_free_eec); return (IBT_NOT_SUPPORTED); } @@ -1420,15 +1212,12 @@ static ibt_status_t tavor_ci_query_eec(ibc_hca_hdl_t hca, ibc_eec_hdl_t eec, ibt_eec_query_attr_t *attr_p) { - TAVOR_TNF_ENTER(tavor_ci_query_eec); - /* * This is an unsupported interface for the Tavor driver. This * interface is necessary to support Reliable Datagram (RD) * operations. Tavor does not support RD. */ - TAVOR_TNF_EXIT(tavor_ci_query_eec); return (IBT_NOT_SUPPORTED); } @@ -1443,15 +1232,12 @@ static ibt_status_t tavor_ci_modify_eec(ibc_hca_hdl_t hca, ibc_eec_hdl_t eec, ibt_cep_modify_flags_t flags, ibt_eec_info_t *info_p) { - TAVOR_TNF_ENTER(tavor_ci_query_eec); - /* * This is an unsupported interface for the Tavor driver. This * interface is necessary to support Reliable Datagram (RD) * operations. Tavor does not support RD. */ - TAVOR_TNF_EXIT(tavor_ci_query_eec); return (IBT_NOT_SUPPORTED); } @@ -1473,8 +1259,6 @@ tavor_ci_register_mr(ibc_hca_hdl_t hca, ibc_pd_hdl_t pd, tavor_mrhdl_t mrhdl; int status; - TAVOR_TNF_ENTER(tavor_ci_register_mr); - _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*mr_desc)) ASSERT(mr_attr != NULL); @@ -1483,17 +1267,11 @@ tavor_ci_register_mr(ibc_hca_hdl_t hca, ibc_pd_hdl_t pd, /* Check for valid HCA handle */ if (hca == NULL) { - TNF_PROBE_0(tavor_ci_register_mr_invhca_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_register_mr); return (IBT_HCA_HDL_INVALID); } /* Check for valid PD handle pointer */ if (pd == NULL) { - TNF_PROBE_0(tavor_ci_register_mr_invpdhdl_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_register_mr); return (IBT_PD_HDL_INVALID); } @@ -1504,9 +1282,6 @@ tavor_ci_register_mr(ibc_hca_hdl_t hca, ibc_pd_hdl_t pd, if (((mr_attr->mr_flags & IBT_MR_ENABLE_REMOTE_WRITE) || (mr_attr->mr_flags & IBT_MR_ENABLE_REMOTE_ATOMIC)) && !(mr_attr->mr_flags & IBT_MR_ENABLE_LOCAL_WRITE)) { - TNF_PROBE_0(tavor_ci_register_mr_inv_accflags_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_register_mr); return (IBT_MR_ACCESS_REQ_INVALID); } @@ -1520,9 +1295,6 @@ tavor_ci_register_mr(ibc_hca_hdl_t hca, ibc_pd_hdl_t pd, op.mro_bind_override_addr = 0; status = tavor_mr_register(state, pdhdl, mr_attr, &mrhdl, &op); if (status != DDI_SUCCESS) { - TNF_PROBE_1(tavor_ci_register_mr_fail, TAVOR_TNF_ERROR, "", - tnf_uint, status, status); - TAVOR_TNF_EXIT(tavor_ci_register_mr); return (status); } _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*mrhdl)) @@ -1547,7 +1319,6 @@ tavor_ci_register_mr(ibc_hca_hdl_t hca, ibc_pd_hdl_t pd, /* Return the Tavor MR handle */ *mr_p = (ibc_mr_hdl_t)mrhdl; - TAVOR_TNF_EXIT(tavor_ci_register_mr); return (IBT_SUCCESS); } @@ -1570,8 +1341,6 @@ tavor_ci_register_buf(ibc_hca_hdl_t hca, ibc_pd_hdl_t pd, int status; ibt_mr_flags_t flags = attrp->mr_flags; - TAVOR_TNF_ENTER(tavor_ci_register_buf); - _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*mr_desc)) ASSERT(mr_p != NULL); @@ -1579,17 +1348,11 @@ tavor_ci_register_buf(ibc_hca_hdl_t hca, ibc_pd_hdl_t pd, /* Check for valid HCA handle */ if (hca == NULL) { - TNF_PROBE_0(tavor_ci_register_buf_invhca_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_register_buf); return (IBT_HCA_HDL_INVALID); } /* Check for valid PD handle pointer */ if (pd == NULL) { - TNF_PROBE_0(tavor_ci_register_buf_invpdhdl_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_register_buf); return (IBT_PD_HDL_INVALID); } @@ -1600,9 +1363,6 @@ tavor_ci_register_buf(ibc_hca_hdl_t hca, ibc_pd_hdl_t pd, if (((flags & IBT_MR_ENABLE_REMOTE_WRITE) || (flags & IBT_MR_ENABLE_REMOTE_ATOMIC)) && !(flags & IBT_MR_ENABLE_LOCAL_WRITE)) { - TNF_PROBE_0(tavor_ci_register_buf_accflags_inv, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_register_buf); return (IBT_MR_ACCESS_REQ_INVALID); } @@ -1616,9 +1376,6 @@ tavor_ci_register_buf(ibc_hca_hdl_t hca, ibc_pd_hdl_t pd, op.mro_bind_override_addr = 0; status = tavor_mr_register_buf(state, pdhdl, attrp, buf, &mrhdl, &op); if (status != DDI_SUCCESS) { - TNF_PROBE_1(tavor_ci_register_mr_fail, TAVOR_TNF_ERROR, "", - tnf_uint, status, status); - TAVOR_TNF_EXIT(tavor_ci_register_mr); return (status); } _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*mrhdl)) @@ -1643,7 +1400,6 @@ tavor_ci_register_buf(ibc_hca_hdl_t hca, ibc_pd_hdl_t pd, /* Return the Tavor MR handle */ *mr_p = (ibc_mr_hdl_t)mrhdl; - TAVOR_TNF_EXIT(tavor_ci_register_buf); return (IBT_SUCCESS); } @@ -1660,21 +1416,13 @@ tavor_ci_deregister_mr(ibc_hca_hdl_t hca, ibc_mr_hdl_t mr) tavor_mrhdl_t mrhdl; int status; - TAVOR_TNF_ENTER(tavor_ci_deregister_mr); - /* Check for valid HCA handle */ if (hca == NULL) { - TNF_PROBE_0(tavor_ci_deregister_mr_invhca_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_deregister_mr); return (IBT_HCA_HDL_INVALID); } /* Check for valid memory region handle */ if (mr == NULL) { - TNF_PROBE_0(tavor_ci_deregister_mr_invmrhdl_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_deregister_mr); return (IBT_MR_HDL_INVALID); } @@ -1688,13 +1436,9 @@ tavor_ci_deregister_mr(ibc_hca_hdl_t hca, ibc_mr_hdl_t mr) status = tavor_mr_deregister(state, &mrhdl, TAVOR_MR_DEREG_ALL, TAVOR_NOSLEEP); if (status != DDI_SUCCESS) { - TNF_PROBE_1(tavor_ci_deregister_mr_fail, - TAVOR_TNF_ERROR, "", tnf_uint, status, status); - TAVOR_TNF_EXIT(tavor_ci_deregister_mr); return (status); } - TAVOR_TNF_EXIT(tavor_ci_deregister_mr); return (IBT_SUCCESS); } @@ -1712,23 +1456,15 @@ tavor_ci_query_mr(ibc_hca_hdl_t hca, ibc_mr_hdl_t mr, tavor_mrhdl_t mrhdl; int status; - TAVOR_TNF_ENTER(tavor_ci_query_mr); - ASSERT(mr_attr != NULL); /* Check for valid HCA handle */ if (hca == NULL) { - TNF_PROBE_0(tavor_ci_query_mr_invhca_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_query_mr); return (IBT_HCA_HDL_INVALID); } /* Check for MemRegion handle */ if (mr == NULL) { - TNF_PROBE_0(tavor_ci_query_mr_invmrhdl_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_query_mr); return (IBT_MR_HDL_INVALID); } @@ -1739,13 +1475,9 @@ tavor_ci_query_mr(ibc_hca_hdl_t hca, ibc_mr_hdl_t mr, /* Query the memory region */ status = tavor_mr_query(state, mrhdl, mr_attr); if (status != DDI_SUCCESS) { - TNF_PROBE_1(tavor_ci_query_mr_fail, TAVOR_TNF_ERROR, "", - tnf_uint, status, status); - TAVOR_TNF_EXIT(tavor_ci_query_mr); return (status); } - TAVOR_TNF_EXIT(tavor_ci_query_mr); return (IBT_SUCCESS); } @@ -1766,8 +1498,6 @@ tavor_ci_register_shared_mr(ibc_hca_hdl_t hca, ibc_mr_hdl_t mr, tavor_mrhdl_t mrhdl, mrhdl_new; int status; - TAVOR_TNF_ENTER(tavor_ci_register_shared_mr); - _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*mr_desc)) ASSERT(mr_attr != NULL); @@ -1776,25 +1506,16 @@ tavor_ci_register_shared_mr(ibc_hca_hdl_t hca, ibc_mr_hdl_t mr, /* Check for valid HCA handle */ if (hca == NULL) { - TNF_PROBE_0(tavor_ci_register_shared_mr_invhca_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_register_shared_mr); return (IBT_HCA_HDL_INVALID); } /* Check for valid PD handle pointer */ if (pd == NULL) { - TNF_PROBE_0(tavor_ci_register_shared_mr_invpdhdl_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_register_shared_mr); return (IBT_PD_HDL_INVALID); } /* Check for valid memory region handle */ if (mr == NULL) { - TNF_PROBE_0(tavor_ci_register_shared_mr_invmrhdl_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_register_shared_mr); return (IBT_MR_HDL_INVALID); } /* @@ -1804,9 +1525,6 @@ tavor_ci_register_shared_mr(ibc_hca_hdl_t hca, ibc_mr_hdl_t mr, if (((mr_attr->mr_flags & IBT_MR_ENABLE_REMOTE_WRITE) || (mr_attr->mr_flags & IBT_MR_ENABLE_REMOTE_ATOMIC)) && !(mr_attr->mr_flags & IBT_MR_ENABLE_LOCAL_WRITE)) { - TNF_PROBE_0(tavor_ci_register_shared_mr_accflags_inv, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_register_shared_mr); return (IBT_MR_ACCESS_REQ_INVALID); } @@ -1819,9 +1537,6 @@ tavor_ci_register_shared_mr(ibc_hca_hdl_t hca, ibc_mr_hdl_t mr, status = tavor_mr_register_shared(state, mrhdl, pdhdl, mr_attr, &mrhdl_new); if (status != DDI_SUCCESS) { - TNF_PROBE_1(tavor_ci_register_shared_mr_fail, TAVOR_TNF_ERROR, - "", tnf_uint, status, status); - TAVOR_TNF_EXIT(tavor_ci_register_shared_mr); return (status); } _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*mrhdl_new)) @@ -1846,7 +1561,6 @@ tavor_ci_register_shared_mr(ibc_hca_hdl_t hca, ibc_mr_hdl_t mr, /* Return the Tavor MR handle */ *mr_p = (ibc_mr_hdl_t)mrhdl_new; - TAVOR_TNF_EXIT(tavor_ci_register_mr); return (IBT_SUCCESS); } @@ -1868,8 +1582,6 @@ tavor_ci_reregister_mr(ibc_hca_hdl_t hca, ibc_mr_hdl_t mr, ibc_pd_hdl_t pd, tavor_mrhdl_t mrhdl, mrhdl_new; int status; - TAVOR_TNF_ENTER(tavor_ci_reregister_mr); - _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*mr_desc)) ASSERT(mr_attr != NULL); @@ -1878,17 +1590,11 @@ tavor_ci_reregister_mr(ibc_hca_hdl_t hca, ibc_mr_hdl_t mr, ibc_pd_hdl_t pd, /* Check for valid HCA handle */ if (hca == NULL) { - TNF_PROBE_0(tavor_ci_reregister_mr_hca_inv, TAVOR_TNF_ERROR, - ""); - TAVOR_TNF_EXIT(tavor_ci_reregister_mr); return (IBT_HCA_HDL_INVALID); } /* Check for valid memory region handle */ if (mr == NULL) { - TNF_PROBE_0(tavor_ci_reregister_mr_invmrhdl_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_reregister_mr); return (IBT_MR_HDL_INVALID); } @@ -1902,9 +1608,6 @@ tavor_ci_reregister_mr(ibc_hca_hdl_t hca, ibc_mr_hdl_t mr, ibc_pd_hdl_t pd, status = tavor_mr_reregister(state, mrhdl, pdhdl, mr_attr, &mrhdl_new, &op); if (status != DDI_SUCCESS) { - TNF_PROBE_1(tavor_ci_reregister_mr_fail, TAVOR_TNF_ERROR, "", - tnf_uint, status, status); - TAVOR_TNF_EXIT(tavor_ci_reregister_mr); return (status); } _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*mrhdl_new)) @@ -1929,7 +1632,6 @@ tavor_ci_reregister_mr(ibc_hca_hdl_t hca, ibc_mr_hdl_t mr, ibc_pd_hdl_t pd, /* Return the Tavor MR handle */ *mr_new = (ibc_mr_hdl_t)mrhdl_new; - TAVOR_TNF_EXIT(tavor_ci_reregister_mr); return (IBT_SUCCESS); } @@ -1952,8 +1654,6 @@ tavor_ci_reregister_buf(ibc_hca_hdl_t hca, ibc_mr_hdl_t mr, ibc_pd_hdl_t pd, int status; ibt_mr_flags_t flags = attrp->mr_flags; - TAVOR_TNF_ENTER(tavor_ci_reregister_buf); - _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*mr_desc)) ASSERT(mr_new != NULL); @@ -1961,17 +1661,11 @@ tavor_ci_reregister_buf(ibc_hca_hdl_t hca, ibc_mr_hdl_t mr, ibc_pd_hdl_t pd, /* Check for valid HCA handle */ if (hca == NULL) { - TNF_PROBE_0(tavor_ci_reregister_buf_hca_inv, TAVOR_TNF_ERROR, - ""); - TAVOR_TNF_EXIT(tavor_ci_reregister_buf); return (IBT_HCA_HDL_INVALID); } /* Check for valid memory region handle */ if (mr == NULL) { - TNF_PROBE_0(tavor_ci_reregister_buf_invmrhdl_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_reregister_buf); return (IBT_MR_HDL_INVALID); } @@ -1985,9 +1679,6 @@ tavor_ci_reregister_buf(ibc_hca_hdl_t hca, ibc_mr_hdl_t mr, ibc_pd_hdl_t pd, status = tavor_mr_reregister_buf(state, mrhdl, pdhdl, attrp, buf, &mrhdl_new, &op); if (status != DDI_SUCCESS) { - TNF_PROBE_1(tavor_ci_reregister_buf_fail, TAVOR_TNF_ERROR, "", - tnf_uint, status, status); - TAVOR_TNF_EXIT(tavor_ci_reregister_buf); return (status); } _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*mrhdl_new)) @@ -2012,7 +1703,6 @@ tavor_ci_reregister_buf(ibc_hca_hdl_t hca, ibc_mr_hdl_t mr, ibc_pd_hdl_t pd, /* Return the Tavor MR handle */ *mr_new = (ibc_mr_hdl_t)mrhdl_new; - TAVOR_TNF_EXIT(tavor_ci_reregister_buf); return (IBT_SUCCESS); } @@ -2027,15 +1717,10 @@ tavor_ci_sync_mr(ibc_hca_hdl_t hca, ibt_mr_sync_t *mr_segs, size_t num_segs) tavor_state_t *state; int status; - TAVOR_TNF_ENTER(tavor_ci_sync_mr); - ASSERT(mr_segs != NULL); /* Check for valid HCA handle */ if (hca == NULL) { - TNF_PROBE_0(tavor_ci_sync_mr_invhca_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_sync_mr); return (IBT_HCA_HDL_INVALID); } @@ -2045,13 +1730,9 @@ tavor_ci_sync_mr(ibc_hca_hdl_t hca, ibt_mr_sync_t *mr_segs, size_t num_segs) /* Sync the memory region */ status = tavor_mr_sync(state, mr_segs, num_segs); if (status != DDI_SUCCESS) { - TNF_PROBE_1(tavor_ci_sync_mr_fail, TAVOR_TNF_ERROR, "", - tnf_uint, status, status); - TAVOR_TNF_EXIT(tavor_ci_sync_mr); return (status); } - TAVOR_TNF_EXIT(tavor_ci_sync_mr); return (IBT_SUCCESS); } @@ -2070,24 +1751,16 @@ tavor_ci_alloc_mw(ibc_hca_hdl_t hca, ibc_pd_hdl_t pd, ibt_mw_flags_t flags, tavor_mwhdl_t mwhdl; int status; - TAVOR_TNF_ENTER(tavor_ci_alloc_mw); - ASSERT(mw_p != NULL); ASSERT(rkey_p != NULL); /* Check for valid HCA handle */ if (hca == NULL) { - TNF_PROBE_0(tavor_ci_alloc_mw_invhca_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_alloc_mw); return (IBT_HCA_HDL_INVALID); } /* Check for valid PD handle pointer */ if (pd == NULL) { - TNF_PROBE_0(tavor_ci_alloc_mw_invpdhdl_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_alloc_mw); return (IBT_PD_HDL_INVALID); } @@ -2098,9 +1771,6 @@ tavor_ci_alloc_mw(ibc_hca_hdl_t hca, ibc_pd_hdl_t pd, ibt_mw_flags_t flags, /* Allocate the memory window */ status = tavor_mw_alloc(state, pdhdl, flags, &mwhdl); if (status != DDI_SUCCESS) { - TNF_PROBE_1(tavor_ci_alloc_mw_fail, TAVOR_TNF_ERROR, "", - tnf_uint, status, status); - TAVOR_TNF_EXIT(tavor_ci_alloc_mw); return (status); } _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*mwhdl)) @@ -2109,7 +1779,6 @@ tavor_ci_alloc_mw(ibc_hca_hdl_t hca, ibc_pd_hdl_t pd, ibt_mw_flags_t flags, *mw_p = (ibc_mw_hdl_t)mwhdl; *rkey_p = mwhdl->mr_rkey; - TAVOR_TNF_EXIT(tavor_ci_alloc_mw); return (IBT_SUCCESS); } @@ -2126,21 +1795,13 @@ tavor_ci_free_mw(ibc_hca_hdl_t hca, ibc_mw_hdl_t mw) tavor_mwhdl_t mwhdl; int status; - TAVOR_TNF_ENTER(tavor_ci_free_mw); - /* Check for valid HCA handle */ if (hca == NULL) { - TNF_PROBE_0(tavor_ci_free_mw_invhca_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_free_mw); return (IBT_HCA_HDL_INVALID); } /* Check for valid MW handle */ if (mw == NULL) { - TNF_PROBE_0(tavor_ci_free_mw_invmwhdl_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_free_mw); return (IBT_MW_HDL_INVALID); } @@ -2151,13 +1812,9 @@ tavor_ci_free_mw(ibc_hca_hdl_t hca, ibc_mw_hdl_t mw) /* Free the memory window */ status = tavor_mw_free(state, &mwhdl, TAVOR_NOSLEEP); if (status != DDI_SUCCESS) { - TNF_PROBE_1(tavor_ci_free_mw_fail, TAVOR_TNF_ERROR, "", - tnf_uint, status, status); - TAVOR_TNF_EXIT(tavor_ci_free_mw); return (status); } - TAVOR_TNF_EXIT(tavor_ci_free_mw); return (IBT_SUCCESS); } @@ -2173,23 +1830,15 @@ tavor_ci_query_mw(ibc_hca_hdl_t hca, ibc_mw_hdl_t mw, { tavor_mwhdl_t mwhdl; - TAVOR_TNF_ENTER(tavor_ci_query_mw); - ASSERT(mw_attr_p != NULL); /* Check for valid HCA handle */ if (hca == NULL) { - TNF_PROBE_0(tavor_ci_query_mw_invhca_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_query_mw); return (IBT_HCA_HDL_INVALID); } /* Check for valid MemWin handle */ if (mw == NULL) { - TNF_PROBE_0(tavor_ci_query_mw_inc_mwhdl_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_query_mw); return (IBT_MW_HDL_INVALID); } @@ -2200,7 +1849,6 @@ tavor_ci_query_mw(ibc_hca_hdl_t hca, ibc_mw_hdl_t mw, mw_attr_p->mw_rkey = mwhdl->mr_rkey; mutex_exit(&mwhdl->mr_lock); - TAVOR_TNF_EXIT(tavor_ci_query_mw); return (IBT_SUCCESS); } @@ -2288,21 +1936,13 @@ tavor_ci_attach_mcg(ibc_hca_hdl_t hca, ibc_qp_hdl_t qp, ib_gid_t gid, tavor_qphdl_t qphdl; int status; - TAVOR_TNF_ENTER(tavor_ci_attach_mcg); - /* Check for valid HCA handle */ if (hca == NULL) { - TNF_PROBE_0(tavor_ci_attach_mcg_invhca_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_attach_mcg); return (IBT_HCA_HDL_INVALID); } /* Check for valid QP handle pointer */ if (qp == NULL) { - TNF_PROBE_0(tavor_ci_attach_mcg_invqphdl_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_attach_mcg); return (IBT_QP_HDL_INVALID); } @@ -2313,13 +1953,9 @@ tavor_ci_attach_mcg(ibc_hca_hdl_t hca, ibc_qp_hdl_t qp, ib_gid_t gid, /* Attach the QP to the multicast group */ status = tavor_mcg_attach(state, qphdl, gid, lid); if (status != DDI_SUCCESS) { - TNF_PROBE_1(tavor_ci_attach_mcg_fail, TAVOR_TNF_ERROR, "", - tnf_uint, status, status); - TAVOR_TNF_EXIT(tavor_ci_attach_mcg); return (status); } - TAVOR_TNF_EXIT(tavor_ci_attach_mcg); return (IBT_SUCCESS); } @@ -2337,21 +1973,13 @@ tavor_ci_detach_mcg(ibc_hca_hdl_t hca, ibc_qp_hdl_t qp, ib_gid_t gid, tavor_qphdl_t qphdl; int status; - TAVOR_TNF_ENTER(tavor_ci_attach_mcg); - /* Check for valid HCA handle */ if (hca == NULL) { - TNF_PROBE_0(tavor_ci_detach_mcg_invhca_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_detach_mcg); return (IBT_HCA_HDL_INVALID); } /* Check for valid QP handle pointer */ if (qp == NULL) { - TNF_PROBE_0(tavor_ci_detach_mcg_invqphdl_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_detach_mcg); return (IBT_QP_HDL_INVALID); } @@ -2362,13 +1990,9 @@ tavor_ci_detach_mcg(ibc_hca_hdl_t hca, ibc_qp_hdl_t qp, ib_gid_t gid, /* Detach the QP from the multicast group */ status = tavor_mcg_detach(state, qphdl, gid, lid); if (status != DDI_SUCCESS) { - TNF_PROBE_1(tavor_ci_detach_mcg_fail, TAVOR_TNF_ERROR, "", - tnf_uint, status, status); - TAVOR_TNF_EXIT(tavor_ci_detach_mcg); return (status); } - TAVOR_TNF_EXIT(tavor_ci_detach_mcg); return (IBT_SUCCESS); } @@ -2386,24 +2010,16 @@ tavor_ci_post_send(ibc_hca_hdl_t hca, ibc_qp_hdl_t qp, ibt_send_wr_t *wr_p, tavor_qphdl_t qphdl; int status; - TAVOR_TNF_ENTER(tavor_ci_post_send); - ASSERT(wr_p != NULL); ASSERT(num_wr != 0); /* Check for valid HCA handle */ if (hca == NULL) { - TNF_PROBE_0(tavor_ci_post_send_invhca_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_post_send); return (IBT_HCA_HDL_INVALID); } /* Check for valid QP handle pointer */ if (qp == NULL) { - TNF_PROBE_0(tavor_ci_post_send_invqphdl_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_post_send); return (IBT_QP_HDL_INVALID); } @@ -2414,13 +2030,9 @@ tavor_ci_post_send(ibc_hca_hdl_t hca, ibc_qp_hdl_t qp, ibt_send_wr_t *wr_p, /* Post the send WQEs */ status = tavor_post_send(state, qphdl, wr_p, num_wr, num_posted_p); if (status != DDI_SUCCESS) { - TNF_PROBE_1(tavor_ci_post_send_fail, TAVOR_TNF_ERROR, "", - tnf_uint, status, status); - TAVOR_TNF_EXIT(tavor_ci_post_send); return (status); } - TAVOR_TNF_EXIT(tavor_ci_post_send); return (IBT_SUCCESS); } @@ -2438,24 +2050,16 @@ tavor_ci_post_recv(ibc_hca_hdl_t hca, ibc_qp_hdl_t qp, ibt_recv_wr_t *wr_p, tavor_qphdl_t qphdl; int status; - TAVOR_TNF_ENTER(tavor_ci_post_recv); - ASSERT(wr_p != NULL); ASSERT(num_wr != 0); /* Check for valid HCA handle */ if (hca == NULL) { - TNF_PROBE_0(tavor_ci_post_recv_invhca_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_post_recv); return (IBT_HCA_HDL_INVALID); } /* Check for valid QP handle pointer */ if (qp == NULL) { - TNF_PROBE_0(tavor_ci_post_recv_invqphdl_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_post_recv); return (IBT_QP_HDL_INVALID); } @@ -2466,13 +2070,9 @@ tavor_ci_post_recv(ibc_hca_hdl_t hca, ibc_qp_hdl_t qp, ibt_recv_wr_t *wr_p, /* Post the receive WQEs */ status = tavor_post_recv(state, qphdl, wr_p, num_wr, num_posted_p); if (status != DDI_SUCCESS) { - TNF_PROBE_1(tavor_ci_post_recv_fail, TAVOR_TNF_ERROR, "", - tnf_uint, status, status); - TAVOR_TNF_EXIT(tavor_ci_post_recv); return (status); } - TAVOR_TNF_EXIT(tavor_ci_post_recv); return (IBT_SUCCESS); } @@ -2491,31 +2091,20 @@ tavor_ci_poll_cq(ibc_hca_hdl_t hca, ibc_cq_hdl_t cq, ibt_wc_t *wc_p, uint_t polled; int status; - TAVOR_TNF_ENTER(tavor_ci_poll_cq); - ASSERT(wc_p != NULL); /* Check for valid HCA handle */ if (hca == NULL) { - TNF_PROBE_0(tavor_ci_poll_cq_invhca_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_poll_cq); return (IBT_HCA_HDL_INVALID); } /* Check for valid CQ handle pointer */ if (cq == NULL) { - TNF_PROBE_0(tavor_ci_poll_cq_invcqhdl_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_poll_cq); return (IBT_CQ_HDL_INVALID); } /* Check for valid num_wc field */ if (num_wc == 0) { - TNF_PROBE_0(tavor_ci_poll_cq_num_wc_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_poll_cq); return (IBT_INVALID_PARAM); } @@ -2538,15 +2127,9 @@ tavor_ci_poll_cq(ibc_hca_hdl_t hca, ibc_cq_hdl_t cq, ibt_wc_t *wc_p, * If success (something was polled), we return success */ if (status != DDI_SUCCESS) { - if (status != IBT_CQ_EMPTY) { - TNF_PROBE_1(tavor_ci_poll_cq_fail, TAVOR_TNF_ERROR, "", - tnf_uint, status, status); - } - TAVOR_TNF_EXIT(tavor_ci_poll_cq); return (status); } - TAVOR_TNF_EXIT(tavor_ci_poll_cq); return (IBT_SUCCESS); } @@ -2564,21 +2147,13 @@ tavor_ci_notify_cq(ibc_hca_hdl_t hca, ibc_cq_hdl_t cq_hdl, tavor_cqhdl_t cqhdl; int status; - TAVOR_TNF_ENTER(tavor_ci_notify_cq); - /* Check for valid HCA handle */ if (hca == NULL) { - TNF_PROBE_0(tavor_ci_notify_cq_invhca_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_notify_cq); return (IBT_HCA_HDL_INVALID); } /* Check for valid CQ handle pointer */ if (cq_hdl == NULL) { - TNF_PROBE_0(tavor_ci_notify_cq_invcqhdl_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_notify_cq); return (IBT_CQ_HDL_INVALID); } @@ -2589,13 +2164,9 @@ tavor_ci_notify_cq(ibc_hca_hdl_t hca, ibc_cq_hdl_t cq_hdl, /* Enable the CQ notification */ status = tavor_cq_notify(state, cqhdl, flags); if (status != DDI_SUCCESS) { - TNF_PROBE_1(tavor_ci_notify_cq_fail, TAVOR_TNF_ERROR, "", - tnf_uint, status, status); - TAVOR_TNF_EXIT(tavor_ci_notify_cq); return (status); } - TAVOR_TNF_EXIT(tavor_ci_notify_cq); return (IBT_SUCCESS); } @@ -2612,13 +2183,8 @@ tavor_ci_ci_data_in(ibc_hca_hdl_t hca, ibt_ci_data_flags_t flags, tavor_state_t *state; int status; - TAVOR_TNF_ENTER(tavor_ci_ci_data_in); - /* Check for valid HCA handle */ if (hca == NULL) { - TNF_PROBE_0(tavor_ci_ci_data_in_invhca_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_ci_data_in); return (IBT_HCA_HDL_INVALID); } @@ -2629,13 +2195,9 @@ tavor_ci_ci_data_in(ibc_hca_hdl_t hca, ibt_ci_data_flags_t flags, status = tavor_umap_ci_data_in(state, flags, object, ibc_object_handle, data_p, data_sz); if (status != DDI_SUCCESS) { - TNF_PROBE_1(tavor_ci_ci_data_in_umap_fail, TAVOR_TNF_ERROR, - "", tnf_uint, status, status); - TAVOR_TNF_EXIT(tavor_ci_ci_data_in); return (status); } - TAVOR_TNF_EXIT(tavor_ci_ci_data_in); return (IBT_SUCCESS); } @@ -2652,13 +2214,8 @@ tavor_ci_ci_data_out(ibc_hca_hdl_t hca, ibt_ci_data_flags_t flags, tavor_state_t *state; int status; - TAVOR_TNF_ENTER(tavor_ci_ci_data_out); - /* Check for valid HCA handle */ if (hca == NULL) { - TNF_PROBE_0(tavor_ci_ci_data_out_invhca_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_ci_data_out); return (IBT_HCA_HDL_INVALID); } @@ -2669,13 +2226,9 @@ tavor_ci_ci_data_out(ibc_hca_hdl_t hca, ibt_ci_data_flags_t flags, status = tavor_umap_ci_data_out(state, flags, object, ibc_object_handle, data_p, data_sz); if (status != DDI_SUCCESS) { - TNF_PROBE_1(tavor_ci_ci_data_out_umap_fail, TAVOR_TNF_ERROR, - "", tnf_uint, status, status); - TAVOR_TNF_EXIT(tavor_ci_ci_data_out); return (status); } - TAVOR_TNF_EXIT(tavor_ci_ci_data_out); return (IBT_SUCCESS); } @@ -2697,13 +2250,8 @@ tavor_ci_alloc_srq(ibc_hca_hdl_t hca, ibt_srq_flags_t flags, tavor_srq_options_t op; int status; - TAVOR_TNF_ENTER(tavor_ci_alloc_srq); - /* Check for valid HCA handle */ if (hca == NULL) { - TNF_PROBE_0(tavor_ci_alloc_srq_invhca_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_alloc_srq); return (IBT_HCA_HDL_INVALID); } @@ -2711,17 +2259,11 @@ tavor_ci_alloc_srq(ibc_hca_hdl_t hca, ibt_srq_flags_t flags, /* Check if SRQ is even supported */ if (state->ts_cfg_profile->cp_srq_enable == 0) { - TNF_PROBE_0(tavor_ci_alloc_srq_not_supported_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_alloc_srq); return (IBT_NOT_SUPPORTED); } /* Check for valid PD handle pointer */ if (pd == NULL) { - TNF_PROBE_0(tavor_ci_alloc_srq_invpdhdl_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_alloc_srq); return (IBT_PD_HDL_INVALID); } @@ -2736,13 +2278,11 @@ tavor_ci_alloc_srq(ibc_hca_hdl_t hca, ibt_srq_flags_t flags, op.srqo_wq_loc = state->ts_cfg_profile->cp_srq_wq_inddr; status = tavor_srq_alloc(state, &srqinfo, TAVOR_NOSLEEP, &op); if (status != DDI_SUCCESS) { - TAVOR_TNF_EXIT(tavor_ci_alloc_srq); return (status); } *ibc_srq_p = (ibc_srq_hdl_t)srqhdl; - TAVOR_TNF_EXIT(tavor_ci_alloc_srq); return (IBT_SUCCESS); } @@ -2758,13 +2298,8 @@ tavor_ci_free_srq(ibc_hca_hdl_t hca, ibc_srq_hdl_t srq) tavor_srqhdl_t srqhdl; int status; - TAVOR_TNF_ENTER(tavor_ci_free_srq); - /* Check for valid HCA handle */ if (hca == NULL) { - TNF_PROBE_0(tavor_ci_free_srq_invhca_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_free_srq); return (IBT_HCA_HDL_INVALID); } @@ -2772,17 +2307,11 @@ tavor_ci_free_srq(ibc_hca_hdl_t hca, ibc_srq_hdl_t srq) /* Check if SRQ is even supported */ if (state->ts_cfg_profile->cp_srq_enable == 0) { - TNF_PROBE_0(tavor_ci_alloc_srq_not_supported_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_free_srq); return (IBT_NOT_SUPPORTED); } /* Check for valid SRQ handle pointer */ if (srq == NULL) { - TNF_PROBE_0(tavor_ci_free_srq_invsrqhdl_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_free_srq); return (IBT_SRQ_HDL_INVALID); } @@ -2791,13 +2320,9 @@ tavor_ci_free_srq(ibc_hca_hdl_t hca, ibc_srq_hdl_t srq) /* Free the SRQ */ status = tavor_srq_free(state, &srqhdl, TAVOR_NOSLEEP); if (status != DDI_SUCCESS) { - TNF_PROBE_1(tavor_ci_free_srq_fail, TAVOR_TNF_ERROR, "", - tnf_uint, status, status); - TAVOR_TNF_EXIT(tavor_ci_free_srq); return (status); } - TAVOR_TNF_EXIT(tavor_ci_free_srq); return (IBT_SUCCESS); } @@ -2813,13 +2338,8 @@ tavor_ci_query_srq(ibc_hca_hdl_t hca, ibc_srq_hdl_t srq, ibc_pd_hdl_t *pd_p, tavor_state_t *state; tavor_srqhdl_t srqhdl; - TAVOR_TNF_ENTER(tavor_ci_query_srq); - /* Check for valid HCA handle */ if (hca == NULL) { - TNF_PROBE_0(tavor_ci_query_srq_invhca_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_query_srq); return (IBT_HCA_HDL_INVALID); } @@ -2827,17 +2347,11 @@ tavor_ci_query_srq(ibc_hca_hdl_t hca, ibc_srq_hdl_t srq, ibc_pd_hdl_t *pd_p, /* Check if SRQ is even supported */ if (state->ts_cfg_profile->cp_srq_enable == 0) { - TNF_PROBE_0(tavor_ci_query_srq_not_supported_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_query_srq); return (IBT_NOT_SUPPORTED); } /* Check for valid SRQ handle pointer */ if (srq == NULL) { - TNF_PROBE_0(tavor_ci_query_srq_invsrqhdl_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_query_srq); return (IBT_SRQ_HDL_INVALID); } @@ -2846,9 +2360,6 @@ tavor_ci_query_srq(ibc_hca_hdl_t hca, ibc_srq_hdl_t srq, ibc_pd_hdl_t *pd_p, mutex_enter(&srqhdl->srq_lock); if (srqhdl->srq_state == TAVOR_SRQ_STATE_ERROR) { mutex_exit(&srqhdl->srq_lock); - TNF_PROBE_0(tavor_ci_query_srq_error_state, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_query_srq); return (IBT_SRQ_ERROR_STATE); } @@ -2858,7 +2369,6 @@ tavor_ci_query_srq(ibc_hca_hdl_t hca, ibc_srq_hdl_t srq, ibc_pd_hdl_t *pd_p, mutex_exit(&srqhdl->srq_lock); *limit_p = 0; - TAVOR_TNF_EXIT(tavor_ci_query_srq); return (IBT_SUCCESS); } @@ -2877,13 +2387,8 @@ tavor_ci_modify_srq(ibc_hca_hdl_t hca, ibc_srq_hdl_t srq, uint_t resize_supported, cur_srq_size; int status; - TAVOR_TNF_ENTER(tavor_ci_modify_srq); - /* Check for valid HCA handle */ if (hca == NULL) { - TNF_PROBE_0(tavor_ci_modify_srq_invhca_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_modify_srq); return (IBT_HCA_HDL_INVALID); } @@ -2891,17 +2396,11 @@ tavor_ci_modify_srq(ibc_hca_hdl_t hca, ibc_srq_hdl_t srq, /* Check if SRQ is even supported */ if (state->ts_cfg_profile->cp_srq_enable == 0) { - TNF_PROBE_0(tavor_ci_modify_srq_not_supported_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_modify_srq); return (IBT_NOT_SUPPORTED); } /* Check for valid SRQ handle pointer */ if (srq == NULL) { - TNF_PROBE_0(tavor_ci_modify_srq_invcqhdl_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_modify_srq); return (IBT_SRQ_HDL_INVALID); } @@ -2916,9 +2415,6 @@ tavor_ci_modify_srq(ibc_hca_hdl_t hca, ibc_srq_hdl_t srq, cur_srq_size = srqhdl->srq_wq_bufsz; if (srqhdl->srq_state == TAVOR_SRQ_STATE_ERROR) { mutex_exit(&srqhdl->srq_lock); - TNF_PROBE_0(tavor_ci_modify_srq_error_state, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_modify_srq); return (IBT_SRQ_ERROR_STATE); } mutex_exit(&srqhdl->srq_lock); @@ -2936,9 +2432,6 @@ tavor_ci_modify_srq(ibc_hca_hdl_t hca, ibc_srq_hdl_t srq, * function should also be removed at that time. */ if (flags & IBT_SRQ_SET_LIMIT) { - TNF_PROBE_0(tavor_ci_modify_srq_limit_not_supported, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_modify_srq); return (IBT_NOT_SUPPORTED); } @@ -2948,7 +2441,6 @@ tavor_ci_modify_srq(ibc_hca_hdl_t hca, ibc_srq_hdl_t srq, * do we continue on with our resize processing. */ if (!(flags & IBT_SRQ_SET_SIZE)) { - TAVOR_TNF_EXIT(tavor_ci_modify_srq); return (IBT_SUCCESS); } @@ -2956,9 +2448,6 @@ tavor_ci_modify_srq(ibc_hca_hdl_t hca, ibc_srq_hdl_t srq, IBT_HCA_RESIZE_SRQ; if ((flags & IBT_SRQ_SET_SIZE) && !resize_supported) { - TNF_PROBE_0(tavor_ci_modify_srq_resize_not_supp_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_modify_srq); return (IBT_NOT_SUPPORTED); } @@ -2969,7 +2458,6 @@ tavor_ci_modify_srq(ibc_hca_hdl_t hca, ibc_srq_hdl_t srq, */ if (size <= cur_srq_size) { *ret_size_p = cur_srq_size; - TAVOR_TNF_EXIT(tavor_ci_modify_srq); return (IBT_SUCCESS); } @@ -2978,13 +2466,9 @@ tavor_ci_modify_srq(ibc_hca_hdl_t hca, ibc_srq_hdl_t srq, if (status != DDI_SUCCESS) { /* Set return value to current SRQ size */ *ret_size_p = cur_srq_size; - TNF_PROBE_1(tavor_ci_modify_srq_fail, TAVOR_TNF_ERROR, "", - tnf_uint, status, status); - TAVOR_TNF_EXIT(tavor_ci_modify_srq); return (status); } - TAVOR_TNF_EXIT(tavor_ci_modify_srq); return (IBT_SUCCESS); } @@ -3001,13 +2485,8 @@ tavor_ci_post_srq(ibc_hca_hdl_t hca, ibc_srq_hdl_t srq, tavor_srqhdl_t srqhdl; int status; - TAVOR_TNF_ENTER(tavor_ci_post_srq); - /* Check for valid HCA handle */ if (hca == NULL) { - TNF_PROBE_0(tavor_ci_post_srq_invhca_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_post_srq); return (IBT_HCA_HDL_INVALID); } @@ -3015,17 +2494,11 @@ tavor_ci_post_srq(ibc_hca_hdl_t hca, ibc_srq_hdl_t srq, /* Check if SRQ is even supported */ if (state->ts_cfg_profile->cp_srq_enable == 0) { - TNF_PROBE_0(tavor_ci_post_srq_not_supported_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_post_srq); return (IBT_NOT_SUPPORTED); } /* Check for valid SRQ handle pointer */ if (srq == NULL) { - TNF_PROBE_0(tavor_ci_post_srq_invsrqhdl_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_post_srq); return (IBT_SRQ_HDL_INVALID); } @@ -3033,13 +2506,9 @@ tavor_ci_post_srq(ibc_hca_hdl_t hca, ibc_srq_hdl_t srq, status = tavor_post_srq(state, srqhdl, wr, num_wr, num_posted_p); if (status != DDI_SUCCESS) { - TNF_PROBE_1(tavor_ci_post_srq_fail, TAVOR_TNF_ERROR, "", - tnf_uint, status, status); - TAVOR_TNF_EXIT(tavor_ci_post_srq); return (status); } - TAVOR_TNF_EXIT(tavor_ci_post_srq); return (IBT_SUCCESS); } @@ -3286,8 +2755,6 @@ tavor_ci_alloc_lkey(ibc_hca_hdl_t hca, ibc_pd_hdl_t pd, ibt_lkey_flags_t flags, uint_t phys_buf_list_sz, ibc_mr_hdl_t *mr_p, ibt_pmr_desc_t *mem_desc_p) { - TAVOR_TNF_ENTER(tavor_ci_alloc_lkey); - TAVOR_TNF_EXIT(tavor_ci_alloc_lkey); return (IBT_NOT_SUPPORTED); } @@ -3301,8 +2768,6 @@ tavor_ci_register_physical_mr(ibc_hca_hdl_t hca, ibc_pd_hdl_t pd, ibt_pmr_attr_t *mem_pattrs, void *ibtl_reserved, ibc_mr_hdl_t *mr_p, ibt_pmr_desc_t *mem_desc_p) { - TAVOR_TNF_ENTER(tavor_ci_register_physical_mr); - TAVOR_TNF_EXIT(tavor_ci_register_physical_mr); return (IBT_NOT_SUPPORTED); } @@ -3315,8 +2780,6 @@ tavor_ci_reregister_physical_mr(ibc_hca_hdl_t hca, ibc_mr_hdl_t mr, ibc_pd_hdl_t pd, ibt_pmr_attr_t *mem_pattrs, void *ibtl_reserved, ibc_mr_hdl_t *mr_p, ibt_pmr_desc_t *mr_desc_p) { - TAVOR_TNF_ENTER(tavor_ci_reregister_physical_mr); - TAVOR_TNF_EXIT(tavor_ci_reregister_physical_mr); return (IBT_NOT_SUPPORTED); } @@ -3401,21 +2864,13 @@ tavor_ci_alloc_io_mem( tavor_state_t *state; int status; - TAVOR_TNF_ENTER(tavor_ci_alloc_io_mem); - /* Check for valid HCA handle */ if (hca == NULL) { - TNF_PROBE_0(tavor_ci_alloc_io_mem_invhca_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_alloc_io_mem); return (IBT_HCA_HDL_INVALID); } /* Check for valid mem_alloc_hdl handle pointer */ if (mem_alloc_hdl == NULL) { - TNF_PROBE_0(tavor_ci_alloc_io_mem_hdl_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_alloc_io_mem); return (IBT_MEM_ALLOC_HDL_INVALID); } @@ -3427,13 +2882,9 @@ tavor_ci_alloc_io_mem( (tavor_mem_alloc_hdl_t *)mem_alloc_hdl); if (status != DDI_SUCCESS) { - TNF_PROBE_1(tavor_ci_alloc_ah_fail, TAVOR_TNF_ERROR, "", - tnf_uint, status, status); - TAVOR_TNF_EXIT(tavor_ci_alloc_io_mem); return (status); } - TAVOR_TNF_EXIT(tavor_ci_alloc_io_mem); return (IBT_SUCCESS); } @@ -3447,21 +2898,13 @@ tavor_ci_free_io_mem(ibc_hca_hdl_t hca, ibc_mem_alloc_hdl_t mem_alloc_hdl) { tavor_mem_alloc_hdl_t memhdl; - TAVOR_TNF_ENTER(tavor_ci_free_io_mem); - /* Check for valid HCA handle */ if (hca == NULL) { - TNF_PROBE_0(tavor_ci_free_io_mem_invhca_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_free_io_mem); return (IBT_HCA_HDL_INVALID); } /* Check for valid mem_alloc_hdl handle pointer */ if (mem_alloc_hdl == NULL) { - TNF_PROBE_0(tavor_ci_free_io_mem_hdl_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ci_free_io_mem); return (IBT_MEM_ALLOC_HDL_INVALID); } @@ -3473,7 +2916,6 @@ tavor_ci_free_io_mem(ibc_hca_hdl_t hca, ibc_mem_alloc_hdl_t mem_alloc_hdl) ddi_dma_free_handle(&memhdl->tavor_dma_hdl); kmem_free(memhdl, sizeof (*memhdl)); - TAVOR_TNF_EXIT(tavor_dma_free); return (IBT_SUCCESS); } @@ -3493,8 +2935,6 @@ tavor_mem_alloc( int status; int (*ddi_cb)(caddr_t); - TAVOR_TNF_ENTER(tavor_mem_alloc); - tavor_dma_attr_init(&dma_attr); ddi_cb = (flags & IBT_MR_NOSLEEP) ? DDI_DMA_DONTWAIT : DDI_DMA_SLEEP; @@ -3503,8 +2943,6 @@ tavor_mem_alloc( status = ddi_dma_alloc_handle(state->ts_dip, &dma_attr, ddi_cb, NULL, &dma_hdl); if (status != DDI_SUCCESS) { - TNF_PROBE_0(tavor_dma_alloc_handle_fail, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_mem_alloc); return (DDI_FAILURE); } @@ -3515,8 +2953,6 @@ tavor_mem_alloc( kaddrp, &real_len, &acc_hdl); if (status != DDI_SUCCESS) { ddi_dma_free_handle(&dma_hdl); - TNF_PROBE_0(tavor_dma_alloc_memory_fail, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_mem_alloc); return (DDI_FAILURE); } @@ -3526,14 +2962,11 @@ tavor_mem_alloc( if (*mem_hdl == NULL) { ddi_dma_mem_free(&acc_hdl); ddi_dma_free_handle(&dma_hdl); - TNF_PROBE_0(tavor_dma_alloc_memory_fail, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_mem_alloc); return (DDI_FAILURE); } _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(**mem_hdl)) (*mem_hdl)->tavor_dma_hdl = dma_hdl; (*mem_hdl)->tavor_acc_hdl = acc_hdl; - TAVOR_TNF_EXIT(tavor_mem_alloc); return (DDI_SUCCESS); } diff --git a/usr/src/uts/common/io/ib/adapters/tavor/tavor_cmd.c b/usr/src/uts/common/io/ib/adapters/tavor/tavor_cmd.c index 4675367af6..8af83be8cc 100644 --- a/usr/src/uts/common/io/ib/adapters/tavor/tavor_cmd.c +++ b/usr/src/uts/common/io/ib/adapters/tavor/tavor_cmd.c @@ -73,39 +73,27 @@ tavor_cmd_post(tavor_state_t *state, tavor_cmd_post_t *cmdpost) int status; uint16_t token; - TAVOR_TNF_ENTER(tavor_cmd_post); - _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*cmdpost)) /* Determine if we are going to spin until completion */ if (cmdpost->cp_flags == TAVOR_CMD_NOSLEEP_SPIN) { - TNF_PROBE_0_DEBUG(tavor_cmd_post_spin, TAVOR_TNF_TRACE, ""); - /* Write the command to the HCR */ status = tavor_write_hcr(state, cmdpost, 0); if (status != TAVOR_CMD_SUCCESS) { - TNF_PROBE_0(tavor_cmd_post_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_cmd_post); return (status); } - TAVOR_TNF_EXIT(tavor_cmd_post); return (TAVOR_CMD_SUCCESS); } else { /* "TAVOR_CMD_SLEEP_NOSPIN" */ - TNF_PROBE_0_DEBUG(tavor_cmd_post_nospin, TAVOR_TNF_TRACE, ""); - ASSERT(TAVOR_SLEEPFLAG_FOR_CONTEXT() != TAVOR_NOSLEEP); /* NOTE: Expect threads to be waiting in here */ status = tavor_outstanding_cmd_alloc(state, &cmdptr, cmdpost->cp_flags); if (status != TAVOR_CMD_SUCCESS) { - TNF_PROBE_0(tavor_cmd_alloc_fail, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_cmd_post); return (status); } _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*cmdptr)) @@ -126,8 +114,6 @@ tavor_cmd_post(tavor_state_t *state, tavor_cmd_post_t *cmdpost) status = tavor_write_hcr(state, cmdpost, token); if (status != TAVOR_CMD_SUCCESS) { tavor_outstanding_cmd_free(state, &cmdptr); - TNF_PROBE_0(tavor_cmd_post_fail, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_cmd_post); return (status); } @@ -171,12 +157,9 @@ tavor_cmd_post(tavor_state_t *state, tavor_cmd_post_t *cmdpost) tavor_outstanding_cmd_free(state, &cmdptr); if (status != TAVOR_CMD_SUCCESS) { - TNF_PROBE_0(tavor_cmd_post_fail, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_cmd_post); return (status); } - TAVOR_TNF_EXIT(tavor_cmd_post); return (TAVOR_CMD_SUCCESS); } } @@ -196,8 +179,6 @@ tavor_mbox_alloc(tavor_state_t *state, tavor_mbox_info_t *mbox_info, int status; uint_t sleep_context; - TAVOR_TNF_ENTER(tavor_mbox_alloc); - sleep_context = TAVOR_SLEEPFLAG_FOR_CONTEXT(); /* Allocate an "In" mailbox */ @@ -215,7 +196,6 @@ tavor_mbox_alloc(tavor_state_t *state, tavor_mbox_info_t *mbox_info, &state->ts_in_mblist, &mbox_info->mbi_in, mbox_wait); if (status != TAVOR_CMD_SUCCESS) { - TAVOR_TNF_EXIT(tavor_mbox_alloc); return (status); } } @@ -244,7 +224,6 @@ tavor_mbox_alloc(tavor_state_t *state, tavor_mbox_info_t *mbox_info, &state->ts_in_mblist, &mbox_info->mbi_in); } - TAVOR_TNF_EXIT(tavor_mbox_alloc); return (status); } } @@ -254,7 +233,6 @@ tavor_mbox_alloc(tavor_state_t *state, tavor_mbox_info_t *mbox_info, _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(mbox_info->mbi_sleep_context)) mbox_info->mbi_sleep_context = sleep_context; - TAVOR_TNF_EXIT(tavor_mbox_alloc); return (TAVOR_CMD_SUCCESS); } @@ -266,8 +244,6 @@ tavor_mbox_alloc(tavor_state_t *state, tavor_mbox_info_t *mbox_info, void tavor_mbox_free(tavor_state_t *state, tavor_mbox_info_t *mbox_info) { - TAVOR_TNF_ENTER(tavor_mbox_free); - /* * The mailbox has to be freed in the same context from which it was * allocated. The context is stored in the mbox_info at @@ -303,8 +279,6 @@ tavor_mbox_free(tavor_state_t *state, tavor_mbox_info_t *mbox_info) &mbox_info->mbi_out); } } - - TAVOR_TNF_EXIT(tavor_mbox_free); } @@ -319,19 +293,14 @@ tavor_cmd_complete_handler(tavor_state_t *state, tavor_eqhdl_t eq, tavor_cmd_t *cmdp; uint_t eqe_evttype; - TAVOR_TNF_ENTER(tavor_cmd_complete_handler); - eqe_evttype = TAVOR_EQE_EVTTYPE_GET(eq, eqe); ASSERT(eqe_evttype == TAVOR_EVT_COMMAND_INTF_COMP || eqe_evttype == TAVOR_EVT_EQ_OVERFLOW); if (eqe_evttype == TAVOR_EVT_EQ_OVERFLOW) { - TNF_PROBE_0(tavor_cmd_complete_overflow_condition, - TAVOR_TNF_ERROR, ""); tavor_eq_overflow_handler(state, eq, eqe); - TAVOR_TNF_EXIT(tavor_cmd_complete_handler); return (DDI_FAILURE); } @@ -350,7 +319,6 @@ tavor_cmd_complete_handler(tavor_state_t *state, tavor_eqhdl_t eq, cv_signal(&cmdp->cmd_comp_cv); mutex_exit(&cmdp->cmd_comp_lock); - TAVOR_TNF_EXIT(tavor_cmd_complete_handler); return (DDI_SUCCESS); } @@ -365,20 +333,14 @@ tavor_inmbox_list_init(tavor_state_t *state) int status; uint_t num_inmbox; - TAVOR_TNF_ENTER(tavor_inmbox_list_init); - /* Initialize the "In" mailbox list */ num_inmbox = (1 << state->ts_cfg_profile->cp_log_num_inmbox); status = tavor_impl_mboxlist_init(state, &state->ts_in_mblist, num_inmbox, TAVOR_IN_MBOX); if (status != DDI_SUCCESS) { - TNF_PROBE_0(tavor_impl_mboxlist_init_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_inmbox_list_init); return (DDI_FAILURE); } - TAVOR_TNF_EXIT(tavor_inmbox_list_init); return (DDI_SUCCESS); } @@ -393,20 +355,14 @@ tavor_intr_inmbox_list_init(tavor_state_t *state) int status; uint_t num_inmbox; - TAVOR_TNF_ENTER(tavor_intr_inmbox_list_init); - /* Initialize the interrupt "In" mailbox list */ num_inmbox = (1 << state->ts_cfg_profile->cp_log_num_intr_inmbox); status = tavor_impl_mboxlist_init(state, &state->ts_in_intr_mblist, num_inmbox, TAVOR_INTR_IN_MBOX); if (status != DDI_SUCCESS) { - TNF_PROBE_0(tavor_impl_mboxlist_init_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_intr_inmbox_list_init); return (DDI_FAILURE); } - TAVOR_TNF_EXIT(tavor_intr_inmbox_list_init); return (DDI_SUCCESS); } @@ -421,20 +377,14 @@ tavor_outmbox_list_init(tavor_state_t *state) int status; uint_t num_outmbox; - TAVOR_TNF_ENTER(tavor_outmbox_list_init); - /* Initialize the "Out" mailbox list */ num_outmbox = (1 << state->ts_cfg_profile->cp_log_num_outmbox); status = tavor_impl_mboxlist_init(state, &state->ts_out_mblist, num_outmbox, TAVOR_OUT_MBOX); if (status != DDI_SUCCESS) { - TNF_PROBE_0(tavor_impl_mboxlist_init_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_outmbox_list_init); return (DDI_FAILURE); } - TAVOR_TNF_EXIT(tavor_outmbox_list_init); return (DDI_SUCCESS); } @@ -449,20 +399,14 @@ tavor_intr_outmbox_list_init(tavor_state_t *state) int status; uint_t num_outmbox; - TAVOR_TNF_ENTER(tavor_intr_outmbox_list_init); - /* Initialize the interrupts "Out" mailbox list */ num_outmbox = (1 << state->ts_cfg_profile->cp_log_num_intr_outmbox); status = tavor_impl_mboxlist_init(state, &state->ts_out_intr_mblist, num_outmbox, TAVOR_INTR_OUT_MBOX); if (status != DDI_SUCCESS) { - TNF_PROBE_0(tavor_impl_mboxlist_init_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_intr_outmbox_list_init); return (DDI_FAILURE); } - TAVOR_TNF_EXIT(tavor_intr_outmbox_list_init); return (DDI_SUCCESS); } @@ -474,12 +418,8 @@ tavor_intr_outmbox_list_init(tavor_state_t *state) void tavor_inmbox_list_fini(tavor_state_t *state) { - TAVOR_TNF_ENTER(tavor_inmbox_list_fini); - /* Free up the "In" mailbox list */ tavor_impl_mboxlist_fini(state, &state->ts_in_mblist); - - TAVOR_TNF_EXIT(tavor_inmbox_list_fini); } @@ -490,12 +430,8 @@ tavor_inmbox_list_fini(tavor_state_t *state) void tavor_intr_inmbox_list_fini(tavor_state_t *state) { - TAVOR_TNF_ENTER(tavor_intr_inmbox_list_fini); - /* Free up the interupts "In" mailbox list */ tavor_impl_mboxlist_fini(state, &state->ts_in_intr_mblist); - - TAVOR_TNF_EXIT(tavor_intr_inmbox_list_fini); } @@ -506,12 +442,8 @@ tavor_intr_inmbox_list_fini(tavor_state_t *state) void tavor_outmbox_list_fini(tavor_state_t *state) { - TAVOR_TNF_ENTER(tavor_outmbox_list_fini); - /* Free up the "Out" mailbox list */ tavor_impl_mboxlist_fini(state, &state->ts_out_mblist); - - TAVOR_TNF_EXIT(tavor_outmbox_list_fini); } @@ -522,12 +454,8 @@ tavor_outmbox_list_fini(tavor_state_t *state) void tavor_intr_outmbox_list_fini(tavor_state_t *state) { - TAVOR_TNF_ENTER(tavor_intr_outmbox_list_fini); - /* Free up the interrupt "Out" mailbox list */ tavor_impl_mboxlist_fini(state, &state->ts_out_intr_mblist); - - TAVOR_TNF_EXIT(tavor_intr_outmbox_list_fini); } @@ -543,8 +471,6 @@ tavor_impl_mbox_alloc(tavor_state_t *state, tavor_mboxlist_t *mblist, uint_t index, next, prev; uint_t count, countmax; - TAVOR_TNF_ENTER(tavor_impl_mbox_alloc); - /* * If the mailbox list is empty, then wait (if appropriate in the * current context). Otherwise, grab the next available mailbox. @@ -559,9 +485,6 @@ tavor_impl_mbox_alloc(tavor_state_t *state, tavor_mboxlist_t *mblist, mutex_exit(&mblist->mbl_lock); /* Delay loop polling for an available mbox */ if (++count > countmax) { - TNF_PROBE_0(tavor_impl_mbox_alloc_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_impl_mbox_alloc); return (TAVOR_CMD_INSUFF_RSRC); } @@ -613,7 +536,6 @@ tavor_impl_mbox_alloc(tavor_state_t *state, tavor_mboxlist_t *mblist, mutex_exit(&mblist->mbl_lock); - TAVOR_TNF_EXIT(tavor_impl_mbox_alloc); return (TAVOR_CMD_SUCCESS); } @@ -627,8 +549,6 @@ tavor_impl_mbox_free(tavor_mboxlist_t *mblist, tavor_mbox_t **mb) { uint_t mbox_indx; - TAVOR_TNF_ENTER(tavor_impl_mbox_free); - mutex_enter(&mblist->mbl_lock); /* Pull the "index" from mailbox entry */ @@ -696,8 +616,6 @@ tavor_impl_mbox_free(tavor_mboxlist_t *mblist, tavor_mbox_t **mb) *mb = NULL; mutex_exit(&mblist->mbl_lock); - - TAVOR_TNF_EXIT(tavor_impl_mbox_free); } @@ -714,8 +632,6 @@ tavor_impl_mboxlist_init(tavor_state_t *state, tavor_mboxlist_t *mblist, uint_t dma_cookiecnt, flag, sync; int status, i; - TAVOR_TNF_ENTER(tavor_impl_mboxlist_init); - /* Allocate the memory for the mailbox entries list */ mblist->mbl_list_sz = num_mbox; mblist->mbl_mbox = kmem_zalloc(mblist->mbl_list_sz * @@ -746,8 +662,6 @@ tavor_impl_mboxlist_init(tavor_state_t *state, tavor_mboxlist_t *mblist, &rsrc); if (status != DDI_SUCCESS) { /* Jump to cleanup and return error */ - TNF_PROBE_0(tavor_impl_mbox_init_rsrcalloc_fail, - TAVOR_TNF_ERROR, ""); goto mboxlist_init_fail; } @@ -767,8 +681,6 @@ tavor_impl_mboxlist_init(tavor_state_t *state, tavor_mboxlist_t *mblist, if (status != DDI_SUCCESS) { /* Jump to cleanup and return error */ tavor_rsrc_free(state, &rsrc); - TNF_PROBE_0(tavor_impl_mbox_init_dmabind_fail, - TAVOR_TNF_ERROR, ""); goto mboxlist_init_fail; } @@ -791,13 +703,11 @@ tavor_impl_mboxlist_init(tavor_state_t *state, tavor_mboxlist_t *mblist, mblist->mbl_mbox[mblist->mbl_tail_indx].mb_next = mblist->mbl_head_indx; - TAVOR_TNF_EXIT(tavor_impl_mboxlist_init); return (DDI_SUCCESS); mboxlist_init_fail: tavor_impl_mboxlist_fini(state, mblist); - TAVOR_TNF_EXIT(tavor_impl_mboxlist_init); return (DDI_FAILURE); } @@ -812,8 +722,6 @@ tavor_impl_mboxlist_fini(tavor_state_t *state, tavor_mboxlist_t *mblist) tavor_rsrc_t *rsrc; int i, status; - TAVOR_TNF_ENTER(tavor_impl_mboxlist_fini); - /* Release the resources for each of the mailbox list entries */ for (i = 0; i < mblist->mbl_num_alloc; i++) { rsrc = mblist->mbl_mbox[i].mb_rsrcptr; @@ -830,9 +738,6 @@ tavor_impl_mboxlist_fini(tavor_state_t *state, tavor_mboxlist_t *mblist) status = ddi_dma_unbind_handle(rsrc->tr_dmahdl); if (status != DDI_SUCCESS) { TAVOR_WARNING(state, "failed to unbind DMA mapping"); - TNF_PROBE_0(tavor_impl_mboxlist_fini_dmaunbind_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_impl_mboxlist_fini); return; } @@ -847,8 +752,6 @@ tavor_impl_mboxlist_fini(tavor_state_t *state, tavor_mboxlist_t *mblist) /* Free up the memory for tracking the mailbox list */ kmem_free(mblist->mbl_mbox, mblist->mbl_list_sz * sizeof (tavor_mbox_t)); - - TAVOR_TNF_EXIT(tavor_impl_mboxlist_fini); } @@ -863,8 +766,6 @@ tavor_outstanding_cmd_alloc(tavor_state_t *state, tavor_cmd_t **cmd_ptr, tavor_cmdlist_t *cmd_list; uint_t next, prev, head; - TAVOR_TNF_ENTER(tavor_outstanding_cmd_alloc); - cmd_list = &state->ts_cmd_list; mutex_enter(&cmd_list->cml_lock); @@ -880,9 +781,6 @@ tavor_outstanding_cmd_alloc(tavor_state_t *state, tavor_cmd_t **cmd_ptr, /* No free commands */ if (cmd_wait == TAVOR_NOSLEEP) { mutex_exit(&cmd_list->cml_lock); - TNF_PROBE_0(tavor_outstanding_cmd_alloc_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_outstanding_cmd_alloc); return (TAVOR_CMD_INSUFF_RSRC); } @@ -920,7 +818,6 @@ tavor_outstanding_cmd_alloc(tavor_state_t *state, tavor_cmd_t **cmd_ptr, mutex_exit(&cmd_list->cml_lock); - TAVOR_TNF_EXIT(tavor_outstanding_cmd_alloc); return (TAVOR_CMD_SUCCESS); } @@ -935,8 +832,6 @@ tavor_outstanding_cmd_free(tavor_state_t *state, tavor_cmd_t **cmd_ptr) tavor_cmdlist_t *cmd_list; uint_t cmd_indx; - TAVOR_TNF_ENTER(tavor_outstanding_cmd_free); - cmd_list = &state->ts_cmd_list; mutex_enter(&cmd_list->cml_lock); @@ -980,8 +875,6 @@ tavor_outstanding_cmd_free(tavor_state_t *state, tavor_cmd_t **cmd_ptr) *cmd_ptr = NULL; mutex_exit(&cmd_list->cml_lock); - - TAVOR_TNF_EXIT(tavor_outstanding_cmd_free); } @@ -997,8 +890,6 @@ tavor_write_hcr(tavor_state_t *state, tavor_cmd_post_t *cmdpost, uint_t status, count, countmax; uint64_t hcrreg; - TAVOR_TNF_ENTER(tavor_write_hcr); - /* * Grab the "HCR access" lock if the driver is not in * fastreboot. In fastreboot, this function is called @@ -1026,9 +917,6 @@ tavor_write_hcr(tavor_state_t *state, tavor_cmd_post_t *cmdpost, /* If "go" bit is clear, then done */ if ((hcrreg & TAVOR_HCR_CMD_GO_MASK) == 0) { - TNF_PROBE_1_DEBUG(tavor_write_hcr_loop_count, - TAVOR_TNF_ERROR, "", tnf_uint, nospinloopcount, - count); break; } /* Delay before polling the "go" bit again */ @@ -1046,9 +934,6 @@ tavor_write_hcr(tavor_state_t *state, tavor_cmd_post_t *cmdpost, mutex_exit(&state->ts_cmd_regs.hcr_lock); } #endif - TNF_PROBE_0(tavor_write_hcr_timeout1, TAVOR_TNF_ERROR, - ""); - TAVOR_TNF_EXIT(tavor_write_hcr); return (TAVOR_CMD_TIMEOUT); } } @@ -1093,9 +978,6 @@ tavor_write_hcr(tavor_state_t *state, tavor_cmd_post_t *cmdpost, /* If "go" bit is clear, then done */ if ((hcrreg & TAVOR_HCR_CMD_GO_MASK) == 0) { - TNF_PROBE_1_DEBUG(tavor_write_hcr_loop_count, - TAVOR_TNF_ERROR, "", tnf_uint, - spinloopcount, count); break; } /* Delay before polling the "go" bit again */ @@ -1114,9 +996,6 @@ tavor_write_hcr(tavor_state_t *state, tavor_cmd_post_t *cmdpost, ts_cmd_regs.hcr_lock); } #endif - TNF_PROBE_0(tavor_write_hcr_timeout2, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_write_hcr); return (TAVOR_CMD_TIMEOUT); } } @@ -1148,7 +1027,6 @@ tavor_write_hcr(tavor_state_t *state, tavor_cmd_post_t *cmdpost, } #endif - TAVOR_TNF_EXIT(tavor_write_hcr); return (status); } @@ -1163,8 +1041,6 @@ tavor_outstanding_cmdlist_init(tavor_state_t *state) uint_t num_outstanding_cmds, head, tail; int i; - TAVOR_TNF_ENTER(tavor_outstanding_cmdlist_init); - /* * Determine the number of the outstanding commands supported * by the Tavor device (obtained from the QUERY_FW command). Note: @@ -1215,7 +1091,6 @@ tavor_outstanding_cmdlist_init(tavor_state_t *state) state->ts_cmd_list.cml_head_indx; } - TAVOR_TNF_EXIT(tavor_outstanding_cmdlist_init); return (DDI_SUCCESS); } @@ -1229,8 +1104,6 @@ tavor_outstanding_cmdlist_fini(tavor_state_t *state) { int i; - TAVOR_TNF_ENTER(tavor_outstanding_cmdlist_fini); - /* Destroy the outstanding command list entries */ for (i = 0; i < state->ts_cmd_list.cml_num_alloc; i++) { mutex_destroy(&state->ts_cmd_list.cml_cmd[i].cmd_comp_lock); @@ -1245,7 +1118,6 @@ tavor_outstanding_cmdlist_fini(tavor_state_t *state) state->ts_cmd_list.cml_list_sz * sizeof (tavor_cmd_t)); } - TAVOR_TNF_EXIT(tavor_outstanding_cmdlist_fini); } @@ -1259,11 +1131,8 @@ tavor_mbox_sync(tavor_mbox_t *mbox, uint_t offset, uint_t length, ddi_dma_handle_t dmahdl; int status; - TAVOR_TNF_ENTER(tavor_mbox_sync); - /* Determine if mailbox needs to be synced or not */ if (mbox->mb_sync == 0) { - TAVOR_TNF_EXIT(tavor_mbox_sync); return; } @@ -1273,12 +1142,8 @@ tavor_mbox_sync(tavor_mbox_t *mbox, uint_t offset, uint_t length, /* Calculate offset into mailbox */ status = ddi_dma_sync(dmahdl, (off_t)offset, (size_t)length, flag); if (status != DDI_SUCCESS) { - TNF_PROBE_0(tavor_mbox_sync_fail, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_mbox_sync); return; } - - TAVOR_TNF_EXIT(tavor_mbox_sync); } @@ -1294,8 +1159,6 @@ tavor_sys_en_cmd_post(tavor_state_t *state, uint_t flags, tavor_cmd_post_t cmd; int status; - TAVOR_TNF_ENTER(tavor_sys_en_cmd_post); - /* Make sure we are called with the correct flag */ ASSERT(sleepflag == TAVOR_CMD_NOSLEEP_SPIN); @@ -1308,7 +1171,6 @@ tavor_sys_en_cmd_post(tavor_state_t *state, uint_t flags, cmd.cp_flags = sleepflag; status = tavor_cmd_post(state, &cmd); if (status != TAVOR_CMD_SUCCESS) { - TNF_PROBE_0(tavor_sys_en_cmd_post_fail, TAVOR_TNF_ERROR, ""); /* * When the SYS_EN command fails, the "outparam" field may * contain more detailed information about what caused the @@ -1317,7 +1179,6 @@ tavor_sys_en_cmd_post(tavor_state_t *state, uint_t flags, *errorcode = cmd.cp_outparm; } - TAVOR_TNF_EXIT(tavor_sys_en_cmd_post); return (status); } @@ -1333,8 +1194,6 @@ tavor_sys_dis_cmd_post(tavor_state_t *state, uint_t sleepflag) tavor_cmd_post_t cmd; int status; - TAVOR_TNF_ENTER(tavor_sys_dis_cmd_post); - /* Make sure we are called with the correct flag */ ASSERT(sleepflag == TAVOR_CMD_NOSLEEP_SPIN); @@ -1346,12 +1205,7 @@ tavor_sys_dis_cmd_post(tavor_state_t *state, uint_t sleepflag) cmd.cp_opmod = 0; cmd.cp_flags = sleepflag; status = tavor_cmd_post(state, &cmd); - if (status != TAVOR_CMD_SUCCESS) { - TNF_PROBE_0(tavor_sys_dis_cmd_post_fail, - TAVOR_TNF_ERROR, ""); - } - TAVOR_TNF_EXIT(tavor_sys_dis_cmd_post); return (status); } @@ -1371,8 +1225,6 @@ tavor_init_hca_cmd_post(tavor_state_t *state, uint_t size; int status, i; - TAVOR_TNF_ENTER(tavor_init_hca_cmd_post); - /* Make sure we are called with the correct flag */ ASSERT(sleepflag == TAVOR_CMD_NOSLEEP_SPIN); @@ -1380,8 +1232,6 @@ tavor_init_hca_cmd_post(tavor_state_t *state, mbox_info.mbi_alloc_flags = TAVOR_ALLOC_INMBOX; status = tavor_mbox_alloc(state, &mbox_info, sleepflag); if (status != TAVOR_CMD_SUCCESS) { - TNF_PROBE_0(tavor_init_hca_mbox_fail, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_init_hca_cmd_post); return (status); } @@ -1404,15 +1254,10 @@ tavor_init_hca_cmd_post(tavor_state_t *state, cmd.cp_opmod = 0; cmd.cp_flags = sleepflag; status = tavor_cmd_post(state, &cmd); - if (status != TAVOR_CMD_SUCCESS) { - TNF_PROBE_0(tavor_init_hca_cmd_post_fail, - TAVOR_TNF_ERROR, ""); - } /* Free the mailbox */ tavor_mbox_free(state, &mbox_info); - TAVOR_TNF_EXIT(tavor_init_hca_cmd_post); return (status); } @@ -1428,8 +1273,6 @@ tavor_close_hca_cmd_post(tavor_state_t *state, uint_t sleepflag) tavor_cmd_post_t cmd; int status; - TAVOR_TNF_ENTER(tavor_close_hca_cmd_post); - /* Make sure we are called with the correct flag */ ASSERT(sleepflag == TAVOR_CMD_NOSLEEP_SPIN); @@ -1441,12 +1284,7 @@ tavor_close_hca_cmd_post(tavor_state_t *state, uint_t sleepflag) cmd.cp_opmod = 0; cmd.cp_flags = sleepflag; status = tavor_cmd_post(state, &cmd); - if (status != TAVOR_CMD_SUCCESS) { - TNF_PROBE_0(tavor_close_hca_cmd_post_fail, - TAVOR_TNF_ERROR, ""); - } - TAVOR_TNF_EXIT(tavor_close_hca_cmd_post); return (status); } @@ -1466,8 +1304,6 @@ tavor_init_ib_cmd_post(tavor_state_t *state, tavor_hw_initib_t *initib, uint_t size; int status, i; - TAVOR_TNF_ENTER(tavor_init_ib_cmd_post); - /* Make sure we are called with the correct flag */ ASSERT(sleepflag == TAVOR_CMD_NOSLEEP_SPIN); @@ -1475,8 +1311,6 @@ tavor_init_ib_cmd_post(tavor_state_t *state, tavor_hw_initib_t *initib, mbox_info.mbi_alloc_flags = TAVOR_ALLOC_INMBOX; status = tavor_mbox_alloc(state, &mbox_info, sleepflag); if (status != TAVOR_CMD_SUCCESS) { - TNF_PROBE_0(tavor_init_ib_mbox_fail, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_init_ib_cmd_post); return (status); } @@ -1499,15 +1333,10 @@ tavor_init_ib_cmd_post(tavor_state_t *state, tavor_hw_initib_t *initib, cmd.cp_opmod = 0; cmd.cp_flags = sleepflag; status = tavor_cmd_post(state, &cmd); - if (status != TAVOR_CMD_SUCCESS) { - TNF_PROBE_0(tavor_init_ib_cmd_post_fail, - TAVOR_TNF_ERROR, ""); - } /* Free the mailbox */ tavor_mbox_free(state, &mbox_info); - TAVOR_TNF_EXIT(tavor_init_ib_cmd_post); return (status); } @@ -1523,8 +1352,6 @@ tavor_close_ib_cmd_post(tavor_state_t *state, uint_t port, uint_t sleepflag) tavor_cmd_post_t cmd; int status; - TAVOR_TNF_ENTER(tavor_close_ib_cmd_post); - /* Setup and post the Tavor "CLOSE_IB" command */ cmd.cp_inparm = 0; cmd.cp_outparm = 0; @@ -1533,11 +1360,7 @@ tavor_close_ib_cmd_post(tavor_state_t *state, uint_t port, uint_t sleepflag) cmd.cp_opmod = 0; cmd.cp_flags = sleepflag; status = tavor_cmd_post(state, &cmd); - if (status != TAVOR_CMD_SUCCESS) { - TNF_PROBE_0(tavor_close_ib_cmd_post_fail, TAVOR_TNF_ERROR, ""); - } - TAVOR_TNF_EXIT(tavor_close_ib_cmd_post); return (status); } @@ -1554,14 +1377,10 @@ tavor_set_ib_cmd_post(tavor_state_t *state, uint32_t capmask, uint_t port, tavor_cmd_post_t cmd; int status; - TAVOR_TNF_ENTER(tavor_set_ib_cmd_post); - /* Get an "In" mailbox for the command */ mbox_info.mbi_alloc_flags = TAVOR_ALLOC_INMBOX; status = tavor_mbox_alloc(state, &mbox_info, sleepflag); if (status != TAVOR_CMD_SUCCESS) { - TNF_PROBE_0(tavor_set_ib_mbox_fail, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_set_ib_cmd_post); return (status); } @@ -1583,14 +1402,10 @@ tavor_set_ib_cmd_post(tavor_state_t *state, uint32_t capmask, uint_t port, cmd.cp_opmod = 0; cmd.cp_flags = sleepflag; status = tavor_cmd_post(state, &cmd); - if (status != TAVOR_CMD_SUCCESS) { - TNF_PROBE_0(tavor_set_ib_cmd_post_fail, TAVOR_TNF_ERROR, ""); - } /* Free the mailbox */ tavor_mbox_free(state, &mbox_info); - TAVOR_TNF_EXIT(tavor_set_ib_cmd_post); return (status); } @@ -1609,8 +1424,6 @@ tavor_mod_stat_cfg_cmd_post(tavor_state_t *state) uint_t size; int status, i; - TAVOR_TNF_ENTER(tavor_mod_stat_cfg_cmd_post); - /* * "MOD_STAT_CFG" needs an INMBOX parameter, to specify what operations * to do. However, at the point in time that we call this command, the @@ -1622,8 +1435,6 @@ tavor_mod_stat_cfg_cmd_post(tavor_state_t *state) mbox_info.mbi_alloc_flags = TAVOR_ALLOC_OUTMBOX; status = tavor_mbox_alloc(state, &mbox_info, TAVOR_NOSLEEP); if (status != TAVOR_CMD_SUCCESS) { - TNF_PROBE_0(tavor_mod_stat_cfg_mbox_fail, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_mod_stat_cfg_cmd_post); return (status); } @@ -1664,10 +1475,6 @@ tavor_mod_stat_cfg_cmd_post(tavor_state_t *state) cmd.cp_opmod = 0; cmd.cp_flags = TAVOR_CMD_NOSLEEP_SPIN; status = tavor_cmd_post(state, &cmd); - if (status != TAVOR_CMD_SUCCESS) { - TNF_PROBE_0(tavor_mod_stat_cfg_cmd_post_fail, TAVOR_TNF_ERROR, - ""); - } /* Free "MOD_STAT_CFG" struct */ kmem_free(mod, sizeof (tavor_hw_mod_stat_cfg_t)); @@ -1675,7 +1482,6 @@ tavor_mod_stat_cfg_cmd_post(tavor_state_t *state) /* Free the mailbox */ tavor_mbox_free(state, &mbox_info); - TAVOR_TNF_EXIT(tavor_mod_stat_cfg_cmd_post); return (status); } @@ -1693,14 +1499,10 @@ tavor_mad_ifc_cmd_post(tavor_state_t *state, uint_t port, uint_t size; int status; - TAVOR_TNF_ENTER(tavor_mad_ifc_cmd_post); - /* Get "In" and "Out" mailboxes for the command */ mbox_info.mbi_alloc_flags = TAVOR_ALLOC_INMBOX | TAVOR_ALLOC_OUTMBOX; status = tavor_mbox_alloc(state, &mbox_info, sleepflag); if (status != TAVOR_CMD_SUCCESS) { - TNF_PROBE_0(tavor_mad_ifc_mbox_fail, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_mad_ifc_cmd_post); return (status); } @@ -1720,8 +1522,6 @@ tavor_mad_ifc_cmd_post(tavor_state_t *state, uint_t port, cmd.cp_flags = sleepflag; status = tavor_cmd_post(state, &cmd); if (status != TAVOR_CMD_SUCCESS) { - TNF_PROBE_0(tavor_mad_ifc_cmd_post_fail, - TAVOR_TNF_ERROR, ""); goto mad_ifc_fail; } @@ -1735,7 +1535,6 @@ mad_ifc_fail: /* Free the mailbox */ tavor_mbox_free(state, &mbox_info); - TAVOR_TNF_EXIT(tavor_mad_ifc_cmd_post); return (status); } @@ -1754,15 +1553,10 @@ tavor_getportinfo_cmd_post(tavor_state_t *state, uint_t port, uint_t size; int status, i; - TAVOR_TNF_ENTER(tavor_getportinfo_cmd_post); - /* Get "In" and "Out" mailboxes for the command */ mbox_info.mbi_alloc_flags = TAVOR_ALLOC_INMBOX | TAVOR_ALLOC_OUTMBOX; status = tavor_mbox_alloc(state, &mbox_info, sleepflag); if (status != TAVOR_CMD_SUCCESS) { - TNF_PROBE_0(tavor_getportinfo_mbox_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_getportinfo_cmd_post); return (status); } @@ -1791,8 +1585,6 @@ tavor_getportinfo_cmd_post(tavor_state_t *state, uint_t port, cmd.cp_flags = sleepflag; status = tavor_cmd_post(state, &cmd); if (status != TAVOR_CMD_SUCCESS) { - TNF_PROBE_0(tavor_getportinfo_cmd_post_fail, - TAVOR_TNF_ERROR, ""); goto getportinfo_fail; } @@ -1816,7 +1608,6 @@ getportinfo_fail: /* Free the mailbox */ tavor_mbox_free(state, &mbox_info); - TAVOR_TNF_EXIT(tavor_getportinfo_cmd_post); return (status); } @@ -1836,8 +1627,6 @@ tavor_getnodeinfo_cmd_post(tavor_state_t *state, uint_t sleepflag, uint_t size; int status, i; - TAVOR_TNF_ENTER(tavor_getnodeinfo_cmd_post); - /* Make sure we are called with the correct flag */ ASSERT(sleepflag == TAVOR_CMD_NOSLEEP_SPIN); @@ -1845,9 +1634,6 @@ tavor_getnodeinfo_cmd_post(tavor_state_t *state, uint_t sleepflag, mbox_info.mbi_alloc_flags = TAVOR_ALLOC_INMBOX | TAVOR_ALLOC_OUTMBOX; status = tavor_mbox_alloc(state, &mbox_info, sleepflag); if (status != TAVOR_CMD_SUCCESS) { - TNF_PROBE_0(tavor_getnodeinfo_mbox_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_getnodeinfo_cmd_post); return (status); } @@ -1875,8 +1661,6 @@ tavor_getnodeinfo_cmd_post(tavor_state_t *state, uint_t sleepflag, cmd.cp_flags = sleepflag; status = tavor_cmd_post(state, &cmd); if (status != TAVOR_CMD_SUCCESS) { - TNF_PROBE_0(tavor_getnodeinfo_cmd_post_fail, - TAVOR_TNF_ERROR, ""); goto getnodeinfo_fail; } @@ -1898,7 +1682,6 @@ getnodeinfo_fail: /* Free the mailbox */ tavor_mbox_free(state, &mbox_info); - TAVOR_TNF_EXIT(tavor_getnodeinfo_cmd_post); return (status); } @@ -1918,14 +1701,10 @@ tavor_getnodedesc_cmd_post(tavor_state_t *state, uint_t sleepflag, uint_t size; int status, i; - TAVOR_TNF_ENTER(tavor_getnodedesc_cmd_post); - /* Get "In" and "Out" mailboxes for the command */ mbox_info.mbi_alloc_flags = TAVOR_ALLOC_INMBOX | TAVOR_ALLOC_OUTMBOX; status = tavor_mbox_alloc(state, &mbox_info, sleepflag); if (status != TAVOR_CMD_SUCCESS) { - TNF_PROBE_0(tavor_getnodedesc_mbox_fail, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_getnodedesc_cmd_post); return (status); } @@ -1953,8 +1732,6 @@ tavor_getnodedesc_cmd_post(tavor_state_t *state, uint_t sleepflag, cmd.cp_flags = sleepflag; status = tavor_cmd_post(state, &cmd); if (status != TAVOR_CMD_SUCCESS) { - TNF_PROBE_0(tavor_getnodedesc_cmd_post_fail, - TAVOR_TNF_ERROR, ""); goto getnodedesc_fail; } @@ -1971,7 +1748,6 @@ getnodedesc_fail: /* Free the mailbox */ tavor_mbox_free(state, &mbox_info); - TAVOR_TNF_EXIT(tavor_getnodedesc_cmd_post); return (status); } @@ -1990,14 +1766,10 @@ tavor_getguidinfo_cmd_post(tavor_state_t *state, uint_t port, uint_t size; int status, i; - TAVOR_TNF_ENTER(tavor_getguidinfo_cmd_post); - /* Get "In" and "Out" mailboxes for the command */ mbox_info.mbi_alloc_flags = TAVOR_ALLOC_INMBOX | TAVOR_ALLOC_OUTMBOX; status = tavor_mbox_alloc(state, &mbox_info, sleepflag); if (status != TAVOR_CMD_SUCCESS) { - TNF_PROBE_0(tavor_getguidinfo_mbox_fail, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_getguidinfo_cmd_post); return (status); } @@ -2026,8 +1798,6 @@ tavor_getguidinfo_cmd_post(tavor_state_t *state, uint_t port, cmd.cp_flags = sleepflag; status = tavor_cmd_post(state, &cmd); if (status != TAVOR_CMD_SUCCESS) { - TNF_PROBE_0(tavor_getguidinfo_cmd_post_fail, - TAVOR_TNF_ERROR, ""); goto getguidinfo_fail; } @@ -2050,7 +1820,6 @@ getguidinfo_fail: /* Free the mailbox */ tavor_mbox_free(state, &mbox_info); - TAVOR_TNF_EXIT(tavor_getguidinfo_cmd_post); return (status); } @@ -2069,14 +1838,10 @@ tavor_getpkeytable_cmd_post(tavor_state_t *state, uint_t port, uint_t size; int status, i; - TAVOR_TNF_ENTER(tavor_getpkeytable_cmd_post); - /* Get "In" and "Out" mailboxes for the command */ mbox_info.mbi_alloc_flags = TAVOR_ALLOC_INMBOX | TAVOR_ALLOC_OUTMBOX; status = tavor_mbox_alloc(state, &mbox_info, sleepflag); if (status != TAVOR_CMD_SUCCESS) { - TNF_PROBE_0(tavor_getpkeytable_mbox_fail, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_getpkeytable_cmd_post); return (status); } @@ -2105,8 +1870,6 @@ tavor_getpkeytable_cmd_post(tavor_state_t *state, uint_t port, cmd.cp_flags = sleepflag; status = tavor_cmd_post(state, &cmd); if (status != TAVOR_CMD_SUCCESS) { - TNF_PROBE_0(tavor_getpkeytable_cmd_post_fail, - TAVOR_TNF_ERROR, ""); goto getpkeytable_fail; } @@ -2129,7 +1892,6 @@ getpkeytable_fail: /* Free the mailbox */ tavor_mbox_free(state, &mbox_info); - TAVOR_TNF_EXIT(tavor_getpkeytable_cmd_post); return (status); } @@ -2146,8 +1908,6 @@ tavor_write_mtt_cmd_post(tavor_state_t *state, tavor_mbox_info_t *mbox_info, uint_t size; int status; - TAVOR_TNF_ENTER(tavor_write_mtt_cmd_post); - /* * The WRITE_MTT command is unlike the other commands we use, in that * we have intentionally separated the mailbox allocation step from @@ -2170,11 +1930,7 @@ tavor_write_mtt_cmd_post(tavor_state_t *state, tavor_mbox_info_t *mbox_info, cmd.cp_opmod = 0; cmd.cp_flags = sleepflag; status = tavor_cmd_post(state, &cmd); - if (status != TAVOR_CMD_SUCCESS) { - TNF_PROBE_0(tavor_write_mtt_cmd_fail, TAVOR_TNF_ERROR, ""); - } - TAVOR_TNF_EXIT(tavor_write_mtt_cmd_post); return (status); } @@ -2189,8 +1945,6 @@ tavor_sync_tpt_cmd_post(tavor_state_t *state, uint_t sleepflag) tavor_cmd_post_t cmd; int status; - TAVOR_TNF_ENTER(tavor_sync_tpt_cmd_post); - /* Setup and post the Tavor "SYNC_TPT" command */ cmd.cp_inparm = 0; cmd.cp_outparm = 0; @@ -2199,11 +1953,7 @@ tavor_sync_tpt_cmd_post(tavor_state_t *state, uint_t sleepflag) cmd.cp_opmod = 0; cmd.cp_flags = sleepflag; status = tavor_cmd_post(state, &cmd); - if (status != TAVOR_CMD_SUCCESS) { - TNF_PROBE_0(tavor_sync_tpt_cmd_post_fail, TAVOR_TNF_ERROR, ""); - } - TAVOR_TNF_EXIT(tavor_sync_tpt_cmd_post); return (status); } @@ -2219,8 +1969,6 @@ tavor_map_eq_cmd_post(tavor_state_t *state, uint_t map, uint_t eqcindx, tavor_cmd_post_t cmd; int status; - TAVOR_TNF_ENTER(tavor_map_eq_cmd_post); - /* Setup and post Tavor "MAP_EQ" command */ cmd.cp_inparm = eqmapmask; cmd.cp_outparm = 0; @@ -2232,11 +1980,7 @@ tavor_map_eq_cmd_post(tavor_state_t *state, uint_t map, uint_t eqcindx, cmd.cp_opmod = 0; cmd.cp_flags = sleepflag; status = tavor_cmd_post(state, &cmd); - if (status != TAVOR_CMD_SUCCESS) { - TNF_PROBE_0(tavor_map_eq_cmd_post_fail, TAVOR_TNF_ERROR, ""); - } - TAVOR_TNF_EXIT(tavor_map_eq_cmd_post); return (status); } @@ -2255,14 +1999,10 @@ tavor_resize_cq_cmd_post(tavor_state_t *state, tavor_hw_cqc_t *cqc, uint_t size; int status, i; - TAVOR_TNF_ENTER(tavor_resize_cq_cmd_post); - /* Get an "In" mailbox for the command */ mbox_info.mbi_alloc_flags = TAVOR_ALLOC_INMBOX; status = tavor_mbox_alloc(state, &mbox_info, sleepflag); if (status != TAVOR_CMD_SUCCESS) { - TNF_PROBE_0(tavor_resize_cq_mbox_fail, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_resize_cq_cmd_post); return (status); } @@ -2285,9 +2025,6 @@ tavor_resize_cq_cmd_post(tavor_state_t *state, tavor_hw_cqc_t *cqc, cmd.cp_opmod = 0; cmd.cp_flags = sleepflag; status = tavor_cmd_post(state, &cmd); - if (status != TAVOR_CMD_SUCCESS) { - TNF_PROBE_0(tavor_resize_cq_cmd_post_fail, TAVOR_TNF_ERROR, ""); - } /* * New "producer index" is returned in the upper 32 bits of @@ -2298,7 +2035,6 @@ tavor_resize_cq_cmd_post(tavor_state_t *state, tavor_hw_cqc_t *cqc, /* Free the mailbox */ tavor_mbox_free(state, &mbox_info); - TAVOR_TNF_EXIT(tavor_resize_cq_cmd_post); return (status); } @@ -2328,8 +2064,6 @@ tavor_cmn_qp_cmd_post(tavor_state_t *state, uint_t opcode, uint_t size, flags, opmod; int status, i; - TAVOR_TNF_ENTER(tavor_cmn_qp_cmd_post); - /* * Use the specified opcode type to set the appropriate parameters. * Specifically, we need to set in_mapaddr, out_mapaddr, flags, and @@ -2390,9 +2124,6 @@ tavor_cmn_qp_cmd_post(tavor_state_t *state, uint_t opcode, mbox_info.mbi_alloc_flags = TAVOR_ALLOC_INMBOX; status = tavor_mbox_alloc(state, &mbox_info, sleepflag); if (status != TAVOR_CMD_SUCCESS) { - TNF_PROBE_0(tavor_cmn_qp_mbox_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_cmn_qp_cmd_post); return (status); } in_mapaddr = mbox_info.mbi_in->mb_mapaddr; @@ -2428,9 +2159,6 @@ tavor_cmn_qp_cmd_post(tavor_state_t *state, uint_t opcode, cmd.cp_opmod = opmod; cmd.cp_flags = sleepflag; status = tavor_cmd_post(state, &cmd); - if (status != TAVOR_CMD_SUCCESS) { - TNF_PROBE_0(tavor_cmn_qp_cmd_post_fail, TAVOR_TNF_ERROR, ""); - } /* * If we allocated a mailbox (either an "In" or an "Out") above, @@ -2442,7 +2170,6 @@ tavor_cmn_qp_cmd_post(tavor_state_t *state, uint_t opcode, tavor_mbox_free(state, &mbox_info); } - TAVOR_TNF_EXIT(tavor_cmn_qp_cmd_post); return (status); } @@ -2469,14 +2196,10 @@ tavor_cmn_query_cmd_post(tavor_state_t *state, uint_t opcode, uint_t offset; int status, i; - TAVOR_TNF_ENTER(tavor_cmn_query_cmd_post); - /* Get an "Out" mailbox for the command */ mbox_info.mbi_alloc_flags = TAVOR_ALLOC_OUTMBOX; status = tavor_mbox_alloc(state, &mbox_info, sleepflag); if (status != TAVOR_CMD_SUCCESS) { - TNF_PROBE_0(tavor_cmn_query_mbox_fail, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_cmn_query_cmd_post); return (status); } @@ -2489,7 +2212,6 @@ tavor_cmn_query_cmd_post(tavor_state_t *state, uint_t opcode, cmd.cp_flags = sleepflag; status = tavor_cmd_post(state, &cmd); if (status != TAVOR_CMD_SUCCESS) { - TNF_PROBE_0(tavor_cmn_query_cmd_post_fail, TAVOR_TNF_ERROR, ""); goto cmn_query_fail; } @@ -2514,7 +2236,6 @@ cmn_query_fail: /* Free the mailbox */ tavor_mbox_free(state, &mbox_info); - TAVOR_TNF_EXIT(tavor_cmn_query_cmd_post); return (status); } @@ -2545,8 +2266,6 @@ tavor_cmn_ownership_cmd_post(tavor_state_t *state, uint_t opcode, uint_t direction, opmod; int status, i; - TAVOR_TNF_ENTER(tavor_cmn_ownership_cmd_post); - /* * Determine the direction of the ownership transfer based on the * provided opcode @@ -2560,9 +2279,6 @@ tavor_cmn_ownership_cmd_post(tavor_state_t *state, uint_t opcode, direction = TAVOR_CMD_RSRC_SW2HW; } else { - TNF_PROBE_0(tavor_cmn_ownership_dir_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_cmn_ownership_cmd_post); return (TAVOR_CMD_INVALID_STATUS); } @@ -2595,9 +2311,6 @@ tavor_cmn_ownership_cmd_post(tavor_state_t *state, uint_t opcode, status = tavor_mbox_alloc(state, &mbox_info, sleepflag); if (status != TAVOR_CMD_SUCCESS) { - TNF_PROBE_0(tavor_cmn_ownership_mbox_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_cmn_ownership_cmd_post); return (status); } in_mapaddr = 0; @@ -2612,9 +2325,6 @@ tavor_cmn_ownership_cmd_post(tavor_state_t *state, uint_t opcode, mbox_info.mbi_alloc_flags = TAVOR_ALLOC_INMBOX; status = tavor_mbox_alloc(state, &mbox_info, sleepflag); if (status != TAVOR_CMD_SUCCESS) { - TNF_PROBE_0(tavor_cmn_ownership_mbox_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_sw2hw_mpt_cmd_post); return (status); } @@ -2645,8 +2355,6 @@ tavor_cmn_ownership_cmd_post(tavor_state_t *state, uint_t opcode, cmd.cp_flags = sleepflag; status = tavor_cmd_post(state, &cmd); if (status != TAVOR_CMD_SUCCESS) { - TNF_PROBE_0(tavor_cmn_ownership_cmd_post_fail, - TAVOR_TNF_ERROR, ""); goto cmn_ownership_fail; } @@ -2674,7 +2382,6 @@ cmn_ownership_fail: tavor_mbox_free(state, &mbox_info); } - TAVOR_TNF_EXIT(tavor_cmn_ownership_cmd_post); return (status); } @@ -2690,8 +2397,6 @@ tavor_conf_special_qp_cmd_post(tavor_state_t *state, uint_t qpindx, tavor_cmd_post_t cmd; int status; - TAVOR_TNF_ENTER(tavor_conf_special_qp_cmd_post); - /* Setup and post Tavor "CONF_SPECIAL_QP" command */ cmd.cp_inparm = 0; cmd.cp_outparm = 0; @@ -2700,12 +2405,7 @@ tavor_conf_special_qp_cmd_post(tavor_state_t *state, uint_t qpindx, cmd.cp_opmod = qptype; cmd.cp_flags = sleepflag; status = tavor_cmd_post(state, &cmd); - if (status != TAVOR_CMD_SUCCESS) { - TNF_PROBE_0(tavor_conf_special_qp_cmd_post_fail, - TAVOR_TNF_ERROR, ""); - } - TAVOR_TNF_EXIT(tavor_conf_special_qp_cmd_post); return (status); } @@ -2722,14 +2422,10 @@ tavor_mgid_hash_cmd_post(tavor_state_t *state, uint64_t mgid_h, tavor_cmd_post_t cmd; int status; - TAVOR_TNF_ENTER(tavor_mgid_hash_cmd_post); - /* Get an "In" mailbox for the command */ mbox_info.mbi_alloc_flags = TAVOR_ALLOC_INMBOX; status = tavor_mbox_alloc(state, &mbox_info, sleepflag); if (status != TAVOR_CMD_SUCCESS) { - TNF_PROBE_0(tavor_mgid_hash_mbox_fail, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_mgid_hash_cmd_post); return (status); } @@ -2751,9 +2447,6 @@ tavor_mgid_hash_cmd_post(tavor_state_t *state, uint64_t mgid_h, cmd.cp_opmod = 0; cmd.cp_flags = sleepflag; status = tavor_cmd_post(state, &cmd); - if (status != TAVOR_CMD_SUCCESS) { - TNF_PROBE_0(tavor_mgid_hash_cmd_post_fail, TAVOR_TNF_ERROR, ""); - } /* MGID hash value is returned in command "outparam" */ *mgid_hash = cmd.cp_outparm; @@ -2761,7 +2454,6 @@ tavor_mgid_hash_cmd_post(tavor_state_t *state, uint64_t mgid_h, /* Free the mailbox */ tavor_mbox_free(state, &mbox_info); - TAVOR_TNF_EXIT(tavor_mgid_hash_cmd_post); return (status); } @@ -2785,14 +2477,10 @@ tavor_read_mgm_cmd_post(tavor_state_t *state, tavor_hw_mcg_t *mcg, uint_t size, hdrsz, qplistsz; int status, i; - TAVOR_TNF_ENTER(tavor_read_mgm_cmd_post); - /* Get an "Out" mailbox for the results */ mbox_info.mbi_alloc_flags = TAVOR_ALLOC_OUTMBOX; status = tavor_mbox_alloc(state, &mbox_info, sleepflag); if (status != TAVOR_CMD_SUCCESS) { - TNF_PROBE_0(tavor_read_mgm_mbox_fail, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_read_mgm_cmd_post); return (status); } @@ -2805,7 +2493,6 @@ tavor_read_mgm_cmd_post(tavor_state_t *state, tavor_hw_mcg_t *mcg, cmd.cp_flags = sleepflag; status = tavor_cmd_post(state, &cmd); if (status != TAVOR_CMD_SUCCESS) { - TNF_PROBE_0(tavor_read_mgm_cmd_post_fail, TAVOR_TNF_ERROR, ""); goto read_mgm_fail; } @@ -2831,7 +2518,6 @@ read_mgm_fail: /* Free the mailbox */ tavor_mbox_free(state, &mbox_info); - TAVOR_TNF_EXIT(tavor_read_mgm_cmd_post); return (status); } @@ -2855,14 +2541,10 @@ tavor_write_mgm_cmd_post(tavor_state_t *state, tavor_hw_mcg_t *mcg, uint_t size, hdrsz, qplistsz; int status, i; - TAVOR_TNF_ENTER(tavor_write_mgm_cmd_post); - /* Get an "In" mailbox for the command */ mbox_info.mbi_alloc_flags = TAVOR_ALLOC_INMBOX; status = tavor_mbox_alloc(state, &mbox_info, sleepflag); if (status != TAVOR_CMD_SUCCESS) { - TNF_PROBE_0(tavor_write_mcg_mbox_fail, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_write_mgm_cmd_post); return (status); } @@ -2892,14 +2574,10 @@ tavor_write_mgm_cmd_post(tavor_state_t *state, tavor_hw_mcg_t *mcg, cmd.cp_opmod = 0; cmd.cp_flags = sleepflag; status = tavor_cmd_post(state, &cmd); - if (status != TAVOR_CMD_SUCCESS) { - TNF_PROBE_0(tavor_write_mgm_cmd_post_fail, TAVOR_TNF_ERROR, ""); - } /* Free the mailbox */ tavor_mbox_free(state, &mbox_info); - TAVOR_TNF_EXIT(tavor_write_mgm_cmd_post); return (status); } @@ -2919,14 +2597,10 @@ tavor_modify_mpt_cmd_post(tavor_state_t *state, tavor_hw_mpt_t *mpt, uint_t size; int status, i; - TAVOR_TNF_ENTER(tavor_modify_mpt_cmd_post); - /* Get an "In" mailbox for the command */ mbox_info.mbi_alloc_flags = TAVOR_ALLOC_INMBOX; status = tavor_mbox_alloc(state, &mbox_info, sleepflag); if (status != TAVOR_CMD_SUCCESS) { - TNF_PROBE_0(tavor_modify_mpt_mbox_fail, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_modify_mpt_cmd_post); return (status); } @@ -2949,15 +2623,10 @@ tavor_modify_mpt_cmd_post(tavor_state_t *state, tavor_hw_mpt_t *mpt, cmd.cp_opmod = flags; cmd.cp_flags = sleepflag; status = tavor_cmd_post(state, &cmd); - if (status != TAVOR_CMD_SUCCESS) { - TNF_PROBE_0(tavor_modify_mpt_cmd_post_fail, - TAVOR_TNF_ERROR, ""); - } /* Free the mailbox */ tavor_mbox_free(state, &mbox_info); - TAVOR_TNF_EXIT(tavor_modify_mpt_cmd_post); return (status); } diff --git a/usr/src/uts/common/io/ib/adapters/tavor/tavor_cq.c b/usr/src/uts/common/io/ib/adapters/tavor/tavor_cq.c index a31591dbbc..ef0892c6f2 100644 --- a/usr/src/uts/common/io/ib/adapters/tavor/tavor_cq.c +++ b/usr/src/uts/common/io/ib/adapters/tavor/tavor_cq.c @@ -77,9 +77,6 @@ tavor_cq_alloc(tavor_state_t *state, ibt_cq_hdl_t ibt_cqhdl, uint32_t log_cq_size, lkey, uarpg; uint_t dma_xfer_mode, cq_sync, cq_is_umap; int status, i, flag; - char *errormsg; - - TAVOR_TNF_ENTER(tavor_cq_alloc); _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*cq_attr)) @@ -96,8 +93,6 @@ tavor_cq_alloc(tavor_state_t *state, ibt_cq_hdl_t ibt_cqhdl, status = tavor_umap_db_find(state->ts_instance, ddi_get_pid(), MLNX_UMAP_UARPG_RSRC, &value, 0, NULL); if (status != DDI_SUCCESS) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_INVALID_PARAM, "failed UAR page"); goto cqalloc_fail; } uarpg = ((tavor_rsrc_t *)(uintptr_t)value)->tr_indx; @@ -118,8 +113,6 @@ tavor_cq_alloc(tavor_state_t *state, ibt_cq_hdl_t ibt_cqhdl, */ status = tavor_rsrc_alloc(state, TAVOR_CQC, 1, sleepflag, &cqc); if (status != DDI_SUCCESS) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_INSUFF_RESOURCE, "failed CQ context"); goto cqalloc_fail1; } @@ -131,8 +124,6 @@ tavor_cq_alloc(tavor_state_t *state, ibt_cq_hdl_t ibt_cqhdl, */ status = tavor_rsrc_alloc(state, TAVOR_CQHDL, 1, sleepflag, &rsrc); if (status != DDI_SUCCESS) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_INSUFF_RESOURCE, "failed CQ handle"); goto cqalloc_fail2; } cq = (tavor_cqhdl_t)rsrc->tr_addr; @@ -153,8 +144,6 @@ tavor_cq_alloc(tavor_state_t *state, ibt_cq_hdl_t ibt_cqhdl, umapdb = tavor_umap_db_alloc(state->ts_instance, cq->cq_cqnum, MLNX_UMAP_CQMEM_RSRC, (uint64_t)(uintptr_t)rsrc); if (umapdb == NULL) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_INSUFF_RESOURCE, "failed umap add"); goto cqalloc_fail3; } } @@ -173,8 +162,6 @@ tavor_cq_alloc(tavor_state_t *state, ibt_cq_hdl_t ibt_cqhdl, * with the device limits and/or software-configured limits) */ if (log_cq_size > state->ts_cfg_profile->cp_log_max_cq_sz) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_HCA_CQ_EXCEEDED, "max CQ size"); goto cqalloc_fail4; } @@ -203,8 +190,6 @@ tavor_cq_alloc(tavor_state_t *state, ibt_cq_hdl_t ibt_cqhdl, } status = tavor_queue_alloc(state, &cq->cq_cqinfo, sleepflag); if (status != DDI_SUCCESS) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_INSUFF_RESOURCE, "failed completion queue"); goto cqalloc_fail4; } buf = (tavor_hw_cqe_t *)cq->cq_cqinfo.qa_buf_aligned; @@ -244,8 +229,6 @@ tavor_cq_alloc(tavor_state_t *state, ibt_cq_hdl_t ibt_cqhdl, op.mro_bind_override_addr = 0; status = tavor_mr_register(state, pd, &mr_attr, &mr, &op); if (status != DDI_SUCCESS) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_INSUFF_RESOURCE, "failed register mr"); goto cqalloc_fail5; } _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*mr)) @@ -300,10 +283,6 @@ tavor_cq_alloc(tavor_state_t *state, ibt_cq_hdl_t ibt_cqhdl, if (status != TAVOR_CMD_SUCCESS) { cmn_err(CE_CONT, "Tavor: SW2HW_CQ command failed: %08x\n", status); - TNF_PROBE_1(tavor_cq_alloc_sw2hw_cq_cmd_fail, - TAVOR_TNF_ERROR, "", tnf_uint, status, status); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(ibc_get_ci_failure(0), "tavor SW2HW_CQ command"); goto cqalloc_fail6; } @@ -356,7 +335,6 @@ tavor_cq_alloc(tavor_state_t *state, ibt_cq_hdl_t ibt_cqhdl, } *cqhdl = cq; - TAVOR_TNF_EXIT(tavor_cq_alloc); return (DDI_SUCCESS); /* @@ -380,9 +358,6 @@ cqalloc_fail2: cqalloc_fail1: tavor_pd_refcnt_dec(pd); cqalloc_fail: - TNF_PROBE_1(tavor_cq_alloc_fail, TAVOR_TNF_ERROR, "", - tnf_string, msg, errormsg); - TAVOR_TNF_EXIT(tavor_cq_alloc); return (status); } @@ -406,8 +381,6 @@ tavor_cq_free(tavor_state_t *state, tavor_cqhdl_t *cqhdl, uint_t sleepflag) uint_t maxprot; int status; - TAVOR_TNF_ENTER(tavor_cq_free); - /* * Pull all the necessary information from the Tavor Completion Queue * handle. This is necessary here because the resource for the @@ -427,9 +400,6 @@ tavor_cq_free(tavor_state_t *state, tavor_cqhdl_t *cqhdl, uint_t sleepflag) */ if (cq->cq_refcnt != 0) { mutex_exit(&cq->cq_lock); - TNF_PROBE_1(tavor_cq_free_refcnt_fail, TAVOR_TNF_ERROR, "", - tnf_int, refcnt, cq->cq_refcnt); - TAVOR_TNF_EXIT(tavor_cq_free); return (IBT_CQ_BUSY); } @@ -448,7 +418,6 @@ tavor_cq_free(tavor_state_t *state, tavor_cqhdl_t *cqhdl, uint_t sleepflag) if (status != DDI_SUCCESS) { mutex_exit(&cq->cq_lock); TAVOR_WARNING(state, "failed to find in database"); - TAVOR_TNF_EXIT(tavor_cq_free); return (ibc_get_ci_failure(0)); } tavor_umap_db_free(umapdb); @@ -461,7 +430,6 @@ tavor_cq_free(tavor_state_t *state, tavor_cqhdl_t *cqhdl, uint_t sleepflag) mutex_exit(&cq->cq_lock); TAVOR_WARNING(state, "failed in CQ memory " "devmap_devmem_remap()"); - TAVOR_TNF_EXIT(tavor_cq_free); return (ibc_get_ci_failure(0)); } cq->cq_umap_dhp = (devmap_cookie_t)NULL; @@ -498,9 +466,6 @@ tavor_cq_free(tavor_state_t *state, tavor_cqhdl_t *cqhdl, uint_t sleepflag) TAVOR_WARNING(state, "failed to reclaim CQC ownership"); cmn_err(CE_CONT, "Tavor: HW2SW_CQ command failed: %08x\n", status); - TNF_PROBE_1(tavor_cq_free_hw2sw_cq_cmd_fail, - TAVOR_TNF_ERROR, "", tnf_uint, status, status); - TAVOR_TNF_EXIT(tavor_cq_free); return (ibc_get_ci_failure(0)); } @@ -514,8 +479,6 @@ tavor_cq_free(tavor_state_t *state, tavor_cqhdl_t *cqhdl, uint_t sleepflag) sleepflag); if (status != DDI_SUCCESS) { TAVOR_WARNING(state, "failed to deregister CQ memory"); - TNF_PROBE_0(tavor_cq_free_dereg_mr_fail, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_cq_free); return (ibc_get_ci_failure(0)); } @@ -534,7 +497,6 @@ tavor_cq_free(tavor_state_t *state, tavor_cqhdl_t *cqhdl, uint_t sleepflag) /* Set the cqhdl pointer to NULL and return success */ *cqhdl = NULL; - TAVOR_TNF_EXIT(tavor_cq_free); return (DDI_SUCCESS); } @@ -557,9 +519,6 @@ tavor_cq_resize(tavor_state_t *state, tavor_cqhdl_t cq, uint_t req_size, uint32_t new_prod_indx, old_cons_indx; uint_t dma_xfer_mode, cq_sync, log_cq_size, maxprot; int status, i, flag; - char *errormsg; - - TAVOR_TNF_ENTER(tavor_cq_resize); /* Use the internal protection domain (PD) for CQs */ pd = state->ts_pdhdl_internal; @@ -578,8 +537,6 @@ tavor_cq_resize(tavor_state_t *state, tavor_cqhdl_t cq, uint_t req_size, * with the device limits and/or software-configured limits) */ if (log_cq_size > state->ts_cfg_profile->cp_log_max_cq_sz) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_HCA_CQ_EXCEEDED, "max CQ size"); goto cqresize_fail; } @@ -609,8 +566,6 @@ tavor_cq_resize(tavor_state_t *state, tavor_cqhdl_t cq, uint_t req_size, } status = tavor_queue_alloc(state, &new_cqinfo, sleepflag); if (status != DDI_SUCCESS) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_INSUFF_RESOURCE, "failed completion queue"); goto cqresize_fail; } buf = (tavor_hw_cqe_t *)new_cqinfo.qa_buf_aligned; @@ -649,8 +604,6 @@ tavor_cq_resize(tavor_state_t *state, tavor_cqhdl_t cq, uint_t req_size, status = tavor_mr_register(state, pd, &mr_attr, &mr, &op); if (status != DDI_SUCCESS) { tavor_queue_free(state, &new_cqinfo); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_INSUFF_RESOURCE, "failed register mr"); goto cqresize_fail; } _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*mr)) @@ -707,9 +660,6 @@ tavor_cq_resize(tavor_state_t *state, tavor_cqhdl_t cq, uint_t req_size, tavor_queue_free(state, &new_cqinfo); TAVOR_WARNING(state, "failed to find in database"); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(ibc_get_ci_failure(0), - "failed umap lookup"); goto cqresize_fail; } old_cons_indx = cqc_entry.cons_indx; @@ -748,14 +698,10 @@ tavor_cq_resize(tavor_state_t *state, tavor_cqhdl_t cq, uint_t req_size, } tavor_queue_free(state, &new_cqinfo); if (status == TAVOR_CMD_BAD_SIZE) { - TAVOR_TNF_EXIT(tavor_cq_resize); return (IBT_CQ_SZ_INSUFFICIENT); } else { cmn_err(CE_CONT, "Tavor: RESIZE_CQ command failed: " "%08x\n", status); - TNF_PROBE_1(tavor_cq_resize_cq_cmd_fail, - TAVOR_TNF_ERROR, "", tnf_uint, status, status); - TAVOR_TNF_EXIT(tavor_cq_resize); return (ibc_get_ci_failure(0)); } } @@ -806,7 +752,6 @@ tavor_cq_resize(tavor_state_t *state, tavor_cqhdl_t cq, uint_t req_size, mutex_exit(&cq->cq_lock); TAVOR_WARNING(state, "failed in CQ memory " "devmap_devmem_remap()"); - TAVOR_TNF_EXIT(tavor_cq_free); return (ibc_get_ci_failure(0)); } cq->cq_umap_dhp = (devmap_cookie_t)NULL; @@ -830,9 +775,6 @@ tavor_cq_resize(tavor_state_t *state, tavor_cqhdl_t cq, uint_t req_size, sleepflag); if (status != DDI_SUCCESS) { TAVOR_WARNING(state, "failed to deregister old CQ memory"); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(ibc_get_ci_failure(0), - "failed deregister mr (old)"); goto cqresize_fail; } @@ -847,13 +789,9 @@ tavor_cq_resize(tavor_state_t *state, tavor_cqhdl_t cq, uint_t req_size, *actual_size = (1 << log_cq_size) - 1; } - TAVOR_TNF_EXIT(tavor_cq_resize); return (DDI_SUCCESS); cqresize_fail: - TNF_PROBE_1(tavor_cq_resize_fail, TAVOR_TNF_ERROR, "", - tnf_string, msg, errormsg); - TAVOR_TNF_EXIT(tavor_cq_resize); return (status); } @@ -868,8 +806,6 @@ tavor_cq_notify(tavor_state_t *state, tavor_cqhdl_t cq, { uint_t cqnum; - TAVOR_TNF_ENTER(tavor_cq_notify); - /* * Determine if we are trying to get the next completion or the next * "solicited" completion. Then hit the appropriate doorbell. @@ -888,13 +824,9 @@ tavor_cq_notify(tavor_state_t *state, tavor_cqhdl_t cq, cqnum, TAVOR_CQDB_DEFAULT_PARAM); } else { - TNF_PROBE_1(tavor_cq_notify_invflags_fail, TAVOR_TNF_ERROR, "", - tnf_int, flags, flags); - TAVOR_TNF_EXIT(tavor_cq_notify); return (IBT_CQ_NOTIFY_TYPE_INVALID); } - TAVOR_TNF_EXIT(tavor_cq_notify); return (DDI_SUCCESS); } @@ -912,17 +844,12 @@ tavor_cq_poll(tavor_state_t *state, tavor_cqhdl_t cq, ibt_wc_t *wc_p, uint32_t polled_cnt, num_to_increment; int status; - TAVOR_TNF_ENTER(tavor_cq_poll); - /* * Check for user-mappable CQ memory. Note: We do not allow kernel * clients to poll CQ memory that is accessible directly by the user. * If the CQ memory is user accessible, then return an error. */ if (cq->cq_is_umap) { - TNF_PROBE_0(tavor_cq_poll_inv_usrmapped_type, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_cq_poll); return (IBT_CQ_HDL_INVALID); } @@ -1039,7 +966,6 @@ tavor_cq_poll(tavor_state_t *state, tavor_cqhdl_t cq, ibt_wc_t *wc_p, (void) tavor_isr((caddr_t)state, (caddr_t)NULL); } - TAVOR_TNF_EXIT(tavor_cq_poll); return (status); } @@ -1056,19 +982,14 @@ tavor_cq_handler(tavor_state_t *state, tavor_eqhdl_t eq, uint_t cqnum; uint_t eqe_evttype; - TAVOR_TNF_ENTER(tavor_cq_handler); - eqe_evttype = TAVOR_EQE_EVTTYPE_GET(eq, eqe); ASSERT(eqe_evttype == TAVOR_EVT_COMPLETION || eqe_evttype == TAVOR_EVT_EQ_OVERFLOW); if (eqe_evttype == TAVOR_EVT_EQ_OVERFLOW) { - TNF_PROBE_0(tavor_cq_handler_eq_overflow_condition, - TAVOR_TNF_ERROR, ""); tavor_eq_overflow_handler(state, eq, eqe); - TAVOR_TNF_EXIT(tavor_cq_handler); return (DDI_FAILURE); } @@ -1107,13 +1028,8 @@ tavor_cq_handler(tavor_state_t *state, tavor_eqhdl_t eq, if ((cq != NULL) && (cq->cq_cqnum == cqnum) && (state->ts_ibtfpriv != NULL)) { TAVOR_DO_IBTF_CQ_CALLB(state, cq); - } else { - TNF_PROBE_2(tavor_cq_handler_dropped_event, - TAVOR_TNF_ERROR, "", tnf_uint, ev_cqnum, cqnum, - tnf_uint, hdl_cqnum, cqnum); } - TAVOR_TNF_EXIT(tavor_cq_handler); return (DDI_SUCCESS); } @@ -1132,19 +1048,14 @@ tavor_cq_err_handler(tavor_state_t *state, tavor_eqhdl_t eq, ibt_async_code_t type; uint_t eqe_evttype; - TAVOR_TNF_ENTER(tavor_cq_err_handler); - eqe_evttype = TAVOR_EQE_EVTTYPE_GET(eq, eqe); ASSERT(eqe_evttype == TAVOR_EVT_CQ_ERRORS || eqe_evttype == TAVOR_EVT_EQ_OVERFLOW); if (eqe_evttype == TAVOR_EVT_EQ_OVERFLOW) { - TNF_PROBE_0(tavor_cq_err_handler_eq_overflow_condition, - TAVOR_TNF_ERROR, ""); tavor_eq_overflow_handler(state, eq, eqe); - TAVOR_TNF_EXIT(tavor_cq_err_handler); return (DDI_FAILURE); } @@ -1180,13 +1091,8 @@ tavor_cq_err_handler(tavor_state_t *state, tavor_eqhdl_t eq, type = IBT_ERROR_CQ; TAVOR_DO_IBTF_ASYNC_CALLB(state, type, &event); - } else { - TNF_PROBE_2(tavor_cq_err_handler_dropped_event, - TAVOR_TNF_ERROR, "", tnf_uint, ev_cqnum, cqnum, - tnf_uint, hdl_cqnum, cqnum); } - TAVOR_TNF_EXIT(tavor_cq_err_handler); return (DDI_SUCCESS); } @@ -1206,8 +1112,6 @@ tavor_cq_refcnt_inc(tavor_cqhdl_t cq, uint_t is_special) * CQ is being used. */ mutex_enter(&cq->cq_lock); - TNF_PROBE_1_DEBUG(tavor_cq_refcnt_inc, TAVOR_TNF_TRACE, "", - tnf_uint, refcnt, cq->cq_refcnt); if (cq->cq_refcnt == 0) { cq->cq_is_special = is_special; } else { @@ -1232,8 +1136,6 @@ tavor_cq_refcnt_dec(tavor_cqhdl_t cq) /* Decrement the completion queue's reference count */ mutex_enter(&cq->cq_lock); cq->cq_refcnt--; - TNF_PROBE_1_DEBUG(tavor_cq_refcnt_dec, TAVOR_TNF_TRACE, "", - tnf_uint, refcnt, cq->cq_refcnt); mutex_exit(&cq->cq_lock); } @@ -1252,9 +1154,6 @@ tavor_cq_doorbell(tavor_state_t *state, uint32_t cq_cmd, uint32_t cqn, doorbell = ((uint64_t)cq_cmd << TAVOR_CQDB_CMD_SHIFT) | ((uint64_t)cqn << TAVOR_CQDB_CQN_SHIFT) | cq_param; - TNF_PROBE_1_DEBUG(tavor_cq_doorbell, TAVOR_TNF_TRACE, "", - tnf_ulong, doorbell, doorbell); - /* Write the doorbell to UAR */ TAVOR_UAR_DOORBELL(state, (uint64_t *)&state->ts_uar->cq, doorbell); @@ -1303,8 +1202,6 @@ tavor_cq_cqe_consume(tavor_state_t *state, tavor_cqhdl_t cq, uint_t flags, type, opcode, qpnum, qp1_indx; int status; - TAVOR_TNF_ENTER(tavor_cq_cqe_consume); - /* * Determine if this is an "error" CQE by examining "opcode". If it * is an error CQE, then call tavor_cq_errcqe_consume() and return @@ -1315,7 +1212,6 @@ tavor_cq_cqe_consume(tavor_state_t *state, tavor_cqhdl_t cq, if ((opcode == TAVOR_CQE_SEND_ERR_OPCODE) || (opcode == TAVOR_CQE_RECV_ERR_OPCODE)) { status = tavor_cq_errcqe_consume(state, cq, cqe, wc); - TAVOR_TNF_EXIT(tavor_cq_cqe_consume); return (status); } @@ -1368,9 +1264,6 @@ tavor_cq_cqe_consume(tavor_state_t *state, tavor_cqhdl_t cq, default: TAVOR_WARNING(state, "unknown send CQE type"); wc->wc_status = IBT_WC_LOCAL_QP_OP_ERR; - TNF_PROBE_1(tavor_cq_cqe_consume_unknown_send_type, - TAVOR_TNF_ERROR, "", tnf_uint, opcode, opcode); - TAVOR_TNF_EXIT(tavor_cq_cqe_consume); return (TAVOR_CQ_SYNC_AND_DB); } } else { @@ -1409,9 +1302,6 @@ tavor_cq_cqe_consume(tavor_state_t *state, tavor_cqhdl_t cq, default: TAVOR_WARNING(state, "unknown recv CQE type"); wc->wc_status = IBT_WC_LOCAL_QP_OP_ERR; - TNF_PROBE_1(tavor_cq_cqe_consume_unknown_rcv_type, - TAVOR_TNF_ERROR, "", tnf_uint, opcode, opcode); - TAVOR_TNF_EXIT(tavor_cq_cqe_consume); return (TAVOR_CQ_SYNC_AND_DB); } } @@ -1459,7 +1349,6 @@ tavor_cq_cqe_consume(tavor_state_t *state, tavor_cqhdl_t cq, wc->wc_bytes_xfer = TAVOR_CQE_BYTECNT_GET(cq, cqe); } - TAVOR_TNF_EXIT(tavor_cq_cqe_consume); return (TAVOR_CQ_SYNC_AND_DB); } @@ -1478,8 +1367,6 @@ tavor_cq_errcqe_consume(tavor_state_t *state, tavor_cqhdl_t cq, uint_t doorbell_cnt, status; tavor_wrid_entry_t wre; - TAVOR_TNF_ENTER(tavor_cq_errcqe_consume); - /* * Fetch the Work Request ID using the information in the CQE. * See tavor_wr.c for more details. @@ -1556,8 +1443,6 @@ tavor_cq_errcqe_consume(tavor_state_t *state, tavor_cqhdl_t cq, default: TAVOR_WARNING(state, "unknown error CQE status"); status = IBT_WC_LOCAL_QP_OP_ERR; - TNF_PROBE_1(tavor_cq_errcqe_consume_unknown_status, - TAVOR_TNF_ERROR, "", tnf_uint, status, status); break; } wc->wc_status = status; @@ -1599,7 +1484,6 @@ tavor_cq_errcqe_consume(tavor_state_t *state, tavor_cqhdl_t cq, * Return status to indicate that doorbell and sync may be * necessary. */ - TAVOR_TNF_EXIT(tavor_cq_errcqe_consume); return (TAVOR_CQ_SYNC_AND_DB); } else { @@ -1622,7 +1506,6 @@ tavor_cq_errcqe_consume(tavor_state_t *state, tavor_cqhdl_t cq, TAVOR_CQE_WQEADDRSZ_SET(cq, cqe, TAVOR_QP_WQEADDRSZ(next_wqeaddr, nextwqesize)); - TAVOR_TNF_EXIT(tavor_cq_errcqe_consume); return (TAVOR_CQ_RECYCLE_ENTRY); } } @@ -1637,30 +1520,17 @@ tavor_cqe_sync(tavor_cqhdl_t cq, tavor_hw_cqe_t *cqe, uint_t flag) { ddi_dma_handle_t dmahdl; off_t offset; - int status; - - TAVOR_TNF_ENTER(tavor_cqe_sync); /* Determine if CQ needs to be synced or not */ - if (cq->cq_sync == 0) { - TAVOR_TNF_EXIT(tavor_cqe_sync); + if (cq->cq_sync == 0) return; - } /* Get the DMA handle from CQ context */ dmahdl = cq->cq_mrhdl->mr_bindinfo.bi_dmahdl; /* Calculate offset of next CQE */ offset = (off_t)((uintptr_t)cqe - (uintptr_t)&cq->cq_buf[0]); - status = ddi_dma_sync(dmahdl, offset, sizeof (tavor_hw_cqe_t), flag); - if (status != DDI_SUCCESS) { - TNF_PROBE_0(tavor_cqe_sync_getnextentry_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_cqe_sync); - return; - } - - TAVOR_TNF_EXIT(tavor_cqe_sync); + (void) ddi_dma_sync(dmahdl, offset, sizeof (tavor_hw_cqe_t), flag); } @@ -1676,8 +1546,6 @@ tavor_cq_resize_helper(tavor_cqhdl_t cq, tavor_hw_cqe_t *new_cqbuf, uint32_t new_cons_indx, wrap_around_mask; int i; - TAVOR_TNF_ENTER(tavor_cq_resize_helper); - ASSERT(MUTEX_HELD(&cq->cq_lock)); /* Get the consumer index */ @@ -1720,8 +1588,6 @@ tavor_cq_resize_helper(tavor_cqhdl_t cq, tavor_hw_cqe_t *new_cqbuf, old_cqe = &cq->cq_buf[old_cons_indx]; new_cqe = &new_cqbuf[new_cons_indx]; } - - TAVOR_TNF_EXIT(tavor_cq_resize_helper); } /* diff --git a/usr/src/uts/common/io/ib/adapters/tavor/tavor_event.c b/usr/src/uts/common/io/ib/adapters/tavor/tavor_event.c index e253fea14d..4c690d3f0d 100644 --- a/usr/src/uts/common/io/ib/adapters/tavor/tavor_event.c +++ b/usr/src/uts/common/io/ib/adapters/tavor/tavor_event.c @@ -91,9 +91,6 @@ tavor_eq_init_all(tavor_state_t *state) uint_t log_eq_size, intr_num; uint_t num_eq, num_eq_init, num_eq_unmap; int status, i; - char *errormsg; - - TAVOR_TNF_ENTER(tavor_eq_init_all); /* * For now, all Event Queues default to the same size (pulled from @@ -140,8 +137,6 @@ tavor_eq_init_all(tavor_state_t *state) status = tavor_eq_alloc(state, log_eq_size, intr_num, &state->ts_eqhdl[i]); if (status != DDI_SUCCESS) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(status, "failed EQ alloc"); num_eq_init = i; goto all_eq_init_fail; } @@ -172,8 +167,6 @@ tavor_eq_init_all(tavor_state_t *state) status = tavor_eq_handler_init(state, state->ts_eqhdl[32], TAVOR_EVT_MSK_CQ_ERRORS, tavor_cq_err_handler); if (status != DDI_SUCCESS) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(status, "completion queue error event"); goto all_eq_init_fail; } num_eq_unmap = 33; @@ -190,8 +183,6 @@ tavor_eq_init_all(tavor_state_t *state) status = tavor_eq_handler_init(state, state->ts_eqhdl[33], TAVOR_EVT_MSK_PORT_STATE_CHANGE, tavor_port_state_change_handler); if (status != DDI_SUCCESS) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(status, "port state change event"); goto all_eq_init_fail; } num_eq_unmap = 34; @@ -208,8 +199,6 @@ tavor_eq_init_all(tavor_state_t *state) status = tavor_eq_handler_init(state, state->ts_eqhdl[34], TAVOR_EVT_MSK_COMM_ESTABLISHED, tavor_comm_estbl_handler); if (status != DDI_SUCCESS) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(status, "communication established event"); goto all_eq_init_fail; } num_eq_unmap = 35; @@ -228,8 +217,6 @@ tavor_eq_init_all(tavor_state_t *state) status = tavor_eq_handler_init(state, state->ts_eqhdl[35], TAVOR_EVT_MSK_COMMAND_INTF_COMP, tavor_cmd_complete_handler); if (status != DDI_SUCCESS) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(status, "command completion event"); goto all_eq_init_fail; } num_eq_unmap = 36; @@ -246,8 +233,6 @@ tavor_eq_init_all(tavor_state_t *state) status = tavor_eq_handler_init(state, state->ts_eqhdl[36], TAVOR_EVT_MSK_LOCAL_WQ_CAT_ERROR, tavor_local_wq_cat_err_handler); if (status != DDI_SUCCESS) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(status, "local WQ catastrophic error event"); goto all_eq_init_fail; } num_eq_unmap = 37; @@ -265,8 +250,6 @@ tavor_eq_init_all(tavor_state_t *state) TAVOR_EVT_MSK_INV_REQ_LOCAL_WQ_ERROR, tavor_invreq_local_wq_err_handler); if (status != DDI_SUCCESS) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(status, "invalid req local WQ error event"); goto all_eq_init_fail; } num_eq_unmap = 38; @@ -284,8 +267,6 @@ tavor_eq_init_all(tavor_state_t *state) TAVOR_EVT_MSK_LOCAL_ACC_VIO_WQ_ERROR, tavor_local_acc_vio_wq_err_handler); if (status != DDI_SUCCESS) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(status, "local access violation WQ error event"); goto all_eq_init_fail; } num_eq_unmap = 39; @@ -303,8 +284,6 @@ tavor_eq_init_all(tavor_state_t *state) status = tavor_eq_handler_init(state, state->ts_eqhdl[39], TAVOR_EVT_MSK_SEND_QUEUE_DRAINED, tavor_sendq_drained_handler); if (status != DDI_SUCCESS) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(status, "send queue drained event"); goto all_eq_init_fail; } num_eq_unmap = 40; @@ -322,8 +301,6 @@ tavor_eq_init_all(tavor_state_t *state) status = tavor_eq_handler_init(state, state->ts_eqhdl[40], TAVOR_EVT_MSK_PATH_MIGRATED, tavor_path_mig_handler); if (status != DDI_SUCCESS) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(status, "path migration succeeded event"); goto all_eq_init_fail; } num_eq_unmap = 41; @@ -341,8 +318,6 @@ tavor_eq_init_all(tavor_state_t *state) status = tavor_eq_handler_init(state, state->ts_eqhdl[41], TAVOR_EVT_MSK_PATH_MIGRATE_FAILED, tavor_path_mig_err_handler); if (status != DDI_SUCCESS) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(status, "path migration failed event"); goto all_eq_init_fail; } num_eq_unmap = 42; @@ -365,8 +340,6 @@ tavor_eq_init_all(tavor_state_t *state) status = tavor_eq_handler_init(state, state->ts_eqhdl[42], TAVOR_EVT_MSK_LOCAL_CAT_ERROR, NULL); if (status != DDI_SUCCESS) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(status, "local catastrophic error event"); goto all_eq_init_fail; } num_eq_unmap = 43; @@ -384,8 +357,6 @@ tavor_eq_init_all(tavor_state_t *state) TAVOR_EVT_MSK_SRQ_CATASTROPHIC_ERROR, tavor_srq_catastrophic_handler); if (status != DDI_SUCCESS) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(status, "srq catastrophic error event"); goto all_eq_init_fail; } num_eq_unmap = 44; @@ -403,8 +374,6 @@ tavor_eq_init_all(tavor_state_t *state) TAVOR_EVT_MSK_SRQ_LAST_WQE_REACHED, tavor_srq_last_wqe_reached_handler); if (status != DDI_SUCCESS) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(status, "srq last wqe reached event"); goto all_eq_init_fail; } num_eq_unmap = 45; @@ -422,8 +391,6 @@ tavor_eq_init_all(tavor_state_t *state) TAVOR_EVT_MSK_ECC_DETECTION, tavor_ecc_detection_handler); if (status != DDI_SUCCESS) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(status, "ecc detection event"); goto all_eq_init_fail; } num_eq_unmap = 46; @@ -440,14 +407,9 @@ tavor_eq_init_all(tavor_state_t *state) status = tavor_eq_handler_init(state, state->ts_eqhdl[46], TAVOR_EVT_CATCHALL_MASK, tavor_no_eqhandler); if (status != DDI_SUCCESS) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(status, "all other events"); - TNF_PROBE_0(tavor_eq_init_all_allothershdlr_fail, - TAVOR_TNF_ERROR, ""); goto all_eq_init_fail; } - TAVOR_TNF_EXIT(tavor_eq_init_all); return (DDI_SUCCESS); all_eq_init_fail: @@ -460,9 +422,6 @@ all_eq_init_fail: for (i = 0; i < num_eq_init; i++) { (void) tavor_eq_free(state, &state->ts_eqhdl[i]); } - TNF_PROBE_1(tavor_eq_init_all_fail, TAVOR_TNF_ERROR, "", - tnf_string, msg, errormsg); - TAVOR_TNF_EXIT(tavor_eq_init_all); return (status); } @@ -477,8 +436,6 @@ tavor_eq_fini_all(tavor_state_t *state) uint_t num_eq; int status, i; - TAVOR_TNF_ENTER(tavor_eq_fini_all); - /* * Grab the total number of supported EQs again. This is the same * hardcoded value that was used above (during the event queue @@ -493,9 +450,6 @@ tavor_eq_fini_all(tavor_state_t *state) for (i = 0; i < num_eq; i++) { status = tavor_eq_handler_fini(state, state->ts_eqhdl[i]); if (status != DDI_SUCCESS) { - TNF_PROBE_0(tavor_eq_fini_all_eqhdlfini_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_eq_fini_all); return (DDI_FAILURE); } } @@ -507,14 +461,10 @@ tavor_eq_fini_all(tavor_state_t *state) for (i = 0; i < num_eq; i++) { status = tavor_eq_free(state, &state->ts_eqhdl[i]); if (status != DDI_SUCCESS) { - TNF_PROBE_0(tavor_eq_fini_all_eqfree_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_eq_fini_all); return (DDI_FAILURE); } } - TAVOR_TNF_EXIT(tavor_eq_fini_all); return (DDI_SUCCESS); } @@ -529,8 +479,6 @@ tavor_eq_arm_all(tavor_state_t *state) uint_t num_eq; int i; - TAVOR_TNF_ENTER(tavor_eq_arm_all); - /* * Grab the total number of supported EQs again. This is the same * hardcoded value that was used above (during the event queue @@ -545,8 +493,6 @@ tavor_eq_arm_all(tavor_state_t *state) for (i = 0; i < num_eq; i++) { tavor_eq_doorbell(state, TAVOR_EQDB_REARM_EQ, i, 0); } - - TAVOR_TNF_EXIT(tavor_eq_arm_all); } @@ -564,8 +510,6 @@ tavor_isr(caddr_t arg1, caddr_t arg2) uint_t status; int i; - TAVOR_TNF_ENTER(tavor_isr); - /* * Grab the Tavor softstate pointer from the input parameter */ @@ -620,7 +564,6 @@ tavor_isr(caddr_t arg1, caddr_t arg2) } while (ecrreg != 0x0); - TAVOR_TNF_EXIT(tavor_isr); return (status); } @@ -639,9 +582,6 @@ tavor_eq_doorbell(tavor_state_t *state, uint32_t eq_cmd, uint32_t eqn, doorbell = ((uint64_t)eq_cmd << TAVOR_EQDB_CMD_SHIFT) | ((uint64_t)eqn << TAVOR_EQDB_EQN_SHIFT) | eq_param; - TNF_PROBE_1_DEBUG(tavor_eq_doorbell, TAVOR_TNF_TRACE, "", - tnf_ulong, doorbell, doorbell); - /* Write the doorbell to UAR */ TAVOR_UAR_DOORBELL(state, (uint64_t *)&state->ts_uar->eq, doorbell); @@ -661,8 +601,6 @@ tavor_eq_poll(tavor_state_t *state, tavor_eqhdl_t eq) int (*eqfunction)(tavor_state_t *state, tavor_eqhdl_t eq, tavor_hw_eqe_t *eqe); - TAVOR_TNF_ENTER(tavor_eq_poll); - _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*eq)) /* Find the pointer to the clr_ECR register */ @@ -687,7 +625,6 @@ tavor_eq_poll(tavor_state_t *state, tavor_eqhdl_t eq) ecr_mask = ((uint64_t)1 << eq->eq_eqnum); ddi_put64(state->ts_reg_cmdhdl, clr_ecr, ecr_mask); - TAVOR_TNF_EXIT(tavor_eq_poll); return; } @@ -797,8 +734,6 @@ tavor_eq_poll(tavor_state_t *state, tavor_eqhdl_t eq) TAVOR_EQ_SYNC_NORMAL); } while (TAVOR_EQE_OWNER_IS_SW(eq, eqe)); - - TAVOR_TNF_EXIT(tavor_eq_poll); } @@ -818,8 +753,6 @@ tavor_eq_catastrophic(tavor_state_t *state) uint32_t err_buf; int i; - TAVOR_TNF_ENTER(tavor_eq_catastrophic); - bzero(&event, sizeof (ibc_async_event_t)); base_addr = (uint32_t *)(uintptr_t)( @@ -890,8 +823,6 @@ tavor_eq_catastrophic(tavor_state_t *state) if (state->ts_ibtfpriv != NULL) { TAVOR_DO_IBTF_ASYNC_CALLB(state, type, &event); } - - TAVOR_TNF_EXIT(tavor_eq_catastrophic); } @@ -915,9 +846,6 @@ tavor_eq_alloc(tavor_state_t *state, uint32_t log_eq_size, uint_t intr, uint32_t lkey; uint_t dma_xfer_mode; int status, i; - char *errormsg; - - TAVOR_TNF_ENTER(tavor_eq_alloc); /* Use the internal protection domain (PD) for setting up EQs */ pd = state->ts_pdhdl_internal; @@ -934,8 +862,6 @@ tavor_eq_alloc(tavor_state_t *state, uint32_t log_eq_size, uint_t intr, */ status = tavor_rsrc_alloc(state, TAVOR_EQC, 1, TAVOR_SLEEP, &eqc); if (status != DDI_SUCCESS) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(DDI_FAILURE, "failed EQ context"); goto eqalloc_fail1; } @@ -947,8 +873,6 @@ tavor_eq_alloc(tavor_state_t *state, uint32_t log_eq_size, uint_t intr, */ status = tavor_rsrc_alloc(state, TAVOR_EQHDL, 1, TAVOR_SLEEP, &rsrc); if (status != DDI_SUCCESS) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(DDI_FAILURE, "failed EQ handler"); goto eqalloc_fail2; } eq = (tavor_eqhdl_t)rsrc->tr_addr; @@ -970,8 +894,6 @@ tavor_eq_alloc(tavor_state_t *state, uint32_t log_eq_size, uint_t intr, eq->eq_eqinfo.qa_location = TAVOR_QUEUE_LOCATION_NORMAL; status = tavor_queue_alloc(state, &eq->eq_eqinfo, TAVOR_SLEEP); if (status != DDI_SUCCESS) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(DDI_FAILURE, "failed event queue"); goto eqalloc_fail3; } buf = (tavor_hw_eqe_t *)eq->eq_eqinfo.qa_buf_aligned; @@ -1008,8 +930,6 @@ tavor_eq_alloc(tavor_state_t *state, uint32_t log_eq_size, uint_t intr, op.mro_bind_override_addr = 0; status = tavor_mr_register(state, pd, &mr_attr, &mr, &op); if (status != DDI_SUCCESS) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(DDI_FAILURE, "failed register mr"); goto eqalloc_fail4; } _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*mr)) @@ -1057,10 +977,6 @@ tavor_eq_alloc(tavor_state_t *state, uint32_t log_eq_size, uint_t intr, if (status != TAVOR_CMD_SUCCESS) { cmn_err(CE_CONT, "Tavor: SW2HW_EQ command failed: %08x\n", status); - TNF_PROBE_1(tavor_eq_alloc_sw2hw_eq_cmd_fail, - TAVOR_TNF_ERROR, "", tnf_uint, status, status); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(ibc_get_ci_failure(0), "tavor SW2HW_EQ command"); goto eqalloc_fail5; } @@ -1078,7 +994,6 @@ tavor_eq_alloc(tavor_state_t *state, uint32_t log_eq_size, uint_t intr, eq->eq_mrhdl = mr; *eqhdl = eq; - TAVOR_TNF_EXIT(tavor_eq_alloc); return (DDI_SUCCESS); /* @@ -1098,9 +1013,6 @@ eqalloc_fail2: eqalloc_fail1: tavor_pd_refcnt_dec(pd); eqalloc_fail: - TNF_PROBE_1(tavor_eq_alloc_fail, TAVOR_TNF_ERROR, "", - tnf_string, msg, errormsg); - TAVOR_TNF_EXIT(tavor_eq_alloc); return (status); } @@ -1120,8 +1032,6 @@ tavor_eq_free(tavor_state_t *state, tavor_eqhdl_t *eqhdl) uint32_t eqnum; int status; - TAVOR_TNF_ENTER(tavor_eq_free); - /* * Pull all the necessary information from the Tavor Event Queue * handle. This is necessary here because the resource for the @@ -1146,9 +1056,6 @@ tavor_eq_free(tavor_state_t *state, tavor_eqhdl_t *eqhdl) TAVOR_WARNING(state, "failed to reclaim EQC ownership"); cmn_err(CE_CONT, "Tavor: HW2SW_EQ command failed: %08x\n", status); - TNF_PROBE_1(tavor_eq_free_hw2sw_eq_cmd_fail, - TAVOR_TNF_ERROR, "", tnf_uint, status, status); - TAVOR_TNF_EXIT(tavor_eq_free); return (DDI_FAILURE); } @@ -1162,8 +1069,6 @@ tavor_eq_free(tavor_state_t *state, tavor_eqhdl_t *eqhdl) TAVOR_NOSLEEP); if (status != DDI_SUCCESS) { TAVOR_WARNING(state, "failed to deregister EQ memory"); - TNF_PROBE_0(tavor_eq_free_dereg_mr_fail, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_eq_free); } /* Free the memory for the EQ */ @@ -1181,7 +1086,6 @@ tavor_eq_free(tavor_state_t *state, tavor_eqhdl_t *eqhdl) /* Set the eqhdl pointer to NULL and return success */ *eqhdl = NULL; - TAVOR_TNF_EXIT(tavor_eq_free); return (DDI_SUCCESS); } @@ -1197,8 +1101,6 @@ tavor_eq_handler_init(tavor_state_t *state, tavor_eqhdl_t eq, { int status; - TAVOR_TNF_ENTER(tavor_eq_handler_init); - /* * Save away the EQ handler function and the event type mask. These * will be used later during interrupt and event queue processing. @@ -1223,14 +1125,10 @@ tavor_eq_handler_init(tavor_state_t *state, tavor_eqhdl_t eq, if (status != TAVOR_CMD_SUCCESS) { cmn_err(CE_CONT, "Tavor: MAP_EQ command failed: " "%08x\n", status); - TNF_PROBE_1(tavor_eq_handler_init_map_eq_cmd_fail, - TAVOR_TNF_ERROR, "", tnf_uint, status, status); - TAVOR_TNF_EXIT(tavor_eq_handler_init); return (DDI_FAILURE); } } - TAVOR_TNF_EXIT(tavor_eq_handler_init); return (DDI_SUCCESS); } @@ -1244,8 +1142,6 @@ tavor_eq_handler_fini(tavor_state_t *state, tavor_eqhdl_t eq) { int status; - TAVOR_TNF_ENTER(tavor_eq_handler_fini); - /* * Unmap the EQ from the event class to which it had been previously * mapped. The unmapping is done using the Tavor MAP_EQ (in much @@ -1265,14 +1161,10 @@ tavor_eq_handler_fini(tavor_state_t *state, tavor_eqhdl_t eq) if (status != TAVOR_CMD_SUCCESS) { cmn_err(CE_CONT, "Tavor: MAP_EQ command failed: " "%08x\n", status); - TNF_PROBE_1(tavor_eq_handler_fini_map_eq_cmd_fail, - TAVOR_TNF_ERROR, "", tnf_uint, status, status); - TAVOR_TNF_EXIT(tavor_eq_handler_fini); return (DDI_FAILURE); } } - TAVOR_TNF_EXIT(tavor_eq_handler_fini); return (DDI_SUCCESS); } @@ -1294,13 +1186,9 @@ tavor_eqe_sync(tavor_eqhdl_t eq, tavor_hw_eqe_t *eqe, uint_t flag, { ddi_dma_handle_t dmahdl; off_t offset; - int status; - - TAVOR_TNF_ENTER(tavor_eqe_sync); /* Determine if EQ needs to be synced or not */ if ((eq->eq_sync == 0) && (force_sync == TAVOR_EQ_SYNC_NORMAL)) { - TAVOR_TNF_EXIT(tavor_eqe_sync); return; } @@ -1309,15 +1197,7 @@ tavor_eqe_sync(tavor_eqhdl_t eq, tavor_hw_eqe_t *eqe, uint_t flag, /* Calculate offset of next EQE */ offset = (off_t)((uintptr_t)eqe - (uintptr_t)&eq->eq_buf[0]); - status = ddi_dma_sync(dmahdl, offset, sizeof (tavor_hw_eqe_t), flag); - if (status != DDI_SUCCESS) { - TNF_PROBE_0(tavor_eqe_sync_getnextentry_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_eqe_sync); - return; - } - - TAVOR_TNF_EXIT(tavor_eqe_sync); + (void) ddi_dma_sync(dmahdl, offset, sizeof (tavor_hw_eqe_t), flag); } @@ -1335,19 +1215,14 @@ tavor_port_state_change_handler(tavor_state_t *state, tavor_eqhdl_t eq, uint_t eqe_evttype; char link_msg[24]; - TAVOR_TNF_ENTER(tavor_port_state_change_handler); - eqe_evttype = TAVOR_EQE_EVTTYPE_GET(eq, eqe); ASSERT(eqe_evttype == TAVOR_EVT_PORT_STATE_CHANGE || eqe_evttype == TAVOR_EVT_EQ_OVERFLOW); if (eqe_evttype == TAVOR_EVT_EQ_OVERFLOW) { - TNF_PROBE_0(tavor_port_state_change_eq_overflow_condition, - TAVOR_TNF_ERROR, ""); tavor_eq_overflow_handler(state, eq, eqe); - TAVOR_TNF_EXIT(tavor_port_state_change_handler); return (DDI_FAILURE); } @@ -1362,7 +1237,6 @@ tavor_port_state_change_handler(tavor_state_t *state, tavor_eqhdl_t eq, TAVOR_WARNING(state, "Unexpected port number in port state " "change event"); cmn_err(CE_CONT, " Port number: %02x\n", port); - TAVOR_TNF_EXIT(tavor_port_state_change_handler); return (DDI_FAILURE); } @@ -1386,7 +1260,6 @@ tavor_port_state_change_handler(tavor_state_t *state, tavor_eqhdl_t eq, "event"); cmn_err(CE_CONT, " Event type: %02x, subtype: %02x\n", TAVOR_EQE_EVTTYPE_GET(eq, eqe), subtype); - TAVOR_TNF_EXIT(tavor_port_state_change_handler); return (DDI_FAILURE); } @@ -1400,7 +1273,6 @@ tavor_port_state_change_handler(tavor_state_t *state, tavor_eqhdl_t eq, TAVOR_DO_IBTF_ASYNC_CALLB(state, type, &event); } - TAVOR_TNF_EXIT(tavor_port_state_change_handler); return (DDI_SUCCESS); } @@ -1419,19 +1291,14 @@ tavor_comm_estbl_handler(tavor_state_t *state, tavor_eqhdl_t eq, ibt_async_code_t type; uint_t eqe_evttype; - TAVOR_TNF_ENTER(tavor_comm_estbl_handler); - eqe_evttype = TAVOR_EQE_EVTTYPE_GET(eq, eqe); ASSERT(eqe_evttype == TAVOR_EVT_COMM_ESTABLISHED || eqe_evttype == TAVOR_EVT_EQ_OVERFLOW); if (eqe_evttype == TAVOR_EVT_EQ_OVERFLOW) { - TNF_PROBE_0(tavor_comm_estbl_eq_overflow_condition, - TAVOR_TNF_ERROR, ""); tavor_eq_overflow_handler(state, eq, eqe); - TAVOR_TNF_EXIT(tavor_comm_estbl_handler); return (DDI_FAILURE); } @@ -1465,13 +1332,8 @@ tavor_comm_estbl_handler(tavor_state_t *state, tavor_eqhdl_t eq, type = IBT_EVENT_COM_EST_QP; TAVOR_DO_IBTF_ASYNC_CALLB(state, type, &event); - } else { - TNF_PROBE_2(tavor_comm_estbl_handler_dropped_event, - TAVOR_TNF_ERROR, "", tnf_uint, ev_qpnum, qpnum, - tnf_uint, hdl_qpnum, qpnum); } - TAVOR_TNF_EXIT(tavor_comm_estbl_handler); return (DDI_SUCCESS); } @@ -1490,19 +1352,14 @@ tavor_local_wq_cat_err_handler(tavor_state_t *state, tavor_eqhdl_t eq, ibt_async_code_t type; uint_t eqe_evttype; - TAVOR_TNF_ENTER(tavor_local_wq_cat_err_handler); - eqe_evttype = TAVOR_EQE_EVTTYPE_GET(eq, eqe); ASSERT(eqe_evttype == TAVOR_EVT_LOCAL_WQ_CAT_ERROR || eqe_evttype == TAVOR_EVT_EQ_OVERFLOW); if (eqe_evttype == TAVOR_EVT_EQ_OVERFLOW) { - TNF_PROBE_0(tavor_local_wq_cat_err_eq_overflow_condition, - TAVOR_TNF_ERROR, ""); tavor_eq_overflow_handler(state, eq, eqe); - TAVOR_TNF_EXIT(tavor_local_wq_cat_err_handler); return (DDI_FAILURE); } @@ -1536,13 +1393,8 @@ tavor_local_wq_cat_err_handler(tavor_state_t *state, tavor_eqhdl_t eq, type = IBT_ERROR_CATASTROPHIC_QP; TAVOR_DO_IBTF_ASYNC_CALLB(state, type, &event); - } else { - TNF_PROBE_2(tavor_local_wq_cat_err_handler_dropped_event, - TAVOR_TNF_ERROR, "", tnf_uint, ev_qpnum, qpnum, - tnf_uint, hdl_qpnum, qpnum); } - TAVOR_TNF_EXIT(tavor_local_wq_cat_err_handler); return (DDI_SUCCESS); } @@ -1561,19 +1413,14 @@ tavor_invreq_local_wq_err_handler(tavor_state_t *state, tavor_eqhdl_t eq, ibt_async_code_t type; uint_t eqe_evttype; - TAVOR_TNF_ENTER(tavor_invreq_local_wq_err_handler); - eqe_evttype = TAVOR_EQE_EVTTYPE_GET(eq, eqe); ASSERT(eqe_evttype == TAVOR_EVT_INV_REQ_LOCAL_WQ_ERROR || eqe_evttype == TAVOR_EVT_EQ_OVERFLOW); if (eqe_evttype == TAVOR_EVT_EQ_OVERFLOW) { - TNF_PROBE_0(tavor_invreq_local_wq_err_eq_overflow_condition, - TAVOR_TNF_ERROR, ""); tavor_eq_overflow_handler(state, eq, eqe); - TAVOR_TNF_EXIT(tavor_port_state_change_handler); return (DDI_FAILURE); } @@ -1607,13 +1454,8 @@ tavor_invreq_local_wq_err_handler(tavor_state_t *state, tavor_eqhdl_t eq, type = IBT_ERROR_INVALID_REQUEST_QP; TAVOR_DO_IBTF_ASYNC_CALLB(state, type, &event); - } else { - TNF_PROBE_2(tavor_invreq_local_wq_err_handler_dropped_event, - TAVOR_TNF_ERROR, "", tnf_uint, ev_qpnum, qpnum, - tnf_uint, hdl_qpnum, qpnum); } - TAVOR_TNF_EXIT(tavor_invreq_local_wq_err_handler); return (DDI_SUCCESS); } @@ -1632,19 +1474,14 @@ tavor_local_acc_vio_wq_err_handler(tavor_state_t *state, tavor_eqhdl_t eq, ibt_async_code_t type; uint_t eqe_evttype; - TAVOR_TNF_ENTER(tavor_local_acc_vio_wq_err_handler); - eqe_evttype = TAVOR_EQE_EVTTYPE_GET(eq, eqe); ASSERT(eqe_evttype == TAVOR_EVT_LOCAL_ACC_VIO_WQ_ERROR || eqe_evttype == TAVOR_EVT_EQ_OVERFLOW); if (eqe_evttype == TAVOR_EVT_EQ_OVERFLOW) { - TNF_PROBE_0(tavor_local_acc_vio_wq_err_eq_overflow_condition, - TAVOR_TNF_ERROR, ""); tavor_eq_overflow_handler(state, eq, eqe); - TAVOR_TNF_EXIT(tavor_local_acc_vio_wq_err_handler); return (DDI_FAILURE); } @@ -1678,13 +1515,8 @@ tavor_local_acc_vio_wq_err_handler(tavor_state_t *state, tavor_eqhdl_t eq, type = IBT_ERROR_ACCESS_VIOLATION_QP; TAVOR_DO_IBTF_ASYNC_CALLB(state, type, &event); - } else { - TNF_PROBE_2(tavor_local_acc_vio_wq_err_handler_dropped_event, - TAVOR_TNF_ERROR, "", tnf_uint, ev_qpnum, qpnum, - tnf_uint, hdl_qpnum, qpnum); } - TAVOR_TNF_EXIT(tavor_local_acc_vio_wq_err_handler); return (DDI_SUCCESS); } @@ -1704,19 +1536,14 @@ tavor_sendq_drained_handler(tavor_state_t *state, tavor_eqhdl_t eq, ibt_async_code_t type; uint_t eqe_evttype; - TAVOR_TNF_ENTER(tavor_sendq_drained_handler); - eqe_evttype = TAVOR_EQE_EVTTYPE_GET(eq, eqe); ASSERT(eqe_evttype == TAVOR_EVT_SEND_QUEUE_DRAINED || eqe_evttype == TAVOR_EVT_EQ_OVERFLOW); if (eqe_evttype == TAVOR_EVT_EQ_OVERFLOW) { - TNF_PROBE_0(tavor_sendq_drained_eq_overflow_condition, - TAVOR_TNF_ERROR, ""); tavor_eq_overflow_handler(state, eq, eqe); - TAVOR_TNF_EXIT(tavor_sendq_drained_handler); return (DDI_FAILURE); } @@ -1765,13 +1592,8 @@ tavor_sendq_drained_handler(tavor_state_t *state, tavor_eqhdl_t eq, if (forward_sqd_event != 0) { TAVOR_DO_IBTF_ASYNC_CALLB(state, type, &event); } - } else { - TNF_PROBE_2(tavor_sendq_drained_handler_dropped_event, - TAVOR_TNF_ERROR, "", tnf_uint, ev_qpnum, qpnum, - tnf_uint, hdl_qpnum, qpnum); } - TAVOR_TNF_EXIT(tavor_sendq_drained_handler); return (DDI_SUCCESS); } @@ -1790,19 +1612,14 @@ tavor_path_mig_handler(tavor_state_t *state, tavor_eqhdl_t eq, ibt_async_code_t type; uint_t eqe_evttype; - TAVOR_TNF_ENTER(tavor_path_mig_handler); - eqe_evttype = TAVOR_EQE_EVTTYPE_GET(eq, eqe); ASSERT(eqe_evttype == TAVOR_EVT_PATH_MIGRATED || eqe_evttype == TAVOR_EVT_EQ_OVERFLOW); if (eqe_evttype == TAVOR_EVT_EQ_OVERFLOW) { - TNF_PROBE_0(tavor_path_mig_eq_overflow_condition, - TAVOR_TNF_ERROR, ""); tavor_eq_overflow_handler(state, eq, eqe); - TAVOR_TNF_EXIT(tavor_path_mig_handler); return (DDI_FAILURE); } @@ -1836,13 +1653,8 @@ tavor_path_mig_handler(tavor_state_t *state, tavor_eqhdl_t eq, type = IBT_EVENT_PATH_MIGRATED_QP; TAVOR_DO_IBTF_ASYNC_CALLB(state, type, &event); - } else { - TNF_PROBE_2(tavor_path_mig_handler_dropped_event, - TAVOR_TNF_ERROR, "", tnf_uint, ev_qpnum, qpnum, - tnf_uint, hdl_qpnum, qpnum); } - TAVOR_TNF_EXIT(tavor_path_mig_handler); return (DDI_SUCCESS); } @@ -1861,19 +1673,14 @@ tavor_path_mig_err_handler(tavor_state_t *state, tavor_eqhdl_t eq, ibt_async_code_t type; uint_t eqe_evttype; - TAVOR_TNF_ENTER(tavor_path_mig_err_handler); - eqe_evttype = TAVOR_EQE_EVTTYPE_GET(eq, eqe); ASSERT(eqe_evttype == TAVOR_EVT_PATH_MIGRATE_FAILED || eqe_evttype == TAVOR_EVT_EQ_OVERFLOW); if (eqe_evttype == TAVOR_EVT_EQ_OVERFLOW) { - TNF_PROBE_0(tavor_path_mig_err_eq_overflow_condition, - TAVOR_TNF_ERROR, ""); tavor_eq_overflow_handler(state, eq, eqe); - TAVOR_TNF_EXIT(tavor_path_mig_err_handler); return (DDI_FAILURE); } @@ -1907,13 +1714,8 @@ tavor_path_mig_err_handler(tavor_state_t *state, tavor_eqhdl_t eq, type = IBT_ERROR_PATH_MIGRATE_REQ_QP; TAVOR_DO_IBTF_ASYNC_CALLB(state, type, &event); - } else { - TNF_PROBE_2(tavor_path_mig_err_handler_dropped_event, - TAVOR_TNF_ERROR, "", tnf_uint, ev_qpnum, qpnum, - tnf_uint, hdl_qpnum, qpnum); } - TAVOR_TNF_EXIT(tavor_path_mig_err_handler); return (DDI_SUCCESS); } @@ -1932,19 +1734,14 @@ tavor_srq_catastrophic_handler(tavor_state_t *state, tavor_eqhdl_t eq, ibt_async_code_t type; uint_t eqe_evttype; - TAVOR_TNF_ENTER(tavor_srq_catastrophic_handler); - eqe_evttype = TAVOR_EQE_EVTTYPE_GET(eq, eqe); ASSERT(eqe_evttype == TAVOR_EVT_SRQ_CATASTROPHIC_ERROR || eqe_evttype == TAVOR_EVT_EQ_OVERFLOW); if (eqe_evttype == TAVOR_EVT_EQ_OVERFLOW) { - TNF_PROBE_0(tavor_srq_catastrophic_overflow_condition, - TAVOR_TNF_ERROR, ""); tavor_eq_overflow_handler(state, eq, eqe); - TAVOR_TNF_EXIT(tavor_srq_catastrophic_handler); return (DDI_FAILURE); } @@ -1982,13 +1779,8 @@ tavor_srq_catastrophic_handler(tavor_state_t *state, tavor_eqhdl_t eq, mutex_exit(&qp->qp_srqhdl->srq_lock); TAVOR_DO_IBTF_ASYNC_CALLB(state, type, &event); - } else { - TNF_PROBE_2(tavor_srq_catastrophic_handler_dropped_event, - TAVOR_TNF_ERROR, "", tnf_uint, ev_qpnum, qpnum, - tnf_uint, hdl_qpnum, qpnum); } - TAVOR_TNF_EXIT(tavor_srq_catastrophic_handler); return (DDI_SUCCESS); } @@ -2007,19 +1799,14 @@ tavor_srq_last_wqe_reached_handler(tavor_state_t *state, tavor_eqhdl_t eq, ibt_async_code_t type; uint_t eqe_evttype; - TAVOR_TNF_ENTER(tavor_srq_last_wqe_reached_handler); - eqe_evttype = TAVOR_EQE_EVTTYPE_GET(eq, eqe); ASSERT(eqe_evttype == TAVOR_EVT_SRQ_LAST_WQE_REACHED || eqe_evttype == TAVOR_EVT_EQ_OVERFLOW); if (eqe_evttype == TAVOR_EVT_EQ_OVERFLOW) { - TNF_PROBE_0(tavor_srq_last_wqe_reached_over_condition, - TAVOR_TNF_ERROR, ""); tavor_eq_overflow_handler(state, eq, eqe); - TAVOR_TNF_EXIT(tavor_srq_last_wqe_reached_handler); return (DDI_FAILURE); } @@ -2053,13 +1840,8 @@ tavor_srq_last_wqe_reached_handler(tavor_state_t *state, tavor_eqhdl_t eq, type = IBT_EVENT_EMPTY_CHAN; TAVOR_DO_IBTF_ASYNC_CALLB(state, type, &event); - } else { - TNF_PROBE_2(tavor_srq_last_wqe_reached_dropped_event, - TAVOR_TNF_ERROR, "", tnf_uint, ev_qpnum, qpnum, - tnf_uint, hdl_qpnum, qpnum); } - TAVOR_TNF_EXIT(tavor_srq_last_wqe_reached_handler); return (DDI_SUCCESS); } @@ -2076,19 +1858,14 @@ tavor_ecc_detection_handler(tavor_state_t *state, tavor_eqhdl_t eq, uint_t data; int i; - TAVOR_TNF_ENTER(tavor_ecc_detection_handler); - eqe_evttype = TAVOR_EQE_EVTTYPE_GET(eq, eqe); ASSERT(eqe_evttype == TAVOR_EVT_ECC_DETECTION || eqe_evttype == TAVOR_EVT_EQ_OVERFLOW); if (eqe_evttype == TAVOR_EVT_EQ_OVERFLOW) { - TNF_PROBE_0(tavor_ecc_detection_eq_overflow_condition, - TAVOR_TNF_ERROR, ""); tavor_eq_overflow_handler(state, eq, eqe); - TAVOR_TNF_EXIT(tavor_ecc_detection_handler); return (DDI_FAILURE); } @@ -2104,7 +1881,6 @@ tavor_ecc_detection_handler(tavor_state_t *state, tavor_eqhdl_t eq, cmn_err(CE_CONT, "! EQE[%02x]: %08x\n", i, data); } - TAVOR_TNF_EXIT(tavor_ecc_detection_handler); return (DDI_SUCCESS); } @@ -2119,8 +1895,6 @@ tavor_eq_overflow_handler(tavor_state_t *state, tavor_eqhdl_t eq, { uint_t error_type, data; - TAVOR_TNF_ENTER(tavor_eq_overflow_handler); - ASSERT(TAVOR_EQE_EVTTYPE_GET(eq, eqe) == TAVOR_EVT_EQ_OVERFLOW); /* @@ -2135,8 +1909,6 @@ tavor_eq_overflow_handler(tavor_state_t *state, tavor_eqhdl_t eq, TAVOR_WARNING(state, "Event Queue overflow"); cmn_err(CE_CONT, " Error type: %02x, data: %08x\n", error_type, data); - - TAVOR_TNF_EXIT(tavor_eq_overflow_handler); } @@ -2152,8 +1924,6 @@ tavor_no_eqhandler(tavor_state_t *state, tavor_eqhdl_t eq, uint_t data; int i; - TAVOR_TNF_ENTER(tavor_no_eqhandler); - /* * This "unexpected event" handler (or "catch-all" handler) will * receive all events for which no other handler has been registered. @@ -2171,6 +1941,5 @@ tavor_no_eqhandler(tavor_state_t *state, tavor_eqhdl_t eq, cmn_err(CE_CONT, " EQE[%02x]: %08x\n", i, data); } - TAVOR_TNF_EXIT(tavor_no_eqhandler); return (DDI_SUCCESS); } diff --git a/usr/src/uts/common/io/ib/adapters/tavor/tavor_ioctl.c b/usr/src/uts/common/io/ib/adapters/tavor/tavor_ioctl.c index 0719ad84e8..cbbe3c511d 100644 --- a/usr/src/uts/common/io/ib/adapters/tavor/tavor_ioctl.c +++ b/usr/src/uts/common/io/ib/adapters/tavor/tavor_ioctl.c @@ -138,25 +138,17 @@ tavor_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *credp, minor_t instance; int status; - TAVOR_TNF_ENTER(tavor_ioctl); - if (drv_priv(credp) != 0) { - TNF_PROBE_0(tavor_ioctl_priv_fail, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ioctl); return (EPERM); } instance = TAVOR_DEV_INSTANCE(dev); if (instance == -1) { - TNF_PROBE_0(tavor_ioctl_inst_fail, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ioctl); return (EBADF); } state = ddi_get_soft_state(tavor_statep, instance); if (state == NULL) { - TNF_PROBE_0(tavor_ioctl_gss_fail, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ioctl); return (EBADF); } @@ -211,12 +203,10 @@ tavor_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *credp, default: status = ENOTTY; - TNF_PROBE_0(tavor_ioctl_default_fail, TAVOR_TNF_ERROR, ""); break; } *rvalp = status; - TAVOR_TNF_EXIT(tavor_ioctl); return (status); } @@ -229,8 +219,6 @@ tavor_ioctl_flash_read(tavor_state_t *state, dev_t dev, intptr_t arg, int mode) tavor_flash_ioctl_t ioctl_info; int status = 0; - TAVOR_TNF_ENTER(tavor_ioctl_flash_read); - /* * Check that flash init ioctl has been called first. And check * that the same dev_t that called init is the one calling read now. @@ -239,8 +227,6 @@ tavor_ioctl_flash_read(tavor_state_t *state, dev_t dev, intptr_t arg, int mode) if ((state->ts_fw_flashdev != dev) || (state->ts_fw_flashstarted == 0)) { mutex_exit(&state->ts_fw_flashlock); - TNF_PROBE_0(tavor_flash_bad_state, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ioctl_flash_read); return (EIO); } @@ -252,9 +238,6 @@ tavor_ioctl_flash_read(tavor_state_t *state, dev_t dev, intptr_t arg, int mode) if (ddi_copyin((void *)arg, &info32, sizeof (tavor_flash_ioctl32_t), mode) != 0) { mutex_exit(&state->ts_fw_flashlock); - TNF_PROBE_0(tavor_ioctl_flash_read_copyin_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ioctl_flash_read); return (EFAULT); } ioctl_info.tf_type = info32.tf_type; @@ -266,9 +249,6 @@ tavor_ioctl_flash_read(tavor_state_t *state, dev_t dev, intptr_t arg, int mode) if (ddi_copyin((void *)arg, &ioctl_info, sizeof (tavor_flash_ioctl_t), mode) != 0) { mutex_exit(&state->ts_fw_flashlock); - TNF_PROBE_0(tavor_ioctl_flash_read_copyin_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ioctl_flash_read); return (EFAULT); } @@ -281,9 +261,6 @@ tavor_ioctl_flash_read(tavor_state_t *state, dev_t dev, intptr_t arg, int mode) if (ioctl_info.tf_sector_num >= (state->ts_fw_device_sz >> state->ts_fw_log_sector_sz)) { mutex_exit(&state->ts_fw_flashlock); - TNF_PROBE_0(tavor_flash_read_sector_num_too_large, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ioctl_flash_read); return (EFAULT); } @@ -296,9 +273,6 @@ tavor_ioctl_flash_read(tavor_state_t *state, dev_t dev, intptr_t arg, int mode) &ioctl_info.tf_sector[0], 1 << state->ts_fw_log_sector_sz, mode) != 0) { mutex_exit(&state->ts_fw_flashlock); - TNF_PROBE_0(tavor_flash_read_copyout_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ioctl_flash_read); return (EFAULT); } break; @@ -307,9 +281,6 @@ tavor_ioctl_flash_read(tavor_state_t *state, dev_t dev, intptr_t arg, int mode) /* Check if addr is too large for flash device */ if (ioctl_info.tf_addr >= state->ts_fw_device_sz) { mutex_exit(&state->ts_fw_flashlock); - TNF_PROBE_0(tavor_flash_read_quad_addr_too_large, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ioctl_flash_read); return (EFAULT); } @@ -320,8 +291,6 @@ tavor_ioctl_flash_read(tavor_state_t *state, dev_t dev, intptr_t arg, int mode) break; default: - TNF_PROBE_0(tavor_ioctl_flash_read_invalid_type, - TAVOR_TNF_ERROR, ""); status = EIO; break; } @@ -340,9 +309,6 @@ tavor_ioctl_flash_read(tavor_state_t *state, dev_t dev, intptr_t arg, int mode) if (ddi_copyout(&info32, (void *)arg, sizeof (tavor_flash_ioctl32_t), mode) != 0) { mutex_exit(&state->ts_fw_flashlock); - TNF_PROBE_0(tavor_flash_read_copyout_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ioctl_flash_read); return (EFAULT); } } else @@ -350,14 +316,10 @@ tavor_ioctl_flash_read(tavor_state_t *state, dev_t dev, intptr_t arg, int mode) if (ddi_copyout(&ioctl_info, (void *)arg, sizeof (tavor_flash_ioctl_t), mode) != 0) { mutex_exit(&state->ts_fw_flashlock); - TNF_PROBE_0(tavor_flash_read_copyout_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ioctl_flash_read); return (EFAULT); } mutex_exit(&state->ts_fw_flashlock); - TAVOR_TNF_EXIT(tavor_ioctl_flash_read); return (status); } @@ -370,8 +332,6 @@ tavor_ioctl_flash_write(tavor_state_t *state, dev_t dev, intptr_t arg, int mode) tavor_flash_ioctl_t ioctl_info; int status = 0; - TAVOR_TNF_ENTER(tavor_ioctl_flash_write); - /* * Check that flash init ioctl has been called first. And check * that the same dev_t that called init is the one calling write now. @@ -380,8 +340,6 @@ tavor_ioctl_flash_write(tavor_state_t *state, dev_t dev, intptr_t arg, int mode) if ((state->ts_fw_flashdev != dev) || (state->ts_fw_flashstarted == 0)) { mutex_exit(&state->ts_fw_flashlock); - TNF_PROBE_0(tavor_flash_bad_state, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ioctl_flash_write); return (EIO); } @@ -393,9 +351,6 @@ tavor_ioctl_flash_write(tavor_state_t *state, dev_t dev, intptr_t arg, int mode) if (ddi_copyin((void *)arg, &info32, sizeof (tavor_flash_ioctl32_t), mode) != 0) { mutex_exit(&state->ts_fw_flashlock); - TNF_PROBE_0(tavor_ioctl_flash_write_copyin_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ioctl_flash_write); return (EFAULT); } ioctl_info.tf_type = info32.tf_type; @@ -408,9 +363,6 @@ tavor_ioctl_flash_write(tavor_state_t *state, dev_t dev, intptr_t arg, int mode) if (ddi_copyin((void *)arg, &ioctl_info, sizeof (tavor_flash_ioctl_t), mode) != 0) { mutex_exit(&state->ts_fw_flashlock); - TNF_PROBE_0(tavor_ioctl_flash_write_ci_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ioctl_flash_write); return (EFAULT); } @@ -423,9 +375,6 @@ tavor_ioctl_flash_write(tavor_state_t *state, dev_t dev, intptr_t arg, int mode) if (ioctl_info.tf_sector_num >= (state->ts_fw_device_sz >> state->ts_fw_log_sector_sz)) { mutex_exit(&state->ts_fw_flashlock); - TNF_PROBE_0(tavor_flash_write_sector_num_too_large, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ioctl_flash_write); return (EFAULT); } @@ -434,9 +383,6 @@ tavor_ioctl_flash_write(tavor_state_t *state, dev_t dev, intptr_t arg, int mode) &state->ts_fw_sector[0], 1 << state->ts_fw_log_sector_sz, mode) != 0) { mutex_exit(&state->ts_fw_flashlock); - TNF_PROBE_0(tavor_ioctl_flash_write_fw_sector_ci_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ioctl_flash_write); return (EFAULT); } @@ -449,9 +395,6 @@ tavor_ioctl_flash_write(tavor_state_t *state, dev_t dev, intptr_t arg, int mode) /* Check if addr is too large for flash device */ if (ioctl_info.tf_addr >= state->ts_fw_device_sz) { mutex_exit(&state->ts_fw_flashlock); - TNF_PROBE_0(tavor_flash_write_byte_addr_too_large, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ioctl_flash_write); return (EFAULT); } @@ -464,14 +407,11 @@ tavor_ioctl_flash_write(tavor_state_t *state, dev_t dev, intptr_t arg, int mode) break; default: - TNF_PROBE_0(tavor_ioctl_flash_write_invalid_type, - TAVOR_TNF_ERROR, ""); status = EIO; break; } mutex_exit(&state->ts_fw_flashlock); - TAVOR_TNF_EXIT(tavor_ioctl_flash_write); return (status); } @@ -484,8 +424,6 @@ tavor_ioctl_flash_erase(tavor_state_t *state, dev_t dev, intptr_t arg, int mode) tavor_flash_ioctl_t ioctl_info; int status = 0; - TAVOR_TNF_ENTER(tavor_ioctl_flash_erase); - /* * Check that flash init ioctl has been called first. And check * that the same dev_t that called init is the one calling erase now. @@ -494,8 +432,6 @@ tavor_ioctl_flash_erase(tavor_state_t *state, dev_t dev, intptr_t arg, int mode) if ((state->ts_fw_flashdev != dev) || (state->ts_fw_flashstarted == 0)) { mutex_exit(&state->ts_fw_flashlock); - TNF_PROBE_0(tavor_flash_bad_state, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ioctl_flash_erase); return (EIO); } @@ -507,9 +443,6 @@ tavor_ioctl_flash_erase(tavor_state_t *state, dev_t dev, intptr_t arg, int mode) if (ddi_copyin((void *)arg, &info32, sizeof (tavor_flash_ioctl32_t), mode) != 0) { mutex_exit(&state->ts_fw_flashlock); - TNF_PROBE_0(tavor_ioctl_flash_read_copyin_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ioctl_flash_erase); return (EFAULT); } ioctl_info.tf_type = info32.tf_type; @@ -519,9 +452,6 @@ tavor_ioctl_flash_erase(tavor_state_t *state, dev_t dev, intptr_t arg, int mode) if (ddi_copyin((void *)arg, &ioctl_info, sizeof (tavor_flash_ioctl_t), mode) != 0) { mutex_exit(&state->ts_fw_flashlock); - TNF_PROBE_0(tavor_ioctl_flash_erase_ci_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ioctl_flash_erase); return (EFAULT); } @@ -534,9 +464,6 @@ tavor_ioctl_flash_erase(tavor_state_t *state, dev_t dev, intptr_t arg, int mode) if (ioctl_info.tf_sector_num >= (state->ts_fw_device_sz >> state->ts_fw_log_sector_sz)) { mutex_exit(&state->ts_fw_flashlock); - TNF_PROBE_0(tavor_flash_erase_sector_num_too_large, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ioctl_flash_write); return (EFAULT); } @@ -551,14 +478,11 @@ tavor_ioctl_flash_erase(tavor_state_t *state, dev_t dev, intptr_t arg, int mode) break; default: - TNF_PROBE_0(tavor_ioctl_flash_erase_invalid_type, - TAVOR_TNF_ERROR, ""); status = EIO; break; } mutex_exit(&state->ts_fw_flashlock); - TAVOR_TNF_EXIT(tavor_ioctl_flash_erase); return (status); } @@ -572,8 +496,6 @@ tavor_ioctl_flash_init(tavor_state_t *state, dev_t dev, intptr_t arg, int mode) int ret; int intel_xcmd = 0; - TAVOR_TNF_ENTER(tavor_ioctl_flash_init); - /* * init cannot be called more than once. If we have already init'd the * flash, return directly. @@ -581,9 +503,6 @@ tavor_ioctl_flash_init(tavor_state_t *state, dev_t dev, intptr_t arg, int mode) mutex_enter(&state->ts_fw_flashlock); if (state->ts_fw_flashstarted == 1) { mutex_exit(&state->ts_fw_flashlock); - TNF_PROBE_0(tavor_ioctl_flash_init_already_started, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ioctl_flash_init); return (EIO); } @@ -591,9 +510,6 @@ tavor_ioctl_flash_init(tavor_state_t *state, dev_t dev, intptr_t arg, int mode) if (ddi_copyin((void *)arg, &init_info, sizeof (tavor_flash_init_ioctl_t), mode) != 0) { mutex_exit(&state->ts_fw_flashlock); - TNF_PROBE_0(tavor_flash_init_ioctl_copyin_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ioctl_flash_init); return (EFAULT); } @@ -608,10 +524,6 @@ tavor_ioctl_flash_init(tavor_state_t *state, dev_t dev, intptr_t arg, int mode) */ if (state->ts_fw_cmdset == TAVOR_FLASH_UNKNOWN_CMDSET) { mutex_exit(&state->ts_fw_flashlock); - TNF_PROBE_1(tavor_ioctl_flash_init_cmdset_fail, - TAVOR_TNF_ERROR, "", tnf_string, errmsg, - "UNKNOWN flash command set"); - TAVOR_TNF_EXIT(tavor_ioctl_flash_init); return (EFAULT); } @@ -642,9 +554,6 @@ tavor_ioctl_flash_init(tavor_state_t *state, dev_t dev, intptr_t arg, int mode) tavor_ioctl_flash_cleanup_nolock(state); mutex_exit(&state->ts_fw_flashlock); - TNF_PROBE_0(tavor_ioctl_flash_init_copyout_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ioctl_flash_init); return (EFAULT); } @@ -665,13 +574,9 @@ tavor_ioctl_flash_init(tavor_state_t *state, dev_t dev, intptr_t arg, int mode) if (ret != DDI_SUCCESS) { (void) tavor_ioctl_flash_fini(state, dev); - TNF_PROBE_0(tavor_ioctl_flash_init_set_cb_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ioctl_flash_init); return (EFAULT); } - TAVOR_TNF_EXIT(tavor_ioctl_flash_init); return (0); } @@ -683,8 +588,6 @@ tavor_ioctl_flash_fini(tavor_state_t *state, dev_t dev) { int ret; - TAVOR_TNF_ENTER(tavor_ioctl_flash_fini); - /* * Check that flash init ioctl has been called first. And check * that the same dev_t that called init is the one calling fini now. @@ -693,8 +596,6 @@ tavor_ioctl_flash_fini(tavor_state_t *state, dev_t dev) if ((state->ts_fw_flashdev != dev) || (state->ts_fw_flashstarted == 0)) { mutex_exit(&state->ts_fw_flashlock); - TNF_PROBE_0(tavor_flash_bad_state, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ioctl_flash_fini); return (EIO); } @@ -709,13 +610,9 @@ tavor_ioctl_flash_fini(tavor_state_t *state, dev_t dev) ret = tavor_umap_db_clear_onclose_cb(dev, TAVOR_ONCLOSE_FLASH_INPROGRESS); if (ret != DDI_SUCCESS) { - TNF_PROBE_0(tavor_flash_fini_clear_cb_fail, TAVOR_TNF_ERROR, - ""); - TAVOR_TNF_EXIT(tavor_ioctl_flash_fini); return (EFAULT); } - TAVOR_TNF_EXIT(tavor_ioctl_flash_fini); return (0); } @@ -726,13 +623,9 @@ tavor_ioctl_flash_fini(tavor_state_t *state, dev_t dev) static void tavor_ioctl_flash_cleanup(tavor_state_t *state) { - TAVOR_TNF_ENTER(tavor_ioctl_flash_cleanup); - mutex_enter(&state->ts_fw_flashlock); tavor_ioctl_flash_cleanup_nolock(state); mutex_exit(&state->ts_fw_flashlock); - - TAVOR_TNF_EXIT(tavor_ioctl_flash_cleanup); } @@ -742,8 +635,6 @@ tavor_ioctl_flash_cleanup(tavor_state_t *state) static void tavor_ioctl_flash_cleanup_nolock(tavor_state_t *state) { - TAVOR_TNF_ENTER(tavor_ioctl_flash_cleanup_nolock); - ASSERT(MUTEX_HELD(&state->ts_fw_flashlock)); /* free flash mem */ @@ -755,8 +646,6 @@ tavor_ioctl_flash_cleanup_nolock(tavor_state_t *state) /* Set flash state to fini */ state->ts_fw_flashstarted = 0; state->ts_fw_flashdev = 0; - - TAVOR_TNF_EXIT(tavor_ioctl_flash_cleanup_nolock); } @@ -769,23 +658,16 @@ tavor_ioctl_info(tavor_state_t *state, dev_t dev, intptr_t arg, int mode) tavor_info_ioctl_t info; tavor_flash_init_ioctl_t init_info; - TAVOR_TNF_ENTER(tavor_ioctl_info); - /* * Access to Tavor VTS ioctls is not allowed in "maintenance mode". */ if (state->ts_operational_mode == TAVOR_MAINTENANCE_MODE) { - TNF_PROBE_0(tavor_ioctl_info_maintenance_mode_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ioctl_info); return (EFAULT); } /* copyin the user struct to kernel */ if (ddi_copyin((void *)arg, &info, sizeof (tavor_info_ioctl_t), mode) != 0) { - TNF_PROBE_0(tavor_ioctl_info_copyin_fail, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ioctl_info); return (EFAULT); } @@ -793,8 +675,6 @@ tavor_ioctl_info(tavor_state_t *state, dev_t dev, intptr_t arg, int mode) * Check ioctl revision */ if (info.ti_revision != TAVOR_VTS_IOCTL_REVISION) { - TNF_PROBE_0(tavor_ioctl_info_bad_rev, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ioctl_info); return (EINVAL); } @@ -810,9 +690,6 @@ tavor_ioctl_info(tavor_state_t *state, dev_t dev, intptr_t arg, int mode) if (tavor_ioctl_flash_init(state, dev, (intptr_t)&init_info, (FKIOCTL | mode)) != 0) { mutex_exit(&state->ts_info_lock); - TNF_PROBE_0(tavor_ioctl_info_flash_init_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ioctl_info); return (EFAULT); } (void) tavor_ioctl_flash_fini(state, dev); @@ -831,12 +708,9 @@ tavor_ioctl_info(tavor_state_t *state, dev_t dev, intptr_t arg, int mode) /* Copy ioctl results back to user struct */ if (ddi_copyout(&info, (void *)arg, sizeof (tavor_info_ioctl_t), mode) != 0) { - TNF_PROBE_0(tavor_ioctl_info_copyout_fail, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ioctl_info); return (EFAULT); } - TAVOR_TNF_EXIT(tavor_ioctl_info); return (0); } @@ -854,15 +728,10 @@ tavor_ioctl_ports(tavor_state_t *state, intptr_t arg, int mode) ib_pkey_t *pkey_tbl; int i; - TAVOR_TNF_ENTER(tavor_ioctl_ports); - /* * Access to Tavor VTS ioctls is not allowed in "maintenance mode". */ if (state->ts_operational_mode == TAVOR_MAINTENANCE_MODE) { - TNF_PROBE_0(tavor_ioctl_ports_maintenance_mode_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ioctl_ports); return (EFAULT); } @@ -873,9 +742,6 @@ tavor_ioctl_ports(tavor_state_t *state, intptr_t arg, int mode) if (ddi_copyin((void *)arg, &info32, sizeof (tavor_ports_ioctl32_t), mode) != 0) { - TNF_PROBE_0(tavor_ioctl_ports_copyin_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ioctl_ports); return (EFAULT); } info.tp_revision = info32.tp_revision; @@ -887,8 +753,6 @@ tavor_ioctl_ports(tavor_state_t *state, intptr_t arg, int mode) #endif /* _MULTI_DATAMODEL */ if (ddi_copyin((void *)arg, &info, sizeof (tavor_ports_ioctl_t), mode) != 0) { - TNF_PROBE_0(tavor_ioctl_ports_copyin_fail, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ioctl_ports); return (EFAULT); } @@ -896,8 +760,6 @@ tavor_ioctl_ports(tavor_state_t *state, intptr_t arg, int mode) * Check ioctl revision */ if (info.tp_revision != TAVOR_VTS_IOCTL_REVISION) { - TNF_PROBE_0(tavor_ioctl_ports_bad_rev, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ioctl_ports); return (EINVAL); } @@ -925,10 +787,7 @@ tavor_ioctl_ports(tavor_state_t *state, intptr_t arg, int mode) bzero(&pi, sizeof (ibt_hca_portinfo_t)); pi.p_sgid_tbl = sgid_tbl; pi.p_pkey_tbl = pkey_tbl; - if (tavor_port_query(state, i + 1, &pi) != 0) { - TNF_PROBE_0(tavor_ioctl_ports_query_failed, - TAVOR_TNF_ERROR, ""); - } + (void) tavor_port_query(state, i + 1, &pi); portstat.tsp_port_num = pi.p_port_num; portstat.tsp_state = pi.p_linkstate; @@ -964,22 +823,15 @@ tavor_ioctl_ports(tavor_state_t *state, intptr_t arg, int mode) if (ddi_copyout(&info32, (void *)arg, sizeof (tavor_ports_ioctl32_t), mode) != 0) { - TNF_PROBE_0(tavor_ioctl_ports_copyout_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ioctl_ports); return (EFAULT); } } else #endif /* _MULTI_DATAMODEL */ if (ddi_copyout(&info, (void *)arg, sizeof (tavor_ports_ioctl_t), mode) != 0) { - TNF_PROBE_0(tavor_ioctl_ports_copyout_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ioctl_ports); return (EFAULT); } - TAVOR_TNF_EXIT(tavor_ioctl_ports); return (0); } @@ -997,17 +849,12 @@ tavor_ioctl_loopback(tavor_state_t *state, intptr_t arg, int mode) ib_pkey_t *pkey_tbl; int j, iter, ret; - TAVOR_TNF_ENTER(tavor_ioctl_loopback); - _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(lstate)) /* * Access to Tavor VTS ioctls is not allowed in "maintenance mode". */ if (state->ts_operational_mode == TAVOR_MAINTENANCE_MODE) { - TNF_PROBE_0(tavor_ioctl_loopback_maintenance_mode_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ioctl_loopback); return (EFAULT); } @@ -1018,9 +865,6 @@ tavor_ioctl_loopback(tavor_state_t *state, intptr_t arg, int mode) if (ddi_copyin((void *)arg, &lb32, sizeof (tavor_loopback_ioctl32_t), mode) != 0) { - TNF_PROBE_0(tavor_ioctl_loopback_copyin_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ioctl_loopback); return (EFAULT); } lb.tlb_revision = lb32.tlb_revision; @@ -1037,9 +881,6 @@ tavor_ioctl_loopback(tavor_state_t *state, intptr_t arg, int mode) #endif /* _MULTI_DATAMODEL */ if (ddi_copyin((void *)arg, &lb, sizeof (tavor_loopback_ioctl_t), mode) != 0) { - TNF_PROBE_0(tavor_ioctl_loopback_copyin_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ioctl_loopback); return (EFAULT); } @@ -1052,9 +893,6 @@ tavor_ioctl_loopback(tavor_state_t *state, intptr_t arg, int mode) if (lb.tlb_revision != TAVOR_VTS_IOCTL_REVISION) { lb.tlb_error_type = TAVOR_LOOPBACK_INVALID_REVISION; (void) tavor_loopback_copyout(&lb, arg, mode); - TNF_PROBE_0(tavor_ioctl_loopback_bad_rev, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ioctl_loopback); return (EINVAL); } @@ -1062,9 +900,6 @@ tavor_ioctl_loopback(tavor_state_t *state, intptr_t arg, int mode) if (!tavor_portnum_is_valid(state, lb.tlb_port_num)) { lb.tlb_error_type = TAVOR_LOOPBACK_INVALID_PORT; (void) tavor_loopback_copyout(&lb, arg, mode); - TNF_PROBE_0(tavor_ioctl_loopback_inv_port, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ioctl_loopback); return (EINVAL); } @@ -1092,9 +927,6 @@ tavor_ioctl_loopback(tavor_state_t *state, intptr_t arg, int mode) lb.tlb_error_type = TAVOR_LOOPBACK_INVALID_PORT; (void) tavor_loopback_copyout(&lb, arg, mode); tavor_loopback_free_state(&lstate); - TNF_PROBE_0(tavor_ioctl_loopback_bad_port, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ioctl_loopback); return (EINVAL); } @@ -1133,9 +965,6 @@ tavor_ioctl_loopback(tavor_state_t *state, intptr_t arg, int mode) lb.tlb_error_type = TAVOR_LOOPBACK_SEND_BUF_INVALID; (void) tavor_loopback_copyout(&lb, arg, mode); tavor_loopback_free_state(&lstate); - TNF_PROBE_0(tavor_ioctl_loopback_buf_null, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ioctl_loopback); return (EINVAL); } @@ -1144,7 +973,6 @@ tavor_ioctl_loopback(tavor_state_t *state, intptr_t arg, int mode) lb.tlb_error_type = lstate.tls_err; (void) tavor_loopback_copyout(&lb, arg, mode); tavor_loopback_free_state(&lstate); - TAVOR_TNF_EXIT(tavor_ioctl_loopback); return (EFAULT); } @@ -1155,9 +983,6 @@ tavor_ioctl_loopback(tavor_state_t *state, intptr_t arg, int mode) TAVOR_LOOPBACK_SEND_BUF_MEM_REGION_ALLOC_FAIL; (void) tavor_loopback_copyout(&lb, arg, mode); tavor_loopback_free_state(&lstate); - TNF_PROBE_0(tavor_ioctl_loopback_txbuf_alloc_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ioctl_loopback); return (EFAULT); } @@ -1168,9 +993,6 @@ tavor_ioctl_loopback(tavor_state_t *state, intptr_t arg, int mode) TAVOR_LOOPBACK_RECV_BUF_MEM_REGION_ALLOC_FAIL; (void) tavor_loopback_copyout(&lb, arg, mode); tavor_loopback_free_state(&lstate); - TNF_PROBE_0(tavor_ioctl_loopback_rxbuf_alloc_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ioctl_loopback); return (EFAULT); } @@ -1180,9 +1002,6 @@ tavor_ioctl_loopback(tavor_state_t *state, intptr_t arg, int mode) lb.tlb_error_type = TAVOR_LOOPBACK_SEND_BUF_COPY_FAIL; (void) tavor_loopback_copyout(&lb, arg, mode); tavor_loopback_free_state(&lstate); - TNF_PROBE_0(tavor_ioctl_loopback_tx_copyin_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ioctl_loopback); return (EFAULT); } @@ -1192,9 +1011,6 @@ tavor_ioctl_loopback(tavor_state_t *state, intptr_t arg, int mode) lb.tlb_error_type = lstate.tls_err; (void) tavor_loopback_copyout(&lb, arg, mode); tavor_loopback_free_state(&lstate); - TNF_PROBE_0(tavor_ioctl_loopback_txqp_alloc_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ioctl_loopback); return (EFAULT); } @@ -1204,9 +1020,6 @@ tavor_ioctl_loopback(tavor_state_t *state, intptr_t arg, int mode) lb.tlb_error_type = lstate.tls_err; (void) tavor_loopback_copyout(&lb, arg, mode); tavor_loopback_free_state(&lstate); - TNF_PROBE_0(tavor_ioctl_loopback_rxqp_alloc_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ioctl_loopback); return (EFAULT); } @@ -1217,9 +1030,6 @@ tavor_ioctl_loopback(tavor_state_t *state, intptr_t arg, int mode) lb.tlb_error_type = lstate.tls_err; (void) tavor_loopback_copyout(&lb, arg, mode); tavor_loopback_free_state(&lstate); - TNF_PROBE_0(tavor_ioctl_loopback_txqp_init_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ioctl_loopback); return (EFAULT); } @@ -1230,9 +1040,6 @@ tavor_ioctl_loopback(tavor_state_t *state, intptr_t arg, int mode) lb.tlb_error_type = lstate.tls_err; (void) tavor_loopback_copyout(&lb, arg, mode); tavor_loopback_free_state(&lstate); - TNF_PROBE_0(tavor_ioctl_loopback_rxqp_init_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ioctl_loopback); return (EFAULT); } @@ -1248,9 +1055,6 @@ tavor_ioctl_loopback(tavor_state_t *state, intptr_t arg, int mode) lb.tlb_error_type = TAVOR_LOOPBACK_WQE_POST_FAIL; (void) tavor_loopback_copyout(&lb, arg, mode); tavor_loopback_free_state(&lstate); - TNF_PROBE_0(tavor_ioctl_loopback_wqe_post_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ioctl_loopback); return (EFAULT); } @@ -1265,17 +1069,10 @@ tavor_ioctl_loopback(tavor_state_t *state, intptr_t arg, int mode) if (ddi_copyout(lstate.tls_rx.tlc_buf, lb.tlb_fail_buf, lstate.tls_tx.tlc_buf_sz, mode) != 0) { - TNF_PROBE_0( - tavor_ioctl_loopback_xfer_co_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ioctl_loopback); return (EFAULT); } (void) tavor_loopback_copyout(&lb, arg, mode); tavor_loopback_free_state(&lstate); - TNF_PROBE_0(tavor_ioctl_loopback_xfer_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ioctl_loopback); return (EFAULT); } else if (ret == IBT_CQ_EMPTY) { continue; @@ -1291,17 +1088,10 @@ tavor_ioctl_loopback(tavor_state_t *state, intptr_t arg, int mode) if (ddi_copyout(lstate.tls_rx.tlc_buf, lb.tlb_fail_buf, lstate.tls_tx.tlc_buf_sz, mode) != 0) { - TNF_PROBE_0( - tavor_ioctl_loopback_bcmp_co_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ioctl_loopback); return (EFAULT); } (void) tavor_loopback_copyout(&lb, arg, mode); tavor_loopback_free_state(&lstate); - TNF_PROBE_0(tavor_ioctl_loopback_bcmp_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ioctl_loopback); return (EFAULT); } } @@ -1318,7 +1108,6 @@ tavor_ioctl_loopback(tavor_state_t *state, intptr_t arg, int mode) /* Free up everything and release all consumed resources */ tavor_loopback_free_state(&lstate); - TAVOR_TNF_EXIT(tavor_ioctl_loopback); return (ret); } @@ -1333,24 +1122,16 @@ tavor_ioctl_ddr_read(tavor_state_t *state, intptr_t arg, int mode) uintptr_t baseaddr; uint64_t ddr_size; - TAVOR_TNF_ENTER(tavor_ioctl_ddr_read); - /* * Access to Tavor VTS ioctls is not allowed in "maintenance mode". */ if (state->ts_operational_mode == TAVOR_MAINTENANCE_MODE) { - TNF_PROBE_0(tavor_ioctl_ddr_read_maintenance_mode_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ioctl_ddr_read); return (EFAULT); } /* copyin the user struct to kernel */ if (ddi_copyin((void *)arg, &rdreg, sizeof (tavor_ddr_read_ioctl_t), mode) != 0) { - TNF_PROBE_0(tavor_ioctl_ddr_read_copyin_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ioctl_ddr_read); return (EFAULT); } @@ -1358,8 +1139,6 @@ tavor_ioctl_ddr_read(tavor_state_t *state, intptr_t arg, int mode) * Check ioctl revision */ if (rdreg.tdr_revision != TAVOR_VTS_IOCTL_REVISION) { - TNF_PROBE_0(tavor_ioctl_ddr_read_bad_rev, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ioctl_ddr_read); return (EINVAL); } @@ -1368,9 +1147,6 @@ tavor_ioctl_ddr_read(tavor_state_t *state, intptr_t arg, int mode) */ ddr_size = (state->ts_ddr.ddr_endaddr - state->ts_ddr.ddr_baseaddr + 1); if ((uint64_t)rdreg.tdr_offset >= ddr_size) { - TNF_PROBE_0(tavor_ioctl_ddr_read_bad_offset, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ioctl_ddr_read); return (EINVAL); } @@ -1386,13 +1162,9 @@ tavor_ioctl_ddr_read(tavor_state_t *state, intptr_t arg, int mode) /* Copy ioctl results back to user struct */ if (ddi_copyout(&rdreg, (void *)arg, sizeof (tavor_ddr_read_ioctl_t), mode) != 0) { - TNF_PROBE_0(tavor_ioctl_ddr_read_copyout_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ioctl_ddr_read); return (EFAULT); } - TAVOR_TNF_EXIT(tavor_ioctl_ddr_read); return (0); } @@ -1409,16 +1181,11 @@ tavor_ioctl_reg_read(tavor_state_t *state, intptr_t arg, int mode) uintptr_t baseaddr; int status; - TAVOR_TNF_ENTER(tavor_ioctl_reg_read); - /* * Access to Tavor registers is not allowed in "maintenance mode". * This is primarily because the device may not have BARs to access */ if (state->ts_operational_mode == TAVOR_MAINTENANCE_MODE) { - TNF_PROBE_0(tavor_ioctl_reg_read_maintence_mode_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ioctl_reg_read); return (EFAULT); } @@ -1426,9 +1193,6 @@ tavor_ioctl_reg_read(tavor_state_t *state, intptr_t arg, int mode) status = ddi_copyin((void *)arg, &rdreg, sizeof (tavor_reg_ioctl_t), mode); if (status != 0) { - TNF_PROBE_0(tavor_ioctl_reg_read_copyin_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ioctl_reg_read); return (EFAULT); } @@ -1447,9 +1211,6 @@ tavor_ioctl_reg_read(tavor_state_t *state, intptr_t arg, int mode) break; default: - TNF_PROBE_0(tavor_ioctl_reg_read_invregset_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ioctl_reg_read); return (EFAULT); } @@ -1463,13 +1224,9 @@ tavor_ioctl_reg_read(tavor_state_t *state, intptr_t arg, int mode) status = ddi_copyout(&rdreg, (void *)arg, sizeof (tavor_reg_ioctl_t), mode); if (status != 0) { - TNF_PROBE_0(tavor_ioctl_reg_read_copyout_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ioctl_reg_read); return (EFAULT); } - TAVOR_TNF_EXIT(tavor_ioctl_reg_read); return (0); } @@ -1485,16 +1242,11 @@ tavor_ioctl_reg_write(tavor_state_t *state, intptr_t arg, int mode) uintptr_t baseaddr; int status; - TAVOR_TNF_ENTER(tavor_ioctl_reg_write); - /* * Access to Tavor registers is not allowed in "maintenance mode". * This is primarily because the device may not have BARs to access */ if (state->ts_operational_mode == TAVOR_MAINTENANCE_MODE) { - TNF_PROBE_0(tavor_ioctl_reg_write_maintence_mode_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ioctl_reg_write); return (EFAULT); } @@ -1502,9 +1254,6 @@ tavor_ioctl_reg_write(tavor_state_t *state, intptr_t arg, int mode) status = ddi_copyin((void *)arg, &wrreg, sizeof (tavor_reg_ioctl_t), mode); if (status != 0) { - TNF_PROBE_0(tavor_ioctl_reg_write_copyin_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ioctl_reg_write); return (EFAULT); } @@ -1523,9 +1272,6 @@ tavor_ioctl_reg_write(tavor_state_t *state, intptr_t arg, int mode) break; default: - TNF_PROBE_0(tavor_ioctl_reg_write_invregset_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ioctl_reg_write); return (EFAULT); } @@ -1535,7 +1281,6 @@ tavor_ioctl_reg_write(tavor_state_t *state, intptr_t arg, int mode) /* Write the data to the register pointed to by addr */ ddi_put32(state->ts_reg_cmdhdl, addr, wrreg.trg_data); - TAVOR_TNF_EXIT(tavor_ioctl_reg_write); return (0); } #endif /* DEBUG */ @@ -1546,8 +1291,6 @@ tavor_ioctl_reg_write(tavor_state_t *state, intptr_t arg, int mode) static void tavor_flash_reset(tavor_state_t *state) { - TAVOR_TNF_ENTER(tavor_flash_reset); - /* * Performs a reset to the flash device. After a reset the flash will * be operating in normal mode (capable of read/write, etc.). @@ -1564,8 +1307,6 @@ tavor_flash_reset(tavor_state_t *state) default: break; } - - TAVOR_TNF_EXIT(tavor_flash_reset); } /* @@ -1579,8 +1320,6 @@ tavor_flash_read_sector(tavor_state_t *state, uint32_t sector_num) uint32_t *image; int i; - TAVOR_TNF_ENTER(tavor_flash_read_sector); - image = (uint32_t *)&state->ts_fw_sector[0]; /* @@ -1597,8 +1336,6 @@ tavor_flash_read_sector(tavor_state_t *state, uint32_t sector_num) for (i = 0; addr < end_addr; i++, addr += 4) { image[i] = tavor_flash_read(state, addr); } - - TAVOR_TNF_EXIT(tavor_flash_read_sector); } /* @@ -1608,15 +1345,11 @@ static void tavor_flash_read_quadlet(tavor_state_t *state, uint32_t *data, uint32_t addr) { - TAVOR_TNF_ENTER(tavor_flash_read_quadlet); - /* Set the flash bank correctly for the given address */ tavor_flash_bank(state, addr); /* Read one quadlet of data */ *data = tavor_flash_read(state, addr); - - TAVOR_TNF_EXIT(tavor_flash_read_quadlet); } /* @@ -1631,8 +1364,6 @@ tavor_flash_write_sector(tavor_state_t *state, uint32_t sector_num) int status = 0; int i; - TAVOR_TNF_ENTER(tavor_flash_write_sector); - sector = (uchar_t *)&state->ts_fw_sector[0]; /* @@ -1649,7 +1380,6 @@ tavor_flash_write_sector(tavor_state_t *state, uint32_t sector_num) tavor_flash_reset(state); status = tavor_flash_erase_sector(state, sector_num); if (status != 0) { - TAVOR_TNF_EXIT(tavor_flash_write_sector); return (status); } @@ -1662,7 +1392,6 @@ tavor_flash_write_sector(tavor_state_t *state, uint32_t sector_num) } tavor_flash_reset(state); - TAVOR_TNF_EXIT(tavor_flash_write_sector); return (status); } @@ -1676,8 +1405,6 @@ tavor_flash_write_byte(tavor_state_t *state, uint32_t addr, uchar_t data) int status = 0; int i; - TAVOR_TNF_ENTER(tavor_flash_write_byte); - switch (state->ts_fw_cmdset) { case TAVOR_FLASH_AMD_CMDSET: /* Issue Flash Byte program command */ @@ -1752,7 +1479,6 @@ tavor_flash_write_byte(tavor_state_t *state, uint32_t addr, uchar_t data) break; } - TAVOR_TNF_EXIT(tavor_flash_write_byte); return (status); } @@ -1767,8 +1493,6 @@ tavor_flash_erase_sector(tavor_state_t *state, uint32_t sector_num) int status = 0; int i; - TAVOR_TNF_ENTER(tavor_flash_erase_sector); - /* Get address from sector num */ addr = sector_num << state->ts_fw_log_sector_sz; @@ -1849,7 +1573,6 @@ tavor_flash_erase_sector(tavor_state_t *state, uint32_t sector_num) tavor_flash_reset(state); - TAVOR_TNF_EXIT(tavor_flash_erase_sector); return (status); } @@ -1865,8 +1588,6 @@ tavor_flash_erase_chip(tavor_state_t *state) int num_sect; int i; - TAVOR_TNF_ENTER(tavor_flash_erase_chip); - switch (state->ts_fw_cmdset) { case TAVOR_FLASH_AMD_CMDSET: /* Issue Flash Chip Erase Command */ @@ -1930,7 +1651,6 @@ tavor_flash_erase_chip(tavor_state_t *state) break; } - TAVOR_TNF_EXIT(tavor_flash_erase_chip); return (status); } @@ -1943,8 +1663,6 @@ tavor_flash_bank(tavor_state_t *state, uint32_t addr) ddi_acc_handle_t hdl; uint32_t bank; - TAVOR_TNF_ENTER(tavor_flash_bank); - /* Set handle */ hdl = state->ts_pci_cfghdl; @@ -1968,8 +1686,6 @@ tavor_flash_bank(tavor_state_t *state, uint32_t addr) /* Save the bank state */ state->ts_fw_flashbank = bank; } - - TAVOR_TNF_EXIT(tavor_flash_bank); } /* @@ -1982,8 +1698,6 @@ tavor_flash_read(tavor_state_t *state, uint32_t addr) uint32_t data; int timeout; - TAVOR_TNF_ENTER(tavor_flash_read); - /* Set handle */ hdl = state->ts_pci_cfghdl; @@ -2011,7 +1725,6 @@ tavor_flash_read(tavor_state_t *state, uint32_t addr) data = tavor_flash_read_cfg(hdl, TAVOR_HW_FLASH_DATA); - TAVOR_TNF_EXIT(tavor_flash_read); return (data); } @@ -2025,8 +1738,6 @@ tavor_flash_write(tavor_state_t *state, uint32_t addr, uchar_t data) int cmd; int timeout; - TAVOR_TNF_ENTER(tavor_flash_write); - /* Set handle */ hdl = state->ts_pci_cfghdl; @@ -2051,8 +1762,6 @@ tavor_flash_write(tavor_state_t *state, uint32_t addr, uchar_t data) if (timeout == tavor_hw_flash_timeout_config) { cmn_err(CE_WARN, "tavor_flash_write: config cmd timeout.\n"); } - - TAVOR_TNF_EXIT(tavor_flash_write); } /* @@ -2066,8 +1775,6 @@ tavor_flash_init(tavor_state_t *state) int sema_cnt; int gpio; - TAVOR_TNF_ENTER(tavor_flash_init); - /* Set handle */ hdl = state->ts_pci_cfghdl; @@ -2122,8 +1829,6 @@ tavor_flash_init(tavor_state_t *state) /* Initialize to bank 0 */ tavor_flash_bank(state, 0); - - TAVOR_TNF_EXIT(tavor_flash_init); } /* @@ -2139,8 +1844,6 @@ tavor_flash_cfi_init(tavor_state_t *state, uint32_t *cfi_info, int *intel_xcmd) uint8_t cfi_ch_info[TAVOR_CFI_INFO_SIZE]; int i; - TAVOR_TNF_ENTER(tavor_flash_cfi_init); - /* * Determine if the user command supports the Intel Extended * Command Set. The query string is contained in the fourth @@ -2181,7 +1884,7 @@ tavor_flash_cfi_init(tavor_state_t *state, uint32_t *cfi_info, int *intel_xcmd) cmn_err(CE_WARN, "tavor_flash_cfi_init: UNKNOWN chip cmd set\n"); state->ts_fw_cmdset = TAVOR_FLASH_UNKNOWN_CMDSET; - goto out; + return; } /* Determine total bytes in one sector size */ @@ -2223,8 +1926,6 @@ tavor_flash_cfi_init(tavor_state_t *state, uint32_t *cfi_info, int *intel_xcmd) } cfi_ch_info[0x13] = state->ts_fw_cmdset; tavor_flash_cfi_dword(&cfi_info[0x4], cfi_ch_info, 0x10); -out: - TAVOR_TNF_EXIT(tavor_flash_cfi_init); } /* @@ -2235,8 +1936,6 @@ tavor_flash_fini(tavor_state_t *state) { ddi_acc_handle_t hdl; - TAVOR_TNF_ENTER(tavor_flash_fini); - /* Set handle */ hdl = state->ts_pci_cfghdl; @@ -2252,8 +1951,6 @@ tavor_flash_fini(tavor_state_t *state) /* Give up semaphore */ tavor_flash_write_cfg(hdl, TAVOR_HW_FLASH_GPIO_SEMA, 0); - - TAVOR_TNF_EXIT(tavor_flash_fini); } /* @@ -2264,8 +1961,6 @@ tavor_flash_read_cfg(ddi_acc_handle_t pci_config_hdl, uint32_t addr) { uint32_t read; - TAVOR_TNF_ENTER(tavor_flash_read_cfg); - /* * Perform flash read operation: * 1) Place addr to read from on the TAVOR_HW_FLASH_CFG_ADDR register @@ -2274,8 +1969,6 @@ tavor_flash_read_cfg(ddi_acc_handle_t pci_config_hdl, uint32_t addr) pci_config_put32(pci_config_hdl, TAVOR_HW_FLASH_CFG_ADDR, addr); read = pci_config_get32(pci_config_hdl, TAVOR_HW_FLASH_CFG_DATA); - TAVOR_TNF_EXIT(tavor_flash_read_cfg); - return (read); } @@ -2286,8 +1979,6 @@ static void tavor_flash_write_cfg(ddi_acc_handle_t pci_config_hdl, uint32_t addr, uint32_t data) { - TAVOR_TNF_ENTER(tavor_flash_write_cfg); - /* * Perform flash write operation: * 1) Place addr to write to on the TAVOR_HW_FLASH_CFG_ADDR register @@ -2295,8 +1986,6 @@ tavor_flash_write_cfg(ddi_acc_handle_t pci_config_hdl, uint32_t addr, */ pci_config_put32(pci_config_hdl, TAVOR_HW_FLASH_CFG_ADDR, addr); pci_config_put32(pci_config_hdl, TAVOR_HW_FLASH_CFG_DATA, data); - - TAVOR_TNF_EXIT(tavor_flash_write_cfg); } /* @@ -2401,8 +2090,6 @@ tavor_loopback_init(tavor_state_t *state, tavor_loopback_state_t *lstate) &lstate->tls_pd_hdl, TAVOR_NOSLEEP); if (lstate->tls_status != IBT_SUCCESS) { lstate->tls_err = TAVOR_LOOPBACK_PROT_DOMAIN_ALLOC_FAIL; - TNF_PROBE_0(tavor_ioctl_loopback_alloc_pd_fail, - TAVOR_TNF_ERROR, ""); return (EFAULT); } @@ -2612,16 +2299,12 @@ tavor_loopback_copyout(tavor_loopback_ioctl_t *lb, intptr_t arg, int mode) if (ddi_copyout(&lb32, (void *)arg, sizeof (tavor_loopback_ioctl32_t), mode) != 0) { - TNF_PROBE_0(tavor_ioctl_loopback_copyout_fail, - TAVOR_TNF_ERROR, ""); return (EFAULT); } } else #endif /* _MULTI_DATAMODEL */ if (ddi_copyout(lb, (void *)arg, sizeof (tavor_loopback_ioctl_t), mode) != 0) { - TNF_PROBE_0(tavor_ioctl_loopback_copyout_fail, - TAVOR_TNF_ERROR, ""); return (EFAULT); } return (0); diff --git a/usr/src/uts/common/io/ib/adapters/tavor/tavor_misc.c b/usr/src/uts/common/io/ib/adapters/tavor/tavor_misc.c index f8eb3c3551..41be4c0aca 100644 --- a/usr/src/uts/common/io/ib/adapters/tavor/tavor_misc.c +++ b/usr/src/uts/common/io/ib/adapters/tavor/tavor_misc.c @@ -83,9 +83,6 @@ tavor_ah_alloc(tavor_state_t *state, tavor_pdhdl_t pd, uint64_t data; uint32_t size; int status, i, flag; - char *errormsg; - - TAVOR_TNF_ENTER(tavor_ah_alloc); /* * Someday maybe the "ibt_adds_vect_t *attr_p" will be NULL to @@ -95,8 +92,6 @@ tavor_ah_alloc(tavor_state_t *state, tavor_pdhdl_t pd, /* Validate that specified port number is legal */ if (!tavor_portnum_is_valid(state, attr_p->av_port_num)) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_HCA_PORT_INVALID, "invalid port num"); goto ahalloc_fail; } @@ -108,8 +103,6 @@ tavor_ah_alloc(tavor_state_t *state, tavor_pdhdl_t pd, */ status = tavor_rsrc_alloc(state, TAVOR_UDAV, 1, sleepflag, &udav); if (status != DDI_SUCCESS) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_INSUFF_RESOURCE, "failed UDAV"); goto ahalloc_fail; } @@ -120,8 +113,6 @@ tavor_ah_alloc(tavor_state_t *state, tavor_pdhdl_t pd, */ status = tavor_rsrc_alloc(state, TAVOR_AHHDL, 1, sleepflag, &rsrc); if (status != DDI_SUCCESS) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_INSUFF_RESOURCE, "failed AH handler"); goto ahalloc_fail1; } ah = (tavor_ahhdl_t)rsrc->tr_addr; @@ -144,8 +135,6 @@ tavor_ah_alloc(tavor_state_t *state, tavor_pdhdl_t pd, tavor_pd_refcnt_dec(pd); tavor_rsrc_free(state, &rsrc); tavor_rsrc_free(state, &udav); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(status, "failed in tavor_set_addr_path"); goto ahalloc_fail; } udav_entry.pd = pd->pd_pdnum; @@ -168,8 +157,6 @@ tavor_ah_alloc(tavor_state_t *state, tavor_pdhdl_t pd, op.mro_bind_override_addr = 0; status = tavor_mr_register(state, pd, &mr_attr, &mr, &op); if (status != DDI_SUCCESS) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_INSUFF_RESOURCE, "failed register mr"); goto ahalloc_fail2; } @@ -220,7 +207,6 @@ tavor_ah_alloc(tavor_state_t *state, tavor_pdhdl_t pd, /* Sync the UDAV for use by the hardware */ tavor_udav_sync(ah, udav->tr_addr, DDI_DMA_SYNC_FORDEV); - TAVOR_TNF_EXIT(tavor_ah_alloc); return (DDI_SUCCESS); ahalloc_fail2: @@ -229,9 +215,6 @@ ahalloc_fail2: ahalloc_fail1: tavor_rsrc_free(state, &udav); ahalloc_fail: - TNF_PROBE_1(tavor_ah_alloc_fail, TAVOR_TNF_ERROR, "", - tnf_string, msg, errormsg); - TAVOR_TNF_EXIT(tavor_ah_alloc); return (status); } @@ -250,8 +233,6 @@ tavor_ah_free(tavor_state_t *state, tavor_ahhdl_t *ahhdl, uint_t sleepflag) tavor_ahhdl_t ah; int status; - TAVOR_TNF_ENTER(tavor_ah_free); - /* * Pull all the necessary information from the Tavor Address Handle * struct. This is necessary here because the resource for the @@ -275,8 +256,6 @@ tavor_ah_free(tavor_state_t *state, tavor_ahhdl_t *ahhdl, uint_t sleepflag) status = tavor_mr_deregister(state, &mr, TAVOR_MR_DEREG_ALL, sleepflag); if (status != DDI_SUCCESS) { - TNF_PROBE_0(tavor_ah_free_dereg_mr_fail, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ah_free); return (ibc_get_ci_failure(0)); } @@ -303,7 +282,6 @@ tavor_ah_free(tavor_state_t *state, tavor_ahhdl_t *ahhdl, uint_t sleepflag) /* Set the ahhdl pointer to NULL and return success */ *ahhdl = NULL; - TAVOR_TNF_EXIT(tavor_ah_free); return (DDI_SUCCESS); } @@ -323,8 +301,6 @@ tavor_ah_query(tavor_state_t *state, tavor_ahhdl_t ah, tavor_pdhdl_t *pd, uint32_t size; int i; - TAVOR_TNF_ENTER(tavor_ah_query); - mutex_enter(&ah->ah_lock); _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*attr_p)) @@ -363,7 +339,6 @@ tavor_ah_query(tavor_state_t *state, tavor_ahhdl_t ah, tavor_pdhdl_t *pd, attr_p->av_srate = ah->ah_save_srate; mutex_exit(&ah->ah_lock); - TAVOR_TNF_EXIT(tavor_ah_query); return (DDI_SUCCESS); } @@ -383,13 +358,8 @@ tavor_ah_modify(tavor_state_t *state, tavor_ahhdl_t ah, uint32_t udav_pd, size, portnum_new; int i, status; - TAVOR_TNF_ENTER(tavor_ah_modify); - /* Validate that specified port number is legal */ if (!tavor_portnum_is_valid(state, attr_p->av_port_num)) { - TNF_PROBE_1(tavor_ah_modify_inv_portnum, - TAVOR_TNF_ERROR, "", tnf_uint, port, attr_p->av_port_num); - TAVOR_TNF_EXIT(tavor_ah_modify); return (IBT_HCA_PORT_INVALID); } @@ -421,9 +391,6 @@ tavor_ah_modify(tavor_state_t *state, tavor_ahhdl_t ah, (tavor_hw_addr_path_t *)&udav_entry, TAVOR_ADDRPATH_UDAV, NULL); if (status != DDI_SUCCESS) { mutex_exit(&ah->ah_lock); - TNF_PROBE_0(tavor_ah_modify_setaddrpath_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_ah_modify); return (status); } ah->ah_save_guid = attr_p->av_dgid.gid_guid; @@ -498,7 +465,6 @@ tavor_ah_modify(tavor_state_t *state, tavor_ahhdl_t ah, tavor_udav_sync(ah, udav->tr_addr, DDI_DMA_SYNC_FORDEV); mutex_exit(&ah->ah_lock); - TAVOR_TNF_EXIT(tavor_ah_modify); return (DDI_SUCCESS); } @@ -515,13 +481,10 @@ tavor_udav_sync(tavor_ahhdl_t ah, tavor_hw_udav_t *udav, uint_t flag) off_t offset; int status; - TAVOR_TNF_ENTER(tavor_udav_sync); - _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*ah)) /* Determine if AH needs to be synced or not */ if (ah->ah_sync == 0) { - TAVOR_TNF_EXIT(tavor_udav_sync); return; } @@ -532,13 +495,8 @@ tavor_udav_sync(tavor_ahhdl_t ah, tavor_hw_udav_t *udav, uint_t flag) offset = (off_t)0; status = ddi_dma_sync(dmahdl, offset, sizeof (tavor_hw_udav_t), flag); if (status != DDI_SUCCESS) { - TNF_PROBE_0(tavor_udav_sync_getnextentry_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_udav_sync); return; } - - TAVOR_TNF_EXIT(tavor_udav_sync); } @@ -558,17 +516,12 @@ tavor_mcg_attach(tavor_state_t *state, tavor_qphdl_t qp, ib_gid_t gid, uint32_t end_indx; int status; uint_t qp_found; - char *errormsg; - - TAVOR_TNF_ENTER(tavor_mcg_attach); /* * It is only allowed to attach MCG to UD queue pairs. Verify * that the intended QP is of the appropriate transport type */ if (qp->qp_serv_type != TAVOR_QP_UD) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_QP_SRV_TYPE_INVALID, "invalid service type"); goto mcgattach_fail; } @@ -578,8 +531,6 @@ tavor_mcg_attach(tavor_state_t *state, tavor_qphdl_t qp, ib_gid_t gid, * is outside of that range, then return an error. */ if (tavor_mlid_is_valid(lid) == 0) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_MC_MLID_INVALID, "invalid MLID"); goto mcgattach_fail; } /* @@ -588,8 +539,6 @@ tavor_mcg_attach(tavor_state_t *state, tavor_qphdl_t qp, ib_gid_t gid, * the specified GID does not meet the criteria, then return an error. */ if (tavor_mgid_is_valid(gid) == 0) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_MC_MGID_INVALID, "invalid MGID"); goto mcgattach_fail; } @@ -606,9 +555,6 @@ tavor_mcg_attach(tavor_state_t *state, tavor_qphdl_t qp, ib_gid_t gid, if (status != TAVOR_CMD_SUCCESS) { cmn_err(CE_CONT, "Tavor: MGID_HASH command failed: %08x\n", status); - TNF_PROBE_1(tavor_mcg_attach_mgid_hash_cmd_fail, - TAVOR_TNF_ERROR, "", tnf_uint, cmd_status, status); - TAVOR_TNF_EXIT(tavor_mcg_attach); return (ibc_get_ci_failure(0)); } @@ -665,8 +611,6 @@ tavor_mcg_attach(tavor_state_t *state, tavor_qphdl_t qp, ib_gid_t gid, if (status != DDI_SUCCESS) { bzero(mcg, sizeof (struct tavor_sw_mcg_list_s)); mutex_exit(&state->ts_mcglock); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(status, "failed qplist add"); goto mcgattach_fail; } @@ -688,10 +632,6 @@ tavor_mcg_attach(tavor_state_t *state, tavor_qphdl_t qp, ib_gid_t gid, TAVOR_WARNING(state, "failed to write MCG entry"); cmn_err(CE_CONT, "Tavor: WRITE_MGM command failed: " "%08x\n", status); - TNF_PROBE_2(tavor_mcg_attach_write_mgm_cmd_fail, - TAVOR_TNF_ERROR, "", tnf_uint, cmd_status, status, - tnf_uint, indx, end_indx); - TAVOR_TNF_EXIT(tavor_mcg_attach); return (ibc_get_ci_failure(0)); } @@ -719,7 +659,6 @@ tavor_mcg_attach(tavor_state_t *state, tavor_qphdl_t qp, ib_gid_t gid, * We drop the lock and return success. */ mutex_exit(&state->ts_mcglock); - TAVOR_TNF_EXIT(tavor_mcg_attach); return (DDI_SUCCESS); } @@ -747,10 +686,6 @@ tavor_mcg_attach(tavor_state_t *state, tavor_qphdl_t qp, ib_gid_t gid, TAVOR_WARNING(state, "failed to read MCG entry"); cmn_err(CE_CONT, "Tavor: READ_MGM command failed: " "%08x\n", status); - TNF_PROBE_2(tavor_mcg_attach_read_mgm_cmd_fail, - TAVOR_TNF_ERROR, "", tnf_uint, cmd_status, status, - tnf_uint, indx, end_indx); - TAVOR_TNF_EXIT(tavor_mcg_attach); return (ibc_get_ci_failure(0)); } @@ -771,7 +706,6 @@ tavor_mcg_attach(tavor_state_t *state, tavor_qphdl_t qp, ib_gid_t gid, if (status != DDI_SUCCESS) { mutex_exit(&state->ts_mcglock); /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(status, "failed qplist add"); goto mcgattach_fail; } @@ -790,10 +724,6 @@ tavor_mcg_attach(tavor_state_t *state, tavor_qphdl_t qp, ib_gid_t gid, TAVOR_WARNING(state, "failed to write MCG entry"); cmn_err(CE_CONT, "Tavor: WRITE_MGM command failed: " "%08x\n", status); - TNF_PROBE_2(tavor_mcg_attach_write_mgm_cmd_fail, - TAVOR_TNF_ERROR, "", tnf_uint, cmd_status, status, - tnf_uint, indx, end_indx); - TAVOR_TNF_EXIT(tavor_mcg_attach); return (ibc_get_ci_failure(0)); } @@ -821,7 +751,6 @@ tavor_mcg_attach(tavor_state_t *state, tavor_qphdl_t qp, ib_gid_t gid, * We drop the lock and return success. */ mutex_exit(&state->ts_mcglock); - TAVOR_TNF_EXIT(tavor_mcg_attach); return (DDI_SUCCESS); } @@ -840,8 +769,6 @@ tavor_mcg_attach(tavor_state_t *state, tavor_qphdl_t qp, ib_gid_t gid, status = tavor_rsrc_alloc(state, TAVOR_MCG, 1, TAVOR_NOSLEEP, &rsrc); if (status != DDI_SUCCESS) { mutex_exit(&state->ts_mcglock); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_INSUFF_RESOURCE, "failed MCG"); goto mcgattach_fail; } @@ -872,8 +799,6 @@ tavor_mcg_attach(tavor_state_t *state, tavor_qphdl_t qp, ib_gid_t gid, bzero(newmcg, sizeof (struct tavor_sw_mcg_list_s)); tavor_rsrc_free(state, &rsrc); mutex_exit(&state->ts_mcglock); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(status, "failed qplist add"); goto mcgattach_fail; } @@ -894,10 +819,6 @@ tavor_mcg_attach(tavor_state_t *state, tavor_qphdl_t qp, ib_gid_t gid, TAVOR_WARNING(state, "failed to write MCG entry"); cmn_err(CE_CONT, "Tavor: WRITE_MGM command failed: %08x\n", status); - TNF_PROBE_2(tavor_mcg_attach_write_mgm_cmd_fail, - TAVOR_TNF_ERROR, "", tnf_uint, cmd_status, status, - tnf_uint, indx, rsrc->tr_indx); - TAVOR_TNF_EXIT(tavor_mcg_attach); return (ibc_get_ci_failure(0)); } @@ -921,10 +842,6 @@ tavor_mcg_attach(tavor_state_t *state, tavor_qphdl_t qp, ib_gid_t gid, TAVOR_WARNING(state, "failed to read MCG entry"); cmn_err(CE_CONT, "Tavor: READ_MGM command failed: %08x\n", status); - TNF_PROBE_2(tavor_mcg_attach_read_mgm_cmd_fail, - TAVOR_TNF_ERROR, "", tnf_uint, cmd_status, status, - tnf_uint, indx, end_indx); - TAVOR_TNF_EXIT(tavor_mcg_attach); return (ibc_get_ci_failure(0)); } @@ -950,10 +867,6 @@ tavor_mcg_attach(tavor_state_t *state, tavor_qphdl_t qp, ib_gid_t gid, TAVOR_WARNING(state, "failed to write MCG entry"); cmn_err(CE_CONT, "Tavor: WRITE_MGM command failed: %08x\n", status); - TNF_PROBE_2(tavor_mcg_attach_write_mgm_cmd_fail, - TAVOR_TNF_ERROR, "", tnf_uint, cmd_status, status, - tnf_uint, indx, end_indx); - TAVOR_TNF_EXIT(tavor_mcg_attach); return (ibc_get_ci_failure(0)); } mcg = &state->ts_mcghdl[end_indx]; @@ -975,13 +888,9 @@ tavor_mcg_attach(tavor_state_t *state, tavor_qphdl_t qp, ib_gid_t gid, tavor_qp_mcg_refcnt_inc(qp); mutex_exit(&state->ts_mcglock); - TAVOR_TNF_EXIT(tavor_mcg_attach); return (DDI_SUCCESS); mcgattach_fail: - TNF_PROBE_1(tavor_mcg_attach_fail, TAVOR_TNF_ERROR, "", tnf_string, - msg, errormsg); - TAVOR_TNF_EXIT(tavor_mcg_attach); return (status); } @@ -1001,16 +910,12 @@ tavor_mcg_detach(tavor_state_t *state, tavor_qphdl_t qp, ib_gid_t gid, uint32_t end_indx, prev_indx; int status; - TAVOR_TNF_ENTER(tavor_mcg_detach); - /* * Check for invalid Multicast DLID. Specifically, all Multicast * LIDs should be within a well defined range. If the specified LID * is outside of that range, then return an error. */ if (tavor_mlid_is_valid(lid) == 0) { - TNF_PROBE_0(tavor_mcg_detach_invmlid_fail, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_mcg_detach); return (IBT_MC_MLID_INVALID); } @@ -1028,9 +933,6 @@ tavor_mcg_detach(tavor_state_t *state, tavor_qphdl_t qp, ib_gid_t gid, if (status != TAVOR_CMD_SUCCESS) { cmn_err(CE_CONT, "Tavor: MGID_HASH command failed: %08x\n", status); - TNF_PROBE_1(tavor_mcg_detach_mgid_hash_cmd_fail, - TAVOR_TNF_ERROR, "", tnf_uint, cmd_status, status); - TAVOR_TNF_EXIT(tavor_mcg_attach); return (ibc_get_ci_failure(0)); } @@ -1064,8 +966,6 @@ tavor_mcg_detach(tavor_state_t *state, tavor_qphdl_t qp, ib_gid_t gid, ((mcg->mcg_mgid_h != gid.gid_prefix) || (mcg->mcg_mgid_l != gid.gid_guid))) { mutex_exit(&state->ts_mcglock); - TNF_PROBE_0(tavor_mcg_detach_invmgid_fail, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_mcg_detach); return (IBT_MC_MGID_INVALID); } @@ -1082,10 +982,6 @@ tavor_mcg_detach(tavor_state_t *state, tavor_qphdl_t qp, ib_gid_t gid, TAVOR_WARNING(state, "failed to read MCG entry"); cmn_err(CE_CONT, "Tavor: READ_MGM command failed: %08x\n", status); - TNF_PROBE_2(tavor_mcg_detach_read_mgm_cmd_fail, - TAVOR_TNF_ERROR, "", tnf_uint, cmd_status, status, - tnf_uint, indx, end_indx); - TAVOR_TNF_EXIT(tavor_mcg_attach); return (ibc_get_ci_failure(0)); } @@ -1097,7 +993,6 @@ tavor_mcg_detach(tavor_state_t *state, tavor_qphdl_t qp, ib_gid_t gid, status = tavor_mcg_qplist_remove(mcg, mcg_entry_qplist, qp); if (status != DDI_SUCCESS) { mutex_exit(&state->ts_mcglock); - TAVOR_TNF_EXIT(tavor_mcg_detach); return (status); } @@ -1125,7 +1020,6 @@ tavor_mcg_detach(tavor_state_t *state, tavor_qphdl_t qp, ib_gid_t gid, mcg_entry); if (status != DDI_SUCCESS) { mutex_exit(&state->ts_mcglock); - TAVOR_TNF_EXIT(tavor_mcg_detach); return (status); } @@ -1146,17 +1040,12 @@ tavor_mcg_detach(tavor_state_t *state, tavor_qphdl_t qp, ib_gid_t gid, TAVOR_WARNING(state, "failed to write MCG entry"); cmn_err(CE_CONT, "Tavor: WRITE_MGM command failed: " "%08x\n", status); - TNF_PROBE_2(tavor_mcg_detach_write_mgm_cmd_fail, - TAVOR_TNF_ERROR, "", tnf_uint, cmd_status, status, - tnf_uint, indx, end_indx); - TAVOR_TNF_EXIT(tavor_mcg_detach); return (ibc_get_ci_failure(0)); } mcg->mcg_num_qps--; } mutex_exit(&state->ts_mcglock); - TAVOR_TNF_EXIT(tavor_mcg_detach); return (DDI_SUCCESS); } @@ -1170,8 +1059,6 @@ tavor_qp_mcg_refcnt_inc(tavor_qphdl_t qp) /* Increment the QP's MCG reference count */ mutex_enter(&qp->qp_lock); qp->qp_mcg_refcnt++; - TNF_PROBE_1_DEBUG(tavor_qp_mcg_refcnt_inc, TAVOR_TNF_TRACE, "", - tnf_uint, refcnt, qp->qp_mcg_refcnt); mutex_exit(&qp->qp_lock); } @@ -1186,8 +1073,6 @@ tavor_qp_mcg_refcnt_dec(tavor_qphdl_t qp) /* Decrement the QP's MCG reference count */ mutex_enter(&qp->qp_lock); qp->qp_mcg_refcnt--; - TNF_PROBE_1_DEBUG(tavor_qp_mcg_refcnt_dec, TAVOR_TNF_TRACE, "", - tnf_uint, refcnt, qp->qp_mcg_refcnt); mutex_exit(&qp->qp_lock); } @@ -1203,8 +1088,6 @@ tavor_mcg_qplist_add(tavor_state_t *state, tavor_mcghdl_t mcg, { uint_t qplist_indx; - TAVOR_TNF_ENTER(tavor_mcg_qplist_add); - ASSERT(MUTEX_HELD(&state->ts_mcglock)); qplist_indx = mcg->mcg_num_qps; @@ -1214,9 +1097,6 @@ tavor_mcg_qplist_add(tavor_state_t *state, tavor_mcghdl_t mcg, * multicast group. If we have, then return an error */ if (qplist_indx >= state->ts_cfg_profile->cp_num_qp_per_mcg) { - TNF_PROBE_0(tavor_mcg_qplist_add_too_many_qps, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_mcg_qplist_add); return (IBT_HCA_MCG_QP_EXCEEDED); } @@ -1254,7 +1134,6 @@ tavor_mcg_qplist_add(tavor_state_t *state, tavor_mcghdl_t mcg, *qp_found = 0; } - TAVOR_TNF_EXIT(tavor_mcg_qplist_add); return (DDI_SUCCESS); } @@ -1270,8 +1149,6 @@ tavor_mcg_qplist_remove(tavor_mcghdl_t mcg, tavor_hw_mcg_qp_list_t *mcg_qplist, { uint_t i, qplist_indx; - TAVOR_TNF_ENTER(tavor_mcg_qplist_remove); - /* * Search the MCG QP list for a matching QPN. When * it's found, we swap the last entry with the current @@ -1286,13 +1163,10 @@ tavor_mcg_qplist_remove(tavor_mcghdl_t mcg, tavor_hw_mcg_qp_list_t *mcg_qplist, mcg_qplist[qplist_indx - 1].q = TAVOR_MCG_QPN_INVALID; mcg_qplist[qplist_indx - 1].qpn = 0; - TAVOR_TNF_EXIT(tavor_mcg_qplist_remove); return (DDI_SUCCESS); } } - TNF_PROBE_0(tavor_mcg_qplist_remove_invqphdl_fail, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_mcg_qplist_remove); return (IBT_QP_HDL_INVALID); } @@ -1308,8 +1182,6 @@ tavor_mcg_walk_mgid_hash(tavor_state_t *state, uint64_t start_indx, tavor_mcghdl_t curr_mcghdl; uint_t curr_indx, prev_indx; - TAVOR_TNF_ENTER(tavor_mcg_walk_mgid_hash); - ASSERT(MUTEX_HELD(&state->ts_mcglock)); /* Start at the head of the hash chain */ @@ -1351,7 +1223,6 @@ end_mgid_hash_walk: if (p_indx != NULL) { *p_indx = prev_indx; } - TAVOR_TNF_EXIT(tavor_mcg_walk_mgid_hash); return (curr_indx); } @@ -1364,8 +1235,6 @@ static void tavor_mcg_setup_new_hdr(tavor_mcghdl_t mcg, tavor_hw_mcg_t *mcg_hdr, ib_gid_t mgid, tavor_rsrc_t *mcg_rsrc) { - TAVOR_TNF_ENTER(tavor_mcg_setup_new_hdr); - /* * Fill in the fields of the "shadow" entry used by software * to track MCG hardware entry @@ -1382,8 +1251,6 @@ tavor_mcg_setup_new_hdr(tavor_mcghdl_t mcg, tavor_hw_mcg_t *mcg_hdr, mcg_hdr->mgid_h = mgid.gid_prefix; mcg_hdr->mgid_l = mgid.gid_guid; mcg_hdr->next_gid_indx = 0; - - TAVOR_TNF_EXIT(tavor_mcg_setup_new_hdr); } @@ -1423,7 +1290,6 @@ tavor_mcg_hash_list_remove(tavor_state_t *state, uint_t curr_indx, status = tavor_mcg_entry_invalidate(state, mcg_entry, curr_indx); bzero(curr_mcg, sizeof (struct tavor_sw_mcg_list_s)); - TAVOR_TNF_EXIT(tavor_mcg_hash_list_remove); return (status); } @@ -1445,10 +1311,6 @@ tavor_mcg_hash_list_remove(tavor_state_t *state, uint_t curr_indx, TAVOR_WARNING(state, "failed to read MCG entry"); cmn_err(CE_CONT, "Tavor: READ_MGM command failed: " "%08x\n", status); - TNF_PROBE_2(tavor_mcg_hash_list_rem_read_mgm_cmd_fail, - TAVOR_TNF_ERROR, "", tnf_uint, cmd_status, status, - tnf_uint, indx, next_indx); - TAVOR_TNF_EXIT(tavor_mcg_hash_list_remove); return (ibc_get_ci_failure(0)); } @@ -1470,10 +1332,6 @@ tavor_mcg_hash_list_remove(tavor_state_t *state, uint_t curr_indx, TAVOR_WARNING(state, "failed to write MCG entry"); cmn_err(CE_CONT, "Tavor: WRITE_MGM command failed: " "%08x\n", status); - TNF_PROBE_2(tavor_mcg_hash_list_rem_write_mgm_cmd_fail, - TAVOR_TNF_ERROR, "", tnf_uint, cmd_status, status, - tnf_uint, indx, curr_indx); - TAVOR_TNF_EXIT(tavor_mcg_hash_list_remove); return (ibc_get_ci_failure(0)); } @@ -1494,7 +1352,6 @@ tavor_mcg_hash_list_remove(tavor_state_t *state, uint_t curr_indx, */ tavor_rsrc_free(state, &curr_mcg->mcg_rsrcp); - TAVOR_TNF_EXIT(tavor_mcg_hash_list_remove); return (DDI_SUCCESS); } @@ -1521,10 +1378,6 @@ tavor_mcg_hash_list_remove(tavor_state_t *state, uint_t curr_indx, TAVOR_WARNING(state, "failed to read MCG entry"); cmn_err(CE_CONT, "Tavor: READ_MGM command failed: %08x\n", status); - TNF_PROBE_2(tavor_mcg_hash_list_rem_read_mgm_cmd_fail, - TAVOR_TNF_ERROR, "", tnf_uint, cmd_status, status, - tnf_uint, indx, prev_indx); - TAVOR_TNF_EXIT(tavor_mcg_hash_list_remove); return (ibc_get_ci_failure(0)); } @@ -1545,10 +1398,6 @@ tavor_mcg_hash_list_remove(tavor_state_t *state, uint_t curr_indx, TAVOR_WARNING(state, "failed to write MCG entry"); cmn_err(CE_CONT, "Tavor: WRITE_MGM command failed: %08x\n", status); - TNF_PROBE_2(tavor_mcg_hash_list_rem_write_mgm_cmd_fail, - TAVOR_TNF_ERROR, "", tnf_uint, cmd_status, status, - tnf_uint, indx, prev_indx); - TAVOR_TNF_EXIT(tavor_mcg_hash_list_remove); return (ibc_get_ci_failure(0)); } @@ -1570,7 +1419,6 @@ tavor_mcg_hash_list_remove(tavor_state_t *state, uint_t curr_indx, tavor_rsrc_free(state, &curr_mcg->mcg_rsrcp); bzero(curr_mcg, sizeof (struct tavor_sw_mcg_list_s)); - TAVOR_TNF_EXIT(tavor_mcg_hash_list_remove); return (DDI_SUCCESS); } @@ -1585,8 +1433,6 @@ tavor_mcg_entry_invalidate(tavor_state_t *state, tavor_hw_mcg_t *mcg_entry, { int status; - TAVOR_TNF_ENTER(tavor_mcg_entry_invalidate); - /* * Invalidate the hardware MCG entry by zeroing out this temporary * MCG and writing it the the hardware. Note: In general, this @@ -1601,14 +1447,9 @@ tavor_mcg_entry_invalidate(tavor_state_t *state, tavor_hw_mcg_t *mcg_entry, TAVOR_WARNING(state, "failed to write MCG entry"); cmn_err(CE_CONT, "Tavor: WRITE_MGM command failed: %08x\n", status); - TNF_PROBE_2(tavor_mcg_entry_invalidate_write_mgm_cmd_fail, - TAVOR_TNF_ERROR, "", tnf_uint, cmd_status, status, - tnf_uint, indx, indx); - TAVOR_TNF_EXIT(tavor_mcg_entry_invalidate); return (ibc_get_ci_failure(0)); } - TAVOR_TNF_EXIT(tavor_mcg_entry_invalidate); return (DDI_SUCCESS); } @@ -1622,8 +1463,6 @@ tavor_mgid_is_valid(ib_gid_t gid) { uint_t topbits, flags, scope; - TAVOR_TNF_ENTER(tavor_mgid_is_valid); - /* * According to IBA 1.1 specification (section 4.1.1) a valid * "multicast GID" must have its top eight bits set to all ones @@ -1631,9 +1470,6 @@ tavor_mgid_is_valid(ib_gid_t gid) topbits = (gid.gid_prefix >> TAVOR_MCG_TOPBITS_SHIFT) & TAVOR_MCG_TOPBITS_MASK; if (topbits != TAVOR_MCG_TOPBITS) { - TNF_PROBE_0(tavor_mgid_is_valid_invbits_fail, TAVOR_TNF_ERROR, - ""); - TAVOR_TNF_EXIT(tavor_mgid_is_valid); return (0); } @@ -1647,9 +1483,6 @@ tavor_mgid_is_valid(ib_gid_t gid) TAVOR_MCG_FLAGS_MASK; if (!((flags == TAVOR_MCG_FLAGS_PERM) || (flags == TAVOR_MCG_FLAGS_NONPERM))) { - TNF_PROBE_1(tavor_mgid_is_valid_invflags_fail, TAVOR_TNF_ERROR, - "", tnf_uint, flags, flags); - TAVOR_TNF_EXIT(tavor_mgid_is_valid); return (0); } @@ -1665,9 +1498,6 @@ tavor_mgid_is_valid(ib_gid_t gid) (scope == TAVOR_MCG_SCOPE_SITELOC) || (scope == TAVOR_MCG_SCOPE_ORGLOC) || (scope == TAVOR_MCG_SCOPE_GLOBAL))) { - TNF_PROBE_1(tavor_mgid_is_valid_invscope_fail, TAVOR_TNF_ERROR, - "", tnf_uint, scope, scope); - TAVOR_TNF_EXIT(tavor_mgid_is_valid); return (0); } @@ -1675,7 +1505,6 @@ tavor_mgid_is_valid(ib_gid_t gid) * If it passes all of the above checks, then we will consider it * a valid multicast GID. */ - TAVOR_TNF_EXIT(tavor_mgid_is_valid); return (1); } @@ -1687,20 +1516,14 @@ tavor_mgid_is_valid(ib_gid_t gid) static int tavor_mlid_is_valid(ib_lid_t lid) { - TAVOR_TNF_ENTER(tavor_mlid_is_valid); - /* * According to IBA 1.1 specification (section 4.1.1) a valid * "multicast DLID" must be between 0xC000 and 0xFFFE. */ if ((lid < IB_LID_MC_FIRST) || (lid > IB_LID_MC_LAST)) { - TNF_PROBE_1(tavor_mlid_is_valid_invdlid_fail, TAVOR_TNF_ERROR, - "", tnf_uint, mlid, lid); - TAVOR_TNF_EXIT(tavor_mlid_is_valid); return (0); } - TAVOR_TNF_EXIT(tavor_mlid_is_valid); return (1); } @@ -1716,8 +1539,6 @@ tavor_pd_alloc(tavor_state_t *state, tavor_pdhdl_t *pdhdl, uint_t sleepflag) tavor_pdhdl_t pd; int status; - TAVOR_TNF_ENTER(tavor_pd_alloc); - /* * Allocate the software structure for tracking the protection domain * (i.e. the Tavor Protection Domain handle). By default each PD @@ -1727,8 +1548,6 @@ tavor_pd_alloc(tavor_state_t *state, tavor_pdhdl_t *pdhdl, uint_t sleepflag) */ status = tavor_rsrc_alloc(state, TAVOR_PDHDL, 1, sleepflag, &rsrc); if (status != DDI_SUCCESS) { - TNF_PROBE_0(tavor_pd_alloc_rsrcalloc_fail, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_pd_alloc); return (IBT_INSUFF_RESOURCE); } pd = (tavor_pdhdl_t)rsrc->tr_addr; @@ -1737,7 +1556,6 @@ tavor_pd_alloc(tavor_state_t *state, tavor_pdhdl_t *pdhdl, uint_t sleepflag) pd->pd_refcnt = 0; *pdhdl = pd; - TAVOR_TNF_EXIT(tavor_pd_alloc); return (DDI_SUCCESS); } @@ -1752,8 +1570,6 @@ tavor_pd_free(tavor_state_t *state, tavor_pdhdl_t *pdhdl) tavor_rsrc_t *rsrc; tavor_pdhdl_t pd; - TAVOR_TNF_ENTER(tavor_pd_free); - /* * Pull all the necessary information from the Tavor Protection Domain * handle. This is necessary here because the resource for the @@ -1771,9 +1587,6 @@ tavor_pd_free(tavor_state_t *state, tavor_pdhdl_t *pdhdl) * Tavor resource and return success. */ if (pd->pd_refcnt != 0) { - TNF_PROBE_1(tavor_pd_free_refcnt_fail, TAVOR_TNF_ERROR, "", - tnf_int, refcnt, pd->pd_refcnt); - TAVOR_TNF_EXIT(tavor_pd_free); return (IBT_PD_IN_USE); } @@ -1783,7 +1596,6 @@ tavor_pd_free(tavor_state_t *state, tavor_pdhdl_t *pdhdl) /* Set the pdhdl pointer to NULL and return success */ *pdhdl = (tavor_pdhdl_t)NULL; - TAVOR_TNF_EXIT(tavor_pd_free); return (DDI_SUCCESS); } @@ -1797,8 +1609,6 @@ tavor_pd_refcnt_inc(tavor_pdhdl_t pd) { /* Increment the protection domain's reference count */ mutex_enter(&pd->pd_lock); - TNF_PROBE_1_DEBUG(tavor_pd_refcnt_inc, TAVOR_TNF_TRACE, "", - tnf_uint, refcnt, pd->pd_refcnt); pd->pd_refcnt++; mutex_exit(&pd->pd_lock); @@ -1815,8 +1625,6 @@ tavor_pd_refcnt_dec(tavor_pdhdl_t pd) /* Decrement the protection domain's reference count */ mutex_enter(&pd->pd_lock); pd->pd_refcnt--; - TNF_PROBE_1_DEBUG(tavor_pd_refcnt_dec, TAVOR_TNF_TRACE, "", - tnf_uint, refcnt, pd->pd_refcnt); mutex_exit(&pd->pd_lock); } @@ -1836,15 +1644,10 @@ tavor_port_query(tavor_state_t *state, uint_t port, ibt_hca_portinfo_t *pi) uint_t sgid_max, pkey_max, tbl_size; int i, j, indx, status; - TAVOR_TNF_ENTER(tavor_port_query); - _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*pi)) /* Validate that specified port number is legal */ if (!tavor_portnum_is_valid(state, port)) { - TNF_PROBE_1(tavor_port_query_inv_portnum_fail, - TAVOR_TNF_ERROR, "", tnf_uint, port, port); - TAVOR_TNF_EXIT(tavor_port_query); return (IBT_HCA_PORT_INVALID); } @@ -1860,9 +1663,6 @@ tavor_port_query(tavor_state_t *state, uint_t port, ibt_hca_portinfo_t *pi) if (status != TAVOR_CMD_SUCCESS) { cmn_err(CE_CONT, "Tavor: GetPortInfo (port %02d) command " "failed: %08x\n", port, status); - TNF_PROBE_1(tavor_port_query_getportinfo_cmd_fail, - TAVOR_TNF_ERROR, "", tnf_uint, cmd_status, status); - TAVOR_TNF_EXIT(tavor_port_query); return (ibc_get_ci_failure(0)); } @@ -1923,9 +1723,6 @@ tavor_port_query(tavor_state_t *state, uint_t port, ibt_hca_portinfo_t *pi) if (status != TAVOR_CMD_SUCCESS) { cmn_err(CE_CONT, "Tavor: GetGUIDInfo (port %02d) " "command failed: %08x\n", port, status); - TNF_PROBE_1(tavor_port_query_getguidinfo_cmd_fail, - TAVOR_TNF_ERROR, "", tnf_uint, cmd_status, status); - TAVOR_TNF_EXIT(tavor_port_query); return (ibc_get_ci_failure(0)); } @@ -1954,9 +1751,6 @@ tavor_port_query(tavor_state_t *state, uint_t port, ibt_hca_portinfo_t *pi) if (status != TAVOR_CMD_SUCCESS) { cmn_err(CE_CONT, "Tavor: GetPKeyTable (port %02d) " "command failed: %08x\n", port, status); - TNF_PROBE_1(tavor_port_query_getpkeytable_cmd_fail, - TAVOR_TNF_ERROR, "", tnf_uint, cmd_status, status); - TAVOR_TNF_EXIT(tavor_port_query); return (ibc_get_ci_failure(0)); } @@ -1968,7 +1762,6 @@ tavor_port_query(tavor_state_t *state, uint_t port, ibt_hca_portinfo_t *pi) } } - TAVOR_TNF_EXIT(tavor_port_query); return (DDI_SUCCESS); } @@ -1986,16 +1779,11 @@ tavor_port_modify(tavor_state_t *state, uint8_t port, uint32_t capmask, reset_qkey; int status; - TAVOR_TNF_ENTER(tavor_port_modify); - /* * Return an error if either of the unsupported flags are set */ if ((flags & IBT_PORT_SHUTDOWN) || (flags & IBT_PORT_SET_INIT_TYPE)) { - TNF_PROBE_1(tavor_port_modify_inv_flags_fail, - TAVOR_TNF_ERROR, "", tnf_uint, flags, flags); - TAVOR_TNF_EXIT(tavor_port_modify); return (IBT_NOT_SUPPORTED); } @@ -2006,9 +1794,6 @@ tavor_port_modify(tavor_state_t *state, uint8_t port, /* Validate that specified port number is legal */ if (!tavor_portnum_is_valid(state, port)) { - TNF_PROBE_1(tavor_port_modify_inv_portnum_fail, - TAVOR_TNF_ERROR, "", tnf_uint, port, port); - TAVOR_TNF_EXIT(tavor_port_modify); return (IBT_HCA_PORT_INVALID); } @@ -2023,9 +1808,6 @@ tavor_port_modify(tavor_state_t *state, uint8_t port, status = tavor_getportinfo_cmd_post(state, port, TAVOR_SLEEPFLAG_FOR_CONTEXT(), &portinfo); if (status != TAVOR_CMD_SUCCESS) { - TNF_PROBE_1(tavor_port_modify_getportinfo_cmd_fail, - TAVOR_TNF_ERROR, "", tnf_uint, cmd_status, status); - TAVOR_TNF_EXIT(tavor_port_modify); return (ibc_get_ci_failure(0)); } @@ -2069,13 +1851,9 @@ tavor_port_modify(tavor_state_t *state, uint8_t port, TAVOR_WARNING(state, "failed to modify port capabilities"); cmn_err(CE_CONT, "Tavor: SET_IB (port %02d) command failed: " "%08x\n", port, status); - TNF_PROBE_1(tavor_port_modify_set_ib_cmd_fail, - TAVOR_TNF_ERROR, "", tnf_uint, cmd_status, status); - TAVOR_TNF_EXIT(tavor_port_modify); return (ibc_get_ci_failure(0)); } - TAVOR_TNF_EXIT(tavor_port_modify); return (DDI_SUCCESS); } @@ -2096,8 +1874,6 @@ tavor_set_addr_path(tavor_state_t *state, ibt_adds_vect_t *av, { uint_t gidtbl_sz; - TAVOR_TNF_ENTER(tavor_set_addr_path); - _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*av)) _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*path)) @@ -2128,9 +1904,6 @@ tavor_set_addr_path(tavor_state_t *state, ibt_adds_vect_t *av, } else if (av->av_srate == IBT_SRATE_NOT_SPECIFIED) { path->max_stat_rate = 0; /* Max */ } else { - TNF_PROBE_1(tavor_set_addr_path_inv_srate_fail, - TAVOR_TNF_ERROR, "", tnf_uint, srate, av->av_srate); - TAVOR_TNF_EXIT(tavor_set_addr_path); return (IBT_STATIC_RATE_INVALID); } } else { @@ -2141,9 +1914,6 @@ tavor_set_addr_path(tavor_state_t *state, ibt_adds_vect_t *av, } else if (av->av_srate == IBT_SRATE_NOT_SPECIFIED) { path->max_stat_rate = 0; /* Max */ } else { - TNF_PROBE_1(tavor_set_addr_path_inv_srate_fail, - TAVOR_TNF_ERROR, "", tnf_uint, srate, av->av_srate); - TAVOR_TNF_EXIT(tavor_set_addr_path); return (IBT_STATIC_RATE_INVALID); } } @@ -2159,9 +1929,6 @@ tavor_set_addr_path(tavor_state_t *state, ibt_adds_vect_t *av, /* If "grh" flag is set, then check for valid SGID index too */ gidtbl_sz = (1 << state->ts_devlim.log_max_gid); if ((av->av_send_grh) && (av->av_sgid_ix > gidtbl_sz)) { - TNF_PROBE_1(tavor_set_addr_path_inv_sgid_ix_fail, - TAVOR_TNF_ERROR, "", tnf_uint, sgid_ix, av->av_sgid_ix); - TAVOR_TNF_EXIT(tavor_set_addr_path); return (IBT_SGID_INVALID); } @@ -2207,7 +1974,6 @@ tavor_set_addr_path(tavor_state_t *state, ibt_adds_vect_t *av, path->rgid_l = 0x2; } - TAVOR_TNF_EXIT(tavor_set_addr_path); return (DDI_SUCCESS); } @@ -2349,8 +2115,6 @@ tavor_queue_alloc(tavor_state_t *state, tavor_qalloc_info_t *qa_info, uint_t dma_xfer_mode, type; int flag, status; - TAVOR_TNF_ENTER(tavor_queue_alloc); - _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*qa_info)) /* Set the callback flag appropriately */ @@ -2373,8 +2137,6 @@ tavor_queue_alloc(tavor_state_t *state, tavor_qalloc_info_t *qa_info, status = ddi_dma_alloc_handle(state->ts_dip, &dma_attr, callback, NULL, &qa_info->qa_dmahdl); if (status != DDI_SUCCESS) { - TNF_PROBE_0(tavor_queue_alloc_dmahdl_fail, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_queue_alloc); return (DDI_FAILURE); } @@ -2421,9 +2183,6 @@ tavor_queue_alloc(tavor_state_t *state, tavor_qalloc_info_t *qa_info, (size_t *)&qa_info->qa_buf_realsz, &qa_info->qa_acchdl); if (status != DDI_SUCCESS) { ddi_dma_free_handle(&qa_info->qa_dmahdl); - TNF_PROBE_0(tavor_queue_alloc_dma_memalloc_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_queue_alloc); return (DDI_FAILURE); } @@ -2442,9 +2201,6 @@ tavor_queue_alloc(tavor_state_t *state, tavor_qalloc_info_t *qa_info, &qa_info->qa_umemcookie); if (qa_info->qa_buf_real == NULL) { ddi_dma_free_handle(&qa_info->qa_dmahdl); - TNF_PROBE_0(tavor_queue_alloc_umem_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_queue_alloc); return (DDI_FAILURE); } @@ -2463,9 +2219,6 @@ tavor_queue_alloc(tavor_state_t *state, tavor_qalloc_info_t *qa_info, NULL, NULL, flag); if (qa_info->qa_buf_real == NULL) { ddi_dma_free_handle(&qa_info->qa_dmahdl); - TNF_PROBE_0(tavor_queue_alloc_vmxa_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_queue_alloc); return (DDI_FAILURE); } @@ -2493,7 +2246,6 @@ tavor_queue_alloc(tavor_state_t *state, tavor_qalloc_info_t *qa_info, qa_info->qa_buf_aligned + alloc_mask) & ~alloc_mask); } - TAVOR_TNF_EXIT(tavor_queue_alloc); return (DDI_SUCCESS); } @@ -2505,8 +2257,6 @@ tavor_queue_alloc(tavor_state_t *state, tavor_qalloc_info_t *qa_info, void tavor_queue_free(tavor_state_t *state, tavor_qalloc_info_t *qa_info) { - TAVOR_TNF_ENTER(tavor_queue_free); - _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*qa_info)) /* @@ -2530,8 +2280,6 @@ tavor_queue_free(tavor_state_t *state, tavor_qalloc_info_t *qa_info) /* Always free the dma handle */ ddi_dma_free_handle(&qa_info->qa_dmahdl); - - TAVOR_TNF_EXIT(tavor_queue_free); } diff --git a/usr/src/uts/common/io/ib/adapters/tavor/tavor_mr.c b/usr/src/uts/common/io/ib/adapters/tavor/tavor_mr.c index fd2c41abfc..d3eb9e2bd8 100644 --- a/usr/src/uts/common/io/ib/adapters/tavor/tavor_mr.c +++ b/usr/src/uts/common/io/ib/adapters/tavor/tavor_mr.c @@ -93,8 +93,6 @@ tavor_mr_register(tavor_state_t *state, tavor_pdhdl_t pd, tavor_bind_info_t bind; int status; - TAVOR_TNF_ENTER(tavor_mr_register); - /* * Fill in the "bind" struct. This struct provides the majority * of the information that will be used to distinguish between an @@ -109,15 +107,8 @@ tavor_mr_register(tavor_state_t *state, tavor_pdhdl_t pd, bind.bi_as = mr_attr->mr_as; bind.bi_flags = mr_attr->mr_flags; status = tavor_mr_common_reg(state, pd, &bind, mrhdl, op); - if (status != DDI_SUCCESS) { - TNF_PROBE_0(tavor_mr_register_cmnreg_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_mr_register); - return (status); - } - TAVOR_TNF_EXIT(tavor_mr_register); - return (DDI_SUCCESS); + return (status); } @@ -133,8 +124,6 @@ tavor_mr_register_buf(tavor_state_t *state, tavor_pdhdl_t pd, tavor_bind_info_t bind; int status; - TAVOR_TNF_ENTER(tavor_mr_register_buf); - /* * Fill in the "bind" struct. This struct provides the majority * of the information that will be used to distinguish between an @@ -158,15 +147,8 @@ tavor_mr_register_buf(tavor_state_t *state, tavor_pdhdl_t pd, bind.bi_len = (uint64_t)buf->b_bcount; bind.bi_flags = mr_attr->mr_flags; status = tavor_mr_common_reg(state, pd, &bind, mrhdl, op); - if (status != DDI_SUCCESS) { - TNF_PROBE_0(tavor_mr_register_buf_cmnreg_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_mr_register_buf); - return (status); - } - TAVOR_TNF_EXIT(tavor_mr_register_buf); - return (DDI_SUCCESS); + return (status); } @@ -190,9 +172,6 @@ tavor_mr_register_shared(tavor_state_t *state, tavor_mrhdl_t mrhdl, uint64_t mtt_addr, mtt_ddrbaseaddr, pgsize_msk; uint_t sleep, mr_is_umem; int status, umem_flags; - char *errormsg; - - TAVOR_TNF_ENTER(tavor_mr_register_shared); /* * Check the sleep flag. Ensure that it is consistent with the @@ -203,8 +182,6 @@ tavor_mr_register_shared(tavor_state_t *state, tavor_mrhdl_t mrhdl, TAVOR_SLEEP; if ((sleep == TAVOR_SLEEP) && (sleep != TAVOR_SLEEPFLAG_FOR_CONTEXT())) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_INVALID_PARAM, "invalid flags"); goto mrshared_fail; } @@ -221,8 +198,6 @@ tavor_mr_register_shared(tavor_state_t *state, tavor_mrhdl_t mrhdl, */ status = tavor_rsrc_alloc(state, TAVOR_MPT, 1, sleep, &mpt); if (status != DDI_SUCCESS) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_INSUFF_RESOURCE, "failed MPT"); goto mrshared_fail1; } @@ -234,8 +209,6 @@ tavor_mr_register_shared(tavor_state_t *state, tavor_mrhdl_t mrhdl, */ status = tavor_rsrc_alloc(state, TAVOR_MRHDL, 1, sleep, &rsrc); if (status != DDI_SUCCESS) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_INSUFF_RESOURCE, "failed MR handle"); goto mrshared_fail2; } mr = (tavor_mrhdl_t)rsrc->tr_addr; @@ -284,8 +257,6 @@ tavor_mr_register_shared(tavor_state_t *state, tavor_mrhdl_t mrhdl, */ if ((mrhdl->mr_is_umem) && (mrhdl->mr_umemcookie == NULL)) { mutex_exit(&mrhdl->mr_lock); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_MR_HDL_INVALID, "invalid mrhdl"); goto mrshared_fail3; } @@ -310,8 +281,6 @@ tavor_mr_register_shared(tavor_state_t *state, tavor_mrhdl_t mrhdl, &umem_cookie, &tavor_umem_cbops, NULL); if (status != 0) { mutex_exit(&mrhdl->mr_lock); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_INSUFF_RESOURCE, "failed umem pin"); goto mrshared_fail3; } @@ -320,8 +289,6 @@ tavor_mr_register_shared(tavor_state_t *state, tavor_mrhdl_t mrhdl, (uint64_t)(uintptr_t)rsrc); if (umapdb == NULL) { mutex_exit(&mrhdl->mr_lock); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_INSUFF_RESOURCE, "failed umap add"); goto mrshared_fail4; } } @@ -403,11 +370,6 @@ tavor_mr_register_shared(tavor_state_t *state, tavor_mrhdl_t mrhdl, if (status != TAVOR_CMD_SUCCESS) { cmn_err(CE_CONT, "Tavor: SW2HW_MPT command failed: %08x\n", status); - TNF_PROBE_1(tavor_mr_register_shared_sw2hw_mpt_cmd_fail, - TAVOR_TNF_ERROR, "", tnf_uint, status, status); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(ibc_get_ci_failure(0), - "tavor SW2HW_MPT command"); goto mrshared_fail5; } @@ -438,7 +400,6 @@ tavor_mr_register_shared(tavor_state_t *state, tavor_mrhdl_t mrhdl, *mrhdl_new = mr; - TAVOR_TNF_EXIT(tavor_mr_register_shared); return (DDI_SUCCESS); /* @@ -460,9 +421,6 @@ mrshared_fail2: mrshared_fail1: tavor_pd_refcnt_dec(pd); mrshared_fail: - TNF_PROBE_1(tavor_mr_register_shared_fail, TAVOR_TNF_ERROR, "", - tnf_string, msg, errormsg); - TAVOR_TNF_EXIT(tavor_mr_register_shared); return (status); } @@ -483,9 +441,6 @@ tavor_mr_deregister(tavor_state_t *state, tavor_mrhdl_t *mrhdl, uint_t level, tavor_bind_info_t *bind; uint64_t value; int status, shared_mtt; - char *errormsg; - - TAVOR_TNF_ENTER(tavor_mr_deregister); /* * Check the sleep flag. Ensure that it is consistent with the @@ -494,11 +449,6 @@ tavor_mr_deregister(tavor_state_t *state, tavor_mrhdl_t *mrhdl, uint_t level, */ if ((sleep == TAVOR_SLEEP) && (sleep != TAVOR_SLEEPFLAG_FOR_CONTEXT())) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_INVALID_PARAM, "invalid sleep flags"); - TNF_PROBE_1(tavor_mr_deregister_fail, TAVOR_TNF_ERROR, "", - tnf_string, msg, errormsg); - TAVOR_TNF_EXIT(tavor_mr_deregister); return (status); } @@ -551,15 +501,10 @@ tavor_mr_deregister(tavor_state_t *state, tavor_mrhdl_t *mrhdl, uint_t level, NULL, 0, mpt->tr_indx, sleep); if (status != TAVOR_CMD_SUCCESS) { if (status == TAVOR_CMD_REG_BOUND) { - TAVOR_TNF_EXIT(tavor_mr_deregister); return (IBT_MR_IN_USE); } else { cmn_err(CE_CONT, "Tavor: HW2SW_MPT command " "failed: %08x\n", status); - TNF_PROBE_1(tavor_hw2sw_mpt_cmd_fail, - TAVOR_TNF_ERROR, "", tnf_uint, status, - status); - TAVOR_TNF_EXIT(tavor_mr_deregister); return (IBT_INVALID_PARAM); } } @@ -632,7 +577,6 @@ tavor_mr_deregister(tavor_state_t *state, tavor_mrhdl_t *mrhdl, uint_t level, */ if ((mr->mr_is_umem) && (mr->mr_umemcookie == NULL)) { mutex_exit(&mr->mr_lock); - TAVOR_TNF_EXIT(tavor_mr_deregister); return (DDI_SUCCESS); } @@ -651,7 +595,6 @@ mrdereg_finish_cleanup: /* Set the mrhdl pointer to NULL and return success */ *mrhdl = NULL; - TAVOR_TNF_EXIT(tavor_mr_deregister); return (DDI_SUCCESS); } @@ -665,8 +608,6 @@ int tavor_mr_query(tavor_state_t *state, tavor_mrhdl_t mr, ibt_mr_query_attr_t *attr) { - TAVOR_TNF_ENTER(tavor_mr_query); - _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*attr)) mutex_enter(&mr->mr_lock); @@ -678,8 +619,6 @@ tavor_mr_query(tavor_state_t *state, tavor_mrhdl_t mr, */ if ((mr->mr_is_umem) && (mr->mr_umemcookie == NULL)) { mutex_exit(&mr->mr_lock); - TNF_PROBE_0(tavor_mr_query_inv_mrhdl_fail, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_mr_query); return (IBT_MR_HDL_INVALID); } @@ -713,7 +652,6 @@ tavor_mr_query(tavor_state_t *state, tavor_mrhdl_t mr, IBT_MR_NONCOHERENT) ? B_TRUE : B_FALSE; mutex_exit(&mr->mr_lock); - TAVOR_TNF_EXIT(tavor_mr_query); return (DDI_SUCCESS); } @@ -730,8 +668,6 @@ tavor_mr_reregister(tavor_state_t *state, tavor_mrhdl_t mr, tavor_bind_info_t bind; int status; - TAVOR_TNF_ENTER(tavor_mr_reregister); - /* * Fill in the "bind" struct. This struct provides the majority * of the information that will be used to distinguish between an @@ -746,15 +682,8 @@ tavor_mr_reregister(tavor_state_t *state, tavor_mrhdl_t mr, bind.bi_as = mr_attr->mr_as; bind.bi_flags = mr_attr->mr_flags; status = tavor_mr_common_rereg(state, mr, pd, &bind, mrhdl_new, op); - if (status != DDI_SUCCESS) { - TNF_PROBE_0(tavor_mr_reregister_cmnreg_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_mr_reregister); - return (status); - } - TAVOR_TNF_EXIT(tavor_mr_reregister); - return (DDI_SUCCESS); + return (status); } @@ -770,8 +699,6 @@ tavor_mr_reregister_buf(tavor_state_t *state, tavor_mrhdl_t mr, tavor_bind_info_t bind; int status; - TAVOR_TNF_ENTER(tavor_mr_reregister_buf); - /* * Fill in the "bind" struct. This struct provides the majority * of the information that will be used to distinguish between an @@ -795,15 +722,8 @@ tavor_mr_reregister_buf(tavor_state_t *state, tavor_mrhdl_t mr, bind.bi_flags = mr_attr->mr_flags; bind.bi_as = NULL; status = tavor_mr_common_rereg(state, mr, pd, &bind, mrhdl_new, op); - if (status != DDI_SUCCESS) { - TNF_PROBE_0(tavor_mr_reregister_buf_cmnreg_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_mr_reregister_buf); - return (status); - } - TAVOR_TNF_EXIT(tavor_mr_reregister_buf); - return (DDI_SUCCESS); + return (status); } @@ -820,9 +740,6 @@ tavor_mr_sync(tavor_state_t *state, ibt_mr_sync_t *mr_segs, size_t num_segs) uint64_t mr_start, mr_end; uint_t type; int status, i; - char *errormsg; - - TAVOR_TNF_ENTER(tavor_mr_sync); /* Process each of the ibt_mr_sync_t's */ for (i = 0; i < num_segs; i++) { @@ -830,8 +747,6 @@ tavor_mr_sync(tavor_state_t *state, ibt_mr_sync_t *mr_segs, size_t num_segs) /* Check for valid memory region handle */ if (mrhdl == NULL) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_MR_HDL_INVALID, "invalid mrhdl"); goto mrsync_fail; } @@ -845,8 +760,6 @@ tavor_mr_sync(tavor_state_t *state, ibt_mr_sync_t *mr_segs, size_t num_segs) */ if ((mrhdl->mr_is_umem) && (mrhdl->mr_umemcookie == NULL)) { mutex_exit(&mrhdl->mr_lock); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_MR_HDL_INVALID, "invalid mrhdl2"); goto mrsync_fail; } @@ -858,14 +771,10 @@ tavor_mr_sync(tavor_state_t *state, ibt_mr_sync_t *mr_segs, size_t num_segs) mr_end = mr_start + mrhdl->mr_bindinfo.bi_len - 1; if ((seg_vaddr < mr_start) || (seg_vaddr > mr_end)) { mutex_exit(&mrhdl->mr_lock); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_MR_VA_INVALID, "invalid vaddr"); goto mrsync_fail; } if ((seg_end < mr_start) || (seg_end > mr_end)) { mutex_exit(&mrhdl->mr_lock); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_MR_LEN_INVALID, "invalid length"); goto mrsync_fail; } @@ -876,8 +785,6 @@ tavor_mr_sync(tavor_state_t *state, ibt_mr_sync_t *mr_segs, size_t num_segs) type = DDI_DMA_SYNC_FORCPU; } else { mutex_exit(&mrhdl->mr_lock); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_INVALID_PARAM, "invalid sync type"); goto mrsync_fail; } @@ -886,13 +793,9 @@ tavor_mr_sync(tavor_state_t *state, ibt_mr_sync_t *mr_segs, size_t num_segs) mutex_exit(&mrhdl->mr_lock); } - TAVOR_TNF_EXIT(tavor_mr_sync); return (DDI_SUCCESS); mrsync_fail: - TNF_PROBE_1(tavor_mr_sync_fail, TAVOR_TNF_ERROR, "", tnf_string, msg, - errormsg); - TAVOR_TNF_EXIT(tavor_mr_sync); return (status); } @@ -910,9 +813,6 @@ tavor_mw_alloc(tavor_state_t *state, tavor_pdhdl_t pd, ibt_mw_flags_t flags, tavor_mwhdl_t mw; uint_t sleep; int status; - char *errormsg; - - TAVOR_TNF_ENTER(tavor_mw_alloc); /* * Check the sleep flag. Ensure that it is consistent with the @@ -922,8 +822,6 @@ tavor_mw_alloc(tavor_state_t *state, tavor_pdhdl_t pd, ibt_mw_flags_t flags, sleep = (flags & IBT_MW_NOSLEEP) ? TAVOR_NOSLEEP : TAVOR_SLEEP; if ((sleep == TAVOR_SLEEP) && (sleep != TAVOR_SLEEPFLAG_FOR_CONTEXT())) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_INVALID_PARAM, "invalid flags"); goto mwalloc_fail; } @@ -941,8 +839,6 @@ tavor_mw_alloc(tavor_state_t *state, tavor_pdhdl_t pd, ibt_mw_flags_t flags, */ status = tavor_rsrc_alloc(state, TAVOR_MPT, 1, sleep, &mpt); if (status != DDI_SUCCESS) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_INSUFF_RESOURCE, "failed MPT"); goto mwalloc_fail1; } @@ -956,8 +852,6 @@ tavor_mw_alloc(tavor_state_t *state, tavor_pdhdl_t pd, ibt_mw_flags_t flags, */ status = tavor_rsrc_alloc(state, TAVOR_MRHDL, 1, sleep, &rsrc); if (status != DDI_SUCCESS) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_INSUFF_RESOURCE, "failed MR handle"); goto mwalloc_fail2; } mw = (tavor_mwhdl_t)rsrc->tr_addr; @@ -994,11 +888,6 @@ tavor_mw_alloc(tavor_state_t *state, tavor_pdhdl_t pd, ibt_mw_flags_t flags, if (status != TAVOR_CMD_SUCCESS) { cmn_err(CE_CONT, "Tavor: SW2HW_MPT command failed: %08x\n", status); - TNF_PROBE_1(tavor_mw_alloc_sw2hw_mpt_cmd_fail, - TAVOR_TNF_ERROR, "", tnf_uint, status, status); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(ibc_get_ci_failure(0), - "tavor SW2HW_MPT command"); goto mwalloc_fail3; } @@ -1012,7 +901,6 @@ tavor_mw_alloc(tavor_state_t *state, tavor_pdhdl_t pd, ibt_mw_flags_t flags, mw->mr_rsrcp = rsrc; *mwhdl = mw; - TAVOR_TNF_EXIT(tavor_mw_alloc); return (DDI_SUCCESS); mwalloc_fail3: @@ -1022,9 +910,6 @@ mwalloc_fail2: mwalloc_fail1: tavor_pd_refcnt_dec(pd); mwalloc_fail: - TNF_PROBE_1(tavor_mw_alloc_fail, TAVOR_TNF_ERROR, "", - tnf_string, msg, errormsg); - TAVOR_TNF_EXIT(tavor_mw_alloc); return (status); } @@ -1039,11 +924,8 @@ tavor_mw_free(tavor_state_t *state, tavor_mwhdl_t *mwhdl, uint_t sleep) tavor_rsrc_t *mpt, *rsrc; tavor_mwhdl_t mw; int status; - char *errormsg; tavor_pdhdl_t pd; - TAVOR_TNF_ENTER(tavor_mw_free); - /* * Check the sleep flag. Ensure that it is consistent with the * current thread context (i.e. if we are currently in the interrupt @@ -1051,11 +933,6 @@ tavor_mw_free(tavor_state_t *state, tavor_mwhdl_t *mwhdl, uint_t sleep) */ if ((sleep == TAVOR_SLEEP) && (sleep != TAVOR_SLEEPFLAG_FOR_CONTEXT())) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_INVALID_PARAM, "invalid sleep flags"); - TNF_PROBE_1(tavor_mw_free_fail, TAVOR_TNF_ERROR, "", - tnf_string, msg, errormsg); - TAVOR_TNF_EXIT(tavor_mw_free); return (status); } @@ -1081,9 +958,6 @@ tavor_mw_free(tavor_state_t *state, tavor_mwhdl_t *mwhdl, uint_t sleep) if (status != TAVOR_CMD_SUCCESS) { cmn_err(CE_CONT, "Tavor: HW2SW_MPT command failed: %08x\n", status); - TNF_PROBE_1(tavor_hw2sw_mpt_cmd_fail, TAVOR_TNF_ERROR, "", - tnf_uint, status, status); - TAVOR_TNF_EXIT(tavor_mw_free); return (IBT_INVALID_PARAM); } @@ -1099,7 +973,6 @@ tavor_mw_free(tavor_state_t *state, tavor_mwhdl_t *mwhdl, uint_t sleep) /* Set the mwhdl pointer to NULL and return success */ *mwhdl = NULL; - TAVOR_TNF_EXIT(tavor_mw_free); return (DDI_SUCCESS); } @@ -1155,9 +1028,6 @@ tavor_mr_common_reg(tavor_state_t *state, tavor_pdhdl_t pd, uint64_t mtt_addr, mtt_ddrbaseaddr, max_sz; uint_t sleep, mtt_pgsize_bits, bind_type, mr_is_umem; int status, umem_flags, bind_override_addr; - char *errormsg; - - TAVOR_TNF_ENTER(tavor_mr_common_reg); /* * Check the "options" flag. Currently this flag tells the driver @@ -1187,8 +1057,6 @@ tavor_mr_common_reg(tavor_state_t *state, tavor_pdhdl_t pd, */ max_sz = ((uint64_t)1 << state->ts_cfg_profile->cp_log_max_mrw_sz); if ((bind->bi_len == 0) || (bind->bi_len > max_sz)) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_MR_LEN_INVALID, "invalid length"); goto mrcommon_fail; } @@ -1200,8 +1068,6 @@ tavor_mr_common_reg(tavor_state_t *state, tavor_pdhdl_t pd, sleep = (flags & IBT_MR_NOSLEEP) ? TAVOR_NOSLEEP: TAVOR_SLEEP; if ((sleep == TAVOR_SLEEP) && (sleep != TAVOR_SLEEPFLAG_FOR_CONTEXT())) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_INVALID_PARAM, "invalid flags"); goto mrcommon_fail; } @@ -1224,8 +1090,6 @@ tavor_mr_common_reg(tavor_state_t *state, tavor_pdhdl_t pd, */ status = tavor_rsrc_alloc(state, TAVOR_MPT, 1, sleep, &mpt); if (status != DDI_SUCCESS) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_INSUFF_RESOURCE, "failed MPT"); goto mrcommon_fail1; } @@ -1237,8 +1101,6 @@ tavor_mr_common_reg(tavor_state_t *state, tavor_pdhdl_t pd, */ status = tavor_rsrc_alloc(state, TAVOR_MRHDL, 1, sleep, &rsrc); if (status != DDI_SUCCESS) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_INSUFF_RESOURCE, "failed MR handle"); goto mrcommon_fail2; } mr = (tavor_mrhdl_t)rsrc->tr_addr; @@ -1296,8 +1158,6 @@ tavor_mr_common_reg(tavor_state_t *state, tavor_pdhdl_t pd, status = umem_lockmemory(umem_addr, umem_len, umem_flags, &umem_cookie, &tavor_umem_cbops, NULL); if (status != 0) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_INSUFF_RESOURCE, "failed umem pin"); goto mrcommon_fail3; } @@ -1307,8 +1167,6 @@ tavor_mr_common_reg(tavor_state_t *state, tavor_pdhdl_t pd, bind->bi_buf = ddi_umem_iosetup(umem_cookie, 0, umem_len, B_WRITE, 0, 0, NULL, DDI_UMEM_SLEEP); if (bind->bi_buf == NULL) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_INSUFF_RESOURCE, "failed iosetup"); goto mrcommon_fail3; } bind->bi_type = TAVOR_BINDHDL_UBUF; @@ -1321,8 +1179,6 @@ tavor_mr_common_reg(tavor_state_t *state, tavor_pdhdl_t pd, (uint64_t)(uintptr_t)umem_cookie, MLNX_UMAP_MRMEM_RSRC, (uint64_t)(uintptr_t)rsrc); if (umapdb == NULL) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_INSUFF_RESOURCE, "failed umap add"); goto mrcommon_fail4; } } @@ -1337,8 +1193,6 @@ tavor_mr_common_reg(tavor_state_t *state, tavor_pdhdl_t pd, status = tavor_mr_mtt_bind(state, bh, bind_dmahdl, &mtt, &mtt_pgsize_bits); if (status != DDI_SUCCESS) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(status, "failed mtt bind"); /* * When mtt_bind fails, freerbuf has already been done, * so make sure not to call it again. @@ -1358,8 +1212,6 @@ tavor_mr_common_reg(tavor_state_t *state, tavor_pdhdl_t pd, status = tavor_rsrc_alloc(state, TAVOR_REFCNT, 1, sleep, &mtt_refcnt); if (status != DDI_SUCCESS) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_INSUFF_RESOURCE, "failed refence count"); goto mrcommon_fail6; } mr->mr_mttrefcntp = mtt_refcnt; @@ -1408,11 +1260,6 @@ tavor_mr_common_reg(tavor_state_t *state, tavor_pdhdl_t pd, if (status != TAVOR_CMD_SUCCESS) { cmn_err(CE_CONT, "Tavor: SW2HW_MPT command failed: %08x\n", status); - TNF_PROBE_1(tavor_mr_common_reg_sw2hw_mpt_cmd_fail, - TAVOR_TNF_ERROR, "", tnf_uint, status, status); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(ibc_get_ci_failure(0), - "tavor SW2HW_MPT command"); goto mrcommon_fail7; } @@ -1443,7 +1290,6 @@ tavor_mr_common_reg(tavor_state_t *state, tavor_pdhdl_t pd, *mrhdl = mr; - TAVOR_TNF_EXIT(tavor_mr_common_reg); return (DDI_SUCCESS); /* @@ -1480,9 +1326,6 @@ mrcommon_fail2: mrcommon_fail1: tavor_pd_refcnt_dec(pd); mrcommon_fail: - TNF_PROBE_1(tavor_mr_common_reg_fail, TAVOR_TNF_ERROR, "", - tnf_string, msg, errormsg); - TAVOR_TNF_EXIT(tavor_mr_common_reg); return (status); } @@ -1669,9 +1512,6 @@ tavor_mr_mtt_bind(tavor_state_t *state, tavor_bind_info_t *bind, uint64_t nummtt; uint_t sleep; int status; - char *errormsg; - - TAVOR_TNF_ENTER(tavor_mr_common_reg); /* * Check the sleep flag. Ensure that it is consistent with the @@ -1681,8 +1521,6 @@ tavor_mr_mtt_bind(tavor_state_t *state, tavor_bind_info_t *bind, sleep = (bind->bi_flags & IBT_MR_NOSLEEP) ? TAVOR_NOSLEEP: TAVOR_SLEEP; if ((sleep == TAVOR_SLEEP) && (sleep != TAVOR_SLEEPFLAG_FOR_CONTEXT())) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_INVALID_PARAM, "invalid flags"); goto mrmttbind_fail; } @@ -1699,8 +1537,6 @@ tavor_mr_mtt_bind(tavor_state_t *state, tavor_bind_info_t *bind, */ status = tavor_mr_mem_bind(state, bind, bind_dmahdl, sleep); if (status != DDI_SUCCESS) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_INSUFF_RESOURCE, "failed mem bind"); goto mrmttbind_fail; } @@ -1724,8 +1560,6 @@ tavor_mr_mtt_bind(tavor_state_t *state, tavor_bind_info_t *bind, status = tavor_rsrc_alloc(state, TAVOR_MTT, TAVOR_NUMMTT_TO_MTTSEG(nummtt), sleep, mtt); if (status != DDI_SUCCESS) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_INSUFF_RESOURCE, "failed MTT"); goto mrmttbind_fail2; } @@ -1737,11 +1571,8 @@ tavor_mr_mtt_bind(tavor_state_t *state, tavor_bind_info_t *bind, */ status = tavor_mr_fast_mtt_write(*mtt, bind, *mtt_pgsize_bits); if (status != DDI_SUCCESS) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(ibc_get_ci_failure(0), "failed write mtt"); goto mrmttbind_fail3; } - TAVOR_TNF_EXIT(tavor_mr_mtt_bind); return (DDI_SUCCESS); /* @@ -1752,9 +1583,6 @@ mrmttbind_fail3: mrmttbind_fail2: tavor_mr_mem_unbind(state, bind); mrmttbind_fail: - TNF_PROBE_1(tavor_mr_mtt_bind_fail, TAVOR_TNF_ERROR, "", - tnf_string, msg, errormsg); - TAVOR_TNF_EXIT(tavor_mr_mtt_bind); return (status); } @@ -1767,8 +1595,6 @@ int tavor_mr_mtt_unbind(tavor_state_t *state, tavor_bind_info_t *bind, tavor_rsrc_t *mtt) { - TAVOR_TNF_ENTER(tavor_mr_mtt_unbind); - /* * Free up the MTT entries and unbind the memory. Here, as above, we * attempt to free these resources only if it is appropriate to do so. @@ -1776,7 +1602,6 @@ tavor_mr_mtt_unbind(tavor_state_t *state, tavor_bind_info_t *bind, tavor_mr_mem_unbind(state, bind); tavor_rsrc_free(state, &mtt); - TAVOR_TNF_EXIT(tavor_mr_mtt_unbind); return (DDI_SUCCESS); } @@ -1798,9 +1623,6 @@ tavor_mr_common_rereg(tavor_state_t *state, tavor_mrhdl_t mr, uint64_t mtt_addr_to_use, vaddr_to_use, len_to_use; uint_t sleep, dereg_level; int status; - char *errormsg; - - TAVOR_TNF_ENTER(tavor_mr_common_rereg); _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*bind)) @@ -1810,8 +1632,6 @@ tavor_mr_common_rereg(tavor_state_t *state, tavor_mrhdl_t mr, * currently supported. Return failure. XXX */ if (mr->mr_is_umem) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_MR_HDL_INVALID, "invalid mrhdl"); goto mrrereg_fail; } @@ -1832,8 +1652,6 @@ tavor_mr_common_rereg(tavor_state_t *state, tavor_mrhdl_t mr, if ((sleep == TAVOR_SLEEP) && (sleep != TAVOR_SLEEPFLAG_FOR_CONTEXT())) { mutex_exit(&mr->mr_lock); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_INVALID_PARAM, "invalid flags"); goto mrrereg_fail; } @@ -1855,7 +1673,6 @@ tavor_mr_common_rereg(tavor_state_t *state, tavor_mrhdl_t mr, if (status != TAVOR_CMD_SUCCESS) { mutex_exit(&mr->mr_lock); if (status == TAVOR_CMD_REG_BOUND) { - TAVOR_TNF_EXIT(tavor_mr_common_rereg); return (IBT_MR_IN_USE); } else { cmn_err(CE_CONT, "Tavor: HW2SW_MPT command failed: " @@ -1870,9 +1687,6 @@ tavor_mr_common_rereg(tavor_state_t *state, tavor_mrhdl_t mr, TAVOR_WARNING(state, "failed to deregister " "memory region"); } - TNF_PROBE_1(tavor_mr_common_rereg_hw2sw_mpt_cmd_fail, - TAVOR_TNF_ERROR, "", tnf_uint, status, status); - TAVOR_TNF_EXIT(tavor_mr_common_rereg); return (ibc_get_ci_failure(0)); } } @@ -1898,8 +1712,6 @@ tavor_mr_common_rereg(tavor_state_t *state, tavor_mrhdl_t mr, TAVOR_WARNING(state, "failed to deregister " "memory region"); } - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_PD_HDL_INVALID, "invalid PD handle"); goto mrrereg_fail; } @@ -1936,9 +1748,6 @@ tavor_mr_common_rereg(tavor_state_t *state, tavor_mrhdl_t mr, TAVOR_WARNING(state, "failed to deregister " "memory region"); } - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_MR_ACCESS_REQ_INVALID, - "invalid access flags"); goto mrrereg_fail; } @@ -1992,8 +1801,6 @@ tavor_mr_common_rereg(tavor_state_t *state, tavor_mrhdl_t mr, "memory region"); } - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(status, "failed rereg helper"); goto mrrereg_fail; } vaddr_to_use = mr->mr_bindinfo.bi_addr; @@ -2060,9 +1867,6 @@ tavor_mr_common_rereg(tavor_state_t *state, tavor_mrhdl_t mr, TAVOR_WARNING(state, "failed to deregister memory " "region"); } - TNF_PROBE_1(tavor_mr_common_rereg_sw2hw_mpt_cmd_fail, - TAVOR_TNF_ERROR, "", tnf_uint, status, status); - TAVOR_TNF_EXIT(tavor_mr_common_rereg); return (ibc_get_ci_failure(0)); } @@ -2089,13 +1893,9 @@ tavor_mr_common_rereg(tavor_state_t *state, tavor_mrhdl_t mr, *mrhdl_new = mr; mutex_exit(&mr->mr_lock); - TAVOR_TNF_EXIT(tavor_mr_common_rereg); return (DDI_SUCCESS); mrrereg_fail: - TNF_PROBE_1(tavor_mr_common_rereg_fail, TAVOR_TNF_ERROR, "", - tnf_string, msg, errormsg); - TAVOR_TNF_EXIT(tavor_mr_common_rereg); return (status); } @@ -2120,9 +1920,6 @@ tavor_mr_rereg_xlat_helper(tavor_state_t *state, tavor_mrhdl_t mr, uint64_t mtt_ddrbaseaddr; uint_t mtt_pgsize_bits, bind_type, reuse_dmahdl; int status; - char *errormsg; - - TAVOR_TNF_ENTER(tavor_mr_rereg_xlat_helper); ASSERT(MUTEX_HELD(&mr->mr_lock)); @@ -2154,8 +1951,6 @@ tavor_mr_rereg_xlat_helper(tavor_state_t *state, tavor_mrhdl_t mr, */ *dereg_level = TAVOR_MR_DEREG_NO_HW2SW_MPT; - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_MR_LEN_INVALID, "invalid length"); goto mrrereghelp_fail; } @@ -2237,8 +2032,6 @@ tavor_mr_rereg_xlat_helper(tavor_state_t *state, tavor_mrhdl_t mr, */ *dereg_level = TAVOR_MR_DEREG_NO_HW2SW_MPT_OR_UNBIND; - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_INSUFF_RESOURCE, "failed mem bind"); goto mrrereghelp_fail; } if (reuse_dmahdl) { @@ -2267,9 +2060,6 @@ tavor_mr_rereg_xlat_helper(tavor_state_t *state, tavor_mrhdl_t mr, tavor_mr_mem_unbind(state, bind); *dereg_level = TAVOR_MR_DEREG_NO_HW2SW_MPT_OR_UNBIND; - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(ibc_get_ci_failure(0), - "failed write mtt"); goto mrrereghelp_fail; } @@ -2338,8 +2128,6 @@ tavor_mr_rereg_xlat_helper(tavor_state_t *state, tavor_mrhdl_t mr, */ *dereg_level = TAVOR_MR_DEREG_NO_HW2SW_MPT_OR_UNBIND; - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_INSUFF_RESOURCE, "failed mem bind"); goto mrrereghelp_fail; } if (reuse_dmahdl) { @@ -2367,8 +2155,6 @@ tavor_mr_rereg_xlat_helper(tavor_state_t *state, tavor_mrhdl_t mr, tavor_mr_mem_unbind(state, bind); *dereg_level = TAVOR_MR_DEREG_NO_HW2SW_MPT_OR_UNBIND; - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_INSUFF_RESOURCE, "failed MTT"); goto mrrereghelp_fail; } @@ -2405,9 +2191,6 @@ tavor_mr_rereg_xlat_helper(tavor_state_t *state, tavor_mrhdl_t mr, *dereg_level = TAVOR_MR_DEREG_NO_HW2SW_MPT_OR_UNBIND; - /* Set "status"/"errormsg", goto failure */ - TAVOR_TNF_FAIL(IBT_INSUFF_RESOURCE, - "failed reference count"); goto mrrereghelp_fail; } swrc_new = (tavor_sw_refcnt_t *)mtt_refcnt->tr_addr; @@ -2444,8 +2227,6 @@ tavor_mr_rereg_xlat_helper(tavor_state_t *state, tavor_mrhdl_t mr, tavor_rsrc_free(state, &mtt); *dereg_level = TAVOR_MR_DEREG_NO_HW2SW_MPT_OR_UNBIND; - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_INSUFF_RESOURCE, "failed write mtt"); goto mrrereghelp_fail; } @@ -2480,13 +2261,9 @@ tavor_mr_rereg_xlat_helper(tavor_state_t *state, tavor_mrhdl_t mr, *mtt_addr = mtt_ddrbaseaddr + (mtt->tr_indx << TAVOR_MTT_SIZE_SHIFT); - TAVOR_TNF_EXIT(tavor_mr_rereg_xlat_helper); return (DDI_SUCCESS); mrrereghelp_fail: - TNF_PROBE_1(tavor_mr_rereg_xlat_helper_fail, TAVOR_TNF_ERROR, "", - tnf_string, msg, errormsg); - TAVOR_TNF_EXIT(tavor_mr_rereg_xlat_helper); return (status); } @@ -2535,8 +2312,6 @@ tavor_mr_mem_bind(tavor_state_t *state, tavor_bind_info_t *bind, bind->bi_type == TAVOR_BINDHDL_BUF || bind->bi_type == TAVOR_BINDHDL_UBUF); - TAVOR_TNF_ENTER(tavor_mr_mem_bind); - _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*bind)) /* Set the callback flag appropriately */ @@ -2576,9 +2351,6 @@ tavor_mr_mem_bind(tavor_state_t *state, tavor_bind_info_t *bind, status = ddi_dma_alloc_handle(state->ts_dip, &dma_attr, callback, NULL, &bind->bi_dmahdl); if (status != DDI_SUCCESS) { - TNF_PROBE_0(tavor_mr_mem_bind_dmahdl_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_mr_mem_bind); return (status); } bind->bi_free_dmahdl = 1; @@ -2609,13 +2381,9 @@ tavor_mr_mem_bind(tavor_state_t *state, tavor_bind_info_t *bind, if (bind->bi_free_dmahdl != 0) { ddi_dma_free_handle(&bind->bi_dmahdl); } - TNF_PROBE_0(tavor_mr_mem_bind_dmabind_fail, TAVOR_TNF_ERROR, - ""); - TAVOR_TNF_EXIT(tavor_mr_mem_bind); return (status); } - TAVOR_TNF_EXIT(tavor_mr_mem_bind); return (DDI_SUCCESS); } @@ -2629,8 +2397,6 @@ tavor_mr_mem_unbind(tavor_state_t *state, tavor_bind_info_t *bind) { int status; - TAVOR_TNF_ENTER(tavor_mr_mem_unbind); - /* * In case of TAVOR_BINDHDL_UBUF, the memory bi_buf points to * is actually allocated by ddi_umem_iosetup() internally, then @@ -2656,9 +2422,6 @@ tavor_mr_mem_unbind(tavor_state_t *state, tavor_bind_info_t *bind) status = ddi_dma_unbind_handle(bind->bi_dmahdl); if (status != DDI_SUCCESS) { TAVOR_WARNING(state, "failed to unbind DMA mapping"); - TNF_PROBE_0(tavor_mr_mem_unbind_dmaunbind_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_mr_mem_unbind); return; } @@ -2666,8 +2429,6 @@ tavor_mr_mem_unbind(tavor_state_t *state, tavor_bind_info_t *bind) if (bind->bi_free_dmahdl != 0) { ddi_dma_free_handle(&bind->bi_dmahdl); } - - TAVOR_TNF_EXIT(tavor_mr_mem_unbind); } @@ -2687,8 +2448,6 @@ tavor_mr_fast_mtt_write(tavor_rsrc_t *mtt, tavor_bind_info_t *bind, uint64_t pagesize; int i; - TAVOR_TNF_ENTER(tavor_mr_fast_mtt_write); - /* Calculate page size from the suggested value passed in */ pagesize = ((uint64_t)1 << mtt_pgsize_bits); @@ -2735,7 +2494,6 @@ tavor_mr_fast_mtt_write(tavor_rsrc_t *mtt, tavor_bind_info_t *bind, } } - TAVOR_TNF_EXIT(tavor_mr_fast_mtt_write); return (DDI_SUCCESS); } @@ -2753,8 +2511,6 @@ tavor_mtt_refcnt_inc(tavor_rsrc_t *rsrc) /* Increment the MTT's reference count */ mutex_enter(&rc->swrc_lock); - TNF_PROBE_1_DEBUG(tavor_mtt_refcnt_inc, TAVOR_TNF_TRACE, "", - tnf_uint, refcnt, rc->swrc_refcnt); cnt = rc->swrc_refcnt++; mutex_exit(&rc->swrc_lock); @@ -2777,8 +2533,6 @@ tavor_mtt_refcnt_dec(tavor_rsrc_t *rsrc) /* Decrement the MTT's reference count */ mutex_enter(&rc->swrc_lock); cnt = --rc->swrc_refcnt; - TNF_PROBE_1_DEBUG(tavor_mtt_refcnt_dec, TAVOR_TNF_TRACE, "", - tnf_uint, refcnt, rc->swrc_refcnt); mutex_exit(&rc->swrc_lock); return (cnt); diff --git a/usr/src/uts/common/io/ib/adapters/tavor/tavor_qp.c b/usr/src/uts/common/io/ib/adapters/tavor/tavor_qp.c index 7cf907a846..f80e0082b8 100644 --- a/usr/src/uts/common/io/ib/adapters/tavor/tavor_qp.c +++ b/usr/src/uts/common/io/ib/adapters/tavor/tavor_qp.c @@ -86,9 +86,6 @@ tavor_qp_alloc(tavor_state_t *state, tavor_qp_info_t *qpinfo, uint_t wq_location, dma_xfer_mode, qp_is_umap; uint_t qp_srq_en; int status, flag; - char *errormsg; - - TAVOR_TNF_ENTER(tavor_qp_alloc); _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*attr_p, *queuesz_p)) @@ -126,8 +123,6 @@ tavor_qp_alloc(tavor_state_t *state, tavor_qp_info_t *qpinfo, status = tavor_umap_db_find(state->ts_instance, ddi_get_pid(), MLNX_UMAP_UARPG_RSRC, &value, 0, NULL); if (status != DDI_SUCCESS) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_INVALID_PARAM, "failed UAR page"); goto qpalloc_fail; } uarpg = ((tavor_rsrc_t *)(uintptr_t)value)->tr_indx; @@ -142,9 +137,6 @@ tavor_qp_alloc(tavor_state_t *state, tavor_qp_info_t *qpinfo, * Check for valid SRQ handle pointers */ if (attr_p->qp_ibc_srq_hdl == NULL) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_SRQ_HDL_INVALID, - "invalid SRQ handle"); goto qpalloc_fail; } srq = (tavor_srqhdl_t)attr_p->qp_ibc_srq_hdl; @@ -155,8 +147,6 @@ tavor_qp_alloc(tavor_state_t *state, tavor_qp_info_t *qpinfo, */ if (((type != IBT_UD_RQP) && (type != IBT_RC_RQP) && (type != IBT_UC_RQP))) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_QP_SRV_TYPE_INVALID, "invalid serv type"); goto qpalloc_fail; } @@ -165,8 +155,6 @@ tavor_qp_alloc(tavor_state_t *state, tavor_qp_info_t *qpinfo, * limitation. Arbel native mode will not have this shortcoming. */ if (qp_srq_en && type != IBT_RC_RQP) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_INVALID_PARAM, "invalid serv type with SRQ"); goto qpalloc_fail; } @@ -174,8 +162,6 @@ tavor_qp_alloc(tavor_state_t *state, tavor_qp_info_t *qpinfo, * Check for valid PD handle pointer */ if (attr_p->qp_pd_hdl == NULL) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_PD_HDL_INVALID, "invalid PD handle"); goto qpalloc_fail; } pd = (tavor_pdhdl_t)attr_p->qp_pd_hdl; @@ -184,8 +170,6 @@ tavor_qp_alloc(tavor_state_t *state, tavor_qp_info_t *qpinfo, * If on an SRQ, check to make sure the PD is the same */ if (qp_srq_en && (pd->pd_pdnum != srq->srq_pdhdl->pd_pdnum)) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_PD_HDL_INVALID, "invalid PD handle"); goto qpalloc_fail; } @@ -197,8 +181,6 @@ tavor_qp_alloc(tavor_state_t *state, tavor_qp_info_t *qpinfo, */ if ((attr_p->qp_ibc_scq_hdl == NULL) || (attr_p->qp_ibc_rcq_hdl == NULL)) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_CQ_HDL_INVALID, "invalid CQ handle"); goto qpalloc_fail1; } sq_cq = (tavor_cqhdl_t)attr_p->qp_ibc_scq_hdl; @@ -211,14 +193,10 @@ tavor_qp_alloc(tavor_state_t *state, tavor_qp_info_t *qpinfo, */ status = tavor_cq_refcnt_inc(sq_cq, TAVOR_CQ_IS_NORMAL); if (status != DDI_SUCCESS) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_CQ_HDL_INVALID, "invalid CQ handle"); goto qpalloc_fail1; } status = tavor_cq_refcnt_inc(rq_cq, TAVOR_CQ_IS_NORMAL); if (status != DDI_SUCCESS) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_CQ_HDL_INVALID, "invalid CQ handle"); goto qpalloc_fail2; } @@ -233,8 +211,6 @@ tavor_qp_alloc(tavor_state_t *state, tavor_qp_info_t *qpinfo, */ status = tavor_rsrc_alloc(state, TAVOR_QPC, 1, sleepflag, &qpc); if (status != DDI_SUCCESS) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_INSUFF_RESOURCE, "failed QP context"); goto qpalloc_fail3; } @@ -245,8 +221,6 @@ tavor_qp_alloc(tavor_state_t *state, tavor_qp_info_t *qpinfo, */ status = tavor_rsrc_alloc(state, TAVOR_QPHDL, 1, sleepflag, &rsrc); if (status != DDI_SUCCESS) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_INSUFF_RESOURCE, "failed QP handle"); goto qpalloc_fail4; } qp = (tavor_qphdl_t)rsrc->tr_addr; @@ -259,8 +233,6 @@ tavor_qp_alloc(tavor_state_t *state, tavor_qp_info_t *qpinfo, */ status = tavor_qp_create_qpn(state, qp, qpc); if (status != DDI_SUCCESS) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_INSUFF_RESOURCE, "failed QPN create"); goto qpalloc_fail5; } @@ -275,8 +247,6 @@ tavor_qp_alloc(tavor_state_t *state, tavor_qp_info_t *qpinfo, umapdb = tavor_umap_db_alloc(state->ts_instance, qp->qp_qpnum, MLNX_UMAP_QPMEM_RSRC, (uint64_t)(uintptr_t)rsrc); if (umapdb == NULL) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_INSUFF_RESOURCE, "failed umap add"); goto qpalloc_fail6; } } @@ -297,8 +267,6 @@ tavor_qp_alloc(tavor_state_t *state, tavor_qp_info_t *qpinfo, status = tavor_rsrc_alloc(state, TAVOR_RDB, max_rdb, sleepflag, &rdb); if (status != DDI_SUCCESS) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_INSUFF_RESOURCE, "failed RDB"); goto qpalloc_fail7; } qp->qp_rdbrsrcp = rdb; @@ -333,8 +301,6 @@ tavor_qp_alloc(tavor_state_t *state, tavor_qp_info_t *qpinfo, if ((log_qp_sq_size > state->ts_cfg_profile->cp_log_max_qp_sz) || (!qp_srq_en && (log_qp_rq_size > state->ts_cfg_profile->cp_log_max_qp_sz))) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_HCA_WR_EXCEEDED, "max QP size"); goto qpalloc_fail8; } @@ -346,8 +312,6 @@ tavor_qp_alloc(tavor_state_t *state, tavor_qp_info_t *qpinfo, max_sgl = state->ts_cfg_profile->cp_wqe_real_max_sgl; if ((attr_p->qp_sizes.cs_sq_sgl > max_sgl) || (!qp_srq_en && (attr_p->qp_sizes.cs_rq_sgl > max_sgl))) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_HCA_SGL_EXCEEDED, "max QP SGL"); goto qpalloc_fail8; } @@ -419,8 +383,6 @@ tavor_qp_alloc(tavor_state_t *state, tavor_qp_info_t *qpinfo, } status = tavor_queue_alloc(state, &qp->qp_wqinfo, sleepflag); if (status != DDI_SUCCESS) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_INSUFF_RESOURCE, "failed work queue"); goto qpalloc_fail8; } if (sq_wqe_size > rq_wqe_size) { @@ -479,8 +441,6 @@ tavor_qp_alloc(tavor_state_t *state, tavor_qp_info_t *qpinfo, mr_op.mro_bind_override_addr = 1; status = tavor_mr_register(state, pd, &mr_attr, &mr, &mr_op); if (status != DDI_SUCCESS) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_INSUFF_RESOURCE, "failed register mr"); goto qpalloc_fail9; } @@ -595,7 +555,6 @@ tavor_qp_alloc(tavor_state_t *state, tavor_qp_info_t *qpinfo, *qphdl = qp; - TAVOR_TNF_EXIT(tavor_qp_alloc); return (DDI_SUCCESS); /* @@ -631,9 +590,6 @@ qpalloc_fail2: qpalloc_fail1: tavor_pd_refcnt_dec(pd); qpalloc_fail: - TNF_PROBE_1(tavor_qp_alloc_fail, TAVOR_TNF_ERROR, "", - tnf_string, msg, errormsg); - TAVOR_TNF_EXIT(tavor_qp_alloc); return (status); } @@ -667,9 +623,6 @@ tavor_special_qp_alloc(tavor_state_t *state, tavor_qp_info_t *qpinfo, uint32_t sq_wqe_size, rq_wqe_size; uint_t wq_location, dma_xfer_mode; int status, flag; - char *errormsg; - - TAVOR_TNF_ENTER(tavor_special_qp_alloc); /* * Check the "options" flag. Currently this flag tells the driver @@ -696,8 +649,6 @@ tavor_special_qp_alloc(tavor_state_t *state, tavor_qp_info_t *qpinfo, * Check for valid special QP type (only SMI & GSI supported) */ if ((type != IBT_SMI_SQP) && (type != IBT_GSI_SQP)) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_QP_SPECIAL_TYPE_INVALID, "invalid QP type"); goto spec_qpalloc_fail; } @@ -705,8 +656,6 @@ tavor_special_qp_alloc(tavor_state_t *state, tavor_qp_info_t *qpinfo, * Check for valid port number */ if (!tavor_portnum_is_valid(state, port)) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_HCA_PORT_INVALID, "invalid port num"); goto spec_qpalloc_fail; } port = port - 1; @@ -715,8 +664,6 @@ tavor_special_qp_alloc(tavor_state_t *state, tavor_qp_info_t *qpinfo, * Check for valid PD handle pointer */ if (attr_p->qp_pd_hdl == NULL) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_PD_HDL_INVALID, "invalid PD handle"); goto spec_qpalloc_fail; } pd = (tavor_pdhdl_t)attr_p->qp_pd_hdl; @@ -729,8 +676,6 @@ tavor_special_qp_alloc(tavor_state_t *state, tavor_qp_info_t *qpinfo, */ if ((attr_p->qp_ibc_scq_hdl == NULL) || (attr_p->qp_ibc_rcq_hdl == NULL)) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_CQ_HDL_INVALID, "invalid CQ handle"); goto spec_qpalloc_fail1; } sq_cq = (tavor_cqhdl_t)attr_p->qp_ibc_scq_hdl; @@ -743,14 +688,10 @@ tavor_special_qp_alloc(tavor_state_t *state, tavor_qp_info_t *qpinfo, */ status = tavor_cq_refcnt_inc(sq_cq, TAVOR_CQ_IS_SPECIAL); if (status != DDI_SUCCESS) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_CQ_HDL_INVALID, "invalid CQ handle"); goto spec_qpalloc_fail1; } status = tavor_cq_refcnt_inc(rq_cq, TAVOR_CQ_IS_SPECIAL); if (status != DDI_SUCCESS) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_CQ_HDL_INVALID, "invalid CQ handle"); goto spec_qpalloc_fail2; } @@ -768,8 +709,6 @@ tavor_special_qp_alloc(tavor_state_t *state, tavor_qp_info_t *qpinfo, */ status = tavor_special_qp_rsrc_alloc(state, type, port, &qpc); if (status != DDI_SUCCESS) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(status, "failed special QP rsrc"); goto spec_qpalloc_fail3; } @@ -780,8 +719,6 @@ tavor_special_qp_alloc(tavor_state_t *state, tavor_qp_info_t *qpinfo, */ status = tavor_rsrc_alloc(state, TAVOR_QPHDL, 1, sleepflag, &rsrc); if (status != DDI_SUCCESS) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_INSUFF_RESOURCE, "failed QP handle"); goto spec_qpalloc_fail4; } qp = (tavor_qphdl_t)rsrc->tr_addr; @@ -818,8 +755,6 @@ tavor_special_qp_alloc(tavor_state_t *state, tavor_qp_info_t *qpinfo, */ if ((log_qp_sq_size > state->ts_cfg_profile->cp_log_max_qp_sz) || (log_qp_rq_size > state->ts_cfg_profile->cp_log_max_qp_sz)) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_HCA_WR_EXCEEDED, "max QP size"); goto spec_qpalloc_fail5; } @@ -831,8 +766,6 @@ tavor_special_qp_alloc(tavor_state_t *state, tavor_qp_info_t *qpinfo, max_sgl = state->ts_cfg_profile->cp_wqe_real_max_sgl; if ((attr_p->qp_sizes.cs_sq_sgl > max_sgl) || (attr_p->qp_sizes.cs_rq_sgl > max_sgl)) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_HCA_SGL_EXCEEDED, "max QP SGL"); goto spec_qpalloc_fail5; } @@ -889,8 +822,6 @@ tavor_special_qp_alloc(tavor_state_t *state, tavor_qp_info_t *qpinfo, qp->qp_wqinfo.qa_location = wq_location; status = tavor_queue_alloc(state, &qp->qp_wqinfo, sleepflag); if (status != 0) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_INSUFF_RESOURCE, "failed work queue"); goto spec_qpalloc_fail5; } if (sq_wqe_size > rq_wqe_size) { @@ -936,8 +867,6 @@ tavor_special_qp_alloc(tavor_state_t *state, tavor_qp_info_t *qpinfo, mr_op.mro_bind_override_addr = 1; status = tavor_mr_register(state, pd, &mr_attr, &mr, &mr_op); if (status != DDI_SUCCESS) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_INSUFF_RESOURCE, "failed register mr"); goto spec_qpalloc_fail6; } @@ -1010,7 +939,6 @@ tavor_special_qp_alloc(tavor_state_t *state, tavor_qp_info_t *qpinfo, *qphdl = qp; - TAVOR_TNF_EXIT(tavor_special_qp_alloc); return (DDI_SUCCESS); /* @@ -1031,9 +959,6 @@ spec_qpalloc_fail2: spec_qpalloc_fail1: tavor_pd_refcnt_dec(pd); spec_qpalloc_fail: - TNF_PROBE_1(tavor_special_qp_alloc_fail, TAVOR_TNF_ERROR, "", - tnf_string, msg, errormsg); - TAVOR_TNF_EXIT(tavor_special_qp_alloc); return (status); } @@ -1065,9 +990,6 @@ tavor_qp_free(tavor_state_t *state, tavor_qphdl_t *qphdl, uint_t maxprot; uint_t qp_srq_en; int status; - char *errormsg; - - TAVOR_TNF_ENTER(tavor_qp_free); /* * Pull all the necessary information from the Tavor Queue Pair @@ -1092,7 +1014,6 @@ tavor_qp_free(tavor_state_t *state, tavor_qphdl_t *qphdl, */ if (qp->qp_mcg_refcnt != 0) { mutex_exit(&qp->qp_lock); - TAVOR_TNF_FAIL(ibc_get_ci_failure(0), "QP part of MCG on free"); goto qpfree_fail; } @@ -1108,9 +1029,6 @@ tavor_qp_free(tavor_state_t *state, tavor_qphdl_t *qphdl, if (tavor_qp_to_reset(state, qp) != DDI_SUCCESS) { mutex_exit(&qp->qp_lock); TAVOR_WARNING(state, "failed to reset QP context"); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(ibc_get_ci_failure(0), - "reset QP context"); goto qpfree_fail; } qp->qp_state = TAVOR_QP_RESET; @@ -1137,7 +1055,6 @@ tavor_qp_free(tavor_state_t *state, tavor_qphdl_t *qphdl, if (status != DDI_SUCCESS) { mutex_exit(&qp->qp_lock); TAVOR_WARNING(state, "failed to find in database"); - TAVOR_TNF_EXIT(tavor_qp_free); return (ibc_get_ci_failure(0)); } tavor_umap_db_free(umapdb); @@ -1150,7 +1067,6 @@ tavor_qp_free(tavor_state_t *state, tavor_qphdl_t *qphdl, mutex_exit(&qp->qp_lock); TAVOR_WARNING(state, "failed in QP memory " "devmap_devmem_remap()"); - TAVOR_TNF_EXIT(tavor_qp_free); return (ibc_get_ci_failure(0)); } qp->qp_umap_dhp = (devmap_cookie_t)NULL; @@ -1194,8 +1110,6 @@ tavor_qp_free(tavor_state_t *state, tavor_qphdl_t *qphdl, sleepflag); if (status != DDI_SUCCESS) { TAVOR_WARNING(state, "failed to deregister QP memory"); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(ibc_get_ci_failure(0), "failed deregister mr"); goto qpfree_fail; } @@ -1218,9 +1132,6 @@ tavor_qp_free(tavor_state_t *state, tavor_qphdl_t *qphdl, status = tavor_special_qp_rsrc_free(state, type, port); if (status != DDI_SUCCESS) { TAVOR_WARNING(state, "failed to free special QP rsrc"); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(ibc_get_ci_failure(0), - "failed special QP rsrc"); goto qpfree_fail; } @@ -1261,13 +1172,9 @@ tavor_qp_free(tavor_state_t *state, tavor_qphdl_t *qphdl, /* Set the qphdl pointer to NULL and return success */ *qphdl = NULL; - TAVOR_TNF_EXIT(tavor_qp_free); return (DDI_SUCCESS); qpfree_fail: - TNF_PROBE_1(tavor_qp_free_fail, TAVOR_TNF_ERROR, "", - tnf_string, msg, errormsg); - TAVOR_TNF_EXIT(tavor_qp_free); return (status); } @@ -1290,8 +1197,6 @@ tavor_qp_query(tavor_state_t *state, tavor_qphdl_t qp, tavor_hw_qpc_t *qpc; int status; - TAVOR_TNF_ENTER(tavor_qp_query); - mutex_enter(&qp->qp_lock); /* @@ -1328,9 +1233,6 @@ tavor_qp_query(tavor_state_t *state, tavor_qphdl_t qp, break; default: mutex_exit(&qp->qp_lock); - TNF_PROBE_1(tavor_qp_query_inv_qpstate_fail, - TAVOR_TNF_ERROR, "", tnf_uint, qpstate, qp->qp_state); - TAVOR_TNF_EXIT(tavor_qp_query); return (ibc_get_ci_failure(0)); } attr_p->qp_info.qp_state = qp_state; @@ -1361,7 +1263,6 @@ tavor_qp_query(tavor_state_t *state, tavor_qphdl_t qp, */ if (qp_state == IBT_STATE_RESET) { mutex_exit(&qp->qp_lock); - TAVOR_TNF_EXIT(tavor_qp_query); return (DDI_SUCCESS); } @@ -1379,9 +1280,6 @@ tavor_qp_query(tavor_state_t *state, tavor_qphdl_t qp, mutex_exit(&qp->qp_lock); cmn_err(CE_CONT, "Tavor: QUERY_QP command failed: %08x\n", status); - TNF_PROBE_1(tavor_qp_query_cmd_fail, TAVOR_TNF_ERROR, "", - tnf_uint, status, status); - TAVOR_TNF_EXIT(tavor_qp_query); return (ibc_get_ci_failure(0)); } @@ -1524,7 +1422,6 @@ tavor_qp_query(tavor_state_t *state, tavor_qphdl_t qp, } mutex_exit(&qp->qp_lock); - TAVOR_TNF_EXIT(tavor_qp_query); return (DDI_SUCCESS); } @@ -1540,8 +1437,6 @@ tavor_qp_create_qpn(tavor_state_t *state, tavor_qphdl_t qp, tavor_rsrc_t *qpc) tavor_qpn_entry_t *entry; avl_index_t where; - TAVOR_TNF_ENTER(tavor_qp_create_qpn); - /* * Build a query (for the AVL tree lookup) and attempt to find * a previously added entry that has a matching QPC index. If @@ -1563,7 +1458,6 @@ tavor_qp_create_qpn(tavor_state_t *state, tavor_qphdl_t qp, tavor_rsrc_t *qpc) sizeof (tavor_qpn_entry_t), KM_NOSLEEP); if (entry == NULL) { mutex_exit(&state->ts_qpn_avl_lock); - TAVOR_TNF_EXIT(tavor_qp_create_qpn); return (DDI_FAILURE); } _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*entry)) @@ -1599,7 +1493,6 @@ tavor_qp_create_qpn(tavor_state_t *state, tavor_qphdl_t qp, tavor_rsrc_t *qpc) entry->qpn_refcnt++; mutex_exit(&state->ts_qpn_avl_lock); - TAVOR_TNF_EXIT(tavor_qp_create_qpn); return (DDI_SUCCESS); } @@ -1611,8 +1504,6 @@ tavor_qp_create_qpn(tavor_state_t *state, tavor_qphdl_t qp, tavor_rsrc_t *qpc) void tavor_qp_release_qpn(tavor_state_t *state, tavor_qpn_entry_t *entry, int flags) { - TAVOR_TNF_ENTER(tavor_qp_release_qpn); - ASSERT(entry != NULL); mutex_enter(&state->ts_qpn_avl_lock); @@ -1676,8 +1567,6 @@ tavor_qp_release_qpn(tavor_state_t *state, tavor_qpn_entry_t *entry, int flags) } } mutex_exit(&state->ts_qpn_avl_lock); - - TAVOR_TNF_EXIT(tavor_qp_release_qpn); } @@ -1690,19 +1579,14 @@ tavor_qpn_avl_compare(const void *q, const void *e) { tavor_qpn_entry_t *entry, *query; - TAVOR_TNF_ENTER(tavor_qpn_avl_compare); - entry = (tavor_qpn_entry_t *)e; query = (tavor_qpn_entry_t *)q; if (query->qpn_indx < entry->qpn_indx) { - TAVOR_TNF_EXIT(tavor_qpn_avl_compare); return (-1); } else if (query->qpn_indx > entry->qpn_indx) { - TAVOR_TNF_EXIT(tavor_qpn_avl_compare); return (+1); } else { - TAVOR_TNF_EXIT(tavor_qpn_avl_compare); return (0); } } @@ -1715,8 +1599,6 @@ tavor_qpn_avl_compare(const void *q, const void *e) void tavor_qpn_avl_init(tavor_state_t *state) { - TAVOR_TNF_ENTER(tavor_qpn_avl_init); - /* Initialize the lock used for QP number (QPN) AVL tree access */ mutex_init(&state->ts_qpn_avl_lock, NULL, MUTEX_DRIVER, DDI_INTR_PRI(state->ts_intrmsi_pri)); @@ -1725,8 +1607,6 @@ tavor_qpn_avl_init(tavor_state_t *state) avl_create(&state->ts_qpn_avl, tavor_qpn_avl_compare, sizeof (tavor_qpn_entry_t), offsetof(tavor_qpn_entry_t, qpn_avlnode)); - - TAVOR_TNF_EXIT(tavor_qpn_avl_init); } @@ -1740,8 +1620,6 @@ tavor_qpn_avl_fini(tavor_state_t *state) tavor_qpn_entry_t *entry; void *cookie; - TAVOR_TNF_ENTER(tavor_qpn_avl_fini); - /* * Empty all entries (if necessary) and destroy the AVL tree * that was used for QP number (QPN) tracking. @@ -1755,8 +1633,6 @@ tavor_qpn_avl_fini(tavor_state_t *state) /* Destroy the lock used for QP number (QPN) AVL tree access */ mutex_destroy(&state->ts_qpn_avl_lock); - - TAVOR_TNF_EXIT(tavor_qpn_avl_fini); } @@ -1802,8 +1678,6 @@ tavor_special_qp_rsrc_alloc(tavor_state_t *state, ibt_sqp_type_t type, uint_t mask, flags; int status; - TAVOR_TNF_ENTER(tavor_special_qp_rsrc_alloc); - mutex_enter(&state->ts_spec_qplock); flags = state->ts_spec_qpflags; if (type == IBT_SMI_SQP) { @@ -1818,9 +1692,6 @@ tavor_special_qp_rsrc_alloc(tavor_state_t *state, ibt_sqp_type_t type, */ if (state->ts_cfg_profile->cp_qp0_agents_in_fw != 0) { mutex_exit(&state->ts_spec_qplock); - TNF_PROBE_0(tavor_special_qp0_alloc_already_in_fw, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_special_qp_rsrc_alloc); return (IBT_QP_IN_USE); } @@ -1836,10 +1707,6 @@ tavor_special_qp_rsrc_alloc(tavor_state_t *state, ibt_sqp_type_t type, mutex_exit(&state->ts_spec_qplock); cmn_err(CE_CONT, "Tavor: CONF_SPECIAL_QP " "command failed: %08x\n", status); - TNF_PROBE_1(tavor_conf_special_qp_cmd_fail, - TAVOR_TNF_ERROR, "", tnf_uint, status, - status); - TAVOR_TNF_EXIT(tavor_special_qp_rsrc_alloc); return (IBT_INSUFF_RESOURCE); } } @@ -1851,9 +1718,6 @@ tavor_special_qp_rsrc_alloc(tavor_state_t *state, ibt_sqp_type_t type, mask = (1 << (TAVOR_SPECIAL_QP0_RSRC + port)); if (flags & mask) { mutex_exit(&state->ts_spec_qplock); - TNF_PROBE_1(tavor_ts_spec_qp0_alloc_already, - TAVOR_TNF_ERROR, "", tnf_uint, port, port); - TAVOR_TNF_EXIT(tavor_special_qp_rsrc_alloc); return (IBT_QP_IN_USE); } state->ts_spec_qpflags |= mask; @@ -1872,10 +1736,6 @@ tavor_special_qp_rsrc_alloc(tavor_state_t *state, ibt_sqp_type_t type, mutex_exit(&state->ts_spec_qplock); cmn_err(CE_CONT, "Tavor: CONF_SPECIAL_QP " "command failed: %08x\n", status); - TNF_PROBE_1(tavor_conf_special_qp_cmd_fail, - TAVOR_TNF_ERROR, "", tnf_uint, status, - status); - TAVOR_TNF_EXIT(tavor_special_qp_rsrc_alloc); return (IBT_INSUFF_RESOURCE); } } @@ -1887,9 +1747,6 @@ tavor_special_qp_rsrc_alloc(tavor_state_t *state, ibt_sqp_type_t type, mask = (1 << (TAVOR_SPECIAL_QP1_RSRC + port)); if (flags & mask) { mutex_exit(&state->ts_spec_qplock); - TNF_PROBE_0(tavor_ts_spec_qp1_alloc_already, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_special_qp_rsrc_alloc); return (IBT_QP_IN_USE); } state->ts_spec_qpflags |= mask; @@ -1897,7 +1754,6 @@ tavor_special_qp_rsrc_alloc(tavor_state_t *state, ibt_sqp_type_t type, } mutex_exit(&state->ts_spec_qplock); - TAVOR_TNF_EXIT(tavor_special_qp_rsrc_alloc); return (DDI_SUCCESS); } @@ -1913,8 +1769,6 @@ tavor_special_qp_rsrc_free(tavor_state_t *state, ibt_sqp_type_t type, uint_t mask, flags; int status; - TAVOR_TNF_ENTER(tavor_special_qp_rsrc_free); - mutex_enter(&state->ts_spec_qplock); if (type == IBT_SMI_SQP) { mask = (1 << (TAVOR_SPECIAL_QP0_RSRC + port)); @@ -1932,10 +1786,6 @@ tavor_special_qp_rsrc_free(tavor_state_t *state, ibt_sqp_type_t type, mutex_exit(&state->ts_spec_qplock); cmn_err(CE_CONT, "Tavor: CONF_SPECIAL_QP " "command failed: %08x\n", status); - TNF_PROBE_1(tavor_conf_special_qp_cmd_fail, - TAVOR_TNF_ERROR, "", tnf_uint, status, - status); - TAVOR_TNF_EXIT(tavor_special_qp_rsrc_free); return (ibc_get_ci_failure(0)); } } @@ -1955,17 +1805,12 @@ tavor_special_qp_rsrc_free(tavor_state_t *state, ibt_sqp_type_t type, mutex_exit(&state->ts_spec_qplock); cmn_err(CE_CONT, "Tavor: CONF_SPECIAL_QP " "command failed: %08x\n", status); - TNF_PROBE_1(tavor_conf_special_qp_cmd_fail, - TAVOR_TNF_ERROR, "", tnf_uint, status, - status); - TAVOR_TNF_EXIT(tavor_special_qp_rsrc_free); return (ibc_get_ci_failure(0)); } } } mutex_exit(&state->ts_spec_qplock); - TAVOR_TNF_EXIT(tavor_special_qp_rsrc_free); return (DDI_SUCCESS); } @@ -1980,8 +1825,6 @@ tavor_qp_sgl_to_logwqesz(tavor_state_t *state, uint_t num_sgl, { uint_t max_size, log2, actual_sgl; - TAVOR_TNF_ENTER(tavor_qp_sgl_to_logwqesz); - switch (wq_type) { case TAVOR_QP_WQ_TYPE_SENDQ: /* @@ -2063,14 +1906,10 @@ tavor_qp_sgl_to_logwqesz(tavor_state_t *state, uint_t num_sgl, default: TAVOR_WARNING(state, "unexpected work queue type"); - TNF_PROBE_0(tavor_qp_sgl_to_logwqesz_inv_wqtype_fail, - TAVOR_TNF_ERROR, ""); break; } /* Fill in the return values */ *logwqesz = log2; *max_sgl = min(state->ts_cfg_profile->cp_wqe_real_max_sgl, actual_sgl); - - TAVOR_TNF_EXIT(tavor_qp_sgl_to_logwqesz); } diff --git a/usr/src/uts/common/io/ib/adapters/tavor/tavor_qpmod.c b/usr/src/uts/common/io/ib/adapters/tavor/tavor_qpmod.c index 3553f70d01..8e99020ebb 100644 --- a/usr/src/uts/common/io/ib/adapters/tavor/tavor_qpmod.c +++ b/usr/src/uts/common/io/ib/adapters/tavor/tavor_qpmod.c @@ -86,9 +86,6 @@ tavor_qp_modify(tavor_state_t *state, tavor_qphdl_t qp, ibt_cep_state_t cur_state, mod_state; ibt_cep_modify_flags_t okflags; int status; - char *errormsg; - - TAVOR_TNF_ENTER(tavor_qp_modify); /* * Lock the QP so that we can modify it atomically. After grabbing @@ -119,10 +116,6 @@ tavor_qp_modify(tavor_state_t *state, tavor_qphdl_t qp, */ if (!(TAVOR_QP_TYPE_VALID(info_p->qp_trans, qp->qp_serv_type))) { mutex_exit(&qp->qp_lock); - TNF_PROBE_1(tavor_qp_modify_inv_qp_trans_fail, - TAVOR_TNF_ERROR, "", tnf_uint, qptrans, - info_p->qp_trans); - TAVOR_TNF_EXIT(tavor_qp_modify); return (IBT_QP_SRV_TYPE_INVALID); } @@ -158,10 +151,6 @@ tavor_qp_modify(tavor_state_t *state, tavor_qphdl_t qp, break; default: mutex_exit(&qp->qp_lock); - TNF_PROBE_1(tavor_qp_modify_inv_currqpstate_fail, - TAVOR_TNF_ERROR, "", tnf_uint, qpstate, - info_p->qp_current_state); - TAVOR_TNF_EXIT(tavor_qp_modify); return (IBT_QP_STATE_INVALID); } } else { @@ -181,8 +170,6 @@ tavor_qp_modify(tavor_state_t *state, tavor_qphdl_t qp, */ if (flags & ~okflags) { mutex_exit(&qp->qp_lock); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_QP_ATTR_RO, "reset: invalid flag"); goto qpmod_fail; } @@ -195,9 +182,6 @@ tavor_qp_modify(tavor_state_t *state, tavor_qphdl_t qp, (mod_state != IBT_STATE_INIT)) { /* Invalid transition - ambiguous flags */ mutex_exit(&qp->qp_lock); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_QP_STATE_INVALID, - "reset: ambiguous flags"); goto qpmod_fail; } else if ((flags & IBT_CEP_SET_RESET_INIT) || @@ -209,8 +193,6 @@ tavor_qp_modify(tavor_state_t *state, tavor_qphdl_t qp, status = tavor_qp_reset2init(state, qp, info_p); if (status != DDI_SUCCESS) { mutex_exit(&qp->qp_lock); - /* Set "status"/"errormsg", goto failure */ - TAVOR_TNF_FAIL(status, "reset to init"); goto qpmod_fail; } qp->qp_state = TAVOR_QP_INIT; @@ -229,9 +211,6 @@ tavor_qp_modify(tavor_state_t *state, tavor_qphdl_t qp, * _out_ of the "Reset" state. */ mutex_exit(&qp->qp_lock); - TNF_PROBE_0_DEBUG(tavor_qp_modify_rst2rst, - TAVOR_TNF_TRACE, ""); - TAVOR_TNF_EXIT(tavor_qp_modify); return (DDI_SUCCESS); } else if ((flags & IBT_CEP_SET_STATE) && @@ -242,8 +221,6 @@ tavor_qp_modify(tavor_state_t *state, tavor_qphdl_t qp, status = tavor_qp_reset2err(state, qp); if (status != DDI_SUCCESS) { mutex_exit(&qp->qp_lock); - /* Set "status"/"errormsg", goto failure */ - TAVOR_TNF_FAIL(status, "reset to error"); goto qpmod_fail; } qp->qp_state = TAVOR_QP_ERR; @@ -251,9 +228,6 @@ tavor_qp_modify(tavor_state_t *state, tavor_qphdl_t qp, } else { /* Invalid transition - return error */ mutex_exit(&qp->qp_lock); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_QP_STATE_INVALID, - "reset: invalid transition"); goto qpmod_fail; } @@ -274,8 +248,6 @@ tavor_qp_modify(tavor_state_t *state, tavor_qphdl_t qp, qp->qp_state = TAVOR_QP_RESET; mutex_exit(&qp->qp_lock); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(status, "reset: wrid_from_reset hdl"); goto qpmod_fail; } break; @@ -294,8 +266,6 @@ tavor_qp_modify(tavor_state_t *state, tavor_qphdl_t qp, */ if (flags & ~okflags) { mutex_exit(&qp->qp_lock); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_QP_ATTR_RO, "init: invalid flag"); goto qpmod_fail; } @@ -308,9 +278,6 @@ tavor_qp_modify(tavor_state_t *state, tavor_qphdl_t qp, (mod_state != IBT_STATE_RTR)) { /* Invalid transition - ambiguous flags */ mutex_exit(&qp->qp_lock); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_QP_STATE_INVALID, - "init: ambiguous flags"); goto qpmod_fail; } else if ((flags & IBT_CEP_SET_INIT_RTR) || @@ -322,8 +289,6 @@ tavor_qp_modify(tavor_state_t *state, tavor_qphdl_t qp, status = tavor_qp_init2rtr(state, qp, flags, info_p); if (status != DDI_SUCCESS) { mutex_exit(&qp->qp_lock); - /* Set "status"/"errormsg", goto failure */ - TAVOR_TNF_FAIL(status, "init to rtr"); goto qpmod_fail; } qp->qp_state = TAVOR_QP_RTR; @@ -336,8 +301,6 @@ tavor_qp_modify(tavor_state_t *state, tavor_qphdl_t qp, status = tavor_qp_init2init(state, qp, flags, info_p); if (status != DDI_SUCCESS) { mutex_exit(&qp->qp_lock); - /* Set "status"/"errormsg", goto failure */ - TAVOR_TNF_FAIL(status, "init to init"); goto qpmod_fail; } qp->qp_state = TAVOR_QP_INIT; @@ -350,8 +313,6 @@ tavor_qp_modify(tavor_state_t *state, tavor_qphdl_t qp, status = tavor_qp_to_reset(state, qp); if (status != DDI_SUCCESS) { mutex_exit(&qp->qp_lock); - /* Set "status"/"errormsg", goto failure */ - TAVOR_TNF_FAIL(status, "init to reset"); goto qpmod_fail; } qp->qp_state = TAVOR_QP_RESET; @@ -371,8 +332,6 @@ tavor_qp_modify(tavor_state_t *state, tavor_qphdl_t qp, status = tavor_qp_to_error(state, qp); if (status != DDI_SUCCESS) { mutex_exit(&qp->qp_lock); - /* Set "status"/"errormsg", goto failure */ - TAVOR_TNF_FAIL(status, "init to error"); goto qpmod_fail; } qp->qp_state = TAVOR_QP_ERR; @@ -380,9 +339,6 @@ tavor_qp_modify(tavor_state_t *state, tavor_qphdl_t qp, } else { /* Invalid transition - return error */ mutex_exit(&qp->qp_lock); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_QP_STATE_INVALID, - "init: invalid transition"); goto qpmod_fail; } break; @@ -402,8 +358,6 @@ tavor_qp_modify(tavor_state_t *state, tavor_qphdl_t qp, */ if (flags & ~okflags) { mutex_exit(&qp->qp_lock); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_QP_ATTR_RO, "rtr: invalid flag"); goto qpmod_fail; } @@ -416,9 +370,6 @@ tavor_qp_modify(tavor_state_t *state, tavor_qphdl_t qp, (mod_state != IBT_STATE_RTS)) { /* Invalid transition - ambiguous flags */ mutex_exit(&qp->qp_lock); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_QP_STATE_INVALID, - "reset: ambiguous flags"); goto qpmod_fail; } else if ((flags & IBT_CEP_SET_RTR_RTS) || @@ -430,8 +381,6 @@ tavor_qp_modify(tavor_state_t *state, tavor_qphdl_t qp, status = tavor_qp_rtr2rts(state, qp, flags, info_p); if (status != DDI_SUCCESS) { mutex_exit(&qp->qp_lock); - /* Set "status"/"errormsg", goto failure */ - TAVOR_TNF_FAIL(status, "rtr to rts"); goto qpmod_fail; } qp->qp_state = TAVOR_QP_RTS; @@ -444,8 +393,6 @@ tavor_qp_modify(tavor_state_t *state, tavor_qphdl_t qp, status = tavor_qp_to_reset(state, qp); if (status != DDI_SUCCESS) { mutex_exit(&qp->qp_lock); - /* Set "status"/"errormsg", goto failure */ - TAVOR_TNF_FAIL(status, "rtr to reset"); goto qpmod_fail; } qp->qp_state = TAVOR_QP_RESET; @@ -465,8 +412,6 @@ tavor_qp_modify(tavor_state_t *state, tavor_qphdl_t qp, status = tavor_qp_to_error(state, qp); if (status != DDI_SUCCESS) { mutex_exit(&qp->qp_lock); - /* Set "status"/"errormsg", goto failure */ - TAVOR_TNF_FAIL(status, "rtr to error"); goto qpmod_fail; } qp->qp_state = TAVOR_QP_ERR; @@ -474,9 +419,6 @@ tavor_qp_modify(tavor_state_t *state, tavor_qphdl_t qp, } else { /* Invalid transition - return error */ mutex_exit(&qp->qp_lock); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_QP_STATE_INVALID, - "rtr: invalid transition"); goto qpmod_fail; } break; @@ -494,8 +436,6 @@ tavor_qp_modify(tavor_state_t *state, tavor_qphdl_t qp, */ if (flags & ~okflags) { mutex_exit(&qp->qp_lock); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_QP_ATTR_RO, "rts: invalid flag"); goto qpmod_fail; } @@ -511,8 +451,6 @@ tavor_qp_modify(tavor_state_t *state, tavor_qphdl_t qp, status = tavor_qp_rts2rts(state, qp, flags, info_p); if (status != DDI_SUCCESS) { mutex_exit(&qp->qp_lock); - /* Set "status"/"errormsg", goto failure */ - TAVOR_TNF_FAIL(status, "rts to rts"); goto qpmod_fail; } /* qp->qp_state = TAVOR_QP_RTS; */ @@ -525,8 +463,6 @@ tavor_qp_modify(tavor_state_t *state, tavor_qphdl_t qp, status = tavor_qp_rts2sqd(state, qp, flags); if (status != DDI_SUCCESS) { mutex_exit(&qp->qp_lock); - /* Set "status"/"errormsg", goto failure */ - TAVOR_TNF_FAIL(status, "rts to sqd"); goto qpmod_fail; } qp->qp_state = TAVOR_QP_SQD; @@ -539,8 +475,6 @@ tavor_qp_modify(tavor_state_t *state, tavor_qphdl_t qp, status = tavor_qp_to_reset(state, qp); if (status != DDI_SUCCESS) { mutex_exit(&qp->qp_lock); - /* Set "status"/"errormsg", goto failure */ - TAVOR_TNF_FAIL(status, "rts to reset"); goto qpmod_fail; } qp->qp_state = TAVOR_QP_RESET; @@ -560,8 +494,6 @@ tavor_qp_modify(tavor_state_t *state, tavor_qphdl_t qp, status = tavor_qp_to_error(state, qp); if (status != DDI_SUCCESS) { mutex_exit(&qp->qp_lock); - /* Set "status"/"errormsg", goto failure */ - TAVOR_TNF_FAIL(status, "rts to error"); goto qpmod_fail; } qp->qp_state = TAVOR_QP_ERR; @@ -569,9 +501,6 @@ tavor_qp_modify(tavor_state_t *state, tavor_qphdl_t qp, } else { /* Invalid transition - return error */ mutex_exit(&qp->qp_lock); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_QP_STATE_INVALID, - "rts: invalid transition"); goto qpmod_fail; } break; @@ -587,8 +516,6 @@ tavor_qp_modify(tavor_state_t *state, tavor_qphdl_t qp, */ if (flags & ~okflags) { mutex_exit(&qp->qp_lock); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_QP_ATTR_RO, "sqerr: invalid flag"); goto qpmod_fail; } @@ -604,8 +531,6 @@ tavor_qp_modify(tavor_state_t *state, tavor_qphdl_t qp, status = tavor_qp_sqerr2rts(state, qp, flags, info_p); if (status != DDI_SUCCESS) { mutex_exit(&qp->qp_lock); - /* Set "status"/"errormsg", goto failure */ - TAVOR_TNF_FAIL(status, "sqerr to rts"); goto qpmod_fail; } qp->qp_state = TAVOR_QP_RTS; @@ -618,8 +543,6 @@ tavor_qp_modify(tavor_state_t *state, tavor_qphdl_t qp, status = tavor_qp_to_reset(state, qp); if (status != DDI_SUCCESS) { mutex_exit(&qp->qp_lock); - /* Set "status"/"errormsg", goto failure */ - TAVOR_TNF_FAIL(status, "sqerr to reset"); goto qpmod_fail; } qp->qp_state = TAVOR_QP_RESET; @@ -639,8 +562,6 @@ tavor_qp_modify(tavor_state_t *state, tavor_qphdl_t qp, status = tavor_qp_to_error(state, qp); if (status != DDI_SUCCESS) { mutex_exit(&qp->qp_lock); - /* Set "status"/"errormsg", goto failure */ - TAVOR_TNF_FAIL(status, "sqerr to error"); goto qpmod_fail; } qp->qp_state = TAVOR_QP_ERR; @@ -648,9 +569,6 @@ tavor_qp_modify(tavor_state_t *state, tavor_qphdl_t qp, } else { /* Invalid transition - return error */ mutex_exit(&qp->qp_lock); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_QP_STATE_INVALID, - "sqerr: invalid transition"); goto qpmod_fail; } break; @@ -671,8 +589,6 @@ tavor_qp_modify(tavor_state_t *state, tavor_qphdl_t qp, */ if (flags & ~okflags) { mutex_exit(&qp->qp_lock); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_QP_ATTR_RO, "sqd: invalid flag"); goto qpmod_fail; } @@ -689,8 +605,6 @@ tavor_qp_modify(tavor_state_t *state, tavor_qphdl_t qp, status = tavor_qp_sqd2sqd(state, qp, flags, info_p); if (status != DDI_SUCCESS) { mutex_exit(&qp->qp_lock); - /* Set "status"/"errormsg", goto failure */ - TAVOR_TNF_FAIL(status, "sqd to sqd"); goto qpmod_fail; } qp->qp_state = TAVOR_QP_SQD; @@ -703,9 +617,7 @@ tavor_qp_modify(tavor_state_t *state, tavor_qphdl_t qp, */ if (qp->qp_sqd_still_draining) { mutex_exit(&qp->qp_lock); - /* Set "status"/"errormsg", goto failure */ status = IBT_QP_STATE_INVALID; - TAVOR_TNF_FAIL(status, "sqd to rts; draining"); goto qpmod_fail; } @@ -715,8 +627,6 @@ tavor_qp_modify(tavor_state_t *state, tavor_qphdl_t qp, status = tavor_qp_sqd2rts(state, qp, flags, info_p); if (status != DDI_SUCCESS) { mutex_exit(&qp->qp_lock); - /* Set "status"/"errormsg", goto failure */ - TAVOR_TNF_FAIL(status, "sqd to rts"); goto qpmod_fail; } qp->qp_state = TAVOR_QP_RTS; @@ -729,8 +639,6 @@ tavor_qp_modify(tavor_state_t *state, tavor_qphdl_t qp, status = tavor_qp_to_reset(state, qp); if (status != DDI_SUCCESS) { mutex_exit(&qp->qp_lock); - /* Set "status"/"errormsg", goto failure */ - TAVOR_TNF_FAIL(status, "sqd to reset"); goto qpmod_fail; } qp->qp_state = TAVOR_QP_RESET; @@ -750,8 +658,6 @@ tavor_qp_modify(tavor_state_t *state, tavor_qphdl_t qp, status = tavor_qp_to_error(state, qp); if (status != DDI_SUCCESS) { mutex_exit(&qp->qp_lock); - /* Set "status"/"errormsg", goto failure */ - TAVOR_TNF_FAIL(status, "sqd to error"); goto qpmod_fail; } qp->qp_state = TAVOR_QP_ERR; @@ -759,9 +665,6 @@ tavor_qp_modify(tavor_state_t *state, tavor_qphdl_t qp, } else { /* Invalid transition - return error */ mutex_exit(&qp->qp_lock); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_QP_STATE_INVALID, - "sqd: invalid transition"); goto qpmod_fail; } break; @@ -779,8 +682,6 @@ tavor_qp_modify(tavor_state_t *state, tavor_qphdl_t qp, status = tavor_qp_to_reset(state, qp); if (status != DDI_SUCCESS) { mutex_exit(&qp->qp_lock); - /* Set "status"/"errormsg", goto failure */ - TAVOR_TNF_FAIL(status, "error to reset"); goto qpmod_fail; } qp->qp_state = TAVOR_QP_RESET; @@ -802,17 +703,11 @@ tavor_qp_modify(tavor_state_t *state, tavor_qphdl_t qp, * */ mutex_exit(&qp->qp_lock); - TNF_PROBE_0_DEBUG(tavor_qp_modify_err2err, - TAVOR_TNF_TRACE, ""); - TAVOR_TNF_EXIT(tavor_qp_modify); return (DDI_SUCCESS); } else { /* Invalid transition - return error */ mutex_exit(&qp->qp_lock); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_QP_STATE_INVALID, - "error: invalid transition"); goto qpmod_fail; } break; @@ -825,19 +720,13 @@ tavor_qp_modify(tavor_state_t *state, tavor_qphdl_t qp, */ mutex_exit(&qp->qp_lock); TAVOR_WARNING(state, "unknown QP state in modify"); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_QP_STATE_INVALID, "invalid curr QP state"); goto qpmod_fail; } mutex_exit(&qp->qp_lock); - TAVOR_TNF_EXIT(tavor_qp_modify); return (DDI_SUCCESS); qpmod_fail: - TNF_PROBE_1(tavor_qp_modify_fail, TAVOR_TNF_ERROR, "", - tnf_string, msg, errormsg); - TAVOR_TNF_EXIT(tavor_qp_modify); return (status); } @@ -857,8 +746,6 @@ tavor_qp_reset2init(tavor_state_t *state, tavor_qphdl_t qp, uint_t portnum, pkeyindx; int status; - TAVOR_TNF_ENTER(tavor_qp_reset2init); - ASSERT(MUTEX_HELD(&qp->qp_lock)); /* @@ -911,9 +798,6 @@ tavor_qp_reset2init(tavor_state_t *state, tavor_qphdl_t qp, if (tavor_portnum_is_valid(state, portnum)) { qpc->pri_addr_path.portnum = portnum; } else { - TNF_PROBE_1(tavor_qp_reset2init_inv_port_fail, - TAVOR_TNF_ERROR, "", tnf_uint, port, portnum); - TAVOR_TNF_EXIT(tavor_qp_reset2init); return (IBT_HCA_PORT_INVALID); } @@ -923,9 +807,6 @@ tavor_qp_reset2init(tavor_state_t *state, tavor_qphdl_t qp, qpc->pri_addr_path.pkey_indx = pkeyindx; qp->qp_pkeyindx = pkeyindx; } else { - TNF_PROBE_1(tavor_qp_reset2init_inv_pkey_fail, - TAVOR_TNF_ERROR, "", tnf_uint, pkeyindx, pkeyindx); - TAVOR_TNF_EXIT(tavor_qp_reset2init); return (IBT_PKEY_IX_ILLEGAL); } @@ -942,9 +823,6 @@ tavor_qp_reset2init(tavor_state_t *state, tavor_qphdl_t qp, if (tavor_portnum_is_valid(state, portnum)) { qpc->pri_addr_path.portnum = portnum; } else { - TNF_PROBE_1(tavor_qp_reset2init_inv_port_fail, - TAVOR_TNF_ERROR, "", tnf_uint, port, portnum); - TAVOR_TNF_EXIT(tavor_qp_reset2init); return (IBT_HCA_PORT_INVALID); } @@ -953,9 +831,6 @@ tavor_qp_reset2init(tavor_state_t *state, tavor_qphdl_t qp, if (tavor_pkeyindex_is_valid(state, pkeyindx)) { qpc->pri_addr_path.pkey_indx = pkeyindx; } else { - TNF_PROBE_1(tavor_qp_reset2init_inv_pkey_fail, - TAVOR_TNF_ERROR, "", tnf_uint, pkeyindx, pkeyindx); - TAVOR_TNF_EXIT(tavor_qp_reset2init); return (IBT_PKEY_IX_ILLEGAL); } @@ -973,9 +848,6 @@ tavor_qp_reset2init(tavor_state_t *state, tavor_qphdl_t qp, if (tavor_portnum_is_valid(state, portnum)) { qpc->pri_addr_path.portnum = portnum; } else { - TNF_PROBE_1(tavor_qp_reset2init_inv_port_fail, - TAVOR_TNF_ERROR, "", tnf_uint, port, portnum); - TAVOR_TNF_EXIT(tavor_qp_reset2init); return (IBT_HCA_PORT_INVALID); } @@ -984,9 +856,6 @@ tavor_qp_reset2init(tavor_state_t *state, tavor_qphdl_t qp, if (tavor_pkeyindex_is_valid(state, pkeyindx)) { qpc->pri_addr_path.pkey_indx = pkeyindx; } else { - TNF_PROBE_1(tavor_qp_reset2init_inv_pkey_fail, - TAVOR_TNF_ERROR, "", tnf_uint, pkeyindx, pkeyindx); - TAVOR_TNF_EXIT(tavor_qp_reset2init); return (IBT_PKEY_IX_ILLEGAL); } } else { @@ -996,9 +865,6 @@ tavor_qp_reset2init(tavor_state_t *state, tavor_qphdl_t qp, * and return failure */ TAVOR_WARNING(state, "unknown QP transport type in rst2init"); - TNF_PROBE_0(tavor_qp_reset2init_inv_transtype_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_qp_reset2init); return (ibc_get_ci_failure(0)); } @@ -1015,13 +881,9 @@ tavor_qp_reset2init(tavor_state_t *state, tavor_qphdl_t qp, if (status != TAVOR_CMD_SUCCESS) { cmn_err(CE_CONT, "Tavor: RST2INIT_QP command failed: %08x\n", status); - TNF_PROBE_1(tavor_qp_reset2init_cmd_fail, TAVOR_TNF_ERROR, "", - tnf_uint, status, status); - TAVOR_TNF_EXIT(tavor_qp_reset2init); return (ibc_get_ci_failure(0)); } - TAVOR_TNF_EXIT(tavor_qp_reset2init); return (DDI_SUCCESS); } @@ -1042,8 +904,6 @@ tavor_qp_init2init(tavor_state_t *state, tavor_qphdl_t qp, uint32_t opmask = 0; int status; - TAVOR_TNF_ENTER(tavor_qp_init2init); - ASSERT(MUTEX_HELD(&qp->qp_lock)); /* @@ -1069,10 +929,6 @@ tavor_qp_init2init(tavor_state_t *state, tavor_qphdl_t qp, if (tavor_portnum_is_valid(state, portnum)) { qpc->pri_addr_path.portnum = portnum; } else { - TNF_PROBE_1(tavor_qp_init2init_inv_port_fail, - TAVOR_TNF_ERROR, "", tnf_uint, port, - portnum); - TAVOR_TNF_EXIT(tavor_qp_init2init); return (IBT_HCA_PORT_INVALID); } opmask |= TAVOR_CMD_OP_PRIM_PORT; @@ -1090,10 +946,6 @@ tavor_qp_init2init(tavor_state_t *state, tavor_qphdl_t qp, opmask |= TAVOR_CMD_OP_PKEYINDX; qp->qp_pkeyindx = pkeyindx; } else { - TNF_PROBE_1(tavor_qp_init2init_inv_pkey_fail, - TAVOR_TNF_ERROR, "", tnf_uint, pkeyindx, - pkeyindx); - TAVOR_TNF_EXIT(tavor_qp_init2init); return (IBT_PKEY_IX_ILLEGAL); } } @@ -1121,10 +973,6 @@ tavor_qp_init2init(tavor_state_t *state, tavor_qphdl_t qp, if (tavor_portnum_is_valid(state, portnum)) { qpc->pri_addr_path.portnum = portnum; } else { - TNF_PROBE_1(tavor_qp_init2init_inv_port_fail, - TAVOR_TNF_ERROR, "", tnf_uint, port, - portnum); - TAVOR_TNF_EXIT(tavor_qp_init2init); return (IBT_HCA_PORT_INVALID); } opmask |= TAVOR_CMD_OP_PRIM_PORT; @@ -1141,10 +989,6 @@ tavor_qp_init2init(tavor_state_t *state, tavor_qphdl_t qp, qpc->pri_addr_path.pkey_indx = pkeyindx; opmask |= TAVOR_CMD_OP_PKEYINDX; } else { - TNF_PROBE_1(tavor_qp_init2init_inv_pkey_fail, - TAVOR_TNF_ERROR, "", tnf_uint, pkeyindx, - pkeyindx); - TAVOR_TNF_EXIT(tavor_qp_init2init); return (IBT_PKEY_IX_ILLEGAL); } } @@ -1169,10 +1013,6 @@ tavor_qp_init2init(tavor_state_t *state, tavor_qphdl_t qp, if (tavor_portnum_is_valid(state, portnum)) { qpc->pri_addr_path.portnum = portnum; } else { - TNF_PROBE_1(tavor_qp_init2init_inv_port_fail, - TAVOR_TNF_ERROR, "", tnf_uint, port, - portnum); - TAVOR_TNF_EXIT(tavor_qp_init2init); return (IBT_HCA_PORT_INVALID); } opmask |= TAVOR_CMD_OP_PRIM_PORT; @@ -1189,10 +1029,6 @@ tavor_qp_init2init(tavor_state_t *state, tavor_qphdl_t qp, qpc->pri_addr_path.pkey_indx = pkeyindx; opmask |= TAVOR_CMD_OP_PKEYINDX; } else { - TNF_PROBE_1(tavor_qp_init2init_inv_pkey_fail, - TAVOR_TNF_ERROR, "", tnf_uint, pkeyindx, - pkeyindx); - TAVOR_TNF_EXIT(tavor_qp_init2init); return (IBT_PKEY_IX_ILLEGAL); } } @@ -1214,9 +1050,6 @@ tavor_qp_init2init(tavor_state_t *state, tavor_qphdl_t qp, * and return failure */ TAVOR_WARNING(state, "unknown QP transport type in init2init"); - TNF_PROBE_0(tavor_qp_init2init_inv_transtype_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_qp_init2init); return (ibc_get_ci_failure(0)); } @@ -1234,19 +1067,12 @@ tavor_qp_init2init(tavor_state_t *state, tavor_qphdl_t qp, if (status != TAVOR_CMD_BAD_QP_STATE) { cmn_err(CE_CONT, "Tavor: INIT2INIT_QP command failed: " "%08x\n", status); - TNF_PROBE_1(tavor_qp_init2init_cmd_fail, - TAVOR_TNF_ERROR, "", tnf_uint, status, status); - TAVOR_TNF_EXIT(tavor_qp_init2init); return (ibc_get_ci_failure(0)); } else { - TNF_PROBE_0(tavor_qp_init2init_inv_qpstate_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_qp_init2init); return (IBT_QP_STATE_INVALID); } } - TAVOR_TNF_EXIT(tavor_qp_init2init); return (DDI_SUCCESS); } @@ -1265,13 +1091,11 @@ tavor_qp_init2rtr(tavor_state_t *state, tavor_qphdl_t qp, ibt_qp_uc_attr_t *uc; tavor_hw_addr_path_t *qpc_path; ibt_adds_vect_t *adds_vect; - uint_t portnum, pkeyindx, rdma_ra_in, rra_max; + uint_t portnum, pkeyindx, rra_max; uint_t mtu; uint32_t opmask = 0; int status; - TAVOR_TNF_ENTER(tavor_qp_init2rtr); - ASSERT(MUTEX_HELD(&qp->qp_lock)); /* @@ -1322,10 +1146,6 @@ tavor_qp_init2rtr(tavor_state_t *state, tavor_qphdl_t qp, opmask |= TAVOR_CMD_OP_PKEYINDX; qp->qp_pkeyindx = pkeyindx; } else { - TNF_PROBE_1(tavor_qp_init2rtr_inv_pkey_fail, - TAVOR_TNF_ERROR, "", tnf_uint, pkeyindx, - pkeyindx); - TAVOR_TNF_EXIT(tavor_qp_init2rtr); return (IBT_PKEY_IX_ILLEGAL); } } @@ -1351,9 +1171,6 @@ tavor_qp_init2rtr(tavor_state_t *state, tavor_qphdl_t qp, status = tavor_set_addr_path(state, adds_vect, qpc_path, TAVOR_ADDRPATH_QP, qp); if (status != DDI_SUCCESS) { - TNF_PROBE_0(tavor_qp_init2rtr_setaddrpath_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_qp_init2rtr); return (status); } @@ -1384,9 +1201,6 @@ tavor_qp_init2rtr(tavor_state_t *state, tavor_qphdl_t qp, qpc->ric = (qp->qp_srq_en == TAVOR_QP_SRQ_ENABLED) ? 1 : 0; mtu = rc->rc_path_mtu; if (tavor_qp_validate_mtu(state, mtu) != DDI_SUCCESS) { - TNF_PROBE_1(tavor_qp_init2rtr_inv_mtu_fail, - TAVOR_TNF_ERROR, "", tnf_uint, mtu, mtu); - TAVOR_TNF_EXIT(tavor_qp_init2rtr); return (IBT_HCA_PORT_MTU_EXCEEDED); } qpc->mtu = mtu; @@ -1412,13 +1226,8 @@ tavor_qp_init2rtr(tavor_state_t *state, tavor_qphdl_t qp, * "ra_buf_index" fields in the QPC to point to the * pre-allocated RDB resources (in DDR) */ - rdma_ra_in = rc->rc_rdma_ra_in; if (tavor_qp_validate_resp_rsrc(state, rc, &rra_max) != DDI_SUCCESS) { - TNF_PROBE_1(tavor_qp_init2rtr_inv_rdma_in_fail, - TAVOR_TNF_ERROR, "", tnf_uint, rdma_ra_in, - rdma_ra_in); - TAVOR_TNF_EXIT(tavor_qp_init2rtr); return (IBT_INVALID_PARAM); } qpc->rra_max = rra_max; @@ -1435,10 +1244,6 @@ tavor_qp_init2rtr(tavor_state_t *state, tavor_qphdl_t qp, qpc->pri_addr_path.pkey_indx = pkeyindx; opmask |= TAVOR_CMD_OP_PKEYINDX; } else { - TNF_PROBE_1(tavor_qp_init2rtr_inv_pkey_fail, - TAVOR_TNF_ERROR, "", tnf_uint, pkeyindx, - pkeyindx); - TAVOR_TNF_EXIT(tavor_qp_init2rtr); return (IBT_PKEY_IX_ILLEGAL); } } @@ -1462,9 +1267,6 @@ tavor_qp_init2rtr(tavor_state_t *state, tavor_qphdl_t qp, status = tavor_set_addr_path(state, adds_vect, qpc_path, TAVOR_ADDRPATH_QP, qp); if (status != DDI_SUCCESS) { - TNF_PROBE_0(tavor_qp_init2rtr_setaddrpath_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_qp_init2rtr); return (status); } qpc_path->ack_timeout = rc->rc_alt_path.cep_timeout; @@ -1484,10 +1286,6 @@ tavor_qp_init2rtr(tavor_state_t *state, tavor_qphdl_t qp, if (tavor_portnum_is_valid(state, portnum)) { qpc->alt_addr_path.portnum = portnum; } else { - TNF_PROBE_1(tavor_qp_init2rtr_inv_altport_fail, - TAVOR_TNF_ERROR, "", tnf_uint, altport, - portnum); - TAVOR_TNF_EXIT(tavor_qp_init2rtr); return (IBT_HCA_PORT_INVALID); } @@ -1499,10 +1297,6 @@ tavor_qp_init2rtr(tavor_state_t *state, tavor_qphdl_t qp, if (tavor_pkeyindex_is_valid(state, pkeyindx)) { qpc->alt_addr_path.pkey_indx = pkeyindx; } else { - TNF_PROBE_1(tavor_qp_init2rtr_inv_altpkey_fail, - TAVOR_TNF_ERROR, "", tnf_uint, altpkeyindx, - pkeyindx); - TAVOR_TNF_EXIT(tavor_qp_init2rtr); return (IBT_PKEY_IX_ILLEGAL); } opmask |= (TAVOR_CMD_OP_ALT_PATH | @@ -1520,9 +1314,6 @@ tavor_qp_init2rtr(tavor_state_t *state, tavor_qphdl_t qp, status = tavor_set_addr_path(state, adds_vect, qpc_path, TAVOR_ADDRPATH_QP, qp); if (status != DDI_SUCCESS) { - TNF_PROBE_0(tavor_qp_init2rtr_setaddrpath_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_qp_init2rtr); return (status); } @@ -1537,9 +1328,6 @@ tavor_qp_init2rtr(tavor_state_t *state, tavor_qphdl_t qp, qpc->msg_max = TAVOR_QP_LOG_MAX_MSGSZ; mtu = uc->uc_path_mtu; if (tavor_qp_validate_mtu(state, mtu) != DDI_SUCCESS) { - TNF_PROBE_1(tavor_qp_init2rtr_inv_mtu_fail, - TAVOR_TNF_ERROR, "", tnf_uint, mtu, mtu); - TAVOR_TNF_EXIT(tavor_qp_init2rtr); return (IBT_HCA_PORT_MTU_EXCEEDED); } qpc->mtu = mtu; @@ -1562,10 +1350,6 @@ tavor_qp_init2rtr(tavor_state_t *state, tavor_qphdl_t qp, qpc->pri_addr_path.pkey_indx = pkeyindx; opmask |= TAVOR_CMD_OP_PKEYINDX; } else { - TNF_PROBE_1(tavor_qp_init2rtr_inv_pkey_fail, - TAVOR_TNF_ERROR, "", tnf_uint, pkeyindx, - pkeyindx); - TAVOR_TNF_EXIT(tavor_qp_init2rtr); return (IBT_PKEY_IX_ILLEGAL); } } @@ -1593,9 +1377,6 @@ tavor_qp_init2rtr(tavor_state_t *state, tavor_qphdl_t qp, status = tavor_set_addr_path(state, adds_vect, qpc_path, TAVOR_ADDRPATH_QP, qp); if (status != DDI_SUCCESS) { - TNF_PROBE_0(tavor_qp_init2rtr_setaddrpath_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_qp_init2rtr); return (status); } @@ -1607,10 +1388,6 @@ tavor_qp_init2rtr(tavor_state_t *state, tavor_qphdl_t qp, if (tavor_portnum_is_valid(state, portnum)) { qpc->alt_addr_path.portnum = portnum; } else { - TNF_PROBE_1(tavor_qp_init2rtr_inv_altport_fail, - TAVOR_TNF_ERROR, "", tnf_uint, altport, - portnum); - TAVOR_TNF_EXIT(tavor_qp_init2rtr); return (IBT_HCA_PORT_INVALID); } @@ -1622,10 +1399,6 @@ tavor_qp_init2rtr(tavor_state_t *state, tavor_qphdl_t qp, if (tavor_pkeyindex_is_valid(state, pkeyindx)) { qpc->alt_addr_path.pkey_indx = pkeyindx; } else { - TNF_PROBE_1(tavor_qp_init2rtr_inv_altpkey_fail, - TAVOR_TNF_ERROR, "", tnf_uint, altpkeyindx, - pkeyindx); - TAVOR_TNF_EXIT(tavor_qp_init2rtr); return (IBT_PKEY_IX_ILLEGAL); } opmask |= TAVOR_CMD_OP_ALT_PATH; @@ -1637,9 +1410,6 @@ tavor_qp_init2rtr(tavor_state_t *state, tavor_qphdl_t qp, * and return failure */ TAVOR_WARNING(state, "unknown QP transport type in init2rtr"); - TNF_PROBE_0(tavor_qp_init2rtr_inv_transtype_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_qp_init2rtr); return (ibc_get_ci_failure(0)); } @@ -1657,19 +1427,12 @@ tavor_qp_init2rtr(tavor_state_t *state, tavor_qphdl_t qp, if (status != TAVOR_CMD_BAD_QP_STATE) { cmn_err(CE_CONT, "Tavor: INIT2RTR_QP command failed: " "%08x\n", status); - TNF_PROBE_1(tavor_qp_init2rtr_cmd_fail, - TAVOR_TNF_ERROR, "", tnf_uint, status, status); - TAVOR_TNF_EXIT(tavor_qp_init2rtr); return (ibc_get_ci_failure(0)); } else { - TNF_PROBE_0(tavor_qp_init2rtr_inv_qpstate_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_qp_init2rtr); return (IBT_QP_STATE_INVALID); } } - TAVOR_TNF_EXIT(tavor_qp_init2rtr); return (DDI_SUCCESS); } @@ -1688,12 +1451,10 @@ tavor_qp_rtr2rts(tavor_state_t *state, tavor_qphdl_t qp, ibt_qp_uc_attr_t *uc; tavor_hw_addr_path_t *qpc_path; ibt_adds_vect_t *adds_vect; - uint_t portnum, pkeyindx, rdma_ra_out, sra_max; + uint_t portnum, pkeyindx, sra_max; uint32_t opmask = 0; int status; - TAVOR_TNF_ENTER(tavor_qp_rtr2rts); - ASSERT(MUTEX_HELD(&qp->qp_lock)); /* @@ -1747,13 +1508,8 @@ tavor_qp_rtr2rts(tavor_state_t *state, tavor_qphdl_t qp, * is valid. And if it is, then setup the "sra_max" * appropriately */ - rdma_ra_out = rc->rc_rdma_ra_out; if (tavor_qp_validate_init_depth(state, rc, &sra_max) != DDI_SUCCESS) { - TNF_PROBE_1(tavor_qp_rtr2rts_inv_rdma_out_fail, - TAVOR_TNF_ERROR, "", tnf_uint, rdma_ra_out, - rdma_ra_out); - TAVOR_TNF_EXIT(tavor_qp_rtr2rts); return (IBT_INVALID_PARAM); } qpc->sra_max = sra_max; @@ -1785,10 +1541,6 @@ tavor_qp_rtr2rts(tavor_state_t *state, tavor_qphdl_t qp, } else if (rc->rc_mig_state == IBT_STATE_REARMED) { qpc->pm_state = TAVOR_QP_PMSTATE_REARM; } else { - TNF_PROBE_1(tavor_qp_rtr2rts_inv_mig_state_fail, - TAVOR_TNF_ERROR, "", tnf_uint, mig_state, - rc->rc_mig_state); - TAVOR_TNF_EXIT(tavor_qp_rtr2rts); return (IBT_QP_APM_STATE_INVALID); } opmask |= TAVOR_CMD_OP_PM_STATE; @@ -1816,9 +1568,6 @@ tavor_qp_rtr2rts(tavor_state_t *state, tavor_qphdl_t qp, status = tavor_set_addr_path(state, adds_vect, qpc_path, TAVOR_ADDRPATH_QP, qp); if (status != DDI_SUCCESS) { - TNF_PROBE_0(tavor_qp_rtr2rts_setaddrpath_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_qp_rtr2rts); return (status); } @@ -1839,10 +1588,6 @@ tavor_qp_rtr2rts(tavor_state_t *state, tavor_qphdl_t qp, if (tavor_portnum_is_valid(state, portnum)) { qpc->alt_addr_path.portnum = portnum; } else { - TNF_PROBE_1(tavor_qp_rtr2rts_inv_altport_fail, - TAVOR_TNF_ERROR, "", tnf_uint, altport, - portnum); - TAVOR_TNF_EXIT(tavor_qp_rtr2rts); return (IBT_HCA_PORT_INVALID); } @@ -1854,10 +1599,6 @@ tavor_qp_rtr2rts(tavor_state_t *state, tavor_qphdl_t qp, if (tavor_pkeyindex_is_valid(state, pkeyindx)) { qpc->alt_addr_path.pkey_indx = pkeyindx; } else { - TNF_PROBE_1(tavor_qp_rtr2rts_inv_altpkey_fail, - TAVOR_TNF_ERROR, "", tnf_uint, altpkeyindx, - pkeyindx); - TAVOR_TNF_EXIT(tavor_qp_rtr2rts); return (IBT_PKEY_IX_ILLEGAL); } opmask |= (TAVOR_CMD_OP_ALT_PATH | @@ -1898,10 +1639,6 @@ tavor_qp_rtr2rts(tavor_state_t *state, tavor_qphdl_t qp, } else if (uc->uc_mig_state == IBT_STATE_REARMED) { qpc->pm_state = TAVOR_QP_PMSTATE_REARM; } else { - TNF_PROBE_1(tavor_qp_rtr2rts_inv_mig_state_fail, - TAVOR_TNF_ERROR, "", tnf_uint, mig_state, - uc->uc_mig_state); - TAVOR_TNF_EXIT(tavor_qp_rtr2rts); return (IBT_QP_APM_STATE_INVALID); } opmask |= TAVOR_CMD_OP_PM_STATE; @@ -1919,9 +1656,6 @@ tavor_qp_rtr2rts(tavor_state_t *state, tavor_qphdl_t qp, status = tavor_set_addr_path(state, adds_vect, qpc_path, TAVOR_ADDRPATH_QP, qp); if (status != DDI_SUCCESS) { - TNF_PROBE_0(tavor_qp_rtr2rts_setaddrpath_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_qp_rtr2rts); return (status); } @@ -1933,10 +1667,6 @@ tavor_qp_rtr2rts(tavor_state_t *state, tavor_qphdl_t qp, if (tavor_portnum_is_valid(state, portnum)) { qpc->alt_addr_path.portnum = portnum; } else { - TNF_PROBE_1(tavor_qp_rtr2rts_inv_altport_fail, - TAVOR_TNF_ERROR, "", tnf_uint, altport, - portnum); - TAVOR_TNF_EXIT(tavor_qp_rtr2rts); return (IBT_HCA_PORT_INVALID); } @@ -1948,10 +1678,6 @@ tavor_qp_rtr2rts(tavor_state_t *state, tavor_qphdl_t qp, if (tavor_pkeyindex_is_valid(state, pkeyindx)) { qpc->alt_addr_path.pkey_indx = pkeyindx; } else { - TNF_PROBE_1(tavor_qp_rtr2rts_inv_altpkey_fail, - TAVOR_TNF_ERROR, "", tnf_uint, altpkeyindx, - pkeyindx); - TAVOR_TNF_EXIT(tavor_qp_rtr2rts); return (IBT_PKEY_IX_ILLEGAL); } opmask |= TAVOR_CMD_OP_ALT_PATH; @@ -1963,9 +1689,6 @@ tavor_qp_rtr2rts(tavor_state_t *state, tavor_qphdl_t qp, * and return failure */ TAVOR_WARNING(state, "unknown QP transport type in rtr2rts"); - TNF_PROBE_0(tavor_qp_rtr2rts_inv_transtype_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_qp_rtr2rts); return (ibc_get_ci_failure(0)); } @@ -1983,19 +1706,12 @@ tavor_qp_rtr2rts(tavor_state_t *state, tavor_qphdl_t qp, if (status != TAVOR_CMD_BAD_QP_STATE) { cmn_err(CE_CONT, "Tavor: RTR2RTS_QP command failed: " "%08x\n", status); - TNF_PROBE_1(tavor_qp_rtr2rts_cmd_fail, - TAVOR_TNF_ERROR, "", tnf_uint, status, status); - TAVOR_TNF_EXIT(tavor_qp_rtr2rts); return (ibc_get_ci_failure(0)); } else { - TNF_PROBE_0(tavor_qp_rtr2rts_inv_qpstate_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_qp_rtr2rts); return (IBT_QP_STATE_INVALID); } } - TAVOR_TNF_EXIT(tavor_qp_rtr2rts); return (DDI_SUCCESS); } @@ -2018,8 +1734,6 @@ tavor_qp_rts2rts(tavor_state_t *state, tavor_qphdl_t qp, uint32_t opmask = 0; int status; - TAVOR_TNF_ENTER(tavor_qp_rts2rts); - ASSERT(MUTEX_HELD(&qp->qp_lock)); /* @@ -2066,10 +1780,6 @@ tavor_qp_rts2rts(tavor_state_t *state, tavor_qphdl_t qp, } else if (rc->rc_mig_state == IBT_STATE_REARMED) { qpc->pm_state = TAVOR_QP_PMSTATE_REARM; } else { - TNF_PROBE_1(tavor_qp_rts2rts_inv_mig_state_fail, - TAVOR_TNF_ERROR, "", tnf_uint, mig_state, - rc->rc_mig_state); - TAVOR_TNF_EXIT(tavor_qp_rts2rts); return (IBT_QP_APM_STATE_INVALID); } opmask |= TAVOR_CMD_OP_PM_STATE; @@ -2097,9 +1807,6 @@ tavor_qp_rts2rts(tavor_state_t *state, tavor_qphdl_t qp, status = tavor_set_addr_path(state, adds_vect, qpc_path, TAVOR_ADDRPATH_QP, qp); if (status != DDI_SUCCESS) { - TNF_PROBE_0(tavor_qp_rts2rts_setaddrpath_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_qp_rts2rts); return (status); } qpc_path->ack_timeout = rc->rc_alt_path.cep_timeout; @@ -2112,10 +1819,6 @@ tavor_qp_rts2rts(tavor_state_t *state, tavor_qphdl_t qp, if (tavor_portnum_is_valid(state, portnum)) { qpc->alt_addr_path.portnum = portnum; } else { - TNF_PROBE_1(tavor_qp_rts2rts_inv_altport_fail, - TAVOR_TNF_ERROR, "", tnf_uint, altport, - portnum); - TAVOR_TNF_EXIT(tavor_qp_rts2rts); return (IBT_HCA_PORT_INVALID); } @@ -2127,10 +1830,6 @@ tavor_qp_rts2rts(tavor_state_t *state, tavor_qphdl_t qp, if (tavor_pkeyindex_is_valid(state, pkeyindx)) { qpc->alt_addr_path.pkey_indx = pkeyindx; } else { - TNF_PROBE_1(tavor_qp_rts2rts_inv_altpkey_fail, - TAVOR_TNF_ERROR, "", tnf_uint, altpkeyindx, - pkeyindx); - TAVOR_TNF_EXIT(tavor_qp_rts2rts); return (IBT_PKEY_IX_ILLEGAL); } opmask |= TAVOR_CMD_OP_ALT_PATH; @@ -2161,10 +1860,6 @@ tavor_qp_rts2rts(tavor_state_t *state, tavor_qphdl_t qp, } else if (uc->uc_mig_state == IBT_STATE_REARMED) { qpc->pm_state = TAVOR_QP_PMSTATE_REARM; } else { - TNF_PROBE_1(tavor_qp_rts2rts_inv_mig_state_fail, - TAVOR_TNF_ERROR, "", tnf_uint, mig_state, - uc->uc_mig_state); - TAVOR_TNF_EXIT(tavor_qp_rts2rts); return (IBT_QP_APM_STATE_INVALID); } opmask |= TAVOR_CMD_OP_PM_STATE; @@ -2182,9 +1877,6 @@ tavor_qp_rts2rts(tavor_state_t *state, tavor_qphdl_t qp, status = tavor_set_addr_path(state, adds_vect, qpc_path, TAVOR_ADDRPATH_QP, qp); if (status != DDI_SUCCESS) { - TNF_PROBE_0(tavor_qp_rts2rts_setaddrpath_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_qp_rts2rts); return (status); } @@ -2196,10 +1888,6 @@ tavor_qp_rts2rts(tavor_state_t *state, tavor_qphdl_t qp, if (tavor_portnum_is_valid(state, portnum)) { qpc->alt_addr_path.portnum = portnum; } else { - TNF_PROBE_1(tavor_qp_rts2rts_inv_altport_fail, - TAVOR_TNF_ERROR, "", tnf_uint, altport, - portnum); - TAVOR_TNF_EXIT(tavor_qp_rts2rts); return (IBT_HCA_PORT_INVALID); } @@ -2211,10 +1899,6 @@ tavor_qp_rts2rts(tavor_state_t *state, tavor_qphdl_t qp, if (tavor_pkeyindex_is_valid(state, pkeyindx)) { qpc->alt_addr_path.pkey_indx = pkeyindx; } else { - TNF_PROBE_1(tavor_qp_rts2rts_inv_altpkey_fail, - TAVOR_TNF_ERROR, "", tnf_uint, altpkeyindx, - pkeyindx); - TAVOR_TNF_EXIT(tavor_qp_rts2rts); return (IBT_PKEY_IX_ILLEGAL); } opmask |= TAVOR_CMD_OP_ALT_PATH; @@ -2226,9 +1910,6 @@ tavor_qp_rts2rts(tavor_state_t *state, tavor_qphdl_t qp, * and return failure */ TAVOR_WARNING(state, "unknown QP transport type in rts2rts"); - TNF_PROBE_0(tavor_qp_rts2rts_inv_transtype_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_qp_rts2rts); return (ibc_get_ci_failure(0)); } @@ -2246,19 +1927,12 @@ tavor_qp_rts2rts(tavor_state_t *state, tavor_qphdl_t qp, if (status != TAVOR_CMD_BAD_QP_STATE) { cmn_err(CE_CONT, "Tavor: RTS2RTS_QP command failed: " "%08x\n", status); - TNF_PROBE_1(tavor_qp_rts2rts_cmd_fail, - TAVOR_TNF_ERROR, "", tnf_uint, status, status); - TAVOR_TNF_EXIT(tavor_qp_rts2rts); return (ibc_get_ci_failure(0)); } else { - TNF_PROBE_0(tavor_qp_rts2rts_inv_qpstate_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_qp_rts2rts); return (IBT_QP_STATE_INVALID); } } - TAVOR_TNF_EXIT(tavor_qp_rts2rts); return (DDI_SUCCESS); } @@ -2273,8 +1947,6 @@ tavor_qp_rts2sqd(tavor_state_t *state, tavor_qphdl_t qp, { int status; - TAVOR_TNF_ENTER(tavor_qp_rts2sqd); - ASSERT(MUTEX_HELD(&qp->qp_lock)); /* @@ -2300,14 +1972,8 @@ tavor_qp_rts2sqd(tavor_state_t *state, tavor_qphdl_t qp, if (status != TAVOR_CMD_BAD_QP_STATE) { cmn_err(CE_CONT, "Tavor: RTS2SQD_QP command failed: " "%08x\n", status); - TNF_PROBE_1(tavor_qp_rts2sqd_cmd_fail, - TAVOR_TNF_ERROR, "", tnf_uint, status, status); - TAVOR_TNF_EXIT(tavor_qp_rts2sqd); return (ibc_get_ci_failure(0)); } else { - TNF_PROBE_0(tavor_qp_rts2sqd_inv_qpstate_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_qp_rts2sqd); return (IBT_QP_STATE_INVALID); } } @@ -2319,7 +1985,6 @@ tavor_qp_rts2sqd(tavor_state_t *state, tavor_qphdl_t qp, */ qp->qp_sqd_still_draining = 1; - TAVOR_TNF_EXIT(tavor_qp_rts2sqd); return (DDI_SUCCESS); } @@ -2342,8 +2007,6 @@ tavor_qp_sqd2rts(tavor_state_t *state, tavor_qphdl_t qp, uint32_t opmask = 0; int status; - TAVOR_TNF_ENTER(tavor_qp_sqd2rts); - ASSERT(MUTEX_HELD(&qp->qp_lock)); /* @@ -2390,10 +2053,6 @@ tavor_qp_sqd2rts(tavor_state_t *state, tavor_qphdl_t qp, } else if (rc->rc_mig_state == IBT_STATE_REARMED) { qpc->pm_state = TAVOR_QP_PMSTATE_REARM; } else { - TNF_PROBE_1(tavor_qp_sqd2rts_inv_mig_state_fail, - TAVOR_TNF_ERROR, "", tnf_uint, mig_state, - rc->rc_mig_state); - TAVOR_TNF_EXIT(tavor_qp_sqd2rts); return (IBT_QP_APM_STATE_INVALID); } opmask |= TAVOR_CMD_OP_PM_STATE; @@ -2411,9 +2070,6 @@ tavor_qp_sqd2rts(tavor_state_t *state, tavor_qphdl_t qp, status = tavor_set_addr_path(state, adds_vect, qpc_path, TAVOR_ADDRPATH_QP, qp); if (status != DDI_SUCCESS) { - TNF_PROBE_0(tavor_qp_sqd2rts_setaddrpath_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_qp_sqd2rts); return (status); } qpc_path->ack_timeout = rc->rc_alt_path.cep_timeout; @@ -2426,10 +2082,6 @@ tavor_qp_sqd2rts(tavor_state_t *state, tavor_qphdl_t qp, if (tavor_portnum_is_valid(state, portnum)) { qpc->alt_addr_path.portnum = portnum; } else { - TNF_PROBE_1(tavor_qp_sqd2rts_inv_altport_fail, - TAVOR_TNF_ERROR, "", tnf_uint, altport, - portnum); - TAVOR_TNF_EXIT(tavor_qp_sqd2rts); return (IBT_HCA_PORT_INVALID); } @@ -2441,10 +2093,6 @@ tavor_qp_sqd2rts(tavor_state_t *state, tavor_qphdl_t qp, if (tavor_pkeyindex_is_valid(state, pkeyindx)) { qpc->alt_addr_path.pkey_indx = pkeyindx; } else { - TNF_PROBE_1(tavor_qp_sqd2rts_inv_altpkey_fail, - TAVOR_TNF_ERROR, "", tnf_uint, altpkeyindx, - pkeyindx); - TAVOR_TNF_EXIT(tavor_qp_sqd2rts); return (IBT_PKEY_IX_ILLEGAL); } opmask |= TAVOR_CMD_OP_ALT_PATH; @@ -2485,10 +2133,6 @@ tavor_qp_sqd2rts(tavor_state_t *state, tavor_qphdl_t qp, } else if (uc->uc_mig_state == IBT_STATE_REARMED) { qpc->pm_state = TAVOR_QP_PMSTATE_REARM; } else { - TNF_PROBE_1(tavor_qp_sqd2rts_inv_mig_state_fail, - TAVOR_TNF_ERROR, "", tnf_uint, mig_state, - uc->uc_mig_state); - TAVOR_TNF_EXIT(tavor_qp_sqd2rts); return (IBT_QP_APM_STATE_INVALID); } opmask |= TAVOR_CMD_OP_PM_STATE; @@ -2506,9 +2150,6 @@ tavor_qp_sqd2rts(tavor_state_t *state, tavor_qphdl_t qp, status = tavor_set_addr_path(state, adds_vect, qpc_path, TAVOR_ADDRPATH_QP, qp); if (status != DDI_SUCCESS) { - TNF_PROBE_0(tavor_qp_sqd2rts_setaddrpath_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_qp_sqd2rts); return (status); } @@ -2520,10 +2161,6 @@ tavor_qp_sqd2rts(tavor_state_t *state, tavor_qphdl_t qp, if (tavor_portnum_is_valid(state, portnum)) { qpc->alt_addr_path.portnum = portnum; } else { - TNF_PROBE_1(tavor_qp_sqd2rts_inv_altport_fail, - TAVOR_TNF_ERROR, "", tnf_uint, altport, - portnum); - TAVOR_TNF_EXIT(tavor_qp_sqd2rts); return (IBT_HCA_PORT_INVALID); } @@ -2535,10 +2172,6 @@ tavor_qp_sqd2rts(tavor_state_t *state, tavor_qphdl_t qp, if (tavor_pkeyindex_is_valid(state, pkeyindx)) { qpc->alt_addr_path.pkey_indx = pkeyindx; } else { - TNF_PROBE_1(tavor_qp_sqd2rts_inv_altpkey_fail, - TAVOR_TNF_ERROR, "", tnf_uint, altpkeyindx, - pkeyindx); - TAVOR_TNF_EXIT(tavor_qp_sqd2rts); return (IBT_PKEY_IX_ILLEGAL); } opmask |= TAVOR_CMD_OP_ALT_PATH; @@ -2550,9 +2183,6 @@ tavor_qp_sqd2rts(tavor_state_t *state, tavor_qphdl_t qp, * and return failure */ TAVOR_WARNING(state, "unknown QP transport type in sqd2rts"); - TNF_PROBE_0(tavor_qp_sqd2rts_inv_transtype_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_qp_sqd2rts); return (ibc_get_ci_failure(0)); } @@ -2570,19 +2200,12 @@ tavor_qp_sqd2rts(tavor_state_t *state, tavor_qphdl_t qp, if (status != TAVOR_CMD_BAD_QP_STATE) { cmn_err(CE_CONT, "Tavor: SQD2RTS_QP command failed: " "%08x\n", status); - TNF_PROBE_1(tavor_qp_sqd2rts_cmd_fail, - TAVOR_TNF_ERROR, "", tnf_uint, status, status); - TAVOR_TNF_EXIT(tavor_qp_sqd2rts); return (ibc_get_ci_failure(0)); } else { - TNF_PROBE_0(tavor_qp_sqd2rts_inv_qpstate_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_qp_sqd2rts); return (IBT_QP_STATE_INVALID); } } - TAVOR_TNF_EXIT(tavor_qp_sqd2rts); return (DDI_SUCCESS); } @@ -2601,13 +2224,11 @@ tavor_qp_sqd2sqd(tavor_state_t *state, tavor_qphdl_t qp, ibt_qp_uc_attr_t *uc; tavor_hw_addr_path_t *qpc_path; ibt_adds_vect_t *adds_vect; - uint_t portnum, pkeyindx, rdma_ra_out, rdma_ra_in; + uint_t portnum, pkeyindx; uint_t rra_max, sra_max; uint32_t opmask = 0; int status; - TAVOR_TNF_ENTER(tavor_qp_sqd2sqd); - ASSERT(MUTEX_HELD(&qp->qp_lock)); /* @@ -2635,10 +2256,6 @@ tavor_qp_sqd2sqd(tavor_state_t *state, tavor_qphdl_t qp, opmask |= TAVOR_CMD_OP_PKEYINDX; qp->qp_pkeyindx = pkeyindx; } else { - TNF_PROBE_1(tavor_qp_sqd2sqd_inv_pkey_fail, - TAVOR_TNF_ERROR, "", tnf_uint, pkeyindx, - pkeyindx); - TAVOR_TNF_EXIT(tavor_qp_sqd2sqd); return (IBT_PKEY_IX_ILLEGAL); } } @@ -2675,9 +2292,6 @@ tavor_qp_sqd2sqd(tavor_state_t *state, tavor_qphdl_t qp, status = tavor_set_addr_path(state, adds_vect, qpc_path, TAVOR_ADDRPATH_QP, qp); if (status != DDI_SUCCESS) { - TNF_PROBE_0(tavor_qp_sqd2sqd_setaddrpath_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_qp_sqd2sqd); return (status); } qpc_path->rnr_retry = rc->rc_rnr_retry_cnt; @@ -2707,10 +2321,6 @@ tavor_qp_sqd2sqd(tavor_state_t *state, tavor_qphdl_t qp, } else if (rc->rc_mig_state == IBT_STATE_REARMED) { qpc->pm_state = TAVOR_QP_PMSTATE_REARM; } else { - TNF_PROBE_1(tavor_qp_sqd2sqd_inv_mig_state_fail, - TAVOR_TNF_ERROR, "", tnf_uint, mig_state, - rc->rc_mig_state); - TAVOR_TNF_EXIT(tavor_qp_sqd2sqd); return (IBT_QP_APM_STATE_INVALID); } opmask |= TAVOR_CMD_OP_PM_STATE; @@ -2727,10 +2337,6 @@ tavor_qp_sqd2sqd(tavor_state_t *state, tavor_qphdl_t qp, qpc->pri_addr_path.pkey_indx = pkeyindx; opmask |= TAVOR_CMD_OP_PKEYINDX; } else { - TNF_PROBE_1(tavor_qp_sqd2sqd_inv_pkey_fail, - TAVOR_TNF_ERROR, "", tnf_uint, pkeyindx, - pkeyindx); - TAVOR_TNF_EXIT(tavor_qp_sqd2sqd); return (IBT_PKEY_IX_ILLEGAL); } } @@ -2745,10 +2351,6 @@ tavor_qp_sqd2sqd(tavor_state_t *state, tavor_qphdl_t qp, if (tavor_portnum_is_valid(state, portnum)) { qpc->pri_addr_path.portnum = portnum; } else { - TNF_PROBE_1(tavor_qp_sqd2sqd_inv_port_fail, - TAVOR_TNF_ERROR, "", tnf_uint, port, - portnum); - TAVOR_TNF_EXIT(tavor_qp_sqd2sqd); return (IBT_HCA_PORT_INVALID); } opmask |= TAVOR_CMD_OP_PRIM_PORT; @@ -2766,9 +2368,6 @@ tavor_qp_sqd2sqd(tavor_state_t *state, tavor_qphdl_t qp, status = tavor_set_addr_path(state, adds_vect, qpc_path, TAVOR_ADDRPATH_QP, qp); if (status != DDI_SUCCESS) { - TNF_PROBE_0(tavor_qp_sqd2sqd_setaddrpath_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_qp_sqd2sqd); return (status); } qpc_path->ack_timeout = rc->rc_alt_path.cep_timeout; @@ -2781,10 +2380,6 @@ tavor_qp_sqd2sqd(tavor_state_t *state, tavor_qphdl_t qp, if (tavor_portnum_is_valid(state, portnum)) { qpc->alt_addr_path.portnum = portnum; } else { - TNF_PROBE_1(tavor_qp_sqd2sqd_inv_altport_fail, - TAVOR_TNF_ERROR, "", tnf_uint, altport, - portnum); - TAVOR_TNF_EXIT(tavor_qp_sqd2sqd); return (IBT_HCA_PORT_INVALID); } @@ -2796,10 +2391,6 @@ tavor_qp_sqd2sqd(tavor_state_t *state, tavor_qphdl_t qp, if (tavor_pkeyindex_is_valid(state, pkeyindx)) { qpc->alt_addr_path.pkey_indx = pkeyindx; } else { - TNF_PROBE_1(tavor_qp_sqd2sqd_inv_altpkey_fail, - TAVOR_TNF_ERROR, "", tnf_uint, altpkeyindx, - pkeyindx); - TAVOR_TNF_EXIT(tavor_qp_sqd2sqd); return (IBT_PKEY_IX_ILLEGAL); } opmask |= TAVOR_CMD_OP_ALT_PATH; @@ -2812,13 +2403,8 @@ tavor_qp_sqd2sqd(tavor_state_t *state, tavor_qphdl_t qp, * parameter. */ if (flags & IBT_CEP_SET_RDMARA_OUT) { - rdma_ra_out = rc->rc_rdma_ra_out; if (tavor_qp_validate_init_depth(state, rc, &sra_max) != DDI_SUCCESS) { - TNF_PROBE_1(tavor_qp_sqd2sqd_inv_rdma_out_fail, - TAVOR_TNF_ERROR, "", tnf_uint, rdma_ra_out, - rdma_ra_out); - TAVOR_TNF_EXIT(tavor_qp_sqd2sqd); return (IBT_INVALID_PARAM); } qpc->sra_max = sra_max; @@ -2833,13 +2419,8 @@ tavor_qp_sqd2sqd(tavor_state_t *state, tavor_qphdl_t qp, * the appropriate flag in the "opmask" parameter. */ if (flags & IBT_CEP_SET_RDMARA_IN) { - rdma_ra_in = rc->rc_rdma_ra_in; if (tavor_qp_validate_resp_rsrc(state, rc, &rra_max) != DDI_SUCCESS) { - TNF_PROBE_1(tavor_qp_sqd2sqd_inv_rdma_in_fail, - TAVOR_TNF_ERROR, "", tnf_uint, rdma_ra_in, - rdma_ra_in); - TAVOR_TNF_EXIT(tavor_qp_sqd2sqd); return (IBT_INVALID_PARAM); } qpc->rra_max = rra_max; @@ -2916,9 +2497,6 @@ tavor_qp_sqd2sqd(tavor_state_t *state, tavor_qphdl_t qp, status = tavor_set_addr_path(state, adds_vect, qpc_path, TAVOR_ADDRPATH_QP, qp); if (status != DDI_SUCCESS) { - TNF_PROBE_0(tavor_qp_sqd2sqd_setaddrpath_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_qp_sqd2sqd); return (status); } @@ -2943,10 +2521,6 @@ tavor_qp_sqd2sqd(tavor_state_t *state, tavor_qphdl_t qp, } else if (uc->uc_mig_state == IBT_STATE_REARMED) { qpc->pm_state = TAVOR_QP_PMSTATE_REARM; } else { - TNF_PROBE_1(tavor_qp_sqd2sqd_inv_mig_state_fail, - TAVOR_TNF_ERROR, "", tnf_uint, mig_state, - uc->uc_mig_state); - TAVOR_TNF_EXIT(tavor_qp_sqd2sqd); return (IBT_QP_APM_STATE_INVALID); } opmask |= TAVOR_CMD_OP_PM_STATE; @@ -2963,10 +2537,6 @@ tavor_qp_sqd2sqd(tavor_state_t *state, tavor_qphdl_t qp, qpc->pri_addr_path.pkey_indx = pkeyindx; opmask |= TAVOR_CMD_OP_PKEYINDX; } else { - TNF_PROBE_1(tavor_qp_sqd2sqd_inv_pkey, - TAVOR_TNF_ERROR, "", tnf_uint, pkeyindx, - pkeyindx); - TAVOR_TNF_EXIT(tavor_qp_sqd2sqd); return (IBT_PKEY_IX_ILLEGAL); } } @@ -2983,9 +2553,6 @@ tavor_qp_sqd2sqd(tavor_state_t *state, tavor_qphdl_t qp, status = tavor_set_addr_path(state, adds_vect, qpc_path, TAVOR_ADDRPATH_QP, qp); if (status != DDI_SUCCESS) { - TNF_PROBE_0(tavor_qp_sqd2sqd_setaddrpath_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_qp_sqd2sqd); return (status); } @@ -2997,10 +2564,6 @@ tavor_qp_sqd2sqd(tavor_state_t *state, tavor_qphdl_t qp, if (tavor_portnum_is_valid(state, portnum)) { qpc->alt_addr_path.portnum = portnum; } else { - TNF_PROBE_1(tavor_qp_sqd2sqd_inv_altport_fail, - TAVOR_TNF_ERROR, "", tnf_uint, altport, - portnum); - TAVOR_TNF_EXIT(tavor_qp_sqd2sqd); return (IBT_HCA_PORT_INVALID); } @@ -3012,10 +2575,6 @@ tavor_qp_sqd2sqd(tavor_state_t *state, tavor_qphdl_t qp, if (tavor_pkeyindex_is_valid(state, pkeyindx)) { qpc->alt_addr_path.pkey_indx = pkeyindx; } else { - TNF_PROBE_1(tavor_qp_sqd2sqd_inv_altpkey_fail, - TAVOR_TNF_ERROR, "", tnf_uint, altpkeyindx, - pkeyindx); - TAVOR_TNF_EXIT(tavor_qp_sqd2sqd); return (IBT_PKEY_IX_ILLEGAL); } opmask |= TAVOR_CMD_OP_ALT_PATH; @@ -3027,9 +2586,6 @@ tavor_qp_sqd2sqd(tavor_state_t *state, tavor_qphdl_t qp, * and return failure */ TAVOR_WARNING(state, "unknown QP transport type in sqd2sqd"); - TNF_PROBE_0(tavor_qp_sqd2sqd_inv_transtype_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_qp_sqd2sqd); return (ibc_get_ci_failure(0)); } @@ -3047,19 +2603,12 @@ tavor_qp_sqd2sqd(tavor_state_t *state, tavor_qphdl_t qp, if (status != TAVOR_CMD_BAD_QP_STATE) { cmn_err(CE_CONT, "Tavor: SQD2SQD_QP command failed: " "%08x\n", status); - TNF_PROBE_1(tavor_qp_sqd2sqd_cmd_fail, - TAVOR_TNF_ERROR, "", tnf_uint, status, status); - TAVOR_TNF_EXIT(tavor_qp_sqd2sqd); return (ibc_get_ci_failure(0)); } else { - TNF_PROBE_0(tavor_qp_sqd2sqd_inv_qpstate_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_qp_sqd2sqd); return (IBT_QP_STATE_INVALID); } } - TAVOR_TNF_EXIT(tavor_qp_sqd2sqd); return (DDI_SUCCESS); } @@ -3077,8 +2626,6 @@ tavor_qp_sqerr2rts(tavor_state_t *state, tavor_qphdl_t qp, uint32_t opmask = 0; int status; - TAVOR_TNF_ENTER(tavor_qp_sqerr2rts); - ASSERT(MUTEX_HELD(&qp->qp_lock)); /* @@ -3123,9 +2670,6 @@ tavor_qp_sqerr2rts(tavor_state_t *state, tavor_qphdl_t qp, * and return failure */ TAVOR_WARNING(state, "unknown QP transport type in sqerr2rts"); - TNF_PROBE_0(tavor_qp_sqerr2rts_inv_transtype_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_qp_sqerr2rts); return (ibc_get_ci_failure(0)); } @@ -3143,19 +2687,12 @@ tavor_qp_sqerr2rts(tavor_state_t *state, tavor_qphdl_t qp, if (status != TAVOR_CMD_BAD_QP_STATE) { cmn_err(CE_CONT, "Tavor: SQERR2RTS_QP command failed: " "%08x\n", status); - TNF_PROBE_1(tavor_qp_sqerr2rts_cmd_fail, - TAVOR_TNF_ERROR, "", tnf_uint, status, status); - TAVOR_TNF_EXIT(tavor_qp_sqerr2rts); return (ibc_get_ci_failure(0)); } else { - TNF_PROBE_0(tavor_qp_sqerr2rts_inv_qpstate_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_qp_sqerr2rts); return (IBT_QP_STATE_INVALID); } } - TAVOR_TNF_EXIT(tavor_qp_sqerr2rts); return (DDI_SUCCESS); } @@ -3169,8 +2706,6 @@ tavor_qp_to_error(tavor_state_t *state, tavor_qphdl_t qp) { int status; - TAVOR_TNF_ENTER(tavor_qp_to_error); - ASSERT(MUTEX_HELD(&qp->qp_lock)); /* @@ -3186,13 +2721,9 @@ tavor_qp_to_error(tavor_state_t *state, tavor_qphdl_t qp) if (status != TAVOR_CMD_SUCCESS) { cmn_err(CE_CONT, "Tavor: TOERR_QP command failed: %08x\n", status); - TNF_PROBE_1(tavor_qp_to_error_cmd_fail, - TAVOR_TNF_ERROR, "", tnf_uint, status, status); - TAVOR_TNF_EXIT(tavor_qp_to_error); return (ibc_get_ci_failure(0)); } - TAVOR_TNF_EXIT(tavor_qp_to_error); return (DDI_SUCCESS); } @@ -3207,8 +2738,6 @@ tavor_qp_to_reset(tavor_state_t *state, tavor_qphdl_t qp) tavor_hw_qpc_t *qpc; int status; - TAVOR_TNF_ENTER(tavor_qp_to_reset); - ASSERT(MUTEX_HELD(&qp->qp_lock)); /* @@ -3229,13 +2758,9 @@ tavor_qp_to_reset(tavor_state_t *state, tavor_qphdl_t qp) if (status != TAVOR_CMD_SUCCESS) { cmn_err(CE_CONT, "Tavor: TORST_QP command failed: %08x\n", status); - TNF_PROBE_1(tavor_qp_to_reset_cmd_fail, - TAVOR_TNF_ERROR, "", tnf_uint, status, status); - TAVOR_TNF_EXIT(tavor_qp_to_reset); return (ibc_get_ci_failure(0)); } - TAVOR_TNF_EXIT(tavor_qp_to_reset); return (DDI_SUCCESS); } @@ -3250,8 +2775,6 @@ tavor_qp_reset2err(tavor_state_t *state, tavor_qphdl_t qp) tavor_hw_qpc_t *qpc; int status; - TAVOR_TNF_ENTER(tavor_qp_reset2err); - ASSERT(MUTEX_HELD(&qp->qp_lock)); /* @@ -3331,9 +2854,6 @@ tavor_qp_reset2err(tavor_state_t *state, tavor_qphdl_t qp) * and return failure */ TAVOR_WARNING(state, "unknown QP transport type in rst2err"); - TNF_PROBE_0(tavor_qp_reset2err_inv_transtype_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_qp_reset2err); return (ibc_get_ci_failure(0)); } @@ -3350,9 +2870,6 @@ tavor_qp_reset2err(tavor_state_t *state, tavor_qphdl_t qp) if (status != TAVOR_CMD_SUCCESS) { cmn_err(CE_CONT, "Tavor: RST2INIT_QP command failed: %08x\n", status); - TNF_PROBE_1(tavor_qp_reset2err_rst2init_cmd_fail, - TAVOR_TNF_ERROR, "", tnf_uint, status, status); - TAVOR_TNF_EXIT(tavor_qp_reset2err); return (ibc_get_ci_failure(0)); } @@ -3373,13 +2890,9 @@ tavor_qp_reset2err(tavor_state_t *state, tavor_qphdl_t qp) if (tavor_qp_to_reset(state, qp) != DDI_SUCCESS) { TAVOR_WARNING(state, "failed to reset QP context"); } - TNF_PROBE_1(tavor_qp_reset2err_toerr_cmd_fail, - TAVOR_TNF_ERROR, "", tnf_uint, status, status); - TAVOR_TNF_EXIT(tavor_qp_reset2err); return (ibc_get_ci_failure(0)); } - TAVOR_TNF_EXIT(tavor_qp_reset2err); return (DDI_SUCCESS); } diff --git a/usr/src/uts/common/io/ib/adapters/tavor/tavor_rsrc.c b/usr/src/uts/common/io/ib/adapters/tavor/tavor_rsrc.c index a79340442d..318845fc68 100644 --- a/usr/src/uts/common/io/ib/adapters/tavor/tavor_rsrc.c +++ b/usr/src/uts/common/io/ib/adapters/tavor/tavor_rsrc.c @@ -182,8 +182,6 @@ tavor_rsrc_alloc(tavor_state_t *state, tavor_rsrc_type_t rsrc, uint_t num, tavor_rsrc_t *tmp_rsrc_hdl; int flag, status = DDI_FAILURE; - TAVOR_TNF_ENTER(tavor_rsrc_alloc); - ASSERT(state != NULL); ASSERT(hdl != NULL); @@ -197,8 +195,6 @@ tavor_rsrc_alloc(tavor_state_t *state, tavor_rsrc_type_t rsrc, uint_t num, tmp_rsrc_hdl = (tavor_rsrc_t *)kmem_cache_alloc(state->ts_rsrc_cache, flag); if (tmp_rsrc_hdl == NULL) { - TNF_PROBE_0(tavor_rsrc_alloc_kmca_fail, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_rsrc_alloc); return (DDI_FAILURE); } _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*tmp_rsrc_hdl)) @@ -300,8 +296,6 @@ tavor_rsrc_alloc(tavor_state_t *state, tavor_rsrc_type_t rsrc, uint_t num, default: TAVOR_WARNING(state, "unexpected resource type in alloc"); - TNF_PROBE_0(tavor_rsrc_alloc_inv_rsrctype_fail, - TAVOR_TNF_ERROR, ""); break; } @@ -313,13 +307,9 @@ tavor_rsrc_alloc(tavor_state_t *state, tavor_rsrc_type_t rsrc, uint_t num, if (status != DDI_SUCCESS) { kmem_cache_free(state->ts_rsrc_cache, tmp_rsrc_hdl); tmp_rsrc_hdl = NULL; - TNF_PROBE_1(tavor_rsrc_alloc_fail, TAVOR_TNF_ERROR, "", - tnf_uint, rsrc_type, rsrc_pool->rsrc_type); - TAVOR_TNF_EXIT(tavor_rsrc_alloc); return (DDI_FAILURE); } else { *hdl = tmp_rsrc_hdl; - TAVOR_TNF_EXIT(tavor_rsrc_alloc); return (DDI_SUCCESS); } } @@ -334,8 +324,6 @@ tavor_rsrc_free(tavor_state_t *state, tavor_rsrc_t **hdl) { tavor_rsrc_pool_info_t *rsrc_pool; - TAVOR_TNF_ENTER(tavor_rsrc_free); - ASSERT(state != NULL); ASSERT(hdl != NULL); @@ -382,8 +370,6 @@ tavor_rsrc_free(tavor_state_t *state, tavor_rsrc_t **hdl) default: TAVOR_WARNING(state, "unexpected resource type in free"); - TNF_PROBE_0(tavor_rsrc_free_inv_rsrctype_fail, - TAVOR_TNF_ERROR, ""); break; } @@ -393,8 +379,6 @@ tavor_rsrc_free(tavor_state_t *state, tavor_rsrc_t **hdl) */ kmem_cache_free(state->ts_rsrc_cache, *hdl); *hdl = NULL; - - TAVOR_TNF_EXIT(tavor_rsrc_free); } @@ -424,9 +408,7 @@ tavor_rsrc_init_phase1(tavor_state_t *state) tavor_cfg_profile_t *cfgprof; uint64_t num, size; int status; - char *errormsg, *rsrc_name; - - TAVOR_TNF_ENTER(tavor_rsrc_init_phase1); + char *rsrc_name; ASSERT(state != NULL); @@ -478,8 +460,6 @@ tavor_rsrc_init_phase1(tavor_state_t *state) status = tavor_rsrc_mbox_init(state, &mbox_info); if (status != DDI_SUCCESS) { tavor_rsrc_fini(state, cleanup); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(DDI_FAILURE, "out mailboxes"); goto rsrcinitp1_fail; } cleanup = TAVOR_RSRC_CLEANUP_LEVEL1; @@ -494,8 +474,6 @@ tavor_rsrc_init_phase1(tavor_state_t *state) status = tavor_outmbox_list_init(state); if (status != DDI_SUCCESS) { tavor_rsrc_fini(state, cleanup); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(DDI_FAILURE, "out mailbox list"); goto rsrcinitp1_fail; } cleanup = TAVOR_RSRC_CLEANUP_LEVEL2; @@ -525,8 +503,6 @@ tavor_rsrc_init_phase1(tavor_state_t *state) status = tavor_rsrc_mbox_init(state, &mbox_info); if (status != DDI_SUCCESS) { tavor_rsrc_fini(state, cleanup); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(DDI_FAILURE, "out intr mailboxes"); goto rsrcinitp1_fail; } cleanup = TAVOR_RSRC_CLEANUP_LEVEL3; @@ -541,21 +517,15 @@ tavor_rsrc_init_phase1(tavor_state_t *state) status = tavor_intr_outmbox_list_init(state); if (status != DDI_SUCCESS) { tavor_rsrc_fini(state, cleanup); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(DDI_FAILURE, "out intr mailbox list"); goto rsrcinitp1_fail; } cleanup = TAVOR_RSRC_CLEANUP_PHASE1_COMPLETE; kmem_free(rsrc_name, TAVOR_RSRC_NAME_MAXLEN); - TAVOR_TNF_EXIT(tavor_rsrc_init_phase1); return (DDI_SUCCESS); rsrcinitp1_fail: kmem_free(rsrc_name, TAVOR_RSRC_NAME_MAXLEN); - TNF_PROBE_1(tavor_rsrc_init_phase1_fail, TAVOR_TNF_ERROR, "", - tnf_string, msg, errormsg); - TAVOR_TNF_EXIT(tavor_rsrc_init_phase1); return (status); } @@ -578,9 +548,7 @@ tavor_rsrc_init_phase2(tavor_state_t *state) uint_t mcg_size, mcg_size_shift; uint_t uarscr_size, mttsegment_sz; int status; - char *errormsg, *rsrc_name; - - TAVOR_TNF_ENTER(tavor_rsrc_init_phase2); + char *rsrc_name; ASSERT(state != NULL); @@ -611,8 +579,6 @@ tavor_rsrc_init_phase2(tavor_state_t *state) sizeof (uint64_t), NULL, NULL, NULL, 0, VM_SLEEP); if (state->ts_ddrvmem == NULL) { tavor_rsrc_fini(state, cleanup); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(DDI_FAILURE, "DDR vmem"); goto rsrcinitp2_fail; } cleanup = TAVOR_RSRC_CLEANUP_LEVEL5; @@ -652,8 +618,6 @@ tavor_rsrc_init_phase2(tavor_state_t *state) status = tavor_rsrc_hw_entries_init(state, &entry_info); if (status != DDI_SUCCESS) { tavor_rsrc_fini(state, cleanup); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(DDI_FAILURE, "MPT table"); goto rsrcinitp2_fail; } cleanup = TAVOR_RSRC_CLEANUP_LEVEL6; @@ -687,8 +651,6 @@ tavor_rsrc_init_phase2(tavor_state_t *state) status = tavor_rsrc_hw_entries_init(state, &entry_info); if (status != DDI_SUCCESS) { tavor_rsrc_fini(state, cleanup); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(DDI_FAILURE, "MTT table"); goto rsrcinitp2_fail; } cleanup = TAVOR_RSRC_CLEANUP_LEVEL7; @@ -721,8 +683,6 @@ tavor_rsrc_init_phase2(tavor_state_t *state) status = tavor_rsrc_hw_entries_init(state, &entry_info); if (status != DDI_SUCCESS) { tavor_rsrc_fini(state, cleanup); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(DDI_FAILURE, "QPC table"); goto rsrcinitp2_fail; } cleanup = TAVOR_RSRC_CLEANUP_LEVEL8; @@ -754,8 +714,6 @@ tavor_rsrc_init_phase2(tavor_state_t *state) status = tavor_rsrc_hw_entries_init(state, &entry_info); if (status != DDI_SUCCESS) { tavor_rsrc_fini(state, cleanup); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(DDI_FAILURE, "RDB table"); goto rsrcinitp2_fail; } cleanup = TAVOR_RSRC_CLEANUP_LEVEL9; @@ -788,8 +746,6 @@ tavor_rsrc_init_phase2(tavor_state_t *state) status = tavor_rsrc_hw_entries_init(state, &entry_info); if (status != DDI_SUCCESS) { tavor_rsrc_fini(state, cleanup); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(DDI_FAILURE, "CQC table"); goto rsrcinitp2_fail; } cleanup = TAVOR_RSRC_CLEANUP_LEVEL10; @@ -826,8 +782,6 @@ tavor_rsrc_init_phase2(tavor_state_t *state) status = tavor_rsrc_hw_entries_init(state, &entry_info); if (status != DDI_SUCCESS) { tavor_rsrc_fini(state, cleanup); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(DDI_FAILURE, "Extended QPC table"); goto rsrcinitp2_fail; } cleanup = TAVOR_RSRC_CLEANUP_LEVEL11; @@ -859,8 +813,6 @@ tavor_rsrc_init_phase2(tavor_state_t *state) status = tavor_rsrc_hw_entries_init(state, &entry_info); if (status != DDI_SUCCESS) { tavor_rsrc_fini(state, cleanup); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(DDI_FAILURE, "UDAV table"); goto rsrcinitp2_fail; } cleanup = TAVOR_RSRC_CLEANUP_LEVEL12; @@ -899,8 +851,6 @@ tavor_rsrc_init_phase2(tavor_state_t *state) status = tavor_rsrc_hw_entries_init(state, &entry_info); if (status != DDI_SUCCESS) { tavor_rsrc_fini(state, cleanup); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(DDI_FAILURE, "UAR scratch table"); goto rsrcinitp2_fail; } cleanup = TAVOR_RSRC_CLEANUP_LEVEL13; @@ -944,8 +894,6 @@ tavor_rsrc_init_phase2(tavor_state_t *state) status = tavor_rsrc_hw_entries_init(state, &entry_info); if (status != DDI_SUCCESS) { tavor_rsrc_fini(state, cleanup); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(DDI_FAILURE, "SRQC table"); goto rsrcinitp2_fail; } } @@ -976,8 +924,6 @@ tavor_rsrc_init_phase2(tavor_state_t *state) status = tavor_rsrc_mbox_init(state, &mbox_info); if (status != DDI_SUCCESS) { tavor_rsrc_fini(state, cleanup); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(DDI_FAILURE, "in mailboxes"); goto rsrcinitp2_fail; } cleanup = TAVOR_RSRC_CLEANUP_LEVEL15; @@ -992,8 +938,6 @@ tavor_rsrc_init_phase2(tavor_state_t *state) status = tavor_inmbox_list_init(state); if (status != DDI_SUCCESS) { tavor_rsrc_fini(state, cleanup); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(DDI_FAILURE, "in mailbox list"); goto rsrcinitp2_fail; } cleanup = TAVOR_RSRC_CLEANUP_LEVEL16; @@ -1023,8 +967,6 @@ tavor_rsrc_init_phase2(tavor_state_t *state) status = tavor_rsrc_mbox_init(state, &mbox_info); if (status != DDI_SUCCESS) { tavor_rsrc_fini(state, cleanup); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(DDI_FAILURE, "in intr mailboxes"); goto rsrcinitp2_fail; } cleanup = TAVOR_RSRC_CLEANUP_LEVEL17; @@ -1039,8 +981,6 @@ tavor_rsrc_init_phase2(tavor_state_t *state) status = tavor_intr_inmbox_list_init(state); if (status != DDI_SUCCESS) { tavor_rsrc_fini(state, cleanup); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(DDI_FAILURE, "in intr mailbox list"); goto rsrcinitp2_fail; } cleanup = TAVOR_RSRC_CLEANUP_LEVEL18; @@ -1053,8 +993,6 @@ tavor_rsrc_init_phase2(tavor_state_t *state) status = tavor_outstanding_cmdlist_init(state); if (status != DDI_SUCCESS) { tavor_rsrc_fini(state, cleanup); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(DDI_FAILURE, "outstanding cmd list"); goto rsrcinitp2_fail; } cleanup = TAVOR_RSRC_CLEANUP_LEVEL19; @@ -1065,8 +1003,6 @@ tavor_rsrc_init_phase2(tavor_state_t *state) status = tavor_rsrc_mcg_entry_get_size(state, &mcg_size_shift); if (status != DDI_SUCCESS) { tavor_rsrc_fini(state, cleanup); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(DDI_FAILURE, "failed get MCG size"); goto rsrcinitp2_fail; } mcg_size = TAVOR_MCGMEM_SZ(state); @@ -1101,8 +1037,6 @@ tavor_rsrc_init_phase2(tavor_state_t *state) status = tavor_rsrc_hw_entries_init(state, &entry_info); if (status != DDI_SUCCESS) { tavor_rsrc_fini(state, cleanup); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(DDI_FAILURE, "MCG table"); goto rsrcinitp2_fail; } cleanup = TAVOR_RSRC_CLEANUP_LEVEL20; @@ -1134,8 +1068,6 @@ tavor_rsrc_init_phase2(tavor_state_t *state) status = tavor_rsrc_hw_entries_init(state, &entry_info); if (status != DDI_SUCCESS) { tavor_rsrc_fini(state, cleanup); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(DDI_FAILURE, "EQC table"); goto rsrcinitp2_fail; } cleanup = TAVOR_RSRC_CLEANUP_LEVEL21; @@ -1170,8 +1102,6 @@ tavor_rsrc_init_phase2(tavor_state_t *state) status = tavor_rsrc_pd_handles_init(state, &hdl_info); if (status != DDI_SUCCESS) { tavor_rsrc_fini(state, cleanup); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(DDI_FAILURE, "PD handle"); goto rsrcinitp2_fail; } cleanup = TAVOR_RSRC_CLEANUP_LEVEL22; @@ -1198,8 +1128,6 @@ tavor_rsrc_init_phase2(tavor_state_t *state) status = tavor_rsrc_sw_handles_init(state, &hdl_info); if (status != DDI_SUCCESS) { tavor_rsrc_fini(state, cleanup); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(DDI_FAILURE, "MR handle"); goto rsrcinitp2_fail; } cleanup = TAVOR_RSRC_CLEANUP_LEVEL23; @@ -1226,8 +1154,6 @@ tavor_rsrc_init_phase2(tavor_state_t *state) status = tavor_rsrc_sw_handles_init(state, &hdl_info); if (status != DDI_SUCCESS) { tavor_rsrc_fini(state, cleanup); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(DDI_FAILURE, "EQ handle"); goto rsrcinitp2_fail; } cleanup = TAVOR_RSRC_CLEANUP_LEVEL24; @@ -1257,8 +1183,6 @@ tavor_rsrc_init_phase2(tavor_state_t *state) status = tavor_rsrc_sw_handles_init(state, &hdl_info); if (status != DDI_SUCCESS) { tavor_rsrc_fini(state, cleanup); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(DDI_FAILURE, "CQ handle"); goto rsrcinitp2_fail; } @@ -1308,8 +1232,6 @@ tavor_rsrc_init_phase2(tavor_state_t *state) status = tavor_rsrc_sw_handles_init(state, &hdl_info); if (status != DDI_SUCCESS) { tavor_rsrc_fini(state, cleanup); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(DDI_FAILURE, "SRQ handle"); goto rsrcinitp2_fail; } @@ -1347,8 +1269,6 @@ tavor_rsrc_init_phase2(tavor_state_t *state) status = tavor_rsrc_sw_handles_init(state, &hdl_info); if (status != DDI_SUCCESS) { tavor_rsrc_fini(state, cleanup); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(DDI_FAILURE, "AH handle"); goto rsrcinitp2_fail; } cleanup = TAVOR_RSRC_CLEANUP_LEVEL27; @@ -1378,8 +1298,6 @@ tavor_rsrc_init_phase2(tavor_state_t *state) status = tavor_rsrc_sw_handles_init(state, &hdl_info); if (status != DDI_SUCCESS) { tavor_rsrc_fini(state, cleanup); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(DDI_FAILURE, "QP handle"); goto rsrcinitp2_fail; } @@ -1417,8 +1335,6 @@ tavor_rsrc_init_phase2(tavor_state_t *state) status = tavor_rsrc_sw_handles_init(state, &hdl_info); if (status != DDI_SUCCESS) { tavor_rsrc_fini(state, cleanup); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(DDI_FAILURE, "reference count handle"); goto rsrcinitp2_fail; } cleanup = TAVOR_RSRC_CLEANUP_LEVEL29; @@ -1436,8 +1352,6 @@ tavor_rsrc_init_phase2(tavor_state_t *state) status = tavor_rsrc_sw_handles_init(state, &hdl_info); if (status != DDI_SUCCESS) { tavor_rsrc_fini(state, cleanup); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(DDI_FAILURE, "MCG handle"); goto rsrcinitp2_fail; } state->ts_mcghdl = hdl_info.swi_table_ptr; @@ -1481,21 +1395,15 @@ tavor_rsrc_init_phase2(tavor_state_t *state) status = tavor_rsrc_hw_entries_init(state, &entry_info); if (status != DDI_SUCCESS) { tavor_rsrc_fini(state, cleanup); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(DDI_FAILURE, "UAR page table"); goto rsrcinitp2_fail; } cleanup = TAVOR_RSRC_CLEANUP_ALL; kmem_free(rsrc_name, TAVOR_RSRC_NAME_MAXLEN); - TAVOR_TNF_EXIT(tavor_rsrc_init_phase2); return (DDI_SUCCESS); rsrcinitp2_fail: kmem_free(rsrc_name, TAVOR_RSRC_NAME_MAXLEN); - TNF_PROBE_1(tavor_rsrc_init_phase2_fail, TAVOR_TNF_ERROR, "", - tnf_string, msg, errormsg); - TAVOR_TNF_EXIT(tavor_rsrc_init_phase2); return (status); } @@ -1512,8 +1420,6 @@ tavor_rsrc_fini(tavor_state_t *state, tavor_rsrc_cleanup_level_t clean) tavor_rsrc_mbox_info_t mbox_info; tavor_cfg_profile_t *cfgprof; - TAVOR_TNF_ENTER(tavor_rsrc_fini); - ASSERT(state != NULL); cfgprof = state->ts_cfg_profile; @@ -1756,12 +1662,7 @@ tavor_rsrc_fini(tavor_state_t *state, tavor_rsrc_cleanup_level_t clean) default: TAVOR_WARNING(state, "unexpected resource cleanup level"); - TNF_PROBE_0(tavor_rsrc_fini_default_fail, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_rsrc_fini); - return; } - - TAVOR_TNF_EXIT(tavor_rsrc_fini); } @@ -1778,8 +1679,6 @@ tavor_rsrc_mbox_init(tavor_state_t *state, tavor_rsrc_mbox_info_t *info) uint64_t offset; uint_t dma_xfer_mode; - TAVOR_TNF_ENTER(tavor_rsrc_mbox_init); - ASSERT(state != NULL); ASSERT(info != NULL); @@ -1813,9 +1712,6 @@ tavor_rsrc_mbox_init(tavor_state_t *state, tavor_rsrc_mbox_info_t *info) if (rsrc_pool->rsrc_ddr_offset == NULL) { /* Unable to alloc space for mailboxes */ kmem_free(priv, sizeof (tavor_rsrc_priv_mbox_t)); - TNF_PROBE_0(tavor_rsrc_mbox_init_vma_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_rsrc_mbox_init); return (DDI_FAILURE); } @@ -1836,9 +1732,6 @@ tavor_rsrc_mbox_init(tavor_state_t *state, tavor_rsrc_mbox_info_t *info) rsrc_pool->rsrc_ddr_offset, rsrc_pool->rsrc_pool_size); kmem_free(priv, sizeof (tavor_rsrc_priv_mbox_t)); - TNF_PROBE_0(tavor_rsrc_mbox_init_vmem_create_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_rsrc_mbox_init); return (DDI_FAILURE); } rsrc_pool->rsrc_vmp = vmp; @@ -1848,7 +1741,6 @@ tavor_rsrc_mbox_init(tavor_state_t *state, tavor_rsrc_mbox_info_t *info) rsrc_pool->rsrc_vmp = NULL; } - TAVOR_TNF_EXIT(tavor_rsrc_mbox_init); return (DDI_SUCCESS); } @@ -1862,8 +1754,6 @@ tavor_rsrc_mbox_fini(tavor_state_t *state, tavor_rsrc_mbox_info_t *info) { tavor_rsrc_pool_info_t *rsrc_pool; - TAVOR_TNF_ENTER(tavor_rsrc_mbox_fini); - ASSERT(state != NULL); ASSERT(info != NULL); @@ -1883,8 +1773,6 @@ tavor_rsrc_mbox_fini(tavor_state_t *state, tavor_rsrc_mbox_info_t *info) /* Free up the private struct */ kmem_free(rsrc_pool->rsrc_private, sizeof (tavor_rsrc_priv_mbox_t)); - - TAVOR_TNF_EXIT(tavor_rsrc_mbox_fini); } @@ -1903,8 +1791,6 @@ tavor_rsrc_hw_entries_init(tavor_state_t *state, uint64_t offset; int status; - TAVOR_TNF_ENTER(tavor_rsrc_hw_entries_init); - ASSERT(state != NULL); ASSERT(info != NULL); @@ -1916,11 +1802,6 @@ tavor_rsrc_hw_entries_init(tavor_state_t *state, /* Make sure number of HW entries makes sense */ if (num_hwentry > max_hwentry) { - TNF_PROBE_2(tavor_rsrc_hw_entries_init_toomany_fail, - TAVOR_TNF_ERROR, "", tnf_string, errmsg, "number of HW " - "entries exceeds device maximum", tnf_uint, maxhw, - max_hwentry); - TAVOR_TNF_EXIT(tavor_rsrc_hw_entries_init); return (DDI_FAILURE); } @@ -1936,9 +1817,6 @@ tavor_rsrc_hw_entries_init(tavor_state_t *state, 0, 0, NULL, NULL, VM_NOSLEEP | VM_FIRSTFIT); if (rsrc_pool->rsrc_ddr_offset == NULL) { /* Unable to alloc space for aligned HW table */ - TNF_PROBE_0(tavor_rsrc_hw_entry_table_vmxalloc_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_rsrc_hw_entries_init); return (DDI_FAILURE); } @@ -1972,9 +1850,6 @@ tavor_rsrc_hw_entries_init(tavor_state_t *state, rsrc_pool->rsrc_ddr_offset, rsrc_pool->rsrc_pool_size); } - TNF_PROBE_0(tavor_rsrc_hw_entries_init_vmemcreate_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_rsrc_hw_entries_init); return (DDI_FAILURE); } rsrc_pool->rsrc_vmp = vmp; @@ -1997,15 +1872,11 @@ tavor_rsrc_hw_entries_init(tavor_state_t *state, rsrc_pool->rsrc_ddr_offset, rsrc_pool->rsrc_pool_size); } - TNF_PROBE_0(tavor_rsrc_hw_entries_init_pre_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_rsrc_hw_entries_init); return (DDI_FAILURE); } } rsrc_pool->rsrc_private = rsvd_rsrc; - TAVOR_TNF_EXIT(tavor_rsrc_hw_entries_init); return (DDI_SUCCESS); } @@ -2021,8 +1892,6 @@ tavor_rsrc_hw_entries_fini(tavor_state_t *state, tavor_rsrc_pool_info_t *rsrc_pool; tavor_rsrc_t *rsvd_rsrc; - TAVOR_TNF_ENTER(tavor_rsrc_hw_entries_fini); - ASSERT(state != NULL); ASSERT(info != NULL); @@ -2051,8 +1920,6 @@ tavor_rsrc_hw_entries_fini(tavor_state_t *state, vmem_xfree(state->ts_ddrvmem, rsrc_pool->rsrc_ddr_offset, rsrc_pool->rsrc_pool_size); } - - TAVOR_TNF_EXIT(tavor_rsrc_hw_entries_fini); } @@ -2067,8 +1934,6 @@ tavor_rsrc_sw_handles_init(tavor_state_t *state, tavor_rsrc_sw_hdl_info_t *info) tavor_rsrc_pool_info_t *rsrc_pool; uint64_t num_swhdl, max_swhdl, prealloc_sz; - TAVOR_TNF_ENTER(tavor_rsrc_sw_handles_init); - ASSERT(state != NULL); ASSERT(info != NULL); @@ -2080,10 +1945,6 @@ tavor_rsrc_sw_handles_init(tavor_state_t *state, tavor_rsrc_sw_hdl_info_t *info) /* Make sure number of SW handles makes sense */ if (num_swhdl > max_swhdl) { - TNF_PROBE_2(tavor_rsrc_sw_handles_init_toomany_fail, - TAVOR_TNF_ERROR, "", tnf_string, errmsg, "number of SW " - "handles exceeds maximum", tnf_uint, maxsw, max_swhdl); - TAVOR_TNF_EXIT(tavor_rsrc_sw_handles_init); return (DDI_FAILURE); } @@ -2105,7 +1966,6 @@ tavor_rsrc_sw_handles_init(tavor_state_t *state, tavor_rsrc_sw_hdl_info_t *info) KM_SLEEP); } - TAVOR_TNF_EXIT(tavor_rsrc_sw_handles_init); return (DDI_SUCCESS); } @@ -2121,8 +1981,6 @@ tavor_rsrc_sw_handles_fini(tavor_state_t *state, tavor_rsrc_sw_hdl_info_t *info) tavor_rsrc_pool_info_t *rsrc_pool; uint64_t num_swhdl, prealloc_sz; - TAVOR_TNF_ENTER(tavor_rsrc_sw_handles_fini); - ASSERT(state != NULL); ASSERT(info != NULL); @@ -2142,8 +2000,6 @@ tavor_rsrc_sw_handles_fini(tavor_state_t *state, tavor_rsrc_sw_hdl_info_t *info) if (info->swi_table_ptr != NULL) { kmem_free(info->swi_table_ptr, num_swhdl * prealloc_sz); } - - TAVOR_TNF_EXIT(tavor_rsrc_sw_handles_fini); } @@ -2159,8 +2015,6 @@ tavor_rsrc_pd_handles_init(tavor_state_t *state, tavor_rsrc_sw_hdl_info_t *info) char vmem_name[TAVOR_RSRC_NAME_MAXLEN]; int status; - TAVOR_TNF_ENTER(tavor_rsrc_pd_handles_init); - ASSERT(state != NULL); ASSERT(info != NULL); @@ -2170,8 +2024,6 @@ tavor_rsrc_pd_handles_init(tavor_state_t *state, tavor_rsrc_sw_hdl_info_t *info) /* Initialize the resource pool for software handle table */ status = tavor_rsrc_sw_handles_init(state, info); if (status != DDI_SUCCESS) { - TNF_PROBE_0(tavor_rsrc_pdhdl_alloc_fail, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_rsrc_pdhdl_alloc); return (DDI_FAILURE); } @@ -2185,14 +2037,10 @@ tavor_rsrc_pd_handles_init(tavor_state_t *state, tavor_rsrc_sw_hdl_info_t *info) /* Unable to create vmem arena */ info->swi_table_ptr = NULL; tavor_rsrc_sw_handles_fini(state, info); - TNF_PROBE_0(tavor_rsrc_pd_handles_init_vmem_create_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_rsrc_pd_handles_init); return (DDI_FAILURE); } rsrc_pool->rsrc_vmp = vmp; - TAVOR_TNF_EXIT(tavor_rsrc_pd_handles_init); return (DDI_SUCCESS); } @@ -2206,8 +2054,6 @@ tavor_rsrc_pd_handles_fini(tavor_state_t *state, tavor_rsrc_sw_hdl_info_t *info) { tavor_rsrc_pool_info_t *rsrc_pool; - TAVOR_TNF_ENTER(tavor_rsrc_pd_handles_fini); - ASSERT(state != NULL); ASSERT(info != NULL); @@ -2218,8 +2064,6 @@ tavor_rsrc_pd_handles_fini(tavor_state_t *state, tavor_rsrc_sw_hdl_info_t *info) /* Destroy the "tavor_sw_pd_t" kmem_cache */ tavor_rsrc_sw_handles_fini(state, info); - - TAVOR_TNF_EXIT(tavor_rsrc_pd_handles_fini); } @@ -2238,8 +2082,6 @@ tavor_rsrc_mbox_alloc(tavor_rsrc_pool_info_t *pool_info, uint_t num, size_t real_len, temp_len; int status; - TAVOR_TNF_ENTER(tavor_rsrc_mbox_alloc); - ASSERT(pool_info != NULL); ASSERT(hdl != NULL); @@ -2257,9 +2099,6 @@ tavor_rsrc_mbox_alloc(tavor_rsrc_pool_info_t *pool_info, uint_t num, status = ddi_dma_alloc_handle(priv->pmb_dip, &priv->pmb_dmaattr, DDI_DMA_SLEEP, NULL, &hdl->tr_dmahdl); if (status != DDI_SUCCESS) { - TNF_PROBE_1(tavor_rsrc_mbox_alloc_dmahdl_fail, TAVOR_TNF_ERROR, - "", tnf_uint, status, status); - TAVOR_TNF_EXIT(tavor_rsrc_mbox_alloc); return (DDI_FAILURE); } @@ -2272,9 +2111,6 @@ tavor_rsrc_mbox_alloc(tavor_rsrc_pool_info_t *pool_info, uint_t num, if (addr == NULL) { /* No more DDR available for mailbox entries */ ddi_dma_free_handle(&hdl->tr_dmahdl); - TNF_PROBE_0(tavor_rsrc_mbox_alloc_vma_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_rsrc_mbox_alloc); return (DDI_FAILURE); } hdl->tr_acchdl = priv->pmb_acchdl; @@ -2295,16 +2131,12 @@ tavor_rsrc_mbox_alloc(tavor_rsrc_pool_info_t *pool_info, uint_t num, if (status != DDI_SUCCESS) { /* No more sys memory available for mailbox entries */ ddi_dma_free_handle(&hdl->tr_dmahdl); - TNF_PROBE_0(tavor_rsrc_mbox_alloc_dma_memalloc_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_rsrc_mbox_alloc); return (DDI_FAILURE); } hdl->tr_addr = (void *)kaddr; hdl->tr_len = real_len; } - TAVOR_TNF_EXIT(tavor_rsrc_mbox_alloc); return (DDI_SUCCESS); } @@ -2319,8 +2151,6 @@ tavor_rsrc_mbox_free(tavor_rsrc_pool_info_t *pool_info, tavor_rsrc_t *hdl) void *addr; uint64_t offset; - TAVOR_TNF_ENTER(tavor_rsrc_mbox_free); - ASSERT(pool_info != NULL); ASSERT(hdl != NULL); @@ -2344,8 +2174,6 @@ tavor_rsrc_mbox_free(tavor_rsrc_pool_info_t *pool_info, tavor_rsrc_t *hdl) /* Free the DMA handle for the mailbox */ ddi_dma_free_handle(&hdl->tr_dmahdl); - - TAVOR_TNF_EXIT(tavor_rsrc_mbox_free); } @@ -2363,8 +2191,6 @@ tavor_rsrc_hw_entry_alloc(tavor_rsrc_pool_info_t *pool_info, uint_t num, uint32_t align; int flag; - TAVOR_TNF_ENTER(tavor_rsrc_hw_entry_alloc); - ASSERT(pool_info != NULL); ASSERT(hdl != NULL); @@ -2389,9 +2215,6 @@ tavor_rsrc_hw_entry_alloc(tavor_rsrc_pool_info_t *pool_info, uint_t num, align, 0, 0, NULL, NULL, flag | VM_FIRSTFIT); if (addr == NULL) { /* No more HW entries available */ - TNF_PROBE_0(tavor_rsrc_hw_entry_alloc_vmxa_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_rsrc_hw_entry_alloc); return (DDI_FAILURE); } @@ -2406,7 +2229,6 @@ tavor_rsrc_hw_entry_alloc(tavor_rsrc_pool_info_t *pool_info, uint_t num, (uintptr_t)pool_info->rsrc_start); hdl->tr_indx = (offset >> pool_info->rsrc_shift); - TAVOR_TNF_EXIT(tavor_rsrc_hw_entry_alloc); return (DDI_SUCCESS); } @@ -2421,8 +2243,6 @@ tavor_rsrc_hw_entry_free(tavor_rsrc_pool_info_t *pool_info, tavor_rsrc_t *hdl) void *addr; uint64_t offset; - TAVOR_TNF_ENTER(tavor_rsrc_hw_entry_free); - ASSERT(pool_info != NULL); ASSERT(hdl != NULL); @@ -2433,8 +2253,6 @@ tavor_rsrc_hw_entry_free(tavor_rsrc_pool_info_t *pool_info, tavor_rsrc_t *hdl) /* Use vmem_xfree() to free up the HW table entry */ vmem_xfree(pool_info->rsrc_vmp, addr, hdl->tr_len); - - TAVOR_TNF_EXIT(tavor_rsrc_hw_entry_free); } @@ -2449,8 +2267,6 @@ tavor_rsrc_swhdl_alloc(tavor_rsrc_pool_info_t *pool_info, uint_t sleepflag, void *addr; int flag; - TAVOR_TNF_ENTER(tavor_rsrc_swhdl_alloc); - ASSERT(pool_info != NULL); ASSERT(hdl != NULL); @@ -2458,15 +2274,11 @@ tavor_rsrc_swhdl_alloc(tavor_rsrc_pool_info_t *pool_info, uint_t sleepflag, flag = (sleepflag == TAVOR_SLEEP) ? KM_SLEEP : KM_NOSLEEP; addr = kmem_cache_alloc(pool_info->rsrc_private, flag); if (addr == NULL) { - TNF_PROBE_0(tavor_rsrc_swhdl_alloc_kmca_fail, TAVOR_TNF_ERROR, - ""); - TAVOR_TNF_EXIT(tavor_rsrc_swhdl_alloc); return (DDI_FAILURE); } hdl->tr_len = pool_info->rsrc_quantum; hdl->tr_addr = addr; - TAVOR_TNF_EXIT(tavor_rsrc_swhdl_alloc); return (DDI_SUCCESS); } @@ -2478,15 +2290,11 @@ tavor_rsrc_swhdl_alloc(tavor_rsrc_pool_info_t *pool_info, uint_t sleepflag, static void tavor_rsrc_swhdl_free(tavor_rsrc_pool_info_t *pool_info, tavor_rsrc_t *hdl) { - TAVOR_TNF_ENTER(tavor_rsrc_swhdl_free); - ASSERT(pool_info != NULL); ASSERT(hdl != NULL); /* Free the software handle structure */ kmem_cache_free(pool_info->rsrc_private, hdl->tr_addr); - - TAVOR_TNF_EXIT(tavor_rsrc_swhdl_free); } @@ -2502,16 +2310,12 @@ tavor_rsrc_pdhdl_alloc(tavor_rsrc_pool_info_t *pool_info, uint_t sleepflag, void *tmpaddr; int flag, status; - TAVOR_TNF_ENTER(tavor_rsrc_pdhdl_alloc); - ASSERT(pool_info != NULL); ASSERT(hdl != NULL); /* Allocate the software handle */ status = tavor_rsrc_swhdl_alloc(pool_info, sleepflag, hdl); if (status != DDI_SUCCESS) { - TNF_PROBE_0(tavor_rsrc_pdhdl_alloc_fail, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_rsrc_pdhdl_alloc); return (DDI_FAILURE); } addr = (tavor_pdhdl_t)hdl->tr_addr; @@ -2523,16 +2327,12 @@ tavor_rsrc_pdhdl_alloc(tavor_rsrc_pool_info_t *pool_info, uint_t sleepflag, if (tmpaddr == NULL) { /* No more PD number entries available */ tavor_rsrc_swhdl_free(pool_info, hdl); - TNF_PROBE_0(tavor_rsrc_pdhdl_alloc_vma_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_rsrc_pdhdl_alloc); return (DDI_FAILURE); } addr->pd_pdnum = (uint32_t)(uintptr_t)tmpaddr; addr->pd_rsrcp = hdl; hdl->tr_indx = addr->pd_pdnum; - TAVOR_TNF_EXIT(tavor_rsrc_pdhdl_alloc); return (DDI_SUCCESS); } @@ -2544,8 +2344,6 @@ tavor_rsrc_pdhdl_alloc(tavor_rsrc_pool_info_t *pool_info, uint_t sleepflag, static void tavor_rsrc_pdhdl_free(tavor_rsrc_pool_info_t *pool_info, tavor_rsrc_t *hdl) { - TAVOR_TNF_ENTER(tavor_rsrc_pdhdl_free); - ASSERT(pool_info != NULL); ASSERT(hdl != NULL); @@ -2554,8 +2352,6 @@ tavor_rsrc_pdhdl_free(tavor_rsrc_pool_info_t *pool_info, tavor_rsrc_t *hdl) /* Free the software handle structure */ tavor_rsrc_swhdl_free(pool_info, hdl); - - TAVOR_TNF_EXIT(tavor_rsrc_pdhdl_free); } @@ -2570,15 +2366,12 @@ tavor_rsrc_pdhdl_constructor(void *pd, void *priv, int flags) tavor_pdhdl_t pdhdl; tavor_state_t *state; - TAVOR_TNF_ENTER(tavor_rsrc_pdhdl_constructor); - pdhdl = (tavor_pdhdl_t)pd; state = (tavor_state_t *)priv; mutex_init(&pdhdl->pd_lock, NULL, MUTEX_DRIVER, DDI_INTR_PRI(state->ts_intrmsi_pri)); - TAVOR_TNF_EXIT(tavor_rsrc_pdhdl_constructor); return (DDI_SUCCESS); } @@ -2593,13 +2386,9 @@ tavor_rsrc_pdhdl_destructor(void *pd, void *priv) { tavor_pdhdl_t pdhdl; - TAVOR_TNF_ENTER(tavor_rsrc_pdhdl_destructor); - pdhdl = (tavor_pdhdl_t)pd; mutex_destroy(&pdhdl->pd_lock); - - TAVOR_TNF_EXIT(tavor_rsrc_pdhdl_destructor); } @@ -2614,8 +2403,6 @@ tavor_rsrc_cqhdl_constructor(void *cq, void *priv, int flags) tavor_cqhdl_t cqhdl; tavor_state_t *state; - TAVOR_TNF_ENTER(tavor_rsrc_cqhdl_constructor); - cqhdl = (tavor_cqhdl_t)cq; state = (tavor_state_t *)priv; @@ -2624,7 +2411,6 @@ tavor_rsrc_cqhdl_constructor(void *cq, void *priv, int flags) mutex_init(&cqhdl->cq_wrid_wqhdr_lock, NULL, MUTEX_DRIVER, DDI_INTR_PRI(state->ts_intrmsi_pri)); - TAVOR_TNF_EXIT(tavor_rsrc_cqhdl_constructor); return (DDI_SUCCESS); } @@ -2639,14 +2425,10 @@ tavor_rsrc_cqhdl_destructor(void *cq, void *priv) { tavor_cqhdl_t cqhdl; - TAVOR_TNF_ENTER(tavor_rsrc_cqhdl_destructor); - cqhdl = (tavor_cqhdl_t)cq; mutex_destroy(&cqhdl->cq_wrid_wqhdr_lock); mutex_destroy(&cqhdl->cq_lock); - - TAVOR_TNF_EXIT(tavor_rsrc_cqhdl_destructor); } @@ -2661,15 +2443,12 @@ tavor_rsrc_qphdl_constructor(void *qp, void *priv, int flags) tavor_qphdl_t qphdl; tavor_state_t *state; - TAVOR_TNF_ENTER(tavor_rsrc_qphdl_constructor); - qphdl = (tavor_qphdl_t)qp; state = (tavor_state_t *)priv; mutex_init(&qphdl->qp_lock, NULL, MUTEX_DRIVER, DDI_INTR_PRI(state->ts_intrmsi_pri)); - TAVOR_TNF_EXIT(tavor_rsrc_qphdl_constructor); return (DDI_SUCCESS); } @@ -2684,13 +2463,9 @@ tavor_rsrc_qphdl_destructor(void *qp, void *priv) { tavor_qphdl_t qphdl; - TAVOR_TNF_ENTER(tavor_rsrc_qphdl_destructor); - qphdl = (tavor_qphdl_t)qp; mutex_destroy(&qphdl->qp_lock); - - TAVOR_TNF_ENTER(tavor_rsrc_qphdl_destructor); } @@ -2705,15 +2480,12 @@ tavor_rsrc_srqhdl_constructor(void *srq, void *priv, int flags) tavor_srqhdl_t srqhdl; tavor_state_t *state; - TAVOR_TNF_ENTER(tavor_rsrc_srqhdl_constructor); - srqhdl = (tavor_srqhdl_t)srq; state = (tavor_state_t *)priv; mutex_init(&srqhdl->srq_lock, NULL, MUTEX_DRIVER, DDI_INTR_PRI(state->ts_intrmsi_pri)); - TAVOR_TNF_EXIT(tavor_rsrc_srqhdl_constructor); return (DDI_SUCCESS); } @@ -2728,13 +2500,9 @@ tavor_rsrc_srqhdl_destructor(void *srq, void *priv) { tavor_srqhdl_t srqhdl; - TAVOR_TNF_ENTER(tavor_rsrc_srqhdl_destructor); - srqhdl = (tavor_srqhdl_t)srq; mutex_destroy(&srqhdl->srq_lock); - - TAVOR_TNF_EXIT(tavor_rsrc_srqhdl_destructor); } @@ -2749,15 +2517,12 @@ tavor_rsrc_refcnt_constructor(void *rc, void *priv, int flags) tavor_sw_refcnt_t *refcnt; tavor_state_t *state; - TAVOR_TNF_ENTER(tavor_rsrc_refcnt_constructor); - refcnt = (tavor_sw_refcnt_t *)rc; state = (tavor_state_t *)priv; mutex_init(&refcnt->swrc_lock, NULL, MUTEX_DRIVER, DDI_INTR_PRI(state->ts_intrmsi_pri)); - TAVOR_TNF_EXIT(tavor_rsrc_refcnt_constructor); return (DDI_SUCCESS); } @@ -2772,13 +2537,9 @@ tavor_rsrc_refcnt_destructor(void *rc, void *priv) { tavor_sw_refcnt_t *refcnt; - TAVOR_TNF_ENTER(tavor_rsrc_refcnt_destructor); - refcnt = (tavor_sw_refcnt_t *)rc; mutex_destroy(&refcnt->swrc_lock); - - TAVOR_TNF_ENTER(tavor_rsrc_refcnt_destructor); } @@ -2793,15 +2554,12 @@ tavor_rsrc_ahhdl_constructor(void *ah, void *priv, int flags) tavor_ahhdl_t ahhdl; tavor_state_t *state; - TAVOR_TNF_ENTER(tavor_rsrc_ahhdl_constructor); - ahhdl = (tavor_ahhdl_t)ah; state = (tavor_state_t *)priv; mutex_init(&ahhdl->ah_lock, NULL, MUTEX_DRIVER, DDI_INTR_PRI(state->ts_intrmsi_pri)); - TAVOR_TNF_EXIT(tavor_rsrc_ahhdl_constructor); return (DDI_SUCCESS); } @@ -2816,13 +2574,9 @@ tavor_rsrc_ahhdl_destructor(void *ah, void *priv) { tavor_ahhdl_t ahhdl; - TAVOR_TNF_ENTER(tavor_rsrc_ahhdl_destructor); - ahhdl = (tavor_ahhdl_t)ah; mutex_destroy(&ahhdl->ah_lock); - - TAVOR_TNF_ENTER(tavor_rsrc_ahhdl_destructor); } @@ -2837,15 +2591,12 @@ tavor_rsrc_mrhdl_constructor(void *mr, void *priv, int flags) tavor_mrhdl_t mrhdl; tavor_state_t *state; - TAVOR_TNF_ENTER(tavor_rsrc_mrhdl_constructor); - mrhdl = (tavor_mrhdl_t)mr; state = (tavor_state_t *)priv; mutex_init(&mrhdl->mr_lock, NULL, MUTEX_DRIVER, DDI_INTR_PRI(state->ts_intrmsi_pri)); - TAVOR_TNF_EXIT(tavor_rsrc_mrhdl_constructor); return (DDI_SUCCESS); } @@ -2860,13 +2611,9 @@ tavor_rsrc_mrhdl_destructor(void *mr, void *priv) { tavor_mrhdl_t mrhdl; - TAVOR_TNF_ENTER(tavor_rsrc_mrhdl_destructor); - mrhdl = (tavor_mrhdl_t)mr; mutex_destroy(&mrhdl->mr_lock); - - TAVOR_TNF_ENTER(tavor_rsrc_mrhdl_destructor); } @@ -2878,8 +2625,6 @@ tavor_rsrc_mcg_entry_get_size(tavor_state_t *state, uint_t *mcg_size_shift) { uint_t num_qp_per_mcg, max_qp_per_mcg, log2; - TAVOR_TNF_ENTER(tavor_rsrc_mcg_entry_get_size); - /* * Round the configured number of QP per MCG to next larger * power-of-2 size and update. @@ -2895,15 +2640,11 @@ tavor_rsrc_mcg_entry_get_size(tavor_state_t *state, uint_t *mcg_size_shift) num_qp_per_mcg = state->ts_cfg_profile->cp_num_qp_per_mcg; max_qp_per_mcg = (1 << state->ts_devlim.log_max_qp_mcg); if (num_qp_per_mcg > max_qp_per_mcg) { - TNF_PROBE_1(tavor_rsrc_mcg_getsz_toomany_qppermcg_fail, - TAVOR_TNF_ERROR, "", tnf_uint, maxqpmcg, max_qp_per_mcg); - TAVOR_TNF_EXIT(tavor_rsrc_mcg_entry_get_size); return (DDI_FAILURE); } /* Return the (shift) size of an individual MCG HW entry */ *mcg_size_shift = log2 + 2; - TAVOR_TNF_EXIT(tavor_rsrc_mcg_entry_get_size); return (DDI_SUCCESS); } diff --git a/usr/src/uts/common/io/ib/adapters/tavor/tavor_srq.c b/usr/src/uts/common/io/ib/adapters/tavor/tavor_srq.c index 3f1e40d0ee..da0aecfb12 100644 --- a/usr/src/uts/common/io/ib/adapters/tavor/tavor_srq.c +++ b/usr/src/uts/common/io/ib/adapters/tavor/tavor_srq.c @@ -74,14 +74,11 @@ tavor_srq_alloc(tavor_state_t *state, tavor_srq_info_t *srqinfo, uint32_t uarpg; uint_t wq_location, dma_xfer_mode, srq_is_umap; int flag, status; - char *errormsg; uint_t max_sgl; uint_t wqesz; _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*sizes)) - TAVOR_TNF_ENTER(tavor_srq_alloc); - /* * Check the "options" flag. Currently this flag tells the driver * whether or not the SRQ's work queues should be come from normal @@ -116,8 +113,6 @@ tavor_srq_alloc(tavor_state_t *state, tavor_srq_info_t *srqinfo, status = tavor_umap_db_find(state->ts_instance, ddi_get_pid(), MLNX_UMAP_UARPG_RSRC, &value, 0, NULL); if (status != DDI_SUCCESS) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_INVALID_PARAM, "failed UAR page"); goto srqalloc_fail3; } uarpg = ((tavor_rsrc_t *)(uintptr_t)value)->tr_indx; @@ -129,16 +124,12 @@ tavor_srq_alloc(tavor_state_t *state, tavor_srq_info_t *srqinfo, /* Allocate an SRQ context entry */ status = tavor_rsrc_alloc(state, TAVOR_SRQC, 1, sleepflag, &srqc); if (status != DDI_SUCCESS) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_INSUFF_RESOURCE, "failed SRQ context"); goto srqalloc_fail1; } /* Allocate the SRQ Handle entry */ status = tavor_rsrc_alloc(state, TAVOR_SRQHDL, 1, sleepflag, &rsrc); if (status != DDI_SUCCESS) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_INSUFF_RESOURCE, "failed SRQ handle"); goto srqalloc_fail2; } @@ -159,8 +150,6 @@ tavor_srq_alloc(tavor_state_t *state, tavor_srq_info_t *srqinfo, srq->srq_srqnum, MLNX_UMAP_SRQMEM_RSRC, (uint64_t)(uintptr_t)rsrc); if (umapdb == NULL) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_INSUFF_RESOURCE, "failed umap add"); goto srqalloc_fail3; } } @@ -183,8 +172,6 @@ tavor_srq_alloc(tavor_state_t *state, tavor_srq_info_t *srqinfo, * then obviously we have a lot of cleanup to do before returning. */ if (log_srq_size > state->ts_cfg_profile->cp_log_max_srq_sz) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_HCA_WR_EXCEEDED, "max SRQ size"); goto srqalloc_fail4; } @@ -195,8 +182,6 @@ tavor_srq_alloc(tavor_state_t *state, tavor_srq_info_t *srqinfo, */ max_sgl = state->ts_cfg_profile->cp_srq_max_sgl; if (sizes->srq_sgl_sz > max_sgl) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_HCA_SGL_EXCEEDED, "max SRQ SGL"); goto srqalloc_fail4; } @@ -252,8 +237,6 @@ tavor_srq_alloc(tavor_state_t *state, tavor_srq_info_t *srqinfo, } status = tavor_queue_alloc(state, &srq->srq_wqinfo, sleepflag); if (status != DDI_SUCCESS) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_INSUFF_RESOURCE, "failed srq"); goto srqalloc_fail4; } buf = (uint32_t *)srq->srq_wqinfo.qa_buf_aligned; @@ -297,8 +280,6 @@ tavor_srq_alloc(tavor_state_t *state, tavor_srq_info_t *srqinfo, mr_op.mro_bind_override_addr = 1; status = tavor_mr_register(state, pd, &mr_attr, &mr, &mr_op); if (status != DDI_SUCCESS) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_INSUFF_RESOURCE, "failed register mr"); goto srqalloc_fail5; } _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*mr)) @@ -318,16 +299,12 @@ tavor_srq_alloc(tavor_state_t *state, tavor_srq_info_t *srqinfo, */ srq->srq_wrid_wql = tavor_wrid_wql_create(state); if (srq->srq_wrid_wql == NULL) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_INSUFF_RESOURCE, "failed wql create"); goto srqalloc_fail6; } _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*(srq->srq_wrid_wql))) srq->srq_wridlist = tavor_wrid_get_list(1 << log_srq_size); if (srq->srq_wridlist == NULL) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_INSUFF_RESOURCE, "failed wridlist create"); goto srqalloc_fail7; } _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*(srq->srq_wridlist))) @@ -379,10 +356,6 @@ tavor_srq_alloc(tavor_state_t *state, tavor_srq_info_t *srqinfo, if (status != TAVOR_CMD_SUCCESS) { cmn_err(CE_CONT, "Tavor: SW2HW_SRQ command failed: %08x\n", status); - TNF_PROBE_1(tavor_srq_alloc_sw2hw_srq_cmd_fail, - TAVOR_TNF_ERROR, "", tnf_uint, status, status); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_FAILURE, "tavor SW2HW_SRQ command"); goto srqalloc_fail8; } @@ -433,7 +406,6 @@ tavor_srq_alloc(tavor_state_t *state, tavor_srq_info_t *srqinfo, *srqhdl = srq; - TAVOR_TNF_EXIT(tavor_srq_alloc); return (status); /* @@ -463,9 +435,6 @@ srqalloc_fail2: srqalloc_fail1: tavor_pd_refcnt_dec(pd); srqalloc_fail: - TNF_PROBE_1(tavor_srq_alloc_fail, TAVOR_TNF_ERROR, "", - tnf_string, msg, errormsg); - TAVOR_TNF_EXIT(tavor_srq_alloc); return (status); } @@ -490,8 +459,6 @@ tavor_srq_free(tavor_state_t *state, tavor_srqhdl_t *srqhdl, uint_t sleepflag) uint_t maxprot; int status; - TAVOR_TNF_ENTER(tavor_srq_free); - /* * Pull all the necessary information from the Tavor Shared Receive * Queue handle. This is necessary here because the resource for the @@ -511,9 +478,6 @@ tavor_srq_free(tavor_state_t *state, tavor_srqhdl_t *srqhdl, uint_t sleepflag) */ if (srq->srq_refcnt != 0) { mutex_exit(&srq->srq_lock); - TNF_PROBE_1(tavor_srq_free_refcnt_fail, TAVOR_TNF_ERROR, "", - tnf_int, refcnt, srq->srq_refcnt); - TAVOR_TNF_EXIT(tavor_srq_free); return (IBT_SRQ_IN_USE); } @@ -532,7 +496,6 @@ tavor_srq_free(tavor_state_t *state, tavor_srqhdl_t *srqhdl, uint_t sleepflag) if (status != DDI_SUCCESS) { mutex_exit(&srq->srq_lock); TAVOR_WARNING(state, "failed to find in database"); - TAVOR_TNF_EXIT(tavor_srq_free); return (ibc_get_ci_failure(0)); } tavor_umap_db_free(umapdb); @@ -545,7 +508,6 @@ tavor_srq_free(tavor_state_t *state, tavor_srqhdl_t *srqhdl, uint_t sleepflag) mutex_exit(&srq->srq_lock); TAVOR_WARNING(state, "failed in SRQ memory " "devmap_devmem_remap()"); - TAVOR_TNF_EXIT(tavor_srq_free); return (ibc_get_ci_failure(0)); } srq->srq_umap_dhp = (devmap_cookie_t)NULL; @@ -575,9 +537,6 @@ tavor_srq_free(tavor_state_t *state, tavor_srqhdl_t *srqhdl, uint_t sleepflag) TAVOR_WARNING(state, "failed to reclaim SRQC ownership"); cmn_err(CE_CONT, "Tavor: HW2SW_SRQ command failed: %08x\n", status); - TNF_PROBE_1(tavor_srq_free_hw2sw_srq_cmd_fail, - TAVOR_TNF_ERROR, "", tnf_uint, status, status); - TAVOR_TNF_EXIT(tavor_srq_free); return (IBT_FAILURE); } @@ -591,8 +550,6 @@ tavor_srq_free(tavor_state_t *state, tavor_srqhdl_t *srqhdl, uint_t sleepflag) sleepflag); if (status != DDI_SUCCESS) { TAVOR_WARNING(state, "failed to deregister SRQ memory"); - TNF_PROBE_0(tavor_srq_free_dereg_mr_fail, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_srq_free); return (IBT_FAILURE); } @@ -626,7 +583,6 @@ tavor_srq_free(tavor_state_t *state, tavor_srqhdl_t *srqhdl, uint_t sleepflag) /* Set the srqhdl pointer to NULL and return success */ *srqhdl = NULL; - TAVOR_TNF_EXIT(tavor_srq_free); return (DDI_SUCCESS); } @@ -656,9 +612,6 @@ tavor_srq_modify(tavor_state_t *state, tavor_srqhdl_t srq, uint_t size, uint_t srq_sync, log_srq_size, maxprot; uint_t wq_location; int status; - char *errormsg; - - TAVOR_TNF_ENTER(tavor_srq_modify); /* * Check the "inddr" flag. This flag tells the driver whether or not @@ -673,9 +626,6 @@ tavor_srq_modify(tavor_state_t *state, tavor_srqhdl_t srq, uint_t size, */ max_srq_size = (1 << state->ts_cfg_profile->cp_log_max_srq_sz); if (size > max_srq_size) { - TNF_PROBE_0(tavor_srq_modify_size_larger_than_maxsize, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_srq_modify); return (IBT_HCA_WR_EXCEEDED); } @@ -696,8 +646,6 @@ tavor_srq_modify(tavor_state_t *state, tavor_srqhdl_t srq, uint_t size, * with the device limits and/or software-configured limits). */ if (log_srq_size > state->ts_cfg_profile->cp_log_max_srq_sz) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_HCA_WR_EXCEEDED, "max SRQ size"); goto srqmodify_fail; } @@ -724,8 +672,6 @@ tavor_srq_modify(tavor_state_t *state, tavor_srqhdl_t srq, uint_t size, } status = tavor_queue_alloc(state, &new_srqinfo, sleepflag); if (status != DDI_SUCCESS) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_INSUFF_RESOURCE, "failed srq"); goto srqmodify_fail; } buf = (uint32_t *)new_srqinfo.qa_buf_aligned; @@ -738,9 +684,6 @@ tavor_srq_modify(tavor_state_t *state, tavor_srqhdl_t srq, uint_t size, wre_new = (tavor_wrid_entry_t *)kmem_zalloc((1 << log_srq_size) * sizeof (tavor_wrid_entry_t), sleepflag); if (wre_new == NULL) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(IBT_INSUFF_RESOURCE, - "failed wre_new alloc"); goto srqmodify_fail; } @@ -778,8 +721,6 @@ tavor_srq_modify(tavor_state_t *state, tavor_srqhdl_t srq, uint_t size, status = tavor_mr_mtt_bind(state, &bind, new_srqinfo.qa_dmahdl, &mtt, &mtt_pgsize_bits); if (status != DDI_SUCCESS) { - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(status, "failed mtt bind"); kmem_free(wre_new, srq->srq_wq_bufsz * sizeof (tavor_wrid_entry_t)); tavor_queue_free(state, &new_srqinfo); @@ -863,9 +804,6 @@ tavor_srq_modify(tavor_state_t *state, tavor_srqhdl_t srq, uint_t size, if (status != TAVOR_CMD_SUCCESS) { cmn_err(CE_CONT, "Tavor: MODIFY_MPT command failed: %08x\n", status); - TNF_PROBE_1(tavor_mr_common_reg_sw2hw_mpt_cmd_fail, - TAVOR_TNF_ERROR, "", tnf_uint, status, status); - TAVOR_TNF_FAIL(status, "MODIFY_MPT command failed"); (void) tavor_mr_mtt_unbind(state, &srq->srq_mrhdl->mr_bindinfo, srq->srq_mrhdl->mr_mttrsrcp); kmem_free(wre_new, srq->srq_wq_bufsz * @@ -966,7 +904,6 @@ tavor_srq_modify(tavor_state_t *state, tavor_srqhdl_t srq, uint_t size, kmem_free(wre_old, srq_old_bufsz * sizeof (tavor_wrid_entry_t)); } - TAVOR_TNF_EXIT(tavor_srq_modify); return (ibc_get_ci_failure(0)); } srq->srq_umap_dhp = (devmap_cookie_t)NULL; @@ -984,9 +921,6 @@ tavor_srq_modify(tavor_state_t *state, tavor_srqhdl_t srq, uint_t size, status = tavor_mr_mtt_unbind(state, &old_bind, old_mtt); if (status != DDI_SUCCESS) { TAVOR_WARNING(state, "failed to unbind old SRQ memory"); - /* Set "status" and "errormsg" and goto failure */ - TAVOR_TNF_FAIL(ibc_get_ci_failure(0), - "failed to unbind (old)"); goto srqmodify_fail; } @@ -1007,13 +941,9 @@ tavor_srq_modify(tavor_state_t *state, tavor_srqhdl_t srq, uint_t size, *real_size = (1 << log_srq_size); } - TAVOR_TNF_EXIT(tavor_srq_modify); return (DDI_SUCCESS); srqmodify_fail: - TNF_PROBE_1(tavor_srq_modify_fail, TAVOR_TNF_ERROR, "", - tnf_string, msg, errormsg); - TAVOR_TNF_EXIT(tavor_srq_modify); return (status); } @@ -1026,8 +956,6 @@ void tavor_srq_refcnt_inc(tavor_srqhdl_t srq) { mutex_enter(&srq->srq_lock); - TNF_PROBE_1_DEBUG(tavor_srq_refcnt_inc, TAVOR_TNF_TRACE, "", - tnf_uint, refcnt, srq->srq_refcnt); srq->srq_refcnt++; mutex_exit(&srq->srq_lock); } @@ -1042,8 +970,6 @@ tavor_srq_refcnt_dec(tavor_srqhdl_t srq) { mutex_enter(&srq->srq_lock); srq->srq_refcnt--; - TNF_PROBE_1_DEBUG(tavor_srq_refcnt_dec, TAVOR_TNF_TRACE, "", - tnf_uint, refcnt, srq->srq_refcnt); mutex_exit(&srq->srq_lock); } @@ -1089,8 +1015,6 @@ tavor_srq_sgl_to_logwqesz(tavor_state_t *state, uint_t num_sgl, { uint_t max_size, log2, actual_sgl; - TAVOR_TNF_ENTER(tavor_srq_sgl_to_logwqesz); - switch (wq_type) { case TAVOR_QP_WQ_TYPE_RECVQ: /* @@ -1113,14 +1037,10 @@ tavor_srq_sgl_to_logwqesz(tavor_state_t *state, uint_t num_sgl, default: TAVOR_WARNING(state, "unexpected work queue type"); - TNF_PROBE_0(tavor_srq_sgl_to_logwqesz_inv_wqtype_fail, - TAVOR_TNF_ERROR, ""); break; } /* Fill in the return values */ *logwqesz = log2; *max_sgl = min(state->ts_cfg_profile->cp_srq_max_sgl, actual_sgl); - - TAVOR_TNF_EXIT(tavor_qp_sgl_to_logwqesz); } diff --git a/usr/src/uts/common/io/ib/adapters/tavor/tavor_stats.c b/usr/src/uts/common/io/ib/adapters/tavor/tavor_stats.c index aa9e0889ae..971c880518 100644 --- a/usr/src/uts/common/io/ib/adapters/tavor/tavor_stats.c +++ b/usr/src/uts/common/io/ib/adapters/tavor/tavor_stats.c @@ -119,14 +119,10 @@ tavor_kstat_init(tavor_state_t *state) uint_t numports; int i; - TAVOR_TNF_ENTER(tavor_kstat_init); - /* Allocate a kstat info structure */ ksi = (tavor_ks_info_t *)kmem_zalloc(sizeof (tavor_ks_info_t), KM_SLEEP); if (ksi == NULL) { - TNF_PROBE_0(tavor_kstat_init_kma_fail, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_kstat_init); return (DDI_FAILURE); } state->ts_ks_info = ksi; @@ -141,8 +137,6 @@ tavor_kstat_init(tavor_state_t *state) ksi->tki_picN_ksp[i] = tavor_kstat_picN_create(state, i, TAVOR_CNTR_NUMENTRIES, tavor_ib_perfcnt_list); if (ksi->tki_picN_ksp[i] == NULL) { - TNF_PROBE_0(tavor_kstat_init_picN_fail, - TAVOR_TNF_ERROR, ""); goto kstat_init_fail; } @@ -156,7 +150,6 @@ tavor_kstat_init(tavor_state_t *state) ksi->tki_cntr_ksp = tavor_kstat_cntr_create(state, numports, tavor_kstat_cntr_update); if (ksi->tki_cntr_ksp == NULL) { - TNF_PROBE_0(tavor_kstat_init_cntr_fail, TAVOR_TNF_ERROR, ""); goto kstat_init_fail; } @@ -176,7 +169,6 @@ tavor_kstat_init(tavor_state_t *state) mutex_init(&ksi->tki_perfcntr64_lock, NULL, MUTEX_DRIVER, NULL); cv_init(&ksi->tki_perfcntr64_cv, NULL, CV_DRIVER, NULL); - TAVOR_TNF_EXIT(tavor_kstat_init); return (DDI_SUCCESS); @@ -198,7 +190,6 @@ kstat_init_fail: /* Free the kstat info structure */ kmem_free(ksi, sizeof (tavor_ks_info_t)); - TAVOR_TNF_EXIT(tavor_kstat_init); return (DDI_FAILURE); } @@ -214,8 +205,6 @@ tavor_kstat_fini(tavor_state_t *state) uint_t numports; int i; - TAVOR_TNF_ENTER(tavor_kstat_fini); - /* Get pointer to kstat info */ ksi = state->ts_ks_info; @@ -246,8 +235,6 @@ tavor_kstat_fini(tavor_state_t *state) /* Free the kstat info structure */ kmem_free(ksi, sizeof (tavor_ks_info_t)); - - TAVOR_TNF_EXIT(tavor_kstat_fini); } @@ -265,8 +252,6 @@ tavor_kstat_picN_create(tavor_state_t *state, int num_pic, int num_evt, char *drv_name; char pic_name[16]; - TAVOR_TNF_ENTER(tavor_kstat_picN_create); - /* * Create the "picN" kstat. In the steps, below we will attach * all of our named event types to it. @@ -277,9 +262,6 @@ tavor_kstat_picN_create(tavor_state_t *state, int num_pic, int num_evt, picN_ksp = kstat_create(drv_name, drv_instance, pic_name, "bus", KSTAT_TYPE_NAMED, num_evt, 0); if (picN_ksp == NULL) { - TNF_PROBE_0(tavor_kstat_picN_create_kstat_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_kstat_picN_create); return (NULL); } pic_named_data = (struct kstat_named *)(picN_ksp->ks_data); @@ -305,7 +287,6 @@ tavor_kstat_picN_create(tavor_state_t *state, int num_pic, int num_evt, /* Install the kstat */ kstat_install(picN_ksp); - TAVOR_TNF_EXIT(tavor_kstat_picN_create); return (picN_ksp); } @@ -324,8 +305,6 @@ tavor_kstat_cntr_create(tavor_state_t *state, int num_pic, char *drv_name; char pic_str[16]; - TAVOR_TNF_ENTER(tavor_kstat_cntr_create); - /* * Create the "counters" kstat. In the steps, below we will attach * all of our "pic" to it. Note: The size of this kstat is @@ -336,9 +315,6 @@ tavor_kstat_cntr_create(tavor_state_t *state, int num_pic, cntr_ksp = kstat_create(drv_name, drv_instance, "counters", "bus", KSTAT_TYPE_NAMED, num_pic + 1, KSTAT_FLAG_WRITABLE); if (cntr_ksp == NULL) { - TNF_PROBE_0(tavor_kstat_picN_create_kstat_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_kstat_cntr_create); return (NULL); } cntr_named_data = (struct kstat_named *)(cntr_ksp->ks_data); @@ -364,7 +340,6 @@ tavor_kstat_cntr_create(tavor_state_t *state, int num_pic, /* Install the kstat */ kstat_install(cntr_ksp); - TAVOR_TNF_ENTER(tavor_kstat_cntr_create); return (cntr_ksp); } @@ -385,8 +360,6 @@ tavor_kstat_cntr_update(kstat_t *ksp, int rw) uint32_t shift, mask, oldval; uint_t numports, indx; - TAVOR_TNF_ENTER(tavor_kstat_cntr_update); - /* * Extract the Tavor softstate pointer, kstat data, pointer to the * kstat info structure, and pointer to the tki_ib_perfcnt[] array @@ -420,7 +393,6 @@ tavor_kstat_cntr_update(kstat_t *ksp, int rw) if (rw == KSTAT_WRITE) { /* Update the stored "pcr" value */ ksi->tki_pcr = data[0].value.ui64; - TAVOR_TNF_EXIT(tavor_kstat_cntr_update); return (0); } else { /* @@ -479,7 +451,6 @@ tavor_kstat_cntr_update(kstat_t *ksp, int rw) data[2].value.ui64 = ksi->tki_pic1; } - TAVOR_TNF_EXIT(tavor_kstat_cntr_update); return (0); } } diff --git a/usr/src/uts/common/io/ib/adapters/tavor/tavor_umap.c b/usr/src/uts/common/io/ib/adapters/tavor/tavor_umap.c index fc07c44aa5..86edf1f5cc 100644 --- a/usr/src/uts/common/io/ib/adapters/tavor/tavor_umap.c +++ b/usr/src/uts/common/io/ib/adapters/tavor/tavor_umap.c @@ -123,14 +123,10 @@ tavor_devmap(dev_t dev, devmap_cookie_t dhp, offset_t off, size_t len, uint_t type; int err, status; - TAVOR_TNF_ENTER(tavor_devmap); - /* Get Tavor softstate structure from instance */ instance = TAVOR_DEV_INSTANCE(dev); state = ddi_get_soft_state(tavor_statep, instance); if (state == NULL) { - TNF_PROBE_0(tavor_devmap_gss_fail, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_devmap); return (ENXIO); } @@ -139,9 +135,6 @@ tavor_devmap(dev_t dev, devmap_cookie_t dhp, offset_t off, size_t len, * "maintenance mode". */ if (state->ts_operational_mode == TAVOR_MAINTENANCE_MODE) { - TNF_PROBE_0(tavor_devmap_maintenance_mode_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_devmap); return (EFAULT); } @@ -166,9 +159,6 @@ tavor_devmap(dev_t dev, devmap_cookie_t dhp, offset_t off, size_t len, * same process attempting to mmap() UAR page. */ if (key != ddi_get_pid()) { - TNF_PROBE_0(tavor_devmap_uarpg_invpid_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_devmap); return (EINVAL); } @@ -176,9 +166,6 @@ tavor_devmap(dev_t dev, devmap_cookie_t dhp, offset_t off, size_t len, status = tavor_umap_uarpg(state, dhp, rsrcp, maplen, &err); if (status != DDI_SUCCESS) { - TNF_PROBE_0(tavor_devmap_uarpg_map_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_devmap); return (err); } break; @@ -188,9 +175,6 @@ tavor_devmap(dev_t dev, devmap_cookie_t dhp, offset_t off, size_t len, status = tavor_umap_cqmem(state, dhp, rsrcp, off, maplen, &err); if (status != DDI_SUCCESS) { - TNF_PROBE_0(tavor_devmap_cqmem_map_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_devmap); return (err); } break; @@ -200,9 +184,6 @@ tavor_devmap(dev_t dev, devmap_cookie_t dhp, offset_t off, size_t len, status = tavor_umap_qpmem(state, dhp, rsrcp, off, maplen, &err); if (status != DDI_SUCCESS) { - TNF_PROBE_0(tavor_devmap_qpmem_map_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_devmap); return (err); } break; @@ -212,27 +193,18 @@ tavor_devmap(dev_t dev, devmap_cookie_t dhp, offset_t off, size_t len, status = tavor_umap_srqmem(state, dhp, rsrcp, off, maplen, &err); if (status != DDI_SUCCESS) { - TNF_PROBE_0(tavor_devmap_srqmem_map_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_devmap); return (err); } break; default: TAVOR_WARNING(state, "unexpected rsrc type in devmap"); - TNF_PROBE_0(tavor_devmap_invrsrc_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_devmap); return (EINVAL); } } else { - TNF_PROBE_0(tavor_devmap_umap_lookup_fail, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_devmap); return (EINVAL); } - TAVOR_TNF_EXIT(tavor_devmap); return (0); } @@ -248,8 +220,6 @@ tavor_umap_uarpg(tavor_state_t *state, devmap_cookie_t dhp, int status; uint_t maxprot; - TAVOR_TNF_ENTER(tavor_umap_uarpg); - /* Map out the UAR page (doorbell page) */ maxprot = (PROT_READ | PROT_WRITE | PROT_USER); status = devmap_devmem_setup(dhp, state->ts_dip, @@ -258,13 +228,10 @@ tavor_umap_uarpg(tavor_state_t *state, devmap_cookie_t dhp, &state->ts_reg_accattr); if (status < 0) { *err = status; - TNF_PROBE_0(tavor_umap_uarpg_devmap_fail, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_umap_uarpg); return (DDI_FAILURE); } *maplen = PAGESIZE; - TAVOR_TNF_EXIT(tavor_umap_uarpg); return (DDI_SUCCESS); } @@ -283,8 +250,6 @@ tavor_umap_cqmem(tavor_state_t *state, devmap_cookie_t dhp, uint_t maxprot; int status; - TAVOR_TNF_ENTER(tavor_umap_cqmem); - /* Extract the Tavor CQ handle pointer from the tavor_rsrc_t */ cq = (tavor_cqhdl_t)rsrcp->tr_addr; @@ -298,13 +263,10 @@ tavor_umap_cqmem(tavor_state_t *state, devmap_cookie_t dhp, maxprot, (DEVMAP_ALLOW_REMAP | DEVMAP_DEFAULTS), NULL); if (status < 0) { *err = status; - TNF_PROBE_0(tavor_umap_cqmem_devmap_fail, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_umap_cqmem); return (DDI_FAILURE); } *maplen = size; - TAVOR_TNF_EXIT(tavor_umap_cqmem); return (DDI_SUCCESS); } @@ -324,8 +286,6 @@ tavor_umap_qpmem(tavor_state_t *state, devmap_cookie_t dhp, uint_t maxprot; int status; - TAVOR_TNF_ENTER(tavor_umap_qpmem); - /* Extract the Tavor QP handle pointer from the tavor_rsrc_t */ qp = (tavor_qphdl_t)rsrcp->tr_addr; @@ -346,13 +306,10 @@ tavor_umap_qpmem(tavor_state_t *state, devmap_cookie_t dhp, size, maxprot, (DEVMAP_ALLOW_REMAP | DEVMAP_DEFAULTS), NULL); if (status < 0) { *err = status; - TNF_PROBE_0(tavor_umap_qpmem_devmap_fail, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_umap_qpmem); return (DDI_FAILURE); } *maplen = size; - TAVOR_TNF_EXIT(tavor_umap_qpmem); return (DDI_SUCCESS); } @@ -372,8 +329,6 @@ tavor_umap_srqmem(tavor_state_t *state, devmap_cookie_t dhp, uint_t maxprot; int status; - TAVOR_TNF_ENTER(tavor_umap_srqmem); - /* Extract the Tavor SRQ handle pointer from the tavor_rsrc_t */ srq = (tavor_srqhdl_t)rsrcp->tr_addr; @@ -394,13 +349,10 @@ tavor_umap_srqmem(tavor_state_t *state, devmap_cookie_t dhp, size, maxprot, (DEVMAP_ALLOW_REMAP | DEVMAP_DEFAULTS), NULL); if (status < 0) { *err = status; - TNF_PROBE_0(tavor_umap_srqmem_devmap_fail, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_umap_srqmem); return (DDI_FAILURE); } *maplen = size; - TAVOR_TNF_EXIT(tavor_umap_srqmem); return (DDI_SUCCESS); } @@ -423,15 +375,10 @@ tavor_devmap_umem_map(devmap_cookie_t dhp, dev_t dev, uint_t flags, uint64_t key; uint_t type; - TAVOR_TNF_ENTER(tavor_devmap_umem_map); - /* Get Tavor softstate structure from instance */ instance = TAVOR_DEV_INSTANCE(dev); state = ddi_get_soft_state(tavor_statep, instance); if (state == NULL) { - TNF_PROBE_0(tavor_devmap_umem_map_gss_fail, TAVOR_TNF_ERROR, - ""); - TAVOR_TNF_EXIT(tavor_devmap_umem_map); return (ENXIO); } @@ -536,13 +483,11 @@ tavor_devmap_umem_map(devmap_cookie_t dhp, dev_t dev, uint_t flags, */ *pvtp = dvm_track; - TAVOR_TNF_EXIT(tavor_devmap_umem_map); return (DDI_SUCCESS); umem_map_fail: mutex_destroy(&dvm_track->tdt_lock); kmem_free(dvm_track, sizeof (tavor_devmap_track_t)); - TAVOR_TNF_EXIT(tavor_devmap_umem_map); return (DDI_FAILURE); } @@ -561,8 +506,6 @@ tavor_devmap_umem_dup(devmap_cookie_t dhp, void *pvtp, devmap_cookie_t new_dhp, uint_t maxprot; int status; - TAVOR_TNF_ENTER(tavor_devmap_umem_dup); - /* * Extract the Tavor softstate pointer from "Tavor devmap tracking * structure" (in "pvtp"). @@ -584,7 +527,6 @@ tavor_devmap_umem_dup(devmap_cookie_t dhp, void *pvtp, devmap_cookie_t new_dhp, dvm_track->tdt_size, maxprot, DEVMAP_MAPPING_INVALID, NULL); if (status != DDI_SUCCESS) { TAVOR_WARNING(state, "failed in tavor_devmap_umem_dup()"); - TAVOR_TNF_EXIT(tavor_devmap_umem_dup); return (status); } @@ -607,7 +549,6 @@ tavor_devmap_umem_dup(devmap_cookie_t dhp, void *pvtp, devmap_cookie_t new_dhp, DDI_INTR_PRI(state->ts_intrmsi_pri)); *new_pvtp = new_dvm_track; - TAVOR_TNF_EXIT(tavor_devmap_umem_dup); return (DDI_SUCCESS); } @@ -633,8 +574,6 @@ tavor_devmap_umem_unmap(devmap_cookie_t dhp, void *pvtp, offset_t off, uint_t size; int status; - TAVOR_TNF_ENTER(tavor_devmap_umem_unmap); - /* * Extract the Tavor softstate pointer from "Tavor devmap tracking * structure" (in "pvtp"). @@ -712,11 +651,9 @@ tavor_devmap_umem_unmap(devmap_cookie_t dhp, void *pvtp, offset_t off, * no further processing is necessary. */ if (size == 0) { - TAVOR_TNF_EXIT(tavor_devmap_umem_unmap); return; } } else { - TAVOR_TNF_EXIT(tavor_devmap_umem_unmap); return; } @@ -802,8 +739,6 @@ tavor_devmap_umem_unmap(devmap_cookie_t dhp, void *pvtp, offset_t off, mutex_exit(&srq->srq_lock); } } - - TAVOR_TNF_EXIT(tavor_devmap_umem_unmap); } @@ -820,15 +755,10 @@ tavor_devmap_devmem_map(devmap_cookie_t dhp, dev_t dev, uint_t flags, tavor_devmap_track_t *dvm_track; minor_t instance; - TAVOR_TNF_ENTER(tavor_devmap_devmem_map); - /* Get Tavor softstate structure from instance */ instance = TAVOR_DEV_INSTANCE(dev); state = ddi_get_soft_state(tavor_statep, instance); if (state == NULL) { - TNF_PROBE_0(tavor_devmap_devmem_map_gss_fail, TAVOR_TNF_ERROR, - ""); - TAVOR_TNF_EXIT(tavor_devmap_devmem_map); return (ENXIO); } @@ -852,7 +782,6 @@ tavor_devmap_devmem_map(devmap_cookie_t dhp, dev_t dev, uint_t flags, */ *pvtp = dvm_track; - TAVOR_TNF_EXIT(tavor_devmap_devmem_map); return (DDI_SUCCESS); } @@ -871,8 +800,6 @@ tavor_devmap_devmem_dup(devmap_cookie_t dhp, void *pvtp, uint_t maxprot; int status; - TAVOR_TNF_ENTER(tavor_devmap_devmem_dup); - /* * Extract the Tavor softstate pointer from "Tavor devmap tracking * structure" (in "pvtp"). Note: If the tracking structure is NULL @@ -882,7 +809,6 @@ tavor_devmap_devmem_dup(devmap_cookie_t dhp, void *pvtp, dvm_track = (tavor_devmap_track_t *)pvtp; if (dvm_track == NULL) { *new_pvtp = NULL; - TAVOR_TNF_EXIT(tavor_devmap_devmem_dup); return (DDI_SUCCESS); } @@ -902,7 +828,6 @@ tavor_devmap_devmem_dup(devmap_cookie_t dhp, void *pvtp, dvm_track->tdt_size, maxprot, DEVMAP_MAPPING_INVALID, NULL); if (status != DDI_SUCCESS) { TAVOR_WARNING(state, "failed in tavor_devmap_devmem_dup()"); - TAVOR_TNF_EXIT(tavor_devmap_devmem_dup); return (status); } @@ -915,7 +840,6 @@ tavor_devmap_devmem_dup(devmap_cookie_t dhp, void *pvtp, */ *new_pvtp = NULL; - TAVOR_TNF_EXIT(tavor_devmap_devmem_dup); return (DDI_SUCCESS); } @@ -932,8 +856,6 @@ tavor_devmap_devmem_unmap(devmap_cookie_t dhp, void *pvtp, offset_t off, { tavor_devmap_track_t *dvm_track; - TAVOR_TNF_ENTER(tavor_devmap_devmem_unmap); - /* * Free up the "Tavor devmap tracking structure" (in "pvtp"). * There cannot be "partial" unmappings here because all UAR pages @@ -944,12 +866,10 @@ tavor_devmap_devmem_unmap(devmap_cookie_t dhp, void *pvtp, offset_t off, dvm_track = (tavor_devmap_track_t *)pvtp; _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*dvm_track)) if (dvm_track == NULL) { - TAVOR_TNF_EXIT(tavor_devmap_devmem_unmap); return; } kmem_free(dvm_track, sizeof (tavor_devmap_track_t)); - TAVOR_TNF_EXIT(tavor_devmap_devmem_unmap); } @@ -964,8 +884,6 @@ tavor_umap_ci_data_in(tavor_state_t *state, ibt_ci_data_flags_t flags, { int status; - TAVOR_TNF_ENTER(tavor_umap_ci_data_in); - /* * Depending on the type of object about which additional information * is being provided (currently only MR is supported), we call the @@ -976,9 +894,6 @@ tavor_umap_ci_data_in(tavor_state_t *state, ibt_ci_data_flags_t flags, status = tavor_umap_mr_data_in((tavor_mrhdl_t)hdl, (ibt_mr_data_in_t *)data_p, data_sz); if (status != DDI_SUCCESS) { - TNF_PROBE_0(tavor_umap_mr_data_in_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_umap_ci_data_in); return (status); } break; @@ -997,22 +912,15 @@ tavor_umap_ci_data_in(tavor_state_t *state, ibt_ci_data_flags_t flags, case IBT_HDL_EEC: case IBT_HDL_RDD: case IBT_HDL_SRQ: - TNF_PROBE_0(tavor_umap_ci_data_in_unsupp_type, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_umap_ci_data_in); return (IBT_NOT_SUPPORTED); /* * Any other types are invalid. */ default: - TNF_PROBE_0(tavor_umap_ci_data_in_invtype_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_umap_ci_data_in); return (IBT_INVALID_PARAM); } - TAVOR_TNF_EXIT(tavor_umap_ci_data_in); return (DDI_SUCCESS); } @@ -1025,28 +933,17 @@ static ibt_status_t tavor_umap_mr_data_in(tavor_mrhdl_t mr, ibt_mr_data_in_t *data, size_t data_sz) { - TAVOR_TNF_ENTER(tavor_umap_mr_data_in); - if (data->mr_rev != IBT_MR_DATA_IN_IF_VERSION) { - TNF_PROBE_0(tavor_umap_mr_data_in_ver_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_umap_mr_data_in); return (IBT_NOT_SUPPORTED); } /* Check for valid MR handle pointer */ if (mr == NULL) { - TNF_PROBE_0(tavor_umap_mr_data_in_invmrhdl_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_umap_mr_data_in); return (IBT_MR_HDL_INVALID); } /* Check for valid MR input structure size */ if (data_sz < sizeof (ibt_mr_data_in_t)) { - TNF_PROBE_0(tavor_umap_mr_data_in_invdatasz_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_umap_mr_data_in); return (IBT_INSUFF_RESOURCE); } _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*data)) @@ -1058,9 +955,6 @@ tavor_umap_mr_data_in(tavor_mrhdl_t mr, ibt_mr_data_in_t *data, mutex_enter(&mr->mr_lock); if ((mr->mr_is_umem == 0) || (mr->mr_umemcookie == NULL)) { mutex_exit(&mr->mr_lock); - TNF_PROBE_0(tavor_umap_mr_data_in_invumem_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_umap_mr_data_in); return (IBT_MR_HDL_INVALID); } @@ -1075,7 +969,6 @@ tavor_umap_mr_data_in(tavor_mrhdl_t mr, ibt_mr_data_in_t *data, mr->mr_umem_cbarg2 = data->mr_arg2; mutex_exit(&mr->mr_lock); - TAVOR_TNF_EXIT(tavor_umap_cq_data_out); return (DDI_SUCCESS); } @@ -1091,8 +984,6 @@ tavor_umap_ci_data_out(tavor_state_t *state, ibt_ci_data_flags_t flags, { int status; - TAVOR_TNF_ENTER(tavor_umap_ci_data_out); - /* * Depending on the type of object about which additional information * is being requested (CQ or QP), we call the appropriate resource- @@ -1103,9 +994,6 @@ tavor_umap_ci_data_out(tavor_state_t *state, ibt_ci_data_flags_t flags, status = tavor_umap_cq_data_out((tavor_cqhdl_t)hdl, (mlnx_umap_cq_data_out_t *)data_p, data_sz); if (status != DDI_SUCCESS) { - TNF_PROBE_0(tavor_umap_cq_data_out_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_umap_ci_data_out); return (status); } break; @@ -1114,9 +1002,6 @@ tavor_umap_ci_data_out(tavor_state_t *state, ibt_ci_data_flags_t flags, status = tavor_umap_qp_data_out((tavor_qphdl_t)hdl, (mlnx_umap_qp_data_out_t *)data_p, data_sz); if (status != DDI_SUCCESS) { - TNF_PROBE_0(tavor_umap_qp_data_out_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_umap_ci_data_out); return (status); } break; @@ -1125,9 +1010,6 @@ tavor_umap_ci_data_out(tavor_state_t *state, ibt_ci_data_flags_t flags, status = tavor_umap_srq_data_out((tavor_srqhdl_t)hdl, (mlnx_umap_srq_data_out_t *)data_p, data_sz); if (status != DDI_SUCCESS) { - TNF_PROBE_0(tavor_umap_srq_data_out_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_umap_ci_data_out); return (status); } break; @@ -1140,9 +1022,6 @@ tavor_umap_ci_data_out(tavor_state_t *state, ibt_ci_data_flags_t flags, status = tavor_umap_pd_data_out((tavor_pdhdl_t)hdl, (mlnx_umap_pd_data_out_t *)data_p, data_sz); if (status != DDI_SUCCESS) { - TNF_PROBE_0(tavor_umap_pd_data_out_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_umap_ci_data_out); return (status); } break; @@ -1154,22 +1033,15 @@ tavor_umap_ci_data_out(tavor_state_t *state, ibt_ci_data_flags_t flags, case IBT_HDL_SCHED: case IBT_HDL_EEC: case IBT_HDL_RDD: - TNF_PROBE_0(tavor_umap_ci_data_out_unsupp_type, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_umap_ci_data_out); return (IBT_NOT_SUPPORTED); /* * Any other types are invalid. */ default: - TNF_PROBE_0(tavor_umap_ci_data_out_invtype_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_umap_ci_data_out); return (IBT_INVALID_PARAM); } - TAVOR_TNF_EXIT(tavor_umap_ci_data_out); return (DDI_SUCCESS); } @@ -1182,21 +1054,13 @@ static ibt_status_t tavor_umap_cq_data_out(tavor_cqhdl_t cq, mlnx_umap_cq_data_out_t *data, size_t data_sz) { - TAVOR_TNF_ENTER(tavor_umap_cq_data_out); - /* Check for valid CQ handle pointer */ if (cq == NULL) { - TNF_PROBE_0(tavor_umap_cq_data_out_invcqhdl_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_umap_cq_data_out); return (IBT_CQ_HDL_INVALID); } /* Check for valid CQ mapping structure size */ if (data_sz < sizeof (mlnx_umap_cq_data_out_t)) { - TNF_PROBE_0(tavor_umap_cq_data_out_invdatasz_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_umap_cq_data_out); return (IBT_INSUFF_RESOURCE); } _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*data)) @@ -1225,7 +1089,6 @@ tavor_umap_cq_data_out(tavor_cqhdl_t cq, mlnx_umap_cq_data_out_t *data, data->mcq_numcqe = cq->cq_bufsz; data->mcq_cqesz = sizeof (tavor_hw_cqe_t); - TAVOR_TNF_EXIT(tavor_umap_cq_data_out); return (DDI_SUCCESS); } @@ -1238,21 +1101,13 @@ static ibt_status_t tavor_umap_qp_data_out(tavor_qphdl_t qp, mlnx_umap_qp_data_out_t *data, size_t data_sz) { - TAVOR_TNF_ENTER(tavor_umap_qp_data_out); - /* Check for valid QP handle pointer */ if (qp == NULL) { - TNF_PROBE_0(tavor_umap_qp_data_out_invqphdl_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_umap_qp_data_out); return (IBT_QP_HDL_INVALID); } /* Check for valid QP mapping structure size */ if (data_sz < sizeof (mlnx_umap_qp_data_out_t)) { - TNF_PROBE_0(tavor_umap_qp_data_out_invdatasz_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_umap_qp_data_out); return (IBT_INSUFF_RESOURCE); } _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*data)) @@ -1310,7 +1165,6 @@ tavor_umap_qp_data_out(tavor_qphdl_t qp, mlnx_umap_qp_data_out_t *data, data->mqp_sq_numwqe = qp->qp_sq_bufsz; data->mqp_sq_wqesz = (1 << qp->qp_sq_log_wqesz); - TAVOR_TNF_EXIT(tavor_umap_qp_data_out); return (DDI_SUCCESS); } @@ -1323,21 +1177,13 @@ static ibt_status_t tavor_umap_srq_data_out(tavor_srqhdl_t srq, mlnx_umap_srq_data_out_t *data, size_t data_sz) { - TAVOR_TNF_ENTER(tavor_umap_srq_data_out); - /* Check for valid SRQ handle pointer */ if (srq == NULL) { - TNF_PROBE_0(tavor_umap_srq_data_out_invsrqhdl_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_umap_srq_data_out); return (IBT_SRQ_HDL_INVALID); } /* Check for valid SRQ mapping structure size */ if (data_sz < sizeof (mlnx_umap_srq_data_out_t)) { - TNF_PROBE_0(tavor_umap_srq_data_out_invdatasz_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_umap_srq_data_out); return (IBT_INSUFF_RESOURCE); } _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*data)) @@ -1374,7 +1220,6 @@ tavor_umap_srq_data_out(tavor_srqhdl_t srq, mlnx_umap_srq_data_out_t *data, data->msrq_numwqe = srq->srq_wq_bufsz; data->msrq_wqesz = (1 << srq->srq_wq_log_wqesz); - TAVOR_TNF_EXIT(tavor_umap_srq_data_out); return (DDI_SUCCESS); } @@ -1386,21 +1231,13 @@ static ibt_status_t tavor_umap_pd_data_out(tavor_pdhdl_t pd, mlnx_umap_pd_data_out_t *data, size_t data_sz) { - TAVOR_TNF_ENTER(tavor_umap_pd_data_out); - /* Check for valid PD handle pointer */ if (pd == NULL) { - TNF_PROBE_0(tavor_umap_pd_data_out_invpdhdl_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_umap_pd_data_out); return (IBT_PD_HDL_INVALID); } /* Check for valid PD mapping structure size */ if (data_sz < sizeof (mlnx_umap_pd_data_out_t)) { - TNF_PROBE_0(tavor_umap_pd_data_out_invdatasz_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_umap_pd_data_out); return (IBT_INSUFF_RESOURCE); } _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*data)) @@ -1412,7 +1249,6 @@ tavor_umap_pd_data_out(tavor_pdhdl_t pd, mlnx_umap_pd_data_out_t *data, data->mpd_rev = MLNX_UMAP_IF_VERSION; data->mpd_pdnum = pd->pd_pdnum; - TAVOR_TNF_EXIT(tavor_umap_pd_data_out); return (DDI_SUCCESS); } @@ -1423,8 +1259,6 @@ tavor_umap_pd_data_out(tavor_pdhdl_t pd, mlnx_umap_pd_data_out_t *data, void tavor_umap_db_init(void) { - TAVOR_TNF_ENTER(tavor_umap_db_init); - /* * Initialize the lock used by the Tavor "userland resources database" * This is used to ensure atomic access to add, remove, and find @@ -1444,8 +1278,6 @@ tavor_umap_db_init(void) avl_create(&tavor_userland_rsrc_db.tdl_umapdb_avl, tavor_umap_db_compare, sizeof (tavor_umap_db_entry_t), offsetof(tavor_umap_db_entry_t, tdbe_avlnode)); - - TAVOR_TNF_EXIT(tavor_umap_db_init); } @@ -1456,15 +1288,11 @@ tavor_umap_db_init(void) void tavor_umap_db_fini(void) { - TAVOR_TNF_ENTER(tavor_umap_db_fini); - /* Destroy the AVL tree for the "userland resources database" */ avl_destroy(&tavor_userland_rsrc_db.tdl_umapdb_avl); /* Destroy the lock for the "userland resources database" */ mutex_destroy(&tavor_userland_rsrc_db.tdl_umapdb_lock); - - TAVOR_TNF_EXIT(tavor_umap_db_fini); } @@ -1477,13 +1305,9 @@ tavor_umap_db_alloc(uint_t instance, uint64_t key, uint_t type, uint64_t value) { tavor_umap_db_entry_t *umapdb; - TAVOR_TNF_ENTER(tavor_umap_db_alloc); - /* Allocate an entry to add to the "userland resources database" */ umapdb = kmem_zalloc(sizeof (tavor_umap_db_entry_t), KM_NOSLEEP); if (umapdb == NULL) { - TNF_PROBE_0(tavor_umap_db_alloc_kmz_fail, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_umap_db_alloc); return (NULL); } _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*umapdb)) @@ -1494,7 +1318,6 @@ tavor_umap_db_alloc(uint_t instance, uint64_t key, uint_t type, uint64_t value) umapdb->tdbe_common.tdb_key = key; umapdb->tdbe_common.tdb_value = value; - TAVOR_TNF_EXIT(tavor_umap_db_alloc); return (umapdb); } @@ -1506,12 +1329,8 @@ tavor_umap_db_alloc(uint_t instance, uint64_t key, uint_t type, uint64_t value) void tavor_umap_db_free(tavor_umap_db_entry_t *umapdb) { - TAVOR_TNF_ENTER(tavor_umap_db_free); - /* Free the database entry */ kmem_free(umapdb, sizeof (tavor_umap_db_entry_t)); - - TAVOR_TNF_EXIT(tavor_umap_db_free); } @@ -1522,13 +1341,9 @@ tavor_umap_db_free(tavor_umap_db_entry_t *umapdb) void tavor_umap_db_add(tavor_umap_db_entry_t *umapdb) { - TAVOR_TNF_ENTER(tavor_umap_db_add); - mutex_enter(&tavor_userland_rsrc_db.tdl_umapdb_lock); tavor_umap_db_add_nolock(umapdb); mutex_exit(&tavor_userland_rsrc_db.tdl_umapdb_lock); - - TAVOR_TNF_EXIT(tavor_umap_db_add); } @@ -1542,8 +1357,6 @@ tavor_umap_db_add_nolock(tavor_umap_db_entry_t *umapdb) tavor_umap_db_query_t query; avl_index_t where; - TAVOR_TNF_ENTER(tavor_umap_db_add_nolock); - ASSERT(MUTEX_HELD(&tavor_userland_rsrc_db.tdl_umapdb_lock)); _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*umapdb)) @@ -1568,8 +1381,6 @@ tavor_umap_db_add_nolock(tavor_umap_db_entry_t *umapdb) */ avl_insert(&tavor_userland_rsrc_db.tdl_umapdb_avl, umapdb, where); - - TAVOR_TNF_EXIT(tavor_umap_db_add_nolock); } @@ -1583,14 +1394,11 @@ tavor_umap_db_find(uint_t instance, uint64_t key, uint_t type, { int status; - TAVOR_TNF_ENTER(tavor_umap_db_find); - mutex_enter(&tavor_userland_rsrc_db.tdl_umapdb_lock); status = tavor_umap_db_find_nolock(instance, key, type, value, flag, umapdb); mutex_exit(&tavor_userland_rsrc_db.tdl_umapdb_lock); - TAVOR_TNF_EXIT(tavor_umap_db_find); return (status); } @@ -1607,8 +1415,6 @@ tavor_umap_db_find_nolock(uint_t instance, uint64_t key, uint_t type, tavor_umap_db_entry_t *entry; avl_index_t where; - TAVOR_TNF_ENTER(tavor_umap_db_find_nolock); - ASSERT(MUTEX_HELD(&tavor_userland_rsrc_db.tdl_umapdb_lock)); /* @@ -1628,7 +1434,6 @@ tavor_umap_db_find_nolock(uint_t instance, uint64_t key, uint_t type, entry = (tavor_umap_db_entry_t *)avl_find( &tavor_userland_rsrc_db.tdl_umapdb_avl, &query, &where); if (entry == NULL) { - TAVOR_TNF_EXIT(tavor_umap_db_find_nolock); return (DDI_FAILURE); } _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*entry)) @@ -1664,7 +1469,6 @@ tavor_umap_db_find_nolock(uint_t instance, uint64_t key, uint_t type, /* Extract value field from database entry and return success */ *value = entry->tdbe_common.tdb_value; - TAVOR_TNF_EXIT(tavor_umap_db_find_nolock); return (DDI_SUCCESS); } @@ -1686,8 +1490,6 @@ tavor_umap_umemlock_cb(ddi_umem_cookie_t *umem_cookie) void (*mr_callback)(void *, void *); void *mr_cbarg1, *mr_cbarg2; - TAVOR_TNF_ENTER(tavor_umap_umemlock_cb); - /* * If this was userland memory, then we need to remove its entry * from the "userland resources database". Note: We use the @@ -1704,9 +1506,6 @@ tavor_umap_umemlock_cb(ddi_umem_cookie_t *umem_cookie) state = ddi_get_soft_state(tavor_statep, instance); if (state == NULL) { cmn_err(CE_WARN, "Unable to match Tavor instance\n"); - TNF_PROBE_0(tavor_umap_umemlock_cb_gss_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_umap_umemlock_cb); return; } @@ -1745,13 +1544,8 @@ tavor_umap_umemlock_cb(ddi_umem_cookie_t *umem_cookie) if (status != DDI_SUCCESS) { TAVOR_WARNING(state, "Unexpected failure in " "deregister from callback\n"); - TNF_PROBE_0(tavor_umap_umemlock_cb_dereg_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_umap_umemlock_cb); } } - - TAVOR_TNF_EXIT(tavor_umap_umemlock_cb); } @@ -1765,8 +1559,6 @@ tavor_umap_db_compare(const void *q, const void *e) tavor_umap_db_common_t *entry_common, *query_common; uint_t query_flags; - TAVOR_TNF_ENTER(tavor_umap_db_compare); - _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*((tavor_umap_db_query_t *)q))) entry_common = &((tavor_umap_db_entry_t *)e)->tdbe_common; @@ -1780,10 +1572,8 @@ tavor_umap_db_compare(const void *q, const void *e) * comparing "type". */ if (query_common->tdb_key < entry_common->tdb_key) { - TAVOR_TNF_EXIT(tavor_umap_db_compare); return (-1); } else if (query_common->tdb_key > entry_common->tdb_key) { - TAVOR_TNF_EXIT(tavor_umap_db_compare); return (+1); } @@ -1795,10 +1585,8 @@ tavor_umap_db_compare(const void *q, const void *e) * by comparing "instance". */ if (query_common->tdb_type < entry_common->tdb_type) { - TAVOR_TNF_EXIT(tavor_umap_db_compare); return (-1); } else if (query_common->tdb_type > entry_common->tdb_type) { - TAVOR_TNF_EXIT(tavor_umap_db_compare); return (+1); } @@ -1812,7 +1600,6 @@ tavor_umap_db_compare(const void *q, const void *e) * instance values and returning the appropriate search direction. */ if (query_flags & TAVOR_UMAP_DB_IGNORE_INSTANCE) { - TAVOR_TNF_EXIT(tavor_umap_db_compare); return (0); } @@ -1823,15 +1610,12 @@ tavor_umap_db_compare(const void *q, const void *e) * Else, we return success (0). */ if (query_common->tdb_instance < entry_common->tdb_instance) { - TAVOR_TNF_EXIT(tavor_umap_db_compare); return (-1); } else if (query_common->tdb_instance > entry_common->tdb_instance) { - TAVOR_TNF_EXIT(tavor_umap_db_compare); return (+1); } /* Everything matches... so return success */ - TAVOR_TNF_EXIT(tavor_umap_db_compare); return (0); } @@ -1850,20 +1634,12 @@ tavor_umap_db_set_onclose_cb(dev_t dev, uint64_t flag, uint64_t value; int status; - TAVOR_TNF_ENTER(tavor_umap_db_set_onclose_cb); - instance = TAVOR_DEV_INSTANCE(dev); if (instance == -1) { - TNF_PROBE_0(tavor_umap_db_set_onclose_cb_inst_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_umap_db_set_onclose_cb); return (DDI_FAILURE); } if (flag != TAVOR_ONCLOSE_FLASH_INPROGRESS) { - TNF_PROBE_0(tavor_umap_db_set_onclose_cb_invflag_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_umap_db_set_onclose_cb); return (DDI_FAILURE); } @@ -1878,10 +1654,7 @@ tavor_umap_db_set_onclose_cb(dev_t dev, uint64_t flag, status = tavor_umap_db_find_nolock(instance, dev, MLNX_UMAP_PID_RSRC, &value, 0, &umapdb); if (status != DDI_SUCCESS) { - TNF_PROBE_0(tavor_umap_db_set_onclose_cb_find_fail, - TAVOR_TNF_ERROR, ""); mutex_exit(&tavor_userland_rsrc_db.tdl_umapdb_lock); - TAVOR_TNF_EXIT(tavor_umap_db_set_onclose_cb); return (DDI_FAILURE); } @@ -1890,10 +1663,7 @@ tavor_umap_db_set_onclose_cb(dev_t dev, uint64_t flag, priv = (tavor_umap_db_priv_t *)kmem_zalloc( sizeof (tavor_umap_db_priv_t), KM_NOSLEEP); if (priv == NULL) { - TNF_PROBE_0(tavor_umap_db_set_onclose_cb_kmz_fail, - TAVOR_TNF_ERROR, ""); mutex_exit(&tavor_userland_rsrc_db.tdl_umapdb_lock); - TAVOR_TNF_EXIT(tavor_umap_db_set_onclose_cb); return (DDI_FAILURE); } } @@ -1908,7 +1678,6 @@ tavor_umap_db_set_onclose_cb(dev_t dev, uint64_t flag, umapdb->tdbe_common.tdb_priv = (void *)priv; mutex_exit(&tavor_userland_rsrc_db.tdl_umapdb_lock); - TAVOR_TNF_EXIT(tavor_umap_db_set_onclose_cb); return (DDI_SUCCESS); } @@ -1926,20 +1695,12 @@ tavor_umap_db_clear_onclose_cb(dev_t dev, uint64_t flag) uint64_t value; int status; - TAVOR_TNF_ENTER(tavor_umap_db_set_onclose_cb); - instance = TAVOR_DEV_INSTANCE(dev); if (instance == -1) { - TNF_PROBE_0(tavor_umap_db_clear_onclose_cb_inst_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_umap_db_clear_onclose_cb); return (DDI_FAILURE); } if (flag != TAVOR_ONCLOSE_FLASH_INPROGRESS) { - TNF_PROBE_0(tavor_umap_db_clear_onclose_cb_invflag_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_umap_db_clear_onclose_cb); return (DDI_FAILURE); } @@ -1954,10 +1715,7 @@ tavor_umap_db_clear_onclose_cb(dev_t dev, uint64_t flag) status = tavor_umap_db_find_nolock(instance, dev, MLNX_UMAP_PID_RSRC, &value, 0, &umapdb); if (status != DDI_SUCCESS) { - TNF_PROBE_0(tavor_umap_db_clear_onclose_cb_find_fail, - TAVOR_TNF_ERROR, ""); mutex_exit(&tavor_userland_rsrc_db.tdl_umapdb_lock); - TAVOR_TNF_EXIT(tavor_umap_db_clear_onclose_cb); return (DDI_FAILURE); } diff --git a/usr/src/uts/common/io/ib/adapters/tavor/tavor_wr.c b/usr/src/uts/common/io/ib/adapters/tavor/tavor_wr.c index fd103b3eed..d33c99219b 100644 --- a/usr/src/uts/common/io/ib/adapters/tavor/tavor_wr.c +++ b/usr/src/uts/common/io/ib/adapters/tavor/tavor_wr.c @@ -109,17 +109,12 @@ tavor_post_send(tavor_state_t *state, tavor_qphdl_t qp, uint_t maxdb = TAVOR_QP_MAXDESC_PER_DB; int status; - TAVOR_TNF_ENTER(tavor_post_send); - /* * Check for user-mappable QP memory. Note: We do not allow kernel * clients to post to QP memory that is accessible directly by the * user. If the QP memory is user accessible, then return an error. */ if (qp->qp_is_umap) { - TNF_PROBE_0(tavor_post_send_inv_usrmapped_type, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_post_send); return (IBT_QP_HDL_INVALID); } @@ -136,9 +131,6 @@ tavor_post_send(tavor_state_t *state, tavor_qphdl_t qp, (qp->qp_state == TAVOR_QP_INIT) || (qp->qp_state == TAVOR_QP_RTR)) { mutex_exit(&qp->qp_lock); - TNF_PROBE_0(tavor_post_send_inv_qpstate_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_post_send); return (IBT_QP_STATE_INVALID); } @@ -197,8 +189,6 @@ tavor_post_send(tavor_state_t *state, tavor_qphdl_t qp, */ if (qp->qp_sq_wqhdr->wq_full != 0) { status = IBT_QP_FULL; - TNF_PROBE_0_DEBUG(tavor_post_send_sqfull, - TAVOR_TNF_TRACE, ""); break; } @@ -228,8 +218,6 @@ tavor_post_send(tavor_state_t *state, tavor_qphdl_t qp, status = tavor_wqe_send_build(state, qp, &wr[wrindx], desc, &desc_sz); if (status != DDI_SUCCESS) { - TNF_PROBE_0(tavor_post_send_bldwqe_fail, - TAVOR_TNF_ERROR, ""); break; } @@ -383,7 +371,6 @@ tavor_post_send(tavor_state_t *state, tavor_qphdl_t qp, mutex_exit(&qp->qp_sq_wqhdr->wq_wrid_wql->wql_lock); mutex_exit(&qp->qp_lock); - TAVOR_TNF_EXIT(tavor_post_send); return (status); } @@ -406,17 +393,12 @@ tavor_post_recv(tavor_state_t *state, tavor_qphdl_t qp, uint_t maxdb = TAVOR_QP_MAXDESC_PER_DB; int status; - TAVOR_TNF_ENTER(tavor_post_recv); - /* * Check for user-mappable QP memory. Note: We do not allow kernel * clients to post to QP memory that is accessible directly by the * user. If the QP memory is user accessible, then return an error. */ if (qp->qp_is_umap) { - TNF_PROBE_0(tavor_post_recv_inv_usrmapped_type, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_post_recv); return (IBT_QP_HDL_INVALID); } @@ -430,9 +412,6 @@ tavor_post_recv(tavor_state_t *state, tavor_qphdl_t qp, */ if (qp->qp_srq_en == TAVOR_QP_SRQ_ENABLED) { mutex_exit(&qp->qp_lock); - TNF_PROBE_0(tavor_post_recv_fail_qp_on_srq, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_post_recv); return (IBT_SRQ_IN_USE); } @@ -441,9 +420,6 @@ tavor_post_recv(tavor_state_t *state, tavor_qphdl_t qp, */ if (qp->qp_state == TAVOR_QP_RESET) { mutex_exit(&qp->qp_lock); - TNF_PROBE_0(tavor_post_recv_inv_qpstate_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_post_recv); return (IBT_QP_STATE_INVALID); } @@ -500,8 +476,6 @@ tavor_post_recv(tavor_state_t *state, tavor_qphdl_t qp, */ if (qp->qp_rq_wqhdr->wq_full != 0) { status = IBT_QP_FULL; - TNF_PROBE_0_DEBUG(tavor_post_recv_rqfull, - TAVOR_TNF_TRACE, ""); break; } @@ -531,8 +505,6 @@ tavor_post_recv(tavor_state_t *state, tavor_qphdl_t qp, status = tavor_wqe_recv_build(state, qp, &wr[wrindx], desc, &desc_sz); if (status != DDI_SUCCESS) { - TNF_PROBE_0(tavor_post_recv_bldwqe_fail, - TAVOR_TNF_ERROR, ""); break; } @@ -639,7 +611,6 @@ tavor_post_recv(tavor_state_t *state, tavor_qphdl_t qp, mutex_exit(&qp->qp_rq_wqhdr->wq_wrid_wql->wql_lock); mutex_exit(&qp->qp_lock); - TAVOR_TNF_EXIT(tavor_post_recv); return (status); } @@ -659,17 +630,12 @@ tavor_post_srq(tavor_state_t *state, tavor_srqhdl_t srq, uint_t maxdb = TAVOR_QP_MAXDESC_PER_DB; int status; - TAVOR_TNF_ENTER(tavor_post_srq); - /* * Check for user-mappable QP memory. Note: We do not allow kernel * clients to post to QP memory that is accessible directly by the * user. If the QP memory is user accessible, then return an error. */ if (srq->srq_is_umap) { - TNF_PROBE_0(tavor_post_srq_inv_usrmapped_type, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_post_srq); return (IBT_SRQ_HDL_INVALID); } @@ -683,9 +649,6 @@ tavor_post_srq(tavor_state_t *state, tavor_srqhdl_t srq, */ if (srq->srq_state == TAVOR_SRQ_STATE_ERROR) { mutex_exit(&srq->srq_lock); - TNF_PROBE_0(tavor_post_srq_inv_srqstate_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_post_srq); return (IBT_QP_STATE_INVALID); } @@ -736,8 +699,6 @@ tavor_post_srq(tavor_state_t *state, tavor_srqhdl_t srq, */ if (srq->srq_wridlist->wl_free_list_indx == -1) { status = IBT_QP_FULL; - TNF_PROBE_0_DEBUG(tavor_post_srq_wqfull, - TAVOR_TNF_TRACE, ""); break; } @@ -771,8 +732,6 @@ tavor_post_srq(tavor_state_t *state, tavor_srqhdl_t srq, status = tavor_wqe_srq_build(state, srq, &wr[wrindx], desc); if (status != DDI_SUCCESS) { - TNF_PROBE_0(tavor_post_recv_bldwqe_fail, - TAVOR_TNF_ERROR, ""); break; } @@ -879,7 +838,6 @@ tavor_post_srq(tavor_state_t *state, tavor_srqhdl_t srq, mutex_exit(&srq->srq_wrid_wql->wql_lock); mutex_exit(&srq->srq_lock); - TAVOR_TNF_EXIT(tavor_post_srq); return (status); } @@ -901,9 +859,6 @@ tavor_qp_send_doorbell(tavor_state_t *state, uint32_t nda, uint32_t nds, ((uint64_t)nopcode << TAVOR_QPSNDDB_NOPCODE_SHIFT) | ((uint64_t)qpn << TAVOR_QPSNDDB_QPN_SHIFT) | nds; - TNF_PROBE_1_DEBUG(tavor_qp_send_doorbell, TAVOR_TNF_TRACE, "", - tnf_ulong, doorbell, doorbell); - /* Write the doorbell to UAR */ TAVOR_UAR_DOORBELL(state, (uint64_t *)&state->ts_uar->send, doorbell); @@ -926,9 +881,6 @@ tavor_qp_recv_doorbell(tavor_state_t *state, uint32_t nda, uint32_t nds, ((uint64_t)nds << TAVOR_QPRCVDB_NDS_SHIFT) | ((uint64_t)qpn << TAVOR_QPRCVDB_QPN_SHIFT) | credits; - TNF_PROBE_1_DEBUG(tavor_qp_recv_doorbell, TAVOR_TNF_TRACE, "", - tnf_ulong, doorbell, doorbell); - /* Write the doorbell to UAR */ TAVOR_UAR_DOORBELL(state, (uint64_t *)&state->ts_uar->recv, doorbell); @@ -954,8 +906,6 @@ tavor_wqe_send_build(tavor_state_t *state, tavor_qphdl_t qp, uint32_t nds; int i, num_ds, status; - TAVOR_TNF_ENTER(tavor_wqe_send_build); - ASSERT(MUTEX_HELD(&qp->qp_lock)); /* Initialize the information for the Data Segments */ @@ -973,9 +923,6 @@ tavor_wqe_send_build(tavor_state_t *state, tavor_qphdl_t qp, case IBT_UD_SRV: /* Ensure that work request transport type matches QP type */ if (qp->qp_serv_type != TAVOR_QP_UD) { - TNF_PROBE_0(tavor_wqe_send_build_inv_servtype_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_wqe_send_build); return (IBT_QP_SRV_TYPE_INVALID); } @@ -984,9 +931,6 @@ tavor_wqe_send_build(tavor_state_t *state, tavor_qphdl_t qp, * "Send" operation is valid */ if (wr->wr_opcode != IBT_WRC_SEND) { - TNF_PROBE_0(tavor_wqe_send_build_inv_optype_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_wqe_send_build); return (IBT_QP_OP_TYPE_INVALID); } @@ -997,7 +941,6 @@ tavor_wqe_send_build(tavor_state_t *state, tavor_qphdl_t qp, */ if (qp->qp_is_special) { status = tavor_wqe_mlx_build(state, qp, wr, desc, size); - TAVOR_TNF_EXIT(tavor_wqe_send_build); return (status); } @@ -1011,9 +954,6 @@ tavor_wqe_send_build(tavor_state_t *state, tavor_qphdl_t qp, sizeof (tavor_hw_snd_wqe_nextctrl_t)); ah = (tavor_ahhdl_t)wr->wr.ud.udwr_dest->ud_ah; if (ah == NULL) { - TNF_PROBE_0(tavor_wqe_send_build_invahhdl_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_wqe_send_build); return (IBT_AH_HDL_INVALID); } @@ -1034,9 +974,6 @@ tavor_wqe_send_build(tavor_state_t *state, tavor_qphdl_t qp, case IBT_RC_SRV: /* Ensure that work request transport type matches QP type */ if (qp->qp_serv_type != TAVOR_QP_RC) { - TNF_PROBE_0(tavor_wqe_send_build_inv_servtype_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_wqe_send_build); return (IBT_QP_SRV_TYPE_INVALID); } @@ -1051,9 +988,6 @@ tavor_wqe_send_build(tavor_state_t *state, tavor_qphdl_t qp, (wr->wr_opcode != IBT_WRC_CSWAP) && (wr->wr_opcode != IBT_WRC_FADD) && (wr->wr_opcode != IBT_WRC_BIND)) { - TNF_PROBE_0(tavor_wqe_send_build_inv_optype_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_wqe_send_build); return (IBT_QP_OP_TYPE_INVALID); } @@ -1129,9 +1063,6 @@ tavor_wqe_send_build(tavor_state_t *state, tavor_qphdl_t qp, if (wr->wr_opcode == IBT_WRC_BIND) { status = tavor_wr_bind_check(state, wr); if (status != DDI_SUCCESS) { - TNF_PROBE_0(tavor_wqe_send_build_bind_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_wqe_send_build); return (status); } @@ -1160,9 +1091,6 @@ tavor_wqe_send_build(tavor_state_t *state, tavor_qphdl_t qp, case IBT_UC_SRV: /* Ensure that work request transport type matches QP type */ if (qp->qp_serv_type != TAVOR_QP_UC) { - TNF_PROBE_0(tavor_wqe_send_build_inv_servtype_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_wqe_send_build); return (IBT_QP_SRV_TYPE_INVALID); } @@ -1175,9 +1103,6 @@ tavor_wqe_send_build(tavor_state_t *state, tavor_qphdl_t qp, if ((wr->wr_opcode != IBT_WRC_SEND) && (wr->wr_opcode != IBT_WRC_RDMAW) && (wr->wr_opcode != IBT_WRC_BIND)) { - TNF_PROBE_0(tavor_wqe_send_build_inv_optype_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_wqe_send_build); return (IBT_QP_OP_TYPE_INVALID); } @@ -1218,9 +1143,6 @@ tavor_wqe_send_build(tavor_state_t *state, tavor_qphdl_t qp, if (wr->wr_opcode == IBT_WRC_BIND) { status = tavor_wr_bind_check(state, wr); if (status != DDI_SUCCESS) { - TNF_PROBE_0(tavor_wqe_send_build_bind_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_wqe_send_build); return (status); } @@ -1247,9 +1169,6 @@ tavor_wqe_send_build(tavor_state_t *state, tavor_qphdl_t qp, break; default: - TNF_PROBE_0(tavor_wqe_send_build_inv_tranport_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_wqe_send_build); return (IBT_QP_SRV_TYPE_INVALID); } @@ -1259,9 +1178,6 @@ tavor_wqe_send_build(tavor_state_t *state, tavor_qphdl_t qp, * Start by checking for a valid number of SGL entries */ if (nds > qp->qp_sq_sgl) { - TNF_PROBE_0(tavor_wqe_send_build_toomanysgl_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_wqe_send_build); return (IBT_QP_SGL_LEN_INVALID); } @@ -1291,7 +1207,6 @@ tavor_wqe_send_build(tavor_state_t *state, tavor_qphdl_t qp, /* Return the size of descriptor (in 16-byte chunks) */ *size = ((uintptr_t)&ds[num_ds] - (uintptr_t)desc) >> 4; - TAVOR_TNF_EXIT(tavor_wqe_send_build); return (DDI_SUCCESS); } @@ -1447,8 +1362,6 @@ tavor_wqe_mlx_build(tavor_state_t *state, tavor_qphdl_t qp, uint32_t desc_sz, udav_sz; int i, num_ds; - TAVOR_TNF_ENTER(tavor_wqe_mlx_build); - ASSERT(MUTEX_HELD(&qp->qp_lock)); /* Initialize the information for the Data Segments */ @@ -1462,9 +1375,6 @@ tavor_wqe_mlx_build(tavor_state_t *state, tavor_qphdl_t qp, */ ah = (tavor_ahhdl_t)wr->wr.ud.udwr_dest->ud_ah; if (ah == NULL) { - TNF_PROBE_0(tavor_wqe_mlx_build_invahhdl_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_wqe_mlx_build); return (IBT_AH_HDL_INVALID); } mutex_enter(&ah->ah_lock); @@ -1483,9 +1393,6 @@ tavor_wqe_mlx_build(tavor_state_t *state, tavor_qphdl_t qp, */ if ((udav.rlid == IB_LID_PERMISSIVE) && (qp->qp_is_special == TAVOR_QP_GSI)) { - TNF_PROBE_0(tavor_wqe_mlx_build_permissiveLIDonQP1_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_wqe_mlx_build); return (IBT_AH_HDL_INVALID); } @@ -1545,9 +1452,6 @@ tavor_wqe_mlx_build(tavor_state_t *state, tavor_qphdl_t qp, * combination of global routine (GRH) and QP0 is not allowed. */ if (qp->qp_is_special == TAVOR_QP_SMI) { - TNF_PROBE_0(tavor_wqe_mlx_build_GRHonQP0_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_wqe_mlx_build); return (IBT_AH_HDL_INVALID); } grh = (ib_grh_t *)((uintptr_t)lrh + sizeof (ib_lrh_hdr_t)); @@ -1586,9 +1490,6 @@ tavor_wqe_mlx_build(tavor_state_t *state, tavor_qphdl_t qp, * Start by checking for a valid number of SGL entries */ if (nds > qp->qp_sq_sgl) { - TNF_PROBE_0(tavor_wqe_mlx_build_toomanysgl_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_wqe_mlx_build); return (IBT_QP_SGL_LEN_INVALID); } @@ -1660,7 +1561,6 @@ tavor_wqe_mlx_build(tavor_state_t *state, tavor_qphdl_t qp, /* Return the size of descriptor (in 16-byte chunks) */ *size = ((uintptr_t)&ds[num_ds] - (uintptr_t)desc) >> 0x4; - TAVOR_TNF_EXIT(tavor_wqe_mlx_build); return (DDI_SUCCESS); } @@ -1808,17 +1708,12 @@ tavor_wqe_recv_build(tavor_state_t *state, tavor_qphdl_t qp, tavor_hw_wqe_sgl_t *ds; int i, num_ds; - TAVOR_TNF_ENTER(tavor_wqe_recv_build); - ASSERT(MUTEX_HELD(&qp->qp_lock)); /* Check that work request transport type is valid */ if ((qp->qp_serv_type != TAVOR_QP_UD) && (qp->qp_serv_type != TAVOR_QP_RC) && (qp->qp_serv_type != TAVOR_QP_UC)) { - TNF_PROBE_0(tavor_build_recv_wqe_inv_servtype_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_build_recv_wqe); return (IBT_QP_SRV_TYPE_INVALID); } @@ -1829,9 +1724,6 @@ tavor_wqe_recv_build(tavor_state_t *state, tavor_qphdl_t qp, /* Check for valid number of SGL entries */ if (wr->wr_nds > qp->qp_rq_sgl) { - TNF_PROBE_0(tavor_wqe_recv_build_toomanysgl_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_wqe_recv_build); return (IBT_QP_SGL_LEN_INVALID); } @@ -1861,7 +1753,6 @@ tavor_wqe_recv_build(tavor_state_t *state, tavor_qphdl_t qp, /* Return the size of descriptor (in 16-byte chunks) */ *size = ((uintptr_t)&ds[num_ds] - (uintptr_t)desc) >> 0x4; - TAVOR_TNF_EXIT(tavor_wqe_recv_build); return (DDI_SUCCESS); } @@ -1925,8 +1816,6 @@ tavor_wqe_srq_build(tavor_state_t *state, tavor_srqhdl_t srq, ibt_wr_ds_t end_sgl; int i, num_ds; - TAVOR_TNF_ENTER(tavor_wqe_recv_build); - ASSERT(MUTEX_HELD(&srq->srq_lock)); /* Fill in the Data Segments (SGL) for the Recv WQE */ @@ -1936,9 +1825,6 @@ tavor_wqe_srq_build(tavor_state_t *state, tavor_srqhdl_t srq, /* Check for valid number of SGL entries */ if (wr->wr_nds > srq->srq_wq_sgl) { - TNF_PROBE_0(tavor_wqe_srq_build_toomanysgl_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_wqe_srq_build); return (IBT_QP_SGL_LEN_INVALID); } @@ -1978,7 +1864,6 @@ tavor_wqe_srq_build(tavor_state_t *state, tavor_srqhdl_t srq, TAVOR_WQE_BUILD_DATA_SEG_SRQ(srq, &ds[num_ds], &end_sgl); } - TAVOR_TNF_EXIT(tavor_wqe_srq_build); return (DDI_SUCCESS); } @@ -2087,8 +1972,6 @@ tavor_wqe_sync(void *hdl, uint_t sync_from, uint_t sync_to, uint32_t qsize; int status; - TAVOR_TNF_ENTER(tavor_wqe_sync); - if (sync_type == TAVOR_WR_SRQ) { srq = (tavor_srqhdl_t)hdl; is_sync_req = srq->srq_sync; @@ -2103,7 +1986,6 @@ tavor_wqe_sync(void *hdl, uint_t sync_from, uint_t sync_to, /* Determine if the work queues need to be synced or not */ if (is_sync_req == 0) { - TAVOR_TNF_EXIT(tavor_wqe_sync); return; } @@ -2155,8 +2037,6 @@ tavor_wqe_sync(void *hdl, uint_t sync_from, uint_t sync_to, status = ddi_dma_sync(dmahdl, offset, length, flag); if (status != DDI_SUCCESS) { - TNF_PROBE_0(tavor_wqe_sync_fail, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_wqe_sync); return; } } else { @@ -2166,9 +2046,6 @@ tavor_wqe_sync(void *hdl, uint_t sync_from, uint_t sync_to, if (length) { status = ddi_dma_sync(dmahdl, offset, length, flag); if (status != DDI_SUCCESS) { - TNF_PROBE_0(tavor_wqe_sync_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_wqe_sync); return; } } @@ -2178,13 +2055,9 @@ tavor_wqe_sync(void *hdl, uint_t sync_from, uint_t sync_to, length = (size_t)((uintptr_t)wqe_top - (uintptr_t)wqe_from); status = ddi_dma_sync(dmahdl, offset, length, flag); if (status != DDI_SUCCESS) { - TNF_PROBE_0(tavor_wqe_sync_fail, TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_wqe_sync); return; } } - - TAVOR_TNF_EXIT(tavor_wqe_sync); } @@ -2203,23 +2076,15 @@ tavor_wr_bind_check(tavor_state_t *state, ibt_send_wr_t *wr) tavor_rsrc_t *mpt; uint32_t new_rkey; - TAVOR_TNF_ENTER(tavor_wr_bind_check); - /* Check for a valid Memory Window handle in the WR */ mw = (tavor_mwhdl_t)wr->wr.rc.rcwr.bind->bind_ibt_mw_hdl; if (mw == NULL) { - TNF_PROBE_0(tavor_wr_bind_check_invmwhdl_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_wr_bind_check); return (IBT_MW_HDL_INVALID); } /* Check for a valid Memory Region handle in the WR */ mr = (tavor_mrhdl_t)wr->wr.rc.rcwr.bind->bind_ibt_mr_hdl; if (mr == NULL) { - TNF_PROBE_0(tavor_wr_bind_check_invmrhdl_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_wr_bind_check); return (IBT_MR_HDL_INVALID); } @@ -2234,9 +2099,6 @@ tavor_wr_bind_check(tavor_state_t *state, ibt_send_wr_t *wr) if ((mr->mr_is_umem) && (mr->mr_umemcookie == NULL)) { mutex_exit(&mr->mr_lock); mutex_exit(&mw->mr_lock); - TNF_PROBE_0(tavor_wr_bind_check_invmrhdl2_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_wr_bind_check); return (IBT_MR_HDL_INVALID); } @@ -2244,9 +2106,6 @@ tavor_wr_bind_check(tavor_state_t *state, ibt_send_wr_t *wr) if (mw->mr_rkey != wr->wr.rc.rcwr.bind->bind_rkey) { mutex_exit(&mr->mr_lock); mutex_exit(&mw->mr_lock); - TNF_PROBE_0(tavor_wr_bind_check_invrkey_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_wr_bind_check); return (IBT_MR_RKEY_INVALID); } @@ -2254,9 +2113,6 @@ tavor_wr_bind_check(tavor_state_t *state, ibt_send_wr_t *wr) if (mr->mr_lkey != wr->wr.rc.rcwr.bind->bind_lkey) { mutex_exit(&mr->mr_lock); mutex_exit(&mw->mr_lock); - TNF_PROBE_0(tavor_wr_bind_check_invlkey_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_wr_bind_check); return (IBT_MR_LKEY_INVALID); } @@ -2273,18 +2129,12 @@ tavor_wr_bind_check(tavor_state_t *state, ibt_send_wr_t *wr) if ((vaddr < reg_start_addr) || (vaddr > reg_end_addr)) { mutex_exit(&mr->mr_lock); mutex_exit(&mw->mr_lock); - TNF_PROBE_0(tavor_wr_bind_check_inv_vaddr_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_wr_bind_check); return (IBT_MR_VA_INVALID); } vaddr = (vaddr + len) - 1; if (vaddr > reg_end_addr) { mutex_exit(&mr->mr_lock); mutex_exit(&mw->mr_lock); - TNF_PROBE_0(tavor_wr_bind_check_invlen_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_wr_bind_check); return (IBT_MR_LEN_INVALID); } } @@ -2300,9 +2150,6 @@ tavor_wr_bind_check(tavor_state_t *state, ibt_send_wr_t *wr) !(mr->mr_accflag & IBT_MR_LOCAL_WRITE)) { mutex_exit(&mr->mr_lock); mutex_exit(&mw->mr_lock); - TNF_PROBE_0(tavor_wr_bind_check_invflags_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_wr_bind_check); return (IBT_MR_ACCESS_REQ_INVALID); } @@ -2315,7 +2162,6 @@ tavor_wr_bind_check(tavor_state_t *state, ibt_send_wr_t *wr) mutex_exit(&mr->mr_lock); mutex_exit(&mw->mr_lock); - TAVOR_TNF_EXIT(tavor_wr_bind_check); return (DDI_SUCCESS); } @@ -2333,8 +2179,6 @@ tavor_wrid_from_reset_handling(tavor_state_t *state, tavor_qphdl_t qp) uint_t create_wql = 0; uint_t qp_srq_en; - TAVOR_TNF_ENTER(tavor_wrid_from_reset_handling); - /* * For each of this QP's Work Queues, make sure we have a (properly * initialized) Work Request ID list attached to the relevant @@ -2355,9 +2199,6 @@ tavor_wrid_from_reset_handling(tavor_state_t *state, tavor_qphdl_t qp) * header, then drop the lock(s) and return failure. */ tavor_wrid_wqhdr_unlock_both(qp); - TNF_PROBE_0(tavor_wrid_from_reset_handling_wqhdr_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_wrid_from_reset_handling); return (ibc_get_ci_failure(0)); } } @@ -2384,9 +2225,6 @@ tavor_wrid_from_reset_handling(tavor_state_t *state, tavor_qphdl_t qp) } tavor_wrid_wqhdr_unlock_both(qp); - TNF_PROBE_0(tavor_wrid_from_reset_handling_wridlist_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_wrid_from_reset_handling); return (ibc_get_ci_failure(0)); } _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*s_wridlist)) @@ -2456,9 +2294,6 @@ tavor_wrid_from_reset_handling(tavor_state_t *state, tavor_qphdl_t qp) #endif tavor_wrid_wqhdr_unlock_both(qp); - TNF_PROBE_0(tavor_wrid_from_reset_handling_wqhdr_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_wrid_from_reset_handling); return (ibc_get_ci_failure(0)); } } @@ -2540,9 +2375,6 @@ tavor_wrid_from_reset_handling(tavor_state_t *state, tavor_qphdl_t qp) #endif tavor_wrid_wqhdr_unlock_both(qp); - TNF_PROBE_0(tavor_wrid_from_reset_handling_wridlist_fail, - TAVOR_TNF_ERROR, ""); - TAVOR_TNF_EXIT(tavor_wrid_from_reset_handling); return (ibc_get_ci_failure(0)); } _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*r_wridlist)) @@ -2600,7 +2432,6 @@ tavor_wrid_from_reset_handling(tavor_state_t *state, tavor_qphdl_t qp) _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*swq)) tavor_wrid_wqhdr_unlock_both(qp); - TAVOR_TNF_EXIT(tavor_wrid_from_reset_handling); return (DDI_SUCCESS); } @@ -2614,8 +2445,6 @@ tavor_wrid_to_reset_handling(tavor_state_t *state, tavor_qphdl_t qp) { uint_t free_wqhdr = 0; - TAVOR_TNF_ENTER(tavor_wrid_to_reset_handling); - /* * For each of this QP's Work Queues, move the WRID "container" to * the "reapable" list. Although there may still be unpolled @@ -2668,8 +2497,6 @@ tavor_wrid_to_reset_handling(tavor_state_t *state, tavor_qphdl_t qp) } tavor_wrid_wqhdr_unlock_both(qp); mutex_exit(&qp->qp_rq_cqhdl->cq_lock); - - TAVOR_TNF_EXIT(tavor_wrid_to_reset_handling); } @@ -2684,8 +2511,6 @@ tavor_wrid_add_entry(tavor_workq_hdr_t *wq, uint64_t wrid, uint32_t wqeaddrsz, tavor_wrid_entry_t *wre_tmp; uint32_t head, tail, size; - TAVOR_TNF_ENTER(tavor_wrid_add_entry); - ASSERT(MUTEX_HELD(&wq->wq_wrid_wql->wql_lock)); /* @@ -2725,7 +2550,6 @@ tavor_wrid_add_entry(tavor_workq_hdr_t *wq, uint64_t wrid, uint32_t wqeaddrsz, if (head == tail) { wq->wq_wrid_post->wl_full = 1; } - TAVOR_TNF_EXIT(tavor_wrid_add_entry); } /* @@ -2739,8 +2563,6 @@ tavor_wrid_add_entry_srq(tavor_srqhdl_t srq, uint64_t wrid, uint_t signaled_dbd) uint64_t *wl_wqe; uint32_t wqe_index; - TAVOR_TNF_ENTER(tavor_wrid_add_entry_srq); - /* * Find the next available WQE from the SRQ free_list. Then update the * free_list to point to the next entry @@ -2766,8 +2588,6 @@ tavor_wrid_add_entry_srq(tavor_srqhdl_t srq, uint64_t wrid, uint_t signaled_dbd) /* Update the free list index */ srq->srq_wridlist->wl_free_list_indx = ddi_get32( srq->srq_wridlist->wl_acchdl, (uint32_t *)wl_wqe); - - TAVOR_TNF_EXIT(tavor_wrid_add_entry_srq); } @@ -2784,8 +2604,6 @@ tavor_wrid_get_entry(tavor_cqhdl_t cq, tavor_hw_cqe_t *cqe, uint64_t wrid; uint_t send_or_recv, qpnum, error, opcode; - TAVOR_TNF_ENTER(tavor_wrid_get_entry); - /* Lock the list of work queues associated with this CQ */ mutex_enter(&cq->cq_wrid_wqhdr_lock); @@ -2847,7 +2665,6 @@ tavor_wrid_get_entry(tavor_cqhdl_t cq, tavor_hw_cqe_t *cqe, mutex_exit(&wq->wq_wrid_wql->wql_lock); mutex_exit(&cq->cq_wrid_wqhdr_lock); - TAVOR_TNF_EXIT(tavor_wrid_get_entry); return (wrid); } @@ -2866,8 +2683,6 @@ tavor_wrid_find_match(tavor_workq_hdr_t *wq, tavor_cqhdl_t cq, uint32_t head, tail, size; int found = 0, last_container; - TAVOR_TNF_ENTER(tavor_wrid_find_match); - ASSERT(MUTEX_HELD(&wq->wq_wrid_wql->wql_lock)); /* Pull the "wqeaddrsz" information from the CQE */ @@ -2985,7 +2800,6 @@ tavor_wrid_find_match(tavor_workq_hdr_t *wq, tavor_cqhdl_t cq, /* Ensure that we've actually found what we were searching for */ ASSERT(curr != NULL); - TAVOR_TNF_EXIT(tavor_wrid_find_match); return (curr); } @@ -3058,8 +2872,6 @@ tavor_wrid_cq_reap(tavor_cqhdl_t cq) ASSERT(MUTEX_HELD(&cq->cq_lock)); - TAVOR_TNF_ENTER(tavor_wrid_cq_reap); - /* Lock the list of work queues associated with this CQ */ mutex_enter(&cq->cq_wrid_wqhdr_lock); @@ -3083,7 +2895,6 @@ tavor_wrid_cq_reap(tavor_cqhdl_t cq) cq->cq_wrid_reap_head = cq->cq_wrid_reap_tail = NULL; mutex_exit(&cq->cq_wrid_wqhdr_lock); - TAVOR_TNF_EXIT(tavor_wrid_cq_reap); } @@ -3101,8 +2912,6 @@ tavor_wrid_cq_force_reap(tavor_cqhdl_t cq) ASSERT(MUTEX_HELD(&cq->cq_lock)); - TAVOR_TNF_ENTER(tavor_wrid_cq_reap); - /* * The first step is to walk the "reapable" list and free up those * containers. This is necessary because the containers on the @@ -3150,7 +2959,6 @@ tavor_wrid_cq_force_reap(tavor_cqhdl_t cq) avl_destroy(treep); mutex_exit(&cq->cq_wrid_wqhdr_lock); - TAVOR_TNF_EXIT(tavor_wrid_cq_reap); } @@ -3262,8 +3070,6 @@ tavor_wrid_reaplist_add(tavor_cqhdl_t cq, tavor_workq_hdr_t *wq) { ASSERT(MUTEX_HELD(&cq->cq_wrid_wqhdr_lock)); - TAVOR_TNF_ENTER(tavor_wrid_reaplist_add); - mutex_enter(&wq->wq_wrid_wql->wql_lock); /* @@ -3315,8 +3121,6 @@ tavor_wrid_wqhdr_find(tavor_cqhdl_t cq, uint_t qpn, uint_t wq_type) tavor_workq_hdr_t *curr; tavor_workq_compare_t cmp; - TAVOR_TNF_ENTER(tavor_wrid_wqhdr_find); - ASSERT(MUTEX_HELD(&cq->cq_wrid_wqhdr_lock)); /* @@ -3332,7 +3136,6 @@ tavor_wrid_wqhdr_find(tavor_cqhdl_t cq, uint_t qpn, uint_t wq_type) #endif curr = avl_find(&cq->cq_wrid_wqhdr_avl_tree, &cmp, NULL); - TAVOR_TNF_EXIT(tavor_wrid_wqhdr_find); return (curr); } @@ -3347,8 +3150,6 @@ tavor_wrid_wqhdr_create(tavor_state_t *state, tavor_cqhdl_t cq, uint_t qpn, { tavor_workq_hdr_t *wqhdr_tmp; - TAVOR_TNF_ENTER(tavor_wrid_wqhdr_create); - ASSERT(MUTEX_HELD(&cq->cq_wrid_wqhdr_lock)); /* @@ -3361,7 +3162,6 @@ tavor_wrid_wqhdr_create(tavor_state_t *state, tavor_cqhdl_t cq, uint_t qpn, wqhdr_tmp = (tavor_workq_hdr_t *)kmem_zalloc( sizeof (tavor_workq_hdr_t), KM_NOSLEEP); if (wqhdr_tmp == NULL) { - TAVOR_TNF_EXIT(tavor_wrid_wqhdr_create); return (NULL); } _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*wqhdr_tmp)) @@ -3372,7 +3172,6 @@ tavor_wrid_wqhdr_create(tavor_state_t *state, tavor_cqhdl_t cq, uint_t qpn, wqhdr_tmp->wq_wrid_wql = tavor_wrid_wql_create(state); if (wqhdr_tmp->wq_wrid_wql == NULL) { kmem_free(wqhdr_tmp, sizeof (tavor_workq_hdr_t)); - TAVOR_TNF_EXIT(tavor_wrid_wqhdr_create); return (NULL); } } @@ -3383,7 +3182,6 @@ tavor_wrid_wqhdr_create(tavor_state_t *state, tavor_cqhdl_t cq, uint_t qpn, /* Chain the newly allocated work queue header to the CQ's list */ tavor_cq_wqhdr_add(cq, wqhdr_tmp); - TAVOR_TNF_EXIT(tavor_wrid_wqhdr_create); return (wqhdr_tmp); } @@ -3397,14 +3195,11 @@ tavor_wrid_wql_create(tavor_state_t *state) { tavor_wq_lock_t *wql; - TAVOR_TNF_ENTER(tavor_wrid_wql_create); - /* * Allocate the WQL and initialize it. */ wql = kmem_zalloc(sizeof (tavor_wq_lock_t), KM_NOSLEEP); if (wql == NULL) { - TAVOR_TNF_EXIT(tavor_wrid_wqhdr_create); return (NULL); } @@ -3414,7 +3209,6 @@ tavor_wrid_wql_create(tavor_state_t *state) /* Add refcount to WQL */ tavor_wql_refcnt_inc(wql); - TAVOR_TNF_EXIT(tavor_wrid_wql_create); return (wql); } @@ -3529,8 +3323,6 @@ tavor_wrid_list_reap(tavor_wrid_list_hdr_t *wridlist) tavor_wrid_list_hdr_t *prev, *next; uint32_t size; - TAVOR_TNF_ENTER(tavor_wrid_list_reap); - /* Get the back pointer to the work queue header (see below) */ wqhdr = wridlist->wl_wqhdr; mutex_enter(&wqhdr->wq_wrid_wql->wql_lock); @@ -3570,7 +3362,6 @@ tavor_wrid_list_reap(tavor_wrid_list_hdr_t *wridlist) mutex_exit(&wqhdr->wq_wrid_wql->wql_lock); - TAVOR_TNF_EXIT(tavor_wrid_list_reap); return (consume_wqhdr); } diff --git a/usr/src/uts/common/io/ib/mgt/ibmf/ibmf_mod.c b/usr/src/uts/common/io/ib/mgt/ibmf/ibmf_mod.c index 10a202ce81..b4e510e151 100644 --- a/usr/src/uts/common/io/ib/mgt/ibmf/ibmf_mod.c +++ b/usr/src/uts/common/io/ib/mgt/ibmf/ibmf_mod.c @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * This file implements the _init(9e), _info(9e) and _fini(9e) functions. */ @@ -53,11 +51,6 @@ extern int ibmf_fini(); extern int ibmf_saa_impl_init(); extern int ibmf_saa_impl_fini(); -#ifndef NPROBE -extern int tnf_mod_load(void); -extern int tnf_mod_unload(struct modlinkage *mlp); -#endif - int _init() { @@ -66,9 +59,6 @@ _init() /* CONSTCOND */ ASSERT(NO_COMPETING_THREADS); -#ifndef NPROBE - (void) tnf_mod_load(); -#endif ibmf_statep = &ibmf_state; /* @@ -77,39 +67,20 @@ _init() */ status = ibmf_saa_impl_init(); if (status != IBMF_SUCCESS) { - TNF_PROBE_1(_init_error, IBMF_TNF_ERROR, "", tnf_string, msg, - "ibmf_saa_impl_init failed"); - -#ifndef NPROBE - (void) tnf_mod_unload(&ibmf_modlinkage); -#endif return (EACCES); } - - status = ibmf_init(); if (status != 0) { - TNF_PROBE_1(_init_error, IBMF_TNF_ERROR, "", tnf_string, msg, - "ibmf_init failed"); - (void) ibmf_saa_impl_fini(); -#ifndef NPROBE - (void) tnf_mod_unload(&ibmf_modlinkage); -#endif return (EACCES); } status = mod_install(&ibmf_modlinkage); if (status != 0) { - TNF_PROBE_2(_init_error, IBMF_TNF_ERROR, "", tnf_string, msg, - "mod_install failed", tnf_uint, status, status); -#ifndef NPROBE - (void) tnf_mod_unload(&ibmf_modlinkage); -#endif (void) ibmf_fini(); - ibmf_statep = (ibmf_state_t *)NULL; + ibmf_statep = NULL; } return (status); @@ -127,23 +98,15 @@ _fini() int status; status = mod_remove(&ibmf_modlinkage); if (status != 0) { - TNF_PROBE_2(_fini_error, IBMF_TNF_ERROR, "", tnf_string, msg, - "mod_remove failed", tnf_uint, status, status); return (status); } status = ibmf_saa_impl_fini(); if (status != 0) { - - TNF_PROBE_2(_fini_error, IBMF_TNF_ERROR, "", tnf_string, msg, - "ibmf_saa fini failed", tnf_uint, status, status); return (status); } (void) ibmf_fini(); - ibmf_statep = (ibmf_state_t *)NULL; -#ifndef NPROBE - (void) tnf_mod_unload(&ibmf_modlinkage); -#endif + ibmf_statep = NULL; return (status); } diff --git a/usr/src/uts/common/krtld/kobj.c b/usr/src/uts/common/krtld/kobj.c index 6c36cd5e95..7d034d37a0 100644 --- a/usr/src/uts/common/krtld/kobj.c +++ b/usr/src/uts/common/krtld/kobj.c @@ -67,7 +67,6 @@ #include <sys/fs/decomp.h> #include <sys/callb.h> #include <sys/cmn_err.h> -#include <sys/tnf_probe.h> #include <sys/zmod.h> #include <krtld/reloc.h> @@ -139,10 +138,6 @@ extern int alloc_gottable(struct module *, caddr_t *, caddr_t *); extern int kobj_boot_mountroot(void); #endif -static void tnf_unsplice_probes(uint_t, struct modctl *); -extern tnf_probe_control_t *__tnf_probe_list_head; -extern tnf_tag_data_t *__tnf_tag_list_head; - extern int modrootloaded; extern int swaploaded; extern int bop_io_quiesced; @@ -259,13 +254,6 @@ static char *suppress_sym_list[] = static kobj_notify_list_t *kobj_notifiers[KOBJ_NOTIFY_MAX + 1]; /* - * TNF probe management globals - */ -tnf_probe_control_t *__tnf_probe_list_head = NULL; -tnf_tag_data_t *__tnf_tag_list_head = NULL; -int tnf_changed_probe_list = 0; - -/* * Prefix for statically defined tracing (SDT) DTrace probes. */ const char *sdt_prefix = "__dtrace_probe_"; @@ -433,9 +421,8 @@ kobj_init( * about the executable. In particular, it does not read in, map or * otherwise look at the program headers. We fake all that up now. * - * We do this early as DTrace static probes and tnf probes both call - * undefined references. We have to process those relocations before - * calling any of them. + * We do this early as DTrace static probes call undefined references. + * We have to process those relocations before calling any of them. * * OBP tells kobj_start() where the ELF image is in memory, so it * synthesized bootaux before kobj_init() was called @@ -4473,87 +4460,6 @@ expand_libmacro(char *tail, char *path, char *pathend) return (NULL); } -static void -tnf_add_notifyunload(kobj_notify_f *fp) -{ - kobj_notify_list_t *entry; - - entry = kobj_alloc(sizeof (kobj_notify_list_t), KM_WAIT); - entry->kn_type = KOBJ_NOTIFY_MODUNLOADING; - entry->kn_func = fp; - (void) kobj_notify_add(entry); -} - -/* ARGSUSED */ -static void -tnf_unsplice_probes(uint_t what, struct modctl *mod) -{ - tnf_probe_control_t **p; - tnf_tag_data_t **q; - struct module *mp = mod->mod_mp; - - if (!(mp->flags & KOBJ_TNF_PROBE)) - return; - - for (p = &__tnf_probe_list_head; *p; ) - if (kobj_addrcheck(mp, (char *)*p) == 0) - *p = (*p)->next; - else - p = &(*p)->next; - - for (q = &__tnf_tag_list_head; *q; ) - if (kobj_addrcheck(mp, (char *)*q) == 0) - *q = (tnf_tag_data_t *)(*q)->tag_version; - else - q = (tnf_tag_data_t **)&(*q)->tag_version; - - tnf_changed_probe_list = 1; -} - -int -tnf_splice_probes(int boot_load, tnf_probe_control_t *plist, - tnf_tag_data_t *tlist) -{ - int result = 0; - static int add_notify = 1; - - if (plist) { - tnf_probe_control_t *pl; - - for (pl = plist; pl->next; ) - pl = pl->next; - - if (!boot_load) - mutex_enter(&mod_lock); - tnf_changed_probe_list = 1; - pl->next = __tnf_probe_list_head; - __tnf_probe_list_head = plist; - if (!boot_load) - mutex_exit(&mod_lock); - result = 1; - } - - if (tlist) { - tnf_tag_data_t *tl; - - for (tl = tlist; tl->tag_version; ) - tl = (tnf_tag_data_t *)tl->tag_version; - - if (!boot_load) - mutex_enter(&mod_lock); - tl->tag_version = (tnf_tag_version_t *)__tnf_tag_list_head; - __tnf_tag_list_head = tlist; - if (!boot_load) - mutex_exit(&mod_lock); - result = 1; - } - if (!boot_load && result && add_notify) { - tnf_add_notifyunload(tnf_unsplice_probes); - add_notify = 0; - } - return (result); -} - char *kobj_file_buf; int kobj_file_bufsize; diff --git a/usr/src/uts/common/krtld/kobj_stubs.c b/usr/src/uts/common/krtld/kobj_stubs.c index 3ef581f1c3..0e75bf12c6 100644 --- a/usr/src/uts/common/krtld/kobj_stubs.c +++ b/usr/src/uts/common/krtld/kobj_stubs.c @@ -23,8 +23,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <sys/kobj.h> #include <sys/kobj_impl.h> #include <sys/errno.h> @@ -249,7 +247,4 @@ kobj_boot_unmountroot(void) * Dummy declarations for variables in * the stand-alone linker/loader. */ -void *__tnf_probe_list_head; -void *__tnf_tag_list_head; -int tnf_changed_probe_list; char *boot_cpu_compatible_list; diff --git a/usr/src/uts/common/os/aio_subr.c b/usr/src/uts/common/os/aio_subr.c index c857026a27..02068a6267 100644 --- a/usr/src/uts/common/os/aio_subr.c +++ b/usr/src/uts/common/os/aio_subr.c @@ -42,7 +42,6 @@ #include <sys/fs/snode.h> #include <sys/siginfo.h> #include <sys/cpuvar.h> -#include <sys/tnf_probe.h> #include <sys/conf.h> #include <sys/sdt.h> @@ -100,13 +99,6 @@ aphysio( return (EINVAL); #endif /* _ILP32 */ - TNF_PROBE_5(aphysio_start, "kaio", /* CSTYLED */, - tnf_opaque, bp, bp, - tnf_device, device, dev, - tnf_offset, blkno, btodt(uio->uio_loffset), - tnf_size, size, uio->uio_iov->iov_len, - tnf_bioflags, rw, rw); - if (rw == B_READ) { CPU_STATS_ADD_K(sys, phread, 1); } else { @@ -214,13 +206,6 @@ aio_done(struct buf *bp) reqp = (aio_req_t *)bp->b_forw; fd = reqp->aio_req_fd; - TNF_PROBE_5(aphysio_end, "kaio", /* CSTYLED */, - tnf_opaque, bp, bp, - tnf_device, device, bp->b_edev, - tnf_offset, blkno, btodt(reqp->aio_req_uio.uio_loffset), - tnf_size, size, reqp->aio_req_uio.uio_iov->iov_len, - tnf_bioflags, rw, (bp->b_flags & (B_READ|B_WRITE))); - /* * mapout earlier so that more kmem is available when aio is * heavily used. bug #1262082 diff --git a/usr/src/uts/common/os/bio.c b/usr/src/uts/common/os/bio.c index daf3b638a6..14151186e1 100644 --- a/usr/src/uts/common/os/bio.c +++ b/usr/src/uts/common/os/bio.c @@ -60,7 +60,6 @@ #include <vm/page.h> #include <vm/pvn.h> #include <sys/vtrace.h> -#include <sys/tnf_probe.h> #include <sys/fs/ufs_inode.h> #include <sys/fs/ufs_bio.h> #include <sys/fs/ufs_log.h> @@ -1238,16 +1237,6 @@ biowait(struct buf *bp) return (error); } -static void -biodone_tnf_probe(struct buf *bp) -{ - /* Kernel probe */ - TNF_PROBE_3(biodone, "io blockio", /* CSTYLED */, - tnf_device, device, bp->b_edev, - tnf_diskaddr, block, bp->b_lblkno, - tnf_opaque, buf, bp); -} - /* * Mark I/O complete on a buffer, release it if I/O is asynchronous, * and wake up anyone waiting for it. @@ -1260,12 +1249,6 @@ biodone(struct buf *bp) bp->b_flags &= ~B_STARTED; } - /* - * Call the TNF probe here instead of the inline code - * to force our compiler to use the tail call optimization. - */ - biodone_tnf_probe(bp); - if (bp->b_iodone != NULL) { (*(bp->b_iodone))(bp); return; @@ -1330,10 +1313,6 @@ pageio_setup(struct page *pp, size_t len, struct vnode *vp, int flags) if (lwp != NULL) lwp->lwp_ru.majflt++; CPU_STATS_ADDQ(cpup, vm, maj_fault, 1); - /* Kernel probe */ - TNF_PROBE_2(major_fault, "vm pagefault", /* CSTYLED */, - tnf_opaque, vnode, pp->p_vnode, - tnf_offset, offset, pp->p_offset); } /* * Update statistics for pages being paged in @@ -1360,11 +1339,6 @@ pageio_setup(struct page *pp, size_t len, struct vnode *vp, int flags) CPU_STATS_EXIT_K(); TRACE_1(TR_FAC_VM, TR_PAGE_WS_IN, "page_ws_in:pp %p", pp); - /* Kernel probe */ - TNF_PROBE_3(pagein, "vm pageio io", /* CSTYLED */, - tnf_opaque, vnode, pp->p_vnode, - tnf_offset, offset, pp->p_offset, - tnf_size, size, len); } bp = kmem_zalloc(sizeof (struct buf), KM_SLEEP); diff --git a/usr/src/uts/common/os/driver.c b/usr/src/uts/common/os/driver.c index c6ef9ee367..e64f4d1345 100644 --- a/usr/src/uts/common/os/driver.c +++ b/usr/src/uts/common/os/driver.c @@ -43,7 +43,6 @@ #include <sys/kmem.h> #include <sys/file.h> #include <sys/debug.h> -#include <sys/tnf_probe.h> /* Don't #include <sys/ddi.h> - it #undef's getmajor() */ @@ -435,18 +434,6 @@ dev_to_instance(dev_t dev) return ((int)(uintptr_t)vinstance); } -static void -bdev_strategy_tnf_probe(struct buf *bp) -{ - /* Kernel probe */ - TNF_PROBE_5(strategy, "io blockio", /* CSTYLED */, - tnf_device, device, bp->b_edev, - tnf_diskaddr, block, bp->b_lblkno, - tnf_size, size, bp->b_bcount, - tnf_opaque, buf, bp, - tnf_bioflags, flags, bp->b_flags); -} - int bdev_strategy(struct buf *bp) { @@ -466,12 +453,6 @@ bdev_strategy(struct buf *bp) DTRACE_IO1(start, struct buf *, bp); bp->b_flags |= B_STARTED; - /* - * Call the TNF probe here instead of the inline code - * to force our compiler to use the tail call optimization. - */ - bdev_strategy_tnf_probe(bp); - return (ops->devo_cb_ops->cb_strategy(bp)); } diff --git a/usr/src/uts/common/os/dtrace_subr.c b/usr/src/uts/common/os/dtrace_subr.c index a6af6ff4ce..a7ac2fc3b7 100644 --- a/usr/src/uts/common/os/dtrace_subr.c +++ b/usr/src/uts/common/os/dtrace_subr.c @@ -27,7 +27,6 @@ #include <sys/dtrace.h> #include <sys/cmn_err.h> -#include <sys/tnf.h> #include <sys/atomic.h> #include <sys/prsystm.h> #include <sys/modctl.h> @@ -195,12 +194,7 @@ dtrace_vtime_enable(void) nstate = DTRACE_VTIME_ACTIVE; break; - case DTRACE_VTIME_INACTIVE_TNF: - nstate = DTRACE_VTIME_ACTIVE_TNF; - break; - case DTRACE_VTIME_ACTIVE: - case DTRACE_VTIME_ACTIVE_TNF: panic("DTrace virtual time already enabled"); /*NOTREACHED*/ } @@ -223,12 +217,7 @@ dtrace_vtime_disable(void) nstate = DTRACE_VTIME_INACTIVE; break; - case DTRACE_VTIME_ACTIVE_TNF: - nstate = DTRACE_VTIME_INACTIVE_TNF; - break; - case DTRACE_VTIME_INACTIVE: - case DTRACE_VTIME_INACTIVE_TNF: panic("DTrace virtual time already disabled"); /*NOTREACHED*/ } @@ -238,74 +227,11 @@ dtrace_vtime_disable(void) } void -dtrace_vtime_enable_tnf(void) -{ - dtrace_vtime_state_t state, nstate; - - nstate = DTRACE_VTIME_INACTIVE; - do { - state = dtrace_vtime_active; - - switch (state) { - case DTRACE_VTIME_ACTIVE: - nstate = DTRACE_VTIME_ACTIVE_TNF; - break; - - case DTRACE_VTIME_INACTIVE: - nstate = DTRACE_VTIME_INACTIVE_TNF; - break; - - case DTRACE_VTIME_ACTIVE_TNF: - case DTRACE_VTIME_INACTIVE_TNF: - panic("TNF already active"); - /*NOTREACHED*/ - } - - } while (atomic_cas_32((uint32_t *)&dtrace_vtime_active, - state, nstate) != state); -} - -void -dtrace_vtime_disable_tnf(void) -{ - dtrace_vtime_state_t state, nstate; - - nstate = DTRACE_VTIME_INACTIVE; - do { - state = dtrace_vtime_active; - - switch (state) { - case DTRACE_VTIME_ACTIVE_TNF: - nstate = DTRACE_VTIME_ACTIVE; - break; - - case DTRACE_VTIME_INACTIVE_TNF: - nstate = DTRACE_VTIME_INACTIVE; - break; - - case DTRACE_VTIME_ACTIVE: - case DTRACE_VTIME_INACTIVE: - panic("TNF already inactive"); - /*NOTREACHED*/ - } - - } while (atomic_cas_32((uint32_t *)&dtrace_vtime_active, - state, nstate) != state); -} - -void dtrace_vtime_switch(kthread_t *next) { dtrace_icookie_t cookie; hrtime_t ts; - if (tnf_tracing_active) { - tnf_thread_switch(next); - - if (dtrace_vtime_active == DTRACE_VTIME_INACTIVE_TNF) - return; - } - cookie = dtrace_interrupt_disable(); ts = dtrace_gethrtime(); diff --git a/usr/src/uts/common/os/lwp.c b/usr/src/uts/common/os/lwp.c index b2adae570f..5e3b1ec949 100644 --- a/usr/src/uts/common/os/lwp.c +++ b/usr/src/uts/common/os/lwp.c @@ -48,7 +48,6 @@ #include <sys/door.h> #include <vm/seg_kp.h> #include <sys/debug.h> -#include <sys/tnf.h> #include <sys/schedctl.h> #include <sys/poll.h> #include <sys/copyops.h> @@ -987,12 +986,6 @@ lwp_exit(void) t->t_proc_flag |= TP_LWPEXIT; term_mstate(t); -#ifndef NPROBE - /* Kernel probe */ - if (t->t_tnf_tpdp) - tnf_thread_exit(); -#endif /* NPROBE */ - t->t_forw->t_back = t->t_back; t->t_back->t_forw = t->t_forw; if (t == p->p_tlist) diff --git a/usr/src/uts/common/os/sched.c b/usr/src/uts/common/os/sched.c index bc6df6afba..dba962fa63 100644 --- a/usr/src/uts/common/os/sched.c +++ b/usr/src/uts/common/os/sched.c @@ -45,7 +45,6 @@ #include <sys/modctl.h> #include <sys/debug.h> #include <sys/sdt.h> -#include <sys/tnf_probe.h> #include <sys/procfs.h> #include <vm/seg.h> @@ -571,11 +570,6 @@ top: /* Kernel probe */ DTRACE_SCHED1(swapin__lwp, kthread_t *, tp); - TNF_PROBE_4(swapin_lwp, "vm swap swapin", /* CSTYLED */, - tnf_pid, pid, pp->p_pid, - tnf_lwpid, lwpid, tp->t_tid, - tnf_kthread_id, tid, tp, - tnf_ulong, page_count, stack_pages); rw_enter(&kas.a_lock, RW_READER); err = segkp_fault(segkp->s_as->a_hat, segkp, @@ -710,14 +704,6 @@ top: /* Kernel probe */ DTRACE_SCHED1(swapout__lwp, kthread_t *, tp); - TNF_PROBE_4(swapout_lwp, - "vm swap swapout", - /* CSTYLED */, - tnf_pid, pid, pp->p_pid, - tnf_lwpid, lwpid, tp->t_tid, - tnf_kthread_id, tid, tp, - tnf_ulong, page_count, - stack_pages); rw_enter(&kas.a_lock, RW_READER); err = segkp_fault(segkp->s_as->a_hat, @@ -766,11 +752,9 @@ top: TRACE_2(TR_FAC_SCHED, TR_SWAPOUT, "swapout: pp %p pages_pushed %lu", pp, ws_pages); + /* Kernel probe */ DTRACE_SCHED1(swapout__process, proc_t *, pp); - TNF_PROBE_2(swapout_process, "vm swap swapout", /* CSTYLED */, - tnf_pid, pid, pp->p_pid, - tnf_ulong, page_count, ws_pages); } *swrss = ws_pages; return (swapped_lwps); @@ -886,11 +870,6 @@ process_swap_queue(void) /* Kernel probe */ DTRACE_SCHED1(swapout__lwp, kthread_t *, tp); - TNF_PROBE_4(swapout_lwp, "vm swap swapout", /* CSTYLED */, - tnf_pid, pid, pp->p_pid, - tnf_lwpid, lwpid, tp->t_tid, - tnf_kthread_id, tid, tp, - tnf_ulong, page_count, stack_pages); rw_enter(&kas.a_lock, RW_READER); err = segkp_fault(segkp->s_as->a_hat, segkp, tp->t_swap, @@ -934,12 +913,9 @@ process_swap_queue(void) TRACE_2(TR_FAC_SCHED, TR_SWAPQ_PROC, "swaplist_proc: pp %p pages_pushed: %lu", pp, ws_pages); + /* Kernel probe */ DTRACE_SCHED1(swapout__process, proc_t *, pp); - TNF_PROBE_2(swapout_process, "vm swap swapout", - /* CSTYLED */, - tnf_pid, pid, pp->p_pid, - tnf_ulong, page_count, ws_pages); } pp->p_swrss += ws_pages; disp_lock_enter(&swapped_lock); diff --git a/usr/src/uts/common/os/vm_pageout.c b/usr/src/uts/common/os/vm_pageout.c index c3fd3658d6..b65a6cea2f 100644 --- a/usr/src/uts/common/os/vm_pageout.c +++ b/usr/src/uts/common/os/vm_pageout.c @@ -61,7 +61,6 @@ #include <sys/kmem.h> #include <sys/debug.h> #include <sys/callb.h> -#include <sys/tnf_probe.h> #include <sys/mem_cage.h> #include <sys/time.h> #include <sys/stdbool.h> diff --git a/usr/src/uts/common/os/vm_subr.c b/usr/src/uts/common/os/vm_subr.c index 537ddb6908..7163852fd6 100644 --- a/usr/src/uts/common/os/vm_subr.c +++ b/usr/src/uts/common/os/vm_subr.c @@ -59,7 +59,6 @@ #include <sys/swap.h> #include <sys/vtrace.h> -#include <sys/tnf_probe.h> #include <sys/fs/snode.h> #include <sys/copyops.h> #include <sys/conf.h> @@ -142,13 +141,6 @@ default_physio(int (*strat)(struct buf *), struct buf *bp, dev_t dev, TRACE_1(TR_FAC_PHYSIO, TR_PHYSIO_START, "physio_start: bp %p", bp); - /* Kernel probe */ - TNF_PROBE_4(physio_start, "io rawio", /* CSTYLED */, - tnf_device, device, dev, - tnf_offset, offset, uio->uio_loffset, - tnf_size, size, uio->uio_resid, - tnf_bioflags, rw, rw); - if (rw == B_READ) { CPU_STATS_ADD_K(sys, phread, 1); } else { @@ -290,10 +282,6 @@ default_physio(int (*strat)(struct buf *), struct buf *bp, dev_t dev, kmem_cache_free(physio_buf_cache, bp); } - /* Kernel probe */ - TNF_PROBE_1(physio_end, "io rawio", /* CSTYLED */, - tnf_device, device, dev); - TRACE_1(TR_FAC_PHYSIO, TR_PHYSIO_END, "physio_end: bp %p", bp); return (error); diff --git a/usr/src/uts/common/sys/1394/adapters/hci1394.h b/usr/src/uts/common/sys/1394/adapters/hci1394.h index 7598d203b3..a75625b0fb 100644 --- a/usr/src/uts/common/sys/1394/adapters/hci1394.h +++ b/usr/src/uts/common/sys/1394/adapters/hci1394.h @@ -46,7 +46,6 @@ extern "C" { #include <sys/1394/h1394.h> #include <sys/1394/adapters/hci1394_def.h> -#include <sys/1394/adapters/hci1394_tnf.h> #include <sys/1394/adapters/hci1394_drvinfo.h> #include <sys/1394/adapters/hci1394_tlist.h> #include <sys/1394/adapters/hci1394_tlabel.h> diff --git a/usr/src/uts/common/sys/1394/adapters/hci1394_tnf.h b/usr/src/uts/common/sys/1394/adapters/hci1394_tnf.h deleted file mode 100644 index 6dc0826916..0000000000 --- a/usr/src/uts/common/sys/1394/adapters/hci1394_tnf.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * 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 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 (c) 1999-2000 by Sun Microsystems, Inc. - * All rights reserved. - */ - -#ifndef _SYS_1394_ADAPTERS_HCI1394_TNF_H -#define _SYS_1394_ADAPTERS_HCI1394_TNF_H - -#pragma ident "%Z%%M% %I% %E% SMI" - -/* - * hci1394_tnf.h - * Keys used for TNF_PROBE_* routines - */ - -#ifdef __cplusplus -extern "C" { -#endif - -#include <sys/tnf_probe.h> - - -#define HCI1394_TNF_HAL " 1394 hci1394 " -#define HCI1394_TNF_HAL_STACK " 1394 hci1394 stacktrace " -#define HCI1394_TNF_HAL_STACK_ISOCH " 1394 hci1394 stacktrace isoch" -#define HCI1394_TNF_HAL_ERROR " 1394 hci1394 error " -#define HCI1394_TNF_HAL_ERROR_ISOCH " 1394 hci1394 error isoch" -#define HCI1394_TNF_HAL_INFO " 1394 hci1394 info " -#define HCI1394_TNF_HAL_INFO_ISOCH " 1394 hci1394 info isoch" -#define HCI1394_TNF_HAL_TLABEL " 1394 hci1394 tlabel " - -#ifdef __cplusplus -} -#endif - -#endif /* _SYS_1394_ADAPTERS_HCI1394_TNF_H */ diff --git a/usr/src/uts/common/sys/1394/s1394.h b/usr/src/uts/common/sys/1394/s1394.h index bb59cb18d9..a45e5b36d7 100644 --- a/usr/src/uts/common/sys/1394/s1394.h +++ b/usr/src/uts/common/sys/1394/s1394.h @@ -27,8 +27,6 @@ #ifndef _SYS_1394_S1394_H #define _SYS_1394_S1394_H -#pragma ident "%Z%%M% %I% %E% SMI" - /* * s1394.h * Contains all of the structures used (internally) by the 1394 @@ -172,40 +170,6 @@ extern "C" { #define ISOCH_SPEED_FACTOR_S200 8 #define ISOCH_SPEED_FACTOR_S400 4 -/* TNF probes */ -#define S1394_TNF_SL "1394 s1394 " -#define S1394_TNF_SL_ERROR "1394 s1394 error " -#define S1394_TNF_SL_STACK "1394 s1394 stacktrace " -#define S1394_TNF_SL_ARREQ_STACK "1394 s1394 arreq stacktrace " -#define S1394_TNF_SL_ARREQ_ERROR "1394 s1394 arreq error " -#define S1394_TNF_SL_ATREQ_STACK "1394 s1394 atreq stacktrace " -#define S1394_TNF_SL_ATREQ_ERROR "1394 s1394 atreq error " -#define S1394_TNF_SL_ATRESP_STACK "1394 s1394 atresp stacktrace " -#define S1394_TNF_SL_ATRESP_ERROR "1394 s1394 atresp error " -#define S1394_TNF_SL_ATREQ_ATRESP_STACK "1394 s1394 atreq atresp stacktrace " -#define S1394_TNF_SL_ATREQ_ATRESP_ERROR "1394 s1394 atreq atresp error " -#define S1394_TNF_SL_BR_STACK "1394 s1394 bus_reset stacktrace " -#define S1394_TNF_SL_BR_ERROR "1394 s1394 bus_reset error " -#define S1394_TNF_SL_IOCTL_STACK "1394 s1394 ioctl stacktrace " -#define S1394_TNF_SL_HOTPLUG_STACK "1394 s1394 hotplug stacktrace " -#define S1394_TNF_SL_HOTPLUG_ERROR "1394 s1394 hotplug error " -#define S1394_TNF_SL_NX1394_STACK "1394 s1394 nx1394 stacktrace " -#define S1394_TNF_SL_CSR_ERROR "1394 s1394 csr error " -#define S1394_TNF_SL_CSR_STACK "1394 s1394 csr stacktrace " -#define S1394_TNF_SL_BR_CSR_STACK "1394 s1394 bus_reset csr stacktrace " -#define S1394_TNF_SL_CFGROM_ERROR "1394 s1394 cfgrom error " -#define S1394_TNF_SL_CFGROM_STACK "1394 s1394 cfgrom stacktrace " -#define S1394_TNF_SL_ISOCH_ERROR "1394 s1394 isoch error " -#define S1394_TNF_SL_ISOCH_STACK "1394 s1394 isoch stacktrace " -#define S1394_TNF_SL_NEXUS_ERROR "1394 s1394 nexus error " -#define S1394_TNF_SL_NEXUS_STACK "1394 s1394 nexus stacktrace " -#define S1394_TNF_SL_FA_STACK "1394 s1394 FA stacktrace " -#define S1394_TNF_SL_FA_ERROR "1394 s1394 FA error " -#define S1394_TNF_SL_FCP_STACK "1394 s1394 FCP stacktrace " -#define S1394_TNF_SL_FCP_ERROR "1394 s1394 FCP error " -#define S1394_TNF_SL_CMP_STACK "1394 s1394 CMP stacktrace " -#define S1394_TNF_SL_CMP_ERROR "1394 s1394 CMP error " - /* s1394_hal_state_t */ typedef enum { S1394_HAL_INIT, diff --git a/usr/src/uts/common/sys/1394/targets/av1394/av1394_impl.h b/usr/src/uts/common/sys/1394/targets/av1394/av1394_impl.h index c6f6715492..d40b832633 100644 --- a/usr/src/uts/common/sys/1394/targets/av1394/av1394_impl.h +++ b/usr/src/uts/common/sys/1394/targets/av1394/av1394_impl.h @@ -35,7 +35,6 @@ #include <sys/sunddi.h> #include <sys/strsun.h> #include <sys/mkdev.h> -#include <sys/tnf_probe.h> #include <sys/av/iec61883.h> #include <sys/1394/t1394.h> #include <sys/1394/targets/av1394/av1394_isoch.h> @@ -296,17 +295,6 @@ enum { /* current interface version */ #define AV1394_IEC61883_VER IEC61883_V1_0 -/* TNF probes */ -#define AV1394_TNF_FCP "1394 av1394 fcp " -#define AV1394_TNF_FCP_STACK "1394 av1394 fcp stacktrace " -#define AV1394_TNF_FCP_ERROR "1394 av1394 fcp error " -#define AV1394_TNF_ASYNC "1394 av1394 async " -#define AV1394_TNF_ASYNC_STACK "1394 av1394 async stacktrace " -#define AV1394_TNF_ASYNC_ERROR "1394 av1394 async error " -#define AV1394_TNF_INST "1394 av1394 inst " -#define AV1394_TNF_INST_STACK "1394 av1394 inst stacktrace " -#define AV1394_TNF_INST_ERROR "1394 av1394 inst error " - /* misc */ #define NELEM(a) (sizeof (a) / sizeof (*(a))) diff --git a/usr/src/uts/common/sys/1394/targets/av1394/av1394_isoch.h b/usr/src/uts/common/sys/1394/targets/av1394/av1394_isoch.h index 75c6e33f80..33131d4a63 100644 --- a/usr/src/uts/common/sys/1394/targets/av1394/av1394_isoch.h +++ b/usr/src/uts/common/sys/1394/targets/av1394/av1394_isoch.h @@ -441,16 +441,6 @@ enum { AV1394_PREQ_IT_UNDERRUN = 0x02 }; - -/* TNF probes */ -#define AV1394_TNF_CMP "1394 av1394 cmp " -#define AV1394_TNF_CMP_STACK "1394 av1394 cmp stacktrace " -#define AV1394_TNF_CMP_ERROR "1394 av1394 cmp error " -#define AV1394_TNF_ISOCH "1394 av1394 isoch " -#define AV1394_TNF_ISOCH_STACK "1394 av1394 isoch stacktrace " -#define AV1394_TNF_ISOCH_ERROR "1394 av1394 isoch error " - - /* isoch channel */ int av1394_ic_open(struct av1394_inst_s *, int); int av1394_ic_close(struct av1394_inst_s *, int); diff --git a/usr/src/uts/common/sys/Makefile b/usr/src/uts/common/sys/Makefile index d506f26802..7aae55e661 100644 --- a/usr/src/uts/common/sys/Makefile +++ b/usr/src/uts/common/sys/Makefile @@ -616,10 +616,6 @@ CHKHDRS= \ tirdwr.h \ tiuser.h \ tl.h \ - tnf.h \ - tnf_com.h \ - tnf_probe.h \ - tnf_writer.h \ todio.h \ tpicommon.h \ ts.h \ diff --git a/usr/src/uts/common/sys/crypto/impl.h b/usr/src/uts/common/sys/crypto/impl.h index 7d9c959ecd..c3cb03f3c3 100644 --- a/usr/src/uts/common/sys/crypto/impl.h +++ b/usr/src/uts/common/sys/crypto/impl.h @@ -37,7 +37,6 @@ #include <sys/crypto/api.h> #include <sys/crypto/spi.h> #include <sys/crypto/ioctl.h> -#include <sys/tnf_probe.h> #include <sys/atomic.h> #include <sys/project.h> #include <sys/taskq.h> diff --git a/usr/src/uts/common/sys/dtrace.h b/usr/src/uts/common/sys/dtrace.h index f554fb0e58..dbd3775207 100644 --- a/usr/src/uts/common/sys/dtrace.h +++ b/usr/src/uts/common/sys/dtrace.h @@ -2254,16 +2254,12 @@ extern int dtrace_meta_unregister(dtrace_meta_provider_id_t); */ typedef enum dtrace_vtime_state { - DTRACE_VTIME_INACTIVE = 0, /* No DTrace, no TNF */ - DTRACE_VTIME_ACTIVE, /* DTrace virtual time, no TNF */ - DTRACE_VTIME_INACTIVE_TNF, /* No DTrace, TNF active */ - DTRACE_VTIME_ACTIVE_TNF /* DTrace virtual time _and_ TNF */ + DTRACE_VTIME_INACTIVE = 0, /* No DTrace */ + DTRACE_VTIME_ACTIVE, /* DTrace virtual time */ } dtrace_vtime_state_t; extern dtrace_vtime_state_t dtrace_vtime_active; extern void dtrace_vtime_switch(kthread_t *next); -extern void dtrace_vtime_enable_tnf(void); -extern void dtrace_vtime_disable_tnf(void); extern void dtrace_vtime_enable(void); extern void dtrace_vtime_disable(void); diff --git a/usr/src/uts/common/sys/fibre-channel/ulp/fcip.h b/usr/src/uts/common/sys/fibre-channel/ulp/fcip.h index f87d9acc09..7546e9ca28 100644 --- a/usr/src/uts/common/sys/fibre-channel/ulp/fcip.h +++ b/usr/src/uts/common/sys/fibre-channel/ulp/fcip.h @@ -572,75 +572,6 @@ struct fcip_sendup_elem { struct fcipstr *(*fcipsu_func)(); }; - -/* - * Having TNF probe points can be lethal during reconfiguration boot. Enable - * TNF using a compile time define. - */ - -#ifdef __lint -#define FCIP_TNF_ENABLED -#else -#undef FCIP_TNF_ENABLED -#endif - -#ifdef FCIP_TNF_ENABLED - -extern int tnf_mod_load(void); -extern int tnf_mod_unload(struct modlinkage *e); - -#define FCIP_TNF_LOAD() (void) tnf_mod_load() -#define FCIP_TNF_UNLOAD(x) (void) tnf_mod_unload(x) -#define FCIP_TNF_PROBE_0(x) TNF_PROBE_0 x -#define FCIP_TNF_PROBE_1(x) TNF_PROBE_1 x -#define FCIP_TNF_PROBE_2(x) TNF_PROBE_2 x -#define FCIP_TNF_PROBE_3(x) TNF_PROBE_3 x -#define FCIP_TNF_PROBE_4(x) TNF_PROBE_4 x -#define FCIP_TNF_PROBE_5(x) TNF_PROBE_5 x - -#else - -#define FCIP_TNF_LOAD() -#define FCIP_TNF_UNLOAD(x) -#define FCIP_TNF_PROBE_0(x) -#define FCIP_TNF_PROBE_1(x) -#define FCIP_TNF_PROBE_2(x) -#define FCIP_TNF_PROBE_3(x) -#define FCIP_TNF_PROBE_4(x) -#define FCIP_TNF_PROBE_5(x) - -#endif /* FCIP_TNF_ENABLED */ - -/* - * Macros to help with complex TNF output - */ - -#ifdef FCIP_TNF_ENABLED - -#define FCIP_TNF_BYTE_ARRAY(name, keys, detail, mesg, barray_name, \ -barray, len) \ -{ \ - TNF_PROBE_1(name, keys, detail, tnf_string, msg, mesg); \ - { \ - int i = 0; \ - char str[65] = ""; \ - char *strp = str; \ - while (i < 32 && i < len) { \ - (void) sprintf(strp, "%02x", \ - ((char *)(barray))[i++] & 0xff); \ - strp += 2; \ - } \ - TNF_PROBE_1(name, keys, "", \ - tnf_string, barray_name, str); \ - } \ -} - -#else - -#define FCIP_TNF_BYTE_ARRAY(name, keys, detail, mesg, barray_name, barray, len) - -#endif /* FCIP_TNF_ENABLED */ - /* * FC4 type setttings for Name Server registration. */ diff --git a/usr/src/uts/common/sys/ib/adapters/hermon/hermon.h b/usr/src/uts/common/sys/ib/adapters/hermon/hermon.h index 88496c21df..1982dd2384 100644 --- a/usr/src/uts/common/sys/ib/adapters/hermon/hermon.h +++ b/usr/src/uts/common/sys/ib/adapters/hermon/hermon.h @@ -40,7 +40,6 @@ #include <sys/conf.h> #include <sys/ddi.h> #include <sys/sunddi.h> -#include <sys/tnf_probe.h> #include <sys/taskq.h> #include <sys/atomic.h> #ifdef FMA_TEST diff --git a/usr/src/uts/common/sys/ib/adapters/tavor/tavor.h b/usr/src/uts/common/sys/ib/adapters/tavor/tavor.h index fa8182befd..adda40c724 100644 --- a/usr/src/uts/common/sys/ib/adapters/tavor/tavor.h +++ b/usr/src/uts/common/sys/ib/adapters/tavor/tavor.h @@ -34,8 +34,6 @@ * structure and for proper attach() and detach() processing. Also * includes all the other Tavor header files (and so is the only header * file that is directly included by the Tavor source files). - * Additionally, this file contains some defines and macros used by - * Tavor TNF tracing mechanism. * Lastly, this file includes everything necessary for implementing the * devmap interface and for maintaining the "mapped resource database". */ @@ -44,7 +42,6 @@ #include <sys/conf.h> #include <sys/ddi.h> #include <sys/sunddi.h> -#include <sys/tnf_probe.h> #include <sys/taskq.h> #include <sys/ib/ibtl/ibci.h> @@ -75,25 +72,6 @@ extern "C" { #endif -/* - * The following defines and macros are used for Tavor TNF tracing - * Note: TAVOR_TNF_FAIL is used in routines which has many failure cases. - * It will initialize the "errormsg" and "status" variables (both of which - * must be declared locally in the routines where this macro is used) for use - * in a later TNF probe and return from routine. - */ -#define TAVOR_TNF_ERROR "tavor tavor_error " -#define TAVOR_TNF_TRACE "tavor tavor_trace " -#define TAVOR_TNF_ENTER(func) \ - TNF_PROBE_0_DEBUG(func##_start, TAVOR_TNF_TRACE, "") -#define TAVOR_TNF_EXIT(func) \ - TNF_PROBE_0_DEBUG(func##_end, TAVOR_TNF_TRACE, "") -#define TAVOR_TNF_FAIL(s, e) \ -{ \ - errormsg = (e); \ - status = (s); \ -} - #define TAVOR_VPD_HDR_DWSIZE 0x10 /* 16 Dwords */ #define TAVOR_VPD_HDR_BSIZE 0x40 /* 64 Bytes */ @@ -739,7 +717,7 @@ typedef struct tavor_umap_db_query_s { tavor_umap_db_common_t tqdb_common; } tavor_umap_db_query_t; _NOTE(MUTEX_PROTECTS_DATA(tavor_umap_db_s::tdl_umapdb_lock, - tavor_umap_db_entry_s::tdbe_avlnode + tavor_umap_db_entry_s::tdbe_avlnode tavor_umap_db_entry_s::tdbe_common.tdb_key tavor_umap_db_entry_s::tdbe_common.tdb_value tavor_umap_db_entry_s::tdbe_common.tdb_type diff --git a/usr/src/uts/common/sys/ib/mgt/ibmf/ibmf_trace.h b/usr/src/uts/common/sys/ib/mgt/ibmf/ibmf_trace.h index fe47f3afc8..6b2094745f 100644 --- a/usr/src/uts/common/sys/ib/mgt/ibmf/ibmf_trace.h +++ b/usr/src/uts/common/sys/ib/mgt/ibmf/ibmf_trace.h @@ -27,8 +27,6 @@ #ifndef _SYS_IB_MGT_IBMF_IBMF_TRACE_H #define _SYS_IB_MGT_IBMF_IBMF_TRACE_H -#pragma ident "%Z%%M% %I% %E% SMI" - /* * This file contains the IBMF trace/debug macros. */ @@ -37,11 +35,6 @@ extern "C" { #endif -#include <sys/tnf_probe.h> - -#define IBMF_TNF_ERROR "ibmf ibmf_error" -#define IBMF_TNF_TRACE "ibmf ibmf_trace" - /* * Trace levels for printing */ @@ -54,10 +47,6 @@ extern "C" { /* * Trace probe macros */ -#define IBMF_TNF_NODEBUG 0 -#define IBMF_TNF_DEBUG 1 - -#ifdef NPROBE /* NPROBE */ #define IBMF_TRACE_0(debug, trlevel, arg01, arg02, arg03, arg04) \ if (ibmf_trace_level > 0) { \ @@ -95,105 +84,6 @@ extern "C" { arg43, arg53); \ } -#else - -#define IBMF_TRACE_0(debug, trlevel, arg01, arg02, arg03, arg04) \ -{ \ - boolean_t use_debug = debug; \ - if (use_debug) { \ - TNF_PROBE_0_DEBUG(arg01, arg02, arg03); \ - } else { \ - TNF_PROBE_0(arg01, arg02, arg03); \ - } \ - if (ibmf_trace_level > 0) { \ - ibmf_dprintf(trlevel, arg04); \ - } \ -} - -/* CSTYLED */ -#define IBMF_TRACE_1(debug, trlevel, arg01, arg02, arg03, arg04, arg11, arg12, arg13) \ -{ \ - boolean_t use_debug = debug; \ - if (use_debug) { \ - TNF_PROBE_1_DEBUG(arg01, arg02, arg03, arg11, arg12, arg13);\ - } else { \ - TNF_PROBE_1(arg01, arg02, arg03, arg11, arg12, arg13); \ - } \ - if (ibmf_trace_level > 0) { \ - ibmf_dprintf(trlevel, arg04, arg13); \ - } \ -} - -/* CSTYLED */ -#define IBMF_TRACE_2(debug, trlevel, arg01, arg02, arg03, arg04, arg11, arg12, arg13, arg21, arg22, arg23) \ -{ \ - boolean_t use_debug = debug; \ - if (use_debug) { \ - TNF_PROBE_2_DEBUG(arg01, arg02, arg03, arg11, arg12, \ - arg13, arg21, arg22, arg23); \ - } else { \ - TNF_PROBE_2(arg01, arg02, arg03, arg11, arg12, arg13, \ - arg21, arg22, arg23); \ - } \ - if (ibmf_trace_level > 0) { \ - ibmf_dprintf(trlevel, arg04, arg13, arg23); \ - } \ -} - -/* CSTYLED */ -#define IBMF_TRACE_3(debug, trlevel, arg01, arg02, arg03, arg04, arg11, arg12, arg13, arg21, arg22, arg23, arg31, arg32, arg33) \ -{ \ - boolean_t use_debug = debug; \ - if (use_debug) { \ - TNF_PROBE_3_DEBUG(arg01, arg02, arg03, arg11, arg12, arg13, \ - arg21, arg22, arg23, arg31, arg32, arg33); \ - } else { \ - TNF_PROBE_3(arg01, arg02, arg03, arg11, arg12, arg13, arg21, \ - arg22, arg23, arg31, arg32, arg33); \ - } \ - if (ibmf_trace_level > 0) { \ - ibmf_dprintf(trlevel, arg04, arg13, arg23, arg33); \ - } \ -} - -/* CSTYLED */ -#define IBMF_TRACE_4(debug, trlevel, arg01, arg02, arg03, arg04, arg11, arg12, arg13, arg21, arg22, arg23, arg31, arg32, arg33, arg41, arg42, arg43) \ -{ \ - boolean_t use_debug = debug; \ - if (use_debug) { \ - TNF_PROBE_4_DEBUG(arg01, arg02, arg03, arg11, arg12, arg13, \ - arg21, arg22, arg23, arg31, arg32, arg33, arg41, arg42, \ - arg43); \ - } else { \ - TNF_PROBE_4(arg01, arg02, arg03, arg11, arg12, arg13, arg21, \ - arg22, arg23, arg31, arg32, arg33, arg41, arg42, arg43); \ - } \ - if (ibmf_trace_level > 0) { \ - ibmf_dprintf(trlevel, arg04, arg13, arg23, arg33, arg43);\ - } \ -} - -/* CSTYLED */ -#define IBMF_TRACE_5(debug, trlevel, arg01, arg02, arg03, arg04, arg11, arg12, arg13, arg21, arg22, arg23, arg31, arg32, arg33, arg41, arg42, arg43, arg51, arg52, arg53) \ -{ \ - boolean_t use_debug = debug; \ - if (use_debug) { \ - TNF_PROBE_5_DEBUG(arg01, arg02, arg03, arg11, arg12, arg13, \ - arg21, arg22, arg23, arg31, arg32, arg33, arg41, arg42, \ - arg43, arg51, arg52, arg53); \ - } else { \ - TNF_PROBE_5(arg01, arg02, arg03, arg11, arg12, arg13, arg21, \ - arg22, arg23, arg31, arg32, arg33, arg41, arg42, arg43, \ - arg51, arg52, arg53); \ - } \ - if (ibmf_trace_level > 0) { \ - ibmf_dprintf(trlevel, arg04, arg13, arg23, arg33, arg43, \ - arg53); \ - } \ -} - -#endif - void ibmf_dprintf(int l, const char *fmt, ...); diff --git a/usr/src/uts/common/sys/kobj_impl.h b/usr/src/uts/common/sys/kobj_impl.h index 752217b5cf..10b0724b0e 100644 --- a/usr/src/uts/common/sys/kobj_impl.h +++ b/usr/src/uts/common/sys/kobj_impl.h @@ -82,7 +82,7 @@ struct proginfo { #define KOBJ_INTERP 0x0008 /* the interpreter module */ #define KOBJ_PRIM 0x0010 /* a primary kernel module */ #define KOBJ_RESOLVED 0x0020 /* fully resolved */ -#define KOBJ_TNF_PROBE 0x0040 /* Contains TNF probe(s) */ +/* 0x0040 unused. */ #define KOBJ_RELOCATED 0x0080 /* relocation completed */ #define KOBJ_NOPARENTS 0x0200 /* nothing can depend on this module */ #define KOBJ_IGNMULDEF 0x0400 /* ignore dups during sym resolution */ diff --git a/usr/src/uts/common/sys/proc.h b/usr/src/uts/common/sys/proc.h index a2fd02e910..06e5a8caf4 100644 --- a/usr/src/uts/common/sys/proc.h +++ b/usr/src/uts/common/sys/proc.h @@ -292,11 +292,6 @@ typedef struct proc { char p_unref_thread; /* unref thread created */ /* - * Kernel probes - */ - uchar_t p_tnf_flags; - - /* * Solaris Audit */ struct p_audit_data *p_audit_data; /* per process audit structure */ diff --git a/usr/src/uts/common/sys/thread.h b/usr/src/uts/common/sys/thread.h index 3822dc2fde..53a31c848c 100644 --- a/usr/src/uts/common/sys/thread.h +++ b/usr/src/uts/common/sys/thread.h @@ -158,7 +158,6 @@ typedef struct _kthread { struct _kthread *t_intr; /* interrupted (pinned) thread */ uint64_t t_intr_start; /* timestamp when time slice began */ kt_did_t t_did; /* thread id for kernel debuggers */ - caddr_t t_tnf_tpdp; /* Trace facility data pointer */ struct _kcpc_ctx *t_cpc_ctx; /* performance counter context */ struct _kcpc_set *t_cpc_set; /* set this thread has bound */ diff --git a/usr/src/uts/common/sys/tnf.h b/usr/src/uts/common/sys/tnf.h deleted file mode 100644 index 9061ed1fae..0000000000 --- a/usr/src/uts/common/sys/tnf.h +++ /dev/null @@ -1,121 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - * All rights reserved. - */ - -#ifndef _SYS_TNF_H -#define _SYS_TNF_H - -#pragma ident "%Z%%M% %I% %E% SMI" - -#ifndef NPROBE - -#include <sys/types.h> -#include <sys/thread.h> -#include <sys/proc.h> -#include <sys/cpuvar.h> - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * - */ - -typedef struct { - ulong_t probenum; - int enabled; - int traced; - int attrsize; -} tnf_probevals_t; - -/* - * - */ - -typedef struct { - enum { - TIFIOCBUF_NONE, - TIFIOCBUF_UNINIT, - TIFIOCBUF_OK, - TIFIOCBUF_BROKEN - } buffer_state; - int buffer_size; - int trace_stopped; - int pidfilter_mode; - int pidfilter_size; -} tifiocstate_t; - -typedef struct { - char *dst_addr; - int block_num; -} tifiocgblock_t; - -typedef struct { - long *dst_addr; - int start; - int slots; -} tifiocgfw_t; - -/* - * ioctl codes - */ - -#define TIFIOCGMAXPROBE (('t' << 8) | 1) /* get max probe number */ -#define TIFIOCGPROBEVALS (('t' << 8) | 2) /* get probe info */ -#define TIFIOCGPROBESTRING (('t' << 8) | 3) /* get probe string */ -#define TIFIOCSPROBEVALS (('t' << 8) | 4) /* set probe info */ -#define TIFIOCGSTATE (('t' << 8) | 5) /* get tracing system state */ -#define TIFIOCALLOCBUF (('t' << 8) | 6) /* allocate trace buffer */ -#define TIFIOCDEALLOCBUF (('t' << 8) | 7) /* dealloc trace buffer */ -#define TIFIOCSTRACING (('t' << 8) | 8) /* set ktrace mode */ -#define TIFIOCSPIDFILTER (('t' << 8) | 9) /* set pidfilter mode */ -#define TIFIOCGPIDSTATE (('t' << 8) | 10) /* check pid filter member */ -#define TIFIOCSPIDON (('t' << 8) | 11) /* add pid to filter */ -#define TIFIOCSPIDOFF (('t' << 8) | 12) /* drop pid from filter */ -#define TIFIOCPIDFILTERGET (('t' << 8) | 13) /* return pid filter set */ -#define TIFIOCGHEADER (('t' << 8) | 14) /* copy out tnf header blk */ -#define TIFIOCGBLOCK (('t' << 8) | 15) /* copy out tnf block */ -#define TIFIOCGFWZONE (('t' << 8) | 16) /* copy out forwarding ptrs */ - -#ifdef _KERNEL - -extern volatile int tnf_tracing_active; - -extern void tnf_thread_create(kthread_t *); -extern void tnf_thread_queue(kthread_t *, cpu_t *, pri_t); -extern void tnf_thread_switch(kthread_t *); -extern void tnf_thread_exit(void); -extern void tnf_thread_free(kthread_t *); - -#endif /* _KERNEL */ - -#ifdef __cplusplus -} -#endif - -#endif /* NPROBE */ - -#endif /* _SYS_TNF_H */ diff --git a/usr/src/uts/common/sys/tnf_com.h b/usr/src/uts/common/sys/tnf_com.h deleted file mode 100644 index a562bc2538..0000000000 --- a/usr/src/uts/common/sys/tnf_com.h +++ /dev/null @@ -1,326 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#ifndef _SYS_TNF_COM_H -#define _SYS_TNF_COM_H - -#pragma ident "%Z%%M% %I% %E% SMI" - -#include <sys/types.h> - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * NOTE: All types are in host (not necessarily file) format. - * Readers are responsible for endian or other transformation. - */ - -/* - * Magic number(s): first word of TNF file. - * - * A writer stores the native unsigned 32-bit integer TNF_MAGIC. - * A same-endian reader will load it as TNF_MAGIC. - * A different-endian reader will load it as TNF_MAGIC_1. - */ - -#define TNF_MAGIC 0x544e4600 -#define TNF_MAGIC_1 0x00464e54 - -/* - * Fundamental types. Machine dependent. - */ - -typedef char tnf_char_t; -typedef signed char tnf_int8_t; -typedef unsigned char tnf_uint8_t; -typedef short tnf_int16_t; -typedef unsigned short tnf_uint16_t; -typedef int tnf_int32_t; -typedef unsigned int tnf_uint32_t; -typedef longlong_t tnf_int64_t; -typedef u_longlong_t tnf_uint64_t; -typedef float tnf_float32_t; -typedef double tnf_float64_t; - -/* - * TNF references - */ - -typedef tnf_int32_t tnf_ref32_t; /* self-relative, 32 bits */ -typedef tnf_int16_t tnf_ref16_t; /* self-relative, 16 bits */ -typedef tnf_uint16_t tnf_abs16_t; /* absolute, 16 bits */ - -/* Generation number for tag blocks */ -#define TNF_TAG_GENERATION_NUM 0xffffffff - -/* definition of space values */ -#define TNF_SPACE_MASK 0x80000000 -#define TNF_SPACE_PERMANENT 0x80000000 -#define TNF_SPACE_RECLAIMABLE 0x0 -#define TNF_SPACE_SIGN_BIT 0x40000000 - -/* Macros on setting or checking space values */ -#define TNF_REF32_MAKE_PERMANENT(x) ((x) | TNF_SPACE_PERMANENT) -#define TNF_REF32_MAKE_RECLAIMABLE(x) ((x) & ~TNF_SPACE_MASK) -#define TNF_REF32_SPACE(x) \ - ((tnf_uint32_t)(x) & TNF_SPACE_MASK) -#define TNF_REF32_IS_PERMANENT(x) \ - (TNF_REF32_SPACE(x) == TNF_SPACE_PERMANENT) -#define TNF_REF32_IS_RECLAIMABLE(x) \ - (TNF_REF32_SPACE(x) == TNF_SPACE_RECLAIMABLE) -#define TNF_REF32_SIGN_EXTEND(x) \ - ((((tnf_uint32_t)(x) & TNF_SPACE_SIGN_BIT) == TNF_SPACE_SIGN_BIT) ? \ - ((tnf_ref32_t)((tnf_uint32_t)(x) | TNF_SPACE_MASK)) : \ - (x)) - -/* definition of references */ -#define TNF_REF32_TYPE_MASK 0x3 -#define TNF_REF32_T_FULL 0x0 -#define TNF_REF32_T_FWD TNF_REF32_T_FULL -#define TNF_REF32_T_PAIR 0x1 -#define TNF_REF32_T_TAG 0x2 -#define TNF_REF32_T_RSVD 0x3 - -#define TNF_REF32_REF16_MASK 0xffff - -#define TNF_REF32_TAG16_SHIFT 16 -#define TNF_REF32_TAG16_MASK 0xffff - -#define TNF_REF16_TYPE_MASK 0x3 - -#define TNF_TAG16_TYPE_MASK 0x3 -#define TNF_TAG16_T_ABS TNF_REF32_T_PAIR -#define TNF_TAG16_T_REL TNF_REF32_T_FWD - -#define TNF_NULL 0 - -/* Macros on tnf_ref32_t values: */ - -#define TNF_REF32_TYPE(x) \ - ((tnf_uint32_t)(x) & TNF_REF32_TYPE_MASK) -#define TNF_REF32_VALUE(x) \ - ((tnf_ref32_t)(((tnf_uint32_t)(x) & ~TNF_REF32_TYPE_MASK) & \ - ~TNF_SPACE_MASK)) - -#define TNF_REF32_IS_FULL(x) (TNF_REF32_TYPE(x) == TNF_REF32_T_FULL) -#define TNF_REF32_IS_FWD(x) (TNF_REF32_TYPE(x) == TNF_REF32_T_FWD) -#define TNF_REF32_IS_PAIR(x) (TNF_REF32_TYPE(x) == TNF_REF32_T_PAIR) -#define TNF_REF32_IS_TAG(x) (TNF_REF32_TYPE(x) == TNF_REF32_T_TAG) -#define TNF_REF32_IS_RSVD(x) (TNF_REF32_TYPE(x) == TNF_REF32_T_RSVD) -#define TNF_REF32_IS_NULL(x) ((x) == TNF_NULL) - -#define TNF_REF32_REF16(x) \ - ((tnf_ref16_t)((tnf_uint32_t)(x) & TNF_REF32_REF16_MASK)) - -#define TNF_REF32_TAG16(x) \ - ((tnf_ref16_t)(((tnf_uint32_t)(x) >> TNF_REF32_TAG16_SHIFT) \ - & TNF_REF32_TAG16_MASK)) - -/* Macros on tnf_ref16_t values: */ - -#define TNF_REF16_TYPE(x) \ - ((tnf_uint32_t)(x) & TNF_REF16_TYPE_MASK) -#define TNF_REF16_VALUE(x) \ - ((tnf_ref16_t)((tnf_uint32_t)(x) & ~TNF_REF16_TYPE_MASK)) - -#define TNF_TAG16_TYPE(x) \ - ((tnf_uint32_t)(x) & TNF_TAG16_TYPE_MASK) - -#define TNF_TAG16_IS_REL(x) (TNF_TAG16_TYPE(x) == TNF_TAG16_T_REL) -#define TNF_TAG16_IS_ABS(x) (TNF_TAG16_TYPE(x) == TNF_TAG16_T_ABS) - -/* The two kinds of values a tag16 can have: */ - -#define TNF_TAG16_REF16(x) \ - ((tnf_ref16_t)((tnf_uint32_t)(x) & ~TNF_TAG16_TYPE_MASK)) -#define TNF_TAG16_ABS16(x) \ - ((tnf_abs16_t)((tnf_uint32_t)(x) & ~TNF_TAG16_TYPE_MASK)) - -/* - * TNF binary layouts - */ - -struct tnf_tagged_hdr { - tnf_ref32_t tag; /* type record */ -}; - -struct tnf_array_hdr { - tnf_ref32_t tag; /* type record */ - tnf_uint32_t self_size; /* total size */ -}; - -struct tnf_type_hdr { - tnf_ref32_t tag; /* type record */ - tnf_ref32_t name; /* string record */ - tnf_ref32_t properties; /* array of type records */ -}; - -struct tnf_struct_type_hdr { - tnf_ref32_t tag; /* type record */ - tnf_ref32_t name; /* string record */ - tnf_ref32_t properties; /* array of type records */ - tnf_ref32_t slot_types; /* array of type records */ - tnf_uint32_t type_size; /* size of struct */ -}; - -struct tnf_array_type_hdr { - tnf_ref32_t tag; /* type record */ - tnf_ref32_t name; /* string record */ - tnf_ref32_t properties; /* array of type records */ - tnf_ref32_t slot_types; /* array of type records */ - tnf_uint32_t header_size; /* size of array header */ -}; - -struct tnf_derived_type_hdr { - tnf_ref32_t tag; /* type record */ - tnf_ref32_t name; /* string record */ - tnf_ref32_t properties; /* array of type records */ - tnf_ref32_t derived_base; /* type record */ -}; - -/* - * File header, after magic # - */ - -#define TNF_FILE_VERSION 1 - -typedef struct tnf_file_header { - tnf_ref32_t tag; - tnf_uint32_t file_version; /* TNF_FILE_VERSION */ - tnf_uint32_t file_header_size; - tnf_uint32_t file_log_size; - tnf_uint32_t block_header_size; - tnf_uint32_t block_size; - tnf_uint32_t directory_size; - tnf_uint32_t block_count; - tnf_uint32_t blocks_valid; - /* writer-specific information after this */ - /* zero padding to end of block */ -} tnf_file_header_t; - -/* - * Block header - */ - -typedef unsigned char tnf_byte_lock_t; - -typedef struct tnf_block_header { - tnf_ref32_t tag; - tnf_uint32_t generation; /* (-1) => tag block */ - tnf_uint16_t bytes_valid; - tnf_byte_lock_t A_lock; - tnf_byte_lock_t B_lock; - struct tnf_block_header *next_block; /* release list */ -} tnf_block_header_t; - -/* - * TNF type names - */ - -#define TNF_N_INLINE "tnf_inline" -#define TNF_N_TAGGED "tnf_tagged" - -#define TNF_N_SCALAR "tnf_scalar" -#define TNF_N_CHAR "tnf_char" -#define TNF_N_INT8 "tnf_int8" -#define TNF_N_UINT8 "tnf_uint8" -#define TNF_N_INT16 "tnf_int16" -#define TNF_N_UINT16 "tnf_uint16" -#define TNF_N_INT32 "tnf_int32" -#define TNF_N_UINT32 "tnf_uint32" -#define TNF_N_INT64 "tnf_int64" -#define TNF_N_UINT64 "tnf_uint64" -#define TNF_N_FLOAT32 "tnf_float32" -#define TNF_N_FLOAT64 "tnf_float64" - -#define TNF_N_ARRAY "tnf_array" -#define TNF_N_STRING "tnf_string" -#define TNF_N_TYPE_ARRAY "tnf_type_array" -#define TNF_N_NAME_ARRAY "tnf_name_array" - -#define TNF_N_ALIGN "tnf_align" -#define TNF_N_DERIVED "tnf_derived" -#define TNF_N_DERIVED_BASE "tnf_derived_base" -#define TNF_N_ELEMENT_TYPE "tnf_element_type" -#define TNF_N_HEADER_SIZE "tnf_header_size" -#define TNF_N_NAME "tnf_name" -#define TNF_N_OPAQUE "tnf_opaque" -#define TNF_N_PROPERTIES "tnf_properties" -#define TNF_N_SELF_SIZE "tnf_self_size" -#define TNF_N_SIZE "tnf_size" -#define TNF_N_SLOT_NAMES "tnf_slot_names" -#define TNF_N_SLOT_TYPES "tnf_slot_types" -#define TNF_N_TAG "tnf_tag" -#define TNF_N_TAG_ARG "tnf_tag_arg" -#define TNF_N_TYPE_SIZE "tnf_type_size" - -#define TNF_N_STRUCT "tnf_struct" - -#define TNF_N_ARRAY_TYPE "tnf_array_type" -#define TNF_N_DERIVED_TYPE "tnf_derived_type" -#define TNF_N_SCALAR_TYPE "tnf_scalar_type" -#define TNF_N_STRUCT_TYPE "tnf_struct_type" -#define TNF_N_TYPE "tnf_type" - -/* - * Reserved names for block and file header information - */ - -#define TNF_N_FILE_HEADER "tnf_file_header" -#define TNF_N_FILE_VERSION "file_version" -#define TNF_N_FILE_HEADER_SIZE "file_header_size" -#define TNF_N_FILE_LOGICAL_SIZE "file_logical_size" -#define TNF_N_BLOCK_HEADER_SIZE "block_header_size" -#define TNF_N_BLOCK_SIZE "block_size" -#define TNF_N_DIRECTORY_SIZE "directory_size" -#define TNF_N_BLOCK_COUNT "block_count" -#define TNF_N_BLOCKS_VALID "blocks_valid" - -#define TNF_N_BLOCK_HEADER "tnf_block_header" -#define TNF_N_GENERATION "generation" -#define TNF_N_BYTES_VALID "bytes_valid" - -/* - * Reserved names for schedule record information - */ - -#define TNF_N_USER_SCHEDULE "tnf_user_schedule" -#define TNF_N_KERNEL_SCHEDULE "tnf_kernel_schedule" - -#define TNF_N_PID "pid" -#define TNF_N_LWPID "lwpid" -#define TNF_N_TID "tid" -#define TNF_N_TIME_BASE "time_base" -#define TNF_N_TIME_DELTA "time_delta" - -/* XXX TODO: kernel type names */ - -#ifdef __cplusplus -} -#endif - -#endif /* _SYS_TNF_COM_H */ diff --git a/usr/src/uts/common/sys/tnf_probe.h b/usr/src/uts/common/sys/tnf_probe.h deleted file mode 100644 index f15daaf63e..0000000000 --- a/usr/src/uts/common/sys/tnf_probe.h +++ /dev/null @@ -1,990 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#ifndef _SYS_TNF_PROBE_H -#define _SYS_TNF_PROBE_H - -#pragma ident "%Z%%M% %I% %E% SMI" - -#include <sys/tnf_writer.h> - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * These macros are used to convert the __LINE__ directive to a - * string in the probe macros below. - */ - -#define TNF_STRINGIFY(x) #x -#define TNF_STRINGVALUE(x) TNF_STRINGIFY(x) - -/* - * Alignment of tnf_ref32_t - */ - -struct _tnf_ref32_align { - char c; - tnf_ref32_t t; -}; -#define TNF_REF32_ALIGN TNF_OFFSETOF(struct _tnf_ref32_align, t) - -/* - * Probe versioning - */ - -struct tnf_probe_version { - size_t version_size; /* sizeof(struct tnf_probe_version) */ - size_t probe_control_size; /* sizeof(tnf_probe_control_t) */ -}; - -extern struct tnf_probe_version __tnf_probe_version_1; -#pragma weak __tnf_probe_version_1 - -/* - * Typedefs - */ - -typedef struct tnf_probe_control tnf_probe_control_t; -typedef struct tnf_probe_setup tnf_probe_setup_t; - -/* returns pointer to buffer */ -typedef void * (*tnf_probe_test_func_t)(void *, - tnf_probe_control_t *, - tnf_probe_setup_t *); - -/* returns buffer pointer */ -typedef void * (*tnf_probe_alloc_func_t)(tnf_ops_t *, /* tpd */ - tnf_probe_control_t *, - tnf_probe_setup_t *); - -typedef void (*tnf_probe_func_t)(tnf_probe_setup_t *); - -/* - * Probe argument block - */ - -struct tnf_probe_setup { - tnf_ops_t *tpd_p; - void *buffer_p; - tnf_probe_control_t *probe_p; -}; - -/* - * Probe control block - */ - -struct tnf_probe_control { - const struct tnf_probe_version *version; - tnf_probe_control_t *next; - tnf_probe_test_func_t test_func; - tnf_probe_alloc_func_t alloc_func; - tnf_probe_func_t probe_func; - tnf_probe_func_t commit_func; - uintptr_t index; - const char *attrs; - tnf_tag_data_t ***slot_types; - unsigned long tnf_event_size; -}; - -#ifdef _KERNEL - -#define TNF_NEXT_INIT 0 - -#else - -#define TNF_NEXT_INIT -1 - -#endif /* _KERNEL */ - -/* - * TNF Type extension - */ - -#ifdef NPROBE - -#define TNF_DECLARE_RECORD(ctype, record) \ - typedef tnf_reference_t record##_t - -#else - -#define TNF_DECLARE_RECORD(ctype, record) \ - typedef tnf_reference_t record##_t; \ - extern tnf_tag_data_t *record##_tag_data; \ - extern record##_t record(tnf_ops_t *, ctype *, tnf_record_p) - -#endif /* NPROBE */ - -#ifdef NPROBE - -/* CSTYLED */ -#define TNF_DEFINE_RECORD_1(ctype, ctype_record, t1, n1) - -#else - -/* CSTYLED */ -#define TNF_DEFINE_RECORD_1(ctype, ctype_record, t1, n1) \ -typedef struct { \ - tnf_tag_t tag; \ - t1##_t data_1; \ -} ctype_record##_prototype_t; \ -static tnf_tag_data_t **ctype_record##_type_slots[] = { \ - &tnf_tag_tag_data, \ - &t1##_tag_data, \ - 0 }; \ -static char *ctype_record##_slot_names[] = { \ - "tnf_tag", \ - ""#n1, \ - 0 }; \ -static tnf_tag_data_t ctype_record##_tag_data_rec = { \ - TNF_TAG_VERSION, &tnf_struct_tag_1, \ - 0, #ctype_record, &tnf_user_struct_properties, \ - sizeof (ctype_record##_prototype_t), \ - TNF_REF32_ALIGN, \ - sizeof (ctype_record##_t), TNF_STRUCT, 0, \ - ctype_record##_type_slots, ctype_record##_slot_names \ -}; \ -tnf_tag_data_t *ctype_record##_tag_data = \ - &ctype_record##_tag_data_rec; \ -ctype_record##_t \ -ctype_record(tnf_ops_t *ops, ctype * the_ctype, \ - tnf_record_p reference) \ -{ \ - tnf_tag_data_t *metatag_data; \ - tnf_record_p metatag_index; \ - ctype_record##_prototype_t *buffer; \ - \ - if (the_ctype == NULL) \ - return (0); \ - buffer = (ctype_record##_prototype_t *) tnf_allocate(ops, \ - sizeof (ctype_record##_prototype_t)); \ - if (buffer == NULL) \ - return (0); \ - \ - metatag_data = ctype_record##_tag_data; \ - metatag_index = metatag_data->tag_index ? \ - metatag_data->tag_index: \ - metatag_data->tag_desc(ops, metatag_data); \ - buffer->tag = tnf_tag(ops, metatag_index, \ - (tnf_record_p) &buffer->tag); \ - buffer->data_1 = t1(ops, the_ctype->n1, \ - (tnf_record_p) &(buffer->data_1)); \ - return (tnf_ref32(ops, (tnf_record_p) buffer, reference)); \ -} - -#endif /* NPROBE */ - -#ifdef NPROBE - -/* CSTYLED */ -#define TNF_DEFINE_RECORD_2(ctype, ctype_record, t1, n1, t2, n2) - -#else - -/* CSTYLED */ -#define TNF_DEFINE_RECORD_2(ctype, ctype_record, t1, n1, t2, n2) \ -typedef struct { \ - tnf_tag_t tag; \ - t1##_t data_1; \ - t2##_t data_2; \ -} ctype_record##_prototype_t; \ -static tnf_tag_data_t **ctype_record##_type_slots[] = { \ - &tnf_tag_tag_data, \ - &t1##_tag_data, \ - &t2##_tag_data, \ - 0 }; \ -static char *ctype_record##_slot_names[] = { \ - "tnf_tag", \ - ""#n1, \ - ""#n2, \ - 0 }; \ -static tnf_tag_data_t ctype_record##_tag_data_rec = { \ - TNF_TAG_VERSION, &tnf_struct_tag_1, \ - 0, #ctype_record, &tnf_user_struct_properties, \ - sizeof (ctype_record##_prototype_t), \ - TNF_REF32_ALIGN, \ - sizeof (ctype_record##_t), TNF_STRUCT, 0, \ - ctype_record##_type_slots, ctype_record##_slot_names \ -}; \ -tnf_tag_data_t *ctype_record##_tag_data = \ - &ctype_record##_tag_data_rec; \ -ctype_record##_t \ -ctype_record(tnf_ops_t *ops, ctype * the_ctype, \ - tnf_record_p reference) \ -{ \ - tnf_tag_data_t *metatag_data; \ - tnf_record_p metatag_index; \ - ctype_record##_prototype_t *buffer; \ - \ - if (the_ctype == NULL) \ - return (0); \ - buffer = (ctype_record##_prototype_t *) tnf_allocate(ops, \ - sizeof (ctype_record##_prototype_t)); \ - if (buffer == NULL) \ - return (0); \ - \ - metatag_data = ctype_record##_tag_data; \ - metatag_index = metatag_data->tag_index ? \ - metatag_data->tag_index: \ - metatag_data->tag_desc(ops, metatag_data); \ - buffer->tag = tnf_tag(ops, metatag_index, \ - (tnf_record_p) &buffer->tag); \ - buffer->data_1 = t1(ops, the_ctype->n1, \ - (tnf_record_p) &(buffer->data_1)); \ - buffer->data_2 = t2(ops, the_ctype->n2, \ - (tnf_record_p) &(buffer->data_2)); \ - return (tnf_ref32(ops, (tnf_record_p) buffer, reference)); \ -} - -#endif /* NPROBE */ - -#ifdef NPROBE - -/* CSTYLED */ -#define TNF_DEFINE_RECORD_3(ctype, ctype_record, t1, n1, t2, n2, t3, n3) - -#else - -/* CSTYLED */ -#define TNF_DEFINE_RECORD_3(ctype, ctype_record, t1, n1, t2, n2, t3, n3) \ -typedef struct { \ - tnf_tag_t tag; \ - t1##_t data_1; \ - t2##_t data_2; \ - t3##_t data_3; \ -} ctype_record##_prototype_t; \ -static tnf_tag_data_t **ctype_record##_type_slots[] = { \ - &tnf_tag_tag_data, \ - &t1##_tag_data, \ - &t2##_tag_data, \ - &t3##_tag_data, \ - 0 }; \ -static char *ctype_record##_slot_names[] = { \ - "tnf_tag", \ - ""#n1, \ - ""#n2, \ - ""#n3, \ - 0 }; \ -static tnf_tag_data_t ctype_record##_tag_data_rec = { \ - TNF_TAG_VERSION, &tnf_struct_tag_1, \ - 0, #ctype_record, &tnf_user_struct_properties, \ - sizeof (ctype_record##_prototype_t), \ - TNF_REF32_ALIGN, \ - sizeof (ctype_record##_t), TNF_STRUCT, 0, \ - ctype_record##_type_slots, ctype_record##_slot_names \ -}; \ -tnf_tag_data_t *ctype_record##_tag_data = \ - &ctype_record##_tag_data_rec; \ -ctype_record##_t \ -ctype_record(tnf_ops_t *ops, ctype * the_ctype, \ - tnf_record_p reference) \ -{ \ - tnf_tag_data_t *metatag_data; \ - tnf_record_p metatag_index; \ - ctype_record##_prototype_t *buffer; \ - \ - if (the_ctype == NULL) \ - return (0); \ - buffer = (ctype_record##_prototype_t *) tnf_allocate(ops, \ - sizeof (ctype_record##_prototype_t)); \ - if (buffer == NULL) \ - return (0); \ - \ - metatag_data = ctype_record##_tag_data; \ - metatag_index = metatag_data->tag_index ? \ - metatag_data->tag_index: \ - metatag_data->tag_desc(ops, metatag_data); \ - buffer->tag = tnf_tag(ops, metatag_index, \ - (tnf_record_p) &buffer->tag); \ - buffer->data_1 = t1(ops, the_ctype->n1, \ - (tnf_record_p) &(buffer->data_1)); \ - buffer->data_2 = t2(ops, the_ctype->n2, \ - (tnf_record_p) &(buffer->data_2)); \ - buffer->data_3 = t3(ops, the_ctype->n3, \ - (tnf_record_p) &(buffer->data_3)); \ - return (tnf_ref32(ops, (tnf_record_p) buffer, reference)); \ -} - -#endif /* NPROBE */ - -#ifdef NPROBE - -/* CSTYLED */ -#define TNF_DEFINE_RECORD_4(ctype, ctype_record, t1, n1, t2, n2, t3, n3, t4, n4) - -#else - -/* CSTYLED */ -#define TNF_DEFINE_RECORD_4(ctype, ctype_record, t1, n1, t2, n2, t3, n3, t4, n4) \ -typedef struct { \ - tnf_tag_t tag; \ - t1##_t data_1; \ - t2##_t data_2; \ - t3##_t data_3; \ - t4##_t data_4; \ -} ctype_record##_prototype_t; \ -static tnf_tag_data_t **ctype_record##_type_slots[] = { \ - &tnf_tag_tag_data, \ - &t1##_tag_data, \ - &t2##_tag_data, \ - &t3##_tag_data, \ - &t4##_tag_data, \ - 0 }; \ -static char *ctype_record##_slot_names[] = { \ - "tnf_tag", \ - ""#n1, \ - ""#n2, \ - ""#n3, \ - ""#n4, \ - 0 }; \ -static tnf_tag_data_t ctype_record##_tag_data_rec = { \ - TNF_TAG_VERSION, &tnf_struct_tag_1, \ - 0, #ctype_record, &tnf_user_struct_properties, \ - sizeof (ctype_record##_prototype_t), \ - TNF_REF32_ALIGN, \ - sizeof (ctype_record##_t), TNF_STRUCT, 0, \ - ctype_record##_type_slots, ctype_record##_slot_names \ -}; \ -tnf_tag_data_t *ctype_record##_tag_data = \ - &ctype_record##_tag_data_rec; \ -ctype_record##_t \ -ctype_record(tnf_ops_t *ops, ctype * the_ctype, \ - tnf_record_p reference) \ -{ \ - tnf_tag_data_t *metatag_data; \ - tnf_record_p metatag_index; \ - ctype_record##_prototype_t *buffer; \ - \ - if (the_ctype == NULL) \ - return (0); \ - buffer = (ctype_record##_prototype_t *) tnf_allocate(ops, \ - sizeof (ctype_record##_prototype_t)); \ - if (buffer == NULL) \ - return (0); \ - \ - metatag_data = ctype_record##_tag_data; \ - metatag_index = metatag_data->tag_index ? \ - metatag_data->tag_index: \ - metatag_data->tag_desc(ops, metatag_data); \ - buffer->tag = tnf_tag(ops, metatag_index, \ - (tnf_record_p) &buffer->tag); \ - buffer->data_1 = t1(ops, the_ctype->n1, \ - (tnf_record_p) &(buffer->data_1)); \ - buffer->data_2 = t2(ops, the_ctype->n2, \ - (tnf_record_p) &(buffer->data_2)); \ - buffer->data_3 = t3(ops, the_ctype->n3, \ - (tnf_record_p) &(buffer->data_3)); \ - buffer->data_4 = t4(ops, the_ctype->n4, \ - (tnf_record_p) &(buffer->data_4)); \ - return (tnf_ref32(ops, (tnf_record_p) buffer, reference)); \ -} - -#endif /* NPROBE */ - -#ifdef NPROBE - -/* CSTYLED */ -#define TNF_DEFINE_RECORD_5(ctype, ctype_record, t1, n1, t2, n2, t3, n3, t4, n4, t5, n5) - -#else - -/* CSTYLED */ -#define TNF_DEFINE_RECORD_5(ctype, ctype_record, t1, n1, t2, n2, t3, n3, t4, n4, t5, n5) \ -typedef struct { \ - tnf_tag_t tag; \ - t1##_t data_1; \ - t2##_t data_2; \ - t3##_t data_3; \ - t4##_t data_4; \ - t5##_t data_5; \ -} ctype_record##_prototype_t; \ -static tnf_tag_data_t **ctype_record##_type_slots[] = { \ - &tnf_tag_tag_data, \ - &t1##_tag_data, \ - &t2##_tag_data, \ - &t3##_tag_data, \ - &t4##_tag_data, \ - &t5##_tag_data, \ - 0 }; \ -static char *ctype_record##_slot_names[] = { \ - "tnf_tag", \ - ""#n1, \ - ""#n2, \ - ""#n3, \ - ""#n4, \ - ""#n5, \ - 0 }; \ -static tnf_tag_data_t ctype_record##_tag_data_rec = { \ - TNF_TAG_VERSION, &tnf_struct_tag_1, \ - 0, #ctype_record, &tnf_user_struct_properties, \ - sizeof (ctype_record##_prototype_t), \ - TNF_REF32_ALIGN, \ - sizeof (ctype_record##_t), TNF_STRUCT, 0, \ - ctype_record##_type_slots, ctype_record##_slot_names \ -}; \ -tnf_tag_data_t *ctype_record##_tag_data = \ - &ctype_record##_tag_data_rec; \ -ctype_record##_t \ -ctype_record(tnf_ops_t *ops, ctype * the_ctype, \ - tnf_record_p reference) \ -{ \ - tnf_tag_data_t *metatag_data; \ - tnf_record_p metatag_index; \ - ctype_record##_prototype_t *buffer; \ - \ - if (the_ctype == NULL) \ - return (0); \ - buffer = (ctype_record##_prototype_t *) tnf_allocate(ops, \ - sizeof (ctype_record##_prototype_t)); \ - if (buffer == NULL) \ - return (0); \ - \ - metatag_data = ctype_record##_tag_data; \ - metatag_index = metatag_data->tag_index ? \ - metatag_data->tag_index: \ - metatag_data->tag_desc(ops, metatag_data); \ - buffer->tag = tnf_tag(ops, metatag_index, \ - (tnf_record_p) &buffer->tag); \ - buffer->data_1 = t1(ops, the_ctype->n1, \ - (tnf_record_p) &(buffer->data_1)); \ - buffer->data_2 = t2(ops, the_ctype->n2, \ - (tnf_record_p) &(buffer->data_2)); \ - buffer->data_3 = t3(ops, the_ctype->n3, \ - (tnf_record_p) &(buffer->data_3)); \ - buffer->data_4 = t4(ops, the_ctype->n4, \ - (tnf_record_p) &(buffer->data_4)); \ - buffer->data_5 = t5(ops, the_ctype->n5, \ - (tnf_record_p) &(buffer->data_5)); \ - return (tnf_ref32(ops, (tnf_record_p) buffer, reference)); \ -} - -#endif /* NPROBE */ - -/* - * Probe Macros - */ - -#ifdef NPROBE - -/* CSTYLED */ -#define TNF_PROBE_0(namearg, keysarg, detail) \ - ((void)0) - -#else - -/* CSTYLED */ -#define TNF_PROBE_0(namearg, keysarg, detail) \ -{ \ - struct tnf_v_buf_0 { \ - tnf_probe_event_t probe_event; \ - tnf_time_delta_t time_delta; \ - }; \ - static tnf_tag_data_t ** tnf_v_##namearg##_info[] = { \ - &tnf_probe_event_tag_data, \ - &tnf_time_delta_tag_data, \ - 0 }; \ - static struct tnf_probe_control tnf_v_##namearg##_probe = { \ - &__tnf_probe_version_1, \ - (tnf_probe_control_t *) TNF_NEXT_INIT, \ - (tnf_probe_test_func_t) 0, \ - (tnf_probe_alloc_func_t) 0, \ - (tnf_probe_func_t) 0, \ - (tnf_probe_func_t) 0, \ - (tnf_uint32_t) 0, \ - /* attribute string */ \ - "name " TNF_STRINGVALUE(namearg) ";" \ - "slots " \ - ";" \ - "keys " keysarg ";" \ - "file " __FILE__ ";" \ - "line " TNF_STRINGVALUE(__LINE__) ";" \ - detail, \ - tnf_v_##namearg##_info, \ - sizeof (struct tnf_v_buf_0) \ - }; \ - tnf_probe_control_t *tnf_v_probe_p = &tnf_v_##namearg##_probe; \ - tnf_probe_test_func_t tnf_v_probe_test = tnf_v_probe_p->test_func; \ - tnf_probe_setup_t tnf_v_set_p; \ - struct tnf_v_buf_0 *tnf_v_probe_buffer; \ - \ - if (tnf_v_probe_test) { \ - tnf_v_probe_buffer = (struct tnf_v_buf_0 *) \ - tnf_v_probe_test(0, tnf_v_probe_p, &tnf_v_set_p); \ - if (tnf_v_probe_buffer) { \ - (tnf_v_probe_p->probe_func)(&tnf_v_set_p); \ - } \ - } \ -} - -#endif /* NPROBE */ - -#ifdef NPROBE - -/* CSTYLED */ -#define TNF_PROBE_1(namearg, keysarg, detail, type_1, namearg_1, valarg_1) \ - ((void)0) - -#else - -/* CSTYLED */ -#define TNF_PROBE_1(namearg, keysarg, detail, type_1, namearg_1, valarg_1) \ -{ \ - struct tnf_v_buf_1 { \ - tnf_probe_event_t probe_event; \ - tnf_time_delta_t time_delta; \ - type_1##_t data_1; \ - }; \ - static tnf_tag_data_t ** tnf_v_##namearg##_info[] = { \ - &tnf_probe_event_tag_data, \ - &tnf_time_delta_tag_data, \ - &type_1##_tag_data, \ - 0 }; \ - static struct tnf_probe_control tnf_v_##namearg##_probe = { \ - &__tnf_probe_version_1, \ - (tnf_probe_control_t *) TNF_NEXT_INIT, \ - (tnf_probe_test_func_t) 0, \ - (tnf_probe_alloc_func_t) 0, \ - (tnf_probe_func_t) 0, \ - (tnf_probe_func_t) 0, \ - (tnf_uint32_t) 0, \ - /* attribute string */ \ - "name " TNF_STRINGVALUE(namearg) ";" \ - "slots " \ - ""#namearg_1" " \ - ";" \ - "keys " keysarg ";" \ - "file " __FILE__ ";" \ - "line " TNF_STRINGVALUE(__LINE__) ";" \ - detail, \ - tnf_v_##namearg##_info, \ - sizeof (struct tnf_v_buf_1) \ - }; \ - tnf_probe_control_t *tnf_v_probe_p = &tnf_v_##namearg##_probe; \ - tnf_probe_test_func_t tnf_v_probe_test = tnf_v_probe_p->test_func; \ - tnf_probe_setup_t tnf_v_set_p; \ - struct tnf_v_buf_1 *tnf_v_probe_buffer; \ - \ - if (tnf_v_probe_test) { \ - tnf_v_probe_buffer = (struct tnf_v_buf_1 *) \ - tnf_v_probe_test(0, tnf_v_probe_p, &tnf_v_set_p); \ - if (tnf_v_probe_buffer) { \ - tnf_v_probe_buffer->data_1 = type_1( \ - tnf_v_set_p.tpd_p, valarg_1, \ - (tnf_record_p) &(tnf_v_probe_buffer->data_1)); \ - (tnf_v_probe_p->probe_func)(&tnf_v_set_p); \ - } \ - } \ -} - -#endif /* NPROBE */ - -#ifdef NPROBE - -/* CSTYLED */ -#define TNF_PROBE_2(namearg, keysarg, detail, type_1, namearg_1, valarg_1, type_2, namearg_2, valarg_2) \ - ((void)0) - -#else - -/* CSTYLED */ -#define TNF_PROBE_2(namearg, keysarg, detail, type_1, namearg_1, valarg_1, type_2, namearg_2, valarg_2) \ -{ \ - struct tnf_v_buf_2 { \ - tnf_probe_event_t probe_event; \ - tnf_time_delta_t time_delta; \ - type_1##_t data_1; \ - type_2##_t data_2; \ - }; \ - static tnf_tag_data_t ** tnf_v_##namearg##_info[] = { \ - &tnf_probe_event_tag_data, \ - &tnf_time_delta_tag_data, \ - &type_1##_tag_data, \ - &type_2##_tag_data, \ - 0 }; \ - static struct tnf_probe_control tnf_v_##namearg##_probe = { \ - &__tnf_probe_version_1, \ - (tnf_probe_control_t *) TNF_NEXT_INIT, \ - (tnf_probe_test_func_t) 0, \ - (tnf_probe_alloc_func_t) 0, \ - (tnf_probe_func_t) 0, \ - (tnf_probe_func_t) 0, \ - (tnf_uint32_t) 0, \ - /* attribute string */ \ - "name " TNF_STRINGVALUE(namearg) ";" \ - "slots " \ - ""#namearg_1" " \ - ""#namearg_2" " \ - ";" \ - "keys " keysarg ";" \ - "file " __FILE__ ";" \ - "line " TNF_STRINGVALUE(__LINE__) ";" \ - detail, \ - tnf_v_##namearg##_info, \ - sizeof (struct tnf_v_buf_2) \ - }; \ - tnf_probe_control_t *tnf_v_probe_p = &tnf_v_##namearg##_probe; \ - tnf_probe_test_func_t tnf_v_probe_test = tnf_v_probe_p->test_func; \ - tnf_probe_setup_t tnf_v_set_p; \ - struct tnf_v_buf_2 *tnf_v_probe_buffer; \ - \ - if (tnf_v_probe_test) { \ - tnf_v_probe_buffer = (struct tnf_v_buf_2 *) \ - tnf_v_probe_test(0, tnf_v_probe_p, &tnf_v_set_p); \ - if (tnf_v_probe_buffer) { \ - tnf_v_probe_buffer->data_1 = type_1( \ - tnf_v_set_p.tpd_p, valarg_1, \ - (tnf_record_p) &(tnf_v_probe_buffer->data_1)); \ - tnf_v_probe_buffer->data_2 = type_2( \ - tnf_v_set_p.tpd_p, valarg_2, \ - (tnf_record_p) &(tnf_v_probe_buffer->data_2)); \ - (tnf_v_probe_p->probe_func)(&tnf_v_set_p); \ - } \ - } \ -} - -#endif /* NPROBE */ - -#ifdef NPROBE - -/* CSTYLED */ -#define TNF_PROBE_3(namearg, keysarg, detail, type_1, namearg_1, valarg_1, type_2, namearg_2, valarg_2, type_3, namearg_3, valarg_3) \ - ((void)0) - -#else - -/* CSTYLED */ -#define TNF_PROBE_3(namearg, keysarg, detail, type_1, namearg_1, valarg_1, type_2, namearg_2, valarg_2, type_3, namearg_3, valarg_3) \ -{ \ - struct tnf_v_buf_3 { \ - tnf_probe_event_t probe_event; \ - tnf_time_delta_t time_delta; \ - type_1##_t data_1; \ - type_2##_t data_2; \ - type_3##_t data_3; \ - }; \ - static tnf_tag_data_t ** tnf_v_##namearg##_info[] = { \ - &tnf_probe_event_tag_data, \ - &tnf_time_delta_tag_data, \ - &type_1##_tag_data, \ - &type_2##_tag_data, \ - &type_3##_tag_data, \ - 0 }; \ - static struct tnf_probe_control tnf_v_##namearg##_probe = { \ - &__tnf_probe_version_1, \ - (tnf_probe_control_t *) TNF_NEXT_INIT, \ - (tnf_probe_test_func_t) 0, \ - (tnf_probe_alloc_func_t) 0, \ - (tnf_probe_func_t) 0, \ - (tnf_probe_func_t) 0, \ - (tnf_uint32_t) 0, \ - /* attribute string */ \ - "name " TNF_STRINGVALUE(namearg) ";" \ - "slots " \ - ""#namearg_1" " \ - ""#namearg_2" " \ - ""#namearg_3" " \ - ";" \ - "keys " keysarg ";" \ - "file " __FILE__ ";" \ - "line " TNF_STRINGVALUE(__LINE__) ";" \ - detail, \ - tnf_v_##namearg##_info, \ - sizeof (struct tnf_v_buf_3) \ - }; \ - tnf_probe_control_t *tnf_v_probe_p = &tnf_v_##namearg##_probe; \ - tnf_probe_test_func_t tnf_v_probe_test = tnf_v_probe_p->test_func; \ - tnf_probe_setup_t tnf_v_set_p; \ - struct tnf_v_buf_3 *tnf_v_probe_buffer; \ - \ - if (tnf_v_probe_test) { \ - tnf_v_probe_buffer = (struct tnf_v_buf_3 *) \ - tnf_v_probe_test(0, tnf_v_probe_p, &tnf_v_set_p); \ - if (tnf_v_probe_buffer) { \ - tnf_v_probe_buffer->data_1 = type_1( \ - tnf_v_set_p.tpd_p, valarg_1, \ - (tnf_record_p) &(tnf_v_probe_buffer->data_1)); \ - tnf_v_probe_buffer->data_2 = type_2( \ - tnf_v_set_p.tpd_p, valarg_2, \ - (tnf_record_p) &(tnf_v_probe_buffer->data_2)); \ - tnf_v_probe_buffer->data_3 = type_3( \ - tnf_v_set_p.tpd_p, valarg_3, \ - (tnf_record_p) &(tnf_v_probe_buffer->data_3)); \ - (tnf_v_probe_p->probe_func)(&tnf_v_set_p); \ - } \ - } \ -} - -#endif /* NPROBE */ - -#ifdef NPROBE - -/* CSTYLED */ -#define TNF_PROBE_4(namearg, keysarg, detail, type_1, namearg_1, valarg_1, type_2, namearg_2, valarg_2, type_3, namearg_3, valarg_3, type_4, namearg_4, valarg_4) \ - ((void)0) - -#else - -/* CSTYLED */ -#define TNF_PROBE_4(namearg, keysarg, detail, type_1, namearg_1, valarg_1, type_2, namearg_2, valarg_2, type_3, namearg_3, valarg_3, type_4, namearg_4, valarg_4) \ -{ \ - struct tnf_v_buf_4 { \ - tnf_probe_event_t probe_event; \ - tnf_time_delta_t time_delta; \ - type_1##_t data_1; \ - type_2##_t data_2; \ - type_3##_t data_3; \ - type_4##_t data_4; \ - }; \ - static tnf_tag_data_t ** tnf_v_##namearg##_info[] = { \ - &tnf_probe_event_tag_data, \ - &tnf_time_delta_tag_data, \ - &type_1##_tag_data, \ - &type_2##_tag_data, \ - &type_3##_tag_data, \ - &type_4##_tag_data, \ - 0 }; \ - static struct tnf_probe_control tnf_v_##namearg##_probe = { \ - &__tnf_probe_version_1, \ - (tnf_probe_control_t *) TNF_NEXT_INIT, \ - (tnf_probe_test_func_t) 0, \ - (tnf_probe_alloc_func_t) 0, \ - (tnf_probe_func_t) 0, \ - (tnf_probe_func_t) 0, \ - (tnf_uint32_t) 0, \ - /* attribute string */ \ - "name " TNF_STRINGVALUE(namearg) ";" \ - "slots " \ - ""#namearg_1" " \ - ""#namearg_2" " \ - ""#namearg_3" " \ - ""#namearg_4" " \ - ";" \ - "keys " keysarg ";" \ - "file " __FILE__ ";" \ - "line " TNF_STRINGVALUE(__LINE__) ";" \ - detail, \ - tnf_v_##namearg##_info, \ - sizeof (struct tnf_v_buf_4) \ - }; \ - tnf_probe_control_t *tnf_v_probe_p = &tnf_v_##namearg##_probe; \ - tnf_probe_test_func_t tnf_v_probe_test = tnf_v_probe_p->test_func; \ - tnf_probe_setup_t tnf_v_set_p; \ - struct tnf_v_buf_4 *tnf_v_probe_buffer; \ - \ - if (tnf_v_probe_test) { \ - tnf_v_probe_buffer = (struct tnf_v_buf_4 *) \ - tnf_v_probe_test(0, tnf_v_probe_p, &tnf_v_set_p); \ - if (tnf_v_probe_buffer) { \ - tnf_v_probe_buffer->data_1 = type_1( \ - tnf_v_set_p.tpd_p, valarg_1, \ - (tnf_record_p) &(tnf_v_probe_buffer->data_1)); \ - tnf_v_probe_buffer->data_2 = type_2( \ - tnf_v_set_p.tpd_p, valarg_2, \ - (tnf_record_p) &(tnf_v_probe_buffer->data_2)); \ - tnf_v_probe_buffer->data_3 = type_3( \ - tnf_v_set_p.tpd_p, valarg_3, \ - (tnf_record_p) &(tnf_v_probe_buffer->data_3)); \ - tnf_v_probe_buffer->data_4 = type_4( \ - tnf_v_set_p.tpd_p, valarg_4, \ - (tnf_record_p) &(tnf_v_probe_buffer->data_4)); \ - (tnf_v_probe_p->probe_func)(&tnf_v_set_p); \ - } \ - } \ -} - -#endif /* NPROBE */ - -#ifdef NPROBE - -/* CSTYLED */ -#define TNF_PROBE_5(namearg, keysarg, detail, type_1, namearg_1, valarg_1, type_2, namearg_2, valarg_2, type_3, namearg_3, valarg_3, type_4, namearg_4, valarg_4, type_5, namearg_5, valarg_5) \ - ((void)0) - -#else - -/* CSTYLED */ -#define TNF_PROBE_5(namearg, keysarg, detail, type_1, namearg_1, valarg_1, type_2, namearg_2, valarg_2, type_3, namearg_3, valarg_3, type_4, namearg_4, valarg_4, type_5, namearg_5, valarg_5) \ -{ \ - struct tnf_v_buf_5 { \ - tnf_probe_event_t probe_event; \ - tnf_time_delta_t time_delta; \ - type_1##_t data_1; \ - type_2##_t data_2; \ - type_3##_t data_3; \ - type_4##_t data_4; \ - type_5##_t data_5; \ - }; \ - static tnf_tag_data_t ** tnf_v_##namearg##_info[] = { \ - &tnf_probe_event_tag_data, \ - &tnf_time_delta_tag_data, \ - &type_1##_tag_data, \ - &type_2##_tag_data, \ - &type_3##_tag_data, \ - &type_4##_tag_data, \ - &type_5##_tag_data, \ - 0 }; \ - static struct tnf_probe_control tnf_v_##namearg##_probe = { \ - &__tnf_probe_version_1, \ - (tnf_probe_control_t *) TNF_NEXT_INIT, \ - (tnf_probe_test_func_t) 0, \ - (tnf_probe_alloc_func_t) 0, \ - (tnf_probe_func_t) 0, \ - (tnf_probe_func_t) 0, \ - (tnf_uint32_t) 0, \ - /* attribute string */ \ - "name " TNF_STRINGVALUE(namearg) ";" \ - "slots " \ - ""#namearg_1" " \ - ""#namearg_2" " \ - ""#namearg_3" " \ - ""#namearg_4" " \ - ""#namearg_5" " \ - ";" \ - "keys " keysarg ";" \ - "file " __FILE__ ";" \ - "line " TNF_STRINGVALUE(__LINE__) ";" \ - detail, \ - tnf_v_##namearg##_info, \ - sizeof (struct tnf_v_buf_5) \ - }; \ - tnf_probe_control_t *tnf_v_probe_p = &tnf_v_##namearg##_probe; \ - tnf_probe_test_func_t tnf_v_probe_test = tnf_v_probe_p->test_func; \ - tnf_probe_setup_t tnf_v_set_p; \ - struct tnf_v_buf_5 *tnf_v_probe_buffer; \ - \ - if (tnf_v_probe_test) { \ - tnf_v_probe_buffer = (struct tnf_v_buf_5 *) \ - tnf_v_probe_test(0, tnf_v_probe_p, &tnf_v_set_p); \ - if (tnf_v_probe_buffer) { \ - tnf_v_probe_buffer->data_1 = type_1( \ - tnf_v_set_p.tpd_p, valarg_1, \ - (tnf_record_p) &(tnf_v_probe_buffer->data_1)); \ - tnf_v_probe_buffer->data_2 = type_2( \ - tnf_v_set_p.tpd_p, valarg_2, \ - (tnf_record_p) &(tnf_v_probe_buffer->data_2)); \ - tnf_v_probe_buffer->data_3 = type_3( \ - tnf_v_set_p.tpd_p, valarg_3, \ - (tnf_record_p) &(tnf_v_probe_buffer->data_3)); \ - tnf_v_probe_buffer->data_4 = type_4( \ - tnf_v_set_p.tpd_p, valarg_4, \ - (tnf_record_p) &(tnf_v_probe_buffer->data_4)); \ - tnf_v_probe_buffer->data_5 = type_5( \ - tnf_v_set_p.tpd_p, valarg_5, \ - (tnf_record_p) &(tnf_v_probe_buffer->data_5)); \ - (tnf_v_probe_p->probe_func)(&tnf_v_set_p); \ - } \ - } \ -} - -#endif /* NPROBE */ - -/* - * Debug Probe Macros (contain an additional "debug" attribute) - */ - -#if defined(TNF_DEBUG) - -/* CSTYLED */ -#define TNF_PROBE_0_DEBUG(namearg, keysarg, detail) TNF_PROBE_0(namearg, keysarg, "debug;" detail) - -#else - -/* CSTYLED */ -#define TNF_PROBE_0_DEBUG(namearg, keysarg, detail) \ - ((void)0) - -#endif /* defined(TNF_DEBUG) */ - -#if defined(TNF_DEBUG) - -/* CSTYLED */ -#define TNF_PROBE_1_DEBUG(namearg, keysarg, detail, type_1, namearg_1, valarg_1) TNF_PROBE_1(namearg, keysarg, "debug;" detail, type_1, namearg_1, valarg_1) - -#else - -/* CSTYLED */ -#define TNF_PROBE_1_DEBUG(namearg, keysarg, detail, type_1, namearg_1, valarg_1) \ - ((void)0) - -#endif /* defined(TNF_DEBUG) */ - -#if defined(TNF_DEBUG) - -/* CSTYLED */ -#define TNF_PROBE_2_DEBUG(namearg, keysarg, detail, type_1, namearg_1, valarg_1, type_2, namearg_2, valarg_2) TNF_PROBE_2(namearg, keysarg, "debug;" detail, type_1, namearg_1, valarg_1, type_2, namearg_2, valarg_2) - -#else - -/* CSTYLED */ -#define TNF_PROBE_2_DEBUG(namearg, keysarg, detail, type_1, namearg_1, valarg_1, type_2, namearg_2, valarg_2) \ - ((void)0) - -#endif /* defined(TNF_DEBUG) */ - -#if defined(TNF_DEBUG) - -/* CSTYLED */ -#define TNF_PROBE_3_DEBUG(namearg, keysarg, detail, type_1, namearg_1, valarg_1, type_2, namearg_2, valarg_2, type_3, namearg_3, valarg_3) TNF_PROBE_3(namearg, keysarg, "debug;" detail, type_1, namearg_1, valarg_1, type_2, namearg_2, valarg_2, type_3, namearg_3, valarg_3) - -#else - -/* CSTYLED */ -#define TNF_PROBE_3_DEBUG(namearg, keysarg, detail, type_1, namearg_1, valarg_1, type_2, namearg_2, valarg_2, type_3, namearg_3, valarg_3) \ - ((void)0) - -#endif /* defined(TNF_DEBUG) */ - -#if defined(TNF_DEBUG) - -/* CSTYLED */ -#define TNF_PROBE_4_DEBUG(namearg, keysarg, detail, type_1, namearg_1, valarg_1, type_2, namearg_2, valarg_2, type_3, namearg_3, valarg_3, type_4, namearg_4, valarg_4) TNF_PROBE_4(namearg, keysarg, "debug;" detail, type_1, namearg_1, valarg_1, type_2, namearg_2, valarg_2, type_3, namearg_3, valarg_3, type_4, namearg_4, valarg_4) - -#else - -/* CSTYLED */ -#define TNF_PROBE_4_DEBUG(namearg, keysarg, detail, type_1, namearg_1, valarg_1, type_2, namearg_2, valarg_2, type_3, namearg_3, valarg_3, type_4, namearg_4, valarg_4) \ - ((void)0) - -#endif /* defined(TNF_DEBUG) */ - -#if defined(TNF_DEBUG) - -/* CSTYLED */ -#define TNF_PROBE_5_DEBUG(namearg, keysarg, detail, type_1, namearg_1, valarg_1, type_2, namearg_2, valarg_2, type_3, namearg_3, valarg_3, type_4, namearg_4, valarg_4, type_5, namearg_5, valarg_5) TNF_PROBE_5(namearg, keysarg, "debug;" detail, type_1, namearg_1, valarg_1, type_2, namearg_2, valarg_2, type_3, namearg_3, valarg_3, type_4, namearg_4, valarg_4, type_5, namearg_5, valarg_5) - -#else - -/* CSTYLED */ -#define TNF_PROBE_5_DEBUG(namearg, keysarg, detail, type_1, namearg_1, valarg_1, type_2, namearg_2, valarg_2, type_3, namearg_3, valarg_3, type_4, namearg_4, valarg_4, type_5, namearg_5, valarg_5) \ - ((void)0) - -#endif /* defined(TNF_DEBUG) */ - -#ifdef __cplusplus -} -#endif - -#endif /* _SYS_TNF_PROBE_H */ diff --git a/usr/src/uts/common/sys/tnf_writer.h b/usr/src/uts/common/sys/tnf_writer.h deleted file mode 100644 index d1e64f8406..0000000000 --- a/usr/src/uts/common/sys/tnf_writer.h +++ /dev/null @@ -1,476 +0,0 @@ -/* - * 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 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 1994,2003 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -#ifndef _SYS_TNF_WRITER_H -#define _SYS_TNF_WRITER_H - -#pragma ident "%Z%%M% %I% %E% SMI" - -/* - * Public interface for writing predefined TNF types - */ -#include <sys/types.h> -#include <sys/tnf_com.h> - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Defines - */ - -#define TNF_OFFSETOF(s, m) ((size_t)(&(((s *)0)->m))) -#define TNF_ALIGN(type) TNF_OFFSETOF(struct { char _c; type _t; }, _t) - -/* - * Typedefs - */ - -typedef char *tnf_record_p; /* trace buffer memory ptr */ -typedef tnf_ref32_t tnf_reference_t; /* generic reference */ - -typedef struct _tnf_ops tnf_ops_t; /* opaque */ -typedef struct _tnf_tag_version tnf_tag_version_t; -typedef struct _tnf_tag_data tnf_tag_data_t; - -/* - * In-memory reader's classification of TNF types - */ - -typedef enum { - TNF_UNKNOWN = 0, - TNF_INT32, - TNF_UINT32, - TNF_INT64, - TNF_UINT64, - TNF_FLOAT32, - TNF_FLOAT64, - TNF_STRING, - TNF_ARRAY, - TNF_STRUCT, - TNF_OPAQUE, -#ifdef _LP64 - TNF_ULONG = TNF_UINT64, - TNF_LONG = TNF_INT64 -#else - TNF_ULONG = TNF_UINT32, - TNF_LONG = TNF_INT32 -#endif -} tnf_arg_kind_t; - -/* - * Structures - */ - -struct _tnf_tag_version { - size_t version_size; /* sizeof(tnf_tag_version_t) */ - size_t tag_data_size; /* sizeof(tnf_tag_data_t) */ -}; - -struct _tnf_tag_data { - tnf_tag_version_t *tag_version; /* TNF_TAG_VERSION */ - tnf_record_p (*tag_desc)(tnf_ops_t *, tnf_tag_data_t *); - tnf_record_p tag_index; /* trace buffer address */ - const char *tag_name; /* name */ - tnf_tag_data_t ****tag_props; /* properties */ - size_t tag_size; /* type_size, header_size */ - size_t tag_align; /* alignment */ - size_t tag_ref_size; /* reference size */ - tnf_arg_kind_t tag_kind; /* type of object */ - tnf_tag_data_t **tag_base; /* element_type, derived_base */ - tnf_tag_data_t ***tag_slots; /* slot_types, header_types */ - char **tag_slot_names; /* slot_names */ -}; - -/* - * TNF tag version - * A client can scan a binary's relocation table for data relocation - * entries corresponding to __tnf_tag_version_1. These identify - * tags. The actual version information is stored in an associated - * structure called __tnf_tag_version_1_info - */ - -extern tnf_tag_version_t __tnf_tag_version_1_info; - -extern tnf_tag_version_t __tnf_tag_version_1; -#pragma weak __tnf_tag_version_1 /* placeholder: never defined */ -#define TNF_TAG_VERSION &__tnf_tag_version_1 - -/* - * TNF primitive types - */ - -extern tnf_tag_data_t *tnf_char_tag_data; -#define tnf_char(ops, item, ref) (item) - -extern tnf_tag_data_t *tnf_int8_tag_data; -#define tnf_int8(ops, item, ref) (item) - -extern tnf_tag_data_t *tnf_uint8_tag_data; -#define tnf_uint8(ops, item, ref) (item) - -extern tnf_tag_data_t *tnf_int16_tag_data; -#define tnf_int16(ops, item, ref) (item) - -extern tnf_tag_data_t *tnf_uint16_tag_data; -#define tnf_uint16(ops, item, ref) (item) - -extern tnf_tag_data_t *tnf_int32_tag_data; -#define tnf_int32(ops, item, ref) (item) - -extern tnf_tag_data_t *tnf_uint32_tag_data; -#define tnf_uint32(ops, item, ref) (item) - -extern tnf_tag_data_t *tnf_int64_tag_data; -#define tnf_int64(ops, item, ref) (item) - -extern tnf_tag_data_t *tnf_uint64_tag_data; -#define tnf_uint64(ops, item, ref) (item) - -extern tnf_tag_data_t *tnf_float32_tag_data; -#define tnf_float32(ops, item, ref) (item) - -extern tnf_tag_data_t *tnf_float64_tag_data; -#define tnf_float64(ops, item, ref) (item) - -/* - * ``Portable'' primitive types - * These are defined as the well-defined TNF types they map into. - * XXX Machine-dependent - */ - -typedef tnf_uint8_t tnf_uchar_t; -#define tnf_uchar(ops, item, ref) tnf_uint8(ops, item, ref) -#define tnf_uchar_tag_data tnf_uint8_tag_data - -typedef tnf_int16_t tnf_short_t; -#define tnf_short(ops, item, ref) tnf_int16(ops, item, ref) -#define tnf_short_tag_data tnf_int16_tag_data - -typedef tnf_uint16_t tnf_ushort_t; -#define tnf_ushort(ops, item, ref) tnf_uint16(ops, item, ref) -#define tnf_ushort_tag_data tnf_uint16_tag_data - -typedef tnf_int32_t tnf_int_t; -#define tnf_int(ops, item, ref) tnf_int32(ops, item, ref) -#define tnf_int_tag_data tnf_int32_tag_data - -typedef tnf_uint32_t tnf_uint_t; -#define tnf_uint(ops, item, ref) tnf_uint32(ops, item, ref) -#define tnf_uint_tag_data tnf_uint32_tag_data - -#if defined(_LP64) - -typedef tnf_int64_t tnf_long_t; -#define tnf_long(ops, item, ref) tnf_int64(ops, item, ref) -#define tnf_long_tag_data tnf_int64_tag_data - -typedef tnf_uint64_t tnf_ulong_t; -#define tnf_ulong(ops, item, ref) tnf_uint64(ops, item, ref) -#define tnf_ulong_tag_data tnf_uint64_tag_data - -#else - -typedef tnf_int32_t tnf_long_t; -#define tnf_long(ops, item, ref) tnf_int32(ops, item, ref) -#define tnf_long_tag_data tnf_int32_tag_data - -typedef tnf_uint32_t tnf_ulong_t; -#define tnf_ulong(ops, item, ref) tnf_uint32(ops, item, ref) -#define tnf_ulong_tag_data tnf_uint32_tag_data - -#endif /* defined(_LP64) */ - -typedef tnf_int64_t tnf_longlong_t; -#define tnf_longlong(ops, item, ref) tnf_int64(ops, item, ref) -#define tnf_longlong_tag_data tnf_int64_tag_data - -typedef tnf_uint64_t tnf_ulonglong_t; -#define tnf_ulonglong(ops, item, ref) tnf_uint64(ops, item, ref) -#define tnf_ulonglong_tag_data tnf_uint64_tag_data - -typedef tnf_float32_t tnf_float_t; -#define tnf_float(ops, item, ref) tnf_float32(ops, item, ref) -#define tnf_float_tag_data tnf_float32_tag_data - -typedef tnf_float64_t tnf_double_t; -#define tnf_double(ops, item, ref) tnf_float64(ops, item, ref) -#define tnf_double_tag_data tnf_float64_tag_data - -/* - * Derived and aggregate TNF types - */ - -/* Not explicitly represented in type system */ -#define tnf_ref32(ops, item, ref) \ - tnf_ref32_1(ops, item, ref) - -extern tnf_tag_data_t *tnf_tag_tag_data; -typedef tnf_ref32_t tnf_tag_t; -#define tnf_tag(ops, item, ref) \ - (tnf_ref32(ops, item, ref) | TNF_REF32_T_TAG) - -extern tnf_tag_data_t *tnf_string_tag_data; -typedef tnf_reference_t tnf_string_t; -#define tnf_string(ops, item, ref) \ - tnf_string_1(ops, item, ref, tnf_string_tag_data) - -extern tnf_tag_data_t *tnf_name_tag_data; -typedef tnf_string_t tnf_name_t; -#define tnf_name(ops, item, ref) \ - tnf_string_1(ops, item, ref, tnf_name_tag_data) - -extern tnf_tag_data_t *tnf_size_tag_data; -typedef tnf_ulong_t tnf_size_t; -#define tnf_size(ops, item, ref) \ - tnf_ulong(ops, item, ref) - -extern tnf_tag_data_t *tnf_opaque_tag_data; - -#if defined(_LP64) - -typedef tnf_uint64_t tnf_opaque_t; -#define tnf_opaque(ops, item, ref) \ - ((tnf_uint64_t)(item)) - -#else - -typedef tnf_uint32_t tnf_opaque_t; -#define tnf_opaque(ops, item, ref) \ - ((tnf_uint32_t)(item)) - -#endif /* defined(_LP64) */ - -/* - * TNF types for tracing - */ - -extern tnf_tag_data_t *tnf_time_base_tag_data; -typedef tnf_int64_t tnf_time_base_t; -#define tnf_time_base(ops, item, ref) \ - tnf_int64(ops, item, ref) - -extern tnf_tag_data_t *tnf_time_delta_tag_data; -typedef tnf_uint32_t tnf_time_delta_t; -#define tnf_time_delta(ops, item, ref) \ - tnf_uint32(ops, item, ref) - -extern tnf_tag_data_t *tnf_probe_event_tag_data; -typedef tnf_ref32_t tnf_probe_event_t; -#define tnf_probe_event(ops, item, ref) \ - ((tnf_ref32_t)(item) | TNF_REF32_T_PAIR) - -/* process ID */ -extern tnf_tag_data_t *tnf_pid_tag_data; -typedef tnf_int32_t tnf_pid_t; -#define tnf_pid(ops, item, ref) \ - tnf_int32(ops, item, ref) - -/* LWP ID */ -extern tnf_tag_data_t *tnf_lwpid_tag_data; -typedef tnf_uint32_t tnf_lwpid_t; -#define tnf_lwpid(ops, item, ref) \ - tnf_uint32(ops, item, ref) - -#ifdef _KERNEL - -/* kernel thread ID */ -extern tnf_tag_data_t *tnf_kthread_id_tag_data; -typedef tnf_opaque_t tnf_kthread_id_t; -#define tnf_kthread_id(ops, item, ref) \ - tnf_opaque(ops, item, ref) - -/* processor ID */ -extern tnf_tag_data_t *tnf_cpuid_tag_data; -typedef tnf_int32_t tnf_cpuid_t; -#define tnf_cpuid(ops, item, ref) \ - tnf_int32(ops, item, ref) - -/* device ID */ -extern tnf_tag_data_t *tnf_device_tag_data; -typedef tnf_ulong_t tnf_device_t; -#define tnf_device(ops, item, ref) \ - tnf_ulong(ops, item, ref) - -/* kernel symbol */ -extern tnf_tag_data_t *tnf_symbol_tag_data; -typedef tnf_opaque_t tnf_symbol_t; -#define tnf_symbol(ops, item, ref) \ - tnf_opaque(ops, item, ref) - -/* array of symbols */ -extern tnf_tag_data_t *tnf_symbols_tag_data; -typedef tnf_ref32_t tnf_symbols_t; - -#if defined(__sparc) -#define tnf_symbols(ops, item, ref) \ - tnf_opaque32_array_1(ops, item, ref, tnf_symbols_tag_data) -#else /* defined(__sparc) */ -#define tnf_symbols(ops, item, ref) \ - tnf_opaque_array_1(ops, item, ref, tnf_symbols_tag_data) -#endif /* defined(__sparc) */ - -/* system call number */ -extern tnf_tag_data_t *tnf_sysnum_tag_data; -typedef tnf_int16_t tnf_sysnum_t; -#define tnf_sysnum(ops, item, ref) \ - tnf_int16(ops, item, ref) - -/* thread microstate XXX enum */ -/* XXX should have a new type tnf_enum of appropriate size to map C enum's */ -/* XXX cast below is to avoid lint warnings */ -extern tnf_tag_data_t *tnf_microstate_tag_data; -typedef tnf_int32_t tnf_microstate_t; -#define tnf_microstate(ops, item, ref) \ - tnf_int32(ops, (tnf_int32_t)(item), ref) - -/* file offset */ -extern tnf_tag_data_t *tnf_offset_tag_data; -typedef tnf_int64_t tnf_offset_t; -#define tnf_offset(ops, item, ref) \ - tnf_int64(ops, item, ref) - -/* address fault type XXX enum */ -/* XXX should have a new type tnf_enum of appropriate size to map C enum's */ -/* XXX cast below is to avoid lint warnings */ -extern tnf_tag_data_t *tnf_fault_type_tag_data; -typedef tnf_int32_t tnf_fault_type_t; -#define tnf_fault_type(ops, item, ref) \ - tnf_int32(ops, (tnf_int32_t)(item), ref) - -/* segment access type XXX enum */ -/* XXX should have a new type tnf_enum of appropriate size to map C enum's */ -/* XXX cast below is to avoid lint warnings */ -extern tnf_tag_data_t *tnf_seg_access_tag_data; -typedef tnf_int32_t tnf_seg_access_t; -#define tnf_seg_access(ops, item, ref) \ - tnf_int32(ops, (tnf_int32_t)(item), ref) - -/* buffered I/O flags */ -extern tnf_tag_data_t *tnf_bioflags_tag_data; -typedef tnf_int32_t tnf_bioflags_t; -#define tnf_bioflags(ops, item, ref) \ - tnf_int32(ops, item, ref) - -/* disk block addresses */ -extern tnf_tag_data_t *tnf_diskaddr_tag_data; -typedef tnf_int64_t tnf_diskaddr_t; -#define tnf_diskaddr(ops, item, ref) \ - tnf_int64(ops, item, ref) - -#endif /* _KERNEL */ - -/* - * Type extension interface - */ - -extern tnf_tag_data_t ***tnf_user_struct_properties; - -/* - * Data encoders - */ - -extern tnf_ref32_t tnf_ref32_1(tnf_ops_t *, - tnf_record_p, - tnf_record_p); - -extern tnf_reference_t tnf_string_1(tnf_ops_t *, - const char *, - tnf_record_p, - tnf_tag_data_t *); - -#ifdef _KERNEL - -extern tnf_reference_t tnf_opaque_array_1(tnf_ops_t *, - tnf_opaque_t *, - tnf_record_p, - tnf_tag_data_t *); - -#ifdef __sparc -extern tnf_reference_t tnf_opaque32_array_1(tnf_ops_t *, - tnf_uint32_t *, - tnf_record_p, - tnf_tag_data_t *); -#endif /* __sparc */ - -#endif /* _KERNEL */ - -/* - * Tag descriptors - */ - -extern tnf_record_p tnf_struct_tag_1(tnf_ops_t *, tnf_tag_data_t *); - -/* - * Buffer memory allocator - */ - -extern void *tnf_allocate(tnf_ops_t *, size_t); - -/* - * Weak symbol definitions to allow unprobed operation - */ - -#if !defined(_KERNEL) && !defined(_TNF_LIBRARY) - -#pragma weak __tnf_tag_version_1_info - -#pragma weak tnf_char_tag_data -#pragma weak tnf_int8_tag_data -#pragma weak tnf_uint8_tag_data -#pragma weak tnf_int16_tag_data -#pragma weak tnf_uint16_tag_data -#pragma weak tnf_int32_tag_data -#pragma weak tnf_uint32_tag_data -#pragma weak tnf_int64_tag_data -#pragma weak tnf_uint64_tag_data -#pragma weak tnf_float32_tag_data -#pragma weak tnf_float64_tag_data - -#pragma weak tnf_tag_tag_data -#pragma weak tnf_string_tag_data -#pragma weak tnf_name_tag_data -#pragma weak tnf_opaque_tag_data -#pragma weak tnf_size_tag_data - -#pragma weak tnf_probe_event_tag_data -#pragma weak tnf_time_delta_tag_data - -#pragma weak tnf_user_struct_properties - -#pragma weak tnf_ref32_1 -#pragma weak tnf_string_1 -#pragma weak tnf_struct_tag_1 -#pragma weak tnf_allocate - -#endif /* !defined(_KERNEL) || !defined(_TNF_LIBRARY) */ - -#ifdef __cplusplus -} -#endif - -#endif /* _SYS_TNF_WRITER_H */ diff --git a/usr/src/uts/common/syscall/lwp_sobj.c b/usr/src/uts/common/syscall/lwp_sobj.c index a87aa05cdd..25e0c49a60 100644 --- a/usr/src/uts/common/syscall/lwp_sobj.c +++ b/usr/src/uts/common/syscall/lwp_sobj.c @@ -54,7 +54,6 @@ #include <sys/schedctl.h> #include <sys/sleepq.h> #include <sys/policy.h> -#include <sys/tnf_probe.h> #include <sys/lwpchan_impl.h> #include <sys/turnstile.h> #include <sys/atomic.h> diff --git a/usr/src/uts/common/tnf/mkprobehdr.sh b/usr/src/uts/common/tnf/mkprobehdr.sh deleted file mode 100644 index d5499ea28e..0000000000 --- a/usr/src/uts/common/tnf/mkprobehdr.sh +++ /dev/null @@ -1,367 +0,0 @@ -#!/usr/bin/sh -# -# 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 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 (c) 1994-2000 by Sun Microsystems, Inc. -# All rights reserved. -# -#ident "%Z%%M% %I% %E% SMI" - -cat <<ENDSTR -/* - * Copyright (c) 1994, by Sun Microsytems, Inc. - */ - -#ifndef _SYS_TNF_PROBE_H -#define _SYS_TNF_PROBE_H - -#pragma ident "%Z%tnf_probe.h %I% %E% SMI" - -#include <sys/tnf_writer.h> - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * These macros are used to convert the __LINE__ directive to a - * string in the probe macros below. - */ - -#define TNF_STRINGIFY(x) #x -#define TNF_STRINGVALUE(x) TNF_STRINGIFY(x) - -/* - * Alignment of tnf_ref32_t - */ - -struct _tnf_ref32_align { - char c; - tnf_ref32_t t; -}; -#define TNF_REF32_ALIGN TNF_OFFSETOF(struct _tnf_ref32_align, t) - -/* - * Probe versioning - */ - -struct tnf_probe_version { - size_t version_size; /* sizeof(struct tnf_probe_version) */ - size_t probe_control_size; /* sizeof(tnf_probe_control_t) */ -}; - -extern struct tnf_probe_version __tnf_probe_version_1; -#pragma weak __tnf_probe_version_1 - -/* - * Typedefs - */ - -typedef struct tnf_probe_control tnf_probe_control_t; -typedef struct tnf_probe_setup tnf_probe_setup_t; - -/* returns pointer to buffer */ -typedef void * (*tnf_probe_test_func_t)(void *, - tnf_probe_control_t *, - tnf_probe_setup_t *); - -/* returns buffer pointer */ -typedef void * (*tnf_probe_alloc_func_t)(tnf_ops_t *, /* tpd */ - tnf_probe_control_t *, - tnf_probe_setup_t *); - -typedef void (*tnf_probe_func_t)(tnf_probe_setup_t *); - -/* - * Probe argument block - */ - -struct tnf_probe_setup { - tnf_ops_t *tpd_p; - void *buffer_p; - tnf_probe_control_t *probe_p; -}; - -/* - * Probe control block - */ - -struct tnf_probe_control { - const struct tnf_probe_version *version; - tnf_probe_control_t *next; - tnf_probe_test_func_t test_func; - tnf_probe_alloc_func_t alloc_func; - tnf_probe_func_t probe_func; - tnf_probe_func_t commit_func; - tnf_uint32_t index; - const char *attrs; - tnf_tag_data_t ***slot_types; - unsigned long tnf_event_size; -}; - -#ifdef _KERNEL - -#define TNF_NEXT_INIT 0 - -#else - -#define TNF_NEXT_INIT -1 - -#endif /* _KERNEL */ - -/* - * TNF Type extension - */ - -#ifdef NPROBE - -#define TNF_DECLARE_RECORD(ctype, record) \\ - typedef tnf_reference_t record##_t - -#else - -#define TNF_DECLARE_RECORD(ctype, record) \\ - typedef tnf_reference_t record##_t; \\ - extern tnf_tag_data_t *record##_tag_data; \\ - extern record##_t record(tnf_ops_t *, ctype *, tnf_reference_t) - -#endif /* NPROBE */ - -ENDSTR - -# -# The following code generates the five type extension macros -# -for i in 1 2 3 4 5; do - echo "#ifdef NPROBE\n" - echo "/* CSTYLED */" - echo "#define TNF_DEFINE_RECORD_$i(ctype, ctype_record\c" - j=1; while [ $j -le $i ]; do - echo ", t$j, n$j\c" - j=`expr $j + 1` - done - echo ")\n" - echo "#else\n" - echo "/* CSTYLED */" - echo "#define TNF_DEFINE_RECORD_$i(ctype, ctype_record\c" - j=1; while [ $j -le $i ]; do - echo ", t$j, n$j\c" - j=`expr $j + 1` - done - echo ") \\" - echo "typedef struct { \\" - echo " tnf_tag_t tag; \\" - j=1; while [ $j -le $i ]; do - echo " t$j##_t data_$j; \\" - j=`expr $j + 1` - done - echo "} ctype_record##_prototype_t; \\" - echo "static tnf_tag_data_t **ctype_record##_type_slots[] = { \\" - echo " &tnf_tag_tag_data, \\" - j=1; while [ $j -le $i ]; do - echo " &t$j##_tag_data, \\" - j=`expr $j + 1` - done - echo " 0 }; \\"; - echo "static char *ctype_record##_slot_names[] = { \\"; - echo " \"tnf_tag\", \\" - j=1; while [ $j -le $i ]; do - echo " \"\"#n$j, \\" - j=`expr $j + 1` - done - echo " 0 }; \\" - echo "static tnf_tag_data_t ctype_record##_tag_data_rec = { \\" - echo " TNF_TAG_VERSION, &tnf_struct_tag_1, \\" - echo " 0, #ctype_record, &tnf_user_struct_properties, \\" - echo " sizeof (ctype_record##_prototype_t), \\" - echo " TNF_REF32_ALIGN, \\" - echo " sizeof (ctype_record##_t), TNF_STRUCT, 0, \\" - echo " ctype_record##_type_slots, ctype_record##_slot_names \\" - echo "}; \\" - echo "tnf_tag_data_t *ctype_record##_tag_data = \\" - echo " &ctype_record##_tag_data_rec; \\" - echo "ctype_record##_t \\" - echo "ctype_record(tnf_ops_t *ops, ctype * the_ctype, \\" - echo " tnf_reference_t reference) \\" - echo "{ \\" - echo " tnf_tag_data_t *metatag_data; \\" - echo " tnf_record_p metatag_index; \\" - echo " ctype_record##_prototype_t *buffer; \\" - echo " \\" - echo " if (the_ctype == NULL) \\" - echo " return (0); \\" - echo " buffer = (ctype_record##_prototype_t *) tnf_allocate(ops, \\" - echo " sizeof (ctype_record##_prototype_t)); \\" - echo " if (buffer == NULL) \\" - echo " return (0); \\" - echo " \\" - echo " metatag_data = ctype_record##_tag_data; \\" - echo " metatag_index = metatag_data->tag_index ? \\" - echo " metatag_data->tag_index: \\" - echo " metatag_data->tag_desc(ops, metatag_data); \\" - echo " buffer->tag = tnf_tag(ops, metatag_index, \\" - echo " (tnf_reference_t) &buffer->tag); \\" - j=1; while [ $j -le $i ]; do - echo " buffer->data_$j = t$j(ops, the_ctype->n$j, \\" - echo " (tnf_reference_t) &(buffer->data_$j)); \\" - j=`expr $j + 1` - done - echo " return (tnf_ref32(ops, (tnf_record_p) buffer, reference)); \\" - echo "}\n" - echo "#endif /* NPROBE */" - echo "" -done - -echo "/*" -echo " * Probe Macros" -echo " */" -echo "" - -# -# The following code generates the six probe macros ... -# -for i in 0 1 2 3 4 5; do - echo "#ifdef NPROBE\n" - echo "/* CSTYLED */" - echo "#define TNF_PROBE_$i(namearg, keysarg, detail\c" - j=1; while [ $j -le $i ]; do - echo ", type_$j, namearg_$j, valarg_$j\c" - j=`expr $j + 1` - done - echo ") \\" - echo "\t\t((void)0)\n" - echo "#else\n" - echo "/* CSTYLED */" - echo "#define TNF_PROBE_$i(namearg, keysarg, detail\c" - j=1; while [ $j -le $i ]; do - echo ", type_$j, namearg_$j, valarg_$j\c"; - j=`expr $j + 1` - done - echo ") \\" - echo "{ \\" - echo " struct tnf_v_buf_$i { \\" - echo " tnf_probe_event_t probe_event; \\" - echo " tnf_time_delta_t time_delta; \\" - j=1; while [ $j -le $i ]; do - echo " type_$j##_t data_$j; \\" - j=`expr $j + 1` - done - echo " }; \\" - echo " static tnf_tag_data_t ** tnf_v_##namearg##_info[] = { \\" - echo " &tnf_probe_event_tag_data, \\" - echo " &tnf_time_delta_tag_data, \\" - j=1; while [ $j -le $i ]; do - echo " &type_$j##_tag_data, \\" - j=`expr $j + 1` - done - echo " 0 }; \\" - echo " static struct tnf_probe_control tnf_v_##namearg##_probe = { \\" - echo " &__tnf_probe_version_1, \\" - echo " (tnf_probe_control_t *) TNF_NEXT_INIT, \\" - echo " (tnf_probe_test_func_t) 0, \\" - echo " (tnf_probe_alloc_func_t) 0, \\" - echo " (tnf_probe_func_t) 0, \\" - echo " (tnf_probe_func_t) 0, \\" - echo " (tnf_uint32_t) 0, \\" - echo " /* attribute string */ \\" - echo " \"name \" TNF_STRINGVALUE(namearg) \";\" \\" -# echo " \"slots \"\c" -# j=1; while [ $j -le $i ]; do -# echo " #namearg_$j \" \"\c" -# j=`expr $j + 1` - echo " \"slots \" \\" - j=1; while [ $j -le $i ]; do - echo " \"\"#namearg_$j\" \" \\" - j=`expr $j + 1` - done - echo " \";\" \\" - echo " \"keys \" keysarg \";\" \\" - echo " \"file \" __FILE__ \";\" \\" - echo " \"line \" TNF_STRINGVALUE(__LINE__) \";\" \\" - echo " detail, \\" - echo " tnf_v_##namearg##_info, \\" - echo " sizeof (struct tnf_v_buf_$i) \\" - echo " }; \\" - echo " tnf_probe_control_t *tnf_v_probe_p = &tnf_v_##namearg##_probe; \\" - echo " tnf_probe_test_func_t tnf_v_probe_test = tnf_v_probe_p->test_func; \\" - echo " tnf_probe_setup_t tnf_v_set_p; \\" - echo " struct tnf_v_buf_$i *tnf_v_probe_buffer; \\" - echo " \\" - echo " if (tnf_v_probe_test) { \\" - echo " tnf_v_probe_buffer = (struct tnf_v_buf_$i *) \\" - echo " tnf_v_probe_test(0, tnf_v_probe_p, &tnf_v_set_p); \\" - echo " if (tnf_v_probe_buffer) { \\" - j=1; while [ $j -le $i ]; do - echo " tnf_v_probe_buffer->data_$j = type_$j( \\" - echo " tnf_v_set_p.tpd_p, valarg_$j, \\" - echo " (tnf_reference_t) &(tnf_v_probe_buffer->data_$j)); \\" - j=`expr $j + 1` - done - echo " (tnf_v_probe_p->probe_func)(&tnf_v_set_p); \\" - echo " } \\" - echo " } \\" - echo "}\n" - echo "#endif /* NPROBE */" - echo "" - done - -echo "/*" -echo " * Debug Probe Macros (contain an additional \"debug\" attribute)" -echo " */" -echo "" - -# -# The following code generates the six debug probe macros ... -# -for i in 0 1 2 3 4 5; do - echo "#if defined(TNF_DEBUG)\n" - echo "/* CSTYLED */" - echo "#define TNF_PROBE_${i}_DEBUG(namearg, keysarg, detail\c" - j=1; while [ $j -le $i ]; do - echo ", type_$j, namearg_$j, valarg_$j\c"; - j=`expr $j + 1` - done - echo ")\t\c" - echo "TNF_PROBE_$i(namearg, keysarg, \"debug;\" detail\c" - j=1; while [ $j -le $i ]; do - echo ", type_$j, namearg_$j, valarg_$j\c" - j=`expr $j + 1` - done - echo ")\n" - echo "#else\n" - echo "/* CSTYLED */" - echo "#define TNF_PROBE_${i}_DEBUG(namearg, keysarg, detail\c" - j=1; while [ $j -le $i ]; do - echo ", type_$j, namearg_$j, valarg_$j\c" - j=`expr $j + 1` - done - echo ") \\" - echo "\t\t((void)0)\n" - echo "#endif /* defined(TNF_DEBUG) */" - echo "" - done - - echo "#ifdef __cplusplus" - echo "}" - echo "#endif" - echo "" - echo "#endif /* _SYS_TNF_PROBE_H */" diff --git a/usr/src/uts/common/tnf/tnf.c b/usr/src/uts/common/tnf/tnf.c deleted file mode 100644 index d5aa17236f..0000000000 --- a/usr/src/uts/common/tnf/tnf.c +++ /dev/null @@ -1,949 +0,0 @@ -/* - * 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 2008 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - - -/* - * tnf driver - provides probe control and kernel trace buffer access - * to the user programs prex and tnfxtract. - */ - -#include <sys/types.h> -#include <sys/param.h> -#include <sys/sysmacros.h> -#include <sys/file.h> -#include <sys/cmn_err.h> -#include <sys/fcntl.h> -#include <sys/uio.h> -#include <sys/kmem.h> -#include <sys/cred.h> -#include <sys/mman.h> -#include <sys/errno.h> -#include <sys/stat.h> -#include <sys/conf.h> -#include <sys/ddi.h> -#include <sys/sunddi.h> -#include <sys/modctl.h> -#include <sys/tnf.h> -#include <sys/debug.h> -#include <sys/devops.h> -#include <vm/as.h> -#include <vm/seg_kp.h> -#include <sys/tnf_probe.h> -#include <sys/kobj.h> - -#include "tnf_buf.h" -#include "tnf_types.h" -#include "tnf_trace.h" - -#ifndef NPROBE - -/* - * Each probe is independently put in the kernel, prex uses - * __tnf_probe_list_head and __tnf_tag_list_head as pointers to linked list - * for probes and static tnf_tag_data_t, respectively. - * tnf used the elf relocation record to build a separate linked list for - * the probes and tnf_tag_data_t. We will describe how the linked list for - * __tnf_tag_list_head is made, the probe list is very similar. - * During the dynamic relocation(in uts/sparc/krtld/kobj_reloc.c), - * the &__tnf_tag_version_1(the first member in tnf_tag_data_t data struct) - * (and since it is a global variable which was never defined) will be filled - * with 0. The following code in kobj_reloc.c will get the address of current - * __tnf_tag_list_head and put it in value_p: - * #define TAG_MARKER_SYMBOL "__tnf_tag_version_1" - * if (strcmp(symname, TAG_MARKER_SYMBOL) == 0) { - * *addend_p = 0; - * *value_p = (Addr) __tnf_tag_list_head; (value_p points to list head) - * __tnf_tag_list_head = (void *)*offset_p;(list head is the next record) - * return (0); - * } - * - * the function do_reloc(in the kobj_reloc.c) will put vlaue_p into - * &__tnf_tag_version_1 - * Now the &__tnf_tag_version_1 points to the last list head - * and __tnf_tag_list_head points to the new list head. - * This is equivalent to attatch a node at the beginning of the list. - * - */ -extern tnf_probe_control_t *__tnf_probe_list_head; -extern tnf_tag_data_t *__tnf_tag_list_head; -extern int tnf_changed_probe_list; - -static int tnf_attach(dev_info_t *, ddi_attach_cmd_t); -static int tnf_detach(dev_info_t *, ddi_detach_cmd_t); -static int tnf_info(dev_info_t *, ddi_info_cmd_t, void *, void **); -static int tnf_open(dev_t *, int, int, struct cred *); -static int tnf_close(dev_t, int, int, struct cred *); -#ifdef UNUSED -static int tnf_mmap(dev_t, off_t, int); -#endif -static int tnf_ioctl(dev_t, int, intptr_t, int, struct cred *, int *); -#ifdef UNUSED -static int tnf_prop_op(dev_t, dev_info_t *, ddi_prop_op_t, - int, char *, caddr_t, int *); -#endif -static dev_info_t *tnf_devi; - -static struct { - int tnf_probe_count; - boolean_t tnf_pidfilter_mode; - boolean_t ctldev_is_open; - int mapdev_open_count; - kmutex_t tnf_mtx; -} tnf_drv_state = { 0, B_FALSE, B_FALSE, 0 }; - -static int tnf_getmaxprobe(caddr_t, int); -static int tnf_getprobevals(caddr_t, int); -static int tnf_getprobestring(caddr_t, int); -static int tnf_setprobevals(caddr_t, int); -static int tnf_getstate(caddr_t, int); -static int tnf_allocbuf(intptr_t); -static int tnf_deallocbuf(void); -static int tnf_settracing(int); -static int tnf_pidfilterset(int); -static int tnf_pidfilterget(caddr_t, int); -static int tnf_getpidstate(caddr_t, int); -static int tnf_setpidstate(int, pid_t, int); -static int tnf_getheader(caddr_t, int); -static int tnf_getblock(caddr_t, int); -static int tnf_getfwzone(caddr_t, int); - -static void *tnf_test_1(void *, tnf_probe_control_t *, tnf_probe_setup_t *); -static void *tnf_test_2(void *, tnf_probe_control_t *, tnf_probe_setup_t *); - -#define TNFCTL_MINOR 0 -#define TNFMAP_MINOR 1 - -struct cb_ops tnf_cb_ops = { - tnf_open, /* open */ - tnf_close, /* close */ - nodev, /* strategy */ - nodev, /* print */ - nodev, /* dump */ - nodev, /* read */ - nodev, /* write */ - tnf_ioctl, /* ioctl */ - nodev, /* devmap */ - nodev, /* mmap */ - nodev, /* segmap */ - nochpoll, /* poll */ - ddi_prop_op, /* prop_op */ - 0, /* streamtab */ - D_NEW | D_MP /* Driver compatibility flag */ -}; - -struct dev_ops tnf_ops = { - DEVO_REV, /* devo_rev, */ - 0, /* refcnt */ - tnf_info, /* info */ - nulldev, /* identify */ - nulldev, /* probe */ - tnf_attach, /* attach */ - tnf_detach, /* detach */ - nodev, /* reset */ - &tnf_cb_ops, /* driver operations */ - (struct bus_ops *)0, /* no bus operations */ - NULL, /* power */ - ddi_quiesce_not_needed, /* quiesce */ -}; - -extern struct mod_ops mod_driverops; - -static struct modldrv modldrv = { - &mod_driverops, - "kernel probes driver", - &tnf_ops, -}; - -static struct modlinkage modlinkage = { - MODREV_1, - (void *)&modldrv, - NULL -}; - -int -_init() -{ - register int error; - - mutex_init(&tnf_drv_state.tnf_mtx, NULL, MUTEX_DEFAULT, NULL); - - if ((error = mod_install(&modlinkage)) != 0) { - mutex_destroy(&tnf_drv_state.tnf_mtx); - return (error); - } - - /* Give t0 a tpdp */ - if (!t0.t_tnf_tpdp) - t0.t_tnf_tpdp = kmem_zalloc(sizeof (tnf_ops_t), KM_SLEEP); - /* Initialize tag system */ - tnf_tag_core_init(); - tnf_tag_trace_init(); - tnf_changed_probe_list = 1; - return (0); -} - -int -_fini() -{ - /* Not safe to unload this module, currently */ - return (EBUSY); -} - -int -_info(struct modinfo *modinfop) -{ - return (mod_info(&modlinkage, modinfop)); -} - -/* ARGSUSED */ -static int -tnf_info(dev_info_t *dip, ddi_info_cmd_t infocmd, void *arg, void **result) -{ - register int error; - - switch (infocmd) { - case DDI_INFO_DEVT2DEVINFO: - *result = (void *)tnf_devi; - error = DDI_SUCCESS; - break; - case DDI_INFO_DEVT2INSTANCE: - *result = (void *)0; - error = DDI_SUCCESS; - break; - default: - error = DDI_FAILURE; - } - return (error); -} - -static int -tnf_attach(dev_info_t *devi, ddi_attach_cmd_t cmd) -{ - if (cmd != DDI_ATTACH) - return (DDI_FAILURE); - if ((ddi_create_minor_node(devi, "tnfctl", S_IFCHR, TNFCTL_MINOR, - DDI_PSEUDO, 0) == DDI_FAILURE) || - (ddi_create_minor_node(devi, "tnfmap", S_IFCHR, TNFMAP_MINOR, - DDI_PSEUDO, 0) == DDI_FAILURE)) { - ddi_remove_minor_node(devi, NULL); - return (DDI_FAILURE); - } - tnf_devi = devi; - return (DDI_SUCCESS); -} - -static int -tnf_detach(dev_info_t *devi, ddi_detach_cmd_t cmd) -{ - if (cmd != DDI_DETACH) - return (DDI_FAILURE); - ddi_remove_minor_node(devi, NULL); - return (DDI_SUCCESS); -} - -/* - * property operations. Return the size of the kernel trace buffer. We - * only handle size property requests. Others are passed on. - */ -#ifdef UNUSED -static int -tnf_prop_op(dev_t dev, dev_info_t *di, ddi_prop_op_t prop, - int m, char *name, caddr_t valuep, int *lengthp) -{ - int length, *retbuf, size; - - if (strcmp(name, "size") == 0) { - - /* Don't need tnf_mtx, since mapdev_open_count > 0 */ - size = tnf_trace_file_size; - - length = *lengthp; /* get caller's length */ - *lengthp = sizeof (int); /* set caller's length */ - - switch (prop) { - - case PROP_LEN: - return (DDI_PROP_SUCCESS); - - case PROP_LEN_AND_VAL_ALLOC: - retbuf = kmem_alloc(sizeof (int), - (m & DDI_PROP_CANSLEEP) ? KM_SLEEP : KM_NOSLEEP); - if (retbuf == NULL) - return (DDI_PROP_NO_MEMORY); - *(int **)valuep = retbuf; /* set caller's buf */ - *retbuf = size; - return (DDI_PROP_SUCCESS); - - case PROP_LEN_AND_VAL_BUF: - if (length < sizeof (int)) - return (DDI_PROP_BUF_TOO_SMALL); - *(int *)valuep = size; - return (DDI_PROP_SUCCESS); - } - } - return (ddi_prop_op(dev, dip, prop, m, name, valuep, lengthp)); -} -#endif - -/* ARGSUSED */ -static int -tnf_open(dev_t *devp, int flag, int otyp, struct cred *cred) -{ - int err = 0; - mutex_enter(&tnf_drv_state.tnf_mtx); - if (getminor(*devp) == TNFCTL_MINOR) { - if (tnf_drv_state.ctldev_is_open) - err = EBUSY; - else { - tnf_drv_state.ctldev_is_open = B_TRUE; - /* stop autounloading -- XXX temporary */ - modunload_disable(); - } - } else { - /* ASSERT(getminor(*devp) == TNFMAP_MINOR) */ - ++tnf_drv_state.mapdev_open_count; - } - mutex_exit(&tnf_drv_state.tnf_mtx); - return (err); -} - -/* ARGSUSED */ -static int -tnf_close(dev_t dev, int flag, int otyp, struct cred *cred) -{ - if (getminor(dev) == TNFCTL_MINOR) { - /* - * Request the reenablement of autounloading - */ - modunload_enable(); - tnf_drv_state.ctldev_is_open = B_FALSE; - } else { - /* ASSERT(getminor(dev) == TNFMAP_MINOR) */ - /* - * Unconditionally zero the open count since close() - * is called when last client closes the device. - */ - tnf_drv_state.mapdev_open_count = 0; - } - return (0); -} - -/* - * return the address of the image referenced by dev. - * - * 1191344: aliasing problem on VAC machines. It could be made to - * work by ensuring that tnf_buf is allocated on a vac_size boundary. - */ -#ifdef UNUSED -/*ARGSUSED*/ -static int -tnf_mmap(dev_t dev, off_t off, int prot) -{ - register caddr_t addr; - register caddr_t pg_offset; - - if (getminor(dev) != TNFMAP_MINOR) - return (-1); - if (tnf_buf == 0 || off >= tnf_trace_file_size) { - return (-1); - } - - addr = tnf_buf; - pg_offset = (caddr_t)((ulong_t)addr + (ulong_t)off); - return ((int)hat_getpfnum(kas.a_hat, pg_offset)); -} -#endif - -/*ARGSUSED4*/ -static int -tnf_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, - cred_t *credp, int *rvalp) -{ - int filterval = 1; - - if ((mode & FMODELS) != FNATIVE) - return (ENOTSUP); - - if (getminor(dev) != TNFCTL_MINOR && - cmd != TIFIOCGSTATE && - cmd != TIFIOCGHEADER && - cmd != TIFIOCGBLOCK && - cmd != TIFIOCGFWZONE) - return (EINVAL); - - switch (cmd) { - case TIFIOCGMAXPROBE: - return (tnf_getmaxprobe((caddr_t)arg, mode)); - case TIFIOCGPROBEVALS: - return (tnf_getprobevals((caddr_t)arg, mode)); - case TIFIOCGPROBESTRING: - return (tnf_getprobestring((caddr_t)arg, mode)); - case TIFIOCSPROBEVALS: - return (tnf_setprobevals((caddr_t)arg, mode)); - case TIFIOCGSTATE: - return (tnf_getstate((caddr_t)arg, mode)); - case TIFIOCALLOCBUF: - return (tnf_allocbuf(arg)); - case TIFIOCDEALLOCBUF: - return (tnf_deallocbuf()); - case TIFIOCSTRACING: - /* LINTED cast from 64-bit integer to 32-bit integer */ - return (tnf_settracing((int)arg)); - case TIFIOCSPIDFILTER: - /* LINTED cast from 64-bit integer to 32-bit integer */ - return (tnf_pidfilterset((int)arg)); - case TIFIOCGPIDSTATE: - return (tnf_getpidstate((caddr_t)arg, mode)); - case TIFIOCSPIDOFF: - filterval = 0; - /*FALLTHROUGH*/ - case TIFIOCSPIDON: - /* LINTED cast from 64-bit integer to 32-bit integer */ - return (tnf_setpidstate(filterval, (pid_t)arg, mode)); - case TIFIOCPIDFILTERGET: - return (tnf_pidfilterget((caddr_t)arg, mode)); - case TIFIOCGHEADER: - return (tnf_getheader((caddr_t)arg, mode)); - case TIFIOCGBLOCK: - return (tnf_getblock((caddr_t)arg, mode)); - case TIFIOCGFWZONE: - return (tnf_getfwzone((caddr_t)arg, mode)); - default: - return (EINVAL); - } -} - -/* - * ioctls - */ - -static int -tnf_getmaxprobe(caddr_t arg, int mode) -{ - tnf_probe_control_t *p; - /* - * XXX Still not right for module unload -- just counting - * the probes is not enough - */ - if (tnf_changed_probe_list) { - mutex_enter(&mod_lock); - tnf_changed_probe_list = 0; - tnf_drv_state.tnf_probe_count = 0; - for (p = (tnf_probe_control_t *)__tnf_probe_list_head; - p != 0; p = p->next) - ++tnf_drv_state.tnf_probe_count; - mutex_exit(&mod_lock); - } - if (ddi_copyout((caddr_t)&tnf_drv_state.tnf_probe_count, - arg, sizeof (tnf_drv_state.tnf_probe_count), mode)) - return (EFAULT); - return (0); -} - -static int -tnf_getprobevals(caddr_t arg, int mode) -{ - tnf_probevals_t probebuf; - tnf_probe_control_t *p; - int i, retval = 0; - - if (ddi_copyin(arg, (caddr_t)&probebuf, sizeof (probebuf), mode)) - return (EFAULT); - - mutex_enter(&mod_lock); - for (i = 1, p = (tnf_probe_control_t *)__tnf_probe_list_head; - p != NULL && i != probebuf.probenum; - ++i, p = p->next) - ; - if (p == NULL) - retval = ENOENT; - else { - probebuf.enabled = (p->test_func != NULL); - probebuf.traced = (p->probe_func == tnf_trace_commit); - /* LINTED assignment of 64-bit integer to 32-bit integer */ - probebuf.attrsize = strlen(p->attrs) + 1; - if (ddi_copyout((caddr_t)&probebuf, - arg, sizeof (probebuf), mode)) - retval = EFAULT; - } - mutex_exit(&mod_lock); - return (retval); -} - -static int -tnf_getprobestring(caddr_t arg, int mode) -{ - tnf_probevals_t probebuf; - tnf_probe_control_t *p; - int i, retval = 0; - - if (ddi_copyin(arg, (caddr_t)&probebuf, sizeof (probebuf), mode)) - return (EFAULT); - - mutex_enter(&mod_lock); - for (i = 1, p = (tnf_probe_control_t *)__tnf_probe_list_head; - p != NULL && i != probebuf.probenum; - ++i, p = p->next) - ; - if (p == NULL) - retval = ENOENT; - else if (ddi_copyout((caddr_t)p->attrs, - arg, strlen(p->attrs) + 1, mode)) - retval = EFAULT; - mutex_exit(&mod_lock); - return (retval); -} - -static int -tnf_setprobevals(caddr_t arg, int mode) -{ - tnf_probevals_t probebuf; - tnf_probe_control_t *p; - int i, retval = 0; - - if (ddi_copyin(arg, (caddr_t)&probebuf, sizeof (probebuf), mode)) - return (EFAULT); - - mutex_enter(&mod_lock); - for (i = 1, p = (tnf_probe_control_t *)__tnf_probe_list_head; - p != NULL && i != probebuf.probenum; - ++i, p = p->next) - ; - if (p == NULL) - retval = ENOENT; - else { - /* - * First do trace, then enable. - * Set test_func last. - */ - if (probebuf.traced) - p->probe_func = tnf_trace_commit; - else - p->probe_func = tnf_trace_rollback; - if (probebuf.enabled) { - p->alloc_func = tnf_trace_alloc; - /* this must be set last */ - if (tnf_drv_state.tnf_pidfilter_mode) - p->test_func = tnf_test_2; - else - p->test_func = tnf_test_1; - } else - p->test_func = NULL; - } - mutex_exit(&mod_lock); - return (retval); -} - -static int -tnf_getstate(caddr_t arg, int mode) -{ - tifiocstate_t tstate; - proc_t *procp; - - if (tnf_buf == NULL) { - tstate.buffer_state = TIFIOCBUF_NONE; - tstate.buffer_size = 0; - } else { - switch (tnfw_b_state & ~TNFW_B_STOPPED) { - case TNFW_B_RUNNING: - tstate.buffer_state = TIFIOCBUF_OK; - break; - case TNFW_B_NOBUFFER: - tstate.buffer_state = TIFIOCBUF_UNINIT; - break; - case TNFW_B_BROKEN: - tstate.buffer_state = TIFIOCBUF_BROKEN; - break; - } - /* LINTED assignment of 64-bit integer to 32-bit integer */ - tstate.buffer_size = tnf_trace_file_size; - } - tstate.trace_stopped = tnfw_b_state & TNFW_B_STOPPED; - tstate.pidfilter_mode = tnf_drv_state.tnf_pidfilter_mode; - tstate.pidfilter_size = 0; - - mutex_enter(&pidlock); - for (procp = practive; procp != NULL; procp = procp->p_next) - if (PROC_IS_FILTER(procp)) - tstate.pidfilter_size++; - mutex_exit(&pidlock); - - if (ddi_copyout((caddr_t)&tstate, arg, sizeof (tstate), mode)) - return (EFAULT); - return (0); -} - -static int -tnf_allocbuf(intptr_t arg) -{ - size_t bufsz; - - if (tnf_buf != NULL) - return (EBUSY); - - bufsz = roundup((size_t)arg, PAGESIZE); - /* - * Validate size - * XXX Take kernel VM into consideration as well - */ - /* bug fix #4057599 if (bufsz > (physmem << PAGESHIFT) / 2) */ - if (btop(bufsz) > (physmem / 2)) - return (ENOMEM); - if (bufsz < TNF_TRACE_FILE_MIN) - bufsz = TNF_TRACE_FILE_MIN; - -#if TNF_USE_KMA - tnf_buf = kmem_zalloc(bufsz, KM_SLEEP); -#else - /* LINTED cast from 64-bit integer to 32-bit intege */ - tnf_buf = segkp_get(segkp, (int)bufsz, - KPD_ZERO | KPD_LOCKED | KPD_NO_ANON); -#endif - if (tnf_buf == NULL) - return (ENOMEM); - - tnf_trace_file_size = bufsz; - tnf_trace_init(); - return (0); -} - -/* - * Process a "deallocate buffer" ioctl request. Tracing must be turned - * off. We must clear references to the buffer from the tag sites; - * invalidate all threads' notions of block ownership; make sure nobody - * is executing a probe (they might have started before tracing was - * turned off); and free the buffer. - */ -static int -tnf_deallocbuf(void) -{ - tnf_ops_t *tpdp; - kthread_t *t; - tnf_probe_control_t *probep; - tnf_tag_data_t *tagp; - - if (tnf_drv_state.mapdev_open_count > 0 || tnf_tracing_active) - return (EBUSY); - if (tnf_buf == NULL) - return (ENOMEM); - - /* - * Make sure nobody is executing a probe. - * (They could be if they got started while - * tnf_tracing_active was still on.) Grab - * pidlock, and check the busy flag in all - * TPDP's. - */ - mutex_enter(&pidlock); - t = curthread; - do { - if (t->t_tnf_tpdp != NULL) { - /* LINTED pointer cast may result in improper alignment */ - tpdp = (tnf_ops_t *)t->t_tnf_tpdp; - if (LOCK_HELD(&tpdp->busy)) { - mutex_exit(&pidlock); - return (EBUSY); - } - tpdp->wcb.tnfw_w_pos.tnfw_w_block = NULL; - tpdp->wcb.tnfw_w_tag_pos.tnfw_w_block = NULL; - tpdp->schedule.record_p = NULL; - } - t = t->t_next; - } while (t != curthread); - mutex_exit(&pidlock); - - /* - * Zap all references to the buffer we're freeing. - * Grab mod_lock while walking list to keep it - * consistent. - */ - mutex_enter(&mod_lock); - tagp = (tnf_tag_data_t *)__tnf_tag_list_head; - while (tagp != NULL) { - tagp->tag_index = 0; - tagp = (tnf_tag_data_t *)tagp->tag_version; - } - probep = (tnf_probe_control_t *)__tnf_probe_list_head; - while (probep != NULL) { - probep->index = 0; - probep = probep->next; - } - mutex_exit(&mod_lock); - - tnfw_b_state = TNFW_B_NOBUFFER | TNFW_B_STOPPED; -#if TNF_USE_KMA - kmem_free(tnf_buf, tnf_trace_file_size); -#else - segkp_release(segkp, tnf_buf); -#endif - tnf_buf = NULL; - - return (0); -} - -static int -tnf_settracing(int arg) -{ - if (arg) - if (tnf_buf == NULL) - return (ENOMEM); - else - tnf_trace_on(); - else - tnf_trace_off(); - -#ifdef _TNF_SPEED_TEST -#define NITER 255 - { - int i; - - for (i = 0; i < NITER; i++) - TNF_PROBE_0(tnf_speed_0, "tnf", /* CSTYLED */); - for (i = 0; i < NITER; i++) - TNF_PROBE_1(tnf_speed_1, "tnf", /* CSTYLED */, - tnf_long, long, i); - for (i = 0; i < NITER; i++) - TNF_PROBE_2(tnf_speed_2, "tnf", /* CSTYLED */, - tnf_long, long1, i, - tnf_long, long2, i); - } -#endif /* _TNF_SPEED_TEST */ - - return (0); -} - -static int -tnf_getpidstate(caddr_t arg, int mode) -{ - int err = 0; - pid_t pid; - proc_t *procp; - int result; - - if (ddi_copyin(arg, (caddr_t)&pid, sizeof (pid), mode)) - return (EFAULT); - - mutex_enter(&pidlock); - if ((procp = prfind(pid)) != NULL) - result = PROC_IS_FILTER(procp); - else - err = ESRCH; - mutex_exit(&pidlock); - - if (!err) - if (ddi_copyout((caddr_t)&result, (caddr_t)arg, - sizeof (result), mode)) - return (EFAULT); - return (err); -} - -/*ARGSUSED*/ -static int -tnf_setpidstate(int filterval, pid_t pid, int mode) -{ - int err = 0; - proc_t *procp; - - mutex_enter(&pidlock); - if ((procp = prfind(pid)) != NULL) - if (filterval) - PROC_FILTER_SET(procp); - else - PROC_FILTER_CLR(procp); - else - err = ESRCH; - mutex_exit(&pidlock); - - return (err); -} - -static int -tnf_pidfilterset(int mode) -{ - tnf_probe_control_t *p; - tnf_probe_test_func_t func; - - tnf_drv_state.tnf_pidfilter_mode = mode; - - /* Establish correct test func for each probe */ - if (mode) - func = tnf_test_2; - else - func = tnf_test_1; - - mutex_enter(&mod_lock); - p = (tnf_probe_control_t *)__tnf_probe_list_head; - while (p != NULL) { - if (p->test_func != NULL) - p->test_func = func; - p = p->next; - } - mutex_exit(&mod_lock); - - return (0); -} - -static int -tnf_pidfilterget(caddr_t dest, int mode) -{ - int err = 0; - int filtercount = 0; - size_t sz; - pid_t *filterbuf, *bufp; - proc_t *procp; - - /* Count how many processes in filter set (upper bound) */ - mutex_enter(&pidlock); - for (procp = practive; procp != NULL; procp = procp->p_next) - if (PROC_IS_FILTER(procp)) - filtercount++; - mutex_exit(&pidlock); - - /* Allocate temp space to hold filter set (upper bound) */ - sz = sizeof (pid_t) * (filtercount + 1); - filterbuf = kmem_zalloc(sz, KM_SLEEP); - - /* - * NOTE: The filter set cannot grow between the first and - * second acquisitions of pidlock. This is currently true - * because: - * 1. /dev/tnfctl is exclusive open, so all driver - * control operations, including changing the filter - * set and this code, are effectively single-threaded. - * 2. There is no in-kernel API to manipulate the filter - * set (i.e. toggle the on/off bit in a proc struct). - * 3. The proc filter bit is not inherited across a fork() - * operation; the child starts with the bit off. - * If any of these assumptions is invalidated, a possible - * solution is to check whether we're overflowing the allocated - * filterbuf below, and back out and restart from the beginning - * if so. - * - * The code below handles the case when the filter set shrinks - * due to processes exiting. - */ - - /* Fill in filter set */ - bufp = filterbuf + 1; /* first word is for count */ - filtercount = 0; /* recomputed below */ - mutex_enter(&pidlock); - for (procp = practive; procp != NULL; procp = procp->p_next) { - if (PROC_IS_FILTER(procp)) { - filtercount++; - *bufp++ = procp->p_pid; - } - } - mutex_exit(&pidlock); - - /* Set filtercount */ - *filterbuf = (pid_t)filtercount; - - /* Copy out result */ - if (ddi_copyout((caddr_t)filterbuf, dest, sz, mode)) - err = EFAULT; - - /* Free temp space */ - kmem_free(filterbuf, sz); - - return (err); -} - -static int -tnf_getheader(caddr_t arg, int mode) -{ - if (tnf_buf == NULL) - return (ENOMEM); - if (ddi_copyout(tnf_buf, arg, TNF_BLOCK_SIZE, mode)) - return (EFAULT); - return (0); -} - -static int -tnf_getblock(caddr_t arg, int mode) -{ - int err = 0; - tifiocgblock_t parms; - caddr_t area; - tnf_block_header_t *blk; - - if (tnf_buf == NULL) - return (ENOMEM); - if (ddi_copyin(arg, (caddr_t)&parms, sizeof (parms), mode)) - return (EFAULT); - area = tnf_buf + TNF_DIRECTORY_SIZE + - parms.block_num * TNF_BLOCK_SIZE; - if (area < tnf_buf + TNF_DIRECTORY_SIZE || - area >= tnf_buf + tnf_trace_file_size) - return (EFAULT); - /* LINTED pointer cast */ - blk = (tnf_block_header_t *)area; - /* - * B-lock the block while we're reading - */ - if (!lock_try(&blk->B_lock)) - return (EBUSY); - if (ddi_copyout(area, parms.dst_addr, TNF_BLOCK_SIZE, mode)) - err = EFAULT; - lock_clear(&blk->B_lock); - return (err); -} - -static int -tnf_getfwzone(caddr_t arg, int mode) -{ - tifiocgfw_t parms; - - if (tnf_buf == NULL) - return (ENOMEM); - if (ddi_copyin(arg, (caddr_t)&parms, sizeof (parms), mode)) - return (EFAULT); - if (ddi_copyout(tnf_buf + TNF_BLOCK_SIZE + parms.start * - sizeof (tnf_ref32_t), (caddr_t)parms.dst_addr, - parms.slots * (int)(sizeof (tnf_ref32_t)), mode)) - return (EFAULT); - return (0); -} - -/*ARGSUSED*/ -static void * -tnf_test_1(void *tpdp, tnf_probe_control_t *probe_p, tnf_probe_setup_t *sp) -{ - tpdp = (void *)curthread->t_tnf_tpdp; - if (tpdp != NULL) - return (tnf_trace_alloc((tnf_ops_t *)tpdp, probe_p, sp)); - return (NULL); -} - -/*ARGSUSED*/ -static void * -tnf_test_2(void *tpdp, tnf_probe_control_t *probe_p, tnf_probe_setup_t *sp) -{ - tpdp = (void *)curthread->t_tnf_tpdp; - if (tpdp != NULL && PROC_IS_FILTER(curproc)) - return (tnf_trace_alloc((tnf_ops_t *)tpdp, probe_p, sp)); - return (NULL); -} - -#endif /* !NPROBE */ diff --git a/usr/src/uts/common/tnf/tnf.conf b/usr/src/uts/common/tnf/tnf.conf deleted file mode 100644 index 65c0219345..0000000000 --- a/usr/src/uts/common/tnf/tnf.conf +++ /dev/null @@ -1,26 +0,0 @@ -# -# 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 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 (c) 1992, by Sun Microsystems, Inc. -# -#ident "%Z%%M% %I% %E% SMI" -name="tnf" parent="pseudo" instance=0; diff --git a/usr/src/uts/common/tnf/tnf_buf.c b/usr/src/uts/common/tnf/tnf_buf.c deleted file mode 100644 index 039a1c0b24..0000000000 --- a/usr/src/uts/common/tnf/tnf_buf.c +++ /dev/null @@ -1,409 +0,0 @@ -/* - * 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 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 (c) 1994-2000 by Sun Microsystems, Inc. - * All rights reserved. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -#include <sys/types.h> -#include <sys/param.h> -#include <sys/systm.h> /* for bzero */ -#include <sys/machlock.h> -#include <sys/spl.h> -#include <sys/promif.h> -#include <sys/debug.h> - -#include "tnf_buf.h" - -/* - * Defines - */ - -#define TNFW_B_ALLOC_LO 0x1 -#define TNFW_B_MAXALLOCTRY 32 - -#define TNF_MAXALLOC (TNF_BLOCK_SIZE - sizeof (tnf_block_header_t)) - -/* - * Globals - */ - -TNFW_B_STATE tnfw_b_state = TNFW_B_NOBUFFER | TNFW_B_STOPPED; - -/* - * Locals - */ - -static int spinlock_spl; - -/* - * Declarations - */ - -static tnf_block_header_t *tnfw_b_alloc_block(tnf_buf_file_header_t *, - enum tnf_alloc_mode); - -/* - * (Private) Allocate a new block. Return NULL on failure and mark - * tracing as broken. 'istag' is non-zero if the block is to be - * non-reclaimable. All blocks are returned A-locked. - */ - -static tnf_block_header_t * -tnfw_b_alloc_block(tnf_buf_file_header_t *fh, enum tnf_alloc_mode istag) -{ - tnf_block_header_t *block; - ulong_t bcount; - ulong_t tmp_bn, bn, new_bn; - ulong_t tmp_gen, gen, new_gen; - ulong_t next; - int i; - lock_t *lp; - ushort_t spl; - - if (tnfw_b_state != TNFW_B_RUNNING) - return (NULL); - - lp = &fh->lock; - - /* - * Check reserved area first for tag block allocations - * Tag allocations are rare, so we move the code out of line - */ - if (istag) - goto try_reserved; - -try_loop: - /* - * Search for a block, using hint as starting point. - */ - - bcount = fh->com.block_count; /* total block count */ - - gen = fh->next_alloc.gen; - bn = fh->next_alloc.block[gen & TNFW_B_ALLOC_LO]; - - for (i = 0; i < TNFW_B_MAXALLOCTRY; i++) { - - /* - * Calculate next (not this) block to look for. - * Needed for updating the hint. - */ - if ((new_bn = bn + 1) >= bcount) { - new_bn = TNFW_B_DATA_BLOCK_BEGIN >> TNF_BLOCK_SHIFT; - new_gen = gen + 1; - } else - new_gen = gen; - - /* - * Try to reserve candidate block - */ - /* LINTED pointer cast may result in improper alignment */ - block = (tnf_block_header_t *) - ((char *)fh + (bn << TNF_BLOCK_SHIFT)); - - if (lock_try(&block->A_lock)) - if (block->generation < gen && - lock_try(&block->B_lock)) - goto update_hint; - else - lock_clear(&block->A_lock); - - /* Reload hint values */ - gen = fh->next_alloc.gen; - bn = fh->next_alloc.block[gen & TNFW_B_ALLOC_LO]; - - /* adjust if we know a little better than the hint */ - if ((new_bn > bn && new_gen == gen) || new_gen > gen) { - gen = new_gen; - bn = new_bn; - } - } - - goto loop_fail; - -update_hint: - /* - * Re-read the hint and update it only if we'll be increasing it. - */ - lock_set_spl(lp, spinlock_spl, &spl); - tmp_gen = fh->next_alloc.gen; - tmp_bn = fh->next_alloc.block[tmp_gen & TNFW_B_ALLOC_LO]; - - if ((new_gen == tmp_gen && new_bn > tmp_bn) || new_gen > tmp_gen) { - /* - * Order is important here! It is the write to - * next_alloc.gen that atomically records the new - * value. - */ - fh->next_alloc.block[new_gen & TNFW_B_ALLOC_LO] = new_bn; - fh->next_alloc.gen = new_gen; - } - lock_clear_splx(lp, spl); - -got_block: - /* - * Initialize and return the block - */ - /* ASSERT(block->tag == TNF_BLOCK_HEADER_TAG); */ - block->bytes_valid = sizeof (tnf_block_header_t); - block->next_block = NULL; - /* LINTED assignment of 64-bit integer to 32-bit integer */ - block->generation = istag ? TNF_TAG_GENERATION_NUM : gen; - /* ASSERT(LOCK_HELD(&block->A_lock); */ - lock_clear(&block->B_lock); - return (block); - -try_reserved: - /* - * Look for a free tag block in reserved area - */ - next = fh->next_tag_alloc; - while (next < (TNFW_B_DATA_BLOCK_BEGIN >> TNF_BLOCK_SHIFT)) { - /* LINTED pointer cast may result in improper alignment */ - block = (tnf_block_header_t *) - ((char *)fh + (next << TNF_BLOCK_SHIFT)); - next++; - /* - * See if block is unclaimed. - * Don't bother clearing the A-lock if the - * block was claimed and released, since it - * will never be reallocated anyway. - */ - if (lock_try(&block->A_lock) && - block->generation == 0) { - lock_set_spl(lp, spinlock_spl, &spl); - if (next > fh->next_tag_alloc) - fh->next_tag_alloc = next; - lock_clear_splx(lp, spl); - goto got_block; - } - } - goto try_loop; - -loop_fail: - /* - * Only get here if we failed the for loop - */ - ASSERT(i == TNFW_B_MAXALLOCTRY); - tnfw_b_state = TNFW_B_BROKEN; -#ifdef DEBUG - prom_printf("kernel probes: alloc_block failed\n"); -#endif - return (NULL); - -} - -/* - * Allocate size bytes from the trace buffer. Return NULL on failure, - * and mark tracing as broken. We're guaranteed that the buffer will - * not be deallocated while we're in this routine. - * Allocation requests must be word-sized and are word-aligned. - */ - -void * -tnfw_b_alloc(TNFW_B_WCB *wcb, size_t size, enum tnf_alloc_mode istag) -{ - TNFW_B_POS *pos; - ushort_t offset; - void *destp; - tnf_block_header_t *block, *new_block; - - pos = &wcb->tnfw_w_pos; /* common case */ - if (istag) - pos = &wcb->tnfw_w_tag_pos; - block = pos->tnfw_w_block; - offset = pos->tnfw_w_write_off; - /* Round size up to a multiple of 8. */ - size = (size + 7) & ~7; - - if (block == NULL || offset + size > TNF_BLOCK_SIZE) { - - /* Get a new block */ - /* LINTED pointer cast may result in improper alignment */ - new_block = tnfw_b_alloc_block(TNF_FILE_HEADER(), istag); - if (new_block == NULL) - /* tracing has been marked as broken at this point */ - return (NULL); - - /* ASSERT(size <= TNF_MAXALLOC); */ - - /* - * If the old block is clean (i.e., we're in a new - * transaction), just release it. Else, pad it out - * and attach it to the list of uncommitted blocks. - */ - if (block != NULL) { - if (block->bytes_valid == offset && - !pos->tnfw_w_dirty) { - /* block is clean: release it */ - lock_clear(&block->A_lock); - } else { - /* block is dirty */ - ulong_t *p, *q; - - /* LINTED pointer cast */ - p = (ulong_t *)((char *)block + offset); - /* LINTED pointer cast */ - q = (ulong_t *)((char *)block + TNF_BLOCK_SIZE); - while (p < q) - *p++ = TNF_NULL; - - /* append block to release list */ - new_block->next_block = block; - - /* we have at least one dirty block */ - pos->tnfw_w_dirty = 1; - } - } - - /* make new_block the current block */ - pos->tnfw_w_block = block = new_block; - /* write_off is updated below */ - offset = sizeof (tnf_block_header_t); - /* ASSERT(new_block->bytes_valid == offset); */ - } - - destp = (char *)block + offset; - /* update write_off */ - pos->tnfw_w_write_off = offset + size; - /* - * Unconditionally write a 0 into the last word allocated, - * in case we left an alignment gap. (Assume that doing an - * unconditional write is cheaper than testing and branching - * around the write half the time.) - */ - /* LINTED pointer cast may result in improper alignment */ - *((int *)((char *)destp + size - sizeof (int))) = 0; - return (destp); -} - -/* - * Allocate a directory entry. - */ - -/*ARGSUSED0*/ -void * -tnfw_b_fw_alloc(TNFW_B_WCB *wcb) -{ - tnf_buf_file_header_t *fh; - lock_t *lp; - ushort_t spl; - caddr_t cell; - ulong_t next; - - /* LINTED pointer cast may result in improper alignment */ - fh = TNF_FILE_HEADER(); - lp = &fh->lock; - - lock_set_spl(lp, spinlock_spl, &spl); - next = fh->next_fw_alloc; - if (next < TNFW_B_FW_ZONE) { - cell = (caddr_t)fh + next; - fh->next_fw_alloc = next + sizeof (tnf_ref32_t); - } else - cell = NULL; - lock_clear_splx(lp, spl); - - return (cell); -} - -/* - * Initialize a buffer. - */ - -void -tnfw_b_init_buffer(caddr_t buf, size_t size) -{ - int gen_shift; - int i; - ulong_t b; - ulong_t blocks; - tnf_block_header_t *block; - tnf_buf_file_header_t *fh; - - /* Compute platform-specific spinlock_spl */ - spinlock_spl = __ipltospl(LOCK_LEVEL + 1); - - /* LINTED pointer cast may result in improper alignment */ - fh = (tnf_buf_file_header_t *)buf; - - /* LINTED logical expression always true: op "||" */ - ASSERT(TNF_DIRECTORY_SIZE > TNF_BLOCK_SIZE); - - /* - * This assertion is needed because we cannot change - * sys/tnf_com.h this late in the release cycle, but we need the - * interface in sys/machlock.h for locking operations. - */ - /* LINTED logical expression always true: op "||" */ - ASSERT(sizeof (tnf_byte_lock_t) == sizeof (lock_t)); - - /* Calculate number of blocks */ - blocks = size >> TNF_BLOCK_SHIFT; - - /* Calculate generation shift */ - gen_shift = 0; - b = 1; - while (b < blocks) { - b <<= 1; - ++gen_shift; - } - ASSERT(gen_shift < 32); - - /* fill in file header */ - /* magic number comes last */ - /* LINTED constant truncated by assignment */ - fh->com.tag = TNF_FILE_HEADER_TAG; - fh->com.file_version = TNF_FILE_VERSION; - fh->com.file_header_size = sizeof (tnf_file_header_t); - fh->com.file_log_size = gen_shift + TNF_BLOCK_SHIFT; - fh->com.block_header_size = sizeof (tnf_block_header_t); - fh->com.block_size = TNF_BLOCK_SIZE; - fh->com.directory_size = TNF_DIRECTORY_SIZE; - /* LINTED assignment of 64-bit integer to 32-bit integer */ - fh->com.block_count = blocks; - /* com.blocks_valid is unused */ - fh->next_alloc.gen = 1; - fh->next_alloc.block[0] = 0; - fh->next_alloc.block[1] = TNFW_B_DATA_BLOCK_BEGIN >> TNF_BLOCK_SHIFT; - fh->next_tag_alloc = TNF_DIRECTORY_SIZE >> TNF_BLOCK_SHIFT; - fh->next_fw_alloc = TNF_DIRENT_LAST + 4; - LOCK_INIT_CLEAR(&fh->lock); - - (void) bzero(buf + sizeof (*fh), TNF_DIRECTORY_SIZE - sizeof (*fh)); - i = TNF_DIRECTORY_SIZE >> TNF_BLOCK_SHIFT; - for (; i < blocks; ++i) { - /* LINTED pointer cast may result in improper alignment */ - block = (tnf_block_header_t *)(buf + (i << TNF_BLOCK_SHIFT)); - block->tag = (tnf_ref32_t)TNF_BLOCK_HEADER_TAG; - block->generation = 0; - block->bytes_valid = sizeof (tnf_block_header_t); - LOCK_INIT_CLEAR(&block->A_lock); - LOCK_INIT_CLEAR(&block->B_lock); - } - - /* snap in magic number */ - fh->magic = TNF_MAGIC; -} diff --git a/usr/src/uts/common/tnf/tnf_buf.h b/usr/src/uts/common/tnf/tnf_buf.h deleted file mode 100644 index 4fc40cb510..0000000000 --- a/usr/src/uts/common/tnf/tnf_buf.h +++ /dev/null @@ -1,250 +0,0 @@ -/* - * 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 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 (c) 1994,1997-1998 by Sun Microsystems, Inc. - * All rights reserved. - */ - -#ifndef _TNF_BUF_H -#define _TNF_BUF_H - -#pragma ident "%Z%%M% %I% %E% SMI" - -#include <sys/tnf_com.h> -#include <sys/machlock.h> - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Size of a TNF buffer block - */ - -#define TNF_BLOCK_SIZE 512 -#define TNF_BLOCK_SHIFT 9 -#define TNF_BLOCK_MASK ~(TNF_BLOCK_SIZE - 1) - -/* - * Size of the file header and forwarding pointer (directory) area combined. - * Tag and data blocks start this many bytes into the file. - * The maximum size of this area is 64KB. - */ - -#define TNF_DIRECTORY_SIZE (4 * 1024) -#define TNFW_B_FW_ZONE TNF_DIRECTORY_SIZE - -/* - * Reserved space for tag blocks, after directory area. - */ - -#define TNFW_B_TAG_RESERVE (28 * 1024) - -#define TNFW_B_DATA_BLOCK_BEGIN (TNFW_B_FW_ZONE + TNFW_B_TAG_RESERVE) - -/* - * Reserved directory entries, and their precomputed tags. These are byte - * offsets from start of file. - */ - -#define TNF_DIRENT_FILE_HEADER (TNF_BLOCK_SIZE + 0) -#define TNF_DIRENT_BLOCK_HEADER (TNF_BLOCK_SIZE + 4) -#define TNF_DIRENT_ROOT (TNF_BLOCK_SIZE + 8) -#define TNF_DIRENT_LAST TNF_DIRENT_ROOT - -#define TNF_FILE_HEADER_TAG \ - (TNF_REF32_MAKE_PERMANENT(TNF_DIRENT_FILE_HEADER) | TNF_REF32_T_TAG) - -#define TNF_BLOCK_HEADER_TAG \ - (TNF_REF32_MAKE_PERMANENT(TNF_DIRENT_BLOCK_HEADER) | TNF_REF32_T_TAG) - -#define TNF_ROOT_TAG \ - (TNF_REF32_MAKE_PERMANENT(TNF_DIRENT_ROOT) | TNF_REF32_T_TAG) - -/* - * Allocation type: permanent or reusable - */ - -enum tnf_alloc_mode { - TNF_ALLOC_REUSABLE = 0, - TNF_ALLOC_FIXED = 1 -}; - -/* - * Buffer status - */ - -typedef enum { - TNFW_B_RUNNING = 0, - TNFW_B_NOBUFFER, - TNFW_B_BROKEN -} TNFW_B_STATE; - -/* - * The STOPPED bit may be or-ed into the state field. - */ -#define TNFW_B_STOPPED 16 -#define TNFW_B_SET_STOPPED(state) ((state) |= TNFW_B_STOPPED) -#define TNFW_B_UNSET_STOPPED(state) ((state) &= ~TNFW_B_STOPPED) -#define TNFW_B_IS_STOPPED(state) ((state) & TNFW_B_STOPPED) - -/* - * Layout of the first block of TNF file (file header) - */ - -typedef struct { - tnf_uint32_t magic; /* magic number */ - tnf_file_header_t com; /* common header */ - struct { - volatile ulong_t gen; /* generation */ - volatile ulong_t block[2]; /* block number */ - } next_alloc; - ulong_t next_tag_alloc; /* block counter */ - ulong_t next_fw_alloc; /* byte offset */ - lock_t lock; /* protects hint updates */ - /* Padding to end of block */ -} tnf_buf_file_header_t; - -/* - * Per-thread write-control information - */ - -typedef struct tnfw_b_pos { - tnf_block_header_t *tnfw_w_block; - ushort_t tnfw_w_write_off; - uchar_t tnfw_w_dirty; -} TNFW_B_POS; - -typedef struct tnfw_b_wcb { - struct tnfw_b_pos tnfw_w_pos; - struct tnfw_b_pos tnfw_w_tag_pos; -} TNFW_B_WCB; - -/* - * Global tracing state - */ - -extern TNFW_B_STATE tnfw_b_state; - -/* - * Global trace buffer - */ - -extern caddr_t tnf_buf; - -#define TNF_FILE_HEADER() ((tnf_buf_file_header_t *)tnf_buf) - -/* - * External interface - */ - -/* - * Allocate 'size' data bytes using 'wcb'; store result into 'buf'. - * This inlines the common trace case. - */ -#define TNFW_B_ALLOC(wcb, size, buf, typ) \ -{ \ - TNFW_B_POS *xx_pos; \ - ushort_t xx_off, xx_nof; \ - tnf_block_header_t *xx_blk; \ - size_t xx_size; \ - \ - /* Round size up to a multiple of 8. */ \ - xx_size = (size + 7) & ~7; \ - xx_pos = &(wcb)->tnfw_w_pos; \ - xx_blk = xx_pos->tnfw_w_block; \ - xx_off = xx_pos->tnfw_w_write_off; \ - xx_nof = xx_off + xx_size; \ - if (xx_blk != NULL && xx_nof <= TNF_BLOCK_SIZE) { \ - buf = (typ)((char *)xx_blk + xx_off); \ - xx_pos->tnfw_w_write_off = xx_nof; \ - /* LINTED */ \ - *((int *)((char *)buf + xx_size - sizeof (int))) = 0; \ - } else \ - buf = tnfw_b_alloc((wcb), xx_size, TNF_ALLOC_REUSABLE);\ -} - -/* - * Giveback words after new_pos. - */ -#define TNFW_B_GIVEBACK(wcb, new_pos) \ - ((wcb)->tnfw_w_pos.tnfw_w_write_off = \ - (((char *)(new_pos) \ - - (char *)((wcb)->tnfw_w_pos.tnfw_w_block) + 7) \ - & ~7), *(int *)(new_pos) = 0) - -/* - * Commit transaction bytes allocated via 'pos' - */ -#define TNFW_B_COMMIT(pos) \ -{ \ - tnf_block_header_t *xx_blk, *xx_nxt; \ - \ - xx_blk = (pos)->tnfw_w_block; \ - if (xx_blk != NULL) { \ - xx_blk->bytes_valid = (pos)->tnfw_w_write_off; \ - if ((pos)->tnfw_w_dirty) { \ - xx_nxt = xx_blk->next_block; \ - while (xx_nxt != NULL) { \ - xx_blk->next_block = NULL; \ - xx_blk = xx_nxt; \ - xx_nxt = xx_blk->next_block; \ - xx_blk->bytes_valid = TNF_BLOCK_SIZE;\ - lock_clear(&xx_blk->A_lock); \ - } \ - (pos)->tnfw_w_dirty = 0; \ - } \ - } \ -} - -/* - * Rollback transaction bytes allocated via 'pos' - */ -#define TNFW_B_ROLLBACK(pos) \ -{ \ - tnf_block_header_t *xx_blk, *xx_nxt; \ - \ - xx_blk = (pos)->tnfw_w_block; \ - if (xx_blk != NULL) { \ - (pos)->tnfw_w_write_off = xx_blk->bytes_valid; \ - if ((pos)->tnfw_w_dirty) { \ - xx_nxt = xx_blk->next_block; \ - while (xx_nxt != NULL) { \ - xx_blk->next_block = NULL; \ - xx_blk = xx_nxt; \ - xx_nxt = xx_blk->next_block; \ - lock_clear(&xx_blk->A_lock); \ - } \ - (pos)->tnfw_w_dirty = 0; \ - } \ - } \ -} - -extern void tnfw_b_init_buffer(caddr_t, size_t); -extern void *tnfw_b_alloc(TNFW_B_WCB *, size_t, enum tnf_alloc_mode); -extern void *tnfw_b_fw_alloc(TNFW_B_WCB *); - -#ifdef __cplusplus -} -#endif - -#endif /* _TNF_BUF_H */ diff --git a/usr/src/uts/common/tnf/tnf_probe.c b/usr/src/uts/common/tnf/tnf_probe.c deleted file mode 100644 index 52744b09c9..0000000000 --- a/usr/src/uts/common/tnf/tnf_probe.c +++ /dev/null @@ -1,187 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -#ifdef _KERNEL -#include <sys/types.h> -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/ddi.h> /* strchr */ -#include <sys/sunddi.h> /* strchr */ -#include <sys/tnf_com.h> -#include <sys/tnf_writer.h> -#include <sys/tnf_probe.h> /* fixed tnf_probe_control_t->index problem */ -#include "tnf_types.h" -#include "tnf_trace.h" -#else /* _KERNEL */ -#include <stdlib.h> -#include <string.h> -#include <tnf/com.h> -#include <tnf/writer.h> -#include <tnf/probe.h> -#include "tnf_types.h" -#include <tnf_trace.h> -#endif /* _KERNEL */ - - -/* - * Defines - */ - -#define NAME_LIMIT 128 -#define ARRAY_LIMIT 5 -#define NAME_START 5 -#define SLOT_OFFSET 7 -#define CONST_SLOTS 2 - -/* - * probe version 1 - */ - -struct tnf_probe_version __tnf_probe_version_1_info = { - sizeof (struct tnf_probe_version), - sizeof (tnf_probe_control_t) -}; - -/* - * write instances of tnf_probe_type (i.e probe records) - */ - -uintptr_t -tnf_probe_tag(tnf_ops_t *ops, tnf_probe_control_t *probe_p) -{ - tnf_tag_data_t *metatag_data; - tnf_record_p metatag_index; - tnf_probe_prototype_t *buffer; - enum tnf_alloc_mode saved_mode; - tnf_uint32_t *fwp; - char probe_name[NAME_LIMIT]; - char slot_array[ARRAY_LIMIT][NAME_LIMIT]; - char *slot_args[ARRAY_LIMIT + CONST_SLOTS + 1]; - const char *nm_start, *nm_end, *slot_start, *slot_end; - int nm_len, separator, count; - - saved_mode = ops->mode; - ops->mode = TNF_ALLOC_FIXED; -#if defined(_LP64) - /* LINTED assignment of 32-bit integer to 8-bit integer */ - ALLOC2(ops, sizeof (*buffer), buffer, saved_mode); -#else - ALLOC2(ops, sizeof (*buffer), buffer, saved_mode); -#endif - probe_p->index = (uintptr_t)buffer; - fwp = tnfw_b_fw_alloc(&(ops->wcb)); - if (fwp) { - /* REMIND: can make the next call more efficient */ - *fwp = tnf_ref32(ops, (tnf_record_p) buffer, - (tnf_record_p)fwp); - /* fwp - filestart < 64K */ -#ifdef _KERNEL - probe_p->index = (char *)fwp - tnf_buf; -#else - probe_p->index = (char *)fwp - _tnfw_b_control->tnf_buffer; -#endif - probe_p->index |= TNF_TAG16_T_ABS; - probe_p->index = probe_p->index << PROBE_INDEX_SHIFT; - probe_p->index |= PROBE_INDEX_FILE_PTR; - } - - metatag_data = TAG_DATA(tnf_probe_type); - metatag_index = metatag_data->tag_index ? - metatag_data->tag_index : - metatag_data->tag_desc(ops, metatag_data); - - /* find the name of the probe */ - nm_start = &(probe_p->attrs[NAME_START]); - separator = ATTR_SEPARATOR; - nm_end = strchr(probe_p->attrs, separator); -#if defined(_LP64) - /* LINTED assignment of 64-bit integer to 32-bit integer */ - nm_len = nm_end - nm_start; -#else - nm_len = nm_end - nm_start; -#endif - slot_start = nm_end + SLOT_OFFSET; - nm_len = (nm_len > (NAME_LIMIT - 1)) ? (NAME_LIMIT - 1) : nm_len; - (void) strncpy(probe_name, nm_start, nm_len); - probe_name[nm_len] = '\0'; - - /* initialize constant part of slot names */ - slot_args[0] = TNF_N_TAG; - slot_args[1] = TNF_N_TIME_DELTA; - - /* - * initialize rest of slot names, if any. This parsing routine is - * dependant on a space after "slots" (even for TNF_PROBE_0 and a - * space after the last slot name. It truncates any values that - * are larger than 127 chars to 127 chars. It handles missing slot - * names. - */ - separator = ATTR_SEPARATOR; - slot_end = strchr(slot_start, separator); - nm_start = slot_start; - separator = VAL_SEPARATOR; - for (count = 0; nm_start < slot_end; count++) { - nm_end = strchr(nm_start, separator); -#if defined(_LP64) - /* LINTED assignment of 64-bit integer to 32-bit integer */ - nm_len = nm_end - nm_start; -#else - nm_len = nm_end - nm_start; -#endif - nm_len = (nm_len > (NAME_LIMIT - 1)) ? (NAME_LIMIT - 1) : - nm_len; - (void) strncpy(slot_array[count], nm_start, nm_len); - slot_array[count][nm_len] = '\0'; - slot_args[count+CONST_SLOTS] = slot_array[count]; - /* get next name */ - nm_start = nm_end + 1; - } - /* null terminate string vector */ - slot_args[count+CONST_SLOTS] = NULL; - - ASSIGN(buffer, tag, metatag_index); - ASSIGN(buffer, name, probe_name); - /* XXX Fix these properties sometime */ - ASSIGN(buffer, properties, &tnf_struct_properties); - ASSIGN(buffer, slot_types, probe_p->slot_types); -#if defined(_LP64) - /* LINTED */ - ASSIGN(buffer, type_size, probe_p->tnf_event_size); -#else - ASSIGN(buffer, type_size, probe_p->tnf_event_size); -#endif - ASSIGN(buffer, slot_names, slot_args); - ASSIGN(buffer, string, (slot_end + 1)); -#if defined(_LP64) - /* supress lint warning for _KERNEL mode, really need this? */ - /* LINTED assignment of 32-bit integer to 8-bit integer */ - ops->mode = saved_mode; -#else - ops->mode = saved_mode; -#endif - return (probe_p->index); -} diff --git a/usr/src/uts/common/tnf/tnf_res.c b/usr/src/uts/common/tnf/tnf_res.c deleted file mode 100644 index 57c738e959..0000000000 --- a/usr/src/uts/common/tnf/tnf_res.c +++ /dev/null @@ -1,388 +0,0 @@ -/* - * 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 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 2004 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -/* - * "Resident" part of TNF -- this has to be around even when the - * driver is not loaded. - */ - -#ifndef NPROBE -#include <sys/types.h> -#include <sys/systm.h> -#include <sys/thread.h> -#include <sys/klwp.h> -#include <sys/proc.h> -#include <sys/kmem.h> -#include <sys/msacct.h> -#include <sys/tnf_com.h> -#include <sys/tnf_writer.h> -#include <sys/tnf_probe.h> -#include <sys/tnf.h> -#include <sys/debug.h> -#include <sys/modctl.h> -#include <sys/kobj.h> - -#include "tnf_buf.h" -#include "tnf_types.h" -#include "tnf_trace.h" - -/* - * Defines - */ - -#define TNF_PC_COUNT 8 - -/* - * Declarations - */ - -/* - * TNF kernel probe management externs - */ -extern tnf_probe_control_t *__tnf_probe_list_head; -extern tnf_tag_data_t *__tnf_tag_list_head; -extern int tnf_changed_probe_list; - -/* - * This makes the state of the TNFW_B_STOPPED bit externally visible - * in the kernel. - */ -volatile int tnf_tracing_active = 0; - -/* - * The trace buffer pointer - */ -caddr_t tnf_buf; - -/* - * Stub definitions for tag data pointers - */ - -/* tnf_writer module */ -tnf_tag_data_t *tnf_inline_tag_data = NULL; -tnf_tag_data_t *tnf_tagged_tag_data = NULL; -tnf_tag_data_t *tnf_scalar_tag_data = NULL; -tnf_tag_data_t *tnf_char_tag_data = NULL; -tnf_tag_data_t *tnf_int8_tag_data = NULL; -tnf_tag_data_t *tnf_uint8_tag_data = NULL; -tnf_tag_data_t *tnf_int16_tag_data = NULL; -tnf_tag_data_t *tnf_uint16_tag_data = NULL; -tnf_tag_data_t *tnf_int32_tag_data = NULL; -tnf_tag_data_t *tnf_uint32_tag_data = NULL; -tnf_tag_data_t *tnf_int64_tag_data = NULL; -tnf_tag_data_t *tnf_uint64_tag_data = NULL; -tnf_tag_data_t *tnf_float32_tag_data = NULL; -tnf_tag_data_t *tnf_float64_tag_data = NULL; -tnf_tag_data_t *tnf_array_tag_data = NULL; -tnf_tag_data_t *tnf_string_tag_data = NULL; -tnf_tag_data_t *tnf_type_array_tag_data = NULL; -tnf_tag_data_t *tnf_name_array_tag_data = NULL; -tnf_tag_data_t *tnf_derived_tag_data = NULL; -tnf_tag_data_t *tnf_align_tag_data = NULL; -tnf_tag_data_t *tnf_derived_base_tag_data = NULL; -tnf_tag_data_t *tnf_element_type_tag_data = NULL; -tnf_tag_data_t *tnf_header_size_tag_data = NULL; -tnf_tag_data_t *tnf_name_tag_data = NULL; -tnf_tag_data_t *tnf_opaque_tag_data = NULL; -tnf_tag_data_t *tnf_properties_tag_data = NULL; -tnf_tag_data_t *tnf_self_size_tag_data = NULL; -tnf_tag_data_t *tnf_size_tag_data = NULL; -tnf_tag_data_t *tnf_slot_names_tag_data = NULL; -tnf_tag_data_t *tnf_slot_types_tag_data = NULL; -tnf_tag_data_t *tnf_tag_tag_data = NULL; -tnf_tag_data_t *tnf_tag_arg_tag_data = NULL; -tnf_tag_data_t *tnf_type_size_tag_data = NULL; -tnf_tag_data_t *tnf_struct_tag_data = NULL; -tnf_tag_data_t *tnf_file_header_tag_data = NULL; -tnf_tag_data_t *tnf_block_header_tag_data = NULL; -tnf_tag_data_t *tnf_type_tag_data = NULL; -tnf_tag_data_t *tnf_array_type_tag_data = NULL; -tnf_tag_data_t *tnf_derived_type_tag_data = NULL; -tnf_tag_data_t *tnf_scalar_type_tag_data = NULL; -tnf_tag_data_t *tnf_struct_type_tag_data = NULL; - -/* tnf_trace module */ -tnf_tag_data_t *tnf_probe_event_tag_data = NULL; -tnf_tag_data_t *tnf_time_base_tag_data = NULL; -tnf_tag_data_t *tnf_time_delta_tag_data = NULL; -tnf_tag_data_t *tnf_pid_tag_data = NULL; -tnf_tag_data_t *tnf_lwpid_tag_data = NULL; -tnf_tag_data_t *tnf_kthread_id_tag_data = NULL; -tnf_tag_data_t *tnf_cpuid_tag_data = NULL; -tnf_tag_data_t *tnf_device_tag_data = NULL; -tnf_tag_data_t *tnf_symbol_tag_data = NULL; -tnf_tag_data_t *tnf_symbols_tag_data = NULL; -tnf_tag_data_t *tnf_sysnum_tag_data = NULL; -tnf_tag_data_t *tnf_microstate_tag_data = NULL; -tnf_tag_data_t *tnf_offset_tag_data = NULL; -tnf_tag_data_t *tnf_fault_type_tag_data = NULL; -tnf_tag_data_t *tnf_seg_access_tag_data = NULL; -tnf_tag_data_t *tnf_bioflags_tag_data = NULL; -tnf_tag_data_t *tnf_diskaddr_tag_data = NULL; -tnf_tag_data_t *tnf_kernel_schedule_tag_data = NULL; - -tnf_tag_data_t *tnf_probe_type_tag_data = NULL; - -/* Exported properties */ -tnf_tag_data_t ***tnf_user_struct_properties = NULL; - -/* - * tnf_thread_create() - * Called from thread_create() to initialize thread's tracing state. - * XXX Do this when tracing is first turned on - */ - -void -tnf_thread_create(kthread_t *t) -{ - /* If the allocation fails, this thread doesn't trace */ - t->t_tnf_tpdp = kmem_zalloc(sizeof (tnf_ops_t), KM_NOSLEEP); - - TNF_PROBE_3(thread_create, "thread", /* CSTYLED */, - tnf_kthread_id, tid, t, - tnf_pid, pid, ttoproc(t)->p_pid, - tnf_symbol, start_pc, t->t_startpc); -} - -/* - * tnf_thread_exit() - * Called from thread_exit() and lwp_exit() if thread has a tpdp. - * From this point on, we're off the allthreads list - */ - -void -tnf_thread_exit(void) -{ - tnf_ops_t *ops; - tnf_block_header_t *block; - - TNF_PROBE_0(thread_exit, "thread", /* CSTYLED */); - /* LINTED pointer cast may result in improper alignment */ - ops = (tnf_ops_t *)curthread->t_tnf_tpdp; - /* - * Mark ops as busy from now on, so it will never be used - * again. If we fail on the busy lock, the buffer - * deallocation code is cleaning our ops, so we don't need to - * do anything. If we get the lock and the buffer exists, - * release all blocks we hold. Once we're off allthreads, - * the deallocator will not examine our ops. - */ - if (ops->busy) - return; - LOCK_INIT_HELD(&ops->busy); - if (tnf_buf != NULL) { - /* Release any A-locks held */ - block = ops->wcb.tnfw_w_pos.tnfw_w_block; - ops->wcb.tnfw_w_pos.tnfw_w_block = NULL; - if (block != NULL) - lock_clear(&block->A_lock); - block = ops->wcb.tnfw_w_tag_pos.tnfw_w_block; - ops->wcb.tnfw_w_tag_pos.tnfw_w_block = NULL; - if (block != NULL) - lock_clear(&block->A_lock); - } -} - -/* - * Called from thread_free() if thread has tpdp. - */ - -void -tnf_thread_free(kthread_t *t) -{ - tnf_ops_t *ops; - /* LINTED pointer cast may result in improper alignment */ - ops = (tnf_ops_t *)t->t_tnf_tpdp; - t->t_tnf_tpdp = NULL; - kmem_free(ops, sizeof (*ops)); -} - -/* - * tnf_thread_queue() - * Probe wrapper called when tracing is enabled and a thread is - * placed on some dispatch queue. - */ - -void -tnf_thread_queue(kthread_t *t, cpu_t *cp, pri_t tpri) -{ - TNF_PROBE_4(thread_queue, "dispatcher", /* CSTYLED */, - tnf_kthread_id, tid, t, - tnf_cpuid, cpuid, cp->cpu_id, - tnf_long, priority, tpri, - tnf_ulong, queue_length, - /* cp->cpu_disp->disp_q[tpri].dq_sruncnt */ - cp->cpu_disp->disp_nrunnable); - - TNF_PROBE_2(thread_state, "thread", /* CSTYLED */, - tnf_kthread_id, tid, t, - tnf_microstate, state, LMS_WAIT_CPU); -} - -/* - * pcstack(): fill in, NULL-terminate and return pc stack. - */ - -static pc_t * -pcstack(pc_t *pcs) -{ - uint_t n; - - n = getpcstack(pcs, TNF_PC_COUNT); - pcs[n] = 0; - return (pcs); -} - -/* - * tnf_thread_switch() - * Probe wrapper called when tracing enabled and curthread is about to - * switch to the next thread. - * XXX Simple sleepstate and runstate calculations - */ - -#define SLPSTATE(t, ts) \ - (((ts) == TS_STOPPED) ? LMS_STOPPED : \ - ((t)->t_wchan0 ? LMS_USER_LOCK : LMS_SLEEP)) - -#define RUNSTATE(next, lwp) \ - ((((lwp = ttolwp(next)) != NULL) && \ - lwp->lwp_state == LWP_USER) ? \ - LMS_USER : LMS_SYSTEM) - -void -tnf_thread_switch(kthread_t *next) -{ - kthread_t *t; - klwp_t *lwp; - caddr_t ztpdp; - int borrow; - uint_t ts; - pc_t pcs[TNF_PC_COUNT + 1]; - - t = curthread; - ts = t->t_state; - - /* - * If we're a zombie, borrow idle thread's tpdp. This lets - * the driver decide whether the buffer is busy by examining - * allthreads (idle threads are always on the list). - */ - if ((borrow = (ts == TS_ZOMB)) != 0) { - ztpdp = t->t_tnf_tpdp; - t->t_tnf_tpdp = CPU->cpu_idle_thread->t_tnf_tpdp; - goto do_next; - } - - /* - * If we're blocked, test the blockage probe - */ - if (ts == TS_SLEEP && t->t_wchan) -#if defined(__sparc) - TNF_PROBE_2(thread_block, "synch", /* CSTYLED */, - tnf_opaque, reason, t->t_wchan, - tnf_symbols, stack, (pc_t *)pcstack(pcs)); -#else /* defined(__sparc) */ - TNF_PROBE_2(thread_block, "synch", /* CSTYLED */, - tnf_opaque, reason, t->t_wchan, - tnf_symbols, stack, (tnf_opaque_t *)pcstack(pcs)); -#endif /* defined(__sparc) */ - - /* - * Record outgoing thread's state - * Kernel thread ID is implicit in schedule record - * supress lint: cast from 32-bit integer to 8-bit integer - * tnf_microstate_t = tnf_uint8_t - */ -#if defined(_LP64) - /* LINTED */ - TNF_PROBE_1(thread_state, "thread", /* CSTYLED */, - tnf_microstate, state, SLPSTATE(t, ts)); -#else - TNF_PROBE_1(thread_state, "thread", /* CSTYLED */, - tnf_microstate, state, SLPSTATE(t, ts)); -#endif - -do_next: - /* - * Record incoming thread's state - * - * supress lint: cast from 32-bit integer to 8-bit integer - * tnf_microstate_t = tnf_uint8_t - */ -#if defined(_LP64) - /* LINTED */ - TNF_PROBE_2(thread_state, "thread", /* CSTYLED */, - tnf_kthread_id, tid, next, - tnf_microstate, state, RUNSTATE(next, lwp)); -#else - TNF_PROBE_2(thread_state, "thread", /* CSTYLED */, - tnf_kthread_id, tid, next, - tnf_microstate, state, RUNSTATE(next, lwp)); -#endif - - /* - * If we borrowed idle thread's tpdp above, restore the zombies - * tpdp so that it will be freed from tnf_thread_free(). - */ - if (borrow) - t->t_tnf_tpdp = ztpdp; - -} - -#endif /* NPROBE */ - -/* - * tnf_mod_load (and tnf_mod_unload), when called from a client module's _init - * (and _fini) entry points are insufficient mechanisms for maintaining the - * consistency of __tnf_probe_list_head and __tnf_tag_list_head whenever that - * module is loaded or unloaded. The problem occurs because loading a module, - * at which time the modules probes are linked into the two lists, and - * installing that module are separate operations. This means that it is - * possible for a module to be loaded, not installed, and unloaded without - * calling _init and _fini. If the module contains TNF probes, the probe and - * tag lists will contain references to data addresses freed when the module - * is unloaded. - * - * The implemented solution for maintaining the lists is to perform the - * unsplicing when the module is unloaded. (Splicing into the lists, "probe - * discovery", is done when krtld processes relocation references when it - * loads the module; this information is not available for subsequent - * operations on the module. - */ -int -tnf_mod_load() -{ - return (0); -} - -/* ARGSUSED */ -int -tnf_mod_unload(struct modlinkage *mlp) -{ - return (0); -} diff --git a/usr/src/uts/common/tnf/tnf_trace.c b/usr/src/uts/common/tnf/tnf_trace.c deleted file mode 100644 index 352fc8156a..0000000000 --- a/usr/src/uts/common/tnf/tnf_trace.c +++ /dev/null @@ -1,298 +0,0 @@ -/* - * 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 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 1994, 2003 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -#include <sys/types.h> -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/ddi.h> /* strchr */ -#include <sys/sunddi.h> /* strchr */ -#include <sys/tnf_com.h> -#include <sys/tnf_writer.h> -#include <sys/tnf_probe.h> -#include <sys/debug.h> - -#include "tnf_buf.h" -#include "tnf_types.h" -#include "tnf_trace.h" - -/* - * New derived types for probes - */ - -TNF_STD_DERIVED_TAG(tnf_probe_event, tnf_tag, - tnf_derived_properties, TNF_OPAQUE); - -TNF_STD_DERIVED_TAG(tnf_time_base, tnf_int64, - tnf_derived_properties, TNF_INT64); - -TNF_STD_DERIVED_TAG(tnf_time_delta, tnf_uint32, - tnf_derived_properties, TNF_UINT32); - -TNF_STD_DERIVED_TAG(tnf_pid, tnf_int32, - tnf_derived_properties, TNF_INT32); - -TNF_STD_DERIVED_TAG(tnf_lwpid, tnf_uint32, - tnf_derived_properties, TNF_UINT32); - -TNF_STD_DERIVED_TAG(tnf_kthread_id, tnf_opaque, - tnf_derived_properties, TNF_OPAQUE); - -TNF_STD_DERIVED_TAG(tnf_cpuid, tnf_int32, - tnf_derived_properties, TNF_INT32); - -TNF_STD_DERIVED_TAG(tnf_device, tnf_ulong, - tnf_derived_properties, TNF_ULONG); - -TNF_STD_DERIVED_TAG(tnf_symbol, tnf_opaque, - tnf_derived_properties, TNF_OPAQUE); - -TNF_STD_ARRAY_TAG(tnf_symbols, tnf_symbol, TNF_ARRAY); - -TNF_STD_DERIVED_TAG(tnf_sysnum, tnf_int16, - tnf_derived_properties, TNF_INT32); - -TNF_STD_DERIVED_TAG(tnf_microstate, tnf_int32, - tnf_derived_properties, TNF_INT32); - -TNF_STD_DERIVED_TAG(tnf_offset, tnf_int64, - tnf_derived_properties, TNF_INT64); - -TNF_STD_DERIVED_TAG(tnf_fault_type, tnf_int32, - tnf_derived_properties, TNF_INT32); - -TNF_STD_DERIVED_TAG(tnf_seg_access, tnf_int32, - tnf_derived_properties, TNF_INT32); - -TNF_STD_DERIVED_TAG(tnf_bioflags, tnf_int32, - tnf_derived_properties, TNF_INT32); - -TNF_STD_DERIVED_TAG(tnf_diskaddr, tnf_int64, - tnf_derived_properties, TNF_INT64); - -static char *kernel_schedule_slot_names[] = { - TNF_N_TAG, - TNF_N_TID, - TNF_N_LWPID, - TNF_N_PID, - TNF_N_TIME_BASE, - "cpuid", /* XXX */ - 0}; - -static tnf_tag_data_t **kernel_schedule_slots[] = { - &TAG_DATA(tnf_tag), - &TAG_DATA(tnf_kthread_id), - &TAG_DATA(tnf_lwpid), - &TAG_DATA(tnf_pid), - &TAG_DATA(tnf_time_base), - &TAG_DATA(tnf_cpuid), - 0}; - -TNF_STD_STRUCT_TAG(tnf_kernel_schedule, - kernel_schedule_slots, - kernel_schedule_slot_names, - sizeof (tnf_schedule_prototype_t)); - -/* - * Probe type record (metatag) - */ - -static tnf_tag_data_t **probe_type_slots[] = { - &TAG_DATA(tnf_tag), - &TAG_DATA(tnf_name), - &TAG_DATA(tnf_properties), - &TAG_DATA(tnf_slot_types), - &TAG_DATA(tnf_type_size), - &TAG_DATA(tnf_slot_names), - &TAG_DATA(tnf_string), /* detail */ - 0}; - -TNF_METATAG(tnf_probe_type, tnf_type_properties, - probe_type_slots, tnf_struct_tag_1); - -/* - * Write a kernel schedule record - * Can only be written in reusable data space. - */ - -tnf_record_p -tnf_kernel_schedule(tnf_ops_t *ops, tnf_schedule_t *sched) -{ - tnf_tag_data_t *metatag_data; - tnf_record_p metatag_index; - tnf_schedule_prototype_t *buffer; - kthread_t *t; - - t = curthread; - - /* Cannot be called when writing into tag space */ - ASSERT(ops->mode == TNF_ALLOC_REUSABLE); - - ALLOC(ops, sizeof (*buffer), buffer, sched->record_p, - TNF_ALLOC_REUSABLE); /* XXX see comment above */ - - metatag_data = TAG_DATA(tnf_kernel_schedule); - metatag_index = metatag_data->tag_index ? - metatag_data->tag_index : - metatag_data->tag_desc(ops, metatag_data); - - ASSIGN(buffer, tag, metatag_index); - ASSIGN2(buffer, tid, t, kthread_id); - ASSIGN(buffer, lwpid, t->t_tid); - ASSIGN(buffer, pid, ttoproc(t)->p_pid); - ASSIGN(buffer, time_base, sched->time_base); - ASSIGN(buffer, cpuid, sched->cpuid); - - /* - * Remember schedule record generation number so the distance - * in virtual space can be calculated from an event record - */ - sched->record_gen = ((tnf_block_header_t *) - ((uintptr_t)buffer & TNF_BLOCK_MASK))->generation; - /* Cannot have been written into tag space */ - ASSERT(sched->record_gen != TNF_TAG_GENERATION_NUM); - - return ((tnf_record_p)buffer); -} - -/* - * Array of addresses and derivatives - */ - -tnf_reference_t -tnf_opaque_array_1(tnf_ops_t *ops, tnf_opaque_t *opaques, - tnf_record_p reference, tnf_tag_data_t *tag_data) -{ - tnf_record_p tag_index; - size_t record_size; - tnf_opaque_t *tmp; - tnf_opaque_t *ref_p; - tnf_array_header_t *bufhdr; - - tag_index = tag_data->tag_index ? tag_data->tag_index : - tag_data->tag_desc(ops, tag_data); - - if (!opaques) - return (TNF_NULL); - - record_size = sizeof (*bufhdr); - tmp = opaques; - while (*tmp++) - record_size += sizeof (*ref_p); - - ALLOC2(ops, record_size, bufhdr, ops->mode); - - ASSIGN(bufhdr, tag, tag_index); - /* LINTED assignment of 64-bit integer to 32-bit integer */ - ASSIGN(bufhdr, self_size, record_size); - - tmp = opaques; - /* LINTED pointer cast may result in improper alignment */ - ref_p = (tnf_opaque_t *)((char *)bufhdr + sizeof (*bufhdr)); - while (*tmp) { - *ref_p = tnf_opaque(ops, *tmp, (tnf_reference_t *)ref_p); - tmp++; - ref_p++; - } - - return (tnf_ref32(ops, (tnf_record_p) bufhdr, reference)); -} - -#ifdef __sparc - -tnf_reference_t -tnf_opaque32_array_1(tnf_ops_t *ops, tnf_uint32_t *opaques, - tnf_record_p reference, tnf_tag_data_t *tag_data) -{ - tnf_record_p tag_index; - size_t record_size; - tnf_uint32_t *tmp; - tnf_uint32_t *ref_p; - tnf_array_header_t *bufhdr; - - tag_index = tag_data->tag_index ? tag_data->tag_index : - tag_data->tag_desc(ops, tag_data); - - if (!opaques) - return (TNF_NULL); - - record_size = sizeof (*bufhdr); - tmp = opaques; - while (*tmp++) - record_size += sizeof (*ref_p); - - ALLOC2(ops, record_size, bufhdr, ops->mode); - - ASSIGN(bufhdr, tag, tag_index); - /* LINTED assignment of 64-bit integer to 32-bit integer */ - ASSIGN(bufhdr, self_size, record_size); - - tmp = opaques; - /* LINTED pointer cast may result in improper alignment */ - ref_p = (tnf_uint32_t *)((char *)bufhdr + sizeof (*bufhdr)); - while (*tmp) { - *ref_p = tnf_uint32(ops, *tmp, (tnf_reference_t *)ref_p); - tmp++; - ref_p++; - } - - return (tnf_ref32(ops, (tnf_record_p) bufhdr, reference)); -} - -#endif /* __sparc */ - -/* - * Tag initializer - */ - -void -tnf_tag_trace_init(void) -{ - - TAG_SNAP(tnf_probe_event); - TAG_SNAP(tnf_time_base); - TAG_SNAP(tnf_time_delta); - TAG_SNAP(tnf_pid); - TAG_SNAP(tnf_lwpid); - - TAG_SNAP(tnf_kthread_id); - TAG_SNAP(tnf_cpuid); - TAG_SNAP(tnf_device); - TAG_SNAP(tnf_symbol); - TAG_SNAP(tnf_symbols); - TAG_SNAP(tnf_sysnum); - TAG_SNAP(tnf_microstate); - TAG_SNAP(tnf_offset); - TAG_SNAP(tnf_fault_type); - TAG_SNAP(tnf_seg_access); - TAG_SNAP(tnf_bioflags); - TAG_SNAP(tnf_diskaddr); - TAG_SNAP(tnf_kernel_schedule); - - TAG_SNAP(tnf_probe_type); - -} diff --git a/usr/src/uts/common/tnf/tnf_trace.h b/usr/src/uts/common/tnf/tnf_trace.h deleted file mode 100644 index 13b7a8b98c..0000000000 --- a/usr/src/uts/common/tnf/tnf_trace.h +++ /dev/null @@ -1,159 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#ifndef _TNF_TRACE_H -#define _TNF_TRACE_H - -#pragma ident "%Z%%M% %I% %E% SMI" - -#include <sys/types.h> -#include <sys/time.h> -#include <sys/tnf_probe.h> -#include <sys/thread.h> -#include <sys/processor.h> - -#include "tnf_buf.h" -#include "tnf_types.h" - -/* - * Minimum and default size of trace file - */ - -#define TNF_TRACE_FILE_MIN (128 * 1024) -#define TNF_TRACE_FILE_DEFAULT (1 * 1024 * 1024) - -/* - * Specification of index field of probe control block - */ - -#define PROBE_INDEX_TYPE_MASK 0x3 -#define PROBE_INDEX_MEM_PTR 0x0 /* index is a normal memory ptr */ -#define PROBE_INDEX_FILE_PTR 0x1 /* index is a file abs ptr */ -#define PROBE_INDEX_LOW_MASK 0xffff0000 -#define PROBE_INDEX_SHIFT 16 - -#define PROBE_IS_FILE_PTR(x) \ - (((x) & PROBE_INDEX_TYPE_MASK) == PROBE_INDEX_FILE_PTR) - -#define ATTR_SEPARATOR ';' -#define VAL_SEPARATOR ' ' - -/* - * Flags in proc struct - */ -#define PROC_F_FILTER 0x1 - -#define PROC_IS_FILTER(pp) ((pp)->p_tnf_flags & PROC_F_FILTER) -#define PROC_FILTER_SET(pp) ((pp)->p_tnf_flags |= PROC_F_FILTER) -#define PROC_FILTER_CLR(pp) ((pp)->p_tnf_flags &= ~PROC_F_FILTER) - -/* - * In-memory scheduling info, maintained per thread - */ - -typedef struct { - tnf_record_p record_p; - tnf_uint32_t record_gen; - hrtime_t time_base; - processorid_t cpuid; -} tnf_schedule_t; - -/* - * Per-thread tracing operations and state - */ - -struct _tnf_ops { - char mode; /* allocation mode */ - tnf_byte_lock_t busy; /* currently in a probe */ - TNFW_B_WCB wcb; /* write control info */ - tnf_schedule_t schedule; /* scheduling info */ -}; - -/* - * File layout of a kernel schedule record - */ - -typedef struct { - tnf_tag_t tag; - tnf_kthread_id_t tid; - tnf_lwpid_t lwpid; - tnf_pid_t pid; - /* - * time base should be on a double word boundary to avoid pads - */ - tnf_time_base_t time_base; - tnf_cpuid_t cpuid; -} tnf_schedule_prototype_t; - -/* - * File layout of a probe (event tag) record - */ - -typedef struct { - tnf_tag_t tag; - tnf_name_t name; - tnf_properties_t properties; - tnf_slot_types_t slot_types; - tnf_type_size_t type_size; - tnf_slot_names_t slot_names; - tnf_string_t string; /* XXX detail */ -} tnf_probe_prototype_t; - -/* - * Tag data variables - */ - -extern tnf_tag_data_t *tnf_probe_type_tag_data; -extern tnf_tag_data_t *tnf_kernel_schedule_tag_data; - -/* - * - */ - -extern size_t tnf_trace_file_size; - -/* - * Function prototypes - */ - -/* Encoder functions */ - -tnf_record_p tnf_kernel_schedule(tnf_ops_t *, tnf_schedule_t *); -uintptr_t tnf_probe_tag(tnf_ops_t *, tnf_probe_control_t *); - -/* Trace functions */ - -void *tnf_trace_alloc(tnf_ops_t *, tnf_probe_control_t *, tnf_probe_setup_t *); - -void tnf_trace_commit(tnf_probe_setup_t *); -void tnf_trace_rollback(tnf_probe_setup_t *); - -/* Trace control functions */ - -void tnf_trace_init(void); -void tnf_trace_on(void); -void tnf_trace_off(void); - -#endif /* _TNF_TRACE_H */ diff --git a/usr/src/uts/common/tnf/tnf_types.h b/usr/src/uts/common/tnf/tnf_types.h deleted file mode 100644 index 69e8e0c132..0000000000 --- a/usr/src/uts/common/tnf/tnf_types.h +++ /dev/null @@ -1,442 +0,0 @@ -/* - * 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 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 (c) 1994,1998 by Sun Microsystems, Inc. - * All rights reserved. - */ - -#ifndef _TNF_TYPES_H -#define _TNF_TYPES_H - -#pragma ident "%Z%%M% %I% %E% SMI" - -#include <sys/types.h> -#ifdef _KERNEL -#include <sys/tnf_com.h> -#include <sys/tnf_writer.h> -#include <sys/tnf_probe.h> -#include "tnf_buf.h" -#else /* _KERNEL */ -#include <tnf/com.h> -#include <tnf/writer.h> -#include <tnf/probe.h> -#endif /* _KERNEL */ - -#ifdef __cplusplus -extern "C" { -#endif - -extern struct tnf_probe_version __tnf_probe_version_1_info; - -/* - * Defines - */ - -#define TAG_DATA(type) type##_tag_data -#define _TAG_DATA(type) _##type##_tag_data - -#define TAG_SNAP(type) TAG_DATA(type) = &_TAG_DATA(type) -#define TAG_EXPORT(type) tnf_tag_data_t *TAG_SNAP(type) - -/* - * String limits - */ - -/* XXX tie into TNF_BLOCK_SIZE */ -#define TNF_STRING_LIMIT 255 /* excludes terminating NUL */ -#define TNF_STRING_ROUNDUP(sz) (((sz) + 3) & ~3) - -/* - * XXX Semi-private - */ - -#ifdef _KERNEL - -#define TAG_SET(type) TAG_SNAP(type) -#define BUF_ALLOC(ops) tnfw_b_alloc - -#else /* _KERNEL */ - -#define TAG_SET(type) TAG_EXPORT(type) -#define BUF_ALLOC(ops) ops->alloc - -#endif /* _KERNEL */ - -#define ASSIGN(buf, slot, val) \ - buf->slot = tnf_##slot(ops, val, (tnf_record_p) &buf->slot) - -#define ASSIGN2(buf, slot, val, func) \ - buf->slot = tnf_##func(ops, val, (tnf_record_p)&buf->slot) - -#define ALLOC(ops, size, mem, index_p, saved_mode) \ - mem = BUF_ALLOC(ops)(&(ops->wcb), size, ops->mode); \ - if (mem == TNF_NULL) { \ - ops->mode = saved_mode; \ - return (TNF_NULL); \ - } \ - index_p = (tnf_record_p)mem - -#define ALLOC2(ops, size, mem, saved_mode) \ - mem = BUF_ALLOC(ops)(&(ops->wcb), size, ops->mode); \ - if (mem == TNF_NULL) { \ - ops->mode = saved_mode; \ - return (TNF_NULL); \ - } - -/* - * NOTE: These macros DO NOT export the tags. In the kernel, tag data - * pointers are initialized to NULL in tnf_res.c, and are snapped by - * tnf_tag_XXX_init() when the driver is loaded. In user land - * they are exported by another macro. - */ - -/* - * Initializing abstract tags - */ - -#define TNF_ABSTRACT_TAG(type) \ -static tnf_tag_data_t _TAG_DATA(type) = { \ - TNF_TAG_VERSION, \ - &tnf_abstract_tag_1, \ - 0, \ - TNF_STRINGIFY(type) } - -/* - * Initializing scalar tags - */ - -#define TNF_SCALAR_TAG(type, size, align, kind) \ -static tnf_tag_data_t _TAG_DATA(type) = { \ - TNF_TAG_VERSION, \ - &tnf_scalar_tag_1, \ - 0, \ - TNF_STRINGIFY(type), \ - &tnf_scalar_properties, \ - size, \ - align, \ - size, \ - kind } - -#define TNF_STD_SCALAR_TAG(type, kind) \ - TNF_SCALAR_TAG(type, sizeof (type##_t), \ - TNF_ALIGN(type##_t), kind) - -/* - * Initializing array tags - * Assumes all arrays are `records' - */ - -#define TNF_ARRAY_TAG(type, eltag, props, slots, kind) \ -static tnf_tag_data_t _TAG_DATA(type) = { \ - TNF_TAG_VERSION, \ - &tnf_array_tag_1, \ - 0, \ - TNF_STRINGIFY(type), \ - &props, \ - ARRAY_HDR_SIZE, \ - TNF_ALIGN(tnf_ref32_t), \ - sizeof (tnf_ref32_t), \ - kind, \ - eltag, \ - slots } - -#define TNF_STD_ARRAY_TAG(type, eltype, kind) \ - TNF_ARRAY_TAG(type, &TAG_DATA(eltype), \ - tnf_array_properties, tnf_array_slots, kind) - -/* - * Initializing derived tags - */ - -#define TNF_DERIVED_TAG(type, basetag, props, size, align, kind) \ -static tnf_tag_data_t _TAG_DATA(type) = { \ - TNF_TAG_VERSION, \ - &tnf_derived_tag_1, \ - 0, \ - TNF_STRINGIFY(type), \ - &props, \ - 0, \ - align, \ - size, \ - kind, \ - basetag } - -#define TNF_STD_DERIVED_TAG(type, base, props, kind) \ - TNF_DERIVED_TAG(type, &TAG_DATA(base), props, \ - sizeof (type##_t), TNF_ALIGN(type##_t), kind) - -/* - * Initializing structure tags - * Assumes all structs are `records' - */ - -#define TNF_STRUCT_TAG(type, props, slots, names, size) \ -static tnf_tag_data_t _TAG_DATA(type) = { \ - TNF_TAG_VERSION, \ - &tnf_struct_tag_1, \ - 0, \ - TNF_STRINGIFY(type), \ - &props, \ - size, \ - TNF_ALIGN(tnf_ref32_t), \ - sizeof (tnf_ref32_t), \ - TNF_STRUCT, \ - 0, \ - slots, \ - names } - -#define TNF_STD_STRUCT_TAG(type, slots, names, size) \ - TNF_STRUCT_TAG(type, tnf_struct_properties, slots, names, size) - -/* - * Initializing metatags - * Size is initialized assuming NULL-terminated array of words and - * each element has a reference size of one word. - */ - -#define TNF_METATAG(type, props, slots, desc) \ -static tnf_tag_data_t _TAG_DATA(type) = { \ - TNF_TAG_VERSION, \ - &desc, \ - 0, \ - TNF_STRINGIFY(type), \ - &props, \ - (sizeof (slots) - sizeof (slots[0])) * \ - (sizeof (tnf_uint32_t))/(sizeof (char *)), \ - TNF_ALIGN(tnf_ref32_t), \ - sizeof (tnf_ref32_t), \ - TNF_STRUCT, \ - 0, \ - slots, \ - 0 } - -/* - * TNF internal types - */ - -extern tnf_tag_data_t *tnf_tag_arg_tag_data; -typedef tnf_ref32_t tnf_tag_arg_t; /* tag qualifier */ - -extern tnf_tag_data_t *tnf_inline_tag_data; /* abstract */ - -extern tnf_tag_data_t *tnf_tagged_tag_data; /* abstract */ - -extern tnf_tag_data_t *tnf_scalar_tag_data; /* abstract scalar */ - -extern tnf_tag_data_t *tnf_array_tag_data; /* abstract array */ - -extern tnf_tag_data_t *tnf_derived_tag_data; /* abstract derived */ - -extern tnf_tag_data_t *tnf_derived_base_tag_data; -typedef tnf_reference_t tnf_derived_base_t; -#define tnf_derived_base(ops, item, ref)\ - tnf_tag_element_1(ops, item, ref, tnf_derived_base_tag_data) - -extern tnf_tag_data_t *tnf_element_type_tag_data; -typedef tnf_reference_t tnf_element_type_t; -#define tnf_element_type(ops, item, ref)\ - tnf_tag_element_1(ops, item, ref, tnf_element_type_tag_data) - -extern tnf_tag_data_t *tnf_type_array_tag_data; -typedef tnf_reference_t tnf_type_array_t; -#define tnf_type_array(ops, item, ref) \ - tnf_tag_array_1(ops, item, ref, tnf_type_array_tag_data) - -extern tnf_tag_data_t *tnf_slot_types_tag_data; -typedef tnf_type_array_t tnf_slot_types_t; -#define tnf_slot_types(ops, item, ref) \ - tnf_tag_array_1(ops, item, ref, tnf_slot_types_tag_data) - -extern tnf_tag_data_t *tnf_properties_tag_data; -typedef tnf_type_array_t tnf_properties_t; -#define tnf_properties(ops, item, ref) \ - tnf_tag_properties_1(ops, item, ref, tnf_properties_tag_data) - -extern tnf_tag_data_t *tnf_name_array_tag_data; -typedef tnf_reference_t tnf_name_array_t; -#define tnf_name_array(ops, item, ref) \ - tnf_string_array_1(ops, item, ref, tnf_name_array_tag_data) - -extern tnf_tag_data_t *tnf_slot_names_tag_data; -typedef tnf_name_array_t tnf_slot_names_t; -#define tnf_slot_names(ops, item, ref) \ - tnf_string_array_1(ops, item, ref, tnf_slot_names_tag_data) - -extern tnf_tag_data_t *tnf_align_tag_data; -typedef tnf_uint32_t tnf_align_t; -#define tnf_align(ops, item, ref) \ - tnf_uint32(ops, item, ref) - -extern tnf_tag_data_t *tnf_self_size_tag_data; -typedef tnf_uint32_t tnf_self_size_t; -#define tnf_self_size(ops, item, ref) \ - tnf_uint32(ops, item, ref) - -extern tnf_tag_data_t *tnf_type_size_tag_data; -typedef tnf_uint32_t tnf_type_size_t; -#define tnf_type_size(ops, item, ref) \ - tnf_uint32(ops, item, ref) - -extern tnf_tag_data_t *tnf_header_size_tag_data; -typedef tnf_uint32_t tnf_header_size_t; -#define tnf_header_size(ops, item, ref) \ - tnf_uint32(ops, item, ref) - -extern tnf_tag_data_t *tnf_struct_tag_data; /* abstract struct */ - -extern tnf_tag_data_t *tnf_type_tag_data; /* abstract type */ - -extern tnf_tag_data_t *tnf_scalar_type_tag_data; - -extern tnf_tag_data_t *tnf_derived_type_tag_data; - -extern tnf_tag_data_t *tnf_array_type_tag_data; - -extern tnf_tag_data_t *tnf_struct_type_tag_data; - -/* - * Concrete struct types - */ - -extern tnf_tag_data_t *tnf_file_header_tag_data; - -extern tnf_tag_data_t *tnf_block_header_tag_data; - -/* - * Exported slots - */ - -extern tnf_tag_data_t **tnf_array_slots[]; - -/* - * Exported properties - */ - -extern tnf_tag_data_t ***tnf_no_properties; -extern tnf_tag_data_t ***tnf_scalar_properties; -extern tnf_tag_data_t ***tnf_array_properties; -extern tnf_tag_data_t ***tnf_derived_properties; -extern tnf_tag_data_t ***tnf_struct_properties; -extern tnf_tag_data_t ***tnf_type_properties; - -/* - * Binary layout of standard array header - */ - -typedef struct { - tnf_tag_t tag; - tnf_self_size_t self_size; -} tnf_array_header_t; - -#define ARRAY_HDR_SIZE sizeof (tnf_array_header_t) - -/* - * Binary layouts of TNF tags - */ - -typedef struct { - tnf_tag_t tag; - tnf_name_t name; - tnf_properties_t properties; -} tnf_type_prototype_t; - -typedef struct { - tnf_tag_t tag; - tnf_name_t name; - tnf_properties_t properties; - tnf_type_size_t type_size; - tnf_align_t align; -} tnf_scalar_type_prototype_t; - -typedef struct { - tnf_tag_t tag; - tnf_name_t name; - tnf_properties_t properties; - tnf_derived_base_t derived_base; -} tnf_derived_type_prototype_t; - -typedef struct { - tnf_tag_t tag; - tnf_name_t name; - tnf_properties_t properties; - tnf_slot_types_t slot_types; - tnf_header_size_t header_size; - tnf_element_type_t element_type; -} tnf_array_type_prototype_t; - -typedef struct { - tnf_tag_t tag; - tnf_name_t name; - tnf_properties_t properties; - tnf_slot_types_t slot_types; - tnf_type_size_t type_size; - tnf_slot_names_t slot_names; -} tnf_struct_type_prototype_t; - -/* - * Data encoders - */ - -extern tnf_reference_t tnf_tag_element_1(tnf_ops_t *, - tnf_tag_data_t **, - tnf_record_p, - tnf_tag_data_t *); - -extern tnf_reference_t tnf_tag_array_1(tnf_ops_t *, - tnf_tag_data_t ***, - tnf_record_p, - tnf_tag_data_t *); - -extern tnf_reference_t tnf_tag_properties_1(tnf_ops_t *, - tnf_tag_data_t ****, - tnf_record_p, - tnf_tag_data_t *); - -extern tnf_reference_t tnf_string_array_1(tnf_ops_t *, - char **, - tnf_record_p, - tnf_tag_data_t *); - -/* - * Tag descriptors - */ - -extern tnf_record_p tnf_abstract_tag_1(tnf_ops_t *, tnf_tag_data_t *); -extern tnf_record_p tnf_scalar_tag_1(tnf_ops_t *, tnf_tag_data_t *); -extern tnf_record_p tnf_derived_tag_1(tnf_ops_t *, tnf_tag_data_t *); -extern tnf_record_p tnf_array_tag_1(tnf_ops_t *, tnf_tag_data_t *); - -#ifdef _KERNEL -/* - * Tag pointer initializers, called when driver loaded to snap all - * tag data pointers. - */ - -extern void tnf_tag_core_init(void); /* initialize core tags */ -extern void tnf_tag_trace_init(void); /* initialize trace tags */ -#endif /* _KERNEL */ - -#ifdef __cplusplus -} -#endif - -#endif /* _TNF_TYPES_H */ diff --git a/usr/src/uts/common/tnf/tnf_writer.c b/usr/src/uts/common/tnf/tnf_writer.c deleted file mode 100644 index 4cfb19efe5..0000000000 --- a/usr/src/uts/common/tnf/tnf_writer.c +++ /dev/null @@ -1,966 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -#ifndef DEBUG -#define NDEBUG 1 -#endif - -#ifdef _KERNEL -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/tnf_com.h> -#include <sys/tnf_writer.h> -#include <sys/debug.h> -#include "tnf_types.h" -#include "tnf_trace.h" -#else /* _KERNEL */ -#include <stdlib.h> -#include <string.h> -#include <tnf/com.h> -#include <tnf/writer.h> -#include <assert.h> -#include "tnf_types.h" -#include <tnf_trace.h> -#endif /* _KERNEL */ - -/* - * Defines - */ - -#ifdef _KERNEL -#define TNF_ASSERT(expr) ASSERT(expr) -#else -#define TNF_ASSERT(expr) assert(expr) -#endif - -/* - * Local functions - */ - -static tnf_record_p tnf_root_tag_1(tnf_ops_t *, tnf_tag_data_t *); - -/* - * TNF tag version 1 - */ - -tnf_tag_version_t __tnf_tag_version_1_info = { - sizeof (tnf_tag_version_t), - sizeof (tnf_tag_data_t) -}; - -/* - * Pure abstract types - */ - -TNF_ABSTRACT_TAG(tnf_inline); -TNF_ABSTRACT_TAG(tnf_tagged); - -/* - * Scalar types - */ - -static tnf_tag_data_t **std_scalar_properties[] = { - &TAG_DATA(tnf_inline), - &TAG_DATA(tnf_scalar), - 0}; - -tnf_tag_data_t ***tnf_scalar_properties = std_scalar_properties; - -TNF_SCALAR_TAG(tnf_scalar, 0, 0, TNF_UNKNOWN); - -TNF_STD_SCALAR_TAG(tnf_char, TNF_UNKNOWN); /* XXX */ -TNF_STD_SCALAR_TAG(tnf_int8, TNF_INT32); -TNF_STD_SCALAR_TAG(tnf_uint8, TNF_UINT32); -TNF_STD_SCALAR_TAG(tnf_int16, TNF_INT32); -TNF_STD_SCALAR_TAG(tnf_uint16, TNF_UINT32); -TNF_STD_SCALAR_TAG(tnf_int32, TNF_INT32); -TNF_STD_SCALAR_TAG(tnf_uint32, TNF_UINT32); -TNF_STD_SCALAR_TAG(tnf_int64, TNF_INT64); -TNF_STD_SCALAR_TAG(tnf_uint64, TNF_UINT64); - -TNF_STD_SCALAR_TAG(tnf_float32, TNF_FLOAT32); -TNF_STD_SCALAR_TAG(tnf_float64, TNF_FLOAT64); - -/* - * Array types - */ - -static tnf_tag_data_t **array_properties[] = { - &TAG_DATA(tnf_array), - 0 -}; -static tnf_tag_data_t ***abstract_array_properties = array_properties; - -static tnf_tag_data_t **std_array_properties[] = { - &TAG_DATA(tnf_array), - &TAG_DATA(tnf_tagged), - 0 -}; -/* Exported */ -tnf_tag_data_t ***tnf_array_properties = std_array_properties; - -/* Exported */ -tnf_tag_data_t **tnf_array_slots[] = { - &TAG_DATA(tnf_tag), - &TAG_DATA(tnf_self_size), - 0 -}; - -TNF_ARRAY_TAG(tnf_array, TNF_NULL, abstract_array_properties, - TNF_NULL, TNF_UNKNOWN); - -TNF_STD_ARRAY_TAG(tnf_string, tnf_char, TNF_STRING); -TNF_STD_ARRAY_TAG(tnf_type_array, tnf_type, TNF_ARRAY); -TNF_STD_ARRAY_TAG(tnf_name_array, tnf_name, TNF_ARRAY); - -/* - * Derived types - */ - -static tnf_tag_data_t **derived_properties[] = { - &TAG_DATA(tnf_derived), - 0 -}; -/* Exported */ -tnf_tag_data_t ***tnf_derived_properties = derived_properties; - -TNF_DERIVED_TAG(tnf_derived, TNF_NULL, - tnf_derived_properties, TNF_NULL, TNF_NULL, TNF_UNKNOWN); - -TNF_STD_DERIVED_TAG(tnf_align, tnf_uint32, - tnf_derived_properties, TNF_UINT32); - -TNF_STD_DERIVED_TAG(tnf_derived_base, tnf_type, - tnf_derived_properties, TNF_OPAQUE); - -TNF_STD_DERIVED_TAG(tnf_element_type, tnf_type, - tnf_derived_properties, TNF_OPAQUE); - -TNF_STD_DERIVED_TAG(tnf_header_size, tnf_uint32, - tnf_derived_properties, TNF_UINT32); - -TNF_STD_DERIVED_TAG(tnf_name, tnf_string, - tnf_derived_properties, TNF_STRING); - -#if defined(_LP64) - -TNF_STD_DERIVED_TAG(tnf_opaque, tnf_uint64, - tnf_derived_properties, TNF_OPAQUE); - -#else - -TNF_STD_DERIVED_TAG(tnf_opaque, tnf_uint32, - tnf_derived_properties, TNF_OPAQUE); - -#endif /* defined(_LP64) */ - -TNF_STD_DERIVED_TAG(tnf_properties, tnf_type_array, - tnf_derived_properties, TNF_ARRAY); - -TNF_STD_DERIVED_TAG(tnf_self_size, tnf_uint32, - tnf_derived_properties, TNF_UINT32); - -TNF_STD_DERIVED_TAG(tnf_size, tnf_ulong, - tnf_derived_properties, TNF_ULONG); - -TNF_STD_DERIVED_TAG(tnf_slot_names, tnf_name_array, - tnf_derived_properties, TNF_ARRAY); - -TNF_STD_DERIVED_TAG(tnf_slot_types, tnf_type_array, - tnf_derived_properties, TNF_ARRAY); - -TNF_STD_DERIVED_TAG(tnf_tag, tnf_type, - tnf_derived_properties, TNF_OPAQUE); - -TNF_STD_DERIVED_TAG(tnf_tag_arg, tnf_tagged, - tnf_derived_properties, TNF_OPAQUE); - -TNF_STD_DERIVED_TAG(tnf_type_size, tnf_uint32, - tnf_derived_properties, TNF_UINT32); - -/* - * Struct types - */ - -static tnf_tag_data_t **no_properties[] = { 0 }; -tnf_tag_data_t ***tnf_no_properties = no_properties; - -static tnf_tag_data_t **no_slots[] = { 0 }; - -static tnf_tag_data_t **std_struct_properties[] = { - &TAG_DATA(tnf_tagged), - &TAG_DATA(tnf_struct), - 0}; -/* Exported */ -tnf_tag_data_t ***tnf_struct_properties = std_struct_properties; - -TNF_STRUCT_TAG(tnf_struct, tnf_no_properties, no_slots, 0, 0); - -/* - * File header - CAUTION - has to be in sync with com.h - */ - -static char *file_header_slot_names[] = { - TNF_N_TAG, - TNF_N_FILE_VERSION, - TNF_N_FILE_HEADER_SIZE, - TNF_N_FILE_LOGICAL_SIZE, - TNF_N_BLOCK_HEADER_SIZE, - TNF_N_BLOCK_SIZE, - TNF_N_DIRECTORY_SIZE, - TNF_N_BLOCK_COUNT, - TNF_N_BLOCKS_VALID, - /* XXX add writer-specific opaque slots here for reader */ - 0}; - -static tnf_tag_data_t **file_header_slots[] = { - &TAG_DATA(tnf_tag), /* tag */ - &TAG_DATA(tnf_uint32), /* file_version */ - &TAG_DATA(tnf_uint32), /* file_header_size */ - &TAG_DATA(tnf_uint32), /* file_logical_size */ - &TAG_DATA(tnf_uint32), /* block_header_size */ - &TAG_DATA(tnf_uint32), /* block_size */ - &TAG_DATA(tnf_uint32), /* directory_size */ - &TAG_DATA(tnf_uint32), /* block_count */ - &TAG_DATA(tnf_uint32), /* blocks_valid */ - /* XXX add writer-specific opaque slots here for reader */ - 0}; - -/* size of tnf_file_header has the size of the magic number subtracted */ -TNF_STD_STRUCT_TAG(tnf_file_header, - file_header_slots, - file_header_slot_names, - sizeof (tnf_buf_file_header_t) - sizeof (tnf_uint32_t)); - -/* - * Block header - CAUTION - has to be in sync with com.h - */ - -static char *block_header_slot_names[] = { - TNF_N_TAG, - TNF_N_GENERATION, - TNF_N_BYTES_VALID, - "A_lock", /* XXX */ - "B_lock", /* XXX */ - "next_block", /* XXX */ - 0}; - -static tnf_tag_data_t **block_header_slots[] = { - &TAG_DATA(tnf_tag), /* tag */ - &TAG_DATA(tnf_uint32), /* generation */ - &TAG_DATA(tnf_uint16), /* bytes_valid */ - &TAG_DATA(tnf_uint8), /* A_lock */ - &TAG_DATA(tnf_uint8), /* B_lock */ - &TAG_DATA(tnf_opaque), /* next_block */ - 0}; - -TNF_STD_STRUCT_TAG(tnf_block_header, - block_header_slots, - block_header_slot_names, - sizeof (tnf_block_header_t)); - -/* - * Metatypes - */ - -static tnf_tag_data_t **type_properties[] = { - &TAG_DATA(tnf_tagged), - &TAG_DATA(tnf_struct), - &TAG_DATA(tnf_type), - 0}; -/* Exported */ -tnf_tag_data_t ***tnf_type_properties = type_properties; - -static tnf_tag_data_t **type_slots[] = { - &TAG_DATA(tnf_tag), - &TAG_DATA(tnf_name), - &TAG_DATA(tnf_properties), - 0}; - -TNF_METATAG(tnf_type, tnf_type_properties, type_slots, tnf_struct_tag_1); - -static tnf_tag_data_t **array_type_slots[] = { - &TAG_DATA(tnf_tag), - &TAG_DATA(tnf_name), - &TAG_DATA(tnf_properties), - &TAG_DATA(tnf_slot_types), - &TAG_DATA(tnf_header_size), - &TAG_DATA(tnf_element_type), - 0}; - -TNF_METATAG(tnf_array_type, tnf_type_properties, - array_type_slots, tnf_struct_tag_1); - -static tnf_tag_data_t **derived_type_slots[] = { - &TAG_DATA(tnf_tag), - &TAG_DATA(tnf_name), - &TAG_DATA(tnf_properties), - &TAG_DATA(tnf_derived_base), - 0}; - -TNF_METATAG(tnf_derived_type, tnf_type_properties, - derived_type_slots, tnf_struct_tag_1); - -static tnf_tag_data_t **scalar_type_slots[] = { - &TAG_DATA(tnf_tag), - &TAG_DATA(tnf_name), - &TAG_DATA(tnf_properties), - &TAG_DATA(tnf_type_size), - &TAG_DATA(tnf_align), - 0}; - -TNF_METATAG(tnf_scalar_type, tnf_type_properties, - scalar_type_slots, tnf_struct_tag_1); - -static tnf_tag_data_t **struct_type_slots[] = { - &TAG_DATA(tnf_tag), - &TAG_DATA(tnf_name), - &TAG_DATA(tnf_properties), - &TAG_DATA(tnf_slot_types), - &TAG_DATA(tnf_type_size), - &TAG_DATA(tnf_slot_names), - 0}; - -TNF_METATAG(tnf_struct_type, tnf_type_properties, - struct_type_slots, tnf_root_tag_1); - - -/* - * Generic tnf reference - does checking on whether destination is - * a permanent block or not - */ - -#ifdef _KERNEL - -/*ARGSUSED0*/ -tnf_ref32_t -tnf_ref32_1(tnf_ops_t *ops, tnf_record_p item, tnf_record_p reference) -{ - tnf_ref32_t offset_delta, gen_delta; - tnf_block_header_t *dest_header_p, *src_header_p; - tnf_ref32_t result; - unsigned int offset_shift = - /* LINTED pointer cast may result in improper alignment */ - ((tnf_buf_file_header_t *)tnf_buf)->com.file_log_size; - - dest_header_p = (tnf_block_header_t *) - ((uintptr_t)item & TNF_BLOCK_MASK); - - if (((char *)dest_header_p < (tnf_buf + TNF_DIRECTORY_SIZE)) || - (dest_header_p->generation == TNF_TAG_GENERATION_NUM)) { - /* reference to a permanent block */ - /* LINTED ast from 64-bit integer to 32-bit integer */ - offset_delta = (tnf_ref32_t)(item - tnf_buf); - - return (TNF_REF32_MAKE_PERMANENT(offset_delta)); - } else { - /* reference to a reclaimable block */ - /* LINTED ast from 64-bit integer to 32-bit integer */ - offset_delta = (tnf_ref32_t)(item - reference); - - src_header_p = (tnf_block_header_t *) - ((uintptr_t)reference & TNF_BLOCK_MASK); - gen_delta = dest_header_p->generation - - src_header_p->generation; - - result = (gen_delta << offset_shift) + offset_delta; - return (TNF_REF32_MAKE_RECLAIMABLE(result)); - } -} - -#else - -/*ARGSUSED0*/ -tnf_ref32_t -tnf_ref32_1(tnf_ops_t *ops, tnf_record_p item, tnf_record_p reference) -{ - volatile char *file_start = _tnfw_b_control->tnf_buffer; - tnf_ref32_t offset_delta, gen_delta; - tnf_block_header_t *dest_header_p, *src_header_p; - tnf_ref32_t result; - unsigned int offset_shift = - /* LINTED pointer cast may result in improper alignment */ - ((tnf_buf_file_header_t *)file_start)->com.file_log_size; - - dest_header_p = (tnf_block_header_t *) - ((uintptr_t)item & TNF_BLOCK_MASK); - - if (((char *)dest_header_p < (file_start + TNFW_B_FW_ZONE)) || - (dest_header_p->generation == TNF_TAG_GENERATION_NUM)) { - /* reference to a permanent block */ - /* LINTED ast from 64-bit integer to 32-bit integer */ - offset_delta = (tnf_ref32_t)(item - (tnf_record_p) file_start); - - return (TNF_REF32_MAKE_PERMANENT(offset_delta)); - } else { - /* reference to a reclaimable block */ - /* LINTED ast from 64-bit integer to 32-bit integer */ - offset_delta = (tnf_ref32_t)(item - reference); - - src_header_p = (tnf_block_header_t *) - ((uintptr_t)reference & TNF_BLOCK_MASK); - gen_delta = dest_header_p->generation - - src_header_p->generation; - - result = (gen_delta << offset_shift) + offset_delta; - return (TNF_REF32_MAKE_RECLAIMABLE(result)); - } -} - -#endif - -/* - * Tag descriptors - */ - -/* - * Write instances of tnf_type - */ - -tnf_record_p -tnf_abstract_tag_1(tnf_ops_t *ops, tnf_tag_data_t *tag_data) -{ - tnf_tag_data_t *metatag_data; - tnf_record_p metatag_index; - tnf_type_prototype_t *buffer; - enum tnf_alloc_mode saved_mode; - - saved_mode = ops->mode; - ops->mode = TNF_ALLOC_FIXED; - /* LINTED assignment of 32-bit integer to 8-bit integer */ - ALLOC(ops, sizeof (*buffer), buffer, tag_data->tag_index, - saved_mode); - - metatag_data = TAG_DATA(tnf_type); - metatag_index = metatag_data->tag_index ? metatag_data->tag_index : - metatag_data->tag_desc(ops, metatag_data); - - ASSIGN(buffer, tag, metatag_index); - ASSIGN(buffer, name, tag_data->tag_name); - ASSIGN(buffer, properties, tag_data->tag_props); - /* LINTED assignment of 32-bit integer to 8-bit integer */ - ops->mode = saved_mode; - return (tag_data->tag_index); -} - -/* - * Write instances of tnf_scalar_type - */ - -tnf_record_p -tnf_scalar_tag_1(tnf_ops_t *ops, tnf_tag_data_t *tag_data) -{ - tnf_tag_data_t *metatag_data; - tnf_record_p metatag_index; - enum tnf_alloc_mode saved_mode; - tnf_scalar_type_prototype_t *buffer; - - saved_mode = ops->mode; - ops->mode = TNF_ALLOC_FIXED; - /* LINTED assignment of 32-bit integer to 8-bit integer */ - ALLOC(ops, sizeof (*buffer), buffer, tag_data->tag_index, - saved_mode); - - metatag_data = TAG_DATA(tnf_scalar_type); - metatag_index = metatag_data->tag_index ? metatag_data->tag_index : - metatag_data->tag_desc(ops, metatag_data); - - ASSIGN(buffer, tag, metatag_index); - ASSIGN(buffer, name, tag_data->tag_name); - ASSIGN(buffer, properties, tag_data->tag_props); - /* LINTED assignment of 32-bit integer to 8-bit integer */ - ASSIGN(buffer, type_size, tag_data->tag_size); - /* LINTED assignment of 64-bit integer to 32-bit integer */ - ASSIGN(buffer, align, tag_data->tag_align); - - /* LINTED assignment of 32-bit integer to 8-bit integer */ - ops->mode = saved_mode; - return (tag_data->tag_index); -} - -/* - * Write instances of tnf_derived_type - */ - -tnf_record_p -tnf_derived_tag_1(tnf_ops_t *ops, tnf_tag_data_t *tag_data) -{ - tnf_tag_data_t *metatag_data; - tnf_record_p metatag_index; - enum tnf_alloc_mode saved_mode; - tnf_derived_type_prototype_t *buffer; - - saved_mode = ops->mode; - ops->mode = TNF_ALLOC_FIXED; - /* LINTED assignment of 32-bit integer to 8-bit integer */ - ALLOC(ops, sizeof (*buffer), buffer, tag_data->tag_index, - saved_mode); - - metatag_data = TAG_DATA(tnf_derived_type); - metatag_index = metatag_data->tag_index ? metatag_data->tag_index: - metatag_data->tag_desc(ops, metatag_data); - - ASSIGN(buffer, tag, metatag_index); - ASSIGN(buffer, name, tag_data->tag_name); - ASSIGN(buffer, properties, tag_data->tag_props); - ASSIGN(buffer, derived_base, tag_data->tag_base); - /* LINTED assignment of 32-bit integer to 8-bit integer */ - ops->mode = saved_mode; - return (tag_data->tag_index); -} - -/* - * Write instances of tnf_struct_type (except root) - */ - -tnf_record_p -tnf_struct_tag_1(tnf_ops_t *ops, tnf_tag_data_t *tag_data) -{ - tnf_tag_data_t *metatag_data; - tnf_record_p metatag_index; - enum tnf_alloc_mode saved_mode; - tnf_struct_type_prototype_t *buffer; - - saved_mode = ops->mode; - ops->mode = TNF_ALLOC_FIXED; - /* LINTED assignment of 32-bit integer to 8-bit integer */ - ALLOC(ops, sizeof (*buffer), buffer, tag_data->tag_index, - saved_mode); - - metatag_data = TAG_DATA(tnf_struct_type); - metatag_index = metatag_data->tag_index ? metatag_data->tag_index: - metatag_data->tag_desc(ops, metatag_data); - - ASSIGN(buffer, tag, metatag_index); - ASSIGN(buffer, name, tag_data->tag_name); - ASSIGN(buffer, properties, tag_data->tag_props); - ASSIGN(buffer, slot_types, tag_data->tag_slots); - /* LINTED assignment of 64-bit integer to 32-bit integer */ - ASSIGN(buffer, type_size, tag_data->tag_size); - ASSIGN(buffer, slot_names, tag_data->tag_slot_names); - /* LINTED assignment of 32-bit integer to 8-bit integer */ - ops->mode = saved_mode; - return (tag_data->tag_index); -} - -/* - * Write instances of tnf_array_type - */ - -tnf_record_p -tnf_array_tag_1(tnf_ops_t *ops, tnf_tag_data_t *tag_data) -{ - tnf_tag_data_t *metatag_data; - tnf_record_p metatag_index; - enum tnf_alloc_mode saved_mode; - tnf_array_type_prototype_t *buffer; - - saved_mode = ops->mode; - ops->mode = TNF_ALLOC_FIXED; - /* LINTED assignment of 32-bit integer to 8-bit integer */ - ALLOC(ops, sizeof (*buffer), buffer, tag_data->tag_index, - saved_mode); - - metatag_data = TAG_DATA(tnf_array_type); - metatag_index = metatag_data->tag_index ? metatag_data->tag_index : - metatag_data->tag_desc(ops, metatag_data); - - ASSIGN(buffer, tag, metatag_index); - ASSIGN(buffer, name, tag_data->tag_name); - ASSIGN(buffer, properties, tag_data->tag_props); - ASSIGN(buffer, slot_types, tag_data->tag_slots); - /* LINTED assignment of 64-bit integer to 32-bit integer */ - ASSIGN(buffer, header_size, tag_data->tag_size); - ASSIGN(buffer, element_type, tag_data->tag_base); - /* LINTED assignment of 32-bit integer to 8-bit integer */ - ops->mode = saved_mode; - return (tag_data->tag_index); -} - -/* - * Write the root metatype, and some critical bootstrap types - */ - -static tnf_record_p -tnf_root_tag_1(tnf_ops_t *ops, tnf_tag_data_t *tag_data) -{ - enum tnf_alloc_mode saved_mode; - tnf_tag_t *fw_p; - tnf_struct_type_prototype_t *buffer; - - saved_mode = ops->mode; - ops->mode = TNF_ALLOC_FIXED; - /* LINTED assignment of 32-bit integer to 8-bit integer */ - ALLOC(ops, sizeof (*buffer), buffer, tag_data->tag_index, - saved_mode); - - /* - * update the root forwarding pointer to point to this root - * CAUTION: Do this before anything else... - */ - -#ifdef _KERNEL - /* LINTED pointer cast may result in improper alignment */ - fw_p = (tnf_tag_t *)(tnf_buf + TNF_DIRENT_ROOT); - *fw_p = tnf_ref32(ops, tag_data->tag_index, (tnf_record_p)fw_p); - tag_data->tag_index = (tnf_record_p)fw_p; -#else - /* LINTED pointer cast may result in improper alignment */ - fw_p = (tnf_tag_t *)_tnf_buf_headers_p->fw_root; - if (fw_p) { - *fw_p = tnf_ref32(ops, tag_data->tag_index, - (tnf_record_p) fw_p); - tag_data->tag_index = (tnf_record_p)fw_p; - } -#endif - -#ifdef _KERNEL - /* LINTED constant truncated by assignment */ - buffer->tag = TNF_ROOT_TAG; -#else - ASSIGN(buffer, tag, tag_data->tag_index); /* ROOT */ -#endif - ASSIGN(buffer, name, tag_data->tag_name); - ASSIGN(buffer, properties, tag_data->tag_props); - ASSIGN(buffer, slot_types, tag_data->tag_slots); - /* LINTED assignment of 64-bit integer to 32-bit integer */ - ASSIGN(buffer, type_size, tag_data->tag_size); - ASSIGN(buffer, slot_names, tag_data->tag_slot_names); - - /* - * Write some additional bootstrap types - */ - { - static tnf_tag_data_t *bootstrap_types[] = { - &_TAG_DATA(tnf_uint16), - &_TAG_DATA(tnf_int32), - &_TAG_DATA(tnf_tag), - &_TAG_DATA(tnf_file_header), - &_TAG_DATA(tnf_block_header), - 0}; - tnf_tag_data_t **list_p, *tag_p; - - list_p = bootstrap_types; - - while (tag_p = *list_p++) { - if (!tag_p->tag_index) /* not written */ - tag_p->tag_desc(ops, tag_p); - } - } - - - /* - * fix for circularity in filling in file header tag and block - * header tag. REMIND: should also fix tag_index of - * file_header. - */ - -#ifdef _KERNEL - - /* LINTED pointer cast may result in improper alignment */ - fw_p = (tnf_tag_t *)(tnf_buf + TNF_DIRENT_FILE_HEADER); - *fw_p = tnf_ref32(ops, _TAG_DATA(tnf_file_header).tag_index, - (tnf_record_p)fw_p); - - /* LINTED pointer cast may result in improper alignment */ - fw_p = (tnf_tag_t *)(tnf_buf + TNF_DIRENT_BLOCK_HEADER); - *fw_p = tnf_ref32(ops, _TAG_DATA(tnf_block_header).tag_index, - (tnf_record_p)fw_p); - -#else - - /* LINTED pointer cast may result in improper alignment */ - fw_p = (tnf_tag_t *)_tnf_buf_headers_p->fw_file_header; - if (fw_p) { - *fw_p = tnf_ref32(ops, _TAG_DATA(tnf_file_header).tag_index, - (tnf_record_p)fw_p); - } - /* LINTED pointer cast may result in improper alignment */ - fw_p = (tnf_tag_t *)_tnf_buf_headers_p->fw_block_header; - if (fw_p) { - *fw_p = tnf_ref32(ops, _TAG_DATA(tnf_block_header).tag_index, - (tnf_record_p) fw_p); - } - -#endif - - /* LINTED assignment of 32-bit integer to 8-bit integer */ - ops->mode = saved_mode; - return (tag_data->tag_index); -} - - -/* - * Data encoders - */ - -/* - * Strings and derivatives - */ - -tnf_reference_t -tnf_string_1(tnf_ops_t *ops, const char *string, tnf_record_p reference, - tnf_tag_data_t *tag_data) -{ - tnf_record_p tag_index; - size_t string_size, record_size; - tnf_array_header_t *bufhdr; - - tag_index = tag_data->tag_index ? tag_data->tag_index : - tag_data->tag_desc(ops, tag_data); - - if (!string) - return ((tnf_reference_t)TNF_NULL); - - string_size = strlen(string); /* excludes terminating NUL */ - if (string_size > TNF_STRING_LIMIT) - string_size = TNF_STRING_LIMIT; - /* Allocate space for terminating NUL as well */ - record_size = sizeof (*bufhdr) + TNF_STRING_ROUNDUP(string_size + 1); - - ALLOC2(ops, record_size, bufhdr, ops->mode); - - ASSIGN(bufhdr, tag, tag_index); - /* LINTED assignment of 64-bit integer to 32-bit integer */ - ASSIGN(bufhdr, self_size, record_size); - -#ifdef _KERNEL - (void) bcopy((caddr_t)string, (char *)bufhdr + sizeof (*bufhdr), - string_size); -#else - (void) memcpy((char *)bufhdr + sizeof (*bufhdr), string, string_size); -#endif - /* NUL-terminate */ - ((char *)bufhdr + sizeof (*bufhdr))[string_size] = '\0'; - - return (tnf_ref32(ops, (tnf_record_p)bufhdr, reference)); -} - -/* - * Array of strings and derivatives - */ - -tnf_reference_t -tnf_string_array_1(tnf_ops_t *ops, char **strings, tnf_record_p reference, - tnf_tag_data_t *tag_data) -{ - tnf_record_p tag_index; - size_t record_size; - char **tmp; - tnf_reference_t *ref_p; - tnf_array_header_t *bufhdr; - - tag_index = tag_data->tag_index ? tag_data->tag_index : - tag_data->tag_desc(ops, tag_data); - - if (!strings) - return ((tnf_reference_t)TNF_NULL); - - record_size = sizeof (*bufhdr); - tmp = strings; - while (*tmp++) - record_size += sizeof (tnf_string_t); - - ALLOC2(ops, record_size, bufhdr, ops->mode); - - ASSIGN(bufhdr, tag, tag_index); - /* LINTED assignment of 64-bit integer to 32-bit integer */ - ASSIGN(bufhdr, self_size, record_size); - - tmp = strings; - /* LINTED pointer cast may result in improper alignment */ - ref_p = (tnf_reference_t *)((char *)bufhdr + sizeof (*bufhdr)); - while (*tmp) { - *ref_p = tnf_string(ops, *tmp, (tnf_record_p)ref_p); - tmp++; - ref_p++; - } - - return (tnf_ref32(ops, (tnf_record_p) bufhdr, reference)); -} - -/* - * Type record as generic (not tag) reference - */ - -tnf_reference_t -tnf_tag_element_1(tnf_ops_t *ops, tnf_tag_data_t **tag_data_p, - tnf_record_p reference, tnf_tag_data_t *aux_tag_data) -{ - tnf_tag_data_t *tag_data; - - if (aux_tag_data) - if (!aux_tag_data->tag_index) - aux_tag_data->tag_desc(ops, aux_tag_data); - - /* tnf_derived has derived_base == TNF_NULL */ - if (!tag_data_p) - return ((tnf_reference_t)TNF_NULL); - - tag_data = *tag_data_p; - if (!tag_data->tag_index) - tag_data->tag_desc(ops, tag_data); - - return (tnf_ref32(ops, tag_data->tag_index, reference)); -} - - -/* - * Array of type records as generic (not tag) references - */ - -tnf_reference_t -tnf_tag_array_1(tnf_ops_t *ops, - tnf_tag_data_t ***tag_data_array, - tnf_record_p reference, - tnf_tag_data_t *tag_data) -{ - tnf_record_p tag_index; - size_t record_size; - tnf_array_header_t *bufhdr; - tnf_tag_data_t ***tmp; - tnf_reference_t *ref_p; - - tag_index = tag_data->tag_index ? tag_data->tag_index : - tag_data->tag_desc(ops, tag_data); - - if (!tag_data_array) - return ((tnf_reference_t)TNF_NULL); - - record_size = sizeof (*bufhdr); - tmp = tag_data_array; - while (*tmp++) - record_size += sizeof (tnf_reference_t); - - ALLOC2(ops, record_size, bufhdr, ops->mode); - - ASSIGN(bufhdr, tag, tag_index); - /* LINTED assignment of 64-bit integer to 32-bit integer */ - ASSIGN(bufhdr, self_size, record_size); - - tmp = tag_data_array; - /* LINTED pointer cast may result in improper alignment */ - ref_p = (tnf_reference_t *)((char *)bufhdr + sizeof (*bufhdr)); - while (*tmp) { - *ref_p = tnf_tag_element_1(ops, *tmp, (tnf_record_p)ref_p, - TNF_NULL); - tmp++; - ref_p++; - } - - return (tnf_ref32(ops, (tnf_record_p)bufhdr, reference)); -} - -/* - * Array of properties (type records) - */ - -tnf_reference_t -tnf_tag_properties_1(tnf_ops_t *ops, - tnf_tag_data_t ****tag_data_array, - tnf_record_p reference, - tnf_tag_data_t *tag_data) -{ - if (!(tag_data->tag_index)) - tag_data->tag_desc(ops, tag_data); - - if (!tag_data_array) - return ((tnf_reference_t)TNF_NULL); - - return (tnf_tag_array_1(ops, *tag_data_array, reference, tag_data)); -} - -#ifdef _KERNEL -/* - * Initialize all core tag pointers defined in this file. - * CAUTION: tnf_tag_core_init is a function for kernel compilation. - */ - -void -tnf_tag_core_init(void) -{ -#endif - TAG_SET(tnf_inline); - TAG_SET(tnf_tagged); - - TAG_SET(tnf_scalar); - TAG_SET(tnf_char); - TAG_SET(tnf_int8); - TAG_SET(tnf_uint8); - TAG_SET(tnf_int16); - TAG_SET(tnf_uint16); - TAG_SET(tnf_int32); - TAG_SET(tnf_uint32); - TAG_SET(tnf_int64); - TAG_SET(tnf_uint64); - - TAG_SET(tnf_float32); - TAG_SET(tnf_float64); - - TAG_SET(tnf_array); - TAG_SET(tnf_string); - TAG_SET(tnf_type_array); - TAG_SET(tnf_name_array); - - TAG_SET(tnf_derived); - TAG_SET(tnf_align); - TAG_SET(tnf_derived_base); - TAG_SET(tnf_element_type); - TAG_SET(tnf_header_size); - TAG_SET(tnf_name); - TAG_SET(tnf_opaque); - TAG_SET(tnf_properties); - TAG_SET(tnf_self_size); - TAG_SET(tnf_size); - TAG_SET(tnf_slot_names); - TAG_SET(tnf_slot_types); - TAG_SET(tnf_tag); - TAG_SET(tnf_tag_arg); - TAG_SET(tnf_type_size); - - TAG_SET(tnf_struct); - TAG_SET(tnf_file_header); - TAG_SET(tnf_block_header); - - TAG_SET(tnf_type); - TAG_SET(tnf_array_type); - TAG_SET(tnf_derived_type); - TAG_SET(tnf_scalar_type); - TAG_SET(tnf_struct_type); - -#ifdef _KERNEL - - /* Snap exported properties */ - tnf_user_struct_properties = std_struct_properties; - -} - -#else /* _KERNEL */ - -tnf_tag_data_t ***tnf_user_struct_properties = std_struct_properties; - -#endif /* _KERNEL */ diff --git a/usr/src/uts/common/tnf/trace_funcs.c b/usr/src/uts/common/tnf/trace_funcs.c deleted file mode 100644 index 96b3e8eed5..0000000000 --- a/usr/src/uts/common/tnf/trace_funcs.c +++ /dev/null @@ -1,342 +0,0 @@ -/* - * 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 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 (c) 1994, by Sun Microsytems, Inc. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -/* - * Includes - */ -#include <sys/param.h> -#include <sys/time.h> -#include <sys/debug.h> -#include <sys/cmn_err.h> -#include <sys/tnf.h> - -#include "tnf_buf.h" -#include "tnf_types.h" -#include "tnf_trace.h" - -/* - * Defines - */ - -#define ENCODED_TAG(tag, tagarg) \ - ((tag) | ((tagarg) & 0xfffc) | TNF_REF32_T_PAIR) - -/* - * CAUTION: halfword_accessible assumes that the pointer is to a reclaimable - * block - i.e. negative offsets have a 0 in high bit - */ -#define HALFWORD_ACCESSIBLE(x) \ - ((((x) & 0xffff8000) == 0) || (((x) & 0xffff8000) == 0x7fff8000)) - -/* - * Check that x can be encoded in tagarg slot - * Same as above, but operates on ints (no space bit) - */ -#define TAGARG_CHECK(x) \ - (((x) < 32767) && ((x) > -32768)) - -/* - * Check that hit 32 bits of hrtime are zero - */ -#define TIME_CHECK(x) \ - (((x) >> 32) == 0) - -/* - * CAUTION: Use the following macro only when doing a self relative pointer - * to a target in the same block - */ -#define PTR_DIFF(item, ref) \ - ((tnf_ref32_t)((tnf_record_p)(item) - (tnf_record_p)(ref))) - -/* - * Typedefs - */ - -typedef struct { - tnf_probe_event_t probe_event; - tnf_time_delta_t time_delta; -} probe_event_prototype_t; - -/* - * Declarations - */ - -/* - * tnf_trace_alloc - * the probe allocation function - */ - -void * -tnf_trace_alloc(tnf_ops_t *ops, tnf_probe_control_t *probe_p, - tnf_probe_setup_t *set_p) -{ - TNFW_B_WCB *wcb; - uintptr_t probe_index; - tnf_record_p sched_record_p; - tnf_reference_t sched_offset, tag_disp; - tnf_block_header_t *block; - tnf_uint32_t shift; - probe_event_prototype_t *buffer; - hrtime_t curr_time, time_diff; - tnf_schedule_t *sched; - tnf_ref32_t *fwd_p; - size_t size, asize; - - /* - * Check the "tracing active" flag after setting the busy bit; - * this avoids a race in which we check the "tracing active" - * flag, then it gets turned off, and the buffer gets - * deallocated, before we've set the busy bit. - */ - if (!lock_try(&ops->busy)) /* atomic op flushes WB */ - return (NULL); - if (!tnf_tracing_active) - goto null_ret; - - /* - * Write probe tag if needed - */ - probe_index = probe_p->index; - if (probe_index == 0) { - if ((probe_index = tnf_probe_tag(ops, probe_p)) == 0) - goto null_ret; - } - - /* - * Determine how much memory is required - */ - size = probe_p->tnf_event_size; - asize = size + sizeof (tnf_ref32_t); /* one fwd ptr */ - - if (PROBE_IS_FILE_PTR(probe_index)) - /* common case - probe_index is a file ptr */ - /* LINTED assignment of 64-bit integer to 32-bit integer */ - tag_disp = probe_index & PROBE_INDEX_LOW_MASK; - else - /* rare case -- get an extra fwd ptr */ - asize += sizeof (tnf_ref32_t); - - /* - * Allocate memory - */ - wcb = &ops->wcb; - /* LINTED assignment of 64-bit integer to 16-bit integer */ - TNFW_B_ALLOC(wcb, asize, buffer, probe_event_prototype_t *); - if (buffer == NULL) - goto null_ret; - - /* LINTED pointer cast may result in improper alignment */ - fwd_p = (tnf_ref32_t *)((char *)buffer + size); - - /* - * Check if the probe tag needs more work - */ - if (!PROBE_IS_FILE_PTR(probe_index)) { - /* use up first fwd ptr */ - /* LINTED assignment of 64-bit integer to 32-bit integer */ - *fwd_p = TNF_REF32_MAKE_PERMANENT( - (tnf_record_p)probe_index - tnf_buf); - /* LINTED cast from 64-bit integer to 32-bit integer */ - tag_disp = PTR_DIFF(fwd_p, buffer); - tag_disp |= TNF_TAG16_T_REL; - tag_disp = tag_disp << TNF_REF32_TAG16_SHIFT; - fwd_p++; - } - - /* - * Get timestamp - */ - curr_time = gethrtime(); - - /* - * Write schedule record if needed - */ - sched = &ops->schedule; - - /* LINTED pointer cast */ - shift = ((tnf_buf_file_header_t *)tnf_buf)->com.file_log_size; - block = (tnf_block_header_t *)((uintptr_t)buffer & TNF_BLOCK_MASK); - - if ((sched_record_p = sched->record_p) == NULL) - /* No record written yet */ - goto new_schedule; - - /* - * Note: Don't bother about space bit here, because we'll - * only use bits 15:2 anyway - */ -#if defined(_LP64) - /* LINTED assignment of 64-bit integer to 32-bit integer */ - sched_offset = ((sched->record_gen - block->generation) << shift) + - (sched_record_p - (caddr_t)buffer); -#else - sched_offset = ((sched->record_gen - block->generation) << shift) + - (sched_record_p - (caddr_t)buffer); -#endif - if (!TAGARG_CHECK(sched_offset)) - /* Record too far away to reference */ - goto new_schedule; - - time_diff = curr_time - sched->time_base; - if (!TIME_CHECK(time_diff)) - /* Time delta can't fit in 32 bits */ - goto new_schedule; - - if (sched->cpuid != CPU->cpu_id) - /* CPU information is invalid */ - goto new_schedule; - - /* - * Can reuse existing schedule record - * Since we did not allocate any more space, can giveback - */ -#if defined(_LP64) - /* LINTED warning: assignment of 64-bit integer to 16-bit integer */ - TNFW_B_GIVEBACK(wcb, fwd_p); -#else - TNFW_B_GIVEBACK(wcb, fwd_p); -#endif - -good_ret: - /* - * Store return params and two common event members, return buffer - */ - set_p->tpd_p = ops; - set_p->buffer_p = buffer; - set_p->probe_p = probe_p; - buffer->probe_event = ENCODED_TAG(tag_disp, sched_offset); -#if defined(_LP64) - /* LINTED assignment of 64-bit integer to 32-bit integer */ - buffer->time_delta = tnf_time_delta(ops, (unsigned long)time_diff, - &buffer->probe_time_delta); -#else - buffer->time_delta = tnf_time_delta(ops, (unsigned long)time_diff, - &buffer->probe_time_delta); -#endif - return (buffer); - -new_schedule: - /* - * Write a new schedule record for this thread - */ - sched->cpuid = CPU->cpu_id; - sched->time_base = curr_time; - time_diff = 0; - if ((sched_record_p = tnf_kernel_schedule(ops, sched)) != NULL) { - /* use one of the extra alloced words for the forwarding ptr */ -#if defined(_LP64) - /* LINTED assignment of 64-bit integer to 32-bit integer */ - *fwd_p = TNF_REF32_MAKE_RECLAIMABLE( - ((sched->record_gen - block->generation) << shift) + - /* LINTED */ - (sched_record_p - (tnf_record_p)fwd_p)); - /* LINTED cast from 64-bit integer to 32-bit integer */ - sched_offset = PTR_DIFF(fwd_p, buffer); -#else - *fwd_p = TNF_REF32_MAKE_RECLAIMABLE( - ((sched->record_gen - block->generation) << shift) + - (sched_record_p - (tnf_record_p)fwd_p)); - sched_offset = PTR_DIFF(fwd_p, buffer); -#endif - } else { - /* Allocation failed (tracing may have been stopped) */ - sched_offset = 0; - *fwd_p = TNF_NULL; - } - goto good_ret; - -null_ret: - /* - * Clear busy flag and return null - */ - LOCK_INIT_CLEAR(&ops->busy); /* XXX save a call */ - return (NULL); -} - -/* - * tnf_trace_commit - */ -void -tnf_trace_commit(tnf_probe_setup_t *set_p) -{ - tnf_ops_t *ops; - TNFW_B_WCB *wcb; - TNFW_B_POS *pos; - - ops = set_p->tpd_p; - wcb = &ops->wcb; - - /* commit reusable bytes */ - pos = &wcb->tnfw_w_pos; - TNFW_B_COMMIT(pos); - - /* commit tag bytes */ - pos = &wcb->tnfw_w_tag_pos; - TNFW_B_COMMIT(pos); - - /* clear busy flag */ - LOCK_INIT_CLEAR(&ops->busy); /* XXX save a call */ -} - -/* - * tnf_trace_rollback - */ -void -tnf_trace_rollback(tnf_probe_setup_t *set_p) -{ - tnf_ops_t *ops; - TNFW_B_WCB *wcb; - TNFW_B_POS *pos; - - ops = set_p->tpd_p; - wcb = &ops->wcb; - - /* rollback data bytes */ - pos = &wcb->tnfw_w_pos; - TNFW_B_ROLLBACK(pos); - - /* commit tag bytes */ - pos = &wcb->tnfw_w_tag_pos; - TNFW_B_COMMIT(pos); - - /* zap schedule record, since it is in uncommitted store */ - ops->schedule.record_p = NULL; - - /* clear busy flag */ - LOCK_INIT_CLEAR(&ops->busy); /* XXX save a call */ -} - -/* - * tnf_allocate - * exported interface for allocating trace memory - */ - -void * -tnf_allocate(tnf_ops_t *ops, size_t size) -{ - return (tnfw_b_alloc(&ops->wcb, size, ops->mode)); -} diff --git a/usr/src/uts/common/tnf/trace_init.c b/usr/src/uts/common/tnf/trace_init.c deleted file mode 100644 index 17b98a4e23..0000000000 --- a/usr/src/uts/common/tnf/trace_init.c +++ /dev/null @@ -1,136 +0,0 @@ -/* - * 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 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 1994-2003 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -/* - * Includes - */ - -#include <sys/types.h> -#include <sys/param.h> -#include <sys/debug.h> -#include <sys/tnf.h> -#include <sys/thread.h> -#include <sys/dtrace.h> - -#include "tnf_buf.h" -#include "tnf_types.h" -#include "tnf_trace.h" - -#ifndef NPROBE - -/* - * Globals - */ - -size_t tnf_trace_file_size = TNF_TRACE_FILE_DEFAULT; - -/* - * tnf_trace_on - */ -void -tnf_trace_on(void) -{ - TNFW_B_UNSET_STOPPED(tnfw_b_state); - tnf_tracing_active = 1; - dtrace_vtime_enable_tnf(); - /* Enable system call tracing for all processes */ - set_all_proc_sys(); -} - -/* - * tnf_trace_off - */ -void -tnf_trace_off(void) -{ - TNFW_B_SET_STOPPED(tnfw_b_state); - dtrace_vtime_disable_tnf(); - tnf_tracing_active = 0; - /* System call tracing is automatically disabled */ -} - -/* - * tnf_trace_init - * Not reentrant: only called from tnf_allocbuf(), which is - * single-threaded. - */ -void -tnf_trace_init(void) -{ - int stopped; - tnf_ops_t *ops; - - ASSERT(tnf_buf != NULL); - ASSERT(!tnf_tracing_active); - - stopped = tnfw_b_state & TNFW_B_STOPPED; - - /* - * Initialize the buffer - */ - tnfw_b_init_buffer(tnf_buf, tnf_trace_file_size); - - /* - * Mark allocator running (not stopped). Luckily, - * tnf_trace_alloc() first checks tnf_tracing_active, so no - * trace data will be written. - */ - tnfw_b_state = TNFW_B_RUNNING; - - /* - * 1195835: Write out some tags now. The stopped bit needs - * to be clear while we do this. - */ - /* LINTED pointer cast may result in improper alignment */ - if ((ops = (tnf_ops_t *)curthread->t_tnf_tpdp) != NULL) { - tnf_tag_data_t *tag; - TNFW_B_POS *pos; - - ASSERT(!LOCK_HELD(&ops->busy)); - LOCK_INIT_HELD(&ops->busy); /* XXX save a call */ - - tag = TAG_DATA(tnf_struct_type); - (void) tag->tag_desc(ops, tag); - tag = TAG_DATA(tnf_probe_type); - (void) tag->tag_desc(ops, tag); - tag = TAG_DATA(tnf_kernel_schedule); - (void) tag->tag_desc(ops, tag); - - pos = &ops->wcb.tnfw_w_tag_pos; - TNFW_B_COMMIT(pos); - pos = &ops->wcb.tnfw_w_pos; - TNFW_B_ROLLBACK(pos); - - LOCK_INIT_CLEAR(&ops->busy); /* XXX save a call */ - } - - /* Restore stopped bit */ - tnfw_b_state |= stopped; -} - -#endif /* NPROBE */ diff --git a/usr/src/uts/common/vm/seg_spt.c b/usr/src/uts/common/vm/seg_spt.c index 1308935159..945bce54b3 100644 --- a/usr/src/uts/common/vm/seg_spt.c +++ b/usr/src/uts/common/vm/seg_spt.c @@ -49,7 +49,6 @@ #include <sys/vmsystm.h> #include <sys/policy.h> #include <sys/project.h> -#include <sys/tnf_probe.h> #include <sys/zone.h> #define SEGSPTADDR (caddr_t)0x0 @@ -344,10 +343,6 @@ sptcreate(size_t size, struct seg **sptseg, struct anon_map *amp, struct as *newas; struct segspt_crargs sptcargs; -#ifdef DEBUG - TNF_PROBE_1(sptcreate, "spt", /* CSTYLED */, - tnf_ulong, size, size ); -#endif if (segspt_minfree == 0) spt_setminfree(); @@ -379,9 +374,6 @@ void sptdestroy(struct as *as, struct anon_map *amp) { -#ifdef DEBUG - TNF_PROBE_0(sptdestroy, "spt", /* CSTYLED */); -#endif (void) as_unmap(as, SEGSPTADDR, amp->size); as_free(as); } @@ -553,10 +545,6 @@ segspt_create(struct seg **segpp, void *argsp) ASSERT(seg->s_as && AS_WRITE_HELD(seg->s_as)); ASSERT(sp != NULL); -#ifdef DEBUG - TNF_PROBE_2(segspt_create, "spt", /* CSTYLED */, - tnf_opaque, addr, addr, tnf_ulong, len, seg->s_size); -#endif if ((sptcargs->flags & SHM_PAGEABLE) == 0) { if (err = anon_swap_adjust(npages)) return (err); diff --git a/usr/src/uts/common/vm/vm_anon.c b/usr/src/uts/common/vm/vm_anon.c index 6785e6b4dd..e101860bf4 100644 --- a/usr/src/uts/common/vm/vm_anon.c +++ b/usr/src/uts/common/vm/vm_anon.c @@ -107,7 +107,6 @@ #include <sys/tuneable.h> #include <sys/debug.h> #include <sys/fs/swapnode.h> -#include <sys/tnf_probe.h> #include <sys/lgrp.h> #include <sys/policy.h> #include <sys/condvar_impl.h> @@ -2419,10 +2418,6 @@ anon_private( CPU_STATS_ADD_K(vm, cow_fault, 1); - /* Kernel probe */ - TNF_PROBE_1(anon_private, "vm pagefault", /* CSTYLED */, - tnf_opaque, address, addr); - *app = new = anon_alloc(NULL, 0); swap_xlate(new, &vp, &off); @@ -2802,10 +2797,6 @@ anon_zero(struct seg *seg, caddr_t addr, struct anon **app, struct cred *cred) page_t *anon_pl[1 + 1]; int err; - /* Kernel probe */ - TNF_PROBE_1(anon_zero, "vm pagefault", /* CSTYLED */, - tnf_opaque, address, addr); - *app = ap = anon_alloc(NULL, 0); swap_xlate(ap, &vp, &off); diff --git a/usr/src/uts/common/vm/vm_as.c b/usr/src/uts/common/vm/vm_as.c index e353692471..c217270943 100644 --- a/usr/src/uts/common/vm/vm_as.c +++ b/usr/src/uts/common/vm/vm_as.c @@ -56,7 +56,6 @@ #include <sys/vmsystm.h> #include <sys/cmn_err.h> #include <sys/debug.h> -#include <sys/tnf_probe.h> #include <sys/vtrace.h> #include <vm/hat.h> @@ -878,12 +877,6 @@ retry: break; } - /* Kernel probe */ - TNF_PROBE_3(address_fault, "vm pagefault", /* CSTYLED */, - tnf_opaque, address, addr, - tnf_fault_type, fault_type, type, - tnf_seg_access, access, rw); - raddr = (caddr_t)((uintptr_t)addr & (uintptr_t)PAGEMASK); rsize = (((size_t)(addr + size) + PAGEOFFSET) & PAGEMASK) - (size_t)raddr; diff --git a/usr/src/uts/common/vm/vm_page.c b/usr/src/uts/common/vm/vm_page.c index 131ee0ba1c..134b3bcb33 100644 --- a/usr/src/uts/common/vm/vm_page.c +++ b/usr/src/uts/common/vm/vm_page.c @@ -59,7 +59,6 @@ #include <sys/cpuvar.h> #include <sys/callb.h> #include <sys/debug.h> -#include <sys/tnf_probe.h> #include <sys/condvar_impl.h> #include <sys/mem_config.h> #include <sys/mem_cage.h> @@ -3569,11 +3568,6 @@ page_hashout(page_t *pp, kmutex_t *phm) TRACE_2(TR_FAC_VM, TR_PAGE_HASHOUT, "page_hashout:pp %p vp %p", pp, vp); - /* Kernel probe */ - TNF_PROBE_2(page_unmap, "vm pagefault", /* CSTYLED */, - tnf_opaque, vnode, vp, - tnf_offset, offset, pp->p_offset); - /* * */ diff --git a/usr/src/uts/common/vm/vm_pvn.c b/usr/src/uts/common/vm/vm_pvn.c index 1b8d12eb8d..aaad06792b 100644 --- a/usr/src/uts/common/vm/vm_pvn.c +++ b/usr/src/uts/common/vm/vm_pvn.c @@ -60,7 +60,6 @@ #include <sys/debug.h> #include <sys/cpuvar.h> #include <sys/vtrace.h> -#include <sys/tnf_probe.h> #include <vm/hat.h> #include <vm/as.h> @@ -563,13 +562,6 @@ pvn_write_done(page_t *plist, int flags) CPU_STATS_ADDQ(cpup, vm, execpgout, execpgout); CPU_STATS_ADDQ(cpup, vm, execfree, execfree); CPU_STATS_EXIT_K(); - - /* Kernel probe */ - TNF_PROBE_4(pageout, "vm pageio io", /* CSTYLED */, - tnf_opaque, vnode, vp, - tnf_ulong, pages_pageout, pgpgout, - tnf_ulong, pages_freed, dfree, - tnf_ulong, pages_reclaimed, pgrec); } /* diff --git a/usr/src/uts/i86pc/io/gfx_private/gfxp_pci.c b/usr/src/uts/i86pc/io/gfx_private/gfxp_pci.c index 9694e25ead..50ddba3f8e 100644 --- a/usr/src/uts/i86pc/io/gfx_private/gfxp_pci.c +++ b/usr/src/uts/i86pc/io/gfx_private/gfxp_pci.c @@ -62,7 +62,6 @@ #include <sys/visual_io.h> #include <sys/fbio.h> #include <sys/ddidmareq.h> -#include <sys/tnf_probe.h> #include <sys/kstat.h> #include <sys/callb.h> #include <sys/pci_cfgspace.h> diff --git a/usr/src/uts/i86pc/io/gfx_private/gfxp_vm.c b/usr/src/uts/i86pc/io/gfx_private/gfxp_vm.c index f46515838f..53a8b96221 100644 --- a/usr/src/uts/i86pc/io/gfx_private/gfxp_vm.c +++ b/usr/src/uts/i86pc/io/gfx_private/gfxp_vm.c @@ -67,7 +67,6 @@ #include <sys/visual_io.h> #include <sys/fbio.h> #include <sys/ddidmareq.h> -#include <sys/tnf_probe.h> #include <sys/kstat.h> #include <sys/callb.h> #include <sys/promif.h> diff --git a/usr/src/uts/i86pc/os/trap.c b/usr/src/uts/i86pc/os/trap.c index 7355e41688..b7c18bb8c9 100644 --- a/usr/src/uts/i86pc/os/trap.c +++ b/usr/src/uts/i86pc/os/trap.c @@ -81,8 +81,6 @@ #include <sys/debugreg.h> #include <sys/modctl.h> #include <sys/aio_impl.h> -#include <sys/tnf.h> -#include <sys/tnf_probe.h> #include <sys/cred.h> #include <sys/mman.h> #include <sys/x86_archext.h> @@ -543,9 +541,6 @@ trap(struct regs *rp, caddr_t addr, processorid_t cpuid) mstate = LMS_TRAP; break; } - /* Kernel probe */ - TNF_PROBE_1(thread_state, "thread", /* CSTYLED */, - tnf_microstate, state, mstate); mstate = new_mstate(ct, mstate); bzero(&siginfo, sizeof (siginfo)); @@ -1470,10 +1465,6 @@ out: /* We can't get here from a system trap */ prunstop(); (void) new_mstate(ct, mstate); - /* Kernel probe */ - TNF_PROBE_1(thread_state, "thread", /* CSTYLED */, - tnf_microstate, state, LMS_USER); - return; cleanup: /* system traps end up here */ diff --git a/usr/src/uts/intel/Makefile.intel b/usr/src/uts/intel/Makefile.intel index fe06a58334..77713eb279 100644 --- a/usr/src/uts/intel/Makefile.intel +++ b/usr/src/uts/intel/Makefile.intel @@ -336,7 +336,6 @@ DRV_KMODS += tcp DRV_KMODS += tcp6 DRV_KMODS += timerfd DRV_KMODS += tl -DRV_KMODS += tnf DRV_KMODS += tpm DRV_KMODS += trill DRV_KMODS += udp diff --git a/usr/src/uts/intel/amd64/krtld/kobj_reloc.c b/usr/src/uts/intel/amd64/krtld/kobj_reloc.c index 9756c847f3..78b1fb7777 100644 --- a/usr/src/uts/intel/amd64/krtld/kobj_reloc.c +++ b/usr/src/uts/intel/amd64/krtld/kobj_reloc.c @@ -40,49 +40,9 @@ #include <sys/elf.h> #include <sys/kobj.h> #include <sys/kobj_impl.h> -#include <sys/tnf.h> -#include <sys/tnf_probe.h> #include "reloc.h" - -/* - * Probe Discovery - */ - -#define PROBE_MARKER_SYMBOL "__tnf_probe_version_1" -#define TAG_MARKER_SYMBOL "__tnf_tag_version_1" - -extern int tnf_splice_probes(int, tnf_probe_control_t *, tnf_tag_data_t *); - -/* - * The kernel run-time linker calls this to try to resolve a reference - * it can't otherwise resolve. We see if it's marking a probe control - * block; if so, we do the resolution and return 0. If not, we return - * 1 to show that we can't resolve it, either. - */ -static int -tnf_reloc_resolve(char *symname, Addr *value_p, - Elf64_Sxword *addend_p, - long offset, - tnf_probe_control_t **probelist, - tnf_tag_data_t **taglist) -{ - if (strcmp(symname, PROBE_MARKER_SYMBOL) == 0) { - *addend_p = 0; - ((tnf_probe_control_t *)offset)->next = *probelist; - *probelist = (tnf_probe_control_t *)offset; - return (0); - } - if (strcmp(symname, TAG_MARKER_SYMBOL) == 0) { - *addend_p = 0; - *value_p = (Addr)*taglist; - *taglist = (tnf_tag_data_t *)offset; - return (0); - } - return (1); -} - #define SDT_NOP 0x90 #define SDT_NOPS 5 @@ -93,9 +53,8 @@ sdt_reloc_resolve(struct module *mp, char *symname, uint8_t *instr) int i; /* - * The "statically defined tracing" (SDT) provider for DTrace uses - * a mechanism similar to TNF, but somewhat simpler. (Surprise, - * surprise.) The SDT mechanism works by replacing calls to the + * The "statically defined tracing" (SDT) provider for DTrace. + * The SDT mechanism works by replacing calls to the * undefined routine __dtrace_probe_[name] with nop instructions. * The relocations are logged, and SDT itself will later patch the * running binary appropriately. @@ -175,15 +134,13 @@ do_relocate(struct module *mp, char *reltbl, int nreloc, int relocsize, Addr baseaddr) { unsigned long stndx; - unsigned long off; /* can't be register for tnf_reloc_resolve() */ + unsigned long off; register unsigned long reladdr, rend; register unsigned int rtype; unsigned long value; Elf64_Sxword addend; Sym *symref = NULL; int err = 0; - tnf_probe_control_t *probelist = NULL; - tnf_tag_data_t *taglist = NULL; int symnum; reladdr = (unsigned long)reltbl; rend = reladdr + nreloc * relocsize; @@ -262,9 +219,9 @@ do_relocate(struct module *mp, char *reltbl, int nreloc, int relocsize, } else { /* * It's global. Allow weak references. If - * the symbol is undefined, give TNF (the - * kernel probes facility) a chance to see - * if it's a probe site, and fix it up if so. + * the symbol is undefined, give dtrace + * a chance to see if it's a probe site, + * and fix it up if so. */ if (symref->st_shndx == SHN_UNDEF && sdt_reloc_resolve(mp, mp->strings + @@ -276,10 +233,7 @@ do_relocate(struct module *mp, char *reltbl, int nreloc, int relocsize, symref->st_name, (uint8_t *)off) == 0) continue; - if (symref->st_shndx == SHN_UNDEF && - tnf_reloc_resolve(mp->strings + - symref->st_name, &symref->st_value, - &addend, off, &probelist, &taglist) != 0) { + if (symref->st_shndx == SHN_UNDEF) { if (ELF_ST_BIND(symref->st_info) != STB_WEAK) { _kobj_printf(ops, @@ -325,9 +279,6 @@ do_relocate(struct module *mp, char *reltbl, int nreloc, int relocsize, if (err) return (-1); - if (tnf_splice_probes(mp->flags & KOBJ_PRIM, probelist, taglist)) - mp->flags |= KOBJ_TNF_PROBE; - return (0); } diff --git a/usr/src/uts/intel/av1394/Makefile b/usr/src/uts/intel/av1394/Makefile index 347ae0b81a..c2c1050cbe 100644 --- a/usr/src/uts/intel/av1394/Makefile +++ b/usr/src/uts/intel/av1394/Makefile @@ -50,9 +50,6 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # # Overrides # -DEBUG_DEFS_DBG32 += -DTNF_DEBUG - - # # For now, disable these warnings; maintainers should endeavor diff --git a/usr/src/uts/intel/hci1394/Makefile b/usr/src/uts/intel/hci1394/Makefile index 333f6693eb..c2acfc8125 100644 --- a/usr/src/uts/intel/hci1394/Makefile +++ b/usr/src/uts/intel/hci1394/Makefile @@ -62,9 +62,6 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) #ALL_BUILDS = $(ALL_BUILDSONLY64) #DEF_BUILDS = $(DEF_BUILDSONLY64) -DEBUG_DEFS_DBG32 += -DTNF_DEBUG -#DEBUG_DEFS_DBG64 += -DTNF_DEBUG - # # For now, disable these warnings; maintainers should endeavor # to investigate and remove these for maximum coverage. diff --git a/usr/src/uts/intel/hermon/Makefile b/usr/src/uts/intel/hermon/Makefile index 58bb4e4d0f..945b6f892b 100644 --- a/usr/src/uts/intel/hermon/Makefile +++ b/usr/src/uts/intel/hermon/Makefile @@ -55,13 +55,6 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) # # -# Build with no debug TNF probes enabled (by default) -# -#DEBUG_DEFS_DBG32 += -DTNF_DEBUG -#DEBUG_DEFS_DBG64 += -DTNF_DEBUG - - -# # For now, disable these warnings; maintainers should endeavor # to investigate and remove these for maximum coverage. # Please do not carry these forward to new Makefiles. diff --git a/usr/src/uts/intel/ibmf/Makefile b/usr/src/uts/intel/ibmf/Makefile index 025b2f656b..494f2940b0 100644 --- a/usr/src/uts/intel/ibmf/Makefile +++ b/usr/src/uts/intel/ibmf/Makefile @@ -52,8 +52,6 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # Overrides # -#DEBUG_DEFS_DBG32 += -DTNF_DEBUG - # # For now, disable these warnings; maintainers should endeavor # to investigate and remove these for maximum coverage. diff --git a/usr/src/uts/intel/ml/modstubs.s b/usr/src/uts/intel/ml/modstubs.s index ec0eefd9f7..bac97ef672 100644 --- a/usr/src/uts/intel/ml/modstubs.s +++ b/usr/src/uts/intel/ml/modstubs.s @@ -935,19 +935,6 @@ fcnname/**/_info: \ #endif /* - * Stubs for kernel probes (tnf module). Not unloadable. - */ -#ifndef TNF_MODULE - MODULE(tnf,drv); - NO_UNLOAD_STUB(tnf, tnf_ref32_1, nomod_zero); - NO_UNLOAD_STUB(tnf, tnf_string_1, nomod_zero); - NO_UNLOAD_STUB(tnf, tnf_opaque_array_1, nomod_zero); - NO_UNLOAD_STUB(tnf, tnf_struct_tag_1, nomod_zero); - NO_UNLOAD_STUB(tnf, tnf_allocate, nomod_zero); - END_MODULE(tnf); -#endif - -/* * Stubs for i86hvm bootstraping */ #ifndef HVM_BOOTSTRAP diff --git a/usr/src/uts/intel/os/syscall.c b/usr/src/uts/intel/os/syscall.c index 1fc429661c..4af0a00e4e 100644 --- a/usr/src/uts/intel/os/syscall.c +++ b/usr/src/uts/intel/os/syscall.c @@ -54,8 +54,6 @@ #include <c2/audit.h> #include <sys/modctl.h> #include <sys/aio_impl.h> -#include <sys/tnf.h> -#include <sys/tnf_probe.h> #include <sys/copyops.h> #include <sys/priv.h> #include <sys/msacct.h> @@ -369,16 +367,6 @@ pre_syscall() } } -#ifndef NPROBE - /* Kernel probe */ - if (tnf_tracing_active) { - TNF_PROBE_1(syscall_start, "syscall thread", /* CSTYLED */, - tnf_sysnum, sysnum, t->t_sysnum); - t->t_post_sys = 1; /* make sure post_syscall runs */ - repost = 1; - } -#endif /* NPROBE */ - #ifdef SYSCALLTRACE if (syscalltrace) { int i; @@ -700,17 +688,6 @@ sig_check: lwp->lwp_errno = 0; /* clear error for next time */ -#ifndef NPROBE - /* Kernel probe */ - if (tnf_tracing_active) { - TNF_PROBE_3(syscall_end, "syscall thread", /* CSTYLED */, - tnf_long, rval1, rval1, - tnf_long, rval2, rval2, - tnf_long, errno, (long)error); - repost = 1; - } -#endif /* NPROBE */ - /* * Set state to LWP_USER here so preempt won't give us a kernel * priority if it occurs after this point. Call CL_TRAPRET() to diff --git a/usr/src/uts/intel/s1394/Makefile b/usr/src/uts/intel/s1394/Makefile index 6368cd6b7b..fcc567d0bf 100644 --- a/usr/src/uts/intel/s1394/Makefile +++ b/usr/src/uts/intel/s1394/Makefile @@ -61,9 +61,6 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) #ALL_BUILDS = $(ALL_BUILDSONLY64) #DEF_BUILDS = $(DEF_BUILDSONLY64) -DEBUG_DEFS_DBG32 += -DTNF_DEBUG -#DEBUG_DEFS_DBG64 += -DTNF_DEBUG - # # For now, disable these warnings; maintainers should endeavor # to investigate and remove these for maximum coverage. diff --git a/usr/src/uts/intel/tavor/Makefile b/usr/src/uts/intel/tavor/Makefile index 73f9d65557..3c71a584de 100644 --- a/usr/src/uts/intel/tavor/Makefile +++ b/usr/src/uts/intel/tavor/Makefile @@ -55,12 +55,6 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) # # -# Build with no debug TNF probes enabled (by default) -# -#DEBUG_DEFS_DBG32 += -DTNF_DEBUG -#DEBUG_DEFS_DBG64 += -DTNF_DEBUG - -# # For now, disable these warnings; maintainers should endeavor # to investigate and remove these for maximum coverage. # Please do not carry these forward to new Makefiles. diff --git a/usr/src/uts/intel/tnf/Makefile b/usr/src/uts/intel/tnf/Makefile deleted file mode 100644 index fcc0fe5dbc..0000000000 --- a/usr/src/uts/intel/tnf/Makefile +++ /dev/null @@ -1,89 +0,0 @@ -# -# 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 -# -# -# uts/intel/tnf/Makefile -# -# Copyright 2006 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# -# Copyright (c) 2018, Joyent, Inc. - -# -# tnf (kernel trace driver) Makefile -# -# intel architecture dependent -# - -# -# Path to the base of the uts directory tree (usually /usr/src/uts). -# -UTSBASE = ../.. - -# -# Define the module and object file sets. -# -MODULE = tnf -OBJECTS = $(TNF_OBJS:%=$(OBJS_DIR)/%) -ROOTMODULE = $(USR_DRV_DIR)/$(MODULE) -CONF_SRCDIR = $(UTSBASE)/common/tnf - -# -# Include common rules. -# -include $(UTSBASE)/intel/Makefile.intel - -# -# Define targets -# -ALL_TARGET = $(BINARY) $(SRC_CONFILE) -INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) - -# -# For now, disable these warnings; maintainers should endeavor -# to investigate and remove these for maximum coverage. -# Please do not carry these forward to new Makefiles. -# - -CERRWARN += -_gcc=-Wno-parentheses -CERRWARN += $(CNOWARN_UNINIT) - -# needs work -$(OBJS_DIR)/tnf_writer.o := SMOFF += all_func_returns - -# -# Default build targets. -# -.KEEP_STATE: - -def: $(DEF_DEPS) - -all: $(ALL_DEPS) - -clean: $(CLEAN_DEPS) - -clobber: $(CLOBBER_DEPS) - -install: $(INSTALL_DEPS) - -# -# Include common targets. -# -include $(UTSBASE)/intel/Makefile.targ diff --git a/usr/src/uts/sparc/Makefile.sparc b/usr/src/uts/sparc/Makefile.sparc index c39489216d..ef413af6de 100644 --- a/usr/src/uts/sparc/Makefile.sparc +++ b/usr/src/uts/sparc/Makefile.sparc @@ -211,7 +211,7 @@ DRV_KMODS += log logindmux mm physmem pm poll pool DRV_KMODS += pseudo ptc ptm pts ptsl ramdisk random rsm rts sad DRV_KMODS += simnet softmac sppp sppptun sy sysevent sysmsg DRV_KMODS += spdsock -DRV_KMODS += tcp tcp6 timerfd tl tnf udp udp6 wc winlock zcons +DRV_KMODS += tcp tcp6 timerfd tl udp udp6 wc winlock zcons DRV_KMODS += ippctl DRV_KMODS += dld DRV_KMODS += ipd diff --git a/usr/src/uts/sparc/av1394/Makefile b/usr/src/uts/sparc/av1394/Makefile index 16a82b6a53..0ebd33419d 100644 --- a/usr/src/uts/sparc/av1394/Makefile +++ b/usr/src/uts/sparc/av1394/Makefile @@ -52,9 +52,6 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) ALL_BUILDS = $(ALL_BUILDSONLY64) DEF_BUILDS = $(DEF_BUILDSONLY64) -DEBUG_DEFS_DBG32 += -DTNF_DEBUG -DEBUG_DEFS_DBG64 += -DTNF_DEBUG - # # For now, disable these warnings; maintainers should endeavor # to investigate and remove these for maximum coverage. diff --git a/usr/src/uts/sparc/hci1394/Makefile b/usr/src/uts/sparc/hci1394/Makefile index 10f40d2a42..b99667787a 100644 --- a/usr/src/uts/sparc/hci1394/Makefile +++ b/usr/src/uts/sparc/hci1394/Makefile @@ -62,9 +62,6 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) ALL_BUILDS = $(ALL_BUILDSONLY64) DEF_BUILDS = $(DEF_BUILDSONLY64) -DEBUG_DEFS_DBG32 += -DTNF_DEBUG -DEBUG_DEFS_DBG64 += -DTNF_DEBUG - # # For now, disable these warnings; maintainers should endeavor # to investigate and remove these for maximum coverage. diff --git a/usr/src/uts/sparc/hermon/Makefile b/usr/src/uts/sparc/hermon/Makefile index d3c9803f39..9751078482 100644 --- a/usr/src/uts/sparc/hermon/Makefile +++ b/usr/src/uts/sparc/hermon/Makefile @@ -60,12 +60,6 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) # # -# Build with no debug TNF probes enabled (by default) -# -#DEBUG_DEFS_DBG32 += -DTNF_DEBUG -#DEBUG_DEFS_DBG64 += -DTNF_DEBUG - -# # For now, disable these warnings; maintainers should endeavor # to investigate and remove these for maximum coverage. # Please do not carry these forward to new Makefiles. diff --git a/usr/src/uts/sparc/ibmf/Makefile b/usr/src/uts/sparc/ibmf/Makefile index e8c713b3ea..2922cd0d1f 100644 --- a/usr/src/uts/sparc/ibmf/Makefile +++ b/usr/src/uts/sparc/ibmf/Makefile @@ -57,7 +57,6 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # Overrides # -#DEBUG_DEFS_DBG64 += -DTNF_DEBUG ALL_BUILDS = $(ALL_BUILDSONLY64) DEF_BUILDS = $(DEF_BUILDSONLY64) diff --git a/usr/src/uts/sparc/krtld/kobj_reloc.c b/usr/src/uts/sparc/krtld/kobj_reloc.c index 2fea631bd1..f8e5d88dea 100644 --- a/usr/src/uts/sparc/krtld/kobj_reloc.c +++ b/usr/src/uts/sparc/krtld/kobj_reloc.c @@ -38,49 +38,10 @@ #include <sys/elf.h> #include <sys/kobj.h> #include <sys/kobj_impl.h> -#include <sys/tnf.h> -#include <sys/tnf_probe.h> #include <sys/sdt.h> #include "krtld/reloc.h" - -/* - * Probe discovery support - */ -#define PROBE_MARKER_SYMBOL "__tnf_probe_version_1" -#define TAG_MARKER_SYMBOL "__tnf_tag_version_1" - -extern int tnf_splice_probes(int, tnf_probe_control_t *, tnf_tag_data_t *); - -/* - * The kernel run-time linker calls this to try to resolve a reference - * it can't otherwise resolve. We see if it's marking a probe control - * block or a probe tag block; if so, we do the resolution and return 0. - * If not, we return 1 to show that we can't resolve it, either. - */ -static int -tnf_reloc_resolve(char *symname, Addr *value_p, - Elf64_Sxword *addend_p, - long offset, - tnf_probe_control_t **probelist, - tnf_tag_data_t **taglist) -{ - if (strcmp(symname, PROBE_MARKER_SYMBOL) == 0) { - *addend_p = 0; - ((tnf_probe_control_t *)offset)->next = *probelist; - *probelist = (tnf_probe_control_t *)offset; - return (0); - } - if (strcmp(symname, TAG_MARKER_SYMBOL) == 0) { - *addend_p = 0; - *value_p = (Addr)*taglist; - *taglist = (tnf_tag_data_t *)offset; - return (0); - } - return (1); -} - #define SDT_RESTORE_MASK 0xc1f80000 #define SDT_RESTORE 0x81e80000 #define SDT_NOP 0x01000000 @@ -95,9 +56,8 @@ sdt_reloc_resolve(struct module *mp, char *symname, uint32_t *instr, long roff) sdt_probedesc_t *sdp; /* - * The "statically defined tracing" (SDT) provider for DTrace uses - * a mechanism similar to TNF, but somewhat simpler. (Surprise, - * surprise.) The SDT mechanism works by replacing calls to the + * The "statically defined tracing" (SDT) provider for DTrace. + * The SDT mechanism works by replacing calls to the * undefined routine __dtrace_probe_[name] with nop instructions. * The relocations are logged, and SDT itself will later patch the * running binary appropriately. @@ -156,8 +116,6 @@ do_relocate(struct module *mp, char *reltbl, int nreloc, int relocsize, Sym *symref; int symnum; int err = 0; - tnf_probe_control_t *probelist = NULL; - tnf_tag_data_t *taglist = NULL; reladdr = (uintptr_t)reltbl; rend = reladdr + nreloc * relocsize; @@ -255,9 +213,9 @@ do_relocate(struct module *mp, char *reltbl, int nreloc, int relocsize, } else { /* * It's global. Allow weak references. If - * the symbol is undefined, give TNF (the - * kernel probes facility) a chance to see - * if it's a probe site, and fix it up if so. + * the symbol is undefined, give dtrace + * a chance to see if it's a probe site, + * and fix it up if so. */ if (symref->st_shndx == SHN_UNDEF && sdt_reloc_resolve(mp, mp->strings + @@ -266,10 +224,7 @@ do_relocate(struct module *mp, char *reltbl, int nreloc, int relocsize, (uintptr_t)mp->text)) == 0) continue; - if (symref->st_shndx == SHN_UNDEF && - tnf_reloc_resolve(mp->strings + - symref->st_name, &symref->st_value, - &addend, off, &probelist, &taglist) != 0) { + if (symref->st_shndx == SHN_UNDEF) { if (ELF_ST_BIND(symref->st_info) != STB_WEAK) { _kobj_printf(ops, @@ -323,9 +278,6 @@ do_relocate(struct module *mp, char *reltbl, int nreloc, int relocsize, if (err) return (-1); - if (tnf_splice_probes(mp->flags & KOBJ_PRIM, probelist, taglist)) - mp->flags |= KOBJ_TNF_PROBE; - return (0); } diff --git a/usr/src/uts/sparc/krtld/mapfile b/usr/src/uts/sparc/krtld/mapfile index 23b7a3a40a..a7ca46e980 100644 --- a/usr/src/uts/sparc/krtld/mapfile +++ b/usr/src/uts/sparc/krtld/mapfile @@ -78,9 +78,6 @@ SYMBOL_SCOPE { kobj_zalloc; kobj_kdi; kobj_linkmaps; - __tnf_tag_list_head; - __tnf_probe_list_head; - tnf_changed_probe_list; boot_cpu_compatible_list; local: *; diff --git a/usr/src/uts/sparc/ml/modstubs.s b/usr/src/uts/sparc/ml/modstubs.s index 07aff93702..815ec5886f 100644 --- a/usr/src/uts/sparc/ml/modstubs.s +++ b/usr/src/uts/sparc/ml/modstubs.s @@ -142,14 +142,14 @@ fcnname/**/_info: \ .word retfcn; /* 1c */ \ .word weak /* 20 */ -/* +/* * The flag MODS_INSTALLED is stored in the stub data and is used to * indicate if a module is installed and initialized. This flag is used * instead of the mod_stub_info->mods_modinfo->mod_installed flag * to minimize the number of pointer de-references for each function * call (and also to avoid possible TLB misses which could be induced * by dereferencing these pointers.) - */ + */ #define STUB_COMMON(module, fcnname, install_fcn, retfcn, weak) \ ENTRY_NP(fcnname); \ @@ -266,7 +266,7 @@ fcnname/**/_info: \ restore SET_SIZE(stubs_common_code) -! this is just a marker for the area of text that contains stubs +! this is just a marker for the area of text that contains stubs .seg ".text" .global stubs_base stubs_base: @@ -274,11 +274,11 @@ stubs_base: /* * WARNING WARNING WARNING!!!!!! - * + * * On the MODULE macro you MUST NOT use any spaces!!! They are * significant to the preprocessor. With ansi c there is a way around this * but for some reason (yet to be investigated) ansi didn't work for other - * reasons! + * reasons! * * When zero is used as the return function, the system will call * panic if the stub can't be resolved. @@ -475,7 +475,7 @@ stubs_base: NO_UNLOAD_STUB(klmmod, lm_shutdown, nomod_zero); NO_UNLOAD_STUB(klmmod, lm_unexport, nomod_zero); NO_UNLOAD_STUB(klmmod, lm_cprresume, nomod_zero); - NO_UNLOAD_STUB(klmmod, lm_cprsuspend, nomod_zero); + NO_UNLOAD_STUB(klmmod, lm_cprsuspend, nomod_zero); NO_UNLOAD_STUB(klmmod, lm_safelock, nomod_zero); NO_UNLOAD_STUB(klmmod, lm_safemap, nomod_zero); NO_UNLOAD_STUB(klmmod, lm_has_sleep, nomod_zero); @@ -483,8 +483,8 @@ stubs_base: NO_UNLOAD_STUB(klmmod, lm_vp_active, nomod_zero); NO_UNLOAD_STUB(klmmod, lm_get_sysid, nomod_zero); NO_UNLOAD_STUB(klmmod, lm_rel_sysid, nomod_zero); - NO_UNLOAD_STUB(klmmod, lm_alloc_sysidt, nomod_minus_one); - NO_UNLOAD_STUB(klmmod, lm_free_sysidt, nomod_zero); + NO_UNLOAD_STUB(klmmod, lm_alloc_sysidt, nomod_minus_one); + NO_UNLOAD_STUB(klmmod, lm_free_sysidt, nomod_zero); NO_UNLOAD_STUB(klmmod, lm_sysidt, nomod_minus_one); END_MODULE(klmmod); #endif @@ -564,7 +564,7 @@ stubs_base: NO_UNLOAD_STUB(procfs, prgetcred, nomod_zero); NO_UNLOAD_STUB(procfs, prgetpriv, nomod_zero); NO_UNLOAD_STUB(procfs, prgetprivsize, nomod_zero); - NO_UNLOAD_STUB(procfs, prgetsecflags, nomod_zero); + NO_UNLOAD_STUB(procfs, prgetsecflags, nomod_zero); NO_UNLOAD_STUB(procfs, prgetstatus, nomod_zero); NO_UNLOAD_STUB(procfs, prgetlwpstatus, nomod_zero); NO_UNLOAD_STUB(procfs, prgetpsinfo, nomod_zero); @@ -699,7 +699,7 @@ stubs_base: WSTUB(FSS, fss_changeproj, nomod_zero); WSTUB(FSS, fss_changepset, nomod_zero); END_MODULE(FSS); -#endif +#endif /* * Stubs for fx_dptbl @@ -766,7 +766,7 @@ stubs_base: END_MODULE(zs); #endif -/* +/* * Stubs for accounting. */ #ifndef SYSACCT_MODULE @@ -961,20 +961,6 @@ stubs_base: #endif /* - * Stubs for kernel probes (tnf module). Not unloadable. - */ -#ifndef TNF_MODULE - MODULE(tnf,drv); - NO_UNLOAD_STUB(tnf, tnf_ref32_1, nomod_zero); - NO_UNLOAD_STUB(tnf, tnf_string_1, nomod_zero); - NO_UNLOAD_STUB(tnf, tnf_opaque_array_1, nomod_zero); - NO_UNLOAD_STUB(tnf, tnf_opaque32_array_1, nomod_zero); - NO_UNLOAD_STUB(tnf, tnf_struct_tag_1, nomod_zero); - NO_UNLOAD_STUB(tnf, tnf_allocate, nomod_zero); - END_MODULE(tnf); -#endif - -/* * Clustering: stubs for bootstrapping. */ #ifndef CL_BOOTSTRAP @@ -992,7 +978,7 @@ stubs_base: /* * Clustering: stubs for cluster infrastructure. - */ + */ #ifndef CL_COMM_MODULE MODULE(cl_comm,misc); NO_UNLOAD_STUB(cl_comm, cladmin, nomod_minus_one); @@ -1026,7 +1012,7 @@ stubs_base: WSTUB(pcihp, pcihp_uninit, nomod_minus_one); WSTUB(pcihp, pcihp_info, nomod_minus_one); WSTUB(pcihp, pcihp_get_cb_ops, nomod_zero); - END_MODULE(pcihp); + END_MODULE(pcihp); #endif /* diff --git a/usr/src/uts/sparc/os/syscall.c b/usr/src/uts/sparc/os/syscall.c index 07928e668c..7c48613b2b 100644 --- a/usr/src/uts/sparc/os/syscall.c +++ b/usr/src/uts/sparc/os/syscall.c @@ -52,8 +52,6 @@ #include <sys/modctl.h> #include <sys/aio_impl.h> #include <c2/audit.h> -#include <sys/tnf.h> -#include <sys/tnf_probe.h> #include <sys/machpcb.h> #include <sys/privregs.h> #include <sys/copyops.h> @@ -474,16 +472,6 @@ pre_syscall(int arg0) } } -#ifndef NPROBE - /* Kernel probe */ - if (tnf_tracing_active) { - TNF_PROBE_1(syscall_start, "syscall thread", /* CSTYLED */, - tnf_sysnum, sysnum, t->t_sysnum); - t->t_post_sys = 1; /* make sure post_syscall runs */ - repost = 1; - } -#endif /* NPROBE */ - #ifdef SYSCALLTRACE if (syscalltrace) { int i; @@ -795,17 +783,6 @@ sig_check: lwp->lwp_errno = 0; /* clear error for next time */ -#ifndef NPROBE - /* Kernel probe */ - if (tnf_tracing_active) { - TNF_PROBE_3(syscall_end, "syscall thread", /* CSTYLED */, - tnf_long, rval1, rval1, - tnf_long, rval2, rval2, - tnf_long, errno, (long)error); - repost = 1; - } -#endif /* NPROBE */ - /* * Set state to LWP_USER here so preempt won't give us a kernel * priority if it occurs after this point. Call CL_TRAPRET() to diff --git a/usr/src/uts/sparc/s1394/Makefile b/usr/src/uts/sparc/s1394/Makefile index e9c197f309..e3ff5c4b33 100644 --- a/usr/src/uts/sparc/s1394/Makefile +++ b/usr/src/uts/sparc/s1394/Makefile @@ -60,9 +60,6 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) ALL_BUILDS = $(ALL_BUILDSONLY64) DEF_BUILDS = $(DEF_BUILDSONLY64) -DEBUG_DEFS_DBG32 += -DTNF_DEBUG -DEBUG_DEFS_DBG64 += -DTNF_DEBUG - # # For now, disable these warnings; maintainers should endeavor # to investigate and remove these for maximum coverage. diff --git a/usr/src/uts/sparc/tavor/Makefile b/usr/src/uts/sparc/tavor/Makefile index b821925977..aae67ab96c 100644 --- a/usr/src/uts/sparc/tavor/Makefile +++ b/usr/src/uts/sparc/tavor/Makefile @@ -60,12 +60,6 @@ ALL_BUILDS = $(ALL_BUILDSONLY64) DEF_BUILDS = $(DEF_BUILDSONLY64) # -# Build with no debug TNF probes enabled (by default) -# -#DEBUG_DEFS_DBG32 += -DTNF_DEBUG -#DEBUG_DEFS_DBG64 += -DTNF_DEBUG - -# # For now, disable these warnings; maintainers should endeavor # to investigate and remove these for maximum coverage. # Please do not carry these forward to new Makefiles. diff --git a/usr/src/uts/sparc/tnf/Makefile b/usr/src/uts/sparc/tnf/Makefile deleted file mode 100644 index 44de22b9e4..0000000000 --- a/usr/src/uts/sparc/tnf/Makefile +++ /dev/null @@ -1,90 +0,0 @@ -# -# 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 -# -# -# uts/sparc/tnf/Makefile -# Copyright 2006 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# - -# -# tnf (kernel trace driver) Makefile -# -# sparc architecture dependent -# - -# -# Path to the base of the uts directory tree (usually /usr/src/uts). -# -UTSBASE = ../.. - -# -# Define the module and object file sets. -# -MODULE = tnf -OBJECTS = $(TNF_OBJS:%=$(OBJS_DIR)/%) -ROOTMODULE = $(USR_DRV_DIR)/$(MODULE) -CONF_SRCDIR = $(UTSBASE)/common/tnf - -# -# Include common rules. -# -include $(UTSBASE)/sparc/Makefile.sparc - -# -# Define targets -# -ALL_TARGET = $(BINARY) $(SRC_CONFILE) -INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) - -# -# Overrides. -# -CCMODE = -Xt -CFLAGS += $(CCVERBOSE) - -# -# For now, disable these warnings; maintainers should endeavor -# to investigate and remove these for maximum coverage. -# Please do not carry these forward to new Makefiles. -# - -CERRWARN += -_gcc=-Wno-parentheses -CERRWARN += $(CNOWARN_UNINIT) - -# -# Default build targets. -# -.KEEP_STATE: - -def: $(DEF_DEPS) - -all: $(ALL_DEPS) - -clean: $(CLEAN_DEPS) - -clobber: $(CLOBBER_DEPS) - -install: $(INSTALL_DEPS) - -# -# Include common targets. -# -include $(UTSBASE)/sparc/Makefile.targ diff --git a/usr/src/uts/sun4/os/trap.c b/usr/src/uts/sun4/os/trap.c index 206b7f1091..795f2560ec 100644 --- a/usr/src/uts/sun4/os/trap.c +++ b/usr/src/uts/sun4/os/trap.c @@ -37,8 +37,6 @@ #include <sys/archsystm.h> #include <sys/machsystm.h> #include <sys/fpu/fpusystm.h> -#include <sys/tnf.h> -#include <sys/tnf_probe.h> #include <sys/simulate.h> #include <sys/ftrace.h> #include <sys/ontrap.h> @@ -216,9 +214,6 @@ trap(struct regs *rp, caddr_t addr, uint32_t type, uint32_t mmu_fsr) mstate = LMS_TRAP; break; } - /* Kernel probe */ - TNF_PROBE_1(thread_state, "thread", /* CSTYLED */, - tnf_microstate, state, (char)mstate); mstate = new_mstate(curthread, mstate); siginfo.si_signo = 0; stepped = @@ -1223,9 +1218,6 @@ out: /* We can't get here from a system trap */ ASSERT(type & T_USER); trap_rtt(); (void) new_mstate(curthread, mstate); - /* Kernel probe */ - TNF_PROBE_1(thread_state, "thread", /* CSTYLED */, - tnf_microstate, state, LMS_USER); TRACE_0(TR_FAC_TRAP, TR_C_TRAP_HANDLER_EXIT, "C_trap_handler_exit"); return; |