goto end;
}
- /* Open processes element */
- ret = mi_lttng_processes_open(writer);
+ /* Open pids element element */
+ ret = mi_lttng_pids_open(writer);
if (ret) {
goto end;
}
if (!pid_element_open) {
/* Open and write a pid element */
- ret = mi_lttng_process(writer, cur_pid, cmdline, 1);
+ ret = mi_lttng_pid(writer, cur_pid, cmdline, 1);
if (ret) {
goto error;
}
}
}
- /* Close processes */
+ /* Close pids */
ret = mi_lttng_writer_close_element(writer);
if (ret) {
goto end;
goto end;
}
- /* Open processes element */
- ret = mi_lttng_processes_open(writer);
+ /* Open pids element */
+ ret = mi_lttng_pids_open(writer);
if (ret) {
goto end;
}
cur_pid = fields[i].event.pid;
cmdline = get_cmdline_by_pid(cur_pid);
if (!pid_element_open) {
- /* Open and write a process element */
- ret = mi_lttng_process(writer, cur_pid, cmdline, 1);
+ /* Open and write a pid element */
+ ret = mi_lttng_pid(writer, cur_pid, cmdline, 1);
if (ret) {
goto error;
}
}
}
- /* Close processes, domain, domains */
+ /* Close pid, domain, domains */
ret = mi_lttng_close_multi_element(writer, 3);
end:
return ret;
const char * const mi_lttng_element_perf_counter_context = "perf_counter_context";
/* Strings related to pid */
-const char * const mi_lttng_element_processes = "processes";
-const char * const mi_lttng_element_process = "process";
+const char * const mi_lttng_element_pid_id = "id";
/* Strings related to save command */
const char * const mi_lttng_element_save = "save";
return mi_lttng_writer_open_element(writer, config_element_pids);
}
+/*
+ * TODO: move the listing of pid for user agent to process semantic on
+ * mi api bump. The use of process element break the mi api.
+ */
LTTNG_HIDDEN
-int mi_lttng_processes_open(struct mi_writer *writer)
-{
- return mi_lttng_writer_open_element(writer, mi_lttng_element_processes);
-}
-
-LTTNG_HIDDEN
-int mi_lttng_process(struct mi_writer *writer, pid_t pid , const char *name,
+int mi_lttng_pid(struct mi_writer *writer, pid_t pid , const char *name,
int is_open)
{
int ret;
- /* Open element process */
- ret = mi_lttng_writer_open_element(writer, mi_lttng_element_process);
+ /* Open pid process */
+ ret = mi_lttng_writer_open_element(writer, config_element_pid);
if (ret) {
goto end;
}
/* Writing pid number */
ret = mi_lttng_writer_write_element_signed_int(writer,
- config_element_pid, (int)pid);
+ mi_lttng_element_pid_id, (int)pid);
if (ret) {
goto end;
}
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 */
*/
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.
*
</xs:restriction>
</xs:simpleType>
- <!-- Maps to a process -->
- <xs:complexType name="process_type">
+ <!-- map to a pid -->
+ <xs:complexType name="pid_type">
<xs:all>
- <xs:element name="pid" type="xs:int" />
- <xs:element name="name" type="name_type" minOccurs="0" />
+ <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:element name="success" type="xs:boolean" default="false" minOccurs="0" />
</xs:all>
</xs:complexType>
- <!-- Maps to an array of pid -->
+ <!-- maps to an array of pid -->
<xs:complexType name="pids_type">
<xs:sequence>
- <xs:element name="pid" type="xs:int" minOccurs="0" maxOccurs="unbounded" />
- </xs:sequence>
- </xs:complexType>
-
- <!-- Maps to an array of processes -->
- <xs:complexType name="processes_type">
- <xs:sequence>
- <xs:element name="process" type="process_type" minOccurs="0" maxOccurs="unbounded" />
+ <xs:element name="pid" type="pid_type" minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
<xs:all>
<xs:element name="type" type="domain_type_type" />
<xs:element name="buffer_type" type="domain_buffer_type" />
- <xs:element name="processes" type="processes_type" minOccurs="0" />
+ <xs:element name="pids" type="pids_type" minOccurs="0" />
<xs:element name="channels" type="channels_type" minOccurs="0" />
<xs:element name="events" type="event_list_type" minOccurs="0" />
<xs:element name="trackers" type="trackers_type" minOccurs="0" />
XPATH_DISABLE_EVENT_SUCCESS="$XPATH_CMD_OUTPUT/channel/events/event/success/text()"
XPATH_LIST_DOMAIN="$XPATH_CMD_OUTPUT/sessions/session/domains/domain"
XPATH_LIST_CHANNEL="$XPATH_CMD_OUTPUT/sessions/session/domains/domain/channels/channel"
-XPATH_LIST_UST_EVENT="$XPATH_CMD_OUTPUT/domains/domain[./type ='UST']/processes/process/events/event"
+XPATH_LIST_UST_EVENT="$XPATH_CMD_OUTPUT/domains/domain[./type ='UST']/pids/pid/events/event"
XPATH_SNAPSHOT_ADD_SNAPSHOT="$XPATH_CMD_OUTPUT/snapshot_action[./name = 'add-output']/output"
XPATH_SNAPSHOT_LIST="$XPATH_CMD_OUTPUT/snapshot_action[./name = 'list-output']/output"
XPATH_SNAPSHOT_DEL="$XPATH_CMD_OUTPUT/snapshot_action[./name = 'del-output']/output"