Re: [PATCH] RFC: perf, tools: Move gtk browser into separate perfgtkexecutable

From: Ingo Molnar
Date: Mon Aug 05 2013 - 04:16:55 EST



* Andi Kleen <andi@xxxxxxxxxxxxxx> wrote:

> From: Andi Kleen <ak@xxxxxxxxxxxxxxx>
>
> By default perf currently links with the GTK2 gui. This pulls
> in a lot of external libraries. It also causes dependency
> problems for distribution packages: simply installing perf
> requires pulling in GTK2 with all its dependencies.
>
> I think the UI is valuable, but it shouldn't be everywhere.
>
> The interfaces between the main perf and the GTK2 perf are
> already quite clean, so it's very straight forward to just
> add a few weak stubs and then generate two executables:
> perf and perfgtk
>
> The only difference is that the gtk version links in the
> GTK code and overrides the weak stubs.
> (so everything is still only compiled once)
>
> I currently gave it the preliminary name "perfgtk".
>
> This cuts down the library dependencies on the main perf
> dramatically. It also completely eliminates the GTK2_SUPPORT
> ifdef.
>
> % ldd ./perf | wc -l
> 18
> % ldd ./perfgtk | wc -l
> 53

If you want fewer dependencies then build with 'make NO_GTK=1'.

Furthermore, what really matters in practice is binary size - and the GKT
UI frontend code isn't really big:

comet:~/tip/tools/perf> ls -l perf.gtk perf.nogtk
-rwxrwxr-x 1 mingo mingo 2525416 Aug 5 10:09 perf.gtk.stripped
-rwxrwxr-x 1 mingo mingo 2497480 Aug 5 10:09 perf.nogtk.stripped

that's only a 1% difference ...

So this is not a good idea, as it breaks the single binary structure of
perf, which is a rather powerful concept that has served us really well in
the past.

Thanks,

Ingo
--
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/