mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 07:12:09 +00:00
perf symbols: Simplify symbol machinery setup
And also express its configuration toggles via a struct. Now all one has to do is to call symbol__init(NULL) if the defaults are OK, or pass a struct symbol_conf pointer with the desired configuration. If a tool uses kernel_maps__find_symbol() to look at the kernel and modules mappings for a symbol but didn't call symbol__init() first, that will generate a one time warning too, alerting the subcommand developer that symbol__init() must be called. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Frédéric Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Paul Mackerras <paulus@samba.org> LKML-Reference: <1259071517-3242-2-git-send-email-acme@infradead.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
parent
7cc017edb9
commit
b32d133aec
12 changed files with 85 additions and 60 deletions
22
tools/perf/util/include/asm/bug.h
Normal file
22
tools/perf/util/include/asm/bug.h
Normal file
|
@ -0,0 +1,22 @@
|
|||
#ifndef _PERF_ASM_GENERIC_BUG_H
|
||||
#define _PERF_ASM_GENERIC_BUG_H
|
||||
|
||||
#define __WARN_printf(arg...) do { fprintf(stderr, arg); } while (0)
|
||||
|
||||
#define WARN(condition, format...) ({ \
|
||||
int __ret_warn_on = !!(condition); \
|
||||
if (unlikely(__ret_warn_on)) \
|
||||
__WARN_printf(format); \
|
||||
unlikely(__ret_warn_on); \
|
||||
})
|
||||
|
||||
#define WARN_ONCE(condition, format...) ({ \
|
||||
static int __warned; \
|
||||
int __ret_warn_once = !!(condition); \
|
||||
\
|
||||
if (unlikely(__ret_warn_once)) \
|
||||
if (WARN(!__warned, format)) \
|
||||
__warned = 1; \
|
||||
unlikely(__ret_warn_once); \
|
||||
})
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue