Skip to content

Commit 5da5025

Browse files
acmelIngo Molnar
authored andcommitted
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. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Paul Mackerras <paulus@samba.org> LKML-Reference: <20090701174608.GA5823@ghostprotocols.net> Signed-off-by: Ingo Molnar <mingo@elte.hu>
1 parent 43cbcd8 commit 5da5025

10 files changed

Lines changed: 32 additions & 608 deletions

File tree

‎tools/perf/Makefile‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,9 +290,10 @@ LIB_FILE=libperf.a
290290

291291
LIB_H += ../../include/linux/perf_counter.h
292292
LIB_H += ../../include/linux/rbtree.h
293+
LIB_H += ../../include/linux/list.h
294+
LIB_H += util/include/linux/list.h
293295
LIB_H += perf.h
294296
LIB_H += util/types.h
295-
LIB_H += util/list.h
296297
LIB_H += util/levenshtein.h
297298
LIB_H += util/parse-options.h
298299
LIB_H += util/parse-events.h

‎tools/perf/builtin-annotate.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#include "util/util.h"
1111

1212
#include "util/color.h"
13-
#include "util/list.h"
13+
#include <linux/list.h>
1414
#include "util/cache.h"
1515
#include <linux/rbtree.h>
1616
#include "util/symbol.h"

‎tools/perf/builtin-report.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#include "util/util.h"
1111

1212
#include "util/color.h"
13-
#include "util/list.h"
13+
#include <linux/list.h>
1414
#include "util/cache.h"
1515
#include <linux/rbtree.h>
1616
#include "util/symbol.h"

‎tools/perf/util/callchain.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#define __PERF_CALLCHAIN_H
33

44
#include "../perf.h"
5-
#include "list.h"
5+
#include <linux/list.h>
66
#include <linux/rbtree.h>
77
#include "symbol.h"
88

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/* Empty */
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#include "../../../../include/linux/list.h"
2+
3+
#ifndef PERF_LIST_H
4+
#define PERF_LIST_H
5+
/**
6+
* list_del_range - deletes range of entries from list.
7+
* @begin: first element in the range to delete from the list.
8+
* @end: last element in the range to delete from the list.
9+
* Note: list_empty on the range of entries does not return true after this,
10+
* the entries is in an undefined state.
11+
*/
12+
static inline void list_del_range(struct list_head *begin,
13+
struct list_head *end)
14+
{
15+
begin->prev->next = end->next;
16+
end->next->prev = begin->prev;
17+
}
18+
#endif
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#include "../../../../include/linux/poison.h"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#ifndef PERF_LINUX_PREFETCH_H
2+
#define PERF_LINUX_PREFETCH_H
3+
4+
static inline void prefetch(void *a __attribute__((unused))) { }
5+
6+
#endif

0 commit comments

Comments
 (0)