@@ -33,8 +33,8 @@ int tracefs_instance_file_write(struct tracefs_instance *instance,
char *tracefs_instance_file_read(struct tracefs_instance *instance,
char *file, int *psize);
-bool tracefs_file_exist(struct tracefs_instance *instance, char *name);
-bool tracefs_dir_exist(struct tracefs_instance *instance, char *name);
+bool tracefs_file_exists(struct tracefs_instance *instance, char *name);
+bool tracefs_dir_exists(struct tracefs_instance *instance, char *name);
/* events */
void tracefs_list_free(char **list);
@@ -248,7 +248,7 @@ char *tracefs_instance_file_read(struct tracefs_instance *instance,
return buf;
}
-static bool check_file_exist(struct tracefs_instance *instance,
+static bool check_file_exists(struct tracefs_instance *instance,
char *name, bool dir)
{
char file[PATH_MAX];
@@ -272,25 +272,25 @@ static bool check_file_exist(struct tracefs_instance *instance,
}
/**
- * tracefs_file_exist - Check if a file with given name exists in given instance
+ * tracefs_file_exists - Check if a file with given name exists in given instance
* @instance: ftrace instance, can be NULL for the top instance
* @name: name of the file
*
* Returns true if the file exists, false otherwise
*/
-bool tracefs_file_exist(struct tracefs_instance *instance, char *name)
+bool tracefs_file_exists(struct tracefs_instance *instance, char *name)
{
- return check_file_exist(instance, name, false);
+ return check_file_exists(instance, name, false);
}
/**
- * tracefs_dir_exist - Check if a directory with given name exists in given instance
+ * tracefs_dir_exists - Check if a directory with given name exists in given instance
* @instance: ftrace instance, can be NULL for the top instance
* @name: name of the directory
*
* Returns true if the directory exists, false otherwise
*/
-bool tracefs_dir_exist(struct tracefs_instance *instance, char *name)
+bool tracefs_dir_exists(struct tracefs_instance *instance, char *name)
{
- return check_file_exist(instance, name, true);
+ return check_file_exists(instance, name, true);
}
@@ -4791,7 +4791,7 @@ static void clear_instance_error_log(struct buffer_instance *instance)
{
char *file;
- if (!tracefs_file_exist(instance->tracefs, "error_log"))
+ if (!tracefs_file_exists(instance->tracefs, "error_log"))
return;
file = tracefs_instance_get_file(instance->tracefs, "error_log");
@@ -252,20 +252,20 @@ static void test_instance_file(void)
tracefs_put_tracing_file(inst_file);
free(fname);
- CU_TEST(tracefs_file_exist(NULL, (char *)name) == false);
- CU_TEST(tracefs_dir_exist(NULL, (char *)name) == false);
- CU_TEST(tracefs_file_exist(instance, (char *)name) == false);
- CU_TEST(tracefs_dir_exist(instance, (char *)name) == false);
-
- CU_TEST(tracefs_file_exist(NULL, CUR_TRACER) == true);
- CU_TEST(tracefs_dir_exist(NULL, CUR_TRACER) == false);
- CU_TEST(tracefs_file_exist(instance, CUR_TRACER) == true);
- CU_TEST(tracefs_dir_exist(instance, CUR_TRACER) == false);
-
- CU_TEST(tracefs_file_exist(NULL, PER_CPU) == false);
- CU_TEST(tracefs_dir_exist(NULL, PER_CPU) == true);
- CU_TEST(tracefs_file_exist(instance, PER_CPU) == false);
- CU_TEST(tracefs_dir_exist(instance, PER_CPU) == true);
+ CU_TEST(tracefs_file_exists(NULL, (char *)name) == false);
+ CU_TEST(tracefs_dir_exists(NULL, (char *)name) == false);
+ CU_TEST(tracefs_file_exists(instance, (char *)name) == false);
+ CU_TEST(tracefs_dir_exists(instance, (char *)name) == false);
+
+ CU_TEST(tracefs_file_exists(NULL, CUR_TRACER) == true);
+ CU_TEST(tracefs_dir_exists(NULL, CUR_TRACER) == false);
+ CU_TEST(tracefs_file_exists(instance, CUR_TRACER) == true);
+ CU_TEST(tracefs_dir_exists(instance, CUR_TRACER) == false);
+
+ CU_TEST(tracefs_file_exists(NULL, PER_CPU) == false);
+ CU_TEST(tracefs_dir_exists(NULL, PER_CPU) == true);
+ CU_TEST(tracefs_file_exists(instance, PER_CPU) == false);
+ CU_TEST(tracefs_dir_exists(instance, PER_CPU) == true);
CU_TEST(tracefs_instance_destroy(NULL) != 0);
CU_TEST(tracefs_instance_destroy(instance) == 0);