Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Belle2019-09-01 22:20:54 +0000
committerJan Belle2019-09-01 22:42:53 +0000
commitbc4a294298a95dd99b2bcd608874ed1a7ac04040 (patch)
tree397551248a9dde39a032af1f4e862caba6c14895 /plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c
parenta7409264ceddf20eafe5e8e17d907d1d59edf6bc (diff)
downloadorg.eclipse.etrice-bc4a294298a95dd99b2bcd608874ed1a7ac04040.tar.gz
org.eclipse.etrice-bc4a294298a95dd99b2bcd608874ed1a7ac04040.tar.xz
org.eclipse.etrice-bc4a294298a95dd99b2bcd608874ed1a7ac04040.zip
[generator] Remove support for data logging
Diffstat (limited to 'plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c')
-rw-r--r--plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/Main.java8
-rw-r--r--plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/NodeGen.xtend114
-rw-r--r--plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/NodeRunnerGen.xtend10
3 files changed, 0 insertions, 132 deletions
diff --git a/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/Main.java b/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/Main.java
index 891517a98..bc6f643e3 100644
--- a/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/Main.java
+++ b/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/Main.java
@@ -28,7 +28,6 @@ import org.eclipse.etrice.generator.base.logging.Loglevel;
import org.eclipse.etrice.generator.c.gen.MainGen;
import org.eclipse.etrice.generator.c.gen.Validator;
import org.eclipse.etrice.generator.c.setup.GeneratorModule;
-import org.eclipse.etrice.generator.c.setup.GeneratorOptions;
import com.google.inject.Inject;
@@ -84,9 +83,6 @@ public class Main extends AbstractGenerator {
private MainGen mainGenerator;
@Inject
- protected org.eclipse.etrice.generator.gnuplot.GnuplotScriptGenerator gnuPlotGenerator;
-
- @Inject
private Validator validator;
@Inject
@@ -134,10 +130,6 @@ public class Main extends AbstractGenerator {
logger.logInfo("-- starting code generation");
mainGenerator.doGenerate(genModel.eResource());
- if(arguments.get(GeneratorOptions.DATA_INSTR)){
- gnuPlotGenerator.doGenerate(genModel);
- }
-
if (diagnostician.isFailed()) {
logger.logError("errors during code generation");
return GENERATOR_ERROR;
diff --git a/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/NodeGen.xtend b/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/NodeGen.xtend
index 7e7cf3e24..5d6f3fca7 100644
--- a/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/NodeGen.xtend
+++ b/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/NodeGen.xtend
@@ -21,7 +21,6 @@ import java.util.ArrayList
import java.util.Collection
import java.util.HashMap
import java.util.HashSet
-import org.eclipse.etrice.core.common.base.LiteralType
import org.eclipse.etrice.core.common.base.StringLiteral
import org.eclipse.etrice.core.common.converter.TimeConverter
import org.eclipse.etrice.core.etmap.util.ETMapUtil
@@ -34,15 +33,12 @@ import org.eclipse.etrice.core.genmodel.etricegen.PortInstance
import org.eclipse.etrice.core.genmodel.etricegen.Root
import org.eclipse.etrice.core.genmodel.etricegen.SubSystemInstance
import org.eclipse.etrice.core.room.CommunicationType
-import org.eclipse.etrice.core.room.EnumerationType
import org.eclipse.etrice.core.room.Port
-import org.eclipse.etrice.core.room.PrimitiveType
import org.eclipse.etrice.core.room.ProtocolClass
import org.eclipse.etrice.core.room.SAP
import org.eclipse.etrice.core.room.SPP
import org.eclipse.etrice.core.room.util.RoomHelpers
import org.eclipse.etrice.generator.base.io.IGeneratorFileIO
-import org.eclipse.etrice.generator.base.logging.ILogger
import org.eclipse.etrice.generator.c.Main
import org.eclipse.etrice.generator.c.setup.GeneratorOptionsHelper
import org.eclipse.etrice.generator.fsm.base.IntelligentSeparator
@@ -62,7 +58,6 @@ class NodeGen {
@Inject IGeneratorFileIO fileIO
@Inject Initialization attrInitGenAddon
- @Inject ILogger logger;
def doGenerate(Root root) {
for (nr : ETMapUtil::getNodeRefs()) {
@@ -139,7 +134,6 @@ class NodeGen {
val ssc = ssi.subSystemClass
val clsname = nr.name+"_"+ssi.name
val threads = nr.type.threads.filter(t|usedThreads.contains(t))
- val logData = Main::settings.generateDataInstrumentation && ssc.annotations.isAnnotationPresent("DataLogging")
'''
/**
* @author generated by eTrice
@@ -156,7 +150,6 @@ class NodeGen {
#include "debugging/etLogger.h"
#include "debugging/etMSCLogger.h"
- #include "debugging/etDataLogger.h"
#include "messaging/etSystemProtocol.h"
#include "osal/etTimer.h"
#include "osal/etSema.h"
@@ -252,15 +245,6 @@ class NodeGen {
/* init all actors */
«clsname»_initActorInstances();
- «IF logData»
- «FOR thread: threads»
- MsgDispatcher_«thread.name»_logDataHeaders();
- «ENDFOR»
- «FOR thread: threads»
- MsgDispatcher_«thread.name»_logData();
- «ENDFOR»
- «ENDIF»
-
ET_MSC_LOGGER_SYNC_EXIT
}
@@ -655,8 +639,6 @@ class NodeGen {
def private generateDispatcherFile(Root root, SubSystemInstance ssi, Collection<PhysicalThread> usedThreads) {
val nr = ETMapUtil::getNodeRef(ssi)
- val logData = Main::settings.generateDataInstrumentation && ssi.subSystemClass.annotations.isAnnotationPresent("DataLogging")
- val loggedPorts = if(logData) ssi.loggedPorts else newArrayList
'''
/**
@@ -686,19 +668,6 @@ class NodeGen {
«ENDFOR»
ET_MSC_LOGGER_SYNC_EXIT
}
- «IF logData»
- static void MsgDispatcher_«thread.name»_logDataHeaders(void){
- «FOR pi: loggedPorts»
- ET_DATA_LOGGER_LOG_STRING("«pi.path»")
- «ENDFOR»
- }
- static void MsgDispatcher_«thread.name»_logData(void){
- ET_DATA_LOGGER_NEW_ROW
- «FOR pi: loggedPorts»
- «pi.createLoggerCall»
- «ENDFOR»
- }
- «ENDIF»
«ENDIF»
/**
@@ -712,9 +681,6 @@ class NodeGen {
«IF !executedInstances.empty»
if (msg->evtID == etSystemProtocol_IN_poll) {
MsgDispatcher_«thread.name»_poll();
- «IF logData»
- MsgDispatcher_«thread.name»_logData();
- «ENDIF»
}
else
«ENDIF»
@@ -788,86 +754,6 @@ class NodeGen {
'''
}
- def private createLoggerCall(PortInstance pi) {
- val msg = pi.protocol.incomingMessages.filter(m|m.data!==null && m.data.refType.type.enumerationOrPrimitive).get(0)
- val ai = pi.eContainer as ActorInstance
- val data = ai.path.pathName+"."+pi.name+"."+msg.name
- val type = if (msg.data.refType.type instanceof EnumerationType) LiteralType.INT
- else (msg.data.refType.type as PrimitiveType).type
-
- switch (type) {
- case LiteralType.BOOL: "ET_DATA_LOGGER_LOG_BOOL((int)"+data+")"
- case LiteralType.CHAR: "ET_DATA_LOGGER_LOG_INT((int)"+data+")"
- case LiteralType.INT: "ET_DATA_LOGGER_LOG_INT((int)"+data+")"
- case LiteralType.REAL: "ET_DATA_LOGGER_LOG_DOUBLE((double)"+data+")"
- default: "internal error: unknown primitive type"
- }
- }
-
- def private loggedPorts(SubSystemInstance ssi) {
- val ArrayList<PortInstance> result = newArrayList
-
- if (ssi.subSystemClass.annotations.isAnnotationPresent("DataLogging")) {
- logger.logInfo("Data Logging is configured by annotation");
-
- val filters = ssi.subSystemClass.annotations.getAttribute("DataLogging", "pathlist")
- val filterList = filters.split(",")
- for (filter: filterList) {
- logger.logInfo(" filter: "+filter);
- }
-
- val ArrayList<String> notLogged = newArrayList
-
- logger.logInfo(" logged ports:");
- var iter = ssi.eAllContents
- while (iter.hasNext) {
- val obj = iter.next
- if (obj instanceof PortInstance) {
- val pi = obj
- if (!pi.port.relay) {
- // only data driven
- if (pi.protocol.commType==CommunicationType::DATA_DRIVEN) {
- // only send ports
- if (pi.port.conjugated) {
- val path = pi.path
- var boolean matched = false
- var primitive = false
- for (filter: filterList) {
- if (path.matches(filter)) {
- matched = true
- if (!pi.protocol.incomingMessages.filter(m|m.data!==null && m.data.refType.type.enumerationOrPrimitive).empty) {
- result.add(pi)
- primitive = true
- logger.logInfo(" data driven port "+pi.path+" (matched "+filter+")");
- }
- }
- }
- if (!primitive) {
- if (matched) {
- notLogged.add(" data driven port "+pi.path+" (matched but contains no primitive data)");
- }
- else {
- notLogged.add(" data driven port "+pi.path+" (no match found)");
- }
- }
- }
- else {
- notLogged.add(" data driven port "+pi.path+" (receive port)");
- }
- }
- }
- }
- }
-
- logger.logInfo(" NOT logged ports:");
- for (nl: notLogged) {
- logger.logInfo(nl);
- }
- }
-
- return result
- }
-
def private checkDataPorts(SubSystemInstance comp) {
val found = new HashSet<String>()
for (ai: comp.allContainedInstances) {
diff --git a/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/NodeRunnerGen.xtend b/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/NodeRunnerGen.xtend
index da14d915f..62986a4ff 100644
--- a/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/NodeRunnerGen.xtend
+++ b/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/NodeRunnerGen.xtend
@@ -21,7 +21,6 @@ import org.eclipse.etrice.core.genmodel.etricegen.Root
import org.eclipse.etrice.core.genmodel.etricegen.SubSystemInstance
import org.eclipse.etrice.generator.generic.RoomExtensions
import org.eclipse.etrice.core.etmap.util.ETMapUtil
-import org.eclipse.etrice.core.common.base.util.BaseHelpers
import org.eclipse.etrice.generator.c.Main
import org.eclipse.etrice.generator.c.setup.GeneratorOptionsHelper
import org.eclipse.etrice.generator.base.io.IGeneratorFileIO
@@ -29,7 +28,6 @@ import org.eclipse.etrice.generator.base.io.IGeneratorFileIO
@Singleton
class NodeRunnerGen {
- @Inject extension BaseHelpers
@Inject extension IGeneratorFileIO fileIO
@Inject extension CExtensions
@Inject extension RoomExtensions
@@ -54,7 +52,6 @@ class NodeRunnerGen {
def generateSourceFile(Root root, SubSystemInstance ssi, boolean first) {
val nr = ETMapUtil::getNodeRef(ssi)
val clsname = nr.name+"_"+ssi.name
- val logData = Main.getSettings.isGenerateDataInstrumentation && ssi.subSystemClass.annotations.isAnnotationPresent("DataLogging")
'''
/**
* @author generated by eTrice
@@ -69,7 +66,6 @@ class NodeRunnerGen {
#include "debugging/etLogger.h"
#include "debugging/etMSCLogger.h"
- #include "debugging/etDataLogger.h"
#include "osal/etPlatformLifecycle.h"
@@ -93,9 +89,6 @@ class NodeRunnerGen {
etLogger_logInfo("*** T H E B E G I N ***");
ET_MSC_LOGGER_OPEN("main");
- «IF logData»
- ET_DATA_LOGGER_OPEN("main");
- «ENDIF»
/* startup sequence of lifecycle */
«clsname»_init(); /* lifecycle init */
@@ -112,9 +105,6 @@ class NodeRunnerGen {
«clsname»_stop(); /* lifecycle stop */
«clsname»_destroy(); /* lifecycle destroy */
- «IF logData»
- ET_DATA_LOGGER_CLOSE
- «ENDIF»
ET_MSC_LOGGER_CLOSE
etLogger_logInfo("*** T H E E N D ***");

Back to the top