Re: [PATCH, RFC] New memory usage statistics infrastructure

2016-01-29 Thread Patrick Palka
On Thu, May 28, 2015 at 1:07 PM, Jeff Law  wrote:
> On 05/28/2015 06:29 AM, Martin Liška wrote:
>
>>>
>>
>> Hello.
>>
>> Thank you for pointing about missing copyright.
>> Following patch adds that.
>>
>> Ready for trunk?
>
> Yes.
> jeff
>

It looks like this patch was never committed.  gcc/mem-stats.h and
gcc/mem-stats-traits.h don't yet have copyright headers.


Re: [PATCH, RFC] New memory usage statistics infrastructure

2016-02-01 Thread Martin Liška
On 01/29/2016 05:24 PM, Patrick Palka wrote:
> On Thu, May 28, 2015 at 1:07 PM, Jeff Law  wrote:
>> On 05/28/2015 06:29 AM, Martin Liška wrote:
>>

>>>
>>> Hello.
>>>
>>> Thank you for pointing about missing copyright.
>>> Following patch adds that.
>>>
>>> Ready for trunk?
>>
>> Yes.
>> jeff
>>
> 
> It looks like this patch was never committed.  gcc/mem-stats.h and
> gcc/mem-stats-traits.h don't yet have copyright headers.
> 

Hi.

Thanks for pointing out, I've just installed the patch (w/ adding 2016 year to 
copyright header).

Martin


Re: [PATCH, RFC] New memory usage statistics infrastructure

2015-05-29 Thread Vidya Praveen


Martin,

The following change:

@@ -2655,10 +2655,10 @@ s-iov: build/gcov-iov$(build_exeext) $(BASEVER) 
$(DEVPHASE)

 GCOV_OBJS = gcov.o
 gcov$(exeext): $(GCOV_OBJS) $(LIBDEPS)
-   +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) $(GCOV_OBJS) $(LIBS) -o $@
+   +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) $(GCOV_OBJS) build/hash-table.o 
ggc-none.o $(LIBS) -o $@



seem to cause canadian cross build failure for arm and aarch64 on x86_64 as
build/hash-table.o and ggc-none.o are not built by the same compiler?

arm-none-linux-gnueabi-g++ -no-pie   -g -O2 -DIN_GCC-fno-exceptions 
-fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing
+-Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual 
-pedantic -Wno-long-long -Wn
build/hash-table.o ggc-none.o libcommon.a ../libcpp/libcpp.a 
../libbacktrace/.libs/libbacktrace.a ../libiberty/libiberty.a ..

+/libdecnumber/libdecnumber.a  -o gcov
build/hash-table.o: file not recognized: File format not recognized
collect2: error: ld returned 1 exit status
make[1]: *** [gcov] Error 1


Should it be:

-   +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) $(GCOV_OBJS) $(LIBS) -o $@
+   +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) $(GCOV_OBJS) hash-table.o 
ggc-none.o $(LIBS) -o $@


instead?

VP.


On 15/05/15 15:38, Martin Liška wrote:

Hello.

Following patch attempts to rewrite memory reports for GCC's internal 
allocations
so that it uses a new template type. The type shares parts which are currently 
duplicated,
adds support for special 'counters' and introduces new support for 
hash-{set,map,table}.

Transformation of the current code is a bit tricky as we internally used 
hash-table as main
data structure which takes care of location-related allocations. As I want to 
add support even
for hash tables (and all derived types), header files inclusion and forward 
declaration is utilized.

Feel free to comment the patch, as well as missing features one may want to 
track by location sensitive
memory allocation.

Attachment contains sample output taken from tramp3d-v4.cpp.

Thanks,
Martin





Re: [PATCH, RFC] New memory usage statistics infrastructure

2015-06-01 Thread Martin Liška
On 05/29/2015 06:09 PM, Vidya Praveen wrote:
> 
> Martin,
> 
> The following change:
> 
> @@ -2655,10 +2655,10 @@ s-iov: build/gcov-iov$(build_exeext) $(BASEVER) 
> $(DEVPHASE)
> 
>  GCOV_OBJS = gcov.o
>  gcov$(exeext): $(GCOV_OBJS) $(LIBDEPS)
> -   +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) $(GCOV_OBJS) $(LIBS) -o $@
> +   +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) $(GCOV_OBJS) 
> build/hash-table.o ggc-none.o $(LIBS) -o $@
> 
> 
> seem to cause canadian cross build failure for arm and aarch64 on x86_64 as
> build/hash-table.o and ggc-none.o are not built by the same compiler?
> 
> arm-none-linux-gnueabi-g++ -no-pie   -g -O2 -DIN_GCC-fno-exceptions 
> -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing
> +-Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual 
> -pedantic -Wno-long-long -Wn
> build/hash-table.o ggc-none.o libcommon.a ../libcpp/libcpp.a 
> ../libbacktrace/.libs/libbacktrace.a ../libiberty/libiberty.a ..
> +/libdecnumber/libdecnumber.a  -o gcov
> build/hash-table.o: file not recognized: File format not recognized
> collect2: error: ld returned 1 exit status
> make[1]: *** [gcov] Error 1
> 
> 
> Should it be:
> 
> -   +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) $(GCOV_OBJS) $(LIBS) -o $@
> +   +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) $(GCOV_OBJS) hash-table.o 
> ggc-none.o $(LIBS) -o $@
> 
> instead?

