Re: [PATCH v2 3/4] perf annotate: configure objdump path at compile time

From: Irina Tirdea
Date: Wed Sep 26 2012 - 20:51:19 EST


On Tue, Sep 25, 2012 at 4:08 PM, Namhyung Kim <namhyung@xxxxxxxxxx> wrote:
> Hi Irina,

Hi Namhyung,

> 2012-09-23 (ì), 22:27 +0300, Irina Tirdea:
>> From: Irina Tirdea <irina.tirdea@xxxxxxxxx>
>>
>> The default name for objdump is "objdump". For cross-compiling the name of
>> objdump will be different (e.g. arm-eabi-objdump in Android).
>>
>> Set the default objdump name in the Makefile with DEFAULT_OBJDUMP_PATH.
>
> I thought about it twice and confused.
>
> For cross-compiling, the resulting perf binary will run on target - say
> Android - but the toolchain runs on host, right? So with this change
> the cross-built perf will try to find the arm-eabi-objdump on Android.
> Is it an intended behavior? Is there an arm-eabi-objdump on Android?
>

Apparently I got confused about this as well...

There are two perf binaries built for Android: one for the target
(that will run on Android) and the other one for the host (that can be
used to analyse data recorded on the target).

As you mentioned, the perf built to run on Android needs to use
objdump as "objdump" (actually Android does not yet have objdump, but
this is the naming convention). In this case, objdump should not have
the CROSS_COMPILE prefix.

The perf built to run on the host needs to use arm-eabi-objdump from
the toolchain so that it can analyse data recorded on Android. This
patch is targeting this scenario, not the previous one. In this case,
the CROSS_COMPILE option would be different than arm-eabi- so using
$(CROSS_COMPILE)objdump would be wrong. objdump should be overridden
when running make since there is no connection between the toolchain
used here and the path for objdump. I am always overriding objdump
when calling make, so I did not catch this.

I think that I should change DEFAULT_OBJDUMP_PATH=objdump in the
Makefile to handle the first scenario. I'll also explain this in the
commit message so that it is more clear and make the same change for
the addr2line patch.

What do you think?

Thanks,
Irina
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/