Example #1
0
PBYTE *T5( PBYTE *pMem )
{
      ODS( WIDE("Starting Defrag test\n"));
      DumpStats();
      {

         int i, r;
         for( i = 0; i < MAX_I/2; i++ )
         {
            r = i*2;
            if( r >= MAX_I )
               r -= (MAX_I - 1);
            pMem[r] = Release( pMem[r] );
         }
      DumpStats();
         for( i = 0; i < (MAX_I)/2; i++ )
         {
            r = i*2;
            Defragment( &pMem[r+1] );
         }
      DumpStats();
         for( ; i < MAX_I; i++ )
         {
            r = i*2;
            if( r >= MAX_I )
               r -= (MAX_I - 1);
            pMem[r] = Release( pMem[r] );
         }
      DumpStats();
      }
   IsDone();
   return pMem;
}
Example #2
0
void test12_8()
{
  std::cout << "==================== test12_8 ====================\n";
  const unsigned asize = 8;

  Digipen::Utils::srand(2, 1);
  BList<int, asize> bl;
  std::cout << "nodesize is " << bl.nodesize() << std::endl;
  unsigned low = 10;
  unsigned high = 99;
  unsigned range = high - low;
  unsigned size = 16;
  int *ia = new int[range];
  for (unsigned i = low; i < high; i++)
    ia[i - low] = i + 1;

  Shuffle(ia, range);
  for (unsigned i = 0; i < size; i++) 
  {
    bl.insert(ia[i]);
    //DumpList(bl, true);
    //DumpList(bl);
    //std::cout << "==========================\n";
  }
  DumpList(bl, false);
  DumpStats(bl);

  bl.clear();

  DumpList(bl, false);
  DumpStats(bl);
  std::cout << std::endl;
  delete [] ia;
}
Example #3
0
CGLMShaderPairCache::~CGLMShaderPairCache( )
{
	if (gl_shaderpair_cachelog/* .GetInt() */)
	{
		DumpStats();
	}

	// free all the built pairs
	// free the entry table
	bool purgeResult = this->Purge();
	Assert( !purgeResult );
	
	if (m_entries)
	{
		free( m_entries );
		m_entries = NULL;
	}

	if (m_evictions)
	{
		free( m_evictions );
		m_evictions = NULL;
	}

	if (m_hits)
	{
		free( m_hits );
		m_hits = NULL;
	}
}
Example #4
0
VOID Fini(int, VOID * v)
{   


    DumpStats(*out, GlobalStatsStatic, "static counts");
    
    *out << endl;

    ComputeGlobalStats();
    
    DumpStats(*out, GlobalStatsDynamic, "dynamic counts");

    *out << "# eof" <<  endl;

    out->close();
}
Example #5
0
CGLMShaderPairCache::~CGLMShaderPairCache( )
{
	if (gl_shaderpair_cachelog.GetInt())
	{
		DumpStats();
	}

	// free all the built pairs
	// free the entry table
	bool purgeResult = this->Purge();
	(void)purgeResult;
	Assert( !purgeResult );
	
	if (m_entries)
	{
		free( m_entries );
		m_entries = NULL;
	}

	if (m_evictions)
	{
		free( m_evictions );
		m_evictions = NULL;
	}

#if GL_SHADER_PAIR_CACHE_STATS
	if (m_hits)
	{
		free( m_hits );
		m_hits = NULL;
	}
#endif
}
Example #6
0
VProfilingCounter::~VProfilingCounter()
{
	if (fDebugDumpOnDelete)
	{
		DumpStats();
		Stop(false);
	}
}
Example #7
0
void GFXDebuggerPanel::OnDumpButton(wxCommandEvent& event)
{
	std::string dump_path = File::GetUserPath(D_DUMP_IDX) + "Debug/" +
		SConfig::GetInstance().m_LocalCoreStartupParameter.m_strUniqueID + "/";
	if (!File::CreateFullPath(dump_path))
		return;

	switch (m_pDumpList->GetSelection())
	{
		case 0: // Pixel Shader
			DumpPixelShader(dump_path);
			break;

		case 1: // Vertex Shader
			DumpVertexShader(dump_path);
			break;

		case 2: // Pixel Shader Constants
			DumpPixelShaderConstants(dump_path);
			wxMessageBox(_("Not implemented"), _("Error"), wxOK);
			break;

		case 3: // Vertex Shader Constants
			DumpVertexShaderConstants(dump_path);
			wxMessageBox(_("Not implemented"), _("Error"), wxOK);
			break;

		case 4: // Textures
			DumpTextures(dump_path);
			wxMessageBox(_("Not implemented"), _("Error"), wxOK);
			break;

		case 5: // Frame Buffer
			DumpFrameBuffer(dump_path);
			wxMessageBox(_("Not implemented"), _("Error"), wxOK);
			break;

		case 6: // Geometry
			DumpGeometry(dump_path);
			wxMessageBox(_("Not implemented"), _("Error"), wxOK);
			break;

		case 7: // Vertex Description
			DumpVertexDecl(dump_path);
			wxMessageBox(_("Not implemented"), _("Error"), wxOK);
			break;

		case 8: // Vertex Matrices
			DumpMatrices(dump_path);
			wxMessageBox(_("Not implemented"), _("Error"), wxOK);
			break;

		case 9: // Statistics
			DumpStats(dump_path);
			wxMessageBox(_("Not implemented"), _("Error"), wxOK);
			break;
	}
}
Example #8
0
void Mask::UpdateBeadFindOutcomes( Region &wholeChip, char const *maskFileName, bool not_single_beadfind, int update_stats, char const *maskStatsName)
{
  // write the beadmask in maskPtr to file maskFileName
  if (!update_stats)
  {
    DumpStats (wholeChip, (char *)maskStatsName, not_single_beadfind);
  }
  WriteRaw (maskFileName);
  validateMask();
}
Example #9
0
int main(int argc, char* argv[])
{
    if (argc >= 1 && strcmp(argv[1], "-v") == 0)
    {
        PrintVersion();
        return 0;
    }

    if (argc < 3)
        return PrintHelp();

    bool sounds = false;
    bool stats = false;

    int arg = 1;
    for (arg = 1; arg < argc; arg++)
    {
        if (strcmp(argv[arg], "-s") == 0)
            sounds = true;
        else if (strcmp(argv[arg], "-i") == 0)
            stats = true;
        else
            break;
    }

    // Make sure we have 1 arg left after getting the options
    char* pageFile = nil;
    if (arg < argc)
        pageFile = argv[arg];
    else
        return PrintHelp();

    // Init our special resMgr
    plResMgrSettings::Get().SetFilterNewerPageVersions(false);
    plResMgrSettings::Get().SetFilterOlderPageVersions(false);
    plResMgrSettings::Get().SetLoadPagesOnInit(false);
    gResMgr = new plResManager;
    hsgResMgr::Init(gResMgr);
    gResMgr->AddSinglePage(pageFile);

    if (sounds)
        DumpSounds();
    if (stats)
    {
        char path[256];
        strcpy(path, pageFile);
        plFileUtils::StripFile(path);
        DumpStats(path);
    }

    hsgResMgr::Shutdown();

    return 0;
}
Example #10
0
void
ExitError(short code)
{
    DumpStats();
    if (OutFileName) {
	fclose(stdout);
	remove(OutFileName);
    }
    if (ExitCode < code)
	ExitCode = code;
    exit(ExitCode);
}
Example #11
0
void test2()
{
  std::cout << "==================== test2 ====================\n";
  const unsigned asize = 4;

  Digipen::Utils::srand(2, 1);
  BList<Foo, asize> bl;
  std::cout << "nodesize is " << bl.nodesize() << std::endl;

  bl.insert(Foo(3,2));
  DumpList(bl, false);  
  bl.insert(Foo(1,2));
  DumpList(bl, false);  
  bl.insert(Foo(2, 5));
  DumpList(bl, false);  
  bl.insert(Foo(2,7));
  DumpList(bl, false);  
  bl.insert(Foo(2,2));
  DumpList(bl, false);  
  bl.insert(Foo(3, 8));
  DumpList(bl, false);  
  DumpList(bl, true); 
  DumpStats(bl);

  int index = bl.find(Foo(2,7));
  std::cout << "Index of " << Foo(2,7) << " is " << index << std::endl;
  index = bl.find(Foo(1,8));
  std::cout << "Index of " << Foo(1,8) << " is " << index << std::endl << std::endl;

  bl.remove(1);
  DumpList(bl, false);  

  bl.remove_by_value(Foo(2,7));
  DumpList(bl, false);  
  DumpStats(bl);

  std::cout << "==========================\n";
  std::cout << std::endl;
}
Example #12
0
void TCPTest1000Byte( void )
{
	int n;
   uint32_t sec = time(NULL);
	while( (sec+5) > time(NULL) )
	//for( n = 0; n < 10000; n++ )
	{
		l.waiting = 1;

		SetTick( l.start );
		SendTCP( l.pClient, l.data, 1000 );
	// have to wait here until the responce is received.
		while( l.waiting )
         Relinquish();
	}
   DumpStats();
}
Example #13
0
VOID Fini(int, VOID * v)
{
    string filename =  KnobOutputFile.Value();

    if( KnobPid )
    {
        filename += "." + decstr( getpid_portable() );
    }

    std::ofstream out(filename.c_str());

    DumpStats(out);
    
    out << "# $eof" <<  endl;

    out.close();
}
Example #14
0
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
// push_front
void test1_1()
{
  std::cout << "==================== test1_1 ====================\n";
  const unsigned asize = 1;

  BList<int, asize> bl;
  std::cout << "nodesize is " << bl.nodesize() << std::endl;
  for (int i = 1; i <= 16; i++)
  {
    bl.push_front(i);
    //DumpList(bl);
    //std::cout << "==========================\n";
  }
  DumpList(bl, false);
  DumpList(bl, true);
  DumpStats(bl);
  std::cout << std::endl;
}
Example #15
0
bool Lacrimi::run()
{
    Delay(400);
    if(GetConfigBool("Features", "LuaEngine", true))
    {
        L_LuaEngineMgr = new LuaEngineMgr();
        L_LuaEngineMgr->Startup();
        Delay(100);
        while(LuaEngineIsStarting)
            Delay(100);
    }

    uint32 curTime = getMSTime();
    uint32 m_StatDumpTimer = curTime+15000, m_CleanupDelay = curTime+10000;
    while(GetThreadState() != THREADSTATE_SELF_TERMINATE)
    {
        curTime = getMSTime();
        if(!SetThreadState(THREADSTATE_BUSY))
            break;

        if(dumpstats)
        {
            if(curTime > m_StatDumpTimer)
            {
                DumpStats();
                m_StatDumpTimer = curTime+60000;
            }
        }

        if(curTime > m_CleanupDelay)
            Cleanup();
        if(!SetThreadState(THREADSTATE_SLEEPING))
            break;
        Delay(5);
    }
    sLog.Notice("Lacrimi", "Terminating...");

    FinalCleanup();
    if(database)
        _StopDB();
    OnShutdown();
    return true;
}
Example #16
0
void Test1Byte( void ) /*FOLD00*/
{
	uint32_t responce;
   uint32_t reslen = 4096;
	int n;
   uint32_t sec = time(NULL);
	while( (sec+5) > time(NULL) )
	//for( n = 0; n < 10000; n++ )
	{
		SetTick( l.start );
		if( !TransactServerMessage( l.MsgBaseClient + MSG_Test1
										  , l.data, 1
										  , &responce, l.data_in, &reslen ) )
		{
			printf( WIDE("Transact message generally failed - suppose that's a timeout.\n") );
		}
		else
		{
			if( responce & 0x80000000 )
				lprintf( WIDE("Responce was faillure from the server...") );
			else
		{
			uint64_t del;
			SetTick( l.end );
			l.accum += (del = l.end - l.start);
			l.passes++;
			l.bytes += reslen;
			if( (!l.min) || (del < l.min) )
				l.min = del;
			if( del > l.max )
				l.max = del;
			l.waiting = 0;
		}
		}
	}
   DumpStats();
}
Example #17
0
void test6_512()
{
  std::cout << "==================== test5_512 ====================\n";
  const unsigned asize = 512;

  BList<int, asize> bl;
  std::cout << "nodesize is " << bl.nodesize() << std::endl;
  unsigned low = 1000;
  unsigned high = 9999;
  unsigned range = high - low;
  unsigned size = 8000;
  int *ia = new int[range];
  for (unsigned i = low; i < high; i++)
    ia[i - low] = i + 1;

  Shuffle(ia, range);

  for (unsigned i = 0; i < size; i++)
    bl.insert(ia[i]);

  //DumpList(bl, true);
  //DumpList(bl, false);
  for (unsigned i = 0; i < size; i++)
  {
    int index = bl.find(ia[i]);
    if (index == -1)
      std::cout << "Item: " << ia[i] << " not found. Something's wrong.\n";
    else
      if (!(i % 400))
        std::cout << "Found " << ia[i] << " at index " << index << std::endl;
  }
  std::cout << std::endl;
  DumpStats(bl);
  std::cout << std::endl;

  delete [] ia;
}
Example #18
0
int
main(int argc, char *argv[])
{
  int opt;
  char *queryWord = NULL;
  char *queryFile = NULL;
  int discardDupFiles = 1;
  int cacheSizeInKB = 0;

  while ((opt = getopt(argc, argv, "ql:d:uw:f:bc:s:")) != -1) {
    switch (opt) {
      case 'q':
        quietFlag = 1;
        break;
      case 'l':
        diskLatency = atoi(optarg);
        break;
      case 'c':
        cacheSizeInKB = atoi(optarg);
        break;
      case 'b':
        diskBusyWaitEnable = 1;
        break;
      case 'u':
        discardDupFiles = 0;
        break;
      case 'w':
        queryWord = strdup(optarg);
        break;
      case 'f':
        queryFile = strdup(optarg);
        break;
      case 's':
        serverAckFd = atoi(optarg);
	diskLatency = 0;  /* Default for assignment 3 is zero-latency */
        break;
      case 'd': {
        char *c = optarg;
        while (*c) {
          Debug_SetFlag(*c, 1);
          c++;
        }
        break;
      }
      default:
        PrintUsageAndExit(argv[0]);
    }
  }
  if (optind != argc-1) {
    PrintUsageAndExit(argv[0]);
  }

  /*
   * Allocate Memory for any caching of data. 0 means infinite cache.
   */
  if (cacheSizeInKB == 0) {
    cacheSizeInKB = INFINITE_CACHE_SIZE/1024;  
  }
  int retVal = CacheMem_Init(cacheSizeInKB);
  if (retVal < 0) {
    fprintf(stderr, "Can't allocate memory for cache\n");
    return 1;
  }

  char *diskpath = diskpath = argv[optind];
  BuildDiskIndex(diskpath, discardDupFiles);

  if (queryWord) {
    TestServiceBySingleWord(queryWord);
  }
  if (queryFile) {
    TestServiceByFileOfWords(queryFile);
  }

  if (serverAckFd) {
    ServerMode(serverAckFd);
  }
  if (!quietFlag) {
    printf("************ Stats ***************\n");
    DumpStats(stdout);
    DumpUsageStats(stdout);
  }

  exit(EXIT_SUCCESS);
  return 0;
}
Example #19
0
MemoryTracker::~MemoryTracker() {
	DumpStats();
	DumpLeaks();
}