xml: Remove duplication caused by d2e628

Remove a repeated switch case and create a helper to do this task.

Change-Id: I5ec17a09fd337107cd0e745e3e7d90bb8bba8300
Signed-off-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Signed-off-by: Geneviève Bastien <gbastien+lttng@versatic.net>
Reviewed-on: https://git.eclipse.org/r/36936
Tested-by: Hudson CI
ctf: Correctly handle packet sizes > 2^31 bits

We use long's for packet sizes, so we should be able to handle
those, just need to make sure the value does not get truncated
to Integer.MAX_VALUE (or even worse, becomes negative!)

Change-Id: If3d6d39f765d8baf43297efaed1681473e1ffeaf
Signed-off-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
Reviewed-on: https://git.eclipse.org/r/37129
Tested-by: Hudson CI
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Tested-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
TMF: Add an experiment utility class to get data from experiment's traces

Change-Id: Ifbc9e4a773bca227150f136bfcbe2a1410a91de5
Signed-off-by: Geneviève Bastien <gbastien+lttng@versatic.net>
Reviewed-on: https://git.eclipse.org/r/36822
Tested-by: Hudson CI
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
LTTng: use tracer_name for perf-CTF traces

Domain will be set to kernel for both, perf and lttng traces. The
tracer_name will be set to perf if the trace is generated by perf and
otherwise lttng-modules if created by thet lttng tool.

Change-Id: I76e0c44efebe8be4e9f3a571884d63b932ac33d3
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/37212
Tested-by: Hudson CI
Reviewed-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
ctf: make Declarations have some NonNull annotations

Change-Id: I2732bad6d7e390223c61fa08af98b3ae649baa79
Signed-off-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/36573
Tested-by: Hudson CI
Reviewed-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
tmf: Remove the ITmfEventTableColumns extension point

Add a getEventAspects() method in ITmfTrace, which allows trace types
to define which aspects can be relevant for their own events.

This becomes redundant with the ITmfEventTableColumn extension point:
now that we build columns directly from aspects, the TmfEventsEditor
can simply call trace.getEventAspects() instead of reading extension
point data. The trace type is already defined in a core extension point,
so we'll pass the event aspect information through that now.

The combination of careful equals() methods in aspects and the use
of a Set in the TmfEventsEditor will allow "merging" aspects/columns
together, like was already the case.

Change-Id: Ic5b6126a50b1b1fdb4b2d5d23eb6a47a57555594
Signed-off-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
Reviewed-on: https://git.eclipse.org/r/36364
Tested-by: Hudson CI
tmf.ctf: Rework the event aspects of CTF traces

- Move the "channel" aspect from LttngKernel to CtfTmfTrace
  (it can apply to any CTF trace).
- Add a CPU aspect for CTF traces.

CTF events know the CPU they were taken on (previously saved in
event.getSource()). Now we can define an aspect to display it
in its own column in the event table.

Change-Id: I603cfd4cc4ca61964ec59ea17293900e7aa1f42a
Signed-off-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
Reviewed-on: https://git.eclipse.org/r/36365
Tested-by: Hudson CI
tmf: Add a TmfTraceUtils class for advanced getter methods

For instance, the various getModuleFromClass() methods should not
be part of the base interface, the trace should only expose a basic
getter. The more fancy functions can however be implemented in a
separate utility class.

Change-Id: I8d957971abfbcc7e3afe81f5db2dba43cbebe84d
Signed-off-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
tmf.analysis: Restore the "getCPU" for data-driven analyses

XML data-driven analyses used to use ITmfEvent.getSource() to get
the event's CPU. This was misleading, because trace types were free
to define "source" as something other than CPUs.

Now instead use a CpuAspect to get the CPU of an event. This
should restore support for getting the CPU of CTF traces, as it
did before.

Also added a new method to TmfTraceUtils to get the aspects matching
a specific class. The analysis modules will make use of this to get
the "cpu" aspects.

Change-Id: I88437b4a419e81aef36f2aa5298ff54f87242b23
Signed-off-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
tmf: Make ITmfTrace.getEventAspects() @NonNull

It's easier to deal with empty collections than dealing with
null/non-null references (for Collection.addAll() and such).

Change-Id: I9e8d0091e099027b5da0c15881b73130b4ef2e9d
Signed-off-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
tmf: Add a "Trace" Event Table column for experiments

Also reworked some internal methods in TmfEventsEditor to not return
a table object directly, but rather just a set of event aspects.
This way we can add this "Trace" column only for experiments.

Change-Id: I21536cd11da28f30b1f822a495cd06a4d922064c
Signed-off-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
tmf: Split off TmfFilterMatchesNode in two

Add new TmfFitlerMatchesFieldNode and TmfFilterMatchesAspectNode, which
both extend TmfFilterMatchesNode (which is now abstract). This will allow
using filtering on aspects.

The aspect node is not integrated yet in the Filter View, but it could be
eventually.

Change-Id: I7206c0508eed4fbb16cc22fef97900ca31220328
Signed-off-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
tmf: Use TmfFilterMatchesAspectNode's in the event table

This will allow filtering/searching on aspects in the event table,
which is more flexible than fields with field IDs.

With this switch, we can now remove the notion of getFilterId() from
the event aspects.

Change-Id: Iecbc47de06c44ef2d114dc3225cd094c111f1f08
Signed-off-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>