X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fcommon%2Fmi-lttng.h;h=585818dae4387b5698dde31af7d5d0355a0c1094;hp=3722e54e2a39dd2997438b181926343fe19fa5d9;hb=8d5841ea483139d3ab2f2b4dd39263dad63832b1;hpb=f95771e88e932a4accf0fa152d8d14b43278920f diff --git a/src/common/mi-lttng.h b/src/common/mi-lttng.h index 3722e54e2..585818dae 100644 --- a/src/common/mi-lttng.h +++ b/src/common/mi-lttng.h @@ -1,6 +1,7 @@ /* * Copyright (C) 2014 - Jonathan Rajotte * - Olivier Cotte + * Copyright (C) 2016 - Jérémie Galarneau * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License, version 2 only, as @@ -23,7 +24,7 @@ #include #include -#include +#include #include /* Don't want to reference snapshot-internal.h here */ @@ -39,13 +40,13 @@ struct mi_writer { * Version information for the machine interface. */ struct mi_lttng_version { - char version[NAME_MAX]; /* Version number of package */ + char version[LTTNG_NAME_MAX]; /* Version number of package */ uint32_t version_major; /* LTTng-Tools major version number */ uint32_t version_minor; /* LTTng-Tools minor version number */ uint32_t version_patchlevel; /* LTTng-Tools patchlevel version number */ - char version_commit[NAME_MAX]; /* Commit hash of the current version */ - char version_name[NAME_MAX]; - char package_url[NAME_MAX]; /* Define to the home page for this package. */ + char version_commit[LTTNG_NAME_MAX]; /* Commit hash of the current version */ + char version_name[LTTNG_NAME_MAX]; + char package_url[LTTNG_NAME_MAX]; /* Define to the home page for this package. */ }; /* Strings related to command */ @@ -61,6 +62,8 @@ extern const char * const mi_lttng_element_command_enable_channels; extern const char * const mi_lttng_element_command_enable_event; extern const char * const mi_lttng_element_command_list; extern const char * const mi_lttng_element_command_load; +extern const char * const mi_lttng_element_command_metadata; +extern const char * const mi_lttng_element_command_metadata_action; extern const char * const mi_lttng_element_command_name; extern const char * const mi_lttng_element_command_output; extern const char * const mi_lttng_element_command_save; @@ -92,17 +95,10 @@ extern const char * const mi_lttng_element_version_web; extern const char * const mi_lttng_element_event_field; extern const char * const mi_lttng_element_event_fields; -/* String related to lttng_event_context */ -extern const char * const mi_lttng_context_type_perf_counter; -extern const char * const mi_lttng_context_type_perf_cpu_counter; -extern const char * const mi_lttng_context_type_perf_thread_counter; - /* String related to lttng_event_perf_counter_ctx */ extern const char * const mi_lttng_element_perf_counter_context; /* Strings related to pid */ -extern const char * const mi_lttng_element_processes; -extern const char * const mi_lttng_element_process; extern const char * const mi_lttng_element_pid_id; /* Strings related to save command */ @@ -187,6 +183,9 @@ extern const char * const mi_lttng_element_snapshot_n_ptr; extern const char * const mi_lttng_element_snapshot_session_name; extern const char * const mi_lttng_element_snapshots; +/* String related to track/untrack command */ +const char * const mi_lttng_element_track_untrack_all_wildcard; + /* Utility string function */ const char *mi_lttng_loglevel_string(int value, enum lttng_domain_type domain); const char *mi_lttng_logleveltype_string(enum lttng_loglevel_type value); @@ -195,9 +194,6 @@ const char *mi_lttng_domaintype_string(enum lttng_domain_type value); const char *mi_lttng_buffertype_string(enum lttng_buffer_type value); const char *mi_lttng_calibratetype_string(enum lttng_calibrate_type val); -/* String related to track/untrack command */ -const char * const mi_lttng_element_track_untrack_all_wildcard; - /* * Create an instance of a machine interface writer. * @@ -617,6 +613,25 @@ int mi_lttng_processes_open(struct mi_writer *writer); */ int mi_lttng_process(struct mi_writer *writer, pid_t pid , const char *name, int is_open); + +/* + * TODO: move pid of lttng list -u to process semantic on mi api bump + * Machine interface of a Process. + * + * writer An instance of a machine interface writer. + * pid A PID. + * + * is_open Defines whether or not the session element shall be closed. + * This should be used carefully and the client + * must close the pid element. + * Use case: nested addition information on a domain + * ex: channel event. + * + * Returns zero if the element's value could be written. + * Negative values indicate an error. + */ +int mi_lttng_pid(struct mi_writer *writer, pid_t pid , const char *name, + int is_open); /* * Machine interface: open a targets element. *