When specifying exclusions not contained in the event string warning
message is printed more than once.
For example, running the following command:
lttng enable-event -u 'event_name_*' --exclude=not_event,other_event,my_event
Will result in this warning:
Warning: Event event_name_*: not_event does not exclude any events from event_name_*
Warning: Event event_name_*: other_event does not exclude any events from event_name_*
Warning: Event event_name_*: my_event does not exclude any events from event_name_*
Warning: Event event_name_*: other_event does not exclude any events from event_name_*
Warning: Event event_name_*: my_event does not exclude any events from event_name_*
Warning: Event event_name_*: my_event does not exclude any events from event_name_*
The following should be printed:
Warning: Event event_name_*: not_event does not exclude any events from event_name_*
Warning: Event event_name_*: other_event does not exclude any events from event_name_*
Warning: Event event_name_*: my_event does not exclude any events from event_name_*
This is due to a bad indexing of the exclusions array.
Since we are already iterating on the exclusions array, pass the
exclusions directly with check_exclusion_subset().
Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
return ret;
}
-static
-int check_exclusions_subsets(const char *event_name,
- char * const *exclusions)
-{
- int ret = 0;
- char * const *item;
-
- for (item = exclusions; *item; item++) {
- ret = check_exclusion_subsets(event_name, *item);
- if (ret) {
- goto end;
- }
- }
-
-end:
- return ret;
-}
-
static
int create_exclusion_list_and_validate(const char *event_name,
const char *exclusions_arg,
for (exclusion = exclusions; *exclusion; exclusion++) {
if (!strutils_is_star_glob_pattern(*exclusion) ||
strutils_is_star_at_the_end_only_glob_pattern(*exclusion)) {
- ret = check_exclusions_subsets(
- event_name, exclusion);
+ ret = check_exclusion_subsets(event_name, *exclusion);
if (ret) {
goto error;
}