/* -*- mode: c; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; coding: utf-8 -*- */ /************************************************************************************ ** ** ** mcHF QRP Transceiver ** ** K Atanassov - M0NKA 2014 ** ** ** **---------------------------------------------------------------------------------** ** ** ** File name: ** ** Description: Simple Timing Profiler ** ** Last Modified: ** ** Licence: GNU GPLv3 ** ************************************************************************************/ #ifndef __PROFILING_H #define __PROFILING_H typedef enum { ProfileAudioInterrupt = 0, ProfileTP1, ProfileTP2, ProfileTP3, ProfileTP4, ProfileTP5, ProfileTP6, ProfileTP7, ProfileTP8, ProfileTP9, ProfileFreeDV, FreeDVTXUnderrun, EventProfileMax } ProfiledEventNames; typedef struct { uint32_t count; uint32_t start; uint32_t stop; uint64_t duration; // to get average divide duration by count } ProfilingTimedEvent; typedef struct { ProfilingTimedEvent event[EventProfileMax]; } EventProfile_t; extern EventProfile_t eventProfile; #define PROFILE_EVENTS inline void profileEvent(const ProfiledEventNames pe) { #ifdef PROFILE_EVENTS if (pe