VirtualBox

Ignore:
Timestamp:
Nov 15, 2011 2:43:38 PM (13 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
74874
Message:

VBoxService: Logging adjustments.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControlExecThread.cpp

    r39300 r39313  
    164164    AssertPtrReturn(pThread, VERR_INVALID_POINTER);
    165165
    166     VBoxServiceVerbose(3, "ControlExec: [PID %u]: Signalling shutdown ...\n",
     166    VBoxServiceVerbose(3, "ControlThead: [PID %u]: Signalling shutdown ...\n",
    167167                       pThread->uPID);
    168168
     
    176176    int rc = VBoxServiceControlThreadPerform(pThread->uPID, &ctrlRequest);
    177177    if (RT_FAILURE(rc))
    178         VBoxServiceVerbose(3, "ControlExec: [PID %u]: Sending quit request failed with rc=%Rrc\n",
     178        VBoxServiceVerbose(3, "ControlThead: [PID %u]: Sending quit request failed with rc=%Rrc\n",
    179179                           pThread->uPID, rc);
    180180    return rc;
     
    197197        && !ASMAtomicReadBool(&pThread->fStopped)) /* Only shutdown threads which aren't yet. */
    198198    {
    199         VBoxServiceVerbose(3, "ControlExec: [PID %u]: Waiting for shutdown ...\n",
     199        VBoxServiceVerbose(3, "ControlThead: [PID %u]: Waiting for shutdown ...\n",
    200200                           pThread->uPID);
    201201
     
    205205        if (RT_FAILURE(rcThread))
    206206        {
    207             VBoxServiceError("ControlExec: [PID %u]: Shutdown returned error rc=%Rrc\n",
     207            VBoxServiceError("ControlThead: [PID %u]: Shutdown returned error rc=%Rrc\n",
    208208                             pThread->uPID, rcThread);
    209209            if (RT_SUCCESS(rc))
     
    225225        return;
    226226
    227     VBoxServiceVerbose(3, "ControlExec: [PID %u]: Freeing thread data ...\n",
     227    VBoxServiceVerbose(3, "ControlThead: [PID %u]: Freeing thread data ...\n",
    228228                       pThread->uPID);
    229229
     
    316316
    317317#ifdef DEBUG_andy
    318     VBoxServiceVerbose(4, "ControlExec: HandleOutputEvent fPollEvt=0x%x, idPollHnd=%u\n",
     318    VBoxServiceVerbose(4, "ControlThead: HandleOutputEvent fPollEvt=0x%x, idPollHnd=%u\n",
    319319                       fPollEvt, idPollHnd);
    320320#endif
     
    342342{
    343343#ifdef DEBUG_andy
    344     VBoxServiceVerbose(4, "ControlExec: HandleIPCRequest\n");
     344    VBoxServiceVerbose(4, "ControlThead: HandleIPCRequest\n");
    345345#endif
    346346
     
    358358        int rc = RTPipeRead(pThread->hNotificationPipeR, abBuf, sizeof(abBuf), &cbIgnore);
    359359        if (RT_FAILURE(rc))
    360             VBoxServiceError("ControlExec: Draining IPC notification pipe failed with rc=%Rrc\n", rc);
     360            VBoxServiceError("ControlThead: Draining IPC notification pipe failed with rc=%Rrc\n", rc);
    361361
    362362        int rcReq = VINF_SUCCESS; /* Actual request result. */
     
    438438                     ? rcReq : rc;
    439439
    440         VBoxServiceVerbose(4, "ControlExec: Handled IPC request with rcReq=%Rrc, enmType=%u, cbData=%u\n",
     440        VBoxServiceVerbose(4, "ControlThead: Handled IPC request with rcReq=%Rrc, enmType=%u, cbData=%u\n",
    441441                           rcReq, pRequest->enmType, pRequest->cbData);
    442442
     
    498498    if (RT_FAILURE(rc))
    499499    {
    500         VBoxServiceError("ControlExec: Unable to assign PID to new thread, rc=%Rrc\n", rc);
     500        VBoxServiceError("ControlThead: Unable to assign PID to new thread, rc=%Rrc\n", rc);
    501501        return rc;
    502502    }
     
    506506     * and that it's now OK to send input to the process.
    507507     */
    508     VBoxServiceVerbose(3, "ControlExec: [PID %u]: Process started, CID=%u, User=%s\n",
     508    VBoxServiceVerbose(3, "ControlThead: [PID %u]: Process started, CID=%u, User=%s\n",
    509509                       pThread->uPID, pThread->uContextID, pThread->pszUser);
    510510    rc = VbglR3GuestCtrlExecReportStatus(pThread->uClientID, pThread->uContextID,
     
    531531        if (RT_SUCCESS(rc2))
    532532        {
    533             /*VBoxServiceVerbose(4, "ControlExec: [PID %u}: RTPollNoResume idPollHnd=%u\n",
     533            /*VBoxServiceVerbose(4, "ControlThead: [PID %u}: RTPollNoResume idPollHnd=%u\n",
    534534                                 pThread->uPID, idPollHnd);*/
    535535            switch (idPollHnd)
     
    608608            if (cMsElapsed >= cMsTimeout)
    609609            {
    610                 VBoxServiceVerbose(3, "ControlExec: [PID %u]: Timed out (%ums elapsed > %ums timeout), killing ...",
     610                VBoxServiceVerbose(3, "ControlThead: [PID %u]: Timed out (%ums elapsed > %ums timeout), killing ...",
    611611                                   pThread->uPID, cMsElapsed, cMsTimeout);
    612612
     
    644644        if (MsProcessKilled == UINT64_MAX)
    645645        {
    646             VBoxServiceVerbose(3, "ControlExec: [PID %u]: Is still alive and not killed yet\n",
     646            VBoxServiceVerbose(3, "ControlThead: [PID %u]: Is still alive and not killed yet\n",
    647647                               pThread->uPID);
    648648
     
    654654        for (size_t i = 0; i < 10; i++)
    655655        {
    656             VBoxServiceVerbose(4, "ControlExec: [PID %u]: Kill attempt %d/10: Waiting to exit ...\n",
     656            VBoxServiceVerbose(4, "ControlThead: [PID %u]: Kill attempt %d/10: Waiting to exit ...\n",
    657657                               pThread->uPID, i + 1);
    658658            rc2 = RTProcWait(hProcess, RTPROCWAIT_FLAGS_NOBLOCK, &ProcessStatus);
    659659            if (RT_SUCCESS(rc2))
    660660            {
    661                 VBoxServiceVerbose(4, "ControlExec: [PID %u]: Kill attempt %d/10: Exited\n",
     661                VBoxServiceVerbose(4, "ControlThead: [PID %u]: Kill attempt %d/10: Exited\n",
    662662                                   pThread->uPID, i + 1);
    663663                fProcessAlive = false;
     
    666666            if (i >= 5)
    667667            {
    668                 VBoxServiceVerbose(4, "ControlExec: [PID %u]: Kill attempt %d/10: Trying to terminate ...\n",
     668                VBoxServiceVerbose(4, "ControlThead: [PID %u]: Kill attempt %d/10: Trying to terminate ...\n",
    669669                                   pThread->uPID, i + 1);
    670670                RTProcTerminate(hProcess);
     
    674674
    675675        if (fProcessAlive)
    676             VBoxServiceVerbose(3, "ControlExec: [PID %u]: Could not be killed\n", pThread->uPID);
     676            VBoxServiceVerbose(3, "ControlThead: [PID %u]: Could not be killed\n", pThread->uPID);
    677677    }
    678678
     
    688688        if (     fProcessTimedOut  && !fProcessAlive && MsProcessKilled != UINT64_MAX)
    689689        {
    690             VBoxServiceVerbose(3, "ControlExec: [PID %u]: Timed out and got killed\n",
     690            VBoxServiceVerbose(3, "ControlThead: [PID %u]: Timed out and got killed\n",
    691691                               pThread->uPID);
    692692            uStatus = PROC_STS_TOK;
     
    694694        else if (fProcessTimedOut  &&  fProcessAlive && MsProcessKilled != UINT64_MAX)
    695695        {
    696             VBoxServiceVerbose(3, "ControlExec: [PID %u]: Timed out and did *not* get killed\n",
     696            VBoxServiceVerbose(3, "ControlThead: [PID %u]: Timed out and did *not* get killed\n",
    697697                               pThread->uPID);
    698698            uStatus = PROC_STS_TOA;
     
    700700        else if (pThread->fShutdown && (fProcessAlive || MsProcessKilled != UINT64_MAX))
    701701        {
    702             VBoxServiceVerbose(3, "ControlExec: [PID %u]: Got terminated because system/service is about to shutdown\n",
     702            VBoxServiceVerbose(3, "ControlThead: [PID %u]: Got terminated because system/service is about to shutdown\n",
    703703                               pThread->uPID);
    704704            uStatus = PROC_STS_DWN; /* Service is stopping, process was killed. */
     
    707707        else if (fProcessAlive)
    708708        {
    709             VBoxServiceError("ControlExec: [PID %u]: Is alive when it should not!\n",
     709            VBoxServiceError("ControlThead: [PID %u]: Is alive when it should not!\n",
    710710                             pThread->uPID);
    711711        }
    712712        else if (MsProcessKilled != UINT64_MAX)
    713713        {
    714             VBoxServiceError("ControlExec: [PID %u]: Has been killed when it should not!\n",
     714            VBoxServiceError("ControlThead: [PID %u]: Has been killed when it should not!\n",
    715715                             pThread->uPID);
    716716        }
    717717        else if (ProcessStatus.enmReason == RTPROCEXITREASON_NORMAL)
    718718        {
    719             VBoxServiceVerbose(3, "ControlExec: [PID %u]: Ended with RTPROCEXITREASON_NORMAL (%u)\n",
     719            VBoxServiceVerbose(3, "ControlThead: [PID %u]: Ended with RTPROCEXITREASON_NORMAL (%u)\n",
    720720                               pThread->uPID, ProcessStatus.iStatus);
    721721
     
    725725        else if (ProcessStatus.enmReason == RTPROCEXITREASON_SIGNAL)
    726726        {
    727             VBoxServiceVerbose(3, "ControlExec: [PID %u]: Ended with RTPROCEXITREASON_SIGNAL (%u)\n",
     727            VBoxServiceVerbose(3, "ControlThead: [PID %u]: Ended with RTPROCEXITREASON_SIGNAL (%u)\n",
    728728                               pThread->uPID, ProcessStatus.iStatus);
    729729
     
    733733        else if (ProcessStatus.enmReason == RTPROCEXITREASON_ABEND)
    734734        {
    735             VBoxServiceVerbose(3, "ControlExec: [PID %u]: Ended with RTPROCEXITREASON_ABEND (%u)\n",
     735            VBoxServiceVerbose(3, "ControlThead: [PID %u]: Ended with RTPROCEXITREASON_ABEND (%u)\n",
    736736                               pThread->uPID, ProcessStatus.iStatus);
    737737
     
    740740        }
    741741        else
    742             VBoxServiceVerbose(1, "ControlExec: [PID %u]: Handling process status %u not implemented\n",
     742            VBoxServiceVerbose(1, "ControlThead: [PID %u]: Handling process status %u not implemented\n",
    743743                               pThread->uPID, ProcessStatus.enmReason);
    744744
    745         VBoxServiceVerbose(3, "ControlExec: [PID %u]: Sending final status, ClientID=%u, CID=%u, Status=%u, Flags=0x%x\n",
     745        VBoxServiceVerbose(3, "ControlThead: [PID %u]: Sending final status, ClientID=%u, CID=%u, Status=%u, Flags=0x%x\n",
    746746                           pThread->uPID, pThread->uClientID, pThread->uContextID, uStatus, uFlags);
    747747        rc = VbglR3GuestCtrlExecReportStatus(pThread->uClientID, pThread->uContextID,
     
    749749                                             NULL /* pvData */, 0 /* cbData */);
    750750        if (RT_FAILURE(rc))
    751             VBoxServiceError("ControlExec: [PID %u]: Error reporting final status to host; rc=%Rrc\n",
     751            VBoxServiceError("ControlThead: [PID %u]: Error reporting final status to host; rc=%Rrc\n",
    752752                             pThread->uPID, rc);
    753753
    754         VBoxServiceVerbose(3, "ControlExec: [PID %u]: Process loop ended with rc=%Rrc\n",
     754        VBoxServiceVerbose(3, "ControlThead: [PID %u]: Process loop ended with rc=%Rrc\n",
    755755                           pThread->uPID, rc);
    756756    }
    757757    else
    758         VBoxServiceError("ControlExec: [PID %u]: Loop failed with rc=%Rrc\n",
     758        VBoxServiceError("ControlThead: [PID %u]: Loop failed with rc=%Rrc\n",
    759759                         pThread->uPID, rc);
    760760    return rc;
     
    833833#endif
    834834#ifdef DEBUG
    835     VBoxServiceVerbose(3, "ControlExec: VBoxServiceControlExecMakeFullPath: %s -> %s\n",
     835    VBoxServiceVerbose(3, "ControlThead: VBoxServiceControlExecMakeFullPath: %s -> %s\n",
    836836                       pszPath, pszExpanded);
    837837#endif
     
    870870        rc = VBoxServiceControlThreadMakeFullPath(pszExecResolved, pszResolved, cbResolved);
    871871#ifdef DEBUG
    872         VBoxServiceVerbose(3, "ControlExec: VBoxServiceControlExecResolveExecutable: %s -> %s\n",
     872        VBoxServiceVerbose(3, "ControlThead: VBoxServiceControlExecResolveExecutable: %s -> %s\n",
    873873                           pszFileName, pszResolved);
    874874#endif
     
    10411041                uProcFlags |= RTPROC_FLAGS_SERVICE;
    10421042#ifdef DEBUG
    1043             VBoxServiceVerbose(3, "ControlExec: Command: %s\n", szExecExp);
     1043            VBoxServiceVerbose(3, "ControlThead: Command: %s\n", szExecExp);
    10441044            for (size_t i = 0; papszArgsExp[i]; i++)
    1045                 VBoxServiceVerbose(3, "ControlExec:\targv[%ld]: %s\n", i, papszArgsExp[i]);
     1045                VBoxServiceVerbose(3, "ControlThead:\targv[%ld]: %s\n", i, papszArgsExp[i]);
    10461046#endif
    10471047            /* Do normal execution. */
     
    10661066{
    10671067    AssertPtrReturn(pThread, VERR_INVALID_POINTER);
    1068     VBoxServiceVerbose(3, "ControlExec: Thread of process \"%s\" started\n", pThread->pszCmd);
     1068    VBoxServiceVerbose(3, "ControlThead: Thread of process \"%s\" started\n", pThread->pszCmd);
    10691069
    10701070    int rc = VbglR3GuestCtrlConnect(&pThread->uClientID);
    10711071    if (RT_FAILURE(rc))
    10721072    {
    1073         VBoxServiceError("ControlExec: Thread failed to connect to the guest control service, aborted! Error: %Rrc\n", rc);
     1073        VBoxServiceError("ControlThead: Thread failed to connect to the guest control service, aborted! Error: %Rrc\n", rc);
    10741074        RTThreadUserSignal(RTThreadSelf());
    10751075        return rc;
    10761076    }
    1077     VBoxServiceVerbose(3, "ControlExec: Guest process \"%s\" got client ID=%u\n",
     1077    VBoxServiceVerbose(3, "ControlThead: Guest process \"%s\" got client ID=%u\n",
    10781078                       pThread->pszCmd, pThread->uClientID);
    10791079
     
    11481148                                                                           &hProcess);
    11491149                                if (RT_FAILURE(rc))
    1150                                     VBoxServiceError("ControlExec: Error starting process, rc=%Rrc\n", rc);
     1150                                    VBoxServiceError("ControlThead: Error starting process, rc=%Rrc\n", rc);
    11511151                                /*
    11521152                                 * Tell the control thread that it can continue
     
    12031203                                else /* Something went wrong; report error! */
    12041204                                {
    1205                                     VBoxServiceError("ControlExec: Could not start process '%s' (CID: %u)! Error: %Rrc\n",
     1205                                    VBoxServiceError("ControlThead: Could not start process '%s' (CID: %u)! Error: %Rrc\n",
    12061206                                                     pThread->pszCmd, pThread->uContextID, rc);
    12071207
     
    12101210                                                                          NULL /* pvData */, 0 /* cbData */);
    12111211                                    if (RT_FAILURE(rc2))
    1212                                         VBoxServiceError("ControlExec: Could not report process start error! Error: %Rrc (process error %Rrc)\n",
     1212                                        VBoxServiceError("ControlThead: Could not report process start error! Error: %Rrc (process error %Rrc)\n",
    12131213                                                         rc2, rc);
    12141214                                }
     
    12381238    if (pThread->uClientID)
    12391239    {
    1240         VBoxServiceVerbose(3, "ControlExec: [PID %u]: Cancelling pending waits (client ID=%u)\n",
     1240        VBoxServiceVerbose(3, "ControlThead: [PID %u]: Cancelling pending waits (client ID=%u)\n",
    12411241                           pThread->uPID, pThread->uClientID);
    12421242        int rc2 = VbglR3GuestCtrlCancelPendingWaits(pThread->uClientID);
    12431243        if (RT_FAILURE(rc2))
    12441244        {
    1245             VBoxServiceError("ControlExec: [PID %u]: Cancelling pending waits failed; rc=%Rrc\n",
     1245            VBoxServiceError("ControlThead: [PID %u]: Cancelling pending waits failed; rc=%Rrc\n",
    12461246                             pThread->uPID, rc2);
    12471247            if (RT_SUCCESS(rc))
     
    12501250
    12511251        /* Disconnect from guest control service. */
     1252        VBoxServiceError("ControlThead: [PID %u]: Disconnecting (client ID=%u) ...\n",
     1253                         pThread->uPID, pThread->uClientID);
    12521254        VbglR3GuestCtrlDisconnect(pThread->uClientID);
    12531255        pThread->uClientID = 0;
    12541256    }
    12551257
    1256     VBoxServiceVerbose(3, "ControlExec: [PID %u]: Thread of process \"%s\" ended with rc=%Rrc\n",
     1258    VBoxServiceVerbose(3, "ControlThead: [PID %u]: Thread of process \"%s\" ended with rc=%Rrc\n",
    12571259                       pThread->uPID, pThread->pszCmd, rc);
    12581260
     
    13461348        if (RT_FAILURE(rc))
    13471349        {
    1348             VBoxServiceError("ControlExec: RTThreadCreate failed, rc=%Rrc\n, pThread=%p\n",
     1350            VBoxServiceError("ControlThead: RTThreadCreate failed, rc=%Rrc\n, pThread=%p\n",
    13491351                             rc, pThread);
    13501352        }
    13511353        else
    13521354        {
    1353             VBoxServiceVerbose(4, "ControlExec: Waiting for thread to initialize ...\n");
     1355            VBoxServiceVerbose(4, "ControlThead: Waiting for thread to initialize ...\n");
    13541356
    13551357            /* Wait for the thread to initialize. */
     
    13571359            if (ASMAtomicReadBool(&pThread->fShutdown))
    13581360            {
    1359                 VBoxServiceError("ControlExec: Thread for process \"%s\" failed to start!\n", pszCmd);
     1361                VBoxServiceError("ControlThead: Thread for process \"%s\" failed to start!\n", pszCmd);
    13601362                rc = VERR_GENERAL_FAILURE;
    13611363            }
     
    14001402        PVBOXSERVICECTRLTHREAD pNext = RTListNodeGetNext(&pOldThread->Node, VBOXSERVICECTRLTHREAD, Node);
    14011403
    1402         VBoxServiceVerbose(3, "ControlExec: PID %u was used before, shutting down stale exec thread ...\n",
     1404        VBoxServiceVerbose(3, "ControlThead: PID %u was used before, shutting down stale exec thread ...\n",
    14031405                           uPID);
    14041406        rc = vboxServiceControlThreadShutdown(pOldThread);
    14051407        if (RT_FAILURE(rc))
    14061408        {
    1407             VBoxServiceVerbose(3, "ControlExec: Unable to shut down stale exec thread, rc=%Rrc\n", rc);
     1409            VBoxServiceVerbose(3, "ControlThead: Unable to shut down stale exec thread, rc=%Rrc\n", rc);
    14081410            /* Keep going. */
    14091411        }
     
    14311433    /* Rest in pRequest is optional (based on the request type). */
    14321434
    1433     VBoxServiceVerbose(4, "ControlExec: Performing PID=%u, enmType=%u, pvData=0x%p, cbData=%u ...\n",
     1435    VBoxServiceVerbose(4, "ControlThead: Performing PID=%u, enmType=%u, pvData=0x%p, cbData=%u ...\n",
    14341436                       uPID, pRequest->enmType, pRequest->pvData, pRequest->cbData);
    14351437
     
    14621464            if (RT_SUCCESS(rc) && cbWritten)
    14631465            {
    1464                 VBoxServiceVerbose(4, "ControlExec: [PID %u]: Waiting for response on enmType=%u, pvData=0x%p, cbData=%u\n",
     1466                VBoxServiceVerbose(4, "ControlThead: [PID %u]: Waiting for response on enmType=%u, pvData=0x%p, cbData=%u\n",
    14651467                                   uPID, pRequest->enmType, pRequest->pvData, pRequest->cbData);
    14661468                /* Wait on the request to get completed (or we are asked to abort/shutdown). */
     
    14681470                if (RT_SUCCESS(rc))
    14691471                {
    1470                     VBoxServiceVerbose(4, "ControlExec: [PID %u]: Performed with rc=%Rrc, cbData=%u\n",
     1472                    VBoxServiceVerbose(4, "ControlThead: [PID %u]: Performed with rc=%Rrc, cbData=%u\n",
    14711473                                       uPID, pRequest->rc, pRequest->cbData);
    14721474
     
    14801482                        rc2 = RTSemEventMultiReset(pThread->RequestEvent);
    14811483                        if (RT_FAILURE(rc2))
    1482                             VBoxServiceError("ControlExec: Unable to reset request event, rc=%Rrc\n", rc2);
     1484                            VBoxServiceError("ControlThead: Unable to reset request event, rc=%Rrc\n", rc2);
    14831485
    14841486                        rc2 = RTCritSectLeave(&pThread->CritSect);
     
    14921494        rc = VERR_NOT_FOUND;
    14931495
    1494     VBoxServiceVerbose(4, "ControlExec: Performed PID=%u, enmType=%u, pvData=0x%p, cbData=%u with rc=%Rrc\n",
     1496    VBoxServiceVerbose(4, "ControlThead: Performed PID=%u, enmType=%u, pvData=0x%p, cbData=%u with rc=%Rrc\n",
    14951497                       uPID, pRequest->enmType, pRequest->pvData, pRequest->cbData, rc);
    14961498    return rc;
     
    15111513    if (RT_SUCCESS(rc))
    15121514    {
    1513         VBoxServiceVerbose(3, "ControlExec: [PID %u]: Shutting down ...\n",
     1515        VBoxServiceVerbose(3, "ControlThead: [PID %u]: Shutting down ...\n",
    15141516                           pThread->uPID);
    15151517
Note: See TracChangeset for help on using the changeset viewer.

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