Skip to contentSkip to conversation

Profiling binaries?

DISCUSSION Steffen Sledz 6 participants 9 messages Oct 22, 2012

lore
Share & tools
lore
#0 lore raw

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

Signature · 7 lines
DResearch Fahrzeugelektronik GmbH
Otto-Schmirgal-Str. 3, 10319 Berlin, Germany
Tel: +49 30 515932-237 mailto:[email protected]
Fax: +49 30 515932-299
Geschäftsführer: Dr. Michael Weber, Werner Mögle;
Amtsgericht Berlin Charlottenburg; HRB 130120 B;
Ust.-IDNr. DE273952058
#1 lore raw

2012/10/22 Steffen Sledz <[email protected]>:

Quoted 2 lines

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

Signature · 2 lines
Regards
Samuel
#2 lore raw
Quoted 4 lines · Samuel Stirtzel

2012/10/22 Steffen Sledz <[email protected]>:

Quoted 2 lines

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

Quoted 8 lines

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.

Signature · 7 lines
DResearch Fahrzeugelektronik GmbH
Otto-Schmirgal-Str. 3, 10319 Berlin, Germany
Tel: +49 30 515932-237 mailto:[email protected]
Fax: +49 30 515932-299
Geschäftsführer: Dr. Michael Weber, Werner Mögle;
Amtsgericht Berlin Charlottenburg; HRB 130120 B;
Ust.-IDNr. DE273952058
#3 lore raw

2012/10/22 Steffen Sledz <[email protected]>:

Quoted 8 lines · Samuel Stirtzel
Quoted 7 lines

2012/10/22 Steffen Sledz <[email protected]>:

Quoted 2 lines

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].

Quoted 8 lines
Quoted 5 lines

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"

Signature · 2 lines
Regards
Samuel
#4 lore raw
Quoted 11 lines · Samuel Stirtzel

2012/10/22 Steffen Sledz <[email protected]>:

Quoted 10 lines · Samuel Stirtzel
Quoted 9 lines

2012/10/22 Steffen Sledz <[email protected]>:

Quoted 2 lines

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.

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

[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

Signature · 5 lines
  Jack Mitchell ([email protected])
  Embedded Systems Engineer
  http://www.embed.me.uk

--
#5 lore raw
In reply to Samuel Stirtzel

2012/10/22 Samuel Stirtzel <[email protected]>:

Quoted 12 lines

2012/10/22 Steffen Sledz <[email protected]>:

Quoted 11 lines · Samuel Stirtzel
Quoted 10 lines

2012/10/22 Steffen Sledz <[email protected]>:

Quoted 2 lines

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.

Quoted 9 lines
Quoted 5 lines
Quoted 2 lines

[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

Signature · 2 lines
Regards
Samuel
#6 lore raw
In reply to Steffen Sledz
Quoted 2 lines · Steffen Sledz

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

#7 lore raw
Quoted 7 lines · Richard Purdie
Quoted 2 lines · Steffen Sledz

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.

#8 lore raw
Quoted 5 lines · Phil Blundell
Quoted 4 lines · Richard Purdie
Quoted 2 lines · Steffen Sledz

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

Quoted 7 lines
Quoted 3 lines

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

Quoted 9 lines

p.

_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core