Skip to content
Open

Perf #269

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
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17">
<attributes>
<attribute name="annotationpath" value="/org.eclipse.tracecompass.incubator.annotations/annotations"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
<attributes>
<attribute name="annotationpath" value="/org.eclipse.tracecompass.incubator.annotations/annotations"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bin/
target/
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.eclipse.tracecompass.incubator.perf.core.tests</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
encoding/<project>=UTF-8
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
line.separator=\n

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
eclipse.preferences.version=1
editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
formatter_profile=_tmf-test-style
formatter_settings_version=12
org.eclipse.jdt.ui.exception.name=e
org.eclipse.jdt.ui.gettersetter.use.is=true
org.eclipse.jdt.ui.keywordthis=false
org.eclipse.jdt.ui.overrideannotation=true
sp_cleanup.add_default_serial_version_id=true
sp_cleanup.add_generated_serial_version_id=false
sp_cleanup.add_missing_annotations=false
sp_cleanup.add_missing_deprecated_annotations=true
sp_cleanup.add_missing_methods=false
sp_cleanup.add_missing_nls_tags=false
sp_cleanup.add_missing_override_annotations=true
sp_cleanup.add_missing_override_annotations_interface_methods=true
sp_cleanup.add_serial_version_id=false
sp_cleanup.always_use_blocks=true
sp_cleanup.always_use_parentheses_in_expressions=false
sp_cleanup.always_use_this_for_non_static_field_access=false
sp_cleanup.always_use_this_for_non_static_method_access=false
sp_cleanup.convert_to_enhanced_for_loop=false
sp_cleanup.correct_indentation=false
sp_cleanup.format_source_code=false
sp_cleanup.format_source_code_changes_only=false
sp_cleanup.make_local_variable_final=false
sp_cleanup.make_parameters_final=false
sp_cleanup.make_private_fields_final=true
sp_cleanup.make_type_abstract_if_missing_method=false
sp_cleanup.make_variable_declarations_final=false
sp_cleanup.never_use_blocks=false
sp_cleanup.never_use_parentheses_in_expressions=true
sp_cleanup.on_save_use_additional_actions=true
sp_cleanup.organize_imports=false
sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
sp_cleanup.remove_private_constructors=true
sp_cleanup.remove_trailing_whitespaces=true
sp_cleanup.remove_trailing_whitespaces_all=true
sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
sp_cleanup.remove_unnecessary_casts=false
sp_cleanup.remove_unnecessary_nls_tags=false
sp_cleanup.remove_unused_imports=false
sp_cleanup.remove_unused_local_variables=false
sp_cleanup.remove_unused_private_fields=true
sp_cleanup.remove_unused_private_members=false
sp_cleanup.remove_unused_private_methods=true
sp_cleanup.remove_unused_private_types=true
sp_cleanup.sort_members=false
sp_cleanup.sort_members_all=false
sp_cleanup.use_blocks=true
sp_cleanup.use_blocks_only_for_return_and_throw=false
sp_cleanup.use_parentheses_in_expressions=false
sp_cleanup.use_this_for_non_static_field_access=false
sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
sp_cleanup.use_this_for_non_static_method_access=false
sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
compilers.f.unresolved-features=1
compilers.f.unresolved-plugins=1
compilers.incompatible-environment=1
compilers.p.build=1
compilers.p.build.bin.includes=0
compilers.p.build.encodings=2
compilers.p.build.java.compiler=2
compilers.p.build.java.compliance=1
compilers.p.build.missing.output=2
compilers.p.build.output.library=1
compilers.p.build.source.library=0
compilers.p.build.src.includes=0
compilers.p.deprecated=1
compilers.p.discouraged-class=1
compilers.p.internal=1
compilers.p.missing-packages=1
compilers.p.missing-version-export-package=2
compilers.p.missing-version-import-package=2
compilers.p.missing-version-require-bundle=2
compilers.p.no-required-att=0
compilers.p.not-externalized-att=2
compilers.p.unknown-attribute=1
compilers.p.unknown-class=1
compilers.p.unknown-element=1
compilers.p.unknown-identifier=1
compilers.p.unknown-resource=1
compilers.p.unresolved-ex-points=0
compilers.p.unresolved-import=0
compilers.s.create-docs=false
compilers.s.doc-folder=doc
compilers.s.open-tags=1
eclipse.preferences.version=1
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name
Bundle-Vendor: %Bundle-Vendor
Bundle-SymbolicName: org.eclipse.tracecompass.incubator.perf.core.tests
Bundle-Version: 0.1.0.qualifier
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: JavaSE-17
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.core.resources,
org.eclipse.tracecompass.common.core,
org.eclipse.tracecompass.tmf.core,
org.eclipse.tracecompass.statesystem.core,
org.eclipse.tracecompass.analysis.profiling.core,
org.eclipse.tracecompass.incubator.perf.core,
org.junit,
org.eclipse.jdt.annotation;bundle-version="[2.0.0,3.0.0)";resolution:=optional
Export-Package: org.eclipse.tracecompass.incubator.perf.core.tests
Automatic-Module-Name: org.eclipse.tracecompass.incubator.perf.core.tests
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>About</title>
</head>
<body lang="EN-US">
<h2>About This Content</h2>

