diff mbox

babeltrace: do not use g_quark_from_static_string in unloadable code

Message ID 1470427182-21295-1-git-send-email-nathan_lynch@mentor.com
State Accepted, archived
Headers show

Commit Message

Nathan Lynch Aug. 5, 2016, 7:59 p.m. UTC
The GLib Quark documentation says that g_quark_from_static_string:

   "... can only be used if the string will continue to exist until the
    program terminates. It can be used with statically allocated
    strings in the main program, but not with statically allocated
    memory in dynamically loaded modules."

https://developer.gnome.org/glib/stable/glib-Quarks.html#g-quark-from-static-string

Convert call sites of g_quark_from_static_string to
g_quark_from_string in code that is potentially unloadable.  Call
sites in the babeltrace main program remain unchanged.

Signed-off-by: Nathan Lynch <nathan_lynch at mentor.com>
---
 formats/bt-dummy/bt-dummy.c                          |  2 +-
 formats/ctf-metadata/ctf-metadata.c                  |  2 +-
 formats/ctf-text/ctf-text.c                          | 14 +++++++-------
 formats/ctf/ctf.c                                    | 20 ++++++++++----------
 .../ctf/metadata/ctf-visitor-generate-io-struct.c    |  6 +++---
 formats/lttng-live/lttng-live-comm.c                 |  2 +-
 formats/lttng-live/lttng-live-plugin.c               |  2 +-
 lib/debug-info.c                                     | 14 +++++++-------
 types/enum.c                                         |  2 +-
 types/float.c                                        | 12 ++++++------
 10 files changed, 38 insertions(+), 38 deletions(-)

Comments

Jérémie Galarneau Sept. 12, 2016, 7:09 p.m. UTC | #1
Merged, thanks!

Jérémie

