diff mbox

[RFC] New memory usage statistics infrastructure

Message ID 556C89D8.2060706@arm.com
State New
Headers show

Commit Message

Vidya Praveen June 1, 2015, 4:35 p.m. UTC
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 <mliska@suse.cz> 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  <vidyapraveen@arm.com>

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

Patch

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) \