rotation-api: pass session name explicitly
[lttng-tools.git] / src / common / config / session-config.c
index 518fde70b5e63d1d244369ca634d0a647bb75f21..244fbd5cc5c05f85e0bcaef9a00c345e634f02dc 100644 (file)
@@ -185,6 +185,8 @@ LTTNG_HIDDEN const char * const config_event_context_interruptible = "INTERRUPTI
 LTTNG_HIDDEN const char * const config_event_context_preemptible = "PREEMPTIBLE";
 LTTNG_HIDDEN const char * const config_event_context_need_reschedule = "NEED_RESCHEDULE";
 LTTNG_HIDDEN const char * const config_event_context_migratable = "MIGRATABLE";
+LTTNG_HIDDEN const char * const config_event_context_callstack_user= "CALLSTACK_USER";
+LTTNG_HIDDEN const char * const config_event_context_callstack_kernel = "CALLSTACK_KERNEL";
 
 /* Deprecated symbols */
 const char * const config_element_perf;
@@ -1018,6 +1020,12 @@ int get_context_type(xmlChar *context_type)
        } else if (!strcmp((char *) context_type,
                config_event_context_migratable)) {
                ret = LTTNG_EVENT_CONTEXT_MIGRATABLE;
+       } else if (!strcmp((char *) context_type,
+               config_event_context_callstack_user)) {
+               ret = LTTNG_EVENT_CONTEXT_CALLSTACK_USER;
+       } else if (!strcmp((char *) context_type,
+               config_event_context_callstack_kernel)) {
+               ret = LTTNG_EVENT_CONTEXT_CALLSTACK_KERNEL;
        } else {
                goto error;
        }
@@ -2823,20 +2831,18 @@ domain_init_error:
        }
 
        if (rotation_timer_interval || rotation_size) {
-               struct lttng_rotation_schedule_attr *rotation_attr = lttng_rotation_schedule_attr_create();
+               struct lttng_rotation_schedule_attr *rotation_attr =
+                               lttng_rotation_schedule_attr_create();
 
                if (!rotation_attr) {
                        goto error;
                }
-               ret = lttng_rotation_schedule_attr_set_session_name(rotation_attr, (const char *) name);
-               if (ret) {
-                       lttng_rotation_schedule_attr_destroy(rotation_attr);
-                       goto error;
-               }
                lttng_rotation_schedule_attr_set_timer_period(rotation_attr,
                                rotation_timer_interval);
-               lttng_rotation_schedule_attr_set_size(rotation_attr, rotation_size);
-               ret = lttng_rotation_set_schedule(rotation_attr);
+               lttng_rotation_schedule_attr_set_size(rotation_attr,
+                               rotation_size);
+               ret = lttng_rotation_set_schedule((const char *) name,
+                               rotation_attr);
                lttng_rotation_schedule_attr_destroy(rotation_attr);
                if (ret) {
                        goto error;
This page took 0.02483 seconds and 5 git commands to generate.