@@ -3,7 +3,7 @@ libtracefs(3)
NAME
----
-tracefs_option_set, tracefs_option_clear, tracefs_option_is_set -
+tracefs_option_set, tracefs_option_clear, tracefs_option_mask_is_set -
Set, clear, check option in a bitmask.
SYNOPSIS
@@ -14,7 +14,7 @@ SYNOPSIS
void *tracefs_option_set*(struct tracefs_options_mask pass:[*]_options_, enum tracefs_option_id _id_);
void *tracefs_option_clear*(struct tracefs_options_mask pass:[*]_options_, enum tracefs_option_id _id_);
-bool *tracefs_option_is_set*(struct tracefs_options_mask _options_, enum tracefs_option_id _id_);
+bool *tracefs_option_mask_is_set*(struct tracefs_options_mask _options_, enum tracefs_option_id _id_);
--
DESCRIPTION
@@ -27,12 +27,12 @@ _options_ bitmask.
The _tracefs_option_clear()_ function clears the bit, corresponding to the option with _id_ in the
_options_ bitmask.
-The _tracefs_option_is_set()_ function checks if the bit, corresponding to the option with _id_ is
+The _tracefs_option_mask_is_set()_ function checks if the bit, corresponding to the option with _id_ is
set in the _options_ bitmask.
RETURN VALUE
------------
-The _tracefs_option_is_set()_ function returns true if the bit is set, false otherwise.
+The _tracefs_option_mask_is_set()_ function returns true if the bit is set, false otherwise.
EXAMPLE
-------
@@ -45,7 +45,7 @@ memset(&options, 0, sizeof(options));
...
tracefs_option_set(&options, TRACEFS_OPTION_EVENT_FORK | TRACEFS_OPTION_FUNCTION_FORK);
...
-if (tracefs_option_is_set(options, TRACEFS_OPTION_EVENT_FORK))
+if (tracefs_option_mask_is_set(options, TRACEFS_OPTION_EVENT_FORK))
tracefs_option_clear(&options, TRACEFS_OPTION_EVENT_FORK);
...
--
@@ -132,8 +132,8 @@ enum tracefs_option_id {
#define TRACEFS_OPTION_MAX (TRACEFS_OPTION_VERBOSE + 1)
struct tracefs_options_mask;
-bool tracefs_option_is_set(const struct tracefs_options_mask *options,
- enum tracefs_option_id id);
+bool tracefs_option_mask_is_set(const struct tracefs_options_mask *options,
+ enum tracefs_option_id id);
struct tracefs_options_mask *tracefs_options_get_supported(struct tracefs_instance *instance);
bool tracefs_option_is_supported(struct tracefs_instance *instance, enum tracefs_option_id id);
struct tracefs_options_mask *tracefs_options_get_enabled(struct tracefs_instance *instance);
@@ -359,14 +359,14 @@ bool tracefs_option_is_enabled(struct tracefs_instance *instance, enum tracefs_o
}
/**
- * tracefs_option_is_set - Check if given option is set in the bitmask
+ * tracefs_option_mask_is_set - Check if given option is set in the bitmask
* @options: Options bitmask
* @id: trace option id
*
* Returns true if an option with given id is set in the bitmask,
* false if it is not set.
*/
-bool tracefs_option_is_set(const struct tracefs_options_mask *options,
+bool tracefs_option_mask_is_set(const struct tracefs_options_mask *options,
enum tracefs_option_id id)
{
if (id > TRACEFS_OPTION_INVALID)
@@ -547,7 +547,7 @@ static bool check_options_mask_empty(struct tracefs_options_mask *mask)
int i;
for (i = 1; i < TRACEFS_OPTION_MAX; i++) {
- if (tracefs_option_is_set(mask, i))
+ if (tracefs_option_mask_is_set(mask, i))
return false;
}
return true;
@@ -580,7 +580,7 @@ static void test_instance_tracing_options(struct tracefs_instance *instance)
CU_TEST(strcmp(name, "unknown"));
snprintf(file, PATH_MAX, "options/%s", name);
- if (tracefs_option_is_set(all, i)) {
+ if (tracefs_option_mask_is_set(all, i)) {
CU_TEST(check_option(instance, i, true, -1));
CU_TEST(tracefs_option_is_supported(instance, i));
} else {
@@ -588,7 +588,7 @@ static void test_instance_tracing_options(struct tracefs_instance *instance)
CU_TEST(!tracefs_option_is_supported(instance, i));
}
- if (tracefs_option_is_set(enabled, i)) {
+ if (tracefs_option_mask_is_set(enabled, i)) {
CU_TEST(check_option(instance, i, true, 1));
CU_TEST(tracefs_option_is_supported(instance, i));
CU_TEST(tracefs_option_is_enabled(instance, i));
@@ -596,7 +596,7 @@ static void test_instance_tracing_options(struct tracefs_instance *instance)
CU_TEST(check_option(instance, i, true, 0));
CU_TEST(tracefs_option_enable(instance, i) == 0);
CU_TEST(check_option(instance, i, true, 1));
- } else if (tracefs_option_is_set(all_copy, i)) {
+ } else if (tracefs_option_mask_is_set(all_copy, i)) {
CU_TEST(check_option(instance, i, true, 0));
CU_TEST(tracefs_option_is_supported(instance, i));
CU_TEST(!tracefs_option_is_enabled(instance, i));
The old name of the function is potentially confusing. Indeed the function do not check anything about the option itself (is it supported or is it enabled). The function only check if inside the mask the bit that corresponds to a given option is set. Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com> --- Documentation/libtracefs-option-bits.txt | 10 +++++----- include/tracefs.h | 4 ++-- src/tracefs-tools.c | 4 ++-- utest/tracefs-utest.c | 8 ++++---- 4 files changed, 13 insertions(+), 13 deletions(-)