From 84e732846beaaecc4714ffdefa9151bbf963c63e Mon Sep 17 00:00:00 2001 From: rusefi Date: Mon, 23 Dec 2019 20:22:17 -0500 Subject: [PATCH] replacing probably unused engineSnifferHisto with new perf_trace --- .../engine_cycle/main_trigger_callback.cpp | 5 +--- firmware/development/engine_sniffer.cpp | 25 +++---------------- firmware/development/engine_sniffer.h | 1 - firmware/development/perf_trace.h | 1 + 4 files changed, 5 insertions(+), 27 deletions(-) diff --git a/firmware/controllers/engine_cycle/main_trigger_callback.cpp b/firmware/controllers/engine_cycle/main_trigger_callback.cpp index 11425eced0..3fb825c1c2 100644 --- a/firmware/controllers/engine_cycle/main_trigger_callback.cpp +++ b/firmware/controllers/engine_cycle/main_trigger_callback.cpp @@ -5,7 +5,7 @@ * See http://rusefi.com/docs/html/ * * @date Feb 7, 2013 - * @author Andrey Belomutskiy, (c) 2012-2018 + * @author Andrey Belomutskiy, (c) 2012-2019 * * This file is part of rusEfi - see http://rusefi.com * @@ -612,9 +612,6 @@ void updatePrimeInjectionPulseState(DECLARE_ENGINE_PARAMETER_SIGNATURE) { static void showTriggerHistogram(void) { printAllCallbacksHistogram(); showMainHistogram(); -#if EFI_ENGINE_SNIFFER - showWaveChartHistogram(); -#endif } static void showMainInfo(Engine *engine) { diff --git a/firmware/development/engine_sniffer.cpp b/firmware/development/engine_sniffer.cpp index ac894bd35a..32c7eba405 100644 --- a/firmware/development/engine_sniffer.cpp +++ b/firmware/development/engine_sniffer.cpp @@ -34,15 +34,10 @@ #include "engine_configuration.h" #include "eficonsole.h" #include "status_loop.h" +#include "perf_trace.h" #define CHART_DELIMETER '!' -#if EFI_HISTOGRAMS -#include "os_util.h" -#include "histogram.h" -static histogram_s engineSnifferHisto; -#endif /* EFI_HISTOGRAMS */ - EXTERN_ENGINE ; extern uint32_t maxLockedDuration; @@ -165,6 +160,8 @@ void WaveChart::publish() { * @brief Register an event for digital sniffer */ void WaveChart::addEvent3(const char *name, const char * msg) { + ScopePerf perf(PE::EngineSniffer); + if (getTimeNowNt() < pauseEngineSnifferUntilNt) { return; } @@ -195,9 +192,6 @@ void WaveChart::addEvent3(const char *name, const char * msg) { return; } -#if EFI_HISTOGRAMS && EFI_PROD_CODE - int beforeCallback = hal_lld_get_counter_value(); -#endif efitick_t nowNt = getTimeNowNt(); @@ -238,22 +232,9 @@ void WaveChart::addEvent3(const char *name, const char * msg) { if (!alreadyLocked) { unlockOutputBuffer(); } - -#if EFI_HISTOGRAMS && EFI_PROD_CODE - int64_t diff = hal_lld_get_counter_value() - beforeCallback; - if (diff > 0) { - hsAdd(&engineSnifferHisto, diff); - } -#endif /* EFI_HISTOGRAMS */ #endif /* EFI_TEXT_LOGGING */ } -void showWaveChartHistogram(void) { -#if EFI_HISTOGRAMS && EFI_PROD_CODE - printHistogram(&logger, &engineSnifferHisto); -#endif -} - void initWaveChart(WaveChart *chart) { /** * constructor does not work because we need specific initialization order diff --git a/firmware/development/engine_sniffer.h b/firmware/development/engine_sniffer.h index 7629cc30bb..4968a26404 100644 --- a/firmware/development/engine_sniffer.h +++ b/firmware/development/engine_sniffer.h @@ -44,7 +44,6 @@ private: }; void initWaveChart(WaveChart *chart); -void showWaveChartHistogram(void); void setChartSize(int newSize); #endif /* EFI_ENGINE_SNIFFER */ diff --git a/firmware/development/perf_trace.h b/firmware/development/perf_trace.h index 3e54b80818..98ca956ef0 100644 --- a/firmware/development/perf_trace.h +++ b/firmware/development/perf_trace.h @@ -57,6 +57,7 @@ enum class PE : uint8_t { Temporary2, Temporary3, Temporary4, + EngineSniffer, // 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