---------- Forwarded message ----------
From:
Aaron Spear <aspear@xxxxxxxxxx>
Date: Thu, Apr 18, 2013 at 6:39 PM
Subject: Re: [linuxtools-dev] TMF/LTTng: best way to control
LTTng from other Eclipse plugins ?
To: Linux Tools developer discussions <
linuxtools-dev@xxxxxxxxxxx>
Hi Bernd!
Thanks much for the helpful feedback. I almost
have this approach working. At the moment I cloned a
fair bit of the logic in TargetNodeComponent.java to
manage the trace lifetime. I basically wrote code that
created a trace project on demand, put the UST traces
(the raw traces) into that project, and then when the
launch terminates it imports the created traces. I will
post again once I have it all working, but it does seem
viable.
Like you said, it is a bit of a bummer to have me
copy and pasting logic though. I may look into what
driving the view might buy me as well. There were other
places I needed to copy and paste code as well, e.g. the
logic necessary to create a new trace project that is
private in the import wizard right now. It might be
nice to pull that into some sort of factory that can be
used in various places.
regards,
Aaron
First of all, I think it's a good idea
to re-use the code that was done for
the ControlView. It gives you the API
to issue LTTng commands remotely as
well as provides the parsing of the
command result. I think it's
thoroughly tested using JUnit tests
(see plug-in
org.eclipse.linuxtools.lttng.ui.tests),
so that it should be pretty stable.
However, even if the API is exported
by the plug-in the API is marked as
internal. We marked it internal
because the LTTng-Tools (remote site)
changes quickly and we want to have
the freedom to change the API to adapt
to these changes. This allows us to
release newer versions of the Control
feature outside the simultaneous
release of Eclipse.
To your other question, if it possible
to use the control feature (and in
particular LTTngControlServiceFactory
and the LTTngControlService classes)
outside the
org.eclipse.linuxtools.lttng.ui and
org.eclipse.linuxtools.lttng plug-ins.
Yes, it is possible. You just get
warnings in Eclipse because you use
internal API's. I actually did that in
the test plug-in where the control
feature is tested (see plug-in
org.eclipse.linuxtools.lttng.ui.tests).
Looking at your example script, it should
work. I've done similar things in the
JUnit-tests (see
org.eclipse.linuxtools.lttng2.ui.tests.control.service.LTTngControlServiceTest).
The ControlView will only show these new
session once you connect to the remote
node or press the refresh button in case
you are already connected.
You could also drive the ControlView
programatically. See JUnit-tests
org.eclipse.linuxtools.lttng2.ui.tests.control.model.component.TraceControlCreateSessionTests
how you could do that. The advantage is that
you would see the sessions right away in the
view.
BTW, a feature for the ControlView that I have
in mind but I haven't had time to implement is
to be able to store a set of commands and
re-run these set of commands. It's like having
a trace profile which can be re-run. What you
want to do seems to be in the same direction.
If you have any questions please don't hesitate
to contact me.
Best Regards
Bernd
_______________________________________________
linuxtools-dev mailing list
linuxtools-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/linuxtools-dev
_______________________________________________
linuxtools-dev mailing list
linuxtools-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/linuxtools-dev