Skip to content
Merged
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
17 changes: 17 additions & 0 deletions features/nl.esi.pps.tmsc.cpu.ui.feature/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>nl.esi.pps.tmsc.cpu.ui.feature</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.pde.FeatureBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.FeatureNature</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
11 changes: 11 additions & 0 deletions features/nl.esi.pps.tmsc.cpu.ui.feature/build.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#
# Copyright (c) 2018-2025 TNO and Contributors to the GitHub community
#
# This program and the accompanying materials are made available
# under the terms of the MIT License which is available at
# https://opensource.org/licenses/MIT
#
# SPDX-License-Identifier: MIT
#

bin.includes = feature.xml
49 changes: 49 additions & 0 deletions features/nl.esi.pps.tmsc.cpu.ui.feature/feature.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

Copyright (c) 2018-2025 TNO and Contributors to the GitHub community

This program and the accompanying materials are made available
under the terms of the MIT License which is available at
https://opensource.org/licenses/MIT

SPDX-License-Identifier: MIT

-->
<feature
id="nl.esi.pps.tmsc.cpu.ui.feature"
label="TMSC CPU UI Feature"
version="0.30.0.qualifier"
provider-name="ESI (TNO)"
license-feature="nl.esi.pps.license"
license-feature-version="0.0.0">

<description url="http://www.example.com/description">
[Enter Feature Description here.]
</description>

<copyright url="http://www.example.com/copyright">
[Enter Copyright Description here.]
</copyright>

<license url="http://www.example.com/license">
[Enter License Description here.]
</license>

<includes
id="nl.esi.pps.tmsc.ui.feature"
version="0.0.0"/>

<plugin
id="nl.esi.pps.tmsc.cpu"
version="0.0.0"/>

<plugin
id="nl.esi.pps.tmsc.cpu.edit"
version="0.0.0"/>

<plugin
id="nl.esi.pps.tmsc.cpu.editor"
version="0.0.0"/>

</feature>
8 changes: 8 additions & 0 deletions plugins/nl.esi.pps.tmsc.cpu.edit/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?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-21"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="xtend-gen"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
34 changes: 34 additions & 0 deletions plugins/nl.esi.pps.tmsc.cpu.edit/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>nl.esi.pps.tmsc.cpu.edit</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
<arguments>
</arguments>
</buildCommand>
<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>
<nature>org.eclipse.xtext.ui.shared.xtextNature</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,9 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=21
org.eclipse.jdt.core.compiler.compliance=21
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=21
10 changes: 10 additions & 0 deletions plugins/nl.esi.pps.tmsc.cpu.edit/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: TMSC CPU Edit
Bundle-SymbolicName: nl.esi.pps.tmsc.cpu.edit;singleton:=true
Bundle-Version: 0.30.0.qualifier
Require-Bundle: nl.esi.pps.tmsc.edit,
nl.esi.pps.tmsc.cpu
Bundle-Vendor: ESI (TNO)
Automatic-Module-Name: nl.esi.pps.tmsc.cpu.edit
Bundle-RequiredExecutionEnvironment: JavaSE-21
16 changes: 16 additions & 0 deletions plugins/nl.esi.pps.tmsc.cpu.edit/build.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#
# Copyright (c) 2018-2025 TNO and Contributors to the GitHub community
#
# This program and the accompanying materials are made available
# under the terms of the MIT License which is available at
# https://opensource.org/licenses/MIT
#
# SPDX-License-Identifier: MIT
#

source.. = src/,\
xtend-gen/
output.. = target/classes/
bin.includes = META-INF/,\
.,\
plugin.xml
24 changes: 24 additions & 0 deletions plugins/nl.esi.pps.tmsc.cpu.edit/plugin.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

Copyright (c) 2018-2025 TNO and Contributors to the GitHub community

This program and the accompanying materials are made available
under the terms of the MIT License which is available at
https://opensource.org/licenses/MIT

SPDX-License-Identifier: MIT

