Mi fix: basic formatting
authorJonathan Rajotte Julien <jonathan.r.julien@gmail.com>
Thu, 19 Jun 2014 21:08:29 +0000 (17:08 -0400)
committerJonathan Rajotte Julien <jonathan.r.julien@gmail.com>
Tue, 22 Jul 2014 20:14:57 +0000 (16:14 -0400)
Signed-off-by: Jonathan Rajotte Julien <jonathan.r.julien@gmail.com>
src/common/mi-lttng.c
src/common/mi-lttng.h
src/common/mi_lttng.xsd

index 1b65ddd4cbdefa31062286114d7b7cd0197177c7..cd5c082fd316bb867216be8acf40c2e60ee6a387 100644 (file)
 
 /* Strings related to command */
 const char * const mi_lttng_element_command = "command";
-const char * const mi_lttng_element_command_name = "name";
-const char * const mi_lttng_element_command_version = "version";
+const char * const mi_lttng_element_command_action = "snapshot_action";
+const char * const mi_lttng_element_command_add_context = "add-context";
+const char * const mi_lttng_element_command_calibrate = "calibrate";
+const char * const mi_lttng_element_command_create = "create";
+const char * const mi_lttng_element_command_destroy = "destroy";
+const char * const mi_lttng_element_command_disable_channel = "disable-channel";
+const char * const mi_lttng_element_command_disable_event = "disable-event";
+const char * const mi_lttng_element_command_enable_channels = "enable-channel";
 const char * const mi_lttng_element_command_enable_event = "enable-event";
 const char * const mi_lttng_element_command_list = "list";
-const char * const mi_lttng_element_command_save = "save";
 const char * const mi_lttng_element_command_load = "load";
+const char * const mi_lttng_element_command_name = "name";
+const char * const mi_lttng_element_command_output = "output";
+const char * const mi_lttng_element_command_save = "save";
+const char * const mi_lttng_element_command_set_session = "set-session";
+const char * const mi_lttng_element_command_snapshot = "snapshot";
+const char * const mi_lttng_element_command_snapshot_add = "add_snapshot";
+const char * const mi_lttng_element_command_snapshot_del = "del_snapshot";
+const char * const mi_lttng_element_command_snapshot_list = "list_snapshot";
+const char * const mi_lttng_element_command_snapshot_record = "record_snapshot";
 const char * const mi_lttng_element_command_start = "start";
 const char * const mi_lttng_element_command_stop = "stop";
-const char * const mi_lttng_element_command_create = "create";
-const char * const mi_lttng_element_command_destroy = "destroy";
-const char * const mi_lttng_element_command_calibrate = "calibrate";
-const char * const mi_lttng_element_command_add_context = "add-context";
-const char * const mi_lttng_element_command_enable_channels = "enable-channel";
-const char * const mi_lttng_element_command_set_session = "set-session";
-const char * const mi_lttng_element_command_disable_event = "disable-event";
-const char * const mi_lttng_element_command_disable_channel = "disable-channel";
-const char * const mi_lttng_element_command_action = "snapshot_action";
-const char * const mi_lttng_element_command_output = "output";
 const char * const mi_lttng_element_command_success = "success";
+const char * const mi_lttng_element_command_version = "version";
 
 /* Strings related to version command */
 const char * const mi_lttng_element_version = "version";
-const char * const mi_lttng_element_version_str = "string";
-const char * const mi_lttng_element_version_web = "url";
-const char * const mi_lttng_element_version_major = "major";
-const char * const mi_lttng_element_version_minor = "minor";
 const char * const mi_lttng_element_version_commit = "commit";
+const char * const mi_lttng_element_version_description = "description";
 const char * const mi_lttng_element_version_license = "license";
+const char * const mi_lttng_element_version_major = "major";
+const char * const mi_lttng_element_version_minor = "minor";
 const char * const mi_lttng_element_version_patch_level = "patchLevel";
