diff options
author | Borislav Petkov <bp@suse.de> | 2013-12-09 11:14:23 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-12-16 14:03:27 -0500 |
commit | 553873e1df63a20559ac9c336765dc7055cfc3d4 (patch) | |
tree | cdae36b2cbe9818bea7e6987a9e73baf9d79fd53 /tools/lib | |
parent | b283d2f3b74bc98174e8453c0be41dfcda3cae1b (diff) |
tools/: Convert to new topic libraries
Move debugfs.* to api/fs/. We have a common tools/lib/api/ place where
the Makefile lives and then we place the headers in subdirs.
For example, all the fs-related stuff goes to tools/lib/api/fs/ from
which we get libapikfs.a (acme got almost the naming he wanted :-)) and
we link it into the tools which need it - in this case perf and
tools/vm/page-types.
acme:
"Looking at the implementation, I think some tools can even link
directly to the .o files, avoiding the .a file altogether.
But that is just an optimization/finer granularity tools/lib/
cherrypicking that toolers can make use of."
Fixup documentation cleaning target while at it.
Signed-off-by: Borislav Petkov <bp@suse.de>
Acked-by: Ingo Molnar <mingo@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Arjan van de Ven <arjan@linux.intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Robert Richter <rric@kernel.org>
Cc: Stanislav Fomichev <stfomichev@yandex-team.ru>
Cc: Stephane Eranian <eranian@google.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Link: http://lkml.kernel.org/r/1386605664-24041-2-git-send-email-bp@alien8.de
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/lib')
-rw-r--r-- | tools/lib/api/Makefile (renamed from tools/lib/lk/Makefile) | 18 | ||||
-rw-r--r-- | tools/lib/api/fs/debugfs.c (renamed from tools/lib/lk/debugfs.c) | 0 | ||||
-rw-r--r-- | tools/lib/api/fs/debugfs.h (renamed from tools/lib/lk/debugfs.h) | 6 |
3 files changed, 14 insertions, 10 deletions
diff --git a/tools/lib/lk/Makefile b/tools/lib/api/Makefile index 3dba0a4aebbf..ed2f51e11b80 100644 --- a/tools/lib/lk/Makefile +++ b/tools/lib/api/Makefile | |||
@@ -1,4 +1,5 @@ | |||
1 | include ../../scripts/Makefile.include | 1 | include ../../scripts/Makefile.include |
2 | include ../../perf/config/utilities.mak # QUIET_CLEAN | ||
2 | 3 | ||
3 | CC = $(CROSS_COMPILE)gcc | 4 | CC = $(CROSS_COMPILE)gcc |
4 | AR = $(CROSS_COMPILE)ar | 5 | AR = $(CROSS_COMPILE)ar |
@@ -7,11 +8,11 @@ AR = $(CROSS_COMPILE)ar | |||
7 | LIB_H= | 8 | LIB_H= |
8 | LIB_OBJS= | 9 | LIB_OBJS= |
9 | 10 | ||
10 | LIB_H += debugfs.h | 11 | LIB_H += fs/debugfs.h |
11 | 12 | ||
12 | LIB_OBJS += $(OUTPUT)debugfs.o | 13 | LIB_OBJS += $(OUTPUT)fs/debugfs.o |
13 | 14 | ||
14 | LIBFILE = liblk.a | 15 | LIBFILE = libapikfs.a |
15 | 16 | ||
16 | CFLAGS = -ggdb3 -Wall -Wextra -std=gnu99 -Werror -O6 -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS) $(EXTRA_CFLAGS) -fPIC | 17 | CFLAGS = -ggdb3 -Wall -Wextra -std=gnu99 -Werror -O6 -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS) $(EXTRA_CFLAGS) -fPIC |
17 | EXTLIBS = -lelf -lpthread -lrt -lm | 18 | EXTLIBS = -lelf -lpthread -lrt -lm |
@@ -25,14 +26,17 @@ $(LIBFILE): $(LIB_OBJS) | |||
25 | 26 | ||
26 | $(LIB_OBJS): $(LIB_H) | 27 | $(LIB_OBJS): $(LIB_H) |
27 | 28 | ||
28 | $(OUTPUT)%.o: %.c | 29 | libapi_dirs: |
30 | $(QUIET_MKDIR)mkdir -p $(OUTPUT)fs/ | ||
31 | |||
32 | $(OUTPUT)%.o: %.c libapi_dirs | ||
29 | $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $< | 33 | $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $< |
30 | $(OUTPUT)%.s: %.c | 34 | $(OUTPUT)%.s: %.c libapi_dirs |
31 | $(QUIET_CC)$(CC) -S $(ALL_CFLAGS) $< | 35 | $(QUIET_CC)$(CC) -S $(ALL_CFLAGS) $< |
32 | $(OUTPUT)%.o: %.S | 36 | $(OUTPUT)%.o: %.S libapi_dirs |
33 | $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $< | 37 | $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $< |
34 | 38 | ||
35 | clean: | 39 | clean: |
36 | $(RM) $(LIB_OBJS) $(LIBFILE) | 40 | $(call QUIET_CLEAN, libapi) $(RM) $(LIB_OBJS) $(LIBFILE) |
37 | 41 | ||
38 | .PHONY: clean | 42 | .PHONY: clean |
diff --git a/tools/lib/lk/debugfs.c b/tools/lib/api/fs/debugfs.c index 7c4347962353..7c4347962353 100644 --- a/tools/lib/lk/debugfs.c +++ b/tools/lib/api/fs/debugfs.c | |||
diff --git a/tools/lib/lk/debugfs.h b/tools/lib/api/fs/debugfs.h index 935c59bdb442..f19d3df9609d 100644 --- a/tools/lib/lk/debugfs.h +++ b/tools/lib/api/fs/debugfs.h | |||
@@ -1,5 +1,5 @@ | |||
1 | #ifndef __LK_DEBUGFS_H__ | 1 | #ifndef __API_DEBUGFS_H__ |
2 | #define __LK_DEBUGFS_H__ | 2 | #define __API_DEBUGFS_H__ |
3 | 3 | ||
4 | #define _STR(x) #x | 4 | #define _STR(x) #x |
5 | #define STR(x) _STR(x) | 5 | #define STR(x) _STR(x) |
@@ -26,4 +26,4 @@ char *debugfs_mount(const char *mountpoint); | |||
26 | 26 | ||
27 | extern char debugfs_mountpoint[]; | 27 | extern char debugfs_mountpoint[]; |
28 | 28 | ||
29 | #endif /* __LK_DEBUGFS_H__ */ | 29 | #endif /* __API_DEBUGFS_H__ */ |