From: "Tzvetomir Stoyanov (VMware)" <tz.stoyanov@gmail.com>
To: rostedt@goodmis.org
Cc: linux-trace-devel@vger.kernel.org
Subject: [PATCH 1/3] libtracefs: Fix trace options unit test
Date: Mon, 12 Apr 2021 07:24:17 +0300 [thread overview]
Message-ID: <20210412042419.3295237-2-tz.stoyanov@gmail.com> (raw)
In-Reply-To: <20210412042419.3295237-1-tz.stoyanov@gmail.com>
Changes to tracefs library APIs were introduced by this patch set:
https://lore.kernel.org/linux-trace-devel/20210409180423.72497-1-y.karadz@gmail.com/
which make the option mask immutable and controlled by the library.
However, the unit test was not updated and fails.
Fixed the trace options unit test, to reflect the changes in the API.
Reported-by: Sameeruddin Shaik <sameeruddin.shaik8@gmail.com>
Suggested-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
---
utest/tracefs-utest.c | 21 +++------------------
1 file changed, 3 insertions(+), 18 deletions(-)
diff --git a/utest/tracefs-utest.c b/utest/tracefs-utest.c
index 1f48e6f..04b5e81 100644
--- a/utest/tracefs-utest.c
+++ b/utest/tracefs-utest.c
@@ -679,21 +679,11 @@ out:
return ret;
}
-static bool check_options_mask_empty(struct tracefs_options_mask *mask)
-{
- int i;
-
- for (i = 1; i < TRACEFS_OPTION_MAX; i++) {
- if (tracefs_option_mask_is_set(mask, i))
- return false;
- }
- return true;
-}
-
static void test_instance_tracing_options(struct tracefs_instance *instance)
{
- struct tracefs_options_mask *enabled;
- struct tracefs_options_mask *all, *all_copy;
+ const struct tracefs_options_mask *enabled;
+ const struct tracefs_options_mask *all_copy;
+ const struct tracefs_options_mask *all;
enum tracefs_option_id i = 1;
char file[PATH_MAX];
const char *name;
@@ -743,11 +733,6 @@ static void test_instance_tracing_options(struct tracefs_instance *instance)
CU_TEST(check_option(instance, i, true, 0));
}
}
- CU_TEST(check_options_mask_empty(all));
- CU_TEST(check_options_mask_empty(enabled));
-
- free(all);
- free(enabled);
}
static void test_tracing_options(void)
--
2.30.2
next prev parent reply other threads:[~2021-04-12 4:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-12 4:24 [PATCH 0/3] Fix unit tests and APIs for loading saved mappings Tzvetomir Stoyanov (VMware)
2021-04-12 4:24 ` Tzvetomir Stoyanov (VMware) [this message]
2021-04-12 4:24 ` [PATCH 2/3] libtracefs: Fix loading of saved maps Tzvetomir Stoyanov (VMware)
2021-04-12 4:24 ` [PATCH 3/3] libtracefs: Fixed trace marker unit test Tzvetomir Stoyanov (VMware)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210412042419.3295237-2-tz.stoyanov@gmail.com \
--to=tz.stoyanov@gmail.com \
--cc=linux-trace-devel@vger.kernel.org \
--cc=rostedt@goodmis.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).