perf tools: Add support for more debug variables
Jiri Olsa
reviewerv2 cover perf tools: Add support for more debug variables
hi,
adding support for more debug variables and --debug option as a way to setup debug variables. Starting with support for verbose, more will come.
It's possible to use it now with report command:
$ perf --debug verbose ... $ perf --debug verbose=2 ...
I need this for ordered events object debug outputs.
v2 changes:
- renaming variable_t to debug_variable (Namhyung)
- separated getopt.h includes removal changes (Namhyung)
- making --debug option global as perf command option (Arnaldo)
thanks,
jirka
---
Jiri Olsa (5):
perf tools: Remove verbose from functions prototypes perf tools: Move pr_* debug macros into debug object perf tools: Factor eprintf to allow different debug variables perf tools: Add --debug optionto set debug variable perf tools: Remove getopt.h includes
tools/perf/Documentation/perf-report.txt | 6 ++++++ tools/perf/Documentation/perf.txt | 10 +++++++++- tools/perf/arch/x86/tests/dwarf-unwind.c | 1 + tools/perf/arch/x86/util/unwind-libunwind.c | 1 + tools/perf/builtin-evlist.c | 1 + tools/perf/builtin-help.c | 1 + tools/perf/builtin-timechart.c | 1 + tools/perf/perf.c | 13 +++++++++++- tools/perf/tests/dso-data.c | 1 + tools/perf/tests/evsel-roundtrip-name.c | 1 + tools/perf/tests/evsel-tp-sched.c | 1 + tools/perf/tests/open-syscall-tp-fields.c | 1 + tools/perf/tests/parse-events.c | 1 + tools/perf/tests/parse-no-sample-id-all.c | 1 + tools/perf/tests/sample-parsing.c | 1 + tools/perf/tests/thread-mg-share.c | 1 + tools/perf/ui/stdio/hist.c | 2 +- tools/perf/util/data.c | 1 + tools/perf/util/debug.c | 56 ++++++++++++++++++++++++++++++++++++++++++++++------ tools/perf/util/debug.h | 22 +++++++++++++++++++++ tools/perf/util/include/linux/kernel.h | 21 -------------------- tools/perf/util/map.c | 24 +++++++++++----------- tools/perf/util/map.h | 9 ++++----- tools/perf/util/probe-finder.c | 1 - tools/perf/util/pstack.c | 1 + tools/perf/util/python.c | 4 ++-- tools/perf/util/scripting-engines/trace-event-perl.c | 1 + tools/perf/util/thread.c | 4 ++-- tools/perf/util/trace-event-info.c | 1 + tools/perf/util/trace-event-read.c | 2 +- tools/perf/util/unwind-libunwind.c | 1 + tools/perf/util/util.c | 1 + tools/perf/util/vdso.c | 1 + 33 files changed, 141 insertions(+), 53 deletions(-)
Jiri Olsa
reviewerPATCH 1/5 perf tools: Remove verbose from functions prototypes
And use verbose as an global object in following fuunctions:
__map_groups__fprintf_maps __map_groups__fprintf_removed_maps map_groups__fprintf_maps
map_groups__fprintf
Also making map_groups__fprintf_maps static.
--- tools/perf/ui/stdio/hist.c | 2 +- tools/perf/util/map.c | 24 ++++++++++++------------ tools/perf/util/map.h | 9 ++++----- tools/perf/util/thread.c | 4 ++-- 4 files changed, 19 insertions(+), 20 deletions(-)
tools/perf/ui/stdio/hist.c +1 -1
@@ -479,7 +479,7 @@ print_entries:if (h->ms.map ==NULL && verbose >1 ) {__map_groups__fprintf_maps (h->thread->mg, -MAP__FUNCTION , verbose, fp); +MAP__FUNCTION , fp);fprintf (fp,"%.10s end\n" , graph_dotted_line); } }
tools/perf/util/map.c +12 -12
@@ -12,6 +12,7 @@#include "vdso.h" #include "build-id.h" #include "util.h" +#include "debug.h" #include <linux/string.h> const char *map_type__name[MAP__NR_TYPES ] = {
@@ -554,8 +555,8 @@ int map_groups__find_ams(struct addr_map_symbol *ams, symbol_filter_t filter)return ams->sym ?0 :-1 ; } -size_t __map_groups__fprintf_maps (struct map_groups *mg, -enum map_type type,int verbose,FILE *fp) +size_t __map_groups__fprintf_maps (struct map_groups *mg,enum map_type type, +FILE *fp) {size_t printed =fprintf (fp,"%s:\n" , map_type__name[type]);struct rb_node *nd;
@@ -573,17 +574,16 @@ size_t __map_groups__fprintf_maps(struct map_groups *mg,return printed; } -size_t map_groups__fprintf_maps (struct map_groups *mg,int verbose,FILE *fp) +static size_t map_groups__fprintf_maps (struct map_groups *mg,FILE *fp) {size_t printed =0 , i;for (i =0 ; i <MAP__NR_TYPES ; ++i) - printed +=__map_groups__fprintf_maps (mg, i, verbose, fp); + printed +=__map_groups__fprintf_maps (mg, i, fp);return printed; }static size_t __map_groups__fprintf_removed_maps (struct map_groups *mg, -enum map_type type, -int verbose,FILE *fp) +enum map_type type,FILE *fp) {struct map *pos;size_t printed =0 ;
@@ -600,23 +600,23 @@ static size_t __map_groups__fprintf_removed_maps(struct map_groups *mg, }static size_t map_groups__fprintf_removed_maps (struct map_groups *mg, -int verbose,FILE *fp) +FILE *fp) {size_t printed =0 , i;for (i =0 ; i <MAP__NR_TYPES ; ++i) - printed +=__map_groups__fprintf_removed_maps (mg, i, verbose, fp); + printed +=__map_groups__fprintf_removed_maps (mg, i, fp);return printed; } -size_t map_groups__fprintf (struct map_groups *mg,int verbose,FILE *fp) +size_t map_groups__fprintf (struct map_groups *mg,FILE *fp) { -size_t printed =map_groups__fprintf_maps (mg, verbose, fp); +size_t printed =map_groups__fprintf_maps (mg, fp); printed +=fprintf (fp,"Removed maps:\n" ); -return printed +map_groups__fprintf_removed_maps (mg, verbose, fp); +return printed +map_groups__fprintf_removed_maps (mg, fp); }int map_groups__fixup_overlappings (struct map_groups *mg,struct map *map, -int verbose,FILE *fp) +FILE *fp) {struct rb_root *root = &mg->maps[map->type];struct rb_node *next =rb_first (root);
tools/perf/util/map.h +4 -5
@@ -141,8 +141,8 @@ void map__fixup_end(struct map *map);void map__reloc_vmlinux (struct map *map); -size_t __map_groups__fprintf_maps (struct map_groups *mg, -enum map_type type,int verbose,FILE *fp); +size_t __map_groups__fprintf_maps (struct map_groups *mg,enum map_type type, +FILE *fp);void maps__insert (struct rb_root *maps,struct map *map);void maps__remove (struct rb_root *maps,struct map *map);struct map *maps__find (struct rb_root *maps,u64 addr);
@@ -152,8 +152,7 @@ void map_groups__init(struct map_groups *mg);void map_groups__exit (struct map_groups *mg);int map_groups__clone (struct map_groups *mg,struct map_groups *parent,enum map_type type); -size_t map_groups__fprintf (struct map_groups *mg,int verbose,FILE *fp); -size_t map_groups__fprintf_maps (struct map_groups *mg,int verbose,FILE *fp); +size_t map_groups__fprintf (struct map_groups *mg,FILE *fp);int maps__set_kallsyms_ref_reloc_sym (struct map **maps,const char *symbol_name,u64 addr);
@@ -210,7 +209,7 @@ struct symbol *map_groups__find_function_by_name(struct map_groups *mg, }int map_groups__fixup_overlappings (struct map_groups *mg,struct map *map, -int verbose,FILE *fp); +FILE *fp);struct map *map_groups__find_by_name (struct map_groups *mg,enum map_type type,const char *name);
tools/perf/util/thread.c +2 -2
@@ -127,12 +127,12 @@ int thread__comm_len(struct thread *thread)size_t thread__fprintf (struct thread *thread,FILE *fp) {return fprintf (fp,"Thread %d %s\n" , thread->tid,thread__comm_str (thread)) + -map_groups__fprintf (thread->mg, verbose, fp); +map_groups__fprintf (thread->mg, fp); }void thread__insert_map (struct thread *thread,struct map *map) { -map_groups__fixup_overlappings (thread->mg, map, verbose, stderr); +map_groups__fixup_overlappings (thread->mg, map, stderr);map_groups__insert (thread->mg, map); }
Signature · 1 line
1.8.3.1
tip-bot for Jiri Olsa
merge bot[tip:perf/core] perf tools: Remove verbose from functions prototypes
perf tools: Remove verbose from functions prototypes
Commit-ID: acebd408bef17169fbf79079b96f0264b535916c Gitweb: http://git.kernel.org/tip/acebd408bef17169fbf79079b96f0264b535916c Author: Jiri Olsa <[email protected]> AuthorDate: Mon, 14 Jul 2014 23:46:47 +0200 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Thu, 17 Jul 2014 11:04:42 -0300
perf tools: Remove verbose from functions prototypes
And use verbose as an global object in following functions:
__map_groups__fprintf_maps
__map_groups__fprintf_removed_maps
map_groups__fprintf_maps
map_groups__fprintf
Also making map_groups__fprintf_maps static.
--- tools/perf/ui/stdio/hist.c | 2 +- tools/perf/util/map.c | 24 ++++++++++++------------ tools/perf/util/map.h | 9 ++++----- tools/perf/util/thread.c | 4 ++-- 4 files changed, 19 insertions(+), 20 deletions(-)
tools/perf/ui/stdio/hist.c +1 -1
@@ -479,7 +479,7 @@ print_entries:if (h->ms.map ==NULL && verbose >1 ) {__map_groups__fprintf_maps (h->thread->mg, -MAP__FUNCTION , verbose, fp); +MAP__FUNCTION , fp);fprintf (fp,"%.10s end\n" , graph_dotted_line); } }
tools/perf/util/map.c +12 -12
@@ -12,6 +12,7 @@#include "vdso.h" #include "build-id.h" #include "util.h" +#include "debug.h" #include <linux/string.h> const char *map_type__name[MAP__NR_TYPES ] = {
@@ -568,8 +569,8 @@ int map_groups__find_ams(struct addr_map_symbol *ams, symbol_filter_t filter)return ams->sym ?0 :-1 ; } -size_t __map_groups__fprintf_maps (struct map_groups *mg, -enum map_type type,int verbose,FILE *fp) +size_t __map_groups__fprintf_maps (struct map_groups *mg,enum map_type type, +FILE *fp) {size_t printed =fprintf (fp,"%s:\n" , map_type__name[type]);struct rb_node *nd;
@@ -587,17 +588,16 @@ size_t __map_groups__fprintf_maps(struct map_groups *mg,return printed; } -size_t map_groups__fprintf_maps (struct map_groups *mg,int verbose,FILE *fp) +static size_t map_groups__fprintf_maps (struct map_groups *mg,FILE *fp) {size_t printed =0 , i;for (i =0 ; i <MAP__NR_TYPES ; ++i) - printed +=__map_groups__fprintf_maps (mg, i, verbose, fp); + printed +=__map_groups__fprintf_maps (mg, i, fp);return printed; }static size_t __map_groups__fprintf_removed_maps (struct map_groups *mg, -enum map_type type, -int verbose,FILE *fp) +enum map_type type,FILE *fp) {struct map *pos;size_t printed =0 ;
@@ -614,23 +614,23 @@ static size_t __map_groups__fprintf_removed_maps(struct map_groups *mg, }static size_t map_groups__fprintf_removed_maps (struct map_groups *mg, -int verbose,FILE *fp) +FILE *fp) {size_t printed =0 , i;for (i =0 ; i <MAP__NR_TYPES ; ++i) - printed +=__map_groups__fprintf_removed_maps (mg, i, verbose, fp); + printed +=__map_groups__fprintf_removed_maps (mg, i, fp);return printed; } -size_t map_groups__fprintf (struct map_groups *mg,int verbose,FILE *fp) +size_t map_groups__fprintf (struct map_groups *mg,FILE *fp) { -size_t printed =map_groups__fprintf_maps (mg, verbose, fp); +size_t printed =map_groups__fprintf_maps (mg, fp); printed +=fprintf (fp,"Removed maps:\n" ); -return printed +map_groups__fprintf_removed_maps (mg, verbose, fp); +return printed +map_groups__fprintf_removed_maps (mg, fp); }int map_groups__fixup_overlappings (struct map_groups *mg,struct map *map, -int verbose,FILE *fp) +FILE *fp) {struct rb_root *root = &mg->maps[map->type];struct rb_node *next =rb_first (root);
tools/perf/util/map.h +4 -5
@@ -142,8 +142,8 @@ void map__fixup_end(struct map *map);void map__reloc_vmlinux (struct map *map); -size_t __map_groups__fprintf_maps (struct map_groups *mg, -enum map_type type,int verbose,FILE *fp); +size_t __map_groups__fprintf_maps (struct map_groups *mg,enum map_type type, +FILE *fp);void maps__insert (struct rb_root *maps,struct map *map);void maps__remove (struct rb_root *maps,struct map *map);struct map *maps__find (struct rb_root *maps,u64 addr);
@@ -153,8 +153,7 @@ void map_groups__init(struct map_groups *mg);void map_groups__exit (struct map_groups *mg);int map_groups__clone (struct map_groups *mg,struct map_groups *parent,enum map_type type); -size_t map_groups__fprintf (struct map_groups *mg,int verbose,FILE *fp); -size_t map_groups__fprintf_maps (struct map_groups *mg,int verbose,FILE *fp); +size_t map_groups__fprintf (struct map_groups *mg,FILE *fp);int maps__set_kallsyms_ref_reloc_sym (struct map **maps,const char *symbol_name,u64 addr);
@@ -211,7 +210,7 @@ struct symbol *map_groups__find_function_by_name(struct map_groups *mg, }int map_groups__fixup_overlappings (struct map_groups *mg,struct map *map, -int verbose,FILE *fp); +FILE *fp);struct map *map_groups__find_by_name (struct map_groups *mg,enum map_type type,const char *name);
tools/perf/util/thread.c +2 -2
@@ -129,12 +129,12 @@ int thread__comm_len(struct thread *thread)size_t thread__fprintf (struct thread *thread,FILE *fp) {return fprintf (fp,"Thread %d %s\n" , thread->tid,thread__comm_str (thread)) + -map_groups__fprintf (thread->mg, verbose, fp); +map_groups__fprintf (thread->mg, fp); }void thread__insert_map (struct thread *thread,struct map *map) { -map_groups__fixup_overlappings (thread->mg, map, verbose, stderr); +map_groups__fixup_overlappings (thread->mg, map, stderr);map_groups__insert (thread->mg, map); }
Jiri Olsa
reviewerPATCH 2/5 perf tools: Move pr_* debug macros into debug object
In reply to Jiri OlsaMoving 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.
--- tools/perf/arch/x86/tests/dwarf-unwind.c | 1 + tools/perf/arch/x86/util/unwind-libunwind.c | 1 + tools/perf/builtin-evlist.c | 1 + tools/perf/builtin-help.c | 1 + tools/perf/builtin-timechart.c | 1 + tools/perf/tests/dso-data.c | 1 + tools/perf/tests/evsel-roundtrip-name.c | 1 + tools/perf/tests/evsel-tp-sched.c | 1 + tools/perf/tests/open-syscall-tp-fields.c | 1 + tools/perf/tests/parse-events.c | 1 + tools/perf/tests/parse-no-sample-id-all.c | 1 + tools/perf/tests/sample-parsing.c | 1 + tools/perf/tests/thread-mg-share.c | 1 + tools/perf/util/data.c | 1 + tools/perf/util/debug.h | 20 ++++++++++++++++++++ tools/perf/util/include/linux/kernel.h | 21 --------------------- tools/perf/util/pstack.c | 1 + .../perf/util/scripting-engines/trace-event-perl.c | 1 + tools/perf/util/trace-event-info.c | 1 + tools/perf/util/trace-event-read.c | 1 + tools/perf/util/unwind-libunwind.c | 1 + tools/perf/util/util.c | 1 + tools/perf/util/vdso.c | 1 + 23 files changed, 41 insertions(+), 21 deletions(-)
tools/perf/arch/x86/tests/dwarf-unwind.c +1 -0
@@ -3,6 +3,7 @@#include "thread.h" #include "map.h" #include "event.h" +#include "debug.h" #include "tests/tests.h" #define STACK_SIZE 8192
tools/perf/arch/x86/util/unwind-libunwind.c +1 -0
@@ -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)
tools/perf/builtin-evlist.c +1 -0
@@ -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) {
tools/perf/builtin-help.c +1 -0
@@ -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;
tools/perf/builtin-timechart.c +1 -0
@@ -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
tools/perf/tests/dso-data.c +1 -0
@@ -10,6 +10,7 @@#include "machine.h" #include "symbol.h" #include "tests.h" +#include "debug.h" static char *test_file (int size) {
tools/perf/tests/evsel-roundtrip-name.c +1 -0
@@ -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 ) {
tools/perf/tests/evsel-tp-sched.c +1 -0
@@ -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)
tools/perf/tests/open-syscall-tp-fields.c +1 -0
@@ -3,6 +3,7 @@#include "evsel.h" #include "thread_map.h" #include "tests.h" +#include "debug.h" int test__syscall_open_tp_fields (void ) {
tools/perf/tests/parse-events.c +1 -0
@@ -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 | \
tools/perf/tests/parse-no-sample-id-all.c +1 -0
@@ -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) {
tools/perf/tests/sample-parsing.c +1 -0
@@ -4,6 +4,7 @@#include "util.h" #include "event.h" #include "evsel.h" +#include "debug.h" #include "tests.h"
tools/perf/tests/thread-mg-share.c +1 -0
@@ -2,6 +2,7 @@#include "machine.h" #include "thread.h" #include "map.h" +#include "debug.h" int test__thread_mg_share (void ) {
tools/perf/util/data.c +1 -0
@@ -7,6 +7,7 @@#include "data.h" #include "util.h" +#include "debug.h" static bool check_pipe (struct perf_data_file *file) {
tools/perf/util/debug.h +20 -0
@@ -11,6 +11,24 @@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 */
tools/perf/util/include/linux/kernel.h +0 -21
@@ -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
tools/perf/util/pstack.c +1 -0
@@ -6,6 +6,7 @@#include "util.h" #include "pstack.h" +#include "debug.h" #include <linux/kernel.h> #include <stdlib.h>
tools/perf/util/scripting-engines/trace-event-perl.c +1 -0
@@ -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);
tools/perf/util/trace-event-info.c +1 -0
@@ -40,6 +40,7 @@#include "trace-event.h" #include <api/fs/debugfs.h> #include "evsel.h" +#include "debug.h" #define VERSION "0.5"
tools/perf/util/trace-event-read.c +1 -0
@@ -36,6 +36,7 @@#include "../perf.h" #include "util.h" #include "trace-event.h" +#include "debug.h" static int input_fd;
tools/perf/util/unwind-libunwind.c +1 -0
@@ -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,
tools/perf/util/util.c +1 -0
@@ -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
tools/perf/util/vdso.c +1 -0
@@ -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" ;
Signature · 1 line
1.8.3.1
Arnaldo Carvalho de Melo
maintainerRe: [PATCH 2/5] perf tools: Move pr_* debug macros into debug object
Em Mon, Jul 14, 2014 at 11:46:48PM +0200, Jiri Olsa escreveu:
Quoted 3 lines
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.
CC /home/acme/git/build/perf/ui/gtk/util.outil/scripting-engines/trace-event-python.c: In function ‘python_process_callchain’:util/scripting-engines/trace-event-python.c:299:3: error: implicit declaration of function ‘pr_err’ [-Werror=implicit-function-declaration] util/scripting-engines/trace-event-python.c:299:3: error: nested extern declaration of ‘pr_err’ [-Werror=nested-externs]
cc1: all warnings being treated as errors
make[1]: *** [/home/acme/git/build/perf/util/scripting-engines/trace-event-python.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [install] Error 2
make: Leaving directory `/home/acme/git/linux/tools/perf'
[acme@ssdandy linux]$
Nevermind, I'll fix it.
Quoted 356 lines
Cc Arnaldo Carvalho de Melo <[email protected]>Cc Corey Ashford <[email protected]>Cc David Ahern <[email protected]>Cc Frederic Weisbecker <[email protected]>Cc Ingo Molnar <[email protected]>Cc Namhyung Kim <[email protected]>Cc Paul Mackerras <[email protected]>Cc Peter Zijlstra <[email protected]>Signed-off-by Jiri Olsa <[email protected]>--- tools/perf/arch/x86/tests/dwarf-unwind.c | 1 + tools/perf/arch/x86/util/unwind-libunwind.c | 1 + tools/perf/builtin-evlist.c | 1 + tools/perf/builtin-help.c | 1 + tools/perf/builtin-timechart.c | 1 + tools/perf/tests/dso-data.c | 1 + tools/perf/tests/evsel-roundtrip-name.c | 1 + tools/perf/tests/evsel-tp-sched.c | 1 + tools/perf/tests/open-syscall-tp-fields.c | 1 + tools/perf/tests/parse-events.c | 1 + tools/perf/tests/parse-no-sample-id-all.c | 1 + tools/perf/tests/sample-parsing.c | 1 + tools/perf/tests/thread-mg-share.c | 1 + tools/perf/util/data.c | 1 + tools/perf/util/debug.h | 20 ++++++++++++++++++++ tools/perf/util/include/linux/kernel.h | 21 --------------------- tools/perf/util/pstack.c | 1 + .../perf/util/scripting-engines/trace-event-perl.c | 1 + tools/perf/util/trace-event-info.c | 1 + tools/perf/util/trace-event-read.c | 1 + tools/perf/util/unwind-libunwind.c | 1 + tools/perf/util/util.c | 1 + tools/perf/util/vdso.c | 1 + 23 files changed, 41 insertions(+), 21 deletions(-)tools/perf/arch/x86/tests/dwarf-unwind.c +1
-0@@ -3,6 +3,7 @@#include "thread.h" #include "map.h" #include "event.h" +#include "debug.h" #include "tests/tests.h" #define STACK_SIZE 8192tools/perf/arch/x86/util/unwind-libunwind.c +1
-0@@ -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)tools/perf/builtin-evlist.c +1
-0@@ -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) {tools/perf/builtin-help.c +1
-0@@ -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;tools/perf/builtin-timechart.c +1
-0@@ -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 -1tools/perf/tests/dso-data.c +1
-0@@ -10,6 +10,7 @@#include "machine.h" #include "symbol.h" #include "tests.h" +#include "debug.h" static char *test_file (int size) {tools/perf/tests/evsel-roundtrip-name.c +1
-0@@ -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 ) {tools/perf/tests/evsel-tp-sched.c +1
-0@@ -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)tools/perf/tests/open-syscall-tp-fields.c +1
-0@@ -3,6 +3,7 @@#include "evsel.h" #include "thread_map.h" #include "tests.h" +#include "debug.h" int test__syscall_open_tp_fields (void ) {tools/perf/tests/parse-events.c +1
-0@@ -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 | \tools/perf/tests/parse-no-sample-id-all.c +1
-0@@ -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) {tools/perf/tests/sample-parsing.c +1
-0@@ -4,6 +4,7 @@#include "util.h" #include "event.h" #include "evsel.h" +#include "debug.h" #include "tests.h" tools/perf/tests/thread-mg-share.c +1
-0@@ -2,6 +2,7 @@#include "machine.h" #include "thread.h" #include "map.h" +#include "debug.h" int test__thread_mg_share (void ) {tools/perf/util/data.c +1
-0@@ -7,6 +7,7 @@#include "data.h" #include "util.h" +#include "debug.h" static bool check_pipe (struct perf_data_file *file) {tools/perf/util/debug.h +20
-0@@ -11,6 +11,24 @@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 */ tools/perf/util/include/linux/kernel.h +0
-21@@ -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 tools/perf/util/pstack.c +1
-0@@ -6,6 +6,7 @@#include "util.h" #include "pstack.h" +#include "debug.h" #include <linux/kernel.h> #include <stdlib.h> tools/perf/util/scripting-engines/trace-event-perl.c +1
-0@@ -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);tools/perf/util/trace-event-info.c +1
-0@@ -40,6 +40,7 @@#include "trace-event.h" #include <api/fs/debugfs.h> #include "evsel.h" +#include "debug.h" #define VERSION "0.5"tools/perf/util/trace-event-read.c +1
-0@@ -36,6 +36,7 @@#include "../perf.h" #include "util.h" #include "trace-event.h" +#include "debug.h" static int input_fd;tools/perf/util/unwind-libunwind.c +1
-0@@ -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,tools/perf/util/util.c +1
-0@@ -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 tools/perf/util/vdso.c +1
-0@@ -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" ;Signature · 1 line
1.8.3.1
tip-bot for Jiri Olsa
merge bot[tip:perf/core] perf tools: Move pr_* debug macros into debug object
In reply to Jiri Olsaperf tools: Move pr_* debug macros into debug object
Commit-ID: 84f5d36f486609277801e827241396334185d11c Gitweb: http://git.kernel.org/tip/84f5d36f486609277801e827241396334185d11c Author: Jiri Olsa <[email protected]> AuthorDate: Mon, 14 Jul 2014 23:46:48 +0200 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Thu, 17 Jul 2014 12:58:39 -0300
perf tools: Move pr_* debug macros into debug object
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.
--- tools/perf/arch/x86/tests/dwarf-unwind.c | 1 + tools/perf/arch/x86/util/unwind-libunwind.c | 1 + tools/perf/builtin-evlist.c | 1 + tools/perf/builtin-help.c | 1 + tools/perf/builtin-timechart.c | 1 + tools/perf/tests/dso-data.c | 1 + tools/perf/tests/evsel-roundtrip-name.c | 1 + tools/perf/tests/evsel-tp-sched.c | 1 + tools/perf/tests/open-syscall-tp-fields.c | 1 + tools/perf/tests/parse-events.c | 1 + tools/perf/tests/parse-no-sample-id-all.c | 1 + tools/perf/tests/sample-parsing.c | 1 + tools/perf/tests/thread-mg-share.c | 1 + tools/perf/util/data.c | 1 + tools/perf/util/debug.h | 20 ++++++++++++++++++++ tools/perf/util/include/linux/kernel.h | 21 --------------------- tools/perf/util/pstack.c | 1 + .../perf/util/scripting-engines/trace-event-perl.c | 1 + .../util/scripting-engines/trace-event-python.c | 1 + tools/perf/util/trace-event-info.c | 1 + tools/perf/util/trace-event-read.c | 1 + tools/perf/util/unwind-libdw.c | 1 + tools/perf/util/unwind-libunwind.c | 1 + tools/perf/util/util.c | 1 + tools/perf/util/vdso.c | 1 + 25 files changed, 43 insertions(+), 21 deletions(-)
tools/perf/arch/x86/tests/dwarf-unwind.c +1 -0
@@ -3,6 +3,7 @@#include "thread.h" #include "map.h" #include "event.h" +#include "debug.h" #include "tests/tests.h" #define STACK_SIZE 8192
tools/perf/arch/x86/util/unwind-libunwind.c +1 -0
@@ -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)
tools/perf/builtin-evlist.c +1 -0
@@ -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) {
tools/perf/builtin-help.c +1 -0
@@ -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;
tools/perf/builtin-timechart.c +1 -0
@@ -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
tools/perf/tests/dso-data.c +1 -0
@@ -10,6 +10,7 @@#include "machine.h" #include "symbol.h" #include "tests.h" +#include "debug.h" static char *test_file (int size) {
tools/perf/tests/evsel-roundtrip-name.c +1 -0
@@ -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 ) {
tools/perf/tests/evsel-tp-sched.c +1 -0
@@ -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)
tools/perf/tests/open-syscall-tp-fields.c +1 -0
@@ -3,6 +3,7 @@#include "evsel.h" #include "thread_map.h" #include "tests.h" +#include "debug.h" int test__syscall_open_tp_fields (void ) {
tools/perf/tests/parse-events.c +1 -0
@@ -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 | \
tools/perf/tests/parse-no-sample-id-all.c +1 -0
@@ -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) {
tools/perf/tests/sample-parsing.c +1 -0
@@ -4,6 +4,7 @@#include "util.h" #include "event.h" #include "evsel.h" +#include "debug.h" #include "tests.h"
tools/perf/tests/thread-mg-share.c +1 -0
@@ -2,6 +2,7 @@#include "machine.h" #include "thread.h" #include "map.h" +#include "debug.h" int test__thread_mg_share (void ) {
tools/perf/util/data.c +1 -0
@@ -7,6 +7,7 @@#include "data.h" #include "util.h" +#include "debug.h" static bool check_pipe (struct perf_data_file *file) {
tools/perf/util/debug.h +20 -0
@@ -11,6 +11,24 @@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 */
tools/perf/util/include/linux/kernel.h +0 -21
@@ -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
tools/perf/util/pstack.c +1 -0
@@ -6,6 +6,7 @@#include "util.h" #include "pstack.h" +#include "debug.h" #include <linux/kernel.h> #include <stdlib.h>
tools/perf/util/scripting-engines/trace-event-perl.c +1 -0
@@ -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);
tools/perf/util/scripting-engines/trace-event-python.c +1 -0
@@ -27,6 +27,7 @@#include <errno.h> #include "../../perf.h" +#include "../debug.h" #include "../evsel.h" #include "../util.h" #include "../event.h"
tools/perf/util/trace-event-info.c +1 -0
@@ -40,6 +40,7 @@#include "trace-event.h" #include <api/fs/debugfs.h> #include "evsel.h" +#include "debug.h" #define VERSION "0.5"
tools/perf/util/trace-event-read.c +1 -0
@@ -36,6 +36,7 @@#include "../perf.h" #include "util.h" #include "trace-event.h" +#include "debug.h" static int input_fd;
tools/perf/util/unwind-libdw.c +1 -0
@@ -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"
tools/perf/util/unwind-libunwind.c +1 -0
@@ -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,
tools/perf/util/util.c +1 -0
@@ -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
tools/perf/util/vdso.c +1 -0
@@ -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" ;
Jiri Olsa
reviewerPATCH 3/5 perf tools: Factor eprintf to allow different debug variables
In reply to Jiri OlsaThis way we can easily reuse current debug functions for another debug variables other than verbose.
--- tools/perf/util/debug.c | 12 ++++++------ tools/perf/util/debug.h | 12 ++++++------ tools/perf/util/python.c | 4 ++-- 3 files changed, 14 insertions(+), 14 deletions(-)
tools/perf/util/debug.c +6 -6
@@ -16,11 +16,11 @@int verbose;bool dump_trace = false, quiet = false; -static int _eprintf (int level,const char *fmt,va_list args) +static int _eprintf (int level,int var,const char *fmt,va_list args) {int ret =0 ; -if (verbose >= level) { +if (var >= level) {if (use_browser >=1 )ui_helpline__vshow (fmt, args);else
@@ -30,13 +30,13 @@ static int _eprintf(int level, const char *fmt, va_list args)return ret; } -int eprintf (int level,const char *fmt, ...) +int eprintf (int level,int var,const char *fmt, ...) {va_list args;int ret;va_start (args, fmt); - ret =_eprintf (level, fmt, args); + ret =_eprintf (level, var, fmt, args);va_end (args);return ret;
@@ -51,9 +51,9 @@ void pr_stat(const char *fmt, ...)va_list args;va_start (args, fmt); -_eprintf (1 , fmt, args); +_eprintf (1 , verbose, fmt, args);va_end (args); -eprintf (1 ,"\n" ); +eprintf (1 , verbose,"\n" ); }int dump_printf (const char *fmt, ...)
tools/perf/util/debug.h +6 -6
@@ -16,15 +16,15 @@ extern bool quiet, dump_trace;#endif #define pr_err (fmt, ...) \ - eprintf(0, pr_fmt(fmt), ##__VA_ARGS__) + eprintf(0, verbose, pr_fmt(fmt), ##__VA_ARGS__)#define pr_warning (fmt, ...) \ - eprintf(0, pr_fmt(fmt), ##__VA_ARGS__) + eprintf(0, verbose, pr_fmt(fmt), ##__VA_ARGS__)#define pr_info (fmt, ...) \ - eprintf(0, pr_fmt(fmt), ##__VA_ARGS__) + eprintf(0, verbose, pr_fmt(fmt), ##__VA_ARGS__)#define pr_debug (fmt, ...) \ - eprintf(1, pr_fmt(fmt), ##__VA_ARGS__) + eprintf(1, verbose, pr_fmt(fmt), ##__VA_ARGS__)#define pr_debugN (n, fmt, ...) \ - eprintf(n, pr_fmt(fmt), ##__VA_ARGS__) + eprintf(n, verbose, 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__)
@@ -37,6 +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 ))); +int eprintf (int level,int var,const char *fmt, ...) __attribute__((format (printf,3 ,4 )));#endif /* __PERF_DEBUG_H */
tools/perf/util/python.c +2 -2
@@ -14,12 +14,12 @@*/ int verbose; -int eprintf (int level,const char *fmt, ...) +int eprintf (int level,int var,const char *fmt, ...) {va_list args;int ret =0 ; -if (verbose >= level) { +if (var >= level) {va_start (args, fmt); ret =vfprintf (stderr, fmt, args);va_end (args);
Signature · 1 line
1.8.3.1
tip-bot for Jiri Olsa
merge bot[tip:perf/core] perf tools: Factor eprintf to allow different debug variables
perf tools: Factor eprintf to allow different debug variables
Commit-ID: c95688aac7723c17b2badc23233706b2f02e58ed Gitweb: http://git.kernel.org/tip/c95688aac7723c17b2badc23233706b2f02e58ed Author: Jiri Olsa <[email protected]> AuthorDate: Mon, 14 Jul 2014 23:46:49 +0200 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Thu, 17 Jul 2014 12:58:59 -0300
perf tools: Factor eprintf to allow different debug variables
This way we can easily reuse current debug functions for another debug variables other than verbose.
--- tools/perf/util/debug.c | 12 ++++++------ tools/perf/util/debug.h | 12 ++++++------ tools/perf/util/python.c | 4 ++-- 3 files changed, 14 insertions(+), 14 deletions(-)
tools/perf/util/debug.c +6 -6
@@ -16,11 +16,11 @@int verbose;bool dump_trace = false, quiet = false; -static int _eprintf (int level,const char *fmt,va_list args) +static int _eprintf (int level,int var,const char *fmt,va_list args) {int ret =0 ; -if (verbose >= level) { +if (var >= level) {if (use_browser >=1 )ui_helpline__vshow (fmt, args);else
@@ -30,13 +30,13 @@ static int _eprintf(int level, const char *fmt, va_list args)return ret; } -int eprintf (int level,const char *fmt, ...) +int eprintf (int level,int var,const char *fmt, ...) {va_list args;int ret;va_start (args, fmt); - ret =_eprintf (level, fmt, args); + ret =_eprintf (level, var, fmt, args);va_end (args);return ret;
@@ -51,9 +51,9 @@ void pr_stat(const char *fmt, ...)va_list args;va_start (args, fmt); -_eprintf (1 , fmt, args); +_eprintf (1 , verbose, fmt, args);va_end (args); -eprintf (1 ,"\n" ); +eprintf (1 , verbose,"\n" ); }int dump_printf (const char *fmt, ...)
tools/perf/util/debug.h +6 -6
@@ -16,15 +16,15 @@ extern bool quiet, dump_trace;#endif #define pr_err (fmt, ...) \ - eprintf(0, pr_fmt(fmt), ##__VA_ARGS__) + eprintf(0, verbose, pr_fmt(fmt), ##__VA_ARGS__)#define pr_warning (fmt, ...) \ - eprintf(0, pr_fmt(fmt), ##__VA_ARGS__) + eprintf(0, verbose, pr_fmt(fmt), ##__VA_ARGS__)#define pr_info (fmt, ...) \ - eprintf(0, pr_fmt(fmt), ##__VA_ARGS__) + eprintf(0, verbose, pr_fmt(fmt), ##__VA_ARGS__)#define pr_debug (fmt, ...) \ - eprintf(1, pr_fmt(fmt), ##__VA_ARGS__) + eprintf(1, verbose, pr_fmt(fmt), ##__VA_ARGS__)#define pr_debugN (n, fmt, ...) \ - eprintf(n, pr_fmt(fmt), ##__VA_ARGS__) + eprintf(n, verbose, 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__)
@@ -37,6 +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 ))); +int eprintf (int level,int var,const char *fmt, ...) __attribute__((format (printf,3 ,4 )));#endif /* __PERF_DEBUG_H */
tools/perf/util/python.c +2 -2
@@ -14,12 +14,12 @@*/ int verbose; -int eprintf (int level,const char *fmt, ...) +int eprintf (int level,int var,const char *fmt, ...) {va_list args;int ret =0 ; -if (verbose >= level) { +if (var >= level) {va_start (args, fmt); ret =vfprintf (stderr, fmt, args);va_end (args);
Jiri Olsa
reviewerPATCH 4/5 perf tools: Add --debug optionto set debug variable
In reply to Jiri OlsaAdding --debug option as a way to setup debug variables. Starting with support for verbose, more will come.
It's possible to use it now with report command:
$ perf --debug verbose ... $ perf --debug verbose=2 ...
I'll need this support to add separated debug variable for ordered events change in order to separate debug output out of standard verbose stream.
--- tools/perf/Documentation/perf-report.txt | 6 +++++ tools/perf/Documentation/perf.txt | 10 +++++++- tools/perf/perf.c | 13 +++++++++- tools/perf/util/debug.c | 44 ++++++++++++++++++++++++++++++++ tools/perf/util/debug.h | 2 ++ 5 files changed, 73 insertions(+), 2 deletions(-)
tools/perf/Documentation/perf-report.txt +6 -0
@@ -25,6 +25,12 @@ OPTIONS --verbose:: Be more verbose. (show symbol address, etc) +--debug:: + Setup debug variable (just verbose for now) in value + range (0, 10). Use like: + --debug verbose # sets verbose = 1 + --debug verbose=2 # sets verbose = 2 + -n:: --show-nr-samples:: Show the number of samples for each symbol
tools/perf/Documentation/perf.txt +9 -1
@@ -8,7 +8,15 @@ perf - Performance analysis tools for Linux SYNOPSIS -------- [verse] -'perf' [--version] [--help] COMMAND [ARGS] +'perf' [--version] [--debug variable[=VALUE]] [--help] COMMAND [ARGS] + +OPTIONS +------- +--debug:: + Setup debug variable (just verbose for now) in value + range (0, 10). Use like: + --debug verbose # sets verbose = 1 + --debug verbose=2 # sets verbose = 2 DESCRIPTION -----------
tools/perf/perf.c +12 -1
@@ -13,11 +13,12 @@#include "util/quote.h" #include "util/run-command.h" #include "util/parse-events.h" +#include "util/debug.h" #include <api/fs/debugfs.h> #include <pthread.h> const char perf_usage_string[] = -"perf [--version] [--help] COMMAND [ARGS]" ; +"perf [--version] [--debug variable[=VALUE]] [--help] COMMAND [ARGS]" ;const char perf_more_info_string[] ="See 'perf help COMMAND' for more information on a specific command." ;
@@ -212,6 +213,16 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)printf ("%s " , p->cmd); }exit (0 ); + }else if (!strcmp (cmd,"--debug" )) { +if (*argc <2 ) { +fprintf (stderr,"No variable specified for --debug.\n" ); +usage (perf_usage_string); + } +if (perf_debug_option ((*argv)[1 ])) +usage (perf_usage_string); + + (*argv)++; + (*argc)--; }else {fprintf (stderr,"Unknown option: %s\n" , cmd);usage (perf_usage_string);
tools/perf/util/debug.c +44 -0
47 lines not on this page · raw message
tools/perf/util/debug.h +2 -0
@@ -39,4 +39,6 @@ void pr_stat(const char *fmt, ...);int eprintf (int level,int var,const char *fmt, ...) __attribute__((format (printf,3 ,4 ))); +int perf_debug_option (const char *str); +#endif /* __PERF_DEBUG_H */
Signature · 1 line
1.8.3.1
Re: [PATCH 4/5] perf tools: Add --debug optionto set debug variable
Hi Jiri,
Quoted 50 lines · Jiri Olsa
Adding --debug option as a way to setup debug variables. Starting with support for verbose, more will come.
It's possible to use it now with report command:
$ perf --debug verbose ... $ perf --debug verbose=2 ...I'll need this support to add separated debug variable for ordered events change in order to separate debug output out of standard verbose stream.
Cc Arnaldo Carvalho de Melo <[email protected]>Cc Corey Ashford <[email protected]>Cc David Ahern <[email protected]>Cc Frederic Weisbecker <[email protected]>Cc Ingo Molnar <[email protected]>Cc Namhyung Kim <[email protected]>Cc Paul Mackerras <[email protected]>Cc Peter Zijlstra <[email protected]>Signed-off-by Jiri Olsa <[email protected]>--- tools/perf/Documentation/perf-report.txt | 6 +++++ tools/perf/Documentation/perf.txt | 10 +++++++- tools/perf/perf.c | 13 +++++++++- tools/perf/util/debug.c | 44 ++++++++++++++++++++++++++++++++ tools/perf/util/debug.h | 2 ++ 5 files changed, 73 insertions(+), 2 deletions(-)tools/perf/Documentation/perf-report.txt +6
-0@@ -25,6 +25,12 @@ OPTIONS --verbose:: Be more verbose. (show symbol address, etc) +--debug:: + Setup debug variable (just verbose for now) in value + range (0, 10). Use like: + --debug verbose # sets verbose = 1 + --debug verbose=2 # sets verbose = 2 + -n:: --show-nr-samples:: Show the number of samples for each symboltools/perf/Documentation/perf.txt +0
-0
tools/perf/Documentation/perf.txt perf - Performance analysis tools for Linux · line 11
Quoted 5 lines
tools/perf/Documentation/perf.txt +1
-1@@ -8,7 +8,15 @@ perf - Performance analysis tools for Linux SYNOPSIS -------- [verse] -'perf' [--version] [--help] COMMAND [ARGS] +'perf' [--version] [--debug variable[=VALUE]] [--help] COMMAND [ARGS]
Hmm.. is this really needed? Also, there're other options might be added here. What about just saying
'perf' [--version] [--help] [OPTIONS] COMMAND [ARGS]
?
Thanks,
Namhyung
Quoted 109 lines
tools/perf/Documentation/perf.txt +8
-0+ +OPTIONS +------- +--debug:: + Setup debug variable (just verbose for now) in value + range (0, 10). Use like: + --debug verbose # sets verbose = 1 + --debug verbose=2 # sets verbose = 2 DESCRIPTION -----------tools/perf/perf.c +12
-1@@ -13,11 +13,12 @@#include "util/quote.h" #include "util/run-command.h" #include "util/parse-events.h" +#include "util/debug.h" #include <api/fs/debugfs.h> #include <pthread.h> const char perf_usage_string[] = -"perf [--version] [--help] COMMAND [ARGS]" ; +"perf [--version] [--debug variable[=VALUE]] [--help] COMMAND [ARGS]" ;const char perf_more_info_string[] ="See 'perf help COMMAND' for more information on a specific command." ;@@ -212,6 +213,16 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)printf ("%s " , p->cmd); }exit (0 ); + }else if (!strcmp (cmd,"--debug" )) { +if (*argc <2 ) { +fprintf (stderr,"No variable specified for --debug.\n" ); +usage (perf_usage_string); + } +if (perf_debug_option ((*argv)[1 ])) +usage (perf_usage_string); + + (*argv)++; + (*argc)--; }else {fprintf (stderr,"Unknown option: %s\n" , cmd);usage (perf_usage_string);tools/perf/util/debug.c +44
-0@@ -105,3 +105,47 @@ void trace_event(union perf_event *event) }printf (".\n" ); } + +static struct debug_variable { +const char *name; +int *ptr; +} debug_variables[] = { + { .name ="verbose" , .ptr = &verbose }, + { .name =NULL , } +}; + +int perf_debug_option (const char *str) +{ +struct debug_variable *var = &debug_variables[0 ]; +char *vstr, *s =strdup (str); +int v =1 ; + + vstr =strchr (s,'=' ); +if (vstr) + *vstr++ =0 ; + +while (var->name) { +if (!strcmp (s, var->name)) +break ; + var++; + } + +if (!var->name) { +pr_err ("Unknown debug variable name '%s'\n" , s); +free (s); +return -1 ; + } + +if (vstr) { + v =atoi (vstr); +/* +* Allow only values in range (0, 10), +* otherwise set 0. +*/ + v = (v <0 ) || (v >10 ) ?0 : v; + } + + *var->ptr = v; +free (s); +return 0 ; +}tools/perf/util/debug.h +2
-0@@ -39,4 +39,6 @@ void pr_stat(const char *fmt, ...);int eprintf (int level,int var,const char *fmt, ...) __attribute__((format (printf,3 ,4 ))); +int perf_debug_option (const char *str); +#endif /* __PERF_DEBUG_H */
PATCH v3 4/5 perf tools: Add --debug optionto set debug variable
On Thu, Jul 17, 2014 at 05:15:49PM +0900, Namhyung Kim wrote:
SNIP
Quoted 13 lines
tools/perf/Documentation/perf.txt perf - Performance analysis tools for Linux · line 11
Quoted 9 lines
index
0eeb247dc7d2..c75a42822c53100644tools/perf/Documentation/perf.txt +1
-1@@ -8,7 +8,15 @@ perf - Performance analysis tools for Linux SYNOPSIS -------- [verse] -'perf' [--version] [--help] COMMAND [ARGS] +'perf' [--version] [--debug variable[=VALUE]] [--help] COMMAND [ARGS]Hmm.. is this really needed? Also, there're other options might be added here. What about just saying
Quoted 4 lines
'perf' [--version] [--help] [OPTIONS] COMMAND [ARGS]
?
yep, it's better, v3 attached
thanks,
jirka
---
Adding --debug option as a way to setup debug variables. Starting with support for verbose, more will come.
It's possible to use it now with report command:
$ perf --debug verbose ... $ perf --debug verbose=2 ...
I'll need this support to add separated debug variable for ordered events change in order to separate debug output out of standard verbose stream.
--- tools/perf/Documentation/perf.txt | 10 ++++++++- tools/perf/perf.c | 13 +++++++++++- tools/perf/util/debug.c | 44 +++++++++++++++++++++++++++++++++++++++ tools/perf/util/debug.h | 2 ++ 4 files changed, 67 insertions(+), 2 deletions(-)
tools/perf/Documentation/perf.txt +9 -1
@@ -8,7 +8,15 @@ perf - Performance analysis tools for Linux SYNOPSIS -------- [verse] -'perf' [--version] [--help] COMMAND [ARGS] +'perf' [--version] [--help] [OPTIONS] COMMAND [ARGS] + +OPTIONS +------- +--debug:: + Setup debug variable (just verbose for now) in value + range (0, 10). Use like: + --debug verbose # sets verbose = 1 + --debug verbose=2 # sets verbose = 2 DESCRIPTION -----------
tools/perf/perf.c +12 -1
@@ -13,11 +13,12 @@#include "util/quote.h" #include "util/run-command.h" #include "util/parse-events.h" +#include "util/debug.h" #include <api/fs/debugfs.h> #include <pthread.h> const char perf_usage_string[] = -"perf [--version] [--help] COMMAND [ARGS]" ; +"perf [--version] [--debug variable[=VALUE]] [--help] COMMAND [ARGS]" ;const char perf_more_info_string[] ="See 'perf help COMMAND' for more information on a specific command." ;
@@ -212,6 +213,16 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)printf ("%s " , p->cmd); }exit (0 ); + }else if (!strcmp (cmd,"--debug" )) { +if (*argc <2 ) { +fprintf (stderr,"No variable specified for --debug.\n" ); +usage (perf_usage_string); + } +if (perf_debug_option ((*argv)[1 ])) +usage (perf_usage_string); + + (*argv)++; + (*argc)--; }else {fprintf (stderr,"Unknown option: %s\n" , cmd);usage (perf_usage_string);
tools/perf/util/debug.c +44 -0
47 lines not on this page · raw message
tools/perf/util/debug.h +2 -0
@@ -39,4 +39,6 @@ void pr_stat(const char *fmt, ...);int eprintf (int level,int var,const char *fmt, ...) __attribute__((format (printf,3 ,4 ))); +int perf_debug_option (const char *str); +#endif /* __PERF_DEBUG_H */
Signature · 1 line
1.8.3.1
tip-bot for Jiri Olsa
merge bot[tip:perf/core] perf tools: Add --debug optionto set debug variable
perf tools: Add --debug optionto set debug variable
Commit-ID: bbb2cea7e8dd496b41558df1a0ec9205497b7ebf Gitweb: http://git.kernel.org/tip/bbb2cea7e8dd496b41558df1a0ec9205497b7ebf Author: Jiri Olsa <[email protected]> AuthorDate: Thu, 17 Jul 2014 12:55:00 +0200 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Thu, 17 Jul 2014 12:58:59 -0300
perf tools: Add --debug optionto set debug variable
Adding --debug option as a way to setup debug variables. Starting with support for verbose, more will come.
It's possible to use it now with report command:
$ perf --debug verbose ... $ perf --debug verbose=2 ...
I'll need this support to add separated debug variable for ordered events change in order to separate debug output out of standard verbose stream.
--- tools/perf/Documentation/perf.txt | 10 ++++++++- tools/perf/perf.c | 13 +++++++++++- tools/perf/util/debug.c | 44 +++++++++++++++++++++++++++++++++++++++ tools/perf/util/debug.h | 2 ++ 4 files changed, 67 insertions(+), 2 deletions(-)
tools/perf/Documentation/perf.txt +9 -1
@@ -8,7 +8,15 @@ perf - Performance analysis tools for Linux SYNOPSIS -------- [verse] -'perf' [--version] [--help] COMMAND [ARGS] +'perf' [--version] [--help] [OPTIONS] COMMAND [ARGS] + +OPTIONS +------- +--debug:: + Setup debug variable (just verbose for now) in value + range (0, 10). Use like: + --debug verbose # sets verbose = 1 + --debug verbose=2 # sets verbose = 2 DESCRIPTION -----------
tools/perf/perf.c +12 -1
@@ -13,11 +13,12 @@#include "util/quote.h" #include "util/run-command.h" #include "util/parse-events.h" +#include "util/debug.h" #include <api/fs/debugfs.h> #include <pthread.h> const char perf_usage_string[] = -"perf [--version] [--help] COMMAND [ARGS]" ; +"perf [--version] [--debug variable[=VALUE]] [--help] COMMAND [ARGS]" ;const char perf_more_info_string[] ="See 'perf help COMMAND' for more information on a specific command." ;
@@ -212,6 +213,16 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)printf ("%s " , p->cmd); }exit (0 ); + }else if (!strcmp (cmd,"--debug" )) { +if (*argc <2 ) { +fprintf (stderr,"No variable specified for --debug.\n" ); +usage (perf_usage_string); + } +if (perf_debug_option ((*argv)[1 ])) +usage (perf_usage_string); + + (*argv)++; + (*argc)--; }else {fprintf (stderr,"Unknown option: %s\n" , cmd);usage (perf_usage_string);
tools/perf/util/debug.c +44 -0
47 lines not on this page · raw message
tools/perf/util/debug.h +2 -0
@@ -39,4 +39,6 @@ void pr_stat(const char *fmt, ...);int eprintf (int level,int var,const char *fmt, ...) __attribute__((format (printf,3 ,4 ))); +int perf_debug_option (const char *str); +#endif /* __PERF_DEBUG_H */
Namhyung Kim
maintainerRe: [PATCHv3 4/5] perf tools: Add --debug optionto set debug variable
In reply to Jiri OlsaHi Jiri,
Quoted 1 line · Jiri Olsa
yep, it's better, v3 attached
[SNIP]
Quoted 24 lines
tools/perf/Documentation/perf.txt +9
-1@@ -8,7 +8,15 @@ perf - Performance analysis tools for Linux SYNOPSIS -------- [verse] -'perf' [--version] [--help] COMMAND [ARGS] +'perf' [--version] [--help] [OPTIONS] COMMAND [ARGS] + +OPTIONS +------- +--debug:: + Setup debug variable (just verbose for now) in value + range (0, 10). Use like: + --debug verbose # sets verbose = 1 + --debug verbose=2 # sets verbose = 2 DESCRIPTION -----------tools/perf/perf.c +0
-0
tools/perf/perf.c line 21
Quoted 10 lines
tools/perf/perf.c +2
-1@@ -13,11 +13,12 @@#include "util/quote.h" #include "util/run-command.h" #include "util/parse-events.h" +#include "util/debug.h" #include <api/fs/debugfs.h> #include <pthread.h> const char perf_usage_string[] = -"perf [--version] [--help] COMMAND [ARGS]" ; +"perf [--version] [--debug variable[=VALUE]] [--help] COMMAND [ARGS]" ;
You missed to update here.. ;-)
Thanks,
Namhyung
Re: [PATCHv3 4/5] perf tools: Add --debug optionto set debug variable
On Fri, Jul 18, 2014 at 02:04:51PM +0900, Namhyung Kim wrote:
SNIP
Quoted 7 lines
Quoted 7 lines
#include "
util/quote.h"
#include "util/run-command.h"
#include "util/parse-events.h"
+#include "util/debug.h"
#include <api/fs/debugfs.h>
#include <pthread.h>
Quoted 5 lines
tools/perf/perf.c line 21
Quoted 3 lines
const char perf_usage_string[] =
tools/perf/perf.c +1
-1-"perf [--version] [--help] COMMAND [ARGS]" ; +"perf [--version] [--debug variable[=VALUE]] [--help] COMMAND [ARGS]" ;You missed to update here.. ;-)
ouch, I'll fix that in following patchset
thanks,
jirka
Jiri Olsa
reviewerPATCH 5/5 perf tools: Remove getopt.h includes
In reply to Jiri OlsaWe don't use getopt.h interfaces.
--- tools/perf/util/probe-finder.c | 1 - tools/perf/util/trace-event-read.c | 1 - 2 files changed, 2 deletions(-)
tools/perf/util/probe-finder.c +0 -1
@@ -26,7 +26,6 @@#include <errno.h> #include <stdio.h> #include <unistd.h> -#include <getopt.h> #include <stdlib.h> #include <string.h> #include <stdarg.h>
tools/perf/util/trace-event-read.c +0 -1
@@ -22,7 +22,6 @@#include <stdio.h> #include <stdlib.h> #include <string.h> -#include <getopt.h> #include <stdarg.h> #include <sys/types.h> #include <sys/stat.h>
Signature · 1 line
1.8.3.1
tip-bot for Jiri Olsa
merge bot[tip:perf/core] perf tools: Remove needless getopt.h includes
perf tools: Remove needless getopt.h includes
Commit-ID: ff527bccd469067a64f4ae9747b9045914667d34 Gitweb: http://git.kernel.org/tip/ff527bccd469067a64f4ae9747b9045914667d34 Author: Jiri Olsa <[email protected]> AuthorDate: Mon, 14 Jul 2014 23:46:51 +0200 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Thu, 17 Jul 2014 12:59:00 -0300
perf tools: Remove needless getopt.h includes
We don't use getopt.h interfaces.
--- tools/perf/util/probe-finder.c | 1 - tools/perf/util/trace-event-read.c | 1 - 2 files changed, 2 deletions(-)
tools/perf/util/probe-finder.c +0 -1
@@ -26,7 +26,6 @@#include <errno.h> #include <stdio.h> #include <unistd.h> -#include <getopt.h> #include <stdlib.h> #include <string.h> #include <stdarg.h>
tools/perf/util/trace-event-read.c +0 -1
@@ -22,7 +22,6 @@#include <stdio.h> #include <stdlib.h> #include <string.h> -#include <getopt.h> #include <stdarg.h> #include <sys/types.h> #include <sys/stat.h>