VirtualBox

Changeset 13185

Show
Ignore:
Timestamp:
10/10/08 23:26:06 (3 months ago)
Author:
vboxsync
Message:

VBoxREM: export the tb statistics.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/recompiler/VBoxRecompiler.c

    r13144 r13185  
    139139static STAMCOUNTER    gStatSelOutOfSyncStateBack[6]; 
    140140static STAMCOUNTER    gStatFlushTBs; 
     141/* in exec.c */ 
     142extern uint32_t       tlb_flush_count; 
     143extern uint32_t       tb_flush_count; 
     144extern uint32_t       tb_phys_invalidate_count; 
    141145#endif 
    142146 
     
    391395    STAM_REG(pVM, &gStatSelOutOfSyncStateBack[4],    STAMTYPE_COUNTER, "/REM/StateBack/SelOutOfSync/FS",        STAMUNIT_OCCURENCES,     "FS out of sync"); 
    392396    STAM_REG(pVM, &gStatSelOutOfSyncStateBack[5],    STAMTYPE_COUNTER, "/REM/StateBack/SelOutOfSync/GS",        STAMUNIT_OCCURENCES,     "GS out of sync"); 
     397 
     398    STAM_REG(pVM, &tb_flush_count,          STAMTYPE_U32_RESET, "/REM/TbFlushCount",     STAMUNIT_OCCURENCES, "tb_flush() calls"); 
     399    STAM_REG(pVM, &tb_phys_invalidate_count,STAMTYPE_U32_RESET, "/REM/TbPhysInvldCount", STAMUNIT_OCCURENCES, "tb_phys_invalidate() calls"); 
     400    STAM_REG(pVM, &tlb_flush_count,         STAMTYPE_U32_RESET, "/REM/TlbFlushCount",    STAMUNIT_OCCURENCES, "tlb_flush() calls"); 
    393401 
    394402 
  • trunk/src/recompiler/exec.c

    r11982 r13185  
    171171 
    172172/* statistics */ 
     173#ifndef VBOX 
    173174static int tlb_flush_count; 
    174175static int tb_flush_count; 
    175 #ifndef VBOX 
    176176static int tb_phys_invalidate_count; 
    177 #endif /* !VBOX */ 
     177#else  /* VBOX */ 
     178# ifdef VBOX_WITH_STATISTICS 
     179uint32_t tlb_flush_count; 
     180uint32_t tb_flush_count; 
     181uint32_t tb_phys_invalidate_count; 
     182# endif 
     183#endif /* VBOX */ 
    178184 
    179185static void page_init(void) 
     
    378384    /* XXX: flush processor icache at this point if cache flush is 
    379385       expensive */ 
     386#if !defined(VBOX) || defined(VBOX_WITH_STATISTICS) 
    380387    tb_flush_count++; 
     388#endif 
    381389} 
    382390 
     
    559567    tb->jmp_first = (TranslationBlock *)((long)tb | 2); /* fail safe */ 
    560568 
    561 #ifndef VBOX 
     569#if !defined(VBOX) || defined(VBOX_WITH_STATISTICS) 
    562570    tb_phys_invalidate_count++; 
    563 #endif /* !VBOX */ 
     571#endif 
    564572} 
    565573 
     
    13771385    } 
    13781386#endif 
     1387#if !defined(VBOX) || defined(VBOX_WITH_STATISTICS) 
    13791388    tlb_flush_count++; 
     1389#endif 
    13801390} 
    13811391 

© 2008 Sun Microsystems, Inc.
ContactPrivacy policy