{"thread":{"id":"23974","subject":"patch perf-fix-endianness-argument-compatibility-with-opt_boolean-and-introduce-opt_incr.patch added to 2.6.34-stable tree","startedAt":"2010-06-01T23:00:54Z","lastAt":"2010-06-01T23:00:54Z","messageCount":1,"participants":["gregkh@suse.de"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"142732","messageId":"12754332543166@site","threadId":"23974","inReplyTo":null,"subject":"patch perf-fix-endianness-argument-compatibility-with-opt_boolean-and-introduce-opt_incr.patch added to 2.6.34-stable tree","fromName":"","fromEmail":"gregkh@suse.de","sentAt":"2010-06-01T23:00:54Z","receivedAt":"2010-06-01T23:00:54Z","isPatch":false,"sender":{"key":"gregkh@suse.de","avatar":"https://gravatar.com/avatar/e52bfe8b8ad890236109deb2ce59960a1584dc070d18487f7a2b5273d709fcdc?d=mp&s=160"},"body":"\nThis is a note to let you know that we have just queued up the patch titled\n\n    Subject: perf: Fix endianness argument compatibility with OPT_BOOLEAN() and introduce OPT_INCR()\n\nto the 2.6.34-stable tree.  Its filename is\n\n    perf-fix-endianness-argument-compatibility-with-opt_boolean-and-introduce-opt_incr.patch\n\nA git repo of this tree can be found at \n    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary\n\n\n>From c05556421742eb47f80301767653a4bcb19de9de Mon Sep 17 00:00:00 2001\nFrom: Ian Munsie <imunsie@au.ibm.com>\nDate: Tue, 13 Apr 2010 18:37:33 +1000\nSubject: perf: Fix endianness argument compatibility with OPT_BOOLEAN() and introduce OPT_INCR()\n\nFrom: Ian Munsie <imunsie@au.ibm.com>\n\ncommit c05556421742eb47f80301767653a4bcb19de9de upstream.\n\nParsing an option from the command line with OPT_BOOLEAN on a\nbool data type would not work on a big-endian machine due to the\nmanner in which the boolean was being cast into an int and\nincremented. For example, running 'perf probe --list' on a\nPowerPC machine would fail to properly set the list_events bool\nand would therefore print out the usage information and\nterminate.\n\nThis patch makes OPT_BOOLEAN work as expected with a bool\ndatatype. For cases where the original OPT_BOOLEAN was\nintentionally being used to increment an int each time it was\npassed in on the command line, this patch introduces OPT_INCR\nwith the old behaviour of OPT_BOOLEAN (the verbose variable is\ncurrently the only such example of this).\n\nI have reviewed every use of OPT_BOOLEAN to verify that a true\nC99 bool was passed. Where integers were used, I verified that\nthey were only being used for boolean logic and changed them to\nbools to ensure that they would not be mistakenly used as ints.\nThe major exception was the verbose variable which now uses\nOPT_INCR instead of OPT_BOOLEAN.\n\nSigned-off-by: Ian Munsie <imunsie@au.ibm.com>\nAcked-by: David S. Miller <davem@davemloft.net>\nCc: <stable@kernel.org> # NOTE: wont apply to .3[34].x cleanly, please backport\nCc: Git development list <git@vger.kernel.org>\nCc: Ian Munsie <imunsie@au1.ibm.com>\nCc: Peter Zijlstra <a.p.zijlstra@chello.nl>\nCc: Paul Mackerras <paulus@samba.org>\nCc: Arnaldo Carvalho de Melo <acme@redhat.com>\nCc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>\nCc: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>\nCc: Rusty Russell <rusty@rustcorp.com.au>\nCc: Frederic Weisbecker <fweisbec@gmail.com>\nCc: Eric B Munson <ebmunson@us.ibm.com>\nCc: Valdis.Kletnieks@vt.edu\nCc: WANG Cong <amwang@redhat.com>\nCc: Thiago Farina <tfransosi@gmail.com>\nCc: Masami Hiramatsu <mhiramat@redhat.com>\nCc: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>\nCc: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>\nCc: Arjan van de Ven <arjan@linux.intel.com>\nCc: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>\nCc: Mike Galbraith <efault@gmx.de>\nCc: Tom Zanussi <tzanussi@gmail.com>\nCc: Anton Blanchard <anton@samba.org>\nCc: John Kacur <jkacur@redhat.com>\nCc: Li Zefan <lizf@cn.fujitsu.com>\nCc: Steven Rostedt <rostedt@goodmis.org>\nLKML-Reference: <1271147857-11604-1-git-send-email-imunsie@au.ibm.com>\nSigned-off-by: Ingo Molnar <mingo@elte.hu>\nSigned-off-by: Greg Kroah-Hartman <gregkh@suse.de>\n\n---\n tools/perf/bench/mem-memcpy.c       |    2 +-\n tools/perf/bench/sched-messaging.c  |    4 ++--\n tools/perf/builtin-annotate.c       |    8 ++++----\n tools/perf/builtin-buildid-cache.c  |    2 +-\n tools/perf/builtin-buildid-list.c   |    4 ++--\n tools/perf/builtin-diff.c           |    4 ++--\n tools/perf/builtin-help.c           |    2 +-\n tools/perf/builtin-lock.c           |    2 +-\n tools/perf/builtin-probe.c          |    2 +-\n tools/perf/builtin-record.c         |   24 ++++++++++++------------\n tools/perf/builtin-report.c         |    6 +++---\n tools/perf/builtin-sched.c          |    6 +++---\n tools/perf/builtin-stat.c           |   10 +++++-----\n tools/perf/builtin-timechart.c      |    2 +-\n tools/perf/builtin-top.c            |   14 +++++++-------\n tools/perf/builtin-trace.c          |    2 +-\n tools/perf/util/debug.c             |    2 +-\n tools/perf/util/debug.h             |    3 ++-\n tools/perf/util/parse-options.c     |    6 ++++++\n tools/perf/util/parse-options.h     |    4 +++-\n tools/perf/util/trace-event-parse.c |    2 +-\n tools/perf/util/trace-event.h       |    3 ++-\n 22 files changed, 62 insertions(+), 52 deletions(-)\n\n--- a/tools/perf/bench/mem-memcpy.c\n+++ b/tools/perf/bench/mem-memcpy.c\n@@ -24,7 +24,7 @@\n \n static const char\t*length_str\t= \"1MB\";\n static const char\t*routine\t= \"default\";\n-static int\t\tuse_clock\t= 0;\n+static bool\t\tuse_clock\t= false;\n static int\t\tclock_fd;\n \n static const struct option options[] = {\n--- a/tools/perf/bench/sched-messaging.c\n+++ b/tools/perf/bench/sched-messaging.c\n@@ -31,9 +31,9 @@\n \n #define DATASIZE 100\n \n-static int use_pipes = 0;\n+static bool use_pipes = false;\n static unsigned int loops = 100;\n-static unsigned int thread_mode = 0;\n+static bool thread_mode = false;\n static unsigned int num_groups = 10;\n \n struct sender_context {\n--- a/tools/perf/builtin-annotate.c\n+++ b/tools/perf/builtin-annotate.c\n@@ -29,11 +29,11 @@\n \n static char\t\tconst *input_name = \"perf.data\";\n \n-static int\t\tforce;\n+static bool\t\tforce;\n \n-static int\t\tfull_paths;\n+static bool\t\tfull_paths;\n \n-static int\t\tprint_line;\n+static bool\t\tprint_line;\n \n struct sym_hist {\n \tu64\t\tsum;\n@@ -584,7 +584,7 @@ static const struct option options[] = {\n \tOPT_STRING('s', \"symbol\", &sym_hist_filter, \"symbol\",\n \t\t    \"symbol to annotate\"),\n \tOPT_BOOLEAN('f', \"force\", &force, \"don't complain, do it\"),\n-\tOPT_BOOLEAN('v', \"verbose\", &verbose,\n+\tOPT_INCR('v', \"verbose\", &verbose,\n \t\t    \"be more verbose (show symbol address, etc)\"),\n \tOPT_BOOLEAN('D', \"dump-raw-trace\", &dump_trace,\n \t\t    \"dump raw trace in ASCII\"),\n--- a/tools/perf/builtin-buildid-cache.c\n+++ b/tools/perf/builtin-buildid-cache.c\n@@ -27,7 +27,7 @@ static const struct option buildid_cache\n \t\t   \"file list\", \"file(s) to add\"),\n \tOPT_STRING('r', \"remove\", &remove_name_list_str, \"file list\",\n \t\t    \"file(s) to remove\"),\n-\tOPT_BOOLEAN('v', \"verbose\", &verbose, \"be more verbose\"),\n+\tOPT_INCR('v', \"verbose\", &verbose, \"be more verbose\"),\n \tOPT_END()\n };\n \n--- a/tools/perf/builtin-buildid-list.c\n+++ b/tools/perf/builtin-buildid-list.c\n@@ -16,7 +16,7 @@\n #include \"util/symbol.h\"\n \n static char const *input_name = \"perf.data\";\n-static int force;\n+static bool force;\n static bool with_hits;\n \n static const char * const buildid_list_usage[] = {\n@@ -29,7 +29,7 @@ static const struct option options[] = {\n \tOPT_STRING('i', \"input\", &input_name, \"file\",\n \t\t    \"input file name\"),\n \tOPT_BOOLEAN('f', \"force\", &force, \"don't complain, do it\"),\n-\tOPT_BOOLEAN('v', \"verbose\", &verbose,\n+\tOPT_INCR('v', \"verbose\", &verbose,\n \t\t    \"be more verbose\"),\n \tOPT_END()\n };\n--- a/tools/perf/builtin-diff.c\n+++ b/tools/perf/builtin-diff.c\n@@ -19,7 +19,7 @@\n static char const *input_old = \"perf.data.old\",\n \t\t  *input_new = \"perf.data\";\n static char\t  diff__default_sort_order[] = \"dso,symbol\";\n-static int  force;\n+static bool  force;\n static bool show_displacement;\n \n static int perf_session__add_hist_entry(struct perf_session *self,\n@@ -188,7 +188,7 @@ static const char * const diff_usage[] =\n };\n \n static const struct option options[] = {\n-\tOPT_BOOLEAN('v', \"verbose\", &verbose,\n+\tOPT_INCR('v', \"verbose\", &verbose,\n \t\t    \"be more verbose (show symbol address, etc)\"),\n \tOPT_BOOLEAN('m', \"displacement\", &show_displacement,\n \t\t    \"Show position displacement relative to baseline\"),\n--- a/tools/perf/builtin-help.c\n+++ b/tools/perf/builtin-help.c\n@@ -29,7 +29,7 @@ enum help_format {\n \tHELP_FORMAT_WEB,\n };\n \n-static int show_all = 0;\n+static bool show_all = false;\n static enum help_format help_format = HELP_FORMAT_MAN;\n static struct option builtin_help_options[] = {\n \tOPT_BOOLEAN('a', \"all\", &show_all, \"print all available commands\"),\n--- a/tools/perf/builtin-lock.c\n+++ b/tools/perf/builtin-lock.c\n@@ -744,7 +744,7 @@ static const char * const lock_usage[] =\n \n static const struct option lock_options[] = {\n \tOPT_STRING('i', \"input\", &input_name, \"file\", \"input file name\"),\n-\tOPT_BOOLEAN('v', \"verbose\", &verbose, \"be more verbose (show symbol address, etc)\"),\n+\tOPT_INCR('v', \"verbose\", &verbose, \"be more verbose (show symbol address, etc)\"),\n \tOPT_BOOLEAN('D', \"dump-raw-trace\", &dump_trace, \"dump raw trace in ASCII\"),\n \tOPT_END()\n };\n--- a/tools/perf/builtin-probe.c\n+++ b/tools/perf/builtin-probe.c\n@@ -162,7 +162,7 @@ static const char * const probe_usage[]\n };\n \n static const struct option options[] = {\n-\tOPT_BOOLEAN('v', \"verbose\", &verbose,\n+\tOPT_INCR('v', \"verbose\", &verbose,\n \t\t    \"be more verbose (show parsed arguments, etc)\"),\n #ifndef NO_DWARF_SUPPORT\n \tOPT_STRING('k', \"vmlinux\", &symbol_conf.vmlinux_name,\n--- a/tools/perf/builtin-record.c\n+++ b/tools/perf/builtin-record.c\n@@ -39,19 +39,19 @@ static int\t\t\toutput;\n static const char\t\t*output_name\t\t\t= \"perf.data\";\n static int\t\t\tgroup\t\t\t\t=      0;\n static unsigned int\t\trealtime_prio\t\t\t=      0;\n-static int\t\t\traw_samples\t\t\t=      0;\n-static int\t\t\tsystem_wide\t\t\t=      0;\n+static bool\t\t\traw_samples\t\t\t=  false;\n+static bool\t\t\tsystem_wide\t\t\t=  false;\n static int\t\t\tprofile_cpu\t\t\t=     -1;\n static pid_t\t\t\ttarget_pid\t\t\t=     -1;\n static pid_t\t\t\tchild_pid\t\t\t=     -1;\n-static int\t\t\tinherit\t\t\t\t=      1;\n-static int\t\t\tforce\t\t\t\t=      0;\n-static int\t\t\tappend_file\t\t\t=      0;\n-static int\t\t\tcall_graph\t\t\t=      0;\n-static int\t\t\tinherit_stat\t\t\t=      0;\n-static int\t\t\tno_samples\t\t\t=      0;\n-static int\t\t\tsample_address\t\t\t=      0;\n-static int\t\t\tmultiplex\t\t\t=      0;\n+static bool\t\t\tinherit\t\t\t\t=   true;\n+static bool\t\t\tforce\t\t\t\t=  false;\n+static bool\t\t\tappend_file\t\t\t=  false;\n+static bool\t\t\tcall_graph\t\t\t=  false;\n+static bool\t\t\tinherit_stat\t\t\t=  false;\n+static bool\t\t\tno_samples\t\t\t=  false;\n+static bool\t\t\tsample_address\t\t\t=  false;\n+static bool\t\t\tmultiplex\t\t\t=  false;\n static int\t\t\tmultiplex_fd\t\t\t=     -1;\n \n static long\t\t\tsamples\t\t\t\t=      0;\n@@ -451,7 +451,7 @@ static int __cmd_record(int argc, const\n \t\t\trename(output_name, oldname);\n \t\t}\n \t} else {\n-\t\tappend_file = 0;\n+\t\tappend_file = false;\n \t}\n \n \tflags = O_CREAT|O_RDWR;\n@@ -676,7 +676,7 @@ static const struct option options[] = {\n \t\t    \"number of mmap data pages\"),\n \tOPT_BOOLEAN('g', \"call-graph\", &call_graph,\n \t\t    \"do call-graph (stack chain/backtrace) recording\"),\n-\tOPT_BOOLEAN('v', \"verbose\", &verbose,\n+\tOPT_INCR('v', \"verbose\", &verbose,\n \t\t    \"be more verbose (show counter open errors, etc)\"),\n \tOPT_BOOLEAN('s', \"stat\", &inherit_stat,\n \t\t    \"per thread counts\"),\n--- a/tools/perf/builtin-report.c\n+++ b/tools/perf/builtin-report.c\n@@ -33,11 +33,11 @@\n \n static char\t\tconst *input_name = \"perf.data\";\n \n-static int\t\tforce;\n+static bool\t\tforce;\n static bool\t\thide_unresolved;\n static bool\t\tdont_use_callchains;\n \n-static int\t\tshow_threads;\n+static bool\t\tshow_threads;\n static struct perf_read_values\tshow_threads_values;\n \n static char\t\tdefault_pretty_printing_style[] = \"normal\";\n@@ -400,7 +400,7 @@ static const char * const report_usage[]\n static const struct option options[] = {\n \tOPT_STRING('i', \"input\", &input_name, \"file\",\n \t\t    \"input file name\"),\n-\tOPT_BOOLEAN('v', \"verbose\", &verbose,\n+\tOPT_INCR('v', \"verbose\", &verbose,\n \t\t    \"be more verbose (show symbol address, etc)\"),\n \tOPT_BOOLEAN('D', \"dump-raw-trace\", &dump_trace,\n \t\t    \"dump raw trace in ASCII\"),\n--- a/tools/perf/builtin-sched.c\n+++ b/tools/perf/builtin-sched.c\n@@ -1790,7 +1790,7 @@ static const char * const sched_usage[]\n static const struct option sched_options[] = {\n \tOPT_STRING('i', \"input\", &input_name, \"file\",\n \t\t    \"input file name\"),\n-\tOPT_BOOLEAN('v', \"verbose\", &verbose,\n+\tOPT_INCR('v', \"verbose\", &verbose,\n \t\t    \"be more verbose (show symbol address, etc)\"),\n \tOPT_BOOLEAN('D', \"dump-raw-trace\", &dump_trace,\n \t\t    \"dump raw trace in ASCII\"),\n@@ -1805,7 +1805,7 @@ static const char * const latency_usage[\n static const struct option latency_options[] = {\n \tOPT_STRING('s', \"sort\", &sort_order, \"key[,key2...]\",\n \t\t   \"sort by key(s): runtime, switch, avg, max\"),\n-\tOPT_BOOLEAN('v', \"verbose\", &verbose,\n+\tOPT_INCR('v', \"verbose\", &verbose,\n \t\t    \"be more verbose (show symbol address, etc)\"),\n \tOPT_INTEGER('C', \"CPU\", &profile_cpu,\n \t\t    \"CPU to profile on\"),\n@@ -1822,7 +1822,7 @@ static const char * const replay_usage[]\n static const struct option replay_options[] = {\n \tOPT_INTEGER('r', \"repeat\", &replay_repeat,\n \t\t    \"repeat the workload replay N times (-1: infinite)\"),\n-\tOPT_BOOLEAN('v', \"verbose\", &verbose,\n+\tOPT_INCR('v', \"verbose\", &verbose,\n \t\t    \"be more verbose (show symbol address, etc)\"),\n \tOPT_BOOLEAN('D', \"dump-raw-trace\", &dump_trace,\n \t\t    \"dump raw trace in ASCII\"),\n--- a/tools/perf/builtin-stat.c\n+++ b/tools/perf/builtin-stat.c\n@@ -66,16 +66,16 @@ static struct perf_event_attr default_at\n \n };\n \n-static int\t\t\tsystem_wide\t\t\t=  0;\n+static bool\t\t\tsystem_wide\t\t\t=  false;\n static unsigned int\t\tnr_cpus\t\t\t\t=  0;\n static int\t\t\trun_idx\t\t\t\t=  0;\n \n static int\t\t\trun_count\t\t\t=  1;\n-static int\t\t\tinherit\t\t\t\t=  1;\n-static int\t\t\tscale\t\t\t\t=  1;\n+static bool\t\t\tinherit\t\t\t\t=  true;\n+static bool\t\t\tscale\t\t\t\t=  true;\n static pid_t\t\t\ttarget_pid\t\t\t= -1;\n static pid_t\t\t\tchild_pid\t\t\t= -1;\n-static int\t\t\tnull_run\t\t\t=  0;\n+static bool\t\t\tnull_run\t\t\t=  false;\n \n static int\t\t\tfd[MAX_NR_CPUS][MAX_COUNTERS];\n \n@@ -494,7 +494,7 @@ static const struct option options[] = {\n \t\t    \"system-wide collection from all CPUs\"),\n \tOPT_BOOLEAN('c', \"scale\", &scale,\n \t\t    \"scale/normalize counters\"),\n-\tOPT_BOOLEAN('v', \"verbose\", &verbose,\n+\tOPT_INCR('v', \"verbose\", &verbose,\n \t\t    \"be more verbose (show counter open errors, etc)\"),\n \tOPT_INTEGER('r', \"repeat\", &run_count,\n \t\t    \"repeat command and print average + stddev (max: 100)\"),\n--- a/tools/perf/builtin-timechart.c\n+++ b/tools/perf/builtin-timechart.c\n@@ -43,7 +43,7 @@ static u64\t\tturbo_frequency;\n \n static u64\t\tfirst_time, last_time;\n \n-static int\t\tpower_only;\n+static bool\t\tpower_only;\n \n \n struct per_pid;\n--- a/tools/perf/builtin-top.c\n+++ b/tools/perf/builtin-top.c\n@@ -57,7 +57,7 @@\n \n static int\t\t\tfd[MAX_NR_CPUS][MAX_COUNTERS];\n \n-static int\t\t\tsystem_wide\t\t\t=      0;\n+static bool\t\t\tsystem_wide\t\t\t=  false;\n \n static int\t\t\tdefault_interval\t\t=      0;\n \n@@ -65,18 +65,18 @@ static int\t\t\tcount_filter\t\t\t=      5;\n static int\t\t\tprint_entries;\n \n static int\t\t\ttarget_pid\t\t\t=     -1;\n-static int\t\t\tinherit\t\t\t\t=      0;\n+static bool\t\t\tinherit\t\t\t\t=  false;\n static int\t\t\tprofile_cpu\t\t\t=     -1;\n static int\t\t\tnr_cpus\t\t\t\t=      0;\n static unsigned int\t\trealtime_prio\t\t\t=      0;\n-static int\t\t\tgroup\t\t\t\t=      0;\n+static bool\t\t\tgroup\t\t\t\t=  false;\n static unsigned int\t\tpage_size;\n static unsigned int\t\tmmap_pages\t\t\t=     16;\n static int\t\t\tfreq\t\t\t\t=   1000; /* 1 KHz */\n \n static int\t\t\tdelay_secs\t\t\t=      2;\n-static int\t\t\tzero                            =      0;\n-static int\t\t\tdump_symtab                     =      0;\n+static bool\t\t\tzero                            =  false;\n+static bool\t\t\tdump_symtab                     =  false;\n \n static bool\t\t\thide_kernel_symbols\t\t=  false;\n static bool\t\t\thide_user_symbols\t\t=  false;\n@@ -839,7 +839,7 @@ static void handle_keypress(int c)\n \t\t\tdisplay_weighted = ~display_weighted;\n \t\t\tbreak;\n \t\tcase 'z':\n-\t\t\tzero = ~zero;\n+\t\t\tzero = !zero;\n \t\t\tbreak;\n \t\tdefault:\n \t\t\tbreak;\n@@ -1296,7 +1296,7 @@ static const struct option options[] = {\n \t\t    \"display this many functions\"),\n \tOPT_BOOLEAN('U', \"hide_user_symbols\", &hide_user_symbols,\n \t\t    \"hide user symbols\"),\n-\tOPT_BOOLEAN('v', \"verbose\", &verbose,\n+\tOPT_INCR('v', \"verbose\", &verbose,\n \t\t    \"be more verbose (show counter open errors, etc)\"),\n \tOPT_END()\n };\n--- a/tools/perf/builtin-trace.c\n+++ b/tools/perf/builtin-trace.c\n@@ -505,7 +505,7 @@ static const char * const trace_usage[]\n static const struct option options[] = {\n \tOPT_BOOLEAN('D', \"dump-raw-trace\", &dump_trace,\n \t\t    \"dump raw trace in ASCII\"),\n-\tOPT_BOOLEAN('v', \"verbose\", &verbose,\n+\tOPT_INCR('v', \"verbose\", &verbose,\n \t\t    \"be more verbose (show symbol address, etc)\"),\n \tOPT_BOOLEAN('L', \"Latency\", &latency_format,\n \t\t    \"show latency attributes (irqs/preemption disabled, etc)\"),\n--- a/tools/perf/util/debug.c\n+++ b/tools/perf/util/debug.c\n@@ -12,7 +12,7 @@\n #include \"util.h\"\n \n int verbose = 0;\n-int dump_trace = 0;\n+bool dump_trace = false;\n \n int eprintf(int level, const char *fmt, ...)\n {\n--- a/tools/perf/util/debug.h\n+++ b/tools/perf/util/debug.h\n@@ -2,10 +2,11 @@\n #ifndef __PERF_DEBUG_H\n #define __PERF_DEBUG_H\n \n+#include <stdbool.h>\n #include \"event.h\"\n \n extern int verbose;\n-extern int dump_trace;\n+extern bool dump_trace;\n \n int eprintf(int level,\n \t    const char *fmt, ...) __attribute__((format(printf, 2, 3)));\n--- a/tools/perf/util/parse-options.c\n+++ b/tools/perf/util/parse-options.c\n@@ -49,6 +49,7 @@ static int get_value(struct parse_opt_ct\n \t\t\t\tbreak;\n \t\t\t/* FALLTHROUGH */\n \t\tcase OPTION_BOOLEAN:\n+\t\tcase OPTION_INCR:\n \t\tcase OPTION_BIT:\n \t\tcase OPTION_SET_INT:\n \t\tcase OPTION_SET_PTR:\n@@ -73,6 +74,10 @@ static int get_value(struct parse_opt_ct\n \t\treturn 0;\n \n \tcase OPTION_BOOLEAN:\n+\t\t*(bool *)opt->value = unset ? false : true;\n+\t\treturn 0;\n+\n+\tcase OPTION_INCR:\n \t\t*(int *)opt->value = unset ? 0 : *(int *)opt->value + 1;\n \t\treturn 0;\n \n@@ -478,6 +483,7 @@ int usage_with_options_internal(const ch\n \t\tcase OPTION_GROUP:\n \t\tcase OPTION_BIT:\n \t\tcase OPTION_BOOLEAN:\n+\t\tcase OPTION_INCR:\n \t\tcase OPTION_SET_INT:\n \t\tcase OPTION_SET_PTR:\n \t\tcase OPTION_LONG:\n--- a/tools/perf/util/parse-options.h\n+++ b/tools/perf/util/parse-options.h\n@@ -8,7 +8,8 @@ enum parse_opt_type {\n \tOPTION_GROUP,\n \t/* options with no arguments */\n \tOPTION_BIT,\n-\tOPTION_BOOLEAN, /* _INCR would have been a better name */\n+\tOPTION_BOOLEAN,\n+\tOPTION_INCR,\n \tOPTION_SET_INT,\n \tOPTION_SET_PTR,\n \t/* options with arguments (usually) */\n@@ -95,6 +96,7 @@ struct option {\n #define OPT_GROUP(h)                { .type = OPTION_GROUP, .help = (h) }\n #define OPT_BIT(s, l, v, h, b)      { .type = OPTION_BIT, .short_name = (s), .long_name = (l), .value = (v), .help = (h), .defval = (b) }\n #define OPT_BOOLEAN(s, l, v, h)     { .type = OPTION_BOOLEAN, .short_name = (s), .long_name = (l), .value = (v), .help = (h) }\n+#define OPT_INCR(s, l, v, h)        { .type = OPTION_INCR, .short_name = (s), .long_name = (l), .value = (v), .help = (h) }\n #define OPT_SET_INT(s, l, v, h, i)  { .type = OPTION_SET_INT, .short_name = (s), .long_name = (l), .value = (v), .help = (h), .defval = (i) }\n #define OPT_SET_PTR(s, l, v, h, p)  { .type = OPTION_SET_PTR, .short_name = (s), .long_name = (l), .value = (v), .help = (h), .defval = (p) }\n #define OPT_INTEGER(s, l, v, h)     { .type = OPTION_INTEGER, .short_name = (s), .long_name = (l), .value = (v), .help = (h) }\n--- a/tools/perf/util/trace-event-parse.c\n+++ b/tools/perf/util/trace-event-parse.c\n@@ -40,7 +40,7 @@ int header_page_size_size;\n int header_page_data_offset;\n int header_page_data_size;\n \n-int latency_format;\n+bool latency_format;\n \n static char *input_buf;\n static unsigned long long input_buf_ptr;\n--- a/tools/perf/util/trace-event.h\n+++ b/tools/perf/util/trace-event.h\n@@ -1,6 +1,7 @@\n #ifndef __PERF_TRACE_EVENTS_H\n #define __PERF_TRACE_EVENTS_H\n \n+#include <stdbool.h>\n #include \"parse-events.h\"\n \n #define __unused __attribute__((unused))\n@@ -241,7 +242,7 @@ extern int header_page_size_size;\n extern int header_page_data_offset;\n extern int header_page_data_size;\n \n-extern int latency_format;\n+extern bool latency_format;\n \n int parse_header_page(char *buf, unsigned long size);\n int trace_parse_common_type(void *data);\n\n\nPatches currently in stable-queue which might be from imunsie@au.ibm.com are\n\nqueue-2.6.34/perf-fix-endianness-argument-compatibility-with-opt_boolean-and-introduce-opt_incr.patch\n"}]}