Skip to content

Instrumentation in shared object

bprail edited this page Aug 30, 2014 · 2 revisions

This project would develop support such that the instrumented code could be placed solely in a shared object. Several obstacles would be presented.

First, setting up the compilation / linking process such that the instrumentation would be made and support code included in a shared object, without also including the core routines like "main / ct_orig_main" or the background thread writer. This would be made under the assumption that the shared object would be loaded by an instrumented binary that would contain the necessary support.

Second, can shared objects require thread local storage? The thread local buffer and number are required by the instrumentation. What happens if they are declared in the shared object? Are these declarations the same as the ones in the core binary? What happens if two shared objects declare these variables? Should a separate shared object providing this support be created?

Third, move the initialization and teardown process for Contech out of the replace main / exit paradigm and instead use routines like, "atexit(func(void))".

Quoting about shared objects regarding init and fini routines: Instead, libraries should export routines using the attribute((constructor)) and attribute((destructor)) function attributes.

Only minimal progress has been made with splitting common/runtime/ct_runtime.c into two files.

Clone this wiki locally