X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=blobdiff_plain;f=extras%2Fbindings%2Fswig%2Fpython%2Flttng.i.in;h=145b0f8e1966aa0773201cb6f90e2241b9de0575;hp=0d6d1e952634c0fcc5bbc1ef9045081d87bd558b;hb=9e52b0d84210aaed7b6bb70709a6dafbffbe922c;hpb=36907cb5a542b8eb01d95e1990894abd45e98bc0;ds=sidebyside diff --git a/extras/bindings/swig/python/lttng.i.in b/extras/bindings/swig/python/lttng.i.in index 0d6d1e952..145b0f8e1 100644 --- a/extras/bindings/swig/python/lttng.i.in +++ b/extras/bindings/swig/python/lttng.i.in @@ -15,6 +15,14 @@ multiple concurrent processes and threads. Tracing across multiple systems is al #include %} +%{ +#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; @@ -306,6 +314,7 @@ enum lttng_calibrate_type { // ============================================= %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); @@ -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. -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); +%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. -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); @@ -707,7 +722,7 @@ def calibrate(handle, calibrate): %pythoncode %{ class Handle: - """ + """ Manages a handle. Takes two arguments: (str session_name, Domain domain) """