Matthew Wilcox
c68a2aab33
radix tree test suite: Remove duplicate bitops code
...
By adding __set_bit and __clear_bit to the tools include directory, we
can share the bitops code. This reveals an include loop between kernel.h,
log2.h, bitmap.h and bitops.h. Break it the same way as the kernel does;
by moving the kernel.h include from bitops.h to bitmap.h.
Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com >
2017-01-27 21:29:39 -05:00
Jiri Olsa
02bc11de56
tools lib: Add for_each_clear_bit macro
...
Adding for_each_clear_bit macro plus all its the necessary backbone
functions. Taken from related kernel code. It will be used in following
patch.
Signed-off-by: Jiri Olsa <jolsa@kernel.org >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: David Ahern <dsahern@gmail.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Wang Nan <wangnan0@huawei.com >
Link: http://lkml.kernel.org/n/tip-cayv2zbqi0nlmg5sjjxs1775@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2016-10-24 11:07:33 -03:00
Arnaldo Carvalho de Melo
de1e17b1d0
tools: Copy the bitops files accessed from the kernel and check for drift
...
copy some more kernel files accessed from tools/, check for drift.
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: David Ahern <dsahern@gmail.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Wang Nan <wangnan0@huawei.com >
Link: http://lkml.kernel.org/n/tip-omz8xdyvvxgjiuqzwj6ecm6j@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2016-07-18 18:33:41 -03:00
Arnaldo Carvalho de Melo
bb9707077b
tools: Copy the bitsperlong.h files from the kernel
...
We use it in bitops/__ffs.h and bitops/atomic.h, that we also got from
the kernel, but were getting it from either newer systems that carry it
in /usr/include, or from the kernel sources, that we decided not to
touch from tools/ code. Fix it.
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: David Ahern <dsahern@gmail.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Wang Nan <wangnan0@huawei.com >
Link: http://lkml.kernel.org/n/tip-lwqvgbuitjmrdpjmjp6zqnyx@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2016-07-12 15:20:39 -03:00
Josh Poimboeuf
1698872b5c
tools: Copy hashtable.h into tools directory
...
Copy hashtable.h from include/linux/tools.h. It's needed by objtool in
the next patch in the series.
Add some includes that it needs, and remove references to
kernel-specific features like RCU and __read_mostly.
Also change some if its dependency headers' includes to use quotes
instead of brackets so gcc can find them.
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com >
Cc: Andrew Morton <akpm@linux-foundation.org >
Cc: Andy Lutomirski <luto@kernel.org >
Cc: Arnaldo Carvalho de Melo <acme@infradead.org >
Cc: Arnaldo Carvalho de Melo <acme@kernel.org >
Cc: Bernd Petrovitsch <bernd@petrovitsch.priv.at >
Cc: Borislav Petkov <bp@alien8.de >
Cc: Chris J Arges <chris.j.arges@canonical.com >
Cc: Jiri Slaby <jslaby@suse.cz >
Cc: Linus Torvalds <torvalds@linux-foundation.org >
Cc: Michal Marek <mmarek@suse.cz >
Cc: Namhyung Kim <namhyung@gmail.com >
Cc: Pedro Alves <palves@redhat.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: live-patching@vger.kernel.org
Link: http://lkml.kernel.org/r/be3bef72f6540d8a510515408119d968a0e18179.1457502970.git.jpoimboe@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org >
2016-03-09 10:48:09 +01:00
Arnaldo Carvalho de Melo
25cd480e44
tools: Remove bitops/hweight usage of bits in tools/perf
...
We need to use lib/hweight.c for that, just like we do for lib/rbtree.c,
so tools need to link hweight.o. For now do it directly, but we need to
have a tools/lib/lk.a or .so that collects these goodies...
Reported-by: Jan Beulich <JBeulich@suse.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Borislav Petkov <bp@suse.de >
Cc: David Ahern <dsahern@gmail.com >
Cc: Don Zickus <dzickus@redhat.com >
Cc: Frederic Weisbecker <fweisbec@gmail.com >
Cc: Jiri Olsa <jolsa@redhat.com >
Cc: Mike Galbraith <efault@gmx.de >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Paul Mackerras <paulus@samba.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Stephane Eranian <eranian@google.com >
Link: http://lkml.kernel.org/n/tip-a1e91dx3apzqw5kbdt7ut21s@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2015-01-16 17:49:29 -03:00
Arnaldo Carvalho de Melo
afcd4f6235
tools: Adopt fls_long and deps
...
Will be used when adopting rounddown_pow_of_two.
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Borislav Petkov <bp@suse.de >
Cc: David Ahern <dsahern@gmail.com >
Cc: Don Zickus <dzickus@redhat.com >
Cc: Frederic Weisbecker <fweisbec@gmail.com >
Cc: Jiri Olsa <jolsa@redhat.com >
Cc: Mike Galbraith <efault@gmx.de >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Paul Mackerras <paulus@samba.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Stephane Eranian <eranian@google.com >
Link: http://lkml.kernel.org/n/tip-9m0tt5300q1ygv51hejjas82@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2014-12-17 11:58:08 -03:00
Arnaldo Carvalho de Melo
23e1a358e8
tools lib: Move asm-generic/bitops/find.h code to tools/include and tools/lib
...
To match the Linux kernel source code structure from where this code came from.
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Borislav Petkov <bp@suse.de >
Cc: David Ahern <dsahern@gmail.com >
Cc: Don Zickus <dzickus@redhat.com >
Cc: Frederic Weisbecker <fweisbec@gmail.com >
Cc: Jiri Olsa <jolsa@redhat.com >
Cc: Mike Galbraith <efault@gmx.de >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Paul Mackerras <paulus@samba.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Stephane Eranian <eranian@google.com >
Link: http://lkml.kernel.org/n/tip-fkbma1h04ki0zzdmp0dpgfyy@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2014-12-17 11:14:48 -03:00
Arnaldo Carvalho de Melo
cae68d4f6a
tools: Move code originally from asm-generic/atomic.h into tools/include/asm-generic/
...
To match the Linux kernel source code structure from where this code came from.
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Borislav Petkov <bp@suse.de >
Cc: David Ahern <dsahern@gmail.com >
Cc: Don Zickus <dzickus@redhat.com >
Cc: Frederic Weisbecker <fweisbec@gmail.com >
Cc: Jiri Olsa <jolsa@redhat.com >
Cc: Mike Galbraith <efault@gmx.de >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Paul Mackerras <paulus@samba.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Stephane Eranian <eranian@google.com >
Link: http://lkml.kernel.org/n/tip-1ldjhvioch1uczilno5e1epl@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2014-12-17 11:11:52 -03:00
Arnaldo Carvalho de Melo
2dc0b97219
tools: Move __ffs implementation to tools/include/asm-generic/bitops/__ffs.h
...
To match the Linux kernel source code structure from where this code came from.
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Borislav Petkov <bp@suse.de >
Cc: David Ahern <dsahern@gmail.com >
Cc: Don Zickus <dzickus@redhat.com >
Cc: Frederic Weisbecker <fweisbec@gmail.com >
Cc: Jiri Olsa <jolsa@redhat.com >
Cc: Mike Galbraith <efault@gmx.de >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Paul Mackerras <paulus@samba.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Stephane Eranian <eranian@google.com >
Link: http://lkml.kernel.org/n/tip-gubysnp4a8hd98lxoeruak13@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2014-12-17 11:09:34 -03:00