-const char * const mi_lttng_element_version_description = "description";
-const char * const mi_lttng_element_command_snapshot = "snapshot";
-const char * const mi_lttng_element_command_list_snapshot = "list_snapshot";
-const char * const mi_lttng_element_command_del_snapshot = "del_snapshot";
-const char * const mi_lttng_element_command_add_snapshot = "add_snapshot";
-const char * const mi_lttng_element_command_record_snapshot = "record_snapshot";
-
-/* Strings related to pid */
-const char * const mi_lttng_element_pids = "pids";
-const char * const mi_lttng_element_pid = "pid";
-
-/* Strings related to save command */
-const char * const mi_lttng_element_save = "save";
-
-/* Strings related to load command */
-const char * const mi_lttng_element_load = "load";
+const char * const mi_lttng_element_version_str = "string";
+const char * const mi_lttng_element_version_web = "url";
 
 /* String related to a lttng_event_field */
 const char * const mi_lttng_element_event_field = "event_field";
@@ -84,16 +74,27 @@ const char * const mi_lttng_context_type_perf_thread_counter = "PERF_THREAD_COUN
 /* String related to lttng_event_perf_counter_ctx */
 const char * const mi_lttng_element_perf_counter_context = "perf_counter_context";
 
+/* Strings related to pid */
+const char * const mi_lttng_element_pids = "pids";
+const char * const mi_lttng_element_pid = "pid";
+const char * const mi_lttng_element_pid_id = "id";
+
+/* Strings related to save command */
+const char * const mi_lttng_element_save = "save";
+
+/* Strings related to load command */
+const char * const mi_lttng_element_load = "load";
+
 /* General elements of mi_lttng */
-const char * const mi_lttng_element_type_other = "OTHER";
-const char * const mi_lttng_element_type_integer = "INTEGER";
+const char * const mi_lttng_element_empty = "";
+const char * const mi_lttng_element_id = "id";
+const char * const mi_lttng_element_nowrite = "nowrite";
+const char * const mi_lttng_element_success = "success";
 const char * const mi_lttng_element_type_enum = "ENUM";
 const char * const mi_lttng_element_type_float = "FLOAT";
+const char * const mi_lttng_element_type_integer = "INTEGER";
+const char * const mi_lttng_element_type_other = "OTHER";
 const char * const mi_lttng_element_type_string = "STRING";
-const char * const mi_lttng_element_nowrite = "nowrite";
-const char * const mi_lttng_element_success = "success";
-const char * const mi_lttng_element_id = "id";
-const char * const mi_lttng_element_empty = "";
 
 /* String related to loglevel */
 const char * const mi_lttng_loglevel_str_alert = "TRACE_ALERT";
@@ -124,12 +125,12 @@ const char * const mi_lttng_element_calibrate = "calibrate";
 const char * const mi_lttng_element_calibrate_function = "FUNCTION";
 
 /* String related to a lttng_snapshot_output */
-const char * const mi_lttng_element_snapshots = "snapshots";
-const char * const mi_lttng_element_snapshot_session_name = "session_name";
-const char * const mi_lttng_element_snapshot_n_ptr = "n_ptr";
-const char * const mi_lttng_element_snapshot_data_url = "data_url";
 const char * const mi_lttng_element_snapshot_ctrl_url = "ctrl_url";
+const char * const mi_lttng_element_snapshot_data_url = "data_url";
 const char * const mi_lttng_element_snapshot_max_size = "max_size";
