]> git.karo-electronics.de Git - linux-beck.git/commitdiff
perf_counter tools: move helper library to util/*
authorIngo Molnar <mingo@elte.hu>
Mon, 27 Apr 2009 06:02:14 +0000 (08:02 +0200)
committerIngo Molnar <mingo@elte.hu>
Mon, 27 Apr 2009 07:05:08 +0000 (09:05 +0200)
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>
31 files changed:
Documentation/perf_counter/Makefile
Documentation/perf_counter/builtin-help.c
Documentation/perf_counter/builtin-stat.c
Documentation/perf_counter/builtin-top.c
Documentation/perf_counter/builtin.h
Documentation/perf_counter/perf.c
Documentation/perf_counter/util/PERF-VERSION-GEN [moved from Documentation/perf_counter/PERF-VERSION-GEN with 100% similarity]
Documentation/perf_counter/util/abspath.c [moved from Documentation/perf_counter/abspath.c with 100% similarity]
Documentation/perf_counter/util/alias.c [moved from Documentation/perf_counter/alias.c with 100% similarity]
Documentation/perf_counter/util/cache.h [moved from Documentation/perf_counter/cache.h with 100% similarity]
Documentation/perf_counter/util/config.c [moved from Documentation/perf_counter/config.c with 100% similarity]
Documentation/perf_counter/util/ctype.c [moved from Documentation/perf_counter/ctype.c with 100% similarity]
Documentation/perf_counter/util/exec_cmd.c [moved from Documentation/perf_counter/exec_cmd.c with 100% similarity]
Documentation/perf_counter/util/exec_cmd.h [moved from Documentation/perf_counter/exec_cmd.h with 100% similarity]
Documentation/perf_counter/util/generate-cmdlist.sh [moved from Documentation/perf_counter/generate-cmdlist.sh with 100% similarity]
Documentation/perf_counter/util/help.c [moved from Documentation/perf_counter/help.c with 99% similarity]
Documentation/perf_counter/util/help.h [moved from Documentation/perf_counter/help.h with 100% similarity]
Documentation/perf_counter/util/levenshtein.c [moved from Documentation/perf_counter/levenshtein.c with 100% similarity]
Documentation/perf_counter/util/levenshtein.h [moved from Documentation/perf_counter/levenshtein.h with 100% similarity]
Documentation/perf_counter/util/parse-options.c [moved from Documentation/perf_counter/parse-options.c with 99% similarity]
Documentation/perf_counter/util/parse-options.h [moved from Documentation/perf_counter/parse-options.h with 100% similarity]
Documentation/perf_counter/util/path.c [moved from Documentation/perf_counter/path.c with 100% similarity]
Documentation/perf_counter/util/quote.c [moved from Documentation/perf_counter/quote.c with 100% similarity]
Documentation/perf_counter/util/quote.h [moved from Documentation/perf_counter/quote.h with 97% similarity]
Documentation/perf_counter/util/run-command.c [moved from Documentation/perf_counter/run-command.c with 100% similarity]
Documentation/perf_counter/util/run-command.h [moved from Documentation/perf_counter/run-command.h with 100% similarity]
Documentation/perf_counter/util/strbuf.c [moved from Documentation/perf_counter/strbuf.c with 100% similarity]
Documentation/perf_counter/util/strbuf.h [moved from Documentation/perf_counter/strbuf.h with 100% similarity]
Documentation/perf_counter/util/usage.c [moved from Documentation/perf_counter/usage.c with 100% similarity]
Documentation/perf_counter/util/util.h [moved from Documentation/perf_counter/util.h with 100% similarity]
Documentation/perf_counter/util/wrapper.c [moved from Documentation/perf_counter/wrapper.c with 100% similarity]

index 690045e4969247d6d1187fd9565ed89c9441d3aa..543ccf28ac4a63de8b5c43c53ef4362f89ac310b 100644 (file)
@@ -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
index a136d619db371a61e737c0629be232ff9f0348ce..6616de0ef05355698128a746c417e287f00b75c2 100644 (file)
@@ -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;
index 169a2d1783fca22e331092e39b032e0a9cad2bce..d7ace631fc4ff10a9b43152335b9cb958fb6f38d 100644 (file)
@@ -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>
index 98e8690b6bcb02cf303e67f49ceb6a7ec64d7a4f..dea016fa41e87aa1d7e03f65744568b51b62fcdb 100644 (file)
@@ -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>
index 800f86c1d4450bacf1f0f3a56ce4aad481a4a597..d32318aed8cf169dce2f789acb5cff73b743d5dd 100644 (file)
@@ -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[];
index 8d6faecdc15d6b07745ac67b842e09c57bf0fb6d..594d270be390d3ab59a9fd1312c4312145b476a7 100644 (file)
@@ -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]";
similarity index 99%
rename from Documentation/perf_counter/help.c
rename to Documentation/perf_counter/util/help.c
index ec0116721660bfe25e70587a7eebea272d9b1233..edde541d238d750d55d890042f5142b03e4fe1e5 100644 (file)
@@ -1,5 +1,5 @@
 #include "cache.h"
-#include "builtin.h"
+#include "../builtin.h"
 #include "exec_cmd.h"
 #include "levenshtein.h"
 #include "help.h"
similarity index 99%
rename from Documentation/perf_counter/parse-options.c
rename to Documentation/perf_counter/util/parse-options.c
index 7464f34e5407e0aa9a189fb52290b8f2a6c48785..28b34c1c29cf52ce9fd6fd32d7c71546b593238d 100644 (file)
@@ -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)
 {
similarity index 97%
rename from Documentation/perf_counter/quote.h
rename to Documentation/perf_counter/util/quote.h
index 66730f2bff3cee42bc7c670e2a6d7da240db1d08..5dfad89816db124e9b18abc7d2964997a55a329b 100644 (file)
@@ -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.