Commit Graph

707 Commits

Author SHA1 Message Date
Aliaksey Kandratsenka 7271bb72be unbreak cmake check for TLS support 2021-02-14 15:44:14 -08:00
Aliaksey Kandratsenka 7c106ca241 don't bother checking for stl namespace and use std
Because there are no compilers left that don't do std namespace.
2021-02-14 15:44:14 -08:00
Aliaksey Kandratsenka 0d6f32b9ce use standard way to print size_t-sized ints
I.e. just use zu/zd/zx instead of finding out right size and defining
PRI{u,x,d}S defines. Compilers have long caught up to this part of
standard.
2021-02-14 15:44:14 -08:00
Aliaksey Kandratsenka 0c11d35f4a amputate checking for __int64
Since everything supports stdint.h this days.
2021-02-14 15:44:14 -08:00
Aliaksey Kandratsenka 92718aaaeb amputate checking for conflict-signal.h
It was never found or used.
2021-02-14 15:12:19 -08:00
Aliaksey Kandratsenka 9bb2937261 amputate checking for inline keyword support
It is supported everywhere now.
2021-02-14 15:12:19 -08:00
Đoàn Trần Công Danh d9c4c3b481 profile-handler: use documented sigev_notify_thread_id in sigevent
sigevent(7) is documented to have sigev_notify_thread_id as its member.
In glibc system, it's a macro expanded to the legacy _sigev_un._tid,
_sigev_un._tid is obviously an internal implementation detail as
signaled by its underscore prefix. And this macro was hidden inside
linux/signal.h in older version of glibc.

On Linux that use musl libc, sigev_notify_thread_id is also a macro, but
it's expanded to __sev_fields.sigev_notify_thread_id

[alkondratenko@gmail.com: amputated broken linux/signal.h dependency]
[alkondratenko@gmail.com: see https://github.com/gperftools/gperftools/pull/1250]
Signed-off-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
2021-02-14 12:50:10 -08:00
Đoàn Trần Công Danh 43459feb33 configure.ac: check for features.h once 2021-02-14 11:28:07 -08:00
Venkatesh Srinivas 290b123c01 atomicops: Remove Acquire_Store / Release_Load
gperftools' internal atomicops library included atomic
Release Load and Acquire Store operations; those operations
were unused and expressed ordering constraints that aren't
expressible in the C++ standard memory model.

Remove them, to make a transition to C++11 atomics easier
and to avoid confusing use of them.
2021-02-14 11:23:42 -08:00
SSE4 3b1c60cc4e Add support for Elbrus 2000 (e2k) 2021-01-30 13:45:18 -08:00
Jarno Rajahalme c5747615da syscall: Mark x8 as clobbered
Mark arm64 register x8 as clobbered by syscall body inline assembly as
it is being used to store the syscall number. Otherwise the compiler
may try to use it for some other purpose.

This fix is derived from a resolution to clang Bugzilla report
https://bugs.llvm.org/show_bug.cgi?id=48798.  See this report for a
minimal reproducer derived from the code fixed here as well as the
resolution.

This should fix SEGFAULTs as reported in
https://github.com/envoyproxy/envoy/issues/14756.

Fixes: #1241
Signed-off-by: Jarno Rajahalme <jarno@covalent.io>
2021-01-30 13:43:03 -08:00
Aliaksey Kandratsenka d8eb315fb1 bump version to 2.8.1 2020-12-20 23:35:08 -08:00
Aliaksey Kandratsenka 6ed61f8e91 add note that cmake build is preliminary 2020-12-19 19:14:50 -08:00
okhowang(王沛文) 6bbf2ed150 Update cmake 2020-12-19 18:52:40 -08:00
Isaac Hier 913d3eb7d7 Fix a few macros for Apple 2020-12-19 18:52:40 -08:00
Isaac Hier 64a73b1cb8 Work on fixing linking errors in stacktrace 2020-12-19 18:52:40 -08:00
Isaac Hier b788d51eb4 Fix conditional definitions 2020-12-19 18:52:40 -08:00
Isaac Hier 495229b625 Make internal tcmalloc libs 2020-12-19 18:52:40 -08:00
Isaac Hier cca7f6f669 More unit tests and libraries 2020-12-19 18:52:40 -08:00
Isaac Hier 11dc65c3c4 Fix config headers, add more unit tests 2020-12-19 18:52:40 -08:00
Isaac Hier 6078fe40d9 Finish configure.ac conversion to CMake, start on Makefile.am 2020-12-19 18:52:40 -08:00
Isaac Hier 515fb22196 Generate config header 2020-12-19 18:52:40 -08:00
Isaac Hier 4adb5ff74d Add architecture checks 2020-12-19 18:52:40 -08:00
Isaac Hier fa9bedc82c Add most of CMake build 2020-12-19 18:52:40 -08:00
Isaac Hier 9e4f72fd1f Define options, start system checks 2020-12-19 18:52:40 -08:00
Isaac Hier a6ce98174b Add CMakeLists.txt 2020-12-19 18:52:40 -08:00
Steve Langasek 3134955875 Additional porting for riscv64.
Adds handling for the PC register, malloc_hook_mmap, and syscalls.

Successfully built in Ubuntu with these changes.
2020-12-19 18:16:39 -08:00
Steve Langasek f0e289bdbb Enable build on riscv64.
Cacheline length may be implementation-specific, but this is known to be
correct on the U54.
2020-12-19 18:16:38 -08:00
Tim Gates 6c715b4fa1 docs: fix simple typo, defininitions -> definitions
There is a small typo in src/base/linux_syscall_support.h.

Should read `definitions` rather than `defininitions`.
2020-12-19 18:15:14 -08:00
Aliaksey Kandratsenka 02d5264018 Revert "drop page heap lock when returning memory back to kernel"
This reverts commit be3da70298.

There are reports of crashes and false-positive OOMs from this
patch. Crashes under aggressive decommit mode are understood, but I
have yet to get confirmations whether false-positive OOMs were seen
under aggressive decommit or not. Thus lets revert for now.

Updates issue #1227 and issue #1204.
2020-12-19 17:15:31 -08:00
Grant Henke 151cbf5146 Add OS X arm64 program counter
[alkondratenko@gmail.com: updated comment that it is tested]

Signed-off-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
2020-12-19 12:39:15 -08:00
Aliaksey Kandratsenka (aka Aliaksei Kandratsenka) 140e3481d0
Merge pull request #1231 from PatriosTheGreat/master
Fix implicit-int-float-conversion warning.
2020-11-17 14:30:59 -08:00
Levon Ter-Grigoryan 0fc5cabdfc Fix implicit-int-float-conversion warning. 2020-11-17 12:29:22 +01:00
Kerrick Staley bda3c82e11 Increase kMaxStackDepth to 254
[alkondratenko@gmail.com: reduced value from 256 to 254]
2020-07-11 21:25:45 -07:00
Aliaksey Kandratsenka 1d9b8bb59d don't test sbrk hook if we're on linux and don't have __sbrk
"mmap" hooks code for linux only hooks sbrk when __sbrk is
defined. But musl doesn't offer this function (reasonably so), so
sbrk hooking doesn't work there. Not big loss, but lets make sure
tests don't fail.

Lets reference this to issue #1198
2020-07-11 20:51:50 -07:00
Aliaksey Kandratsenka 180bfa10d7 bumped version to 2.8 2020-07-06 02:51:43 -07:00
Ryan Macnak c1bcc412ba Don't try to mark esp as clobbered in linux syscall support.
Compare 9e5b162873, issue #1076
2020-07-06 01:46:48 -07:00
Aliaksey Kandratsenka 50f89afaed liberate gperftools tests from relying on -fno-builtin-XXX flags
Clang mostly ignores those anyways, so our tests needed better way to
disable optimizations (clang is quite aggressive replacing new/delete
pair with stack allocation).
2020-07-06 00:58:56 -07:00
Aliaksey Kandratsenka 98ccd0f102 prevent inlining in heap-checker unittest
The test relies on stuff "mmaper" function not being inlined, but
compilers are getting smarter and latest clang actually does inline it
now. Adding volatile to pointer declaration fixes it.
2020-07-05 23:26:12 -07:00
Aliaksey Kandratsenka e521472f1a fix linking of page_heap_test on windows
After change to release page heap lock around returning memory back to
kernel, page heap test got dependency on page heap lock. Which was not
available on windows since relevant symbols are not exported.

Proposed fix is to simply duplicate all needed .cc files in
page_heap_test project instead of linking to dll. This is not perfect
but gets job done, until we figure out better solution (GNU/Linux will
eventually get hidden visibility and will need it).

This fixes github issue 1189.
2020-07-05 23:17:36 -07:00
Aliaksey Kandratsenka e5f77d6485 chmod -x Makefile.am gperftools.sln 2020-03-23 01:22:16 -07:00
Aliaksey Kandratsenka 6b92e00cec don't assume HAVE_MMAP on mingw builds
Fixes github issue #1108.
2020-03-23 01:15:40 -07:00
Kirill Müller 4cddede399 New ProfilerGetStackTrace() 2020-03-08 23:58:13 -07:00
Aliaksey Kandratsenka db7aa547ab bumped version to 2.8rc 2020-03-08 21:06:08 -07:00
Aliaksey Kandratsenka be3da70298 drop page heap lock when returning memory back to kernel
Fixes issue #754.
2020-03-08 19:32:02 -07:00
Aliaksey Kandratsenka 87acc2782f amputate span events history
Nobody used it in years. Abseil tcmalloc had it amputated years ago.
2020-03-08 18:22:17 -07:00
Ilya Leoshkevich e40c7f231a Fix mmap syscall on s390
mmap arguments must be passed in an array on s390.

Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
2020-03-08 18:13:40 -07:00
Jon Kohler b7607ee7d4 tcmalloc: ability to disable fallback allocator in memfs
Whenever tcmalloc memfs allocator runs out of huge memory, it falls back to the
default system allocator, which will start allocating from normal anonymous
memory pool (small pages).  For use cases that exclusively want hugepage backed
memory, such as using tcmalloc in combination with Intel SPDK, this is
problematic.

This change adds an environment variable "TCMALLOC_MEMFS_DISABLE_FALLBACK"
which when set to true will ensure that tcmalloc doesn't fallback to using the
system allocator when the system runs out of hugepages. This is false by
default, such that all other tcmalloc consumers will not see any changes.

For those curious, you can see part of our upstream SPDK work here: 
https://review.gerrithub.io/c/spdk/spdk/+/475943
2020-02-23 12:25:15 -08:00
Jon Kohler 1bfcb5bc3a tcmalloc: fragmentation overhead instrumentation
This patch adds visibility into the overhead due to fragmentation for each size
class in the tcmalloc central free list, which is helpful when debugging
fragmentation issues.
2020-02-23 12:17:22 -08:00
Todd Lipcon 36bf1309de Fix a clang-tidy readability warning for static member access
This fixes the following warning:

src/thread_cache.cc:281:10: warning: static member accessed through instance [readability-static-accessed-through-instance]
  return sampler_.GetSamplePeriod();
         ^~~~~~~~~~~~~~~~~~~~~~~~
         tcmalloc::Sampler::
2020-02-10 00:53:46 -08:00