All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf: move get_term_dimensions from top to util.c
@ 2013-01-14 17:48 David Ahern
  2013-01-25 11:49 ` [tip:perf/core] perf tools: Move " tip-bot for David Ahern
  0 siblings, 1 reply; 3+ messages in thread
From: David Ahern @ 2013-01-14 17:48 UTC (permalink / raw)
  To: acme, linux-kernel; +Cc: David Ahern

It is used by util/help.c so it should be a lib function and included
in libperf.a. Code move only.

Signed-off-by: David Ahern <dsahern@gmail.com>
---
 tools/perf/builtin-top.c |   22 ----------------------
 tools/perf/perf.h        |    4 ----
 tools/perf/util/util.c   |   22 ++++++++++++++++++++++
 tools/perf/util/util.h   |    3 +++
 4 files changed, 25 insertions(+), 26 deletions(-)

diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index c9ff395..471efaa 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -68,28 +68,6 @@
 #include <linux/unistd.h>
 #include <linux/types.h>
 
-void get_term_dimensions(struct winsize *ws)
-{
-	char *s = getenv("LINES");
-
-	if (s != NULL) {
-		ws->ws_row = atoi(s);
-		s = getenv("COLUMNS");
-		if (s != NULL) {
-			ws->ws_col = atoi(s);
-			if (ws->ws_row && ws->ws_col)
-				return;
-		}
-	}
-#ifdef TIOCGWINSZ
-	if (ioctl(1, TIOCGWINSZ, ws) == 0 &&
-	    ws->ws_row && ws->ws_col)
-		return;
-#endif
-	ws->ws_row = 25;
-	ws->ws_col = 80;
-}
-
 static void perf_top__update_print_entries(struct perf_top *top)
 {
 	if (top->print_entries > 9)
diff --git a/tools/perf/perf.h b/tools/perf/perf.h
index 2c340e7..ec1eace 100644
--- a/tools/perf/perf.h
+++ b/tools/perf/perf.h
@@ -1,10 +1,6 @@
 #ifndef _PERF_PERF_H
 #define _PERF_PERF_H
 
-struct winsize;
-
-void get_term_dimensions(struct winsize *ws);
-
 #include <asm/unistd.h>
 
 #if defined(__i386__)
diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c
index 5906e84..1e32d8b 100644
--- a/tools/perf/util/util.c
+++ b/tools/perf/util/util.c
@@ -218,3 +218,25 @@ void dump_stack(void)
 #else
 void dump_stack(void) {}
 #endif
+
+void get_term_dimensions(struct winsize *ws)
+{
+	char *s = getenv("LINES");
+
+	if (s != NULL) {
+		ws->ws_row = atoi(s);
+		s = getenv("COLUMNS");
+		if (s != NULL) {
+			ws->ws_col = atoi(s);
+			if (ws->ws_row && ws->ws_col)
+				return;
+		}
+	}
+#ifdef TIOCGWINSZ
+	if (ioctl(1, TIOCGWINSZ, ws) == 0 &&
+	    ws->ws_row && ws->ws_col)
+		return;
+#endif
+	ws->ws_row = 25;
+	ws->ws_col = 80;
+}
diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h
index c233091..ec5de5e 100644
--- a/tools/perf/util/util.h
+++ b/tools/perf/util/util.h
@@ -271,4 +271,7 @@ void dump_stack(void);
 
 extern unsigned int page_size;
 
+struct winsize;
+void get_term_dimensions(struct winsize *ws);
+
 #endif
-- 
1.7.10.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [tip:perf/core] perf tools: Move get_term_dimensions from top to util.c
  2013-01-14 17:48 [PATCH] perf: move get_term_dimensions from top to util.c David Ahern
@ 2013-01-25 11:49 ` tip-bot for David Ahern
  0 siblings, 0 replies; 3+ messages in thread
From: tip-bot for David Ahern @ 2013-01-25 11:49 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: acme, linux-kernel, hpa, mingo, dsahern, tglx

Commit-ID:  2c803e5248d038988ec7c52e8fd7c83130dd3c13
Gitweb:     http://git.kernel.org/tip/2c803e5248d038988ec7c52e8fd7c83130dd3c13
Author:     David Ahern <dsahern@gmail.com>
AuthorDate: Mon, 14 Jan 2013 10:48:01 -0700
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Thu, 24 Jan 2013 16:40:34 -0300

perf tools: Move get_term_dimensions from top to util.c

It is used by util/help.c so it should be a lib function and included in
libperf.a. Code move only.

Signed-off-by: David Ahern <dsahern@gmail.com>
Link: http://lkml.kernel.org/r/1358185681-90926-1-git-send-email-dsahern@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-top.c | 22 ----------------------
 tools/perf/perf.h        |  4 ----
 tools/perf/util/util.c   | 22 ++++++++++++++++++++++
 tools/perf/util/util.h   |  3 +++
 4 files changed, 25 insertions(+), 26 deletions(-)

diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index bc78812..e05ba81 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -68,28 +68,6 @@
 #include <linux/unistd.h>
 #include <linux/types.h>
 