On Fri, Aug 5, 2016 at 3:59 PM, Nathan Lynch <nathan_lynch at mentor.com> wrote:
> The GLib Quark documentation says that g_quark_from_static_string:
>
>    "... can only be used if the string will continue to exist until the
>     program terminates. It can be used with statically allocated
>     strings in the main program, but not with statically allocated
>     memory in dynamically loaded modules."
>
> https://developer.gnome.org/glib/stable/glib-Quarks.html#g-quark-from-static-string
>
> Convert call sites of g_quark_from_static_string to
> g_quark_from_string in code that is potentially unloadable.  Call
> sites in the babeltrace main program remain unchanged.
>
> Signed-off-by: Nathan Lynch <nathan_lynch at mentor.com>
> ---
>  formats/bt-dummy/bt-dummy.c                          |  2 +-
>  formats/ctf-metadata/ctf-metadata.c                  |  2 +-
>  formats/ctf-text/ctf-text.c                          | 14 +++++++-------
>  formats/ctf/ctf.c                                    | 20 ++++++++++----------
>  .../ctf/metadata/ctf-visitor-generate-io-struct.c    |  6 +++---
>  formats/lttng-live/lttng-live-comm.c                 |  2 +-
>  formats/lttng-live/lttng-live-plugin.c               |  2 +-
>  lib/debug-info.c                                     | 14 +++++++-------
>  types/enum.c                                         |  2 +-
>  types/float.c                                        | 12 ++++++------
>  10 files changed, 38 insertions(+), 38 deletions(-)
>
> diff --git a/formats/bt-dummy/bt-dummy.c b/formats/bt-dummy/bt-dummy.c
> index 6192e8880757..2f866dc95e3a 100644
> --- a/formats/bt-dummy/bt-dummy.c
> +++ b/formats/bt-dummy/bt-dummy.c
> @@ -79,7 +79,7 @@ void __attribute__((constructor)) bt_dummy_init(void)
>  {
>         int ret;
>
> -       bt_dummy_format.name = g_quark_from_static_string("dummy");
> +       bt_dummy_format.name = g_quark_from_string("dummy");
>         ret = bt_register_format(&bt_dummy_format);
>         assert(!ret);
>  }
> diff --git a/formats/ctf-metadata/ctf-metadata.c b/formats/ctf-metadata/ctf-metadata.c
> index a5a74c3178db..ff65306f764a 100644
> --- a/formats/ctf-metadata/ctf-metadata.c
> +++ b/formats/ctf-metadata/ctf-metadata.c
> @@ -132,7 +132,7 @@ void __attribute__((constructor)) ctf_metadata_init(void)
>  {
>         int ret;
>
> -       ctf_metadata_format.name = g_quark_from_static_string("ctf-metadata");
> +       ctf_metadata_format.name = g_quark_from_string("ctf-metadata");
>         ret = bt_register_format(&ctf_metadata_format);
>         assert(!ret);
>  }
> diff --git a/formats/ctf-text/ctf-text.c b/formats/ctf-text/ctf-text.c
> index 883a10a8745a..a0b423c2254d 100644
> --- a/formats/ctf-text/ctf-text.c
> +++ b/formats/ctf-text/ctf-text.c
> @@ -123,12 +123,12 @@ static GQuark Q_STREAM_PACKET_CONTEXT_TIMESTAMP_BEGIN,
>  static
>  void __attribute__((constructor)) init_quarks(void)
>  {
> -       Q_STREAM_PACKET_CONTEXT_TIMESTAMP_BEGIN = g_quark_from_static_string("stream.packet.context.timestamp_begin");
> -       Q_STREAM_PACKET_CONTEXT_TIMESTAMP_END = g_quark_from_static_string("stream.packet.context.timestamp_end");
> -       Q_STREAM_PACKET_CONTEXT_EVENTS_DISCARDED = g_quark_from_static_string("stream.packet.context.events_discarded");
> -       Q_STREAM_PACKET_CONTEXT_CONTENT_SIZE = g_quark_from_static_string("stream.packet.context.content_size");
> -       Q_STREAM_PACKET_CONTEXT_PACKET_SIZE = g_quark_from_static_string("stream.packet.context.packet_size");
> -       Q_STREAM_PACKET_CONTEXT_PACKET_SEQ_NUM = g_quark_from_static_string("stream.packet.context.packet_seq_num");
> +       Q_STREAM_PACKET_CONTEXT_TIMESTAMP_BEGIN = g_quark_from_string("stream.packet.context.timestamp_begin");
> +       Q_STREAM_PACKET_CONTEXT_TIMESTAMP_END = g_quark_from_string("stream.packet.context.timestamp_end");
> +       Q_STREAM_PACKET_CONTEXT_EVENTS_DISCARDED = g_quark_from_string("stream.packet.context.events_discarded");
> +       Q_STREAM_PACKET_CONTEXT_CONTENT_SIZE = g_quark_from_string("stream.packet.context.content_size");
> +       Q_STREAM_PACKET_CONTEXT_PACKET_SIZE = g_quark_from_string("stream.packet.context.packet_size");
> +       Q_STREAM_PACKET_CONTEXT_PACKET_SEQ_NUM = g_quark_from_string("stream.packet.context.packet_seq_num");
>  }
>
>  static
> @@ -605,7 +605,7 @@ void __attribute__((constructor)) ctf_text_init(void)
>  {
>         int ret;
>
> -       ctf_text_format.name = g_quark_from_static_string("text");
> +       ctf_text_format.name = g_quark_from_string("text");
>         ret = bt_register_format(&ctf_text_format);
>         assert(!ret);
>  }
> diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c
> index 5578e68d49b5..9b5302199e17 100644
> --- a/formats/ctf/ctf.c
> +++ b/formats/ctf/ctf.c
> @@ -1789,7 +1789,7 @@ int create_stream_one_packet_index(struct ctf_stream_pos *pos,
>                         fprintf(stderr, "[error] Unable to read packet header: %s\n", strerror(-ret));
>                         return ret;
>                 }
> -               len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.trace_packet_header->declaration, g_quark_from_static_string("magic"));
> +               len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.trace_packet_header->declaration, g_quark_from_string("magic"));
>                 if (len_index >= 0) {
>                         struct bt_definition *field;
>                         uint64_t magic;
> @@ -1806,7 +1806,7 @@ int create_stream_one_packet_index(struct ctf_stream_pos *pos,
>                 }
>
>                 /* check uuid */
> -               len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.trace_packet_header->declaration, g_quark_from_static_string("uuid"));
> +               len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.trace_packet_header->declaration, g_quark_from_string("uuid"));
>                 if (len_index >= 0) {
>                         struct definition_array *defarray;
>                         struct bt_definition *field;
> @@ -1831,7 +1831,7 @@ int create_stream_one_packet_index(struct ctf_stream_pos *pos,
>                         }
>                 }
>
> -               len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.trace_packet_header->declaration, g_quark_from_static_string("stream_id"));
> +               len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.trace_packet_header->declaration, g_quark_from_string("stream_id"));
>                 if (len_index >= 0) {
>                         struct bt_definition *field;
>
> @@ -1862,7 +1862,7 @@ int create_stream_one_packet_index(struct ctf_stream_pos *pos,
>                         return ret;
>                 }
>                 /* read packet size from header */
> -               len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.stream_packet_context->declaration, g_quark_from_static_string("packet_size"));
> +               len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.stream_packet_context->declaration, g_quark_from_string("packet_size"));
>                 if (len_index >= 0) {
>                         struct bt_definition *field;
>
> @@ -1874,7 +1874,7 @@ int create_stream_one_packet_index(struct ctf_stream_pos *pos,
>                 }
>
>                 /* read content size from header */
> -               len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.stream_packet_context->declaration, g_quark_from_static_string("content_size"));
> +               len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.stream_packet_context->declaration, g_quark_from_string("content_size"));
>                 if (len_index >= 0) {
>                         struct bt_definition *field;
>
> @@ -1886,7 +1886,7 @@ int create_stream_one_packet_index(struct ctf_stream_pos *pos,
>                 }
>
>                 /* read timestamp begin from header */
> -               len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.stream_packet_context->declaration, g_quark_from_static_string("timestamp_begin"));
> +               len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.stream_packet_context->declaration, g_quark_from_string("timestamp_begin"));
>                 if (len_index >= 0) {
>                         struct bt_definition *field;
>
> @@ -1901,7 +1901,7 @@ int create_stream_one_packet_index(struct ctf_stream_pos *pos,
>                 }
>
>                 /* read timestamp end from header */
> -               len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.stream_packet_context->declaration, g_quark_from_static_string("timestamp_end"));
> +               len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.stream_packet_context->declaration, g_quark_from_string("timestamp_end"));
>                 if (len_index >= 0) {
>                         struct bt_definition *field;
>
> @@ -1916,7 +1916,7 @@ int create_stream_one_packet_index(struct ctf_stream_pos *pos,
>                 }
>
>                 /* read events discarded from header */
> -               len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.stream_packet_context->declaration, g_quark_from_static_string("events_discarded"));
> +               len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.stream_packet_context->declaration, g_quark_from_string("events_discarded"));
>                 if (len_index >= 0) {
>                         struct bt_definition *field;
>
> @@ -1928,7 +1928,7 @@ int create_stream_one_packet_index(struct ctf_stream_pos *pos,
>                 /* read packet_seq_num from header */
>                 len_index = bt_struct_declaration_lookup_field_index(
>                                 file_stream->parent.stream_packet_context->declaration,
> -                               g_quark_from_static_string("packet_seq_num"));
> +                               g_quark_from_string("packet_seq_num"));
>                 if (len_index >= 0) {
>                         struct bt_definition *field;
>
> @@ -2848,7 +2848,7 @@ void __attribute__((constructor)) ctf_init(void)
>  {
>         int ret;
>
> -       ctf_format.name = g_quark_from_static_string("ctf");
> +       ctf_format.name = g_quark_from_string("ctf");
>         ret = bt_register_format(&ctf_format);
>         assert(!ret);
>  }
> diff --git a/formats/ctf/metadata/ctf-visitor-generate-io-struct.c b/formats/ctf/metadata/ctf-visitor-generate-io-struct.c
> index 223d7d07d02f..097a482e1718 100644
> --- a/formats/ctf/metadata/ctf-visitor-generate-io-struct.c
> +++ b/formats/ctf/metadata/ctf-visitor-generate-io-struct.c
> @@ -1114,7 +1114,7 @@ struct bt_declaration *ctf_declaration_enum_visit(FILE *fd, int depth,
>                         }
>                 }
>                 if (!container_type) {
> -                       declaration = bt_lookup_declaration(g_quark_from_static_string("int"),
> +                       declaration = bt_lookup_declaration(g_quark_from_string("int"),
>                                                          declaration_scope);
>                         if (!declaration) {
>                                 fprintf(fd, "[error] %s: \"int\" type declaration missing for enumeration\n", __func__);
> @@ -2075,7 +2075,7 @@ int ctf_stream_visit(FILE *fd, int depth, struct ctf_node *node,
>         if (CTF_STREAM_FIELD_IS_SET(stream, stream_id)) {
>                 /* check that packet header has stream_id field. */
>                 if (!trace->packet_header_decl
> -                   || bt_struct_declaration_lookup_field_index(trace->packet_header_decl, g_quark_from_static_string("stream_id")) < 0) {
> +                   || bt_struct_declaration_lookup_field_index(trace->packet_header_decl, g_quark_from_string("stream_id")) < 0) {
>                         ret = -EPERM;
>                         fprintf(fd, "[error] %s: missing stream_id field in packet header declaration, but stream_id attribute is declared for stream.\n", __func__);
>                         goto error;
> @@ -2293,7 +2293,7 @@ int ctf_trace_visit(FILE *fd, int depth, struct ctf_node *node, struct ctf_trace
>         if (!CTF_TRACE_FIELD_IS_SET(trace, byte_order)) {
>                 /* check that the packet header contains a "magic" field */
>                 if (!trace->packet_header_decl
> -                   || bt_struct_declaration_lookup_field_index(trace->packet_header_decl, g_quark_from_static_string("magic")) < 0) {
> +                   || bt_struct_declaration_lookup_field_index(trace->packet_header_decl, g_quark_from_string("magic")) < 0) {
>                         ret = -EPERM;
>                         fprintf(fd, "[error] %s: missing both byte_order and packet header magic number in trace declaration\n", __func__);
>                         goto error;
> diff --git a/formats/lttng-live/lttng-live-comm.c b/formats/lttng-live/lttng-live-comm.c
> index 1912b57f5795..cd146d764886 100644
> --- a/formats/lttng-live/lttng-live-comm.c
> +++ b/formats/lttng-live/lttng-live-comm.c
> @@ -1646,7 +1646,7 @@ int lttng_live_read(struct lttng_live_ctx *ctx)
>                 goto end;
>         }
>
> -       fmt_write = bt_lookup_format(g_quark_from_static_string("text"));
> +       fmt_write = bt_lookup_format(g_quark_from_string("text"));
>         if (!fmt_write) {
>                 fprintf(stderr, "[error] ctf-text error\n");
>                 goto end;
> diff --git a/formats/lttng-live/lttng-live-plugin.c b/formats/lttng-live/lttng-live-plugin.c
> index a1fbb9e826ef..35f0f48a4288 100644
> --- a/formats/lttng-live/lttng-live-plugin.c
> +++ b/formats/lttng-live/lttng-live-plugin.c
> @@ -332,7 +332,7 @@ void __attribute__((constructor)) lttng_live_init(void)
>  {
>         int ret;
>
> -       lttng_live_format.name = g_quark_from_static_string("lttng-live");
> +       lttng_live_format.name = g_quark_from_string("lttng-live");
>         ret = bt_register_format(&lttng_live_format);
>         assert(!ret);
>  }
> diff --git a/lib/debug-info.c b/lib/debug-info.c
> index 4e1be1e3d6d3..eff5134b13e8 100644
> --- a/lib/debug-info.c
> +++ b/lib/debug-info.c
> @@ -66,17 +66,17 @@ struct debug_info {
>  static
>  int debug_info_init(struct debug_info *info)
>  {
> -       info->q_statedump_bin_info = g_quark_from_static_string(
> +       info->q_statedump_bin_info = g_quark_from_string(
>                         "lttng_ust_statedump:bin_info");
> -       info->q_statedump_debug_link = g_quark_from_static_string(
> +       info->q_statedump_debug_link = g_quark_from_string(
>                         "lttng_ust_statedump:debug_link)");
> -       info->q_statedump_build_id = g_quark_from_static_string(
> +       info->q_statedump_build_id = g_quark_from_string(
>                         "lttng_ust_statedump:build_id");
> -       info->q_statedump_start = g_quark_from_static_string(
> +       info->q_statedump_start = g_quark_from_string(
>                         "lttng_ust_statedump:start");
> -       info->q_dl_open = g_quark_from_static_string("lttng_ust_dl:dlopen");
> -       info->q_lib_load = g_quark_from_static_string("lttng_ust_lib:load");
> -       info->q_lib_unload = g_quark_from_static_string("lttng_ust_lib:unload");
> +       info->q_dl_open = g_quark_from_string("lttng_ust_dl:dlopen");
> +       info->q_lib_load = g_quark_from_string("lttng_ust_lib:load");
> +       info->q_lib_unload = g_quark_from_string("lttng_ust_lib:unload");
>
>         return bin_info_init();
>  }
> diff --git a/types/enum.c b/types/enum.c
> index 8394e1b35b70..ec10a1695550 100644
> --- a/types/enum.c
> +++ b/types/enum.c
> @@ -449,7 +449,7 @@ struct bt_definition *
>         definition_integer_parent =
>                 enum_declaration->integer_declaration->p.definition_new(&enum_declaration->integer_declaration->p,
>                                 _enum->p.scope,
> -                               g_quark_from_static_string("container"), 0, NULL);
> +                               g_quark_from_string("container"), 0, NULL);
>         _enum->integer = container_of(definition_integer_parent,
>                                       struct definition_integer, p);
>         return &_enum->p;
> diff --git a/types/float.c b/types/float.c
> index 3b61f8faf0a3..99c2acc7c7d7 100644
> --- a/types/float.c
> +++ b/types/float.c
> @@ -100,23 +100,23 @@ struct bt_definition *
>         _float->p.path = bt_new_definition_path(parent_scope, field_name, root_name);
>         if (float_declaration->byte_order == LITTLE_ENDIAN) {
>                 tmp = float_declaration->mantissa->p.definition_new(&float_declaration->mantissa->p,
> -                       _float->p.scope, g_quark_from_static_string("mantissa"), 0, NULL);
> +                       _float->p.scope, g_quark_from_string("mantissa"), 0, NULL);
>                 _float->mantissa = container_of(tmp, struct definition_integer, p);
>                 tmp = float_declaration->exp->p.definition_new(&float_declaration->exp->p,
> -                       _float->p.scope, g_quark_from_static_string("exp"), 1, NULL);
> +                       _float->p.scope, g_quark_from_string("exp"), 1, NULL);
>                 _float->exp = container_of(tmp, struct definition_integer, p);
>                 tmp = float_declaration->sign->p.definition_new(&float_declaration->sign->p,
> -                       _float->p.scope, g_quark_from_static_string("sign"), 2, NULL);
> +                       _float->p.scope, g_quark_from_string("sign"), 2, NULL);
>                 _float->sign = container_of(tmp, struct definition_integer, p);
>         } else {
>                 tmp = float_declaration->sign->p.definition_new(&float_declaration->sign->p,
> -                       _float->p.scope, g_quark_from_static_string("sign"), 0, NULL);
> +                       _float->p.scope, g_quark_from_string("sign"), 0, NULL);
>                 _float->sign = container_of(tmp, struct definition_integer, p);
>                 tmp = float_declaration->exp->p.definition_new(&float_declaration->exp->p,
> -                       _float->p.scope, g_quark_from_static_string("exp"), 1, NULL);
> +                       _float->p.scope, g_quark_from_string("exp"), 1, NULL);
>                 _float->exp = container_of(tmp, struct definition_integer, p);
>                 tmp = float_declaration->mantissa->p.definition_new(&float_declaration->mantissa->p,
> -                       _float->p.scope, g_quark_from_static_string("mantissa"), 2, NULL);
> +                       _float->p.scope, g_quark_from_string("mantissa"), 2, NULL);
>                 _float->mantissa = container_of(tmp, struct definition_integer, p);
>         }
>         _float->p.ref = 1;
> --
> 2.5.5
>
> _______________________________________________
> lttng-dev mailing list
> lttng-dev at lists.lttng.org
> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
diff mbox

Patch

diff --git a/formats/bt-dummy/bt-dummy.c b/formats/bt-dummy/bt-dummy.c
index 6192e8880757..2f866dc95e3a 100644
--- a/formats/bt-dummy/bt-dummy.c
+++ b/formats/bt-dummy/bt-dummy.c
@@ -79,7 +79,7 @@  void __attribute__((constructor)) bt_dummy_init(void)
 {
 	int ret;
 
-	bt_dummy_format.name = g_quark_from_static_string("dummy");
+	bt_dummy_format.name = g_quark_from_string("dummy");
 	ret = bt_register_format(&bt_dummy_format);
 	assert(!ret);
 }
diff --git a/formats/ctf-metadata/ctf-metadata.c b/formats/ctf-metadata/ctf-metadata.c
index a5a74c3178db..ff65306f764a 100644
--- a/formats/ctf-metadata/ctf-metadata.c
+++ b/formats/ctf-metadata/ctf-metadata.c
@@ -132,7 +132,7 @@  void __attribute__((constructor)) ctf_metadata_init(void)
 {
 	int ret;
 
-	ctf_metadata_format.name = g_quark_from_static_string("ctf-metadata");
+	ctf_metadata_format.name = g_quark_from_string("ctf-metadata");
 	ret = bt_register_format(&ctf_metadata_format);
 	assert(!ret);
 }
diff --git a/formats/ctf-text/ctf-text.c b/formats/ctf-text/ctf-text.c
index 883a10a8745a..a0b423c2254d 100644
--- a/formats/ctf-text/ctf-text.c
+++ b/formats/ctf-text/ctf-text.c
@@ -123,12 +123,12 @@  static GQuark Q_STREAM_PACKET_CONTEXT_TIMESTAMP_BEGIN,
 static
 void __attribute__((constructor)) init_quarks(void)
 {
-	Q_STREAM_PACKET_CONTEXT_TIMESTAMP_BEGIN = g_quark_from_static_string("stream.packet.context.timestamp_begin");
-	Q_STREAM_PACKET_CONTEXT_TIMESTAMP_END = g_quark_from_static_string("stream.packet.context.timestamp_end");
-	Q_STREAM_PACKET_CONTEXT_EVENTS_DISCARDED = g_quark_from_static_string("stream.packet.context.events_discarded");
-	Q_STREAM_PACKET_CONTEXT_CONTENT_SIZE = g_quark_from_static_string("stream.packet.context.content_size");
-	Q_STREAM_PACKET_CONTEXT_PACKET_SIZE = g_quark_from_static_string("stream.packet.context.packet_size");
-	Q_STREAM_PACKET_CONTEXT_PACKET_SEQ_NUM = g_quark_from_static_string("stream.packet.context.packet_seq_num");
+	Q_STREAM_PACKET_CONTEXT_TIMESTAMP_BEGIN = g_quark_from_string("stream.packet.context.timestamp_begin");
+	Q_STREAM_PACKET_CONTEXT_TIMESTAMP_END = g_quark_from_string("stream.packet.context.timestamp_end");
+	Q_STREAM_PACKET_CONTEXT_EVENTS_DISCARDED = g_quark_from_string("stream.packet.context.events_discarded");
+	Q_STREAM_PACKET_CONTEXT_CONTENT_SIZE = g_quark_from_string("stream.packet.context.content_size");
+	Q_STREAM_PACKET_CONTEXT_PACKET_SIZE = g_quark_from_string("stream.packet.context.packet_size");
+	Q_STREAM_PACKET_CONTEXT_PACKET_SEQ_NUM = g_quark_from_string("stream.packet.context.packet_seq_num");
 }
 
 static
@@ -605,7 +605,7 @@  void __attribute__((constructor)) ctf_text_init(void)
 {
 	int ret;
 
-	ctf_text_format.name = g_quark_from_static_string("text");
+	ctf_text_format.name = g_quark_from_string("text");
 	ret = bt_register_format(&ctf_text_format);
 	assert(!ret);
 }
diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c
index 5578e68d49b5..9b5302199e17 100644
--- a/formats/ctf/ctf.c
+++ b/formats/ctf/ctf.c
@@ -1789,7 +1789,7 @@  int create_stream_one_packet_index(struct ctf_stream_pos *pos,
 			fprintf(stderr, "[error] Unable to read packet header: %s\n", strerror(-ret));
 			return ret;
 		}
-		len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.trace_packet_header->declaration, g_quark_from_static_string("magic"));
+		len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.trace_packet_header->declaration, g_quark_from_string("magic"));
 		if (len_index >= 0) {
 			struct bt_definition *field;
 			uint64_t magic;
@@ -1806,7 +1806,7 @@  int create_stream_one_packet_index(struct ctf_stream_pos *pos,
 		}
 
 		/* check uuid */
-		len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.trace_packet_header->declaration, g_quark_from_static_string("uuid"));
+		len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.trace_packet_header->declaration, g_quark_from_string("uuid"));
 		if (len_index >= 0) {
 			struct definition_array *defarray;
 			struct bt_definition *field;
@@ -1831,7 +1831,7 @@  int create_stream_one_packet_index(struct ctf_stream_pos *pos,
 			}
 		}
 
-		len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.trace_packet_header->declaration, g_quark_from_static_string("stream_id"));
+		len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.trace_packet_header->declaration, g_quark_from_string("stream_id"));
 		if (len_index >= 0) {
 			struct bt_definition *field;
 
@@ -1862,7 +1862,7 @@  int create_stream_one_packet_index(struct ctf_stream_pos *pos,
 			return ret;
 		}
 		/* read packet size from header */
-		len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.stream_packet_context->declaration, g_quark_from_static_string("packet_size"));
+		len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.stream_packet_context->declaration, g_quark_from_string("packet_size"));
 		if (len_index >= 0) {
 			struct bt_definition *field;
 
@@ -1874,7 +1874,7 @@  int create_stream_one_packet_index(struct ctf_stream_pos *pos,
 		}
 
 		/* read content size from header */
-		len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.stream_packet_context->declaration, g_quark_from_static_string("content_size"));
+		len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.stream_packet_context->declaration, g_quark_from_string("content_size"));
 		if (len_index >= 0) {
 			struct bt_definition *field;
 
@@ -1886,7 +1886,7 @@  int create_stream_one_packet_index(struct ctf_stream_pos *pos,
 		}
 
 		/* read timestamp begin from header */
-		len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.stream_packet_context->declaration, g_quark_from_static_string("timestamp_begin"));
+		len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.stream_packet_context->declaration, g_quark_from_string("timestamp_begin"));
 		if (len_index >= 0) {
 			struct bt_definition *field;
 
@@ -1901,7 +1901,7 @@  int create_stream_one_packet_index(struct ctf_stream_pos *pos,
 		}
 
 		/* read timestamp end from header */
-		len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.stream_packet_context->declaration, g_quark_from_static_string("timestamp_end"));
+		len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.stream_packet_context->declaration, g_quark_from_string("timestamp_end"));
 		if (len_index >= 0) {
 			struct bt_definition *field;
 
@@ -1916,7 +1916,7 @@  int create_stream_one_packet_index(struct ctf_stream_pos *pos,
 		}
 
 		/* read events discarded from header */
-		len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.stream_packet_context->declaration, g_quark_from_static_string("events_discarded"));
+		len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.stream_packet_context->declaration, g_quark_from_string("events_discarded"));
 		if (len_index >= 0) {
 			struct bt_definition *field;
 
@@ -1928,7 +1928,7 @@  int create_stream_one_packet_index(struct ctf_stream_pos *pos,
 		/* read packet_seq_num from header */
 		len_index = bt_struct_declaration_lookup_field_index(
 				file_stream->parent.stream_packet_context->declaration,
-				g_quark_from_static_string("packet_seq_num"));
+				g_quark_from_string("packet_seq_num"));
 		if (len_index >= 0) {
 			struct bt_definition *field;
 
@@ -2848,7 +2848,7 @@  void __attribute__((constructor)) ctf_init(void)
 {
 	int ret;
 
-	ctf_format.name = g_quark_from_static_string("ctf");
+	ctf_format.name = g_quark_from_string("ctf");
 	ret = bt_register_format(&ctf_format);
 	assert(!ret);
 }
diff --git a/formats/ctf/metadata/ctf-visitor-generate-io-struct.c b/formats/ctf/metadata/ctf-visitor-generate-io-struct.c
index 223d7d07d02f..097a482e1718 100644
--- a/formats/ctf/metadata/ctf-visitor-generate-io-struct.c
+++ b/formats/ctf/metadata/ctf-visitor-generate-io-struct.c
@@ -1114,7 +1114,7 @@  struct bt_declaration *ctf_declaration_enum_visit(FILE *fd, int depth,
 			}
 		}
 		if (!container_type) {
-			declaration = bt_lookup_declaration(g_quark_from_static_string("int"),
+			declaration = bt_lookup_declaration(g_quark_from_string("int"),
 							 declaration_scope);
 			if (!declaration) {
 				fprintf(fd, "[error] %s: \"int\" type declaration missing for enumeration\n", __func__);
@@ -2075,7 +2075,7 @@  int ctf_stream_visit(FILE *fd, int depth, struct ctf_node *node,
 	if (CTF_STREAM_FIELD_IS_SET(stream, stream_id)) {
 		/* check that packet header has stream_id field. */
 		if (!trace->packet_header_decl
-		    || bt_struct_declaration_lookup_field_index(trace->packet_header_decl, g_quark_from_static_string("stream_id")) < 0) {
+		    || bt_struct_declaration_lookup_field_index(trace->packet_header_decl, g_quark_from_string("stream_id")) < 0) {
 			ret = -EPERM;
 			fprintf(fd, "[error] %s: missing stream_id field in packet header declaration, but stream_id attribute is declared for stream.\n", __func__);
 			goto error;
@@ -2293,7 +2293,7 @@  int ctf_trace_visit(FILE *fd, int depth, struct ctf_node *node, struct ctf_trace
 	if (!CTF_TRACE_FIELD_IS_SET(trace, byte_order)) {
 		/* check that the packet header contains a "magic" field */
 		if (!trace->packet_header_decl
-		    || bt_struct_declaration_lookup_field_index(trace->packet_header_decl, g_quark_from_static_string("magic")) < 0) {
+		    || bt_struct_declaration_lookup_field_index(trace->packet_header_decl, g_quark_from_string("magic")) < 0) {
 			ret = -EPERM;
 			fprintf(fd, "[error] %s: missing both byte_order and packet header magic number in trace declaration\n", __func__);
 			goto error;
diff --git a/formats/lttng-live/lttng-live-comm.c b/formats/lttng-live/lttng-live-comm.c
index 1912b57f5795..cd146d764886 100644
--- a/formats/lttng-live/lttng-live-comm.c
+++ b/formats/lttng-live/lttng-live-comm.c
@@ -1646,7 +1646,7 @@  int lttng_live_read(struct lttng_live_ctx *ctx)
 		goto end;
 	}
 
-	fmt_write = bt_lookup_format(g_quark_from_static_string("text"));
+	fmt_write = bt_lookup_format(g_quark_from_string("text"));
 	if (!fmt_write) {
 		fprintf(stderr, "[error] ctf-text error\n");
 		goto end;
diff --git a/formats/lttng-live/lttng-live-plugin.c b/formats/lttng-live/lttng-live-plugin.c
index a1fbb9e826ef..35f0f48a4288 100644
--- a/formats/lttng-live/lttng-live-plugin.c
+++ b/formats/lttng-live/lttng-live-plugin.c
@@ -332,7 +332,7 @@  void __attribute__((constructor)) lttng_live_init(void)
 {
 	int ret;
 
-	lttng_live_format.name = g_quark_from_static_string("lttng-live");
+	lttng_live_format.name = g_quark_from_string("lttng-live");
 	ret = bt_register_format(&lttng_live_format);
 	assert(!ret);
 }
diff --git a/lib/debug-info.c b/lib/debug-info.c
index 4e1be1e3d6d3..eff5134b13e8 100644
--- a/lib/debug-info.c
+++ b/lib/debug-info.c
@@ -66,17 +66,17 @@  struct debug_info {
 static
 int debug_info_init(struct debug_info *info)
 {
-	info->q_statedump_bin_info = g_quark_from_static_string(
+	info->q_statedump_bin_info = g_quark_from_string(
 			"lttng_ust_statedump:bin_info");
-	info->q_statedump_debug_link = g_quark_from_static_string(
+	info->q_statedump_debug_link = g_quark_from_string(
 			"lttng_ust_statedump:debug_link)");
-	info->q_statedump_build_id = g_quark_from_static_string(
+	info->q_statedump_build_id = g_quark_from_string(
 			"lttng_ust_statedump:build_id");
-	info->q_statedump_start = g_quark_from_static_string(
+	info->q_statedump_start = g_quark_from_string(
 			"lttng_ust_statedump:start");
-	info->q_dl_open = g_quark_from_static_string("lttng_ust_dl:dlopen");
-	info->q_lib_load = g_quark_from_static_string("lttng_ust_lib:load");
-	info->q_lib_unload = g_quark_from_static_string("lttng_ust_lib:unload");
+	info->q_dl_open = g_quark_from_string("lttng_ust_dl:dlopen");
+	info->q_lib_load = g_quark_from_string("lttng_ust_lib:load");
+	info->q_lib_unload = g_quark_from_string("lttng_ust_lib:unload");
 
 	return bin_info_init();
 }
diff --git a/types/enum.c b/types/enum.c
index 8394e1b35b70..ec10a1695550 100644
--- a/types/enum.c
+++ b/types/enum.c
@@ -449,7 +449,7 @@  struct bt_definition *
 	definition_integer_parent =
 		enum_declaration->integer_declaration->p.definition_new(&enum_declaration->integer_declaration->p,
 				_enum->p.scope,
-				g_quark_from_static_string("container"), 0, NULL);
+				g_quark_from_string("container"), 0, NULL);
 	_enum->integer = container_of(definition_integer_parent,
 				      struct definition_integer, p);
 	return &_enum->p;
diff --git a/types/float.c b/types/float.c
index 3b61f8faf0a3..99c2acc7c7d7 100644
--- a/types/float.c
+++ b/types/float.c
@@ -100,23 +100,23 @@  struct bt_definition *
 	_float->p.path = bt_new_definition_path(parent_scope, field_name, root_name);
 	if (float_declaration->byte_order == LITTLE_ENDIAN) {
 		tmp = float_declaration->mantissa->p.definition_new(&float_declaration->mantissa->p,
-			_float->p.scope, g_quark_from_static_string("mantissa"), 0, NULL);
+			_float->p.scope, g_quark_from_string("mantissa"), 0, NULL);
 		_float->mantissa = container_of(tmp, struct definition_integer, p);
 		tmp = float_declaration->exp->p.definition_new(&float_declaration->exp->p,
-			_float->p.scope, g_quark_from_static_string("exp"), 1, NULL);
+			_float->p.scope, g_quark_from_string("exp"), 1, NULL);
 		_float->exp = container_of(tmp, struct definition_integer, p);
 		tmp = float_declaration->sign->p.definition_new(&float_declaration->sign->p,
-			_float->p.scope, g_quark_from_static_string("sign"), 2, NULL);
+			_float->p.scope, g_quark_from_string("sign"), 2, NULL);
 		_float->sign = container_of(tmp, struct definition_integer, p);
 	} else {
 		tmp = float_declaration->sign->p.definition_new(&float_declaration->sign->p,
-			_float->p.scope, g_quark_from_static_string("sign"), 0, NULL);
+			_float->p.scope, g_quark_from_string("sign"), 0, NULL);
 		_float->sign = container_of(tmp, struct definition_integer, p);
 		tmp = float_declaration->exp->p.definition_new(&float_declaration->exp->p,
-			_float->p.scope, g_quark_from_static_string("exp"), 1, NULL);
+			_float->p.scope, g_quark_from_string("exp"), 1, NULL);
 		_float->exp = container_of(tmp, struct definition_integer, p);
 		tmp = float_declaration->mantissa->p.definition_new(&float_declaration->mantissa->p,
-			_float->p.scope, g_quark_from_static_string("mantissa"), 2, NULL);
+			_float->p.scope, g_quark_from_string("mantissa"), 2, NULL);
 		_float->mantissa = container_of(tmp, struct definition_integer, p);
 	}
 	_float->p.ref = 1;