Changeset 5345:2e95587edd07 in roaraudio
- Timestamp:
- 12/10/11 00:24:27 (12 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- roard
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
roard/include/roard.h
r5279 r5345 227 227 228 228 229 #define counters_init() memset( &g_counters, 0, sizeof(g_counters))229 #define counters_init() memset(counters_getptr(), 0, sizeof(struct counters)) 230 230 //#define counters_inc(c,i) do { signed long int __i = (i); if ( __i < 0 && __i > (g_counters.cur.c) ) { ROAR_WARN("counters_inc(c=%s, i=%li): Decrement request bigger than current counter value. Counter out of syn!", ) } while (0) 231 #define counters_inc(c,i) do { signed long int __i = (i); g_counters.cur.c += __i; if ( __i > 0 ) g_counters.sum.c += __i; } while (0) 232 233 #define counters_get(g,c) ((g_counters.g.c)) 234 231 #define counters_inc(c,i) do { signed long int __i = (i); counters_getptr()->cur.c += __i; if ( __i > 0 ) counters_getptr()->sum.c += __i; } while (0) 232 233 #define counters_get(g,c) ((counters_getptr()->g.c)) 234 235 struct counters * counters_getptr(void); 235 236 void counters_print(int type, int force); 236 237 -
roard/roard.c
r5287 r5345 428 428 #endif 429 429 430 431 struct counters * counters_getptr(void) { 432 return &g_counters; 433 } 434 430 435 #define _pmsg(format, args...) roar_debug_msg(type, __LINE__, __FILE__, ROAR_DBG_PREFIX, format, ## args) 431 #define _pmsgc(group, counter, name) _pmsg(" Counter %-10s: %llu", (name), (long long unsigned int) counters_get(group,counter))436 #define _pmsgc(group, counter, name) _pmsg(" Counter %-10s: %llu", (name), (long long unsigned int)(counters->group.counter)) 432 437 void counters_print(int type, int force) { 438 struct counters * counters = counters_getptr(); 433 439 if ( type != ROAR_DEBUG_TYPE_INFO || force || (ROAR_DBG_INFOVAR) >= ROAR_DBG_INFO_INFO ) { 434 440 _pmsg("--- Counter Listing ---");
Note: See TracChangeset
for help on using the changeset viewer.