tests: test_ust_constructor: Use a C-compiled static archive
authorKienan Stewart <kstewart@efficios.com>
Thu, 8 Feb 2024 13:46:46 +0000 (08:46 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 7 Mar 2024 17:11:31 +0000 (12:11 -0500)
commitab4919b5b443ac46269a5ba9f6bd00f0cbd9f35b
tree627ec639073a7bd42bd2750de3ef4786ed34aa92
parentb8e79f3f1057ff91224991f76b3837202bde5a06
tests: test_ust_constructor: Use a C-compiled static archive

Observed issue
==============

The test output describes the tracepoint as
`constructor_c_provider_static_archive`, which can be a bit misleading.

The tracepoints are indeed emitted inside C-style constructors. However,
as the tracepoints are being compiled inside a C++ translation unit,
they were never traceable when using a heap allocated implementation. If
the static archive is compiled as C and linked against the C++
application, the tracepoints are expected to always be visible.

Solution
========

In splitting the c-style constructors for the static archive into a
separate object the compilation can be made to use gcc instead of g++.

Drawback
========

This change doesn't keep a C-style constructor inside a C++ application
and asserts that it is indeed not traced when compiled using a heap
allocated implementation.

Signed-off-by: Kienan Stewart <kstewart@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I3837fe318b2f8e1d9572ee0bfb6f6bbbd047c5f5
tests/regression/ust/ust-constructor/test_ust_constructor.py
tests/utils/testapp/gen-ust-events-constructor/Makefile.am
tests/utils/testapp/gen-ust-events-constructor/main.cpp
tests/utils/testapp/gen-ust-events-constructor/tp-a.h
tests/utils/testapp/gen-ust-events-constructor/tp-a_c-define.c [new file with mode: 0644]
tests/utils/testapp/gen-ust-events-constructor/tp-a_c-provider.c [new file with mode: 0644]
tests/utils/testapp/gen-ust-events-constructor/tp-a_c.h [new file with mode: 0644]
This page took 0.025921 seconds and 4 git commands to generate.