Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Identifier jvm info #126

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion skeleton/scripts/update_version.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
###############################################################################
# Copyright (c) 2016, 2022 Ericsson
# Copyright (c) 2016, 2024 Ericsson
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License 2.0
Expand Down Expand Up @@ -56,3 +56,6 @@ find ../../rcp/org.eclipse.tracecompass.incubator.rcp.product/ -name "*.product"
#Update .product trace-server/org.eclipse.tracecompass.incubator.trace.server.product/(*/)traceserver.product
find ../../trace-server/org.eclipse.tracecompass.incubator.trace.server.product/ -name "*.product" -type f -exec sed -i -e s/$oldVersion/$newVersion/g {} \;

#Update rest.core plugin trace-server/org.eclipse.tracecompass.incubator.trace.server.jersey.rest.core/META-INF/MANIFEST.MF.
#This version is retrieved to show the server version and hence has to match the trace server product version
sed -i -e s/$oldVersion.qualifier/$newVersion.qualifier/g ../../trace-server/org.eclipse.tracecompass.incubator.trace.server.jersey.rest.core/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name
Bundle-Vendor: %Bundle-Vendor
Bundle-SymbolicName: org.eclipse.tracecompass.incubator.trace.server.jersey.rest.core;singleton:=true
Bundle-Version: 0.1.11.qualifier
Bundle-Version: 0.12.0.qualifier
Bundle-Localization: plugin
Bundle-Activator: org.eclipse.tracecompass.incubator.internal.trace.server.jersey.rest.core.Activator
Bundle-ActivationPolicy: lazy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public class IdentifierService {
private static final String OS_NAME = "os.name"; //$NON-NLS-1$
private static final String OS_ARCH = "os.arch"; //$NON-NLS-1$
private static final String OS_VERSION = "os.version"; //$NON-NLS-1$
private static final String JVM_VERSION = "java.version"; //$NON-NLS-1$
private static final String PRODUCT_ID = "eclipse.product"; //$NON-NLS-1$
private static final String LAUNCHER_NAME = "eclipse.launcher.name"; //$NON-NLS-1$
private static final String QUALIFIER = "qualifier"; //$NON-NLS-1$
Expand Down Expand Up @@ -69,10 +70,11 @@ public Response getSystemInfo() {
response.setMaxMemory(Runtime.getRuntime().maxMemory());
response.setProductId(System.getProperty(PRODUCT_ID));
response.setLauncherName(System.getProperty(LAUNCHER_NAME));
response.setJvmVersion(System.getProperty(JVM_VERSION));

if (product != null) {
Version version = product.getDefiningBundle().getVersion();
response.setVersion(version.getMajor() + SEPARATOR + version.getMicro() + SEPARATOR + version.getMinor());
response.setVersion(version.getMajor() + SEPARATOR + version.getMinor() + SEPARATOR + version.getMicro());
String qualifier = version.getQualifier();
if (!QUALIFIER.equalsIgnoreCase(qualifier) && qualifier != null) {
response.setBuildTime(qualifier);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public class ServerInfoResponseImpl {
private String launcherName;
private String productId;
private String tspVersion;
private String jvmVersion;

/**
* @return Version in the format Major.Minor.Micro
Expand Down Expand Up @@ -201,4 +202,21 @@ public void setProductId(String productId) {
public void setTspVersion(String version) {
tspVersion = version;
}

/**
* Set JVM Version
*
* @param jvmVersion jvm version
*/
public void setJvmVersion(String jvmVersion) {
this.jvmVersion = jvmVersion;
}

/**
* @return the jvm Version
*/
public String getJvmVersion() {
return jvmVersion;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@ Export-Package: org.eclipse.tracecompass.incubator.internal.uftrace.core;x-frien
org.eclipse.tracecompass.incubator.internal.uftrace.core.trace;x-friends:="org.eclipse.tracecompass.incubator.uftrace.core.tests"
Import-Package: com.google.common.collect,
org.apache.commons.io,
org.apache.commons.lang3.math
org.apache.commons.lang3.math,
org.eclipse.cdt.utils
Automatic-Module-Name: org.eclipse.tracecompass.incubator.uftrace.core
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import java.util.Set;

import org.apache.commons.io.FilenameUtils;
import org.eclipse.cdt.utils.CPPFilt;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IProgressMonitor;
Expand All @@ -39,6 +40,7 @@
import org.eclipse.tracecompass.incubator.analysis.core.aspects.ProcessNameAspect;
import org.eclipse.tracecompass.incubator.internal.uftrace.core.Activator;
import org.eclipse.tracecompass.incubator.internal.uftrace.core.trace.SymParser.Symbol;
import org.eclipse.tracecompass.internal.tmf.core.callstack.FunctionNameMapper;
import org.eclipse.tracecompass.tmf.core.event.ITmfEvent;
import org.eclipse.tracecompass.tmf.core.event.ITmfEventType;
import org.eclipse.tracecompass.tmf.core.event.aspect.ITmfEventAspect;
Expand Down Expand Up @@ -491,9 +493,15 @@ private Map<Long, MapParser> getMap() {
private static class UfTraceSymbolProvider implements ISymbolProvider {

private Uftrace fTrace;
private CPPFilt fCppFilt;

public UfTraceSymbolProvider(Uftrace trace) {
fTrace = trace;
try {
fCppFilt = new CPPFilt();
} catch (IOException e) {
Activator.getInstance().logError("Could not load CPP Filt, C++ functions will be mangled." , e); //$NON-NLS-1$
}
}

@Override
Expand Down Expand Up @@ -526,6 +534,9 @@ public TmfResolvedSymbol getSymbol(int tid, long timestamp, long address) {
Symbol value = floorEntry.getValue();
if (value != null) {
String name = String.valueOf(value.getName());
if(fCppFilt != null) {
name = FunctionNameMapper.nameFromCppFilt(fCppFilt, name);
}
return new TmfResolvedSymbol(address, name);
}
}
Expand Down
Loading