Successfully implemented a cpuTime marshaller.
[aesalon.git] / include / informer / Informer.h
blob7fda2f6f717c91e03fb82851de144f32fd1eda31
1 /**
2 Aesalon, a tool to visualize a program's behaviour at run-time.
3 Copyright (C) 2010, Aesalon Development Team.
5 Aesalon is distributed under the terms of the GNU GPLv3. For more
6 licensing information, see the file LICENSE included with the distribution.
8 @file include/common/Informer.h
12 #ifndef AesalonInformer_Informer_H
13 #define AesalonInformer_Informer_H
15 #include <stdint.h>
16 #include <pthread.h>
18 #include "common/SharedMemoryHeader.h"
19 #include "common/SHMPacket.h"
20 #include "common/Config.h"
22 #ifdef __GNUC__
23 #pragma GCC visibility push(hidden)
24 #define AC_EXPORT __attribute__((visibility("default")))
25 #define AC_PRIVATE __attribute__((visibility("hidden")))
26 #else
27 #error "No supported compiler found."
28 #endif
30 /** Constructor for the Informer module. Should be called from every module constructor.
32 void __attribute__((constructor)) AC_EXPORT AI_Construct();
33 /** Destructor for the Informer module. Should be called from every module destructor.
35 void __attribute__((destructor)) AC_EXPORT AI_Destruct();
37 void AC_EXPORT AI_StartPacket(ModuleID moduleID);
38 void AC_EXPORT *AI_PacketSpace(uint32_t size);
39 void AC_EXPORT AI_EndPacket();
41 /** Calculates a unique timestamp for the current instant.
43 uint64_t AC_EXPORT AI_Timestamp();
45 /** Returns a configuration item, @a name, as a string.
47 const char AC_EXPORT *AI_ConfigurationString(const char *name);
48 /** Returns a configuration item, @a name, as a long.
50 long AC_EXPORT AI_ConfigurationLong(const char *name);
51 /** Returns a configuration item, @a name, as a boolean integer.
53 int AC_EXPORT AI_ConfigurationBool(const char *name);
55 /** Returns the list of threads currently active for data collection
56 in the current process.
57 @param size A pointer to an integer to store the size of the list.
58 @return The list of target threads, with size @a size.
60 pthread_t AC_EXPORT *AI_TargetThreadList(int *size);
62 /** Returns 1 if data should be collected, 0 otherwise.
64 short AC_EXPORT AI_CollectionStatus();
66 /** Temporarily pauses collection for the given thread.
68 void AC_EXPORT AI_StopCollection(pthread_t tid);
69 /** Continues collection for the given thread.
71 void AC_EXPORT AI_ContinueCollection(pthread_t tid);
73 void AC_EXPORT AI_CreateMonitoringThread(void *(func)(void *), void *arg);
75 /* Overloaded functions. */
77 int AC_EXPORT pthread_create(pthread_t *thread, const pthread_attr_t *attr, void *(*start_routine) (void *), void *arg);
79 #ifdef __GNUC__
80 #pragma GCC visibility pop
81 #else
82 #error "No supported compiler found."
83 #endif
85 #endif