Hello Vidya.

Thanks for pointing out. To be honest, I'm not a build system guru and it's 
hard for me to verify
that the change you suggest is the correct.

May I please ask you for sending a patch to mailing?

Thanks,
Martin

> 
> VP.
> 
> 
> On 15/05/15 15:38, Martin Liška wrote:
>> Hello.
>>
>> Following patch attempts to rewrite memory reports for GCC's internal 
>> allocations
>> so that it uses a new template type. The type shares parts which are 
>> currently duplicated,
>> adds support for special 'counters' and introduces new support for 
>> hash-{set,map,table}.
>>
>> Transformation of the current code is a bit tricky as we internally used 
>> hash-table as main
>> data structure which takes care of location-related allocations. As I want 
>> to add support even
>> for hash tables (and all derived types), header files inclusion and forward 
>> declaration is utilized.
>>
>> Feel free to comment the patch, as well as missing features one may want to 
>> track by location sensitive
>> memory allocation.
>>
>> Attachment contains sample output taken from tramp3d-v4.cpp.
>>
>> Thanks,
>> Martin
>>
> 



Re: [PATCH, RFC] New memory usage statistics infrastructure

2015-06-01 Thread Richard Biener
On Mon, Jun 1, 2015 at 1:38 PM, Martin Liška  wrote:
> On 05/29/2015 06:09 PM, Vidya Praveen wrote:
>>
>> Martin,
>>
>> The following change:
>>
>> @@ -2655,10 +2655,10 @@ s-iov: build/gcov-iov$(build_exeext) $(BASEVER) 
>> $(DEVPHASE)
>>
>>  GCOV_OBJS = gcov.o
>>  gcov$(exeext): $(GCOV_OBJS) $(LIBDEPS)
>> -   +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) $(GCOV_OBJS) $(LIBS) -o $@
>> +   +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) $(GCOV_OBJS) 
>> build/hash-table.o ggc-none.o $(LIBS) -o $@
>>
>>
>> seem to cause canadian cross build failure for arm and aarch64 on x86_64 as
>> build/hash-table.o and ggc-none.o are not built by the same compiler?
>>
>> arm-none-linux-gnueabi-g++ -no-pie   -g -O2 -DIN_GCC-fno-exceptions 
>> -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing
>> +-Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual 
>> -pedantic -Wno-long-long -Wn
>> build/hash-table.o ggc-none.o libcommon.a ../libcpp/libcpp.a 
>> ../libbacktrace/.libs/libbacktrace.a ../libiberty/libiberty.a ..
>> +/libdecnumber/libdecnumber.a  -o gcov
>> build/hash-table.o: file not recognized: File format not recognized
>> collect2: error: ld returned 1 exit status
>> make[1]: *** [gcov] Error 1
>>
>>
>> Should it be:
>>
>> -   +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) $(GCOV_OBJS) $(LIBS) -o $@
>> +   +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) $(GCOV_OBJS) hash-table.o 
>> ggc-none.o $(LIBS) -o $@
>>
>> instead?
>
> Hello Vidya.
>
> Thanks for pointing out. To be honest, I'm not a build system guru and it's 
> hard for me to verify
> that the change you suggest is the correct.
>
> May I please ask you for sending a patch to mailing?

gcov isn't a build but a host tool so the patch looks good to me.

Richard.

> Thanks,
> Martin
>
>>
>> VP.
>>
>>
>> On 15/05/15 15:38, Martin Liška wrote:
>>> Hello.
>>>
>>> Following patch attempts to rewrite memory reports for GCC's internal 
>>> allocations
>>> so that it uses a new template type. The type shares parts which are 
>>> currently duplicated,
>>> adds support for special 'counters' and introduces new support for 
>>> hash-{set,map,table}.
>>>
>>> Transformation of the current code is a bit tricky as we internally used 
>>> hash-table as main
>>> data structure which takes care of location-related allocations. As I want 
>>> to add support even
>>> for hash tables (and all derived types), header files inclusion and forward 
>>> declaration is utilized.
>>>
>>> Feel free to comment the patch, as well as missing features one may want to 
>>> track by location sensitive
>>> memory allocation.
>>>
>>> Attachment contains sample output taken from tramp3d-v4.cpp.
>>>
>>> Thanks,
>>> Martin
>>>
>>
>


