projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
on-event evaluation: introduce on-event evaluation specific status code
[lttng-tools.git]
/
tests
/
unit
/
test_condition.c
diff --git
a/tests/unit/test_condition.c
b/tests/unit/test_condition.c
index 3b0144a0aae9994c4e212758b75290f7b04afbcf..864c6a840eff692080df098c4186061576189903 100644
(file)
--- a/
tests/unit/test_condition.c
+++ b/
tests/unit/test_condition.c
@@
-20,8
+20,9
@@
#include <lttng/event.h>
#include <lttng/event-rule/tracepoint.h>
#include <lttng/condition/condition-internal.h>
#include <lttng/event.h>
#include <lttng/event-rule/tracepoint.h>
#include <lttng/condition/condition-internal.h>
-#include <lttng/condition/
event-rule
.h>
+#include <lttng/condition/
on-event
.h>
#include <lttng/domain.h>
#include <lttng/domain.h>
+#include <lttng/log-level-rule.h>
#include <common/dynamic-buffer.h>
#include <common/buffer-view.h>
#include <common/dynamic-buffer.h>
#include <common/buffer-view.h>
@@
-45,10
+46,17
@@
void test_condition_event_rule(void)
const char *pattern="my_event_*";
const char *filter="msg_id == 23 && size >= 2048";
const char *exclusions[] = { "my_event_test1", "my_event_test2", "my_event_test3" };
const char *pattern="my_event_*";
const char *filter="msg_id == 23 && size >= 2048";
const char *exclusions[] = { "my_event_test1", "my_event_test2", "my_event_test3" };
+ struct lttng_log_level_rule *log_level_rule_at_least_as_severe = NULL;
struct lttng_payload buffer;
lttng_payload_init(&buffer);
struct lttng_payload buffer;
lttng_payload_init(&buffer);
+ /* Create log level rule. */
+ log_level_rule_at_least_as_severe =
+ lttng_log_level_rule_at_least_as_severe_as_create(
+ LTTNG_LOGLEVEL_WARNING);
+ assert(log_level_rule_at_least_as_severe);
+
tracepoint = lttng_event_rule_tracepoint_create(LTTNG_DOMAIN_UST);
ok(tracepoint, "tracepoint UST_DOMAIN");
tracepoint = lttng_event_rule_tracepoint_create(LTTNG_DOMAIN_UST);
ok(tracepoint, "tracepoint UST_DOMAIN");
@@
-58,8
+66,8
@@
void test_condition_event_rule(void)
status = lttng_event_rule_tracepoint_set_filter(tracepoint, filter);
ok(status == LTTNG_EVENT_RULE_STATUS_OK, "Setting filter");
status = lttng_event_rule_tracepoint_set_filter(tracepoint, filter);
ok(status == LTTNG_EVENT_RULE_STATUS_OK, "Setting filter");
- status = lttng_event_rule_tracepoint_set_log_level_r
ange_lower_bound
(
- tracepoint,
LTTNG_LOGLEVEL_WARNING
);
+ status = lttng_event_rule_tracepoint_set_log_level_r
ule
(
+ tracepoint,
log_level_rule_at_least_as_severe
);
ok(status == LTTNG_EVENT_RULE_STATUS_OK, "Setting log level range");
for (i = 0; i < 3; i++) {
ok(status == LTTNG_EVENT_RULE_STATUS_OK, "Setting log level range");
for (i = 0; i < 3; i++) {
@@
-69,10
+77,10
@@
void test_condition_event_rule(void)
"Setting exclusion pattern");
}
"Setting exclusion pattern");
}
- condition = lttng_condition_
event_rule
_create(tracepoint);
+ condition = lttng_condition_
on_event
_create(tracepoint);
ok(condition, "Created condition");
ok(condition, "Created condition");
- condition_status = lttng_condition_
event_rule
_get_rule(
+ condition_status = lttng_condition_
on_event
_get_rule(
condition, &tracepoint_tmp);
ok(condition_status == LTTNG_CONDITION_STATUS_OK,
"Getting event rule from event rule condition");
condition, &tracepoint_tmp);
ok(condition_status == LTTNG_CONDITION_STATUS_OK,
"Getting event rule from event rule condition");
@@
-98,6
+106,7
@@
void test_condition_event_rule(void)
lttng_event_rule_destroy(tracepoint);
lttng_condition_destroy(condition);
lttng_condition_destroy(condition_from_buffer);
lttng_event_rule_destroy(tracepoint);
lttng_condition_destroy(condition);
lttng_condition_destroy(condition_from_buffer);
+ lttng_log_level_rule_destroy(log_level_rule_at_least_as_severe);
}
int main(int argc, const char *argv[])
}
int main(int argc, const char *argv[])
This page took
0.02622 seconds
and
4
git commands to generate.