Skip to content

perf ui: Add basic error handling for GTK2 front-end (v3)

Namhyung Kim lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest7 patches 8 repliesIn review

Changes from v2 from the cover letter

* Convert critical use of ui__warning to ui__error (by Ingo)
* Use GtkInfoBar instead of a message dialog (by Pekka)

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7perf ui: Make --stdio default when TUI is not supportedtools/perf/ui/setup.c+1 -00 replies
2/7perf tools: Convert critical messages to ui__error()tools/perf/builtin-annotate.c tools/perf/builtin-record.c tools/perf/builtin-report.c +1 more+25 -271 reply
3/7perf ui: Introduce struct perf_error_opstools/perf/Makefile tools/perf/ui/gtk/util.c tools/perf/ui/tui/setup.c +5 more+357 -2261 reply
4/7perf ui/gtk: Introduce struct perf_gtk_contexttools/perf/ui/gtk/browser.c tools/perf/ui/gtk/gtk.h tools/perf/ui/gtk/util.c+47 -11 reply
5/7perf ui/gtk: Add GTK statusbar widget to browser windowtools/perf/ui/gtk/browser.c tools/perf/ui/gtk/gtk.h+27 -11 reply
6/7perf ui/gtk: Add GTK info_bar widget to browser windowtools/perf/Makefile tools/perf/config/feature-tests.mak tools/perf/ui/gtk/browser.c +1 more+61 -01 reply
7/7perf ui/gtk: Use struct perf_error_opstools/perf/ui/gtk/setup.c tools/perf/ui/gtk/util.c+91 -01 reply

Reviews trailers per patch

5 of 7 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchPekka Enberg
SeriesA-b
1/7
2/7
3/7A-b
4/7A-b
5/7A-b
6/7A-b
7/7A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/7] perf ui: Add basic error handling for GTK2 front-end (v3)

Hi,

This patchset implements ui__warning/error() functions for GTK2. Patch 1 is a resend (which forgot to cc LKML) and independent of this series. Patch 2 converts invocations of ui__warning followed by exit (or similar effect) into ui__error.

I chose GtkInfoBar widget to implement ui__warning since it provides a simple way to do what we want IMHO. In fact, a guy sat next to me at the Korean GNOME hackfest suggested to use it. The only problem is it requires 2.18 (or newer) version of GTK+ libraries. So I added status bar as a fallback when info bar is not supported, and this can be used to implement helpline functions later.

Changes from v2:
* Convert critical use of ui__warning to ui__error (by Ingo)
* Use GtkInfoBar instead of a message dialog (by Pekka)

Any comments are welcome.

Thanks,
Namhyung

Namhyung Kim (7):
perf ui: Make --stdio default when TUI is not supported perf tools: Convert critical messages to ui__error() perf ui: Introduce struct perf_error_ops
perf ui/gtk: Introduce struct perf_gtk_context perf ui/gtk: Add GTK statusbar widget to browser window perf ui/gtk: Add GTK info_bar widget to browser window perf ui/gtk: Use struct perf_error_ops

 tools/perf/Makefile                 |    6 +
 tools/perf/builtin-annotate.c       |    2 +-
 tools/perf/builtin-record.c         |   14 +-
 tools/perf/builtin-report.c         |   14 +-
 tools/perf/builtin-top.c            |   22 +--
 tools/perf/config/feature-tests.mak |   13 ++
 tools/perf/ui/gtk/browser.c         |   67 ++++++++-
 tools/perf/ui/gtk/gtk.h             |   31 ++++
 tools/perf/ui/gtk/setup.c           |    5 +
 tools/perf/ui/gtk/util.c            |  129 ++++++++++++++++
 tools/perf/ui/setup.c               |    1 +
 tools/perf/ui/tui/setup.c           |    6 +
 tools/perf/ui/tui/util.c            |  243 ++++++++++++++++++++++++++++++
 tools/perf/ui/util.c                |  277 +++++++----------------------------
 tools/perf/ui/util.h                |    9 +-
 tools/perf/util/debug.c             |    2 +-
 tools/perf/util/debug.h             |   23 ++-
 17 files changed, 609 insertions(+), 255 deletions(-)
 create mode 100644 tools/perf/ui/gtk/util.c
 create mode 100644 tools/perf/ui/tui/util.c
Signature · 1 line
1.7.9.2