Kaydet (Commit) 68e0f4d4 authored tarafından Tor Lillqvist's avatar Tor Lillqvist

Clean jvmfwk tracing output

Change-Id: I070fb24e9466d697a6014bd65635f6cda8736819
üst 247f197c
...@@ -602,8 +602,7 @@ javaPluginError jfw_plugin_startJavaVirtualMachine( ...@@ -602,8 +602,7 @@ javaPluginError jfw_plugin_startJavaVirtualMachine(
if ( ! isVendorSupported(pInfo->sVendor)) if ( ! isVendorSupported(pInfo->sVendor))
return JFW_PLUGIN_E_WRONG_VENDOR; return JFW_PLUGIN_E_WRONG_VENDOR;
OUString sRuntimeLib = getRuntimeLib(pInfo->arVendorData); OUString sRuntimeLib = getRuntimeLib(pInfo->arVendorData);
JFW_TRACE2("[Java framework] Using Java runtime library: " JFW_TRACE2("Using Java runtime library: " << sRuntimeLib);
+ sRuntimeLib + ".\n");
#ifndef ANDROID #ifndef ANDROID
// On linux we load jvm with RTLD_GLOBAL. This is necessary for debugging, because // On linux we load jvm with RTLD_GLOBAL. This is necessary for debugging, because
...@@ -624,9 +623,7 @@ javaPluginError jfw_plugin_startJavaVirtualMachine( ...@@ -624,9 +623,7 @@ javaPluginError jfw_plugin_startJavaVirtualMachine(
"[Java framework]sunjavaplugin" SAL_DLLEXTENSION "[Java framework]sunjavaplugin" SAL_DLLEXTENSION
" could not load Java runtime library: \n" " could not load Java runtime library: \n"
+ sRuntimeLib + "\n"); + sRuntimeLib + "\n");
JFW_TRACE0("[Java framework]sunjavaplugin" SAL_DLLEXTENSION JFW_TRACE0("Could not load Java runtime library: " << sRuntimeLib);
" could not load Java runtime library: \n"
+ sRuntimeLib + "\n");
return JFW_PLUGIN_E_VM_CREATION_FAILED; return JFW_PLUGIN_E_VM_CREATION_FAILED;
} }
...@@ -704,7 +701,7 @@ javaPluginError jfw_plugin_startJavaVirtualMachine( ...@@ -704,7 +701,7 @@ javaPluginError jfw_plugin_startJavaVirtualMachine(
} }
#endif #endif
#if OSL_DEBUG_LEVEL >= 2 #if OSL_DEBUG_LEVEL >= 2
JFW_TRACE2("VM option: " << options[n].optionString << "\n"); JFW_TRACE2("VM option: " << options[n].optionString);
#endif #endif
++n; ++n;
} }
...@@ -765,7 +762,7 @@ javaPluginError jfw_plugin_startJavaVirtualMachine( ...@@ -765,7 +762,7 @@ javaPluginError jfw_plugin_startJavaVirtualMachine(
else else
{ {
*ppVm = pJavaVM; *ppVm = pJavaVM;
JFW_TRACE2("[Java framework] sunjavaplugin" SAL_DLLEXTENSION " has created a VM.\n"); JFW_TRACE2("JVM created");
} }
#else #else
(void) arOptions; (void) arOptions;
...@@ -809,28 +806,25 @@ javaPluginError jfw_plugin_existJRE(const JavaInfo *pInfo, sal_Bool *exist) ...@@ -809,28 +806,25 @@ javaPluginError jfw_plugin_existJRE(const JavaInfo *pInfo, sal_Bool *exist)
if (ret == JFW_PLUGIN_E_NONE && *exist == sal_True) if (ret == JFW_PLUGIN_E_NONE && *exist == sal_True)
{ {
OUString sRuntimeLib = getRuntimeLib(pInfo->arVendorData); OUString sRuntimeLib = getRuntimeLib(pInfo->arVendorData);
JFW_TRACE2("[Java framework] Checking existence of Java runtime library.\n"); JFW_TRACE2("Checking existence of Java runtime library");
::osl::DirectoryItem itemRt; ::osl::DirectoryItem itemRt;
::osl::File::RC rc_itemRt = ::osl::DirectoryItem::get(sRuntimeLib, itemRt); ::osl::File::RC rc_itemRt = ::osl::DirectoryItem::get(sRuntimeLib, itemRt);
if (::osl::File::E_None == rc_itemRt) if (::osl::File::E_None == rc_itemRt)
{ {
*exist = sal_True; *exist = sal_True;
JFW_TRACE2("[Java framework] Java runtime library exist: " JFW_TRACE2("Java runtime library exist: " << sRuntimeLib);
+ sRuntimeLib + "\n");
} }
else if (::osl::File::E_NOENT == rc_itemRt) else if (::osl::File::E_NOENT == rc_itemRt)
{ {
*exist = sal_False; *exist = sal_False;
JFW_TRACE2("[Java framework] Java runtime library does not exist: " JFW_TRACE2("Java runtime library does not exist: " << sRuntimeLib);
+ sRuntimeLib + "\n");
} }
else else
{ {
ret = JFW_PLUGIN_E_ERROR; ret = JFW_PLUGIN_E_ERROR;
JFW_TRACE2("[Java framework] Error while looking for Java runtime library: " JFW_TRACE2("Error while looking for Java runtime library: " << sRuntimeLib);
+ sRuntimeLib + " \n");
} }
} }
return ret; return ret;
......
...@@ -403,7 +403,7 @@ SelfTest::SelfTest() ...@@ -403,7 +403,7 @@ SelfTest::SelfTest()
break; break;
} }
if (bRet) if (bRet)
JFW_TRACE2("[Java framework] sunjavaplugin: Testing class SunVersion succeeded.\n"); JFW_TRACE2("Testing class SunVersion succeeded.");
else else
OSL_ENSURE(bRet, "[Java framework] sunjavaplugin: SunVersion self test failed.\n"); OSL_ENSURE(bRet, "[Java framework] sunjavaplugin: SunVersion self test failed.\n");
} }
......
...@@ -165,8 +165,7 @@ namespace ...@@ -165,8 +165,7 @@ namespace
#endif #endif
buf.appendAscii( SAL_CONFIGFILE("/sunjavaplugin") ); buf.appendAscii( SAL_CONFIGFILE("/sunjavaplugin") );
sIni = buf.makeStringAndClear(); sIni = buf.makeStringAndClear();
JFW_TRACE2("[Java framework] sunjavaplugin: " JFW_TRACE2("Using configuration file " << sIni);
"Using configuration file \n" + sIni);
return sIni; return sIni;
} }
}; };
...@@ -441,7 +440,7 @@ bool getJavaProps(const OUString & exePath, ...@@ -441,7 +440,7 @@ bool getJavaProps(const OUString & exePath,
FileHandleReader stdoutReader(fileOut); FileHandleReader stdoutReader(fileOut);
rtl::Reference< AsynchReader > stderrReader(new AsynchReader(fileErr)); rtl::Reference< AsynchReader > stderrReader(new AsynchReader(fileErr));
JFW_TRACE2("\n[Java framework] Executing: " + exePath + ".\n"); JFW_TRACE2("Executing: " + exePath);
oslProcessError procErr = oslProcessError procErr =
osl_executeProcess_WithRedirectedIO( exePath.pData,//usExe.pData, osl_executeProcess_WithRedirectedIO( exePath.pData,//usExe.pData,
args, args,
...@@ -458,7 +457,7 @@ bool getJavaProps(const OUString & exePath, ...@@ -458,7 +457,7 @@ bool getJavaProps(const OUString & exePath,
if( procErr != osl_Process_E_None) if( procErr != osl_Process_E_None)
{ {
JFW_TRACE2("[Java framework] Execution failed. \n"); JFW_TRACE2("Execution failed");
*bProcessRun = false; *bProcessRun = false;
SAL_WARN("jfw", SAL_WARN("jfw",
"osl_executeProcess failed (" << ret << "): \"" << exePath << "\""); "osl_executeProcess failed (" << ret << "): \"" << exePath << "\"");
...@@ -466,7 +465,7 @@ bool getJavaProps(const OUString & exePath, ...@@ -466,7 +465,7 @@ bool getJavaProps(const OUString & exePath,
} }
else else
{ {
JFW_TRACE2("[Java framework] Java executed successfully.\n"); JFW_TRACE2("Java executed successfully");
*bProcessRun = true; *bProcessRun = true;
} }
...@@ -484,7 +483,7 @@ bool getJavaProps(const OUString & exePath, ...@@ -484,7 +483,7 @@ bool getJavaProps(const OUString & exePath,
OUString sLine; OUString sLine;
if (!decodeOutput(aLine, &sLine)) if (!decodeOutput(aLine, &sLine))
continue; continue;
JFW_TRACE2("[Java framework]:\" " << sLine << " \".\n"); JFW_TRACE2(" \"" << sLine << " \"");
sLine = sLine.trim(); sLine = sLine.trim();
if (sLine.isEmpty()) if (sLine.isEmpty())
continue; continue;
...@@ -511,8 +510,8 @@ bool getJavaProps(const OUString & exePath, ...@@ -511,8 +510,8 @@ bool getJavaProps(const OUString & exePath,
//process error stream data //process error stream data
stderrReader->join(); stderrReader->join();
JFW_TRACE2("[Java framework] Java wrote to stderr:\" " JFW_TRACE2("Java wrote to stderr:\" "
<< stderrReader->getData().getStr() << " \".\n"); << stderrReader->getData().getStr() << " \"");
TimeValue waitMax= {5 ,0}; TimeValue waitMax= {5 ,0};
procErr = osl_joinProcessWithTimeout(javaProcess, &waitMax); procErr = osl_joinProcessWithTimeout(javaProcess, &waitMax);
...@@ -904,9 +903,7 @@ rtl::Reference<VendorBase> getJREInfoByPath( ...@@ -904,9 +903,7 @@ rtl::Reference<VendorBase> getJREInfoByPath(
SameOrSubDirJREMap(sResolvedDir)); SameOrSubDirJREMap(sResolvedDir));
if (entry2 != mapJREs.end()) if (entry2 != mapJREs.end())
{ {
JFW_TRACE2(OUString("[Java framework] sunjavaplugin") JFW_TRACE2("JRE found again (detected before): " << sResolvedDir);
+ SAL_DLLEXTENSION ": JRE found again (detected before): "
+ sResolvedDir + ".\n");
return entry2->second; return entry2->second;
} }
...@@ -936,7 +933,6 @@ rtl::Reference<VendorBase> getJREInfoByPath( ...@@ -936,7 +933,6 @@ rtl::Reference<VendorBase> getJREInfoByPath(
sFullPath = sResolvedDir + sFullPath = sResolvedDir +
OUString("/") + (*i); OUString("/") + (*i);
sFilePath = resolveFilePath(sFullPath); sFilePath = resolveFilePath(sFullPath);
if (sFilePath.isEmpty()) if (sFilePath.isEmpty())
...@@ -959,9 +955,7 @@ rtl::Reference<VendorBase> getJREInfoByPath( ...@@ -959,9 +955,7 @@ rtl::Reference<VendorBase> getJREInfoByPath(
MapIt entry = mapJREs.find(sFilePath); MapIt entry = mapJREs.find(sFilePath);
if (entry != mapJREs.end()) if (entry != mapJREs.end())
{ {
JFW_TRACE2(OUString("[Java framework] sunjavaplugin") JFW_TRACE2("JRE found again (detected before): " << sFilePath);
+ SAL_DLLEXTENSION ": JRE found again (detected before): "
+ sFilePath + ".\n");
return entry->second; return entry->second;
} }
...@@ -1059,9 +1053,7 @@ rtl::Reference<VendorBase> getJREInfoByPath( ...@@ -1059,9 +1053,7 @@ rtl::Reference<VendorBase> getJREInfoByPath(
} }
else else
{ {
JFW_TRACE2(OUString("[Java framework] sunjavaplugin") JFW_TRACE2("Found JRE: " << sResolvedDir << " at: " << path);
+ SAL_DLLEXTENSION ": Found JRE: " + sResolvedDir
+ " \n at: " + path + ".\n");
mapJREs.insert(MAPJRE::value_type(sResolvedDir, ret)); mapJREs.insert(MAPJRE::value_type(sResolvedDir, ret));
mapJREs.insert(MAPJRE::value_type(sFilePath, ret)); mapJREs.insert(MAPJRE::value_type(sFilePath, ret));
...@@ -1140,6 +1132,11 @@ void createJavaInfoFromPath(vector<rtl::Reference<VendorBase> >& vecInfos) ...@@ -1140,6 +1132,11 @@ void createJavaInfoFromPath(vector<rtl::Reference<VendorBase> >& vecInfos)
void createJavaInfoFromJavaHome(vector<rtl::Reference<VendorBase> >& vecInfos) void createJavaInfoFromJavaHome(vector<rtl::Reference<VendorBase> >& vecInfos)
{ {
// Get Java from JAVA_HOME environment // Get Java from JAVA_HOME environment
// Note that on OS X is it not normal at all to have a JAVA_HOME environment
// variable. We set it in our build environment for build-time programs, though,
// so it is set when running unit tests that involve Java functionality. (Which affects
// at least CppunitTest_dbaccess_dialog_save, too, and not only the JunitTest ones.)
char *szJavaHome= getenv("JAVA_HOME"); char *szJavaHome= getenv("JAVA_HOME");
if(szJavaHome) if(szJavaHome)
{ {
...@@ -1173,7 +1170,7 @@ bool makeDriveLetterSame(OUString * fileURL) ...@@ -1173,7 +1170,7 @@ bool makeDriveLetterSame(OUString * fileURL)
void createJavaInfoDirScan(vector<rtl::Reference<VendorBase> >& vecInfos) void createJavaInfoDirScan(vector<rtl::Reference<VendorBase> >& vecInfos)
{ {
JFW_TRACE2("\n[Java framework] Checking \"/usr/jdk/latest\"\n"); JFW_TRACE2("Checking /usr/jdk/latest");
getJREInfoByPath("file:////usr/jdk/latest", vecInfos); getJREInfoByPath("file:////usr/jdk/latest", vecInfos);
} }
...@@ -1239,15 +1236,10 @@ void createJavaInfoDirScan(vector<rtl::Reference<VendorBase> >& vecInfos) ...@@ -1239,15 +1236,10 @@ void createJavaInfoDirScan(vector<rtl::Reference<VendorBase> >& vecInfos)
case File::E_NOTDIR: case File::E_NOTDIR:
continue; continue;
case File::E_ACCES: case File::E_ACCES:
JFW_TRACE2(OUString("[Java framework] sunjavaplugin: ") JFW_TRACE2("Could not read directory " << usDir2 << " because of missing access rights");
+ "Could not read directory " + usDir2
+ " because of missing access rights.");
continue; continue;
default: default:
JFW_TRACE2(OUString("[Java framework] sunjavaplugin: ") JFW_TRACE2("Could not read directory << usDir2 << ". Osl file error: " << openErr);
+ "Could not read directory "
+ usDir2 + ". Osl file error: "
+ OUString::number(openErr));
continue; continue;
} }
...@@ -1259,13 +1251,10 @@ void createJavaInfoDirScan(vector<rtl::Reference<VendorBase> >& vecInfos) ...@@ -1259,13 +1251,10 @@ void createJavaInfoDirScan(vector<rtl::Reference<VendorBase> >& vecInfos)
File::RC errStatus = File::E_None; File::RC errStatus = File::E_None;
if ((errStatus = curIt.getFileStatus(aStatus)) != File::E_None) if ((errStatus = curIt.getFileStatus(aStatus)) != File::E_None)
{ {
JFW_TRACE2(excMessage + "getFileStatus failed with error " JFW_TRACE2(excMessage + "getFileStatus failed with error " << errStatus);
+ OUString::number(errStatus));
continue; continue;
} }
JFW_TRACE2(OUString("[Java framework] sunjavaplugin: ") + JFW_TRACE2("Checking if directory: " << aStatus.getFileURL() << " is a Java");
"Checking if directory: " + aStatus.getFileURL() +
" is a Java. \n");
getJREInfoByPath(aStatus.getFileURL(),vecInfos); getJREInfoByPath(aStatus.getFileURL(),vecInfos);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment