diff options
author | markj <markj@FreeBSD.org> | 2014-10-03 23:20:37 +0000 |
---|---|---|
committer | markj <markj@FreeBSD.org> | 2014-10-03 23:20:37 +0000 |
commit | 91d5d12d67db05be29b36096bcb90e39e1541fae (patch) | |
tree | e5d14bcbe841b9c2e8e073a1970aa1c856236b02 /lib/libproc/tests | |
parent | b089d064397fe71608574f13f2e413d9e5c2786a (diff) | |
download | FreeBSD-src-91d5d12d67db05be29b36096bcb90e39e1541fae.zip FreeBSD-src-91d5d12d67db05be29b36096bcb90e39e1541fae.tar.gz |
Hook up support for userland CTF support in DTrace. This required some
modifications to libproc to support fetching the CTF info for a given file.
With this change, dtrace(1) is able to resolve type info for function and
USDT probe arguments, and function return values. In particular, the args[n]
syntax should now work for referencing arguments of userland probes,
provided that the requisite CTF info is available.
The uctf tests pass if the test programs are compiled with CTF info. The
current infrastructure around the DTrace test suite doesn't support this
yet.
Differential Revision: https://reviews.freebsd.org/D891
MFC after: 1 month
Relnotes: yes
Sponsored by: EMC / Isilon Storage Division
Diffstat (limited to 'lib/libproc/tests')
-rw-r--r-- | lib/libproc/tests/proc_test.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/libproc/tests/proc_test.c b/lib/libproc/tests/proc_test.c index 60f1f04..0242b5b 100644 --- a/lib/libproc/tests/proc_test.c +++ b/lib/libproc/tests/proc_test.c @@ -227,6 +227,7 @@ ATF_TC_HEAD(map_alias_name2sym, tc) ATF_TC_BODY(map_alias_name2sym, tc) { GElf_Sym sym1, sym2; + prsyminfo_t si1, si2; struct proc_handle *phdl; int error; @@ -239,14 +240,15 @@ ATF_TC_BODY(map_alias_name2sym, tc) * Make sure that "target_prog:main" and "a.out:main" return the same * symbol. */ - error = proc_name2sym(phdl, target_prog_file, "main", &sym1); + error = proc_name2sym(phdl, target_prog_file, "main", &sym1, &si1); ATF_REQUIRE_EQ_MSG(error, 0, "failed to look up 'main' via %s", target_prog_file); - error = proc_name2sym(phdl, aout_object, "main", &sym2); + error = proc_name2sym(phdl, aout_object, "main", &sym2, &si2); ATF_REQUIRE_EQ_MSG(error, 0, "failed to look up 'main' via %s", aout_object); ATF_CHECK_EQ(memcmp(&sym1, &sym2, sizeof(sym1)), 0); + ATF_CHECK_EQ(si1.prs_id, si2.prs_id); ATF_CHECK_EQ_MSG(proc_continue(phdl), 0, "failed to resume execution"); @@ -271,11 +273,11 @@ ATF_TC_BODY(symbol_lookup, tc) phdl = start_prog(tc, false); - error = proc_name2sym(phdl, target_prog_file, "main", &main_sym); + error = proc_name2sym(phdl, target_prog_file, "main", &main_sym, NULL); ATF_REQUIRE_EQ_MSG(error, 0, "failed to look up 'main'"); error = proc_name2sym(phdl, ldelf_object, "r_debug_state", - &r_debug_state_sym); + &r_debug_state_sym, NULL); ATF_REQUIRE_EQ_MSG(error, 0, "failed to look up 'r_debug_state'"); set_bkpt(phdl, r_debug_state_sym.st_value, &saved); |