1 /*---------------------------------------------------------------------------* 2 * srec_stats.h * 3 * * 4 * Copyright 2007, 2008 Nuance Communciations, Inc. * 5 * * 6 * Licensed under the Apache License, Version 2.0 (the 'License'); * 7 * you may not use this file except in compliance with the License. * 8 * * 9 * You may obtain a copy of the License at * 10 * http://www.apache.org/licenses/LICENSE-2.0 * 11 * * 12 * Unless required by applicable law or agreed to in writing, software * 13 * distributed under the License is distributed on an 'AS IS' BASIS, * 14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * 15 * See the License for the specific language governing permissions and * 16 * limitations under the License. * 17 * * 18 *---------------------------------------------------------------------------*/ 19 20 #ifndef __SREC_STATS_H__ 21 #define __SREC_STATS_H__ 22 23 #include "srec.h" 24 #include "astar.h" 25 #include "word_lattice.h" 26 27 /*--------------------------------------------------------------------------* 28 * * 29 * stats * 30 * * 31 *--------------------------------------------------------------------------*/ 32 33 #define SREC_STATS_ACTIVE 34 35 #ifndef SREC_STATS_ACTIVE 36 #define SREC_STATS_CLEAR() 37 #define SREC_STATS_SHOW() 38 #define SREC_STATS_UPDATE(REC) 39 #define SREC_STATS_UPDATE_ASTAR(AsTaR) 40 #define SREC_STATS_INC_STOKEN_REPRUNES(K) 41 #define SREC_STATS_INC_FTOKEN_REPRUNES(K) 42 #define SREC_STATS_INC_WTOKEN_REPRUNES(K) 43 44 #else 45 46 #define SREC_STATS_CLEAR() srec_stats_clear() 47 #if defined(__vxworks) && defined(NDEBUG) 48 #define SREC_STATS_SHOW() 49 #else 50 #define SREC_STATS_SHOW() srec_stats_show() 51 #endif 52 #define SREC_STATS_UPDATE(ReC) srec_stats_update(ReC,0) 53 #define SREC_STATS_UPDATE_ASTAR(AsTaR) srec_stats_update_astar(AsTaR) 54 #define SREC_STATS_INC_STOKEN_REPRUNES(K) srec_stats_inc_stoken_reprunes(K) 55 #define SREC_STATS_INC_FTOKEN_REPRUNES(K) srec_stats_inc_ftoken_reprunes(K) 56 #define SREC_STATS_INC_WTOKEN_REPRUNES(K) srec_stats_inc_wtoken_reprunes(K) 57 #define SREC_STATS_INC_AWTOKEN_REPRUNES(K) srec_stats_inc_awtoken_reprunes(K) 58 #define SREC_STATS_INC_BAD_BACKTRACES() srec_stats_inc_bad_backtraces() 59 #define SREC_STATS_INC_FORCED_UPDATES() srec_stats_inc_forced_updates() 60 61 void srec_stats_clear(void); 62 void srec_stats_show(void); 63 void srec_stats_update(srec* rec, char* msg); 64 void srec_stats_inc_stoken_reprunes(int n); 65 void srec_stats_inc_ftoken_reprunes(int n); 66 void srec_stats_inc_wtoken_reprunes(int n); 67 void srec_stats_inc_awtoken_reprunes(int n); 68 void srec_stats_update_astar(AstarStack* stack); 69 void srec_stats_inc_bad_backtraces(); 70 void srec_stats_inc_forced_updates(); 71 72 73 #endif 74 75 #endif 76