Changeset 53652 in vbox for trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace
- Timestamp:
- Jan 2, 2015 12:19:17 PM (10 years ago)
- Location:
- trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common
- Files:
-
- 27 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_aggregate.c
r53634 r53652 25 25 */ 26 26 27 #ifndef VBOX 27 28 #pragma ident "%Z%%M% %I% %E% SMI" 28 29 … … 35 36 #include <alloca.h> 36 37 #include <limits.h> 38 #else /* VBOX */ 39 # include "dt_impl.h" 40 # ifdef _MSC_VER 41 # pragma warning(disable:4018) /* signed/unsigned comparsion mismatch warning */ 42 # endif 43 # include <iprt/mp.h> 44 #endif /* VBOX */ 37 45 38 46 #define DTRACE_AHASHSIZE 32779 /* big 'ol prime */ … … 43 51 * they are protected by a global static lock, dt_qsort_lock. 44 52 */ 53 #ifndef VBOX 45 54 static pthread_mutex_t dt_qsort_lock = PTHREAD_MUTEX_INITIALIZER; 55 #else 56 RTCRITSECT dt_qsort_lock; 57 #endif 46 58 47 59 static int dt_revsort; … … 247 259 dt_aggregate_usym(dtrace_hdl_t *dtp, uint64_t *data) 248 260 { 261 #ifndef VBOX 249 262 uint64_t pid = data[0]; 250 263 uint64_t *pc = &data[1]; … … 265 278 dt_proc_unlock(dtp, P); 266 279 dt_proc_release(dtp, P); 280 #endif 267 281 } 268 282 … … 270 284 dt_aggregate_umod(dtrace_hdl_t *dtp, uint64_t *data) 271 285 { 286 #ifndef VBOX 272 287 uint64_t pid = data[0]; 273 288 uint64_t *pc = &data[1]; … … 288 303 dt_proc_unlock(dtp, P); 289 304 dt_proc_release(dtp, P); 305 #endif 290 306 } 291 307 … … 293 309 dt_aggregate_sym(dtrace_hdl_t *dtp, uint64_t *data) 294 310 { 311 #ifndef VBOX 295 312 GElf_Sym sym; 296 313 uint64_t *pc = data; … … 298 315 if (dtrace_lookup_by_addr(dtp, *pc, &sym, NULL) == 0) 299 316 *pc = sym.st_value; 317 #endif 300 318 } 301 319 … … 303 321 dt_aggregate_mod(dtrace_hdl_t *dtp, uint64_t *data) 304 322 { 323 #ifndef VBOX 305 324 uint64_t *pc = data; 306 325 dt_module_t *dmp; … … 325 344 } 326 345 } 346 #endif 327 347 } 328 348 … … 1008 1028 assert(agp->dtat_cpus == NULL); 1009 1029 1030 #ifndef VBOX 1010 1031 agp->dtat_maxcpu = dt_sysconf(dtp, _SC_CPUID_MAX) + 1; 1011 1032 agp->dtat_ncpu = dt_sysconf(dtp, _SC_NPROCESSORS_MAX); 1033 #else 1034 agp->dtat_maxcpu = RTMpGetMaxCpuId() + 1; 1035 agp->dtat_ncpu = RTMpGetCount(); 1036 #endif 1012 1037 agp->dtat_cpus = malloc(agp->dtat_ncpu * sizeof (processorid_t)); 1013 1038 … … 1243 1268 sorted[i++] = h; 1244 1269 1270 #ifndef VBOX 1245 1271 (void) pthread_mutex_lock(&dt_qsort_lock); 1272 #else 1273 RTCritSectEnter(&dt_qsort_lock); 1274 #endif 1246 1275 1247 1276 if (sfunc == NULL) { … … 1257 1286 } 1258 1287 1288 #ifndef VBOX 1259 1289 (void) pthread_mutex_unlock(&dt_qsort_lock); 1290 #else 1291 RTCritSectLeave(&dt_qsort_lock); 1292 #endif 1260 1293 1261 1294 for (i = 0; i < nentries; i++) { … … 1652 1685 * comparison and sorting. 1653 1686 */ 1687 #ifndef VBOX 1654 1688 (void) pthread_mutex_lock(&dt_qsort_lock); 1689 #else 1690 RTCritSectEnter(&dt_qsort_lock); 1691 #endif 1655 1692 1656 1693 qsort(sorted, nentries, sizeof (dt_ahashent_t *), … … 1681 1718 1682 1719 if ((nbundle = dt_zalloc(dtp, bundlesize)) == NULL) { 1720 #ifndef VBOX 1683 1721 (void) pthread_mutex_unlock(&dt_qsort_lock); 1722 #else 1723 RTCritSectLeave(&dt_qsort_lock); 1724 #endif 1684 1725 goto out; 1685 1726 } 1686 1727 1687 for (j = start; j < i; j++) {1728 for (j = VBDTCAST(int)start; j < i; j++) { 1688 1729 dtrace_aggvarid_t id = dt_aggregate_aggvarid(sorted[j]); 1689 1730 … … 1731 1772 dt_aggregate_bundlecmp); 1732 1773 1774 #ifndef VBOX 1733 1775 (void) pthread_mutex_unlock(&dt_qsort_lock); 1776 #else 1777 RTCritSectLeave(&dt_qsort_lock); 1778 #endif 1734 1779 1735 1780 /* -
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_as.h
r53634 r53652 28 28 #define _DT_AS_H 29 29 30 #ifndef VBOX 30 31 #pragma ident "%Z%%M% %I% %E% SMI" 31 32 32 33 #include <sys/types.h> 34 #endif 33 35 #include <sys/dtrace.h> 34 36 -
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_buf.h
r53634 r53652 28 28 #define _DT_BUF_H 29 29 30 #ifndef VBOX 30 31 #pragma ident "%Z%%M% %I% %E% SMI" 32 #endif 31 33 32 34 #ifdef __cplusplus -
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_decl.h
r53634 r53652 28 28 #define _DT_DECL_H 29 29 30 #ifndef VBOX 30 31 #pragma ident "%Z%%M% %I% %E% SMI" 31 32 32 33 #include <sys/types.h> 34 #endif 33 35 #include <libctf.h> 34 36 #include <dtrace.h> -
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_dof.h
r53634 r53652 28 28 #define _DT_DOF_H 29 29 30 #ifndef VBOX 30 31 #pragma ident "%Z%%M% %I% %E% SMI" 32 #endif 31 33 32 34 #include <dtrace.h> -
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_error.c
r53634 r53652 24 24 */ 25 25 26 #ifndef VBOX 26 27 #include <strings.h> 28 #endif 27 29 #include <dt_impl.h> 28 30 -
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_errtags.h
r53634 r53652 28 28 #define _DT_ERRTAGS_H 29 29 30 #ifndef VBOX 30 31 #pragma ident "%Z%%M% %I% %E% SMI" 32 #endif 31 33 32 34 #ifdef __cplusplus -
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_ident.h
r53634 r53652 28 28 #define _DT_IDENT_H 29 29 30 #ifndef VBOX 30 31 #pragma ident "%Z%%M% %I% %E% SMI" 32 #endif 31 33 32 34 #include <libctf.h> -
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_impl.h
r53634 r53652 28 28 #define _DT_IMPL_H 29 29 30 #ifndef VBOX 30 31 #include <sys/param.h> 31 32 #include <sys/objfs.h> … … 35 36 #include <gelf.h> 36 37 #include <synch.h> 38 #else /* VBOX */ 39 # include <setjmp.h> 40 # include <libctf.h> 41 # include <dtrace.h> 42 # include <errno.h> 43 # include <iprt/assert.h> 44 # define assert(expr) Assert(expr) 45 #endif /* VBOX*/ 46 37 47 38 48 #ifdef __cplusplus … … 79 89 uint_t (*do_syminit)(struct dt_module *); 80 90 void (*do_symsort)(struct dt_module *); 91 #ifndef VBOX 81 92 GElf_Sym *(*do_symname)(struct dt_module *, 82 93 const char *, GElf_Sym *, uint_t *); 83 94 GElf_Sym *(*do_symaddr)(struct dt_module *, 84 95 GElf_Addr, GElf_Sym *, uint_t *); 96 #endif 85 97 } dt_modops_t; 86 98 … … 105 117 struct dt_module *dm_next; /* pointer to next module in hash chain */ 106 118 const dt_modops_t *dm_ops; /* pointer to data model's ops vector */ 119 #ifndef VBOX 107 120 Elf *dm_elf; /* libelf handle for module object */ 108 121 objfs_info_t dm_info; /* object filesystem private info */ 122 #endif 109 123 ctf_sect_t dm_symtab; /* symbol table for module */ 110 124 ctf_sect_t dm_strtab; /* string table for module */ … … 121 135 uint_t dm_flags; /* module flags (see below) */ 122 136 int dm_modid; /* modinfo(1M) module identifier */ 137 #ifndef VBOX 123 138 GElf_Addr dm_text_va; /* virtual address of text section */ 124 139 GElf_Xword dm_text_size; /* size in bytes of text section */ … … 127 142 GElf_Addr dm_bss_va; /* virtual address of BSS */ 128 143 GElf_Xword dm_bss_size; /* size in bytes of BSS */ 144 #endif 129 145 dt_idhash_t *dm_extern; /* external symbol definitions */ 130 146 } dt_module_t; … … 296 312 void *dt_bufarg; /* buffered handler argument */ 297 313 dt_dof_t dt_dof; /* DOF generation buffers (see dt_dof.c) */ 314 #ifndef VBOX 298 315 struct utsname dt_uts; /* uname(2) information for system */ 316 #endif 299 317 dt_list_t dt_lib_dep; /* scratch linked-list of lib dependencies */ 300 318 dt_list_t dt_lib_dep_sorted; /* dependency sorted library list */ … … 651 669 652 670 #endif /* _DT_IMPL_H */ 671 -
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_inttab.h
r53634 r53652 28 28 #define _DT_INTTAB_H 29 29 30 #ifndef VBOX 30 31 #pragma ident "%Z%%M% %I% %E% SMI" 32 #endif 31 33 32 34 #include <dtrace.h> -
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_list.h
r53634 r53652 28 28 #define _DT_LIST_H 29 29 30 #ifndef VBOX 30 31 #pragma ident "%Z%%M% %I% %E% SMI" 32 #endif 31 33 32 34 #ifdef __cplusplus -
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_module.h
r53634 r53652 28 28 #define _DT_MODULE_H 29 29 30 #ifndef VBOX 30 31 #pragma ident "%Z%%M% %I% %E% SMI" 32 #endif 31 33 32 34 #include <dt_impl.h> -
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_open.c
r53634 r53652 24 24 */ 25 25 26 #ifndef VBOX 26 27 #include <sys/types.h> 27 28 #include <sys/modctl.h> 28 29 #include <sys/systeminfo.h> 29 #include <sys/resource.h>30 30 31 31 #include <libelf.h> … … 40 40 #include <assert.h> 41 41 42 #define _POSIX_PTHREAD_SEMANTICS 43 #include <dirent.h> 44 #undef _POSIX_PTHREAD_SEMANTICS 42 #ifndef _MSC_VER 43 # define _POSIX_PTHREAD_SEMANTICS 44 # include <dirent.h> 45 # undef _POSIX_PTHREAD_SEMANTICS 46 #endif 47 48 #else /* VBOX */ 49 # ifndef _MSC_VER 50 # include <sys/resource.h> 51 # include <unistd.h> 52 # else 53 # include <io.h> 54 # endif 55 #endif /* VBOX */ 45 56 46 57 #include <dt_impl.h> … … 662 673 int _dtrace_debug = 0; /* debug messages enabled (off) */ 663 674 const char *const _dtrace_version = DT_VERS_STRING; /* API version string */ 675 #ifndef VBOX 664 676 int _dtrace_rdvers = RD_VERSION; /* rtld_db feature version */ 677 #endif 665 678 666 679 typedef struct dt_fdlist { … … 670 683 } dt_fdlist_t; 671 684 685 686 #ifdef VBOX 687 # include <iprt/critsect.h> 688 extern RTCRITSECT dt_qsort_lock; /* dt_aggregate.c */ 689 690 void dtrace_init(void) 691 #else /* !VBOX */ 672 692 #pragma init(_dtrace_init) 673 693 void 674 694 _dtrace_init(void) 695 #endif /* !VBOX */ 675 696 { 676 697 _dtrace_debug = getenv("DTRACE_DEBUG") != NULL; 677 698 699 #ifndef VBOX 678 700 for (; _dtrace_rdvers > 0; _dtrace_rdvers--) { 679 701 if (rd_init(_dtrace_rdvers) == RD_OK) 680 702 break; 681 703 } 704 #else 705 RTCritSectInit(&dt_qsort_lock); 706 #endif 682 707 } 683 708 … … 692 717 } 693 718 719 #ifndef VBOX 694 720 static void 695 721 dt_provmod_open(dt_provmod_t **provmod, dt_fdlist_t *dfp) … … 745 771 (void) closedir(dirp); 746 772 } 773 #endif /* !VBOX */ 747 774 748 775 static void … … 763 790 dt_get_sysinfo(int cmd, char *buf, size_t len) 764 791 { 792 #ifndef VBOX 765 793 ssize_t rv = sysinfo(cmd, buf, len); 766 794 char *p = buf; … … 771 799 while ((p = strchr(p, '.')) != NULL) 772 800 *p++ = '_'; 773 801 #else 802 snprintf(buf, len, "%s", "Unknown"); 803 #endif 774 804 return (buf); 775 805 } … … 785 815 dt_provmod_t *provmod = NULL; 786 816 int i, err; 817 #ifndef _MSC_VER 787 818 struct rlimit rl; 819 #endif 788 820 789 821 const dt_intrinsic_t *dinp; … … 795 827 ctf_arinfo_t ctr; 796 828 829 #ifndef VBOX 797 830 dt_fdlist_t df = { NULL, 0, 0 }; 831 #endif 798 832 799 833 char isadef[32], utsdef[32]; 834 #ifndef VBOX 800 835 char s1[64], s2[64]; 836 #endif 801 837 802 838 if (version <= 0) … … 830 866 return (set_open_errno(dtp, errp, EINVAL)); 831 867 868 #ifndef VBOX 832 869 if (elf_version(EV_CURRENT) == EV_NONE) 833 870 return (set_open_errno(dtp, errp, EDT_ELFVERSION)); 871 #endif 834 872 835 873 if (vector != NULL || (flags & DTRACE_O_NODEV)) 836 874 goto alloc; /* do not attempt to open dtrace device */ 837 875 876 #ifndef _MSC_VER 838 877 /* 839 878 * Before we get going, crank our limit on file descriptors up to the … … 848 887 (void) setrlimit(RLIMIT_NOFILE, &rl); 849 888 } 850 889 #endif 890 891 #ifndef VBOX 851 892 /* 852 893 * Get the device path of each of the providers. We hold them open … … 892 933 (void) fcntl(dtfd, F_SETFD, FD_CLOEXEC); 893 934 (void) fcntl(ftfd, F_SETFD, FD_CLOEXEC); 935 #else /* VBOX */ 936 /** @todo open ring-0 dtrace module. */ 937 #endif /* VBOX */ 894 938 895 939 alloc: … … 926 970 dtp->dt_varg = arg; 927 971 dt_dof_init(dtp); 972 #ifndef VBOX 928 973 (void) uname(&dtp->dt_uts); 974 #endif 929 975 930 976 if (dtp->dt_mods == NULL || dtp->dt_provs == NULL || … … 941 987 (uint_t)(sizeof (void *) * NBBY)); 942 988 989 #ifndef VBOX 943 990 (void) snprintf(utsdef, sizeof (utsdef), "-D__%s_%s", 944 991 dt_get_sysinfo(SI_SYSNAME, s1, sizeof (s1)), 945 992 dt_get_sysinfo(SI_RELEASE, s2, sizeof (s2))); 993 #endif 946 994 947 995 if (dt_cpp_add_arg(dtp, "-D__sun") == NULL || -
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_parser.h
r53634 r53652 27 27 #define _DT_PARSER_H 28 28 29 #ifndef VBOX 29 30 #pragma ident "%Z%%M% %I% %E% SMI" 30 31 … … 35 36 #include <stdarg.h> 36 37 #include <stdio.h> 38 #else /* VBOX */ 39 # include <sys/dtrace.h> 40 # include <stdio.h> 41 #endif /* VBOX */ 37 42 38 43 #ifdef __cplusplus -
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_pcb.h
r53634 r53652 28 28 #define _DT_PCB_H 29 29 30 #pragma ident "%Z%%M% %I% %E% SMI" 30 #ifndef VBOX 31 # pragma ident "%Z%%M% %I% %E% SMI" 32 #endif 31 33 32 34 #include <dtrace.h> -
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_pid.h
r53634 r53652 28 28 #ifndef _DT_PID_H 29 29 #define _DT_PID_H 30 #ifndef VBOX 30 31 31 32 #pragma ident "%Z%%M% %I% %E% SMI" … … 58 59 dtrace_hdl_t *, fasttrap_probe_spec_t *, const GElf_Sym *, const char *); 59 60 61 #endif /* !VBOX */ 60 62 #ifdef __cplusplus 61 63 } -
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_printf.h
r53634 r53652 28 28 #define _DT_PRINTF_H 29 29 30 #pragma ident "%Z%%M% %I% %E% SMI" 30 #ifndef VBOX 31 # pragma ident "%Z%%M% %I% %E% SMI" 31 32 32 33 #include <sys/types.h> 34 #endif 33 35 #include <libctf.h> 34 36 #include <dtrace.h> -
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_proc.c
r53634 r53652 77 77 */ 78 78 79 #ifndef VBOX 79 80 #include <sys/wait.h> 80 81 #include <sys/lwp.h> … … 83 84 #include <assert.h> 84 85 #include <errno.h> 86 #endif 85 87 86 88 #include <dt_proc.h> 87 89 #include <dt_pid.h> 88 90 #include <dt_impl.h> 91 92 #ifndef VBOX 89 93 90 94 #define IS_SYS_EXEC(w) (w == SYS_execve) … … 1033 1037 assert(err == 0); /* check for unheld lock */ 1034 1038 } 1039 #endif /* !VBOX */ 1035 1040 1036 1041 void … … 1040 1045 sizeof (dt_proc_t *) * _dtrace_pidbuckets - 1)) != NULL) { 1041 1046 1047 #ifndef VBOX /** @todo This needs more work... */ 1042 1048 (void) pthread_mutex_init(&dtp->dt_procs->dph_lock, NULL); 1043 1049 (void) pthread_cond_init(&dtp->dt_procs->dph_cv, NULL); 1050 #else 1051 1052 #endif 1044 1053 1045 1054 dtp->dt_procs->dph_hashlen = _dtrace_pidbuckets; … … 1052 1061 { 1053 1062 dt_proc_hash_t *dph = dtp->dt_procs; 1063 #ifndef VBOX 1054 1064 dt_proc_t *dpr; 1055 1065 1056 1066 while ((dpr = dt_list_next(&dph->dph_lrulist)) != NULL) 1057 1067 dt_proc_destroy(dtp, dpr->dpr_proc); 1068 #endif 1058 1069 1059 1070 dtp->dt_procs = NULL; … … 1061 1072 } 1062 1073 1074 #ifndef VBOX 1075 1063 1076 struct ps_prochandle * 1064 1077 dtrace_proc_create(dtrace_hdl_t *dtp, const char *file, char *const *argv) … … 1096 1109 dt_proc_continue(dtp, P); 1097 1110 } 1111 #endif /* !VBOX */ -
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_proc.h
r53634 r53652 28 28 #define _DT_PROC_H 29 29 30 #ifndef VBOX 30 31 #pragma ident "%Z%%M% %I% %E% SMI" 31 32 … … 34 35 #include <pthread.h> 35 36 #include <dt_list.h> 37 #else /* VBOX */ 38 # include <dtrace.h> 39 # include <dt_list.h> 40 # include <iprt/critsect.h> 41 #endif /* VBOX */ 42 36 43 37 44 #ifdef __cplusplus … … 45 52 struct ps_prochandle *dpr_proc; /* proc handle for libproc calls */ 46 53 char dpr_errmsg[BUFSIZ]; /* error message */ 54 #ifndef VBOX 47 55 rd_agent_t *dpr_rtld; /* rtld handle for librtld_db calls */ 48 56 pthread_mutex_t dpr_lock; /* lock for manipulating dpr_hdl */ 49 57 pthread_cond_t dpr_cv; /* cond for dpr_stop/quit/done */ 58 #else 59 RTCRITSECT dpr_lock; 60 RTSEMEVENT dpr_cv; 61 #endif 50 62 pid_t dpr_pid; /* pid of process */ 51 63 uint_t dpr_refs; /* reference count */ … … 57 69 uint8_t dpr_stale; /* proc flag: been deprecated */ 58 70 uint8_t dpr_rdonly; /* proc flag: opened read-only */ 71 #ifndef VBOX 59 72 pthread_t dpr_tid; /* control thread (or zero if none) */ 73 #else 74 RTTHREAD dpr_tid; 75 #endif 60 76 dt_list_t dpr_bps; /* list of dt_bkpt_t structures */ 61 77 } dt_proc_t; … … 87 103 88 104 typedef struct dt_proc_hash { 105 #ifndef VBOX 89 106 pthread_mutex_t dph_lock; /* lock protecting dph_notify list */ 90 107 pthread_cond_t dph_cv; /* cond for waiting for dph_notify */ 108 #else 109 RTSEMEVENT dph_event; 110 #endif 91 111 dt_proc_notify_t *dph_notify; /* list of pending proc notifications */ 92 112 dt_list_t dph_lrulist; /* list of dt_proc_t's in lru order */ -
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_program.h
r53634 r53652 28 28 #define _DT_PROGRAM_H 29 29 30 #ifndef VBOX 30 31 #pragma ident "%Z%%M% %I% %E% SMI" 32 #endif 31 33 32 34 #ifdef __cplusplus -
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_provider.h
r53634 r53652 28 28 #define _DT_PROVIDER_H 29 29 30 #ifndef VBOX 30 31 #pragma ident "%Z%%M% %I% %E% SMI" 32 #endif 31 33 32 34 #include <dt_impl.h> -
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_regset.h
r53634 r53652 28 28 #define _DT_REGSET_H 29 29 30 #ifndef VBOX 30 31 #pragma ident "%Z%%M% %I% %E% SMI" 31 32 32 33 #include <sys/types.h> 34 #endif 33 35 34 36 #ifdef __cplusplus -
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_string.h
r53634 r53652 27 27 #define _DT_STRING_H 28 28 29 #ifndef VBOX 29 30 #include <sys/types.h> 30 31 #include <strings.h> 32 #else /* VBOX */ 33 # include <iprt/string.h> 34 #endif /* VBOX */ 31 35 32 36 #ifdef __cplusplus -
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_strtab.h
r53634 r53652 28 28 #define _DT_STRTAB_H 29 29 30 #ifndef VBOX 30 31 #pragma ident "%Z%%M% %I% %E% SMI" 31 32 32 33 #include <sys/types.h> 34 #endif 33 35 34 36 #ifdef __cplusplus -
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_work.c
r53634 r53652 26 26 */ 27 27 28 #ifndef VBOX 28 29 #pragma ident "%Z%%M% %I% %E% SMI" 29 30 … … 33 34 #include <assert.h> 34 35 #include <time.h> 36 #else /* VBOX */ 37 # include <dt_impl.h> 38 //# include <stddef.h> 39 //# include <time.h> 40 # include <iprt/semaphore.h> 41 #endif /* VBOX */ 35 42 36 43 static const struct { … … 52 59 53 60 hrtime_t earliest = INT64_MAX; 61 #ifndef VBOX 54 62 struct timespec tv; 63 #endif 55 64 hrtime_t now; 56 65 int i; … … 74 83 } 75 84 85 #ifndef VBOX 76 86 (void) pthread_mutex_lock(&dph->dph_lock); 87 #endif 77 88 78 89 now = gethrtime(); 79 90 80 91 if (earliest < now) { 92 #ifndef VBOX 81 93 (void) pthread_mutex_unlock(&dph->dph_lock); 94 #endif 82 95 return; /* sleep duration has already past */ 83 96 } 84 97 98 #ifndef VBOX 85 99 tv.tv_sec = (earliest - now) / NANOSEC; 86 100 tv.tv_nsec = (earliest - now) % NANOSEC; 101 #endif 87 102 88 103 /* … … 91 106 * awaken, iterate over any pending notifications and process them. 92 107 */ 108 #ifndef VBOX 93 109 (void) pthread_cond_reltimedwait_np(&dph->dph_cv, &dph->dph_lock, &tv); 110 #else 111 RTSemEventWait(dph->dph_event, (earliest - now) / RT_NS_1MS); 112 #endif 94 113 95 114 while ((dprn = dph->dph_notify) != NULL) { … … 107 126 } 108 127 128 #ifndef VBOX 109 129 (void) pthread_mutex_unlock(&dph->dph_lock); 130 #endif 110 131 } 111 132 … … 124 145 125 146 if (dtp->dt_laststatus != 0) { 126 if (now - dtp->dt_laststatus < interval)147 if (now - dtp->dt_laststatus < VBDTCAST(hrtime_t)interval) 127 148 return (DTRACE_STATUS_NONE); 128 149 -
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_xlator.h
r53634 r53652 28 28 #define _DT_XLATOR_H 29 29 30 #ifndef VBOX 30 31 #pragma ident "%Z%%M% %I% %E% SMI" 32 #endif 31 33 32 34 #include <libctf.h> -
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dtrace.h
r53646 r53652 30 30 #ifndef VBOX 31 31 #pragma ident "%Z%%M% %I% %E% SMI" 32 #endif33 32 34 33 #include <sys/dtrace.h> 35 34 #include <stdarg.h> 36 35 #include <stdio.h> 37 #ifndef VBOX38 36 #include <gelf.h> 39 #endif 37 #else /* VBOX */ 38 # include <sys/dtrace.h> 39 # include <stdio.h> 40 #endif /* VBOX */ 40 41 41 42 #ifdef __cplusplus … … 435 436 * be flushed and not used subsequently by the client program. 436 437 */ 437 #ifndef VBOX438 438 439 439 #define DTRACE_OBJ_EXEC ((const char *)0L) /* primary executable file */ … … 451 451 uint_t dto_flags; /* object flags (see below) */ 452 452 453 #ifndef VBOX 453 454 GElf_Addr dto_text_va; /* address of text section */ 454 455 GElf_Xword dto_text_size; /* size of text section */ … … 457 458 GElf_Addr dto_bss_va; /* address of BSS */ 458 459 GElf_Xword dto_bss_size; /* size of BSS */ 460 #endif 459 461 } dtrace_objinfo_t; 460 462 … … 473 475 } dtrace_syminfo_t; 474 476 477 #ifndef VBOX 475 478 extern int dtrace_lookup_by_name(dtrace_hdl_t *, const char *, const char *, 476 479 GElf_Sym *, dtrace_syminfo_t *); … … 576 579 extern int _dtrace_debug; 577 580 581 #ifdef VBOX 582 extern void dtrace_init(void); 583 #endif 584 578 585 #ifdef __cplusplus 579 586 }
Note:
See TracChangeset
for help on using the changeset viewer.