Changeset 53647 in vbox
- Timestamp:
- Jan 2, 2015 12:17:41 PM (10 years ago)
- Location:
- trunk/src/VBox/ExtPacks/VBoxDTrace
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ExtPacks/VBoxDTrace/VBoxDTrace/Makefile.kmk
r53646 r53647 33 33 34 34 PROGRAMS += VBoxDTrace 35 VBoxDTrace_TEMPLATE = VBOXR3NP 35 VBoxDTrace_TEMPLATE = VBOXR3NPEXE 36 36 VBoxDTrace_INCS = \ 37 37 ../include \ -
trunk/src/VBox/ExtPacks/VBoxDTrace/include/VBoxDTraceTypes.h
r53646 r53647 39 39 struct modctl; 40 40 41 typedef unsigned char uchar_t; 42 typedef unsigned int uint_t; 43 typedef uintptr_t ulong_t; 44 typedef uintptr_t pc_t; 45 typedef uint32_t zoneid_t; 46 typedef char *caddr_t; 47 typedef uint64_t hrtime_t; 48 typedef RTCPUID processorid_t; 49 typedef RTCCUINTREG greg_t; 50 typedef unsigned int model_t; 41 typedef unsigned char uchar_t; 42 typedef unsigned int uint_t; 43 typedef uintptr_t ulong_t; 44 typedef uintptr_t pc_t; 45 typedef unsigned int model_t; 46 typedef uint32_t zoneid_t; 47 typedef RTCPUID processorid_t; 48 49 #define NANOSEC RT_NS_1SEC 50 #define MILLISEC RT_MS_1SEC 51 52 #if defined(RT_ARCH_X86) 53 # ifndef __i386 54 # define __i386 1 55 # endif 56 57 #elif defined(RT_ARCH_AMD64) 58 # ifndef __x86_64 59 # define __x86_64 1 60 # endif 61 62 #else 63 # error "unsupported arch!" 64 #endif 65 66 /** Mark a cast added when porting the code to VBox. 67 * Avoids lots of \#ifdef VBOX otherwise needed to mark up the changes. */ 68 #define VBDTCAST(a_Type) (a_Type) 69 /** Mark a type change made when porting the code to VBox. 70 * This is usually signed -> unsigned type changes that avoids a whole lot of 71 * comparsion warnings. */ 72 #define VBDTTYPE(a_VBox, a_Org) a_VBox 73 /** Mark missing void in a parameter list. */ 74 #define VBDTVOID void 75 /** Mark missing static in a function definition. */ 76 #define VBDTSTATIC static 77 #define VBDTUNASS(a_Value) = a_Value 78 79 /* 80 * string 81 */ 82 #if defined(_MSC_VER) || defined(IN_RING0) 83 # define bcopy(a_pSrc, a_pDst, a_cb) memmove(a_pDst, a_pSrc, a_cb) 84 # define bzero(a_pDst, a_cb) RT_BZERO(a_pDst, a_cb) 85 # define bcmp(a_p1, a_p2, a_cb) memcmp(a_p1, a_p2, a_cb) 86 # define snprintf RTStrPrintf 87 #endif 88 89 90 /* 91 * CTF - probably needs to be ported wholesale or smth. 92 */ 93 #define CTF_MODEL_NATIVE 1 94 typedef struct VBoxDtCtfFile ctf_file_t; 95 typedef intptr_t ctf_id_t; 96 97 98 #ifdef IN_RING0 99 100 /* 101 * Kernel stuff... 102 */ 103 typedef char *caddr_t; 104 typedef uint64_t hrtime_t; 105 typedef RTCCUINTREG greg_t; 106 typedef RTUID uid_t; 107 typedef RTPROCESS pid_t; 108 109 #define P2ROUNDUP(uWhat, uAlign) ( ((uWhat) + (uAlign) - 1) & ~(uAlign - 1) ) 110 #define IS_P2ALIGNED(uWhat, uAlign) ( !((uWhat) & ((uAlign) - 1)) ) 111 #define roundup(uWhat, uUnit) ( ( (uWhat) + ((uUnit) - 1)) / (uUnit) * (uUnit) ) 112 #define MIN(a1, a2) RT_MIN(a1, a2) 113 114 #define NBBY 8 115 #define NCPU RTCPUSET_MAX_CPUS 116 #define B_FALSE (0) 117 #define B_TRUE (1) 118 #define CPU_ON_INTR(a_pCpu) (false) 119 120 #define KERNELBASE VBoxDtGetKernelBase() 121 uintptr_t VBoxDtGetKernelBase(void); 122 51 123 52 124 typedef struct VBoxDtCred … … 162 234 163 235 164 #if 1 /* */165 166 typedef RTUID uid_t;167 typedef RTPROCESS pid_t;168 #endif169 170 #define B_FALSE (0)171 #define B_TRUE (1)172 #define NANOSEC RT_NS_1SEC173 #define MILLISEC RT_MS_1SEC174 #define NBBY 8175 #define NCPU RTCPUSET_MAX_CPUS176 #define P2ROUNDUP(uWhat, uAlign) ( ((uWhat) + (uAlign) - 1) & ~(uAlign - 1) )177 #define IS_P2ALIGNED(uWhat, uAlign) ( !((uWhat) & ((uAlign) - 1)) )178 #define roundup(uWhat, uUnit) ( ( (uWhat) + ((uUnit) - 1)) / (uUnit) * (uUnit) )179 #define MIN(a1, a2) RT_MIN(a1, a2)180 181 #define CPU_ON_INTR(a_pCpu) (false)182 183 #define KERNELBASE VBoxDtGetKernelBase()184 uintptr_t VBoxDtGetKernelBase(void);185 186 187 #if defined(RT_ARCH_X86)188 # ifndef __i386189 # define __i386 1190 # endif191 192 #elif defined(RT_ARCH_AMD64)193 # ifndef __x86_64194 # define __x86_64 1195 # endif196 197 #else198 # error "unsupported arch!"199 #endif200 201 /** Mark a cast added when porting the code to VBox.202 * Avoids lots of \#ifdef VBOX otherwise needed to mark up the changes. */203 #define VBDTCAST(a_Type) (a_Type)204 /** Mark a type change made when porting the code to VBox.205 * This is usually signed -> unsigned type changes that avoids a whole lot of206 * comparsion warnings. */207 #define VBDTTYPE(a_VBox, a_Org) a_VBox208 /** Mark missing void in a parameter list. */209 #define VBDTVOID void210 /** Mark missing static in a function definition. */211 #define VBDTSTATIC static212 #define VBDTUNASS(a_Value) = a_Value213 214 /*215 * string216 */217 #define bcopy(a_pSrc, a_pDst, a_cb) memmove(a_pDst, a_pSrc, a_cb)218 #define bzero(a_pDst, a_cb) RT_BZERO(a_pDst, a_cb)219 #define bcmp(a_p1, a_p2, a_cb) memcmp(a_p1, a_p2, a_cb)220 #define snprintf RTStrPrintf221 222 223 /*224 * CTF - probably needs to be ported wholesale or smth.225 */226 #define CTF_MODEL_NATIVE 1227 typedef struct VBoxDtCtfFile ctf_file_t;228 typedef intptr_t ctf_id_t;229 230 #ifdef IN_RING0231 232 236 /* 233 237 * Errno defines compatible with the CRT of the given host... -
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/dtrace.c
r53646 r53647 149 149 static char **g_argv; 150 150 static int g_argc; 151 #ifndef VBOX /* No linking. */ 151 152 static char **g_objv; 152 153 static int g_objc; 154 #endif 153 155 static dtrace_cmd_t *g_cmdv; 154 156 static int g_cmdc; … … 171 173 static int g_grabanon = 0; 172 174 static const char *g_ofile = NULL; 173 #ifndef _MSC_VER /* stdout isn't a constant usablein C code. */175 #ifndef VBOX /* stdout isn't a necessarily constant usable like this in C code. */ 174 176 static FILE *g_ofp = stdout; 175 177 #else … … 707 709 } 708 710 711 #ifndef VBOX 709 712 /* 710 713 * Link the specified D program in DOF form into an ELF file for use in either … … 735 738 dfatal("failed to link %s %s", dcp->dc_desc, dcp->dc_name); 736 739 } 740 #endif /* !VBOX */ 737 741 738 742 /*ARGSUSED*/ … … 1252 1256 int done = 0, mode = 0; 1253 1257 int err, i; 1258 #ifndef VBOX 1254 1259 char c, *p, **v; 1260 #else 1261 int c; 1262 char *p, **v; 1263 #endif 1255 1264 struct ps_prochandle *P; 1256 1265 pid_t pid; … … 1262 1271 if (RT_FAILURE(err)) 1263 1272 return RTMsgInitFailure(err); 1264 #endif 1265 #ifdef _MSC_VER 1273 1266 1274 g_ofp = stdout; 1267 1275 #endif … … 1352 1360 1353 1361 case 'G': 1362 #ifndef VBOX 1354 1363 g_mode = DMODE_LINK; 1355 1364 g_oflags |= DTRACE_O_NODEV; … … 1358 1367 mode++; 1359 1368 break; 1369 #else 1370 fprintf(stderr, "%s: -G is not supported\n", g_pname); 1371 return (E_USAGE); 1372 #endif 1360 1373 1361 1374 case 'l': … … 1479 1492 */ 1480 1493 if (g_mode == DMODE_LINK) { 1494 #ifndef VBOX /* No link mode. */ 1481 1495 (void) dtrace_setopt(g_dtp, "linkmode", "dynamic"); 1482 1496 (void) dtrace_setopt(g_dtp, "unodefs", NULL); … … 1493 1507 */ 1494 1508 g_argc = 1; 1509 #else /* VBOX */ 1510 AssertFailed(); 1511 #endif /* VBOX */ 1495 1512 } else if (g_mode == DMODE_ANON) 1496 1513 (void) dtrace_setopt(g_dtp, "linkmode", "primary"); … … 1812 1829 1813 1830 case DMODE_LINK: 1831 #ifndef VBOX /* No link mode. */ 1814 1832 if (g_cmdc == 0) { 1815 1833 (void) fprintf(stderr, "%s: -G requires one or more " … … 1835 1853 dtrace_close(g_dtp); 1836 1854 return (g_status); 1855 #else /* VBOX */ 1856 AssertFailed(); 1857 dtrace_close(g_dtp); 1858 return (E_USAGE); 1859 #endif /* VBOX */ 1837 1860 1838 1861 case DMODE_LIST: -
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/uts/common/dtrace/dtrace.c
r53645 r53647 110 110 # include <iprt/asm-amd64-x86.h> 111 111 # define dtrace_casptr(a_ppvDst, a_pvOld, a_pvNew) \ 112 VBoxDtCompareAndSwapPtr( a_ppvDst, a_pvOld, a_pvNew)112 VBoxDtCompareAndSwapPtr((void * volatile *)a_ppvDst, a_pvOld, a_pvNew) 113 113 DECLINLINE(void *) VBoxDtCompareAndSwapPtr(void * volatile *ppvDst, void *pvOld, void *pvNew) 114 114 { … … 9794 9794 dtrace_recdesc_t *rec; 9795 9795 dtrace_state_t *state = ecb->dte_state; 9796 dtrace_optval_t *opt = state->dts_options, nframes , strsize;9796 dtrace_optval_t *opt = state->dts_options, nframes VBDTUNASS(0), strsize; 9797 9797 uint64_t arg = desc->dtad_arg; 9798 9798
Note:
See TracChangeset
for help on using the changeset viewer.