Re: [PATCH, RFC] New memory usage statistics infrastructure

2015-06-01 Thread Martin Liška
On 06/01/2015 02:18 PM, Richard Biener wrote:
> On Mon, Jun 1, 2015 at 1:38 PM, Martin Liška  wrote:
>> On 05/29/2015 06:09 PM, Vidya Praveen wrote:
>>>
>>> Martin,
>>>
>>> The following change:
>>>
>>> @@ -2655,10 +2655,10 @@ s-iov: build/gcov-iov$(build_exeext) $(BASEVER) 
>>> $(DEVPHASE)
>>>
>>>  GCOV_OBJS = gcov.o
>>>  gcov$(exeext): $(GCOV_OBJS) $(LIBDEPS)
>>> -   +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) $(GCOV_OBJS) $(LIBS) -o $@
>>> +   +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) $(GCOV_OBJS) 
>>> build/hash-table.o ggc-none.o $(LIBS) -o $@
>>>
>>>
>>> seem to cause canadian cross build failure for arm and aarch64 on x86_64 as
>>> build/hash-table.o and ggc-none.o are not built by the same compiler?
>>>
>>> arm-none-linux-gnueabi-g++ -no-pie   -g -O2 -DIN_GCC-fno-exceptions 
>>> -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing
>>> +-Wwrite-strings -Wcast-qual -Wmissing-format-attribute 
>>> -Woverloaded-virtual -pedantic -Wno-long-long -Wn
>>> build/hash-table.o ggc-none.o libcommon.a 
>>> ../libcpp/libcpp.a ../libbacktrace/.libs/libbacktrace.a 
>>> ../libiberty/libiberty.a ..
>>> +/libdecnumber/libdecnumber.a  -o gcov
>>> build/hash-table.o: file not recognized: File format not recognized
>>> collect2: error: ld returned 1 exit status
>>> make[1]: *** [gcov] Error 1
>>>
>>>
>>> Should it be:
>>>
>>> -   +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) $(GCOV_OBJS) $(LIBS) -o $@
>>> +   +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) $(GCOV_OBJS) hash-table.o 
>>> ggc-none.o $(LIBS) -o $@
>>>
>>> instead?
>>
>> Hello Vidya.
>>
>> Thanks for pointing out. To be honest, I'm not a build system guru and it's 
>> hard for me to verify
>> that the change you suggest is the correct.
>>
>> May I please ask you for sending a patch to mailing?
> 
> gcov isn't a build but a host tool so the patch looks good to me.
> 
> Richard.
> 
>> Thanks,
>> Martin
>>
>>>
>>> VP.
>>>
>>>
>>> On 15/05/15 15:38, Martin Liška wrote:
 Hello.

 Following patch attempts to rewrite memory reports for GCC's internal 
 allocations
 so that it uses a new template type. The type shares parts which are 
 currently duplicated,
 adds support for special 'counters' and introduces new support for 
 hash-{set,map,table}.

 Transformation of the current code is a bit tricky as we internally used 
 hash-table as main
 data structure which takes care of location-related allocations. As I want 
 to add support even
 for hash tables (and all derived types), header files inclusion and 
 forward declaration is utilized.

 Feel free to comment the patch, as well as missing features one may want 
 to track by location sensitive
 memory allocation.

 Attachment contains sample output taken from tramp3d-v4.cpp.

 Thanks,
 Martin

>>>
>>

Ok.

I'm going to install following patch.

Thanks,
Martin
>From 04939698092c834713bd83d49bc50a5ab31dbe79 Mon Sep 17 00:00:00 2001
From: mliska 
Date: Mon, 1 Jun 2015 16:03:30 +0200
Subject: [PATCH] Fix Makefile dependencies.

gcc/ChangeLog:

2015-06-01  Vidya Praveen  
	* Makefile.in: Fix gcov dependencies that should
	not point to a build folder.
---
 gcc/Makefile.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index b59b5d9..952f285 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -2667,7 +2667,7 @@ s-iov: build/gcov-iov$(build_exeext) $(BASEVER) $(DEVPHASE)
 GCOV_OBJS = gcov.o
 gcov$(exeext): $(GCOV_OBJS) $(LIBDEPS)
 	+$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) $(GCOV_OBJS) \
-		build/hash-table.o ggc-none.o $(LIBS) -o $@
+		hash-table.o ggc-none.o $(LIBS) -o $@
 GCOV_DUMP_OBJS = gcov-dump.o
 gcov-dump$(exeext): $(GCOV_DUMP_OBJS) $(LIBDEPS)
 	+$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) $(GCOV_DUMP_OBJS) \
-- 
2.1.4



Re: [PATCH, RFC] New memory usage statistics infrastructure

2015-06-01 Thread Vidya Praveen

On 01/06/15 15:08, Martin Liška wrote:

On 06/01/2015 02:18 PM, Richard Biener wrote:

On Mon, Jun 1, 2015 at 1:38 PM, Martin Liška  wrote:

On 05/29/2015 06:09 PM, Vidya Praveen wrote:


Martin,

The following change:

@@ -2655,10 +2655,10 @@ s-iov: build/gcov-iov$(build_exeext) $(BASEVER) 
$(DEVPHASE)

  GCOV_OBJS = gcov.o
  gcov$(exeext): $(GCOV_OBJS) $(LIBDEPS)
-   +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) $(GCOV_OBJS) $(LIBS) -o $@
+   +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) $(GCOV_OBJS) 
build/hash-table.o ggc-none.o $(LIBS) -o $@


seem to cause canadian cross build failure for arm and aarch64 on x86_64 as
build/hash-table.o and ggc-none.o are not built by the same compiler?

arm-none-linux-gnueabi-g++ -no-pie   -g -O2 -DIN_GCC-fno-exceptions 
-fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing
+-Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual 
-pedantic -Wno-long-long -Wn
 build/hash-table.o ggc-none.o libcommon.a ../libcpp/libcpp.a 
../libbacktrace/.libs/libbacktrace.a ../libiberty/libiberty.a ..
+/libdecnumber/libdecnumber.a  -o gcov
build/hash-table.o: file not recognized: File format not recognized
collect2: error: ld returned 1 exit status
make[1]: *** [gcov] Error 1


Should it be:

-   +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) $(GCOV_OBJS) $(LIBS) -o $@
+   +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) $(GCOV_OBJS) hash-table.o 
ggc-none.o $(LIBS) -o $@

instead?


Hello Vidya.

Thanks for pointing out. To be honest, I'm not a build system guru and it's 
hard for me to verify
that the change you suggest is the correct.

May I please ask you for sending a patch to mailing?


gcov isn't a build but a host tool so the patch looks good to me.

Richard.


Thanks,
Martin



VP.


On 15/05/15 15:38, Martin Liška wrote:

Hello.

Following patch attempts to rewrite memory reports for GCC's internal 
allocations
so that it uses a new template type. The type shares parts which are currently 
duplicated,
adds support for special 'counters' and introduces new support for 
hash-{set,map,table}.

Transformation of the current code is a bit tricky as we internally used 
hash-table as main
data structure which takes care of location-related allocations. As I want to 
add support even
for hash tables (and all derived types), header files inclusion and forward 
declaration is utilized.

Feel free to comment the patch, as well as missing features one may want to 
track by location sensitive
memory allocation.

Attachment contains sample output taken from tramp3d-v4.cpp.

Thanks,
Martin







Ok.

I'm going to install following patch.



Martin,

I realized we require change in one more place. I'm just doing builds to verify
this.

VP.


diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index b59b5d9..3d14938 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -2667,11 +2667,11 @@ s-iov: build/gcov-iov$(build_exeext) $(BASEVER) 
$(DEVPHASE)
 GCOV_OBJS = gcov.o
 gcov$(exeext): $(GCOV_OBJS) $(LIBDEPS)
+$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) $(GCOV_OBJS) \
-   build/hash-table.o ggc-none.o $(LIBS) -o $@
+   hash-table.o ggc-none.o $(LIBS) -o $@
 GCOV_DUMP_OBJS = gcov-dump.o
 gcov-dump$(exeext): $(GCOV_DUMP_OBJS) $(LIBDEPS)
+$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) $(GCOV_DUMP_OBJS) \
-   build/hash-table.o build/ggc-none.o\
+   hash-table.o ggc-none.o\
$(LIBS) -o $@

 GCOV_TOOL_DEP_FILES = $(srcdir)/../libgcc/libgcov-util.c gcov-io.c 
$(GCOV_IO_H) \




Re: [PATCH, RFC] New memory usage statistics infrastructure

2015-06-01 Thread Martin Liška
On 06/01/2015 04:08 PM, Martin Liška wrote:
> On 06/01/2015 02:18 PM, Richard Biener wrote:
>> On Mon, Jun 1, 2015 at 1:38 PM, Martin Liška  wrote:
>>> On 05/29/2015 06:09 PM, Vidya Praveen wrote:

 Martin,

 The following change:

 @@ -2655,10 +2655,10 @@ s-iov: build/gcov-iov$(build_exeext) $(BASEVER) 
 $(DEVPHASE)

  GCOV_OBJS = gcov.o
  gcov$(exeext): $(GCOV_OBJS) $(LIBDEPS)
 -   +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) $(GCOV_OBJS) $(LIBS) -o $@
 +   +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) $(GCOV_OBJS) 
 build/hash-table.o ggc-none.o $(LIBS) -o $@


 seem to cause canadian cross build failure for arm and aarch64 on x86_64 as
 build/hash-table.o and ggc-none.o are not built by the same compiler?

 arm-none-linux-gnueabi-g++ -no-pie   -g -O2 -DIN_GCC-fno-exceptions 
 -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing
 +-Wwrite-strings -Wcast-qual -Wmissing-format-attribute 
 -Woverloaded-virtual -pedantic -Wno-long-long -Wn
 build/hash-table.o ggc-none.o libcommon.a 
 ../libcpp/libcpp.a ../libbacktrace/.libs/libbacktrace.a 
 ../libiberty/libiberty.a ..
 +/libdecnumber/libdecnumber.a  -o gcov
 build/hash-table.o: file not recognized: File format not recognized
 collect2: error: ld returned 1 exit status
 make[1]: *** [gcov] Error 1


 Should it be:

 -   +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) $(GCOV_OBJS) $(LIBS) -o $@
 +   +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) $(GCOV_OBJS) hash-table.o 
 ggc-none.o $(LIBS) -o $@

 instead?
>>>
>>> Hello Vidya.
>>>
>>> Thanks for pointing out. To be honest, I'm not a build system guru and it's 
>>> hard for me to verify
>>> that the change you suggest is the correct.
>>>
>>> May I please ask you for sending a patch to mailing?
>>
>> gcov isn't a build but a host tool so the patch looks good to me.
>>
>> Richard.
>>
>>> Thanks,
>>> Martin
>>>

 VP.


 On 15/05/15 15:38, Martin Liška wrote:
> Hello.
>
> Following patch attempts to rewrite memory reports for GCC's internal 
> allocations
> so that it uses a new template type. The type shares parts which are 
> currently duplicated,
> adds support for special 'counters' and introduces new support for 
> hash-{set,map,table}.
>
> Transformation of the current code is a bit tricky as we internally used 
> hash-table as main
> data structure which takes care of location-related allocations. As I 
> want to add support even
> for hash tables (and all derived types), header files inclusion and 
> forward declaration is utilized.
>
> Feel free to comment the patch, as well as missing features one may want 
> to track by location sensitive
> memory allocation.
>
> Attachment contains sample output taken from tramp3d-v4.cpp.
>
> Thanks,
> Martin
>

>>>
> 
> Ok.
> 
> I'm going to install following patch.
> 
> Thanks,
> Martin
> 

Hi.

Vidya notified me that I used a wrong email for his Changelog entry.

This is patch I'm going to install.

Thanks,
Martin
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index daf6476..63e69d2 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,4 +1,4 @@
-2015-06-01  Vidya Praveen  
+2015-06-01  Vidya Praveen  
 
 	* Makefile.in: Fix gcov dependencies that should
 	not point to a build folder.


Re: [PATCH, RFC] New memory usage statistics infrastructure

2015-06-01 Thread Vidya Praveen

On 01/06/15 15:21, Vidya Praveen wrote:

On 01/06/15 15:08, Martin Liška wrote:

On 06/01/2015 02:18 PM, Richard Biener wrote:

On Mon, Jun 1, 2015 at 1:38 PM, Martin Liška  wrote:

On 05/29/2015 06:09 PM, Vidya Praveen wrote:


Martin,

The following change:

@@ -2655,10 +2655,10 @@ s-iov: build/gcov-iov$(build_exeext) $(BASEVER) 
$(DEVPHASE)

   GCOV_OBJS = gcov.o
   gcov$(exeext): $(GCOV_OBJS) $(LIBDEPS)
-   +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) $(GCOV_OBJS) $(LIBS) -o $@
+   +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) $(GCOV_OBJS) 
build/hash-table.o ggc-none.o $(LIBS) -o $@


seem to cause canadian cross build failure for arm and aarch64 on x86_64 as
build/hash-table.o and ggc-none.o are not built by the same compiler?

arm-none-linux-gnueabi-g++ -no-pie   -g -O2 -DIN_GCC-fno-exceptions 
-fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing
+-Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual 
-pedantic -Wno-long-long -Wn
  build/hash-table.o ggc-none.o libcommon.a ../libcpp/libcpp.a 
../libbacktrace/.libs/libbacktrace.a ../libiberty/libiberty.a ..
+/libdecnumber/libdecnumber.a  -o gcov
build/hash-table.o: file not recognized: File format not recognized
collect2: error: ld returned 1 exit status
make[1]: *** [gcov] Error 1


Should it be:

-   +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) $(GCOV_OBJS) $(LIBS) -o $@
+   +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) $(GCOV_OBJS) hash-table.o 
ggc-none.o $(LIBS) -o $@

instead?


Hello Vidya.

Thanks for pointing out. To be honest, I'm not a build system guru and it's 
hard for me to verify
that the change you suggest is the correct.

May I please ask you for sending a patch to mailing?


gcov isn't a build but a host tool so the patch looks good to me.

Richard.


Thanks,
Martin



VP.


On 15/05/15 15:38, Martin Liška wrote:

Hello.

Following patch attempts to rewrite memory reports for GCC's internal 
allocations
so that it uses a new template type. The type shares parts which are currently 
duplicated,
adds support for special 'counters' and introduces new support for 
hash-{set,map,table}.

Transformation of the current code is a bit tricky as we internally used 
hash-table as main
data structure which takes care of location-related allocations. As I want to 
add support even
for hash tables (and all derived types), header files inclusion and forward 
declaration is utilized.

Feel free to comment the patch, as well as missing features one may want to 
track by location sensitive
memory allocation.

Attachment contains sample output taken from tramp3d-v4.cpp.

Thanks,
Martin







Ok.

I'm going to install following patch.



Martin,

I realized we require change in one more place. I'm just doing builds to verify
this.

VP.




   GCOV_OBJS = gcov.o
   gcov$(exeext): $(GCOV_OBJS) $(LIBDEPS)
  +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) $(GCOV_OBJS) \
-   build/hash-table.o ggc-none.o $(LIBS) -o $@
+   hash-table.o ggc-none.o $(LIBS) -o $@
   GCOV_DUMP_OBJS = gcov-dump.o
   gcov-dump$(exeext): $(GCOV_DUMP_OBJS) $(LIBDEPS)
  +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) $(GCOV_DUMP_OBJS) \
-   build/hash-table.o build/ggc-none.o\
+   hash-table.o ggc-none.o\
  $(LIBS) -o $@

   GCOV_TOOL_DEP_FILES = $(srcdir)/../libgcc/libgcov-util.c gcov-io.c 
$(GCOV_IO_H) \



Installing the following patch as it is obvious and same kind of change as the
the previous one (which was approved by richi). Verified by building canadian
cross of aarch64-none-linux-gnu and cross build of arm-none-eabi.

gcc/ChangeLog:

2015-06-01  Vidya Praveen  

* Makefile.in: Pick up gcov-dump dependencies from gcc/ directory
rather than from gcc/build directory.


diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 952f285..3d14938 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -2671,7 +2671,7 @@ gcov$(exeext): $(GCOV_OBJS) $(LIBDEPS)
 GCOV_DUMP_OBJS = gcov-dump.o
 gcov-dump$(exeext): $(GCOV_DUMP_OBJS) $(LIBDEPS)
+$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) $(GCOV_DUMP_OBJS) \
-   build/hash-table.o build/ggc-none.o\
+   hash-table.o ggc-none.o\
$(LIBS) -o $@

 GCOV_TOOL_DEP_FILES = $(srcdir)/../libgcc/libgcov-util.c gcov-io.c 
$(GCOV_IO_H) \




Re: [PATCH, RFC] New memory usage statistics infrastructure

2015-05-19 Thread Jeff Law

On 05/15/2015 08:38 AM, Martin Liška wrote:

Hello.

Following patch attempts to rewrite memory reports for GCC's internal
allocations
so that it uses a new template type. The type shares parts which are
currently duplicated,
adds support for special 'counters' and introduces new support for
hash-{set,map,table}.

Transformation of the current code is a bit tricky as we internally used
hash-table as main
data structure which takes care of location-related allocations. As I
want to add support even
for hash tables (and all derived types), header files inclusion and
forward declaration is utilized.

Feel free to comment the patch, as well as missing features one may want
to track by location sensitive
memory allocation.

Attachment contains sample output taken from tramp3d-v4.cpp.

Thanks,
Martin




0001-New-memory-allocation-statistics-infrastructure.patch


 From 7a9048ef36bddf17209acadc1dcab9fc48a7fd63 Mon Sep 17 00:00:00 2001
From: mliska
Date: Tue, 5 May 2015 11:34:16 +0200
Subject: [PATCH] New memory allocation statistics infrastructure.

gcc/ChangeLog:

2015-05-05  Martin Liska

* Makefile.in: Add additional dependencies related to memory report
enhancement.
* alloc-pool.c (allocate_pool_descriptor): Use new ctor.
* bitmap.c (struct bitmap_descriptor_d): Remove.
(struct loc): Likewise.
(struct bitmap_desc_hasher): Likewise.
(bitmap_desc_hasher::hash): Likewise.
(bitmap_desc_hasher::equal): Likewise.
(get_bitmap_descriptor): Likewise.
(bitmap_register): User new memory descriptor API.
(register_overhead): Likewise.
(bitmap_find_bit): Register nsearches and search_iter statistics.
(struct bitmap_output_info): Remove.
(print_statistics): Likewise.
(dump_bitmap_statistics): Use new memory descriptor.
* bitmap.h (struct bitmap_usage): New class.
* genmatch.c: Extend header file inclusion.
* genpreds.c: Likewise.
* ggc-common.c (struct ggc_usage): New class.
(struct ggc_loc_desc_hasher): Remove.
(ggc_loc_desc_hasher::hash): Likewise.
(ggc_loc_desc_hasher::equal): Likewise.
(struct ggc_ptr_hash_entry): Likewise.
(struct ptr_hash_hasher): Likewise.
(ptr_hash_hasher::hash): Likewise.
(ptr_hash_hasher::equal): Likewise.
(make_loc_descriptor): Likewise.
(ggc_prune_ptr): Likewise.
(dump_ggc_loc_statistics): Use new memory descriptor.
(ggc_record_overhead): Likewise.
(ggc_free_overhead): Likewise.
(final_cmp_statistic): Remove.
(cmp_statistic): Likewise.
(ggc_add_statistics): Liekwise.
(ggc_prune_overhead_list): Likewise.
* hash-map-traits.h: New file.
* hash-map.h (struct default_hashmap_traits): Move the traits to a
separate header file.
* hash-set.h: Pass memory statistics info to ctor.
* hash-table.c (void dump_hash_table_loc_statistics): New function.
* hash-table.h (hash_table::hash_table): Add new ctor arguments.
(hash_table::~hash_table): Register memory release operation.
(hash_table::alloc_entries): Handle memory allocation operation.
(hash_table::expand): Likewise.
* inchash.c (iterative_hash_hashval_t): Move implementation to header
file.
(iterative_hash_host_wide_int): Likewise.
* inchash.h (class hash): Likewise.
* mem-stats-traits.h: New file.
* mem-stats.h: New file.
(mem_location): Add new class.
(mem_usage): Likewise.
(mem_alloc_description): Likewise.
* sese.c: Add new header file inclusision.
* toplev.c (dump_memory_report): Add report for hash_table, hash_map
and hash_set.
* tree-sra.c: Add new header file inclusision.
* vec.c (struct vec_descriptor): Remove.
(hash_descriptor): Likewise.
(struct vec_usage): Likewise.
(struct ptr_hash_entry): Likewise.
(hash_ptr): Likewise.
(eq_ptr): Likewise.
(vec_prefix::register_overhead): Use new memory descriptor API.
(vec_prefix::release_overhead): Likewise.
(add_statistics): Remove.
(dump_vec_loc_statistics): Use new memory descriptor API.
* vec.h (struct vec_prefix): Likewise.
(va_heap::reserve): Likewise.
(va_heap::release): Likewise.
Please check for overly-long lines.  I spotted several, but didn't keep 
them handy as I was working through the patch.  ISTM that using the 
script from contrib/ might help identify the overly long lines.


Overall it looks good -- I like the consistency in reporting.  I think 
if there's things missing, we ought to be able to add them incrementally.


My recommendation would be to take care of the line wrapping issues, run 
it through the usual bootstrap and testing cycles and commit assuming 
nothing is amiss.


jeff


Re: [PATCH, RFC] New memory usage statistics infrastructure

2015-05-28 Thread Thomas Schwinge
Hi!

On Fri, 15 May 2015 16:38:40 +0200, Martin Liška  wrote:
> Following patch attempts to rewrite memory reports for GCC's internal 
> allocations
> [...]

(Got commtited to trunk in r223748.)

>   * hash-map-traits.h: New file.

In that one you added a copyright/licensing header, but...

>   * mem-stats-traits.h: New file.
>   * mem-stats.h: New file.

... in these two you didn't (but should):

> --- /dev/null
> +++ b/gcc/hash-map-traits.h
> @@ -0,0 +1,104 @@
> +/* A hash map traits.
> +   Copyright (C) 2015 Free Software Foundation, Inc.
> +
> +This file is part of GCC.
> +
> +GCC is free software; you can redistribute it and/or modify it under
> +the terms of [...]

> --- /dev/null
> +++ b/gcc/mem-stats-traits.h
> @@ -0,0 +1,20 @@
> +#ifndef GCC_MEM_STATS_TRAITS_H
> +#define GCC_MEM_STATS_TRAITS_H
> +
> +/* Memory allocation origin.  */
> +enum mem_alloc_origin
> +{
> +  HASH_TABLE,
> +  HASH_MAP,
> +  HASH_SET,
> +  VEC,
> +  BITMAP,
> +  GGC,
> +  MEM_ALLOC_ORIGIN_LENGTH
> +};
> +
> +/* Verbose names of the memory allocation origin.  */
> +static const char * mem_alloc_origin_names[] = { "Hash tables", "Hash maps", 
> "Hash sets",
> +  "Heap vectors", "Bitmaps", "GGC memory" };
> +
> +#endif // GCC_MEM_STATS_TRAITS_H

> --- /dev/null
> +++ b/gcc/mem-stats.h
> @@ -0,0 +1,535 @@
> +#ifndef GCC_MEM_STATS_H
> +#define GCC_MEM_STATS_H
> +
> +#include "hash-map-traits.h"
> +[...]


Grüße,
 Thomas


signature.asc
Description: PGP signature


Re: [PATCH, RFC] New memory usage statistics infrastructure

2015-05-28 Thread Martin Liška

On 05/28/2015 01:15 PM, Thomas Schwinge wrote:

Hi!

On Fri, 15 May 2015 16:38:40 +0200, Martin Liška  wrote:

Following patch attempts to rewrite memory reports for GCC's internal 
allocations
[...]


(Got commtited to trunk in r223748.)


* hash-map-traits.h: New file.


In that one you added a copyright/licensing header, but...


* mem-stats-traits.h: New file.
* mem-stats.h: New file.


... in these two you didn't (but should):


--- /dev/null
+++ b/gcc/hash-map-traits.h
@@ -0,0 +1,104 @@
+/* A hash map traits.
+   Copyright (C) 2015 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of [...]



--- /dev/null
+++ b/gcc/mem-stats-traits.h
@@ -0,0 +1,20 @@
+#ifndef GCC_MEM_STATS_TRAITS_H
+#define GCC_MEM_STATS_TRAITS_H
+
+/* Memory allocation origin.  */
+enum mem_alloc_origin
+{
+  HASH_TABLE,
+  HASH_MAP,
+  HASH_SET,
+  VEC,
+  BITMAP,
+  GGC,
+  MEM_ALLOC_ORIGIN_LENGTH
+};
+
+/* Verbose names of the memory allocation origin.  */
+static const char * mem_alloc_origin_names[] = { "Hash tables", "Hash maps", "Hash 
sets",
+  "Heap vectors", "Bitmaps", "GGC memory" };
+
+#endif // GCC_MEM_STATS_TRAITS_H



--- /dev/null
+++ b/gcc/mem-stats.h
@@ -0,0 +1,535 @@
+#ifndef GCC_MEM_STATS_H
+#define GCC_MEM_STATS_H
+
+#include "hash-map-traits.h"
+[...]



Grüße,
  Thomas



Hello.

Thank you for pointing about missing copyright.
Following patch adds that.

Ready for trunk?
Thanks,
Martin
>From 2abc4116e3a941dbd8e0cff22698b979c9c1c830 Mon Sep 17 00:00:00 2001
From: mliska 
Date: Thu, 28 May 2015 14:24:58 +0200
Subject: [PATCH] Missing copyright for mem-stats header files.

gcc/ChangeLog:

2015-05-28  Martin Liska  

	* mem-stats-traits.h: Add copyright header.
	* mem-stats.h: Likewise.
---
 gcc/mem-stats-traits.h | 20 
 gcc/mem-stats.h| 20 
 2 files changed, 40 insertions(+)

diff --git a/gcc/mem-stats-traits.h b/gcc/mem-stats-traits.h
index de1614e..c5cb84a 100644
--- a/gcc/mem-stats-traits.h
+++ b/gcc/mem-stats-traits.h
@@ -1,3 +1,23 @@
+/* A memory statistics traits.
+   Copyright (C) 2015 Free Software Foundation, Inc.
+   Contributed by Martin Liska  
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3.  If not see
+.  */
+
 #ifndef GCC_MEM_STATS_TRAITS_H
 #define GCC_MEM_STATS_TRAITS_H
 
diff --git a/gcc/mem-stats.h b/gcc/mem-stats.h
index ac47231..9e3dec0 100644
--- a/gcc/mem-stats.h
+++ b/gcc/mem-stats.h
@@ -1,3 +1,23 @@
+/* A memory statistics tracking infrastructure.
+   Copyright (C) 2015 Free Software Foundation, Inc.
+   Contributed by Martin Liska  
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3.  If not see
+.  */
+
 #ifndef GCC_MEM_STATS_H
 #define GCC_MEM_STATS_H
 
-- 
2.1.4



Re: [PATCH, RFC] New memory usage statistics infrastructure

2015-05-28 Thread Jeff Law

On 05/28/2015 06:29 AM, Martin Liška wrote:





Hello.

Thank you for pointing about missing copyright.
Following patch adds that.

Ready for trunk?

Yes.
jeff