UDI/channels - Tracing of direction of calls
authorJohn Hodge <[email protected]>
Sun, 9 Feb 2014 01:57:18 +0000 (09:57 +0800)
committerJohn Hodge <[email protected]>
Sun, 9 Feb 2014 01:57:18 +0000 (09:57 +0800)
KernelLand/Modules/Interfaces/UDI/channels.c

index b386507..a3894bb 100644 (file)
  * TODO: This should actually lock the GCB, not the channel
  */
 #define LOCK_CHANNELS  0
+/*
+ * TRACE_ENDPOINTS
+ * - Emit a log message with names/indexes of both endpoints
+ */
+#define TRACE_ENDPOINTS        1
 
 #define MAX_SPAWN_IDX  6
 
@@ -195,6 +200,13 @@ const void *UDI_int_ChannelPrepForCall(udi_cb_t *gcb, tUDI_MetaLang *metalang, u
                }
        }
 
+       #if TRACE_ENDPOINTS
+       struct sUDI_ChannelSide *thisside = UDI_int_ChannelGetSide(gcb->channel, false);
+       Log("%s:%i -> %s:%i",
+               (thisside->Instance ? thisside->Instance->Module->ModuleName : "MA"), thisside->RegionIdx,
+               (newside->Instance ? newside->Instance->Module->ModuleName : "MA"), newside->RegionIdx);
+       #endif
+
        gcb->channel = (udi_channel_t)&newside->BackPtr;
        gcb->context = newside->Context;
        if( !newside->Ops ) {

UCC git Repository :: git.ucc.asn.au