VirtualBox

Ignore:
Timestamp:
Nov 22, 2023 11:29:30 AM (14 months ago)
Author:
vboxsync
Message:

libs/xpcom/ipc: Get Convert IPC logging to use IPRT Log() macros directly, bugref:10545

Location:
trunk/src/libs/xpcom18a4/ipc/ipcd
Files:
2 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/libs/xpcom18a4/ipc/ipcd/client/src/ipcdclient.cpp

    r102197 r102249  
    3535 *
    3636 * ***** END LICENSE BLOCK ***** */
    37 
     37#define LOG_GROUP LOG_GROUP_IPC
    3838#include "ipcdclient.h"
    3939#include "ipcConnection.h"
     
    4141#include "ipcMessageQ.h"
    4242#include "ipcMessageUtils.h"
    43 #include "ipcLog.h"
    4443#include "ipcm.h"
    4544
     
    6261#include <iprt/process.h>
    6362#include <iprt/string.h>
     63
     64#include <VBox/log.h>
    6465
    6566/* ------------------------------------------------------------------------- */
     
    280281      NS_ASSERTION(aTarget.Equals(IPCM_TARGET) || msg->Target().Equals(IPCM_TARGET),
    281282                   "unexpected target");
    282       LOG(("dropping IPCM message: type=%x\n", IPCM_GetType(msg)));
     283      Log(("dropping IPCM message: type=%x\n", IPCM_GetType(msg)));
    283284    }
    284285    tempQ.DeleteFirst();
     
    447448    mon.Wait(timeEnd - t);
    448449
    449     LOG(("woke up from sleep [pendingQempty=%d connected=%d shutdown=%d isIPCMTarget=%d]\n",
     450    Log(("woke up from sleep [pendingQempty=%d connected=%d shutdown=%d isIPCMTarget=%d]\n",
    450451          td->pendingQ.IsEmpty(), gClientState->connected,
    451452          gClientState->shutdown, isIPCMTarget));
     
    694695    nsresult rv = MakeIPCMRequest(new ipcmMessageClientDelTarget(aTarget));
    695696    if (NS_FAILED(rv))
    696       LOG(("failed to delete target: rv=%x\n", rv));
     697      Log(("failed to delete target: rv=%x\n", rv));
    697698  }
    698699}
     
    720721    if (NS_FAILED(rv))
    721722    {
    722       LOG(("failed to add target: rv=%x\n", rv));
     723      Log(("failed to add target: rv=%x\n", rv));
    723724      RemoveTarget(aTarget, PR_FALSE);
    724725      return rv;
     
    768769  else
    769770  {
    770     LOG(("unexpected response from CLIENT_HELLO message: type=%x!\n",
     771    Log(("unexpected response from CLIENT_HELLO message: type=%x!\n",
    771772        IPCM_GetType(msg)));
    772773    rv = NS_ERROR_UNEXPECTED;
     
    781782{
    782783  NS_ENSURE_TRUE(!gClientState, NS_ERROR_ALREADY_INITIALIZED);
    783 
    784   IPC_InitLog(">>>");
    785784
    786785  gClientState = ipcClientState::Create();
     
    805804  NS_ENSURE_TRUE(gClientState, NS_ERROR_NOT_INITIALIZED);
    806805
    807   LOG(("IPC_Shutdown: connected=%d\n",gClientState->connected));
     806  Log(("IPC_Shutdown: connected=%d\n",gClientState->connected));
    808807
    809808  if (gClientState->connected)
     
    990989            status->ClientState() == IPCM_CLIENT_STATE_DOWN)
    991990        {
    992           LOG(("sender (%d) we're waiting a message from (%d) has died\n",
     991          Log(("sender (%d) we're waiting a message from (%d) has died\n",
    993992               status->ClientID(), data->senderID));
    994993
     
    10241023                 status->ClientState() == IPCM_CLIENT_STATE_UP)
    10251024        {
    1026           LOG(("sender (%d) we're waiting a message from (%d) has come up\n",
     1025          Log(("sender (%d) we're waiting a message from (%d) has come up\n",
    10271026               status->ClientID(), data->senderID));
    10281027          if (data->senderID == IPC_SENDER_ANY)
     
    11951194  else
    11961195  {
    1197     LOG(("unexpected IPCM response: type=%x\n", IPCM_GetType(msg)));
     1196    Log(("unexpected IPCM response: type=%x\n", IPCM_GetType(msg)));
    11981197    rv = NS_ERROR_UNEXPECTED;
    11991198  }
     
    13211320  td->pendingQ.Append(msg);
    13221321
    1323 #ifdef IPC_LOGGING
    1324   if (IPC_LOG_ENABLED())
     1322#ifdef LOG_ENABLED
    13251323  {
    13261324    char *targetStr = target.ToString();
    1327     LOG(("placed message on pending queue for target %s and notifying all...\n", targetStr));
     1325    Log(("placed message on pending queue for target %s and notifying all...\n", targetStr));
    13281326    nsMemory::Free(targetStr);
    13291327  }
     
    13551353/* ------------------------------------------------------------------------- */
    13561354
    1357 #ifdef IPC_LOGGING
    1358 #include "prprf.h"
    1359 #include <ctype.h>
    1360 #endif
    1361 
    13621355// called on a background thread
    13631356void
    13641357IPC_OnMessageAvailable(ipcMessage *msg)
    13651358{
    1366 #ifdef IPC_LOGGING
    1367   if (IPC_LOG_ENABLED())
     1359#ifdef LOG_ENABLED
    13681360  {
    13691361    char *targetStr = msg->Target().ToString();
    1370     LOG(("got message for target: %s\n", targetStr));
     1362    Log(("got message for target: %s\n", targetStr));
    13711363    nsMemory::Free(targetStr);
    13721364
  • trunk/src/libs/xpcom18a4/ipc/ipcd/daemon/src/ipcCommandModule.cpp

    r101936 r102249  
    3535 *
    3636 * ***** END LICENSE BLOCK ***** */
    37 
     37#define LOG_GROUP LOG_GROUP_IPC
    3838#include <stdlib.h>
    3939#include <string.h>
    40 #include "ipcLog.h"
    4140#include "ipcCommandModule.h"
    4241#include "ipcClient.h"
     
    4645#include "ipcm.h"
    4746
     47#include <VBox/log.h>
     48
    4849struct ipcCommandModule
    4950{
     
    104105    OnPing(ipcClient *client, const ipcMessage *rawMsg)
    105106    {
    106         LOG(("got PING\n"));
     107        Log(("got PING\n"));
    107108
    108109        IPC_SendMsg(client, new ipcmMessageResult(IPCM_GetRequestIndex(rawMsg), IPCM_OK));
     
    112113    OnClientHello(ipcClient *client, const ipcMessage *rawMsg)
    113114    {
    114         LOG(("got CLIENT_HELLO\n"));
     115        Log(("got CLIENT_HELLO\n"));
    115116
    116117        IPC_SendMsg(client, new ipcmMessageClientID(IPCM_GetRequestIndex(rawMsg), client->ID()));
     
    129130    OnClientAddName(ipcClient *client, const ipcMessage *rawMsg)
    130131    {
    131         LOG(("got CLIENT_ADD_NAME\n"));
     132        Log(("got CLIENT_ADD_NAME\n"));
    132133
    133134        PRInt32 status = IPCM_OK;
     
    139140            ipcClient *result = IPC_GetClientByName(msg->Name());
    140141            if (result) {
    141                 LOG(("  client with such name already exists (ID = %d)\n", result->ID()));
     142                Log(("  client with such name already exists (ID = %d)\n", result->ID()));
    142143                status = IPCM_ERROR_ALREADY_EXISTS;
    143144            }
     
    154155    OnClientDelName(ipcClient *client, const ipcMessage *rawMsg)
    155156    {
    156         LOG(("got CLIENT_DEL_NAME\n"));
     157        Log(("got CLIENT_DEL_NAME\n"));
    157158
    158159        PRInt32 status = IPCM_OK;
     
    163164        if (name) {
    164165            if (!client->DelName(name)) {
    165                 LOG(("  client doesn't have name '%s'\n", name));
     166                Log(("  client doesn't have name '%s'\n", name));
    166167                status = IPCM_ERROR_NO_SUCH_DATA;
    167168            }
     
    176177    OnClientAddTarget(ipcClient *client, const ipcMessage *rawMsg)
    177178    {
    178         LOG(("got CLIENT_ADD_TARGET\n"));
     179        Log(("got CLIENT_ADD_TARGET\n"));
    179180
    180181        PRInt32 status = IPCM_OK;
     
    183184        ipcMessageCast<ipcmMessageClientAddTarget> msg(rawMsg);
    184185        if (client->HasTarget(msg->Target())) {
    185             LOG(("  target already defined for client\n"));
     186            Log(("  target already defined for client\n"));
    186187            status = IPCM_ERROR_ALREADY_EXISTS;
    187188        }
     
    195196    OnClientDelTarget(ipcClient *client, const ipcMessage *rawMsg)
    196197    {
    197         LOG(("got CLIENT_DEL_TARGET\n"));
     198        Log(("got CLIENT_DEL_TARGET\n"));
    198199
    199200        PRInt32 status = IPCM_OK;
     
    202203        ipcMessageCast<ipcmMessageClientDelTarget> msg(rawMsg);
    203204        if (!client->DelTarget(msg->Target())) {
    204             LOG(("  client doesn't have the given target\n"));
     205            Log(("  client doesn't have the given target\n"));
    205206            status = IPCM_ERROR_NO_SUCH_DATA;
    206207        }
     
    212213    OnQueryClientByName(ipcClient *client, const ipcMessage *rawMsg)
    213214    {
    214         LOG(("got QUERY_CLIENT_BY_NAME\n"));
     215        Log(("got QUERY_CLIENT_BY_NAME\n"));
    215216
    216217        PRUint32 requestIndex = IPCM_GetRequestIndex(rawMsg);
     
    220221        ipcClient *result = IPC_GetClientByName(msg->Name());
    221222        if (result) {
    222             LOG(("  client exists w/ ID = %u\n", result->ID()));
     223            Log(("  client exists w/ ID = %u\n", result->ID()));
    223224            IPC_SendMsg(client, new ipcmMessageClientID(requestIndex, result->ID()));
    224225        }
    225226        else {
    226             LOG(("  client does not exist\n"));
     227            Log(("  client does not exist\n"));
    227228            IPC_SendMsg(client, new ipcmMessageResult(requestIndex, IPCM_ERROR_NO_CLIENT));
    228229        }
     
    233234    OnQueryClientInfo(ipcClient *client, const ipcMessage *rawMsg)
    234235    {
    235         LOG(("got QUERY_CLIENT_INFO\n"));
     236        Log(("got QUERY_CLIENT_INFO\n"));
    236237
    237238        ipcMessageCast<ipcmMessageQueryClientInfo> msg(rawMsg);
     
    250251        }
    251252        else {
    252             LOG(("  client does not exist\n"));
     253            Log(("  client does not exist\n"));
    253254            IPC_SendMsg(client, new ipcmMessageError(IPCM_ERROR_NO_CLIENT, msg->RequestIndex()));
    254255        }
     
    259260    OnForward(ipcClient *client, const ipcMessage *rawMsg)
    260261    {
    261         LOG(("got FORWARD\n"));
     262        Log(("got FORWARD\n"));
    262263
    263264        ipcMessageCast<ipcmMessageForward> msg(rawMsg);
     
    265266        ipcClient *dest = IPC_GetClientByID(msg->ClientID());
    266267        if (!dest) {
    267             LOG(("  destination client not found!\n"));
     268            Log(("  destination client not found!\n"));
    268269            IPC_SendMsg(client, new ipcmMessageResult(IPCM_GetRequestIndex(rawMsg), IPCM_ERROR_NO_CLIENT));
    269270            return;
     
    297298
    298299    int type = IPCM_GetType(rawMsg);
    299     LOG(("IPCM_HandleMsg [type=%x]\n", type));
     300    Log(("IPCM_HandleMsg [type=%x]\n", type));
    300301
    301302    if (!(type & IPCM_MSG_CLASS_REQ)) {
    302         LOG(("not a request -- ignoring message\n"));
     303        Log(("not a request -- ignoring message\n"));
    303304        return;
    304305    }
     
    307308    type--;
    308309    if (type < 0 || type >= (int) (sizeof(handlers)/sizeof(handlers[0]))) {
    309         LOG(("unknown request -- ignoring message\n"));
     310        Log(("unknown request -- ignoring message\n"));
    310311        return;
    311312    }
  • trunk/src/libs/xpcom18a4/ipc/ipcd/daemon/src/ipcd.cpp

    r102197 r102249  
    3535 *
    3636 * ***** END LICENSE BLOCK ***** */
    37 
     37#define LOG_GROUP LOG_GROUP_IPC
    3838#include "ipcConfig.h"
    39 #include "ipcLog.h"
    4039#include "ipcMessage.h"
    4140#include "ipcClient.h"
  • trunk/src/libs/xpcom18a4/ipc/ipcd/extensions/dconnect/src/ipcDConnectService.cpp

    r102015 r102249  
    3636 *
    3737 * ***** END LICENSE BLOCK ***** */
    38 
     38#define LOG_GROUP LOG_GROUP_IPC
    3939#include "ipcDConnectService.h"
    4040#include "ipcMessageWriter.h"
    4141#include "ipcMessageReader.h"
    42 #include "ipcLog.h"
    4342
    4443#include "nsIServiceManagerUtils.h"
     
    6160# include <iprt/time.h>
    6261# include <iprt/thread.h>
     62
     63# include <VBox/log.h>
    6364#endif /* VBOX */
    6465
     
    452453    case nsXPTType::T_PWSTRING_SIZE_IS:
    453454    default:
    454       LOG(("unexpected parameter type: %d\n", t.TagPart()));
     455      Log(("unexpected parameter type: %d\n", t.TagPart()));
    455456      return NS_ERROR_UNEXPECTED;
    456457  }
     
    609610    case nsXPTType::T_PWSTRING_SIZE_IS:
    610611    default:
    611       LOG(("unexpected parameter type\n"));
     612      Log(("unexpected parameter type\n"));
    612613      return NS_ERROR_UNEXPECTED;
    613614  }
     
    646647
    647648      default:
    648         LOG(("unhandled dipper: type=%d\n", t.TagPart()));
     649        Log(("unhandled dipper: type=%d\n", t.TagPart()));
    649650        return NS_ERROR_UNEXPECTED;
    650651    }
     
    855856    case nsXPTType::T_PWSTRING_SIZE_IS:
    856857    default:
    857       LOG(("unexpected parameter type\n"));
     858      Log(("unexpected parameter type\n"));
    858859      return NS_ERROR_UNEXPECTED;
    859860  }
     
    903904    if (pi.GetType().TagPart() != nsXPTType::T_U32)
    904905    {
    905       LOG(("unexpected size_is() parameter type: $d\n",
     906      Log(("unexpected size_is() parameter type: $d\n",
    906907           pi.GetType().TagPart()));
    907908      return NS_ERROR_UNEXPECTED;
     
    911912    if (pi.GetType().TagPart() != nsXPTType::T_U32)
    912913    {
    913       LOG(("unexpected length_is() parameter type: $d\n",
     914      Log(("unexpected length_is() parameter type: $d\n",
    914915           pi.GetType().TagPart()));
    915916      return NS_ERROR_UNEXPECTED;
     
    943944       elemType.IsReference()))
    944945  {
    945     LOG(("arrays of pointers and references to arithmetic types are "
     946    Log(("arrays of pointers and references to arithmetic types are "
    946947         "not yet supported\n"));
    947948    return NS_ERROR_NOT_IMPLEMENTED;
     
    950951  if (elemType.IsArray())
    951952  {
    952     LOG(("multidimensional arrays are not yet supported\n"));
     953    Log(("multidimensional arrays are not yet supported\n"));
    953954    return NS_ERROR_NOT_IMPLEMENTED;
    954955  }
     
    994995      break;
    995996    default:
    996       LOG(("unexpected parameter type: %d\n", type.TagPart()));
     997      Log(("unexpected parameter type: %d\n", type.TagPart()));
    997998      return NS_ERROR_UNEXPECTED;
    998999  }
     
    11011102  if (prefix != 1)
    11021103  {
    1103     LOG(("unexpected array prefix: %u\n", prefix));
     1104    Log(("unexpected array prefix: %u\n", prefix));
    11041105    return NS_ERROR_UNEXPECTED;
    11051106  }
     
    12551256        break;
    12561257      default:
    1257         LOG(("unexpected parameter type: %d\n", elemType.TagPart()));
     1258        Log(("unexpected parameter type: %d\n", elemType.TagPart()));
    12581259        return;
    12591260    }
     
    13871388    if (aSenderID == IPC_SENDER_ANY && aTarget.Equals(nsID()) && !aData && !aDataLen)
    13881389    {
    1389         LOG(("DConnectMsgSelector::OnMessageAvailable: poll liveness for mPeer=%d\n",
     1390        Log(("DConnectMsgSelector::OnMessageAvailable: poll liveness for mPeer=%d\n",
    13901391             mPeer));
    13911392        ClientDownMap::iterator it = g_ClientDownMap.find(mPeer);
     
    14321433  {
    14331434    const DConnectOp *op = (const DConnectOp *) aData;
    1434     LOG((
     1435    Log((
    14351436      "DConnectCompletion::OnMessageAvailable: "
    14361437      "senderID=%d, opcode_major=%d, index=%d (waiting for %d)\n",
     
    22362237DConnectStub::~DConnectStub()
    22372238{
    2238 #ifdef IPC_LOGGING
    2239   if (IPC_LOG_ENABLED())
    2240   {
    2241     const char *name = NULL;
    2242     mIInfo->GetNameShared(&name);
    2243     LOG(("{%p} DConnectStub::<dtor>(): peer=%d instance=0x%Lx {%s}\n",
    2244          this, mPeerID, mInstance, name));
    2245   }
     2239#ifdef LOG_ENABLED
     2240  const char *name = NULL;
     2241  mIInfo->GetNameShared(&name);
     2242  Log(("{%p} DConnectStub::<dtor>(): peer=%d instance=0x%Lx {%s}\n",
     2243       this, mPeerID, mInstance, name));
    22462244#endif
    22472245
     
    22802278
    22812279
    2282     #ifdef IPC_LOGGING
    2283     if (IPC_LOG_ENABLED())
    2284     {
    2285       const char *name;
    2286       mIInfo->GetNameShared(&name);
    2287       LOG(("{%p} DConnectStub::Release(): peer=%d instance=0x%Lx {%s}, new count=%d\n",
    2288           this, mPeerID, mInstance, name, count));
    2289     }
    2290     #endif
     2280#ifdef LOG_ENABLED
     2281    const char *name;
     2282    mIInfo->GetNameShared(&name);
     2283    Log(("{%p} DConnectStub::Release(): peer=%d instance=0x%Lx {%s}, new count=%d\n",
     2284        this, mPeerID, mInstance, name, count));
     2285#endif
    22912286
    22922287    // mRefCntLevels may already be empty here (due to the "stabilize" trick below)
     
    24412436  // else, we need to query the peer object by making an IPC call
    24422437
    2443 #ifdef IPC_LOGGING
    2444   if (IPC_LOG_ENABLED())
     2438#ifdef LOG_ENABLED
    24452439  {
    24462440    const char *name;
     
    24512445    if (iinfoQ) {
    24522446        iinfoQ->GetNameShared(&nameQ);
    2453         LOG(("calling QueryInterface {%s} on peer object "
     2447        Log(("calling QueryInterface {%s} on peer object "
    24542448             "(stub=%p, instance=0x%Lx {%s})\n",
    24552449             nameQ, this, mInstance, name));
     
    24942488                         nsXPTCMiniVariant *aParams)
    24952489{
    2496   LOG(("DConnectStub::CallMethod [methodIndex=%hu]\n", aMethodIndex));
     2490  Log(("DConnectStub::CallMethod [methodIndex=%hu]\n", aMethodIndex));
    24972491
    24982492  nsresult rv;
     
    25282522  PRUint8 i, paramCount = aInfo->GetParamCount();
    25292523
    2530 #ifdef IPC_LOGGING
    2531   if (IPC_LOG_ENABLED())
     2524#ifdef LOG_ENABLED
    25322525  {
    25332526    const char *name;
     
    25352528    GetInterfaceInfo(getter_AddRefs(iinfo));
    25362529    iinfo->GetNameShared(&name);
    2537     LOG(("  instance=0x%Lx {%s}\n", mInstance, name));
    2538     LOG(("  name=%s\n", aInfo->GetName()));
    2539     LOG(("  param-count=%u\n", (PRUint32) paramCount));
     2530    Log(("  instance=0x%Lx {%s}\n", mInstance, name));
     2531    Log(("  name=%s\n", aInfo->GetName()));
     2532    Log(("  param-count=%u\n", (PRUint32) paramCount));
    25402533  }
    25412534#endif
     
    25532546  invoke.method_index = aMethodIndex;
    25542547
    2555   LOG(("  request-index=%d\n", (PRUint32) invoke.request_index));
     2548  Log(("  request-index=%d\n", (PRUint32) invoke.request_index));
    25562549
    25572550  writer.PutBytes(&invoke, sizeof(invoke));
     
    26292622                       writer.GetBuffer(),
    26302623                       writer.GetSize());
    2631   LOG(("DConnectStub::CallMethod: IPC_SendMessage()=%08X\n", rv));
     2624  Log(("DConnectStub::CallMethod: IPC_SendMessage()=%08X\n", rv));
    26322625  if (NS_FAILED(rv))
    26332626  {
     
    26502643                         &completion.GetSelector(), &completion,
    26512644                         DCON_WAIT_TIMEOUT);
    2652     LOG(("DConnectStub::CallMethod: IPC_WaitMessage()=%08X\n", rv));
     2645    Log(("DConnectStub::CallMethod: IPC_WaitMessage()=%08X\n", rv));
    26532646    if (NS_FAILED(rv))
    26542647    {
     
    27232716  if (completion.Reply()->flags & DCON_OP_FLAGS_REPLY_EXCEPTION)
    27242717  {
    2725     LOG(("got nsIException instance, will create a stub\n"));
     2718    Log(("got nsIException instance, will create a stub\n"));
    27262719
    27272720    nsIException *xcpt = nsnull;
     
    27672760    const DConnectSetupReply *reply = (const DConnectSetupReply *) op;
    27682761
    2769     LOG(("got SETUP_REPLY: status=%x instance=0x%Lx\n", reply->status, reply->instance));
     2762    Log(("got SETUP_REPLY: status=%x instance=0x%Lx\n", reply->status, reply->instance));
    27702763
    27712764    mStatus = reply->status;
     
    27922785      ipcMessageReader reader(params, paramsLen);
    27932786
    2794       LOG(("got nsIException instance, will create a stub\n"));
     2787      Log(("got nsIException instance, will create a stub\n"));
    27952788
    27962789      nsresult rv;
     
    29472940DConnectWorker::Run()
    29482941{
    2949   LOG(("DConnect Worker thread started.\n"));
     2942  Log(("DConnect Worker thread started.\n"));
    29502943
    29512944  mIsRunnable = PR_TRUE;
     
    29782971    else
    29792972    {
    2980       LOG(("DConnect Worker thread got request.\n"));
     2973      Log(("DConnect Worker thread got request.\n"));
    29812974
    29822975      // remove the request from the queue
     
    30022995  mIsRunnable = PR_FALSE;
    30032996
    3004   LOG(("DConnect Worker thread stopped.\n"));
     2997  Log(("DConnect Worker thread stopped.\n"));
    30052998  return NS_OK;
    30062999}
     
    30513044  // disregarding the reference counter
    30523045
    3053 #ifdef IPC_LOGGING
    3054   if (IPC_LOG_ENABLED())
    3055   {
    3056     const char *name;
    3057     aData->InterfaceInfo()->GetNameShared(&name);
    3058     LOG(("ipcDConnectService: WARNING: deleting unreleased "
    3059          "instance=%p iface=%p {%s}\n", aData, aData->RealInstance(), name));
    3060   }
     3046#ifdef LOG_ENABLED
     3047  const char *name;
     3048  aData->InterfaceInfo()->GetNameShared(&name);
     3049  Log(("ipcDConnectService: WARNING: deleting unreleased "
     3050       "instance=%p iface=%p {%s}\n", aData, aData->RealInstance(), name));
    30613051#endif
    30623052
     
    30913081  nsresult rv;
    30923082
    3093   LOG(("ipcDConnectService::Init.\n"));
     3083  Log(("ipcDConnectService::Init.\n"));
    30943084
    30953085  rv = IPC_DefineTarget(kDConnectTargetID, this);
     
    31723162  mInstance = this;
    31733163
    3174   LOG(("ipcDConnectService::Init NS_OK.\n"));
     3164  Log(("ipcDConnectService::Init NS_OK.\n"));
    31753165  return NS_OK;
    31763166}
     
    32213211  fprintf(stderr, "ipcDConnectService Stats\n");
    32223212  fprintf(stderr, " => number of worker threads: %d\n", mWorkers.Count());
    3223   LOG(("ipcDConnectService Stats\n"));
    3224   LOG((" => number of worker threads: %d\n", mWorkers.Count()));
     3213  Log(("ipcDConnectService Stats\n"));
     3214  Log((" => number of worker threads: %d\n", mWorkers.Count()));
    32253215#endif
    32263216
     
    32303220  // exited a working loop and abandon ones which have not
    32313221  // managed to do that when timeout occurred.
    3232   LOG(("Worker threads: %d\n", mWorkers.Count()));
     3222  Log(("Worker threads: %d\n", mWorkers.Count()));
    32333223  uint64_t tsStart = RTTimeMilliTS();
    32343224  while ((tsStart + VBOX_XPCOM_SHUTDOWN_TIMEOUT_MS ) > RTTimeMilliTS() && mWorkers.Count() > 0)
     
    32423232      if (worker->IsRunning() == PR_FALSE)
    32433233      {
    3244         LOG(("Worker %p joined.\n", worker));
     3234        Log(("Worker %p joined.\n", worker));
    32453235        worker->Join();
    32463236        delete worker;
     
    32573247  }
    32583248
    3259   LOG(("There are %d thread(s) left.\n", mWorkers.Count()));
     3249  Log(("There are %d thread(s) left.\n", mWorkers.Count()));
    32603250
    32613251  // If there are some running threads left, terminate the process.
     
    33333323ipcDConnectService::StoreInstance(DConnectInstance *wrapper)
    33343324{
    3335 #ifdef IPC_LOGGING
    3336   if (IPC_LOG_ENABLED())
    3337   {
    3338     const char *name;
    3339     wrapper->InterfaceInfo()->GetNameShared(&name);
    3340     LOG(("ipcDConnectService::StoreInstance(): instance=%p iface=%p {%s}\n",
    3341          wrapper, wrapper->RealInstance(), name));
    3342   }
     3325#ifdef LOG_ENABLED
     3326  const char *name;
     3327  wrapper->InterfaceInfo()->GetNameShared(&name);
     3328  Log(("ipcDConnectService::StoreInstance(): instance=%p iface=%p {%s}\n",
     3329       wrapper, wrapper->RealInstance(), name));
    33433330#endif
    33443331
     
    33613348    RTSemFastMutexRequest(mLock);
    33623349
    3363 #ifdef IPC_LOGGING
    3364   if (IPC_LOG_ENABLED())
    3365   {
    3366     const char *name;
    3367     wrapper->InterfaceInfo()->GetNameShared(&name);
    3368     LOG(("ipcDConnectService::DeleteInstance(): instance=%p iface=%p {%s}\n",
    3369          wrapper, wrapper->RealInstance(), name));
    3370   }
     3350#ifdef LOG_ENABLED
     3351  const char *name;
     3352  wrapper->InterfaceInfo()->GetNameShared(&name);
     3353  Log(("ipcDConnectService::DeleteInstance(): instance=%p iface=%p {%s}\n",
     3354       wrapper, wrapper->RealInstance(), name));
    33713355#endif
    33723356
     
    34063390ipcDConnectService::StoreStub(DConnectStub *stub)
    34073391{
    3408 #ifdef IPC_LOGGING
    3409   if (IPC_LOG_ENABLED())
    3410   {
    3411     const char *name;
    3412     nsCOMPtr<nsIInterfaceInfo> iinfo;
    3413     stub->GetInterfaceInfo(getter_AddRefs(iinfo));
    3414     iinfo->GetNameShared(&name);
    3415     LOG(("ipcDConnectService::StoreStub(): stub=%p instance=0x%Lx {%s}\n",
    3416          stub, stub->Instance(), name));
    3417   }
     3392#ifdef LOG_ENABLED
     3393  const char *name;
     3394  nsCOMPtr<nsIInterfaceInfo> iinfo;
     3395  stub->GetInterfaceInfo(getter_AddRefs(iinfo));
     3396  iinfo->GetNameShared(&name);
     3397  Log(("ipcDConnectService::StoreStub(): stub=%p instance=0x%Lx {%s}\n",
     3398       stub, stub->Instance(), name));
    34183399#endif
    34193400
     
    34253406ipcDConnectService::DeleteStub(DConnectStub *stub)
    34263407{
    3427 #ifdef IPC_LOGGING
    3428   if (IPC_LOG_ENABLED())
    3429   {
    3430     const char *name;
    3431     nsCOMPtr<nsIInterfaceInfo> iinfo;
    3432     stub->GetInterfaceInfo(getter_AddRefs(iinfo));
    3433     iinfo->GetNameShared(&name);
    3434     LOG(("ipcDConnectService::DeleteStub(): stub=%p instance=0x%Lx {%s}\n",
    3435          stub, stub->Instance(), name));
    3436   }
     3408#ifdef LOG_ENABLED
     3409  const char *name;
     3410  nsCOMPtr<nsIInterfaceInfo> iinfo;
     3411  stub->GetInterfaceInfo(getter_AddRefs(iinfo));
     3412  iinfo->GetNameShared(&name);
     3413  Log(("ipcDConnectService::DeleteStub(): stub=%p instance=0x%Lx {%s}\n",
     3414       stub, stub->Instance(), name));
    34373415#endif
    34383416
     
    35473525  const DConnectOp *op = (const DConnectOp *) aData;
    35483526
    3549   LOG (("ipcDConnectService::OnMessageAvailable: "
     3527  Log (("ipcDConnectService::OnMessageAvailable: "
    35503528        "senderID=%d, opcode_major=%d, index=%d\n",
    35513529        aSenderID, op->opcode_major, op->request_index));
     
    36233601    nsrefcnt countIPC = aData->ReleaseIPC(PR_TRUE /* locked */);
    36243602
    3625     LOG(("ipcDConnectService::PruneInstanceMapForPeer: "
     3603    Log(("ipcDConnectService::PruneInstanceMapForPeer: "
    36263604         "instance=%p: %d IPC refs to release\n",
    36273605         aData, countIPC + 1));
     
    36553633                                        PRUint32 aClientState)
    36563634{
    3657   LOG(("ipcDConnectService::OnClientStateChange: aClientID=%d, aClientState=%d\n",
     3635  Log(("ipcDConnectService::OnClientStateChange: aClientID=%d, aClientState=%d\n",
    36583636       aClientID, aClientState));
    36593637
     
    36683646    else
    36693647    {
    3670       LOG(("ipcDConnectService::OnClientStateChange: "
     3648      Log(("ipcDConnectService::OnClientStateChange: "
    36713649           "pruning all instances created for peer %d...\n", aClientID));
    36723650
     
    36813659      }
    36823660
    3683       LOG(("ipcDConnectService::OnClientStateChange: "
     3661      Log(("ipcDConnectService::OnClientStateChange: "
    36843662           "%d lost instances\n", wrappers.Count()));
    36853663
     
    38933871        if (NS_SUCCEEDED(rv2))
    38943872        {
    3895           LOG(("got nsIException instance, will serialize\n"));
     3873          Log(("got nsIException instance, will serialize\n"));
    38963874          got_exception = PR_TRUE;
    38973875        }
     
    39343912  if (NS_FAILED(rv))
    39353913  {
    3936     LOG(("unable to send SETUP_REPLY: rv=%x\n", rv));
     3914    Log(("unable to send SETUP_REPLY: rv=%x\n", rv));
    39373915    ReleaseWrappers(wrappers, peer);
    39383916  }
     
    39423920ipcDConnectService::OnRelease(PRUint32 peer, const DConnectRelease *release)
    39433921{
    3944   LOG(("ipcDConnectService::OnRelease [peer=%u instance=0x%Lx]\n",
     3922  Log(("ipcDConnectService::OnRelease [peer=%u instance=0x%Lx]\n",
    39453923       peer, release->instance));
    39463924
     
    39693947    // client gets processed here (because of true multithreading). Just log
    39703948    // a debug warning
    3971     LOG(("ipcDConnectService::OnRelease: WARNING: "
     3949    Log(("ipcDConnectService::OnRelease: WARNING: "
    39723950         "instance wrapper %p for peer %d not found", wrapper, peer));
    39733951  }
     
    39773955ipcDConnectService::OnInvoke(PRUint32 peer, const DConnectInvoke *invoke, PRUint32 opLen)
    39783956{
    3979   LOG(("ipcDConnectService::OnInvoke [peer=%u instance=0x%Lx method=%u]\n",
     3957  Log(("ipcDConnectService::OnInvoke [peer=%u instance=0x%Lx method=%u]\n",
    39803958      peer, invoke->instance, invoke->method_index));
    39813959
     
    40103988  paramCount = methodInfo->GetParamCount();
    40113989
    4012   LOG(("  iface=%p\n", wrapper->RealInstance()));
    4013   LOG(("  name=%s\n", methodInfo->GetName()));
    4014   LOG(("  param-count=%u\n", (PRUint32) paramCount));
    4015   LOG(("  request-index=%d\n", (PRUint32) invoke->request_index));
     3990  Log(("  iface=%p\n", wrapper->RealInstance()));
     3991  Log(("  name=%s\n", methodInfo->GetName()));
     3992  Log(("  param-count=%u\n", (PRUint32) paramCount));
     3993  Log(("  request-index=%d\n", (PRUint32) invoke->request_index));
    40163994
    40173995  params = new nsXPTCVariant[paramCount];
     
    41144092        if (NS_SUCCEEDED(rv2))
    41154093        {
    4116           LOG(("got nsIException instance, will serialize\n"));
     4094          Log(("got nsIException instance, will serialize\n"));
    41174095          got_exception = PR_TRUE;
    41184096        }
     
    41254103
    41264104end:
    4127   LOG(("sending INVOKE_REPLY: rv=%x\n", rv));
     4105  Log(("sending INVOKE_REPLY: rv=%x\n", rv));
    41284106
    41294107  // balance CheckInstanceAndAddRef()
     
    42154193  if (NS_FAILED(rv))
    42164194  {
    4217     LOG(("unable to send INVOKE_REPLY: rv=%x\n", rv));
     4195    Log(("unable to send INVOKE_REPLY: rv=%x\n", rv));
    42184196    ReleaseWrappers(wrappers, peer);
    42194197  }
  • trunk/src/libs/xpcom18a4/ipc/ipcd/extensions/lock/src/ipcLockService.cpp

    r101959 r102249  
    3737 * ***** END LICENSE BLOCK ***** */
    3838
     39#define LOG_GROUP LOG_GROUP_IPC
    3940#include <stdlib.h>
    4041#include "nsDependentString.h"
     
    4344#include "ipcLockService.h"
    4445#include "ipcLockProtocol.h"
    45 #include "ipcLog.h"
    4646
    4747#include <iprt/errcore.h>
     48#include <VBox/log.h>
     49
    4850
    4951static const nsID kLockTargetID = IPC_LOCK_TARGETID;
     
    8082ipcLockService::AcquireLock(const char *lockName, PRBool waitIfBusy)
    8183{
    82     LOG(("ipcLockService::AcquireLock [lock=%s wait=%u]\n", lockName, waitIfBusy));
     84    LogFlowFunc(("ipcLockService::AcquireLock [lock=%s wait=%u]\n", lockName, waitIfBusy));
    8385
    8486    ipcLockMsg msg;
     
    123125ipcLockService::ReleaseLock(const char *lockName)
    124126{
    125     LOG(("ipcLockService::ReleaseLock [lock=%s]\n", lockName));
     127    LogFlowFunc(("ipcLockService::ReleaseLock [lock=%s]\n", lockName));
    126128
    127129    ipcLockMsg msg;
     
    152154    IPC_UnflattenLockMsg(data, dataLen, &msg);
    153155
    154     LOG(("ipcLockService::OnMessageAvailable [lock=%s opcode=%u]\n", msg.key, msg.opcode));
     156    LogFlowFunc(("ipcLockService::OnMessageAvailable [lock=%s opcode=%u]\n", msg.key, msg.opcode));
    155157
    156158    ipcPendingLock *pendingLock = (ipcPendingLock *) RTTlsGet(mTPIndex);
     
    164166    }
    165167
    166     LOG(("message does not match; waiting for another...\n"));
     168    LogFlowFunc(("message does not match; waiting for another...\n"));
    167169
    168170    // else, we got a message that another thread is waiting to receive.
  • trunk/src/libs/xpcom18a4/ipc/ipcd/shared/src/ipcConfig.cpp

    r101962 r102249  
    3535 *
    3636 * ***** END LICENSE BLOCK ***** */
     37#define LOG_GROUP LOG_GROUP_IPC
    3738
    3839#if defined(XP_WIN)
     
    4647#endif
    4748#include "ipcConfig.h"
    48 #include "ipcLog.h"
    4949#include "plstr.h"
    5050
    5151#include <iprt/env.h>
     52#include <VBox/log.h>
    5253
    5354#if defined(XP_OS2) && !defined(XP_OS2_NATIVEIPC)
     
    8990            logName = RTEnvGet("USER");
    9091            if (!logName || !logName[0]) {
    91                 LOG(("could not determine username from environment\n"));
     92                Log(("could not determine username from environment\n"));
    9293                goto end;
    9394            }
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette