Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 317863 - [zOS] Remove dependency on JAVA_PROFILER_HOME
Summary: [zOS] Remove dependency on JAVA_PROFILER_HOME
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: TPTP (show other bugs)
Version: unspecified   Edit
Hardware: PC other
: P2 normal (vote)
Target Milestone: ---   Edit
Assignee: Mike Reid CLA
QA Contact: Kathy Chan CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-24 13:47 EDT by Mike Reid CLA
Modified: 2016-05-05 10:58 EDT (History)
4 users (show)

See Also:


Attachments
First patch (15.01 KB, patch)
2010-06-28 10:35 EDT, Mike Reid CLA
no flags Details | Diff
Reworked patch (14.14 KB, patch)
2010-07-08 15:58 EDT, Mike Reid CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Reid CLA 2010-06-24 13:47:39 EDT
This bug is to port the work of bug 241984 to zOS. This will allow the zOS
platform to launch the Java profiler using the -agentpath switch; absolving the
need to configure environment variables.
Comment 1 Mike Reid CLA 2010-06-28 10:35:32 EDT
Created attachment 172912 [details]
First patch

Attaching a patch with the needed changes to support -agentpath: on zOS. It builds on the patch for bug 317444 (you will need to apply the 317444 patch before applying this patch).

Adds an implementation of GetDefaultLibPath for zOS which uses w_getpsent() to find the command line of the Java process and parse the location of libJPIBootLoader.so from that.

Issues:

1. We don't ship the IBM Toolkit for XML with the RAC so the user still must manually export the install path to the LIBPATH env var. This is already covered in the documentation so may not be a big deal. If we are sure of the install location we could enhance the patch to programmatically add this to the LIBPATH env var.

- The system call which provides command line information only returns up to 1023 characters; it is possible that for long invocations the location of libJPIBootLoader.so could be truncated causing this to fail. 

Comments welcome.
Comment 2 Mike Reid CLA 2010-07-08 15:58:34 EDT
Created attachment 173811 [details]
Reworked patch

Since w_getpsent() was discovered to only be supported on 31-bit as well as the fact it only returns the first 1024 characters of the command line, it is too unreliable to implement this feature.

No other suitable APIs have been found, instead we will look for a new option in the agent string which gives the path to the JPI libs, e.g.:

 -agentpath:.../libJPIBootLoader.so=JPIAgent:jpi_home=...,server=enabled,....

JPIBootLoader then parses out jpi_home, and uses it to setup the needed library path information before starting the rest of the initialization process.

A new patch which implements this approach is attached.
Comment 3 Mike Reid CLA 2010-07-12 12:04:50 EDT
Patch reviewed by Jonathan and patch checked into HEAD.
Comment 4 Mike Reid CLA 2010-07-23 17:10:39 EDT
Obsoleted patch in favour of all-inclusive patch: 
https://bugs.eclipse.org/bugs/attachment.cgi?id=175108

This is only provided for archival purposes, as it is easier to apply this to 4.7.0 rather than cherry-picking all the individual commits.
Comment 5 Kathy Chan CLA 2011-02-11 13:45:40 EST
This defect had been resolved as FIXED for more than 1 month.  Please verify with the latest TPTP 4.7.2 driver.  If this defect is still left unverified by February 25, we'll close it on the originator's behalf.

TPTP 4.7.2 driver can be downloaded from:

http://www.eclipse.org/tptp/home/downloads/?ver=4.7.2
Comment 6 Mike Reid CLA 2011-04-04 10:54:59 EDT
Closing.