Generate session name and default output on sessiond's end
[lttng-tools.git] / extras / bindings / swig / python / lttng.i.in
index 4349d93d000ea7270c75fc008527b4f0ed0eeea1..7418d01d635c24778b55309de35aff4a4716086d 100644 (file)
@@ -135,10 +135,6 @@ enum lttng_event_context_type {
        LTTNG_EVENT_CONTEXT_PTHREAD_ID        = 10,
 };
 
-%rename("CALIBRATE_FUNCTION") LTTNG_CALIBRATE_FUNCTION;
-enum lttng_calibrate_type {
-       LTTNG_CALIBRATE_FUNCTION              = 0,
-};
 
 
 
@@ -160,12 +156,10 @@ enum lttng_calibrate_type {
                        PyObject *name = PyString_FromString((*$1)[i].name);
                        PyObject *path = PyString_FromString((*$1)[i].path);
                        PyObject *enabled = PyInt_FromSize_t((*$1)[i].enabled);
-                       PyObject *padding = PyString_FromString((*$1)[i].padding);
 
                        PyTuple_SetItem(tmp, 0, name);
                        PyTuple_SetItem(tmp, 1, path);
                        PyTuple_SetItem(tmp, 2, enabled);
-                       PyTuple_SetItem(tmp, 3, padding);
                        PyList_Append(sessions, tmp);
                }
                $result = sessions;
@@ -335,7 +329,6 @@ enum lttng_calibrate_type {
 %rename("_lttng_enable_channel") lttng_enable_channel(struct lttng_handle *handle, struct lttng_channel *chan);
 %rename("_lttng_disable_event") lttng_disable_event(struct lttng_handle *handle, const char *name, const char *channel_name);
 %rename("_lttng_disable_channel") lttng_disable_channel(struct lttng_handle *handle, const char *name);
-%rename("_lttng_calibrate") lttng_calibrate(struct lttng_handle *handle, struct lttng_calibrate *calibrate);
 %rename("channel_set_default_attr") lttng_channel_set_default_attr(struct lttng_domain *domain, struct lttng_channel_attr *attr);
 
 //Redefined functions
@@ -354,7 +347,6 @@ int lttng_enable_channel(struct lttng_handle *handle, struct lttng_channel *chan
 int lttng_disable_event(struct lttng_handle *handle,
                const char *name, const char *channel_name);
 int lttng_disable_channel(struct lttng_handle *handle, const char *name);
-int lttng_calibrate(struct lttng_handle *handle, struct lttng_calibrate *calibrate);
 int lttng_register_consumer(struct lttng_handle *handle, const char *socket_path);
 int lttng_list_sessions(struct lttng_session **sessions);
 int lttng_list_domains(const char *session_name, struct lttng_domain **domains);
@@ -696,20 +688,6 @@ def disable_channel(handle, name):
                return _lttng_disable_channel(handle._h, name)
        except AttributeError:
                raise TypeError("in method 'disable_channel', argument 1 must be a Handle instance")
-
-
-def calibrate(handle, calibrate):
-       """
-       calibrate(Handle handle, Calibrate calibrate) -> int
-
-       Quantify LTTng overhead.
-       Returns size of returned session payload data or a negative error code.
-       """
-
-       try:
-               return _lttng_calibrate(handle._h, calibrate)
-       except AttributeError:
-               raise TypeError("in method 'calibrate', argument 1 must be a Handle instance")
 %}
 
 
@@ -776,7 +754,6 @@ class Handle:
 %rename("Domain") lttng_domain;
 %rename("EventContext") lttng_event_context;
 %rename("Event") lttng_event;
-%rename("Calibrate") lttng_calibrate;
 %rename("ChannelAttr") lttng_channel_attr;
 %rename("Channel") lttng_channel;
 %rename("Session") lttng_session;
@@ -954,26 +931,6 @@ struct lttng_event {
        }
 };
 
-struct lttng_calibrate {
-       enum lttng_calibrate_type type;
-       char padding[LTTNG_CALIBRATE_PADDING1];
-
-       %extend {
-               char *__repr__() {
-                       static char temp[256];
-                       switch ( $self->type ) {
-                       case 0:
-                               sprintf(temp, "lttng.Calibrate; type(CALIBRATE_FUNCTION)");
-                               break;
-                       default:
-                               sprintf(temp, "lttng.Calibrate; type(%i)", $self->type);
-                               break;
-                       }
-                       return &temp[0];
-               }
-       }
-};
-
 struct lttng_channel_attr {
        int overwrite;
        uint64_t subbuf_size;
@@ -1020,7 +977,7 @@ struct lttng_channel {
        %extend {
                char *__repr__() {
                        static char temp[512];
-                       sprintf(temp, "lttng.Channel; name('%s'), enabled(%s)",
+                       snprintf(temp, sizeof(temp), "lttng.Channel; name('%s'), enabled(%s)",
                                $self->name, $self->enabled ? "True" : "False");
                        return &temp[0];
                }
@@ -1031,12 +988,17 @@ struct lttng_session {
        char name[NAME_MAX];
        char path[PATH_MAX];
        uint32_t enabled;
-       char padding[LTTNG_SESSION_PADDING1];
+       uint32_t snapshot_mode;
+       unsigned int live_timer_interval;
+       union {
+               char padding[LTTNG_SESSION_PADDING1];
+               void *ptr;
+       } extended;
 
        %extend {
                char *__repr__() {
-                       static char temp[512];
-                       sprintf(temp, "lttng.Session; name('%s'), path('%s'), enabled(%s)",
+                       static char temp[PATH_MAX + NAME_MAX + 512];
+                       snprintf(temp, sizeof(temp), "lttng.Session; name('%s'), path('%s'), enabled(%s)",
                                $self->name, $self->path,
                                $self->enabled ? "True" : "False");
                        return &temp[0];
This page took 0.02625 seconds and 4 git commands to generate.