VirtualBox

Changeset 40954 in vbox for trunk


Ignore:
Timestamp:
Apr 16, 2012 10:49:17 PM (13 years ago)
Author:
vboxsync
Message:

PDM: info pdmtracingids.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR3/PDM.cpp

    r40920 r40954  
    325325static DECLCALLBACK(int) pdmR3LoadPrep(PVM pVM, PSSMHANDLE pSSM);
    326326
     327static FNDBGFHANDLERINT pdmR3InfoTracingIds;
    327328
    328329
     
    413414        if (RT_SUCCESS(rc))
    414415        {
     416            /*
     417             * Register the info handlers.
     418             */
     419            DBGFR3InfoRegisterInternal(pVM, "pdmtracingids",
     420                                       "Displays the tracing IDs assigned by PDM to devices, USB device, drivers and more.",
     421                                       pdmR3InfoTracingIds);
     422
    415423            LogFlow(("PDM: Successfully initialized\n"));
    416424            return rc;
     
    26642672}
    26652673
     2674
     2675/**
     2676 * Info handler for 'pdmtracingids'.
     2677 *
     2678 * @param   pVM         The VM handle.
     2679 * @param   pHlp        The output helpers.
     2680 * @param   pszArgs     The optional user arguments.
     2681 *
     2682 * @remarks Can be called on most threads.
     2683 */
     2684static DECLCALLBACK(void) pdmR3InfoTracingIds(PVM pVM, PCDBGFINFOHLP pHlp, const char *pszArgs)
     2685{
     2686    /*
     2687     * Parse the argument (optional).
     2688     */
     2689    if (   *pszArgs
     2690        && strcmp(pszArgs, "all")
     2691        && strcmp(pszArgs, "devices")
     2692        && strcmp(pszArgs, "drivers")
     2693        && strcmp(pszArgs, "usb"))
     2694    {
     2695        pHlp->pfnPrintf(pHlp, "Unable to grok '%s'\n", pszArgs);
     2696        return;
     2697    }
     2698    bool fAll     = !*pszArgs || !strcmp(pszArgs, "all");
     2699    bool fDevices = fAll || !strcmp(pszArgs, "devices");
     2700    bool fUsbDevs = fAll || !strcmp(pszArgs, "usb");
     2701    bool fDrivers = fAll || !strcmp(pszArgs, "drivers");
     2702
     2703    /*
     2704     * Produce the requested output.
     2705     */
     2706/** @todo lock PDM lists! */
     2707    /* devices */
     2708    if (fDevices)
     2709    {
     2710        pHlp->pfnPrintf(pHlp, "Device tracing IDs:\n");
     2711        for (PPDMDEVINS pDevIns = pVM->pdm.s.pDevInstances; pDevIns; pDevIns = pDevIns->Internal.s.pNextR3)
     2712            pHlp->pfnPrintf(pHlp, "%05u  %s\n", pDevIns->idTracing, pDevIns->Internal.s.pDevR3->pReg->szName);
     2713    }
     2714
     2715    /* USB devices */
     2716    if (fUsbDevs)
     2717    {
     2718        pHlp->pfnPrintf(pHlp, "USB device tracing IDs:\n");
     2719        for (PPDMUSBINS pUsbIns = pVM->pdm.s.pUsbInstances; pUsbIns; pUsbIns = pUsbIns->Internal.s.pNext)
     2720            pHlp->pfnPrintf(pHlp, "%05u  %s\n", pUsbIns->idTracing, pUsbIns->Internal.s.pUsbDev->pReg->szName);
     2721    }
     2722
     2723    /* Drivers */
     2724    if (fDrivers)
     2725    {
     2726        pHlp->pfnPrintf(pHlp, "Driver tracing IDs:\n");
     2727        for (PPDMDEVINS pDevIns = pVM->pdm.s.pDevInstances; pDevIns; pDevIns = pDevIns->Internal.s.pNextR3)
     2728        {
     2729            for (PPDMLUN pLun = pDevIns->Internal.s.pLunsR3; pLun; pLun = pLun->pNext)
     2730            {
     2731                uint32_t iLevel = 0;
     2732                for (PPDMDRVINS pDrvIns = pLun->pTop; pDrvIns; pDrvIns = pDrvIns->Internal.s.pDown, iLevel++)
     2733                    pHlp->pfnPrintf(pHlp, "%05u  %s (level %u, lun %u, dev %s)\n",
     2734                                    pDrvIns->idTracing, pDrvIns->Internal.s.pDrv->pReg->szName,
     2735                                    iLevel, pLun->iLun, pDevIns->Internal.s.pDevR3->pReg->szName);
     2736            }
     2737        }
     2738
     2739        for (PPDMUSBINS pUsbIns = pVM->pdm.s.pUsbInstances; pUsbIns; pUsbIns = pUsbIns->Internal.s.pNext)
     2740        {
     2741            for (PPDMLUN pLun = pUsbIns->Internal.s.pLuns; pLun; pLun = pLun->pNext)
     2742            {
     2743                uint32_t iLevel = 0;
     2744                for (PPDMDRVINS pDrvIns = pLun->pTop; pDrvIns; pDrvIns = pDrvIns->Internal.s.pDown, iLevel++)
     2745                    pHlp->pfnPrintf(pHlp, "%05u  %s (level %u, lun %u, dev %s)\n",
     2746                                    pDrvIns->idTracing, pDrvIns->Internal.s.pDrv->pReg->szName,
     2747                                    iLevel, pLun->iLun, pUsbIns->Internal.s.pUsbDev->pReg->szName);
     2748            }
     2749        }
     2750    }
     2751}
     2752
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