path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2018-02-27Symbolizer support for mingw and cygwin (#208)HEADmasterSergiu Deitsch5-10/+27
* added dbghelp symbolizer support for mingw and cygwin * fixed compiler errors in case <stdint.h> is not available * cmake: check whether SymFromAddr actually works
2018-01-16Add workaround for Bazel build on macOSRodrigo Queiro1-0/+12
This works around, and so closes #282.
2018-01-02Merge pull request #281 from sergiud/msvc-error-defineSergiu Deitsch1-1/+1
Fixed undeclared identifier error
2018-01-02logging_unittest: fixed undeclared identifier error (fixes #267)Sergiu Deitsch1-1/+1
2017-11-10Merge pull request #261 from pcc/fix3Fumitoshi Ukai1-52/+59
Compute base addresses from program headers while reading /proc/self/maps.
2017-11-08Compute base addresses from program headers while reading /proc/self/maps.Peter Collingbourne1-52/+59
We previously had logic to compute the base address from program headers as part of symbolization. The problem is that we need a correct base address earlier in order to adjust a PC into the image's address space, as these addresses can appear in unsymbolized output. There was previously an assumption that only the mapping that was lowest in the address space did not need to be adjusted. This assumption is not guaranteed (for example, the kernel may choose to map an ET_DYN lowest) and in fact turned out to be wrong in binaries linked with lld because the first mapping is read-only. The solution is to move the program header reading logic into the code that reads /proc/self/maps. There is a change in semantics for clients that install a callback using the InstallSymbolizeOpenObjectFileCallback function. Any such clients will need to return a correct base address from the callback by reading program headers using code similar to that in the function OpenObjectFileContainingPcAndGetStartAddress.
2017-11-04Merge pull request #106 from dimhotepus/masterSergiu Deitsch1-3/+4
Cache strlen outside of cycles (PVS-Studio)
2017-10-31Shell escape arguments to /bin/mail.Fumitoshi Ukai1-1/+40
2017-10-20Style fixes for consistencyShinichiro Hamaji1-8/+6
2017-10-20Merge pull request #245 from DariuszOstolski/issue211Shinichiro Hamaji1-1/+25
Fix username lookup in case of missing USER environment variable
2017-10-18#253: Use MS preprocessor idiom to disable warningDariusz Ostolski1-1/+2
2017-10-11Merge pull request #226 from sergiud/zero-allocation-log-failureShinichiro Hamaji4-21/+18
Zero allocation fix
2017-10-10fixed gcc logging failureSergiu Deitsch4-21/+18
2017-09-19Fix username lookup in case of missing USER environment variableDariusz Ostolski1-1/+25
2017-08-09Merge pull request #228 from sergiud/dll-export-fixShinichiro Hamaji4-4/+5
Fix for missing exports (fixes #227)
2017-08-09added missing exports (fixes #227)Sergiu Deitsch4-4/+5
2017-08-09Merge pull request #225 from jray272/remove-log-every-n-assertShinichiro Hamaji2-12/+0
Fix LOG_EVERY_N with clang -Wunused-local-typedef
2017-08-09Remove GOOGLE_GLOG_COMPILE_ASSERTJim Ray2-6/+0
This compile time assert is no longer used anywhere in glog. Remove it.
2017-08-06Fix LOG_EVERY_N with clang -Wunused-local-typedefJim Ray2-6/+0
Glog uses a pre-C++11 compile time assert to verify the validity of the severity parameter for LOG_EVERY_N. Unfortunately, some compilers will complain about the usage of LOG_EVERY_N with "-Wunused-local-typedef" due to the way the compile time assert is constructed. This makes it impossible to use LOG_EVERY_N with this warning treated as an error. The fix simply removes the assert entirely. This is safe to do since you can't put anything invalid into the severity parameters without generating a compile error elsewhere. This has been safe to do ever since the GLOG_ prefixes were added as part of 6febec361e. Fixes #223
2017-08-06Update Windows logging.h based on 2df0ca34aaJim Ray1-0/+7
Commit changes to src/windows/glog/logging.h that were missed in 2df0ca34aa. Because a change to src/glog/ was made, src/windows/ needed to be run.
2017-07-06Merge pull request #157 from sergiud/cygwin-supportShinichiro Hamaji2-3/+3
Cygwin support
2017-07-06Merge pull request #158 from sergiud/zero-allocationShinichiro Hamaji5-1/+46
[RFC] reduce heap memory allocations to zero
2017-07-06Merge pull request #145 from pixelb/rate-limit-posix-fadviseShinichiro Hamaji1-11/+14
rate limit calls to posix_fadvise()
2017-07-05reduce memory allocations to zeroHans-Andreas Engel5-1/+46
2017-06-27Support signal handler on WindowsAndrew Schwartzmeyer4-16/+53
2017-06-27Link to DbgHelp using pre-processor directiveAndrew Schwartzmeyer2-0/+2
This method ensure that all users of glog get automatically linked to the DbgHelp library without needing to set compiler flags.
2017-06-27Export GetStackTraceAndrew Schwartzmeyer1-1/+2
Necessary when building with BUILD_SHARED_LIBS=1.
2017-06-27Support symbolizer and demangler on WindowsAndrew Schwartzmeyer6-71/+180
2017-06-27Support stacktrace on WindowsAndrew Schwartzmeyer2-18/+52
2017-06-26Copy stacktrace_generic-inl.h for WindowsAndrew Schwartzmeyer1-0/+59
2017-05-09Add a hack for naive include scannersShinichiro Hamaji1-0/+8
2017-05-09Define OS_LINUX only if it's not defined yetShinichiro Hamaji1-1/+3
2017-05-09symbolize: Allow 4kB stack consumption on PPC64Shinichiro Hamaji1-0/+5
2017-05-09x86 stacktrace: Use __builtin_frame_address if possibleShinichiro Hamaji1-4/+11
2017-05-09Relax test for symbolizeShinichiro Hamaji1-2/+12
Don't rely on an internal-linkage extern "C" function having an unmangled name. This isn't required by the ABI, and in fact is not valid for a conforming compiler(!). Instead, allow symbolization to produce either a mangled or an unmangled name here.
2017-05-09Use LOG(FATAL) instead of CHECK(false)Shinichiro Hamaji1-1/+1
2017-05-09Run src/windows/preprocess.shShinichiro Hamaji1-0/+30
2017-04-20CHECK_NOTNULL works with smart pointers when compiled in C++11.Ning Ren1-0/+30
2017-03-07Add __declspec(noreturn) on Winmayah2-4/+4
Currently cl.exe doesn't know LOG(FATAL) exits the program. Set __declspec(noreturn).
2017-02-08DCHECK_ALWAYS_ON to make D* enabled under NDEBUGYoshisato Yanagisawa2-16/+28
The macro NDEBUG could be automatically defined for release build on some build environments (e.g. MSVC). If we use NDEBUG as a key to distinguish using DCHECK as CHECK (I call this DCHECK is enabled) or not, we cannot make DCHECK enabled for release build on such environments. Considering people use a program with glog for presubmit testing or dogfooding, they should need to do release build with DCHECK enabled.
2017-01-17fixed cygwin compilation errorsSergiu Deitsch2-3/+3
2016-12-09rate limit calls to posix_fadvise()Pádraig Brady1-11/+14
There can be a large kernel overhead involved in POSIX_FADV_DONTNEED. There is no point in calling this per item logged, so rate limit to at most once per 2MiB written. With a simple test program that logs 100K items at WARNING level: Before: $ time strace -c -e fadvise64 log.test \ -log_dir=/dev/shm -logtofiles=true -logtostderr=false % time seconds usecs/call calls errors syscall ------ ----------- ----------- --------- --------- ---------------- 100.00 12.522509 125 99957 fadvise64 ------ ----------- ----------- --------- --------- ---------------- real 0m52.671s user 0m2.194s sys 0m44.022s After: $ time strace -c -e fadvise64 log.test \ -log_dir=/dev/shm -logtofiles=true -logtostderr=false % time seconds usecs/call calls errors syscall ------ ----------- ----------- --------- --------- ---------------- 100.00 0.000759 152 5 fadvise64 ------ ----------- ----------- --------- --------- ---------------- real 0m4.206s user 0m1.436s sys 0m3.153s Fixes issue #84
2016-10-19Merge pull request #127 from MinGW-caffe/masterFumitoshi Ukai1-0/+2
try to avoid the error "conflicting declaration 'typedef DWORD pthread_t'" etc. in MinGW
2016-10-19Merge pull request #123 from yying/masterFumitoshi Ukai1-0/+1
Set sinks_ to NULL after deletion in LogDestination::DeleteLogDestinations
2016-10-19Merge pull request #116 from pcc/fix2Fumitoshi Ukai2-9/+1
Fix autotools build.
2016-10-03try to avoid the error "conflicting declaration 'typedef DWORDMiniLight1-0/+2
pthread_t'" etc.
2016-09-11NULL sinks_ after deletion to prevent dangling pointerAndy Ying1-0/+1
2016-06-23Fix autotools build.Peter Collingbourne2-9/+1
It looks like commit 3c49b93 modified the auto-generated file src/ to add a definition of macro GOOGLE_GLOG_DLL_DECL. One of the autotools reverts this change upon running "make", causing the build to fail when a source file includes demangle.h. To fix the problem, revert the change to src/ and include glog/logging.h from demangle.h which provides a definition of that macro.
2016-06-23symbolize: Calculate a module's zero VA using program headers.Peter Collingbourne1-3/+24
Previously we were using a module's "start address", i.e. the address at which the module's executable region was mapped, as the zero virtual address, i.e. the address from which the DSO's virtual addresses are calculated. This works fine for DSOs created by the bfd and gold linkers, which will emit a PT_LOAD directive into the program header which loads the executable region at virtual address (p_vaddr) and file offset (p_offset) 0. However, the lld linker may place a read-only region before the executable region, meaning that both p_vaddr and p_offset for the executable region are non-zero. This means that any symbols resolved by the symbolizer are resolved to an incorrect virtual address. To correctly calculate the address corresponding to virtual address zero, we need to take into account p_vaddr and p_offset. Specifically, the calculation starts with the "base address", i.e. the start address minus the file offset. To get from the base address to virtual address zero, we first add p_offset. This gives us the mapped address of the start of the segment, or in other words the mapped address corresponding to the virtual address of the segment. (Note that this is distinct from the start address, as p_offset is not guaranteed to be page aligned.) We then subtract p_vaddr, which takes us to virtual address zero.
2016-04-30Cache strlen outside of cycles (PVS-Studio)dimhotepus1-3/+4