Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 354541 - LTTng plugins requires to set LD_LIBRARY_PATH to point to the path of native parsing libraries
Summary: LTTng plugins requires to set LD_LIBRARY_PATH to point to the path of native ...
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: LinuxTools (show other bugs)
Version: unspecified   Edit
Hardware: All Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Francois Chouinard CLA
QA Contact: Francois Chouinard CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-11 15:22 EDT by Yufen Kuo CLA
Modified: 2022-01-13 14:53 EST (History)
0 users

See Also:


Attachments
Patch to add UI to allow user to specify parser library path in new LTTng project wizard and project property (61.68 KB, patch)
2011-08-11 15:30 EDT, Yufen Kuo CLA
fchouinard: iplog+
Details | Diff
patch to fix compilation issues in org.eclipse.linuxtools.lttng.tests plugin (10.79 KB, patch)
2011-08-11 18:05 EDT, Yufen Kuo CLA
fchouinard: iplog+
Details | Diff
patch to enable Project->Properties main menu when LTTng project is selected in Lttng Projects View (2.88 KB, patch)
2011-08-12 18:48 EDT, Yufen Kuo CLA
fchouinard: iplog+
Details | Diff
patch for runpath setting note on loader parser library (5.89 KB, patch)
2011-08-25 19:25 EDT, Yufen Kuo CLA
fchouinard: iplog+
Details | Diff
screenshot of the added runpath setting (21.78 KB, image/png)
2011-08-25 19:27 EDT, Yufen Kuo CLA
no flags Details
Proposed wording for the new wizard page (53.22 KB, image/png)
2011-08-26 14:28 EDT, Francois Chouinard CLA
no flags Details
Wizard description + note (45.98 KB, image/png)
2011-08-26 19:10 EDT, Francois Chouinard CLA
no flags Details
Property description + note (67.08 KB, image/png)
2011-08-26 19:10 EDT, Francois Chouinard CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yufen Kuo CLA 2011-08-11 15:22:23 EDT
Currently, LTTng plugins for eclipse uses native LTTng parsing libraries to parse trace files and displayed them in the viewer.

Once the parsing libraries are installed, it requires user to set LD_LIBRARY_PATH before running eclipse so it can be picked up by JVM when LTTng plugins tries to load the parsing libraries.

This is not very flexible for users, it requires to restart eclipse workbench everytime LD_LIBRARY_PATH is changed.
Comment 1 Yufen Kuo CLA 2011-08-11 15:30:36 EDT
Created attachment 201344 [details]
Patch to add UI to allow user to specify parser library path in new LTTng project wizard and project property

This contribution allows user to specify parser library directory in new LTTng project wizard and also in Project Properties Dialog.

When parser library directory is specified, it will try to find the parser library from that directory and load it in JVM when trace files needs to be parsed.

Since liblttvtraceread_loader.so library has a dependency on liblttvtraceread.so The RUNPATH setting needs to be set so when loading library into JVM, it knows where to find the dependent library. 
It can be done using the patchelf utility or set RUNPATH during link time in makefile.

patchelf utility can be downloaded from http://nixos.org/patchelf.html

$patchelf --set-rpath '.:$ORIGIN' liblttvtraceread_loader-2.5.so
This will make sure when loading this library would make the ld.so loader look for dependencies first in the current directory of the process, and then in the directory where the originating library is located.

Parser Library directory is optional, if it is not set by user, it will still defaults to LD_LIBRARY_PATH as search path for parser libraries.
Comment 2 Yufen Kuo CLA 2011-08-11 18:05:06 EDT
Created attachment 201363 [details]
patch to fix compilation issues in org.eclipse.linuxtools.lttng.tests plugin
Comment 3 Francois Chouinard CLA 2011-08-12 08:57:06 EDT
Hi Yufen.

Thanks for your contribution! The unit test update is *really* appreciated.

I'm still on vacation for a week or so but I will process your bug as soon as I get back.

FWIW, this bug is probably related to these other 2:

- https://bugs.eclipse.org/bugs/show_bug.cgi?id=315604
- https://bugs.eclipse.org/bugs/show_bug.cgi?id=340341

