summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2018-01-19 20:00:04 +0000
committerEmmanuele Bassi <ebassi@gnome.org>2018-01-19 20:00:04 +0000
commit552d944f76f1c0961cd2b3bd39fa44eaa8a95f56 (patch)
treebbe9bc2bacfdbbbddbb4d3701fa55f9430b05eef
parent05e5db0f0a8e75de68f8baa3a0b59bf398caebf6 (diff)
Move private profile symbols into the private header
We are going to re-use them in the profile CLI tool.
-rw-r--r--endless/eosprofile-private.h14
-rw-r--r--endless/eosprofile.c13
2 files changed, 15 insertions, 12 deletions
diff --git a/endless/eosprofile-private.h b/endless/eosprofile-private.h
index 5a58233..7c367bd 100644
--- a/endless/eosprofile-private.h
+++ b/endless/eosprofile-private.h
@@ -15,6 +15,8 @@ G_BEGIN_DECLS
#define PROBE_DB_META_START_KEY PROBE_DB_META_BASE_KEY "/start_time"
#define PROBE_DB_META_PROFILE_KEY PROBE_DB_META_BASE_KEY "/profile_time"
+#define PROBE_DB_META_PROBE_TYPE "(sssuua(xx))"
+
typedef struct {
/* element-type (key utf8) (value EosProfileProbe) */
GHashTable *probes;
@@ -33,6 +35,18 @@ typedef struct {
G_LOCK_DEFINE_STATIC (profile_state);
static ProfileState *profile_state;
+struct _EosProfileProbe {
+ char *file;
+ gint32 line;
+ char *function;
+ char *name;
+
+ /* element-type ProfileSample */
+ GArray *samples;
+
+ GMutex probe_lock;
+};
+
typedef struct {
gint64 start_time;
gint64 end_time;
diff --git a/endless/eosprofile.c b/endless/eosprofile.c
index 1bf55f1..5238ef7 100644
--- a/endless/eosprofile.c
+++ b/endless/eosprofile.c
@@ -110,17 +110,6 @@ sample_compare (gconstpointer a,
#define N_SAMPLES 64
-struct _EosProfileProbe {
- char *file;
- gint32 line;
- char *function;
- char *name;
-
- GArray *samples;
-
- GMutex probe_lock;
-};
-
static EosProfileProbe eos_profile_dummy_probe;
static EosProfileProbe *
@@ -606,7 +595,7 @@ eos_profile_state_dump (void)
GVariantBuilder builder;
- g_variant_builder_init (&builder, G_VARIANT_TYPE ("(sssuua(xx))"));
+ g_variant_builder_init (&builder, G_VARIANT_TYPE (PROBE_DB_META_PROBE_TYPE));
g_variant_builder_add (&builder, "s", probe->name);
g_variant_builder_add (&builder, "s", probe->function);