summaryrefslogtreecommitdiffstats
path: root/cddl/contrib/opensolaris/lib/libdtrace/common/dt_aggregate.c
diff options
context:
space:
mode:
authorrpaulo <rpaulo@FreeBSD.org>2010-08-21 11:50:53 +0000
committerrpaulo <rpaulo@FreeBSD.org>2010-08-21 11:50:53 +0000
commitb325e69c9282072ea3b203319017abc400db4771 (patch)
treeae5b6066f0143ecb034e8de394e160841cd4f84f /cddl/contrib/opensolaris/lib/libdtrace/common/dt_aggregate.c
parent232561a60dcdeeffd316d29086bb31f2e12d7591 (diff)
downloadFreeBSD-src-b325e69c9282072ea3b203319017abc400db4771.zip
FreeBSD-src-b325e69c9282072ea3b203319017abc400db4771.tar.gz
Add libdtrace support for tracing userland programs.
Summary of changes: * Implement a compatibility shim between Solaris libproc and our libproc and remove several ifdefs because of this. * Port the drti to FreeBSD. * Implement the missing DOODAD sections * Link with libproc and librtld_db * Support for ustack, jstack and uregs (by sson@) * Misc bugfixing When writing the SUWN_dof section, we had to resort to building the ELF file layout by "hand". This is the job of libelf, but our libelf doesn't support this yet. When libelf is fixed, we can remove the code under #ifdef BROKEN_LIBELF. Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'cddl/contrib/opensolaris/lib/libdtrace/common/dt_aggregate.c')
-rw-r--r--cddl/contrib/opensolaris/lib/libdtrace/common/dt_aggregate.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_aggregate.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_aggregate.c
index ac32f76..f6c9622 100644
--- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_aggregate.c
+++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_aggregate.c
@@ -36,6 +36,7 @@
#include <alloca.h>
#else
#include <sys/sysctl.h>
+#include <libproc_compat.h>
#endif
#include <limits.h>
@@ -264,11 +265,7 @@ dt_aggregate_usym(dtrace_hdl_t *dtp, uint64_t *data)
dt_proc_lock(dtp, P);
-#if defined(sun)
if (Plookup_by_addr(P, *pc, NULL, 0, &sym) == 0)
-#else
- if (proc_addr2sym(P, *pc, NULL, 0, &sym) == 0)
-#endif
*pc = sym.st_value;
dt_proc_unlock(dtp, P);
@@ -291,11 +288,7 @@ dt_aggregate_umod(dtrace_hdl_t *dtp, uint64_t *data)
dt_proc_lock(dtp, P);
-#if defined(sun)
if ((map = Paddr_to_map(P, *pc)) != NULL)
-#else
- if ((map = proc_addr2map(P, *pc)) != NULL)
-#endif
*pc = map->pr_vaddr;
dt_proc_unlock(dtp, P);
OpenPOWER on IntegriCloud