Irina Tirdea
1d037ca164
perf tools: Use __maybe_used for unused variables
...
perf defines both __used and __unused variables to use for marking
unused variables. The variable __used is defined to
__attribute__((__unused__)), which contradicts the kernel definition to
__attribute__((__used__)) for new gcc versions. On Android, __used is
also defined in system headers and this leads to warnings like: warning:
'__used__' attribute ignored
__unused is not defined in the kernel and is not a standard definition.
If __unused is included everywhere instead of __used, this leads to
conflicts with glibc headers, since glibc has a variables with this name
in its headers.
The best approach is to use __maybe_unused, the definition used in the
kernel for __attribute__((unused)). In this way there is only one
definition in perf sources (instead of 2 definitions that point to the
same thing: __used and __unused) and it works on both Linux and Android.
This patch simply replaces all instances of __used and __unused with
__maybe_unused.
Signed-off-by: Irina Tirdea <irina.tirdea@intel.com >
Acked-by: Pekka Enberg <penberg@kernel.org >
Cc: David Ahern <dsahern@gmail.com >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: Namhyung Kim <namhyung.kim@lge.com >
Cc: Paul Mackerras <paulus@samba.org >
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl >
Cc: Steven Rostedt <rostedt@goodmis.org >
Link: http://lkml.kernel.org/r/1347315303-29906-7-git-send-email-irina.tirdea@intel.com
[ committer note: fixed up conflict with a116e05
in builtin-sched.c ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2012-09-11 12:19:15 -03:00
Namhyung Kim
12ceaded6b
perf gtk/browser: Use perf_hpp__format functions
...
Now we can support color using pango markup with this change.
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
Acked-by: Pekka Enberg <penberg@kernel.org >
Cc: Ingo Molnar <mingo@kernel.org >
Cc: Paul Mackerras <paulus@samba.org >
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl >
Link: http://lkml.kernel.org/r/1346640790-17197-6-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2012-09-08 13:20:21 -03:00
Namhyung Kim
2708bf3a30
perf ui gtk: Ensure not to call gtk_main_quit() twice
...
Currently the gtk_main_quit() is called twice when perf exits so the
following warning is emitted:
[penberg@tux perf]$ ./perf report --gtk
^Cperf: Interrupt
(perf:4048): Gtk-CRITICAL **: IA__gtk_main_quit: assertion `main_loops != NULL' failed
Fix it by not to call it unnecessarily.
Reported-by: Pekka Enberg <penberg@kernel.org >
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
Acked-by: Pekka Enberg <penberg@kernel.org >
Cc: Ingo Molnar <mingo@kernel.org >
Cc: Pekka Enberg <penberg@kernel.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Link: http://lkml.kernel.org/r/1345222583-3964-1-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2012-08-20 09:29:12 -03:00
Namhyung Kim
0985a94891
perf ui gtk: Add perf_gtk__show_helpline() for pr_*
...
Use helpline for printing error/debug messages. The code resembles a TUI
counter part and only print the first line of the message.
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
Acked-by: Pekka Enberg <penberg@kernel.org >
Cc: Ingo Molnar <mingo@kernel.org >
Cc: Paul Mackerras <paulus@samba.org >
Cc: Pekka Enberg <penberg@kernel.org >
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl >
Link: http://lkml.kernel.org/r/1345104894-14205-5-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2012-08-17 12:37:56 -03:00
Namhyung Kim
ed70c609ae
perf ui/gtk: Use helpline API in browser
...
As we now have a helpline implementation, use it for displaying help
messages.
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
Acked-by: Pekka Enberg <penberg@kernel.org >
Cc: Ingo Molnar <mingo@kernel.org >
Cc: Paul Mackerras <paulus@samba.org >
Cc: Pekka Enberg <penberg@kernel.org >
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl >
Link: http://lkml.kernel.org/r/1345104894-14205-4-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2012-08-17 12:37:36 -03:00
Namhyung Kim
4bb1646a80
perf ui gtk: Implement helpline_fns
...
Add helpline API implementation to GTK front-end.
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
Acked-by: Pekka Enberg <penberg@kernel.org >
Cc: Ingo Molnar <mingo@kernel.org >
Cc: Paul Mackerras <paulus@samba.org >
Cc: Pekka Enberg <penberg@kernel.org >
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl >
Link: http://lkml.kernel.org/r/1345104894-14205-3-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2012-08-17 12:37:11 -03:00
Arnaldo Carvalho de Melo
7289f83cce
perf tools: Move all users of event_name to perf_evsel__name
...
So that we don't use global variables that could make us misreport event
names when having a multi window top, for instance.
Cc: David Ahern <dsahern@gmail.com >
Cc: Frederic Weisbecker <fweisbec@gmail.com >
Cc: Jiri Olsa <jolsa@redhat.com >
Cc: Mike Galbraith <efault@gmx.de >
Cc: Namhyung Kim <namhyung@gmail.com >
Cc: Paul Mackerras <paulus@samba.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Stephane Eranian <eranian@google.com >
Link: http://lkml.kernel.org/n/tip-mccancovi1u0wdkg8ncth509@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2012-06-19 13:06:20 -03:00
Namhyung Kim
e078ba14df
perf ui/gtk: Use struct perf_error_ops
...
Define and use perf_gtk_eops to provide a GTK2 message dialog for error
reporting and a info_bar for warning.
As GtkInfoBar requires recent GTK+ libraries, provides a fallback
implementation using statusbar widget too.
Signed-off-by: Namhyung Kim <namhyung@gmail.com >
Acked-by: Pekka Enberg <penberg@kernel.org >
Cc: Paul Mackerras <paulus@samba.org >
Cc: Pekka Enberg <penberg@kernel.org >
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl >
Link: http://lkml.kernel.org/r/1338265382-6872-8-git-send-email-namhyung@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2012-06-19 13:06:19 -03:00
Namhyung Kim
a6b702c117
perf ui/gtk: Add GTK info_bar widget to browser window
...
The GtkInfoBar is a modern UI component to display messages without
bothering the main window. It'll be used for showing a warning message.
As the GtkInfoBar requires 2.18 (or newer) version of GTK+ library, add
availability check to Makefile too.
Suggested-by: Sunjin Yang <fan4326@gmail.com >
Signed-off-by: Namhyung Kim <namhyung@gmail.com >
Acked-by: Pekka Enberg <penberg@kernel.org >
Cc: Paul Mackerras <paulus@samba.org >
Cc: Pekka Enberg <penberg@kernel.org >
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl >
Link: http://lkml.kernel.org/r/1338265382-6872-7-git-send-email-namhyung@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2012-06-19 13:06:19 -03:00
Namhyung Kim
b4418c6848
perf ui/gtk: Add GTK statusbar widget to browser window
...
Add statusbar widget to display non-critical messages at the bottom of
the window. This can be used for showing a status change, warning or
help message.
Signed-off-by: Namhyung Kim <namhyung@gmail.com >
Acked-by: Pekka Enberg <penberg@kernel.org >
Cc: Paul Mackerras <paulus@samba.org >
Cc: Pekka Enberg <penberg@kernel.org >
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl >
Link: http://lkml.kernel.org/r/1338265382-6872-6-git-send-email-namhyung@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2012-06-19 13:06:19 -03:00
Namhyung Kim
42ab68a35f
perf ui/gtk: Introduce struct perf_gtk_context
...
The struct perf_gtk_context is for tracking current state of GTK window
and/or other things. This is a preparation of next changes.
Signed-off-by: Namhyung Kim <namhyung@gmail.com >
Acked-by: Pekka Enberg <penberg@kernel.org >
Cc: Paul Mackerras <paulus@samba.org >
Cc: Pekka Enberg <penberg@kernel.org >
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl >
Link: http://lkml.kernel.org/r/1338265382-6872-5-git-send-email-namhyung@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2012-06-19 13:06:18 -03:00
Namhyung Kim
ba47a142d9
perf ui: Introduce struct perf_error_ops
...
The struct perf_error_ops is for flexible error logging.
We can register appropriate functions based on front-end.
Signed-off-by: Namhyung Kim <namhyung.kim@lge.com >
Acked-by: Pekka Enberg <penberg@kernel.org >
Cc: Paul Mackerras <paulus@samba.org >
Cc: Pekka Enberg <penberg@kernel.org >
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl >
Link: http://lkml.kernel.org/r/1338265382-6872-4-git-send-email-namhyung@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2012-06-19 13:06:18 -03:00
Namhyung Kim
dc41b9b8f0
perf ui: Change fallback policy of setup_browser()
...
If gtk2 support is not enabled (or failed for some reason) try TUI again
instead of falling directly back to the stdio interface.
Signed-off-by: Namhyung Kim <namhyung.kim@lge.com >
Acked-by: Pekka Enberg <penberg@kernel.org >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: Namhyung Kim <namhyung@gmail.com >
Cc: Paul Mackerras <paulus@samba.org >
Cc: Pekka Enberg <penberg@kernel.org >
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl >
Link: http://lkml.kernel.org/r/1335761711-31403-6-git-send-email-namhyung.kim@lge.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2012-05-02 16:17:37 -03:00
Namhyung Kim
281ef544a8
perf ui: Add gtk2 support into setup_browser()
...
Now setup_browser can handle gtk2 front-end so split the TUI code to
ui/tui/setup.c in order to remove dependency.
To this end, make ui__init/exit global symbols and take an argument.
Also split gtk code to ui/gtk/setup.c.
Signed-off-by: Namhyung Kim <namhyung.kim@lge.com >
Acked-by: Pekka Enberg <penberg@kernel.org >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: Namhyung Kim <namhyung@gmail.com >
Cc: Paul Mackerras <paulus@samba.org >
Cc: Pekka Enberg <penberg@kernel.org >
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl >
Link: http://lkml.kernel.org/r/1335761711-31403-5-git-send-email-namhyung.kim@lge.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2012-05-02 16:17:34 -03:00
Namhyung Kim
28e62b90d9
perf ui gtk: Rename functions for consistency
...
We use double underscore characters to distinguish its subsystem and
actual function name.
Signed-off-by: Namhyung Kim <namhyung.kim@lge.com >
Acked-by: Pekka Enberg <penberg@kernel.org >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: Namhyung Kim <namhyung@gmail.com >
Cc: Paul Mackerras <paulus@samba.org >
Cc: Pekka Enberg <penberg@kernel.org >
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl >
Link: http://lkml.kernel.org/r/1335761711-31403-4-git-send-email-namhyung.kim@lge.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2012-05-02 16:17:28 -03:00
Namhyung Kim
7706f96632
perf ui gtk: Drop arg[cv] arguments from perf_gtk_setup_browser()
...
As perf doesn't allow to specify gtk command-line option, drop the
arguments and pass NULL to gtk_init().
This makes the function easier to be called from setup_browser().
Signed-off-by: Namhyung Kim <namhyung.kim@lge.com >
Acked-by: Pekka Enberg <penberg@kernel.org >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: Namhyung Kim <namhyung@gmail.com >
Cc: Paul Mackerras <paulus@samba.org >
Cc: Pekka Enberg <penberg@kernel.org >
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl >
Link: http://lkml.kernel.org/r/1335761711-31403-3-git-send-email-namhyung.kim@lge.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2012-05-02 16:17:25 -03:00
Namhyung Kim
e7b3ba6d8b
perf tools: Move GTK+ bits to tools/perf/ui/gtk directory
...
Move those files to new directory in order to be prepared to
further UI work. Makefile and header file pathes are adjusted
accordingly. Also fix a build breakage if NO_GTK2=1 is given.
Signed-off-by: Namhyung Kim <namhyung.kim@lge.com >
Suggested-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net >
Acked-by: Pekka Enberg <penberg@kernel.org >
Cc: Ingo Molnar <mingo@elte.hu >
Cc: Namhyung Kim <namhyung.kim@lge.com >
Cc: Paul Mackerras <paulus@samba.org >
Cc: Pekka Enberg <penberg@kernel.org >
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl
Link: http://lkml.kernel.org/r/1333523765-12092-1-git-send-email-namhyung.kim@lge.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2012-04-11 17:18:31 -03:00