-->
<?eclipse version="3.4"?>
<plugin>
<extension
point="nl.esi.pps.tmsc.edit.dataAnalysis">
<DataAnalysis
content_provider="nl.esi.pps.tmsc.cpu.edit.ExecutionDataAnalysisItemContentProvider"
eclass_uri="http://www.esi.nl/pps/tmsc#Execution"
id="nl.esi.pps.tmsc.cpu.edit.ExecutionDataAnalysisItemContentProvider">
</DataAnalysis>
</extension>

</plugin>
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/**
* Copyright (c) 2018-2025 TNO and Contributors to the GitHub community
*
* This program and the accompanying materials are made available
* under the terms of the MIT License which is available at
* https://opensource.org/licenses/MIT
*
* SPDX-License-Identifier: MIT
*/
package nl.esi.pps.tmsc.cpu.edit

import java.util.Collections
import nl.esi.pps.tmsc.Execution
import nl.esi.pps.tmsc.cpu.TmscCpuInfoQueries
import nl.esi.pps.tmsc.provider.dataanalysis.IDataAnalysisItemContentProvider
import nl.esi.pps.tmsc.util.TmscQueries

import static extension nl.esi.pps.tmsc.cpu.TmscCpuInfoQueries.*

class ExecutionDataAnalysisItemContentProvider implements IDataAnalysisItemContentProvider {
/**
* Data analysis of On-CPU for all {@link Execution executions} with the same
* {@link Execution#getFunction() function} on the same{@link Execution#getLifeline() executor.}
*/
static final String CONF_ON_CPU = "On-CPU (On same executor)"

/**
* Data analysis of Wait-for-CPU for all {@link Execution executions} with the same
* {@link Execution#getFunction() function} on the same{@link Execution#getLifeline() executor.}
*/
static final String CONF_WAIT_CPU = "Wait-for-CPU (On same executor)"

override getConfigurations(Object object) {
val Execution execution = object as Execution
return execution.hasCpuInfo ? newLinkedHashSet(CONF_ON_CPU, CONF_WAIT_CPU) : Collections.emptySet()
}

override getTitle(Object object, String configuration) {
val Execution execution = object as Execution
return switch (configuration) {
case CONF_ON_CPU: '''On-CPU for «execution.function.name» on «execution.lifeline.executor.name»'''
case CONF_WAIT_CPU: '''Wait-for-CPU for «execution.function.name» on «execution.lifeline.executor.name»'''
default: '''Unsupported configuration: «configuration»'''
}
}

override getSiblings(Object object, String configuration) {
val Execution execution = object as Execution
return TmscQueries::findAllWithFunctionAndLifeline(execution)
}

override getDuration(Object object, Object sibling, String configuration) {
val Execution execution = sibling as Execution
return switch (configuration) {
case CONF_ON_CPU: TmscCpuInfoQueries::getOnCpuNanos(execution, true)
case CONF_WAIT_CPU: TmscCpuInfoQueries::getWaitCpuNanos(execution, true)
default: throw new IllegalArgumentException('''Unsupported configuration: «configuration»''')
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
/**
* Copyright (c) 2018-2025 TNO and Contributors to the GitHub community
*
* This program and the accompanying materials are made available
* under the terms of the MIT License which is available at
* https://opensource.org/licenses/MIT
*
* SPDX-License-Identifier: MIT
*/
package nl.esi.pps.tmsc.cpu.edit;

import java.util.Collections;
import java.util.Set;
import nl.esi.pps.tmsc.Execution;
import nl.esi.pps.tmsc.cpu.TmscCpuInfoQueries;
import nl.esi.pps.tmsc.provider.dataanalysis.IDataAnalysisItemContentProvider;
import nl.esi.pps.tmsc.util.TmscQueries;
import org.eclipse.xtend2.lib.StringConcatenation;
import org.eclipse.xtext.xbase.lib.CollectionLiterals;

@SuppressWarnings("all")
public class ExecutionDataAnalysisItemContentProvider implements IDataAnalysisItemContentProvider {
/**
* Data analysis of On-CPU for all {@link Execution executions} with the same
* {@link Execution#getFunction() function} on the same{@link Execution#getLifeline() executor.}
*/
private static final String CONF_ON_CPU = "On-CPU (On same executor)";

/**
* Data analysis of Wait-for-CPU for all {@link Execution executions} with the same
* {@link Execution#getFunction() function} on the same{@link Execution#getLifeline() executor.}
*/
private static final String CONF_WAIT_CPU = "Wait-for-CPU (On same executor)";

@Override
public Set<String> getConfigurations(final Object object) {
final Execution execution = ((Execution) object);
Set<String> _xifexpression = null;
boolean _hasCpuInfo = TmscCpuInfoQueries.hasCpuInfo(execution);
if (_hasCpuInfo) {
_xifexpression = CollectionLiterals.<String>newLinkedHashSet(ExecutionDataAnalysisItemContentProvider.CONF_ON_CPU, ExecutionDataAnalysisItemContentProvider.CONF_WAIT_CPU);
} else {
_xifexpression = Collections.<String>emptySet();
}
return _xifexpression;
}

@Override
public String getTitle(final Object object, final String configuration) {
final Execution execution = ((Execution) object);
String _switchResult = null;
if (configuration != null) {
switch (configuration) {
case ExecutionDataAnalysisItemContentProvider.CONF_ON_CPU:
StringConcatenation _builder = new StringConcatenation();
_builder.append("On-CPU for ");
String _name = execution.getFunction().getName();
_builder.append(_name);
_builder.append(" on ");
String _name_1 = execution.getLifeline().getExecutor().getName();
_builder.append(_name_1);
_switchResult = _builder.toString();
break;
case ExecutionDataAnalysisItemContentProvider.CONF_WAIT_CPU:
StringConcatenation _builder_1 = new StringConcatenation();
_builder_1.append("Wait-for-CPU for ");
String _name_2 = execution.getFunction().getName();
_builder_1.append(_name_2);
_builder_1.append(" on ");
String _name_3 = execution.getLifeline().getExecutor().getName();
_builder_1.append(_name_3);
_switchResult = _builder_1.toString();
break;
default:
StringConcatenation _builder_2 = new StringConcatenation();
_builder_2.append("Unsupported configuration: ");
_builder_2.append(configuration);
_switchResult = _builder_2.toString();
break;
}
} else {
StringConcatenation _builder_2 = new StringConcatenation();
_builder_2.append("Unsupported configuration: ");
_builder_2.append(configuration);
_switchResult = _builder_2.toString();
}
return _switchResult;
}

@Override
public Iterable<?> getSiblings(final Object object, final String configuration) {
final Execution execution = ((Execution) object);
return TmscQueries.findAllWithFunctionAndLifeline(execution);
}

@Override
public Long getDuration(final Object object, final Object sibling, final String configuration) {
final Execution execution = ((Execution) sibling);
long _switchResult = (long) 0;
if (configuration != null) {
switch (configuration) {
case ExecutionDataAnalysisItemContentProvider.CONF_ON_CPU:
_switchResult = TmscCpuInfoQueries.getOnCpuNanos(execution, true);
break;
case ExecutionDataAnalysisItemContentProvider.CONF_WAIT_CPU:
_switchResult = TmscCpuInfoQueries.getWaitCpuNanos(execution, true);
break;
default:
StringConcatenation _builder = new StringConcatenation();
_builder.append("Unsupported configuration: ");
_builder.append(configuration);
throw new IllegalArgumentException(_builder.toString());
}
} else {
StringConcatenation _builder = new StringConcatenation();
_builder.append("Unsupported configuration: ");
_builder.append(configuration);
throw new IllegalArgumentException(_builder.toString());
}
return Long.valueOf(_switchResult);
}
}
7 changes: 7 additions & 0 deletions plugins/nl.esi.pps.tmsc.cpu.editor/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?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-21"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
Loading