Fix: Exclusion check iterates multiple times on same array
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Fri, 5 May 2017 17:45:36 +0000 (13:45 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Sat, 6 May 2017 19:52:49 +0000 (15:52 -0400)
commit8aa579d4f55ead9a3e14f5fde3be039eedc891ea
tree842655d463db764ed0c8ce290b1d50cb70cd0af1
parent190afa261ad4c77130b136c6f8b72227a9463543
Fix: Exclusion check iterates multiple times on same array

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>
src/bin/lttng/commands/enable_events.c
This page took 0.025731 seconds and 4 git commands to generate.