perf_counter tools: Share list.h with the kernel
PATCH 1/1 perf_counter tools: Share list.h with the kernel
The copy we were using came from another copy I did for the dwarves (pahole) package, that came from the kernel years ago.
The only function that is used by the perf tools and that isn't in the kernel is list_del_range, that I'm leaving in the perf tools only for now.
--- tools/perf/Makefile | 3 +- tools/perf/builtin-annotate.c | 2 +- tools/perf/builtin-report.c | 2 +- tools/perf/util/callchain.h | 2 +- tools/perf/util/include/asm/system.h | 1 + tools/perf/util/include/linux/list.h | 18 + tools/perf/util/include/linux/poison.h | 1 + tools/perf/util/include/linux/prefetch.h | 6 + tools/perf/util/list.h | 603 ------------------------------ tools/perf/util/symbol.h | 2 +- 10 files changed, 32 insertions(+), 608 deletions(-) create mode 100644 tools/perf/util/include/asm/system.h create mode 100644 tools/perf/util/include/linux/list.h create mode 100644 tools/perf/util/include/linux/poison.h create mode 100644 tools/perf/util/include/linux/prefetch.h delete mode 100644 tools/perf/util/list.h
tools/perf/Makefile +2 -1
@@ -290,9 +290,10 @@ LIB_FILE=libperf.a LIB_H += ../../include/linux/perf_counter.h LIB_H += ../../include/linux/rbtree.h +LIB_H += ../../include/linux/list.h +LIB_H += util/include/linux/list.h LIB_H += perf.h LIB_H += util/types.h -LIB_H += util/list.h LIB_H += util/levenshtein.h LIB_H += util/parse-options.h LIB_H += util/parse-events.h
tools/perf/builtin-annotate.c +1 -1
@@ -10,7 +10,7 @@#include "util/util.h" #include "util/color.h" -#include "util/list.h" +#include <linux/list.h> #include "util/cache.h" #include <linux/rbtree.h> #include "util/symbol.h"
tools/perf/builtin-report.c +1 -1
@@ -10,7 +10,7 @@#include "util/util.h" #include "util/color.h" -#include "util/list.h" +#include <linux/list.h> #include "util/cache.h" #include <linux/rbtree.h> #include "util/symbol.h"
tools/perf/util/callchain.h +1 -1
@@ -2,7 +2,7 @@#define __PERF_CALLCHAIN_H#include "../perf.h" -#include "list.h" +#include <linux/list.h> #include <linux/rbtree.h> #include "symbol.h"
tools/perf/util/include/asm/system.h new file +1 -0
@@ -0,0 +1 @@ +/* Empty */
tools/perf/util/include/linux/list.h new file +18 -0
@@ -0,0 +1,18 @@ +#include "../../../../include/linux/list.h" + +#ifndef PERF_LIST_H +#define PERF_LIST_H +/** +* list_del_range - deletes range of entries from list. +* @begin: first element in the range to delete from the list. +* @end: last element in the range to delete from the list. +* Note: list_empty on the range of entries does not return true after this, +* the entries is in an undefined state. +*/ +static inline void list_del_range (struct list_head *begin, +struct list_head *end) +{ + begin->prev->next = end->next; + end->next->prev = begin->prev; +} +#endif
tools/perf/util/include/linux/poison.h new file +1 -0
@@ -0,0 +1 @@ +#include "../../../../include/linux/poison.h"
tools/perf/util/include/linux/prefetch.h new file +6 -0
@@ -0,0 +1,6 @@ +#ifndef PERF_LINUX_PREFETCH_H +#define PERF_LINUX_PREFETCH_H + +static inline void prefetch (void *a __attribute__((unused))) { } + +#endif
tools/perf/util/list.h deleted +0 -603
603 lines not on this page · raw message
tools/perf/util/symbol.h +1 -1
@@ -3,7 +3,7 @@#include <linux/types.h> #include "types.h" -#include "list.h" +#include <linux/list.h> #include <linux/rbtree.h> struct symbol {
Signature · 1 line
1.6.2.5
Commit-ID: 5da50258584469ddfee6545feb4eb2252a8d7e7b Gitweb: http://git.kernel.org/tip/5da50258584469ddfee6545feb4eb2252a8d7e7b Author: Arnaldo Carvalho de Melo <[email protected]> AuthorDate: Wed, 1 Jul 2009 14:46:08 -0300 Committer: Ingo Molnar <[email protected]> CommitDate: Wed, 1 Jul 2009 22:37:23 +0200
perf_counter tools: Share list.h with the kernel
The copy we were using came from another copy I did for the dwarves (pahole) package, that came from the kernel years ago.
The only function that is used by the perf tools and that isn't in the kernel is list_del_range, that I'm leaving in the perf tools only for now.
LKML-Reference: <[email protected]>
--- tools/perf/Makefile | 3 +- tools/perf/builtin-annotate.c | 2 +- tools/perf/builtin-report.c | 2 +- tools/perf/util/callchain.h | 2 +- tools/perf/util/include/asm/system.h | 1 + tools/perf/util/include/linux/list.h | 18 + tools/perf/util/include/linux/poison.h | 1 + tools/perf/util/include/linux/prefetch.h | 6 + tools/perf/util/list.h | 603 ------------------------------ tools/perf/util/symbol.h | 2 +- 10 files changed, 32 insertions(+), 608 deletions(-)
tools/perf/Makefile +2 -1
@@ -290,9 +290,10 @@ LIB_FILE=libperf.a LIB_H += ../../include/linux/perf_counter.h LIB_H += ../../include/linux/rbtree.h +LIB_H += ../../include/linux/list.h +LIB_H += util/include/linux/list.h LIB_H += perf.h LIB_H += util/types.h -LIB_H += util/list.h LIB_H += util/levenshtein.h LIB_H += util/parse-options.h LIB_H += util/parse-events.h
tools/perf/builtin-annotate.c +1 -1
@@ -10,7 +10,7 @@#include "util/util.h" #include "util/color.h" -#include "util/list.h" +#include <linux/list.h> #include "util/cache.h" #include <linux/rbtree.h> #include "util/symbol.h"
tools/perf/builtin-report.c +1 -1
@@ -10,7 +10,7 @@#include "util/util.h" #include "util/color.h" -#include "util/list.h" +#include <linux/list.h> #include "util/cache.h" #include <linux/rbtree.h> #include "util/symbol.h"
tools/perf/util/callchain.h +1 -1
@@ -2,7 +2,7 @@#define __PERF_CALLCHAIN_H#include "../perf.h" -#include "list.h" +#include <linux/list.h> #include <linux/rbtree.h> #include "symbol.h"
tools/perf/util/include/asm/system.h new file +1 -0
@@ -0,0 +1 @@ +/* Empty */
tools/perf/util/include/linux/list.h new file +18 -0
@@ -0,0 +1,18 @@ +#include "../../../../include/linux/list.h" + +#ifndef PERF_LIST_H +#define PERF_LIST_H +/** +* list_del_range - deletes range of entries from list. +* @begin: first element in the range to delete from the list. +* @end: last element in the range to delete from the list. +* Note: list_empty on the range of entries does not return true after this, +* the entries is in an undefined state. +*/ +static inline void list_del_range (struct list_head *begin, +struct list_head *end) +{ + begin->prev->next = end->next; + end->next->prev = begin->prev; +} +#endif
tools/perf/util/include/linux/poison.h new file +1 -0
@@ -0,0 +1 @@ +#include "../../../../include/linux/poison.h"
tools/perf/util/include/linux/prefetch.h new file +6 -0
@@ -0,0 +1,6 @@ +#ifndef PERF_LINUX_PREFETCH_H +#define PERF_LINUX_PREFETCH_H + +static inline void prefetch (void *a __attribute__((unused))) { } + +#endif
tools/perf/util/list.h deleted +0 -603
603 lines not on this page · raw message
tools/perf/util/symbol.h +1 -1
@@ -3,7 +3,7 @@#include <linux/types.h> #include "types.h" -#include "list.h" +#include <linux/list.h> #include <linux/rbtree.h> struct symbol {