VirtualBox

Ignore:
Timestamp:
Mar 11, 2013 3:41:01 PM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
84215
Message:

VBOX_WITH_DPC_LATENCY_CHECKER: Some adjustments. Please, don't use #pragma pack() unless you really need and mean it! Misaligning data just makes things slow...

File:
1 edited

Legend:

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

    r44328 r44992  
    3737# include <VBox/HostServices/GuestPropertySvc.h>
    3838#endif
     39#ifdef VBOX_WITH_DPC_LATENCY_CHECKER
     40# include <VBox/VBoxGuest.h>
     41# include "../VBoxGuestLib/VBGLR3Internal.h" /* HACK ALERT! Using vbglR3DoIOCtl directly!! */
     42#endif
     43
    3944
    4045/*******************************************************************************
     
    101106    RTPrintf("\n");
    102107
    103 /* Exclude the Windows bits from the test version.  Anyone who needs to test
    104  * them can fix this. */
     108    /* Exclude the Windows bits from the test version.  Anyone who needs to
     109       test them can fix this. */
    105110#if defined(RT_OS_WINDOWS) && !defined(VBOX_CONTROL_TEST)
    106111    if (eWhich  == GET_VIDEO_ACCEL || eWhich == USAGE_ALL)
     
    14781483#endif
    14791484
     1485#ifdef VBOX_WITH_DPC_LATENCY_CHECKER
     1486/**
     1487 * @callback_method_impl{FNVBOXCTRLCMDHANDLER, Command: help}
     1488 */
     1489static RTEXITCODE handleDpc(int argc, char *argv[])
     1490{
     1491# ifndef VBOX_CONTROL_TEST
     1492    int rc;
     1493    for (int i = 0; i < 30; i++)
     1494    {
     1495        rc = vbglR3DoIOCtl(VBOXGUEST_IOCTL_DPC_LATENCY_CHECKER, NULL, 0);
     1496        if (RT_FAILURE(rc))
     1497            break;
     1498        RTPrintf("%d\n", i);
     1499    }
     1500# else
     1501    int rc = VERR_NOT_IMPLEMENTED;
     1502# endif
     1503    if (RT_FAILURE(rc))
     1504        return VBoxControlError("Error. rc=%Rrc\n", rc);
     1505    RTPrintf("Samples collection completed.\n");
     1506    return RTEXITCODE_SUCCESS;
     1507}
     1508#endif /* VBOX_WITH_DPC_LATENCY_CHECKER */
     1509
     1510
    14801511/**
    14811512 * @callback_method_impl{FNVBOXCTRLCMDHANDLER, Command: takesnapshot}
     
    15351566}
    15361567
    1537 #ifdef VBOX_WITH_DPC_LATENCY_CHECKER
    1538 #include "..\VBoxGuestLib\VBGLR3Internal.h"
    1539 
    1540 static RTEXITCODE handleDpc(int argc, char *argv[])
    1541 {
    1542 #ifndef VBOX_CONTROL_TEST
    1543     int rc = VINF_SUCCESS;
    1544     int i;
    1545     for (i = 0; i < 30; i++)
    1546     {
    1547         rc = vbglR3DoIOCtl(VBOXGUEST_IOCTL_DPC, NULL, 0);
    1548         if (RT_FAILURE(rc))
    1549         {
    1550             break;
    1551         }
    1552         RTPrintf("%d\n", i);
    1553     }
    1554 #else
    1555     int rc = VERR_NOT_IMPLEMENTED;
    1556 #endif
    1557     if (RT_SUCCESS(rc))
    1558     {
    1559         RTPrintf("Samples collection completed.\n");
    1560         return RTEXITCODE_SUCCESS;
    1561     }
    1562     else
    1563     {
    1564         VBoxControlError("Error. rc=%Rrc\n", rc);
    1565         return RTEXITCODE_FAILURE;
    1566     }
    1567 }
    1568 #endif /* VBOX_WITH_DPC_LATENCY_CHECKER */
    15691568
    15701569/** command handler type */
     
    15951594#if !defined(VBOX_CONTROL_TEST)
    15961595    { "writecoredump",          handleWriteCoreDump },
     1596#endif
     1597#ifdef VBOX_WITH_DPC_LATENCY_CHECKER
     1598    { "dpc",                    handleDpc },
    15971599#endif
    15981600    { "takesnapshot",           handleTakeSnapshot },
     
    16041606    { "getversion",             handleVersion },
    16051607    { "version",                handleVersion },
    1606 #ifdef VBOX_WITH_DPC_LATENCY_CHECKER
    1607     { "dpc",                    handleDpc },
    1608 #endif /* VBOX_WITH_DPC_LATENCY_CHECKER */
    16091608    { "help",                   handleHelp }
    16101609};
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