Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
79152b9
Assert that a valid clean-up pipe exists on ht_cleanup_push
jgalar Jun 14, 2016
fa1e908
Express overwrite attribute as a byte in communication protocol
jgalar Jun 14, 2016
591069a
Add name omission and output omission on save to lttng-ctl
jgalar Jun 14, 2016
87b2853
Clean-up: move mi_writer declaration with other declarations
jgalar Jun 14, 2016
f3eada7
Clean-up: harmonize popt option declarations in save.c
jgalar Jun 14, 2016
d31283b
Use bool type for save command options
jgalar Jun 14, 2016
cab91ee
Add --omit-name and --omit-output options to the save command
jgalar Jun 14, 2016
2074933
Allow nameless sessions in session.xsd
jgalar Jun 14, 2016
47895dd
Honor omit_name and omit_output options in sessiond save command
jgalar Jun 14, 2016
f847e29
Docs: document new save command options (--omit-name/--omit-output)
jgalar Jun 14, 2016
ac451f9
refactor: split create_session in 4 functions
PSRCode Jun 8, 2016
d2f1302
WIP add template and session_config function
PSRCode Jun 8, 2016
c628f44
WIP TEST: template testing
PSRCode Jun 8, 2016
6ebcd9a
WIP sessiond.xsd
PSRCode Jun 8, 2016
458db88
Fix session-config: mem leak and uninitialized ret value
PSRCode Jun 9, 2016
341364f
Fix: use temporary data for return of asprintf
PSRCode Jun 9, 2016
3b2377e
Fix: memory management in create.c
PSRCode Jun 9, 2016
97581f2
Fix format and variable name create.c
PSRCode Jun 9, 2016
fa409aa
Implement create command --default-name option
jgalar Jun 15, 2016
a01d3d5
Docs: document create command --default-name option
jgalar Jun 15, 2016
4718348
Implement --default-output option of create command
jgalar Jun 15, 2016
7d3984c
Docs: document new --default-output option of create command
jgalar Jun 15, 2016
ff5b827
Make the domain's buffer type optional in session.xsd
jgalar Jun 15, 2016
8094712
Make channel name attribute optional in session.xsd
jgalar Jun 16, 2016
3a5e9d4
Make channel output type optional in session.xsd
jgalar Jun 16, 2016
22ad58f
Make channel read timer interval optional in session.xsd
jgalar Jun 16, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -981,6 +981,8 @@ AC_CONFIG_FILES([
tests/regression/tools/wildcard/Makefile
tests/regression/tools/crash/Makefile
tests/regression/tools/metadata-regen/Makefile
tests/regression/tools/templates/Makefile
tests/regression/tools/templates/sessions/Makefile
tests/regression/ust/Makefile
tests/regression/ust/nprocesses/Makefile
tests/regression/ust/high-throughput/Makefile
Expand Down
8 changes: 8 additions & 0 deletions doc/man/lttng-create.1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,9 @@ option:-o, option:--output='PATH'::
option:--shm-path='PATH'::
Create shared memory holding buffers at 'PATH'.

option:--default-output::
Use the default output associated to the session's mode.


URL
~~~
Expand All @@ -224,6 +227,11 @@ In <<local-mode,local>> mode, 'URL' must start with `file://` followed
by the destination path on the local file system.


Name
~~~~
option:--default-name::
Generate a session name of the form `auto-YYYYmmdd-HHMMSS`.

include::common-cmd-help-options.txt[]


Expand Down
5 changes: 5 additions & 0 deletions doc/man/lttng-save.1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ option:-f, option:--force::
option:-o, option:--output-path='PATH'::
Set output directory path to 'PATH'.

option:--omit-name::
Omit session name(s) from saved session configuration(s).

option:--omit-output::
Omit session output(s) from saved session configuration(s).

include::common-cmd-help-options.txt[]

Expand Down
6 changes: 5 additions & 1 deletion include/lttng/save-internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ struct lttng_save_session_attr {
/* Destination of the session configuration. See lttng(1) for URL format. */
char configuration_url[PATH_MAX];
/* Overwrite the session configuration file if it exists. */
uint32_t overwrite;
uint8_t overwrite;
/* Omit the sessions' name(s). */
uint8_t omit_name;
/* Omit the sessions' output(s). */
uint8_t omit_output;
} LTTNG_PACKED;

#endif /* LTTNG_SAVE_INTERNAL_ABI_H */
24 changes: 24 additions & 0 deletions include/lttng/save.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,18 @@ const char *lttng_save_session_attr_get_output_url(
*/
int lttng_save_session_attr_get_overwrite(
struct lttng_save_session_attr *attr);
/*
* Return the omit name configuration attribute. This attribute indicates
* whether or not the saved sessions' names should be omitted.
*/
int lttng_save_session_attr_get_omit_name(
struct lttng_save_session_attr *attr);
/*
* Return the omit output configuration attribute. This attribute indicates
* whether or not the saved sessions' output configuration should be omitted.
*/
int lttng_save_session_attr_get_omit_output(
struct lttng_save_session_attr *attr);

/*
* Save session attribute setter family functions.
Expand Down Expand Up @@ -86,6 +98,18 @@ int lttng_save_session_attr_set_output_url(
*/
int lttng_save_session_attr_set_overwrite(
struct lttng_save_session_attr *attr, int overwrite);
/*
* Set the omit name attribute. If set to true, the sessions' names are omitted
* from the resulting session configuration file.
*/
int lttng_save_session_attr_set_omit_name(
struct lttng_save_session_attr *attr, int omit_name);
/*
* Set the omit output attribute. If set to true, the sessions' output
* configurations are omitted from the resulting session configuration file.
*/
int lttng_save_session_attr_set_omit_output(
struct lttng_save_session_attr *attr, int omit_output);

/*
* Save session configuration(s).
Expand Down
33 changes: 25 additions & 8 deletions src/bin/lttng-sessiond/save.c
Original file line number Diff line number Diff line change
Expand Up @@ -1856,6 +1856,7 @@ int save_session(struct ltt_session *session,
struct config_writer *writer = NULL;
size_t session_name_len;
const char *provided_path;
bool omit_name, omit_output;

assert(session);
assert(attr);
Expand All @@ -1871,6 +1872,18 @@ int save_session(struct ltt_session *session,
goto end;
}

ret = lttng_save_session_attr_get_omit_name(attr);
if (ret < 0) {
goto end;
}
omit_name = !!ret;

ret = lttng_save_session_attr_get_omit_output(attr);
if (ret < 0) {
goto end;
}
omit_output = !!ret;

provided_path = lttng_save_session_attr_get_output_url(attr);
if (provided_path) {
DBG3("Save session in provided path %s", provided_path);
Expand Down Expand Up @@ -1963,11 +1976,13 @@ int save_session(struct ltt_session *session,
goto end;
}

ret = config_writer_write_element_string(writer, config_element_name,
session->name);
if (ret) {
ret = LTTNG_ERR_SAVE_IO_FAIL;
goto end;
if (!omit_name) {
ret = config_writer_write_element_string(writer,
config_element_name, session->name);
if (ret) {
ret = LTTNG_ERR_SAVE_IO_FAIL;
goto end;
}
}

if(session->shm_path[0] != '\0') {
Expand Down Expand Up @@ -2023,9 +2038,11 @@ int save_session(struct ltt_session *session,
}
}

ret = save_session_output(writer, session);
if (ret) {
goto end;
if (!omit_output) {
ret = save_session_output(writer, session);
if (ret) {
goto end;
}
}

/* /session */
Expand Down
3 changes: 1 addition & 2 deletions src/bin/lttng-sessiond/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ void ht_cleanup_push(struct lttng_ht *ht)
if (!ht) {
return;
}
if (fd < 0)
return;
assert(fd >= 0);
ret = lttng_write(fd, &ht, sizeof(ht));
if (ret < sizeof(ht)) {
PERROR("write ht cleanup pipe %d", fd);
Expand Down
Loading