From: Namhyung Kim <namhyung@gmail.com>
To: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>,
Paul Mackerras <paulus@samba.org>, Ingo Molnar <mingo@kernel.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 2/5] perf ui/tui: Add tui.h header
Date: Sat, 18 Aug 2012 01:03:44 +0900 [thread overview]
Message-ID: <1345219424.1656.8.camel@leonhard> (raw)
In-Reply-To: <20120816193711.GA10277@infradead.org>
Hi Arnaldo,
2012-08-16 (목), 16:37 -0300, Arnaldo Carvalho de Melo:
> Em Thu, Aug 16, 2012 at 05:14:51PM +0900, Namhyung Kim escreveu:
> > Consolidate TUI-relate header files and declarations into tui.h.
>
> What for?
>
> #include directives should be used where they are needed, and in this
> new tui.h only the definitions of those two structs are needed, right?
Right. But I just thought as more UI stuff is added, the more will be
needed. At least I'll add two more - hist, progress - in the near
future.
> I applied the first patch, looking at the others now.
Thanks! :)
Namhyung
>
> > Signed-off-by: Namhyung Kim <namhyung@kernel.org>
> > ---
> > tools/perf/Makefile | 1 +
> > tools/perf/ui/helpline.h | 2 --
> > tools/perf/ui/tui/helpline.c | 5 +----
> > tools/perf/ui/tui/setup.c | 12 +-----------
> > tools/perf/ui/tui/tui.h | 21 +++++++++++++++++++++
> > tools/perf/ui/tui/util.c | 10 +---------
> > 6 files changed, 25 insertions(+), 26 deletions(-)
> > create mode 100644 tools/perf/ui/tui/tui.h
> >
> > diff --git a/tools/perf/Makefile b/tools/perf/Makefile
> > index 483fb69fa4ae..14c0b744d98e 100644
> > --- a/tools/perf/Makefile
> > +++ b/tools/perf/Makefile
> > @@ -581,6 +581,7 @@ else
> > LIB_H += ui/progress.h
> > LIB_H += ui/util.h
> > LIB_H += ui/ui.h
> > + LIB_H += ui/tui/tui.h
> > endif
> > endif
> >
> > diff --git a/tools/perf/ui/helpline.h b/tools/perf/ui/helpline.h
> > index 61118b2bc242..d9e97f771245 100644
> > --- a/tools/perf/ui/helpline.h
> > +++ b/tools/perf/ui/helpline.h
> > @@ -11,8 +11,6 @@ struct ui_helpline {
> >
> > extern struct ui_helpline *helpline_fns;
> >
> > -void ui_helpline__init(void);
> > -
> > void ui_helpline__pop(void);
> > void ui_helpline__push(const char *msg);
> > void ui_helpline__vpush(const char *fmt, va_list ap);
> > diff --git a/tools/perf/ui/tui/helpline.c b/tools/perf/ui/tui/helpline.c
> > index b4e521ef2170..62bd9432f12a 100644
> > --- a/tools/perf/ui/tui/helpline.c
> > +++ b/tools/perf/ui/tui/helpline.c
> > @@ -3,10 +3,7 @@
> > #include <string.h>
> > #include <pthread.h>
> >
> > -#include "../../util/debug.h"
> > -#include "../helpline.h"
> > -#include "../ui.h"
> > -#include "../libslang.h"
> > +#include "tui.h"
> >
> >
> > static void tui_helpline__pop(void)
> > diff --git a/tools/perf/ui/tui/setup.c b/tools/perf/ui/tui/setup.c
> > index e813c1d17346..e247bf51d247 100644
> > --- a/tools/perf/ui/tui/setup.c
> > +++ b/tools/perf/ui/tui/setup.c
> > @@ -1,22 +1,12 @@
> > -#include <newt.h>
> > #include <signal.h>
> > #include <stdbool.h>
> >
> > -#include "../../util/cache.h"
> > -#include "../../util/debug.h"
> > -#include "../browser.h"
> > -#include "../helpline.h"
> > -#include "../ui.h"
> > -#include "../util.h"
> > -#include "../libslang.h"
> > -#include "../keysyms.h"
> > +#include "tui.h"
> >
> > pthread_mutex_t ui__lock = PTHREAD_MUTEX_INITIALIZER;
> >
> > static volatile int ui__need_resize;
> >
> > -extern struct perf_error_ops perf_tui_eops;
> > -
> > void ui__refresh_dimensions(bool force)
> > {
> > if (force || ui__need_resize) {
> > diff --git a/tools/perf/ui/tui/tui.h b/tools/perf/ui/tui/tui.h
> > new file mode 100644
> > index 000000000000..51e8cb527fcc
> > --- /dev/null
> > +++ b/tools/perf/ui/tui/tui.h
> > @@ -0,0 +1,21 @@
> > +#ifndef _PERF_TUI_H_
> > +#define _PERF_TUI_H_
> > +
> > +#include <newt.h>
> > +
> > +#include "../../util/debug.h"
> > +#include "../../util/cache.h"
> > +#include "../ui.h"
> > +#include "../util.h"
> > +#include "../browser.h"
> > +#include "../helpline.h"
> > +#include "../libslang.h"
> > +#include "../keysyms.h"
> > +
> > +extern struct perf_error_ops perf_tui_eops;
> > +
> > +extern struct ui_helpline tui_helpline_fns;
> > +
> > +void ui_helpline__init(void);
> > +
> > +#endif /* _PERF_TUI_H */
> > diff --git a/tools/perf/ui/tui/util.c b/tools/perf/ui/tui/util.c
> > index 092902e30cee..b555ae839b2a 100644
> > --- a/tools/perf/ui/tui/util.c
> > +++ b/tools/perf/ui/tui/util.c
> > @@ -1,17 +1,9 @@
> > -#include "../../util/util.h"
> > #include <signal.h>
> > #include <stdbool.h>
> > #include <string.h>
> > #include <sys/ttydefaults.h>
> >
> > -#include "../../util/cache.h"
> > -#include "../../util/debug.h"
> > -#include "../browser.h"
> > -#include "../keysyms.h"
> > -#include "../helpline.h"
> > -#include "../ui.h"
> > -#include "../util.h"
> > -#include "../libslang.h"
> > +#include "tui.h"
> >
> > static void ui_browser__argv_write(struct ui_browser *browser,
> > void *entry, int row)
> > --
> > 1.7.11.2
--
Regards,
Namhyung Kim
next prev parent reply other threads:[~2012-08-17 16:04 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-16 8:14 [PATCH v2 1/5] perf ui: Introduce struct ui_helpline Namhyung Kim
2012-08-16 8:14 ` [PATCH v2 2/5] perf ui/tui: Add tui.h header Namhyung Kim
2012-08-16 19:37 ` Arnaldo Carvalho de Melo
2012-08-16 19:42 ` Arnaldo Carvalho de Melo
2012-08-17 16:03 ` Namhyung Kim [this message]
2012-08-16 8:14 ` [PATCH v2 3/5] perf ui/gtk: Implement helpline_fns Namhyung Kim
2012-08-17 11:28 ` Pekka Enberg
2012-08-21 16:21 ` [tip:perf/core] perf ui gtk: " tip-bot for Namhyung Kim
2012-08-16 8:14 ` [PATCH v2 4/5] perf ui/gtk: Use helpline API in browser Namhyung Kim
2012-08-21 16:22 ` [tip:perf/core] " tip-bot for Namhyung Kim
2012-08-16 8:14 ` [PATCH v2 5/5] perf ui/gtk: Add perf_gtk__show_helpline() for pr_* Namhyung Kim
2012-08-17 16:40 ` [PATCH v3 " Namhyung Kim
2012-08-21 16:23 ` [tip:perf/core] perf ui gtk: " tip-bot for Namhyung Kim
2012-08-21 16:20 ` [tip:perf/core] perf ui: Introduce struct ui_helpline tip-bot for Namhyung Kim
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1345219424.1656.8.camel@leonhard \
--to=namhyung@gmail.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@ghostprotocols.net \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=paulus@samba.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox