Re: [Valgrind-users] Valgrind Finds More Dynamic Allocations than Inte Pin

2019-02-10 Thread Ahmad Nouralizadeh
Thanks, everybody. I will try your suggestions. On Saturday, February 9, 2019, Philippe Waroquiers < philippe.waroqui...@skynet.be> wrote: > On Fri, 2019-02-08 at 21:02 +0330, Ahmad Nouralizadeh wrote: > > Thanks David, > > But heaptrack even reports a larger number: 153 MB! > > > > On Fri, Feb 8

Re: [Valgrind-users] Valgrind Finds More Dynamic Allocations than Inte Pin

2019-02-09 Thread Philippe Waroquiers
On Fri, 2019-02-08 at 21:02 +0330, Ahmad Nouralizadeh wrote: > Thanks David, > But heaptrack even reports a larger number: 153 MB! > > On Fri, Feb 8, 2019 at 8:09 PM David Faure wrote: > > On vendredi 8 février 2019 16:32:50 CET Ahmad Nouralizadeh wrote: > > > Hi, > > > I wrote a really simple Pi

Re: [Valgrind-users] Valgrind Finds More Dynamic Allocations than Inte Pin

2019-02-08 Thread John Reiser
On 2/8/19 10:58 AM, Ahmad Nouralizadeh wrote: By image, I mean the binary code of the program to be traced and all the shared libraries accessed by that program. As soon as they are loaded, they will be searched for calls to malloc,... and some code will be added before and after each call I

Re: [Valgrind-users] Valgrind Finds More Dynamic Allocations than Inte Pin

2019-02-08 Thread Ahmad Nouralizadeh
Hi Tom, Yes. ld.so is also an image that is looked for malloc calls. On Fri, Feb 8, 2019 at 10:31 PM Tom Hughes wrote: > Right but how does your program get control? Does it manage to see > all the allocations done by the dynamic linker before main is entered? > > Tom > > On 08/02/2019 18:58, Ah

Re: [Valgrind-users] Valgrind Finds More Dynamic Allocations than Inte Pin

2019-02-08 Thread Tom Hughes
Right but how does your program get control? Does it manage to see all the allocations done by the dynamic linker before main is entered? Tom On 08/02/2019 18:58, Ahmad Nouralizadeh wrote: By image, I mean the binary code of the program to be traced and all the shared libraries accessed by that

Re: [Valgrind-users] Valgrind Finds More Dynamic Allocations than Inte Pin

2019-02-08 Thread Ahmad Nouralizadeh
By image, I mean the binary code of the program to be traced and all the shared libraries accessed by that program. As soon as they are loaded, they will be searched for calls to malloc,... and some code will be added before and after each call. The code is used to store stats, such as the allocati

Re: [Valgrind-users] Valgrind Finds More Dynamic Allocations than Inte Pin

2019-02-08 Thread David Faure
LOL that was the risk, getting a third, completely different, number ;) Well, you mention that your tool only looks at "each loaded image", while heaptrack and valgrind look at ALL allocations. On vendredi 8 février 2019 18:32:01 CET Ahmad Nouralizadeh wrote: > Thanks David, > But heaptrack even

Re: [Valgrind-users] Valgrind Finds More Dynamic Allocations than Inte Pin

2019-02-08 Thread Ahmad Nouralizadeh
Thanks David, But heaptrack even reports a larger number: 153 MB! On Fri, Feb 8, 2019 at 8:09 PM David Faure wrote: > On vendredi 8 février 2019 16:32:50 CET Ahmad Nouralizadeh wrote: > > Hi, > > I wrote a really simple Pin tool to calculate the number of dynamically > > allocated bytes in a pro

Re: [Valgrind-users] Valgrind Finds More Dynamic Allocations than Inte Pin

2019-02-08 Thread David Faure
On vendredi 8 février 2019 16:32:50 CET Ahmad Nouralizadeh wrote: > Hi, > I wrote a really simple Pin tool to calculate the number of dynamically > allocated bytes in a program. I instrumented GIMP with this tool and it > reported 77 MB of allocations. I did the same experiment with Valgrind > whic

[Valgrind-users] Valgrind Finds More Dynamic Allocations than Inte Pin

2019-02-08 Thread Ahmad Nouralizadeh
Hi, I wrote a really simple Pin tool to calculate the number of dynamically allocated bytes in a program. I instrumented GIMP with this tool and it reported 77 MB of allocations. I did the same experiment with Valgrind which reported 117 MB. My Pin tool is similar to the example in Pin. It searches