Commit Graph

341 Commits

Author SHA1 Message Date
Aliaksey Kandratsenka
4380908093 lowered autoconf requirement
Autoconf 2.59 works. And most notably it will not affect our releases
which are all prepared with newer autoconf.
2013-08-29 19:40:51 +03:00
Joon-Sung Um
7a178d4727 Update document for tcmalloc
Update tcmalloc.html for new parameters.

 * kMaxSize = 256k
 * kNumClasses = 88
 * kPageShift = 13

Signed-off-by: Aliaksey Kandratsenka <alk@tut.by>
2013-08-29 14:53:21 +03:00
Aliaksey Kandratsenka
313e08b5a1 issue-560: Revert "issue-481: ...
...Replaced test mechanism for distinct address spaces with a more
reliable mechanism"

This reverts commit 5dd53ab6cb (svn
revision 167)

With this commit rhel 6.2 fails heap-checker-death_unittest and
without it passes.

Ticket refers to 2 things and both are invalid:

* that ptrace PEEKDATA ignores data argument. I've checked kernel
  source and found it to be wrong

* something about distinct address spaces

And in addition to all that original ticket admits that it doesn't fix
anything.

It looks like, compared to original code that "fix" is not succesfully
wait-ing on parent's ptrace request. I.e. by adding some additional
diagnostics I'm seeing this sys_waitpid returning ECHILD.
2013-08-17 19:17:27 +03:00
Aliaksey Kandratsenka
6d00cbce92 issue-561: don't cast function pointer to void *
Which gcc-3.4 (as shipped in rhel 4) doesn't like.

Cast to void * was originally added to avoid issue on OSX which
doesn't have sighandler_t.

In that place we only need to know if it's null or not. So casting to
intptr_t looks like simplest possible way to achieve that.
2013-08-17 15:59:08 +03:00
Aliaksey Kandratsenka
7d8d522d73 add heap-profile-stats.h to dist .tar.gz 2013-08-17 15:52:22 +03:00
Aliaksey Kandratsenka
d76cfa6d6c issue-502: Count m(un)map for each stacktrace in MemoryRegionMap
..instead of HeapProfileTable

This upstreams chromium commit reviewed at:
https://codereview.chromium.org/12388070

Original and upstreaming author is: Dai MIKURUBE

This patch fixes a bug that gperftools(TCMalloc)'s mmap profiler
(HEAP_PROFILE_MMAP) doesn't hook some memory pages used by the
profiler itself.

This problem has been lived in gperftools for a long time.
It is discussed in gperftools' issue 502.
https://code.google.com/p/gperftools/issues/detail?id=502

Some bugs in the mmap profiler were fixed by
https://code.google.com/p/gperftools/issues/detail?id=383,
but the patch in the issue 383 didn't fix the bug mentioned in
the issue 502.

This change reverts the previous patch and http://crrev.com/132771
at first. Then, it modifies MemoryRegionMap to count m(un)map
calls for each stacktrace in itself instead of merging the counts
for each stacktrace in HeapProfileTable.

This change also cleans up heap-profiler, heap-profile-table and
deep-heap-profile.

Chromium-BUG=https://code.google.com/p/chromium/issues/detail?id=181517
Chromium-Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=188176
2013-08-04 18:52:28 +03:00
Aliaksey Kandratsenka
89b163a088 added .gitignore 2013-08-04 18:27:07 +03:00
alkondratenko@gmail.com
18fbc316ee Fix a C++11 error.
This merges patch by Nico Weber.

New clang versions complain in C++11 mode that:

error: cannot initialize a variable of type 'void *' with an rvalue of type 'uintptr_t' (aka 'unsigned long')

This same change was done for the google-internal version of tcmalloc too.

Reviewed-at: https://codereview.appspot.com/12132043



git-svn-id: http://gperftools.googlecode.com/svn/trunk@238 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-07-31 04:02:19 +00:00
alkondratenko@gmail.com
674fcd94a8 bump version to 2.1
git-svn-id: http://gperftools.googlecode.com/svn/trunk@236 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-07-30 09:14:20 +00:00
alkondratenko@gmail.com
805a660193 issue-559: don't setup fork handler in InitStaticVars
Because on OSX it calls malloc which leads to deadlock.

Given that we don't really need that fork handler _that_ early, it's
fine to change it to normal static initializer



git-svn-id: http://gperftools.googlecode.com/svn/trunk@235 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-07-30 08:30:45 +00:00
alkondratenko@gmail.com
c583a5babb issue-559: don't depend on sighandler_t
Which is not available on OSX.

I've also fixed style around this place.



git-svn-id: http://gperftools.googlecode.com/svn/trunk@234 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-07-30 08:30:19 +00:00
alkondratenko@gmail.com
1af20041bf issue-559: AtomicWord xxx_AtomicExchange are all inline
Otherwise OSX correctly complains about duplicate definitions



git-svn-id: http://gperftools.googlecode.com/svn/trunk@233 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-07-30 08:29:46 +00:00
alkondratenko@gmail.com
7a9c4e075f issue-556: update windows PACKAGE_{VERSION,STRING}
git-svn-id: http://gperftools.googlecode.com/svn/trunk@232 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-07-26 19:36:08 +00:00
alkondratenko@gmail.com
11d46f0aac issue-556: dll-export getpagesize
Because page_heap_test needs this.



git-svn-id: http://gperftools.googlecode.com/svn/trunk@231 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-07-26 19:35:38 +00:00
alkondratenko@gmail.com
6d4ad4428b issue-556: drop malloc limit at the end of page_heap_test
Which otherwise causes somewhat weird stack overflow on release
windows builds.



git-svn-id: http://gperftools.googlecode.com/svn/trunk@230 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-07-26 19:35:20 +00:00
alkondratenko@gmail.com
be54c3f3ed issue-556: dll-export TCMalloc_System{Alloc,Release}
because page_heap_test is using this stuff



git-svn-id: http://gperftools.googlecode.com/svn/trunk@229 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-07-26 19:34:54 +00:00
alkondratenko@gmail.com
e3716145cb issue-552: Fix page_heap_test for system with different page size
This is patch by Adhemerval Zanella.

PowerPC uses 64K page size instead of 4k for x86 and x86_64. It makes the
page_heap_test fails because the following test:

 static bool HaveSystemRelease =
    TCMalloc_SystemRelease(TCMalloc_SystemAlloc(kPageSize, NULL, 0), kPageSize);

will always fail if kPageSize is less than getpagesize() (the default
configuration).

The following patch fixes it by trying to allocate/deallocate an entire
page instead.



git-svn-id: http://gperftools.googlecode.com/svn/trunk@228 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-07-26 18:19:05 +00:00
alkondratenko@gmail.com
f45133e75c issue-553: Fix syscall wrapper for PowerPC
This is patch by Adhemerval Zanella.

* src/stacktrace_powerpc-inl.h: It is just a cleanup for the stacktrace
  functions for PowerPC. The idea is to simplify the code.
* src/tests/heap-checker_unittest.cc: Handles the PPC64 function descriptor
  correctly in malloc tracers. Different from other architecture, for PPC64
  the address returned in function pointers are the ODP entry, not the
  symbol address in .text segment. This leads the comparison bogus, since
  it will compare a ODP entry with a .text address.
* src/heap-checker.cc: Add support for PPC in ptrace.
* src/base/elfcore.h: Likewise.
* src/base/linuxthreads.cc: Fix the thread creation using the clone wrapper.
* src/base/linux_syscall_support.h: Various fixes for PPC32 and PPC64:
  fixes the kernel_stat[64] struct layout, and sys_clone and sys_socket
  implementation.



git-svn-id: http://gperftools.googlecode.com/svn/trunk@227 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-07-26 18:04:03 +00:00
alkondratenko@gmail.com
ee2bf09713 updated NEWS and packages/ for 2.1rc
git-svn-id: http://gperftools.googlecode.com/svn/trunk@226 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-07-20 21:37:26 +00:00
alkondratenko@gmail.com
60ab178aeb bump version number for 2.1rc
git-svn-id: http://gperftools.googlecode.com/svn/trunk@225 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-07-20 21:37:01 +00:00
alkondratenko@gmail.com
7c2aa2f7c2 issue-546: fixed return type of Release_AtomicExchange on arm6+
git-svn-id: http://gperftools.googlecode.com/svn/trunk@224 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-07-20 21:35:56 +00:00
alkondratenko@gmail.com
d8e12e94ea issue-549: handle most recent mingw that has sleep and nanosleep
I.e. we have to check their presence in configure and in case of their
presence we have to avoid re-defining then in window's port.h



git-svn-id: http://gperftools.googlecode.com/svn/trunk@223 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-07-20 21:35:14 +00:00
alkondratenko@gmail.com
ac354636de issue-550: remove config.h.in
Which is autoconf product and thus is not needed in source repository



git-svn-id: http://gperftools.googlecode.com/svn/trunk@222 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-07-14 04:19:02 +00:00
alkondratenko@gmail.com
e54971d586 issue-534: fixed a number of gcc warnings
This applies patch from Adhemerval Zanella.



git-svn-id: http://gperftools.googlecode.com/svn/trunk@221 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-07-06 21:54:34 +00:00
alkondratenko@gmail.com
7dd038d7c5 issue-545: corrected README for CPUPROFILE_FREQUENCY variable
Applied patch by Mikhail Veltishchev



git-svn-id: http://gperftools.googlecode.com/svn/trunk@220 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-07-06 20:48:18 +00:00
alkondratenko@gmail.com
a833a146b7 issue-528: fixed spelling
This simply applies patch by Lajos Veres



git-svn-id: http://gperftools.googlecode.com/svn/trunk@219 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-07-06 20:46:50 +00:00
alkondratenko@gmail.com
205abf1e7c issue-518: add support for x32 ABI to linux_syscall_support.h
As pointed out in the ticket this is taken from chromium review system
here: https://codereview.chromium.org/13648012



git-svn-id: http://gperftools.googlecode.com/svn/trunk@218 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-05-12 19:15:13 +00:00
alkondratenko@gmail.com
376a3107aa issue-368: allocate enough bytes for large metadata allocations
During issue-368 review it was correctly pointed out then in place
where I compare metadata allocation size to threshold I should pass
that size down to TCMalloc_SystemAlloc instead of threshold.



git-svn-id: http://gperftools.googlecode.com/svn/trunk@217 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-05-07 22:28:05 +00:00
alkondratenko@gmail.com
58d39a1b21 issue-368: added missing large_heap_fragmentation_unittest.cc
git-svn-id: http://gperftools.googlecode.com/svn/trunk@216 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-05-07 22:23:37 +00:00
alkondratenko@gmail.com
c45bb7d603 issue-511: fixed negative offset handling for conditional jumps
While doing and testing issue-511 I've found one subtle bug which is
incorrect handling of short offsets. They are defined to be signed but
previous code used unsigned char for them which caused negative
offsets to look like larger positive offsets. Fix is trivial.



git-svn-id: http://gperftools.googlecode.com/svn/trunk@215 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-05-07 19:22:45 +00:00
alkondratenko@gmail.com
3567b1701a issue-511: recognise rex.w jmpq *<literal>(%rip) as iat jump
Apparently Windows Server 2012 (and presumably windows 8) now has this
form of iat jump. Which is quite useless (rex.w is according to my
understanding is not needed at all) but because of rex.w our code to
recognize jumps like that didn't work.

Fix is just skip this prefix.



git-svn-id: http://gperftools.googlecode.com/svn/trunk@214 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-05-07 19:15:35 +00:00
alkondratenko@gmail.com
7fcb5ac069 issue-511: implemented rel8 jump patching
I've found that Visual Studio 2012 release 32-bit C runtime library
patching fails because array new has rel8 jmp which previous code
could not handle.

Implementation is largely copied from conditional jumps handling code.



git-svn-id: http://gperftools.googlecode.com/svn/trunk@213 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-05-07 19:13:29 +00:00
alkondratenko@gmail.com
8cb4086a0a issue-368: test that we don't fragment large spans too badly
This adds unit test that does essentially same things as code to
reproduce bug in
https://code.google.com/p/gperftools/issues/detail?id=368




git-svn-id: http://gperftools.googlecode.com/svn/trunk@212 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-05-06 19:50:59 +00:00
alkondratenko@gmail.com
f25ac4421f issue-{368,443}: allocate metadata in big batches
It uses same approach as PageHeapAllocator. Namely allocates big chunk
which is then used to satisfy smaller allocations.

In issue-443 gradual heap grows causes old code that allocates
metadata in smaller pieces and thus more frequently to fragment the
heap. It's also causing most of 368 heap fragmentation too.

New code allocates 8 megs of address space at once for metadata
allocations. Most OSes will allocate actual memory only when
corresponding pages are touched. Thus this change should not cause
increased memory usage.

I've also made sure metadata is always properly aligned in case we
ever allocate something that breaks natural alignment. E.g. strings.



git-svn-id: http://gperftools.googlecode.com/svn/trunk@211 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-05-06 19:50:23 +00:00
alkondratenko@gmail.com
4fd762cead issue-368: unmap free spans and retry before growing heap
Because unmapped spans are not coalesced with normal spans it's
possible that we indeed have a large enough free span, but we fail to
see that because we always consider unmapped and normal spans
separately. That behavior is more likely for larger spans.

In order to protect programs that grow heap frequently and by small
amounts from much more frequent minor page faults, there's limit of
running that force pages unmap path once per 128 megs of heap growth.



git-svn-id: http://gperftools.googlecode.com/svn/trunk@210 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-05-06 19:49:48 +00:00
alkondratenko@gmail.com
99fe9944de issue-510: remove duplicate arm #elif
git-svn-id: http://gperftools.googlecode.com/svn/trunk@209 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-04-01 05:32:22 +00:00
alkondratenko@gmail.com
6354e2c8cd issue-506: fixed bogus unit test failure
Looks like my version of GCC is aware that free(malloc(X)) is a
no-op. So it optimizes that away completely ignoring simple fact that
we're observing malloc hooks invocations. By adding check that malloc
succeeded we force gcc to actually preserve that malloc call.



