From: Borislav Petkov <bp@amd64.org>
To: <acme@infradead.org>, <fweisbec@gmail.com>, <mingo@elte.hu>,
<peterz@infradead.org>, <rostedt@goodmis.org>
Cc: <linux-kernel@vger.kernel.org>,
Borislav Petkov <borislav.petkov@amd.com>
Subject: [PATCH 11/20] perf: Move rbtree to library
Date: Thu, 4 Nov 2010 16:36:47 +0100 [thread overview]
Message-ID: <1288885016-18295-12-git-send-email-bp@amd64.org> (raw)
In-Reply-To: <1288885016-18295-1-git-send-email-bp@amd64.org>
From: Borislav Petkov <borislav.petkov@amd.com>
This is generic code anyway and will be needed by other utils so move it
to a generic library.
Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
---
tools/lib/lk/Makefile | 5 +++++
tools/lib/lk/rbtree.h | 1 +
tools/perf/Makefile | 6 ------
tools/perf/builtin-annotate.c | 2 +-
tools/perf/builtin-kmem.c | 2 +-
tools/perf/builtin-report.c | 2 +-
tools/perf/builtin-timechart.c | 2 +-
tools/perf/builtin-top.c | 2 +-
tools/perf/util/callchain.h | 2 +-
tools/perf/util/include/linux/rbtree.h | 1 -
tools/perf/util/map.h | 2 +-
tools/perf/util/session.h | 2 +-
tools/perf/util/sort.h | 2 +-
tools/perf/util/strlist.h | 2 +-
tools/perf/util/symbol.h | 2 +-
tools/perf/util/thread.h | 2 +-
tools/perf/util/ui/browser.c | 2 +-
tools/perf/util/ui/browsers/hists.c | 2 +-
18 files changed, 20 insertions(+), 21 deletions(-)
create mode 100644 tools/lib/lk/rbtree.h
delete mode 100644 tools/perf/util/include/linux/rbtree.h
diff --git a/tools/lib/lk/Makefile b/tools/lib/lk/Makefile
index 985214a..32cf118 100644
--- a/tools/lib/lk/Makefile
+++ b/tools/lib/lk/Makefile
@@ -8,12 +8,15 @@ LIB_H += debugfs.h
LIB_H += util.h
LIB_H += types.h
LIB_H += cpumap.h
+LIB_H += ../../../include/linux/rbtree.h
+LIB_H += rbtree.h
LIB_OBJS += debugfs.o
LIB_OBJS += usage.o
LIB_OBJS += util.o
LIB_OBJS += cpumap.o
LIB_OBJS += ctype.o
+LIB_OBJS += rbtree.o
LIBFILE = $(LIB_OUTPUT)lklib.a
@@ -29,6 +32,8 @@ $(LIBFILE): $(LIB_OBJS)
$(LIB_OBJS): $(LIB_H)
+rbtree.o: ../../../lib/rbtree.c
+ $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -I../../../include $<
%.o: %.c
$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $<
%.s: %.c
diff --git a/tools/lib/lk/rbtree.h b/tools/lib/lk/rbtree.h
new file mode 100644
index 0000000..965901d
--- /dev/null
+++ b/tools/lib/lk/rbtree.h
@@ -0,0 +1 @@
+#include "../../../include/linux/rbtree.h"
diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 6d06417..2c82537 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -331,7 +331,6 @@ LIB_FILE=$(OUTPUT)libperf.a
EXTRA_LIB_FILES=$(LIB_OUTPUT)libparsevent.a $(LIB_OUTPUT)lklib.a $(LIB_OUTPUT)lkperflib.a
LIB_H += ../../include/linux/perf_event.h
-LIB_H += ../../include/linux/rbtree.h
LIB_H += ../../include/linux/list.h
LIB_H += ../../include/linux/hash.h
LIB_H += ../../include/linux/stringify.h
@@ -344,7 +343,6 @@ LIB_H += util/include/linux/list.h
LIB_H += util/include/linux/module.h
LIB_H += util/include/linux/poison.h
LIB_H += util/include/linux/prefetch.h
-LIB_H += util/include/linux/rbtree.h
LIB_H += util/include/linux/string.h
LIB_H += util/include/linux/types.h
LIB_H += util/include/asm/asm-offsets.h
@@ -398,7 +396,6 @@ LIB_OBJS += $(OUTPUT)util/levenshtein.o
LIB_OBJS += $(OUTPUT)util/parse-options.o
LIB_OBJS += $(OUTPUT)util/parse-events.o
LIB_OBJS += $(OUTPUT)util/path.o
-LIB_OBJS += $(OUTPUT)util/rbtree.o
LIB_OBJS += $(OUTPUT)util/bitmap.o
LIB_OBJS += $(OUTPUT)util/hweight.o
LIB_OBJS += $(OUTPUT)util/run-command.o
@@ -958,9 +955,6 @@ $(OUTPUT)util/ui/browsers/hists.o: util/ui/browsers/hists.c $(OUTPUT)PERF-CFLAGS
$(OUTPUT)util/ui/browsers/map.o: util/ui/browsers/map.c $(OUTPUT)PERF-CFLAGS
$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -DENABLE_SLFUTURE_CONST $<
-$(OUTPUT)util/rbtree.o: ../../lib/rbtree.c $(OUTPUT)PERF-CFLAGS
- $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -DETC_PERFCONFIG='"$(ETC_PERFCONFIG_SQ)"' $<
-
$(OUTPUT)util/scripting-engines/trace-event-perl.o: util/scripting-engines/trace-event-perl.c $(OUTPUT)PERF-CFLAGS
$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-shadow $<
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index 19f2751..7f9983b 100644
--- a/tools/perf/builtin-annotate.c
+++ b/tools/perf/builtin-annotate.c
@@ -12,7 +12,7 @@
#include "util/color.h"
#include <linux/list.h>
#include "util/cache.h"
-#include <linux/rbtree.h>
+#include <lk/rbtree.h>
#include "util/symbol.h"
#include "perf.h"
diff --git a/tools/perf/builtin-kmem.c b/tools/perf/builtin-kmem.c
index 95901eb..f157a9c 100644
--- a/tools/perf/builtin-kmem.c
+++ b/tools/perf/builtin-kmem.c
@@ -13,7 +13,7 @@
#include "util/debug.h"
-#include <linux/rbtree.h>
+#include <lk/rbtree.h>
struct alloc_stat;
typedef int (*sort_fn_t)(struct alloc_stat *, struct alloc_stat *);
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index f8564f9..76e6967 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -12,7 +12,7 @@
#include "util/color.h"
#include <linux/list.h>
#include "util/cache.h"
-#include <linux/rbtree.h>
+#include <lk/rbtree.h>
#include "util/symbol.h"
#include "util/callchain.h"
#include "util/strlist.h"
diff --git a/tools/perf/builtin-timechart.c b/tools/perf/builtin-timechart.c
index fe79fc6..aa9e4fc 100644
--- a/tools/perf/builtin-timechart.c
+++ b/tools/perf/builtin-timechart.c
@@ -19,7 +19,7 @@
#include "util/color.h"
#include <linux/list.h>
#include "util/cache.h"
-#include <linux/rbtree.h>
+#include <lk/rbtree.h>
#include "util/symbol.h"
#include "util/callchain.h"
#include "util/strlist.h"
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index 773676f..3727a5c 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -53,7 +53,7 @@
#include <lk/cpumap.h>
#include <perf/mmap.h>
-#include <linux/rbtree.h>
+#include <lk/rbtree.h>
#include <linux/unistd.h>
#include <linux/types.h>
diff --git a/tools/perf/util/callchain.h b/tools/perf/util/callchain.h
index 6de4313..e0d0dfb 100644
--- a/tools/perf/util/callchain.h
+++ b/tools/perf/util/callchain.h
@@ -3,7 +3,7 @@
#include "../perf.h"
#include <linux/list.h>
-#include <linux/rbtree.h>
+#include <lk/rbtree.h>
#include "event.h"
#include "symbol.h"
diff --git a/tools/perf/util/include/linux/rbtree.h b/tools/perf/util/include/linux/rbtree.h
deleted file mode 100644
index 7a243a1..0000000
--- a/tools/perf/util/include/linux/rbtree.h
+++ /dev/null
@@ -1 +0,0 @@
-#include "../../../../include/linux/rbtree.h"
diff --git a/tools/perf/util/map.h b/tools/perf/util/map.h
index 729469e..4219466 100644
--- a/tools/perf/util/map.h
+++ b/tools/perf/util/map.h
@@ -3,7 +3,7 @@
#include <linux/compiler.h>
#include <linux/list.h>
-#include <linux/rbtree.h>
+#include <lk/rbtree.h>
#include <stdio.h>
#include <stdbool.h>
#include <lk/types.h>
diff --git a/tools/perf/util/session.h b/tools/perf/util/session.h
index 9fa0fc2..6f2af58 100644
--- a/tools/perf/util/session.h
+++ b/tools/perf/util/session.h
@@ -6,7 +6,7 @@
#include "header.h"
#include "symbol.h"
#include "thread.h"
-#include <linux/rbtree.h>
+#include <lk/rbtree.h>
#include "../../../include/linux/perf_event.h"
struct sample_queue;
diff --git a/tools/perf/util/sort.h b/tools/perf/util/sort.h
index 0c68709..4c015e9 100644
--- a/tools/perf/util/sort.h
+++ b/tools/perf/util/sort.h
@@ -7,7 +7,7 @@
#include "color.h"
#include <linux/list.h>
#include "cache.h"
-#include <linux/rbtree.h>
+#include <lk/rbtree.h>
#include "symbol.h"
#include "string.h"
#include "callchain.h"
diff --git a/tools/perf/util/strlist.h b/tools/perf/util/strlist.h
index 3ba8390..649eae3 100644
--- a/tools/perf/util/strlist.h
+++ b/tools/perf/util/strlist.h
@@ -1,7 +1,7 @@
#ifndef __PERF_STRLIST_H
#define __PERF_STRLIST_H
-#include <linux/rbtree.h>
+#include <lk/rbtree.h>
#include <stdbool.h>
struct str_node {
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
index ea95c27..adc7211 100644
--- a/tools/perf/util/symbol.h
+++ b/tools/perf/util/symbol.h
@@ -6,7 +6,7 @@
#include <stdint.h>
#include "map.h"
#include <linux/list.h>
-#include <linux/rbtree.h>
+#include <lk/rbtree.h>
#include <stdio.h>
#ifdef HAVE_CPLUS_DEMANGLE
diff --git a/tools/perf/util/thread.h b/tools/perf/util/thread.h
index 688500f..1a70f60 100644
--- a/tools/perf/util/thread.h
+++ b/tools/perf/util/thread.h
@@ -1,7 +1,7 @@
#ifndef __PERF_THREAD_H
#define __PERF_THREAD_H
-#include <linux/rbtree.h>
+#include <lk/rbtree.h>
#include <unistd.h>
#include "symbol.h"
diff --git a/tools/perf/util/ui/browser.c b/tools/perf/util/ui/browser.c
index 66f2d58..638a545 100644
--- a/tools/perf/util/ui/browser.c
+++ b/tools/perf/util/ui/browser.c
@@ -12,7 +12,7 @@
#endif
#include <slang.h>
#include <linux/list.h>
-#include <linux/rbtree.h>
+#include <lk/rbtree.h>
#include <stdlib.h>
#include <sys/ttydefaults.h>
#include "browser.h"
diff --git a/tools/perf/util/ui/browsers/hists.c b/tools/perf/util/ui/browsers/hists.c
index 6866aa4..1d4ee98 100644
--- a/tools/perf/util/ui/browsers/hists.c
+++ b/tools/perf/util/ui/browsers/hists.c
@@ -5,7 +5,7 @@
#include <stdlib.h>
#include <string.h>
#include <newt.h>
-#include <linux/rbtree.h>
+#include <lk/rbtree.h>
#include "../../hist.h"
#include "../../pstack.h"
--
1.7.3.1
next prev parent reply other threads:[~2010-11-04 15:39 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-04 15:36 [RFC PATCH 00/20] RAS daemon v3 Borislav Petkov
2010-11-04 15:36 ` [PATCH 01/20] perf: Start the massive restructuring Borislav Petkov
2010-11-04 15:36 ` [PATCH 02/20] perf: Add persistent event facilities Borislav Petkov
2010-11-04 15:36 ` [PATCH 03/20] x86, mce: Add persistent MCE event Borislav Petkov
2010-11-10 21:15 ` Ben Gamari
2010-11-10 22:21 ` Ingo Molnar
2010-11-11 6:17 ` Borislav Petkov
2010-11-11 8:58 ` Ingo Molnar
2010-11-11 13:34 ` Borislav Petkov
2010-11-11 15:38 ` Peter Zijlstra
2010-11-11 15:55 ` Borislav Petkov
2010-11-11 17:30 ` Ingo Molnar
2010-11-04 15:36 ` [PATCH 04/20] perf: Move trace-event-parse out of perf/util directory Borislav Petkov
2010-11-04 15:36 ` [PATCH 05/20] perf: Update the lib parse-events to the latest code Borislav Petkov
2010-11-04 15:36 ` [PATCH 06/20] perf: Move trace stuff into tools/lib/trace Borislav Petkov
2010-11-04 15:36 ` [PATCH 07/20] perf: Export debugfs utilities Borislav Petkov
2010-11-04 15:36 ` [PATCH 08/20] perf: Export cpumap Borislav Petkov
2010-11-04 15:36 ` [PATCH 09/20] perf: Carve out mmap helpers for general use Borislav Petkov
2010-11-04 15:36 ` [PATCH 10/20] perf: Export util.ch into library Borislav Petkov
2010-11-04 15:36 ` Borislav Petkov [this message]
2010-11-04 15:36 ` [PATCH 12/20] perf: Export generic kernel utils to library Borislav Petkov
2010-11-04 15:36 ` [PATCH 13/20] perf: Export compiler.h to the generic library Borislav Petkov
2010-11-04 15:36 ` [PATCH 14/20] perf: Export color.ch and config.ch Borislav Petkov
2010-11-04 15:36 ` [PATCH 15/20] perf: Export strlist.ch Borislav Petkov
2010-11-04 15:36 ` [PATCH 16/20] perf: Export map.ch and symbol.ch Borislav Petkov
2010-11-04 15:36 ` [PATCH 17/20] perf: Export trace parsing utils Borislav Petkov
2010-11-04 15:36 ` [PATCH 18/20] Move string.c to the library Borislav Petkov
2010-11-04 15:36 ` [PATCH 19/20] perf, trace: Export event parsing helpers Borislav Petkov
2010-11-04 15:36 ` [PATCH 20/20] ras: Add RAS daemon Borislav Petkov
2010-11-05 12:02 ` [RFC PATCH 00/20] RAS daemon v3 Mauro Carvalho Chehab
2010-11-05 13:46 ` Borislav Petkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1288885016-18295-12-git-send-email-bp@amd64.org \
--to=bp@amd64.org \
--cc=acme@infradead.org \
--cc=borislav.petkov@amd.com \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®