+const char * const mi_lttng_element_snapshot_n_ptr = "n_ptr";
+const char * const mi_lttng_element_snapshot_session_name = "session_name";
+const char * const mi_lttng_element_snapshots = "snapshots";
 
 const char *mi_lttng_loglevel_string(int value)
 {
@@ -798,28 +799,28 @@ int mi_lttng_event_common_attributes(struct mi_writer *writer,
                goto end;
        }
 
-       /* event name */
+       /* Event name */
        ret = mi_lttng_writer_write_element_string(writer,
                        config_element_name, event->name);
        if (ret) {
                goto end;
        }
 
-       /* event type */
+       /* Event type */
        ret = mi_lttng_writer_write_element_string(writer,
                        config_element_type, mi_lttng_eventtype_string(event->type));
        if (ret) {
                goto end;
        }
 
-       /* is event enabled */
+       /* Is event enabled */
        ret = mi_lttng_writer_write_element_bool(writer,
                        config_element_enabled, event->enabled);
        if (ret) {
                goto end;
        }
 
-       /* event filter enabled? */
+       /* Event filter enabled? */
        ret = mi_lttng_writer_write_element_bool(writer,
                        config_element_filter, event->filter);
 
@@ -833,13 +834,14 @@ int mi_lttng_event_tracepoint_loglevel(struct mi_writer *writer,
 {
        int ret;
 
-       /* event loglevel */
+       /* Event loglevel */
        ret = mi_lttng_writer_write_element_string(writer,
                        config_element_loglevel, mi_lttng_loglevel_string(event->loglevel));
        if (ret) {
                goto end;
        }
 
+       /* Log level type */
        ret = mi_lttng_writer_write_element_string(writer,
                        config_element_loglevel_type,
                        mi_lttng_logleveltype_string(event->loglevel_type));
@@ -1009,9 +1011,6 @@ int mi_lttng_event_field(struct mi_writer *writer,
        int ret;
 
        if (!field->field_name[0]) {
-               /* To Review: not sure if legal david ?
-                * how should this be handle ?
-                */
                ret = 0;
                goto end;
        }
index 6215df56734414b21d360bd7233e15c91a947d66..476310ba404c5655345e1b6e3699ac5b643b2fce 100644 (file)
@@ -50,41 +50,41 @@ struct mi_lttng_version {
 
 /* Strings related to command */
 const char * const mi_lttng_element_command;
-const char * const mi_lttng_element_command_name;
 const char * const mi_lttng_element_command_action;
-const char * const mi_lttng_element_command_version;
-const char * const mi_lttng_element_command_enable_event;
-const char * const mi_lttng_element_command_list;
-const char * const mi_lttng_element_command_save;
-const char * const mi_lttng_element_command_load;
-const char * const mi_lttng_element_command_stop;
-const char * const mi_lttng_element_command_start;
+const char * const mi_lttng_element_command_add_context;
+const char * const mi_lttng_element_command_calibrate;
 const char * const mi_lttng_element_command_create;
 const char * const mi_lttng_element_command_destroy;
-const char * const mi_lttng_element_command_calibrate;
-const char * const mi_lttng_element_command_add_context;
+const char * const mi_lttng_element_command_disable_channel;
+const char * const mi_lttng_element_command_disable_event;
 const char * const mi_lttng_element_command_enable_channels;
+const char * const mi_lttng_element_command_enable_event;
+const char * const mi_lttng_element_command_list;
+const char * const mi_lttng_element_command_load;
+const char * const mi_lttng_element_command_name;
+const char * const mi_lttng_element_command_output;
+const char * const mi_lttng_element_command_save;
 const char * const mi_lttng_element_command_set_session;
-const char * const mi_lttng_element_command_disable_event;
-const char * const mi_lttng_element_command_disable_channel;
 const char * const mi_lttng_element_command_snapshot;
-const char * const mi_lttng_element_command_list_snapshot;
-const char * const mi_lttng_element_command_del_snapshot;
-const char * const mi_lttng_element_command_add_snapshot;
-const char * const mi_lttng_element_command_record_snapshot;
-const char * const mi_lttng_element_command_output;
+const char * const mi_lttng_element_command_snapshot_add;
+const char * const mi_lttng_element_command_snapshot_del;
+const char * const mi_lttng_element_command_snapshot_list;
+const char * const mi_lttng_element_command_snapshot_record;
+const char * const mi_lttng_element_command_start;
+const char * const mi_lttng_element_command_stop;
 const char * const mi_lttng_element_command_success;
+const char * const mi_lttng_element_command_version;
 
 /* Strings related to version command */
 const char * const mi_lttng_element_version;
-const char * const mi_lttng_element_version_str;
-const char * const mi_lttng_element_version_web;
+const char * const mi_lttng_element_version_commit;
+const char * const mi_lttng_element_version_description;
+const char * const mi_lttng_element_version_license;
 const char * const mi_lttng_element_version_major;
 const char * const mi_lttng_element_version_minor;
-const char * const mi_lttng_element_version_license;
-const char * const mi_lttng_element_version_commit;
 const char * const mi_lttng_element_version_patch_level;
-const char * const mi_lttng_element_version_description;
+const char * const mi_lttng_element_version_str;
+const char * const mi_lttng_element_version_web;
 
 /* String related to a lttng_event_field */
 const char * const mi_lttng_element_event_field;
@@ -110,13 +110,15 @@ const char * const mi_lttng_element_save;
 const char * const mi_lttng_element_load;
 
 /* General element of mi_lttng */
-const char * const mi_lttng_element_type_other;
-const char * const mi_lttng_element_type_integer;
+const char * const mi_lttng_element_empty;
+const char * const mi_lttng_element_id;
+const char * const mi_lttng_element_nowrite;
+const char * const mi_lttng_element_success;
 const char * const mi_lttng_element_type_enum;
 const char * const mi_lttng_element_type_float;
+const char * const mi_lttng_element_type_integer;
+const char * const mi_lttng_element_type_other;
 const char * const mi_lttng_element_type_string;
-const char * const mi_lttng_element_nowrite;
-const char * const mi_lttng_element_success;
 
 /* String related to loglevel */
 const char * const mi_lttng_loglevel_str_alert;
@@ -147,12 +149,12 @@ const char * const mi_lttng_element_calibrate;
 const char * const mi_lttng_element_calibrate_function;
 
 /* String related to a lttng_snashot */
-const char * const mi_lttng_element_snapshots;
-const char * const mi_lttng_element_snapshot_session_name;
-const char * const mi_lttng_element_snapshot_n_ptr;
-const char * const mi_lttng_element_snapshot_data_url;
 const char * const mi_lttng_element_snapshot_ctrl_url;
+const char * const mi_lttng_element_snapshot_data_url;
 const char * const mi_lttng_element_snapshot_max_size;
+const char * const mi_lttng_element_snapshot_n_ptr;
+const char * const mi_lttng_element_snapshot_session_name;
+const char * const mi_lttng_element_snapshots;
 
 /* Utility string function  */
 const char *mi_lttng_loglevel_string(int value);
index 2b28a314b059530028696d23a50d8cd65e72ca6b..57960119e5571f4820808d8c10f61a897d91b221 100644 (file)
@@ -158,6 +158,7 @@ THE SOFTWARE.
                </xs:choice>
        </xs:complexType>
 
+       <!-- Maps to exclusion type -->
        <xs:complexType name="event_exclusion_list_type">
                <xs:sequence>
                        <xs:element name="exclusion" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
@@ -196,6 +197,7 @@ THE SOFTWARE.
                </xs:all>
        </xs:complexType>
 
+       <!-- Maps to an array of event -->
        <xs:complexType name="event_list_type">
                <xs:sequence>
                        <xs:element name="event" type="event_type" minOccurs="0" maxOccurs="unbounded" />
@@ -220,6 +222,7 @@ THE SOFTWARE.
                </xs:restriction>
        </xs:simpleType>
 
+       <!-- Maps to the type mode of a channel -->
        <xs:simpleType name="channel_overwrite_mode_type">
                <xs:restriction base="xs:string">
                        <xs:enumeration value="DISCARD" />
@@ -235,14 +238,16 @@ THE SOFTWARE.
                </xs:restriction>
        </xs:simpleType>
 
+       <!-- map to a pid -->
        <xs:complexType name="pid_type">
                <xs:all>
-                       <xs:element name="id" type="xs:int"/>
-                       <xs:element name="name" type="name_type"/>
+                       <xs:element name="id" type="xs:int" />
+                       <xs:element name="name" type="name_type" />
                        <xs:element name="events" type="event_list_type" minOccurs="0" />
                </xs:all>
        </xs:complexType>
 
+       <!-- maps to an array of pid -->
        <xs:complexType name="pids_type">
                <xs:sequence>
                        <xs:element name="pid" type="pid_type" minOccurs="0" maxOccurs="unbounded" />
@@ -252,7 +257,7 @@ THE SOFTWARE.
        <!-- Maps to struct lttng_domain and contains channels -->
        <xs:complexType name="domain_type">
                <xs:all>
-                       <xs:element name="type" type="domain_type_type"/>
+                       <xs:element name="type" type="domain_type_type" />
                        <xs:element name="buffer_type" type="domain_buffer_type" />
                        <xs:element name="pids" type="pids_type" minOccurs="0" />
                        <xs:element name="channels" type="channels_type" minOccurs="0" />
@@ -263,25 +268,25 @@ THE SOFTWARE.
        <!-- Maps to struct lttng_channel -->
        <xs:complexType name="channel_type">
                <xs:all>
-                       <xs:element name="name" type="name_type"/>
-                       <xs:element name="enabled" type="xs:boolean" default="true" minOccurs="0"/>
-                       <xs:element name="attributes" type="channel_attributes_type" minOccurs="0"/>
-                       <xs:element name="events" type="event_list_type" minOccurs="0"/>
+                       <xs:element name="name" type="name_type" />
+                       <xs:element name="enabled" type="xs:boolean" default="true" minOccurs="0" />
+                       <xs:element name="attributes" type="channel_attributes_type" minOccurs="0" />
+                       <xs:element name="events" type="event_list_type" minOccurs="0" />
                </xs:all>
        </xs:complexType>
 
        <!-- Maps to struct lttng_channel_attr -->
        <xs:complexType name="channel_attributes_type">
                <xs:all>
-                       <xs:element name="overwrite_mode" type="channel_overwrite_mode_type" default="DISCARD" minOccurs="0"/>
-                       <xs:element name="subbuffer_size" type="uint64_type" minOccurs="0"/> <!-- bytes -->
-                       <xs:element name="subbuffer_count" type="uint64_type" default="4" minOccurs="0"/>
-                       <xs:element name="switch_timer_interval" type="uint32_type" default="0" minOccurs="0"/>  <!-- usec -->
-                       <xs:element name="read_timer_interval" type="uint32_type"/>  <!-- usec -->
-                       <xs:element name="output_type" type="event_output_type"/>
-                       <xs:element name="tracefile_size" type="uint64_type" default="0" minOccurs="0"/> <!-- bytes -->
-                       <xs:element name="tracefile_count" type="uint64_type" default="0" minOccurs="0"/>
-                       <xs:element name="live_timer_interval" type="uint32_type" default="0" minOccurs="0"/> <!-- usec -->
+                       <xs:element name="overwrite_mode" type="channel_overwrite_mode_type" default="DISCARD" minOccurs="0" />
+                       <xs:element name="subbuffer_size" type="uint64_type" minOccurs="0" /> <!-- bytes -->
+                       <xs:element name="subbuffer_count" type="uint64_type" default="4" minOccurs="0" />
+                       <xs:element name="switch_timer_interval" type="uint32_type" default="0" minOccurs="0" />  <!-- usec -->
+                       <xs:element name="read_timer_interval" type="uint32_type" />  <!-- usec -->
+                       <xs:element name="output_type" type="event_output_type" />
+                       <xs:element name="tracefile_size" type="uint64_type" default="0" minOccurs="0" /> <!-- bytes -->
+                       <xs:element name="tracefile_count" type="uint64_type" default="0" minOccurs="0" />
+                       <xs:element name="live_timer_interval" type="uint32_type" default="0" minOccurs="0" /> <!-- usec -->
                </xs:all>
        </xs:complexType>
 
@@ -292,8 +297,8 @@ THE SOFTWARE.
                        <xs:element name="max_size" type="uint64_type" minOccurs="0" />
                        <xs:element name="name" type="name_type" minOccurs="0" />
                        <xs:element name="session_name" type="name_type" minOccurs="0" />
-                       <xs:element name="ctrl_url" type="name_type" minOccurs="0"/>
-                       <xs:element name="data_url" type="name_type" minOccurs="0"/>
+                       <xs:element name="ctrl_url" type="name_type" minOccurs="0" />
+                       <xs:element name="data_url" type="name_type" minOccurs="0" />
                </xs:all>
        </xs:complexType>
 
@@ -309,6 +314,7 @@ THE SOFTWARE.
                </xs:sequence>
        </xs:complexType>
 
+       <!-- Maps to a lttng_session -->
        <xs:complexType name="session_type">
                <xs:all>
                        <xs:element name="name" type="name_type" />
@@ -322,27 +328,28 @@ THE SOFTWARE.
                </xs:all>
        </xs:complexType>
 
+       <!-- Maps to a lttng_event_field -->
        <xs:complexType name="event_field_type">
                <xs:all>
                        <xs:element name="name" type="name_type" />
-                       <xs:element name="type" type="event_field_type_type"/>
-                       <xs:element name="nowrite" type="xs:int"/>
+                       <xs:element name="type" type="event_field_type_type" />
+                       <xs:element name="nowrite" type="xs:int" />
                </xs:all>
        </xs:complexType>
 
-       <!-- map to the save command -->
+       <!-- Map to the save command -->
        <xs:complexType name="save_type">
                <xs:all>
                        <xs:element name="session" type="session_type" />
-                       <xs:element name="path" type="name_type"/>
+                       <xs:element name="path" type="name_type" />
                </xs:all>
        </xs:complexType>
 
-       <!-- map to the load command -->
+       <!-- Map to the load command -->
        <xs:complexType name="load_type">
                <xs:all>
                        <xs:element name="session" type="session_type" />
-                       <xs:element name="path" type="name_type"/>
+                       <xs:element name="path" type="name_type" />
                </xs:all>
        </xs:complexType>
 
@@ -367,35 +374,39 @@ THE SOFTWARE.
                <xs:all>
                        <xs:element name="type" type="context_type_type" />
                        <xs:element name="perf_counter_context" type="perf_counter_context_type" minOccurs="0" />
-                       <!-- The success element is present only for lttng cli command add-context -->
                        <xs:element name="success" type="xs:boolean" default="false" minOccurs="0" />
                </xs:all>
        </xs:complexType>
 
+       <!-- Maps to an array of domain -->
        <xs:complexType name="domains_type">
                <xs:sequence>
                        <xs:element name="domain" type="domain_type" minOccurs="0" maxOccurs="unbounded" />
                </xs:sequence>
        </xs:complexType>
 
+       <!-- Maps to an array of session -->
        <xs:complexType name="sessions_type">
                <xs:sequence>
                        <xs:element name="session" type="session_type" minOccurs="0" maxOccurs="unbounded" />
                </xs:sequence>
        </xs:complexType>
 
+       <!-- Maps to an array of event_field -->
        <xs:complexType name="event_fields_type">
                <xs:sequence>
                        <xs:element name="event_field" type="event_field_type" minOccurs="0" maxOccurs="unbounded" />
                </xs:sequence>
        </xs:complexType>
 
+       <!-- Maps to an array of context -->
        <xs:complexType name="contexts_type">
                <xs:sequence>
                        <xs:element name="context" type="context_type" minOccurs="0" maxOccurs="unbounded" />
                </xs:sequence>
        </xs:complexType>
 
+       <!-- Maps to an action dutring snapshot command -->
        <xs:complexType name="snapshot_action_type">
                <xs:sequence>
                        <xs:element name="name" type="snapshot_actiontype_type" minOccurs="0" />
@@ -406,10 +417,10 @@ THE SOFTWARE.
        <!-- Type of snapshot commands -->
        <xs:simpleType name="snapshot_actiontype_type">
                <xs:restriction base="xs:string">
-                       <xs:enumeration value="list-output"/>
-                       <xs:enumeration value="del-output"/>
-                       <xs:enumeration value="add-output"/>
-                       <xs:enumeration value="record-output"/>
+                       <xs:enumeration value="list-output" />
+                       <xs:enumeration value="del-output" />
+                       <xs:enumeration value="add-output" />
+                       <xs:enumeration value="record-output" />
                </xs:restriction>
        </xs:simpleType>
 
This page took 0.033037 seconds and 4 git commands to generate.