Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] Setting up Perf for buildroot
@ 2012-12-28  4:26 Kaiwan Billimoria
  2012-12-28 10:18 ` Jeremy Rosen
  0 siblings, 1 reply; 5+ messages in thread
From: Kaiwan Billimoria @ 2012-12-28  4:26 UTC (permalink / raw)
  To: buildroot

Hi All,

I saw this message titled "[Buildroot] elfutils and the perf userspace
tool" (see below) on the buildroot mailing list. Last email is shown below:

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Dear Bogdan Radulescu,

On Thu, 6 Dec 2012 08:10:12 -0800 (PST), Bogdan Radulescu wrote:

> I noticed now that this is in the newer versions. I tried to build it
> without libelf even though it will be pretty crippled but still I
> didn't have any luck. http://pastie.org/pastes/5489305/text
>
> I tried with using 3.7-rc3. In 3.4.22 isn't patched for building
> without libelf. On which version did you manage to build it for ARM?

I never built perf for ARM so far, so I can't really help,
unfortunately.

Thomas
-- 
Thomas Petazzoni, Free Electrons
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx


I too am very interested in getting the 'perf' tools onto buildroot.
I would be willing to try this and submit a patch for the same (in fact I
already have one from
another source that seems to work, successfully cross-compiling perf for
ARM), but before that, I have a question:

What would be the appropriate location in the buildroot tree for 'perf'?
Packages branch? Am asking as, of course, perf is a Linux *kernel* (but)
user-space component/tool (it lives under <kernel-src-tree>/tools/perf).
So should we look at inserting a patch as part of the 'kernel' menu or
under 'packages' itself?

TIA!
Kaiwan.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20121228/b16fcefb/attachment-0001.html>

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

* [Buildroot] Setting up Perf for buildroot
  2012-12-28  4:26 [Buildroot] Setting up Perf for buildroot Kaiwan Billimoria
@ 2012-12-28 10:18 ` Jeremy Rosen
  2012-12-28 10:51   ` Thomas Petazzoni
  0 siblings, 1 reply; 5+ messages in thread
From: Jeremy Rosen @ 2012-12-28 10:18 UTC (permalink / raw)
  To: buildroot

my guess is that ideally the config entries should be in packages->debug tools, but the makefile should be integrated in the linux kernel makefile

I don't think it's possible with KConfig, though...


maybe add a perf directory in the packages/ dir with only the Config.in and use the variables set by that Config.in within the kernel makefiles to build the tool


(that's just an idea, I havn't looked precisely how it's done)

    Cordialement

    J?r?my Rosen

fight key loggers : write some perl using vim

----- Mail original -----
> De: "Kaiwan Billimoria" <kaiwan.billimoria@gmail.com>
> ?: buildroot at busybox.net
> Envoy?: Vendredi 28 D?cembre 2012 05:26:08
> Objet: [Buildroot] Setting up Perf for buildroot
> 
> 
> Hi All,
> 
> I saw this message titled "[Buildroot] elfutils and the perf
> userspace tool" (see below) on the buildroot mailing list. Last
> email is shown below:
> 
> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Dear Bogdan Radulescu,
> 
> On Thu, 6 Dec 2012 08:10:12 -0800 (PST), Bogdan Radulescu wrote:
> 
> > I noticed now that this is in the newer versions. I tried to build
> > it
> > without libelf even though it will be pretty crippled but still I
> > didn't have any luck. http://pastie.org/pastes/5489305/text
> > 
> > I tried with using 3.7-rc3. In 3.4.22 isn't patched for building
> > without libelf. On which version did you manage to build it for
> > ARM?
> 
> I never built perf for ARM so far, so I can't really help,
> unfortunately.
> 
> Thomas
> --
> Thomas Petazzoni, Free Electrons
> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> 
> 
> I too am very interested in getting the 'perf' tools onto buildroot.
> I would be willing to try this and submit a patch for the same (in
> fact I already have one from
> another source that seems to work, successfully cross-compiling perf
> for ARM), but before that, I have a question:
> 
> 
> What would be the appropriate location in the buildroot tree for
> 'perf'?
> Packages branch? Am asking as, of course, perf is a Linux *kernel*
> (but) user-space component/tool (it lives under
> <kernel-src-tree>/tools/perf).
> So should we look at inserting a patch as part of the 'kernel' menu
> or under 'packages' itself?
> 
> 
> TIA!
> Kaiwan.
> 
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

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

* [Buildroot] Setting up Perf for buildroot
  2012-12-28 10:18 ` Jeremy Rosen
@ 2012-12-28 10:51   ` Thomas Petazzoni
  2012-12-28 13:09     ` Kaiwan Billimoria
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Petazzoni @ 2012-12-28 10:51 UTC (permalink / raw)
  To: buildroot

Dear Jeremy Rosen,

Please fix your e-mail client to wrap lines at a reasonable width.

On Fri, 28 Dec 2012 11:18:06 +0100 (CET), Jeremy Rosen wrote:

> my guess is that ideally the config entries should be in packages->debug tools, but the makefile should be integrated in the linux kernel makefile
> 
> I don't think it's possible with KConfig, though...
> 
> 
> maybe add a perf directory in the packages/ dir with only the Config.in and use the variables set by that Config.in within the kernel makefiles to build the tool

See:

Subject: Re: [Buildroot] [PATCH v3] usbip: new package
Date: Wed, 26 Dec 2012 18:32:20 +0100

where I did some suggestions on how to do this.

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

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