git-svn-id: http://gperftools.googlecode.com/svn/trunk@208 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-03-11 19:24:49 +00:00
alkondratenko@gmail.com
7896dcb9db issue-504: disable tls on mingw
Which is known to fail.



git-svn-id: http://gperftools.googlecode.com/svn/trunk@207 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-03-11 19:16:47 +00:00
alkondratenko@gmail.com
8bf4522aa5 issue-504: do not define HAVE_MMAP on mingw
Because, clearly, windows doesn't have one



git-svn-id: http://gperftools.googlecode.com/svn/trunk@206 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-03-11 19:15:46 +00:00
alkondratenko@gmail.com
9c24d255cd issue-504: add AM_LDFLAGS to all *_la targets
Because automake will not automatically add AM_LDFLAGS if there's
per-target LDFLAGS. See their good info manual.

This fixes .dll compilation of tcmalloc



git-svn-id: http://gperftools.googlecode.com/svn/trunk@205 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-03-11 19:15:23 +00:00
alkondratenko@gmail.com
a2275fc6b4 issue-504: don't try to typedef pid_t on mingw
Because recent mingws (more then few years ago seemingly) do that
already.



git-svn-id: http://gperftools.googlecode.com/svn/trunk@204 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-03-11 19:14:18 +00:00
alkondratenko@gmail.com
f00977533d issue-504: use gcc inline assembly atomic ops on mingw
Because those are well tested and can be trusted



git-svn-id: http://gperftools.googlecode.com/svn/trunk@203 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-03-11 19:13:53 +00:00
alkondratenko@gmail.com
34cdd6821b issue-504: use lowercase windows includes for mingw x-compilation
I.e. so that I can build tcmalloc.dll using comfortable environment of
my GNU/Linux box and without having to touch actual windows box or VM.



git-svn-id: http://gperftools.googlecode.com/svn/trunk@202 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-03-11 19:13:13 +00:00
alkondratenko@gmail.com
0971d80d0e issue-503: updated svn:ignore to ignore generated files
git-svn-id: http://gperftools.googlecode.com/svn/trunk@201 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-03-11 18:35:16 +00:00
alkondratenko@gmail.com
05b100d9d4 issue-503: removed checked in configure and other auto* products
So that it's easier to contribute and review contributions.

People wishing to build gperftools from svn checkout should run
autogen.sh first which will create those files and then ./configure &&
make as usual

INSTALL file has updated instructions too.



git-svn-id: http://gperftools.googlecode.com/svn/trunk@200 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-03-11 18:32:05 +00:00
alkondratenko@gmail.com
dcf55b976f issue-503: recover original INSTALL file
That was accidently overwritten by autotools files update in r196



git-svn-id: http://gperftools.googlecode.com/svn/trunk@199 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-03-11 18:29:00 +00:00
chappedm@gmail.com
5037f687d1 issue-425: Fixed tcmalloc unittest crashes for windows builds
Missing use of volatile was causing vs2010 to perform unwanted
optimization resulting in the crash. See issue for more details.


git-svn-id: http://gperftools.googlecode.com/svn/trunk@198 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-03-11 01:35:37 +00:00
chappedm@gmail.com
beb78cc05b issue-493: Fix for building against ARM targets
gperftools was failing to build for arm targets for the following reasons:
1. Some ARMv7 instructions used when the target is ARMv6 so those fail to assemble
2. The cache line length is undefined for ARM architectures


git-svn-id: http://gperftools.googlecode.com/svn/trunk@197 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-03-11 00:23:03 +00:00
chappedm@gmail.com
bd3b3a7e9a issue-496: Fixes an issue where tcmalloc might deadlock in a thread calling fork
tcmalloc contained a bug where some internal locks were left in a undefined state
between fork, leaving the child process in a deadlock state. This patch fixes the
issue by introducing stricter locking between the parent nd child while forking.


git-svn-id: http://gperftools.googlecode.com/svn/trunk@196 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-03-10 20:17:21 +00:00
chappedm@gmail.com
560ca8650c issue-491: Significant performance improvement for spin lock contention
This patch fixes issues where spinlocks under contention were failing to
wakeup waiters, sometimes resulting in blow ups from 13ns to as high as 256ms.
Under heavy contention, applications were observed sleeping for minutes at a
time giving the appearance of a hang.  


git-svn-id: http://gperftools.googlecode.com/svn/trunk@195 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2013-03-10 20:02:46 +00:00