[lttng-dev] TRACELOG_LOGLEVEL not observed when using g++
Mathieu Desnoyers
mathieu.desnoyers at efficios.com
Tue Oct 18 22:07:56 UTC 2016
----- On Oct 11, 2016, at 12:24 PM, Staffan Tjernstrom staffan at eternaltraveller.com wrote:
> The TRACELOG_LOGLEVEL doesn't work when compiling for C++ using the
> gcc toolchain. The events all end up as TRACE_DEBUG_LINE.
>
> For instance, using the easy-ust example from lttng-ust to demonstrate.
>
> The initial run is built as shipped, the second run is built on g++
> (using the AM_CC override in the make file).
Hi,
It's been reported in 2015 by Zifei Tong too:
https://lists.lttng.org/pipermail/lttng-dev/2015-June/024628.html
but it somehow fell through the cracks.
I've opened this bug entry: https://bugs.lttng.org/issues/1069
Just pushed a fix for this issue in master, 2.9, 2.8, 2.7:
commit 4ea4f80e8c57628907b035bd1a0372f7b8faec51
Author: Mathieu Desnoyers <mathieu.desnoyers at efficios.com>
Date: Tue Oct 18 17:56:42 2016 -0400
Fix: loglevel and model_emf_uri with g++ compiled probes
Fix the loglevel and model_emf_uri features for probe providers compiled
with g++. They were previously effectless because of C++ symbol name
mangling. The weakref was refering to the non-mangled symbol, but C++
emits a mangled symbol for the static variable.
Fix this by emitting an extern "C" symbol with hidden visibility on C++.
With a C compiled, this simply turns a static variable into a variable
with hidden visibility.
Fixes: #1069
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers at efficios.com>
Thanks for letting us know!
Mathieu
>
> This initial report is done using
>
> {master} staffan at towel:~/src/test/lttng-easy> gcc -v
> Using built-in specs.
> COLLECT_GCC=gcc
> COLLECT_LTO_WRAPPER=/usr/lib64/gcc/x86_64-suse-linux/4.8/lto-wrapper
> Target: x86_64-suse-linux
> Configured with: ../configure --prefix=/usr --infodir=/usr/share/info
> --mandir=/usr/share/man --libdir=/usr/lib64 --libexecdir=/usr/lib64
> --enable-languages=c,c++,objc,fortran,obj-c++,java,ada
> --enable-checking=release --with-gxx-include-dir=/usr/include/c++/4.8
> --enable-ssp --disable-libssp --disable-plugin
> --with-bugurl=http://bugs.opensuse.org/ --with-pkgversion='SUSE Linux'
> --disable-libgcj --disable-libmudflap --with-slibdir=/lib64
> --with-system-zlib --enable-__cxa_atexit
> --enable-libstdcxx-allocator=new --disable-libstdcxx-pch
> --enable-version-specific-runtime-libs --enable-linker-build-id
> --enable-linux-futex --program-suffix=-4.8 --without-system-libunwind
> --with-arch-32=i586 --with-tune=generic --build=x86_64-suse-linux
> --host=x86_64-suse-linux
> Thread model: posix
> gcc version 4.8.5 (SUSE Linux)
> {master} staffan at towel:~/src/test/lttng-easy> g++ -v
> Using built-in specs.
> COLLECT_GCC=g++
> COLLECT_LTO_WRAPPER=/usr/lib64/gcc/x86_64-suse-linux/4.8/lto-wrapper
> Target: x86_64-suse-linux
> Configured with: ../configure --prefix=/usr --infodir=/usr/share/info
> --mandir=/usr/share/man --libdir=/usr/lib64 --libexecdir=/usr/lib64
> --enable-languages=c,c++,objc,fortran,obj-c++,java,ada
> --enable-checking=release --with-gxx-include-dir=/usr/include/c++/4.8
> --enable-ssp --disable-libssp --disable-plugin
> --with-bugurl=http://bugs.opensuse.org/ --with-pkgversion='SUSE Linux'
> --disable-libgcj --disable-libmudflap --with-slibdir=/lib64
> --with-system-zlib --enable-__cxa_atexit
> --enable-libstdcxx-allocator=new --disable-libstdcxx-pch
> --enable-version-specific-runtime-libs --enable-linker-build-id
> --enable-linux-futex --program-suffix=-4.8 --without-system-libunwind
> --with-arch-32=i586 --with-tune=generic --build=x86_64-suse-linux
> --host=x86_64-suse-linux
> Thread model: posix
> gcc version 4.8.5 (SUSE Linux)
>
> but I've seen the same using gcc 4.9 under Fedora21
>
> {master} staffan at towel:~/src/test/lttng-easy> lttng create
> Session auto-20161011-111412 created.
> Traces will be written in /home/staffan/lttng-traces/auto-20161011-111412
> {master} staffan at towel:~/src/test/lttng-easy> lttng enable-event -u -a
> All UST events are enabled in channel channel0
> {master} staffan at towel:~/src/test/lttng-easy> lttng start
> Tracing started for session auto-20161011-111412
> {master} staffan at towel:~/src/test/lttng-easy> sample
> {master} staffan at towel:~/src/test/lttng-easy> lttng stop
> Waiting for data availability.
> Tracing stopped for session auto-20161011-111412
> {master} staffan at towel:~/src/test/lttng-easy> lttng view -e
> "babeltrace -n none --clock-date --clock-gmt --no-delta -f loglevel" |
> head -n 30
> [2016-10-11 16:16:22.116799023] TRACE_DEBUG_LINE (13)
> lttng_ust_statedump:start: { 6 }, { }
> [2016-10-11 16:16:22.117644633] TRACE_DEBUG_LINE (13)
> lttng_ust_statedump:soinfo: { 6 }, { 0x400000,
> "/home/staffan/src/test/lttng-easy/sample", 23952, 1476202315 }
> [2016-10-11 16:16:22.117662102] TRACE_DEBUG_LINE (13)
> lttng_ust_statedump:soinfo: { 6 }, { 0x7FFCC6F8C000,
> "[linux-vdso.so.1]", 0, -1 }
> [2016-10-11 16:16:22.117726342] TRACE_DEBUG_LINE (13)
> lttng_ust_statedump:soinfo: { 6 }, { 0x7FE82ADE3000,
> "/lib64/libdl-2.19.so", 18904, 1467656154 }
> [2016-10-11 16:16:22.117741383] TRACE_WARNING (4)
> sample_component:message: { 2 }, { "Hello World" }
> [2016-10-11 16:16:22.117742035] TRACE_DEBUG_LINE (13)
> lttng_ust_statedump:soinfo: { 6 }, { 0x7FE82AB87000,
> "/usr/lib64/liblttng-ust.so.0.0.0", 376144, 1445780443 }
> [2016-10-11 16:16:22.117752146] TRACE_DEBUG_LINE (13)
> lttng_ust_statedump:soinfo: { 6 }, { 0x7FE82A7DF000,
> "/lib64/libc-2.19.so", 1979344, 1467656154 }
> [2016-10-11 16:16:22.117762095] TRACE_DEBUG_LINE (13)
> lttng_ust_statedump:soinfo: { 6 }, { 0x7FE82AFE7000,
> "/lib64/ld-2.19.so", 158192, 1467656153 }
> [2016-10-11 16:16:22.117774096] TRACE_DEBUG_LINE (13)
> lttng_ust_statedump:soinfo: { 6 }, { 0x7FE82A5C4000,
> "/usr/lib64/liblttng-ust-tracepoint.so.0.0.0", 43416, 1445780443 }
> [2016-10-11 16:16:22.117784383] TRACE_DEBUG_LINE (13)
> lttng_ust_statedump:soinfo: { 6 }, { 0x7FE82A3BC000,
> "/lib64/librt-2.19.so", 42672, 1467656155 }
> [2016-10-11 16:16:22.117795908] TRACE_DEBUG_LINE (13)
> lttng_ust_statedump:soinfo: { 6 }, { 0x7FE82A1B4000,
> "/usr/lib64/liburcu-bp.so.2.0.0", 31520, 1443872930 }
> [2016-10-11 16:16:22.117806805] TRACE_DEBUG_LINE (13)
> lttng_ust_statedump:soinfo: { 6 }, { 0x7FE829FAC000,
> "/usr/lib64/liburcu-cds.so.2.0.0", 30984, 1443872930 }
> [2016-10-11 16:16:22.117815982] TRACE_WARNING (4)
> sample_component:message: { 2 }, { "Hello World" }
> [2016-10-11 16:16:22.117816280] TRACE_DEBUG_LINE (13)
> lttng_ust_statedump:soinfo: { 6 }, { 0x7FE829D8F000,
> "/lib64/libpthread-2.19.so", 137440, 1467656155 }
> [2016-10-11 16:16:22.117819460] TRACE_DEBUG_LINE (13)
> lttng_ust_statedump:end: { 6 }, { }
> [2016-10-11 16:16:22.117875170] TRACE_WARNING (4)
> sample_component:message: { 2 }, { "Hello World" }
> [2016-10-11 16:16:22.117933513] TRACE_WARNING (4)
> sample_component:message: { 2 }, { "Hello World" }
> [2016-10-11 16:16:22.117991242] TRACE_WARNING (4)
> sample_component:message: { 2 }, { "Hello World" }
> [2016-10-11 16:16:22.118049045] TRACE_WARNING (4)
> sample_component:message: { 2 }, { "Hello World" }
> [2016-10-11 16:16:22.118106607] TRACE_WARNING (4)
> sample_component:message: { 2 }, { "Hello World" }
> [2016-10-11 16:16:22.118164172] TRACE_WARNING (4)
> sample_component:message: { 2 }, { "Hello World" }
> [2016-10-11 16:16:22.118221726] TRACE_WARNING (4)
> sample_component:message: { 2 }, { "Hello World" }
> [2016-10-11 16:16:22.118279306] TRACE_WARNING (4)
> sample_component:message: { 2 }, { "Hello World" }
> [2016-10-11 16:16:22.118336868] TRACE_WARNING (4)
> sample_component:message: { 2 }, { "Hello World" }
> [2016-10-11 16:16:22.118394422] TRACE_WARNING (4)
> sample_component:message: { 2 }, { "Hello World" }
> [2016-10-11 16:16:22.118452073] TRACE_WARNING (4)
> sample_component:message: { 2 }, { "Hello World" }
> [2016-10-11 16:16:22.118509608] TRACE_WARNING (4)
> sample_component:message: { 2 }, { "Hello World" }
> [2016-10-11 16:16:22.118567130] TRACE_WARNING (4)
> sample_component:message: { 2 }, { "Hello World" }
> [2016-10-11 16:16:22.118624840] TRACE_WARNING (4)
> sample_component:message: { 2 }, { "Hello World" }
> [2016-10-11 16:16:22.118682477] TRACE_WARNING (4)
> sample_component:message: { 2 }, { "Hello World" }
> {master} staffan at towel:~/src/test/lttng-easy> lttng destroy
> Session auto-20161011-111412 destroyed
> {master} staffan at towel:~/src/test/lttng-easy> emacs Makefile
> {master} staffan at towel:~/src/test/lttng-easy> AM_CC=g++ make
> make: Nothing to be done for 'all'.
> {master} staffan at towel:~/src/test/lttng-easy> make lcean
> make: *** No rule to make target 'lcean'. Stop.
> {master} staffan at towel:~/src/test/lttng-easy> make clean
> rm -f *.html
> rm -f *.o sample
> {master} staffan at towel:~/src/test/lttng-easy> AM_CC=g++ make
> g++ -I. \
> -c -o sample.o sample.c
> g++ -I. \
> -c -o tp.o tp.c
> g++ -o sample \
> sample.o tp.o -ldl -llttng-ust
> {master} staffan at towel:~/src/test/lttng-easy> lttng create
> Session auto-20161011-111753 created.
> Traces will be written in /home/staffan/lttng-traces/auto-20161011-111753
> {master} staffan at towel:~/src/test/lttng-easy> lttng enable-event -u -a
> All UST events are enabled in channel channel0
> {master} staffan at towel:~/src/test/lttng-easy> lttng start
> Tracing started for session auto-20161011-111753
> {master} staffan at towel:~/src/test/lttng-easy> sample
> {master} staffan at towel:~/src/test/lttng-easy> lttng stop
> Waiting for data availability.
> Tracing stopped for session auto-20161011-111753
> {master} staffan at towel:~/src/test/lttng-easy> lttng view -e
> "babeltrace -n none --clock-date --clock-gmt --no-delta -f loglevel" |
> head -n 30
> [2016-10-11 16:18:02.535281184] TRACE_DEBUG_LINE (13)
> lttng_ust_statedump:start: { 6 }, { }
> [2016-10-11 16:18:02.536099671] TRACE_DEBUG_LINE (13)
> lttng_ust_statedump:soinfo: { 6 }, { 0x400000,
> "/home/staffan/src/test/lttng-easy/sample", 24232, 1476202668 }
> [2016-10-11 16:18:02.536185078] TRACE_DEBUG_LINE (13)
> lttng_ust_statedump:soinfo: { 6 }, { 0x7FFCB49E0000,
> "[linux-vdso.so.1]", 0, -1 }
> [2016-10-11 16:18:02.536197222] TRACE_DEBUG_LINE (13)
> sample_component:message: { 1 }, { "Hello World" }
> [2016-10-11 16:18:02.536210187] TRACE_DEBUG_LINE (13)
> lttng_ust_statedump:soinfo: { 6 }, { 0x7FBDD14C8000,
> "/lib64/libdl-2.19.so", 18904, 1467656154 }
> [2016-10-11 16:18:02.536223321] TRACE_DEBUG_LINE (13)
> lttng_ust_statedump:soinfo: { 6 }, { 0x7FBDD126C000,
> "/usr/lib64/liblttng-ust.so.0.0.0", 376144, 1445780443 }
> [2016-10-11 16:18:02.536248525] TRACE_DEBUG_LINE (13)
> lttng_ust_statedump:soinfo: { 6 }, { 0x7FBDD0EE8000,
> "/usr/lib64/libstdc++.so.6.0.21", 1574408, 1459961643 }
> [2016-10-11 16:18:02.536254455] TRACE_DEBUG_LINE (13)
> sample_component:message: { 1 }, { "Hello World" }
> [2016-10-11 16:18:02.536258569] TRACE_DEBUG_LINE (13)
> lttng_ust_statedump:soinfo: { 6 }, { 0x7FBDD0BE7000,
> "/lib64/libm-2.19.so", 1118640, 1467656154 }
> [2016-10-11 16:18:02.536264711] TRACE_DEBUG_LINE (13)
> lttng_ust_statedump:soinfo: { 6 }, { 0x7FBDD09D0000,
> "/lib64/libgcc_s.so.1", 92568, 1459961618 }
> [2016-10-11 16:18:02.536273618] TRACE_DEBUG_LINE (13)
> lttng_ust_statedump:soinfo: { 6 }, { 0x7FBDD0628000,
> "/lib64/libc-2.19.so", 1979344, 1467656154 }
> [2016-10-11 16:18:02.536282489] TRACE_DEBUG_LINE (13)
> lttng_ust_statedump:soinfo: { 6 }, { 0x7FBDD16CC000,
> "/lib64/ld-2.19.so", 158192, 1467656153 }
> [2016-10-11 16:18:02.536293368] TRACE_DEBUG_LINE (13)
> lttng_ust_statedump:soinfo: { 6 }, { 0x7FBDD040D000,
> "/usr/lib64/liblttng-ust-tracepoint.so.0.0.0", 43416, 1445780443 }
> [2016-10-11 16:18:02.536302751] TRACE_DEBUG_LINE (13)
> lttng_ust_statedump:soinfo: { 6 }, { 0x7FBDD0205000,
> "/lib64/librt-2.19.so", 42672, 1467656155 }
> [2016-10-11 16:18:02.536313099] TRACE_DEBUG_LINE (13)
> sample_component:message: { 1 }, { "Hello World" }
> [2016-10-11 16:18:02.536313336] TRACE_DEBUG_LINE (13)
> lttng_ust_statedump:soinfo: { 6 }, { 0x7FBDCFFFD000,
> "/usr/lib64/liburcu-bp.so.2.0.0", 31520, 1443872930 }
> [2016-10-11 16:18:02.536323885] TRACE_DEBUG_LINE (13)
> lttng_ust_statedump:soinfo: { 6 }, { 0x7FBDCFDF5000,
> "/usr/lib64/liburcu-cds.so.2.0.0", 30984, 1443872930 }
> [2016-10-11 16:18:02.536332582] TRACE_DEBUG_LINE (13)
> lttng_ust_statedump:soinfo: { 6 }, { 0x7FBDCFBD8000,
> "/lib64/libpthread-2.19.so", 137440, 1467656155 }
> [2016-10-11 16:18:02.536335641] TRACE_DEBUG_LINE (13)
> lttng_ust_statedump:end: { 6 }, { }
> [2016-10-11 16:18:02.536370396] TRACE_DEBUG_LINE (13)
> sample_component:message: { 1 }, { "Hello World" }
> [2016-10-11 16:18:02.536427433] TRACE_DEBUG_LINE (13)
> sample_component:message: { 1 }, { "Hello World" }
> [2016-10-11 16:18:02.536484251] TRACE_DEBUG_LINE (13)
> sample_component:message: { 1 }, { "Hello World" }
> [2016-10-11 16:18:02.536541001] TRACE_DEBUG_LINE (13)
> sample_component:message: { 1 }, { "Hello World" }
> [2016-10-11 16:18:02.536597774] TRACE_DEBUG_LINE (13)
> sample_component:message: { 1 }, { "Hello World" }
> [2016-10-11 16:18:02.536654713] TRACE_DEBUG_LINE (13)
> sample_component:message: { 1 }, { "Hello World" }
> [2016-10-11 16:18:02.536711455] TRACE_DEBUG_LINE (13)
> sample_component:message: { 1 }, { "Hello World" }
> [2016-10-11 16:18:02.536768188] TRACE_DEBUG_LINE (13)
> sample_component:message: { 1 }, { "Hello World" }
> [2016-10-11 16:18:02.536825035] TRACE_DEBUG_LINE (13)
> sample_component:message: { 1 }, { "Hello World" }
> [2016-10-11 16:18:02.536881893] TRACE_DEBUG_LINE (13)
> sample_component:message: { 1 }, { "Hello World" }
> [2016-10-11 16:18:02.536938558] TRACE_DEBUG_LINE (13)
> sample_component:message: { 1 }, { "Hello World" }
>
>
> _______________________________________________
> lttng-dev mailing list
> lttng-dev at lists.lttng.org
> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
--
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com
More information about the lttng-dev
mailing list