From e2ca642f97e5c315e6072ad3964c4d013f5bc074 Mon Sep 17 00:00:00 2001 From: rusefillc Date: Sun, 4 Oct 2020 00:15:40 -0400 Subject: [PATCH] 60/2 perf grab #1850 --- firmware/console/binary/tooth_logger.cpp | 2 ++ firmware/controllers/trigger/trigger_central.cpp | 2 +- firmware/development/perf_trace.cpp | 2 ++ firmware/development/perf_trace.h | 3 ++- java_console/.gitignore | 3 ++- .../models/src/main/java/com/rusefi/tracing/EnumNames.java | 1 + .../models/src/main/java/com/rusefi/tracing/JsonOutput.java | 2 +- java_console/ui/src/main/java/com/rusefi/BenchTestPane.java | 2 +- 8 files changed, 12 insertions(+), 5 deletions(-) diff --git a/firmware/console/binary/tooth_logger.cpp b/firmware/console/binary/tooth_logger.cpp index e1acef8a3e..5827401562 100644 --- a/firmware/console/binary/tooth_logger.cpp +++ b/firmware/console/binary/tooth_logger.cpp @@ -8,6 +8,7 @@ #include "tooth_logger.h" #include "global.h" +#include "perf_trace.h" #if EFI_TOOTH_LOGGER @@ -97,6 +98,7 @@ static void SetNextCompositeEntry(efitick_t timestamp, bool trigger1, bool trigg } void LogTriggerTooth(trigger_event_e tooth, efitick_t timestamp DECLARE_ENGINE_PARAMETER_SUFFIX) { + ScopePerf perf(PE::LogTriggerTooth); // bail if we aren't enabled if (!ToothLoggerEnabled) { return; diff --git a/firmware/controllers/trigger/trigger_central.cpp b/firmware/controllers/trigger/trigger_central.cpp index 40743f16d5..b98947ba06 100644 --- a/firmware/controllers/trigger/trigger_central.cpp +++ b/firmware/controllers/trigger/trigger_central.cpp @@ -272,7 +272,7 @@ void hwHandleShaftSignal(trigger_event_e signal, efitick_t timestamp) { // We want to do this before anything else as we // actually want to capture any noise/jitter that may be occurring - bool logLogicState = CONFIG(displayLogicLevelsInEngineSniffer && engineConfiguration->useOnlyRisingEdgeForTrigger); + bool logLogicState = CONFIG(displayLogicLevelsInEngineSniffer) && CONFIG(useOnlyRisingEdgeForTrigger); if (!logLogicState) { // we log physical state even if displayLogicLevelsInEngineSniffer if both fronts are used by decoder diff --git a/firmware/development/perf_trace.cpp b/firmware/development/perf_trace.cpp index e92c3f04a4..350bc9ac11 100644 --- a/firmware/development/perf_trace.cpp +++ b/firmware/development/perf_trace.cpp @@ -1,6 +1,8 @@ /** * @file perf_trace.cpp * + * https://github.com/rusefi/rusefi/wiki/Developer-Performance-Tracing + * * See JsonOutput.java in rusEfi console */ diff --git a/firmware/development/perf_trace.h b/firmware/development/perf_trace.h index 1ae6a51359..d1bca96f34 100644 --- a/firmware/development/perf_trace.h +++ b/firmware/development/perf_trace.h @@ -12,7 +12,7 @@ // each element in PE more than once, as they should each indicate that a specific thing began, // ended, or occurred. enum class PE : uint8_t { - // The tag below is consumed by PerfTraceTool.java + // The tag below is consumed by PerfTraceTool.java which generates EnumNames.java // enum_start_tag INVALID, ISR, @@ -63,6 +63,7 @@ enum class PE : uint8_t { GlobalLock, GlobalUnlock, SoftwareKnockProcess, + LogTriggerTooth, // enum_end_tag // The tag above is consumed by PerfTraceTool.java // please note that the tool requires a comma at the end of last value diff --git a/java_console/.gitignore b/java_console/.gitignore index b4bc2f58fd..25d5c2abee 100644 --- a/java_console/.gitignore +++ b/java_console/.gitignore @@ -10,4 +10,5 @@ openocd DfuSe rusefi_*.* triggers -unit_test*.xml \ No newline at end of file +unit_test*.xml +*trace.json diff --git a/java_console/models/src/main/java/com/rusefi/tracing/EnumNames.java b/java_console/models/src/main/java/com/rusefi/tracing/EnumNames.java index 5129b02df8..71ad44516d 100644 --- a/java_console/models/src/main/java/com/rusefi/tracing/EnumNames.java +++ b/java_console/models/src/main/java/com/rusefi/tracing/EnumNames.java @@ -51,5 +51,6 @@ public class EnumNames { "GlobalLock", "GlobalUnlock", "SoftwareKnockProcess", + "LogTriggerTooth", }; } diff --git a/java_console/models/src/main/java/com/rusefi/tracing/JsonOutput.java b/java_console/models/src/main/java/com/rusefi/tracing/JsonOutput.java index e75808d50e..543b1a9d1f 100644 --- a/java_console/models/src/main/java/com/rusefi/tracing/JsonOutput.java +++ b/java_console/models/src/main/java/com/rusefi/tracing/JsonOutput.java @@ -12,7 +12,7 @@ import java.util.List; * This class helps to write JSON files readable by chrome://tracing/ *

* See https://github.com/catapult-project/catapult/blob/master/tracing/README.md - * @see PerfTraceTool + * @see PerfTraceTool code generator for EnumNames.java */ public class JsonOutput { diff --git a/java_console/ui/src/main/java/com/rusefi/BenchTestPane.java b/java_console/ui/src/main/java/com/rusefi/BenchTestPane.java index c8f007dac7..2abcd31d55 100644 --- a/java_console/ui/src/main/java/com/rusefi/BenchTestPane.java +++ b/java_console/ui/src/main/java/com/rusefi/BenchTestPane.java @@ -74,7 +74,7 @@ public class BenchTestPane { List data = Entry.parseBuffer(packet); int rpm = RpmModel.getInstance().getValue(); - String fileName = Logger.getDate() + "_rpm_" + rpm + "_rusEfi_trace" + ".json"; + String fileName = Logger.getDate() + "_rpm_" + rpm + "_rusEFI_trace" + ".json"; JsonOutput.writeToStream(data, new FileOutputStream(fileName));