/* To catch attempts to access to invalid profile structures. */
#define PROFILE_MAGIC 0x439929d8
+static FILE *profiling_file = NULL;
+
BlueSkyProfile *bluesky_profile_new()
{
BlueSkyProfile *profile = g_new0(BlueSkyProfile, 1);
void bluesky_profile_add_event(BlueSkyProfile *profile, char *message)
{
+ if (profiling_file == NULL)
+ return;
+
g_return_if_fail(profile != NULL);
if (profile->magic != PROFILE_MAGIC) {
g_mutex_unlock(profile->lock);
}
-static FILE *profiling_file = NULL;
static GStaticMutex profiling_print_lock = G_STATIC_MUTEX_INIT;
void bluesky_profile_set_output(FILE *stream)
void bluesky_profile_print(BlueSkyProfile *profile)
{
- if (profiling_file == NULL)
- return;
FILE *stream = profiling_file;
+ if (stream == NULL)
+ return;
g_return_if_fail(profile != NULL);