Regards,
/fc
Comment 4 Yufen Kuo CLA 2011-08-12 15:40:18 EDT
(In reply to comment #3)
> Hi Yufen.
> 
> Thanks for your contribution! The unit test update is *really* appreciated.
> 
> I'm still on vacation for a week or so but I will process your bug as soon as I
> get back.
> 
> FWIW, this bug is probably related to these other 2:
> 
> - https://bugs.eclipse.org/bugs/show_bug.cgi?id=315604
> - https://bugs.eclipse.org/bugs/show_bug.cgi?id=340341
> 
> Regards,
> /fc

Thanks Francois for your quick reply,
Not to give you any pressure during your vacation :) Do you know if there is any chance that the contribution can go in for the 0.8.1 release? 

I also submitted the bug for bug 340341.
will look into 315604 later.

Legal Message: I, Yufen, declare that I developed attached code from scratch, without referencing any 3rd party materials except material licensed under the EPL. {I am authorized by my employer to make this contribution under the EPL.}
Comment 5 Yufen Kuo CLA 2011-08-12 18:48:10 EDT
Created attachment 201448 [details]
patch to enable Project->Properties main menu when LTTng project is selected in Lttng Projects View

Implements IAdaptable for LTTngProjectNode, return IProject when is asking for adapter for IResource. This also brings in other context menus like "Team", "Compare With", "Restore from Local History" when LTTng project node is selected.
Comment 6 Francois Chouinard CLA 2011-08-25 17:55:23 EDT
Hi Yufen,

I finally had a chance to look at your patches and they look quite good!

The only thing I would like you to add is some kind of note in the TraceLibraryPathWizardPage to remind the user that liblttvtraceread_loader.so has to be "patchelf'ed" or "RPATHed" for this feature to work. I will take care of the User Guide and wiki.

One final thing: This patch is >250 lines and we theoretically have to go over the Eclipse IP process before committing it... unless you guys (MonteVista) have signed a Member Committer Agreement in which case we can avoid a really annoying legal procedure :-) Could you let me know ASAP. Thanks!
Comment 7 Yufen Kuo CLA 2011-08-25 19:24:40 EDT
(In reply to comment #6)
> Hi Yufen,
> 
> I finally had a chance to look at your patches and they look quite good!
> 
> The only thing I would like you to add is some kind of note in the
> TraceLibraryPathWizardPage to remind the user that liblttvtraceread_loader.so
> has to be "patchelf'ed" or "RPATHed" for this feature to work. I will take care
> of the User Guide and wiki.
> 
> One final thing: This patch is >250 lines and we theoretically have to go over
> the Eclipse IP process before committing it... unless you guys (MonteVista)
> have signed a Member Committer Agreement in which case we can avoid a really
> annoying legal procedure :-) Could you let me know ASAP. Thanks!

MontaVista do have valid Member Committer Agreement and my name is one of the possible contributors.
Comment 8 Yufen Kuo CLA 2011-08-25 19:25:52 EDT
Created attachment 202190 [details]
patch for runpath setting note on loader parser library

This patch contains the added note in the wizard and property page where parser library path was specified.
Comment 9 Yufen Kuo CLA 2011-08-25 19:27:02 EDT
Created attachment 202191 [details]
screenshot of the added runpath setting

feel free to change the wording in messages.properties file.
Comment 10 Francois Chouinard CLA 2011-08-25 20:14:27 EDT
Now that was fast :-)

