mirror of
https://github.com/gperftools/gperftools
synced 2024-12-20 14:30:09 +00:00
6fa2a2574c
* google-perftools: version 1.0rc1 release * Replace API for selectively disabling heap-checker in code (sanjay) * Add a pre-mmap hook (daven, adlr) * Add MallocExtension interface to set memory-releasing rate (fikes) * Augment pprof to allow any string ending in /pprof/profile (csilvers) * PORTING: Rewrite -- and fix -- malloc patching for windows (dvitek) * PORTING: Add nm-pdb and addr2line-pdb for use by pprof (dvitek) * PORTING: Improve cygwin and mingw support (jperkins, csilvers) * PORTING: Fix pprof for mac os x, other pprof improvements (csilvers) * PORTING: Fix some PPC bugs in our locking code (anton.blanchard) * A new unittest, smapling_test, to verify tcmalloc-profiles (csilvers) * Turn off TLS for gcc < 4.1.2, due to a TLS + -fPIC bug (csilvers) * Prefer __builtin_frame_address to assembly for stacktraces (nlewycky) * Separate tcmalloc.cc out into multiple files -- finally! (kash) * Make our locking code work with -fPIC on 32-bit x86 (aruns) * Fix an initialization-ordering bug for tcmalloc/profiling (csilvers) * Use "initial exec" model of TLS to speed up tcmalloc (csilvers) * Enforce 16-byte alignment for tcmalloc, for SSE (sanjay) git-svn-id: http://gperftools.googlecode.com/svn/trunk@60 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
70 lines
3.3 KiB
Plaintext
70 lines
3.3 KiB
Plaintext
This project has begun being ported to Windows. A working solution
|
|
file exists in this directory:
|
|
google-perftools.sln
|
|
|
|
You can load this solution file into either VC++ 7.1 (Visual Studio
|
|
2003) or VC++ 8.0 (Visual Studio 2005) -- in the latter case, it will
|
|
automatically convert the files to the latest format for you.
|
|
|
|
There are a few issues compiling with VC++ 7.1, due to its lack of
|
|
support for __VA_ARGS__. If you need to compile perftools in that
|
|
environment, send mail to google-perftools@googlegroups.com; there may
|
|
be ways to work around this issue. The code compiles without problem
|
|
in VC++ 8.0 (Visual Studio 2005).
|
|
|
|
When you build the solution, it will create a number of unittests,
|
|
which you can run by hand (or, more easily, under the Visual Studio
|
|
debugger) to make sure everything is working properly on your system.
|
|
The binaries will end up in a directory called "debug" or "release" in
|
|
the top-level directory (next to the .sln file). It will also create
|
|
two binaries, nm-pdb and addr2line-pdb, which you should install in
|
|
the same directory you install the 'pprof' perl script.
|
|
|
|
Note that these systems are set to build in Debug mode by default.
|
|
You may want to change them to Release mode.
|
|
|
|
To use tcmalloc_minimal in your own projects, you should only need to
|
|
build the dll and install it someplace, so you can link it into
|
|
further binaries. To use the dll, you need to add the following to
|
|
the linker line of your executable:
|
|
"libtcmalloc_minimal.lib" /INCLUDE:"__tcmalloc"
|
|
|
|
Here is how to accomplish this in Visual Studio 2005 (VC8):
|
|
|
|
1) Have your executable depend on the tcmalloc library by selecting
|
|
"Project Dependencies..." from the "Project" menu. Your executable
|
|
should depend on "libtcmalloc_minimal".
|
|
|
|
2) Have your executable depend on a tcmalloc symbol -- this is
|
|
necessary so the linker doesn't "optimize out" the libtcmalloc
|
|
dependency -- by right-clicking on your executable's project (in
|
|
the solution explorer), selecting Properties from the pull-down
|
|
menu, then selecting "Configuration Properties" -> "Linker" ->
|
|
"Input". Then, in the "Force Symbol References" field, enter the
|
|
text "__tcmalloc" (without the quotes). Be sure to do this for both
|
|
debug and release modes!
|
|
|
|
You can also link tcmalloc code in statically -- see the example
|
|
project tcmalloc_minimal_unittest-static, which does this. For this
|
|
to work, you'll need to add "/D PERFTOOLS_DLL_DECL=" to the compile
|
|
line of every perftools .cc file. You do not need to depend on the
|
|
tcmalloc symbol in this case (that is, you don't need to do either
|
|
step 1 or step 2 from above).
|
|
|
|
The heap-profiler has had a preliminary port to Windows. It has not
|
|
been well tested, and probably does not work at all when Frame Pointer
|
|
Optimization (FPO) is enabled -- that is, in release mode. The other
|
|
features of perftools, such as the cpu-profiler and leak-checker, have
|
|
not yet been ported to Windows at all.
|
|
|
|
I have little experience with Windows programming, so there may be
|
|
better ways to set this up than I've done! If you run across any
|
|
problems, please post to the google-perftools Google Group, or report
|
|
them on the google-perftools Google Code site:
|
|
http://groups.google.com/group/google-perftools
|
|
http://code.google.com/p/google-perftools/issues/list
|
|
|
|
-- craig
|
|
|
|
Last modified: 18 November 2008
|