perf tools: Move pr_* debug macros into debug object
authorJiri Olsa <jolsa@kernel.org>
Mon, 14 Jul 2014 21:46:48 +0000 (23:46 +0200)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 17 Jul 2014 15:58:39 +0000 (12:58 -0300)
Moving pr_* debug macros to have it with in same object as debug
variables, becase we will change them to use verbose variable in next
patch.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1405374411-29012-3-git-send-email-jolsa@kernel.org
[ Add missing debug.h include in python scripting glue and in the libdw unwind lib ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
25 files changed:
tools/perf/arch/x86/tests/dwarf-unwind.c
tools/perf/arch/x86/util/unwind-libunwind.c
tools/perf/builtin-evlist.c
tools/perf/builtin-help.c
tools/perf/builtin-timechart.c
tools/perf/tests/dso-data.c
tools/perf/tests/evsel-roundtrip-name.c
tools/perf/tests/evsel-tp-sched.c
tools/perf/tests/open-syscall-tp-fields.c
tools/perf/tests/parse-events.c
tools/perf/tests/parse-no-sample-id-all.c
tools/perf/tests/sample-parsing.c
tools/perf/tests/thread-mg-share.c
tools/perf/util/data.c
tools/perf/util/debug.h
tools/perf/util/include/linux/kernel.h
tools/perf/util/pstack.c
tools/perf/util/scripting-engines/trace-event-perl.c
tools/perf/util/scripting-engines/trace-event-python.c
tools/perf/util/trace-event-info.c
tools/perf/util/trace-event-read.c
tools/perf/util/unwind-libdw.c
tools/perf/util/unwind-libunwind.c
tools/perf/util/util.c
tools/perf/util/vdso.c

index 9f89f899ccc75ff2091f140009e6a29486ae4d2a..d8bbf7ad1681f6e5afb4a49374a3f0dbd625f3ef 100644 (file)
@@ -3,6 +3,7 @@
 #include "thread.h"
 #include "map.h"
 #include "event.h"
+#include "debug.h"
 #include "tests/tests.h"
 
 #define STACK_SIZE 8192
index 3261f68c6a7c0c8834679bf24a543a5afe15df8b..db25e93d989ced4f74f2f9b61b56a00ea1e429b6 100644 (file)
@@ -3,6 +3,7 @@
 #include <libunwind.h>
 #include "perf_regs.h"
 #include "../../util/unwind.h"
+#include "../../util/debug.h"
 
 #ifdef HAVE_ARCH_X86_64_SUPPORT
 int libunwind__arch_reg_id(int regnum)
index c99e0de7e54a7549b6d19bf4e6025f5d7daf1198..66e12f55c052869e32864ad52e19dda226d918c3 100644 (file)
@@ -15,6 +15,7 @@
 #include "util/parse-options.h"
 #include "util/session.h"
 #include "util/data.h"
+#include "util/debug.h"
 
 static int __cmd_evlist(const char *file_name, struct perf_attr_details *details)
 {
index 178b88ae3d2f174a5a085f233163d54cef152337..0384d930480b47b29adbb86d93ae7c48e15f3741 100644 (file)
@@ -11,6 +11,7 @@
 #include "util/parse-options.h"
 #include "util/run-command.h"
 #include "util/help.h"
+#include "util/debug.h"
 
 static struct man_viewer_list {
        struct man_viewer_list *next;
index 04c9c53becad06d28ae9ab93752e9768ddc43412..2f1a5220c090f4fd8461b743f85b88b0b812214b 100644 (file)
@@ -37,6 +37,7 @@
 #include "util/svghelper.h"
 #include "util/tool.h"
 #include "util/data.h"
+#include "util/debug.h"
 
 #define SUPPORT_OLD_POWER_EVENTS 1
 #define PWR_EVENT_EXIT -1
index 630808cd7cc2fedabc1fb79e3c5c7e0cfb3b9bdb..caaf37f079b1c60fb987ca98445b12159135b3d5 100644 (file)
@@ -10,6 +10,7 @@
 #include "machine.h"
 #include "symbol.h"
 #include "tests.h"
+#include "debug.h"
 
 static char *test_file(int size)
 {
index 465cdbc345cf935d4abc7ea5bb465937659c3929..b8d8341b383e7bc123c29301eff6fbe6e98be332 100644 (file)
@@ -2,6 +2,7 @@
 #include "evsel.h"
 #include "parse-events.h"
 #include "tests.h"
+#include "debug.h"
 
 static int perf_evsel__roundtrip_cache_name_test(void)
 {
index 35d7fdb2328db7a3bcc8d33070c1e68aaa7f858e..52162425c969ef2b29596658931ec0c85e822182 100644 (file)
@@ -1,6 +1,7 @@
 #include <traceevent/event-parse.h>
 #include "evsel.h"
 #include "tests.h"
+#include "debug.h"
 
 static int perf_evsel__test_field(struct perf_evsel *evsel, const char *name,
                                  int size, bool should_be_signed)
index c505ef2af245901639a04e453432b78c5adb5f8b..0785b64ffd6cd8b49009d89bdd935475e957f32a 100644 (file)
@@ -3,6 +3,7 @@
 #include "evsel.h"
 #include "thread_map.h"
 #include "tests.h"
+#include "debug.h"
 
 int test__syscall_open_tp_fields(void)
 {
index deba66955f8c8ecf7eec342abc9696d16b3173f6..5941927a4b7f2b3252b3be787b87839906a3cfe2 100644 (file)
@@ -5,6 +5,7 @@
 #include <api/fs/fs.h>
 #include <api/fs/debugfs.h>
 #include "tests.h"
+#include "debug.h"
 #include <linux/hw_breakpoint.h>
 
 #define PERF_TP_SAMPLE_TYPE (PERF_SAMPLE_RAW | PERF_SAMPLE_TIME | \
index 905019f9b7409ecd962d63c94a701f54aadcf715..2c63ea6585413c691beb0b2a6ebf52de292eca52 100644 (file)
@@ -7,6 +7,7 @@
 #include "evlist.h"
 #include "header.h"
 #include "util.h"
+#include "debug.h"
 
 static int process_event(struct perf_evlist **pevlist, union perf_event *event)
 {
index 7ae8d17db3d9d6b6a1041f1004de4759ea9eeda5..ca292f9a4ae241e07ce53af24514417cb9ffaa41 100644 (file)
@@ -4,6 +4,7 @@
 #include "util.h"
 #include "event.h"
 #include "evsel.h"
+#include "debug.h"
 
 #include "tests.h"
 
index 2b2e0dbe114fa17204d86bf9898b675f45367c8b..b028499dd3cf0f5ee7530a6c869aaa40ef802521 100644 (file)
@@ -2,6 +2,7 @@
 #include "machine.h"
 #include "thread.h"
 #include "map.h"
+#include "debug.h"
 
 int test__thread_mg_share(void)
 {
index ee370a7f244498cd24c852d37f94fec30d22ca06..29d720cf5844763f300611b85e503cc1e6013bf8 100644 (file)
@@ -7,6 +7,7 @@
 
 #include "data.h"
 #include "util.h"
+#include "debug.h"
 
 static bool check_pipe(struct perf_data_file *file)
 {
index 443694c36b03c50e639ac087664764200a71646c..8a8ceb3ccde9924e6882e22466eb60580cac0c52 100644 (file)
 extern int verbose;
 extern bool quiet, dump_trace;
 
+#ifndef pr_fmt
+#define pr_fmt(fmt) fmt
+#endif
+
+#define pr_err(fmt, ...) \
+       eprintf(0, pr_fmt(fmt), ##__VA_ARGS__)
+#define pr_warning(fmt, ...) \
+       eprintf(0, pr_fmt(fmt), ##__VA_ARGS__)
+#define pr_info(fmt, ...) \
+       eprintf(0, pr_fmt(fmt), ##__VA_ARGS__)
+#define pr_debug(fmt, ...) \
+       eprintf(1, pr_fmt(fmt), ##__VA_ARGS__)
+#define pr_debugN(n, fmt, ...) \
+       eprintf(n, pr_fmt(fmt), ##__VA_ARGS__)
+#define pr_debug2(fmt, ...) pr_debugN(2, pr_fmt(fmt), ##__VA_ARGS__)
+#define pr_debug3(fmt, ...) pr_debugN(3, pr_fmt(fmt), ##__VA_ARGS__)
+#define pr_debug4(fmt, ...) pr_debugN(4, pr_fmt(fmt), ##__VA_ARGS__)
+
 int dump_printf(const char *fmt, ...) __attribute__((format(printf, 1, 2)));
 void trace_event(union perf_event *event);
 
@@ -19,4 +37,6 @@ int ui__warning(const char *format, ...) __attribute__((format(printf, 1, 2)));
 
 void pr_stat(const char *fmt, ...);
 
+int eprintf(int level, const char *fmt, ...) __attribute__((format(printf, 2, 3)));
+
 #endif /* __PERF_DEBUG_H */
index 9844c31b7c2bb26c25a71e5a0203800e3a2daa26..09e8e7aea7c68dc25c3ce8f2bd42adf412c54a6f 100644 (file)
@@ -94,27 +94,6 @@ static inline int scnprintf(char * buf, size_t size, const char * fmt, ...)
        return (i >= ssize) ? (ssize - 1) : i;
 }
 
-int eprintf(int level,
-           const char *fmt, ...) __attribute__((format(printf, 2, 3)));
-
-#ifndef pr_fmt
-#define pr_fmt(fmt) fmt
-#endif
-
-#define pr_err(fmt, ...) \
-       eprintf(0, pr_fmt(fmt), ##__VA_ARGS__)
-#define pr_warning(fmt, ...) \
-       eprintf(0, pr_fmt(fmt), ##__VA_ARGS__)
-#define pr_info(fmt, ...) \
-       eprintf(0, pr_fmt(fmt), ##__VA_ARGS__)
-#define pr_debug(fmt, ...) \
-       eprintf(1, pr_fmt(fmt), ##__VA_ARGS__)
-#define pr_debugN(n, fmt, ...) \
-       eprintf(n, pr_fmt(fmt), ##__VA_ARGS__)
-#define pr_debug2(fmt, ...) pr_debugN(2, pr_fmt(fmt), ##__VA_ARGS__)
-#define pr_debug3(fmt, ...) pr_debugN(3, pr_fmt(fmt), ##__VA_ARGS__)
-#define pr_debug4(fmt, ...) pr_debugN(4, pr_fmt(fmt), ##__VA_ARGS__)
-
 /*
  * This looks more complex than it should be. But we need to
  * get the type for the ~ right in round_down (it needs to be
index daa17aeb6c634726381b9617f3b1b003dbc7ef21..a126e6cc6e73ad8554e21a611b373a25599f5a9a 100644 (file)
@@ -6,6 +6,7 @@
 
 #include "util.h"
 #include "pstack.h"
+#include "debug.h"
 #include <linux/kernel.h>
 #include <stdlib.h>
 
index af7da565a75011939d3fbaade1019320250d5328..b2dba9c0a3a1843e91d0095e71845af45db1d5df 100644 (file)
@@ -34,6 +34,7 @@
 #include "../event.h"
 #include "../trace-event.h"
 #include "../evsel.h"
+#include "../debug.h"
 
 void boot_Perf__Trace__Context(pTHX_ CV *cv);
 void boot_DynaLoader(pTHX_ CV *cv);
index b366b48646ca5bce9a192213dc9b313dc2f8baaf..cbce2545da455fba34631818d5c08be7e8d26664 100644 (file)
@@ -27,6 +27,7 @@
 #include <errno.h>
 
 #include "../../perf.h"
+#include "../debug.h"
 #include "../evsel.h"
 #include "../util.h"
 #include "../event.h"
index c3bba883f5c3b347ebba815386e0916cdbda8cc2..eb72716017ac265bf1572c912769bad3bf21c643 100644 (file)
@@ -40,6 +40,7 @@
 #include "trace-event.h"
 #include <api/fs/debugfs.h>
 #include "evsel.h"
+#include "debug.h"
 
 #define VERSION "0.5"
 
index e113e180c48f77398637a3b04771563412e3c0ee..ea3fd7fc6f5c586adc1b7f2a6de93dbbeab838f9 100644 (file)
@@ -36,6 +36,7 @@
 #include "../perf.h"
 #include "util.h"
 #include "trace-event.h"
+#include "debug.h"
 
 static int input_fd;
 
index 5ec80a575b50a111b64cd2a6a7593fd270f60814..7419768c38b1f750fc756d370ab08a5d2b791429 100644 (file)
@@ -3,6 +3,7 @@
 #include <elfutils/libdwfl.h>
 #include <inttypes.h>
 #include <errno.h>
+#include "debug.h"
 #include "unwind.h"
 #include "unwind-libdw.h"
 #include "machine.h"
index 25578b98f5c595d384039da249e140010fe56045..92b56db5247193fb4c74f6d88cd5d49a542087ad 100644 (file)
@@ -30,6 +30,7 @@
 #include "unwind.h"
 #include "symbol.h"
 #include "util.h"
+#include "debug.h"
 
 extern int
 UNW_OBJ(dwarf_search_unwind_table) (unw_addr_space_t as,
index e4132aeeb780f0dd761d1c56a5c9864d9ff79d40..e52e7461911b978838e868b92f024aa642c2bf53 100644 (file)
@@ -1,5 +1,6 @@
 #include "../perf.h"
 #include "util.h"
+#include "debug.h"
 #include <api/fs/fs.h>
 #include <sys/mman.h>
 #ifdef HAVE_BACKTRACE_SUPPORT
index 0ddb3b8a89ecff40fc2626ec5937d2c1bb62a2ca..290582452da36580a5944ffcc278945e11641f46 100644 (file)
@@ -12,6 +12,7 @@
 #include "util.h"
 #include "symbol.h"
 #include "linux/string.h"
+#include "debug.h"
 
 static bool vdso_found;
 static char vdso_file[] = "/tmp/perf-vdso.so-XXXXXX";
This page took 0.034107 seconds and 5 git commands to generate.