Thanks!
Comment 11 Yufen Kuo CLA 2011-08-25 22:39:03 EDT
(In reply to comment #6)
> Hi Yufen,
> 
> The only thing I would like you to add is some kind of note in the
> TraceLibraryPathWizardPage to remind the user that liblttvtraceread_loader.so
> has to be "patchelf'ed" or "RPATHed" for this feature to work. I will take care
> of the User Guide and wiki.

forgot to thank you for taking care of user guide and wiki changes. I found the documentation for LTTng plugins pretty decent. thanks for the good work!
Comment 12 Francois Chouinard CLA 2011-08-26 07:43:55 EDT
(In reply to comment #11)
> I found the
> documentation for LTTng plugins pretty decent. thanks for the good work!

I find there's quite a lot of room for improvement in our docs but thanks!
Comment 13 Francois Chouinard CLA 2011-08-26 14:28:20 EDT
Created attachment 202247 [details]
Proposed wording for the new wizard page

Hi,

I think this message is a bit more descriptive of why you would want to set this field and what you have to be aware of if you do.

I realize that it is a bit wordy and that it feels like a full blown UG but, hey, we have the room :-)

What do you think?
Comment 14 Yufen Kuo CLA 2011-08-26 17:02:13 EDT
(In reply to comment #13)
> Created attachment 202247 [details]
> Proposed wording for the new wizard page
> 
> Hi,
> 
> I think this message is a bit more descriptive of why you would want to set
> this field and what you have to be aware of if you do.
> 
> I realize that it is a bit wordy and that it feels like a full blown UG but,
> hey, we have the room :-)
> 
> What do you think?

I think it is a bit wordy, maybe tried to condense the second and third note paragraph as dialog description. (by the way, there was a typo in the screenshot, liberty should be library)

I sent the screenshot to our documentation person and she suggested:

1. change the description of the wizard page to:
Set this field if you want to dynamically change the parsing libraries your LTTng projects use or if you do not want to set LD_LIBRARY_PATH. The field is project specific and can be modified at any time from the LTTng project Properties page.

2. change the description of the project properties page to:
Set this field if you want to dynamically change the parsing libraries your LTTng projects use or if you do not want to set LD_LIBRARY_PATH. 

3.Then in the note part: 
Note: If you set this field, the parser library 'liblttvtraceread_loader.so' must be accessible from the path provided. 
In addition, the library 'liblttvtraceread_loader.so' must have 'RUNPATH' set with ${ORIGIN} so it can find the dependent libraries. 'RUNPATH' can be set in the makefile or by using the patchelf utility.
Comment 15 Francois Chouinard CLA 2011-08-26 18:00:52 EDT
Hummm.

The wording is way too long for the description of the wizard page. There's only 2 lines of description available in those headers...
Comment 16 Yufen Kuo CLA 2011-08-26 18:09:02 EDT
(In reply to comment #15)
> Hummm.
> 
> The wording is way too long for the description of the wizard page. There's
> only 2 lines of description available in those headers...

ok. what about keep the description the way it is, and use the text in Note (replace it with second and third note paragraph in https://bugs.eclipse.org/bugs/attachment.cgi?id=202247)?
Comment 17 Francois Chouinard CLA 2011-08-26 19:10:09 EDT
Created attachment 202258 [details]
Wizard description + note
Comment 18 Francois Chouinard CLA 2011-08-26 19:10:40 EDT
Created attachment 202259 [details]
Property description + note
Comment 19 Francois Chouinard CLA 2011-08-26 19:12:40 EDT
Here's what I propose (https://bugs.eclipse.org/bugs/attachment.cgi?id=202258 and https://bugs.eclipse.org/bugs/attachment.cgi?id=202259)

We have the wording from your doc person and it "fits" the dialogs.

OK with you?
Comment 20 Yufen Kuo CLA 2011-08-26 19:25:40 EDT
(In reply to comment #19)
> Here's what I propose (https://bugs.eclipse.org/bugs/attachment.cgi?id=202258
> and https://bugs.eclipse.org/bugs/attachment.cgi?id=202259)
> 
> We have the wording from your doc person and it "fits" the dialogs.
> 
> OK with you?

looks good! thanks
Comment 21 Francois Chouinard CLA 2011-08-26 19:40:34 EDT
Comment on attachment 201344 [details]
Patch to add UI to allow user to specify parser library path in new LTTng project wizard and project property

Patch committed on stable-0.8 branch
Comment 22 Francois Chouinard CLA 2011-08-26 19:41:16 EDT
Comment on attachment 201363 [details]
patch to fix compilation issues in org.eclipse.linuxtools.lttng.tests plugin

Patch committed on stable-0.8 branch
Comment 23 Francois Chouinard CLA 2011-08-26 19:41:44 EDT
Comment on attachment 201448 [details]
patch to enable Project->Properties main menu when LTTng project is selected in Lttng Projects View

Patch committed on stable-0.8 branch (with minor modifications)
Comment 24 Francois Chouinard CLA 2011-08-26 19:42:09 EDT
Comment on attachment 202190 [details]
patch for runpath setting note on loader parser library

Patch committed on stable-0.8 branch (with minor modifications)
Comment 25 Francois Chouinard CLA 2011-08-26 19:43:35 EDT
Still need to commit changes on HEAD.
Comment 26 Francois Chouinard CLA 2011-08-28 20:33:52 EDT
Committed to HEAD
Comment 27 Francois Chouinard CLA 2011-09-28 17:39:45 EDT
Delivered with 0.8.1