timemory 3.3.0
Modular C++ Toolkit for Performance Analysis and Logging. Profiling API and Tools for C, C++, CUDA, Fortran, and Python. The C++ template API is essentially a framework to creating tools: it is designed to provide a unifying interface for recording various performance measurements alongside data logging and interfaces to other tools.
pthread.cpp File Reference
#include "timemory/backends/threading.hpp"
#include "timemory/compat/library.h"
#include "timemory/library.h"
#include "timemory/manager.hpp"
#include "timemory/operations/types/storage_initializer.hpp"
#include "timemory/runtime/configure.hpp"
#include "timemory/timemory.hpp"
#include "timemory/trace.hpp"
#include "timemory/utility/bits/signals.hpp"
#include <array>
#include <functional>
#include <pthread.h>
+ Include dependency graph for pthread.cpp:

Go to the source code of this file.

Macros

#define TIMEMORY_LIBRARY_SOURCE   1
 

Typedefs

using empty_tuple_t = tim::component_tuple<>
 
using pthread_gotcha_t = tim::component::gotcha< 2, empty_tuple_t, pthread_gotcha >
 
using pthread_bundle_t = tim::component_tuple< pthread_gotcha_t, tim::quirk::auto_start >
 

Functions

TIMEMORY_WEAK_PREFIX bool timemory_enable_pthread_gotcha_wrapper () TIMEMORY_WEAK_POSTFIX
 
auto setup_pthread_gotcha ()
 

Macro Definition Documentation

◆ TIMEMORY_LIBRARY_SOURCE

#define TIMEMORY_LIBRARY_SOURCE   1

Definition at line 26 of file pthread.cpp.

Typedef Documentation

◆ empty_tuple_t

Definition at line 163 of file pthread.cpp.

◆ pthread_bundle_t

◆ pthread_gotcha_t

Definition at line 164 of file pthread.cpp.

Function Documentation

◆ setup_pthread_gotcha()

auto setup_pthread_gotcha ( )

Definition at line 170 of file pthread.cpp.

171{
172# if defined(TIMEMORY_USE_GOTCHA)
174 {
176 TIMEMORY_C_GOTCHA(pthread_gotcha_t, 0, pthread_create);
177 };
178 }
179 return std::make_shared<pthread_bundle_t>();
180# else
181 return std::shared_ptr<pthread_bundle_t>{};
182# endif
183}
#define TIMEMORY_C_GOTCHA(...)
Definition: macros.hpp:323
TIMEMORY_WEAK_PREFIX bool timemory_enable_pthread_gotcha_wrapper() TIMEMORY_WEAK_POSTFIX
Definition: pthread.cpp:55
The gotcha component rewrites the global offset table such that calling the wrapped function actually...
Definition: components.hpp:179
static get_initializer_t & get_initializer()
Definition: components.hpp:234

References tim::component::gotcha< Nt, BundleT, DiffT >::get_initializer(), TIMEMORY_C_GOTCHA, and timemory_enable_pthread_gotcha_wrapper().

◆ timemory_enable_pthread_gotcha_wrapper()

bool timemory_enable_pthread_gotcha_wrapper ( )

Definition at line 55 of file pthread.cpp.

56 {
57 return tim::get_env("TIMEMORY_ENABLE_PTHREAD_GOTCHA_WRAPPER", false);
58 }
Tp get_env(const std::string &env_id, Tp _default, bool _store)

References tim::get_env().

Referenced by setup_pthread_gotcha().