projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Docs: comment typo fix (accomodates -> accommodates)
[lttng-tools.git]
/
src
/
bin
/
lttng-sessiond
/
trace-ust.c
diff --git
a/src/bin/lttng-sessiond/trace-ust.c
b/src/bin/lttng-sessiond/trace-ust.c
index 314c21e3804b2b35c899da154bd35889e48b4d00..45dbec74e174feac9a7aba9932666b87f18e5628 100644
(file)
--- a/
src/bin/lttng-sessiond/trace-ust.c
+++ b/
src/bin/lttng-sessiond/trace-ust.c
@@
-358,6
+358,8
@@
struct ltt_ust_channel *trace_ust_create_channel(struct lttng_channel *chan,
luc->attr.output = (enum lttng_ust_output) chan->attr.output;
luc->monitor_timer_interval = ((struct lttng_channel_extended *)
chan->attr.extended.ptr)->monitor_timer_interval;
luc->attr.output = (enum lttng_ust_output) chan->attr.output;
luc->monitor_timer_interval = ((struct lttng_channel_extended *)
chan->attr.extended.ptr)->monitor_timer_interval;
+ luc->attr.u.s.blocking_timeout = ((struct lttng_channel_extended *)
+ chan->attr.extended.ptr)->blocking_timeout;
/* Translate to UST output enum */
switch (luc->attr.output) {
/* Translate to UST output enum */
switch (luc->attr.output) {
@@
-433,91
+435,99
@@
end:
* Allocate and initialize a ust event. Set name and event type.
* We own filter_expression, filter, and exclusion.
*
* Allocate and initialize a ust event. Set name and event type.
* We own filter_expression, filter, and exclusion.
*
- * Return
pointer to structure or NULL.
+ * Return
an lttng_error_code
*/
*/
-
struct ltt_ust_event *
trace_ust_create_event(struct lttng_event *ev,
+
enum lttng_error_code
trace_ust_create_event(struct lttng_event *ev,
char *filter_expression,
struct lttng_filter_bytecode *filter,
struct lttng_event_exclusion *exclusion,
char *filter_expression,
struct lttng_filter_bytecode *filter,
struct lttng_event_exclusion *exclusion,
- bool internal_event)
+ bool internal_event,
+ struct ltt_ust_event **ust_event)
{
{
- struct ltt_ust_event *lue;
+ struct ltt_ust_event *local_ust_event;
+ enum lttng_error_code ret = LTTNG_OK;
assert(ev);
if (exclusion && validate_exclusion(exclusion)) {
assert(ev);
if (exclusion && validate_exclusion(exclusion)) {
+ ret = LTTNG_ERR_INVALID;
goto error;
}
goto error;
}
- l
ue
= zmalloc(sizeof(struct ltt_ust_event));
- if (l
ue
== NULL) {
+ l
ocal_ust_event
= zmalloc(sizeof(struct ltt_ust_event));
+ if (l
ocal_ust_event
== NULL) {
PERROR("ust event zmalloc");
PERROR("ust event zmalloc");
+ ret = LTTNG_ERR_NOMEM;
goto error;
}
goto error;
}
- l
ue
->internal = internal_event;
+ l
ocal_ust_event
->internal = internal_event;
switch (ev->type) {
case LTTNG_EVENT_PROBE:
switch (ev->type) {
case LTTNG_EVENT_PROBE:
- l
ue
->attr.instrumentation = LTTNG_UST_PROBE;
+ l
ocal_ust_event
->attr.instrumentation = LTTNG_UST_PROBE;
break;
case LTTNG_EVENT_FUNCTION:
break;
case LTTNG_EVENT_FUNCTION:
- l
ue
->attr.instrumentation = LTTNG_UST_FUNCTION;
+ l
ocal_ust_event
->attr.instrumentation = LTTNG_UST_FUNCTION;
break;
case LTTNG_EVENT_FUNCTION_ENTRY:
break;
case LTTNG_EVENT_FUNCTION_ENTRY:
- l
ue
->attr.instrumentation = LTTNG_UST_FUNCTION;
+ l
ocal_ust_event
->attr.instrumentation = LTTNG_UST_FUNCTION;
break;
case LTTNG_EVENT_TRACEPOINT:
break;
case LTTNG_EVENT_TRACEPOINT:
- l
ue
->attr.instrumentation = LTTNG_UST_TRACEPOINT;
+ l
ocal_ust_event
->attr.instrumentation = LTTNG_UST_TRACEPOINT;
break;
default:
ERR("Unknown ust instrumentation type (%d)", ev->type);
break;
default:
ERR("Unknown ust instrumentation type (%d)", ev->type);
+ ret = LTTNG_ERR_INVALID;
goto error_free_event;
}
/* Copy event name */
goto error_free_event;
}
/* Copy event name */
- strncpy(l
ue
->attr.name, ev->name, LTTNG_UST_SYM_NAME_LEN);
- l
ue
->attr.name[LTTNG_UST_SYM_NAME_LEN - 1] = '\0';
+ strncpy(l
ocal_ust_event
->attr.name, ev->name, LTTNG_UST_SYM_NAME_LEN);
+ l
ocal_ust_event
->attr.name[LTTNG_UST_SYM_NAME_LEN - 1] = '\0';
switch (ev->loglevel_type) {
case LTTNG_EVENT_LOGLEVEL_ALL:
switch (ev->loglevel_type) {
case LTTNG_EVENT_LOGLEVEL_ALL:
- l
ue
->attr.loglevel_type = LTTNG_UST_LOGLEVEL_ALL;
- l
ue->attr.loglevel = -1;
/* Force to -1 */
+ l
ocal_ust_event
->attr.loglevel_type = LTTNG_UST_LOGLEVEL_ALL;
+ l
ocal_ust_event->attr.loglevel = -1;
/* Force to -1 */
break;
case LTTNG_EVENT_LOGLEVEL_RANGE:
break;
case LTTNG_EVENT_LOGLEVEL_RANGE:
- l
ue
->attr.loglevel_type = LTTNG_UST_LOGLEVEL_RANGE;
- l
ue
->attr.loglevel = ev->loglevel;
+ l
ocal_ust_event
->attr.loglevel_type = LTTNG_UST_LOGLEVEL_RANGE;
+ l
ocal_ust_event
->attr.loglevel = ev->loglevel;
break;
case LTTNG_EVENT_LOGLEVEL_SINGLE:
break;
case LTTNG_EVENT_LOGLEVEL_SINGLE:
- l
ue
->attr.loglevel_type = LTTNG_UST_LOGLEVEL_SINGLE;
- l
ue
->attr.loglevel = ev->loglevel;
+ l
ocal_ust_event
->attr.loglevel_type = LTTNG_UST_LOGLEVEL_SINGLE;
+ l
ocal_ust_event
->attr.loglevel = ev->loglevel;
break;
default:
ERR("Unknown ust loglevel type (%d)", ev->loglevel_type);
break;
default:
ERR("Unknown ust loglevel type (%d)", ev->loglevel_type);
+ ret = LTTNG_ERR_INVALID;
goto error_free_event;
}
/* Same layout. */
goto error_free_event;
}
/* Same layout. */
- l
ue
->filter_expression = filter_expression;
- l
ue
->filter = filter;
- l
ue
->exclusion = exclusion;
+ l
ocal_ust_event
->filter_expression = filter_expression;
+ l
ocal_ust_event
->filter = filter;
+ l
ocal_ust_event
->exclusion = exclusion;
/* Init node */
/* Init node */
- lttng_ht_node_init_str(&l
ue->node, lue
->attr.name);
+ lttng_ht_node_init_str(&l
ocal_ust_event->node, local_ust_event
->attr.name);
DBG2("Trace UST event %s, loglevel (%d,%d) created",
DBG2("Trace UST event %s, loglevel (%d,%d) created",
- lue->attr.name, lue->attr.loglevel_type,
- lue->attr.loglevel);
+ local_ust_event->attr.name, local_ust_event->attr.loglevel_type,
+ local_ust_event->attr.loglevel);
+
+ *ust_event = local_ust_event;
- return
lue
;
+ return
ret
;
error_free_event:
error_free_event:
- free(l
ue
);
+ free(l
ocal_ust_event
);
error:
free(filter_expression);
free(filter);
free(exclusion);
error:
free(filter_expression);
free(filter);
free(exclusion);
- return
NULL
;
+ return
ret
;
}
static
}
static
This page took
0.027102 seconds
and
4
git commands to generate.