aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-04-27 08:02:14 +0200
committerIngo Molnar <mingo@elte.hu>2009-04-27 09:05:08 +0200
commit148be2c15d4a866fbc7a8f55342e4fd4de73be61 (patch)
treea99f8c85552166f187a233ce29eb442f27fe620d
parentf1f9b3b1795da8625e0e6096813c9d18d4a344ce (diff)
perf_counter tools: move helper library to util/*
Clean up the top level directory a bit by moving all the helper libraries to util/*.[ch]. Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r--Documentation/perf_counter/Makefile60
-rw-r--r--Documentation/perf_counter/builtin-help.c10
-rw-r--r--Documentation/perf_counter/builtin-stat.c2
-rw-r--r--Documentation/perf_counter/builtin-top.c2
-rw-r--r--Documentation/perf_counter/builtin.h4
-rw-r--r--Documentation/perf_counter/perf.c8
-rwxr-xr-xDocumentation/perf_counter/util/PERF-VERSION-GEN (renamed from Documentation/perf_counter/PERF-VERSION-GEN)0
-rw-r--r--Documentation/perf_counter/util/abspath.c (renamed from Documentation/perf_counter/abspath.c)0
-rw-r--r--Documentation/perf_counter/util/alias.c (renamed from Documentation/perf_counter/alias.c)0
-rw-r--r--Documentation/perf_counter/util/cache.h (renamed from Documentation/perf_counter/cache.h)0
-rw-r--r--Documentation/perf_counter/util/config.c (renamed from Documentation/perf_counter/config.c)0
-rw-r--r--Documentation/perf_counter/util/ctype.c (renamed from Documentation/perf_counter/ctype.c)0
-rw-r--r--Documentation/perf_counter/util/exec_cmd.c (renamed from Documentation/perf_counter/exec_cmd.c)0
-rw-r--r--Documentation/perf_counter/util/exec_cmd.h (renamed from Documentation/perf_counter/exec_cmd.h)0
-rwxr-xr-xDocumentation/perf_counter/util/generate-cmdlist.sh (renamed from Documentation/perf_counter/generate-cmdlist.sh)0
-rw-r--r--Documentation/perf_counter/util/help.c (renamed from Documentation/perf_counter/help.c)2
-rw-r--r--Documentation/perf_counter/util/help.h (renamed from Documentation/perf_counter/help.h)0
-rw-r--r--Documentation/perf_counter/util/levenshtein.c (renamed from Documentation/perf_counter/levenshtein.c)0
-rw-r--r--Documentation/perf_counter/util/levenshtein.h (renamed from Documentation/perf_counter/levenshtein.h)0
-rw-r--r--Documentation/perf_counter/util/parse-options.c (renamed from Documentation/perf_counter/parse-options.c)3
-rw-r--r--Documentation/perf_counter/util/parse-options.h (renamed from Documentation/perf_counter/parse-options.h)0
-rw-r--r--Documentation/perf_counter/util/path.c (renamed from Documentation/perf_counter/path.c)0
-rw-r--r--Documentation/perf_counter/util/quote.c (renamed from Documentation/perf_counter/quote.c)0
-rw-r--r--Documentation/perf_counter/util/quote.h (renamed from Documentation/perf_counter/quote.h)2
-rw-r--r--Documentation/perf_counter/util/run-command.c (renamed from Documentation/perf_counter/run-command.c)0
-rw-r--r--Documentation/perf_counter/util/run-command.h (renamed from Documentation/perf_counter/run-command.h)0
-rw-r--r--Documentation/perf_counter/util/strbuf.c (renamed from Documentation/perf_counter/strbuf.c)0
-rw-r--r--Documentation/perf_counter/util/strbuf.h (renamed from Documentation/perf_counter/strbuf.h)0
-rw-r--r--Documentation/perf_counter/util/usage.c (renamed from Documentation/perf_counter/usage.c)0
-rw-r--r--Documentation/perf_counter/util/util.h (renamed from Documentation/perf_counter/util.h)0
-rw-r--r--Documentation/perf_counter/util/wrapper.c (renamed from Documentation/perf_counter/wrapper.c)0
31 files changed, 46 insertions, 47 deletions
diff --git a/Documentation/perf_counter/Makefile b/Documentation/perf_counter/Makefile
index 690045e4969..543ccf28ac4 100644
--- a/Documentation/perf_counter/Makefile
+++ b/Documentation/perf_counter/Makefile
@@ -147,7 +147,7 @@ all::
# broken, or spawning external process is slower than built-in grep perf has).
PERF-VERSION-FILE: .FORCE-PERF-VERSION-FILE
- @$(SHELL_PATH) ./PERF-VERSION-GEN
+ @$(SHELL_PATH) util/PERF-VERSION-GEN
-include PERF-VERSION-FILE
uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
@@ -287,26 +287,28 @@ export PERL_PATH
LIB_FILE=libperf.a
LIB_H += ../../include/linux/perf_counter.h
-LIB_H += levenshtein.h
-LIB_H += parse-options.h
-LIB_H += quote.h
-LIB_H += strbuf.h
-LIB_H += run-command.h
-
-LIB_OBJS += abspath.o
-LIB_OBJS += alias.o
-LIB_OBJS += config.o
-LIB_OBJS += ctype.o
-LIB_OBJS += exec_cmd.o
-LIB_OBJS += help.o
-LIB_OBJS += levenshtein.o
-LIB_OBJS += parse-options.o
-LIB_OBJS += path.o
-LIB_OBJS += run-command.o
-LIB_OBJS += quote.o
-LIB_OBJS += strbuf.o
-LIB_OBJS += usage.o
-LIB_OBJS += wrapper.o
+LIB_H += util/levenshtein.h
+LIB_H += util/parse-options.h
+LIB_H += util/quote.h
+LIB_H += util/util.h
+LIB_H += util/help.h
+LIB_H += util/strbuf.h
+LIB_H += util/run-command.h
+
+LIB_OBJS += util/abspath.o
+LIB_OBJS += util/alias.o
+LIB_OBJS += util/config.o
+LIB_OBJS += util/ctype.o
+LIB_OBJS += util/exec_cmd.o
+LIB_OBJS += util/help.o
+LIB_OBJS += util/levenshtein.o
+LIB_OBJS += util/parse-options.o
+LIB_OBJS += util/path.o
+LIB_OBJS += util/run-command.o
+LIB_OBJS += util/quote.o
+LIB_OBJS += util/strbuf.o
+LIB_OBJS += util/usage.o
+LIB_OBJS += util/wrapper.o
BUILTIN_OBJS += builtin-help.o
BUILTIN_OBJS += builtin-record.o
@@ -620,10 +622,10 @@ $(BUILT_INS): perf$X
ln -s perf$X $@ 2>/dev/null || \
cp perf$X $@
-common-cmds.h: ./generate-cmdlist.sh command-list.txt
+common-cmds.h: util/generate-cmdlist.sh command-list.txt
common-cmds.h: $(wildcard Documentation/perf-*.txt)
- $(QUIET_GEN)./generate-cmdlist.sh > $@+ && mv $@+ $@
+ $(QUIET_GEN)util/generate-cmdlist.sh > $@+ && mv $@+ $@
$(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh
$(QUIET_GEN)$(RM) $@ $@+ && \
@@ -656,7 +658,7 @@ perf.o perf.spec \
%.o: %.S
$(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) $<
-exec_cmd.o: exec_cmd.c PERF-CFLAGS
+util/exec_cmd.o: util/exec_cmd.c PERF-CFLAGS
$(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) \
'-DPERF_EXEC_PATH="$(perfexecdir_SQ)"' \
'-DBINDIR="$(bindir_relative_SQ)"' \
@@ -666,7 +668,7 @@ exec_cmd.o: exec_cmd.c PERF-CFLAGS
builtin-init-db.o: builtin-init-db.c PERF-CFLAGS
$(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) -DDEFAULT_PERF_TEMPLATE_DIR='"$(template_dir_SQ)"' $<
-config.o: config.c PERF-CFLAGS
+util/config.o: util/config.c PERF-CFLAGS
$(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) -DETC_PERFCONFIG='"$(ETC_PERFCONFIG_SQ)"' $<
perf-%$X: %.o $(PERFLIBS)
@@ -729,7 +731,7 @@ export NO_SVN_TESTS
check: common-cmds.h
if sparse; \
then \
- for i in *.c; \
+ for i in *.c */*.c; \
do \
sparse $(ALL_CFLAGS) $(SPARSE_FLAGS) $$i || exit; \
done; \
@@ -795,7 +797,7 @@ distclean: clean
$(RM) configure
clean:
- $(RM) *.o $(LIB_FILE)
+ $(RM) *.o */*.o $(LIB_FILE)
$(RM) $(ALL_PROGRAMS) $(BUILT_INS) perf$X
$(RM) $(TEST_PROGRAMS)
$(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo common-cmds.h TAGS tags cscope*
@@ -836,7 +838,7 @@ coverage-build: coverage-clean
-j1 test
coverage-report:
- gcov -b *.c
- grep '^function.*called 0 ' *.c.gcov \
+ gcov -b *.c */*.c
+ grep '^function.*called 0 ' *.c.gcov */*.c.gcov \
| sed -e 's/\([^:]*\)\.gcov: *function \([^ ]*\) called.*/\1: \2/' \
| tee coverage-untested-functions
diff --git a/Documentation/perf_counter/builtin-help.c b/Documentation/perf_counter/builtin-help.c
index a136d619db3..6616de0ef05 100644
--- a/Documentation/perf_counter/builtin-help.c
+++ b/Documentation/perf_counter/builtin-help.c
@@ -3,13 +3,13 @@
*
* Builtin help command
*/
-#include "cache.h"
+#include "util/cache.h"
#include "builtin.h"
-#include "exec_cmd.h"
+#include "util/exec_cmd.h"
#include "common-cmds.h"
-#include "parse-options.h"
-#include "run-command.h"
-#include "help.h"
+#include "util/parse-options.h"
+#include "util/run-command.h"
+#include "util/help.h"
static struct man_viewer_list {
struct man_viewer_list *next;
diff --git a/Documentation/perf_counter/builtin-stat.c b/Documentation/perf_counter/builtin-stat.c
index 169a2d1783f..d7ace631fc4 100644
--- a/Documentation/perf_counter/builtin-stat.c
+++ b/Documentation/perf_counter/builtin-stat.c
@@ -61,7 +61,7 @@
* Released under the GPL v2. (and only v2, not any later version)
*/
-#include "util.h"
+#include "util/util.h"
#include <getopt.h>
#include <assert.h>
diff --git a/Documentation/perf_counter/builtin-top.c b/Documentation/perf_counter/builtin-top.c
index 98e8690b6bc..dea016fa41e 100644
--- a/Documentation/perf_counter/builtin-top.c
+++ b/Documentation/perf_counter/builtin-top.c
@@ -42,7 +42,7 @@
* Released under the GPL v2. (and only v2, not any later version)
*/
-#include "util.h"
+#include "util/util.h"
#include <getopt.h>
#include <assert.h>
diff --git a/Documentation/perf_counter/builtin.h b/Documentation/perf_counter/builtin.h
index 800f86c1d44..d32318aed8c 100644
--- a/Documentation/perf_counter/builtin.h
+++ b/Documentation/perf_counter/builtin.h
@@ -1,8 +1,8 @@
#ifndef BUILTIN_H
#define BUILTIN_H
-#include "util.h"
-#include "strbuf.h"
+#include "util/util.h"
+#include "util/strbuf.h"
extern const char perf_version_string[];
extern const char perf_usage_string[];
diff --git a/Documentation/perf_counter/perf.c b/Documentation/perf_counter/perf.c
index 8d6faecdc15..594d270be39 100644
--- a/Documentation/perf_counter/perf.c
+++ b/Documentation/perf_counter/perf.c
@@ -1,8 +1,8 @@
#include "builtin.h"
-#include "exec_cmd.h"
-#include "cache.h"
-#include "quote.h"
-#include "run-command.h"
+#include "util/exec_cmd.h"
+#include "util/cache.h"
+#include "util/quote.h"
+#include "util/run-command.h"
const char perf_usage_string[] =
"perf [--version] [--help] COMMAND [ARGS]";
diff --git a/Documentation/perf_counter/PERF-VERSION-GEN b/Documentation/perf_counter/util/PERF-VERSION-GEN
index c561d1538c0..c561d1538c0 100755
--- a/Documentation/perf_counter/PERF-VERSION-GEN
+++ b/Documentation/perf_counter/util/PERF-VERSION-GEN
diff --git a/Documentation/perf_counter/abspath.c b/Documentation/perf_counter/util/abspath.c
index 649f34f8336..649f34f8336 100644
--- a/Documentation/perf_counter/abspath.c
+++ b/Documentation/perf_counter/util/abspath.c
diff --git a/Documentation/perf_counter/alias.c b/Documentation/perf_counter/util/alias.c
index 9b3dd2b428d..9b3dd2b428d 100644
--- a/Documentation/perf_counter/alias.c
+++ b/Documentation/perf_counter/util/alias.c
diff --git a/Documentation/perf_counter/cache.h b/Documentation/perf_counter/util/cache.h
index 71080512fa8..71080512fa8 100644
--- a/Documentation/perf_counter/cache.h
+++ b/Documentation/perf_counter/util/cache.h
diff --git a/Documentation/perf_counter/config.c b/Documentation/perf_counter/util/config.c
index 3dd13faa6a2..3dd13faa6a2 100644
--- a/Documentation/perf_counter/config.c
+++ b/Documentation/perf_counter/util/config.c
diff --git a/Documentation/perf_counter/ctype.c b/Documentation/perf_counter/util/ctype.c
index b90ec004f29..b90ec004f29 100644
--- a/Documentation/perf_counter/ctype.c
+++ b/Documentation/perf_counter/util/ctype.c
diff --git a/Documentation/perf_counter/exec_cmd.c b/Documentation/perf_counter/util/exec_cmd.c
index d3929226315..d3929226315 100644
--- a/Documentation/perf_counter/exec_cmd.c
+++ b/Documentation/perf_counter/util/exec_cmd.c
diff --git a/Documentation/perf_counter/exec_cmd.h b/Documentation/perf_counter/util/exec_cmd.h
index effe25eb154..effe25eb154 100644
--- a/Documentation/perf_counter/exec_cmd.h
+++ b/Documentation/perf_counter/util/exec_cmd.h
diff --git a/Documentation/perf_counter/generate-cmdlist.sh b/Documentation/perf_counter/util/generate-cmdlist.sh
index f06f6fd148f..f06f6fd148f 100755
--- a/Documentation/perf_counter/generate-cmdlist.sh
+++ b/Documentation/perf_counter/util/generate-cmdlist.sh
diff --git a/Documentation/perf_counter/help.c b/Documentation/perf_counter/util/help.c
index ec011672166..edde541d238 100644
--- a/Documentation/perf_counter/help.c
+++ b/Documentation/perf_counter/util/help.c
@@ -1,5 +1,5 @@
#include "cache.h"
-#include "builtin.h"
+#include "../builtin.h"
#include "exec_cmd.h"
#include "levenshtein.h"
#include "help.h"
diff --git a/Documentation/perf_counter/help.h b/Documentation/perf_counter/util/help.h
index 56bc15406ff..56bc15406ff 100644
--- a/Documentation/perf_counter/help.h
+++ b/Documentation/perf_counter/util/help.h
diff --git a/Documentation/perf_counter/levenshtein.c b/Documentation/perf_counter/util/levenshtein.c
index e521d1516df..e521d1516df 100644
--- a/Documentation/perf_counter/levenshtein.c
+++ b/Documentation/perf_counter/util/levenshtein.c
diff --git a/Documentation/perf_counter/levenshtein.h b/Documentation/perf_counter/util/levenshtein.h
index 0173abeef52..0173abeef52 100644
--- a/Documentation/perf_counter/levenshtein.h
+++ b/Documentation/perf_counter/util/levenshtein.h
diff --git a/Documentation/perf_counter/parse-options.c b/Documentation/perf_counter/util/parse-options.c
index 7464f34e540..28b34c1c29c 100644
--- a/Documentation/perf_counter/parse-options.c
+++ b/Documentation/perf_counter/util/parse-options.c
@@ -469,9 +469,6 @@ int parse_options_usage(const char * const *usagestr,
}
-/*----- some often used options -----*/
-#include "cache.h"
-
int parse_opt_verbosity_cb(const struct option *opt, const char *arg,
int unset)
{
diff --git a/Documentation/perf_counter/parse-options.h b/Documentation/perf_counter/util/parse-options.h
index a81c7faff68..a81c7faff68 100644
--- a/Documentation/perf_counter/parse-options.h
+++ b/Documentation/perf_counter/util/parse-options.h
diff --git a/Documentation/perf_counter/path.c b/Documentation/perf_counter/util/path.c
index a501a40dd2c..a501a40dd2c 100644
--- a/Documentation/perf_counter/path.c
+++ b/Documentation/perf_counter/util/path.c
diff --git a/Documentation/perf_counter/quote.c b/Documentation/perf_counter/util/quote.c
index 7a49fcf6967..7a49fcf6967 100644
--- a/Documentation/perf_counter/quote.c
+++ b/Documentation/perf_counter/util/quote.c
diff --git a/Documentation/perf_counter/quote.h b/Documentation/perf_counter/util/quote.h
index 66730f2bff3..5dfad89816d 100644
--- a/Documentation/perf_counter/quote.h
+++ b/Documentation/perf_counter/util/quote.h
@@ -18,7 +18,7 @@
* run the command on the other side:
*
* sprintf(cmd, "git-diff-tree %s %s", sq_quote(arg0), sq_quote(arg1));
- * sprintf(rcmd, "ssh %s %s", sq_quote(host), sq_quote(cmd));
+ * sprintf(rcmd, "ssh %s %s", sq_util/quote.host), sq_quote(cmd));
*
* Note that the above examples leak memory! Remember to free result from
* sq_quote() in a real application.
diff --git a/Documentation/perf_counter/run-command.c b/Documentation/perf_counter/util/run-command.c
index b2f5e854f40..b2f5e854f40 100644
--- a/Documentation/perf_counter/run-command.c
+++ b/Documentation/perf_counter/util/run-command.c
diff --git a/Documentation/perf_counter/run-command.h b/Documentation/perf_counter/util/run-command.h
index 328289f2366..328289f2366 100644
--- a/Documentation/perf_counter/run-command.h
+++ b/Documentation/perf_counter/util/run-command.h
diff --git a/Documentation/perf_counter/strbuf.c b/Documentation/perf_counter/util/strbuf.c
index eaba0930680..eaba0930680 100644
--- a/Documentation/perf_counter/strbuf.c
+++ b/Documentation/perf_counter/util/strbuf.c
diff --git a/Documentation/perf_counter/strbuf.h b/Documentation/perf_counter/util/strbuf.h
index 9ee908a3ec5..9ee908a3ec5 100644
--- a/Documentation/perf_counter/strbuf.h
+++ b/Documentation/perf_counter/util/strbuf.h
diff --git a/Documentation/perf_counter/usage.c b/Documentation/perf_counter/util/usage.c
index 7a10421fe6b..7a10421fe6b 100644
--- a/Documentation/perf_counter/usage.c
+++ b/Documentation/perf_counter/util/usage.c
diff --git a/Documentation/perf_counter/util.h b/Documentation/perf_counter/util/util.h
index 36e40c38e09..36e40c38e09 100644
--- a/Documentation/perf_counter/util.h
+++ b/Documentation/perf_counter/util/util.h
diff --git a/Documentation/perf_counter/wrapper.c b/Documentation/perf_counter/util/wrapper.c
index 6350d65f6d9..6350d65f6d9 100644
--- a/Documentation/perf_counter/wrapper.c
+++ b/Documentation/perf_counter/util/wrapper.c