lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1369527896-3650-16-git-send-email-dsahern@gmail.com>
Date:	Sat, 25 May 2013 18:24:55 -0600
From:	David Ahern <dsahern@...il.com>
To:	linux-kernel@...r.kernel.org
Cc:	acme@...stprotocols.net, mingo@...nel.org, fweisbec@...il.com,
	peterz@...radead.org, jolsa@...hat.com, namhyung@...nel.org,
	xiaoguangrong@...ux.vnet.ibm.com, runzhen@...ux.vnet.ibm.com,
	David Ahern <dsahern@...il.com>
Subject: [PATCH 15/16] perf kvm: move the prompt_integer() to /util/top.c

As David suggested, this patch has no functional changes
just a code move.

move prompt_integer() from tools/perf/builtin-top.c  into
tools/perf/util/top.c

Signed-off-by: Runzhen Wang <runzhen@...ux.vnet.ibm.com>
Signed-off-by: David Ahern <dsahern@...il.com>
Cc: Arnaldo Carvalho de Melo <acme@...stprotocols.net>
Cc: Ingo Molnar <mingo@...nel.org>
Cc: Frederic Weisbecker <fweisbec@...il.com>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Jiri Olsa <jolsa@...hat.com>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Xiao Guangrong <xiaoguangrong@...ux.vnet.ibm.com>
---
 tools/perf/builtin-top.c |   26 --------------------------
 tools/perf/util/top.c    |   26 ++++++++++++++++++++++++++
 tools/perf/util/top.h    |    1 +
 3 files changed, 27 insertions(+), 26 deletions(-)

diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index 495171a..cb7c308 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -298,32 +298,6 @@ static void perf_top__print_sym_table(struct perf_top *top)
 		       top->min_percent, stdout);
 }
 
-static void prompt_integer(int *target, const char *msg)
-{
-	char *buf = malloc(0), *p;
-	size_t dummy = 0;
-	int tmp;
-
-	fprintf(stdout, "\n%s: ", msg);
-	if (getline(&buf, &dummy, stdin) < 0)
-		return;
-
-	p = strchr(buf, '\n');
-	if (p)
-		*p = 0;
-
-	p = buf;
-	while(*p) {
-		if (!isdigit(*p))
-			goto out_free;
-		p++;
-	}
-	tmp = strtoul(buf, NULL, 10);
-	*target = tmp;
-out_free:
-	free(buf);
-}
-
 static void prompt_percent(int *target, const char *msg)
 {
 	int tmp = 0;
diff --git a/tools/perf/util/top.c b/tools/perf/util/top.c
index f857b51..1a2eaec 100644
--- a/tools/perf/util/top.c
+++ b/tools/perf/util/top.c
@@ -115,3 +115,29 @@ void perf_top__reset_sample_counters(struct perf_top *top)
 	top->exact_samples = top->guest_kernel_samples =
 	top->guest_us_samples = 0;
 }
+
+void prompt_integer(int *target, const char *msg)
+{
+	char *buf = malloc(0), *p;
+	size_t dummy = 0;
+	int tmp;
+
+	fprintf(stdout, "\n%s: ", msg);
+	if (getline(&buf, &dummy, stdin) < 0)
+		return;
+
+	p = strchr(buf, '\n');
+	if (p)
+		*p = 0;
+
+	p = buf;
+	while (*p) {
+		if (!isdigit(*p))
+			goto out_free;
+		p++;
+	}
+	tmp = strtoul(buf, NULL, 10);
+	*target = tmp;
+out_free:
+	free(buf);
+}
diff --git a/tools/perf/util/top.h b/tools/perf/util/top.h
index b554ffc..1538dab 100644
--- a/tools/perf/util/top.h
+++ b/tools/perf/util/top.h
@@ -43,4 +43,5 @@ struct perf_top {
 
 size_t perf_top__header_snprintf(struct perf_top *top, char *bf, size_t size);
 void perf_top__reset_sample_counters(struct perf_top *top);
+void prompt_integer(int *target, const char *msg);
 #endif /* __PERF_TOP_H */
-- 
1.7.10.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