projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Rename on-event to event-rule-matches
[lttng-tools.git]
/
src
/
common
/
trigger.c
diff --git
a/src/common/trigger.c
b/src/common/trigger.c
index ec96fc80b7d804249c8c4f1f395d4a693080fd1e..34d4208076a22eec5d9e6d003ec880e887f08d40 100644
(file)
--- a/
src/common/trigger.c
+++ b/
src/common/trigger.c
@@
-16,8
+16,8
@@
#include <lttng/action/action-internal.h>
#include <lttng/condition/buffer-usage.h>
#include <lttng/condition/condition-internal.h>
#include <lttng/action/action-internal.h>
#include <lttng/condition/buffer-usage.h>
#include <lttng/condition/condition-internal.h>
-#include <lttng/condition/
on-event
-internal.h>
-#include <lttng/condition/
on-event
.h>
+#include <lttng/condition/
event-rule-matches
-internal.h>
+#include <lttng/condition/
event-rule-matches
.h>
#include <lttng/domain.h>
#include <lttng/event-expr-internal.h>
#include <lttng/event-rule/event-rule-internal.h>
#include <lttng/domain.h>
#include <lttng/event-expr-internal.h>
#include <lttng/event-rule/event-rule-internal.h>
@@
-704,6
+704,7
@@
enum lttng_trigger_status lttng_trigger_set_owner_uid(
struct lttng_trigger *trigger, uid_t uid)
{
enum lttng_trigger_status ret = LTTNG_TRIGGER_STATUS_OK;
struct lttng_trigger *trigger, uid_t uid)
{
enum lttng_trigger_status ret = LTTNG_TRIGGER_STATUS_OK;
+ const uid_t euid = geteuid();
const struct lttng_credentials creds = {
.uid = LTTNG_OPTIONAL_INIT_VALUE(uid),
.gid = LTTNG_OPTIONAL_INIT_UNSET,
const struct lttng_credentials creds = {
.uid = LTTNG_OPTIONAL_INIT_VALUE(uid),
.gid = LTTNG_OPTIONAL_INIT_UNSET,
@@
-715,7
+716,7
@@
enum lttng_trigger_status lttng_trigger_set_owner_uid(
}
/* Client-side validation only to report a clearer error. */
}
/* Client-side validation only to report a clearer error. */
- if (
geteuid() != 0
) {
+ if (
euid != 0 && euid != uid
) {
ret = LTTNG_TRIGGER_STATUS_PERMISSION_DENIED;
goto end;
}
ret = LTTNG_TRIGGER_STATUS_PERMISSION_DENIED;
goto end;
}
@@
-771,9
+772,9
@@
enum lttng_domain_type lttng_trigger_get_underlying_domain_type_restriction(
/* Apply to any domain. */
type = LTTNG_DOMAIN_NONE;
break;
/* Apply to any domain. */
type = LTTNG_DOMAIN_NONE;
break;
- case LTTNG_CONDITION_TYPE_
ON_EVENT
:
+ case LTTNG_CONDITION_TYPE_
EVENT_RULE_MATCHES
:
/* Return the domain of the event rule. */
/* Return the domain of the event rule. */
- c_status = lttng_condition_
on_event
_get_rule(
+ c_status = lttng_condition_
event_rule_matches
_get_rule(
trigger->condition, &event_rule);
assert(c_status == LTTNG_CONDITION_STATUS_OK);
type = lttng_event_rule_get_domain_type(event_rule);
trigger->condition, &event_rule);
assert(c_status == LTTNG_CONDITION_STATUS_OK);
type = lttng_event_rule_get_domain_type(event_rule);
@@
-811,12
+812,12
@@
enum lttng_error_code lttng_trigger_generate_bytecode(
}
switch (lttng_condition_get_type(condition)) {
}
switch (lttng_condition_get_type(condition)) {
- case LTTNG_CONDITION_TYPE_
ON_EVENT
:
+ case LTTNG_CONDITION_TYPE_
EVENT_RULE_MATCHES
:
{
struct lttng_event_rule *event_rule;
const enum lttng_condition_status condition_status =
{
struct lttng_event_rule *event_rule;
const enum lttng_condition_status condition_status =
- lttng_condition_
on_event
_borrow_rule_mutable(
- condition, &event_rule);
+ lttng_condition_
event_rule_matches
_borrow_rule_mutable(
+
condition, &event_rule);
assert(condition_status == LTTNG_CONDITION_STATUS_OK);
assert(condition_status == LTTNG_CONDITION_STATUS_OK);
@@
-828,7
+829,7
@@
enum lttng_error_code lttng_trigger_generate_bytecode(
}
/* Generate the capture bytecode. */
}
/* Generate the capture bytecode. */
- ret = lttng_condition_
on_event
_generate_capture_descriptor_bytecode(
+ ret = lttng_condition_
event_rule_matches
_generate_capture_descriptor_bytecode(
condition);
if (ret != LTTNG_OK) {
goto end;
condition);
if (ret != LTTNG_OK) {
goto end;
@@
-884,7
+885,7
@@
bool lttng_trigger_needs_tracer_notifier(const struct lttng_trigger *trigger)
lttng_trigger_get_const_condition(trigger);
switch (lttng_condition_get_type(condition)) {
lttng_trigger_get_const_condition(trigger);
switch (lttng_condition_get_type(condition)) {
- case LTTNG_CONDITION_TYPE_
ON_EVENT
:
+ case LTTNG_CONDITION_TYPE_
EVENT_RULE_MATCHES
:
needs_tracer_notifier = true;
goto end;
case LTTNG_CONDITION_TYPE_SESSION_CONSUMED_SIZE:
needs_tracer_notifier = true;
goto end;
case LTTNG_CONDITION_TYPE_SESSION_CONSUMED_SIZE:
This page took
0.025259 seconds
and
4
git commands to generate.