tclDTrace.dGo to the documentation of this file.00001 /* 00002 * tclDTrace.d -- 00003 * 00004 * Tcl DTrace provider. 00005 * 00006 * Copyright (c) 2007 Daniel A. Steffen <das@users.sourceforge.net> 00007 * 00008 * See the file "license.terms" for information on usage and redistribution of 00009 * this file, and for a DISCLAIMER OF ALL WARRANTIES. 00010 * 00011 * RCS: @(#) $Id: tclDTrace.d,v 1.2 2007/12/13 15:23:16 dgp Exp $ 00012 */ 00013 00014 typedef struct Tcl_Obj Tcl_Obj; 00015 00016 /* 00017 * Tcl DTrace probes 00018 */ 00019 00020 provider tcl { 00021 /***************************** proc probes *****************************/ 00022 /* 00023 * tcl*:::proc-entry probe 00024 * triggered immediately before proc bytecode execution 00025 * arg0: proc name (string) 00026 * arg1: number of arguments (int) 00027 * arg2: array of proc argument objects (Tcl_Obj**) 00028 */ 00029 probe proc__entry(char* name, int objc, Tcl_Obj **objv); 00030 /* 00031 * tcl*:::proc-return probe 00032 * triggered immediately after proc bytecode execution 00033 * arg0: proc name (string) 00034 * arg1: return code (int) 00035 */ 00036 probe proc__return(char* name, int code); 00037 /* 00038 * tcl*:::proc-result probe 00039 * triggered after proc-return probe and result processing 00040 * arg0: proc name (string) 00041 * arg1: return code (int) 00042 * arg2: proc result (string) 00043 * arg3: proc result object (Tcl_Obj*) 00044 */ 00045 probe proc__result(char* name, int code, char* result, Tcl_Obj *resultobj); 00046 /* 00047 * tcl*:::proc-args probe 00048 * triggered before proc-entry probe, gives access to string 00049 * representation of proc arguments 00050 * arg0: proc name (string) 00051 * arg1-arg9: proc arguments or NULL (strings) 00052 */ 00053 probe proc__args(char* name, char* arg1, char* arg2, char* arg3, 00054 char* arg4, char* arg5, char* arg6, char* arg7, char* arg8, 00055 char* arg9); 00056 /* 00057 * tcl*:::proc-info probe 00058 * triggered before proc-entry probe, gives access to TIP 280 00059 * information for the proc invocation (i.e. [info frame 0]) 00060 * arg0: TIP 280 cmd (string) 00061 * arg1: TIP 280 type (string) 00062 * arg2: TIP 280 proc (string) 00063 * arg3: TIP 280 file (string) 00064 * arg4: TIP 280 line (int) 00065 * arg5: TIP 280 level (int) 00066 */ 00067 probe proc__info(char* cmd, char* type, char* proc, char* file, int line, 00068 int level); 00069 00070 /***************************** cmd probes ******************************/ 00071 /* 00072 * tcl*:::cmd-entry probe 00073 * triggered immediately before commmand execution 00074 * arg0: command name (string) 00075 * arg1: number of arguments (int) 00076 * arg2: array of command argument objects (Tcl_Obj**) 00077 */ 00078 probe cmd__entry(char* name, int objc, Tcl_Obj **objv); 00079 /* 00080 * tcl*:::cmd-return probe 00081 * triggered immediately after commmand execution 00082 * arg0: command name (string) 00083 * arg1: return code (int) 00084 */ 00085 probe cmd__return(char* name, int code); 00086 /* 00087 * tcl*:::cmd-result probe 00088 * triggered after cmd-return probe and result processing 00089 * arg0: command name (string) 00090 * arg1: return code (int) 00091 * arg2: command result (string) 00092 * arg3: command result object (Tcl_Obj*) 00093 */ 00094 probe cmd__result(char* name, int code, char* result, Tcl_Obj *resultobj); 00095 /* 00096 * tcl*:::cmd-args probe 00097 * triggered before cmd-entry probe, gives access to string 00098 * representation of command arguments 00099 * arg0: command name (string) 00100 * arg1-arg9: command arguments or NULL (strings) 00101 */ 00102 probe cmd__args(char* name, char* arg1, char* arg2, char* arg3, 00103 char* arg4, char* arg5, char* arg6, char* arg7, char* arg8, 00104 char* arg9); 00105 /* 00106 * tcl*:::cmd-info probe 00107 * triggered before cmd-entry probe, gives access to TIP 280 00108 * information for the command invocation (i.e. [info frame 0]) 00109 * arg0: TIP 280 cmd (string) 00110 * arg1: TIP 280 type (string) 00111 * arg2: TIP 280 proc (string) 00112 * arg3: TIP 280 file (string) 00113 * arg4: TIP 280 line (int) 00114 * arg5: TIP 280 level (int) 00115 */ 00116 probe cmd__info(char* cmd, char* type, char* proc, char* file, int line, 00117 int level); 00118 00119 /***************************** inst probes *****************************/ 00120 /* 00121 * tcl*:::inst-start probe 00122 * triggered immediately before execution of a bytecode 00123 * arg0: bytecode name (string) 00124 * arg1: depth of stack (int) 00125 * arg2: top of stack (Tcl_Obj**) 00126 */ 00127 probe inst__start(char* name, int depth, Tcl_Obj **stack); 00128 /* 00129 * tcl*:::inst-done probe 00130 * triggered immediately after execution of a bytecode 00131 * arg0: bytecode name (string) 00132 * arg1: depth of stack (int) 00133 * arg2: top of stack (Tcl_Obj**) 00134 */ 00135 probe inst__done(char* name, int depth, Tcl_Obj **stack); 00136 00137 /***************************** obj probes ******************************/ 00138 /* 00139 * tcl*:::obj-create probe 00140 * triggered immediately after a new Tcl_Obj has been created 00141 * arg0: object created (Tcl_Obj*) 00142 */ 00143 probe obj__create(Tcl_Obj* obj); 00144 /* 00145 * tcl*:::obj-free probe 00146 * triggered immediately before a Tcl_Obj is freed 00147 * arg0: object to be freed (Tcl_Obj*) 00148 */ 00149 probe obj__free(Tcl_Obj* obj); 00150 00151 /***************************** tcl probes ******************************/ 00152 /* 00153 * tcl*:::tcl-probe probe 00154 * triggered when the ::tcl::dtrace command is called 00155 * arg0-arg9: command arguments (strings) 00156 */ 00157 probe tcl__probe(char* arg0, char* arg1, char* arg2, char* arg3, 00158 char* arg4, char* arg5, char* arg6, char* arg7, char* arg8, 00159 char* arg9); 00160 }; 00161 00162 /* 00163 * Tcl types and constants for use in DTrace scripts 00164 */ 00165 00166 typedef struct Tcl_ObjType { 00167 char *name; 00168 void *freeIntRepProc; 00169 void *dupIntRepProc; 00170 void *updateStringProc; 00171 void *setFromAnyProc; 00172 } Tcl_ObjType; 00173 00174 struct Tcl_Obj { 00175 int refCount; 00176 char *bytes; 00177 int length; 00178 Tcl_ObjType *typePtr; 00179 union { 00180 long longValue; 00181 double doubleValue; 00182 void *otherValuePtr; 00183 int64_t wideValue; 00184 struct { 00185 void *ptr1; 00186 void *ptr2; 00187 } twoPtrValue; 00188 struct { 00189 void *ptr; 00190 unsigned long value; 00191 } ptrAndLongRep; 00192 } internalRep; 00193 }; 00194 00195 enum return_codes { 00196 TCL_OK = 0, 00197 TCL_ERROR, 00198 TCL_RETURN, 00199 TCL_BREAK, 00200 TCL_CONTINUE 00201 }; 00202 00203 #pragma D attributes Evolving/Evolving/Common provider tcl provider 00204 #pragma D attributes Private/Private/Common provider tcl module 00205 #pragma D attributes Private/Private/Common provider tcl function 00206 #pragma D attributes Evolving/Evolving/Common provider tcl name 00207 #pragma D attributes Evolving/Evolving/Common provider tcl args 00208 00209 /* 00210 * Local Variables: 00211 * mode: c 00212 * c-basic-offset: 4 00213 * fill-column: 78 00214 * End: 00215 */
Generated on Wed Mar 12 12:18:15 2008 by 1.5.1 |