Jiri Olsa
a82bfd041d
perf ui progress: Fix progress update
...
We currently update the 'next' variable only with a single step value.
But it's possible the 'adv' update is bigger than single 'step' value.
This would leave 'next' value under counted and force unnecessary
ui_progress__ops->update calls.
Calculate the amount of steps we need for 'adv' update and increase the
'next' with that amounts of steps.
Signed-off-by: Jiri Olsa <jolsa@kernel.org >
Cc: David Ahern <dsahern@gmail.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl >
Link: http://lkml.kernel.org/r/20170908120510.22515-3-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2017-09-12 12:34:54 -03:00
Jiri Olsa
4d286c89e4
perf ui progress: Make sure we always define step value
...
Unlikely, but we could have ui_progress__init being called with total <
16, which would set the next and step variables to 0. That would force
unnecessary ui_progress__ops->update calls because 'next' would never
raise.
Forcing the next and step values to be always > 0.
Signed-off-by: Jiri Olsa <jolsa@kernel.org >
Cc: David Ahern <dsahern@gmail.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl >
Link: http://lkml.kernel.org/r/20170908120510.22515-2-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2017-09-12 12:34:46 -03:00
Arnaldo Carvalho de Melo
4d3001fdfd
perf ui progress: Per progress bar state
...
That will ease using a progress bar across multiple functions, like in
the upcoming patches that will present a progress bar when collapsing
histograms.
Based on a previous patch by Namhyung Kim.
Cc: Adrian Hunter <adrian.hunter@intel.com >
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: Paul Mackerras <paulus@samba.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Stephane Eranian <eranian@google.com >
Link: http://lkml.kernel.org/n/tip-cr7lq7ud9fj21bg7wvq27w1u@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2013-10-23 15:40:38 -03:00
Arnaldo Carvalho de Melo
4779a2e99a
perf ui: Rename ui_progress to ui_progress_ops
...
Reserving 'struct ui_progress' to the per progress instances, not to the
particular set of operations used to implmenet a progress bar in the
current UI (GTK, TUI, etc).
Cc: Adrian Hunter <adrian.hunter@intel.com >
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: Paul Mackerras <paulus@samba.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Stephane Eranian <eranian@google.com >
Link: http://lkml.kernel.org/n/tip-zjqbfp9gx3yo45s0rp9uv42n@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2013-10-23 14:41:23 -03:00
Namhyung Kim
a5580f3ecb
perf ui: Add ui_progress__finish()
...
Sometimes we need to know when the progress bar should disappear.
Checking curr >= total wasn't enough since there're cases not met that
condition for the last call.
So add a new ->finish callback to identify this explicitly. Currently
only GTK frontend needs it.
Signed-off-by: Namhyung Kim <namhyung@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/1352813436-14173-4-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2012-11-14 16:52:56 -03:00
Namhyung Kim
688f2f5b99
perf ui: Introduce generic ui_progress helper
...
Make ui_progress functions generic so that UI frontend code will add its
callbacks.
Signed-off-by: Namhyung Kim <namhyung@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/1352813436-14173-2-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2012-11-14 16:52:39 -03:00
Namhyung Kim
7da5c85dd3
perf ui tui: Move progress.c under ui/tui directory
...
Current ui_progress functions are implemented for TUI only. So move the
file under the tui directory. This is needed for providing an UI-
agnostic wrapper.
Signed-off-by: Namhyung Kim <namhyung@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/1352813436-14173-1-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2012-11-14 16:52:33 -03:00
Namhyung Kim
aca7a94d6a
perf tools: Move UI bits to tools/perf/ui directory
...
Move those files to new directory in order to be prepared to further UI
work. Makefile and header file pathes are adjusted accordingly.
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/1333523666-12057-1-git-send-email-namhyung.kim@lge.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2012-04-11 17:16:40 -03:00