<p>November 30, 2017</p>
<h3>License</h3>

<p>
The Eclipse Foundation makes available all content in this plug-in
(&quot;Content&quot;). Unless otherwise indicated below, the Content
is provided to you under the terms and conditions of the Eclipse
Public License Version 2.0 (&quot;EPL&quot;). A copy of the EPL is
available at <a href="http://www.eclipse.org/legal/epl-2.0">http://www.eclipse.org/legal/epl-2.0</a>.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Use HTTPS links in About page content.

Both external links are plaintext HTTP; switch them to HTTPS to avoid mixed/insecure navigation from plugin metadata pages.

Suggested fix
-		available at <a href="http://www.eclipse.org/legal/epl-2.0">http://www.eclipse.org/legal/epl-2.0</a>.
+		available at <a href="https://www.eclipse.org/legal/epl-2.0">https://www.eclipse.org/legal/epl-2.0</a>.
@@
-		code in the Content and such source code may be obtained at <a
-			href="http://www.eclipse.org/">http://www.eclipse.org</a>.
+		code in the Content and such source code may be obtained at <a
+			href="https://www.eclipse.org/">https://www.eclipse.org</a>.

Also applies to: 32-32

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tracetypes/org.eclipse.tracecompass.incubator.perf.core.tests/about.html` at
line 19, Replace the plaintext HTTP links in the about page content with HTTPS:
locate the occurrences of "http://www.eclipse.org/legal/epl-2.0" and the other
external link using "http://" in the about.html content and change them to
"https://..." so both external links use HTTPS to avoid mixed/insecure
navigation from plugin metadata pages; ensure you update both occurrences (the
one shown and the other at the second occurrence).

For purposes of the EPL, &quot;Program&quot; will mean the Content.
</p>

<p>
If you did not receive this Content directly from the Eclipse
Foundation, the Content is being redistributed by another party
(&quot;Redistributor&quot;) and different terms and conditions may
apply to your use of any object code in the Content. Check the
Redistributor's license that was provided with the Content. If no such
license exists, contact the Redistributor. Unless otherwise indicated
below, the terms and conditions of the EPL still apply to any source
code in the Content and such source code may be obtained at <a
href="http://www.eclipse.org/">http://www.eclipse.org</a>.
</p>

</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
###############################################################################
# Copyright (c) 2026 Ericsson
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License 2.0
# which accompanies this distribution, and is available at
# https://www.eclipse.org/legal/epl-2.0
#
# SPDX-License-Identifier: EPL-2.0
###############################################################################

source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\
about.html,\
plugin.properties,\
traces/
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
###############################################################################
# Copyright (c) 2026 Ericsson
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License 2.0
# which accompanies this distribution, and is available at
# https://www.eclipse.org/legal/epl-2.0
#
# SPDX-License-Identifier: EPL-2.0
###############################################################################

Bundle-Vendor = Eclipse Trace Compass Incubator
Bundle-Name = Trace Compass Incubator perf.data Core Tests Plug-in
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
/*******************************************************************************
* Copyright (c) 2026 Ericsson
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License 2.0 which
* accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/

package org.eclipse.tracecompass.incubator.perf.core.tests;

import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;

import java.io.File;
import java.io.IOException;

import org.eclipse.tracecompass.incubator.internal.perf.core.PerfConstants;
import org.eclipse.tracecompass.incubator.internal.perf.core.PerfDataReader;
import org.eclipse.tracecompass.incubator.internal.perf.core.PerfRecord;
import org.junit.Test;

/**
* Structural test for the callchain data exposed by {@link PerfDataReader}.
*
* The callchain analysis module expects each {@code PERF_RECORD_SAMPLE}
* record to carry a {@code callchain} {@code long[]} in its fields. This
* test walks the bundled sample file and verifies that assumption so we
* don't silently regress the data shape that the analysis depends on.
*/
public class PerfDataCallchainTest {

/**
* Verify that the bundled trace has {@code PERF_RECORD_SAMPLE} records
* and that, when callchains are present, they carry non-sentinel IPs.
*
* The bundled sample was captured without {@code -g}, so every SAMPLE
* has an empty callchain. We still exercise the code path and make
* sure the data shape (a {@code long[]} in the {@code callchain}
* field, or its absence) matches what the analysis module expects.
*
* @throws IOException
* on I/O error
*/
@Test
public void hasNonTrivialCallchains() throws IOException {
File file = PerfDataTraceTest.resolveTraceFile();
try (PerfDataReader reader = new PerfDataReader(file)) {
long off = reader.getDataOffset();
long end = off + reader.getDataSize();
int samples = 0;
int samplesWithChain = 0;
int realIps = 0;
while (off < end) {
PerfRecord rec = reader.readRecordAt(off);
if (rec == null) {
break;
}
if (rec.getType() == PerfConstants.PERF_RECORD_SAMPLE) {
samples++;
Object cc = rec.getField("callchain"); //$NON-NLS-1$
if (cc instanceof long[]) {
long[] chain = (long[]) cc;
if (chain.length > 0) {
samplesWithChain++;
}
for (long ip : chain) {
// PERF_CONTEXT_* sentinels live in the top 128 bytes of the address space
if (Long.compareUnsigned(ip, 0xffffffffffffff80L) < 0 && ip != 0) {
realIps++;
}
}
}
}
off += rec.getSize();
}
assertNotNull(file);
assertTrue("expected some SAMPLE records, got " + samples, samples > 0); //$NON-NLS-1$
// Callchains are only present when perf was run with -g. If any
// are present in the bundled trace, at least one must contain a
// non-sentinel IP.
if (samplesWithChain > 0) {
assertTrue("expected non-sentinel IPs in callchains, got " + realIps, //$NON-NLS-1$
realIps > 0);
}
}
}

/**
* The second bundled trace ({@code traces/perf-callgraph.data}) was
* captured with {@code perf record -g ping 4.4.4.4 -c 3} so every
* SAMPLE carries a callchain. Make sure the reader exposes it as a
* {@code long[]} containing at least one real IP.
*
* @throws IOException
* on I/O error
*/
@Test
public void callgraphTraceHasRealChains() throws IOException {
File file = PerfDataTraceTest.resolveCallgraphTraceFile();
if (!file.isFile()) {
// Bundled only in the source tree; skip gracefully when the
// test is run from an unusual working directory.
return;
}
try (PerfDataReader reader = new PerfDataReader(file)) {
long off = reader.getDataOffset();
long end = off + reader.getDataSize();
int samples = 0;
int samplesWithChain = 0;
int realIps = 0;
while (off < end) {
PerfRecord rec = reader.readRecordAt(off);
if (rec == null) {
break;
}
if (rec.getType() == PerfConstants.PERF_RECORD_SAMPLE) {
samples++;
Object cc = rec.getField("callchain"); //$NON-NLS-1$
if (cc instanceof long[]) {
long[] chain = (long[]) cc;
if (chain.length > 0) {
samplesWithChain++;
}
for (long ip : chain) {
if (Long.compareUnsigned(ip, 0xffffffffffffff80L) < 0 && ip != 0) {
realIps++;
}
}
}
}
off += rec.getSize();
}
assertNotNull(file);
assertTrue("expected samples, got " + samples, samples > 0); //$NON-NLS-1$
assertTrue("expected callchains on every sample, got " //$NON-NLS-1$
+ samplesWithChain + "/" + samples, //$NON-NLS-1$
samplesWithChain == samples && samples > 0);
assertTrue("expected non-sentinel IPs, got " + realIps, realIps > samples); //$NON-NLS-1$
}
}
}
Loading
Loading