Openembedded Core Discussions
 help / color / mirror / Atom feed
* Profiling binaries?
@ 2012-10-22 12:58 Steffen Sledz
  2012-10-22 13:12 ` Samuel Stirtzel
  2012-10-22 13:40 ` Richard Purdie
  0 siblings, 2 replies; 9+ messages in thread
From: Steffen Sledz @ 2012-10-22 12:58 UTC (permalink / raw)
  To: openembedded-core

Just a short question: Does oe[-core] provide a generic method to create packages containing binaries/libraries with profiling support?

-- 
DResearch Fahrzeugelektronik GmbH
Otto-Schmirgal-Str. 3, 10319 Berlin, Germany
Tel: +49 30 515932-237 mailto:sledz@dresearch-fe.de
Fax: +49 30 515932-299
Geschäftsführer: Dr. Michael Weber, Werner Mögle;
Amtsgericht Berlin Charlottenburg; HRB 130120 B;
Ust.-IDNr. DE273952058



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Profiling binaries?
  2012-10-22 12:58 Profiling binaries? Steffen Sledz
@ 2012-10-22 13:12 ` Samuel Stirtzel
  2012-10-22 13:20   ` Steffen Sledz
  2012-10-22 13:40 ` Richard Purdie
  1 sibling, 1 reply; 9+ messages in thread
From: Samuel Stirtzel @ 2012-10-22 13:12 UTC (permalink / raw)
  To: Steffen Sledz; +Cc: openembedded-core

2012/10/22 Steffen Sledz <sledz@dresearch-fe.de>:
> Just a short question: Does oe[-core] provide a generic method to create packages containing binaries/libraries with profiling support?
>

Depending on your platform you could use Valgrind [1], or to be more
specific Callgrind [2].

The recipe is in .../openembedded-core/meta/recipes-devtools/valgrind/
you can check there if your arch/platform is supported.

[1] http://valgrind.org/
[2] http://valgrind.org/docs/manual/cl-manual.html



-- 
Regards
Samuel



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Profiling binaries?
  2012-10-22 13:12 ` Samuel Stirtzel
@ 2012-10-22 13:20   ` Steffen Sledz
  2012-10-22 13:23     ` Samuel Stirtzel
  0 siblings, 1 reply; 9+ messages in thread
From: Steffen Sledz @ 2012-10-22 13:20 UTC (permalink / raw)
  To: Samuel Stirtzel; +Cc: openembedded-core

On 22.10.2012 15:12, Samuel Stirtzel wrote:
> 2012/10/22 Steffen Sledz <sledz@dresearch-fe.de>:
>> Just a short question: Does oe[-core] provide a generic method to create packages containing binaries/libraries with profiling support?
>>
> 
> Depending on your platform you could use Valgrind [1], or to be more
> specific Callgrind [2].
> 
> The recipe is in .../openembedded-core/meta/recipes-devtools/valgrind/
> you can check there if your arch/platform is supported.
> 
> [1] http://valgrind.org/
> [2] http://valgrind.org/docs/manual/cl-manual.html

My question was more related to gcc -pg, gprof & Co.

-- 
DResearch Fahrzeugelektronik GmbH
Otto-Schmirgal-Str. 3, 10319 Berlin, Germany
Tel: +49 30 515932-237 mailto:sledz@dresearch-fe.de
Fax: +49 30 515932-299
Geschäftsführer: Dr. Michael Weber, Werner Mögle;
Amtsgericht Berlin Charlottenburg; HRB 130120 B;
Ust.-IDNr. DE273952058



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Profiling binaries?
  2012-10-22 13:20   ` Steffen Sledz
@ 2012-10-22 13:23     ` Samuel Stirtzel
  2012-10-22 13:30       ` Jack Mitchell
  2012-10-22 15:08       ` Samuel Stirtzel
  0 siblings, 2 replies; 9+ messages in thread
From: Samuel Stirtzel @ 2012-10-22 13:23 UTC (permalink / raw)
  To: Steffen Sledz; +Cc: openembedded-core

