From a628dc17b42b637a3fa8789d19fe4a602e8fc326 Mon Sep 17 00:00:00 2001 From: Ramsey Harris Date: Mon, 20 Jul 2015 15:54:22 -0700 Subject: [PATCH] Add log events to NameServer and NameMap Add attach and detach log events to NameServer (look in LAD log). NameMap runs on slave processor. Add log event for name announcement message sent to host processor. --- linux/src/daemon/NameServer_daemon.c | 11 +++++++++++ packages/ti/ipc/rpmsg/NameMap.c | 5 ++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/linux/src/daemon/NameServer_daemon.c b/linux/src/daemon/NameServer_daemon.c index 8d3643d..6ec0d81 100644 --- a/linux/src/daemon/NameServer_daemon.c +++ b/linux/src/daemon/NameServer_daemon.c @@ -1278,6 +1278,9 @@ Int NameServer_attach(UInt16 procId) /* procId already validated in API layer */ clId = procId - MultiProc_getBaseIdOfCluster(); + LOG2("NameServer_attach: --> procId=%d, refCount=%d\n", + procId, NameServer_module->comm[clId].refCount) + /* must reference count because we have multiple clients */ if (NameServer_module->comm[clId].refCount > 0) { NameServer_module->comm[clId].refCount++; @@ -1351,6 +1354,9 @@ done: } } + LOG2("NameServer_attach: <-- refCount=%d, status=%d\n", + NameServer_module->comm[clId].refCount, status) + return (status); } @@ -1368,6 +1374,9 @@ Int NameServer_detach(UInt16 procId) /* procId already validated in API layer */ clId = procId - MultiProc_getBaseIdOfCluster(); + LOG2("NameServer_detach: --> procId=%d, refCount=%d\n", + procId, NameServer_module->comm[clId].refCount) + /* decrement reference count regardless of outcome below */ if (--NameServer_module->comm[clId].refCount > 0) { goto done; @@ -1396,6 +1405,8 @@ Int NameServer_detach(UInt16 procId) close(recvSock); done: + LOG2("NameServer_detach: <-- refCount=%d, status=%d\n", + NameServer_module->comm[clId].refCount, status) return (status); } diff --git a/packages/ti/ipc/rpmsg/NameMap.c b/packages/ti/ipc/rpmsg/NameMap.c index fe3bce8..3bffbcc 100644 --- a/packages/ti/ipc/rpmsg/NameMap.c +++ b/packages/ti/ipc/rpmsg/NameMap.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2013, Texas Instruments Incorporated + * Copyright (c) 2011-2015 Texas Instruments Incorporated - http://www.ti.com * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -33,6 +33,8 @@ #include #include +#include +#include #include #include @@ -75,6 +77,7 @@ sendMessage(Char * name, UInt32 port, enum rpmsg_ns_flags flags) nsMsg.addr = port; nsMsg.flags = flags; + Log_print1(Diags_INFO, "NameMap_sendMessage: HOST 53, port=%d", port); s = RPMessage_send(MultiProc_getId("HOST"), 53, port, &nsMsg, sizeof(nsMsg)); if (s < 0) { -- 2.39.2