Fix: track-untrack.c: regression of `--all --pid` option ordering
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Tue, 7 Jan 2020 20:34:07 +0000 (15:34 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 14 Jan 2020 23:58:52 +0000 (18:58 -0500)
commitadce7589954ef2c8236be5145e664b4383474d43
tree77bb6b36a569e80ddb8d3dd105a47c9ad535c4ef
parentc47a705beb4d03d1a7498802047f6410814dced3
Fix: track-untrack.c: regression of `--all --pid` option ordering

Background
==========
The `tests/regression/kernel/test_callstack` test uses the PID tracker
to restrict what events end up in the trace. It does that by using the
following lttng command:
  lttng untrack -s $SESSION_NAME --all --pid -k

Issue
=====
A regression was introduced along with the UID tracker patch series that
makes the above command fail silently and return status 1. The bug is in
the argument parsing function that assumes that the tracker option
(`--pid` in this case) would appear before the `--all` option.

Where the above command fails, the one below works as expected:
  lttng untrack -s $SESSION_NAME --pid --all -k

Both ordering are valid and should be accepted.

Fix
===
When parsing the arguments, first record the fact that we encountered the
`--all` flag, and later check to what tracker it applies too.

Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Change-Id: I85f7a2fa8d6f67056aeff8edf3d12508f5ae0879
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng/commands/track-untrack.c
tests/regression/tools/tracker/test_event_tracker
This page took 0.028905 seconds and 5 git commands to generate.