TODO 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. * Get heap-profile-table.cc using DeleteMatchingFiles
  2. * Get heap-profile-table.cc using FillProcSelfMaps, DumpProcSelfMaps
  3. * Play around with ExperimentalGetStackTrace
  4. * Support the windows-level memory-allocation functions? See
  5. /home/build/googleclient/earth/client/tools/memorytracking/client/memorytrace/src/memorytrace.cpp
  6. /home/build/googleclient/total_recall/common/sitestep/*
  7. http://www.internals.com/articles/apispy/apispy.htm
  8. http://www.wheaty.net/APISPY32.zip
  9. * Verify /proc/xxx/maps:
  10. http://www.geocities.com/wah_java_dotnet/procmap/index.html
  11. * Figure out how to edit the executable IAT so tcmalloc.dll is loaded first
  12. * Use QueryPerformanceCounter instead of GetTickCount() (also for sparsehash)
  13. ----
  14. More info on windows-level memory-allocation functions:
  15. C runtime malloc
  16. LocalAlloc
  17. GlobalAlloc
  18. HeapAlloc
  19. VirtualAlloc
  20. mmap stuff
  21. malloc, LocalAlloc and GlobalAlloc call HeapAlloc, which calls
  22. VirtualAlloc when needed, which calls VirtualAllocEx (the __sbrk equiv?)
  23. siggi sez: If you want to do a generic job, you probably need to
  24. preserve the semantics of all of these Win32 calls:
  25. Heap32First
  26. Heap32ListFirst
  27. Heap32ListNext
  28. Heap32Next
  29. HeapAlloc
  30. HeapCompact
  31. HeapCreate
  32. HeapCreateTagsW
  33. HeapDestroy
  34. HeapExtend
  35. HeapFree
  36. HeapLock
  37. HeapQueryInformation
  38. HeapQueryTagW
  39. HeapReAlloc
  40. HeapSetInformation
  41. HeapSize
  42. HeapSummary
  43. HeapUnlock
  44. HeapUsage
  45. HeapValidate
  46. HeapWalk
  47. kernel32.dll export functions and nt.dll export functions:
  48. http://www.shorthike.com/svn/trunk/tools_win32/dm/lib/kernel32.def
  49. http://undocumented.ntinternals.net/
  50. You can edit the executable IAT to have the patching DLL be the
  51. first one loaded.
  52. Most complete way to intercept system calls is patch the functions
  53. (not the IAT).
  54. Microsoft has somee built-in routines for heap-checking:
  55. http://support.microsoft.com/kb/268343
  56. ----
  57. Itimer replacement:
  58. http://msdn2.microsoft.com/en-us/library/ms712713.aspx
  59. ----
  60. Changes I've had to make to the project file:
  61. 0) When creating the project file, click on "no autogenerated files"
  62. --- For each project:
  63. 1) Alt-F7 -> General -> [pulldown "all configurations" ] -> Output Directory -> $(SolutionDir)$(ConfigurationName)
  64. 2) Alt-F7 -> General -> [pulldown "all configurations" ] -> Intermediate Directory -> $(ConfigurationName)
  65. --- For each .cc file:
  66. 1) Alt-F7 -> C/C++ -> General -> [pulldown "all configurations"] -> Additional Include Directives --> src/windows + src/
  67. 2) Alt-F7 -> C/C++ -> Code Generation -> Runtime Library -> Multi-threaded, debug/release, DLL or not
  68. --- For DLL:
  69. 3) Alt-F7 -> Linker -> Input -> [pulldown "all configurations" ] -> Module Definition File -> src\windows\vc7and8.def
  70. --- For binaries depending on a DLL:
  71. 3) Right-click on project -> Project Dependencies -> [add dll]
  72. --- For static binaries (not depending on a DLL)
  73. 3) Alt-F7 -> C/C++ -> Command Line -> [pulldown "all configurations"] -> /D PERFTOOLS_DLL_DECL=