Skip to content

Commit

Permalink
perf_counter tools: Share list.h with the kernel
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Arnaldo Carvalho de Melo authored and Ingo Molnar committed Jul 1, 2009
1 parent 43cbcd8 commit 5da5025
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 608 deletions.
3 changes: 2 additions & 1 deletion tools/perf/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tools/perf/builtin-annotate.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion tools/perf/builtin-report.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion tools/perf/util/callchain.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
1 change: 1 addition & 0 deletions tools/perf/util/include/asm/system.h
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* Empty */
18 changes: 18 additions & 0 deletions tools/perf/util/include/linux/list.h
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions tools/perf/util/include/linux/poison.h
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "../../../../include/linux/poison.h"
6 changes: 6 additions & 0 deletions tools/perf/util/include/linux/prefetch.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#ifndef PERF_LINUX_PREFETCH_H
#define PERF_LINUX_PREFETCH_H

static inline void prefetch(void *a __attribute__((unused))) { }

#endif
Loading

0 comments on commit 5da5025

Please sign in to comment.