Skip to content

Commit 3d0d7d7

Browse files
committed
added libunwind support
1 parent 3b40a11 commit 3d0d7d7

18 files changed

+7279
-4598
lines changed

ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11

2+
0.4.0b Sun Aug 2 22:20:42 CEST 2015
3+
- use libunwind for backtrace if available
4+
- scripts modified to support decoding of libuwind based backtrace
5+
26
0.3.0 Sun Nov 23 21:12:54 CET 2014
37
- add manpages
48
- release

Makefile.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ LN_S = @LN_S@
200200
LOG_MALLOC2_API_VERSION = @LOG_MALLOC2_API_VERSION@
201201
LOG_MALLOC2_SO_VERSION = @LOG_MALLOC2_SO_VERSION@
202202
LTLIBOBJS = @LTLIBOBJS@
203+
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
203204
MAKEINFO = @MAKEINFO@
204205
MANIFEST_TOOL = @MANIFEST_TOOL@
205206
MKDIR_P = @MKDIR_P@

README

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
################################################################################
33

44
Program : log-malloc2 (library)
5-
Version : 0.3.0
5+
Version : 0.4.0
66
Purpose : Malloc logging library with backtrace and byte-exact memory
77
tracking.
88
License : GNU GPL v3 (see file COPYING)
99
GNU LGPL v3 (see file COPYING-LGPL)
10-
Author : Samuel Behan <_samuel_._behan_(at)_dob_._sk> (c) 2011-2014
10+
Author : Samuel Behan <_samuel_._behan_(at)_dob_._sk> (c) 2011-2015
1111
Web : http://devel.dob.sk/log-malloc2
1212
http://blog.dob.sk/category/devel/log-malloc2 (howto, tutorial)
1313

@@ -36,7 +36,7 @@ Web : http://devel.dob.sk/log-malloc2
3636
------------
3737

3838
* logging to file descriptor 1022 (if opened)
39-
* call stack backtrace (using GNU backtrace() if available)
39+
* call stack backtrace (via GNU backtrace() or libunwind)
4040
* requested memory tracking (byte-exact)
4141
* allocated memory tracking (byte-exact - using malloc_usable_size())
4242
* process memory status tracking (from /proc/self/statm)
@@ -82,8 +82,8 @@ Web : http://devel.dob.sk/log-malloc2
8282
* log-malloc-trackusage
8383
Script to track program memory usage over time.
8484

85-
This scripts can be also used as perl packages, because they export functions
86-
to parse and analyse trace file or convert backtraces.
85+
These scripts can be also used as perl packages, because they export functions
86+
to parse and analyse trace file or convert backtraces (modulino concept).
8787

8888

8989
---------
@@ -150,7 +150,7 @@ Web : http://devel.dob.sk/log-malloc2
150150
Pre-initializes backtrace() function, to avoid later memory alocations.
151151
Use of this function is optional.
152152

153-
ssize_t log_malloc_backtrace(int fd)
153+
ssize_t log_malloc_backtrace(int fd)
154154

155155
Generate current backtrace including process memory map (/proc/self/maps) to
156156
make backtrace symbol conversion easier. Generated output can be directly
@@ -162,8 +162,9 @@ Web : http://devel.dob.sk/log-malloc2
162162
--------------------
163163

164164
* Log to tmpfs, or other FS that handles write operation effectively
165+
165166
If traced application intensively allocates memory, consider logging to tmpf
166-
because writting to trace fd is the slowest operation, that is in addition
167+
because writting to trace fd is the slowest operation, that migbt be in addition
167168
protected by a mutex, thus serializing multithreaded memory allocations.
168169

169170

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@ produces simple text trace output, that makes it easy to find leaks and also ide
66

77
[![Build Status](https://travis-ci.org/samsk/log-malloc2.svg)](https://travis-ci.org/samsk/log-malloc2)
88

9+
910
#Features
1011

1112
- logging to file descriptor 1022 (if opened)
12-
- call stack **backtrace** (using GNU backtrace() if available)
13+
- call stack **backtrace** (via GNU backtrace() or libunwind)
1314
- **requested memory tracking** (byte-exact)
1415
- allocated memory tracking (byte-exact - using malloc_usable_size())
1516
- process memory status tracking (from /proc/self/statm)
@@ -26,6 +27,7 @@ OR
2627

2728
`LD_PRELOAD=./liblog-malloc2.so command args ... 1022>/tmp/program.log`
2829

30+
2931
#Helper scripts
3032

3133
- `backtrace2line`
@@ -39,7 +41,6 @@ OR
3941
- Script to track program memory usage over time.
4042

4143

42-
4344
# C API
4445

4546
- ```size_t log_malloc_get_usage(void)```
@@ -92,16 +93,19 @@ OR
9293
- **homepage**: [http://dob.sk](http://dob.sk?u=github)
9394
- **projects**: [http://devel.dob.sk](http://devel.dob.sk?u=github)
9495

96+
9597
# Licensing
9698

9799
* [LGPLv3](https://www.gnu.org/licenses/lgpl.html) for C code (library)
98100
* [GPLv3](https://www.gnu.org/licenses/gpl.html) for Perl code (scripts)
99101

102+
100103
# See Also
101104

102105
* More/Detailed info in project [README](README)
103106
* Project home: [http://devel.dob.sk/log-malloc2](http://devel.dob.sk/log-malloc2?u=github)
104107

108+
105109
#Examples
106110

107111
###Example Trace Output
@@ -176,7 +180,6 @@ OR
176180
7fffb54cf000-7fffb54d1000 r-xp 00000000 00:00 0 [vdso]
177181
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
178182

179-
180183
###Example leak
181184

182185
$ ./scripts/log-malloc-findleak.pl /tmp/lm2.trace

0 commit comments

Comments
 (0)