-void get_term_dimensions(struct winsize *ws)
-{
-	char *s = getenv("LINES");
-
-	if (s != NULL) {
-		ws->ws_row = atoi(s);
-		s = getenv("COLUMNS");
-		if (s != NULL) {
-			ws->ws_col = atoi(s);
-			if (ws->ws_row && ws->ws_col)
-				return;
-		}
-	}
-#ifdef TIOCGWINSZ
-	if (ioctl(1, TIOCGWINSZ, ws) == 0 &&
-	    ws->ws_row && ws->ws_col)
-		return;
-#endif
-	ws->ws_row = 25;
-	ws->ws_col = 80;
-}
-
 static void perf_top__update_print_entries(struct perf_top *top)
 {
 	if (top->print_entries > 9)
diff --git a/tools/perf/perf.h b/tools/perf/perf.h
index 7622f15..8f3bf38 100644
--- a/tools/perf/perf.h
+++ b/tools/perf/perf.h
@@ -1,10 +1,6 @@
 #ifndef _PERF_PERF_H
 #define _PERF_PERF_H
 
-struct winsize;
-
-void get_term_dimensions(struct winsize *ws);
-
 #include <asm/unistd.h>
 
 #if defined(__i386__)
diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c
index 252b889..805d1f5 100644
--- a/tools/perf/util/util.c
+++ b/tools/perf/util/util.c
@@ -220,3 +220,25 @@ void dump_stack(void)
 #else
 void dump_stack(void) {}
 #endif
+
+void get_term_dimensions(struct winsize *ws)
+{
+	char *s = getenv("LINES");
+
+	if (s != NULL) {
+		ws->ws_row = atoi(s);
+		s = getenv("COLUMNS");
+		if (s != NULL) {
+			ws->ws_col = atoi(s);
+			if (ws->ws_row && ws->ws_col)
+				return;
+		}
+	}
+#ifdef TIOCGWINSZ
+	if (ioctl(1, TIOCGWINSZ, ws) == 0 &&
+	    ws->ws_row && ws->ws_col)
+		return;
+#endif
+	ws->ws_row = 25;
+	ws->ws_col = 80;
+}
diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h
index c233091..ec5de5e 100644
--- a/tools/perf/util/util.h
+++ b/tools/perf/util/util.h
@@ -271,4 +271,7 @@ void dump_stack(void);
 
 extern unsigned int page_size;
 
+struct winsize;
+void get_term_dimensions(struct winsize *ws);
+
 #endif

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH] perf: move get_term_dimensions from top to util.c
@ 2013-01-14 17:02 David Ahern
  0 siblings, 0 replies; 3+ messages in thread
From: David Ahern @ 2013-01-14 17:02 UTC (permalink / raw)
  To: acme, linux-kernel; +Cc: David Ahern

It is used by util/help.c so it should be a lib function and included
in libperf.a. Code move only.
---
 tools/perf/builtin-top.c |   22 ----------------------
 tools/perf/perf.h        |    4 ----
 tools/perf/util/util.c   |   22 ++++++++++++++++++++++
 tools/perf/util/util.h   |    3 +++
 4 files changed, 25 insertions(+), 26 deletions(-)

diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index c9ff395..471efaa 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -68,28 +68,6 @@
 #include <linux/unistd.h>
 #include <linux/types.h>
 
-void get_term_dimensions(struct winsize *ws)
-{
-	char *s = getenv("LINES");
-
-	if (s != NULL) {
-		ws->ws_row = atoi(s);
-		s = getenv("COLUMNS");
-		if (s != NULL) {
-			ws->ws_col = atoi(s);
-			if (ws->ws_row && ws->ws_col)
-				return;
-		}
-	}
-#ifdef TIOCGWINSZ
-	if (ioctl(1, TIOCGWINSZ, ws) == 0 &&
-	    ws->ws_row && ws->ws_col)
-		return;
-#endif
-	ws->ws_row = 25;
-	ws->ws_col = 80;
-}
-
 static void perf_top__update_print_entries(struct perf_top *top)
 {
 	if (top->print_entries > 9)
diff --git a/tools/perf/perf.h b/tools/perf/perf.h
index 2c340e7..ec1eace 100644
--- a/tools/perf/perf.h
+++ b/tools/perf/perf.h
@@ -1,10 +1,6 @@
 #ifndef _PERF_PERF_H
 #define _PERF_PERF_H
 
-struct winsize;
-
-void get_term_dimensions(struct winsize *ws);
-
 #include <asm/unistd.h>
 
 #if defined(__i386__)
diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c
index 5906e84..1e32d8b 100644
--- a/tools/perf/util/util.c
+++ b/tools/perf/util/util.c
@@ -218,3 +218,25 @@ void dump_stack(void)
 #else
 void dump_stack(void) {}
 #endif
+
+void get_term_dimensions(struct winsize *ws)
+{
+	char *s = getenv("LINES");
+
+	if (s != NULL) {
+		ws->ws_row = atoi(s);
+		s = getenv("COLUMNS");
+		if (s != NULL) {
+			ws->ws_col = atoi(s);
+			if (ws->ws_row && ws->ws_col)
+				return;
+		}
+	}
+#ifdef TIOCGWINSZ
+	if (ioctl(1, TIOCGWINSZ, ws) == 0 &&
+	    ws->ws_row && ws->ws_col)
+		return;
+#endif
+	ws->ws_row = 25;
+	ws->ws_col = 80;
+}
diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h
index c233091..ec5de5e 100644
--- a/tools/perf/util/util.h
+++ b/tools/perf/util/util.h
@@ -271,4 +271,7 @@ void dump_stack(void);
 
 extern unsigned int page_size;
 
+struct winsize;
+void get_term_dimensions(struct winsize *ws);
+
 #endif
-- 
1.7.10.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-01-25 11:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-14 17:48 [PATCH] perf: move get_term_dimensions from top to util.c David Ahern
2013-01-25 11:49 ` [tip:perf/core] perf tools: Move " tip-bot for David Ahern
  -- strict thread matches above, loose matches on Subject: below --
2013-01-14 17:02 [PATCH] perf: move " David Ahern

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.