projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Docs: relayd: document the lifetime of viewer session trace chunks
[lttng-tools.git]
/
src
/
bin
/
lttng-sessiond
/
event-notifier-error-accounting.c
diff --git
a/src/bin/lttng-sessiond/event-notifier-error-accounting.c
b/src/bin/lttng-sessiond/event-notifier-error-accounting.c
index 47366e9e9a95b75211281c3422489e51a2c586ab..1488d801c8f360cef8a341a2c4d5cbaa1156223f 100644
(file)
--- a/
src/bin/lttng-sessiond/event-notifier-error-accounting.c
+++ b/
src/bin/lttng-sessiond/event-notifier-error-accounting.c
@@
-87,7
+87,7
@@
static inline void get_trigger_info_for_log(const struct lttng_trigger *trigger,
trigger_status = lttng_trigger_get_owner_uid(trigger,
trigger_owner_uid);
trigger_status = lttng_trigger_get_owner_uid(trigger,
trigger_owner_uid);
-
assert
(trigger_status == LTTNG_TRIGGER_STATUS_OK);
+
LTTNG_ASSERT
(trigger_status == LTTNG_TRIGGER_STATUS_OK);
}
static inline
}
static inline
@@
-219,7
+219,7
@@
init_error_accounting_state(struct error_accounting_state *state,
{
enum event_notifier_error_accounting_status status;
{
enum event_notifier_error_accounting_status status;
-
assert
(state);
+
LTTNG_ASSERT
(state);
state->number_indices = index_count;
state->number_indices = index_count;
@@
-251,7
+251,7
@@
end:
static
void fini_error_accounting_state(struct error_accounting_state *state)
{
static
void fini_error_accounting_state(struct error_accounting_state *state)
{
-
assert
(state);
+
LTTNG_ASSERT
(state);
/*
* Will assert if some error counter indices were not released (an
/*
* Will assert if some error counter indices were not released (an
@@
-381,6
+381,12
@@
struct ust_error_accounting_entry *ust_error_accounting_entry_create(
.has_overflow = false,
};
.has_overflow = false,
};
+ if (!ust_app_supports_counters(app)) {
+ DBG("Refusing to create accounting entry for application (unsupported feature): app name = '%s', app ppid = %d",
+ app->name, (int) app->ppid);
+ goto error;
+ }
+
entry = zmalloc(sizeof(struct ust_error_accounting_entry));
if (!entry) {
PERROR("Failed to allocate event notifier error acounting entry")
entry = zmalloc(sizeof(struct ust_error_accounting_entry));
if (!entry) {
PERROR("Failed to allocate event notifier error acounting entry")
@@
-482,7
+488,7
@@
error_create_counter_data:
lttng_ust_ctl_destroy_counter(daemon_counter);
error_create_daemon_counter:
error_shm_alloc:
lttng_ust_ctl_destroy_counter(daemon_counter);
error_create_daemon_counter:
error_shm_alloc:
- /* Error occured before per-cpu SHMs were handed-off to ustctl. */
+ /* Error occur
r
ed before per-cpu SHMs were handed-off to ustctl. */
if (cpu_counter_fds) {
for (i = 0; i < entry->nr_counter_cpu_fds; i++) {
if (cpu_counter_fds[i] < 0) {
if (cpu_counter_fds) {
for (i = 0; i < entry->nr_counter_cpu_fds; i++) {
if (cpu_counter_fds[i] < 0) {
@@
-586,6
+592,11
@@
event_notifier_error_accounting_register_app(struct ust_app *app)
enum event_notifier_error_accounting_status status;
struct lttng_ust_abi_object_data **cpu_counters;
enum event_notifier_error_accounting_status status;
struct lttng_ust_abi_object_data **cpu_counters;
+ if (!ust_app_supports_counters(app)) {
+ status = EVENT_NOTIFIER_ERROR_ACCOUNTING_STATUS_UNSUPPORTED;
+ goto end;
+ }
+
/*
* Check if we already have a error counter for the user id of this
* app. If not, create one.
/*
* Check if we already have a error counter for the user id of this
* app. If not, create one.
@@
-688,7
+699,7
@@
event_notifier_error_accounting_register_app(struct ust_app *app)
app->event_notifier_group.nr_counter_cpu = entry->nr_counter_cpu_fds;
app->event_notifier_group.counter_cpu = cpu_counters;
cpu_counters = NULL;
app->event_notifier_group.nr_counter_cpu = entry->nr_counter_cpu_fds;
app->event_notifier_group.counter_cpu = cpu_counters;
cpu_counters = NULL;
- goto end;
+ goto end
_unlock
;
error_send_cpu_counter_data:
error_duplicate_cpu_counter:
error_send_cpu_counter_data:
error_duplicate_cpu_counter:
@@
-716,8
+727,9
@@
error_duplicate_counter:
ust_error_accounting_entry_put(entry);
error_creating_entry:
app->event_notifier_group.counter = NULL;
ust_error_accounting_entry_put(entry);
error_creating_entry:
app->event_notifier_group.counter = NULL;
-end:
+end
_unlock
:
rcu_read_unlock();
rcu_read_unlock();
+end:
return status;
}
return status;
}
@@
-1016,7
+1028,7
@@
enum event_notifier_error_accounting_status create_error_counter_index_for_token
uint64_t local_error_counter_index;
enum event_notifier_error_accounting_status status;
uint64_t local_error_counter_index;
enum event_notifier_error_accounting_status status;
-
assert
(state);
+
LTTNG_ASSERT
(state);
/* Allocate a new index for that counter. */
index_alloc_status = lttng_index_allocator_alloc(state->index_allocator,
/* Allocate a new index for that counter. */
index_alloc_status = lttng_index_allocator_alloc(state->index_allocator,
@@
-1069,6
+1081,9
@@
event_notifier_error_accounting_register_event_notifier(
state = &kernel_state;
break;
case LTTNG_DOMAIN_UST:
state = &kernel_state;
break;
case LTTNG_DOMAIN_UST:
+ case LTTNG_DOMAIN_PYTHON:
+ case LTTNG_DOMAIN_JUL:
+ case LTTNG_DOMAIN_LOG4J:
state = &ust_state;
break;
default:
state = &ust_state;
break;
default:
@@
-1117,6
+1132,9
@@
event_notifier_error_accounting_register_event_notifier(
#ifdef HAVE_LIBLTTNG_UST_CTL
switch (lttng_trigger_get_underlying_domain_type_restriction(trigger)) {
case LTTNG_DOMAIN_UST:
#ifdef HAVE_LIBLTTNG_UST_CTL
switch (lttng_trigger_get_underlying_domain_type_restriction(trigger)) {
case LTTNG_DOMAIN_UST:
+ case LTTNG_DOMAIN_PYTHON:
+ case LTTNG_DOMAIN_JUL:
+ case LTTNG_DOMAIN_LOG4J:
pthread_mutex_lock(&the_event_notifier_counter.lock);
the_event_notifier_counter.count++;
if (the_event_notifier_counter.count == 1) {
pthread_mutex_lock(&the_event_notifier_counter.lock);
the_event_notifier_counter.count++;
if (the_event_notifier_counter.count == 1) {
@@
-1162,7
+1180,7
@@
event_notifier_error_accounting_kernel_get_count(
counter_aggregate.index.number_dimensions = 1;
counter_aggregate.index.dimension_indexes[0] = error_counter_index;
counter_aggregate.index.number_dimensions = 1;
counter_aggregate.index.dimension_indexes[0] = error_counter_index;
-
assert
(kernel_error_accounting_entry.error_counter_fd);
+
LTTNG_ASSERT
(kernel_error_accounting_entry.error_counter_fd);
ret = kernctl_counter_get_aggregate_value(
kernel_error_accounting_entry.error_counter_fd,
ret = kernctl_counter_get_aggregate_value(
kernel_error_accounting_entry.error_counter_fd,
@@
-1188,7
+1206,7
@@
event_notifier_error_accounting_kernel_get_count(
}
/* Error count can't be negative. */
}
/* Error count can't be negative. */
-
assert
(counter_aggregate.value.value >= 0);
+
LTTNG_ASSERT
(counter_aggregate.value.value >= 0);
*count = (uint64_t) counter_aggregate.value.value;
status = EVENT_NOTIFIER_ERROR_ACCOUNTING_STATUS_OK;
*count = (uint64_t) counter_aggregate.value.value;
status = EVENT_NOTIFIER_ERROR_ACCOUNTING_STATUS_OK;
@@
-1206,6
+1224,9
@@
event_notifier_error_accounting_get_count(
return event_notifier_error_accounting_kernel_get_count(
trigger, count);
case LTTNG_DOMAIN_UST:
return event_notifier_error_accounting_kernel_get_count(
trigger, count);
case LTTNG_DOMAIN_UST:
+ case LTTNG_DOMAIN_PYTHON:
+ case LTTNG_DOMAIN_JUL:
+ case LTTNG_DOMAIN_LOG4J:
#ifdef HAVE_LIBLTTNG_UST_CTL
return event_notifier_error_accounting_ust_get_count(trigger,
count);
#ifdef HAVE_LIBLTTNG_UST_CTL
return event_notifier_error_accounting_ust_get_count(trigger,
count);
@@
-1226,6
+1247,9
@@
event_notifier_error_accounting_clear(const struct lttng_trigger *trigger)
case LTTNG_DOMAIN_KERNEL:
return event_notifier_error_accounting_kernel_clear(trigger);
case LTTNG_DOMAIN_UST:
case LTTNG_DOMAIN_KERNEL:
return event_notifier_error_accounting_kernel_clear(trigger);
case LTTNG_DOMAIN_UST:
+ case LTTNG_DOMAIN_PYTHON:
+ case LTTNG_DOMAIN_JUL:
+ case LTTNG_DOMAIN_LOG4J:
#ifdef HAVE_LIBLTTNG_UST_CTL
return event_notifier_error_accounting_ust_clear(trigger);
#else
#ifdef HAVE_LIBLTTNG_UST_CTL
return event_notifier_error_accounting_ust_clear(trigger);
#else
@@
-1269,6
+1293,9
@@
void event_notifier_error_accounting_unregister_event_notifier(
break;
#ifdef HAVE_LIBLTTNG_UST_CTL
case LTTNG_DOMAIN_UST:
break;
#ifdef HAVE_LIBLTTNG_UST_CTL
case LTTNG_DOMAIN_UST:
+ case LTTNG_DOMAIN_PYTHON:
+ case LTTNG_DOMAIN_JUL:
+ case LTTNG_DOMAIN_LOG4J:
state = &ust_state;
pthread_mutex_lock(&the_event_notifier_counter.lock);
state = &ust_state;
pthread_mutex_lock(&the_event_notifier_counter.lock);
@@
-1316,7
+1343,7
@@
void event_notifier_error_accounting_unregister_event_notifier(
}
del_ret = lttng_ht_del(state->indices_ht, &iter);
}
del_ret = lttng_ht_del(state->indices_ht, &iter);
-
assert
(!del_ret);
+
LTTNG_ASSERT
(!del_ret);
call_rcu(&index_entry->rcu_head, free_index_ht_entry);
}
call_rcu(&index_entry->rcu_head, free_index_ht_entry);
}
This page took
0.027684 seconds
and
4
git commands to generate.