Bernd Hufmann [Fri, 27 Nov 2015 18:41:48 +0000 (13:41 -0500)]
control: partly revert commit 0e7ea8ac and use clone in handlers
The patch that will be reverted here used copy constructors instead
of clone. However, using copy constructors the class type gets lost
in certain cases and this will cause different errors to happen.
For example, add context on a UST channel will send the command with
-k instead of -u. This is because a instanceof check for
ChannelCommandParameter fails since the object to check is a
CommandParameter instance and not ChannelCommandParameter.
I'll add a subsequent patch with a unit test for the add context case.
Change-Id: I01177bc1fad7eb100b204997b4572bf14cb5be61 Signed-off-by: Bernd Hufmann <Bernd.Hufmann@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/61491 Reviewed-by: Hudson CI Reviewed-by: Patrick Tasse <patrick.tasse@gmail.com> Tested-by: Patrick Tasse <patrick.tasse@gmail.com>
New errors have cropped up with the latest integration build. It seems
JDT is now stricter with regards to annotated generic types vs.
un-annotated ones (where before un-annotated was similar to @Nullable,
now we don't we away with it that easily).
Variants of checkNotNull() method that used to help the compiler now
seem to do more harm than good. Just deferring to the basic "T" one
fixes the new errors. Perhaps this should have been the ideal approach
all along?
SashForm.setWeights() fails and throws runtime exceptions if
the sum of the passed values is 0 or if one of the values is
negative.
In some cases that include switching to a not-yet-initialized
Resource View, this situation could happen. Simply ignore sash
resize for invalid arguments. No need to time-sync an uninitialized
view anyway.
For Collections we can easily go through a Stream and back
to call checkNotNullContents(Stream<T>), for arrays it's slightly
more complicated, so we might as well define a new method
specifically for arrays.
Also add some "tests" (not actual runnable tests, but just snippets
of code that should compile) to make sure the annotations are working
correctly.
Jonathan Rajotte [Thu, 26 Nov 2015 22:50:01 +0000 (17:50 -0500)]
tmf: log error before displaying message
Otherwise the error is logged only after the dialog is closed.
This is not a problem for normal use but for automated tests it can be
tricky since we can stop the test before closing the dialog and still look for
errors.
Change-Id: I1579fa166af2fbe5cd55fdb82b92d976171deaf6 Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Reviewed-on: https://git.eclipse.org/r/61066 Reviewed-by: Hudson CI Reviewed-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com> Tested-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
Patrick Tasse [Tue, 24 Nov 2015 23:27:50 +0000 (18:27 -0500)]
tmf: Bug 477508: Fix wrong event count and ranks in TmfXmlTraceStub
The stub implementation of getNext() was increasing the context rank
twice per event. This would cause a wrong event count in the trace.
The processing of the 'set_aspects' dummy event was also causing the
context rank to be incremented twice. The XML Schema Definition is
changed to extract 'set_aspects' into its own element. The trace stub
now first parses the trace with a custom XML trace definition that only
processes the single 'set_aspects' event, then reinitializes the trace
with a custom XML trace definition that processes 'event' events.
Change-Id: Id1cf2251e364f892ab37511f0a5d99f2bcc2b5c6 Signed-off-by: Patrick Tasse <patrick.tasse@gmail.com>
Reviewed-on: https://git.eclipse.org/r/61205 Reviewed-by: Hudson CI
Patrick Tasse [Tue, 24 Nov 2015 23:13:14 +0000 (18:13 -0500)]
tmf: Fix unprocessed custom event content
If the custom event content is read before the event timestamp, it could
be undefined as the event data hasn't be processed yet. This can happen
in test code.
Change-Id: Idab415eb8015f1a7035bee11582d0baad89cad5b Signed-off-by: Patrick Tasse <patrick.tasse@gmail.com>
Reviewed-on: https://git.eclipse.org/r/61204 Reviewed-by: Hudson CI Reviewed-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com> Tested-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
tmf: Try to make the shell fully visible in SWTBot at start
In certain environments, the workbench shell can be positioned at random
locations. Depending on the size of the display, it is possible that the
shell is not fully visible. This patch adds logic to the start of SWTBot
tests so that if the top shell is not fully visible, it will try to move
it in within the display bounds. If the shell cannot fit the display, it
will be positioned at the top-left corner of the display.
To be able to apply this to all test, a new utility method was
introduced, SWTBotUtils.initialize. More common code that is applicable
to all SWTBot tests could be moved there in the future.
This fix is important to some tests that can depend on whether of not
some controls get painted. For example, a drag listener is only added on
a sash when it gets first painted. If it is never painted,
TmfAlignTimeAxisTest fails when trying to drag this sash to verify the
proper behavior of time alignment.
Change-Id: Ic67739e204fcb0a4b567914e8b6078c286d56bd3 Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/61094 Reviewed-by: Hudson CI Reviewed-by: Patrick Tasse <patrick.tasse@gmail.com> Tested-by: Patrick Tasse <patrick.tasse@gmail.com>
Exclude Sonar rules that are not working with jdt.annotation
Since we have moved to jdt.annotation 2.0, a few Sonar rules (FindBugs)
do not work properly and report false positives. This resulted in
around 460 false issues in Sonar. We can disable those rules for now
until the problem is resolved. A bug report was filled at the FindBugs
project:
http://sourceforge.net/p/findbugs/bugs/1425/
The exclusions are done in the pom.xml so that any Sonar server can
benefit from this fix.
lttng: additional definitions for lttng 2.7 and 2.8
* New event sched_waking (for upcomming lttng 2.8 and linux > 4.3)
* Modified event names in lttng 2.7 for softirqs
(softirq_entry renamed to irq_softirq_entry)
Change-Id: I0c5acd0e201e41ad7f2cf6749cc2105d41523f3f Signed-off-by: Francis Giraldeau <francis.giraldeau@gmail.com>
Reviewed-on: https://git.eclipse.org/r/59230 Reviewed-by: Hudson CI Reviewed-by: Alexandre Montplaisir <alexmonthy@efficios.com>
Matthew Khouzam [Fri, 16 Oct 2015 01:34:38 +0000 (21:34 -0400)]
analysis: Clean up AlgorithmManager a bit
Change-Id: I092a78d5899bd742acdd002290f67fab06c3126d Signed-off-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/58290 Reviewed-by: Hudson CI Reviewed-by: Francis Giraldeau <francis.giraldeau@gmail.com>
Matthew Khouzam [Mon, 23 Nov 2015 23:40:40 +0000 (18:40 -0500)]
ctf: support event-header-less traces
This fixes a regression caused by overly zealous @NonNull annotations
coupled with many warnings hiding a problem. The trace reader can now
read traces without an event header again.
Change-Id: Ida701b45cd0438cfd2000443a7a725e31d96669b Signed-off-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/61090 Reviewed-by: Hudson CI Reviewed-by: Patrick Tasse <patrick.tasse@gmail.com> Tested-by: Patrick Tasse <patrick.tasse@gmail.com>
Matthew Khouzam [Mon, 23 Nov 2015 23:39:05 +0000 (18:39 -0500)]
ctf: Support Streamless packet readers
If a stream isn't set, the default one is null. This ensures that streamless
traces work.
Change-Id: Iad06dd965e3ca1173008cec5b8e68ac3bc910cbe Signed-off-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/61089 Reviewed-by: Hudson CI Reviewed-by: Patrick Tasse <patrick.tasse@gmail.com> Tested-by: Patrick Tasse <patrick.tasse@gmail.com>
Both variants return @NonNull array references. The one with the
(T[]) parameter can also e annotated to require a @NonNull array
reference (or else it would just throw an NPE).
Note this covers only the array references themselves. The
contained element types will depend on what is passed in parameter
Running tests that use the keyboard (AWT) on headless Mac fails with
java.awt.AWTException: headless environment
Setting java.awt.headless=false fixes this.
But actually, the returned Set should not contain any null elements,
since then entry objects will always exist, even if the key and/or
value is null. So we could augment the annotation to:
@NonNull Set<@NonNull Map.Entry<K, V>>
K and V in this case need to remain unannotated, their type should
match the Map's declaration.
IFileInfo.getSize() returns 0 for directories on Windows. "For
directories, the return value is unspecified" so the right thing to do
is to add an isDirectory check.
Change-Id: I6112287adc6cef8fcd7c609edab5bbdfbd933ba3 Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/60756 Reviewed-by: Hudson CI Reviewed-by: Patrick Tasse <patrick.tasse@gmail.com>
Matthew Khouzam [Thu, 27 Aug 2015 02:32:24 +0000 (22:32 -0400)]
ctf: Introduce IPacketReader
Introduce the IPacketReader api to allow better decoupling between the
streaminputreader and the packet reader. This allows for more packet
reader types in the future, such as an InMemoryPacketReader for streamed
in RAM traces.
The IPacketReader is currently implemented by 2 classes:
* a NullPacketReader, if there is no data to read
* a CTFPacketReader, the typical packet reader
The CTFPacketReader is quite different from the CTFStreamPacketReader. The
SPR holds on to a FileChannel and maps segments as it needs. This results in
a fast but complex sliding window like reader. On the other hand, the
CTFPacketReader will only read one packet of a stream, a new one needs to
be created for each packet. This makes it wrap a single BitBuffer. As
FileChannels are resources but Bit(Byte)Buffers are not, this means a
CTFPacketReader is NOT autoclosable.
It should be noted that ByteBuffers can hold onto a system file handle. They
are released on GC. Also, ByteBuffers as they have their handle, will not
require the fileChannel to be opened all the time, so resources can be
dynamically closed when running low on file handles.
This patch also fixes some bugs in the tests relating to uninitialized traces
and lost event locations that were hidden due to "event.equals" not working as
well as it should.
The reason this patch does two things at the same time is that the interface
required a major re-write of the packet reader. This resulted in several bugs
being highlighted and fixed. To fix them in a separate patch before would
be very time consuming, and fixing them after would mean deliberately writing
a buggy packet reader to fix it in a subsequent patch.
This change will allow the following changes down the road:
* In memory ctf reading (network streams)
* Encrypted ctf stream reading
* Compressed ctf stream reading
* Multi-threaded stream reading
* A power set of the previous elements
Change-Id: Id45b69bb0dac7a1f74f50cd732cd92064595f737 Signed-off-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/53284 Reviewed-by: Hudson CI
Patrick Tasse [Fri, 20 Nov 2015 16:06:52 +0000 (11:06 -0500)]
tmf: Add check for ineffective setters in AbstractTimeGraphView
If these setters are called after the part control has been created,
they have no effect.
Change-Id: I34bab27624a98df122efd08546d1740d5d672fd8 Signed-off-by: Patrick Tasse <patrick.tasse@gmail.com>
Reviewed-on: https://git.eclipse.org/r/60940 Reviewed-by: Hudson CI Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com> Tested-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Patrick Tasse [Tue, 17 Nov 2015 22:35:36 +0000 (17:35 -0500)]
tmf: Make call stack view extend AbstractTimeGraphView
Change-Id: I43c472c0512486e806bc1aa1db034d6268face5e Signed-off-by: Patrick Tasse <patrick.tasse@gmail.com>
Reviewed-on: https://git.eclipse.org/r/60667 Reviewed-by: Hudson CI Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com> Tested-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
However the returned List is not null-annotated, which means it gives a
warning if we want to save it to a @NonNull List<> reference.
It could be tempting to annotate Stream.collect() directly, however that
would be wrong: there is no guarantee that some shoddy Collector does
not return a null value.
Instead, annotate Collectors.toList(), toSet() and toCollection(), which
should cover for most common use cases.
Patrick Tasse [Wed, 18 Nov 2015 16:18:26 +0000 (11:18 -0500)]
tmf: Call synchingToTime in AbstractTimeGraphView when switching traces
When switching traces (or opening a trace for the first time) the method
synchingToTime should be called with the selection begin time, to
perform view-specific handling for the new selected time.
Change-Id: Ia1eaa248b7e6d9616bfc20375276dcc83527fb28 Signed-off-by: Patrick Tasse <patrick.tasse@gmail.com>
Reviewed-on: https://git.eclipse.org/r/60736 Reviewed-by: Hudson CI
Matthew Khouzam [Tue, 5 May 2015 11:18:09 +0000 (07:18 -0400)]
analysis: Split up KernelStateProvider
Right now, the cpu number and threadid is looked up for each
event, this new architecture will only read the information
as need be. This should accelerate trace reading by about 5%,
also it is more intuitive, as each event has one file
describing what it does.
Change-Id: I0a2c4480b1532536727783e5470acb545f0a705b Signed-off-by: Matthew Khouzam <matthew.khouzam@ericsson.com> Signed-off-by: Francis Giraldeau <francis.giraldeau@gmail.com> Signed-off-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
Reviewed-on: https://git.eclipse.org/r/47150 Reviewed-by: Hudson CI
When we migrated to using the tracecompass-test-traces, we also stopped
downloading the ctf-testsuite using git. However those are not part of
tracecompass-test-traces. Oops!
Somehow the tests didn't complain so far, but it'd be better if they
actually ran.
Patrick Tasse [Wed, 11 Nov 2015 14:49:12 +0000 (09:49 -0500)]
ctf: Fix CtfTmfLostEvent time range does not use timestamp transform
When a timestamp transform or trace offset was set on the trace, the
lost event time range end time was not transformed, but the timestamp
and time range start time were.
Change-Id: Ie2e79b5e90e900bdaf2e7e8391868132bd632332 Signed-off-by: Patrick Tasse <patrick.tasse@gmail.com>
Reviewed-on: https://git.eclipse.org/r/60136 Reviewed-by: Hudson CI Reviewed-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com> Tested-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
lttng: Rename orphaned relayd test to TestApplication
This file is a test application that is not intented to be tested as a Junit
test but it is written as such for convenience. We use this while developping
the Live feature.
Patrick Tasse [Thu, 5 Nov 2015 17:50:26 +0000 (12:50 -0500)]
tmf: Add Lost Events marker event source and factory
A marker event source factory for Lost Events is enabled for all traces.
The marker event source can reuse a previously returned marker list if
the requested parameters are identical to the previous request.
The event types statistics state system is updated to add a new
attribute which is used to compute the time ranges that are covered by
at least one lost event time range.
Change-Id: I2479afc3f07deb363f5847f4816940010bae3e9e Signed-off-by: Patrick Tasse <patrick.tasse@gmail.com>
Reviewed-on: https://git.eclipse.org/r/59389 Reviewed-by: Hudson CI Reviewed-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com> Tested-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
Patrick Tasse [Fri, 30 Oct 2015 20:15:04 +0000 (16:15 -0400)]
tmf: Add TmfTraceAdapterFactory
Base class for a trace adapter factory. The factory creates a single
instance of each adapter type per trace, and disposes the adapter when
the trace is closed, if it is an instance of IDisposableAdapter.
Change-Id: Ieec69d17d0cff037f2df0c8dded14eef91db6f97 Signed-off-by: Patrick Tasse <patrick.tasse@gmail.com>
Reviewed-on: https://git.eclipse.org/r/59388 Reviewed-by: Hudson CI Reviewed-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com> Tested-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
Patrick Tasse [Thu, 5 Nov 2015 15:43:41 +0000 (10:43 -0500)]
tmf: Support adjustment of time graph window range on range selection
When the selection range is modified and 'ensureVisible' is true, then
the window range will be centered on either the selection begin time (if
it has changed) otherwise on the selection end time, if that time is
outside of the current window.
This adjustment is now enabled in time graph views when the
TmfSelectionRangeUpdatedSignal is received.
Change-Id: I8b5ec885b00009be05222db02acd745218759131 Signed-off-by: Patrick Tasse <patrick.tasse@gmail.com>
Reviewed-on: https://git.eclipse.org/r/59758 Reviewed-by: Hudson CI Reviewed-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com> Tested-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>