VirtualBox

Changeset 54241 in vbox


Ignore:
Timestamp:
Feb 17, 2015 3:47:27 PM (10 years ago)
Author:
vboxsync
Message:

VBoxGuest-win.cpp: Cleaned up the 'logging' change of r92875, returning a number of LogFlow statements (error paths, useful stuff) into Log statements.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest-win.cpp

    r54229 r54241  
    283283            else
    284284            {
    285                 LogFlowFunc(("IoAttachDeviceToDeviceStack did not give a nextLowerDriver!\n"));
     285                LogFunc(("IoAttachDeviceToDeviceStack did not give a nextLowerDriver!\n"));
    286286                rc = STATUS_DEVICE_NOT_CONNECTED;
    287287            }
     
    291291        }
    292292        else
    293             LogFlowFunc(("IoCreateSymbolicLink failed with rc=%#x!\n", rc));
     293            LogFunc(("IoCreateSymbolicLink failed with rc=%#x!\n", rc));
    294294        IoDeleteDevice(pDeviceObject);
    295295    }
    296296    else
    297         LogFlowFunc(("IoCreateDevice failed with rc=%#x!\n", rc));
    298 
    299     LogFlowFunc(("Returning with rc=0x%x\n", rc));
     297        LogFunc(("IoCreateDevice failed with rc=%#x!\n", rc));
     298
     299    LogFunc(("Returning with rc=0x%x\n", rc));
    300300    return rc;
    301301}
     
    331331        };
    332332
    333         LogFlowFunc(("Type=%s",
    334                      uType < RT_ELEMENTS(s_apszName) ? s_apszName[uType] : "Unknown"));
     333        LogFunc(("Type=%s", uType < RT_ELEMENTS(s_apszName) ? s_apszName[uType] : "Unknown"));
    335334
    336335        switch (uType)
     
    338337            case CmResourceTypePort:
    339338            case CmResourceTypeMemory:
    340                 LogFlowFunc(("Start %8X%8.8lX, length=%X\n",
    341                              pResource->u.Port.Start.HighPart, pResource->u.Port.Start.LowPart,
    342                              pResource->u.Port.Length));
     339                LogFunc(("Start %8X%8.8lX, length=%X\n",
     340                         pResource->u.Port.Start.HighPart, pResource->u.Port.Start.LowPart,
     341                         pResource->u.Port.Length));
    343342                break;
    344343
    345344            case CmResourceTypeInterrupt:
    346                 LogFlowFunc(("Level=%X, vector=%X, affinity=%X\n",
    347                              pResource->u.Interrupt.Level, pResource->u.Interrupt.Vector,
    348                              pResource->u.Interrupt.Affinity));
     345                LogFunc(("Level=%X, vector=%X, affinity=%X\n",
     346                         pResource->u.Interrupt.Level, pResource->u.Interrupt.Vector,
     347                         pResource->u.Interrupt.Affinity));
    349348                break;
    350349
    351350            case CmResourceTypeDma:
    352                 LogFlowFunc(("Channel %d, Port %X\n",
    353                              pResource->u.Dma.Channel, pResource->u.Dma.Port));
     351                LogFunc(("Channel %d, Port %X\n",
     352                         pResource->u.Dma.Channel, pResource->u.Dma.Port));
    354353                break;
    355354
    356355            default:
    357                 LogFlowFunc(("\n"));
     356                LogFunc(("\n"));
    358357                break;
    359358        }
     
    382381    LogFlowFuncEnter();
    383382
    384     int rc = STATUS_SUCCESS;
     383    int rc = STATUS_SUCCESS; /** @todo r=bird: s/rc/rcNt/ and s/int/NTSTATUS/. gee. */
    385384#ifdef TARGET_NT4
    386385    /*
     
    424423            pDevExt->Core.pVMMDevMemory = (VMMDevMemory *)pvMMIOBase;
    425424
    426             LogFlowFunc(("pvMMIOBase=0x%p, pDevExt=0x%p, pDevExt->Core.pVMMDevMemory=0x%p\n",
    427                          pvMMIOBase, pDevExt, pDevExt ? pDevExt->Core.pVMMDevMemory : NULL));
     425            LogFunc(("pvMMIOBase=0x%p, pDevExt=0x%p, pDevExt->Core.pVMMDevMemory=0x%p\n",
     426                     pvMMIOBase, pDevExt, pDevExt ? pDevExt->Core.pVMMDevMemory : NULL));
    428427
    429428            int vrc = VBoxGuestInitDevExt(&pDevExt->Core,
     
    434433            if (RT_FAILURE(vrc))
    435434            {
    436                 LogFlowFunc(("Could not init device extension, rc=%Rrc\n", vrc));
     435                LogFunc(("Could not init device extension, rc=%Rrc\n", vrc));
    437436                rc = STATUS_DEVICE_CONFIGURATION_ERROR;
    438437            }
    439438        }
    440439        else
    441             LogFlowFunc(("Could not map physical address of VMMDev, rc=0x%x\n", rc));
     440            LogFunc(("Could not map physical address of VMMDev, rc=0x%x\n", rc));
    442441    }
    443442
     
    448447        if (RT_FAILURE(vrc))
    449448        {
    450             LogFlowFunc(("Alloc for pPowerStateRequest failed, rc=%Rrc\n", vrc));
     449            LogFunc(("Alloc for pPowerStateRequest failed, rc=%Rrc\n", vrc));
    451450            rc = STATUS_UNSUCCESSFUL;
    452451        }
     
    483482        }
    484483        else
    485             LogFlowFunc(("Device does not provide an interrupt!\n"));
     484            LogFunc(("Device does not provide an interrupt!\n"));
    486485#endif
    487486        if (pDevExt->interruptVector)
     
    507506                                    FALSE);                                     /* Don't save FPU stack. */
    508507            if (NT_ERROR(rc))
    509                 LogFlowFunc(("Could not connect interrupt, rc=0x%x\n", rc));
     508                LogFunc(("Could not connect interrupt, rc=0x%x\n", rc));
    510509        }
    511510        else
    512             LogFlowFunc(("No interrupt vector found!\n"));
     511            LogFunc(("No interrupt vector found!\n"));
    513512    }
    514513
     
    519518    if (RT_FAILURE(vrc))
    520519    {
    521         LogFlowFunc(("Failed to allocated kernel session data, rc=%Rrc\n", rc));
     520        LogFunc(("Failed to allocated kernel session data, rc=%Rrc\n", rc));
    522521        rc = STATUS_UNSUCCESSFUL;
    523522    }
     
    546545     *        whole bunch of things... */
    547546
    548     LogFlowFunc(("Returned with rc=0x%x\n", rc));
     547    LogFunc(("Returned with rc=0x%x\n", rc));
    549548    return rc;
    550549}
     
    647646    if (pDevExt->devState != WORKING)
    648647    {
    649         LogFlowFunc(("Device is not working currently, state=%d\n", pDevExt->devState));
     648        LogFunc(("Device is not working currently, state=%d\n", pDevExt->devState));
    650649        rc = STATUS_UNSUCCESSFUL;
    651650    }
     
    760759    if (pSession == NULL)
    761760    {
    762         LogFlowFunc(("Using kernel session data ...\n"));
     761        LogFunc(("XXX: BUGBUG: FIXME: Using ugly kernel session data hack ...\n"));
     762#ifdef DEBUG_andy
     763        RTLogBackdoorPrintf("XXX: BUGBUG: FIXME: Using ugly kernel session data hack ... Please don't forget to fix this one, Andy!\n");
     764#endif
    763765        pSession = pDevExt->pKernelSession;
    764766    }
     
    781783                            || cbDataReturned > pStack->Parameters.DeviceIoControl.OutputBufferLength))
    782784            {
    783                 LogFlowFunc(("Too much output data %u - expected %u!\n", cbDataReturned, cbData));
     785                LogFunc(("Too much output data %u - expected %u!\n", cbDataReturned, cbData));
    784786                cbDataReturned = cbData;
    785787                Status = STATUS_BUFFER_TOO_SMALL;
     
    801803    else
    802804    {
    803         LogFlowFunc(("Not buffered request (%#x) - not supported\n",
    804                      pStack->Parameters.DeviceIoControl.IoControlCode));
     805        LogFunc(("Not buffered request (%#x) - not supported\n", pStack->Parameters.DeviceIoControl.IoControlCode));
    805806        Status = STATUS_NOT_SUPPORTED;
    806807    }
     
    920921        int rc = VbglGRPerform(&pReq->header);
    921922        if (RT_FAILURE(rc))
    922             LogFlowFunc(("Error performing request to VMMDev, rc=%Rrc\n", rc));
     923            LogFunc(("Error performing request to VMMDev, rc=%Rrc\n", rc));
    923924    }
    924925
     
    957958{
    958959    PVBOXGUESTDEVEXTWIN pDevExt = (PVBOXGUESTDEVEXTWIN)pDevObj->DeviceExtension;
    959 #ifndef DEBUG_andy
    960     LogFlowFunc(("pDevExt=0x%p\n", pDevExt));
    961 #endif
     960    Log3Func(("pDevExt=0x%p\n", pDevExt));
    962961
    963962    /* Test & reset the counter. */
     
    994993        return FALSE;
    995994
    996     /*LogFlowFunc(("pDevExt=0x%p, pVMMDevMemory=0x%p\n",
    997                    pDevExt, pDevExt ? pDevExt->pVMMDevMemory : NULL));*/
     995    /*Log3Func(("pDevExt=0x%p, pVMMDevMemory=0x%p\n", pDevExt, pDevExt ? pDevExt->pVMMDevMemory : NULL));*/
    998996
    999997    /* Enter the common ISR routine and do the actual work. */
     
    10041002    if (fIRQTaken)
    10051003    {
    1006 #ifndef DEBUG_andy
    1007         LogFlowFunc(("IRQ was taken! pInterrupt=0x%p, pDevExt=0x%p\n",
    1008                      pInterrupt, pDevExt));
    1009 #endif
     1004        Log3Func(("IRQ was taken! pInterrupt=0x%p, pDevExt=0x%p\n", pInterrupt, pDevExt));
    10101005        if (ASMAtomicUoReadU32(   &pDevExt->Core.u32MousePosChangedSeq)
    10111006                               || !RTListIsEmpty(&pDevExt->Core.WakeUpList))
    10121007        {
    1013 #ifndef DEBUG_andy
    1014             LogFlowFunc(("Requesting DPC ...\n"));
    1015 #endif
     1008            Log3Func(("Requesting DPC ...\n"));
    10161009            IoRequestDpc(pDevExt->pDeviceObject, pDevExt->pCurrentIrp, NULL);
    10171010        }
     
    11141107                    pBaseAddress->ResourceMapped = FALSE;
    11151108
    1116                     LogFlowFunc(("I/O range for VMMDev found! Base=%08x:%08x, length=%08x\n",
    1117                                  pPartialData->u.Port.Start.HighPart,
    1118                                  pPartialData->u.Port.Start.LowPart,
    1119                                  pPartialData->u.Port.Length));
     1109                    LogFunc(("I/O range for VMMDev found! Base=%08x:%08x, length=%08x\n",
     1110                             pPartialData->u.Port.Start.HighPart,
     1111                             pPartialData->u.Port.Start.LowPart,
     1112                             pPartialData->u.Port.Length));
    11201113
    11211114                    /* Next item ... */
     
    11271120            case CmResourceTypeInterrupt:
    11281121            {
    1129                 LogFlowFunc(("Interrupt: Level=%x, vector=%x, mode=%x\n",
    1130                              pPartialData->u.Interrupt.Level,
    1131                              pPartialData->u.Interrupt.Vector,
    1132                              pPartialData->Flags));
     1122                LogFunc(("Interrupt: Level=%x, vector=%x, mode=%x\n",
     1123                         pPartialData->u.Interrupt.Level,
     1124                         pPartialData->u.Interrupt.Vector,
     1125                         pPartialData->Flags));
    11331126
    11341127                /* Save information. */
     
    11701163                        pBaseAddress->ResourceMapped = FALSE;
    11711164
    1172                         LogFlowFunc(("Memory range for VMMDev found! Base = %08x:%08x, Length = %08x\n",
    1173                                      pPartialData->u.Memory.Start.HighPart,
    1174                                      pPartialData->u.Memory.Start.LowPart,
    1175                                      pPartialData->u.Memory.Length));
     1165                        LogFunc(("Memory range for VMMDev found! Base = %08x:%08x, Length = %08x\n",
     1166                                 pPartialData->u.Memory.Start.HighPart,
     1167                                 pPartialData->u.Memory.Start.LowPart,
     1168                                 pPartialData->u.Memory.Length));
    11761169
    11771170                        /* Next item ... */
     
    11791172                    }
    11801173                    else
    1181                         LogFlowFunc(("Ignoring memory: Flags=%08x\n", pPartialData->Flags));
     1174                        LogFunc(("Ignoring memory: Flags=%08x\n", pPartialData->Flags));
    11821175                }
    11831176                break;
     
    11861179            default:
    11871180            {
    1188                 LogFlowFunc(("Unhandled resource found, type=%d\n", pPartialData->Type));
     1181                LogFunc(("Unhandled resource found, type=%d\n", pPartialData->Type));
    11891182                break;
    11901183            }
     
    12231216         if (pVMMDevMemory)
    12241217         {
    1225              LogFlowFunc(("VMMDevMemory: Version = 0x%x, Size = %d\n",
    1226                           pVMMDevMemory->u32Version, pVMMDevMemory->u32Size));
     1218             LogFunc(("VMMDevMemory: Version = 0x%x, Size = %d\n", pVMMDevMemory->u32Version, pVMMDevMemory->u32Size));
    12271219
    12281220             /* Check version of the structure; do we have the right memory version? */
     
    12341226                     *pcbMMIO = pVMMDevMemory->u32Size;
    12351227
    1236                  LogFlowFunc(("VMMDevMemory found and mapped! pvMMIOBase = 0x%p\n",
    1237                               *ppvMMIOBase));
     1228                 LogFlowFunc(("VMMDevMemory found and mapped! pvMMIOBase = 0x%p\n", *ppvMMIOBase));
    12381229             }
    12391230             else
    12401231             {
    12411232                 /* Not our version, refuse operation and unmap the memory. */
    1242                  LogFlowFunc(("Wrong version (%u), refusing operation!\n", pVMMDevMemory->u32Version));
     1233                 LogFunc(("Wrong version (%u), refusing operation!\n", pVMMDevMemory->u32Version));
    12431234
    12441235                 vbgdNtUnmapVMMDevMemory(pDevExt);
     
    15481539    return VINF_SUCCESS;
    15491540}
     1541
    15501542#endif /* VBOX_WITH_DPC_LATENCY_CHECKER */
    15511543
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