- Timestamp:
- Nov 22, 2001, 2:35:42 PM (24 years ago)
- Location:
- trunk/src/odinprof
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/odinprof/profiler.cpp
r7423 r7427 1 /* $Id: profiler.cpp,v 1. 2 2001-11-22 11:34:43phaller Exp $ */1 /* $Id: profiler.cpp,v 1.3 2001-11-22 13:35:42 phaller Exp $ */ 2 2 /* 3 3 * Project Odin Software License can be found in LICENSE.TXT … … 710 710 { 711 711 PPROFILEENTRY p = (PPROFILEENTRY)arrEntries[i].pObject; 712 if (p->ulCalls > 1)713 712 fprintf(file, 714 713 "%10d %10d %10d %10d %10d %s(%s)\n", … … 738 737 { 739 738 PPROFILEENTRY p = (PPROFILEENTRY)arrEntries[i].pObject; 740 if (p->ulCalls > 1)741 739 fprintf(file, 742 740 "%10d %10d %10d %s(%s)\n", … … 764 762 { 765 763 PPROFILEENTRY p = (PPROFILEENTRY)arrEntries[i].pObject; 766 if (p->ulCalls > 1)767 764 fprintf(file, 768 765 "%10d %10d %10d %s(%s)\n", … … 790 787 { 791 788 PPROFILEENTRY p = (PPROFILEENTRY)arrEntries[i].pObject; 792 if (p->ulCalls > 1)793 789 fprintf(file, 794 790 "%10d %10d %10d %s(%s)\n", … … 810 806 // write to file 811 807 fprintf(file, 812 " Functions / symbols sorted by address\n"808 "\nFunctions / symbols sorted by address\n" 813 809 "Address ----- Function / Symbol -------------------------------------------\n"); 814 810 for(i = 0; … … 817 813 { 818 814 PPROFILEENTRY p = (PPROFILEENTRY)arrEntries[i].pObject; 819 if (p->ulCalls > 1)820 815 fprintf(file, 821 816 "#%08xh %-9s %s\n", … … 825 820 } 826 821 822 // at last print the sym map 823 pSymPool->printSYMs(file); 827 824 828 825 ProfilerEnable(flagLock); -
trunk/src/odinprof/symfile.cpp
r7423 r7427 1 /* $Id: symfile.cpp,v 1. 2 2001-11-22 11:34:43phaller Exp $ */1 /* $Id: symfile.cpp,v 1.3 2001-11-22 13:35:42 phaller Exp $ */ 2 2 /* 3 3 * Project Odin Software License can be found in LICENSE.TXT … … 395 395 if (NULL == pSym) 396 396 { 397 CHAR szFilename[260];397 DosEnterCritSec(); 398 398 399 // 1 - locate the file 400 APIRET rc = searchModule(pszModule, szFilename, sizeof(szFilename)); 399 // try again since someone else could have loaded the map already 400 pSym = (LXSymbolFile*)pHashModules->getElement(pszModule); 401 if (NULL == pSym) 402 { 403 CHAR szFilename[260]; 404 405 // 1 - locate the file 406 APIRET rc = searchModule(pszModule, szFilename, sizeof(szFilename)); 407 408 // create new entry 409 pSym = new LXSymbolFile(pszModule, szFilename); 410 411 // parse the file 412 if (rc == NO_ERROR) 413 pSym->parseFile(); 414 else 415 pSym->setErrorMessage("file not found"); 416 417 // add to the hashtable 418 PSZ pszCopyOfModuleName = strdup(pszModule); 419 pHashModules->addElement(pszCopyOfModuleName, pSym); 420 } 401 421 402 // create new entry 403 pSym = new LXSymbolFile(pszModule, szFilename); 404 405 // parse the file 406 if (rc == NO_ERROR) 407 pSym->parseFile(); 408 else 409 pSym->setErrorMessage("file not found"); 410 411 // add to the hashtable 412 pHashModules->addElement(pszModule, pSym); 422 DosExitCritSec(); 413 423 } 414 424 … … 457 467 } 458 468 469 470 static int _Optlink sortHashtableSYMs(const void *arg1,const void *arg2) 471 { 472 PHASHTABLEENTRY pHTE1 = (PHASHTABLEENTRY)arg1; 473 PHASHTABLEENTRY pHTE2 = (PHASHTABLEENTRY)arg2; 474 475 LXSymbolFile* p1 = (LXSymbolFile*)pHTE1->pObject; 476 LXSymbolFile* p2 = (LXSymbolFile*)pHTE2->pObject; 477 478 return stricmp(p1->getName(), p2->getName()); 479 } 480 481 482 void SymbolFilePool::printSYMs(FILE *file) 483 { 484 int iEntries = pHashModules->getNumberOfElements(); 485 486 // get a list of all entries of the hashtable 487 PHASHTABLEENTRY arrEntries = (PHASHTABLEENTRY)malloc( iEntries * sizeof(HASHTABLEENTRY) ); 488 iEntries = pHashModules->getElementMap(arrEntries); 489 490 fprintf(file, 491 "\nSymbolic debug information maps (%d maps)\n", 492 iEntries); 493 494 // sort the list by name 495 qsort(arrEntries, 496 iEntries, 497 sizeof( HASHTABLEENTRY ), 498 sortHashtableSYMs); 499 500 // write to file 501 fprintf(file, 502 "Module ---- Status --------------------------------------------------------\n"); 503 for(int i = 0; 504 i < iEntries; 505 i++) 506 { 507 LXSymbolFile* p = (LXSymbolFile*)arrEntries[i].pObject; 508 fprintf(file, 509 "%-10s %s (%s)\n", 510 p->getName(), 511 p->getFileName(), 512 (p->getErrorMessage() != NULL) ? p->getErrorMessage() : ""); 513 } 514 } -
trunk/src/odinprof/symfile.h
r7423 r7427 1 /* $Id: symfile.h,v 1. 2 2001-11-22 11:34:44phaller Exp $ */1 /* $Id: symfile.h,v 1.3 2001-11-22 13:35:42 phaller Exp $ */ 2 2 /* 3 3 * Project Odin Software License can be found in LICENSE.TXT … … 164 164 ULONG ulNameBufferLength, 165 165 PULONG pulSymbolOffset); 166 void printSYMs(FILE *file); 166 167 167 168 protected:
Note:
See TracChangeset
for help on using the changeset viewer.