diff packages/kernel/current/src/instrmnt/meminst.cxx @ 460:a65a4055f146

* src/common/kapi.cxx: * include/kapi.h: Added function cyg_thread_get_next(), cyg_thread_find() and cyg_thread_get_info() to allow the current set of threads to be enumerated, and per-thread information to be retrieved safely. * doc/kernel.sgml: Documented new KAPI calls. * src/common/thread.cxx: Zero unique_id in thread destructor so that a stale thread pointer can be checked for validity. * include/instrmnt.h: Added cyg_instrument_state() to report the current state of an instrumentation flag. Moved ifdef for CYGDBG_KERNEL_INSTRUMENT_MSGS out of within FLAGS ifdef. We can have messages without flags. * src/instrmnt/meminst.cxx: Added cyg_instrument_state() to report the current state of an instrumentation flag. Modified cyg_instrument_msg() in line with header and table changes. * host/instr/dump_instr.c: * host/instr/instrument.sh: * include/instrument_desc.h: Added a final NULL element to the generated table in instrument_desc.h to mark its end. Otherwise code that does not have access to the table definition cannot find its end. Also added ifdefs to allow instrument_desc.h to be used to acquire the structure definition and table pointer.
author nickg
date Thu, 12 Dec 2002 18:31:34 +0000
parents d2c90368aeef
children 7f47e5d2fe20
line wrap: on
line diff
--- a/packages/kernel/current/src/instrmnt/meminst.cxx
+++ b/packages/kernel/current/src/instrmnt/meminst.cxx
@@ -214,11 +214,17 @@ externC void cyg_instrument_disable( cyg
 
 }
 
+externC cyg_bool cyg_instrument_state( cyg_uint32 cl, cyg_uint32 event)
+{
+    return (instrument_flags[cl>>8] & (1<<event)) != 0;
+}
+
 #endif
 
 // -------------------------------------------------------------------------
 
 #ifdef CYGDBG_KERNEL_INSTRUMENT_MSGS
+#define CYGDBG_KERNEL_INSTRUMENT_MSGS_DEFINE_TABLE
 #include <cyg/kernel/instrument_desc.h>
 #define NELEM(x) (sizeof(x)/sizeof*(x))
 externC char * cyg_instrument_msg(CYG_WORD16 type) {
@@ -228,7 +234,7 @@ externC char * cyg_instrument_msg(CYG_WO
   CYG_WORD cl, event;
 
   record = instrument_desc;
-  end_record = &instrument_desc[NELEM(instrument_desc)];
+  end_record = &instrument_desc[NELEM(instrument_desc)-1];
   cl = type & 0xff00;
   event = type & 0x00ff;