2012/10/22 Steffen Sledz <sledz@dresearch-fe.de>:
> On 22.10.2012 15:12, Samuel Stirtzel wrote:
>> 2012/10/22 Steffen Sledz <sledz@dresearch-fe.de>:
>>> Just a short question: Does oe[-core] provide a generic method to create packages containing binaries/libraries with profiling support?
>>>
>>
>> Depending on your platform you could use Valgrind [1], or to be more
>> specific Callgrind [2].
>>
>> The recipe is in .../openembedded-core/meta/recipes-devtools/valgrind/
>> you can check there if your arch/platform is supported.
>>
>> [1] http://valgrind.org/
>> [2] http://valgrind.org/docs/manual/cl-manual.html
>
> My question was more related to gcc -pg, gprof & Co.
>

Sorry forgot to mention that,
you can use IMAGE_FEATURES += "dev-pkgs"

-- 
Regards
Samuel



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Profiling binaries?
  2012-10-22 13:23     ` Samuel Stirtzel
@ 2012-10-22 13:30       ` Jack Mitchell
  2012-10-22 15:08       ` Samuel Stirtzel
  1 sibling, 0 replies; 9+ messages in thread
From: Jack Mitchell @ 2012-10-22 13:30 UTC (permalink / raw)
  To: openembedded-core

On 22/10/12 14:23, Samuel Stirtzel wrote:
> 2012/10/22 Steffen Sledz <sledz@dresearch-fe.de>:
>> On 22.10.2012 15:12, Samuel Stirtzel wrote:
>>> 2012/10/22 Steffen Sledz <sledz@dresearch-fe.de>:
>>>> Just a short question: Does oe[-core] provide a generic method to create packages containing binaries/libraries with profiling support?
>>>>
>>> Depending on your platform you could use Valgrind [1], or to be more
>>> specific Callgrind [2].
>>>
>>> The recipe is in .../openembedded-core/meta/recipes-devtools/valgrind/
>>> you can check there if your arch/platform is supported.
>>>
>>> [1] http://valgrind.org/
>>> [2] http://valgrind.org/docs/manual/cl-manual.html
>> My question was more related to gcc -pg, gprof & Co.
>>
> Sorry forgot to mention that,
> you can use IMAGE_FEATURES += "dev-pkgs"
>

Section 5.15 has some interesting tidbits of profiling. There are a few 
5,x sections so look at them all the find the profiling one ;)

http://www.yoctoproject.org/docs/latest/mega-manual/mega-manual.html

-- 

   Jack Mitchell (jack@embed.me.uk)
   Embedded Systems Engineer
   http://www.embed.me.uk

--




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Profiling binaries?
  2012-10-22 12:58 Profiling binaries? Steffen Sledz
  2012-10-22 13:12 ` Samuel Stirtzel
@ 2012-10-22 13:40 ` Richard Purdie
  2012-10-22 13:49   ` Phil Blundell
  1 sibling, 1 reply; 9+ messages in thread
From: Richard Purdie @ 2012-10-22 13:40 UTC (permalink / raw)
  To: Steffen Sledz; +Cc: openembedded-core

On Mon, 2012-10-22 at 14:58 +0200, Steffen Sledz wrote:
> Just a short question: Does oe[-core] provide a generic method to
> create packages containing binaries/libraries with profiling support?

Have a look at the section "Optimization flags" in bitbake.conf. You
should be able to add the -pg flag to
FULL_OPTIMIZATION/DEBUG_OPTIMIZATION and get what you're looking for.

Cheers,

Richard






^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Profiling binaries?
  2012-10-22 13:40 ` Richard Purdie
@ 2012-10-22 13:49   ` Phil Blundell
  2012-10-22 14:44     ` Mark Hatle
  0 siblings, 1 reply; 9+ messages in thread
From: Phil Blundell @ 2012-10-22 13:49 UTC (permalink / raw)
  To: Richard Purdie; +Cc: openembedded-core

On Mon, 2012-10-22 at 14:40 +0100, Richard Purdie wrote:
> On Mon, 2012-10-22 at 14:58 +0200, Steffen Sledz wrote:
> > Just a short question: Does oe[-core] provide a generic method to
> > create packages containing binaries/libraries with profiling support?
> 
> Have a look at the section "Optimization flags" in bitbake.conf. You
> should be able to add the -pg flag to
> FULL_OPTIMIZATION/DEBUG_OPTIMIZATION and get what you're looking for.

I think you need a bit of special handling around eglibc as well.  But
otherwise yes, I've done basically this in the past and it seems to work
fine.

p.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Profiling binaries?
  2012-10-22 13:49   ` Phil Blundell
@ 2012-10-22 14:44     ` Mark Hatle
  0 siblings, 0 replies; 9+ messages in thread
From: Mark Hatle @ 2012-10-22 14:44 UTC (permalink / raw)
  To: openembedded-core

On 10/22/12 8:49 AM, Phil Blundell wrote:
> On Mon, 2012-10-22 at 14:40 +0100, Richard Purdie wrote:
>> On Mon, 2012-10-22 at 14:58 +0200, Steffen Sledz wrote:
>>> Just a short question: Does oe[-core] provide a generic method to
>>> create packages containing binaries/libraries with profiling support?
>>
>> Have a look at the section "Optimization flags" in bitbake.conf. You
>> should be able to add the -pg flag to
>> FULL_OPTIMIZATION/DEBUG_OPTIMIZATION and get what you're looking for.
>
> I think you need a bit of special handling around eglibc as well.  But
> otherwise yes, I've done basically this in the past and it seems to work
> fine.

For our environment we do:

# Add profiling optimization type
PROFILING_OPTIMIZATION = "${FULL_OPTIMIZATION} -fno-omit-frame-pointer 
-fvisibility=default"
SELECTED_OPTIMIZATION[vardeps] += "PROFILING_OPTIMIZATION"

# Uncomment to enable profiling
#SELECTED_OPTIMIZATION = "${PROFILING_OPTIMIZATION}"


You can certainly add -pg to the optimization arguments as well.  As others have 
said, you'll need to have the profiling libgcc/libc components if you use -pg.

But this is a simple way to make your own customized optimization.  If you want 
to only enable it for one package you can do something like:

SELECTED_OPTIMIZATION_pn-<recipe> = "${PROFILING_OPTIMIZATION}"

--Mark

> p.
>
>
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Profiling binaries?
  2012-10-22 13:23     ` Samuel Stirtzel
  2012-10-22 13:30       ` Jack Mitchell
@ 2012-10-22 15:08       ` Samuel Stirtzel
  1 sibling, 0 replies; 9+ messages in thread
From: Samuel Stirtzel @ 2012-10-22 15:08 UTC (permalink / raw)
  Cc: openembedded-core

2012/10/22 Samuel Stirtzel <s.stirtzel@googlemail.com>:
> 2012/10/22 Steffen Sledz <sledz@dresearch-fe.de>:
>> On 22.10.2012 15:12, Samuel Stirtzel wrote:
>>> 2012/10/22 Steffen Sledz <sledz@dresearch-fe.de>:
>>>> Just a short question: Does oe[-core] provide a generic method to create packages containing binaries/libraries with profiling support?
>>>>
>>>
>>> Depending on your platform you could use Valgrind [1], or to be more
>>> specific Callgrind [2].
>>>
>>> The recipe is in .../openembedded-core/meta/recipes-devtools/valgrind/
>>> you can check there if your arch/platform is supported.
>>>
>>> [1] http://valgrind.org/
>>> [2] http://valgrind.org/docs/manual/cl-manual.html
>>
>> My question was more related to gcc -pg, gprof & Co.
>>
>
> Sorry forgot to mention that,
> you can use IMAGE_FEATURES += "dev-pkgs"
>
Strange copy and paste mistake, I really should take more time writing mails..

What I meant was you can add
IMAGE_FEATURES += "dbg-pkgs"
to your image, this will ship all debug packages for your installed packages.

Combined with DEBUG_OPTIMIZATION flags this works like a charm, as
Richard already noted.


Usually I am using Callgrind in connection with the graphical tool
KCachegrind [2] for profiling.
But on target profiling is very slow with Callgrind, OProfile is
"marketed" as low overhead profiler...
Didn't know about OProfile or the documentation [1], it definitely
might be worth a try.

[1] http://www.yoctoproject.org/docs/latest/mega-manual/mega-manual.html#platdev-oprofile
[2] http://kcachegrind.sourceforge.net/cgi-bin/show.cgi/KcacheGrindIndex

-- 
Regards
Samuel



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-10-22 15:22 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-22 12:58 Profiling binaries? Steffen Sledz
2012-10-22 13:12 ` Samuel Stirtzel
2012-10-22 13:20   ` Steffen Sledz
2012-10-22 13:23     ` Samuel Stirtzel
2012-10-22 13:30       ` Jack Mitchell
2012-10-22 15:08       ` Samuel Stirtzel
2012-10-22 13:40 ` Richard Purdie
2012-10-22 13:49   ` Phil Blundell
2012-10-22 14:44     ` Mark Hatle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox