Python: add create_snapshot
[lttng-tools.git] / extras / bindings / swig / python / lttng.i.in
index 0d6d1e952634c0fcc5bbc1ef9045081d87bd558b..145b0f8e1966aa0773201cb6f90e2241b9de0575 100644 (file)
@@ -15,6 +15,14 @@ multiple concurrent processes and threads. Tracing across multiple systems is al
 #include <lttng/lttng.h>
 %}
 
 #include <lttng/lttng.h>
 %}
 
+%{
+#if PY_MAJOR_VERSION >= 3
+// The PyInt and PyLong types were unified as of Python 3
+// This makes the typemap code useable with both Python 2 and 3.
+#define PyInt_AsSsize_t PyLong_AsSsize_t
+#endif
+%}
+
 typedef unsigned int uint32_t;
 typedef int int32_t;
 typedef unsigned long long uint64_t;
 typedef unsigned int uint32_t;
 typedef int int32_t;
 typedef unsigned long long uint64_t;
@@ -306,6 +314,7 @@ enum lttng_calibrate_type {
 // =============================================
 
 %rename("create") lttng_create_session(const char *name, const char *path);
 // =============================================
 
 %rename("create") lttng_create_session(const char *name, const char *path);
+%rename("create_snapshot") lttng_create_session_snapshot(const char *name, const char *snapshot_url);
 %rename("destroy") lttng_destroy_session(const char *name);
 %rename("_lttng_create_handle") lttng_create_handle(const char *session_name, struct lttng_domain *domain);
 %rename("_lttng_destroy_handle") lttng_destroy_handle(struct lttng_handle *handle);
 %rename("destroy") lttng_destroy_session(const char *name);
 %rename("_lttng_create_handle") lttng_create_handle(const char *session_name, struct lttng_domain *domain);
 %rename("_lttng_destroy_handle") lttng_destroy_handle(struct lttng_handle *handle);
@@ -353,14 +362,20 @@ int lttng_list_domains(const char *session_name, struct lttng_domain **domains);
 %feature("docstring")"create(str name, str path) -> int
 
 Create a new tracing session using name and path.
 %feature("docstring")"create(str name, str path) -> int
 
 Create a new tracing session using name and path.
-Returns size of returned session payload data or a negative error code."
+Returns 0 on success or a negative error code."
 int lttng_create_session(const char *name, const char *path);
 
 int lttng_create_session(const char *name, const char *path);
 
+%feature("docstring")"create_snapshot(str name, str snapshot_url) -> int
+
+Create a new tracing session using name and snapshot_url in snapshot
+mode (flight recorder).
+Returns 0 on success or a negative error code."
+int lttng_create_session_snapshot(const char *name, const char *path);
 
 %feature("docstring")"destroy(str name) -> int
 
 Tear down tracing session using name.
 
 %feature("docstring")"destroy(str name) -> int
 
 Tear down tracing session using name.
-Returns size of returned session payload data or a negative error code."
+Returns 0 on success or a negative error code."
 int lttng_destroy_session(const char *name);
 
 
 int lttng_destroy_session(const char *name);
 
 
@@ -707,7 +722,7 @@ def calibrate(handle, calibrate):
 
 %pythoncode %{
 class Handle:
 
 %pythoncode %{
 class Handle:
-        """
+       """
        Manages a handle.
        Takes two arguments: (str session_name, Domain domain)
        """
        Manages a handle.
        Takes two arguments: (str session_name, Domain domain)
        """
This page took 0.025054 seconds and 5 git commands to generate.