Remove old monitoring timestamps (#1217)

* remove monitoring timestamps

* adv map

* fuel calc

* map avg

* printing

* spark logic

* hip 9011

* new traces

* s

* missed a few
This commit is contained in:
Matthew Kennedy 2020-03-24 17:19:19 -07:00 committed by GitHub
parent 9e125ecbdf
commit 2c809e4475
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 8 additions and 69 deletions

View File

@ -84,8 +84,6 @@ static angle_t getRunningAdvance(int rpm, float engineLoad DECLARE_ENGINE_PARAME
}
efiAssert(CUSTOM_ERR_ASSERT, !cisnan(engineLoad), "invalid el", NAN);
engine->m.beforeZeroTest = getTimeNowLowerNt();
engine->m.zeroTestTime = getTimeNowLowerNt() - engine->m.beforeZeroTest;
float advanceAngle;
if (CONFIG(useTPSAdvanceTable)) {

View File

@ -225,8 +225,6 @@ void Engine::reset() {
*/
engineCycle = getEngineCycle(FOUR_STROKE_CRANK_SENSOR);
memset(&ignitionPin, 0, sizeof(ignitionPin));
memset(&m, 0, sizeof(m));
}
@ -488,11 +486,9 @@ void Engine::periodicFastCallback(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
engineState.periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE);
#if EFI_ENGINE_CONTROL
engine->m.beforeFuelCalc = getTimeNowLowerNt();
int rpm = GET_RPM();
ENGINE(injectionDuration) = getInjectionDuration(rpm PASS_ENGINE_PARAMETER_SUFFIX);
engine->m.fuelCalcTime = getTimeNowLowerNt() - engine->m.beforeFuelCalc;
#endif
}

View File

@ -322,8 +322,6 @@ public:
*/
bool isInShutdownMode() const;
monitoring_timestamps_s m;
void knockLogic(float knockVolts DECLARE_ENGINE_PARAMETER_SUFFIX);
void printKnockState(void);

View File

@ -105,35 +105,6 @@ public:
cyclic_buffer<int, 8> recentWarnings;
};
typedef struct {
uint32_t beforeMainTrigger;
uint32_t mainTriggerCallbackTime;
uint32_t beforeIgnitionSch;
uint32_t ignitionSchTime;
uint32_t beforeInjectonSch;
uint32_t injectonSchTime;
uint32_t beforeZeroTest;
uint32_t zeroTestTime;
uint32_t beforeAdvance;
uint32_t advanceLookupTime;
uint32_t beforeFuelCalc;
uint32_t fuelCalcTime;
uint32_t beforeMapAveragingCb;
uint32_t mapAveragingCbTime;
uint32_t beforeHipCb;
uint32_t hipCbTime;
uint32_t beforeRpmCb;
uint32_t rpmCbTime;
} monitoring_timestamps_s;
class FsioState {
public:
FsioState();

View File

@ -359,7 +359,6 @@ static void mainTriggerCallback(trigger_event_e ckpSignalType, uint32_t trgEvent
(void) ckpSignalType;
ENGINE(m.beforeMainTrigger) = getTimeNowLowerNt();
if (hasFirmwareError()) {
/**
* In case on a major error we should not process any more events.
@ -450,10 +449,6 @@ static void mainTriggerCallback(trigger_event_e ckpSignalType, uint32_t trgEvent
* For spark we schedule both start of coil charge and actual spark based on trigger angle
*/
onTriggerEventSparkLogic(limitedSpark, trgEventIndex, rpm, edgeTimestamp PASS_ENGINE_PARAMETER_SUFFIX);
if (trgEventIndex == 0) {
ENGINE(m.mainTriggerCallbackTime) = getTimeNowLowerNt() - ENGINE(m.beforeMainTrigger);
}
}
// Check if the engine is not stopped or cylinder cleanup is activated

View File

@ -273,7 +273,6 @@ static void mapAveragingTriggerCallback(trigger_event_e ckpEventType,
if (index != (uint32_t)CONFIG(mapAveragingSchedulingAtIndex))
return;
engine->m.beforeMapAveragingCb = getTimeNowLowerNt();
int rpm = GET_RPM_VALUE;
if (!isValidRpm(rpm)) {
return;
@ -317,8 +316,6 @@ static void mapAveragingTriggerCallback(trigger_event_e ckpEventType,
startAveraging PASS_ENGINE_PARAMETER_SUFFIX);
scheduleByAngle(&endTimer[i][structIndex], edgeTimestamp, samplingEnd,
endAveraging PASS_ENGINE_PARAMETER_SUFFIX);
engine->m.mapAveragingCbTime = getTimeNowLowerNt()
- engine->m.beforeMapAveragingCb;
}
#endif
}

View File

@ -233,8 +233,6 @@ void rpmShaftPositionCallback(trigger_event_e ckpSignalType,
RpmCalculator *rpmState = &engine->rpmCalculator;
if (index == 0) {
ENGINE(m.beforeRpmCb) = getTimeNowLowerNt();
bool hadRpmRecently = rpmState->checkIfSpinning(nowNt PASS_ENGINE_PARAMETER_SUFFIX);
if (hadRpmRecently) {
@ -256,7 +254,6 @@ void rpmShaftPositionCallback(trigger_event_e ckpSignalType,
}
rpmState->onNewEngineCycle();
rpmState->lastRpmEventTimeNt = nowNt;
ENGINE(m.rpmCbTime) = getTimeNowLowerNt() - ENGINE(m.beforeRpmCb);
}

View File

@ -376,8 +376,8 @@ void initializeIgnitionActions(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
}
static ALWAYS_INLINE void prepareIgnitionSchedule(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
engine->m.beforeIgnitionSch = getTimeNowLowerNt();
ScopePerf perf(PE::PrepareIgnitionSchedule);
/**
* TODO: warning. there is a bit of a hack here, todo: improve.
* currently output signals/times dwellStartTimer from the previous revolutions could be
@ -402,7 +402,6 @@ static ALWAYS_INLINE void prepareIgnitionSchedule(DECLARE_ENGINE_PARAMETER_SIGNA
// todo: add some check for dwell overflow? like 4 times 6 ms while engine cycle is less then that
initializeIgnitionActions(PASS_ENGINE_PARAMETER_SIGNATURE);
engine->m.ignitionSchTime = getTimeNowLowerNt() - engine->m.beforeIgnitionSch;
}

View File

@ -597,22 +597,7 @@ void triggerInfo(void) {
scheduleMsg(logger, "primary logic input: %s", hwPortname(CONFIG(logicAnalyzerPins)[0]));
scheduleMsg(logger, "secondary logic input: %s", hwPortname(CONFIG(logicAnalyzerPins)[1]));
scheduleMsg(logger, "zeroTestTime=%d maxSchedulingPrecisionLoss=%d", engine->m.zeroTestTime, maxSchedulingPrecisionLoss);
scheduleMsg(logger, "advanceLookupTime=%d now=%d fuelCalcTime=%d",
engine->m.advanceLookupTime, *cyccnt,
engine->m.fuelCalcTime);
scheduleMsg(logger,
"ignitionSchTime=%d injectonSchTime=%d",
engine->m.ignitionSchTime,
engine->m.injectonSchTime);
scheduleMsg(logger, "mapTime=%d/hipTime=%d/rpmTime=%d/mainTriggerCallbackTime=%d",
engine->m.mapAveragingCbTime,
engine->m.hipCbTime,
engine->m.rpmCbTime,
engine->m.mainTriggerCallbackTime);
scheduleMsg(logger, "maxSchedulingPrecisionLoss=%d", maxSchedulingPrecisionLoss);
#if EFI_CLOCK_LOCKS
scheduleMsg(logger, "maxLockedDuration=%d / maxTriggerReentraint=%d", maxLockedDuration, maxTriggerReentraint);

View File

@ -58,6 +58,8 @@ enum class PE : uint8_t {
Temporary3,
Temporary4,
EngineSniffer,
PrepareIgnitionSchedule,
Hip9011IntHoldCallback,
// 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

View File

@ -42,6 +42,7 @@
#include "hip9011_lookup.h"
#include "hip9011.h"
#include "adc_inputs.h"
#include "perf_trace.h"
#include "engine_controller.h"
@ -253,7 +254,8 @@ static void intHoldCallback(trigger_event_e ckpEventType, uint32_t index, efitic
// this callback is invoked on interrupt thread
if (index != 0)
return;
engine->m.beforeHipCb = getTimeNowLowerNt();
ScopePerf perf(PE::Hip9011IntHoldCallback);
int rpm = GET_RPM_VALUE;
if (!isValidRpm(rpm))
@ -268,7 +270,6 @@ static void intHoldCallback(trigger_event_e ckpEventType, uint32_t index, efitic
#endif /* EFI_PROD_CODE */
scheduleByAngle(&endTimer[structIndex], edgeTimestamp, engineConfiguration->knockDetectionWindowEnd,
&endIntegration);
engine->m.hipCbTime = getTimeNowLowerNt() - engine->m.beforeHipCb;
}
void setMaxKnockSubDeg(int value) {