lkml.org 
[lkml]   [2022]   [Apr]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] tools: port perf ui from GTK 2 to GTK 3
On Wed, Apr 20, 2022 at 10:08 AM Arnaldo Carvalho de Melo
<arnaldo.melo@gmail.com> wrote:
>
> Em Thu, Apr 14, 2022 at 10:00:03PM -0700, Matt Turner escreveu:
> > From: Jelle van der Waa <jvanderwaa@redhat.com>
> >
> > GTK 2 is a legacy API and the newer version is GTK 3 which changes a few
> > API functions. gtk_tree_view_set_rules_hint is no longer required since
> > theme's are now responsible to handle this, gtk_vbox_new is deprecated
> > and replaced by passing the orientation to gtk_box_new. Apart from these
> > changes the accessing of the screen changed in GTK which requires using
> > new functions for getting geometry. Lastly the GTK_STOCK_OK define is
> > deprecated in GTK 3.
> >
> > Signed-off-by: Jelle van der Waa <jvanderwaa@redhat.com>
> > Signed-off-by: Matt Turner <mattst88@gmail.com>
> > ---
> > Originally sent in 2019. I've rebased it and given it a test.
> >
> > One problem I've noticed is that C++ symbol names are often broken.
> > E.g.:
> >
> > (perf:3254940): Gtk-WARNING **: 21:47:46.663: Failed to set text from
> > markup due to error parsing markup: Error on line 1 char 95:
> > “std::char_traits<char” is not a valid name: “<”
> >
> > Presumably we need to call g_markup_escape_text() somewhere, but I
> > struggled to find the right place.
> >
> > Without the patch, the GTK-2 version repeatedly segfaults, so this is an
> > improvement regardless.
>
> I'm trying to test build this but failing:
>
> 1. uninstalled gtk2-devel, which removed several other packages
>
> 2. installed gtk3-devel, which installed several other packages
>
> 3.:
>
> Auto-detecting system features:
> ... dwarf: [ on ]
> ... dwarf_getlocations: [ on ]
> ... glibc: [ on ]
> ... gtk3: [ OFF ]
> ... libbfd: [ on ]
> ... libbfd-buildid: [ on ]
>
> Looking at how that OFF is deduced:
>
> ⬢[acme@toolbox perf]$ cat /tmp/build/perf/feature/test-
> Display all 150 possibilities? (y or n)
> ⬢[acme@toolbox perf]$ cat /tmp/build/perf/feature/test-all.make.output
> In file included from test-all.c:74:
> test-gtk3.c:3:10: fatal error: gtk/gtk.h: No such file or directory
> 3 | #include <gtk/gtk.h>
> | ^~~~~~~~~~~
> compilation terminated.
> ⬢[acme@toolbox perf]$
>
> ⬢[acme@toolbox perf]$ find /usr/include -name gtk.h
> /usr/include/gtk-3.0/gtk/gtk.h
> ⬢[acme@toolbox perf]$ rpm -qf /usr/include/gtk-3.0/gtk/gtk.h
> gtk3-devel-3.24.31-2.fc35.x86_64
> ⬢[acme@toolbox perf]$
>
> And that pkg-config line produces:
>
> ⬢[acme@toolbox perf]$ pkg-config --libs --cflags gtk+-3.0
> -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/sysprof-4 -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/fribidi -I/usr/include/libxml2 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/gio-unix-2.0 -I/usr/include/cloudproviders -I/usr/include/atk-1.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/include/at-spi-2.0 -pthread -lgtk-3 -lgdk-3 -lz -lpangocairo-1.0 -lpango-1.0 -lharfbuzz -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0
> ⬢[acme@toolbox perf]$
>
> I'm testing this on fedora 35 silverblue, in a perf build container:
>
> ⬢[acme@toolbox perf]$ rpm -qa | grep gtk
> gtk-update-icon-cache-3.24.31-2.fc35.x86_64
> libcanberra-gtk3-0.30-27.fc35.x86_64
> gtk3-3.24.31-2.fc35.x86_64
> libcanberra-gtk2-0.30-27.fc35.x86_64
> gtk2-2.24.33-7.fc35.x86_64
> gtk3-devel-3.24.31-2.fc35.x86_64
> ⬢[acme@toolbox perf]$
>
> Ideas?

Just to be clear, are you building with 'GTK3=1 make'? Since commit
4751bddd3f98 ("perf tools: Make GTK2 support opt-in") it's required to
enable GTK support explicitly. (IMO, leaving it disabled by default
makes sense to me, given some of the problems)

\
 
 \ /
  Last update: 2022-04-21 23:04    [W:0.084 / U:0.892 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site