* [Buildroot] Setting up Perf for buildroot
  2012-12-28 10:51   ` Thomas Petazzoni
@ 2012-12-28 13:09     ` Kaiwan Billimoria
  2012-12-28 13:11       ` Kaiwan Billimoria
  0 siblings, 1 reply; 5+ messages in thread
From: Kaiwan Billimoria @ 2012-12-28 13:09 UTC (permalink / raw)
  To: buildroot

Reproducing the email referenced for context, below.
Pl see my comments inline below:
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

[Buildroot] [PATCH v3] usbip: new package

Thomas Petazzoni thomas.petazzoni at free-electrons.com
Wed Dec 26 17:32:20 UTC 2012

Dear Jeremy Rosen,

On Wed, 26 Dec 2012 17:49:57 +0100 (CET), Jeremy Rosen wrote:

> I would be interested too, more and more tools are distributed with
> the kernel that we might want to build... I'm thinking of the perf
> tools in particular
>
> is there an example somewhere on how to handle these ?

> Unfortunately, there isn't a really good and nice way of handling these
> in Buildroot for now.
>
> I see two options:

 > * Add sub-options to the "Linux kernel" package, to allow the
 >   installation of perf, usbip or other userspace packages whose source
 >   code is bundled with the kernel source code. This is the easiest
 >   solution, since the kernel version, sources and al. is already
>    defined. But it also has major drawbacks: 1/ it makes those tools
  >  available only if you build your kernel with Buildroot and 2/ it
  >  puts the configuration options to install those tools inside the
  >  "Linux kernel" menu, which is not very intuitive.

To my thinking, this (option 1 above) would be the "right" way.

Reasons:
a) As Thomas mentions below, there is an ABI (user<->kernel) that
needs to be honoured, which requires the correct kernel source tree
b) Experienced developers (i.e. buildroot end-users :) ) should be - /
be educated on / - aware of the trade-off's that building a
kernel-tree user-mode tool entails; we should clearly document the
"drawbacks" as well..
c) Drawback 1: Yes it does mean building BR with the kernel; but of
course, a serious end-user can then always choose to use their own
custom kernel afterwards... and regression-test to see whether the
tools work as expected
d) Drawback 2:not a very serious one, IMO... -this can further be
documented in the manual (& word gets around :) )
e) Merely extracting one or 2 folders from the kernel src tree may not
cut it for all tools; in fact, perf has some dependencies on other
portions of the kernel source tree.

So I was thinking, keep a config directive in linux/Config.in called
BR2_LINUX_KERNEL_TOOLS_XXX
where XXX is the user-mode tool to be built.

Thanks,
Kaiwan.

 > * Add separate packages for each of those tools in package/, with
   > those packages depending on the "linux" package. The extract step of
   > those packages could copy the source code of these tools from the
   > Linux kernel source tree into their build directory, or simply build
   > then directly from within the Linux kernel source tree. It solves
   > drawback (2) described above, but not drawback (1).

 > * Add separate packages for each of those tools in package/, and make
   > them independent from the Linux package. They would for example
   > download the latest stable version of the Linux kernel source code,
   > and use that as a source. The extract step could be customized to
   > only extract the part of the kernel sources that are actually
   > relevant for this package. This would solve both drawbacks (1) and
   > (2), but adds different drawbacks: it's another place where we have
   > to bump the kernel version regularly, and people may want to
   > configure the version of the kernel sources used to build those
   > tools: the primary reason why those tools are bundled with the
   > kernel sources is because the userspace-to-kernel ABI specific to
   > those tools gets changed from time to time, and therefore there may
   > be compatibility issues in running those tools from kernel version X
   > under a system running kernel version Y.

> Best regards,

> Thomas
> --
> Thomas Petazzoni, Free Electrons
> Kernel, drivers, real-time and embedded Linux
> development, consulting, training and support.
> http://free-electrons.com

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx



On Fri, Dec 28, 2012 at 4:21 PM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
>
> Dear Jeremy Rosen,
>
> Please fix your e-mail client to wrap lines at a reasonable width.
>
> On Fri, 28 Dec 2012 11:18:06 +0100 (CET), Jeremy Rosen wrote:
>
> > my guess is that ideally the config entries should be in packages->debug tools, but the makefile should be integrated in the linux kernel makefile
> >
> > I don't think it's possible with KConfig, though...
> >
> >
> > maybe add a perf directory in the packages/ dir with only the Config.in and use the variables set by that Config.in within the kernel makefiles to build the tool
>
> See:
>
> Subject: Re: [Buildroot] [PATCH v3] usbip: new package
> Date: Wed, 26 Dec 2012 18:32:20 +0100
>
> where I did some suggestions on how to do this.
>
> Thomas
> --
> Thomas Petazzoni, Free Electrons
> Kernel, drivers, real-time and embedded Linux
> development, consulting, training and support.
> http://free-electrons.com

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

* [Buildroot] Setting up Perf for buildroot
  2012-12-28 13:09     ` Kaiwan Billimoria
@ 2012-12-28 13:11       ` Kaiwan Billimoria
  0 siblings, 0 replies; 5+ messages in thread
From: Kaiwan Billimoria @ 2012-12-28 13:11 UTC (permalink / raw)
  To: buildroot

Or, perhaps better:

BR2_LINUX_KERNEL_USERMODE_TOOLS_XXX

On Fri, Dec 28, 2012 at 6:39 PM, Kaiwan Billimoria
<kaiwan.billimoria@gmail.com> wrote:
> So I was thinking, keep a config directive in linux/Config.in called
> BR2_LINUX_KERNEL_TOOLS_XXX
> where XXX is the user-mode tool to be built.

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

end of thread, other threads:[~2012-12-28 13:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-28  4:26 [Buildroot] Setting up Perf for buildroot Kaiwan Billimoria
2012-12-28 10:18 ` Jeremy Rosen
2012-12-28 10:51   ` Thomas Petazzoni
2012-12-28 13:09     ` Kaiwan Billimoria
2012-12-28 13:11       ` Kaiwan Billimoria

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