Changeset 102249 in vbox for trunk/src/libs/xpcom18a4/ipc/ipcd
- Timestamp:
- Nov 22, 2023 11:29:30 AM (14 months ago)
- 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 35 35 * 36 36 * ***** END LICENSE BLOCK ***** */ 37 37 #define LOG_GROUP LOG_GROUP_IPC 38 38 #include "ipcdclient.h" 39 39 #include "ipcConnection.h" … … 41 41 #include "ipcMessageQ.h" 42 42 #include "ipcMessageUtils.h" 43 #include "ipcLog.h"44 43 #include "ipcm.h" 45 44 … … 62 61 #include <iprt/process.h> 63 62 #include <iprt/string.h> 63 64 #include <VBox/log.h> 64 65 65 66 /* ------------------------------------------------------------------------- */ … … 280 281 NS_ASSERTION(aTarget.Equals(IPCM_TARGET) || msg->Target().Equals(IPCM_TARGET), 281 282 "unexpected target"); 282 L OG(("dropping IPCM message: type=%x\n", IPCM_GetType(msg)));283 Log(("dropping IPCM message: type=%x\n", IPCM_GetType(msg))); 283 284 } 284 285 tempQ.DeleteFirst(); … … 447 448 mon.Wait(timeEnd - t); 448 449 449 L OG(("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", 450 451 td->pendingQ.IsEmpty(), gClientState->connected, 451 452 gClientState->shutdown, isIPCMTarget)); … … 694 695 nsresult rv = MakeIPCMRequest(new ipcmMessageClientDelTarget(aTarget)); 695 696 if (NS_FAILED(rv)) 696 L OG(("failed to delete target: rv=%x\n", rv));697 Log(("failed to delete target: rv=%x\n", rv)); 697 698 } 698 699 } … … 720 721 if (NS_FAILED(rv)) 721 722 { 722 L OG(("failed to add target: rv=%x\n", rv));723 Log(("failed to add target: rv=%x\n", rv)); 723 724 RemoveTarget(aTarget, PR_FALSE); 724 725 return rv; … … 768 769 else 769 770 { 770 L OG(("unexpected response from CLIENT_HELLO message: type=%x!\n",771 Log(("unexpected response from CLIENT_HELLO message: type=%x!\n", 771 772 IPCM_GetType(msg))); 772 773 rv = NS_ERROR_UNEXPECTED; … … 781 782 { 782 783 NS_ENSURE_TRUE(!gClientState, NS_ERROR_ALREADY_INITIALIZED); 783 784 IPC_InitLog(">>>");785 784 786 785 gClientState = ipcClientState::Create(); … … 805 804 NS_ENSURE_TRUE(gClientState, NS_ERROR_NOT_INITIALIZED); 806 805 807 L OG(("IPC_Shutdown: connected=%d\n",gClientState->connected));806 Log(("IPC_Shutdown: connected=%d\n",gClientState->connected)); 808 807 809 808 if (gClientState->connected) … … 990 989 status->ClientState() == IPCM_CLIENT_STATE_DOWN) 991 990 { 992 L OG(("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", 993 992 status->ClientID(), data->senderID)); 994 993 … … 1024 1023 status->ClientState() == IPCM_CLIENT_STATE_UP) 1025 1024 { 1026 L OG(("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", 1027 1026 status->ClientID(), data->senderID)); 1028 1027 if (data->senderID == IPC_SENDER_ANY) … … 1195 1194 else 1196 1195 { 1197 L OG(("unexpected IPCM response: type=%x\n", IPCM_GetType(msg)));1196 Log(("unexpected IPCM response: type=%x\n", IPCM_GetType(msg))); 1198 1197 rv = NS_ERROR_UNEXPECTED; 1199 1198 } … … 1321 1320 td->pendingQ.Append(msg); 1322 1321 1323 #ifdef IPC_LOGGING 1324 if (IPC_LOG_ENABLED()) 1322 #ifdef LOG_ENABLED 1325 1323 { 1326 1324 char *targetStr = target.ToString(); 1327 L OG(("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)); 1328 1326 nsMemory::Free(targetStr); 1329 1327 } … … 1355 1353 /* ------------------------------------------------------------------------- */ 1356 1354 1357 #ifdef IPC_LOGGING1358 #include "prprf.h"1359 #include <ctype.h>1360 #endif1361 1362 1355 // called on a background thread 1363 1356 void 1364 1357 IPC_OnMessageAvailable(ipcMessage *msg) 1365 1358 { 1366 #ifdef IPC_LOGGING 1367 if (IPC_LOG_ENABLED()) 1359 #ifdef LOG_ENABLED 1368 1360 { 1369 1361 char *targetStr = msg->Target().ToString(); 1370 L OG(("got message for target: %s\n", targetStr));1362 Log(("got message for target: %s\n", targetStr)); 1371 1363 nsMemory::Free(targetStr); 1372 1364 -
trunk/src/libs/xpcom18a4/ipc/ipcd/daemon/src/ipcCommandModule.cpp
r101936 r102249 35 35 * 36 36 * ***** END LICENSE BLOCK ***** */ 37 37 #define LOG_GROUP LOG_GROUP_IPC 38 38 #include <stdlib.h> 39 39 #include <string.h> 40 #include "ipcLog.h"41 40 #include "ipcCommandModule.h" 42 41 #include "ipcClient.h" … … 46 45 #include "ipcm.h" 47 46 47 #include <VBox/log.h> 48 48 49 struct ipcCommandModule 49 50 { … … 104 105 OnPing(ipcClient *client, const ipcMessage *rawMsg) 105 106 { 106 L OG(("got PING\n"));107 Log(("got PING\n")); 107 108 108 109 IPC_SendMsg(client, new ipcmMessageResult(IPCM_GetRequestIndex(rawMsg), IPCM_OK)); … … 112 113 OnClientHello(ipcClient *client, const ipcMessage *rawMsg) 113 114 { 114 L OG(("got CLIENT_HELLO\n"));115 Log(("got CLIENT_HELLO\n")); 115 116 116 117 IPC_SendMsg(client, new ipcmMessageClientID(IPCM_GetRequestIndex(rawMsg), client->ID())); … … 129 130 OnClientAddName(ipcClient *client, const ipcMessage *rawMsg) 130 131 { 131 L OG(("got CLIENT_ADD_NAME\n"));132 Log(("got CLIENT_ADD_NAME\n")); 132 133 133 134 PRInt32 status = IPCM_OK; … … 139 140 ipcClient *result = IPC_GetClientByName(msg->Name()); 140 141 if (result) { 141 L OG((" client with such name already exists (ID = %d)\n", result->ID()));142 Log((" client with such name already exists (ID = %d)\n", result->ID())); 142 143 status = IPCM_ERROR_ALREADY_EXISTS; 143 144 } … … 154 155 OnClientDelName(ipcClient *client, const ipcMessage *rawMsg) 155 156 { 156 L OG(("got CLIENT_DEL_NAME\n"));157 Log(("got CLIENT_DEL_NAME\n")); 157 158 158 159 PRInt32 status = IPCM_OK; … … 163 164 if (name) { 164 165 if (!client->DelName(name)) { 165 L OG((" client doesn't have name '%s'\n", name));166 Log((" client doesn't have name '%s'\n", name)); 166 167 status = IPCM_ERROR_NO_SUCH_DATA; 167 168 } … … 176 177 OnClientAddTarget(ipcClient *client, const ipcMessage *rawMsg) 177 178 { 178 L OG(("got CLIENT_ADD_TARGET\n"));179 Log(("got CLIENT_ADD_TARGET\n")); 179 180 180 181 PRInt32 status = IPCM_OK; … … 183 184 ipcMessageCast<ipcmMessageClientAddTarget> msg(rawMsg); 184 185 if (client->HasTarget(msg->Target())) { 185 L OG((" target already defined for client\n"));186 Log((" target already defined for client\n")); 186 187 status = IPCM_ERROR_ALREADY_EXISTS; 187 188 } … … 195 196 OnClientDelTarget(ipcClient *client, const ipcMessage *rawMsg) 196 197 { 197 L OG(("got CLIENT_DEL_TARGET\n"));198 Log(("got CLIENT_DEL_TARGET\n")); 198 199 199 200 PRInt32 status = IPCM_OK; … … 202 203 ipcMessageCast<ipcmMessageClientDelTarget> msg(rawMsg); 203 204 if (!client->DelTarget(msg->Target())) { 204 L OG((" client doesn't have the given target\n"));205 Log((" client doesn't have the given target\n")); 205 206 status = IPCM_ERROR_NO_SUCH_DATA; 206 207 } … … 212 213 OnQueryClientByName(ipcClient *client, const ipcMessage *rawMsg) 213 214 { 214 L OG(("got QUERY_CLIENT_BY_NAME\n"));215 Log(("got QUERY_CLIENT_BY_NAME\n")); 215 216 216 217 PRUint32 requestIndex = IPCM_GetRequestIndex(rawMsg); … … 220 221 ipcClient *result = IPC_GetClientByName(msg->Name()); 221 222 if (result) { 222 L OG((" client exists w/ ID = %u\n", result->ID()));223 Log((" client exists w/ ID = %u\n", result->ID())); 223 224 IPC_SendMsg(client, new ipcmMessageClientID(requestIndex, result->ID())); 224 225 } 225 226 else { 226 L OG((" client does not exist\n"));227 Log((" client does not exist\n")); 227 228 IPC_SendMsg(client, new ipcmMessageResult(requestIndex, IPCM_ERROR_NO_CLIENT)); 228 229 } … … 233 234 OnQueryClientInfo(ipcClient *client, const ipcMessage *rawMsg) 234 235 { 235 L OG(("got QUERY_CLIENT_INFO\n"));236 Log(("got QUERY_CLIENT_INFO\n")); 236 237 237 238 ipcMessageCast<ipcmMessageQueryClientInfo> msg(rawMsg); … … 250 251 } 251 252 else { 252 L OG((" client does not exist\n"));253 Log((" client does not exist\n")); 253 254 IPC_SendMsg(client, new ipcmMessageError(IPCM_ERROR_NO_CLIENT, msg->RequestIndex())); 254 255 } … … 259 260 OnForward(ipcClient *client, const ipcMessage *rawMsg) 260 261 { 261 L OG(("got FORWARD\n"));262 Log(("got FORWARD\n")); 262 263 263 264 ipcMessageCast<ipcmMessageForward> msg(rawMsg); … … 265 266 ipcClient *dest = IPC_GetClientByID(msg->ClientID()); 266 267 if (!dest) { 267 L OG((" destination client not found!\n"));268 Log((" destination client not found!\n")); 268 269 IPC_SendMsg(client, new ipcmMessageResult(IPCM_GetRequestIndex(rawMsg), IPCM_ERROR_NO_CLIENT)); 269 270 return; … … 297 298 298 299 int type = IPCM_GetType(rawMsg); 299 L OG(("IPCM_HandleMsg [type=%x]\n", type));300 Log(("IPCM_HandleMsg [type=%x]\n", type)); 300 301 301 302 if (!(type & IPCM_MSG_CLASS_REQ)) { 302 L OG(("not a request -- ignoring message\n"));303 Log(("not a request -- ignoring message\n")); 303 304 return; 304 305 } … … 307 308 type--; 308 309 if (type < 0 || type >= (int) (sizeof(handlers)/sizeof(handlers[0]))) { 309 L OG(("unknown request -- ignoring message\n"));310 Log(("unknown request -- ignoring message\n")); 310 311 return; 311 312 } -
trunk/src/libs/xpcom18a4/ipc/ipcd/daemon/src/ipcd.cpp
r102197 r102249 35 35 * 36 36 * ***** END LICENSE BLOCK ***** */ 37 37 #define LOG_GROUP LOG_GROUP_IPC 38 38 #include "ipcConfig.h" 39 #include "ipcLog.h"40 39 #include "ipcMessage.h" 41 40 #include "ipcClient.h" -
trunk/src/libs/xpcom18a4/ipc/ipcd/extensions/dconnect/src/ipcDConnectService.cpp
r102015 r102249 36 36 * 37 37 * ***** END LICENSE BLOCK ***** */ 38 38 #define LOG_GROUP LOG_GROUP_IPC 39 39 #include "ipcDConnectService.h" 40 40 #include "ipcMessageWriter.h" 41 41 #include "ipcMessageReader.h" 42 #include "ipcLog.h"43 42 44 43 #include "nsIServiceManagerUtils.h" … … 61 60 # include <iprt/time.h> 62 61 # include <iprt/thread.h> 62 63 # include <VBox/log.h> 63 64 #endif /* VBOX */ 64 65 … … 452 453 case nsXPTType::T_PWSTRING_SIZE_IS: 453 454 default: 454 L OG(("unexpected parameter type: %d\n", t.TagPart()));455 Log(("unexpected parameter type: %d\n", t.TagPart())); 455 456 return NS_ERROR_UNEXPECTED; 456 457 } … … 609 610 case nsXPTType::T_PWSTRING_SIZE_IS: 610 611 default: 611 L OG(("unexpected parameter type\n"));612 Log(("unexpected parameter type\n")); 612 613 return NS_ERROR_UNEXPECTED; 613 614 } … … 646 647 647 648 default: 648 L OG(("unhandled dipper: type=%d\n", t.TagPart()));649 Log(("unhandled dipper: type=%d\n", t.TagPart())); 649 650 return NS_ERROR_UNEXPECTED; 650 651 } … … 855 856 case nsXPTType::T_PWSTRING_SIZE_IS: 856 857 default: 857 L OG(("unexpected parameter type\n"));858 Log(("unexpected parameter type\n")); 858 859 return NS_ERROR_UNEXPECTED; 859 860 } … … 903 904 if (pi.GetType().TagPart() != nsXPTType::T_U32) 904 905 { 905 L OG(("unexpected size_is() parameter type: $d\n",906 Log(("unexpected size_is() parameter type: $d\n", 906 907 pi.GetType().TagPart())); 907 908 return NS_ERROR_UNEXPECTED; … … 911 912 if (pi.GetType().TagPart() != nsXPTType::T_U32) 912 913 { 913 L OG(("unexpected length_is() parameter type: $d\n",914 Log(("unexpected length_is() parameter type: $d\n", 914 915 pi.GetType().TagPart())); 915 916 return NS_ERROR_UNEXPECTED; … … 943 944 elemType.IsReference())) 944 945 { 945 L OG(("arrays of pointers and references to arithmetic types are "946 Log(("arrays of pointers and references to arithmetic types are " 946 947 "not yet supported\n")); 947 948 return NS_ERROR_NOT_IMPLEMENTED; … … 950 951 if (elemType.IsArray()) 951 952 { 952 L OG(("multidimensional arrays are not yet supported\n"));953 Log(("multidimensional arrays are not yet supported\n")); 953 954 return NS_ERROR_NOT_IMPLEMENTED; 954 955 } … … 994 995 break; 995 996 default: 996 L OG(("unexpected parameter type: %d\n", type.TagPart()));997 Log(("unexpected parameter type: %d\n", type.TagPart())); 997 998 return NS_ERROR_UNEXPECTED; 998 999 } … … 1101 1102 if (prefix != 1) 1102 1103 { 1103 L OG(("unexpected array prefix: %u\n", prefix));1104 Log(("unexpected array prefix: %u\n", prefix)); 1104 1105 return NS_ERROR_UNEXPECTED; 1105 1106 } … … 1255 1256 break; 1256 1257 default: 1257 L OG(("unexpected parameter type: %d\n", elemType.TagPart()));1258 Log(("unexpected parameter type: %d\n", elemType.TagPart())); 1258 1259 return; 1259 1260 } … … 1387 1388 if (aSenderID == IPC_SENDER_ANY && aTarget.Equals(nsID()) && !aData && !aDataLen) 1388 1389 { 1389 L OG(("DConnectMsgSelector::OnMessageAvailable: poll liveness for mPeer=%d\n",1390 Log(("DConnectMsgSelector::OnMessageAvailable: poll liveness for mPeer=%d\n", 1390 1391 mPeer)); 1391 1392 ClientDownMap::iterator it = g_ClientDownMap.find(mPeer); … … 1432 1433 { 1433 1434 const DConnectOp *op = (const DConnectOp *) aData; 1434 L OG((1435 Log(( 1435 1436 "DConnectCompletion::OnMessageAvailable: " 1436 1437 "senderID=%d, opcode_major=%d, index=%d (waiting for %d)\n", … … 2236 2237 DConnectStub::~DConnectStub() 2237 2238 { 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)); 2246 2244 #endif 2247 2245 … … 2280 2278 2281 2279 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 2291 2286 2292 2287 // mRefCntLevels may already be empty here (due to the "stabilize" trick below) … … 2441 2436 // else, we need to query the peer object by making an IPC call 2442 2437 2443 #ifdef IPC_LOGGING 2444 if (IPC_LOG_ENABLED()) 2438 #ifdef LOG_ENABLED 2445 2439 { 2446 2440 const char *name; … … 2451 2445 if (iinfoQ) { 2452 2446 iinfoQ->GetNameShared(&nameQ); 2453 L OG(("calling QueryInterface {%s} on peer object "2447 Log(("calling QueryInterface {%s} on peer object " 2454 2448 "(stub=%p, instance=0x%Lx {%s})\n", 2455 2449 nameQ, this, mInstance, name)); … … 2494 2488 nsXPTCMiniVariant *aParams) 2495 2489 { 2496 L OG(("DConnectStub::CallMethod [methodIndex=%hu]\n", aMethodIndex));2490 Log(("DConnectStub::CallMethod [methodIndex=%hu]\n", aMethodIndex)); 2497 2491 2498 2492 nsresult rv; … … 2528 2522 PRUint8 i, paramCount = aInfo->GetParamCount(); 2529 2523 2530 #ifdef IPC_LOGGING 2531 if (IPC_LOG_ENABLED()) 2524 #ifdef LOG_ENABLED 2532 2525 { 2533 2526 const char *name; … … 2535 2528 GetInterfaceInfo(getter_AddRefs(iinfo)); 2536 2529 iinfo->GetNameShared(&name); 2537 L OG((" instance=0x%Lx {%s}\n", mInstance, name));2538 L OG((" name=%s\n", aInfo->GetName()));2539 L OG((" 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)); 2540 2533 } 2541 2534 #endif … … 2553 2546 invoke.method_index = aMethodIndex; 2554 2547 2555 L OG((" request-index=%d\n", (PRUint32) invoke.request_index));2548 Log((" request-index=%d\n", (PRUint32) invoke.request_index)); 2556 2549 2557 2550 writer.PutBytes(&invoke, sizeof(invoke)); … … 2629 2622 writer.GetBuffer(), 2630 2623 writer.GetSize()); 2631 L OG(("DConnectStub::CallMethod: IPC_SendMessage()=%08X\n", rv));2624 Log(("DConnectStub::CallMethod: IPC_SendMessage()=%08X\n", rv)); 2632 2625 if (NS_FAILED(rv)) 2633 2626 { … … 2650 2643 &completion.GetSelector(), &completion, 2651 2644 DCON_WAIT_TIMEOUT); 2652 L OG(("DConnectStub::CallMethod: IPC_WaitMessage()=%08X\n", rv));2645 Log(("DConnectStub::CallMethod: IPC_WaitMessage()=%08X\n", rv)); 2653 2646 if (NS_FAILED(rv)) 2654 2647 { … … 2723 2716 if (completion.Reply()->flags & DCON_OP_FLAGS_REPLY_EXCEPTION) 2724 2717 { 2725 L OG(("got nsIException instance, will create a stub\n"));2718 Log(("got nsIException instance, will create a stub\n")); 2726 2719 2727 2720 nsIException *xcpt = nsnull; … … 2767 2760 const DConnectSetupReply *reply = (const DConnectSetupReply *) op; 2768 2761 2769 L OG(("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)); 2770 2763 2771 2764 mStatus = reply->status; … … 2792 2785 ipcMessageReader reader(params, paramsLen); 2793 2786 2794 L OG(("got nsIException instance, will create a stub\n"));2787 Log(("got nsIException instance, will create a stub\n")); 2795 2788 2796 2789 nsresult rv; … … 2947 2940 DConnectWorker::Run() 2948 2941 { 2949 L OG(("DConnect Worker thread started.\n"));2942 Log(("DConnect Worker thread started.\n")); 2950 2943 2951 2944 mIsRunnable = PR_TRUE; … … 2978 2971 else 2979 2972 { 2980 L OG(("DConnect Worker thread got request.\n"));2973 Log(("DConnect Worker thread got request.\n")); 2981 2974 2982 2975 // remove the request from the queue … … 3002 2995 mIsRunnable = PR_FALSE; 3003 2996 3004 L OG(("DConnect Worker thread stopped.\n"));2997 Log(("DConnect Worker thread stopped.\n")); 3005 2998 return NS_OK; 3006 2999 } … … 3051 3044 // disregarding the reference counter 3052 3045 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)); 3061 3051 #endif 3062 3052 … … 3091 3081 nsresult rv; 3092 3082 3093 L OG(("ipcDConnectService::Init.\n"));3083 Log(("ipcDConnectService::Init.\n")); 3094 3084 3095 3085 rv = IPC_DefineTarget(kDConnectTargetID, this); … … 3172 3162 mInstance = this; 3173 3163 3174 L OG(("ipcDConnectService::Init NS_OK.\n"));3164 Log(("ipcDConnectService::Init NS_OK.\n")); 3175 3165 return NS_OK; 3176 3166 } … … 3221 3211 fprintf(stderr, "ipcDConnectService Stats\n"); 3222 3212 fprintf(stderr, " => number of worker threads: %d\n", mWorkers.Count()); 3223 L OG(("ipcDConnectService Stats\n"));3224 L OG((" => number of worker threads: %d\n", mWorkers.Count()));3213 Log(("ipcDConnectService Stats\n")); 3214 Log((" => number of worker threads: %d\n", mWorkers.Count())); 3225 3215 #endif 3226 3216 … … 3230 3220 // exited a working loop and abandon ones which have not 3231 3221 // managed to do that when timeout occurred. 3232 L OG(("Worker threads: %d\n", mWorkers.Count()));3222 Log(("Worker threads: %d\n", mWorkers.Count())); 3233 3223 uint64_t tsStart = RTTimeMilliTS(); 3234 3224 while ((tsStart + VBOX_XPCOM_SHUTDOWN_TIMEOUT_MS ) > RTTimeMilliTS() && mWorkers.Count() > 0) … … 3242 3232 if (worker->IsRunning() == PR_FALSE) 3243 3233 { 3244 L OG(("Worker %p joined.\n", worker));3234 Log(("Worker %p joined.\n", worker)); 3245 3235 worker->Join(); 3246 3236 delete worker; … … 3257 3247 } 3258 3248 3259 L OG(("There are %d thread(s) left.\n", mWorkers.Count()));3249 Log(("There are %d thread(s) left.\n", mWorkers.Count())); 3260 3250 3261 3251 // If there are some running threads left, terminate the process. … … 3333 3323 ipcDConnectService::StoreInstance(DConnectInstance *wrapper) 3334 3324 { 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)); 3343 3330 #endif 3344 3331 … … 3361 3348 RTSemFastMutexRequest(mLock); 3362 3349 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)); 3371 3355 #endif 3372 3356 … … 3406 3390 ipcDConnectService::StoreStub(DConnectStub *stub) 3407 3391 { 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)); 3418 3399 #endif 3419 3400 … … 3425 3406 ipcDConnectService::DeleteStub(DConnectStub *stub) 3426 3407 { 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)); 3437 3415 #endif 3438 3416 … … 3547 3525 const DConnectOp *op = (const DConnectOp *) aData; 3548 3526 3549 L OG(("ipcDConnectService::OnMessageAvailable: "3527 Log (("ipcDConnectService::OnMessageAvailable: " 3550 3528 "senderID=%d, opcode_major=%d, index=%d\n", 3551 3529 aSenderID, op->opcode_major, op->request_index)); … … 3623 3601 nsrefcnt countIPC = aData->ReleaseIPC(PR_TRUE /* locked */); 3624 3602 3625 L OG(("ipcDConnectService::PruneInstanceMapForPeer: "3603 Log(("ipcDConnectService::PruneInstanceMapForPeer: " 3626 3604 "instance=%p: %d IPC refs to release\n", 3627 3605 aData, countIPC + 1)); … … 3655 3633 PRUint32 aClientState) 3656 3634 { 3657 L OG(("ipcDConnectService::OnClientStateChange: aClientID=%d, aClientState=%d\n",3635 Log(("ipcDConnectService::OnClientStateChange: aClientID=%d, aClientState=%d\n", 3658 3636 aClientID, aClientState)); 3659 3637 … … 3668 3646 else 3669 3647 { 3670 L OG(("ipcDConnectService::OnClientStateChange: "3648 Log(("ipcDConnectService::OnClientStateChange: " 3671 3649 "pruning all instances created for peer %d...\n", aClientID)); 3672 3650 … … 3681 3659 } 3682 3660 3683 L OG(("ipcDConnectService::OnClientStateChange: "3661 Log(("ipcDConnectService::OnClientStateChange: " 3684 3662 "%d lost instances\n", wrappers.Count())); 3685 3663 … … 3893 3871 if (NS_SUCCEEDED(rv2)) 3894 3872 { 3895 L OG(("got nsIException instance, will serialize\n"));3873 Log(("got nsIException instance, will serialize\n")); 3896 3874 got_exception = PR_TRUE; 3897 3875 } … … 3934 3912 if (NS_FAILED(rv)) 3935 3913 { 3936 L OG(("unable to send SETUP_REPLY: rv=%x\n", rv));3914 Log(("unable to send SETUP_REPLY: rv=%x\n", rv)); 3937 3915 ReleaseWrappers(wrappers, peer); 3938 3916 } … … 3942 3920 ipcDConnectService::OnRelease(PRUint32 peer, const DConnectRelease *release) 3943 3921 { 3944 L OG(("ipcDConnectService::OnRelease [peer=%u instance=0x%Lx]\n",3922 Log(("ipcDConnectService::OnRelease [peer=%u instance=0x%Lx]\n", 3945 3923 peer, release->instance)); 3946 3924 … … 3969 3947 // client gets processed here (because of true multithreading). Just log 3970 3948 // a debug warning 3971 L OG(("ipcDConnectService::OnRelease: WARNING: "3949 Log(("ipcDConnectService::OnRelease: WARNING: " 3972 3950 "instance wrapper %p for peer %d not found", wrapper, peer)); 3973 3951 } … … 3977 3955 ipcDConnectService::OnInvoke(PRUint32 peer, const DConnectInvoke *invoke, PRUint32 opLen) 3978 3956 { 3979 L OG(("ipcDConnectService::OnInvoke [peer=%u instance=0x%Lx method=%u]\n",3957 Log(("ipcDConnectService::OnInvoke [peer=%u instance=0x%Lx method=%u]\n", 3980 3958 peer, invoke->instance, invoke->method_index)); 3981 3959 … … 4010 3988 paramCount = methodInfo->GetParamCount(); 4011 3989 4012 L OG((" iface=%p\n", wrapper->RealInstance()));4013 L OG((" name=%s\n", methodInfo->GetName()));4014 L OG((" param-count=%u\n", (PRUint32) paramCount));4015 L OG((" 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)); 4016 3994 4017 3995 params = new nsXPTCVariant[paramCount]; … … 4114 4092 if (NS_SUCCEEDED(rv2)) 4115 4093 { 4116 L OG(("got nsIException instance, will serialize\n"));4094 Log(("got nsIException instance, will serialize\n")); 4117 4095 got_exception = PR_TRUE; 4118 4096 } … … 4125 4103 4126 4104 end: 4127 L OG(("sending INVOKE_REPLY: rv=%x\n", rv));4105 Log(("sending INVOKE_REPLY: rv=%x\n", rv)); 4128 4106 4129 4107 // balance CheckInstanceAndAddRef() … … 4215 4193 if (NS_FAILED(rv)) 4216 4194 { 4217 L OG(("unable to send INVOKE_REPLY: rv=%x\n", rv));4195 Log(("unable to send INVOKE_REPLY: rv=%x\n", rv)); 4218 4196 ReleaseWrappers(wrappers, peer); 4219 4197 } -
trunk/src/libs/xpcom18a4/ipc/ipcd/extensions/lock/src/ipcLockService.cpp
r101959 r102249 37 37 * ***** END LICENSE BLOCK ***** */ 38 38 39 #define LOG_GROUP LOG_GROUP_IPC 39 40 #include <stdlib.h> 40 41 #include "nsDependentString.h" … … 43 44 #include "ipcLockService.h" 44 45 #include "ipcLockProtocol.h" 45 #include "ipcLog.h"46 46 47 47 #include <iprt/errcore.h> 48 #include <VBox/log.h> 49 48 50 49 51 static const nsID kLockTargetID = IPC_LOCK_TARGETID; … … 80 82 ipcLockService::AcquireLock(const char *lockName, PRBool waitIfBusy) 81 83 { 82 L OG(("ipcLockService::AcquireLock [lock=%s wait=%u]\n", lockName, waitIfBusy));84 LogFlowFunc(("ipcLockService::AcquireLock [lock=%s wait=%u]\n", lockName, waitIfBusy)); 83 85 84 86 ipcLockMsg msg; … … 123 125 ipcLockService::ReleaseLock(const char *lockName) 124 126 { 125 L OG(("ipcLockService::ReleaseLock [lock=%s]\n", lockName));127 LogFlowFunc(("ipcLockService::ReleaseLock [lock=%s]\n", lockName)); 126 128 127 129 ipcLockMsg msg; … … 152 154 IPC_UnflattenLockMsg(data, dataLen, &msg); 153 155 154 L OG(("ipcLockService::OnMessageAvailable [lock=%s opcode=%u]\n", msg.key, msg.opcode));156 LogFlowFunc(("ipcLockService::OnMessageAvailable [lock=%s opcode=%u]\n", msg.key, msg.opcode)); 155 157 156 158 ipcPendingLock *pendingLock = (ipcPendingLock *) RTTlsGet(mTPIndex); … … 164 166 } 165 167 166 L OG(("message does not match; waiting for another...\n"));168 LogFlowFunc(("message does not match; waiting for another...\n")); 167 169 168 170 // else, we got a message that another thread is waiting to receive. -
trunk/src/libs/xpcom18a4/ipc/ipcd/shared/src/ipcConfig.cpp
r101962 r102249 35 35 * 36 36 * ***** END LICENSE BLOCK ***** */ 37 #define LOG_GROUP LOG_GROUP_IPC 37 38 38 39 #if defined(XP_WIN) … … 46 47 #endif 47 48 #include "ipcConfig.h" 48 #include "ipcLog.h"49 49 #include "plstr.h" 50 50 51 51 #include <iprt/env.h> 52 #include <VBox/log.h> 52 53 53 54 #if defined(XP_OS2) && !defined(XP_OS2_NATIVEIPC) … … 89 90 logName = RTEnvGet("USER"); 90 91 if (!logName || !logName[0]) { 91 L OG(("could not determine username from environment\n"));92 Log(("could not determine username from environment\n")); 92 93 goto end; 93 94 }
Note:
See TracChangeset
for help on using the changeset viewer.