From d3765576bcdab2fff6360fffc0b77f1021d1a771 Mon Sep 17 00:00:00 2001 From: Francis Deslauriers Date: Sat, 13 Jul 2019 10:39:21 -0400 Subject: [PATCH] Tests: flt.lttng-utils.debug-info: update debug-info tests * Convert the currently disabled Python bindings based debug-info testcase to a `sink.text.details` based test. * Update debug-info test trace using a recently changed `libhello_so` file. * Move all debug-info test files to `tests/plugins/flt.lttng-utils.debug-info/` * Move `tests/data/debug-info/README.md` content to `CONTRIBUTING.adoc` * Update `tests/data/plugins/flt.lttng-utils.debug-info/README.md` to explain how to generate the debug-info test trace. Signed-off-by: Francis Deslauriers Change-Id: I67b8fa729e462137fb3e584c0f1eaf472256e3c9 Reviewed-on: https://review.lttng.org/c/babeltrace/+/1704 Reviewed-by: Philippe Proulx --- tests/Makefile.am | 5 +- .../ctf-traces/succeed/debug-info/channel0_0 | Bin 0 -> 4096 bytes .../ctf-traces/succeed/debug-info/metadata | 127 +++++++++++++++++ tests/data/debug-info/trace/metadata | 91 ------------ tests/data/debug-info/trace/stream_0_0 | Bin 292 -> 0 bytes .../flt.lttng-utils.debug-info}/Makefile | 0 .../flt.lttng-utils.debug-info}/README.md | 53 +++++-- ...8cdd87f7fe64c13b6daad553987eafd40cbb.debug | Bin .../i386-linux-gnu/build_id/libhello_so | Bin .../i386-linux-gnu/debug_link/libhello_so | Bin .../debug_link/libhello_so.debug | Bin .../i386-linux-gnu/dwarf_full/libhello_so | Bin .../i386-linux-gnu/elf_only/libhello_so | Bin .../flt.lttng-utils.debug-info}/libhello.c | 0 .../flt.lttng-utils.debug-info}/libhello.h | 0 .../flt.lttng-utils.debug-info}/main.c | 0 ...8cdd87f7fe64c13b6daad553987eafd40cbb.debug | Bin .../powerpc-linux-gnu/build_id/libhello_so | Bin .../powerpc-linux-gnu/debug_link/libhello_so | Bin .../debug_link/libhello_so.debug | Bin .../powerpc-linux-gnu/dwarf_full/libhello_so | Bin .../powerpc-linux-gnu/elf_only/libhello_so | Bin ...8cdd87f7fe64c13b6daad553987eafd40cbb.debug | Bin .../build_id/libhello_so | Bin .../debug_link/libhello_so | Bin .../debug_link/libhello_so.debug | Bin .../dwarf_full/libhello_so | Bin .../elf_only/libhello_so | Bin .../flt.lttng-utils.debug-info}/tp.c | 0 .../flt.lttng-utils.debug-info}/tp.h | 0 .../trace-debug-info.expect | 131 ++++++++++++++++++ ...8cdd87f7fe64c13b6daad553987eafd40cbb.debug | Bin .../x86_64-linux-gnu/build_id/libhello_so | Bin .../x86_64-linux-gnu/debug_link/libhello_so | Bin .../debug_link/libhello_so.debug | Bin .../x86_64-linux-gnu/dwarf_full/libhello_so | Bin .../x86_64-linux-gnu/elf_only/libhello_so | Bin .../flt.lttng-utils.debug-info/Makefile.am | 3 +- .../test_bin_info_i386-linux-gnu | 6 +- .../test_bin_info_powerpc-linux-gnu | 6 +- .../test_bin_info_powerpc64le-linux-gnu | 6 +- .../test_bin_info_x86_64-linux-gnu | 6 +- .../test_dwarf_i386-linux-gnu | 7 +- .../test_dwarf_powerpc-linux-gnu | 7 +- .../test_dwarf_powerpc64le-linux-gnu | 7 +- .../test_dwarf_x86_64-linux-gnu | 7 +- .../test_lttng_utils_debug_info | 32 ----- .../test_lttng_utils_debug_info.py | 44 ------ .../flt.lttng-utils.debug-info/test_succeed | 59 ++++++++ tests/utils/utils.sh | 1 - 50 files changed, 401 insertions(+), 197 deletions(-) create mode 100644 tests/data/ctf-traces/succeed/debug-info/channel0_0 create mode 100644 tests/data/ctf-traces/succeed/debug-info/metadata delete mode 100644 tests/data/debug-info/trace/metadata delete mode 100644 tests/data/debug-info/trace/stream_0_0 rename tests/data/{debug-info => plugins/flt.lttng-utils.debug-info}/Makefile (100%) rename tests/data/{debug-info => plugins/flt.lttng-utils.debug-info}/README.md (56%) rename tests/data/{debug-info => plugins/flt.lttng-utils.debug-info}/i386-linux-gnu/build_id/.build-id/cd/d98cdd87f7fe64c13b6daad553987eafd40cbb.debug (100%) rename tests/data/{debug-info => plugins/flt.lttng-utils.debug-info}/i386-linux-gnu/build_id/libhello_so (100%) rename tests/data/{debug-info => plugins/flt.lttng-utils.debug-info}/i386-linux-gnu/debug_link/libhello_so (100%) rename tests/data/{debug-info => plugins/flt.lttng-utils.debug-info}/i386-linux-gnu/debug_link/libhello_so.debug (100%) rename tests/data/{debug-info => plugins/flt.lttng-utils.debug-info}/i386-linux-gnu/dwarf_full/libhello_so (100%) rename tests/data/{debug-info => plugins/flt.lttng-utils.debug-info}/i386-linux-gnu/elf_only/libhello_so (100%) rename tests/data/{debug-info => plugins/flt.lttng-utils.debug-info}/libhello.c (100%) rename tests/data/{debug-info => plugins/flt.lttng-utils.debug-info}/libhello.h (100%) rename tests/data/{debug-info => plugins/flt.lttng-utils.debug-info}/main.c (100%) rename tests/data/{debug-info => plugins/flt.lttng-utils.debug-info}/powerpc-linux-gnu/build_id/.build-id/cd/d98cdd87f7fe64c13b6daad553987eafd40cbb.debug (100%) rename tests/data/{debug-info => plugins/flt.lttng-utils.debug-info}/powerpc-linux-gnu/build_id/libhello_so (100%) rename tests/data/{debug-info => plugins/flt.lttng-utils.debug-info}/powerpc-linux-gnu/debug_link/libhello_so (100%) rename tests/data/{debug-info => plugins/flt.lttng-utils.debug-info}/powerpc-linux-gnu/debug_link/libhello_so.debug (100%) rename tests/data/{debug-info => plugins/flt.lttng-utils.debug-info}/powerpc-linux-gnu/dwarf_full/libhello_so (100%) rename tests/data/{debug-info => plugins/flt.lttng-utils.debug-info}/powerpc-linux-gnu/elf_only/libhello_so (100%) rename tests/data/{debug-info => plugins/flt.lttng-utils.debug-info}/powerpc64le-linux-gnu/build_id/.build-id/cd/d98cdd87f7fe64c13b6daad553987eafd40cbb.debug (100%) rename tests/data/{debug-info => plugins/flt.lttng-utils.debug-info}/powerpc64le-linux-gnu/build_id/libhello_so (100%) rename tests/data/{debug-info => plugins/flt.lttng-utils.debug-info}/powerpc64le-linux-gnu/debug_link/libhello_so (100%) rename tests/data/{debug-info => plugins/flt.lttng-utils.debug-info}/powerpc64le-linux-gnu/debug_link/libhello_so.debug (100%) rename tests/data/{debug-info => plugins/flt.lttng-utils.debug-info}/powerpc64le-linux-gnu/dwarf_full/libhello_so (100%) rename tests/data/{debug-info => plugins/flt.lttng-utils.debug-info}/powerpc64le-linux-gnu/elf_only/libhello_so (100%) rename tests/data/{debug-info => plugins/flt.lttng-utils.debug-info}/tp.c (100%) rename tests/data/{debug-info => plugins/flt.lttng-utils.debug-info}/tp.h (100%) create mode 100644 tests/data/plugins/flt.lttng-utils.debug-info/trace-debug-info.expect rename tests/data/{debug-info => plugins/flt.lttng-utils.debug-info}/x86_64-linux-gnu/build_id/.build-id/cd/d98cdd87f7fe64c13b6daad553987eafd40cbb.debug (100%) rename tests/data/{debug-info => plugins/flt.lttng-utils.debug-info}/x86_64-linux-gnu/build_id/libhello_so (100%) rename tests/data/{debug-info => plugins/flt.lttng-utils.debug-info}/x86_64-linux-gnu/debug_link/libhello_so (100%) rename tests/data/{debug-info => plugins/flt.lttng-utils.debug-info}/x86_64-linux-gnu/debug_link/libhello_so.debug (100%) rename tests/data/{debug-info => plugins/flt.lttng-utils.debug-info}/x86_64-linux-gnu/dwarf_full/libhello_so (100%) rename tests/data/{debug-info => plugins/flt.lttng-utils.debug-info}/x86_64-linux-gnu/elf_only/libhello_so (100%) delete mode 100755 tests/plugins/flt.lttng-utils.debug-info/test_lttng_utils_debug_info delete mode 100644 tests/plugins/flt.lttng-utils.debug-info/test_lttng_utils_debug_info.py create mode 100755 tests/plugins/flt.lttng-utils.debug-info/test_succeed diff --git a/tests/Makefile.am b/tests/Makefile.am index ad8ded96..c2bf42a5 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -79,10 +79,11 @@ TESTS_PLUGINS = \ if !ENABLE_BUILT_IN_PLUGINS if ENABLE_PYTHON_BINDINGS TESTS_PLUGINS += plugins/src.ctf.fs/query/test_query +endif if ENABLE_DEBUG_INFO -TESTS_PLUGINS += plugins/flt.lttng-utils.debug-info/test_lttng_utils_debug_info -endif +TESTS_PLUGINS += \ + plugins/flt.lttng-utils.debug-info/test_succeed endif endif diff --git a/tests/data/ctf-traces/succeed/debug-info/channel0_0 b/tests/data/ctf-traces/succeed/debug-info/channel0_0 new file mode 100644 index 0000000000000000000000000000000000000000..35b979b20c24d1e165f9fd8f3707de247996bbd3 GIT binary patch literal 4096 zcmX>o|L5Q(b^fTT0$0U0?y3H)ek|DxNFb|e`h~s13=B(7YTpIXD>$H%4M>X6nE(HS z1Xk|)57sH9#=xLG>C$%2dZ3_y+}=MR8VaIwGV@9+bjwnT^YwtpFcu=d6NX^N~k1x(=U}R)qWcYKQ_aaD#=VFLTu&j { + struct { + uint27_clock_monotonic_t timestamp; + } compact; + struct { + uint32_t id; + uint64_clock_monotonic_t timestamp; + } extended; + } v; +} align(8); + +struct event_header_large { + enum : uint16_t { compact = 0 ... 65534, extended = 65535 } id; + variant { + struct { + uint32_clock_monotonic_t timestamp; + } compact; + struct { + uint32_t id; + uint64_clock_monotonic_t timestamp; + } extended; + } v; +} align(8); + +event { + name = "lttng_ust_statedump:bin_info"; + id = 0; + stream_id = 0; + loglevel = 13; + fields := struct { + integer { size = 64; align = 8; signed = 0; encoding = none; base = 16; } _baddr; + integer { size = 64; align = 8; signed = 0; encoding = none; base = 10; } _memsz; + string _path; + integer { size = 8; align = 8; signed = 0; encoding = none; base = 10; } _is_pic; + integer { size = 8; align = 8; signed = 0; encoding = none; base = 10; } _has_build_id; + integer { size = 8; align = 8; signed = 0; encoding = none; base = 10; } _has_debug_link; + }; +}; + +stream { + id = 0; + event.header := struct event_header_large; + packet.context := struct packet_context; + event.context := struct { + integer { size = 32; align = 8; signed = 1; encoding = none; base = 10; } _vpid; + integer { size = 64; align = 8; signed = 0; encoding = none; base = 16; } _ip; + }; +}; + +event { + name = "my_provider:my_first_tracepoint"; + id = 1; + stream_id = 0; + loglevel = 13; + fields := struct { + string _my_string_field; + integer { size = 32; align = 8; signed = 1; encoding = none; base = 10; } _my_integer_field; + }; +}; + diff --git a/tests/data/debug-info/trace/metadata b/tests/data/debug-info/trace/metadata deleted file mode 100644 index 1388b296..00000000 --- a/tests/data/debug-info/trace/metadata +++ /dev/null @@ -1,91 +0,0 @@ -/* CTF 1.8 */ - -trace { - major = 1; - minor = 8; - uuid = "c4f5ad74-2d9a-4a17-9633-3e9e49d5f773"; - byte_order = le; - packet.header := struct { - integer { size = 32; align = 8; signed = false; encoding = none; base = decimal; byte_order = le; } magic; - integer { size = 8; align = 8; signed = false; encoding = none; base = decimal; byte_order = le; } uuid[16]; - integer { size = 32; align = 8; signed = false; encoding = none; base = decimal; byte_order = le; } stream_id; - integer { size = 64; align = 8; signed = false; encoding = none; base = decimal; byte_order = le; } stream_instance_id; - } align(8); -}; - -env { - hostname = "sinkpad"; - domain = "ust"; - tracer_name = "lttng-ust"; - tracer_major = 2; - tracer_minor = 10; -}; - -clock { - name = monotonic; - uuid = "00000000-0000-0000-0000-000000000000"; - description = "Monotonic Clock"; - freq = 1000000000; - precision = 1; - offset_s = 0; - offset = 1497619475540462738; - absolute = TRUE; -}; - -stream { - id = 0; - event.header := struct { - enum : integer { size = 5; align = 1; signed = false; encoding = none; base = decimal; byte_order = le; } { "compact" = 0 ... 30, "extended" = 31 } id; - variant { - struct { - integer { size = 64; align = 1; signed = false; encoding = none; base = decimal; byte_order = le; map = clock.monotonic.value; } timestamp; - } align(1) compact; - struct { - integer { size = 32; align = 8; signed = false; encoding = none; base = decimal; byte_order = le; } id; - integer { size = 64; align = 8; signed = false; encoding = none; base = decimal; byte_order = le; map = clock.monotonic.value; } timestamp; - } align(8) extended; - } v; - } align(8); - - packet.context := struct { - integer { size = 64; align = 8; signed = false; encoding = none; base = decimal; byte_order = le; map = clock.monotonic.value; } timestamp_begin; - integer { size = 64; align = 8; signed = false; encoding = none; base = decimal; byte_order = le; map = clock.monotonic.value; } timestamp_end; - integer { size = 64; align = 8; signed = false; encoding = none; base = decimal; byte_order = le; } content_size; - integer { size = 64; align = 8; signed = false; encoding = none; base = decimal; byte_order = le; } packet_size; - integer { size = 64; align = 8; signed = false; encoding = none; base = decimal; byte_order = le; } packet_seq_num; - integer { size = 64; align = 8; signed = false; encoding = none; base = decimal; byte_order = le; } events_discarded; - integer { size = 32; align = 8; signed = false; encoding = none; base = decimal; byte_order = le; } cpu_id; - } align(8); - - event.context := struct { - integer { size = 32; align = 8; signed = true; encoding = none; base = decimal; byte_order = le; } _vpid; - integer { size = 64; align = 8; signed = false; encoding = none; base = hexadecimal; byte_order = le; } _ip; - } align(8); -}; - -event { - name = "lttng_ust_statedump:bin_info"; - id = 0; - stream_id = 0; - loglevel = 13; - fields := struct { - integer { size = 64; align = 8; signed = false; encoding = none; base = hexadecimal; byte_order = le; } _baddr; - integer { size = 64; align = 8; signed = false; encoding = none; base = decimal; byte_order = le; } _memsz; - string { encoding = UTF8; } _path; - integer { size = 8; align = 8; signed = false; encoding = none; base = decimal; byte_order = le; } _is_pic; - integer { size = 8; align = 8; signed = false; encoding = none; base = decimal; byte_order = le; } _has_build_id; - integer { size = 8; align = 8; signed = false; encoding = none; base = decimal; byte_order = le; } _has_debug_link; - } align(8); -}; - -event { - name = "my_provider:my_first_tracepoint"; - id = 1; - stream_id = 0; - loglevel = 13; - fields := struct { - string { encoding = UTF8; } _my_string_field; - integer { size = 32; align = 8; signed = true; encoding = none; base = decimal; byte_order = le; } _my_integer_field; - } align(8); -}; - diff --git a/tests/data/debug-info/trace/stream_0_0 b/tests/data/debug-info/trace/stream_0_0 deleted file mode 100644 index 582f445a3841e01d97bc4f5dcc31cfc21bf2ab8d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 292 zcmX>o|L5S5uWL(mXL*TFGq#)OdG&iS0}@b}w`C2*Q0@c&ED$}zQUR<`za+J|q*y;CHK{aRH#09SUpFPOBvC&n zGbtlACnrC?IG=%$k)h!!HlqS!I{$-=go5a@l;ZqY5XUhj2VwIS76Gu0VDoeoN{SMb sQ;Qh1fXWV9bRm>2V}&RyN=?qs0Xj+{wM3yfH8(LcCnvR-!4jw(04V8B{r~^~ diff --git a/tests/data/debug-info/Makefile b/tests/data/plugins/flt.lttng-utils.debug-info/Makefile similarity index 100% rename from tests/data/debug-info/Makefile rename to tests/data/plugins/flt.lttng-utils.debug-info/Makefile diff --git a/tests/data/debug-info/README.md b/tests/data/plugins/flt.lttng-utils.debug-info/README.md similarity index 56% rename from tests/data/debug-info/README.md rename to tests/data/plugins/flt.lttng-utils.debug-info/README.md index 1912194a..6d20c5cb 100644 --- a/tests/data/debug-info/README.md +++ b/tests/data/plugins/flt.lttng-utils.debug-info/README.md @@ -66,16 +66,43 @@ To regenerate them, you can use the included Makefile or follow these steps: Test program ------------ -An executable linked to this library can be compiled from the `main.c` source file. -To compile it, you can do: - - $ ln -s libhello_so libhello.so - $ gcc -I. -o test main.c -L. -lhello_build_id -llttng-ust -ldl -Wl,--rpath=. - -The trace provided in this directory was generated with lttng-ust running this -program and stripped to contain only the bare minimum. When running babeltrace -with the `--debug-info-target-prefix` option pointing to the source tree of -Babeltrace, the `my_provider:my_first_tracepoint` events should contain this -information: - - debug_info = { bin = "libhello_so+0x166b", func = "baz+0x9c", src = "libhello.c:20" } } +The trace provided in `tests/data/ctf-traces/succeed/debug-info/` was generated +using lttng-ust in a LTTng session configured to contain only the bare minimum +to do the debug-info resolution. You can generate such trace by following these +steps: + +1. Compile the example binary: + $ ln -s x86_64-linux-gnu/dwarf_full/libhello_so libhello.so + $ gcc -I. -o debug_info_app main.c -L. -lhello -llttng-ust -ldl -Wl,--rpath=. + +2. In order to have paths to binary and shared objects that are not relative + to the file system they were built on, we used a simple trick of copying + the following files to the root directory ('/') like this: + + $ sudo cp x86_64-linux-gnu/dwarf_full/libhello_so /libhello_so + $ sudo cp ./debug_info_app / + +3. Create symbolic link to the `/libhello_so` file with the `/libhello.so` name. + $ sudo ln -s /libhello_so /libhello.so + +4. Create the LTTng tracing session using the following commands: + $ cd / + $ sudo lttng create + $ sudo lttng add-context -u -t vpid -t ip + $ sudo lttng enable-event -u my_provider:my_first_tracepoint + $ sudo lttng enable-event -u lttng_ust_statedump:bin_info --filter='path=="/libhello_so"' + $ sudo lttng enable-event -u lttng_ust_statedump:bin_info --filter='path=="[linux-vdso.so.1]"' + $ sudo lttng start + $ sudo /debug_info_app + $ sudo lttng stop + +5. Copy the resulting trace back into the Babeltrace repository. + +When running babeltrace with the `--debug-info-target-prefix` option or +`target-prefix` component paramater set to the directory containing the right +`libhello_so` file. In the example used above, the `libhello_so` file is in the +`x86_64-linux-gnu/dwarf_full/` directory. +In the printed trace, the `my_provider:my_first_tracepoint` events should +contain information similar to this: + + debug_info = { bin = "libhello_so+0x2349", func = "foo+0xd2", src = "libhello.c:35" } diff --git a/tests/data/debug-info/i386-linux-gnu/build_id/.build-id/cd/d98cdd87f7fe64c13b6daad553987eafd40cbb.debug b/tests/data/plugins/flt.lttng-utils.debug-info/i386-linux-gnu/build_id/.build-id/cd/d98cdd87f7fe64c13b6daad553987eafd40cbb.debug similarity index 100% rename from tests/data/debug-info/i386-linux-gnu/build_id/.build-id/cd/d98cdd87f7fe64c13b6daad553987eafd40cbb.debug rename to tests/data/plugins/flt.lttng-utils.debug-info/i386-linux-gnu/build_id/.build-id/cd/d98cdd87f7fe64c13b6daad553987eafd40cbb.debug diff --git a/tests/data/debug-info/i386-linux-gnu/build_id/libhello_so b/tests/data/plugins/flt.lttng-utils.debug-info/i386-linux-gnu/build_id/libhello_so similarity index 100% rename from tests/data/debug-info/i386-linux-gnu/build_id/libhello_so rename to tests/data/plugins/flt.lttng-utils.debug-info/i386-linux-gnu/build_id/libhello_so diff --git a/tests/data/debug-info/i386-linux-gnu/debug_link/libhello_so b/tests/data/plugins/flt.lttng-utils.debug-info/i386-linux-gnu/debug_link/libhello_so similarity index 100% rename from tests/data/debug-info/i386-linux-gnu/debug_link/libhello_so rename to tests/data/plugins/flt.lttng-utils.debug-info/i386-linux-gnu/debug_link/libhello_so diff --git a/tests/data/debug-info/i386-linux-gnu/debug_link/libhello_so.debug b/tests/data/plugins/flt.lttng-utils.debug-info/i386-linux-gnu/debug_link/libhello_so.debug similarity index 100% rename from tests/data/debug-info/i386-linux-gnu/debug_link/libhello_so.debug rename to tests/data/plugins/flt.lttng-utils.debug-info/i386-linux-gnu/debug_link/libhello_so.debug diff --git a/tests/data/debug-info/i386-linux-gnu/dwarf_full/libhello_so b/tests/data/plugins/flt.lttng-utils.debug-info/i386-linux-gnu/dwarf_full/libhello_so similarity index 100% rename from tests/data/debug-info/i386-linux-gnu/dwarf_full/libhello_so rename to tests/data/plugins/flt.lttng-utils.debug-info/i386-linux-gnu/dwarf_full/libhello_so diff --git a/tests/data/debug-info/i386-linux-gnu/elf_only/libhello_so b/tests/data/plugins/flt.lttng-utils.debug-info/i386-linux-gnu/elf_only/libhello_so similarity index 100% rename from tests/data/debug-info/i386-linux-gnu/elf_only/libhello_so rename to tests/data/plugins/flt.lttng-utils.debug-info/i386-linux-gnu/elf_only/libhello_so diff --git a/tests/data/debug-info/libhello.c b/tests/data/plugins/flt.lttng-utils.debug-info/libhello.c similarity index 100% rename from tests/data/debug-info/libhello.c rename to tests/data/plugins/flt.lttng-utils.debug-info/libhello.c diff --git a/tests/data/debug-info/libhello.h b/tests/data/plugins/flt.lttng-utils.debug-info/libhello.h similarity index 100% rename from tests/data/debug-info/libhello.h rename to tests/data/plugins/flt.lttng-utils.debug-info/libhello.h diff --git a/tests/data/debug-info/main.c b/tests/data/plugins/flt.lttng-utils.debug-info/main.c similarity index 100% rename from tests/data/debug-info/main.c rename to tests/data/plugins/flt.lttng-utils.debug-info/main.c diff --git a/tests/data/debug-info/powerpc-linux-gnu/build_id/.build-id/cd/d98cdd87f7fe64c13b6daad553987eafd40cbb.debug b/tests/data/plugins/flt.lttng-utils.debug-info/powerpc-linux-gnu/build_id/.build-id/cd/d98cdd87f7fe64c13b6daad553987eafd40cbb.debug similarity index 100% rename from tests/data/debug-info/powerpc-linux-gnu/build_id/.build-id/cd/d98cdd87f7fe64c13b6daad553987eafd40cbb.debug rename to tests/data/plugins/flt.lttng-utils.debug-info/powerpc-linux-gnu/build_id/.build-id/cd/d98cdd87f7fe64c13b6daad553987eafd40cbb.debug diff --git a/tests/data/debug-info/powerpc-linux-gnu/build_id/libhello_so b/tests/data/plugins/flt.lttng-utils.debug-info/powerpc-linux-gnu/build_id/libhello_so similarity index 100% rename from tests/data/debug-info/powerpc-linux-gnu/build_id/libhello_so rename to tests/data/plugins/flt.lttng-utils.debug-info/powerpc-linux-gnu/build_id/libhello_so diff --git a/tests/data/debug-info/powerpc-linux-gnu/debug_link/libhello_so b/tests/data/plugins/flt.lttng-utils.debug-info/powerpc-linux-gnu/debug_link/libhello_so similarity index 100% rename from tests/data/debug-info/powerpc-linux-gnu/debug_link/libhello_so rename to tests/data/plugins/flt.lttng-utils.debug-info/powerpc-linux-gnu/debug_link/libhello_so diff --git a/tests/data/debug-info/powerpc-linux-gnu/debug_link/libhello_so.debug b/tests/data/plugins/flt.lttng-utils.debug-info/powerpc-linux-gnu/debug_link/libhello_so.debug similarity index 100% rename from tests/data/debug-info/powerpc-linux-gnu/debug_link/libhello_so.debug rename to tests/data/plugins/flt.lttng-utils.debug-info/powerpc-linux-gnu/debug_link/libhello_so.debug diff --git a/tests/data/debug-info/powerpc-linux-gnu/dwarf_full/libhello_so b/tests/data/plugins/flt.lttng-utils.debug-info/powerpc-linux-gnu/dwarf_full/libhello_so similarity index 100% rename from tests/data/debug-info/powerpc-linux-gnu/dwarf_full/libhello_so rename to tests/data/plugins/flt.lttng-utils.debug-info/powerpc-linux-gnu/dwarf_full/libhello_so diff --git a/tests/data/debug-info/powerpc-linux-gnu/elf_only/libhello_so b/tests/data/plugins/flt.lttng-utils.debug-info/powerpc-linux-gnu/elf_only/libhello_so similarity index 100% rename from tests/data/debug-info/powerpc-linux-gnu/elf_only/libhello_so rename to tests/data/plugins/flt.lttng-utils.debug-info/powerpc-linux-gnu/elf_only/libhello_so diff --git a/tests/data/debug-info/powerpc64le-linux-gnu/build_id/.build-id/cd/d98cdd87f7fe64c13b6daad553987eafd40cbb.debug b/tests/data/plugins/flt.lttng-utils.debug-info/powerpc64le-linux-gnu/build_id/.build-id/cd/d98cdd87f7fe64c13b6daad553987eafd40cbb.debug similarity index 100% rename from tests/data/debug-info/powerpc64le-linux-gnu/build_id/.build-id/cd/d98cdd87f7fe64c13b6daad553987eafd40cbb.debug rename to tests/data/plugins/flt.lttng-utils.debug-info/powerpc64le-linux-gnu/build_id/.build-id/cd/d98cdd87f7fe64c13b6daad553987eafd40cbb.debug diff --git a/tests/data/debug-info/powerpc64le-linux-gnu/build_id/libhello_so b/tests/data/plugins/flt.lttng-utils.debug-info/powerpc64le-linux-gnu/build_id/libhello_so similarity index 100% rename from tests/data/debug-info/powerpc64le-linux-gnu/build_id/libhello_so rename to tests/data/plugins/flt.lttng-utils.debug-info/powerpc64le-linux-gnu/build_id/libhello_so diff --git a/tests/data/debug-info/powerpc64le-linux-gnu/debug_link/libhello_so b/tests/data/plugins/flt.lttng-utils.debug-info/powerpc64le-linux-gnu/debug_link/libhello_so similarity index 100% rename from tests/data/debug-info/powerpc64le-linux-gnu/debug_link/libhello_so rename to tests/data/plugins/flt.lttng-utils.debug-info/powerpc64le-linux-gnu/debug_link/libhello_so diff --git a/tests/data/debug-info/powerpc64le-linux-gnu/debug_link/libhello_so.debug b/tests/data/plugins/flt.lttng-utils.debug-info/powerpc64le-linux-gnu/debug_link/libhello_so.debug similarity index 100% rename from tests/data/debug-info/powerpc64le-linux-gnu/debug_link/libhello_so.debug rename to tests/data/plugins/flt.lttng-utils.debug-info/powerpc64le-linux-gnu/debug_link/libhello_so.debug diff --git a/tests/data/debug-info/powerpc64le-linux-gnu/dwarf_full/libhello_so b/tests/data/plugins/flt.lttng-utils.debug-info/powerpc64le-linux-gnu/dwarf_full/libhello_so similarity index 100% rename from tests/data/debug-info/powerpc64le-linux-gnu/dwarf_full/libhello_so rename to tests/data/plugins/flt.lttng-utils.debug-info/powerpc64le-linux-gnu/dwarf_full/libhello_so diff --git a/tests/data/debug-info/powerpc64le-linux-gnu/elf_only/libhello_so b/tests/data/plugins/flt.lttng-utils.debug-info/powerpc64le-linux-gnu/elf_only/libhello_so similarity index 100% rename from tests/data/debug-info/powerpc64le-linux-gnu/elf_only/libhello_so rename to tests/data/plugins/flt.lttng-utils.debug-info/powerpc64le-linux-gnu/elf_only/libhello_so diff --git a/tests/data/debug-info/tp.c b/tests/data/plugins/flt.lttng-utils.debug-info/tp.c similarity index 100% rename from tests/data/debug-info/tp.c rename to tests/data/plugins/flt.lttng-utils.debug-info/tp.c diff --git a/tests/data/debug-info/tp.h b/tests/data/plugins/flt.lttng-utils.debug-info/tp.h similarity index 100% rename from tests/data/debug-info/tp.h rename to tests/data/plugins/flt.lttng-utils.debug-info/tp.h diff --git a/tests/data/plugins/flt.lttng-utils.debug-info/trace-debug-info.expect b/tests/data/plugins/flt.lttng-utils.debug-info/trace-debug-info.expect new file mode 100644 index 00000000..047ef8f9 --- /dev/null +++ b/tests/data/plugins/flt.lttng-utils.debug-info/trace-debug-info.expect @@ -0,0 +1,131 @@ +Trace class: + Stream class (ID 0): + Supports packets: Yes + Packets have beginning default clock snapshot: Yes + Packets have end default clock snapshot: Yes + Supports discarded events: Yes + Discarded events have default clock snapshots: Yes + Supports discarded packets: Yes + Discarded packets have default clock snapshots: Yes + Default clock class: + Name: monotonic + Description: Monotonic Clock + Frequency (Hz): 1,000,000,000 + Precision (cycles): 0 + Offset (s): 1,563,264,475 + Offset (cycles): 374,722,151 + Origin is Unix epoch: Yes + UUID: c56ad62a-6a35-4722-9807-d8e0f118a367 + Packet context field class: Structure (1 member): + cpu_id: Unsigned integer (32-bit, Base 10) + Event common context field class: Structure (3 members): + vpid: Signed integer (32-bit, Base 10) + ip: Unsigned integer (64-bit, Base 16) + debug_info: Structure (3 members): + bin: String + func: String + src: String + Event class `lttng_ust_statedump:bin_info` (ID 0): + Log level: Debug (line) + Payload field class: Structure (6 members): + baddr: Unsigned integer (64-bit, Base 16) + memsz: Unsigned integer (64-bit, Base 10) + path: String + is_pic: Unsigned integer (8-bit, Base 10) + has_build_id: Unsigned integer (8-bit, Base 10) + has_debug_link: Unsigned integer (8-bit, Base 10) + Event class `my_provider:my_first_tracepoint` (ID 1): + Log level: Debug (line) + Payload field class: Structure (2 members): + my_string_field: String + my_integer_field: Signed integer (32-bit, Base 10) + +[Unknown] +{Trace 0, Stream class ID 0, Stream ID 0} +Stream beginning: + Trace: + Environment (5 entries): + domain: ust + hostname: raton + tracer_major: 2 + tracer_minor: 11 + tracer_name: lttng-ust + Stream (ID 0, Class ID 0) + +[21,705,969,336,938 cycles, 1,563,286,181,344,059,089 ns from origin] +{Trace 0, Stream class ID 0, Stream ID 0} +Packet beginning: + Context: + cpu_id: 0 + +[21,705,976,167,081 cycles, 1,563,286,181,350,889,232 ns from origin] +{Trace 0, Stream class ID 0, Stream ID 0} +Event `lttng_ust_statedump:bin_info` (Class ID 0): + Common context: + vpid: 9746 + ip: 0x7f09:b7d2:922b + debug_info: + bin: + func: + src: + Payload: + baddr: 0x7ffc:bd1e:1000 + memsz: 0 + path: [linux-vdso.so.1] + is_pic: 0 + has_build_id: 0 + has_debug_link: 0 + +[21,705,976,183,716 cycles, 1,563,286,181,350,905,867 ns from origin] +{Trace 0, Stream class ID 0, Stream ID 0} +Event `lttng_ust_statedump:bin_info` (Class ID 0): + Common context: + vpid: 9746 + ip: 0x7f09:b7d2:922b + debug_info: + bin: + func: + src: + Payload: + baddr: 0x7f09:b7f9:8000 + memsz: 2,114,208 + path: /libhello_so + is_pic: 1 + has_build_id: 1 + has_debug_link: 0 + +[21,705,977,090,044 cycles, 1,563,286,181,351,812,195 ns from origin] +{Trace 0, Stream class ID 0, Stream ID 0} +Event `my_provider:my_first_tracepoint` (Class ID 1): + Common context: + vpid: 9746 + ip: 0x7f09:b7f9:a349 + debug_info: + bin: libhello_so+0x2349 + func: foo+0xd2 + src: libhello.c:35 + Payload: + my_string_field: hello, tracer + my_integer_field: 42 + +[21,705,977,161,190 cycles, 1,563,286,181,351,883,341 ns from origin] +{Trace 0, Stream class ID 0, Stream ID 0} +Event `my_provider:my_first_tracepoint` (Class ID 1): + Common context: + vpid: 9746 + ip: 0x7f09:b7f9:a448 + debug_info: + bin: libhello_so+0x2448 + func: bar+0xd2 + src: libhello.c:41 + Payload: + my_string_field: recoltes et semailles + my_integer_field: 57 + +[21,706,180,381,092 cycles, 1,563,286,181,555,103,243 ns from origin] +{Trace 0, Stream class ID 0, Stream ID 0} +Packet end + +[Unknown] +{Trace 0, Stream class ID 0, Stream ID 0} +Stream end diff --git a/tests/data/debug-info/x86_64-linux-gnu/build_id/.build-id/cd/d98cdd87f7fe64c13b6daad553987eafd40cbb.debug b/tests/data/plugins/flt.lttng-utils.debug-info/x86_64-linux-gnu/build_id/.build-id/cd/d98cdd87f7fe64c13b6daad553987eafd40cbb.debug similarity index 100% rename from tests/data/debug-info/x86_64-linux-gnu/build_id/.build-id/cd/d98cdd87f7fe64c13b6daad553987eafd40cbb.debug rename to tests/data/plugins/flt.lttng-utils.debug-info/x86_64-linux-gnu/build_id/.build-id/cd/d98cdd87f7fe64c13b6daad553987eafd40cbb.debug diff --git a/tests/data/debug-info/x86_64-linux-gnu/build_id/libhello_so b/tests/data/plugins/flt.lttng-utils.debug-info/x86_64-linux-gnu/build_id/libhello_so similarity index 100% rename from tests/data/debug-info/x86_64-linux-gnu/build_id/libhello_so rename to tests/data/plugins/flt.lttng-utils.debug-info/x86_64-linux-gnu/build_id/libhello_so diff --git a/tests/data/debug-info/x86_64-linux-gnu/debug_link/libhello_so b/tests/data/plugins/flt.lttng-utils.debug-info/x86_64-linux-gnu/debug_link/libhello_so similarity index 100% rename from tests/data/debug-info/x86_64-linux-gnu/debug_link/libhello_so rename to tests/data/plugins/flt.lttng-utils.debug-info/x86_64-linux-gnu/debug_link/libhello_so diff --git a/tests/data/debug-info/x86_64-linux-gnu/debug_link/libhello_so.debug b/tests/data/plugins/flt.lttng-utils.debug-info/x86_64-linux-gnu/debug_link/libhello_so.debug similarity index 100% rename from tests/data/debug-info/x86_64-linux-gnu/debug_link/libhello_so.debug rename to tests/data/plugins/flt.lttng-utils.debug-info/x86_64-linux-gnu/debug_link/libhello_so.debug diff --git a/tests/data/debug-info/x86_64-linux-gnu/dwarf_full/libhello_so b/tests/data/plugins/flt.lttng-utils.debug-info/x86_64-linux-gnu/dwarf_full/libhello_so similarity index 100% rename from tests/data/debug-info/x86_64-linux-gnu/dwarf_full/libhello_so rename to tests/data/plugins/flt.lttng-utils.debug-info/x86_64-linux-gnu/dwarf_full/libhello_so diff --git a/tests/data/debug-info/x86_64-linux-gnu/elf_only/libhello_so b/tests/data/plugins/flt.lttng-utils.debug-info/x86_64-linux-gnu/elf_only/libhello_so similarity index 100% rename from tests/data/debug-info/x86_64-linux-gnu/elf_only/libhello_so rename to tests/data/plugins/flt.lttng-utils.debug-info/x86_64-linux-gnu/elf_only/libhello_so diff --git a/tests/plugins/flt.lttng-utils.debug-info/Makefile.am b/tests/plugins/flt.lttng-utils.debug-info/Makefile.am index a076b3e8..44f17db4 100644 --- a/tests/plugins/flt.lttng-utils.debug-info/Makefile.am +++ b/tests/plugins/flt.lttng-utils.debug-info/Makefile.am @@ -11,8 +11,7 @@ dist_check_SCRIPTS = \ test_dwarf_powerpc64le-linux-gnu \ test_dwarf_powerpc-linux-gnu \ test_dwarf_x86_64-linux-gnu \ - test_lttng_utils_debug_info \ - test_lttng_utils_debug_info.py + test_succeed noinst_PROGRAMS = diff --git a/tests/plugins/flt.lttng-utils.debug-info/test_bin_info_i386-linux-gnu b/tests/plugins/flt.lttng-utils.debug-info/test_bin_info_i386-linux-gnu index 484f6380..553778c2 100755 --- a/tests/plugins/flt.lttng-utils.debug-info/test_bin_info_i386-linux-gnu +++ b/tests/plugins/flt.lttng-utils.debug-info/test_bin_info_i386-linux-gnu @@ -27,9 +27,11 @@ fi # shellcheck source=../../utils/utils.sh source "$UTILSSH" -debug_info_data="${BT_DEBUG_INFO_PATH}/i386-linux-gnu" +this_dir_relative="plugins/flt.lttng-utils.debug-info" +this_dir_build="$BT_TESTS_BUILDDIR/$this_dir_relative" +debug_info_data="$BT_TESTS_DATADIR/$this_dir_relative/i386-linux-gnu" -"${BT_TESTS_BUILDDIR}/plugins/flt.lttng-utils.debug-info/test_bin_info" \ +"$this_dir_build/test_bin_info" \ --foo-addr=0x1c8d \ --printf-offset=0xda \ --printf-lineno=36 \ diff --git a/tests/plugins/flt.lttng-utils.debug-info/test_bin_info_powerpc-linux-gnu b/tests/plugins/flt.lttng-utils.debug-info/test_bin_info_powerpc-linux-gnu index 9a9ffbd3..eacce862 100755 --- a/tests/plugins/flt.lttng-utils.debug-info/test_bin_info_powerpc-linux-gnu +++ b/tests/plugins/flt.lttng-utils.debug-info/test_bin_info_powerpc-linux-gnu @@ -27,9 +27,11 @@ fi # shellcheck source=../../utils/utils.sh source "$UTILSSH" -debug_info_data="${BT_DEBUG_INFO_PATH}/powerpc-linux-gnu" +this_dir_relative="plugins/flt.lttng-utils.debug-info" +this_dir_build="$BT_TESTS_BUILDDIR/$this_dir_relative" +debug_info_data="$BT_TESTS_DATADIR/$this_dir_relative/powerpc-linux-gnu" -"${BT_TESTS_BUILDDIR}/plugins/flt.lttng-utils.debug-info/test_bin_info" \ +"$this_dir_build/test_bin_info" \ --foo-addr=0x23bc \ --printf-offset=0x114 \ --printf-lineno=36 \ diff --git a/tests/plugins/flt.lttng-utils.debug-info/test_bin_info_powerpc64le-linux-gnu b/tests/plugins/flt.lttng-utils.debug-info/test_bin_info_powerpc64le-linux-gnu index 061a27a4..706e1e79 100755 --- a/tests/plugins/flt.lttng-utils.debug-info/test_bin_info_powerpc64le-linux-gnu +++ b/tests/plugins/flt.lttng-utils.debug-info/test_bin_info_powerpc64le-linux-gnu @@ -27,9 +27,11 @@ fi # shellcheck source=../../utils/utils.sh source "$UTILSSH" -debug_info_data="${BT_DEBUG_INFO_PATH}/powerpc64le-linux-gnu" +this_dir_relative="plugins/flt.lttng-utils.debug-info" +this_dir_build="$BT_TESTS_BUILDDIR/$this_dir_relative" +debug_info_data="$BT_TESTS_DATADIR/$this_dir_relative/powerpc64le-linux-gnu" -"${BT_TESTS_BUILDDIR}/plugins/flt.lttng-utils.debug-info/test_bin_info" \ +"$this_dir_build/test_bin_info" \ --foo-addr=0x2e7c \ --printf-offset=0x190 \ --printf-lineno=36 \ diff --git a/tests/plugins/flt.lttng-utils.debug-info/test_bin_info_x86_64-linux-gnu b/tests/plugins/flt.lttng-utils.debug-info/test_bin_info_x86_64-linux-gnu index b50da5ce..4804f75c 100755 --- a/tests/plugins/flt.lttng-utils.debug-info/test_bin_info_x86_64-linux-gnu +++ b/tests/plugins/flt.lttng-utils.debug-info/test_bin_info_x86_64-linux-gnu @@ -27,9 +27,11 @@ fi # shellcheck source=../../utils/utils.sh source "$UTILSSH" -debug_info_data="${BT_DEBUG_INFO_PATH}/x86_64-linux-gnu" +this_dir_relative="plugins/flt.lttng-utils.debug-info" +this_dir_build="$BT_TESTS_BUILDDIR/$this_dir_relative" +debug_info_data="$BT_TESTS_DATADIR/$this_dir_relative/x86_64-linux-gnu" -"${BT_TESTS_BUILDDIR}/plugins/flt.lttng-utils.debug-info/test_bin_info" \ +"$this_dir_build/test_bin_info" \ --foo-addr=0x2277 \ --printf-offset=0xf0 \ --printf-lineno=36 \ diff --git a/tests/plugins/flt.lttng-utils.debug-info/test_dwarf_i386-linux-gnu b/tests/plugins/flt.lttng-utils.debug-info/test_dwarf_i386-linux-gnu index d02227f6..14cb3b1d 100755 --- a/tests/plugins/flt.lttng-utils.debug-info/test_dwarf_i386-linux-gnu +++ b/tests/plugins/flt.lttng-utils.debug-info/test_dwarf_i386-linux-gnu @@ -27,4 +27,9 @@ fi # shellcheck source=../../utils/utils.sh source "$UTILSSH" -"${BT_TESTS_BUILDDIR}/plugins/flt.lttng-utils.debug-info/test_dwarf" "${BT_DEBUG_INFO_PATH}/i386-linux-gnu" +this_dir_relative="plugins/flt.lttng-utils.debug-info" +this_dir_build="$BT_TESTS_BUILDDIR/$this_dir_relative" +debug_info_data="$BT_TESTS_DATADIR/$this_dir_relative/i386-linux-gnu" + +"$this_dir_build/test_dwarf" \ + "$debug_info_data" diff --git a/tests/plugins/flt.lttng-utils.debug-info/test_dwarf_powerpc-linux-gnu b/tests/plugins/flt.lttng-utils.debug-info/test_dwarf_powerpc-linux-gnu index eb4c3b02..742fbad0 100755 --- a/tests/plugins/flt.lttng-utils.debug-info/test_dwarf_powerpc-linux-gnu +++ b/tests/plugins/flt.lttng-utils.debug-info/test_dwarf_powerpc-linux-gnu @@ -27,4 +27,9 @@ fi # shellcheck source=../../utils/utils.sh source "$UTILSSH" -"${BT_TESTS_BUILDDIR}/plugins/flt.lttng-utils.debug-info/test_dwarf" "${BT_DEBUG_INFO_PATH}/powerpc-linux-gnu" +this_dir_relative="plugins/flt.lttng-utils.debug-info" +this_dir_build="$BT_TESTS_BUILDDIR/$this_dir_relative" +debug_info_data="$BT_TESTS_DATADIR/$this_dir_relative/powerpc-linux-gnu" + +"$this_dir_build/test_dwarf" \ + "$debug_info_data" diff --git a/tests/plugins/flt.lttng-utils.debug-info/test_dwarf_powerpc64le-linux-gnu b/tests/plugins/flt.lttng-utils.debug-info/test_dwarf_powerpc64le-linux-gnu index ee4ba4ad..c14ffadc 100755 --- a/tests/plugins/flt.lttng-utils.debug-info/test_dwarf_powerpc64le-linux-gnu +++ b/tests/plugins/flt.lttng-utils.debug-info/test_dwarf_powerpc64le-linux-gnu @@ -27,4 +27,9 @@ fi # shellcheck source=../../utils/utils.sh source "$UTILSSH" -"${BT_TESTS_BUILDDIR}/plugins/flt.lttng-utils.debug-info/test_dwarf" "${BT_DEBUG_INFO_PATH}/powerpc64le-linux-gnu" +this_dir_relative="plugins/flt.lttng-utils.debug-info" +this_dir_build="$BT_TESTS_BUILDDIR/$this_dir_relative" +debug_info_data="$BT_TESTS_DATADIR/$this_dir_relative/powerpc64le-linux-gnu" + +"$this_dir_build/test_dwarf" \ + "$debug_info_data" diff --git a/tests/plugins/flt.lttng-utils.debug-info/test_dwarf_x86_64-linux-gnu b/tests/plugins/flt.lttng-utils.debug-info/test_dwarf_x86_64-linux-gnu index ef5416fd..175ce8a4 100755 --- a/tests/plugins/flt.lttng-utils.debug-info/test_dwarf_x86_64-linux-gnu +++ b/tests/plugins/flt.lttng-utils.debug-info/test_dwarf_x86_64-linux-gnu @@ -27,4 +27,9 @@ fi # shellcheck source=../../utils/utils.sh source "$UTILSSH" -"${BT_TESTS_BUILDDIR}/plugins/flt.lttng-utils.debug-info/test_dwarf" "${BT_DEBUG_INFO_PATH}/x86_64-linux-gnu" +this_dir_relative="plugins/flt.lttng-utils.debug-info" +this_dir_build="$BT_TESTS_BUILDDIR/$this_dir_relative" +debug_info_data="$BT_TESTS_DATADIR/$this_dir_relative/x86_64-linux-gnu" + +"$this_dir_build/test_dwarf" \ + "$debug_info_data/" diff --git a/tests/plugins/flt.lttng-utils.debug-info/test_lttng_utils_debug_info b/tests/plugins/flt.lttng-utils.debug-info/test_lttng_utils_debug_info deleted file mode 100755 index c1772727..00000000 --- a/tests/plugins/flt.lttng-utils.debug-info/test_lttng_utils_debug_info +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash -# -# Copyright (C) 2017 Philippe Proulx -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; only version 2 -# of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# - -if [ "x${BT_TESTS_SRCDIR:-}" != "x" ]; then - UTILSSH="$BT_TESTS_SRCDIR/utils/utils.sh" -else - UTILSSH="$(dirname "$0")/../../utils/utils.sh" -fi - -# shellcheck source=../../utils/utils.sh -source "$UTILSSH" - -export BT_DEBUG_INFO_PATH - -run_python_bt2_test "${BT_TESTS_SRCDIR}/plugins/flt.lttng-utils.debug-info" \ - "test_lttng_utils_debug_info.py" diff --git a/tests/plugins/flt.lttng-utils.debug-info/test_lttng_utils_debug_info.py b/tests/plugins/flt.lttng-utils.debug-info/test_lttng_utils_debug_info.py deleted file mode 100644 index a79ca479..00000000 --- a/tests/plugins/flt.lttng-utils.debug-info/test_lttng_utils_debug_info.py +++ /dev/null @@ -1,44 +0,0 @@ -# -# Copyright (C) 2019 EfficiOS Inc. -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; only version 2 -# of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# - -import unittest -import os.path -import bt2 -import os - - -@unittest.skip('depends on Python bindings, which are broken') -class LttngUtilsDebugInfoTestCase(unittest.TestCase): - def test_debug_info(self): - debug_info_data_path = os.environ['BT_DEBUG_INFO_PATH'] - trace_path = os.path.join(debug_info_data_path, 'trace') - target_prefix = os.path.join(debug_info_data_path, '..', '..') - src = bt2.ComponentSpec('ctf', 'fs', trace_path) - flt = bt2.ComponentSpec( - 'lttng-utils', 'debug-info', {'target-prefix': target_prefix} - ) - it = bt2.TraceCollectionNotificationIterator(src, flt, [bt2.EventNotification]) - notifs = list(it) - debug_info = notifs[2].event['debug_info'] - self.assertEqual(debug_info['bin'], 'libhello_so+0x14d4') - self.assertEqual(debug_info['func'], 'foo+0xa9') - self.assertEqual(debug_info['src'], 'libhello.c:7') - debug_info = notifs[3].event['debug_info'] - self.assertEqual(debug_info['bin'], 'libhello_so+0x15a6') - self.assertEqual(debug_info['func'], 'bar+0xa9') - self.assertEqual(debug_info['src'], 'libhello.c:13') diff --git a/tests/plugins/flt.lttng-utils.debug-info/test_succeed b/tests/plugins/flt.lttng-utils.debug-info/test_succeed new file mode 100755 index 00000000..b57b7a78 --- /dev/null +++ b/tests/plugins/flt.lttng-utils.debug-info/test_succeed @@ -0,0 +1,59 @@ +#!/bin/bash +# +# Copyright (C) 2019 Philippe Proulx +# Copyright (C) 2019 Francis Deslauriers +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; only version 2 +# of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +# This test validates that a `src.ctf.fs` component successfully reads +# specific CTF traces and creates the expected messages. +# +# Such CTF traces to open either exist (in `tests/ctf-traces/succeed`) +# or are generated by this test using local trace generators. + +SH_TAP=1 + +if [ "x${BT_TESTS_SRCDIR:-}" != "x" ]; then + UTILSSH="$BT_TESTS_SRCDIR/utils/utils.sh" +else + UTILSSH="$(dirname "$0")/../../utils/utils.sh" +fi + +# shellcheck source=../../../utils/utils.sh +source "$UTILSSH" + +this_dir_relative="plugins/flt.lttng-utils.debug-info" +this_dir_build="$BT_TESTS_BUILDDIR/$this_dir_relative" +succeed_trace_dir="$BT_CTF_TRACES_PATH/succeed" +expect_dir="$BT_TESTS_DATADIR/$this_dir_relative" +binary_artefact_dir="$BT_TESTS_DATADIR/$this_dir_relative" + +test_debug_info() { + local name="$1" + local local_args=( + "-c" "flt.lttng-utils.debug-info" + "-p" "target-prefix=\"$binary_artefact_dir/x86_64-linux-gnu/dwarf_full\"" + "-c" "sink.text.details" + "-p" "with-trace-name=no,with-stream-name=no" + ) + + bt_diff_cli "$expect_dir/trace-$name.expect" "/dev/null" \ + "$succeed_trace_dir/$name" "${local_args[@]}" + ok $? "Trace '$name' gives the expected output" +} + +plan_tests 1 + +test_debug_info debug-info diff --git a/tests/utils/utils.sh b/tests/utils/utils.sh index 27a5f3ee..baef441a 100644 --- a/tests/utils/utils.sh +++ b/tests/utils/utils.sh @@ -129,7 +129,6 @@ export BT_TESTS_SED_BIN # Data files path BT_TESTS_DATADIR="${BT_TESTS_SRCDIR}/data" BT_CTF_TRACES_PATH="${BT_TESTS_DATADIR}/ctf-traces" -BT_DEBUG_INFO_PATH="${BT_TESTS_DATADIR}/debug-info" ### Diff Functions ### -- 2.34.1