From: Simon Marchi Date: Fri, 24 May 2024 16:40:53 +0000 (-0400) Subject: .gitignore: add some more IDE / tools related file X-Git-Url: https://git.efficios.com/?a=commitdiff_plain;h=refs%2Fheads%2Fmaster;hp=4e24e7b301c53b3fb75ee63dcb2a464c307b8890;p=babeltrace.git .gitignore: add some more IDE / tools related file Change-Id: I223c98e0b94dceb879dbf9273e7bc3c23e17f780 Signed-off-by: Simon Marchi Reviewed-on: https://review.lttng.org/c/babeltrace/+/12774 Tested-by: jenkins --- diff --git a/.gitignore b/.gitignore index 904372ce..fe091c00 100644 --- a/.gitignore +++ b/.gitignore @@ -80,8 +80,11 @@ __pycache__ *.swp *~ .cache/ +.clangd .coverage +.gdb_history .theia +.vscode compile_commands.json cscope* htmlcov/ diff --git a/doc/api/libbabeltrace2/DoxygenLayout.xml b/doc/api/libbabeltrace2/DoxygenLayout.xml index 7e40db87..0ceb53ca 100644 --- a/doc/api/libbabeltrace2/DoxygenLayout.xml +++ b/doc/api/libbabeltrace2/DoxygenLayout.xml @@ -6,7 +6,9 @@ + intro="List of all API reference pages:"/> + diff --git a/doc/api/libbabeltrace2/dox/api-fund.dox b/doc/api/libbabeltrace2/dox/api-fund.dox index 5b24faf4..8f742e73 100644 --- a/doc/api/libbabeltrace2/dox/api-fund.dox +++ b/doc/api/libbabeltrace2/dox/api-fund.dox @@ -35,7 +35,7 @@ that it meets its when it returns. The function descriptions in the -API reference modules +API reference list all their preconditions and postconditions, if any. The libbabeltrace2 public functions offer a @@ -126,7 +126,7 @@ object type A inherits an object type B, then you can use both the A and B API functions with an object of type A. For example, because an \bt_enum_fc \em is conceptually an \bt_int_fc, you can use any integer field class function with an enumeration field class. -The API reference modules always +The API reference pages always indicate the inheritance relations. @subsection api-fund-object-shared-unique Shared vs. unique objects @@ -199,7 +199,7 @@ Some \bt_name objects are \em shared while some others are \em unique: Because you cannot get a new unique object reference, you \em must ensure that you own the unique object's owner to keep it alive. The - API reference modules make it + API reference pages make it clear, depending on the context, which shared object is the ultimate owner of a given unique object. @@ -212,7 +212,7 @@ Some \bt_name objects are \em shared while some others are \em unique: -In the API reference, each module +In the API reference, each page indicates whether the documented objects are shared or unique. @subsection api-fund-freezing Object freezing @@ -233,7 +233,7 @@ When an object becomes frozen, its contained objects, if any, also become frozen, recursively. There's no function to check whether or not a given object is frozen. -Because the API reference modules +Because the API reference pages document which functions freeze which objects, the "frozen" property is only useful for libbabeltrace2 to catch programming errors (\ref api-fund-pre-post "precondition checks"). @@ -264,7 +264,7 @@ be contained in some collection. For example, all \bt_val objects have the type #bt_value because an \bt_array_val can contain different types of values. You must be careful to only call the functions which apply to a specific type of such objects. -The API reference modules make +The API reference pages make this clear in the precondition section. Such objects always have a *_get_type() function to get the object's exact type enumerator. For example, bt_value_get_type() returns the type enumerator @@ -374,7 +374,7 @@ if (status != BT_VALUE_COPY_STATUS_OK) { } @endcode -The API reference modules +The API reference pages document, for each function, what each return status enumerator means. Some functions return properties or objects by output parameter. When diff --git a/doc/api/libbabeltrace2/dox/group-trace-ir.dox b/doc/api/libbabeltrace2/dox/group-trace-ir.dox index db258057..5aef881b 100644 --- a/doc/api/libbabeltrace2/dox/group-trace-ir.dox +++ b/doc/api/libbabeltrace2/dox/group-trace-ir.dox @@ -8,8 +8,8 @@ domain objects and concepts (contents of \bt_p_msg). The \bt_name -trace IR (intermediate representation) modules -contain everything you need to represent tracing domain concepts and +trace IR (intermediate representation) API +offers everything you need to represent tracing domain concepts and objects so that many \bt_p_comp, written by different authors, can exchange trace metadata and data. diff --git a/doc/api/libbabeltrace2/dox/main-page.dox b/doc/api/libbabeltrace2/dox/main-page.dox index 22c1e5d3..d5a096c1 100644 --- a/doc/api/libbabeltrace2/dox/main-page.dox +++ b/doc/api/libbabeltrace2/dox/main-page.dox @@ -112,13 +112,13 @@ to learn even more about the \bt_name project and its core concepts. parts of the API to accomplish real tasks. -
API reference
+
API reference
Documents all the \bt_name C functions, definitions, macros, enumerators, and types. - Each documentation module describes its API thoroughly and how it's - related to other modules. + Each page describes its API thoroughly and how it's + related to other APIs.
*/ diff --git a/include/babeltrace2-ctf-writer/object.h b/include/babeltrace2-ctf-writer/object.h index 9767eb3e..0191b34b 100644 --- a/include/babeltrace2-ctf-writer/object.h +++ b/include/babeltrace2-ctf-writer/object.h @@ -20,7 +20,7 @@ extern "C" { #include @endcode -The macros and functions of this module are everything that is needed +The macros and functions of this API are everything that is needed to handle the reference counting of Babeltrace objects. diff --git a/include/babeltrace2/error-reporting.h b/include/babeltrace2/error-reporting.h index 29e53e16..0a257d19 100644 --- a/include/babeltrace2/error-reporting.h +++ b/include/babeltrace2/error-reporting.h @@ -28,8 +28,8 @@ extern "C" { @brief Error reporting functions and macros. -This module contains functions and macros to report rich errors from a -user function (a \bt_comp_cls method, a +This API offers functions and macros to report rich +errors from a user function (a \bt_comp_cls method, a \ref api-qexec "query operation", or a trace processing \bt_graph listener, for example) to any function caller. diff --git a/include/babeltrace2/graph/component-class-dev.h b/include/babeltrace2/graph/component-class-dev.h index 7267e62f..7e59f665 100644 --- a/include/babeltrace2/graph/component-class-dev.h +++ b/include/babeltrace2/graph/component-class-dev.h @@ -32,11 +32,11 @@ A component class is the class of a \bt_comp: @image html component.png @attention - This module (component class development API) offers functions to + This API (component class development API) offers functions to programmatically create component classes. To get the properties of an existing component class, see \ref api-comp-cls. -A component class has methods. This module essentially +A component class has methods. This API essentially offers: - Component class method type definitions. @@ -84,7 +84,7 @@ See \ref api-comp-cls-dev-methods "Methods" to learn more about the different types of component class methods. A component class is a \ref api-fund-shared-object "shared object": see -the \ref api-comp-cls module for the reference count functions. +the \ref api-comp-cls API for the reference count functions. Some library functions \ref api-fund-freezing "freeze" component classes on success. The documentation of those functions indicate this diff --git a/include/babeltrace2/graph/component-class.h b/include/babeltrace2/graph/component-class.h index 4fe692f2..64bccf3b 100644 --- a/include/babeltrace2/graph/component-class.h +++ b/include/babeltrace2/graph/component-class.h @@ -31,9 +31,9 @@ A component class is the class of a \bt_comp: @image html component.png @attention - This module (component class API) offers basic, read-only functions - to get component class properties. To \em create a component class, - see \ref api-comp-cls-dev or \ref api-plugin-dev. + This API (component class API) offers basic, + read-only functions to get component class properties. To \em create + a component class, see \ref api-comp-cls-dev or \ref api-plugin-dev. You can instantiate a given component class many times, with different initialization parameters, to create many components with the diff --git a/include/babeltrace2/graph/message-iterator-class.h b/include/babeltrace2/graph/message-iterator-class.h index 82ee1f2d..b7ddf89a 100644 --- a/include/babeltrace2/graph/message-iterator-class.h +++ b/include/babeltrace2/graph/message-iterator-class.h @@ -39,8 +39,8 @@ pass it to bt_component_class_source_create() or bt_component_class_filter_create() to set it as the created component class's message iterator class. -A message iterator class has methods. This module essentially -offers: +A message iterator class has methods. This API +essentially offers: - Message iterator class method type definitions. diff --git a/include/babeltrace2/graph/message.h b/include/babeltrace2/graph/message.h index a73d6e1c..f634f888 100644 --- a/include/babeltrace2/graph/message.h +++ b/include/babeltrace2/graph/message.h @@ -848,7 +848,7 @@ version as rarely as possible. When it is required, though, it's a welcome tool to make the project evolve gracefully. The Message Interchange Protocol has no dedicated documentation as this -very message module (and its submodules, like \ref api-tir) +very message API (and its contained APIs, like \ref api-tir) documentation is enough. You can consider that all the functions of the message and trace IR objects have an implicit MIP version \ref api-fund-pre-post "precondition". When a given diff --git a/include/babeltrace2/graph/private-query-executor.h b/include/babeltrace2/graph/private-query-executor.h index 81a0daeb..7598f539 100644 --- a/include/babeltrace2/graph/private-query-executor.h +++ b/include/babeltrace2/graph/private-query-executor.h @@ -35,7 +35,7 @@ from within a \bt_comp_cls A query method receives a private query executor as its \bt_p{query_executor} parameter. -As of \bt_name_version_min_maj, this module only offers the +As of \bt_name_version_min_maj, this API only offers the bt_private_query_executor_as_query_executor_const() function to \ref api-fund-c-typing "upcast" a private query executor to a \c const query executor. You need this to get the query executor's diff --git a/include/babeltrace2/graph/self-component-class.h b/include/babeltrace2/graph/self-component-class.h index 366f7146..c0748059 100644 --- a/include/babeltrace2/graph/self-component-class.h +++ b/include/babeltrace2/graph/self-component-class.h @@ -31,9 +31,9 @@ The #bt_self_component_class, #bt_self_component_class_source, private views of a \bt_comp_cls from within a component class \ref api-comp-cls-dev-class-meth "class method". -As of \bt_name_version_min_maj, this module only contains functions -to \ref api-fund-c-typing "upcast" the "self" (private) types to their -public #bt_component_class, #bt_component_class_source, +As of \bt_name_version_min_maj, this API only offers +functions to \ref api-fund-c-typing "upcast" the "self" (private) types +to their public #bt_component_class, #bt_component_class_source, #bt_component_class_filter, and #bt_component_class_sink counterparts. */ diff --git a/include/babeltrace2/plugin/plugin-dev.h b/include/babeltrace2/plugin/plugin-dev.h index 42420d8e..e5760598 100644 --- a/include/babeltrace2/plugin/plugin-dev.h +++ b/include/babeltrace2/plugin/plugin-dev.h @@ -49,13 +49,14 @@ extern "C" { @brief Shared object plugin development. -This module offers macros to create a \bt_name shared object plugin. +This API offers macros to create a \bt_name shared +object plugin. -Behind the scenes, the BT_PLUGIN_*() macros of this module -create and fill global tables which are located in sections of the -shared object with specific names. The \ref api-plugin functions can -load the resulting shared object file and create corresponding -\bt_plugin objects. +Behind the scenes, the BT_PLUGIN_*() macros of this +API create and fill global tables which are located in +sections of the shared object with specific names. The \ref api-plugin +functions can load the resulting shared object file and create +corresponding \bt_plugin objects. See \ref guide-comp-link-plugin-so. @@ -192,7 +193,7 @@ You can repeat steps 5 to 7 to add more than one component class to a given plugin. See \ref example-simple-plugin-def-file for a concrete example of how -to use the macros of this module. +to use the macros of this API.

\anchor api-plugin-dev-custom-plugin-id Custom plugin ID

diff --git a/include/babeltrace2/util.h b/include/babeltrace2/util.h index 80c0e66b..030862ae 100644 --- a/include/babeltrace2/util.h +++ b/include/babeltrace2/util.h @@ -25,7 +25,7 @@ extern "C" { @brief General purpose utilities. -This module contains general purpose utilities. +This API offers general purpose utilities. */ /*! @{ */ diff --git a/include/babeltrace2/version.h b/include/babeltrace2/version.h index 66ad5415..0f950600 100644 --- a/include/babeltrace2/version.h +++ b/include/babeltrace2/version.h @@ -23,8 +23,8 @@ extern "C" { @brief Library version getters. -This module contains functions to get information about the library's -version: +This API offers functions to get information about the +library's version:
Major version
diff --git a/src/autodisc/autodisc.h b/src/autodisc/autodisc.h index a0387949..6a51111c 100644 --- a/src/autodisc/autodisc.h +++ b/src/autodisc/autodisc.h @@ -4,8 +4,8 @@ * Copyright (C) 2019 EfficiOS Inc. and Linux Foundation */ -#ifndef AUTODISC_AUTODISC_H -#define AUTODISC_AUTODISC_H +#ifndef BABELTRACE_AUTODISC_AUTODISC_H +#define BABELTRACE_AUTODISC_AUTODISC_H #include @@ -71,4 +71,4 @@ auto_source_discovery_status auto_discover_source_components( struct auto_source_discovery *auto_disc, const bt_interrupter *interrupter); -#endif /* AUTODISC_AUTODISC_H */ +#endif /* BABELTRACE_AUTODISC_AUTODISC_H */ diff --git a/src/bindings/python/bt2/bt2/logging.h b/src/bindings/python/bt2/bt2/logging.h index 360f253a..9a4efebc 100644 --- a/src/bindings/python/bt2/bt2/logging.h +++ b/src/bindings/python/bt2/bt2/logging.h @@ -4,12 +4,12 @@ * Copyright (c) 2017 Philippe Proulx */ -#ifndef BABELTRACE_BINDINGS_PYTHON_BT2_LOGGING_H -#define BABELTRACE_BINDINGS_PYTHON_BT2_LOGGING_H +#ifndef BABELTRACE_BINDINGS_PYTHON_BT2_BT2_LOGGING_H +#define BABELTRACE_BINDINGS_PYTHON_BT2_BT2_LOGGING_H #define BT_LOG_OUTPUT_LEVEL bt_python_bindings_bt2_log_level #include "logging/log.h" BT_LOG_LEVEL_EXTERN_SYMBOL(bt_python_bindings_bt2_log_level); -#endif /* BABELTRACE_BINDINGS_PYTHON_BT2_LOGGING_H */ +#endif /* BABELTRACE_BINDINGS_PYTHON_BT2_BT2_LOGGING_H */ diff --git a/src/bindings/python/bt2/bt2/native_bt_autodisc.i.h b/src/bindings/python/bt2/bt2/native_bt_autodisc.i.h index 9b12e8c3..f1629efb 100644 --- a/src/bindings/python/bt2/bt2/native_bt_autodisc.i.h +++ b/src/bindings/python/bt2/bt2/native_bt_autodisc.i.h @@ -4,6 +4,9 @@ * Copyright (c) 2016 Philippe Proulx */ +#ifndef BABELTRACE_BINDINGS_PYTHON_BT2_BT2_NATIVE_BT_AUTODISC_I_H +#define BABELTRACE_BINDINGS_PYTHON_BT2_BT2_NATIVE_BT_AUTODISC_I_H + #include #include @@ -209,3 +212,5 @@ end: return result; } + +#endif /* BABELTRACE_BINDINGS_PYTHON_BT2_BT2_NATIVE_BT_AUTODISC_I_H */ diff --git a/src/bindings/python/bt2/bt2/native_bt_bt2_objects.h b/src/bindings/python/bt2/bt2/native_bt_bt2_objects.h index eedd97c1..9a47849e 100644 --- a/src/bindings/python/bt2/bt2/native_bt_bt2_objects.h +++ b/src/bindings/python/bt2/bt2/native_bt_bt2_objects.h @@ -4,8 +4,10 @@ * Copyright (c) 2017 Philippe Proulx */ -#include "logging/comp-logging.h" +#ifndef BABELTRACE_BINDINGS_PYTHON_BT2_BT2_NATIVE_BT_BT2_OBJECTS_H +#define BABELTRACE_BINDINGS_PYTHON_BT2_BT2_NATIVE_BT_BT2_OBJECTS_H +#include "logging/comp-logging.h" /* * Useful Python objects. @@ -70,3 +72,5 @@ void bt_bt2_exit_handler(void) Py_XDECREF(py_mod_bt2_exc_stop_type); Py_XDECREF(py_mod_bt2_exc_unknown_object_type); } + +#endif /* BABELTRACE_BINDINGS_PYTHON_BT2_BT2_NATIVE_BT_BT2_OBJECTS_H */ diff --git a/src/bindings/python/bt2/bt2/native_bt_component_class.i.h b/src/bindings/python/bt2/bt2/native_bt_component_class.i.h index 628d5867..de11581a 100644 --- a/src/bindings/python/bt2/bt2/native_bt_component_class.i.h +++ b/src/bindings/python/bt2/bt2/native_bt_component_class.i.h @@ -4,6 +4,9 @@ * Copyright (c) 2017 Philippe Proulx */ +#ifndef BABELTRACE_BINDINGS_PYTHON_BT2_BT2_NATIVE_BT_COMPONENT_CLASS_I_H +#define BABELTRACE_BINDINGS_PYTHON_BT2_BT2_NATIVE_BT_COMPONENT_CLASS_I_H + #include "logging/comp-logging.h" #include "compat/glib.h" @@ -1524,3 +1527,5 @@ bt_component_class_sink *bt_bt2_component_class_sink_create( end: return component_class_sink; } + +#endif /* BABELTRACE_BINDINGS_PYTHON_BT2_BT2_NATIVE_BT_COMPONENT_CLASS_I_H */ diff --git a/src/bindings/python/bt2/bt2/native_bt_error.i.h b/src/bindings/python/bt2/bt2/native_bt_error.i.h index 78eeb28a..5e542d17 100644 --- a/src/bindings/python/bt2/bt2/native_bt_error.i.h +++ b/src/bindings/python/bt2/bt2/native_bt_error.i.h @@ -4,6 +4,9 @@ * Copyright (c) 2019 Efficios, Inc. */ +#ifndef BABELTRACE_BINDINGS_PYTHON_BT2_BT2_NATIVE_BT_ERROR_I_H +#define BABELTRACE_BINDINGS_PYTHON_BT2_BT2_NATIVE_BT_ERROR_I_H + #include static @@ -41,3 +44,5 @@ PyObject *bt_bt2_format_bt_error(const bt_error *error) return py_error_str; } + +#endif /* BABELTRACE_BINDINGS_PYTHON_BT2_BT2_NATIVE_BT_ERROR_I_H */ diff --git a/src/bindings/python/bt2/bt2/native_bt_graph.i.h b/src/bindings/python/bt2/bt2/native_bt_graph.i.h index 41569f3d..8831e21a 100644 --- a/src/bindings/python/bt2/bt2/native_bt_graph.i.h +++ b/src/bindings/python/bt2/bt2/native_bt_graph.i.h @@ -4,6 +4,9 @@ * Copyright (c) 2017 Philippe Proulx */ +#ifndef BABELTRACE_BINDINGS_PYTHON_BT2_BT2_NATIVE_BT_GRAPH_I_H +#define BABELTRACE_BINDINGS_PYTHON_BT2_BT2_NATIVE_BT_GRAPH_I_H + static bt_graph_listener_func_status port_added_listener( const void *component, swig_type_info *component_swig_type, @@ -257,3 +260,5 @@ bt_bt2_graph_add_sink_component( component_class, name, params, obj == Py_None ? NULL : obj, log_level, component); } + +#endif /* BABELTRACE_BINDINGS_PYTHON_BT2_BT2_NATIVE_BT_GRAPH_I_H */ diff --git a/src/bindings/python/bt2/bt2/native_bt_log_and_append_error.h b/src/bindings/python/bt2/bt2/native_bt_log_and_append_error.h index 84c67172..2205772f 100644 --- a/src/bindings/python/bt2/bt2/native_bt_log_and_append_error.h +++ b/src/bindings/python/bt2/bt2/native_bt_log_and_append_error.h @@ -4,6 +4,9 @@ * Copyright (c) 2017 Philippe Proulx */ +#ifndef BABELTRACE_BINDINGS_PYTHON_BT2_BT2_NATIVE_BT_LOG_AND_APPEND_ERROR_H +#define BABELTRACE_BINDINGS_PYTHON_BT2_BT2_NATIVE_BT_LOG_AND_APPEND_ERROR_H + #include #include "logging/comp-logging.h" @@ -249,3 +252,5 @@ void logw_exception_clear(int active_log_level) false, NULL, NULL, NULL, NULL); PyErr_Clear(); } + +#endif /* BABELTRACE_BINDINGS_PYTHON_BT2_BT2_NATIVE_BT_LOG_AND_APPEND_ERROR_H */ diff --git a/src/bindings/python/bt2/bt2/native_bt_message_iterator.i.h b/src/bindings/python/bt2/bt2/native_bt_message_iterator.i.h index 35c2612a..aaa88fca 100644 --- a/src/bindings/python/bt2/bt2/native_bt_message_iterator.i.h +++ b/src/bindings/python/bt2/bt2/native_bt_message_iterator.i.h @@ -4,6 +4,9 @@ * Copyright (c) 2017 Philippe Proulx */ +#ifndef BABELTRACE_BINDINGS_PYTHON_BT2_BT2_NATIVE_BT_MESSAGE_ITERATOR_I_H +#define BABELTRACE_BINDINGS_PYTHON_BT2_BT2_NATIVE_BT_MESSAGE_ITERATOR_I_H + static bt_message_iterator_create_from_message_iterator_status bt_bt2_message_iterator_create_from_message_iterator( @@ -116,3 +119,5 @@ static PyObject *bt_bt2_self_component_port_input_get_msg_range( &messages, &message_count); return get_msg_range_common(status, messages, message_count); } + +#endif /* BABELTRACE_BINDINGS_PYTHON_BT2_BT2_NATIVE_BT_MESSAGE_ITERATOR_I_H */ diff --git a/src/bindings/python/bt2/bt2/native_bt_mip.i.h b/src/bindings/python/bt2/bt2/native_bt_mip.i.h index 1fa7c3fe..9e64084c 100644 --- a/src/bindings/python/bt2/bt2/native_bt_mip.i.h +++ b/src/bindings/python/bt2/bt2/native_bt_mip.i.h @@ -4,6 +4,9 @@ * Copyright (c) 2017 Philippe Proulx */ +#ifndef BABELTRACE_BINDINGS_PYTHON_BT2_BT2_NATIVE_BT_MIP_I_H +#define BABELTRACE_BINDINGS_PYTHON_BT2_BT2_NATIVE_BT_MIP_I_H + static bt_component_descriptor_set_add_descriptor_status bt_bt2_component_descriptor_set_add_descriptor_with_initialize_method_data( @@ -14,3 +17,5 @@ bt_bt2_component_descriptor_set_add_descriptor_with_initialize_method_data( return bt_component_descriptor_set_add_descriptor_with_initialize_method_data( comp_descr_set, comp_cls, params, obj == Py_None ? NULL : obj); } + +#endif /* BABELTRACE_BINDINGS_PYTHON_BT2_BT2_NATIVE_BT_MIP_I_H */ diff --git a/src/bindings/python/bt2/bt2/native_bt_plugin.i.h b/src/bindings/python/bt2/bt2/native_bt_plugin.i.h index 105fafc7..1edf0813 100644 --- a/src/bindings/python/bt2/bt2/native_bt_plugin.i.h +++ b/src/bindings/python/bt2/bt2/native_bt_plugin.i.h @@ -4,6 +4,9 @@ * Copyright (c) 2017 Philippe Proulx */ +#ifndef BABELTRACE_BINDINGS_PYTHON_BT2_BT2_NATIVE_BT_PLUGIN_I_H +#define BABELTRACE_BINDINGS_PYTHON_BT2_BT2_NATIVE_BT_PLUGIN_I_H + /* * Those bt_bt2_*() functions below ensure that when the API function * fails, the output parameter is set to `NULL`. This is necessary @@ -95,3 +98,5 @@ bt_plugin_find_all_from_dir_status bt_bt2_plugin_find_all_from_dir( return status; } + +#endif /* BABELTRACE_BINDINGS_PYTHON_BT2_BT2_NATIVE_BT_PLUGIN_I_H */ diff --git a/src/bindings/python/bt2/bt2/native_bt_query_exec.i.h b/src/bindings/python/bt2/bt2/native_bt_query_exec.i.h index 224b52a4..9c26acff 100644 --- a/src/bindings/python/bt2/bt2/native_bt_query_exec.i.h +++ b/src/bindings/python/bt2/bt2/native_bt_query_exec.i.h @@ -4,6 +4,9 @@ * Copyright (c) 2017 Philippe Proulx */ +#ifndef BABELTRACE_BINDINGS_PYTHON_BT2_BT2_NATIVE_BT_QUERY_EXEC_I_H +#define BABELTRACE_BINDINGS_PYTHON_BT2_BT2_NATIVE_BT_QUERY_EXEC_I_H + static bt_query_executor *bt_bt2_query_executor_create( const bt_component_class *component_class, const char *object, @@ -12,3 +15,5 @@ bt_query_executor *bt_bt2_query_executor_create( return bt_query_executor_create_with_method_data(component_class, object, params, py_obj == Py_None ? NULL : py_obj); } + +#endif /* BABELTRACE_BINDINGS_PYTHON_BT2_BT2_NATIVE_BT_QUERY_EXEC_I_H */ diff --git a/src/bindings/python/bt2/bt2/native_bt_trace.i.h b/src/bindings/python/bt2/bt2/native_bt_trace.i.h index 7d4c6882..bccdf875 100644 --- a/src/bindings/python/bt2/bt2/native_bt_trace.i.h +++ b/src/bindings/python/bt2/bt2/native_bt_trace.i.h @@ -4,6 +4,9 @@ * Copyright (c) 2016 Philippe Proulx */ +#ifndef BABELTRACE_BINDINGS_PYTHON_BT2_BT2_NATIVE_BT_TRACE_I_H +#define BABELTRACE_BINDINGS_PYTHON_BT2_BT2_NATIVE_BT_TRACE_I_H + static void trace_destroyed_listener(const bt_trace *trace, void *py_callable) { @@ -46,3 +49,5 @@ int bt_bt2_trace_add_destruction_listener(bt_trace *trace, return status; } + +#endif /* BABELTRACE_BINDINGS_PYTHON_BT2_BT2_NATIVE_BT_TRACE_I_H */ diff --git a/src/bindings/python/bt2/bt2/native_bt_trace_class.i.h b/src/bindings/python/bt2/bt2/native_bt_trace_class.i.h index 68ea78c4..201801da 100644 --- a/src/bindings/python/bt2/bt2/native_bt_trace_class.i.h +++ b/src/bindings/python/bt2/bt2/native_bt_trace_class.i.h @@ -4,6 +4,9 @@ * Copyright (c) 2016 Philippe Proulx */ +#ifndef BABELTRACE_BINDINGS_PYTHON_BT2_BT2_NATIVE_BT_TRACE_CLASS_I_H +#define BABELTRACE_BINDINGS_PYTHON_BT2_BT2_NATIVE_BT_TRACE_CLASS_I_H + static void trace_class_destroyed_listener(const bt_trace_class *trace_class, void *py_callable) { @@ -48,3 +51,5 @@ int bt_bt2_trace_class_add_destruction_listener( return status; } + +#endif /* BABELTRACE_BINDINGS_PYTHON_BT2_BT2_NATIVE_BT_TRACE_CLASS_I_H */ diff --git a/src/bindings/python/bt2/bt2/native_bt_value.i.h b/src/bindings/python/bt2/bt2/native_bt_value.i.h index ed1034a9..650515f3 100644 --- a/src/bindings/python/bt2/bt2/native_bt_value.i.h +++ b/src/bindings/python/bt2/bt2/native_bt_value.i.h @@ -4,6 +4,9 @@ * Copyright (c) 2016 Philippe Proulx */ +#ifndef BABELTRACE_BINDINGS_PYTHON_BT2_BT2_NATIVE_BT_VALUE_I_H +#define BABELTRACE_BINDINGS_PYTHON_BT2_BT2_NATIVE_BT_VALUE_I_H + struct bt_value_map_get_keys_data { struct bt_value *keys; }; @@ -46,3 +49,5 @@ error: end: return data.keys; } + +#endif /* BABELTRACE_BINDINGS_PYTHON_BT2_BT2_NATIVE_BT_VALUE_I_H */ diff --git a/src/cli/babeltrace2-cfg-cli-args-connect.h b/src/cli/babeltrace2-cfg-cli-args-connect.h index 48a442e7..2a8bf1cb 100644 --- a/src/cli/babeltrace2-cfg-cli-args-connect.h +++ b/src/cli/babeltrace2-cfg-cli-args-connect.h @@ -4,8 +4,8 @@ * Copyright 2017 Philippe Proulx */ -#ifndef CLI_BABELTRACE_CFG_CLI_ARGS_CONNECT_H -#define CLI_BABELTRACE_CFG_CLI_ARGS_CONNECT_H +#ifndef BABELTRACE_CLI_BABELTRACE2_CFG_CLI_ARGS_CONNECT_H +#define BABELTRACE_CLI_BABELTRACE2_CFG_CLI_ARGS_CONNECT_H #include #include @@ -16,4 +16,4 @@ int bt_config_cli_args_create_connections(struct bt_config *cfg, const bt_value *connection_args, char *error_buf, size_t error_buf_size); -#endif /* CLI_BABELTRACE_CFG_CLI_ARGS_CONNECT_H */ +#endif /* BABELTRACE_CLI_BABELTRACE2_CFG_CLI_ARGS_CONNECT_H */ diff --git a/src/cli/babeltrace2-cfg-cli-args-default.h b/src/cli/babeltrace2-cfg-cli-args-default.h index 61927ba0..d44915b9 100644 --- a/src/cli/babeltrace2-cfg-cli-args-default.h +++ b/src/cli/babeltrace2-cfg-cli-args-default.h @@ -6,8 +6,8 @@ * Babeltrace Trace Converter - Default Configuration */ -#ifndef CLI_BABELTRACE_CFG_CLI_ARGS_DEFAULT_H -#define CLI_BABELTRACE_CFG_CLI_ARGS_DEFAULT_H +#ifndef BABELTRACE_CLI_BABELTRACE2_CFG_CLI_ARGS_DEFAULT_H +#define BABELTRACE_CLI_BABELTRACE2_CFG_CLI_ARGS_DEFAULT_H #include "babeltrace2-cfg.h" @@ -15,4 +15,4 @@ enum bt_config_cli_args_status bt_config_cli_args_create_with_default(int argc, const char *argv[], struct bt_config **cfg, const bt_interrupter *interrupter); -#endif /* CLI_BABELTRACE_CFG_CLI_ARGS_DEFAULT_H */ +#endif /* BABELTRACE_CLI_BABELTRACE2_CFG_CLI_ARGS_DEFAULT_H */ diff --git a/src/cli/babeltrace2-cfg-cli-args.h b/src/cli/babeltrace2-cfg-cli-args.h index 1ceded7e..2be129a2 100644 --- a/src/cli/babeltrace2-cfg-cli-args.h +++ b/src/cli/babeltrace2-cfg-cli-args.h @@ -4,8 +4,8 @@ * Copyright 2016-2017 Philippe Proulx */ -#ifndef CLI_BABELTRACE_CFG_CLI_ARGS_H -#define CLI_BABELTRACE_CFG_CLI_ARGS_H +#ifndef BABELTRACE_CLI_BABELTRACE2_CFG_CLI_ARGS_H +#define BABELTRACE_CLI_BABELTRACE2_CFG_CLI_ARGS_H #include #include @@ -49,4 +49,4 @@ enum bt_config_cli_args_status bt_config_cli_args_create(int argc, const bt_value *initial_plugin_paths, const bt_interrupter *interrupter); -#endif /* CLI_BABELTRACE_CFG_CLI_ARGS_H */ +#endif /* BABELTRACE_CLI_BABELTRACE2_CFG_CLI_ARGS_H */ diff --git a/src/cli/babeltrace2-cfg.h b/src/cli/babeltrace2-cfg.h index 79e11610..81db306a 100644 --- a/src/cli/babeltrace2-cfg.h +++ b/src/cli/babeltrace2-cfg.h @@ -6,8 +6,8 @@ * Babeltrace trace converter - CLI tool's configuration */ -#ifndef CLI_BABELTRACE_CFG_H -#define CLI_BABELTRACE_CFG_H +#ifndef BABELTRACE_CLI_BABELTRACE2_CFG_H +#define BABELTRACE_CLI_BABELTRACE2_CFG_H #include #include @@ -120,4 +120,4 @@ int bt_config_append_plugin_paths(bt_value *plugin_paths, void bt_config_connection_destroy(struct bt_config_connection *connection); -#endif /* CLI_BABELTRACE_CFG_H */ +#endif /* BABELTRACE_CLI_BABELTRACE2_CFG_H */ diff --git a/src/cli/babeltrace2-log-level.h b/src/cli/babeltrace2-log-level.h index 66fe1038..d1e81432 100644 --- a/src/cli/babeltrace2-log-level.h +++ b/src/cli/babeltrace2-log-level.h @@ -4,8 +4,8 @@ * Copyright 2019 Philippe Proulx */ -#ifndef CLI_BABELTRACE_LOG_LEVEL_H -#define CLI_BABELTRACE_LOG_LEVEL_H +#ifndef BABELTRACE_CLI_BABELTRACE2_LOG_LEVEL_H +#define BABELTRACE_CLI_BABELTRACE2_LOG_LEVEL_H #include @@ -31,4 +31,4 @@ int logging_level_min(int a, int b) void set_auto_log_levels(int *logging_level); -#endif /* CLI_BABELTRACE_LOG_LEVEL_H */ +#endif /* BABELTRACE_CLI_BABELTRACE2_LOG_LEVEL_H */ diff --git a/src/cli/babeltrace2-plugins.h b/src/cli/babeltrace2-plugins.h index c95eda90..2ddf9768 100644 --- a/src/cli/babeltrace2-plugins.h +++ b/src/cli/babeltrace2-plugins.h @@ -6,8 +6,8 @@ * Babeltrace trace converter - CLI tool's configuration */ -#ifndef CLI_BABELTRACE_PLUGINS_H -#define CLI_BABELTRACE_PLUGINS_H +#ifndef BABELTRACE_CLI_BABELTRACE2_PLUGINS_H +#define BABELTRACE_CLI_BABELTRACE2_PLUGINS_H #include #include "common/macros.h" @@ -23,4 +23,4 @@ const bt_plugin *borrow_loaded_plugin_by_index(size_t index); const bt_plugin *borrow_loaded_plugin_by_name(const char *name); -#endif /* CLI_BABELTRACE_PLUGINS_H */ +#endif /* BABELTRACE_CLI_BABELTRACE2_PLUGINS_H */ diff --git a/src/cli/babeltrace2-query.h b/src/cli/babeltrace2-query.h index c128bb6c..86fa8ea2 100644 --- a/src/cli/babeltrace2-query.h +++ b/src/cli/babeltrace2-query.h @@ -4,8 +4,8 @@ * Copyright 2016-2019 EfficiOS Inc. */ -#ifndef CLI_BABELTRACE_QUERY_H -#define CLI_BABELTRACE_QUERY_H +#ifndef BABELTRACE_CLI_BABELTRACE2_QUERY_H +#define BABELTRACE_CLI_BABELTRACE2_QUERY_H #include #include "common/macros.h" @@ -15,4 +15,4 @@ bt_query_executor_query_status cli_query(const bt_component_class *comp_cls, bt_logging_level log_level, const bt_interrupter *interrupter, const bt_value **user_result, const char **fail_reason); -#endif /* CLI_BABELTRACE_QUERY_H */ +#endif /* BABELTRACE_CLI_BABELTRACE2_QUERY_H */ diff --git a/src/cli/logging.h b/src/cli/logging.h index 967b2382..9df7660c 100644 --- a/src/cli/logging.h +++ b/src/cli/logging.h @@ -4,8 +4,8 @@ * Copyright (C) 2017 Philippe Proulx */ -#ifndef CLI_LOGGING_H -#define CLI_LOGGING_H +#ifndef BABELTRACE_CLI_LOGGING_H +#define BABELTRACE_CLI_LOGGING_H #define BT_LOG_OUTPUT_LEVEL bt_cli_log_level #include "logging/log.h" @@ -24,4 +24,4 @@ BT_LOG_LEVEL_EXTERN_SYMBOL(bt_cli_log_level); #define BT_CLI_LOGW_APPEND_CAUSE(_fmt, ...) \ BT_CLI_LOG_AND_APPEND(BT_LOG_WARNING, _fmt, ##__VA_ARGS__) -#endif /* CLI_LOGGING_H */ +#endif /* BABELTRACE_CLI_LOGGING_H */ diff --git a/src/clock-correlation-validator/clock-correlation-validator.h b/src/clock-correlation-validator/clock-correlation-validator.h index 4ccb7598..20c1509d 100644 --- a/src/clock-correlation-validator/clock-correlation-validator.h +++ b/src/clock-correlation-validator/clock-correlation-validator.h @@ -4,8 +4,8 @@ * Copyright 2024 EfficiOS, Inc. */ -#ifndef CLOCK_CORRELATION_VALIDATOR_CLOCK_CORRELATION_VALIDATOR_H -#define CLOCK_CORRELATION_VALIDATOR_CLOCK_CORRELATION_VALIDATOR_H +#ifndef BABELTRACE_CLOCK_CORRELATION_VALIDATOR_CLOCK_CORRELATION_VALIDATOR_H +#define BABELTRACE_CLOCK_CORRELATION_VALIDATOR_CLOCK_CORRELATION_VALIDATOR_H #include #include @@ -51,4 +51,4 @@ void bt_clock_correlation_validator_destroy( } /* extern "C" */ #endif -#endif /* CLOCK_CORRELATION_VALIDATOR_CLOCK_CORRELATION_VALIDATOR_H */ +#endif /* BABELTRACE_CLOCK_CORRELATION_VALIDATOR_CLOCK_CORRELATION_VALIDATOR_H */ diff --git a/src/clock-correlation-validator/clock-correlation-validator.hpp b/src/clock-correlation-validator/clock-correlation-validator.hpp index 314551c3..94ca4e00 100644 --- a/src/clock-correlation-validator/clock-correlation-validator.hpp +++ b/src/clock-correlation-validator/clock-correlation-validator.hpp @@ -4,8 +4,8 @@ * Copyright 2024 EfficiOS, Inc. */ -#ifndef CLOCK_CORRELATION_VALIDATOR_CLOCK_CORRELATION_VALIDATOR_HPP -#define CLOCK_CORRELATION_VALIDATOR_CLOCK_CORRELATION_VALIDATOR_HPP +#ifndef BABELTRACE_CLOCK_CORRELATION_VALIDATOR_CLOCK_CORRELATION_VALIDATOR_HPP +#define BABELTRACE_CLOCK_CORRELATION_VALIDATOR_CLOCK_CORRELATION_VALIDATOR_HPP #include "cpp-common/bt2/message.hpp" @@ -148,4 +148,4 @@ private: } /* namespace bt2ccv */ -#endif /* CLOCK_CORRELATION_VALIDATOR_CLOCK_CORRELATION_VALIDATOR_HPP */ +#endif /* BABELTRACE_CLOCK_CORRELATION_VALIDATOR_CLOCK_CORRELATION_VALIDATOR_HPP */ diff --git a/src/common/align.h b/src/common/align.h index 01004c67..bf8acd6e 100644 --- a/src/common/align.h +++ b/src/common/align.h @@ -4,8 +4,8 @@ * Copyright 2010 Mathieu Desnoyers */ -#ifndef _BABELTRACE_ALIGN_H -#define _BABELTRACE_ALIGN_H +#ifndef BABELTRACE_COMMON_ALIGN_H +#define BABELTRACE_COMMON_ALIGN_H #include "compat/compiler.h" #include "compat/limits.h" @@ -19,4 +19,4 @@ ((__typeof__(p)) BT_ALIGN_FLOOR((unsigned long) (p), a)) #define BT_IS_ALIGNED(x, a) (((x) & ((__typeof__(x)) (a) - 1)) == 0) -#endif /* _BABELTRACE_ALIGN_H */ +#endif /* BABELTRACE_COMMON_ALIGN_H */ diff --git a/src/common/assert.h b/src/common/assert.h index 52349e64..a9485256 100644 --- a/src/common/assert.h +++ b/src/common/assert.h @@ -5,8 +5,8 @@ * Copyright (c) 2018-2019 Philippe Proulx */ -#ifndef BABELTRACE_ASSERT_INTERNAL_H -#define BABELTRACE_ASSERT_INTERNAL_H +#ifndef BABELTRACE_COMMON_ASSERT_H +#define BABELTRACE_COMMON_ASSERT_H #include #include @@ -63,4 +63,4 @@ extern void bt_common_assert_failed(const char *file, int line, } #endif -#endif /* BABELTRACE_ASSERT_INTERNAL_H */ +#endif /* BABELTRACE_COMMON_ASSERT_H */ diff --git a/src/common/common.h b/src/common/common.h index fd9da4e7..63b01cc9 100644 --- a/src/common/common.h +++ b/src/common/common.h @@ -5,8 +5,8 @@ * Copyright (c) 2018 Philippe Proulx */ -#ifndef BABELTRACE_COMMON_INTERNAL_H -#define BABELTRACE_COMMON_INTERNAL_H +#ifndef BABELTRACE_COMMON_COMMON_H +#define BABELTRACE_COMMON_COMMON_H #include #include @@ -781,4 +781,4 @@ const char *bt_common_message_type_string(enum bt_message_type type) } #endif -#endif /* BABELTRACE_COMMON_INTERNAL_H */ +#endif /* BABELTRACE_COMMON_COMMON_H */ diff --git a/src/common/list.h b/src/common/list.h index fd1f471c..1b9be5cc 100644 --- a/src/common/list.h +++ b/src/common/list.h @@ -6,8 +6,8 @@ * Contributed by Ulrich Drepper , 2002. */ -#ifndef _BT_LIST_H -#define _BT_LIST_H 1 +#ifndef BABELTRACE_COMMON_LIST_H +#define BABELTRACE_COMMON_LIST_H /* The definitions of this file are adopted from those which can be found in the Linux kernel headers to enable people familiar with @@ -163,4 +163,4 @@ static inline void bt_list_replace_init(struct bt_list_head *old, } #endif -#endif /* _BT_LIST_H */ +#endif /* BABELTRACE_COMMON_LIST_H */ diff --git a/src/common/macros.h b/src/common/macros.h index 8120515c..8a518b03 100644 --- a/src/common/macros.h +++ b/src/common/macros.h @@ -4,8 +4,8 @@ * Copyright 2012 Mathieu Desnoyers */ -#ifndef _BABELTRACE_INTERNAL_H -#define _BABELTRACE_INTERNAL_H +#ifndef BABELTRACE_COMMON_MACROS_H +#define BABELTRACE_COMMON_MACROS_H #ifdef __cplusplus extern "C" { @@ -45,29 +45,6 @@ extern "C" { #define BT_IF_DEV_MODE(txt) #endif -/* - * Yield `ref`'s value while setting `ref` to NULL. - * - * This can be used to give a strong reference to a callee: - * - * add_foo_to_list(list, BT_MOVE_REF(foo)); - * - * or in a simple assignment: - * - * my_struct->foo = BT_MOVE_REF(foo); - * - * When moving a reference in a function call, the reference is given to the - * callee even if that function call fails, so make sure the called function - * is written accordingly. - */ - -#define BT_MOVE_REF(ref) \ - ({ \ - __typeof__(ref) _ref = ref; \ - ref = NULL; \ - _ref; \ - }) - /* Wrapper for g_array_index that adds bound checking. */ #define bt_g_array_index(a, t, i) \ g_array_index((a), t, ({ BT_ASSERT_DBG((i) < (a)->len); (i); })) @@ -119,4 +96,4 @@ extern "C" { } #endif -#endif +#endif /* BABELTRACE_COMMON_MACROS_H */ diff --git a/src/common/mmap-align.h b/src/common/mmap-align.h index 4d81b257..d4595dc5 100644 --- a/src/common/mmap-align.h +++ b/src/common/mmap-align.h @@ -4,8 +4,8 @@ * Copyright 2010 Mathieu Desnoyers */ -#ifndef _BABELTRACE_MMAP_ALIGN_H -#define _BABELTRACE_MMAP_ALIGN_H +#ifndef BABELTRACE_COMMON_MMAP_ALIGN_H +#define BABELTRACE_COMMON_MMAP_ALIGN_H #include "common/align.h" #include @@ -95,4 +95,4 @@ void mmap_align_set_addr(struct mmap_align_data *mma, void *addr) mma->addr = addr; } -#endif /* _BABELTRACE_MMAP_ALIGN_H */ +#endif /* BABELTRACE_COMMON_MMAP_ALIGN_H */ diff --git a/src/common/prio-heap.c b/src/common/prio-heap.c deleted file mode 100644 index 55ed5e81..00000000 --- a/src/common/prio-heap.c +++ /dev/null @@ -1,220 +0,0 @@ -/* - * SPDX-License-Identifier: MIT - * - * Copyright 2011 Mathieu Desnoyers - * - * Static-sized priority heap containing pointers. Based on CLRS, - * chapter 6. - */ - -#include "common/macros.h" -#include "common/assert.h" -#include -#include -#include - -#include "common/prio-heap.h" - -#ifdef DEBUG_HEAP -void check_heap(const struct ptr_heap *heap) -{ - size_t i; - - if (!heap->len) - return; - - for (i = 1; i < heap->len; i++) - BT_ASSERT_DBG(!heap->gt(heap->ptrs[i], heap->ptrs[0])); -} -#endif - -static -size_t parent(size_t i) -{ - return (i - 1) >> 1; -} - -static -size_t left(size_t i) -{ - return (i << 1) + 1; -} - -static -size_t right(size_t i) -{ - return (i << 1) + 2; -} - -/* - * Copy of heap->ptrs pointer is invalid after heap_grow. - */ -static -int heap_grow(struct ptr_heap *heap, size_t new_len) -{ - void **new_ptrs; - - if (G_LIKELY(heap->alloc_len >= new_len)) - return 0; - - heap->alloc_len = bt_max_t(size_t, new_len, heap->alloc_len << 1); - new_ptrs = calloc(heap->alloc_len, sizeof(void *)); - if (G_UNLIKELY(!new_ptrs)) - return -ENOMEM; - if (G_LIKELY(heap->ptrs)) - memcpy(new_ptrs, heap->ptrs, heap->len * sizeof(void *)); - free(heap->ptrs); - heap->ptrs = new_ptrs; - return 0; -} - -static -int heap_set_len(struct ptr_heap *heap, size_t new_len) -{ - int ret; - - ret = heap_grow(heap, new_len); - if (G_UNLIKELY(ret)) - return ret; - heap->len = new_len; - return 0; -} - -int bt_heap_init(struct ptr_heap *heap, size_t alloc_len, - int gt(void *a, void *b)) -{ - heap->ptrs = NULL; - heap->len = 0; - heap->alloc_len = 0; - heap->gt = gt; - /* - * Minimum size allocated is 1 entry to ensure memory allocation - * never fails within bt_heap_replace_max. - */ - return heap_grow(heap, bt_max_t(size_t, 1, alloc_len)); -} - -void bt_heap_free(struct ptr_heap *heap) -{ - free(heap->ptrs); -} - -static void heapify(struct ptr_heap *heap, size_t i) -{ - void **ptrs = heap->ptrs; - size_t l, r, largest; - - for (;;) { - void *tmp; - - l = left(i); - r = right(i); - if (l < heap->len && heap->gt(ptrs[l], ptrs[i])) - largest = l; - else - largest = i; - if (r < heap->len && heap->gt(ptrs[r], ptrs[largest])) - largest = r; - if (G_UNLIKELY(largest == i)) - break; - tmp = ptrs[i]; - ptrs[i] = ptrs[largest]; - ptrs[largest] = tmp; - i = largest; - } - check_heap(heap); -} - -void *bt_heap_replace_max(struct ptr_heap *heap, void *p) -{ - void *res; - - if (G_UNLIKELY(!heap->len)) { - (void) heap_set_len(heap, 1); - heap->ptrs[0] = p; - check_heap(heap); - return NULL; - } - - /* Replace the current max and heapify */ - res = heap->ptrs[0]; - heap->ptrs[0] = p; - heapify(heap, 0); - return res; -} - -int bt_heap_insert(struct ptr_heap *heap, void *p) -{ - void **ptrs; - size_t pos; - int ret; - - ret = heap_set_len(heap, heap->len + 1); - if (G_UNLIKELY(ret)) - return ret; - ptrs = heap->ptrs; - pos = heap->len - 1; - while (pos > 0 && heap->gt(p, ptrs[parent(pos)])) { - /* Move parent down until we find the right spot */ - ptrs[pos] = ptrs[parent(pos)]; - pos = parent(pos); - } - ptrs[pos] = p; - check_heap(heap); - return 0; -} - -void *bt_heap_remove(struct ptr_heap *heap) -{ - switch (heap->len) { - case 0: - return NULL; - case 1: - (void) heap_set_len(heap, 0); - return heap->ptrs[0]; - } - /* Shrink, replace the current max by previous last entry and heapify */ - heap_set_len(heap, heap->len - 1); - /* len changed. previous last entry is at heap->len */ - return bt_heap_replace_max(heap, heap->ptrs[heap->len]); -} - -void *bt_heap_cherrypick(struct ptr_heap *heap, void *p) -{ - size_t pos, len = heap->len; - - for (pos = 0; pos < len; pos++) - if (G_UNLIKELY(heap->ptrs[pos] == p)) - goto found; - return NULL; -found: - if (G_UNLIKELY(heap->len == 1)) { - (void) heap_set_len(heap, 0); - check_heap(heap); - return heap->ptrs[0]; - } - /* Replace p with previous last entry and heapify. */ - heap_set_len(heap, heap->len - 1); - /* len changed. previous last entry is at heap->len */ - heap->ptrs[pos] = heap->ptrs[heap->len]; - heapify(heap, pos); - return p; -} - -int bt_heap_copy(struct ptr_heap *dst, struct ptr_heap *src) -{ - int ret; - - ret = bt_heap_init(dst, src->alloc_len, src->gt); - if (ret < 0) - goto end; - - ret = heap_set_len(dst, src->len); - if (ret < 0) - goto end; - - memcpy(dst->ptrs, src->ptrs, src->len * sizeof(void *)); - -end: - return ret; -} diff --git a/src/common/prio-heap.h b/src/common/prio-heap.h deleted file mode 100644 index 7e56521b..00000000 --- a/src/common/prio-heap.h +++ /dev/null @@ -1,116 +0,0 @@ -/* - * SPDX-License-Identifier: MIT - * - * Copyright 2011 Mathieu Desnoyers - * - * Static-sized priority heap containing pointers. Based on CLRS, - * chapter 6. - */ - -#ifndef BABELTRACE_COMMON_PRIO_HEAP_H -#define BABELTRACE_COMMON_PRIO_HEAP_H - -#include -#include "common/macros.h" - -struct ptr_heap { - size_t len, alloc_len; - void **ptrs; - int (*gt)(void *a, void *b); -}; - -#ifdef DEBUG_HEAP -void check_heap(const struct ptr_heap *heap); -#else -static inline -void check_heap(const struct ptr_heap *heap __attribute__((unused))) -{ -} -#endif - -/** - * bt_heap_maximum - return the largest element in the heap - * @heap: the heap to be operated on - * - * Returns the largest element in the heap, without performing any modification - * to the heap structure. Returns NULL if the heap is empty. - */ -static inline void *bt_heap_maximum(const struct ptr_heap *heap) -{ - check_heap(heap); - return G_LIKELY(heap->len) ? heap->ptrs[0] : NULL; -} - -/** - * bt_heap_init - initialize the heap - * @heap: the heap to initialize - * @alloc_len: number of elements initially allocated - * @gt: function to compare the elements - * - * Returns -ENOMEM if out of memory. - */ -extern int bt_heap_init(struct ptr_heap *heap, - size_t alloc_len, - int gt(void *a, void *b)); - -/** - * bt_heap_free - free the heap - * @heap: the heap to free - */ -extern void bt_heap_free(struct ptr_heap *heap); - -/** - * bt_heap_insert - insert an element into the heap - * @heap: the heap to be operated on - * @p: the element to add - * - * Insert an element into the heap. - * - * Returns -ENOMEM if out of memory. - */ -extern int bt_heap_insert(struct ptr_heap *heap, void *p); - -/** - * bt_heap_remove - remove the largest element from the heap - * @heap: the heap to be operated on - * - * Returns the largest element in the heap. It removes this element from the - * heap. Returns NULL if the heap is empty. - */ -extern void *bt_heap_remove(struct ptr_heap *heap); - -/** - * bt_heap_cherrypick - remove a given element from the heap - * @heap: the heap to be operated on - * @p: the element - * - * Remove the given element from the heap. Return the element if present, else - * return NULL. This algorithm has a complexity of O(n), which is higher than - * O(log(n)) provided by the rest of this API. - */ -extern void *bt_heap_cherrypick(struct ptr_heap *heap, void *p); - -/** - * bt_heap_replace_max - replace the the largest element from the heap - * @heap: the heap to be operated on - * @p: the pointer to be inserted as topmost element replacement - * - * Returns the largest element in the heap. It removes this element from the - * heap. The heap is rebalanced only once after the insertion. Returns NULL if - * the heap is empty. - * - * This is the equivalent of calling bt_heap_remove() and then bt_heap_insert(), but - * it only rebalances the heap once. It never allocates memory. - */ -extern void *bt_heap_replace_max(struct ptr_heap *heap, void *p); - -/** - * bt_heap_copy - copy a heap - * @dst: the destination heap (must be allocated) - * @src: the source heap - * - * Returns -ENOMEM if out of memory. - */ -extern int bt_heap_copy(struct ptr_heap *dst, struct ptr_heap *src); - -#endif /* BABELTRACE_COMMON_PRIO_HEAP_H */ diff --git a/src/common/safe.h b/src/common/safe.h index cb962c48..8d742b27 100644 --- a/src/common/safe.h +++ b/src/common/safe.h @@ -4,6 +4,9 @@ * Copyright 2012 Mathieu Desnoyers */ +#ifndef BABELTRACE_COMMON_SAFE_H +#define BABELTRACE_COMMON_SAFE_H + #include #include @@ -46,3 +49,5 @@ bool bt_safe_to_add_uint64(uint64_t a, uint64_t b) #ifdef __cplusplus } #endif + +#endif /* BABELTRACE_COMMON_SAFE_H */ diff --git a/src/common/uuid.h b/src/common/uuid.h index c8418a67..1c656a94 100644 --- a/src/common/uuid.h +++ b/src/common/uuid.h @@ -4,8 +4,8 @@ * Copyright (C) 2019 Michael Jeanson */ -#ifndef _BABELTRACE_COMMON_UUID_H -#define _BABELTRACE_COMMON_UUID_H +#ifndef BABELTRACE_COMMON_UUID_H +#define BABELTRACE_COMMON_UUID_H #include #include @@ -47,4 +47,4 @@ void bt_uuid_copy(bt_uuid_t uuid_dest, const bt_uuid_t uuid_src); } #endif -#endif /* _BABELTRACE_COMMON_UUID_H */ +#endif /* BABELTRACE_COMMON_UUID_H */ diff --git a/src/common/version.h b/src/common/version.h index b9de46dd..2fb6de39 100644 --- a/src/common/version.h +++ b/src/common/version.h @@ -4,9 +4,9 @@ * Copyright (C) 2018 Michael Jeanson */ -#ifndef VERSION_H -#define VERSION_H +#ifndef BABELTRACE_COMMON_VERSION_H +#define BABELTRACE_COMMON_VERSION_H #include "common/version.i" -#endif /* VERSION_H */ +#endif /* BABELTRACE_COMMON_VERSION_H */ diff --git a/src/compat/bitfield.h b/src/compat/bitfield.h index df67401d..022cb4cf 100644 --- a/src/compat/bitfield.h +++ b/src/compat/bitfield.h @@ -4,8 +4,8 @@ * Copyright 2010-2019 Mathieu Desnoyers */ -#ifndef _BABELTRACE_BITFIELD_H -#define _BABELTRACE_BITFIELD_H +#ifndef BABELTRACE_COMPAT_BITFIELD_H +#define BABELTRACE_COMPAT_BITFIELD_H #include /* C99 5.2.4.2 Numerical limits */ #include /* C99 7.16 bool type */ @@ -506,4 +506,4 @@ do { \ #endif -#endif /* _BABELTRACE_BITFIELD_H */ +#endif /* BABELTRACE_COMPAT_BITFIELD_H */ diff --git a/src/compat/compiler.h b/src/compat/compiler.h index 90e80da8..94ebb2c0 100644 --- a/src/compat/compiler.h +++ b/src/compat/compiler.h @@ -4,8 +4,8 @@ * Copyright 2010 Mathieu Desnoyers */ -#ifndef _BABELTRACE_COMPILER_H -#define _BABELTRACE_COMPILER_H +#ifndef BABELTRACE_COMPAT_COMPILER_H +#define BABELTRACE_COMPAT_COMPILER_H #include /* for offsetof */ @@ -21,4 +21,4 @@ #define BT_ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) -#endif /* _BABELTRACE_COMPILER_H */ +#endif /* BABELTRACE_COMPAT_COMPILER_H */ diff --git a/src/compat/endian.h b/src/compat/endian.h index a1c0ab34..1de99d2d 100644 --- a/src/compat/endian.h +++ b/src/compat/endian.h @@ -6,8 +6,8 @@ * endian.h compatibility layer. */ -#ifndef _BABELTRACE_ENDIAN_H -#define _BABELTRACE_ENDIAN_H +#ifndef BABELTRACE_COMPAT_ENDIAN_H +#define BABELTRACE_COMPAT_ENDIAN_H #ifdef __FreeBSD__ #include @@ -221,4 +221,4 @@ #endif /* __FLOAT_WORD_ORDER */ #endif /* FLOAT_WORD_ORDER */ -#endif /* _BABELTRACE_ENDIAN_H */ +#endif /* BABELTRACE_COMPAT_ENDIAN_H */ diff --git a/src/compat/fcntl.h b/src/compat/fcntl.h index e78b6d49..f5b9bb34 100644 --- a/src/compat/fcntl.h +++ b/src/compat/fcntl.h @@ -6,8 +6,8 @@ * fcntl compatibility layer. */ -#ifndef _BABELTRACE_COMPAT_FCNTL_H -#define _BABELTRACE_COMPAT_FCNTL_H +#ifndef BABELTRACE_COMPAT_FCNTL_H +#define BABELTRACE_COMPAT_FCNTL_H #include "common/common.h" @@ -216,4 +216,4 @@ end: } #endif /* #else #ifdef BABELTRACE_HAVE_POSIX_FALLOCATE */ -#endif /* _BABELTRACE_COMPAT_FCNTL_H */ +#endif /* BABELTRACE_COMPAT_FCNTL_H */ diff --git a/src/compat/glib.h b/src/compat/glib.h index ef17be6c..5319fcb6 100644 --- a/src/compat/glib.h +++ b/src/compat/glib.h @@ -4,8 +4,8 @@ * Copyright (C) 2015 Michael Jeanson */ -#ifndef _BABELTRACE_COMPAT_GLIB_H -#define _BABELTRACE_COMPAT_GLIB_H +#ifndef BABELTRACE_COMPAT_GLIB_H +#define BABELTRACE_COMPAT_GLIB_H #include @@ -59,4 +59,4 @@ end: } #endif -#endif /* _BABELTRACE_COMPAT_GLIB_H */ +#endif /* BABELTRACE_COMPAT_GLIB_H */ diff --git a/src/compat/limits.h b/src/compat/limits.h index c51c2929..48c18e68 100644 --- a/src/compat/limits.h +++ b/src/compat/limits.h @@ -4,8 +4,8 @@ * Copyright (C) 2014 Jérémie Galarneau */ -#ifndef _BABELTRACE_LIMITS_H -#define _BABELTRACE_LIMITS_H +#ifndef BABELTRACE_COMPAT_LIMITS_H +#define BABELTRACE_COMPAT_LIMITS_H #include @@ -34,4 +34,4 @@ #define PATH_MAX 4096 #endif /* __GNU__ */ -#endif /* _BABELTRACE_LIMITS_H */ +#endif /* BABELTRACE_COMPAT_LIMITS_H */ diff --git a/src/compat/memstream.h b/src/compat/memstream.h index 374a5e72..b055b2e3 100644 --- a/src/compat/memstream.h +++ b/src/compat/memstream.h @@ -6,8 +6,8 @@ * memstream compatibility layer. */ -#ifndef _BABELTRACE_FORMAT_CTF_MEMSTREAM_H -#define _BABELTRACE_FORMAT_CTF_MEMSTREAM_H +#ifndef BABELTRACE_COMPAT_MEMSTREAM_H +#define BABELTRACE_COMPAT_MEMSTREAM_H #ifdef BABELTRACE_HAVE_FMEMOPEN #include @@ -344,4 +344,4 @@ error_free: #endif /* BABELTRACE_HAVE_OPEN_MEMSTREAM */ -#endif /* _BABELTRACE_FORMAT_CTF_MEMSTREAM_H */ +#endif /* BABELTRACE_COMPAT_MEMSTREAM_H */ diff --git a/src/compat/mman.h b/src/compat/mman.h index 33febccb..b33ca611 100644 --- a/src/compat/mman.h +++ b/src/compat/mman.h @@ -4,8 +4,8 @@ * Copyright (C) 2015-2016 Michael Jeanson */ -#ifndef _BABELTRACE_COMPAT_MMAN_H -#define _BABELTRACE_COMPAT_MMAN_H +#ifndef BABELTRACE_COMPAT_MMAN_H +#define BABELTRACE_COMPAT_MMAN_H #ifdef __MINGW32__ @@ -76,4 +76,4 @@ size_t bt_mmap_get_offset_align_size(int log_level) # endif #endif -#endif /* _BABELTRACE_COMPAT_MMAN_H */ +#endif /* BABELTRACE_COMPAT_MMAN_H */ diff --git a/src/compat/stdio.h b/src/compat/stdio.h index 076f43a9..d0200226 100644 --- a/src/compat/stdio.h +++ b/src/compat/stdio.h @@ -4,8 +4,8 @@ * Copyright (C) 2015 Mathieu Desnoyers */ -#ifndef _BABELTRACE_COMPAT_STDIO_H -#define _BABELTRACE_COMPAT_STDIO_H +#ifndef BABELTRACE_COMPAT_STDIO_H +#define BABELTRACE_COMPAT_STDIO_H #include #include @@ -109,4 +109,4 @@ ssize_t bt_getline(char **lineptr, size_t *n, FILE *stream) return linelen - 1; /* Count don't include final \0. */ } -#endif /* _BABELTRACE_COMPAT_STDIO_H */ +#endif /* BABELTRACE_COMPAT_STDIO_H */ diff --git a/src/compat/stdlib.h b/src/compat/stdlib.h index a06844d5..02a5cd9d 100644 --- a/src/compat/stdlib.h +++ b/src/compat/stdlib.h @@ -4,8 +4,8 @@ * Copyright (C) 2015 Michael Jeanson */ -#ifndef _BABELTRACE_COMPAT_STDLIB_H -#define _BABELTRACE_COMPAT_STDLIB_H +#ifndef BABELTRACE_COMPAT_STDLIB_H +#define BABELTRACE_COMPAT_STDLIB_H /* * This compat wrapper can be removed and replaced by g_mkdtemp() when we bump @@ -58,4 +58,4 @@ end: #endif -#endif /* _BABELTRACE_COMPAT_STDLIB_H */ +#endif /* BABELTRACE_COMPAT_STDLIB_H */ diff --git a/src/compat/string.h b/src/compat/string.h index a1503b29..7a3a27ef 100644 --- a/src/compat/string.h +++ b/src/compat/string.h @@ -4,8 +4,8 @@ * Copyright (C) 2013 Mathieu Desnoyers */ -#ifndef _BABELTRACE_COMPAT_STRING_H -#define _BABELTRACE_COMPAT_STRING_H +#ifndef BABELTRACE_COMPAT_STRING_H +#define BABELTRACE_COMPAT_STRING_H #include #include @@ -71,4 +71,4 @@ end: } #endif /* HAVE_STRNDUP */ -#endif /* _BABELTRACE_COMPAT_STRING_H */ +#endif /* BABELTRACE_COMPAT_STRING_H */ diff --git a/src/compat/time.h b/src/compat/time.h index 74172589..62982fc6 100644 --- a/src/compat/time.h +++ b/src/compat/time.h @@ -5,8 +5,8 @@ * Copyright (C) 2016 Michael Jeanson */ -#ifndef _BABELTRACE_INCLUDE_COMPAT_TIME_H -#define _BABELTRACE_INCLUDE_COMPAT_TIME_H +#ifndef BABELTRACE_COMPAT_TIME_H +#define BABELTRACE_COMPAT_TIME_H #include #include @@ -78,4 +78,5 @@ struct tm *bt_localtime_r(const time_t *timep, struct tm *result) } #endif /* __MINGW32__ */ -#endif /* _BABELTRACE_INCLUDE_COMPAT_TIME_H */ + +#endif /* BABELTRACE_COMPAT_TIME_H */ diff --git a/src/compat/unistd.h b/src/compat/unistd.h index e517e4bc..6aae01ad 100644 --- a/src/compat/unistd.h +++ b/src/compat/unistd.h @@ -4,8 +4,8 @@ * Copyright (C) 2016 Michael Jeanson */ -#ifndef _BABELTRACE_COMPAT_UNISTD_H -#define _BABELTRACE_COMPAT_UNISTD_H +#ifndef BABELTRACE_COMPAT_UNISTD_H +#define BABELTRACE_COMPAT_UNISTD_H #include @@ -39,4 +39,5 @@ long bt_sysconf(int name) } #endif -#endif /* _BABELTRACE_COMPAT_UNISTD_H */ + +#endif /* BABELTRACE_COMPAT_UNISTD_H */ diff --git a/src/compat/utc.h b/src/compat/utc.h index 4154c3e8..da95d0a9 100644 --- a/src/compat/utc.h +++ b/src/compat/utc.h @@ -4,8 +4,8 @@ * Copyright (C) 2011-2013 Mathieu Desnoyers */ -#ifndef _BABELTRACE_UTC_H -#define _BABELTRACE_UTC_H +#ifndef BABELTRACE_COMPAT_UTC_H +#define BABELTRACE_COMPAT_UTC_H #include @@ -86,4 +86,4 @@ time_t bt_timegm(struct tm *tm) #endif -#endif /* _BABELTRACE_UTC_H */ +#endif /* BABELTRACE_COMPAT_UTC_H */ diff --git a/src/cpp-common/bt2/query-executor.hpp b/src/cpp-common/bt2/query-executor.hpp index 4b3fb264..b610b3fd 100644 --- a/src/cpp-common/bt2/query-executor.hpp +++ b/src/cpp-common/bt2/query-executor.hpp @@ -121,4 +121,4 @@ using ConstQueryExecutor = CommonQueryExecutor; } /* namespace bt2 */ -#endif /* BABELTRACE_CPP_COMMON_BT2_QUERY_EXECUTOR_HPP */ +#endif /* BABELTRACE_CPP_COMMON_BT2_QUERY_EXECUTOR_HPP */ diff --git a/src/cpp-common/bt2c/file-utils.hpp b/src/cpp-common/bt2c/file-utils.hpp index 9890f0a8..17bbe8c3 100644 --- a/src/cpp-common/bt2c/file-utils.hpp +++ b/src/cpp-common/bt2c/file-utils.hpp @@ -4,8 +4,8 @@ * SPDX-License-Identifier: MIT */ -#ifndef BABELTRACE_CPP_COMMON_FILE_UTILS_HPP -#define BABELTRACE_CPP_COMMON_FILE_UTILS_HPP +#ifndef BABELTRACE_CPP_COMMON_BT2C_FILE_UTILS_HPP +#define BABELTRACE_CPP_COMMON_BT2C_FILE_UTILS_HPP #include #include @@ -19,4 +19,4 @@ std::vector dataFromFile(const char *path); } /* namespace bt2c */ -#endif /* BABELTRACE_CPP_COMMON_FILE_UTILS_HPP */ +#endif /* BABELTRACE_CPP_COMMON_BT2C_FILE_UTILS_HPP */ diff --git a/src/cpp-common/bt2c/fmt.hpp b/src/cpp-common/bt2c/fmt.hpp index a78d7a61..f29a77a2 100644 --- a/src/cpp-common/bt2c/fmt.hpp +++ b/src/cpp-common/bt2c/fmt.hpp @@ -4,6 +4,9 @@ * SPDX-License-Identifier: MIT */ +#ifndef BABELTRACE_CPP_COMMON_BT2C_FMT_HPP +#define BABELTRACE_CPP_COMMON_BT2C_FMT_HPP + #include "cpp-common/vendor/fmt/format.h" /* IWYU pragma: keep */ #include "cpp-common/vendor/wise-enum/wise_enum.h" @@ -13,7 +16,7 @@ namespace internal { template using EnableIfIsWiseEnum = - typename std::enable_if::value, const char *>::type; + typename std::enable_if::value, wise_enum::string_type>::type; } /* namespace internal */ @@ -41,3 +44,5 @@ inline std::string format_as(const UuidView uuid) } } /* namespace bt2c */ + +#endif /* BABELTRACE_CPP_COMMON_BT2C_FMT_HPP */ diff --git a/src/cpp-common/bt2c/logging.hpp b/src/cpp-common/bt2c/logging.hpp index a1fc583f..f8140dde 100644 --- a/src/cpp-common/bt2c/logging.hpp +++ b/src/cpp-common/bt2c/logging.hpp @@ -79,9 +79,8 @@ public: * `tag`. */ explicit Logger(const bt2::SelfComponent selfComp, std::string tag) noexcept : - _mSelfComp {selfComp}, _mLevel {static_cast(selfComp.loggingLevel())}, _mTag { - std::move( - tag)} + _mSelfComp {selfComp}, _mLevel {static_cast(selfComp.loggingLevel())}, + _mTag {std::move(tag)} { } @@ -142,8 +141,8 @@ public: */ explicit Logger(const Logger& other, std::string newTag) : _mSelfCompCls {other._mSelfCompCls}, _mSelfComp {other._mSelfComp}, - _mSelfMsgIter {other._mSelfMsgIter}, - _mModuleName {other._mModuleName}, _mLevel {other._mLevel}, _mTag {std::move(newTag)} + _mSelfMsgIter {other._mSelfMsgIter}, _mModuleName {other._mModuleName}, + _mLevel {other._mLevel}, _mTag {std::move(newTag)} { } @@ -275,10 +274,10 @@ public: */ template void log(const char * const fileName, const char * const funcName, const unsigned int lineNo, - const char * const fmt, ArgTs&&...args) const + fmt::format_string fmt, ArgTs&&...args) const { - this->_log<_StdLogWriter, LevelV, AppendCauseV>(fileName, funcName, lineNo, {}, "", fmt, - std::forward(args)...); + this->_log<_StdLogWriter, LevelV, AppendCauseV>( + fileName, funcName, lineNo, {}, "", std::move(fmt), std::forward(args)...); } /* @@ -287,10 +286,10 @@ public: */ template [[noreturn]] void logErrorAndThrow(const char * const fileName, const char * const funcName, - const unsigned int lineNo, const char * const fmt, + const unsigned int lineNo, fmt::format_string fmt, ArgTs&&...args) const { - this->log(fileName, funcName, lineNo, fmt, + this->log(fileName, funcName, lineNo, std::move(fmt), std::forward(args)...); throw ExcT {}; } @@ -300,10 +299,10 @@ public: */ template [[noreturn]] void logErrorAndRethrow(const char * const fileName, const char * const funcName, - const unsigned int lineNo, const char * const fmt, - ArgTs&&...args) const + const unsigned int lineNo, + fmt::format_string fmt, ArgTs&&...args) const { - this->log(fileName, funcName, lineNo, fmt, + this->log(fileName, funcName, lineNo, std::move(fmt), std::forward(args)...); throw; } @@ -333,12 +332,12 @@ public: */ template void logErrno(const char * const fileName, const char * const funcName, - const unsigned int lineNo, const char * const initMsg, const char * const fmt, - ArgTs&&...args) const + const unsigned int lineNo, const char * const initMsg, + fmt::format_string fmt, ArgTs&&...args) const { - this->_log<_InitMsgLogWriter, LevelV, AppendCauseV>(fileName, funcName, lineNo, {}, - this->_errnoIntroStr(initMsg).c_str(), - fmt, std::forward(args)...); + this->_log<_InitMsgLogWriter, LevelV, AppendCauseV>( + fileName, funcName, lineNo, {}, this->_errnoIntroStr(initMsg).c_str(), std::move(fmt), + std::forward(args)...); } /* @@ -348,11 +347,11 @@ public: template [[noreturn]] void logErrorErrnoAndThrow(const char * const fileName, const char * const funcName, const unsigned int lineNo, - const char * const initMsg, const char * const fmt, - ArgTs&&...args) const + const char * const initMsg, + fmt::format_string fmt, ArgTs&&...args) const { - this->logErrno(fileName, funcName, lineNo, initMsg, fmt, - std::forward(args)...); + this->logErrno(fileName, funcName, lineNo, initMsg, + std::move(fmt), std::forward(args)...); throw ExcT {}; } @@ -360,13 +359,13 @@ public: * Like logErrno() with the `Level::Error` level, but also rethrows. */ template - [[noreturn]] void logErrorErrnoAndRethrow(const char * const fileName, - const char * const funcName, - const unsigned int lineNo, const char * const initMsg, - const char * const fmt, ArgTs&&...args) const + [[noreturn]] void + logErrorErrnoAndRethrow(const char * const fileName, const char * const funcName, + const unsigned int lineNo, const char * const initMsg, + fmt::format_string fmt, ArgTs&&...args) const { - this->logErrno(fileName, funcName, lineNo, initMsg, fmt, - std::forward(args)...); + this->logErrno(fileName, funcName, lineNo, initMsg, + std::move(fmt), std::forward(args)...); throw; } @@ -391,10 +390,10 @@ public: */ template void logMem(const char * const fileName, const char * const funcName, const unsigned int lineNo, - const MemData memData, const char * const fmt, ArgTs&&...args) const + const MemData memData, fmt::format_string fmt, ArgTs&&...args) const { - this->_log<_MemLogWriter, LevelV, false>(fileName, funcName, lineNo, memData, "", fmt, - std::forward(args)...); + this->_log<_MemLogWriter, LevelV, false>(fileName, funcName, lineNo, memData, "", + std::move(fmt), std::forward(args)...); } private: @@ -411,7 +410,7 @@ private: */ template void _log(const char * const fileName, const char * const funcName, const unsigned int lineNo, - const MemData memData, const char * const initMsg, const char * const fmt, + const MemData memData, const char * const initMsg, fmt::format_string fmt, ArgTs&&...args) const { const auto wouldLog = this->wouldLog(LevelV); @@ -423,8 +422,7 @@ private: * append a null character). */ _mBuf.clear(); - BT_ASSERT(fmt); - fmt::format_to(std::back_inserter(_mBuf), fmt, std::forward(args)...); + fmt::format_to(std::back_inserter(_mBuf), std::move(fmt), std::forward(args)...); _mBuf.push_back('\0'); } diff --git a/src/cpp-common/bt2c/vector.hpp b/src/cpp-common/bt2c/vector.hpp index 516a8263..e40a913f 100644 --- a/src/cpp-common/bt2c/vector.hpp +++ b/src/cpp-common/bt2c/vector.hpp @@ -4,8 +4,8 @@ * SPDX-License-Identifier: MIT */ -#ifndef SRC_CPP_COMMON_VECTOR_HPP -#define SRC_CPP_COMMON_VECTOR_HPP +#ifndef BABELTRACE_CPP_COMMON_BT2C_VECTOR_HPP +#define BABELTRACE_CPP_COMMON_BT2C_VECTOR_HPP #include @@ -34,4 +34,4 @@ void vectorFastRemove(std::vector& vec, } /* namespace bt2c */ -#endif /* SRC_CPP_COMMON_VECTOR_HPP */ +#endif /* BABELTRACE_CPP_COMMON_BT2C_VECTOR_HPP */ diff --git a/src/cpp-common/vendor/span-lite/span.hpp b/src/cpp-common/vendor/span-lite/span.hpp index 3d2d86a4..9a7182f5 100644 --- a/src/cpp-common/vendor/span-lite/span.hpp +++ b/src/cpp-common/vendor/span-lite/span.hpp @@ -1870,7 +1870,7 @@ using span_lite::byte_span; #endif // span_FEATURE( BYTE_SPAN ) -#if span_HAVE( STRUCT_BINDING ) +#if !span_USES_STD_SPAN && span_HAVE( STRUCT_BINDING ) #if span_CPP14_OR_GREATER # include @@ -1938,7 +1938,7 @@ span_constexpr ElementType const & get( nonstd::span const } // end namespace std -#endif // span_HAVE( STRUCT_BINDING ) +#endif // !span_USES_STD_SPAN && span_HAVE( STRUCT_BINDING ) #if ! span_USES_STD_SPAN span_RESTORE_WARNINGS() diff --git a/src/ctf-writer/assert-pre.h b/src/ctf-writer/assert-pre.h index 38e3ac2c..a118841d 100644 --- a/src/ctf-writer/assert-pre.h +++ b/src/ctf-writer/assert-pre.h @@ -5,8 +5,8 @@ * Copyright (c) 2018 Philippe Proulx */ -#ifndef BABELTRACE_CTF_WRITER_ASSERT_PRE_INTERNAL_H -#define BABELTRACE_CTF_WRITER_ASSERT_PRE_INTERNAL_H +#ifndef BABELTRACE_CTF_WRITER_ASSERT_PRE_H +#define BABELTRACE_CTF_WRITER_ASSERT_PRE_H /* * The macros in this header use macros defined in "logging/log.h". We @@ -142,4 +142,4 @@ "Index is out of bounds: index=%" PRIu64 ", " \ "count=%" PRIu64, (uint64_t) (_index), (uint64_t) (_length)) -#endif /* BABELTRACE_CTF_WRITER_ASSERT_PRE_INTERNAL_H */ +#endif /* BABELTRACE_CTF_WRITER_ASSERT_PRE_H */ diff --git a/src/ctf-writer/clock-class.h b/src/ctf-writer/clock-class.h index adbba43a..588b2d71 100644 --- a/src/ctf-writer/clock-class.h +++ b/src/ctf-writer/clock-class.h @@ -4,8 +4,8 @@ * Copyright 2013, 2014 Jérémie Galarneau */ -#ifndef BABELTRACE_CTF_WRITER_CLOCK_CLASS_INTERNAL_H -#define BABELTRACE_CTF_WRITER_CLOCK_CLASS_INTERNAL_H +#ifndef BABELTRACE_CTF_WRITER_CLOCK_CLASS_H +#define BABELTRACE_CTF_WRITER_CLOCK_CLASS_H #include "common/macros.h" #include "object-pool.h" @@ -78,4 +78,4 @@ const uint8_t *bt_ctf_clock_class_get_uuid( int bt_ctf_clock_class_set_uuid(struct bt_ctf_clock_class *clock_class, const uint8_t *uuid); -#endif /* BABELTRACE_CTF_WRITER_CLOCK_CLASS_INTERNAL_H */ +#endif /* BABELTRACE_CTF_WRITER_CLOCK_CLASS_H */ diff --git a/src/ctf-writer/clock.h b/src/ctf-writer/clock.h index cad188e7..3fc2a15c 100644 --- a/src/ctf-writer/clock.h +++ b/src/ctf-writer/clock.h @@ -4,8 +4,8 @@ * Copyright 2017 Philippe Proulx */ -#ifndef BABELTRACE_CTF_WRITER_CLOCK_INTERNAL_H -#define BABELTRACE_CTF_WRITER_CLOCK_INTERNAL_H +#ifndef BABELTRACE_CTF_WRITER_CLOCK_H +#define BABELTRACE_CTF_WRITER_CLOCK_H #include #include "common/macros.h" @@ -28,4 +28,4 @@ int bt_ctf_clock_get_value(struct bt_ctf_clock *clock, uint64_t *value); void bt_ctf_clock_class_serialize(struct bt_ctf_clock_class *clock_class, struct metadata_context *context); -#endif /* BABELTRACE_CTF_WRITER_CLOCK_INTERNAL_H */ +#endif /* BABELTRACE_CTF_WRITER_CLOCK_H */ diff --git a/src/ctf-writer/event-class.h b/src/ctf-writer/event-class.h index 429888a7..e8e53114 100644 --- a/src/ctf-writer/event-class.h +++ b/src/ctf-writer/event-class.h @@ -4,8 +4,8 @@ * Copyright 2013, 2014 Jérémie Galarneau */ -#ifndef BABELTRACE_CTF_WRITER_EVENT_CLASS_INTERNAL_H -#define BABELTRACE_CTF_WRITER_EVENT_CLASS_INTERNAL_H +#ifndef BABELTRACE_CTF_WRITER_EVENT_CLASS_H +#define BABELTRACE_CTF_WRITER_EVENT_CLASS_H #include "common/assert.h" #include "common/macros.h" @@ -371,4 +371,4 @@ end: return ret; } -#endif /* BABELTRACE_CTF_WRITER_EVENT_CLASS_INTERNAL_H */ +#endif /* BABELTRACE_CTF_WRITER_EVENT_CLASS_H */ diff --git a/src/ctf-writer/event.h b/src/ctf-writer/event.h index 52e4c520..df043477 100644 --- a/src/ctf-writer/event.h +++ b/src/ctf-writer/event.h @@ -7,8 +7,8 @@ * http://www.efficios.com/ctf */ -#ifndef BABELTRACE_CTF_WRITER_EVENT_INTERNAL_H -#define BABELTRACE_CTF_WRITER_EVENT_INTERNAL_H +#ifndef BABELTRACE_CTF_WRITER_EVENT_H +#define BABELTRACE_CTF_WRITER_EVENT_H #include @@ -249,4 +249,4 @@ struct bt_ctf_stream_class *bt_ctf_event_class_borrow_stream_class( BT_CTF_TO_COMMON(event_class))); } -#endif /* BABELTRACE_CTF_WRITER_EVENT_INTERNAL_H */ +#endif /* BABELTRACE_CTF_WRITER_EVENT_H */ diff --git a/src/ctf-writer/field-path.h b/src/ctf-writer/field-path.h index c823f009..372a8c97 100644 --- a/src/ctf-writer/field-path.h +++ b/src/ctf-writer/field-path.h @@ -7,8 +7,8 @@ * http://www.efficios.com/ctf */ -#ifndef BABELTRACE_CTF_WRITER_FIELD_PATH_INTERNAL -#define BABELTRACE_CTF_WRITER_FIELD_PATH_INTERNAL +#ifndef BABELTRACE_CTF_WRITER_FIELD_PATH_H +#define BABELTRACE_CTF_WRITER_FIELD_PATH_H #include "common/common.h" #include "common/assert.h" @@ -47,4 +47,4 @@ int64_t bt_ctf_field_path_get_index_count( int bt_ctf_field_path_get_index( const struct bt_ctf_field_path *field_path, uint64_t index); -#endif /* BABELTRACE_CTF_WRITER_FIELD_PATH_INTERNAL */ +#endif /* BABELTRACE_CTF_WRITER_FIELD_PATH_H */ diff --git a/src/ctf-writer/field-types.h b/src/ctf-writer/field-types.h index f5dbd99e..2ee48a4b 100644 --- a/src/ctf-writer/field-types.h +++ b/src/ctf-writer/field-types.h @@ -7,8 +7,8 @@ * http://www.efficios.com/ctf */ -#ifndef BABELTRACE_CTF_WRITER_FIELD_TYPES_INTERNAL_H -#define BABELTRACE_CTF_WRITER_FIELD_TYPES_INTERNAL_H +#ifndef BABELTRACE_CTF_WRITER_FIELD_TYPES_H +#define BABELTRACE_CTF_WRITER_FIELD_TYPES_H #include #include @@ -671,4 +671,4 @@ int bt_ctf_field_type_serialize_recursive(struct bt_ctf_field_type *type, struct bt_ctf_field_type *bt_ctf_field_type_copy(struct bt_ctf_field_type *ft); -#endif /* BABELTRACE_CTF_WRITER_FIELD_TYPES_INTERNAL_H */ +#endif /* BABELTRACE_CTF_WRITER_FIELD_TYPES_H */ diff --git a/src/ctf-writer/field-wrapper.h b/src/ctf-writer/field-wrapper.h index 2b3286d2..f0053cf8 100644 --- a/src/ctf-writer/field-wrapper.h +++ b/src/ctf-writer/field-wrapper.h @@ -4,8 +4,8 @@ * Copyright 2018 Philippe Proulx */ -#ifndef BABELTRACE_CTF_WRITER_FIELD_WRAPPER_INTERNAL_H -#define BABELTRACE_CTF_WRITER_FIELD_WRAPPER_INTERNAL_H +#ifndef BABELTRACE_CTF_WRITER_FIELD_WRAPPER_H +#define BABELTRACE_CTF_WRITER_FIELD_WRAPPER_H #include "common/macros.h" @@ -27,4 +27,4 @@ void bt_ctf_field_wrapper_destroy(struct bt_ctf_field_wrapper *field); struct bt_ctf_field_wrapper *bt_ctf_field_wrapper_create( struct bt_ctf_object_pool *pool, struct bt_ctf_field_type *ft); -#endif /* BABELTRACE_CTF_WRITER_FIELD_WRAPPER_INTERNAL_H */ +#endif /* BABELTRACE_CTF_WRITER_FIELD_WRAPPER_H */ diff --git a/src/ctf-writer/fields.h b/src/ctf-writer/fields.h index 3c13c3ef..8a440206 100644 --- a/src/ctf-writer/fields.h +++ b/src/ctf-writer/fields.h @@ -7,8 +7,8 @@ * http://www.efficios.com/ctf */ -#ifndef BABELTRACE_CTF_WRITER_FIELDS_INTERNAL_H -#define BABELTRACE_CTF_WRITER_FIELDS_INTERNAL_H +#ifndef BABELTRACE_CTF_WRITER_FIELDS_H +#define BABELTRACE_CTF_WRITER_FIELDS_H #include #include @@ -807,4 +807,4 @@ bt_ctf_bool bt_ctf_field_is_set_recursive( return bt_ctf_field_common_is_set_recursive((void *) field); } -#endif /* BABELTRACE_CTF_WRITER_FIELDS_INTERNAL_H */ +#endif /* BABELTRACE_CTF_WRITER_FIELDS_H */ diff --git a/src/ctf-writer/functor.h b/src/ctf-writer/functor.h index 0b13d47e..a7f4da76 100644 --- a/src/ctf-writer/functor.h +++ b/src/ctf-writer/functor.h @@ -4,12 +4,12 @@ * Copyright 2013, 2014 Jérémie Galarneau */ -#ifndef BABELTRACE_CTF_WRITER_FUNCTOR_INTERNAL_H -#define BABELTRACE_CTF_WRITER_FUNCTOR_INTERNAL_H +#ifndef BABELTRACE_CTF_WRITER_FUNCTOR_H +#define BABELTRACE_CTF_WRITER_FUNCTOR_H #include #include "common/macros.h" void value_exists(gpointer element, gpointer search_query); -#endif /* BABELTRACE_CTF_WRITER_FUNCTOR_INTERNAL_H */ +#endif /* BABELTRACE_CTF_WRITER_FUNCTOR_H */ diff --git a/src/ctf-writer/object-pool.h b/src/ctf-writer/object-pool.h index 34679ebf..fc118236 100644 --- a/src/ctf-writer/object-pool.h +++ b/src/ctf-writer/object-pool.h @@ -5,8 +5,8 @@ * Copyright (c) 2018 Philippe Proulx */ -#ifndef BABELTRACE_CTF_WRITER_OBJECT_POOL_INTERNAL_H -#define BABELTRACE_CTF_WRITER_OBJECT_POOL_INTERNAL_H +#ifndef BABELTRACE_CTF_WRITER_OBJECT_POOL_H +#define BABELTRACE_CTF_WRITER_OBJECT_POOL_H /* * This is a generic object pool to avoid memory allocation/deallocation @@ -165,4 +165,4 @@ void bt_ctf_object_pool_recycle_object(struct bt_ctf_object_pool *pool, void *ob #endif } -#endif /* BABELTRACE_CTF_WRITER_OBJECT_POOL_INTERNAL_H */ +#endif /* BABELTRACE_CTF_WRITER_OBJECT_POOL_H */ diff --git a/src/ctf-writer/object.h b/src/ctf-writer/object.h index 0f8eec4c..149e1658 100644 --- a/src/ctf-writer/object.h +++ b/src/ctf-writer/object.h @@ -4,8 +4,8 @@ * Copyright 2015 Jérémie Galarneau */ -#ifndef BABELTRACE_CTF_WRITER_OBJECT_INTERNAL_H -#define BABELTRACE_CTF_WRITER_OBJECT_INTERNAL_H +#ifndef BABELTRACE_CTF_WRITER_OBJECT_H +#define BABELTRACE_CTF_WRITER_OBJECT_H #include "common/macros.h" #include "common/assert.h" @@ -296,4 +296,4 @@ void bt_ctf_object_put_no_null_check(struct bt_ctf_object *obj) } } -#endif /* BABELTRACE_CTF_WRITER_OBJECT_INTERNAL_H */ +#endif /* BABELTRACE_CTF_WRITER_OBJECT_H */ diff --git a/src/ctf-writer/resolve.h b/src/ctf-writer/resolve.h index 7d72e934..15837bf6 100644 --- a/src/ctf-writer/resolve.h +++ b/src/ctf-writer/resolve.h @@ -5,8 +5,8 @@ * Copyright 2016 Philippe Proulx */ -#ifndef BABELTRACE_CTF_WRITER_RESOLVE_INTERNAL_H -#define BABELTRACE_CTF_WRITER_RESOLVE_INTERNAL_H +#ifndef BABELTRACE_CTF_WRITER_RESOLVE_H +#define BABELTRACE_CTF_WRITER_RESOLVE_H #include #include "common/macros.h" @@ -48,4 +48,4 @@ int bt_ctf_resolve_types(struct bt_ctf_private_value *environment, struct bt_ctf_field_type_common *event_payload_type, enum bt_ctf_resolve_flag flags); -#endif /* BABELTRACE_CTF_WRITER_RESOLVE_INTERNAL_H */ +#endif /* BABELTRACE_CTF_WRITER_RESOLVE_H */ diff --git a/src/ctf-writer/stream-class.h b/src/ctf-writer/stream-class.h index ab54ce73..1a8a0f17 100644 --- a/src/ctf-writer/stream-class.h +++ b/src/ctf-writer/stream-class.h @@ -7,8 +7,8 @@ * http://www.efficios.com/ctf */ -#ifndef BABELTRACE_CTF_WRITER_STREAM_CLASS_INTERNAL_H -#define BABELTRACE_CTF_WRITER_STREAM_CLASS_INTERNAL_H +#ifndef BABELTRACE_CTF_WRITER_STREAM_CLASS_H +#define BABELTRACE_CTF_WRITER_STREAM_CLASS_H #include "common/assert.h" #include "common/macros.h" @@ -508,4 +508,4 @@ int bt_ctf_stream_class_map_clock_class( struct bt_ctf_field_type *packet_context_type, struct bt_ctf_field_type *event_header_type); -#endif /* BABELTRACE_CTF_WRITER_STREAM_CLASS_INTERNAL_H */ +#endif /* BABELTRACE_CTF_WRITER_STREAM_CLASS_H */ diff --git a/src/ctf-writer/stream.h b/src/ctf-writer/stream.h index 605a3e55..f5817c50 100644 --- a/src/ctf-writer/stream.h +++ b/src/ctf-writer/stream.h @@ -7,8 +7,8 @@ * http://www.efficios.com/ctf */ -#ifndef BABELTRACE_CTF_WRITER_STREAM_INTERNAL_H -#define BABELTRACE_CTF_WRITER_STREAM_INTERNAL_H +#ifndef BABELTRACE_CTF_WRITER_STREAM_H +#define BABELTRACE_CTF_WRITER_STREAM_H #include "common/assert.h" #include "common/macros.h" @@ -84,4 +84,4 @@ struct bt_ctf_stream *bt_ctf_stream_create_with_id( struct bt_ctf_stream_class *stream_class, const char *name, uint64_t id); -#endif /* BABELTRACE_CTF_WRITER_STREAM_INTERNAL_H */ +#endif /* BABELTRACE_CTF_WRITER_STREAM_H */ diff --git a/src/ctf-writer/trace.h b/src/ctf-writer/trace.h index 29df2f42..eb751ea9 100644 --- a/src/ctf-writer/trace.h +++ b/src/ctf-writer/trace.h @@ -7,8 +7,8 @@ * http://www.efficios.com/ctf */ -#ifndef BABELTRACE_CTF_WRITER_TRACE_INTERNAL_H -#define BABELTRACE_CTF_WRITER_TRACE_INTERNAL_H +#ifndef BABELTRACE_CTF_WRITER_TRACE_H +#define BABELTRACE_CTF_WRITER_TRACE_H #include "common/macros.h" #include "common/uuid.h" @@ -350,4 +350,4 @@ bt_ctf_trace_get_environment_field_value_by_name( int bt_ctf_trace_visit(struct bt_ctf_trace *trace, bt_ctf_visitor visitor, void *data); -#endif /* BABELTRACE_CTF_WRITER_TRACE_INTERNAL_H */ +#endif /* BABELTRACE_CTF_WRITER_TRACE_H */ diff --git a/src/ctf-writer/utils.h b/src/ctf-writer/utils.h index 1ea5406a..4bd6bd68 100644 --- a/src/ctf-writer/utils.h +++ b/src/ctf-writer/utils.h @@ -4,8 +4,8 @@ * Copyright 2019 EfficiOS, Inc */ -#ifndef BABELTRACE_CTF_WRITER_UTILS_INTERNAL_H -#define BABELTRACE_CTF_WRITER_UTILS_INTERNAL_H +#ifndef BABELTRACE_CTF_WRITER_UTILS_H +#define BABELTRACE_CTF_WRITER_UTILS_H #include "common/macros.h" #include @@ -204,4 +204,4 @@ end: return str; } -#endif /* BABELTRACE_CTF_WRITER_UTILS_INTERNAL_H */ +#endif /* BABELTRACE_CTF_WRITER_UTILS_H */ diff --git a/src/ctf-writer/validation.h b/src/ctf-writer/validation.h index fef42a6d..0b93ddf9 100644 --- a/src/ctf-writer/validation.h +++ b/src/ctf-writer/validation.h @@ -4,8 +4,8 @@ * Copyright 2016 Philippe Proulx */ -#ifndef BABELTRACE_CTF_WRITER_VALIDATION_INTERNAL_H -#define BABELTRACE_CTF_WRITER_VALIDATION_INTERNAL_H +#ifndef BABELTRACE_CTF_WRITER_VALIDATION_H +#define BABELTRACE_CTF_WRITER_VALIDATION_H #include "common/macros.h" @@ -106,4 +106,4 @@ void bt_ctf_validation_replace_types(struct bt_ctf_trace_common *trace, void bt_ctf_validation_output_put_types( struct bt_ctf_validation_output *output); -#endif /* BABELTRACE_CTF_WRITER_VALIDATION_INTERNAL_H */ +#endif /* BABELTRACE_CTF_WRITER_VALIDATION_H */ diff --git a/src/ctf-writer/values.h b/src/ctf-writer/values.h index ad29a9fb..e752c475 100644 --- a/src/ctf-writer/values.h +++ b/src/ctf-writer/values.h @@ -5,8 +5,8 @@ * Copyright (c) 2015-2017 Philippe Proulx */ -#ifndef BABELTRACE_CTF_WRITER_VALUES_INTERNAL_H -#define BABELTRACE_CTF_WRITER_VALUES_INTERNAL_H +#ifndef BABELTRACE_CTF_WRITER_VALUES_H +#define BABELTRACE_CTF_WRITER_VALUES_H #include @@ -293,4 +293,4 @@ const char *bt_ctf_value_type_string(enum bt_ctf_value_type type) } }; -#endif /* BABELTRACE_CTF_WRITER_VALUES_INTERNAL_H */ +#endif /* BABELTRACE_CTF_WRITER_VALUES_H */ diff --git a/src/ctf-writer/visitor.h b/src/ctf-writer/visitor.h index bdbf2283..93375259 100644 --- a/src/ctf-writer/visitor.h +++ b/src/ctf-writer/visitor.h @@ -4,8 +4,8 @@ * Copyright 2016 Jérémie Galarneau */ -#ifndef BABELTRACE_CTF_WRITER_VISITOR_INTERNAL_H -#define BABELTRACE_CTF_WRITER_VISITOR_INTERNAL_H +#ifndef BABELTRACE_CTF_WRITER_VISITOR_H +#define BABELTRACE_CTF_WRITER_VISITOR_H #include #include @@ -29,4 +29,4 @@ int bt_ctf_visitor_helper(struct bt_ctf_visitor_object *root, bt_ctf_visitor visitor, void *data); -#endif /* BABELTRACE_CTF_WRITER_VISITOR_INTERNAL_H */ +#endif /* BABELTRACE_CTF_WRITER_VISITOR_H */ diff --git a/src/ctf-writer/writer.h b/src/ctf-writer/writer.h index 24c92c36..e99bb4da 100644 --- a/src/ctf-writer/writer.h +++ b/src/ctf-writer/writer.h @@ -4,8 +4,8 @@ * Copyright 2013, 2014 Jérémie Galarneau */ -#ifndef BABELTRACE_CTF_WRITER_WRITER_INTERNAL_H -#define BABELTRACE_CTF_WRITER_WRITER_INTERNAL_H +#ifndef BABELTRACE_CTF_WRITER_WRITER_H +#define BABELTRACE_CTF_WRITER_WRITER_H #include #include @@ -48,4 +48,4 @@ const char *bt_ctf_get_byte_order_string(enum bt_ctf_byte_order byte_order); void bt_ctf_writer_freeze(struct bt_ctf_writer *writer); -#endif /* BABELTRACE_CTF_WRITER_WRITER_INTERNAL_H */ +#endif /* BABELTRACE_CTF_WRITER_WRITER_H */ diff --git a/src/ctfser/ctfser.h b/src/ctfser/ctfser.h index 33d48d20..20f8bded 100644 --- a/src/ctfser/ctfser.h +++ b/src/ctfser/ctfser.h @@ -9,8 +9,8 @@ * http://www.efficios.com/ctf */ -#ifndef BABELTRACE_CTFSER_INTERNAL_H -#define BABELTRACE_CTFSER_INTERNAL_H +#ifndef BABELTRACE_CTFSER_CTFSER_H +#define BABELTRACE_CTFSER_CTFSER_H #include #include @@ -562,4 +562,4 @@ const char *bt_ctfser_get_file_path(struct bt_ctfser *ctfser) return ctfser->path->str; } -#endif /* BABELTRACE_CTFSER_INTERNAL_H */ +#endif /* BABELTRACE_CTFSER_CTFSER_H */ diff --git a/src/fd-cache/fd-cache.h b/src/fd-cache/fd-cache.h index 9a04bb47..6d1e4c10 100644 --- a/src/fd-cache/fd-cache.h +++ b/src/fd-cache/fd-cache.h @@ -6,8 +6,8 @@ * Babeltrace - File descriptor cache */ -#ifndef BABELTRACE_FD_CACHE_INTERNAL_H -#define BABELTRACE_FD_CACHE_INTERNAL_H +#ifndef BABELTRACE_FD_CACHE_FD_CACHE_H +#define BABELTRACE_FD_CACHE_FD_CACHE_H #include "common/macros.h" @@ -36,4 +36,4 @@ struct bt_fd_cache_handle *bt_fd_cache_get_handle(struct bt_fd_cache *fdc, void bt_fd_cache_put_handle(struct bt_fd_cache *fdc, struct bt_fd_cache_handle *handle); -#endif /* BABELTRACE_FD_CACHE_INTERNAL_H */ +#endif /* BABELTRACE_FD_CACHE_FD_CACHE_H */ diff --git a/src/lib/assert-cond-base.h b/src/lib/assert-cond-base.h index c8d04b63..a2dc3c5b 100644 --- a/src/lib/assert-cond-base.h +++ b/src/lib/assert-cond-base.h @@ -5,8 +5,8 @@ * Copyright (c) 2018-2020 Philippe Proulx */ -#ifndef BABELTRACE_ASSERT_COND_BASE_INTERNAL_H -#define BABELTRACE_ASSERT_COND_BASE_INTERNAL_H +#ifndef BABELTRACE_LIB_ASSERT_COND_BASE_H +#define BABELTRACE_LIB_ASSERT_COND_BASE_H /* * The macros in this header use macros defined in "lib/logging.h". We @@ -165,4 +165,4 @@ void bt_lib_assert_cond_failed(const char *cond_type, const char *func, */ #define BT_ASSERT_COND_SUPPORTED -#endif /* BABELTRACE_ASSERT_COND_BASE_INTERNAL_H */ +#endif /* BABELTRACE_LIB_ASSERT_COND_BASE_H */ diff --git a/src/lib/assert-cond.h b/src/lib/assert-cond.h index 4868c48c..993edcc9 100644 --- a/src/lib/assert-cond.h +++ b/src/lib/assert-cond.h @@ -5,8 +5,8 @@ * Copyright (c) 2018-2020 Philippe Proulx */ -#ifndef BABELTRACE_ASSERT_COND_INTERNAL_H -#define BABELTRACE_ASSERT_COND_INTERNAL_H +#ifndef BABELTRACE_LIB_ASSERT_COND_H +#define BABELTRACE_LIB_ASSERT_COND_H #include "assert-cond-base.h" @@ -1270,4 +1270,4 @@ BT_ASSERT_PRE_DEV_NON_NULL(_BT_ASSERT_PRE_KEY_ID, (_key), \ _BT_ASSERT_PRE_KEY_NAME) -#endif /* BABELTRACE_ASSERT_COND_INTERNAL_H */ +#endif /* BABELTRACE_LIB_ASSERT_COND_H */ diff --git a/src/lib/error.h b/src/lib/error.h index 39788185..41bf7101 100644 --- a/src/lib/error.h +++ b/src/lib/error.h @@ -4,8 +4,8 @@ * Copyright (c) 2019 Philippe Proulx */ -#ifndef BABELTRACE_ERROR_INTERNAL_H -#define BABELTRACE_ERROR_INTERNAL_H +#ifndef BABELTRACE_LIB_ERROR_H +#define BABELTRACE_LIB_ERROR_H #include #include @@ -97,4 +97,4 @@ int bt_error_append_cause_from_message_iterator( const char *file_name, uint64_t line_no, const char *msg_fmt, va_list args); -#endif /* BABELTRACE_ERROR_INTERNAL_H */ +#endif /* BABELTRACE_LIB_ERROR_H */ diff --git a/src/lib/func-status.h b/src/lib/func-status.h index 1da2097b..0f366cab 100644 --- a/src/lib/func-status.h +++ b/src/lib/func-status.h @@ -4,8 +4,8 @@ * Copyright (c) 2019 Philippe Proulx */ -#ifndef BABELTRACE_FUNC_STATUS_INTERNAL_H -#define BABELTRACE_FUNC_STATUS_INTERNAL_H +#ifndef BABELTRACE_LIB_FUNC_STATUS_H +#define BABELTRACE_LIB_FUNC_STATUS_H #define __BT_IN_BABELTRACE_H #include @@ -26,4 +26,4 @@ #define BT_FUNC_STATUS_OK __BT_FUNC_STATUS_OK #define BT_FUNC_STATUS_OVERFLOW_ERROR __BT_FUNC_STATUS_OVERFLOW_ERROR -#endif /* BABELTRACE_FUNC_STATUS_INTERNAL_H */ +#endif /* BABELTRACE_LIB_FUNC_STATUS_H */ diff --git a/src/lib/graph/component-class-sink-simple.h b/src/lib/graph/component-class-sink-simple.h index 7143da96..ce490178 100644 --- a/src/lib/graph/component-class-sink-simple.h +++ b/src/lib/graph/component-class-sink-simple.h @@ -4,8 +4,8 @@ * Copyright 2017-2019 Philippe Proulx */ -#ifndef BABELTRACE_GRAPH_COMPONENT_CLASS_SINK_SIMPLE_H -#define BABELTRACE_GRAPH_COMPONENT_CLASS_SINK_SIMPLE_H +#ifndef BABELTRACE_LIB_GRAPH_COMPONENT_CLASS_SINK_SIMPLE_H +#define BABELTRACE_LIB_GRAPH_COMPONENT_CLASS_SINK_SIMPLE_H #include #include @@ -19,4 +19,4 @@ struct simple_sink_init_method_data { struct bt_component_class_sink *bt_component_class_sink_simple_borrow(void); -#endif /* BABELTRACE_GRAPH_COMPONENT_CLASS_SINK_SIMPLE_H */ +#endif /* BABELTRACE_LIB_GRAPH_COMPONENT_CLASS_SINK_SIMPLE_H */ diff --git a/src/lib/graph/component-class.h b/src/lib/graph/component-class.h index c6a69e57..b8ce3ccf 100644 --- a/src/lib/graph/component-class.h +++ b/src/lib/graph/component-class.h @@ -5,8 +5,8 @@ * Copyright 2015 Jérémie Galarneau */ -#ifndef BABELTRACE_GRAPH_COMPONENT_CLASS_INTERNAL_H -#define BABELTRACE_GRAPH_COMPONENT_CLASS_INTERNAL_H +#ifndef BABELTRACE_LIB_GRAPH_COMPONENT_CLASS_H +#define BABELTRACE_LIB_GRAPH_COMPONENT_CLASS_H #include #include @@ -103,4 +103,4 @@ bool bt_component_class_has_message_iterator_class( component_class->type == BT_COMPONENT_CLASS_TYPE_FILTER; } -#endif /* BABELTRACE_GRAPH_COMPONENT_CLASS_INTERNAL_H */ +#endif /* BABELTRACE_LIB_GRAPH_COMPONENT_CLASS_H */ diff --git a/src/lib/graph/component-descriptor-set.h b/src/lib/graph/component-descriptor-set.h index fdc90f46..77f7459f 100644 --- a/src/lib/graph/component-descriptor-set.h +++ b/src/lib/graph/component-descriptor-set.h @@ -5,8 +5,8 @@ * Copyright 2017 Jérémie Galarneau */ -#ifndef BABELTRACE_GRAPH_COMPONENT_DESCRIPTOR_SET_INTERNAL_H -#define BABELTRACE_GRAPH_COMPONENT_DESCRIPTOR_SET_INTERNAL_H +#ifndef BABELTRACE_LIB_GRAPH_COMPONENT_DESCRIPTOR_SET_H +#define BABELTRACE_LIB_GRAPH_COMPONENT_DESCRIPTOR_SET_H #include #include @@ -39,4 +39,4 @@ struct bt_component_descriptor_set { GPtrArray *sinks; }; -#endif /* BABELTRACE_GRAPH_COMPONENT_DESCRIPTOR_SET_INTERNAL_H */ +#endif /* BABELTRACE_LIB_GRAPH_COMPONENT_DESCRIPTOR_SET_H */ diff --git a/src/lib/graph/component-filter.h b/src/lib/graph/component-filter.h index 83089191..53f7ed8f 100644 --- a/src/lib/graph/component-filter.h +++ b/src/lib/graph/component-filter.h @@ -5,8 +5,8 @@ * Copyright 2016 Jérémie Galarneau */ -#ifndef BABELTRACE_GRAPH_COMPONENT_FILTER_INTERNAL_H -#define BABELTRACE_GRAPH_COMPONENT_FILTER_INTERNAL_H +#ifndef BABELTRACE_LIB_GRAPH_COMPONENT_FILTER_H +#define BABELTRACE_LIB_GRAPH_COMPONENT_FILTER_H #include @@ -18,4 +18,4 @@ struct bt_component_filter { struct bt_component *bt_component_filter_create(void); -#endif /* BABELTRACE_GRAPH_COMPONENT_FILTER_INTERNAL_H */ +#endif /* BABELTRACE_LIB_GRAPH_COMPONENT_FILTER_H */ diff --git a/src/lib/graph/component-sink.h b/src/lib/graph/component-sink.h index 2c4569c0..69aa48e4 100644 --- a/src/lib/graph/component-sink.h +++ b/src/lib/graph/component-sink.h @@ -5,8 +5,8 @@ * Copyright 2015 Jérémie Galarneau */ -#ifndef BABELTRACE_GRAPH_COMPONENT_SINK_INTERNAL_H -#define BABELTRACE_GRAPH_COMPONENT_SINK_INTERNAL_H +#ifndef BABELTRACE_LIB_GRAPH_COMPONENT_SINK_H +#define BABELTRACE_LIB_GRAPH_COMPONENT_SINK_H #include @@ -22,4 +22,4 @@ struct bt_component_sink { struct bt_component *bt_component_sink_create(void); -#endif /* BABELTRACE_GRAPH_COMPONENT_SINK_INTERNAL_H */ +#endif /* BABELTRACE_LIB_GRAPH_COMPONENT_SINK_H */ diff --git a/src/lib/graph/component-source.h b/src/lib/graph/component-source.h index c91ebda4..6b0333db 100644 --- a/src/lib/graph/component-source.h +++ b/src/lib/graph/component-source.h @@ -5,8 +5,8 @@ * Copyright 2015 Jérémie Galarneau */ -#ifndef BABELTRACE_GRAPH_COMPONENT_SOURCE_INTERNAL_H -#define BABELTRACE_GRAPH_COMPONENT_SOURCE_INTERNAL_H +#ifndef BABELTRACE_LIB_GRAPH_COMPONENT_SOURCE_H +#define BABELTRACE_LIB_GRAPH_COMPONENT_SOURCE_H #include "component.h" @@ -16,4 +16,4 @@ struct bt_component_source { struct bt_component *bt_component_source_create(void); -#endif /* BABELTRACE_GRAPH_COMPONENT_SOURCE_INTERNAL_H */ +#endif /* BABELTRACE_LIB_GRAPH_COMPONENT_SOURCE_H */ diff --git a/src/lib/graph/component.h b/src/lib/graph/component.h index 401cc385..dbe1f1ff 100644 --- a/src/lib/graph/component.h +++ b/src/lib/graph/component.h @@ -5,8 +5,8 @@ * Copyright 2015 Jérémie Galarneau */ -#ifndef BABELTRACE_GRAPH_COMPONENT_INTERNAL_H -#define BABELTRACE_GRAPH_COMPONENT_INTERNAL_H +#ifndef BABELTRACE_LIB_GRAPH_COMPONENT_H +#define BABELTRACE_LIB_GRAPH_COMPONENT_H #include #include @@ -109,4 +109,4 @@ void bt_component_add_destroy_listener(struct bt_component *component, void bt_component_remove_destroy_listener(struct bt_component *component, bt_component_destroy_listener_func func, void *data); -#endif /* BABELTRACE_GRAPH_COMPONENT_INTERNAL_H */ +#endif /* BABELTRACE_LIB_GRAPH_COMPONENT_H */ diff --git a/src/lib/graph/connection.h b/src/lib/graph/connection.h index cc512e1f..18c586dd 100644 --- a/src/lib/graph/connection.h +++ b/src/lib/graph/connection.h @@ -5,8 +5,8 @@ * Copyright 2017 Jérémie Galarneau */ -#ifndef BABELTRACE_GRAPH_CONNECTION_INTERNAL_H -#define BABELTRACE_GRAPH_CONNECTION_INTERNAL_H +#ifndef BABELTRACE_LIB_GRAPH_CONNECTION_H +#define BABELTRACE_LIB_GRAPH_CONNECTION_H #include #include "lib/object.h" @@ -60,4 +60,4 @@ struct bt_graph *bt_connection_borrow_graph(struct bt_connection *conn) return (void *) conn->base.parent; } -#endif /* BABELTRACE_GRAPH_CONNECTION_INTERNAL_H */ +#endif /* BABELTRACE_LIB_GRAPH_CONNECTION_H */ diff --git a/src/lib/graph/graph.h b/src/lib/graph/graph.h index 01dfaec6..efc96991 100644 --- a/src/lib/graph/graph.h +++ b/src/lib/graph/graph.h @@ -5,8 +5,8 @@ * Copyright 2017 Jérémie Galarneau */ -#ifndef BABELTRACE_GRAPH_GRAPH_INTERNAL_H -#define BABELTRACE_GRAPH_GRAPH_INTERNAL_H +#ifndef BABELTRACE_LIB_GRAPH_GRAPH_H +#define BABELTRACE_LIB_GRAPH_GRAPH_H /* Protection: this file uses BT_LIB_LOG*() macros directly */ #ifndef BT_LIB_LOG_SUPPORTED @@ -172,4 +172,4 @@ void bt_graph_make_faulty(struct bt_graph *graph) BT_LIB_LOGI("Set graph's state to faulty: %![graph-]+g", graph); } -#endif /* BABELTRACE_GRAPH_GRAPH_INTERNAL_H */ +#endif /* BABELTRACE_LIB_GRAPH_GRAPH_H */ diff --git a/src/lib/graph/interrupter.h b/src/lib/graph/interrupter.h index 72b93288..fa533201 100644 --- a/src/lib/graph/interrupter.h +++ b/src/lib/graph/interrupter.h @@ -4,8 +4,8 @@ * Copyright (c) 2019 Philippe Proulx */ -#ifndef BABELTRACE_GRAPH_INTERRUPTER_INTERNAL_H -#define BABELTRACE_GRAPH_INTERRUPTER_INTERNAL_H +#ifndef BABELTRACE_LIB_GRAPH_INTERRUPTER_H +#define BABELTRACE_LIB_GRAPH_INTERRUPTER_H #include @@ -40,4 +40,4 @@ end: return is_set; } -#endif /* BABELTRACE_GRAPH_INTERRUPTER_INTERNAL_H */ +#endif /* BABELTRACE_LIB_GRAPH_INTERRUPTER_H */ diff --git a/src/lib/graph/iterator.h b/src/lib/graph/iterator.h index e508dc2b..5c7ea912 100644 --- a/src/lib/graph/iterator.h +++ b/src/lib/graph/iterator.h @@ -5,8 +5,8 @@ * Copyright 2015 Jérémie Galarneau */ -#ifndef BABELTRACE_GRAPH_MESSAGE_ITERATOR_INTERNAL_H -#define BABELTRACE_GRAPH_MESSAGE_ITERATOR_INTERNAL_H +#ifndef BABELTRACE_LIB_GRAPH_ITERATOR_H +#define BABELTRACE_LIB_GRAPH_ITERATOR_H #include "common/macros.h" #include "lib/object.h" @@ -189,4 +189,4 @@ const char *bt_message_iterator_state_string( } }; -#endif /* BABELTRACE_GRAPH_MESSAGE_ITERATOR_INTERNAL_H */ +#endif /* BABELTRACE_LIB_GRAPH_ITERATOR_H */ diff --git a/src/lib/graph/message-iterator-class.h b/src/lib/graph/message-iterator-class.h index 0606aa72..d8625d76 100644 --- a/src/lib/graph/message-iterator-class.h +++ b/src/lib/graph/message-iterator-class.h @@ -5,8 +5,8 @@ * Copyright 2015 Jérémie Galarneau */ -#ifndef BABELTRACE_GRAPH_MESSAGE_ITERATOR_CLASS_INTERNAL_H -#define BABELTRACE_GRAPH_MESSAGE_ITERATOR_CLASS_INTERNAL_H +#ifndef BABELTRACE_LIB_GRAPH_MESSAGE_ITERATOR_CLASS_H +#define BABELTRACE_LIB_GRAPH_MESSAGE_ITERATOR_CLASS_H #include #include @@ -38,4 +38,4 @@ void _bt_message_iterator_class_freeze( # define bt_message_iterator_class_freeze(_cls) #endif -#endif /* BABELTRACE_GRAPH_MESSAGE_ITERATOR_CLASS_INTERNAL_H */ +#endif /* BABELTRACE_LIB_GRAPH_MESSAGE_ITERATOR_CLASS_H */ diff --git a/src/lib/graph/message/discarded-items.h b/src/lib/graph/message/discarded-items.h index fe3416b1..5809a41d 100644 --- a/src/lib/graph/message/discarded-items.h +++ b/src/lib/graph/message/discarded-items.h @@ -4,8 +4,8 @@ * Copyright 2019 Philippe Proulx */ -#ifndef BABELTRACE_GRAPH_MESSAGE_DISCARDED_ITEMS_INTERNAL_H -#define BABELTRACE_GRAPH_MESSAGE_DISCARDED_ITEMS_INTERNAL_H +#ifndef BABELTRACE_LIB_GRAPH_MESSAGE_DISCARDED_ITEMS_H +#define BABELTRACE_LIB_GRAPH_MESSAGE_DISCARDED_ITEMS_H #include #include "lib/trace-ir/clock-snapshot.h" @@ -23,4 +23,4 @@ struct bt_message_discarded_items { struct bt_property_uint count; }; -#endif /* BABELTRACE_GRAPH_MESSAGE_DISCARDED_ITEMS_INTERNAL_H */ +#endif /* BABELTRACE_LIB_GRAPH_MESSAGE_DISCARDED_ITEMS_H */ diff --git a/src/lib/graph/message/event.h b/src/lib/graph/message/event.h index 98d4acf1..68cf1e7f 100644 --- a/src/lib/graph/message/event.h +++ b/src/lib/graph/message/event.h @@ -5,8 +5,8 @@ * Copyright 2016 Jérémie Galarneau */ -#ifndef BABELTRACE_GRAPH_MESSAGE_EVENT_INTERNAL_H -#define BABELTRACE_GRAPH_MESSAGE_EVENT_INTERNAL_H +#ifndef BABELTRACE_LIB_GRAPH_MESSAGE_EVENT_H +#define BABELTRACE_LIB_GRAPH_MESSAGE_EVENT_H #include "compat/compiler.h" #include @@ -34,4 +34,4 @@ void bt_message_event_destroy(struct bt_message *msg); } #endif -#endif /* BABELTRACE_GRAPH_MESSAGE_EVENT_INTERNAL_H */ +#endif /* BABELTRACE_LIB_GRAPH_MESSAGE_EVENT_H */ diff --git a/src/lib/graph/message/message-iterator-inactivity.h b/src/lib/graph/message/message-iterator-inactivity.h index 7cd1a7de..28cf7a2b 100644 --- a/src/lib/graph/message/message-iterator-inactivity.h +++ b/src/lib/graph/message/message-iterator-inactivity.h @@ -4,8 +4,8 @@ * Copyright 2017-2018 Philippe Proulx */ -#ifndef BABELTRACE_GRAPH_MESSAGE_MESSAGE_ITERATOR_INACTIVITY_INTERNAL_H -#define BABELTRACE_GRAPH_MESSAGE_MESSAGE_ITERATOR_INACTIVITY_INTERNAL_H +#ifndef BABELTRACE_LIB_GRAPH_MESSAGE_MESSAGE_ITERATOR_INACTIVITY_H +#define BABELTRACE_LIB_GRAPH_MESSAGE_MESSAGE_ITERATOR_INACTIVITY_H #include #include "lib/trace-ir/clock-snapshot.h" @@ -16,4 +16,4 @@ struct bt_message_message_iterator_inactivity { struct bt_clock_snapshot *cs; }; -#endif /* BABELTRACE_GRAPH_MESSAGE_MESSAGE_ITERATOR_INACTIVITY_INTERNAL_H */ +#endif /* BABELTRACE_LIB_GRAPH_MESSAGE_MESSAGE_ITERATOR_INACTIVITY_H */ diff --git a/src/lib/graph/message/message.h b/src/lib/graph/message/message.h index d6ba358a..3f749694 100644 --- a/src/lib/graph/message/message.h +++ b/src/lib/graph/message/message.h @@ -5,8 +5,8 @@ * Copyright 2015 Jérémie Galarneau */ -#ifndef BABELTRACE_GRAPH_MESSAGE_MESSAGE_INTERNAL_H -#define BABELTRACE_GRAPH_MESSAGE_MESSAGE_INTERNAL_H +#ifndef BABELTRACE_LIB_GRAPH_MESSAGE_MESSAGE_H +#define BABELTRACE_LIB_GRAPH_MESSAGE_MESSAGE_H /* Protection: this file uses BT_LIB_LOG*() macros directly */ #ifndef BT_LIB_LOG_SUPPORTED @@ -92,4 +92,4 @@ void bt_message_unlink_graph(struct bt_message *msg); # define bt_message_freeze(_x) #endif /* BT_DEV_MODE */ -#endif /* BABELTRACE_GRAPH_MESSAGE_MESSAGE_INTERNAL_H */ +#endif /* BABELTRACE_LIB_GRAPH_MESSAGE_MESSAGE_H */ diff --git a/src/lib/graph/message/packet.h b/src/lib/graph/message/packet.h index 632aaeea..451546b7 100644 --- a/src/lib/graph/message/packet.h +++ b/src/lib/graph/message/packet.h @@ -5,8 +5,8 @@ * Copyright 2016 Jérémie Galarneau */ -#ifndef BABELTRACE_GRAPH_MESSAGE_PACKET_INTERNAL_H -#define BABELTRACE_GRAPH_MESSAGE_PACKET_INTERNAL_H +#ifndef BABELTRACE_LIB_GRAPH_MESSAGE_PACKET_H +#define BABELTRACE_LIB_GRAPH_MESSAGE_PACKET_H #include "compat/compiler.h" #include @@ -30,4 +30,4 @@ struct bt_message *bt_message_packet_end_new(struct bt_graph *graph); void bt_message_packet_end_recycle(struct bt_message *msg); -#endif /* BABELTRACE_GRAPH_MESSAGE_PACKET_INTERNAL_H */ +#endif /* BABELTRACE_LIB_GRAPH_MESSAGE_PACKET_H */ diff --git a/src/lib/graph/message/stream.h b/src/lib/graph/message/stream.h index c90476db..46af8291 100644 --- a/src/lib/graph/message/stream.h +++ b/src/lib/graph/message/stream.h @@ -5,8 +5,8 @@ * Copyright 2016 Jérémie Galarneau */ -#ifndef BABELTRACE_GRAPH_MESSAGE_STREAM_INTERNAL_H -#define BABELTRACE_GRAPH_MESSAGE_STREAM_INTERNAL_H +#ifndef BABELTRACE_LIB_GRAPH_MESSAGE_STREAM_H +#define BABELTRACE_LIB_GRAPH_MESSAGE_STREAM_H #include @@ -38,4 +38,4 @@ const char *bt_message_stream_clock_snapshot_state_string( } -#endif /* BABELTRACE_GRAPH_MESSAGE_STREAM_INTERNAL_H */ +#endif /* BABELTRACE_LIB_GRAPH_MESSAGE_STREAM_H */ diff --git a/src/lib/graph/port.h b/src/lib/graph/port.h index 4a84db1c..7032e52a 100644 --- a/src/lib/graph/port.h +++ b/src/lib/graph/port.h @@ -5,8 +5,8 @@ * Copyright 2017 Jérémie Galarneau */ -#ifndef BABELTRACE_GRAPH_PORT_INTERNAL_H -#define BABELTRACE_GRAPH_PORT_INTERNAL_H +#ifndef BABELTRACE_LIB_GRAPH_PORT_H +#define BABELTRACE_LIB_GRAPH_PORT_H #include @@ -46,4 +46,4 @@ const char *bt_port_type_string(enum bt_port_type port_type) } } -#endif /* BABELTRACE_GRAPH_PORT_INTERNAL_H */ +#endif /* BABELTRACE_LIB_GRAPH_PORT_H */ diff --git a/src/lib/graph/query-executor.h b/src/lib/graph/query-executor.h index d14de9a1..eed1da31 100644 --- a/src/lib/graph/query-executor.h +++ b/src/lib/graph/query-executor.h @@ -4,8 +4,8 @@ * Copyright 2017-2018 Philippe Proulx */ -#ifndef BABELTRACE_GRAPH_QUERY_EXECUTOR_INTERNAL_H -#define BABELTRACE_GRAPH_QUERY_EXECUTOR_INTERNAL_H +#ifndef BABELTRACE_LIB_GRAPH_QUERY_EXECUTOR_H +#define BABELTRACE_LIB_GRAPH_QUERY_EXECUTOR_H #include @@ -44,4 +44,4 @@ struct bt_query_executor { enum bt_logging_level log_level; }; -#endif /* BABELTRACE_GRAPH_QUERY_EXECUTOR_INTERNAL_H */ +#endif /* BABELTRACE_LIB_GRAPH_QUERY_EXECUTOR_H */ diff --git a/src/lib/integer-range-set.h b/src/lib/integer-range-set.h index c53a7849..7dcc8557 100644 --- a/src/lib/integer-range-set.h +++ b/src/lib/integer-range-set.h @@ -7,8 +7,8 @@ * http://www.efficios.com/ctf */ -#ifndef BABELTRACE_INTEGER_RANGE_SET_INTERNAL_H -#define BABELTRACE_INTEGER_RANGE_SET_INTERNAL_H +#ifndef BABELTRACE_LIB_INTEGER_RANGE_SET_H +#define BABELTRACE_LIB_INTEGER_RANGE_SET_H #include #include @@ -53,4 +53,4 @@ bool bt_integer_range_set_unsigned_has_overlaps( bool bt_integer_range_set_signed_has_overlaps( const struct bt_integer_range_set *range_set); -#endif /* BABELTRACE_INTEGER_RANGE_SET_INTERNAL_H */ +#endif /* BABELTRACE_LIB_INTEGER_RANGE_SET_H */ diff --git a/src/lib/lib-logging.c b/src/lib/lib-logging.c index a22e000f..6d98a0ce 100644 --- a/src/lib/lib-logging.c +++ b/src/lib/lib-logging.c @@ -497,8 +497,8 @@ static inline void format_trace(char **buf_ch, bool extended, { char tmp_prefix[TMP_PREFIX_LEN]; - if (trace->name.value) { - BUF_APPEND(", %sname=\"%s\"", PRFIELD(trace->name.value)); + if (trace->name) { + BUF_APPEND(", %sname=\"%s\"", PRFIELD(trace->name)); } if (!extended) { @@ -534,9 +534,9 @@ static inline void format_stream_class(char **buf_ch, bool extended, BUF_APPEND(", %sid=%" PRIu64, PRFIELD(stream_class->id)); - if (stream_class->name.value) { + if (stream_class->name) { BUF_APPEND(", %sname=\"%s\"", - PRFIELD(stream_class->name.value)); + PRFIELD(stream_class->name)); } if (!extended) { @@ -593,9 +593,9 @@ static inline void format_event_class(char **buf_ch, bool extended, BUF_APPEND(", %sid=%" PRIu64, PRFIELD(event_class->id)); - if (event_class->name.value) { + if (event_class->name) { BUF_APPEND(", %sname=\"%s\"", - PRFIELD(event_class->name.value)); + PRFIELD(event_class->name)); } if (!extended) { @@ -610,9 +610,9 @@ static inline void format_event_class(char **buf_ch, bool extended, (int) event_class->log_level.value))); } - if (event_class->emf_uri.value) { + if (event_class->emf_uri) { BUF_APPEND(", %semf-uri=\"%s\"", - PRFIELD(event_class->emf_uri.value)); + PRFIELD(event_class->emf_uri)); } BUF_APPEND(", %sspecific-context-fc-addr=%p, %spayload-fc-addr=%p", @@ -649,8 +649,8 @@ static inline void format_stream(char **buf_ch, bool extended, BUF_APPEND(", %sid=%" PRIu64, PRFIELD(stream->id)); - if (stream->name.value) { - BUF_APPEND(", %sname=\"%s\"", PRFIELD(stream->name.value)); + if (stream->name) { + BUF_APPEND(", %sname=\"%s\"", PRFIELD(stream->name)); } if (!extended) { @@ -777,8 +777,8 @@ static inline void format_clock_class(char **buf_ch, bool extended, { char tmp_prefix[TMP_PREFIX_LEN]; - if (clock_class->name.value) { - BUF_APPEND(", %sname=\"%s\"", PRFIELD(clock_class->name.value)); + if (clock_class->name) { + BUF_APPEND(", %sname=\"%s\"", PRFIELD(clock_class->name)); } BUF_APPEND(", %sfreq=%" PRIu64, PRFIELD(clock_class->frequency)); @@ -787,9 +787,9 @@ static inline void format_clock_class(char **buf_ch, bool extended, return; } - if (clock_class->description.value) { + if (clock_class->description) { BUF_APPEND(", %spartial-descr=\"%.32s\"", - PRFIELD(clock_class->description.value)); + PRFIELD(clock_class->description)); } if (clock_class->uuid.value) { diff --git a/src/lib/logging.h b/src/lib/logging.h index aa4fc5e5..669b41bc 100644 --- a/src/lib/logging.h +++ b/src/lib/logging.h @@ -4,8 +4,8 @@ * Copyright 2017-2018 Philippe Proulx */ -#ifndef BABELTRACE_LIB_LOGGING_INTERNAL_H -#define BABELTRACE_LIB_LOGGING_INTERNAL_H +#ifndef BABELTRACE_LIB_LOGGING_H +#define BABELTRACE_LIB_LOGGING_H #include @@ -86,4 +86,4 @@ void bt_lib_maybe_log_and_append_cause(const char *func, const char *file, #define BT_LIB_LOG_SUPPORTED -#endif /* BABELTRACE_LIB_LOGGING_INTERNAL_H */ +#endif /* BABELTRACE_LIB_LOGGING_H */ diff --git a/src/lib/object-pool.h b/src/lib/object-pool.h index e0501daf..c1558de1 100644 --- a/src/lib/object-pool.h +++ b/src/lib/object-pool.h @@ -4,8 +4,8 @@ * Copyright (c) 2018 Philippe Proulx */ -#ifndef BABELTRACE_OBJECT_POOL_INTERNAL_H -#define BABELTRACE_OBJECT_POOL_INTERNAL_H +#ifndef BABELTRACE_LIB_OBJECT_POOL_H +#define BABELTRACE_LIB_OBJECT_POOL_H /* * This is a generic object pool to avoid memory allocation/deallocation @@ -151,4 +151,4 @@ void bt_object_pool_recycle_object(struct bt_object_pool *pool, void *obj) pool, pool->size, pool->objects->len, obj); } -#endif /* BABELTRACE_OBJECT_POOL_INTERNAL_H */ +#endif /* BABELTRACE_LIB_OBJECT_POOL_H */ diff --git a/src/lib/object.h b/src/lib/object.h index 6531394a..94b6e807 100644 --- a/src/lib/object.h +++ b/src/lib/object.h @@ -5,8 +5,8 @@ * Copyright 2015 Jérémie Galarneau */ -#ifndef BABELTRACE_OBJECT_INTERNAL_H -#define BABELTRACE_OBJECT_INTERNAL_H +#ifndef BABELTRACE_LIB_OBJECT_H +#define BABELTRACE_LIB_OBJECT_H #include "common/assert.h" #include @@ -347,4 +347,4 @@ void bt_object_put_ref(const void *ptr) (_var_src) = NULL; \ } while (0) -#endif /* BABELTRACE_OBJECT_INTERNAL_H */ +#endif /* BABELTRACE_LIB_OBJECT_H */ diff --git a/src/lib/plugin/plugin-so.h b/src/lib/plugin/plugin-so.h index 7d663e20..525fe424 100644 --- a/src/lib/plugin/plugin-so.h +++ b/src/lib/plugin/plugin-so.h @@ -5,8 +5,8 @@ * Copyright 2016 Jérémie Galarneau */ -#ifndef BABELTRACE_PLUGIN_PLUGIN_SO_INTERNAL_H -#define BABELTRACE_PLUGIN_PLUGIN_SO_INTERNAL_H +#ifndef BABELTRACE_LIB_PLUGIN_PLUGIN_SO_H +#define BABELTRACE_LIB_PLUGIN_PLUGIN_SO_H #include #include @@ -45,4 +45,4 @@ int bt_plugin_so_create_all_from_static(bool fail_on_load_error, void bt_plugin_so_on_add_component_class(struct bt_plugin *plugin, struct bt_component_class *comp_class); -#endif /* BABELTRACE_PLUGIN_PLUGIN_SO_INTERNAL_H */ +#endif /* BABELTRACE_LIB_PLUGIN_PLUGIN_SO_H */ diff --git a/src/lib/plugin/plugin.h b/src/lib/plugin/plugin.h index 60db3aaa..a186e022 100644 --- a/src/lib/plugin/plugin.h +++ b/src/lib/plugin/plugin.h @@ -5,8 +5,8 @@ * Copyright 2015 Jérémie Galarneau */ -#ifndef BABELTRACE_PLUGIN_PLUGIN_INTERNAL_H -#define BABELTRACE_PLUGIN_PLUGIN_INTERNAL_H +#ifndef BABELTRACE_LIB_PLUGIN_PLUGIN_H +#define BABELTRACE_LIB_PLUGIN_PLUGIN_H #include "common/common.h" #include "lib/graph/component-class.h" @@ -446,4 +446,4 @@ end: return; } -#endif /* BABELTRACE_PLUGIN_PLUGIN_INTERNAL_H */ +#endif /* BABELTRACE_LIB_PLUGIN_PLUGIN_H */ diff --git a/src/lib/property.h b/src/lib/property.h index 685568c7..93f2b270 100644 --- a/src/lib/property.h +++ b/src/lib/property.h @@ -4,8 +4,8 @@ * Copyright (c) 2018 Philippe Proulx */ -#ifndef BABELTRACE_PROPERTY_INTERNAL_H -#define BABELTRACE_PROPERTY_INTERNAL_H +#ifndef BABELTRACE_LIB_PROPERTY_H +#define BABELTRACE_LIB_PROPERTY_H #include "common/assert.h" #include @@ -38,4 +38,4 @@ void bt_property_uint_init(struct bt_property_uint *prop, prop->value = value; } -#endif /* BABELTRACE_PROPERTY_INTERNAL_H */ +#endif /* BABELTRACE_LIB_PROPERTY_H */ diff --git a/src/lib/trace-ir/attributes.h b/src/lib/trace-ir/attributes.h index 2920f383..ab7aa6e3 100644 --- a/src/lib/trace-ir/attributes.h +++ b/src/lib/trace-ir/attributes.h @@ -5,8 +5,8 @@ * Copyright (c) 2015 EfficiOS Inc. and Linux Foundation */ -#ifndef BABELTRACE_TRACE_IR_ATTRIBUTES_H -#define BABELTRACE_TRACE_IR_ATTRIBUTES_H +#ifndef BABELTRACE_LIB_TRACE_IR_ATTRIBUTES_H +#define BABELTRACE_LIB_TRACE_IR_ATTRIBUTES_H #ifdef __cplusplus extern "C" { @@ -40,4 +40,4 @@ int bt_attributes_freeze(const struct bt_value *attr_obj); } #endif -#endif /* BABELTRACE_TRACE_IR_ATTRIBUTES_H */ +#endif /* BABELTRACE_LIB_TRACE_IR_ATTRIBUTES_H */ diff --git a/src/lib/trace-ir/clock-class.c b/src/lib/trace-ir/clock-class.c index 10030155..886501ec 100644 --- a/src/lib/trace-ir/clock-class.c +++ b/src/lib/trace-ir/clock-class.c @@ -35,18 +35,8 @@ void destroy_clock_class(struct bt_object *obj) BT_LIB_LOGD("Destroying clock class: %!+K", clock_class); BT_OBJECT_PUT_REF_AND_RESET(clock_class->user_attributes); - if (clock_class->name.str) { - g_string_free(clock_class->name.str, TRUE); - clock_class->name.str = NULL; - clock_class->name.value = NULL; - } - - if (clock_class->description.str) { - g_string_free(clock_class->description.str, TRUE); - clock_class->description.str = NULL; - clock_class->description.value = NULL; - } - + g_free(clock_class->name); + g_free(clock_class->description); bt_object_pool_finalize(&clock_class->cs_pool); g_free(clock_class); } @@ -91,18 +81,6 @@ struct bt_clock_class *bt_clock_class_create(bt_self_component *self_comp) goto error; } - clock_class->name.str = g_string_new(NULL); - if (!clock_class->name.str) { - BT_LIB_LOGE_APPEND_CAUSE("Failed to allocate a GString."); - goto error; - } - - clock_class->description.str = g_string_new(NULL); - if (!clock_class->description.str) { - BT_LIB_LOGE_APPEND_CAUSE("Failed to allocate a GString."); - goto error; - } - clock_class->frequency = UINT64_C(1000000000); clock_class->origin_is_unix_epoch = BT_TRUE; set_base_offset(clock_class); @@ -132,7 +110,7 @@ BT_EXPORT const char *bt_clock_class_get_name(const struct bt_clock_class *clock_class) { BT_ASSERT_PRE_DEV_CLK_CLS_NON_NULL(clock_class); - return clock_class->name.value; + return clock_class->name; } BT_EXPORT @@ -143,8 +121,8 @@ enum bt_clock_class_set_name_status bt_clock_class_set_name( BT_ASSERT_PRE_CLK_CLS_NON_NULL(clock_class); BT_ASSERT_PRE_NAME_NON_NULL(name); BT_ASSERT_PRE_DEV_CLOCK_CLASS_HOT(clock_class); - g_string_assign(clock_class->name.str, name); - clock_class->name.value = clock_class->name.str->str; + g_free(clock_class->name); + clock_class->name = g_strdup(name); BT_LIB_LOGD("Set clock class's name: %!+K", clock_class); return BT_FUNC_STATUS_OK; } @@ -154,7 +132,7 @@ const char *bt_clock_class_get_description( const struct bt_clock_class *clock_class) { BT_ASSERT_PRE_DEV_CLK_CLS_NON_NULL(clock_class); - return clock_class->description.value; + return clock_class->description; } BT_EXPORT @@ -165,8 +143,8 @@ enum bt_clock_class_set_description_status bt_clock_class_set_description( BT_ASSERT_PRE_CLK_CLS_NON_NULL(clock_class); BT_ASSERT_PRE_DESCR_NON_NULL(descr); BT_ASSERT_PRE_DEV_CLOCK_CLASS_HOT(clock_class); - g_string_assign(clock_class->description.str, descr); - clock_class->description.value = clock_class->description.str->str; + g_free(clock_class->description); + clock_class->description = g_strdup(descr); BT_LIB_LOGD("Set clock class's description: %!+K", clock_class); return BT_FUNC_STATUS_OK; diff --git a/src/lib/trace-ir/clock-class.h b/src/lib/trace-ir/clock-class.h index e2e90412..50df464b 100644 --- a/src/lib/trace-ir/clock-class.h +++ b/src/lib/trace-ir/clock-class.h @@ -5,8 +5,8 @@ * Copyright 2013, 2014 Jérémie Galarneau */ -#ifndef BABELTRACE_TRACE_IR_CLOCK_CLASS_INTERNAL_H -#define BABELTRACE_TRACE_IR_CLOCK_CLASS_INTERNAL_H +#ifndef BABELTRACE_LIB_TRACE_IR_CLOCK_CLASS_H +#define BABELTRACE_LIB_TRACE_IR_CLOCK_CLASS_H #include #include "lib/object.h" @@ -27,19 +27,8 @@ struct bt_clock_class { /* Owned by this */ struct bt_value *user_attributes; - struct { - GString *str; - - /* NULL or `str->str` above */ - const char *value; - } name; - - struct { - GString *str; - - /* NULL or `str->str` above */ - const char *value; - } description; + gchar *name; + gchar *description; uint64_t frequency; uint64_t precision; @@ -100,4 +89,4 @@ int bt_clock_class_clock_value_from_ns_from_origin( raw_value) ? BT_FUNC_STATUS_OVERFLOW_ERROR : BT_FUNC_STATUS_OK; } -#endif /* BABELTRACE_TRACE_IR_CLOCK_CLASS_INTERNAL_H */ +#endif /* BABELTRACE_LIB_TRACE_IR_CLOCK_CLASS_H */ diff --git a/src/lib/trace-ir/clock-snapshot.h b/src/lib/trace-ir/clock-snapshot.h index 860b4200..49dcd84d 100644 --- a/src/lib/trace-ir/clock-snapshot.h +++ b/src/lib/trace-ir/clock-snapshot.h @@ -4,8 +4,8 @@ * Copyright 2017-2018 Philippe Proulx */ -#ifndef BABELTRACE_TRACE_IR_CLOCK_SNAPSHOT_INTERNAL_H -#define BABELTRACE_TRACE_IR_CLOCK_SNAPSHOT_INTERNAL_H +#ifndef BABELTRACE_LIB_TRACE_IR_CLOCK_SNAPSHOT_H +#define BABELTRACE_LIB_TRACE_IR_CLOCK_SNAPSHOT_H #include "lib/object.h" #include @@ -68,4 +68,4 @@ struct bt_clock_snapshot *bt_clock_snapshot_create( void bt_clock_snapshot_recycle(struct bt_clock_snapshot *clock_snapshot); -#endif /* BABELTRACE_TRACE_IR_CLOCK_SNAPSHOT_INTERNAL_H */ +#endif /* BABELTRACE_LIB_TRACE_IR_CLOCK_SNAPSHOT_H */ diff --git a/src/lib/trace-ir/event-class.c b/src/lib/trace-ir/event-class.c index 0d907175..76ad226b 100644 --- a/src/lib/trace-ir/event-class.c +++ b/src/lib/trace-ir/event-class.c @@ -41,16 +41,8 @@ void destroy_event_class(struct bt_object *obj) BT_LIB_LOGD("Destroying event class: %!+E", event_class); BT_OBJECT_PUT_REF_AND_RESET(event_class->user_attributes); - if (event_class->name.str) { - g_string_free(event_class->name.str, TRUE); - event_class->name.str = NULL; - } - - if (event_class->emf_uri.str) { - g_string_free(event_class->emf_uri.str, TRUE); - event_class->emf_uri.str = NULL; - } - + g_free(event_class->name); + g_free(event_class->emf_uri); BT_LOGD_STR("Putting context field class."); BT_OBJECT_PUT_REF_AND_RESET(event_class->specific_context_fc); BT_LOGD_STR("Putting payload field class."); @@ -119,17 +111,6 @@ struct bt_event_class *create_event_class_with_id( event_class->id = id; bt_property_uint_init(&event_class->log_level, BT_PROPERTY_AVAILABILITY_NOT_AVAILABLE, 0); - event_class->name.str = g_string_new(NULL); - if (!event_class->name.str) { - BT_LIB_LOGE_APPEND_CAUSE("Failed to allocate a GString."); - goto error; - } - - event_class->emf_uri.str = g_string_new(NULL); - if (!event_class->emf_uri.str) { - BT_LIB_LOGE_APPEND_CAUSE("Failed to allocate a GString."); - goto error; - } ret = bt_object_pool_initialize(&event_class->event_pool, (bt_object_pool_new_object_func) bt_event_new, @@ -187,7 +168,7 @@ BT_EXPORT const char *bt_event_class_get_name(const struct bt_event_class *event_class) { BT_ASSERT_PRE_DEV_EC_NON_NULL(event_class); - return event_class->name.value; + return event_class->name; } BT_EXPORT @@ -198,8 +179,8 @@ enum bt_event_class_set_name_status bt_event_class_set_name( BT_ASSERT_PRE_EC_NON_NULL(event_class); BT_ASSERT_PRE_NAME_NON_NULL(name); BT_ASSERT_PRE_DEV_EVENT_CLASS_HOT(event_class); - g_string_assign(event_class->name.str, name); - event_class->name.value = event_class->name.str->str; + g_free(event_class->name); + event_class->name = g_strdup(name); BT_LIB_LOGD("Set event class's name: %!+E", event_class); return BT_FUNC_STATUS_OK; } @@ -240,7 +221,7 @@ BT_EXPORT const char *bt_event_class_get_emf_uri(const struct bt_event_class *event_class) { BT_ASSERT_PRE_DEV_EC_NON_NULL(event_class); - return event_class->emf_uri.value; + return event_class->emf_uri; } BT_EXPORT @@ -252,8 +233,8 @@ enum bt_event_class_set_emf_uri_status bt_event_class_set_emf_uri( BT_ASSERT_PRE_EC_NON_NULL(event_class); BT_ASSERT_PRE_NON_NULL("emf-uri", emf_uri, "EMF URI"); BT_ASSERT_PRE_DEV_EVENT_CLASS_HOT(event_class); - g_string_assign(event_class->emf_uri.str, emf_uri); - event_class->emf_uri.value = event_class->emf_uri.str->str; + g_free(event_class->emf_uri); + event_class->emf_uri = g_strdup(emf_uri); BT_LIB_LOGD("Set event class's EMF URI: %!+E", event_class); return BT_FUNC_STATUS_OK; } diff --git a/src/lib/trace-ir/event-class.h b/src/lib/trace-ir/event-class.h index 67d93695..5e1d5071 100644 --- a/src/lib/trace-ir/event-class.h +++ b/src/lib/trace-ir/event-class.h @@ -5,8 +5,8 @@ * Copyright 2013, 2014 Jérémie Galarneau */ -#ifndef BABELTRACE_TRACE_IR_EVENT_CLASS_INTERNAL_H -#define BABELTRACE_TRACE_IR_EVENT_CLASS_INTERNAL_H +#ifndef BABELTRACE_LIB_TRACE_IR_EVENT_CLASS_H +#define BABELTRACE_LIB_TRACE_IR_EVENT_CLASS_H #include #include @@ -29,22 +29,12 @@ struct bt_event_class { /* Owned by this */ struct bt_value *user_attributes; - struct { - GString *str; - - /* NULL or `str->str` above */ - const char *value; - } name; + gchar *name; uint64_t id; struct bt_property_uint log_level; - struct { - GString *str; - - /* NULL or `str->str` above */ - const char *value; - } emf_uri; + gchar *emf_uri; /* Pool of `struct bt_event *` */ struct bt_object_pool event_pool; @@ -68,4 +58,4 @@ struct bt_stream_class *bt_event_class_borrow_stream_class_inline( return (void *) bt_object_borrow_parent(&event_class->base); } -#endif /* BABELTRACE_TRACE_IR_EVENT_CLASS_INTERNAL_H */ +#endif /* BABELTRACE_LIB_TRACE_IR_EVENT_CLASS_H */ diff --git a/src/lib/trace-ir/event.h b/src/lib/trace-ir/event.h index 53130c4b..852113d4 100644 --- a/src/lib/trace-ir/event.h +++ b/src/lib/trace-ir/event.h @@ -5,8 +5,8 @@ * Copyright 2013, 2014 Jérémie Galarneau */ -#ifndef BABELTRACE_TRACE_IR_EVENT_INTERNAL_H -#define BABELTRACE_TRACE_IR_EVENT_INTERNAL_H +#ifndef BABELTRACE_LIB_TRACE_IR_EVENT_H +#define BABELTRACE_LIB_TRACE_IR_EVENT_H /* Protection: this file uses BT_LIB_LOG*() macros directly */ #ifndef BT_LIB_LOG_SUPPORTED @@ -148,4 +148,4 @@ void bt_event_recycle(struct bt_event *event) bt_object_put_ref_no_null_check(&event_class->base); } -#endif /* BABELTRACE_TRACE_IR_EVENT_INTERNAL_H */ +#endif /* BABELTRACE_LIB_TRACE_IR_EVENT_H */ diff --git a/src/lib/trace-ir/field-class.h b/src/lib/trace-ir/field-class.h index 289f3b09..12f42749 100644 --- a/src/lib/trace-ir/field-class.h +++ b/src/lib/trace-ir/field-class.h @@ -5,8 +5,8 @@ * Copyright 2013, 2014 Jérémie Galarneau */ -#ifndef BABELTRACE_TRACE_IR_FIELD_CLASSES_INTERNAL_H -#define BABELTRACE_TRACE_IR_FIELD_CLASSES_INTERNAL_H +#ifndef BABELTRACE_LIB_TRACE_IR_FIELD_CLASS_H +#define BABELTRACE_LIB_TRACE_IR_FIELD_CLASS_H #include #include @@ -247,4 +247,4 @@ void _bt_named_field_class_freeze(const struct bt_named_field_class *named_fc); void bt_field_class_make_part_of_trace_class( const struct bt_field_class *field_class); -#endif /* BABELTRACE_TRACE_IR_FIELD_CLASSES_INTERNAL_H */ +#endif /* BABELTRACE_LIB_TRACE_IR_FIELD_CLASS_H */ diff --git a/src/lib/trace-ir/field-path.h b/src/lib/trace-ir/field-path.h index 79e9d8f1..41e523cc 100644 --- a/src/lib/trace-ir/field-path.h +++ b/src/lib/trace-ir/field-path.h @@ -7,8 +7,8 @@ * http://www.efficios.com/ctf */ -#ifndef BABELTRACE_TRACE_IR_FIELD_PATH_INTERNAL -#define BABELTRACE_TRACE_IR_FIELD_PATH_INTERNAL +#ifndef BABELTRACE_LIB_TRACE_IR_FIELD_PATH_H +#define BABELTRACE_LIB_TRACE_IR_FIELD_PATH_H #include "lib/object.h" #include @@ -71,4 +71,4 @@ const char *bt_field_path_item_type_string(enum bt_field_path_item_type type) } }; -#endif /* BABELTRACE_TRACE_IR_FIELD_PATH_INTERNAL */ +#endif /* BABELTRACE_LIB_TRACE_IR_FIELD_PATH_H */ diff --git a/src/lib/trace-ir/field-wrapper.h b/src/lib/trace-ir/field-wrapper.h index c80d6a30..0afcfb5e 100644 --- a/src/lib/trace-ir/field-wrapper.h +++ b/src/lib/trace-ir/field-wrapper.h @@ -4,8 +4,8 @@ * Copyright 2018 Philippe Proulx */ -#ifndef BABELTRACE_TRACE_IR_FIELD_WRAPPER_INTERNAL_H -#define BABELTRACE_TRACE_IR_FIELD_WRAPPER_INTERNAL_H +#ifndef BABELTRACE_LIB_TRACE_IR_FIELD_WRAPPER_H +#define BABELTRACE_LIB_TRACE_IR_FIELD_WRAPPER_H #include "lib/object-pool.h" #include "lib/object.h" @@ -26,4 +26,4 @@ void bt_field_wrapper_destroy(struct bt_field_wrapper *field); struct bt_field_wrapper *bt_field_wrapper_create( struct bt_object_pool *pool, struct bt_field_class *fc); -#endif /* BABELTRACE_TRACE_IR_FIELD_WRAPPER_INTERNAL_H */ +#endif /* BABELTRACE_LIB_TRACE_IR_FIELD_WRAPPER_H */ diff --git a/src/lib/trace-ir/field.h b/src/lib/trace-ir/field.h index 87446b26..bf90380a 100644 --- a/src/lib/trace-ir/field.h +++ b/src/lib/trace-ir/field.h @@ -5,8 +5,8 @@ * Copyright 2013, 2014 Jérémie Galarneau */ -#ifndef BABELTRACE_TRACE_IR_FIELDS_INTERNAL_H -#define BABELTRACE_TRACE_IR_FIELDS_INTERNAL_H +#ifndef BABELTRACE_LIB_TRACE_IR_FIELD_H +#define BABELTRACE_LIB_TRACE_IR_FIELD_H #include "lib/object.h" #include @@ -161,4 +161,4 @@ struct bt_field *bt_field_create(struct bt_field_class *class); void bt_field_destroy(struct bt_field *field); -#endif /* BABELTRACE_TRACE_IR_FIELDS_INTERNAL_H */ +#endif /* BABELTRACE_LIB_TRACE_IR_FIELD_H */ diff --git a/src/lib/trace-ir/packet.h b/src/lib/trace-ir/packet.h index c22e7c9f..e5292fd4 100644 --- a/src/lib/trace-ir/packet.h +++ b/src/lib/trace-ir/packet.h @@ -4,8 +4,8 @@ * Copyright 2016-2018 Philippe Proulx */ -#ifndef BABELTRACE_TRACE_IR_PACKET_INTERNAL_H -#define BABELTRACE_TRACE_IR_PACKET_INTERNAL_H +#ifndef BABELTRACE_LIB_TRACE_IR_PACKET_H +#define BABELTRACE_LIB_TRACE_IR_PACKET_H #include #include @@ -37,4 +37,4 @@ void bt_packet_recycle(struct bt_packet *packet); void bt_packet_destroy(struct bt_packet *packet); -#endif /* BABELTRACE_TRACE_IR_PACKET_INTERNAL_H */ +#endif /* BABELTRACE_LIB_TRACE_IR_PACKET_H */ diff --git a/src/lib/trace-ir/resolve-field-path.h b/src/lib/trace-ir/resolve-field-path.h index a0df1cd5..1f8cced4 100644 --- a/src/lib/trace-ir/resolve-field-path.h +++ b/src/lib/trace-ir/resolve-field-path.h @@ -7,8 +7,8 @@ * http://www.efficios.com/ctf */ -#ifndef BABELTRACE_TRACE_IR_RESOLVE_FIELD_PATH_INTERNAL -#define BABELTRACE_TRACE_IR_RESOLVE_FIELD_PATH_INTERNAL +#ifndef BABELTRACE_LIB_TRACE_IR_RESOLVE_FIELD_PATH_H +#define BABELTRACE_LIB_TRACE_IR_RESOLVE_FIELD_PATH_H #include #include @@ -25,4 +25,4 @@ int bt_resolve_field_paths(struct bt_field_class *field_class, struct bt_resolve_field_path_context *ctx, const char *api_func); -#endif /* BABELTRACE_TRACE_IR_RESOLVE_FIELD_PATH_INTERNAL */ +#endif /* BABELTRACE_LIB_TRACE_IR_RESOLVE_FIELD_PATH_H */ diff --git a/src/lib/trace-ir/stream-class.c b/src/lib/trace-ir/stream-class.c index 08395849..c9970861 100644 --- a/src/lib/trace-ir/stream-class.c +++ b/src/lib/trace-ir/stream-class.c @@ -47,12 +47,7 @@ void destroy_stream_class(struct bt_object *obj) stream_class->event_classes = NULL; } - if (stream_class->name.str) { - g_string_free(stream_class->name.str, TRUE); - stream_class->name.str = NULL; - stream_class->name.value = NULL; - } - + g_free(stream_class->name); BT_LOGD_STR("Putting packet context field class."); BT_OBJECT_PUT_REF_AND_RESET(stream_class->packet_context_fc); BT_LOGD_STR("Putting event common context field class."); @@ -117,12 +112,6 @@ struct bt_stream_class *create_stream_class_with_id( goto error; } - stream_class->name.str = g_string_new(NULL); - if (!stream_class->name.str) { - BT_LIB_LOGE_APPEND_CAUSE("Failed to allocate a GString."); - goto error; - } - stream_class->id = id; stream_class->assigns_automatic_event_class_id = true; stream_class->assigns_automatic_stream_id = true; @@ -203,7 +192,7 @@ BT_EXPORT const char *bt_stream_class_get_name(const struct bt_stream_class *stream_class) { BT_ASSERT_PRE_DEV_SC_NON_NULL(stream_class); - return stream_class->name.value; + return stream_class->name; } BT_EXPORT @@ -215,8 +204,8 @@ enum bt_stream_class_set_name_status bt_stream_class_set_name( BT_ASSERT_PRE_SC_NON_NULL(stream_class); BT_ASSERT_PRE_NAME_NON_NULL(name); BT_ASSERT_PRE_DEV_STREAM_CLASS_HOT(stream_class); - g_string_assign(stream_class->name.str, name); - stream_class->name.value = stream_class->name.str->str; + g_free(stream_class->name); + stream_class->name = g_strdup(name); BT_LIB_LOGD("Set stream class's name: %!+S", stream_class); return BT_FUNC_STATUS_OK; } diff --git a/src/lib/trace-ir/stream-class.h b/src/lib/trace-ir/stream-class.h index 771a5899..7ebb1d02 100644 --- a/src/lib/trace-ir/stream-class.h +++ b/src/lib/trace-ir/stream-class.h @@ -5,8 +5,8 @@ * Copyright 2013, 2014 Jérémie Galarneau */ -#ifndef BABELTRACE_TRACE_IR_STREAM_CLASS_INTERNAL_H -#define BABELTRACE_TRACE_IR_STREAM_CLASS_INTERNAL_H +#ifndef BABELTRACE_LIB_TRACE_IR_STREAM_CLASS_H +#define BABELTRACE_LIB_TRACE_IR_STREAM_CLASS_H #include "common/assert.h" #include @@ -23,12 +23,7 @@ struct bt_stream_class { /* Owned by this */ struct bt_value *user_attributes; - struct { - GString *str; - - /* NULL or `str->str` above */ - const char *value; - } name; + gchar *name; uint64_t id; bool assigns_automatic_event_class_id; @@ -69,4 +64,4 @@ struct bt_trace_class *bt_stream_class_borrow_trace_class_inline( return (void *) bt_object_borrow_parent(&stream_class->base); } -#endif /* BABELTRACE_TRACE_IR_STREAM_CLASS_INTERNAL_H */ +#endif /* BABELTRACE_LIB_TRACE_IR_STREAM_CLASS_H */ diff --git a/src/lib/trace-ir/stream.c b/src/lib/trace-ir/stream.c index 7cb124f4..471623e8 100644 --- a/src/lib/trace-ir/stream.c +++ b/src/lib/trace-ir/stream.c @@ -37,12 +37,7 @@ void destroy_stream(struct bt_object *obj) BT_LIB_LOGD("Destroying stream object: %!+s", stream); BT_OBJECT_PUT_REF_AND_RESET(stream->user_attributes); - if (stream->name.str) { - g_string_free(stream->name.str, TRUE); - stream->name.str = NULL; - stream->name.value = NULL; - } - + g_free(stream->name); BT_LOGD_STR("Putting stream's class."); bt_object_put_ref(stream->class); bt_object_pool_finalize(&stream->packet_pool); @@ -114,12 +109,6 @@ struct bt_stream *create_stream_with_id(struct bt_stream_class *stream_class, goto error; } - stream->name.str = g_string_new(NULL); - if (!stream->name.str) { - BT_LIB_LOGE_APPEND_CAUSE("Failed to allocate a GString."); - goto error; - } - stream->id = id; ret = bt_object_pool_initialize(&stream->packet_pool, (bt_object_pool_new_object_func) bt_packet_new, @@ -211,7 +200,7 @@ BT_EXPORT const char *bt_stream_get_name(const struct bt_stream *stream) { BT_ASSERT_PRE_DEV_STREAM_NON_NULL(stream); - return stream->name.value; + return stream->name; } BT_EXPORT @@ -222,8 +211,8 @@ enum bt_stream_set_name_status bt_stream_set_name(struct bt_stream *stream, BT_ASSERT_PRE_STREAM_NON_NULL(stream); BT_ASSERT_PRE_NAME_NON_NULL(name); BT_ASSERT_PRE_DEV_STREAM_HOT(stream); - g_string_assign(stream->name.str, name); - stream->name.value = stream->name.str->str; + g_free(stream->name); + stream->name = g_strdup(name); BT_LIB_LOGD("Set stream's name: %!+s", stream); return BT_FUNC_STATUS_OK; } diff --git a/src/lib/trace-ir/stream.h b/src/lib/trace-ir/stream.h index 89d7bf73..250f7948 100644 --- a/src/lib/trace-ir/stream.h +++ b/src/lib/trace-ir/stream.h @@ -5,8 +5,8 @@ * Copyright 2013, 2014 Jérémie Galarneau */ -#ifndef BABELTRACE_TRACE_IR_STREAM_INTERNAL_H -#define BABELTRACE_TRACE_IR_STREAM_INTERNAL_H +#ifndef BABELTRACE_LIB_TRACE_IR_STREAM_H +#define BABELTRACE_LIB_TRACE_IR_STREAM_H #include #include "lib/object.h" @@ -26,12 +26,7 @@ struct bt_stream { /* Owned by this */ struct bt_stream_class *class; - struct { - GString *str; - - /* NULL or `str->str` above */ - const char *value; - } name; + gchar *name; uint64_t id; @@ -56,4 +51,4 @@ struct bt_trace *bt_stream_borrow_trace_inline(const struct bt_stream *stream) return (void *) bt_object_borrow_parent(&stream->base); } -#endif /* BABELTRACE_TRACE_IR_STREAM_INTERNAL_H */ +#endif /* BABELTRACE_LIB_TRACE_IR_STREAM_H */ diff --git a/src/lib/trace-ir/trace-class.h b/src/lib/trace-ir/trace-class.h index 8df87e97..3484ffc2 100644 --- a/src/lib/trace-ir/trace-class.h +++ b/src/lib/trace-ir/trace-class.h @@ -5,8 +5,8 @@ * Copyright 2014 Jérémie Galarneau */ -#ifndef BABELTRACE_TRACE_IR_TRACE_CLASS_INTERNAL_H -#define BABELTRACE_TRACE_IR_TRACE_CLASS_INTERNAL_H +#ifndef BABELTRACE_LIB_TRACE_IR_TRACE_CLASS_H +#define BABELTRACE_LIB_TRACE_IR_TRACE_CLASS_H #include #include @@ -40,4 +40,4 @@ void _bt_trace_class_freeze(const struct bt_trace_class *trace_class); # define bt_trace_class_freeze(_tc) #endif -#endif /* BABELTRACE_TRACE_IR_TRACE_CLASS_INTERNAL_H */ +#endif /* BABELTRACE_LIB_TRACE_IR_TRACE_CLASS_H */ diff --git a/src/lib/trace-ir/trace.c b/src/lib/trace-ir/trace.c index 8cc005a7..ef9581ee 100644 --- a/src/lib/trace-ir/trace.c +++ b/src/lib/trace-ir/trace.c @@ -105,11 +105,7 @@ void destroy_trace(struct bt_object *obj) } } - if (trace->name.str) { - g_string_free(trace->name.str, TRUE); - trace->name.str = NULL; - trace->name.value = NULL; - } + g_free(trace->name); if (trace->environment) { BT_LOGD_STR("Destroying environment attributes."); @@ -170,12 +166,6 @@ struct bt_trace *bt_trace_create(struct bt_trace_class *tc) goto error; } - trace->name.str = g_string_new(NULL); - if (!trace->name.str) { - BT_LIB_LOGE_APPEND_CAUSE("Failed to allocate one GString."); - goto error; - } - trace->environment = bt_attributes_create(); if (!trace->environment) { BT_LIB_LOGE_APPEND_CAUSE("Cannot create empty attributes object."); @@ -205,7 +195,7 @@ BT_EXPORT const char *bt_trace_get_name(const struct bt_trace *trace) { BT_ASSERT_PRE_DEV_TRACE_NON_NULL(trace); - return trace->name.value; + return trace->name; } BT_EXPORT @@ -216,8 +206,8 @@ enum bt_trace_set_name_status bt_trace_set_name(struct bt_trace *trace, BT_ASSERT_PRE_TRACE_NON_NULL(trace); BT_ASSERT_PRE_NAME_NON_NULL(name); BT_ASSERT_PRE_DEV_TRACE_HOT(trace); - g_string_assign(trace->name.str, name); - trace->name.value = trace->name.str->str; + g_free(trace->name); + trace->name = g_strdup(name); BT_LIB_LOGD("Set trace's name: %!+t", trace); return BT_FUNC_STATUS_OK; } diff --git a/src/lib/trace-ir/trace.h b/src/lib/trace-ir/trace.h index 294e8943..4ab18f1b 100644 --- a/src/lib/trace-ir/trace.h +++ b/src/lib/trace-ir/trace.h @@ -5,8 +5,8 @@ * Copyright 2014 Jérémie Galarneau */ -#ifndef BABELTRACE_TRACE_IR_TRACE_INTERNAL_H -#define BABELTRACE_TRACE_IR_TRACE_INTERNAL_H +#ifndef BABELTRACE_LIB_TRACE_IR_TRACE_H +#define BABELTRACE_LIB_TRACE_IR_TRACE_H #include #include @@ -31,12 +31,7 @@ struct bt_trace { /* Owned by this */ struct bt_trace_class *class; - struct { - GString *str; - - /* NULL or `str->str` above */ - const char *value; - } name; + gchar *name; struct { bt_uuid_t uuid; @@ -74,4 +69,4 @@ void bt_trace_add_stream(struct bt_trace *trace, struct bt_stream *stream); uint64_t bt_trace_get_automatic_stream_id(const struct bt_trace *trace, const struct bt_stream_class *stream_class); -#endif /* BABELTRACE_TRACE_IR_TRACE_INTERNAL_H */ +#endif /* BABELTRACE_LIB_TRACE_IR_TRACE_H */ diff --git a/src/lib/trace-ir/utils.h b/src/lib/trace-ir/utils.h index f9c2f6e3..8943ee24 100644 --- a/src/lib/trace-ir/utils.h +++ b/src/lib/trace-ir/utils.h @@ -4,8 +4,8 @@ * Copyright 2017-2018 Philippe Proulx */ -#ifndef BABELTRACE_TRACE_IR_UTILS_INTERNAL_H -#define BABELTRACE_TRACE_IR_UTILS_INTERNAL_H +#ifndef BABELTRACE_LIB_TRACE_IR_UTILS_H +#define BABELTRACE_LIB_TRACE_IR_UTILS_H #include #include @@ -155,4 +155,4 @@ bool bt_util_value_is_in_range_unsigned(unsigned int size, uint64_t value) return value <= max_value; } -#endif /* BABELTRACE_TRACE_IR_UTILS_INTERNAL_H */ +#endif /* BABELTRACE_LIB_TRACE_IR_UTILS_H */ diff --git a/src/lib/value.h b/src/lib/value.h index 34b7a40a..68cd907e 100644 --- a/src/lib/value.h +++ b/src/lib/value.h @@ -4,8 +4,8 @@ * Copyright (c) 2015-2018 Philippe Proulx */ -#ifndef BABELTRACE_VALUES_INTERNAL_H -#define BABELTRACE_VALUES_INTERNAL_H +#ifndef BABELTRACE_LIB_VALUE_H +#define BABELTRACE_LIB_VALUE_H #include #include @@ -59,4 +59,4 @@ void _bt_value_freeze(const struct bt_value *object); # define bt_value_freeze(_value) #endif /* BT_DEV_MODE */ -#endif /* BABELTRACE_VALUES_INTERNAL_H */ +#endif /* BABELTRACE_LIB_VALUE_H */ diff --git a/src/param-parse/param-parse.h b/src/param-parse/param-parse.h index 8ca0e3eb..d53b4177 100644 --- a/src/param-parse/param-parse.h +++ b/src/param-parse/param-parse.h @@ -4,8 +4,8 @@ * Copyright 2016-2019 Philippe Proulx */ -#ifndef SRC_PARAMS_PARSE_VALUE_PARSE_H -#define SRC_PARAMS_PARSE_VALUE_PARSE_H +#ifndef BABELTRACE_PARAM_PARSE_PARAM_PARSE_H +#define BABELTRACE_PARAM_PARSE_PARAM_PARSE_H #include @@ -15,4 +15,4 @@ bt_value *bt_param_parse(const char *arg, GString *ini_error); -#endif /* SRC_VALUE_PARSE_VALUE_PARSE_H */ +#endif /* BABELTRACE_PARAM_PARSE_PARAM_PARSE_H */ diff --git a/src/plugins/common/muxing/muxing.h b/src/plugins/common/muxing/muxing.h index d724f8a4..9f0e913e 100644 --- a/src/plugins/common/muxing/muxing.h +++ b/src/plugins/common/muxing/muxing.h @@ -4,8 +4,8 @@ * Copyright 2019 Francis Deslauriers */ -#ifndef BABELTRACE_PLUGIN_COMMON_MUXING_H -#define BABELTRACE_PLUGIN_COMMON_MUXING_H +#ifndef BABELTRACE_PLUGINS_COMMON_MUXING_MUXING_H +#define BABELTRACE_PLUGINS_COMMON_MUXING_MUXING_H #include #include "common/macros.h" @@ -14,4 +14,4 @@ BT_EXTERN_C int common_muxing_compare_messages(const bt_message *left_msg, const bt_message *right_msg); -#endif /* BABELTRACE_PLUGIN_COMMON_MUXING_H */ +#endif /* BABELTRACE_PLUGINS_COMMON_MUXING_MUXING_H */ diff --git a/src/plugins/common/param-validation/param-validation.h b/src/plugins/common/param-validation/param-validation.h index 40d57609..8361b593 100644 --- a/src/plugins/common/param-validation/param-validation.h +++ b/src/plugins/common/param-validation/param-validation.h @@ -3,6 +3,7 @@ * * Copyright 2019 EfficiOS Inc. */ + #ifndef BABELTRACE_PLUGINS_COMMON_PARAM_VALIDATION_PARAM_VALIDATION_H #define BABELTRACE_PLUGINS_COMMON_PARAM_VALIDATION_PARAM_VALIDATION_H diff --git a/src/plugins/ctf/common/src/bfcr/bfcr.hpp b/src/plugins/ctf/common/src/bfcr/bfcr.hpp index 984b695c..f43f2109 100644 --- a/src/plugins/ctf/common/src/bfcr/bfcr.hpp +++ b/src/plugins/ctf/common/src/bfcr/bfcr.hpp @@ -7,8 +7,8 @@ * Babeltrace - CTF binary field class reader (BFCR) */ -#ifndef CTF_BFCR_H -#define CTF_BFCR_H +#ifndef BABELTRACE_PLUGINS_CTF_COMMON_SRC_BFCR_BFCR_HPP +#define BABELTRACE_PLUGINS_CTF_COMMON_SRC_BFCR_BFCR_HPP #include #include @@ -355,4 +355,4 @@ size_t bt_bfcr_continue(struct bt_bfcr *bfcr, const uint8_t *buf, size_t sz, void bt_bfcr_set_unsigned_int_cb(struct bt_bfcr *bfcr, bt_bfcr_unsigned_int_cb_func cb); -#endif /* CTF_BFCR_H */ +#endif /* BABELTRACE_PLUGINS_CTF_COMMON_SRC_BFCR_BFCR_HPP */ diff --git a/src/plugins/ctf/common/src/clk-cls-cfg.hpp b/src/plugins/ctf/common/src/clk-cls-cfg.hpp index 0c3b52d7..e46b66e5 100644 --- a/src/plugins/ctf/common/src/clk-cls-cfg.hpp +++ b/src/plugins/ctf/common/src/clk-cls-cfg.hpp @@ -4,8 +4,8 @@ * Copyright (c) 2022 EfficiOS Inc. and Linux Foundation */ -#ifndef CTF_COMMON_SRC_CLK_CLS_CFG_HPP -#define CTF_COMMON_SRC_CLK_CLS_CFG_HPP +#ifndef BABELTRACE_PLUGINS_CTF_COMMON_SRC_CLK_CLS_CFG_HPP +#define BABELTRACE_PLUGINS_CTF_COMMON_SRC_CLK_CLS_CFG_HPP #include @@ -22,4 +22,4 @@ struct ClkClsCfg } /* namespace src */ } /* namespace ctf */ -#endif /* CTF_COMMON_SRC_CLK_CLS_CFG_HPP */ +#endif /* BABELTRACE_PLUGINS_CTF_COMMON_SRC_CLK_CLS_CFG_HPP */ diff --git a/src/plugins/ctf/common/src/metadata/tsdl/ast.hpp b/src/plugins/ctf/common/src/metadata/tsdl/ast.hpp index 597cb3a4..93bfe8bc 100644 --- a/src/plugins/ctf/common/src/metadata/tsdl/ast.hpp +++ b/src/plugins/ctf/common/src/metadata/tsdl/ast.hpp @@ -4,8 +4,8 @@ * Copyright 2011-2012 Mathieu Desnoyers */ -#ifndef _CTF_AST_H -#define _CTF_AST_H +#ifndef BABELTRACE_PLUGINS_CTF_COMMON_SRC_METADATA_TSDL_AST_HPP +#define BABELTRACE_PLUGINS_CTF_COMMON_SRC_METADATA_TSDL_AST_HPP #include @@ -608,4 +608,4 @@ end: return ret; } -#endif /* _CTF_AST_H */ +#endif /* BABELTRACE_PLUGINS_CTF_COMMON_SRC_METADATA_TSDL_AST_HPP */ diff --git a/src/plugins/ctf/common/src/metadata/tsdl/ctf-meta-configure-ir-trace.hpp b/src/plugins/ctf/common/src/metadata/tsdl/ctf-meta-configure-ir-trace.hpp index 2adffb53..3ce3fa96 100644 --- a/src/plugins/ctf/common/src/metadata/tsdl/ctf-meta-configure-ir-trace.hpp +++ b/src/plugins/ctf/common/src/metadata/tsdl/ctf-meta-configure-ir-trace.hpp @@ -4,11 +4,11 @@ * Copyright 2019 Philippe Proulx */ -#ifndef _CTF_META_CONFIGURE_IR_TRACE_H -#define _CTF_META_CONFIGURE_IR_TRACE_H +#ifndef BABELTRACE_PLUGINS_CTF_COMMON_SRC_METADATA_TSDL_CTF_META_CONFIGURE_IR_TRACE_HPP +#define BABELTRACE_PLUGINS_CTF_COMMON_SRC_METADATA_TSDL_CTF_META_CONFIGURE_IR_TRACE_HPP #include "cpp-common/bt2/trace-ir.hpp" void ctf_trace_class_configure_ir_trace(struct ctf_trace_class *tc, bt2::Trace ir_trace); -#endif /* _CTF_META_CONFIGURE_IR_TRACE_H */ +#endif /* BABELTRACE_PLUGINS_CTF_COMMON_SRC_METADATA_TSDL_CTF_META_CONFIGURE_IR_TRACE_HPP */ diff --git a/src/plugins/ctf/common/src/metadata/tsdl/ctf-meta-visitors.hpp b/src/plugins/ctf/common/src/metadata/tsdl/ctf-meta-visitors.hpp index 1a6f708f..0b2e5b09 100644 --- a/src/plugins/ctf/common/src/metadata/tsdl/ctf-meta-visitors.hpp +++ b/src/plugins/ctf/common/src/metadata/tsdl/ctf-meta-visitors.hpp @@ -4,8 +4,8 @@ * Copyright 2018 Philippe Proulx */ -#ifndef _CTF_META_VISITORS_H -#define _CTF_META_VISITORS_H +#ifndef BABELTRACE_PLUGINS_CTF_COMMON_SRC_METADATA_TSDL_CTF_META_VISITORS_HPP +#define BABELTRACE_PLUGINS_CTF_COMMON_SRC_METADATA_TSDL_CTF_META_VISITORS_HPP #include @@ -43,4 +43,4 @@ int ctf_trace_class_validate(struct ctf_trace_class *ctf_tc, const bt2c::Logger& void ctf_trace_class_warn_meaningless_header_fields(struct ctf_trace_class *ctf_tc, const bt2c::Logger& parentLogger); -#endif /* _CTF_META_VISITORS_H */ +#endif /* BABELTRACE_PLUGINS_CTF_COMMON_SRC_METADATA_TSDL_CTF_META_VISITORS_HPP */ diff --git a/src/plugins/ctf/common/src/metadata/tsdl/ctf-meta.hpp b/src/plugins/ctf/common/src/metadata/tsdl/ctf-meta.hpp index 5efa7106..541fba6d 100644 --- a/src/plugins/ctf/common/src/metadata/tsdl/ctf-meta.hpp +++ b/src/plugins/ctf/common/src/metadata/tsdl/ctf-meta.hpp @@ -4,8 +4,8 @@ * Copyright 2018 Philippe Proulx */ -#ifndef _CTF_META_H -#define _CTF_META_H +#ifndef BABELTRACE_PLUGINS_CTF_COMMON_SRC_METADATA_TSDL_CTF_META_HPP +#define BABELTRACE_PLUGINS_CTF_COMMON_SRC_METADATA_TSDL_CTF_META_HPP #include #include @@ -1773,4 +1773,4 @@ end: return ret_entry; } -#endif /* _CTF_META_H */ +#endif /* BABELTRACE_PLUGINS_CTF_COMMON_SRC_METADATA_TSDL_CTF_META_HPP */ diff --git a/src/plugins/ctf/common/src/metadata/tsdl/decoder-packetized-file-stream-to-buf.hpp b/src/plugins/ctf/common/src/metadata/tsdl/decoder-packetized-file-stream-to-buf.hpp index 6190b061..b0d544c2 100644 --- a/src/plugins/ctf/common/src/metadata/tsdl/decoder-packetized-file-stream-to-buf.hpp +++ b/src/plugins/ctf/common/src/metadata/tsdl/decoder-packetized-file-stream-to-buf.hpp @@ -4,8 +4,8 @@ * Copyright 2019 Efficios Inc. */ -#ifndef SRC_PLUGINS_CTF_COMMON_METADATA_DECODER_PACKETIZED_FILE_STREAM_TO_BUF -#define SRC_PLUGINS_CTF_COMMON_METADATA_DECODER_PACKETIZED_FILE_STREAM_TO_BUF +#ifndef BABELTRACE_PLUGINS_CTF_COMMON_SRC_METADATA_TSDL_DECODER_PACKETIZED_FILE_STREAM_TO_BUF_HPP +#define BABELTRACE_PLUGINS_CTF_COMMON_SRC_METADATA_TSDL_DECODER_PACKETIZED_FILE_STREAM_TO_BUF_HPP #include @@ -23,4 +23,4 @@ int ctf_metadata_decoder_packetized_file_stream_to_buf(FILE *fp, char **buf, int bool *is_uuid_set, uint8_t *uuid, const bt2c::Logger& parentLogger); -#endif /* SRC_PLUGINS_CTF_COMMON_METADATA_DECODER_PACKETIZED_FILE_STREAM_TO_BUF */ +#endif /* BABELTRACE_PLUGINS_CTF_COMMON_SRC_METADATA_TSDL_DECODER_PACKETIZED_FILE_STREAM_TO_BUF_HPP */ diff --git a/src/plugins/ctf/common/src/metadata/tsdl/decoder.hpp b/src/plugins/ctf/common/src/metadata/tsdl/decoder.hpp index b4dbce87..9d230fd3 100644 --- a/src/plugins/ctf/common/src/metadata/tsdl/decoder.hpp +++ b/src/plugins/ctf/common/src/metadata/tsdl/decoder.hpp @@ -4,8 +4,8 @@ * Copyright 2016-2017 Philippe Proulx */ -#ifndef _METADATA_DECODER_H -#define _METADATA_DECODER_H +#ifndef BABELTRACE_PLUGINS_CTF_COMMON_SRC_METADATA_TSDL_DECODER_HPP +#define BABELTRACE_PLUGINS_CTF_COMMON_SRC_METADATA_TSDL_DECODER_HPP #include @@ -191,4 +191,4 @@ static inline bool ctf_metadata_decoder_is_packet_version_valid(unsigned int maj return major == 1 && minor == 8; } -#endif /* _METADATA_DECODER_H */ +#endif /* BABELTRACE_PLUGINS_CTF_COMMON_SRC_METADATA_TSDL_DECODER_HPP */ diff --git a/src/plugins/ctf/common/src/metadata/tsdl/logging.hpp b/src/plugins/ctf/common/src/metadata/tsdl/logging.hpp index ee019a3c..e19e37f3 100644 --- a/src/plugins/ctf/common/src/metadata/tsdl/logging.hpp +++ b/src/plugins/ctf/common/src/metadata/tsdl/logging.hpp @@ -4,8 +4,8 @@ * Copyright (c) 2017 Jérémie Galarneau */ -#ifndef CTF_METADATA_LOGGING_H -#define CTF_METADATA_LOGGING_H +#ifndef BABELTRACE_PLUGINS_CTF_COMMON_SRC_METADATA_TSDL_LOGGING_HPP +#define BABELTRACE_PLUGINS_CTF_COMMON_SRC_METADATA_TSDL_LOGGING_HPP #include @@ -23,4 +23,4 @@ #define _BT_CPPLOGE_APPEND_CAUSE_LINENO(logger, _lineno, _msg, args...) \ BT_CPPLOGE_APPEND_CAUSE_SPEC((logger), "At line {} in metadata stream: " _msg, _lineno, ##args) -#endif /* CTF_METADATA_LOGGING_H */ +#endif /* BABELTRACE_PLUGINS_CTF_COMMON_SRC_METADATA_TSDL_LOGGING_HPP */ diff --git a/src/plugins/ctf/common/src/metadata/tsdl/objstack.hpp b/src/plugins/ctf/common/src/metadata/tsdl/objstack.hpp index cc17d433..511a411f 100644 --- a/src/plugins/ctf/common/src/metadata/tsdl/objstack.hpp +++ b/src/plugins/ctf/common/src/metadata/tsdl/objstack.hpp @@ -6,8 +6,8 @@ * Common Trace Format Object Stack. */ -#ifndef _OBJSTACK_H -#define _OBJSTACK_H +#ifndef BABELTRACE_PLUGINS_CTF_COMMON_SRC_METADATA_TSDL_OBJSTACK_HPP +#define BABELTRACE_PLUGINS_CTF_COMMON_SRC_METADATA_TSDL_OBJSTACK_HPP #include @@ -26,4 +26,4 @@ void objstack_destroy(struct objstack *objstack); */ void *objstack_alloc(struct objstack *objstack, size_t len); -#endif /* _OBJSTACK_H */ +#endif /* BABELTRACE_PLUGINS_CTF_COMMON_SRC_METADATA_TSDL_OBJSTACK_HPP */ diff --git a/src/plugins/ctf/common/src/metadata/tsdl/parser-wrap.hpp b/src/plugins/ctf/common/src/metadata/tsdl/parser-wrap.hpp index bfc0e907..ba128994 100644 --- a/src/plugins/ctf/common/src/metadata/tsdl/parser-wrap.hpp +++ b/src/plugins/ctf/common/src/metadata/tsdl/parser-wrap.hpp @@ -4,8 +4,8 @@ * Copyright 2019 EfficiOS Inc. */ -#ifndef BABELTRACE_PLUGINS_CTF_COMMON_METADATA_PARSER_WRAP_H -#define BABELTRACE_PLUGINS_CTF_COMMON_METADATA_PARSER_WRAP_H +#ifndef BABELTRACE_PLUGINS_CTF_COMMON_SRC_METADATA_TSDL_PARSER_WRAP_HPP +#define BABELTRACE_PLUGINS_CTF_COMMON_SRC_METADATA_TSDL_PARSER_WRAP_HPP /* * Small wrapper around the bison-generated parser.h to conditionally define @@ -24,4 +24,4 @@ #include "plugins/ctf/common/src/metadata/tsdl/parser.hpp" #undef ALLOW_INCLUDE_PARSER_H -#endif +#endif /* BABELTRACE_PLUGINS_CTF_COMMON_SRC_METADATA_TSDL_PARSER_WRAP_HPP */ diff --git a/src/plugins/ctf/common/src/metadata/tsdl/scanner-symbols.hpp b/src/plugins/ctf/common/src/metadata/tsdl/scanner-symbols.hpp index 1f6f144d..e2740366 100644 --- a/src/plugins/ctf/common/src/metadata/tsdl/scanner-symbols.hpp +++ b/src/plugins/ctf/common/src/metadata/tsdl/scanner-symbols.hpp @@ -4,8 +4,8 @@ * Copyright 2011-2012 Mathieu Desnoyers */ -#ifndef _CTF_SCANNER_SYMBOLS -#define _CTF_SCANNER_SYMBOLS +#ifndef BABELTRACE_PLUGINS_CTF_COMMON_SRC_METADATA_TSDL_SCANNER_SYMBOLS_HPP +#define BABELTRACE_PLUGINS_CTF_COMMON_SRC_METADATA_TSDL_SCANNER_SYMBOLS_HPP #define yy_create_buffer bt_yy_create_buffer #define yy_delete_buffer bt_yy_delete_buffer @@ -37,4 +37,4 @@ #define yyset_lval bt_yyset_lval #define yyset_out bt_yyset_out -#endif /* _CTF_SCANNER_SYMBOLS */ +#endif /* BABELTRACE_PLUGINS_CTF_COMMON_SRC_METADATA_TSDL_SCANNER_SYMBOLS_HPP */ diff --git a/src/plugins/ctf/common/src/metadata/tsdl/scanner.hpp b/src/plugins/ctf/common/src/metadata/tsdl/scanner.hpp index 4f2a1f86..79933d50 100644 --- a/src/plugins/ctf/common/src/metadata/tsdl/scanner.hpp +++ b/src/plugins/ctf/common/src/metadata/tsdl/scanner.hpp @@ -4,8 +4,8 @@ * Copyright 2011-2012 Mathieu Desnoyers */ -#ifndef _CTF_SCANNER_H -#define _CTF_SCANNER_H +#ifndef BABELTRACE_PLUGINS_CTF_COMMON_SRC_METADATA_TSDL_SCANNER_HPP +#define BABELTRACE_PLUGINS_CTF_COMMON_SRC_METADATA_TSDL_SCANNER_HPP #include @@ -51,4 +51,4 @@ static inline struct ctf_ast *ctf_scanner_get_ast(struct ctf_scanner *scanner) int is_type(struct ctf_scanner *scanner, const char *id); -#endif /* _CTF_SCANNER_H */ +#endif /* BABELTRACE_PLUGINS_CTF_COMMON_SRC_METADATA_TSDL_SCANNER_HPP */ diff --git a/src/plugins/ctf/common/src/msg-iter/msg-iter.hpp b/src/plugins/ctf/common/src/msg-iter/msg-iter.hpp index f9bb7f2a..b375b0d8 100644 --- a/src/plugins/ctf/common/src/msg-iter/msg-iter.hpp +++ b/src/plugins/ctf/common/src/msg-iter/msg-iter.hpp @@ -7,8 +7,8 @@ * Babeltrace - CTF message iterator */ -#ifndef CTF_MSG_ITER_H -#define CTF_MSG_ITER_H +#ifndef BABELTRACE_PLUGINS_CTF_COMMON_SRC_MSG_ITER_MSG_ITER_HPP +#define BABELTRACE_PLUGINS_CTF_COMMON_SRC_MSG_ITER_MSG_ITER_HPP #include #include @@ -362,4 +362,4 @@ void ctf_msg_iter_reset_for_next_stream_file(struct ctf_msg_iter *msg_it); void ctf_msg_iter_set_dry_run(struct ctf_msg_iter *msg_it, bool val); -#endif /* CTF_MSG_ITER_H */ +#endif /* BABELTRACE_PLUGINS_CTF_COMMON_SRC_MSG_ITER_MSG_ITER_HPP */ diff --git a/src/plugins/ctf/fs-sink/fs-sink-ctf-meta.hpp b/src/plugins/ctf/fs-sink/fs-sink-ctf-meta.hpp index 7161fb35..440fca72 100644 --- a/src/plugins/ctf/fs-sink/fs-sink-ctf-meta.hpp +++ b/src/plugins/ctf/fs-sink/fs-sink-ctf-meta.hpp @@ -4,8 +4,8 @@ * Copyright 2018-2019 Philippe Proulx */ -#ifndef BABELTRACE_PLUGIN_CTF_FS_SINK_FS_SINK_CTF_META_H -#define BABELTRACE_PLUGIN_CTF_FS_SINK_FS_SINK_CTF_META_H +#ifndef BABELTRACE_PLUGINS_CTF_FS_SINK_FS_SINK_CTF_META_HPP +#define BABELTRACE_PLUGINS_CTF_FS_SINK_FS_SINK_CTF_META_HPP #include #include @@ -935,4 +935,4 @@ static inline struct fs_sink_ctf_trace *fs_sink_ctf_trace_create(const bt_trace return trace; } -#endif /* BABELTRACE_PLUGIN_CTF_FS_SINK_FS_SINK_CTF_META_H */ +#endif /* BABELTRACE_PLUGINS_CTF_FS_SINK_FS_SINK_CTF_META_HPP */ diff --git a/src/plugins/ctf/fs-sink/fs-sink-stream.hpp b/src/plugins/ctf/fs-sink/fs-sink-stream.hpp index 8c309525..b30f7751 100644 --- a/src/plugins/ctf/fs-sink/fs-sink-stream.hpp +++ b/src/plugins/ctf/fs-sink/fs-sink-stream.hpp @@ -4,8 +4,8 @@ * Copyright 2019 Philippe Proulx */ -#ifndef BABELTRACE_PLUGIN_CTF_FS_SINK_FS_SINK_STREAM_H -#define BABELTRACE_PLUGIN_CTF_FS_SINK_FS_SINK_STREAM_H +#ifndef BABELTRACE_PLUGINS_CTF_FS_SINK_FS_SINK_STREAM_HPP +#define BABELTRACE_PLUGINS_CTF_FS_SINK_FS_SINK_STREAM_HPP #include #include @@ -179,4 +179,4 @@ int fs_sink_stream_open_packet(struct fs_sink_stream *stream, const bt_clock_sna int fs_sink_stream_close_packet(struct fs_sink_stream *stream, const bt_clock_snapshot *cs); -#endif /* BABELTRACE_PLUGIN_CTF_FS_SINK_FS_SINK_STREAM_H */ +#endif /* BABELTRACE_PLUGINS_CTF_FS_SINK_FS_SINK_STREAM_HPP */ diff --git a/src/plugins/ctf/fs-sink/fs-sink-trace.hpp b/src/plugins/ctf/fs-sink/fs-sink-trace.hpp index c9b16436..ac558b97 100644 --- a/src/plugins/ctf/fs-sink/fs-sink-trace.hpp +++ b/src/plugins/ctf/fs-sink/fs-sink-trace.hpp @@ -4,8 +4,8 @@ * Copyright 2019 Philippe Proulx */ -#ifndef BABELTRACE_PLUGIN_CTF_FS_SINK_FS_SINK_TRACE_H -#define BABELTRACE_PLUGIN_CTF_FS_SINK_FS_SINK_TRACE_H +#ifndef BABELTRACE_PLUGINS_CTF_FS_SINK_FS_SINK_TRACE_HPP +#define BABELTRACE_PLUGINS_CTF_FS_SINK_FS_SINK_TRACE_HPP #include @@ -62,4 +62,4 @@ struct fs_sink_trace *fs_sink_trace_create(struct fs_sink_comp *fs_sink, const b void fs_sink_trace_destroy(struct fs_sink_trace *trace); -#endif /* BABELTRACE_PLUGIN_CTF_FS_SINK_FS_SINK_TRACE_H */ +#endif /* BABELTRACE_PLUGINS_CTF_FS_SINK_FS_SINK_TRACE_HPP */ diff --git a/src/plugins/ctf/fs-sink/fs-sink.hpp b/src/plugins/ctf/fs-sink/fs-sink.hpp index 529ae346..71a15745 100644 --- a/src/plugins/ctf/fs-sink/fs-sink.hpp +++ b/src/plugins/ctf/fs-sink/fs-sink.hpp @@ -4,8 +4,8 @@ * Copyright 2019 Philippe Proulx */ -#ifndef BABELTRACE_PLUGIN_CTF_FS_SINK_FS_SINK_H -#define BABELTRACE_PLUGIN_CTF_FS_SINK_FS_SINK_H +#ifndef BABELTRACE_PLUGINS_CTF_FS_SINK_FS_SINK_HPP +#define BABELTRACE_PLUGINS_CTF_FS_SINK_FS_SINK_HPP #include @@ -67,4 +67,4 @@ ctf_fs_sink_graph_is_configured(bt_self_component_sink *component); void ctf_fs_sink_finalize(bt_self_component_sink *component); -#endif /* BABELTRACE_PLUGIN_CTF_FS_SINK_FS_SINK_H */ +#endif /* BABELTRACE_PLUGINS_CTF_FS_SINK_FS_SINK_HPP */ diff --git a/src/plugins/ctf/fs-sink/translate-ctf-ir-to-tsdl.hpp b/src/plugins/ctf/fs-sink/translate-ctf-ir-to-tsdl.hpp index 1efe100f..a3658d65 100644 --- a/src/plugins/ctf/fs-sink/translate-ctf-ir-to-tsdl.hpp +++ b/src/plugins/ctf/fs-sink/translate-ctf-ir-to-tsdl.hpp @@ -4,11 +4,11 @@ * Copyright 2019 Philippe Proulx */ -#ifndef BABELTRACE_PLUGIN_CTF_FS_SINK_TRANSLATE_CTF_IR_TO_TSDL_H -#define BABELTRACE_PLUGIN_CTF_FS_SINK_TRANSLATE_CTF_IR_TO_TSDL_H +#ifndef BABELTRACE_PLUGINS_CTF_FS_SINK_TRANSLATE_CTF_IR_TO_TSDL_HPP +#define BABELTRACE_PLUGINS_CTF_FS_SINK_TRANSLATE_CTF_IR_TO_TSDL_HPP #include void translate_trace_ctf_ir_to_tsdl(struct fs_sink_ctf_trace *trace, GString *tsdl); -#endif /* BABELTRACE_PLUGIN_CTF_FS_SINK_TRANSLATE_CTF_IR_TO_TSDL_H */ +#endif /* BABELTRACE_PLUGINS_CTF_FS_SINK_TRANSLATE_CTF_IR_TO_TSDL_HPP */ diff --git a/src/plugins/ctf/fs-sink/translate-trace-ir-to-ctf-ir.hpp b/src/plugins/ctf/fs-sink/translate-trace-ir-to-ctf-ir.hpp index 5a3fda6c..b371ab63 100644 --- a/src/plugins/ctf/fs-sink/translate-trace-ir-to-ctf-ir.hpp +++ b/src/plugins/ctf/fs-sink/translate-trace-ir-to-ctf-ir.hpp @@ -4,8 +4,8 @@ * Copyright 2019 Philippe Proulx */ -#ifndef BABELTRACE_PLUGIN_CTF_FS_SINK_TRANSLATE_TRACE_IR_TO_CTF_IR_H -#define BABELTRACE_PLUGIN_CTF_FS_SINK_TRANSLATE_TRACE_IR_TO_CTF_IR_H +#ifndef BABELTRACE_PLUGINS_CTF_FS_SINK_TRANSLATE_TRACE_IR_TO_CTF_IR_HPP +#define BABELTRACE_PLUGINS_CTF_FS_SINK_TRANSLATE_TRACE_IR_TO_CTF_IR_HPP #include @@ -22,4 +22,4 @@ int try_translate_stream_class_trace_ir_to_ctf_ir(struct fs_sink_comp *fs_sink, struct fs_sink_ctf_trace *translate_trace_trace_ir_to_ctf_ir(struct fs_sink_comp *fs_sink, const bt_trace *ir_trace); -#endif /* BABELTRACE_PLUGIN_CTF_FS_SINK_TRANSLATE_TRACE_IR_TO_CTF_IR_H */ +#endif /* BABELTRACE_PLUGINS_CTF_FS_SINK_TRANSLATE_TRACE_IR_TO_CTF_IR_HPP */ diff --git a/src/plugins/ctf/fs-src/data-stream-file.hpp b/src/plugins/ctf/fs-src/data-stream-file.hpp index 05a6db13..eb20944d 100644 --- a/src/plugins/ctf/fs-src/data-stream-file.hpp +++ b/src/plugins/ctf/fs-src/data-stream-file.hpp @@ -4,8 +4,8 @@ * Copyright (C) 2016 Philippe Proulx */ -#ifndef CTF_FS_DS_FILE_H -#define CTF_FS_DS_FILE_H +#ifndef BABELTRACE_PLUGINS_CTF_FS_SRC_DATA_STREAM_FILE_HPP +#define BABELTRACE_PLUGINS_CTF_FS_SRC_DATA_STREAM_FILE_HPP #include #include @@ -201,4 +201,4 @@ ctf_fs_ds_group_medops_data_create(struct ctf_fs_ds_file_group *ds_file_group, void ctf_fs_ds_group_medops_data_reset(struct ctf_fs_ds_group_medops_data *data); -#endif /* CTF_FS_DS_FILE_H */ +#endif /* BABELTRACE_PLUGINS_CTF_FS_SRC_DATA_STREAM_FILE_HPP */ diff --git a/src/plugins/ctf/fs-src/file.hpp b/src/plugins/ctf/fs-src/file.hpp index ee6441cb..5516f44c 100644 --- a/src/plugins/ctf/fs-src/file.hpp +++ b/src/plugins/ctf/fs-src/file.hpp @@ -4,8 +4,8 @@ * Copyright (C) 2016 Philippe Proulx */ -#ifndef CTF_FS_FILE_H -#define CTF_FS_FILE_H +#ifndef BABELTRACE_PLUGINS_CTF_FS_SRC_FILE_HPP +#define BABELTRACE_PLUGINS_CTF_FS_SRC_FILE_HPP #include #include @@ -35,4 +35,4 @@ struct ctf_fs_file int ctf_fs_file_open(struct ctf_fs_file *file, const char *mode); -#endif /* CTF_FS_FILE_H */ +#endif /* BABELTRACE_PLUGINS_CTF_FS_SRC_FILE_HPP */ diff --git a/src/plugins/ctf/fs-src/fs.hpp b/src/plugins/ctf/fs-src/fs.hpp index c9ca2a90..4f7837d6 100644 --- a/src/plugins/ctf/fs-src/fs.hpp +++ b/src/plugins/ctf/fs-src/fs.hpp @@ -7,8 +7,8 @@ * BabelTrace - CTF on File System Component */ -#ifndef BABELTRACE_PLUGIN_CTF_FS_H -#define BABELTRACE_PLUGIN_CTF_FS_H +#ifndef BABELTRACE_PLUGINS_CTF_FS_SRC_FS_HPP +#define BABELTRACE_PLUGINS_CTF_FS_SRC_FS_HPP #include @@ -95,8 +95,8 @@ struct ctf_fs_msg_iter_data using UP = std::unique_ptr; explicit ctf_fs_msg_iter_data(bt_self_message_iterator *selfMsgIter) : - self_msg_iter {selfMsgIter}, logger {bt2::SelfMessageIterator {self_msg_iter}, - "PLUGIN/SRC.CTF.FS/MSG-ITER"} + self_msg_iter {selfMsgIter}, + logger {bt2::SelfMessageIterator {self_msg_iter}, "PLUGIN/SRC.CTF.FS/MSG-ITER"} { } @@ -199,4 +199,4 @@ ctf::src::fs::Parameters read_src_fs_parameters(bt2::ConstMapValue params, std::string ctf_fs_make_port_name(ctf_fs_ds_file_group *ds_file_group); -#endif /* BABELTRACE_PLUGIN_CTF_FS_H */ +#endif /* BABELTRACE_PLUGINS_CTF_FS_SRC_FS_HPP */ diff --git a/src/plugins/ctf/fs-src/lttng-index.hpp b/src/plugins/ctf/fs-src/lttng-index.hpp index 36dc7cc9..3faccb09 100644 --- a/src/plugins/ctf/fs-src/lttng-index.hpp +++ b/src/plugins/ctf/fs-src/lttng-index.hpp @@ -6,8 +6,8 @@ * Copyright (C) 2013 David Goulet */ -#ifndef LTTNG_INDEX_H -#define LTTNG_INDEX_H +#ifndef BABELTRACE_PLUGINS_CTF_FS_SRC_LTTNG_INDEX_HPP +#define BABELTRACE_PLUGINS_CTF_FS_SRC_LTTNG_INDEX_HPP #include @@ -49,4 +49,4 @@ struct ctf_packet_index uint64_t packet_seq_num; /* packet sequence number */ } __attribute__((__packed__)); -#endif /* LTTNG_INDEX_H */ +#endif /* BABELTRACE_PLUGINS_CTF_FS_SRC_LTTNG_INDEX_HPP */ diff --git a/src/plugins/ctf/fs-src/metadata.hpp b/src/plugins/ctf/fs-src/metadata.hpp index 14d7cc19..bab69e26 100644 --- a/src/plugins/ctf/fs-src/metadata.hpp +++ b/src/plugins/ctf/fs-src/metadata.hpp @@ -4,8 +4,8 @@ * Copyright 2016 Philippe Proulx */ -#ifndef CTF_FS_METADATA_H -#define CTF_FS_METADATA_H +#ifndef BABELTRACE_PLUGINS_CTF_FS_SRC_METADATA_HPP +#define BABELTRACE_PLUGINS_CTF_FS_SRC_METADATA_HPP #include @@ -28,4 +28,4 @@ FILE *ctf_fs_metadata_open_file(const char *trace_path, const bt2c::Logger& logg bool ctf_metadata_is_packetized(FILE *fp, int *byte_order); -#endif /* CTF_FS_METADATA_H */ +#endif /* BABELTRACE_PLUGINS_CTF_FS_SRC_METADATA_HPP */ diff --git a/src/plugins/ctf/fs-src/query.cpp b/src/plugins/ctf/fs-src/query.cpp index 0b700e91..4143f9c0 100644 --- a/src/plugins/ctf/fs-src/query.cpp +++ b/src/plugins/ctf/fs-src/query.cpp @@ -74,7 +74,7 @@ bt2::Value::Shared metadata_info_query(const bt2::ConstMapValue params, const bt ctf_metadata_decoder_up decoder = ctf_metadata_decoder_create(&decoder_cfg); if (!decoder) { BT_CPPLOGE_APPEND_CAUSE_AND_THROW_SPEC( - logger, bt2::Error, "Cannot create metadata decoder: path=\"{}}\".", path); + logger, bt2::Error, "Cannot create metadata decoder: path=\"{}\".", path); } rewind(metadataFp.get()); diff --git a/src/plugins/ctf/fs-src/query.hpp b/src/plugins/ctf/fs-src/query.hpp index 2c7aca09..f5066120 100644 --- a/src/plugins/ctf/fs-src/query.hpp +++ b/src/plugins/ctf/fs-src/query.hpp @@ -6,8 +6,8 @@ * BabelTrace - CTF on File System Component */ -#ifndef BABELTRACE_PLUGIN_CTF_FS_QUERY_H -#define BABELTRACE_PLUGIN_CTF_FS_QUERY_H +#ifndef BABELTRACE_PLUGINS_CTF_FS_SRC_QUERY_HPP +#define BABELTRACE_PLUGINS_CTF_FS_SRC_QUERY_HPP #include "cpp-common/bt2/value.hpp" @@ -23,4 +23,4 @@ bt2::Value::Shared trace_infos_query(bt2::ConstMapValue params, const bt2c::Logg bt2::Value::Shared support_info_query(bt2::ConstMapValue params, const bt2c::Logger& logger); -#endif /* BABELTRACE_PLUGIN_CTF_FS_QUERY_H */ +#endif /* BABELTRACE_PLUGINS_CTF_FS_SRC_QUERY_HPP */ diff --git a/src/plugins/ctf/lttng-live/data-stream.hpp b/src/plugins/ctf/lttng-live/data-stream.hpp index 675bbdbb..9ad85bba 100644 --- a/src/plugins/ctf/lttng-live/data-stream.hpp +++ b/src/plugins/ctf/lttng-live/data-stream.hpp @@ -4,8 +4,8 @@ * Copyright 2016 Philippe Proulx */ -#ifndef LTTNG_LIVE_DATA_STREAM_H -#define LTTNG_LIVE_DATA_STREAM_H +#ifndef BABELTRACE_PLUGINS_CTF_LTTNG_LIVE_DATA_STREAM_HPP +#define BABELTRACE_PLUGINS_CTF_LTTNG_LIVE_DATA_STREAM_HPP #include @@ -18,4 +18,4 @@ struct lttng_live_stream_iterator * lttng_live_stream_iterator_create(struct lttng_live_session *session, uint64_t ctf_trace_id, uint64_t stream_id, bt_self_message_iterator *self_msg_iter); -#endif /* LTTNG_LIVE_DATA_STREAM_H */ +#endif /* BABELTRACE_PLUGINS_CTF_LTTNG_LIVE_DATA_STREAM_HPP */ diff --git a/src/plugins/ctf/lttng-live/lttng-live.hpp b/src/plugins/ctf/lttng-live/lttng-live.hpp index 9dbc432a..be2689ce 100644 --- a/src/plugins/ctf/lttng-live/lttng-live.hpp +++ b/src/plugins/ctf/lttng-live/lttng-live.hpp @@ -8,8 +8,8 @@ * BabelTrace - LTTng-live client Component */ -#ifndef BABELTRACE_PLUGIN_CTF_LTTNG_LIVE_H -#define BABELTRACE_PLUGIN_CTF_LTTNG_LIVE_H +#ifndef BABELTRACE_PLUGINS_CTF_LTTNG_LIVE_LTTNG_LIVE_HPP +#define BABELTRACE_PLUGINS_CTF_LTTNG_LIVE_LTTNG_LIVE_HPP #include #include @@ -451,4 +451,4 @@ bool lttng_live_graph_is_canceled(struct lttng_live_msg_iter *msg_iter); void lttng_live_stream_iterator_set_state(struct lttng_live_stream_iterator *stream_iter, enum lttng_live_stream_state new_state); -#endif /* BABELTRACE_PLUGIN_CTF_LTTNG_LIVE_H */ +#endif /* BABELTRACE_PLUGINS_CTF_LTTNG_LIVE_LTTNG_LIVE_HPP */ diff --git a/src/plugins/ctf/lttng-live/lttng-viewer-abi.hpp b/src/plugins/ctf/lttng-live/lttng-viewer-abi.hpp index 926ace11..e4d480f6 100644 --- a/src/plugins/ctf/lttng-live/lttng-viewer-abi.hpp +++ b/src/plugins/ctf/lttng-live/lttng-viewer-abi.hpp @@ -6,8 +6,8 @@ * Copyright (C) 2013 David Goulet */ -#ifndef LTTNG_VIEWER_ABI_H -#define LTTNG_VIEWER_ABI_H +#ifndef BABELTRACE_PLUGINS_CTF_LTTNG_LIVE_LTTNG_VIEWER_ABI_HPP +#define BABELTRACE_PLUGINS_CTF_LTTNG_LIVE_LTTNG_VIEWER_ABI_HPP #include @@ -359,4 +359,4 @@ struct lttng_viewer_detach_session_response uint32_t status; } __attribute__((__packed__)); -#endif /* LTTNG_VIEWER_ABI_H */ +#endif /* BABELTRACE_PLUGINS_CTF_LTTNG_LIVE_LTTNG_VIEWER_ABI_HPP */ diff --git a/src/plugins/ctf/lttng-live/metadata.hpp b/src/plugins/ctf/lttng-live/metadata.hpp index 7c2d7659..2a02032c 100644 --- a/src/plugins/ctf/lttng-live/metadata.hpp +++ b/src/plugins/ctf/lttng-live/metadata.hpp @@ -4,8 +4,8 @@ * Copyright 2016 Philippe Proulx */ -#ifndef LTTNG_LIVE_METADATA_H -#define LTTNG_LIVE_METADATA_H +#ifndef BABELTRACE_PLUGINS_CTF_LTTNG_LIVE_METADATA_HPP +#define BABELTRACE_PLUGINS_CTF_LTTNG_LIVE_METADATA_HPP #include @@ -16,4 +16,4 @@ int lttng_live_metadata_create_stream(struct lttng_live_session *session, uint64 enum lttng_live_iterator_status lttng_live_metadata_update(struct lttng_live_trace *trace); -#endif /* LTTNG_LIVE_METADATA_H */ +#endif /* BABELTRACE_PLUGINS_CTF_LTTNG_LIVE_METADATA_HPP */ diff --git a/src/plugins/ctf/lttng-live/viewer-connection.hpp b/src/plugins/ctf/lttng-live/viewer-connection.hpp index 0f284581..9610a15e 100644 --- a/src/plugins/ctf/lttng-live/viewer-connection.hpp +++ b/src/plugins/ctf/lttng-live/viewer-connection.hpp @@ -4,8 +4,8 @@ * Copyright 2016 Mathieu Desnoyers */ -#ifndef LTTNG_LIVE_VIEWER_CONNECTION_H -#define LTTNG_LIVE_VIEWER_CONNECTION_H +#ifndef BABELTRACE_PLUGINS_CTF_LTTNG_LIVE_VIEWER_CONNECTION_HPP +#define BABELTRACE_PLUGINS_CTF_LTTNG_LIVE_VIEWER_CONNECTION_HPP #include @@ -111,4 +111,4 @@ lttng_live_create_viewer_session(struct lttng_live_msg_iter *lttng_live_msg_iter bt2::Value::Shared live_viewer_connection_list_sessions(struct live_viewer_connection *viewer_connection); -#endif /* LTTNG_LIVE_VIEWER_CONNECTION_H */ +#endif /* BABELTRACE_PLUGINS_CTF_LTTNG_LIVE_VIEWER_CONNECTION_HPP */ diff --git a/src/plugins/lttng-utils/debug-info/bin-info.h b/src/plugins/lttng-utils/debug-info/bin-info.h index cd9b9d61..2a641691 100644 --- a/src/plugins/lttng-utils/debug-info/bin-info.h +++ b/src/plugins/lttng-utils/debug-info/bin-info.h @@ -6,8 +6,8 @@ * Babeltrace - Executable and Shared Object Debug Info Reader */ -#ifndef _BABELTRACE_BIN_INFO_H -#define _BABELTRACE_BIN_INFO_H +#ifndef BABELTRACE_PLUGINS_LTTNG_UTILS_DEBUG_INFO_BIN_INFO_H +#define BABELTRACE_PLUGINS_LTTNG_UTILS_DEBUG_INFO_BIN_INFO_H #include #include @@ -218,4 +218,4 @@ int bin_info_get_bin_loc(struct bin_info *bin, uint64_t addr, char **bin_loc); */ void source_location_destroy(struct source_location *src_loc); -#endif /* _BABELTRACE_BIN_INFO_H */ +#endif /* BABELTRACE_PLUGINS_LTTNG_UTILS_DEBUG_INFO_BIN_INFO_H */ diff --git a/src/plugins/lttng-utils/debug-info/crc32.h b/src/plugins/lttng-utils/debug-info/crc32.h index 7e1e254c..5dedda43 100644 --- a/src/plugins/lttng-utils/debug-info/crc32.h +++ b/src/plugins/lttng-utils/debug-info/crc32.h @@ -4,8 +4,8 @@ * Copyright (c) 1991, 1993 The Regents of the University of California. */ -#ifndef _BABELTRACE_CRC32_H -#define _BABELTRACE_CRC32_H +#ifndef BABELTRACE_PLUGINS_LTTNG_UTILS_DEBUG_INFO_CRC32_H +#define BABELTRACE_PLUGINS_LTTNG_UTILS_DEBUG_INFO_CRC32_H #include #include @@ -24,4 +24,4 @@ */ int crc32(int fd, uint32_t *crc); -#endif /* _BABELTRACE_CRC32_H */ +#endif /* BABELTRACE_PLUGINS_LTTNG_UTILS_DEBUG_INFO_CRC32_H */ diff --git a/src/plugins/lttng-utils/debug-info/debug-info.h b/src/plugins/lttng-utils/debug-info/debug-info.h index 8a7e8ea0..5877a056 100644 --- a/src/plugins/lttng-utils/debug-info/debug-info.h +++ b/src/plugins/lttng-utils/debug-info/debug-info.h @@ -8,8 +8,8 @@ * Babeltrace - Debug information Plugin */ -#ifndef BABELTRACE_PLUGIN_DEBUG_INFO_H -#define BABELTRACE_PLUGIN_DEBUG_INFO_H +#ifndef BABELTRACE_PLUGINS_LTTNG_UTILS_DEBUG_INFO_DEBUG_INFO_H +#define BABELTRACE_PLUGINS_LTTNG_UTILS_DEBUG_INFO_DEBUG_INFO_H #include #include @@ -55,4 +55,4 @@ bt_message_iterator_class_seek_beginning_method_status debug_info_msg_iter_seek_ void debug_info_msg_iter_finalize(bt_self_message_iterator *it); -#endif /* BABELTRACE_PLUGIN_DEBUG_INFO_H */ +#endif /* BABELTRACE_PLUGINS_LTTNG_UTILS_DEBUG_INFO_DEBUG_INFO_H */ diff --git a/src/plugins/lttng-utils/debug-info/dwarf.h b/src/plugins/lttng-utils/debug-info/dwarf.h index 2a446b19..288eb9c2 100644 --- a/src/plugins/lttng-utils/debug-info/dwarf.h +++ b/src/plugins/lttng-utils/debug-info/dwarf.h @@ -6,8 +6,8 @@ * Babeltrace - DWARF Information Reader */ -#ifndef _BABELTRACE_DWARF_H -#define _BABELTRACE_DWARF_H +#ifndef BABELTRACE_PLUGINS_LTTNG_UTILS_DEBUG_INFO_DWARF_H +#define BABELTRACE_PLUGINS_LTTNG_UTILS_DEBUG_INFO_DWARF_H #include #include @@ -201,4 +201,4 @@ int bt_dwarf_die_get_call_line(struct bt_dwarf_die *die, int bt_dwarf_die_contains_addr(struct bt_dwarf_die *die, uint64_t addr, bool *contains); -#endif /* _BABELTRACE_DWARF_H */ +#endif /* BABELTRACE_PLUGINS_LTTNG_UTILS_DEBUG_INFO_DWARF_H */ diff --git a/src/plugins/lttng-utils/debug-info/trace-ir-data-copy.h b/src/plugins/lttng-utils/debug-info/trace-ir-data-copy.h index 319d366b..847befa1 100644 --- a/src/plugins/lttng-utils/debug-info/trace-ir-data-copy.h +++ b/src/plugins/lttng-utils/debug-info/trace-ir-data-copy.h @@ -7,8 +7,8 @@ * Babeltrace - Trace IR data object copy */ -#ifndef BABELTRACE_PLUGIN_DEBUG_INFO_TRACE_DATA_COPY_H -#define BABELTRACE_PLUGIN_DEBUG_INFO_TRACE_DATA_COPY_H +#ifndef BABELTRACE_PLUGINS_LTTNG_UTILS_DEBUG_INFO_TRACE_IR_DATA_COPY_H +#define BABELTRACE_PLUGINS_LTTNG_UTILS_DEBUG_INFO_TRACE_IR_DATA_COPY_H #include @@ -31,4 +31,4 @@ enum debug_info_trace_ir_mapping_status copy_field_content( const bt_field *in_field, bt_field *out_field, bt_logging_level log_level, bt_self_component *self_comp); -#endif /* BABELTRACE_PLUGIN_DEBUG_INFO_TRACE_DATA_COPY_H */ +#endif /* BABELTRACE_PLUGINS_LTTNG_UTILS_DEBUG_INFO_TRACE_IR_DATA_COPY_H */ diff --git a/src/plugins/lttng-utils/debug-info/trace-ir-mapping.h b/src/plugins/lttng-utils/debug-info/trace-ir-mapping.h index 37da3bcf..b4d7445b 100644 --- a/src/plugins/lttng-utils/debug-info/trace-ir-mapping.h +++ b/src/plugins/lttng-utils/debug-info/trace-ir-mapping.h @@ -4,8 +4,8 @@ * Copyright 2019 Francis Deslauriers francis.deslauriers@efficios.com> */ -#ifndef BABELTRACE_PLUGIN_DEBUG_INFO_TRACE_IR_MAPPING_H -#define BABELTRACE_PLUGIN_DEBUG_INFO_TRACE_IR_MAPPING_H +#ifndef BABELTRACE_PLUGINS_LTTNG_UTILS_DEBUG_INFO_TRACE_IR_MAPPING_H +#define BABELTRACE_PLUGINS_LTTNG_UTILS_DEBUG_INFO_TRACE_IR_MAPPING_H #include @@ -261,4 +261,4 @@ struct trace_ir_metadata_maps *borrow_metadata_maps_from_input_event_class( bt_event_class_borrow_stream_class_const(in_event_class)); } -#endif /* BABELTRACE_PLUGIN_DEBUG_INFO_TRACE_IR_MAPPING_H */ +#endif /* BABELTRACE_PLUGINS_LTTNG_UTILS_DEBUG_INFO_TRACE_IR_MAPPING_H */ diff --git a/src/plugins/lttng-utils/debug-info/trace-ir-metadata-copy.h b/src/plugins/lttng-utils/debug-info/trace-ir-metadata-copy.h index b853ada9..06c99035 100644 --- a/src/plugins/lttng-utils/debug-info/trace-ir-metadata-copy.h +++ b/src/plugins/lttng-utils/debug-info/trace-ir-metadata-copy.h @@ -8,8 +8,8 @@ * Babeltrace - Trace IR metadata object copy */ -#ifndef BABELTRACE_PLUGIN_DEBUG_INFO_TRACE_METADATA_COPY_H -#define BABELTRACE_PLUGIN_DEBUG_INFO_TRACE_METADATA_COPY_H +#ifndef BABELTRACE_PLUGINS_LTTNG_UTILS_DEBUG_INFO_TRACE_IR_METADATA_COPY_H +#define BABELTRACE_PLUGINS_LTTNG_UTILS_DEBUG_INFO_TRACE_IR_METADATA_COPY_H #include #include "common/macros.h" @@ -47,4 +47,4 @@ bt_field_class *create_field_class_copy( struct trace_ir_metadata_maps *trace_ir_metadata_maps, const bt_field_class *in_field_class); -#endif /* BABELTRACE_PLUGIN_DEBUG_INFO_TRACE_METADATA_COPY_H */ +#endif /* BABELTRACE_PLUGINS_LTTNG_UTILS_DEBUG_INFO_TRACE_IR_METADATA_COPY_H */ diff --git a/src/plugins/lttng-utils/debug-info/trace-ir-metadata-field-class-copy.h b/src/plugins/lttng-utils/debug-info/trace-ir-metadata-field-class-copy.h index 65c6ecd7..84802c9d 100644 --- a/src/plugins/lttng-utils/debug-info/trace-ir-metadata-field-class-copy.h +++ b/src/plugins/lttng-utils/debug-info/trace-ir-metadata-field-class-copy.h @@ -7,8 +7,8 @@ * Babeltrace - Trace IR metadata field class copy */ -#ifndef BABELTRACE_PLUGIN_DEBUG_INFO_FIELD_CLASS_COPY_H -#define BABELTRACE_PLUGIN_DEBUG_INFO_FIELD_CLASS_COPY_H +#ifndef BABELTRACE_PLUGINS_LTTNG_UTILS_DEBUG_INFO_TRACE_IR_METADATA_FIELD_CLASS_COPY_H +#define BABELTRACE_PLUGINS_LTTNG_UTILS_DEBUG_INFO_TRACE_IR_METADATA_FIELD_CLASS_COPY_H #include #include "common/macros.h" @@ -23,4 +23,4 @@ bt_field_class *create_field_class_copy_internal( struct trace_ir_metadata_maps *trace_ir_metadata_maps, const bt_field_class *in_field_class); -#endif /* BABELTRACE_PLUGIN_DEBUG_INFO_FIELD_CLASS_COPY_H */ +#endif /* BABELTRACE_PLUGINS_LTTNG_UTILS_DEBUG_INFO_TRACE_IR_METADATA_FIELD_CLASS_COPY_H */ diff --git a/src/plugins/lttng-utils/debug-info/utils.h b/src/plugins/lttng-utils/debug-info/utils.h index 27cf93ec..4d9310d9 100644 --- a/src/plugins/lttng-utils/debug-info/utils.h +++ b/src/plugins/lttng-utils/debug-info/utils.h @@ -6,8 +6,8 @@ * Babeltrace - Debug Info Utilities */ -#ifndef BABELTRACE_PLUGIN_DEBUG_INFO_UTILS_H -#define BABELTRACE_PLUGIN_DEBUG_INFO_UTILS_H +#ifndef BABELTRACE_PLUGINS_LTTNG_UTILS_DEBUG_INFO_UTILS_H +#define BABELTRACE_PLUGINS_LTTNG_UTILS_DEBUG_INFO_UTILS_H #include @@ -25,4 +25,4 @@ bool is_event_common_ctx_dbg_info_compatible( const bt_field_class *in_field_class, const char *debug_info_field_class_name); -#endif /* BABELTRACE_PLUGIN_DEBUG_INFO_UTILS_H */ +#endif /* BABELTRACE_PLUGINS_LTTNG_UTILS_DEBUG_INFO_UTILS_H */ diff --git a/src/plugins/text/dmesg/dmesg.h b/src/plugins/text/dmesg/dmesg.h index f4cb3dc1..e3759318 100644 --- a/src/plugins/text/dmesg/dmesg.h +++ b/src/plugins/text/dmesg/dmesg.h @@ -4,8 +4,8 @@ * Copyright 2017 Philippe Proulx */ -#ifndef BABELTRACE_PLUGIN_TEXT_DMESG_DMESG_H -#define BABELTRACE_PLUGIN_TEXT_DMESG_DMESG_H +#ifndef BABELTRACE_PLUGINS_TEXT_DMESG_DMESG_H +#define BABELTRACE_PLUGINS_TEXT_DMESG_DMESG_H #include #include "common/macros.h" @@ -38,4 +38,4 @@ dmesg_msg_iter_can_seek_beginning( bt_message_iterator_class_seek_beginning_method_status dmesg_msg_iter_seek_beginning( bt_self_message_iterator *message_iterator); -#endif /* BABELTRACE_PLUGIN_TEXT_DMESG_DMESG_H */ +#endif /* BABELTRACE_PLUGINS_TEXT_DMESG_DMESG_H */ diff --git a/src/plugins/text/pretty/pretty.h b/src/plugins/text/pretty/pretty.h index b73f3345..f19b18c1 100644 --- a/src/plugins/text/pretty/pretty.h +++ b/src/plugins/text/pretty/pretty.h @@ -4,8 +4,8 @@ * Copyright 2016 Jérémie Galarneau */ -#ifndef BABELTRACE_PLUGIN_TEXT_PRETTY_PRETTY_H -#define BABELTRACE_PLUGIN_TEXT_PRETTY_PRETTY_H +#ifndef BABELTRACE_PLUGINS_TEXT_PRETTY_PRETTY_H +#define BABELTRACE_PLUGINS_TEXT_PRETTY_PRETTY_H #include #include @@ -117,4 +117,4 @@ int pretty_print_discarded_items(struct pretty_component *pretty, void pretty_print_init(void); -#endif /* BABELTRACE_PLUGIN_TEXT_PRETTY_PRETTY_H */ +#endif /* BABELTRACE_PLUGINS_TEXT_PRETTY_PRETTY_H */ diff --git a/src/plugins/utils/counter/counter.h b/src/plugins/utils/counter/counter.h index ad886bb3..302d6993 100644 --- a/src/plugins/utils/counter/counter.h +++ b/src/plugins/utils/counter/counter.h @@ -4,8 +4,8 @@ * Copyright 2017 Philippe Proulx */ -#ifndef BABELTRACE_PLUGINS_UTILS_COUNTER_H -#define BABELTRACE_PLUGINS_UTILS_COUNTER_H +#ifndef BABELTRACE_PLUGINS_UTILS_COUNTER_COUNTER_H +#define BABELTRACE_PLUGINS_UTILS_COUNTER_COUNTER_H #include #include @@ -54,4 +54,4 @@ bt_component_class_sink_consume_method_status counter_consume(bt_self_component_ } #endif -#endif /* BABELTRACE_PLUGINS_UTILS_COUNTER_H */ +#endif /* BABELTRACE_PLUGINS_UTILS_COUNTER_COUNTER_H */ diff --git a/src/plugins/utils/dummy/dummy.h b/src/plugins/utils/dummy/dummy.h index 0a7c6a95..29e4e7cd 100644 --- a/src/plugins/utils/dummy/dummy.h +++ b/src/plugins/utils/dummy/dummy.h @@ -4,8 +4,8 @@ * Copyright 2017 Philippe Proulx */ -#ifndef BABELTRACE_PLUGINS_UTILS_DUMMY_H -#define BABELTRACE_PLUGINS_UTILS_DUMMY_H +#ifndef BABELTRACE_PLUGINS_UTILS_DUMMY_DUMMY_H +#define BABELTRACE_PLUGINS_UTILS_DUMMY_DUMMY_H #include #include @@ -36,4 +36,4 @@ bt_component_class_sink_consume_method_status dummy_consume( } #endif -#endif /* BABELTRACE_PLUGINS_UTILS_DUMMY_H */ +#endif /* BABELTRACE_PLUGINS_UTILS_DUMMY_DUMMY_H */ diff --git a/src/plugins/utils/muxer/upstream-msg-iter.hpp b/src/plugins/utils/muxer/upstream-msg-iter.hpp index 4d89da39..ff24cb36 100644 --- a/src/plugins/utils/muxer/upstream-msg-iter.hpp +++ b/src/plugins/utils/muxer/upstream-msg-iter.hpp @@ -1,4 +1,3 @@ - /* * SPDX-License-Identifier: MIT * diff --git a/src/plugins/utils/trimmer/trimmer.h b/src/plugins/utils/trimmer/trimmer.h index 0cb997a4..d61374f8 100644 --- a/src/plugins/utils/trimmer/trimmer.h +++ b/src/plugins/utils/trimmer/trimmer.h @@ -6,8 +6,8 @@ * BabelTrace - Trace Trimmer Plug-in */ -#ifndef BABELTRACE_PLUGINS_UTILS_TRIMMER_H -#define BABELTRACE_PLUGINS_UTILS_TRIMMER_H +#ifndef BABELTRACE_PLUGINS_UTILS_TRIMMER_TRIMMER_H +#define BABELTRACE_PLUGINS_UTILS_TRIMMER_TRIMMER_H #include "common/macros.h" #include @@ -39,4 +39,4 @@ void trimmer_msg_iter_finalize(bt_self_message_iterator *self_msg_iter); } #endif -#endif /* BABELTRACE_PLUGINS_UTILS_TRIMMER_H */ +#endif /* BABELTRACE_PLUGINS_UTILS_TRIMMER_TRIMMER_H */ diff --git a/src/py-common/py-common.h b/src/py-common/py-common.h index 7d4e3f14..6ba19590 100644 --- a/src/py-common/py-common.h +++ b/src/py-common/py-common.h @@ -6,8 +6,8 @@ * Copyright (c) 2019 Simon Marchi */ -#ifndef BABELTRACE_PY_COMMON_INTERNAL_H -#define BABELTRACE_PY_COMMON_INTERNAL_H +#ifndef BABELTRACE_PY_COMMON_PY_COMMON_H +#define BABELTRACE_PY_COMMON_PY_COMMON_H #include #include @@ -46,4 +46,4 @@ GString *bt_py_common_format_exception(PyObject *py_exc_type, */ GString *bt_py_common_format_current_exception(int log_level); -#endif /* BABELTRACE_PY_COMMON_INTERNAL_H */ +#endif /* BABELTRACE_PY_COMMON_PY_COMMON_H */ diff --git a/src/python-plugin-provider/python-plugin-provider.h b/src/python-plugin-provider/python-plugin-provider.h index 74694714..3393cba2 100644 --- a/src/python-plugin-provider/python-plugin-provider.h +++ b/src/python-plugin-provider/python-plugin-provider.h @@ -4,8 +4,8 @@ * Copyright 2017-2018 Philippe Proulx */ -#ifndef BABELTRACE_PLUGIN_PYTHON_PLUGIN_PROVIDER_INTERNAL_H -#define BABELTRACE_PLUGIN_PYTHON_PLUGIN_PROVIDER_INTERNAL_H +#ifndef BABELTRACE_PYTHON_PLUGIN_PROVIDER_PYTHON_PLUGIN_PROVIDER_H +#define BABELTRACE_PYTHON_PLUGIN_PROVIDER_PYTHON_PLUGIN_PROVIDER_H #include #include @@ -15,4 +15,4 @@ int bt_plugin_python_create_all_from_file(const char *path, bool fail_on_load_error, struct bt_plugin_set **plugin_set_out); -#endif /* BABELTRACE_PLUGIN_PYTHON_PLUGIN_PROVIDER_INTERNAL_H */ +#endif /* BABELTRACE_PYTHON_PLUGIN_PROVIDER_PYTHON_PLUGIN_PROVIDER_H */ diff --git a/src/string-format/format-error.h b/src/string-format/format-error.h index 25da4648..799c397f 100644 --- a/src/string-format/format-error.h +++ b/src/string-format/format-error.h @@ -4,8 +4,8 @@ * Copyright (C) 2019 EfficiOS, Inc. */ -#ifndef _BABELTRACE_STRING_FORMAT_FORMAT_ERROR_H -#define _BABELTRACE_STRING_FORMAT_FORMAT_ERROR_H +#ifndef BABELTRACE_STRING_FORMAT_FORMAT_ERROR_H +#define BABELTRACE_STRING_FORMAT_FORMAT_ERROR_H #include #include @@ -24,4 +24,4 @@ gchar *format_bt_error( bt_logging_level log_level, enum bt_common_color_when use_colors); -#endif /* _BABELTRACE_STRING_FORMAT_FORMAT_ERROR_H */ +#endif /* BABELTRACE_STRING_FORMAT_FORMAT_ERROR_H */ diff --git a/src/string-format/format-plugin-comp-cls-name.h b/src/string-format/format-plugin-comp-cls-name.h index 25050042..3508da33 100644 --- a/src/string-format/format-plugin-comp-cls-name.h +++ b/src/string-format/format-plugin-comp-cls-name.h @@ -4,8 +4,8 @@ * Copyright (C) 2019 EfficiOS, Inc. */ -#ifndef _BABELTRACE_STRING_FORMAT_FORMAT_PLUGIN_COMP_CLS_NAME_H -#define _BABELTRACE_STRING_FORMAT_FORMAT_PLUGIN_COMP_CLS_NAME_H +#ifndef BABELTRACE_STRING_FORMAT_FORMAT_PLUGIN_COMP_CLS_NAME_H +#define BABELTRACE_STRING_FORMAT_FORMAT_PLUGIN_COMP_CLS_NAME_H #include #include @@ -16,4 +16,4 @@ gchar *format_plugin_comp_cls_opt(const char *plugin_name, const char *comp_cls_name, bt_component_class_type type, enum bt_common_color_when use_colors); -#endif /* _BABELTRACE_STRING_FORMAT_FORMAT_PLUGIN_COMP_CLS_NAME_H */ +#endif /* BABELTRACE_STRING_FORMAT_FORMAT_PLUGIN_COMP_CLS_NAME_H */ diff --git a/tests/data/plugins/flt.lttng-utils.debug-info/libhello.h b/tests/data/plugins/flt.lttng-utils.debug-info/libhello.h index 173ffeb0..ada3bbf1 100644 --- a/tests/data/plugins/flt.lttng-utils.debug-info/libhello.h +++ b/tests/data/plugins/flt.lttng-utils.debug-info/libhello.h @@ -6,11 +6,11 @@ * Debug Info - Tests */ -#ifndef _LIBHELLO_H -#define _LIBHELLO_H +#ifndef BABELTRACE_TESTS_DATA_PLUGINS_FLT_LTTNG_UTILS_DEBUG_INFO_LIBHELLO_H +#define BABELTRACE_TESTS_DATA_PLUGINS_FLT_LTTNG_UTILS_DEBUG_INFO_LIBHELLO_H void foo(); void bar(); void baz(); -#endif /* _LIBHELLO_H */ +#endif /* BABELTRACE_TESTS_DATA_PLUGINS_FLT_LTTNG_UTILS_DEBUG_INFO_LIBHELLO_H */ diff --git a/tests/lib/conds/clk-cls-compat-postconds-triggers.cpp b/tests/lib/conds/clk-cls-compat-postconds-triggers.cpp index aa7e6876..5f5cbed0 100644 --- a/tests/lib/conds/clk-cls-compat-postconds-triggers.cpp +++ b/tests/lib/conds/clk-cls-compat-postconds-triggers.cpp @@ -31,8 +31,8 @@ public: const MsgType msgType2, const CreateClockCls createClockCls2) noexcept : _mMsgType1 {msgType1}, - _mMsgType2 {msgType2}, _mCreateClockCls1 {createClockCls1}, _mCreateClockCls2 { - createClockCls2} + _mMsgType2 {msgType2}, _mCreateClockCls1 {createClockCls1}, + _mCreateClockCls2 {createClockCls2} { } diff --git a/tests/lib/conds/clk-cls-compat-postconds-triggers.hpp b/tests/lib/conds/clk-cls-compat-postconds-triggers.hpp index cabf25cf..7f28e20f 100644 --- a/tests/lib/conds/clk-cls-compat-postconds-triggers.hpp +++ b/tests/lib/conds/clk-cls-compat-postconds-triggers.hpp @@ -4,11 +4,11 @@ * Copyright (C) 2024 EfficiOS Inc. */ -#ifndef TESTS_LIB_CONDS_CLK_CLS_COMPAT_POSTCONDS_TRIGGERS_HPP -#define TESTS_LIB_CONDS_CLK_CLS_COMPAT_POSTCONDS_TRIGGERS_HPP +#ifndef BABELTRACE_TESTS_LIB_CONDS_CLK_CLS_COMPAT_POSTCONDS_TRIGGERS_HPP +#define BABELTRACE_TESTS_LIB_CONDS_CLK_CLS_COMPAT_POSTCONDS_TRIGGERS_HPP #include "utils.hpp" void addClkClsCompatTriggers(CondTriggers& triggers); -#endif +#endif /* BABELTRACE_TESTS_LIB_CONDS_CLK_CLS_COMPAT_POSTCONDS_TRIGGERS_HPP */ diff --git a/tests/lib/conds/utils.hpp b/tests/lib/conds/utils.hpp index 2ea53bc4..7833c072 100644 --- a/tests/lib/conds/utils.hpp +++ b/tests/lib/conds/utils.hpp @@ -4,8 +4,8 @@ * Copyright (C) 2020 Philippe Proulx */ -#ifndef TESTS_LIB_CONDS_UTILS_HPP -#define TESTS_LIB_CONDS_UTILS_HPP +#ifndef BABELTRACE_TESTS_LIB_CONDS_UTILS_HPP +#define BABELTRACE_TESTS_LIB_CONDS_UTILS_HPP #include #include @@ -180,4 +180,4 @@ using CondTriggers = std::vector; */ void condMain(const bt2s::span argv, const CondTriggers& triggers) noexcept; -#endif /* TESTS_LIB_CONDS_UTILS_HPP */ +#endif /* BABELTRACE_TESTS_LIB_CONDS_UTILS_HPP */ diff --git a/tests/lib/utils/run-in.hpp b/tests/lib/utils/run-in.hpp index 54e8ec20..62770b5d 100644 --- a/tests/lib/utils/run-in.hpp +++ b/tests/lib/utils/run-in.hpp @@ -4,8 +4,8 @@ * Copyright (C) 2020-2023 EfficiOS, inc. */ -#ifndef TESTS_LIB_UTILS_RUN_IN_HPP -#define TESTS_LIB_UTILS_RUN_IN_HPP +#ifndef BABELTRACE_TESTS_LIB_UTILS_RUN_IN_HPP +#define BABELTRACE_TESTS_LIB_UTILS_RUN_IN_HPP #include @@ -52,4 +52,4 @@ public: */ void runIn(RunIn& runIn); -#endif /* TESTS_LIB_UTILS_RUN_IN_HPP */ +#endif /* BABELTRACE_TESTS_LIB_UTILS_RUN_IN_HPP */ diff --git a/tests/plugins/flt.utils.muxer/test-clock-compatibility.cpp b/tests/plugins/flt.utils.muxer/test-clock-compatibility.cpp index ef05d1d5..60bbd763 100644 --- a/tests/plugins/flt.utils.muxer/test-clock-compatibility.cpp +++ b/tests/plugins/flt.utils.muxer/test-clock-compatibility.cpp @@ -156,8 +156,8 @@ public: ErrorTestCase(CreateClockClass createClockClass1Param, CreateClockClass createClockClass2Param, const char * const testName, const char * const expectedCauseMsg) : _mCreateClockClass1 {createClockClass1Param}, - _mCreateClockClass2 {createClockClass2Param}, _mTestName {testName}, _mExpectedCauseMsg { - expectedCauseMsg} + _mCreateClockClass2 {createClockClass2Param}, _mTestName {testName}, + _mExpectedCauseMsg {expectedCauseMsg} { } diff --git a/tests/plugins/src.ctf.fs/field/test-field.sh b/tests/plugins/src.ctf.fs/field/test-field.sh index df035d36..7c73aa2b 100755 --- a/tests/plugins/src.ctf.fs/field/test-field.sh +++ b/tests/plugins/src.ctf.fs/field/test-field.sh @@ -21,13 +21,27 @@ data_dir=$BT_TESTS_DATADIR/plugins/src.ctf.fs/field test_pass() { local -r mp_path=$1 local -r output_dir=$(mktemp -d) + local -r py_cmd=( + "$BT_TESTS_PYTHON_BIN" "$data_dir/data_from_mp.py" + "$mp_path" "$output_dir" + ) - run_python "$BT_TESTS_PYTHON_BIN" "$data_dir/data_from_mp.py" "$mp_path" "$output_dir" + if ! bt_run_in_py_env "${py_cmd[@]}"; then + fail "Failed to run \`${py_cmd[*]}\`" + return 1 + fi local -r res_path=$(mktemp) - - bt_cli "$res_path" /dev/null --plugin-path="$data_dir" \ + local -r cli_cmd=( + "$res_path" /dev/null --plugin-path="$data_dir" -c sink.test-text.single "$output_dir/trace" + ) + + if ! bt_cli "${cli_cmd[@]}"; then + fail "Failed to run \`bt_cli ${cli_cmd[*]}\`" + return 1 + fi + bt_diff "$res_path" "$output_dir/expect" ok $? "$mp_path" rm -rf "$output_dir" "$res_path" diff --git a/tests/utils/common.h b/tests/utils/common.h index cbd96cf1..1831d5de 100644 --- a/tests/utils/common.h +++ b/tests/utils/common.h @@ -7,9 +7,9 @@ * Lib BabelTrace - Common function to all tests */ -#ifndef TESTS_UTILS_COMMON_H -#define TESTS_UTILS_COMMON_H +#ifndef BABELTRACE_TESTS_UTILS_COMMON_H +#define BABELTRACE_TESTS_UTILS_COMMON_H void recursive_rmdir(const char *path); -#endif /* TESTS_UTILS_COMMON_H */ +#endif /* BABELTRACE_TESTS_UTILS_COMMON_H */ diff --git a/tests/utils/utils.sh b/tests/utils/utils.sh index 692def5d..f3d4d945 100644 --- a/tests/utils/utils.sh +++ b/tests/utils/utils.sh @@ -239,6 +239,16 @@ bt_diff() { local -r expected_file=$1 local -r actual_file=$2 + if [[ ! -e $expected_file ]]; then + echo "ERROR: expected file \`$expected_file\` doesn't exist" >&2 + return 1 + fi + + if [[ ! -e $actual_file ]]; then + echo "ERROR: actual file \`$actual_file\` doesn't exist" >&2 + return 1 + fi + diff -u <(bt_remove_cr_inline "$expected_file") <(bt_remove_cr_inline "$actual_file") 1>&2 } diff --git a/tools/check-include-guard.py b/tools/check-include-guard.py new file mode 100755 index 00000000..c4fc92cf --- /dev/null +++ b/tools/check-include-guard.py @@ -0,0 +1,111 @@ +#!/usr/bin/env python3 + +# Usage: check-include-guard.py [--fix] FILE +# +# Checks (and optionally tries to fix) the C/C++ header include guard +# names and format of `FILE`. +# +# With `--fix`, this script fixes the include guard names in place. + +import re +import sys +import pathlib +import argparse + + +class _Oops(Exception): + def __init__(self, msg: str): + self._msg = msg + + @property + def msg(self): + return self._msg + + +def _make_expected_ig_name(filename: pathlib.Path): + # Normalize `filename` (e.g. remove `..`) and make it relative to + # the root of the source tree. + root = pathlib.Path(__file__).parent.parent.resolve(strict=True) + filename = filename.absolute().resolve(strict=True).relative_to(root) + + expected_ig_name = re.sub(r"[/.-]", "_", str(filename)).upper() + expected_ig_name = re.sub(r"^SRC_", "", expected_ig_name) + return "BABELTRACE_" + expected_ig_name + + +def _check_file(filename: pathlib.Path, fix: bool): + with open(filename) as f: + contents = f.read() + + write_file = False + + # Top part + top_re = re.compile(r"^(/\*.+?\*/)\n\n#ifndef (\w+)\n#define (\w+)\n", re.DOTALL) + top_m = top_re.match(contents) + + if not top_m: + raise _Oops( + "Top of the file doesn't have the expected form: block comment, empty line, and then two include guard lines" + ) + + expected_ig_name = _make_expected_ig_name(filename) + + if fix: + contents = top_re.sub( + rf"\1\n\n#ifndef {expected_ig_name}\n#define {expected_ig_name}\n", + contents, + ) + write_file = True + else: + if top_m.group(2) != expected_ig_name: + raise _Oops( + f"In `#ifndef {top_m.group(2)}` include guard line: expecting `#ifndef {expected_ig_name}`" + ) + + if top_m.group(3) != expected_ig_name: + raise _Oops( + f"In `#define {top_m.group(3)}` include guard line: expecting `#define {expected_ig_name}`" + ) + + # Bottom part + bottom_re = re.compile(r"\n\n#endif(?: /\* (\w+) \*/)?\n$") + bottom_m = bottom_re.search(contents) + + if not bottom_m: + raise _Oops("Missing final `#endif` include guard line and trailing empty line") + + if fix: + contents = bottom_re.sub(f"\n\n#endif /* {expected_ig_name} */\n", contents) + write_file = True + else: + if bottom_m.group(1) != expected_ig_name: + raise _Oops( + f"In bottom `#endif` include guard line: expecting `#endif /* {expected_ig_name} */`" + ) + + if write_file: + with open(filename, "w") as f: + f.write(contents) + + +def _main(): + argparser = argparse.ArgumentParser() + argparser.add_argument( + "-f", + "--fix", + action="store_true", + help="attempt to fix the include guards of FILE", + ) + argparser.add_argument("FILE") + args = argparser.parse_args() + filename = pathlib.Path(args.FILE) + + try: + _check_file(filename, args.fix) + except _Oops as exc: + print(f"{filename}: {exc}", file=sys.stderr) + sys.exit(1) + + +if __name__ == "__main__": + _main() diff --git a/tools/check-include-guards.sh b/tools/check-include-guards.sh new file mode 100755 index 00000000..89a3dd96 --- /dev/null +++ b/tools/check-include-guards.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# +# SPDX-License-Identifier: GPL-2.0-only +# +# Copyright (C) 2024 EfficiOS Inc. + +# Change directory to the root of the project, to make `find` simpler +cd "$(dirname "${BASH_SOURCE[0]}")/.." || exit 1 + +find src tests \ + \( -name '*.hpp' -or -name '*.h' \) \ + ! -path '/.git/*' \ + ! -path 'src/argpar/*' \ + ! -path 'src/cpp-common/vendor/*' \ + ! -path 'tests/data/plugins/flt.lttng-utils.debug-info/tp.h' \ + ! -path 'tests/utils/tap/tap.h' \ + -print0 | xargs -P "$(nproc)" -n1 -t -0 tools/check-include-guard.py "$@" diff --git a/tools/format-cpp.sh b/tools/format-cpp.sh index c0a9583a..763c726b 100755 --- a/tools/format-cpp.sh +++ b/tools/format-cpp.sh @@ -4,7 +4,7 @@ # # Copyright (C) 2020-2023 Philippe Proulx -expected_formatter_major_version=15 +expected_formatter_major_version=16 # Runs the formatter, returning 1 if it's not the expected version. #