Skip to content

Commit 40efbe8

Browse files
Add perf.data trace type
Add a new trace type that parses Linux perf.data files directly, following the layout described in perf_data_format.md. New bundle: org.eclipse.tracecompass.incubator.perf.core - PerfDataReader: random-access reader for the file header (PERFILE2 / PERFILE1, little- and big-endian), attrs section (perf_event_attr + per-attr event IDs), feature sections (hostname, osrelease, arch, cpudesc, cpuid, cmdline, nr_cpus), and data-stream records (MMAP, MMAP2, COMM, FORK, EXIT, SAMPLE, SWITCH, SWITCH_CPU_WIDE, LOST, THROTTLE, UNTHROTTLE, FINISHED_ROUND, FINISHED_INIT), including the trailing sample_id block when sample_id_all is set. Piped headers are detected but their record stream is not decoded yet. - PerfDataTrace: TmfTrace subclass registered via plugin.xml, with aspects for timestamp, event type, PID, TID, CPU, IP, Address, Comm and Filename. Exposes trace metadata through ITmfPropertiesProvider. New bundle: org.eclipse.tracecompass.incubator.perf.core.tests - PerfDataTraceTest with validate/reader/event-iteration tests, driven by a bundled sample perf.data file. Register both bundles in tracetypes/pom.xml. This code was written with the assistance of claude opus 4.7 Signed-off-by: Matthew Khouzam <matthew.khouzam@ericsson.com> Change-Id: I43f44e9f1eaef3c886c36d9eb3a4565c92bc96bc
1 parent c5168dc commit 40efbe8

40 files changed

Lines changed: 3804 additions & 0 deletions
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17">
4+
<attributes>
5+
<attribute name="annotationpath" value="/org.eclipse.tracecompass.incubator.annotations/annotations"/>
6+
</attributes>
7+
</classpathentry>
8+
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
9+
<attributes>
10+
<attribute name="annotationpath" value="/org.eclipse.tracecompass.incubator.annotations/annotations"/>
11+
</attributes>
12+
</classpathentry>
13+
<classpathentry kind="src" path="src"/>
14+
<classpathentry kind="output" path="bin"/>
15+
</classpath>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
bin/
2+
target/
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>org.eclipse.tracecompass.incubator.perf.core.tests</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>org.eclipse.pde.ManifestBuilder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
<buildCommand>
19+
<name>org.eclipse.pde.SchemaBuilder</name>
20+
<arguments>
21+
</arguments>
22+
</buildCommand>
23+
</buildSpec>
24+
<natures>
25+
<nature>org.eclipse.pde.PluginNature</nature>
26+
<nature>org.eclipse.jdt.core.javanature</nature>
27+
</natures>
28+
</projectDescription>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
eclipse.preferences.version=1
2+
encoding/<project>=UTF-8
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
eclipse.preferences.version=1
2+
line.separator=\n

tracetypes/org.eclipse.tracecompass.incubator.perf.core.tests/.settings/org.eclipse.jdt.core.prefs

