VirtualBox

Ignore:
Timestamp:
Jun 7, 2010 12:39:12 PM (15 years ago)
Author:
vboxsync
Message:

Count user and kernel pages separately

File:
1 edited

Legend:

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

    r30064 r30067  
    228228    VBoxServicePageSharingInspectModules(GetCurrentProcessId());
    229229
     230    printf("\n\nUSER RESULTS\n");
     231    printf("cNotPresentPages = %d\n", cNotPresentPages);
     232    printf("cWritablePages   = %d\n", cWritablePages);
     233    printf("cPrivatePages    = %d\n", cPrivatePages);
     234    printf("cSharedPages     = %d\n", cSharedPages);
     235
     236    cNotPresentPages = 0;
     237    cWritablePages   = 0;
     238    cPrivatePages    = 0;
     239    cSharedPages     = 0;
     240
    230241    /* Check all loaded kernel modules. */
    231242    if (ZwQuerySystemInformation)
     
    293304            RTMemFree(pBuffer);
    294305    }
    295 }
    296 #else
    297 void VBoxServicePageSharingInspectGuest()
    298 {
    299     /* @todo other platforms */
    300 }
    301 #endif
    302 
    303 
    304 /** @copydoc VBOXSERVICE::pfnInit */
    305 static DECLCALLBACK(int) VBoxServicePageSharingInit(void)
    306 {
    307     printf("VBoxServicePageSharingInit\n");
    308 
    309 #ifdef RT_OS_WINDOWS
    310     hNtdll = LoadLibrary("ntdll.dll");
    311 
    312     if (hNtdll)
    313         ZwQuerySystemInformation = (PFNZWQUERYSYSTEMINFORMATION)GetProcAddress(hNtdll, "ZwQuerySystemInformation");
    314 #endif
    315 
    316     /* @todo report system name and version */
    317     /* Never fail here. */
    318     return VINF_SUCCESS;
    319 }
    320 
    321 static DECLCALLBACK(void) VBoxServicePageSharingTerm(void)
    322 {
    323     printf("VBoxServicePageSharingTerm\n");
    324 
    325     printf("\n\nRESULT\n");
     306    printf("\n\nKERNEL RESULTS\n");
    326307    printf("cNotPresentPages = %d\n", cNotPresentPages);
    327308    printf("cWritablePages   = %d\n", cWritablePages);
    328309    printf("cPrivatePages    = %d\n", cPrivatePages);
    329310    printf("cSharedPages     = %d\n", cSharedPages);
     311}
     312#else
     313void VBoxServicePageSharingInspectGuest()
     314{
     315    /* @todo other platforms */
     316}
     317#endif
     318
     319
     320/** @copydoc VBOXSERVICE::pfnInit */
     321static DECLCALLBACK(int) VBoxServicePageSharingInit(void)
     322{
     323    printf("VBoxServicePageSharingInit\n");
     324
     325#ifdef RT_OS_WINDOWS
     326    hNtdll = LoadLibrary("ntdll.dll");
     327
     328    if (hNtdll)
     329        ZwQuerySystemInformation = (PFNZWQUERYSYSTEMINFORMATION)GetProcAddress(hNtdll, "ZwQuerySystemInformation");
     330#endif
     331
     332    /* @todo report system name and version */
     333    /* Never fail here. */
     334    return VINF_SUCCESS;
     335}
     336
     337static DECLCALLBACK(void) VBoxServicePageSharingTerm(void)
     338{
     339    printf("VBoxServicePageSharingTerm\n");
    330340
    331341#ifdef RT_OS_WINDOWS
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