Lines changed: 428 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
eclipse.preferences.version=1
2+
editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
3+
formatter_profile=_tmf-test-style
4+
formatter_settings_version=12
5+
org.eclipse.jdt.ui.exception.name=e
6+
org.eclipse.jdt.ui.gettersetter.use.is=true
7+
org.eclipse.jdt.ui.keywordthis=false
8+
org.eclipse.jdt.ui.overrideannotation=true
9+
sp_cleanup.add_default_serial_version_id=true
10+
sp_cleanup.add_generated_serial_version_id=false
11+
sp_cleanup.add_missing_annotations=false
12+
sp_cleanup.add_missing_deprecated_annotations=true
13+
sp_cleanup.add_missing_methods=false
14+
sp_cleanup.add_missing_nls_tags=false
15+
sp_cleanup.add_missing_override_annotations=true
16+
sp_cleanup.add_missing_override_annotations_interface_methods=true
17+
sp_cleanup.add_serial_version_id=false
18+
sp_cleanup.always_use_blocks=true
19+
sp_cleanup.always_use_parentheses_in_expressions=false
20+
sp_cleanup.always_use_this_for_non_static_field_access=false
21+
sp_cleanup.always_use_this_for_non_static_method_access=false
22+
sp_cleanup.convert_to_enhanced_for_loop=false
23+
sp_cleanup.correct_indentation=false
24+
sp_cleanup.format_source_code=false
25+
sp_cleanup.format_source_code_changes_only=false
26+
sp_cleanup.make_local_variable_final=false
27+
sp_cleanup.make_parameters_final=false
28+
sp_cleanup.make_private_fields_final=true
29+
sp_cleanup.make_type_abstract_if_missing_method=false
30+
sp_cleanup.make_variable_declarations_final=false
31+
sp_cleanup.never_use_blocks=false
32+
sp_cleanup.never_use_parentheses_in_expressions=true
33+
sp_cleanup.on_save_use_additional_actions=true
34+
sp_cleanup.organize_imports=false
35+
sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
36+
sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
37+
sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
38+
sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
39+
sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
40+
sp_cleanup.remove_private_constructors=true
41+
sp_cleanup.remove_trailing_whitespaces=true
42+
sp_cleanup.remove_trailing_whitespaces_all=true
43+
sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
44+
sp_cleanup.remove_unnecessary_casts=false
45+
sp_cleanup.remove_unnecessary_nls_tags=false
46+
sp_cleanup.remove_unused_imports=false
47+
sp_cleanup.remove_unused_local_variables=false
48+
sp_cleanup.remove_unused_private_fields=true
49+
sp_cleanup.remove_unused_private_members=false
50+
sp_cleanup.remove_unused_private_methods=true
51+
sp_cleanup.remove_unused_private_types=true
52+
sp_cleanup.sort_members=false
53+
sp_cleanup.sort_members_all=false
54+
sp_cleanup.use_blocks=true
55+
sp_cleanup.use_blocks_only_for_return_and_throw=false
56+
sp_cleanup.use_parentheses_in_expressions=false
57+
sp_cleanup.use_this_for_non_static_field_access=false
58+
sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
59+
sp_cleanup.use_this_for_non_static_method_access=false
60+
sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
compilers.f.unresolved-features=1
2+
compilers.f.unresolved-plugins=1
3+
compilers.incompatible-environment=1
4+
compilers.p.build=1
5+
compilers.p.build.bin.includes=0
6+
compilers.p.build.encodings=2
7+
compilers.p.build.java.compiler=2
8+
compilers.p.build.java.compliance=1
9+
compilers.p.build.missing.output=2
10+
compilers.p.build.output.library=1
11+
compilers.p.build.source.library=0
12+
compilers.p.build.src.includes=0
13+
compilers.p.deprecated=1
14+
compilers.p.discouraged-class=1
15+
compilers.p.internal=1
16+
compilers.p.missing-packages=1
17+
compilers.p.missing-version-export-package=2
18+
compilers.p.missing-version-import-package=2
19+
compilers.p.missing-version-require-bundle=2
20+
compilers.p.no-required-att=0
21+
compilers.p.not-externalized-att=2
22+
compilers.p.unknown-attribute=1
23+
compilers.p.unknown-class=1
24+
compilers.p.unknown-element=1
25+
compilers.p.unknown-identifier=1
26+
compilers.p.unknown-resource=1
27+
compilers.p.unresolved-ex-points=0
28+
compilers.p.unresolved-import=0
29+
compilers.s.create-docs=false
30+
compilers.s.doc-folder=doc
31+
compilers.s.open-tags=1
32+
eclipse.preferences.version=1
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Manifest-Version: 1.0
2+
Bundle-ManifestVersion: 2
3+
Bundle-Name: %Bundle-Name
4+
Bundle-Vendor: %Bundle-Vendor
5+
Bundle-SymbolicName: org.eclipse.tracecompass.incubator.perf.core.tests
6+
Bundle-Version: 0.1.0.qualifier
7+
Bundle-Localization: plugin
8+
Bundle-RequiredExecutionEnvironment: JavaSE-17
9+
Require-Bundle: org.eclipse.core.runtime,
10+
org.eclipse.core.resources,
11+
org.eclipse.tracecompass.common.core,
12+
org.eclipse.tracecompass.tmf.core,
13+
org.eclipse.tracecompass.incubator.perf.core,
14+
org.junit,
15+
org.eclipse.jdt.annotation;bundle-version="[2.0.0,3.0.0)";resolution:=optional
16+
Export-Package: org.eclipse.tracecompass.incubator.perf.core.tests
17+
Automatic-Module-Name: org.eclipse.tracecompass.incubator.perf.core.tests
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3+
<html xmlns="http://www.w3.org/1999/xhtml">
4+
<head>
5+
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
6+
<title>About</title>
7+
</head>
8+
<body lang="EN-US">
9+
<h2>About This Content</h2>
10+
11+
<p>November 30, 2017</p>
12+
<h3>License</h3>
13+
14+
<p>
15+
The Eclipse Foundation makes available all content in this plug-in
16+
(&quot;Content&quot;). Unless otherwise indicated below, the Content
17+
is provided to you under the terms and conditions of the Eclipse
18+
Public License Version 2.0 (&quot;EPL&quot;). A copy of the EPL is
19+
available at <a href="http://www.eclipse.org/legal/epl-2.0">http://www.eclipse.org/legal/epl-2.0</a>.
20+
For purposes of the EPL, &quot;Program&quot; will mean the Content.
21+
</p>
22+
23+
<p>
24+
If you did not receive this Content directly from the Eclipse
25+
Foundation, the Content is being redistributed by another party
26+
(&quot;Redistributor&quot;) and different terms and conditions may
27+
apply to your use of any object code in the Content. Check the
28+
Redistributor's license that was provided with the Content. If no such
29+
license exists, contact the Redistributor. Unless otherwise indicated
30+
below, the terms and conditions of the EPL still apply to any source
31+
code in the Content and such source code may be obtained at <a
32+
href="http://www.eclipse.org/">http://www.eclipse.org</a>.
33+
</p>
34+
35+
</body>
36+
</html>

0 commit comments

Comments
 (0)