Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 191193
b: refs/heads/master
c: c055564
h: refs/heads/master
i:
  191191: 953dc65
v: v3
  • Loading branch information
Ian Munsie authored and Ingo Molnar committed Apr 14, 2010
1 parent 8df5e6b commit be2a668
Show file tree
Hide file tree
Showing 23 changed files with 63 additions and 53 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 53e5b5c215ce8372250e227f2c9acf9892de8434
refs/heads/master: c05556421742eb47f80301767653a4bcb19de9de
2 changes: 1 addition & 1 deletion trunk/tools/perf/bench/mem-memcpy.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

static const char *length_str = "1MB";
static const char *routine = "default";
static int use_clock = 0;
static bool use_clock = false;
static int clock_fd;

static const struct option options[] = {
Expand Down
4 changes: 2 additions & 2 deletions trunk/tools/perf/bench/sched-messaging.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@

#define DATASIZE 100

static int use_pipes = 0;
static bool use_pipes = false;
static unsigned int loops = 100;
static unsigned int thread_mode = 0;
static bool thread_mode = false;
static unsigned int num_groups = 10;

struct sender_context {
Expand Down
8 changes: 4 additions & 4 deletions trunk/tools/perf/builtin-annotate.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@

static char const *input_name = "perf.data";

static int force;
static bool force;

static int full_paths;
static bool full_paths;

static int print_line;
static bool print_line;

struct sym_hist {
u64 sum;
Expand Down Expand Up @@ -595,7 +595,7 @@ static const struct option options[] = {
OPT_STRING('s', "symbol", &sym_hist_filter, "symbol",
"symbol to annotate"),
OPT_BOOLEAN('f', "force", &force, "don't complain, do it"),
OPT_BOOLEAN('v', "verbose", &verbose,
OPT_INCR('v', "verbose", &verbose,
"be more verbose (show symbol address, etc)"),
OPT_BOOLEAN('D', "dump-raw-trace", &dump_trace,
"dump raw trace in ASCII"),
Expand Down
2 changes: 1 addition & 1 deletion trunk/tools/perf/builtin-buildid-cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ static const struct option buildid_cache_options[] = {
"file list", "file(s) to add"),
OPT_STRING('r', "remove", &remove_name_list_str, "file list",
"file(s) to remove"),
OPT_BOOLEAN('v', "verbose", &verbose, "be more verbose"),
OPT_INCR('v', "verbose", &verbose, "be more verbose"),
OPT_END()
};

Expand Down
4 changes: 2 additions & 2 deletions trunk/tools/perf/builtin-buildid-list.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include "util/symbol.h"

static char const *input_name = "perf.data";
static int force;
static bool force;
static bool with_hits;

static const char * const buildid_list_usage[] = {
Expand All @@ -29,7 +29,7 @@ static const struct option options[] = {
OPT_STRING('i', "input", &input_name, "file",
"input file name"),
OPT_BOOLEAN('f', "force", &force, "don't complain, do it"),
OPT_BOOLEAN('v', "verbose", &verbose,
OPT_INCR('v', "verbose", &verbose,
"be more verbose"),
OPT_END()
};
Expand Down
4 changes: 2 additions & 2 deletions trunk/tools/perf/builtin-diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
static char const *input_old = "perf.data.old",
*input_new = "perf.data";
static char diff__default_sort_order[] = "dso,symbol";
static int force;
static bool force;
static bool show_displacement;

static int perf_session__add_hist_entry(struct perf_session *self,
Expand Down Expand Up @@ -188,7 +188,7 @@ static const char * const diff_usage[] = {
};

static const struct option options[] = {
OPT_BOOLEAN('v', "verbose", &verbose,
OPT_INCR('v', "verbose", &verbose,
"be more verbose (show symbol address, etc)"),
OPT_BOOLEAN('m', "displacement", &show_displacement,
"Show position displacement relative to baseline"),
Expand Down
2 changes: 1 addition & 1 deletion trunk/tools/perf/builtin-help.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ enum help_format {
HELP_FORMAT_WEB,
};

static int show_all = 0;
static bool show_all = false;
static enum help_format help_format = HELP_FORMAT_MAN;
static struct option builtin_help_options[] = {
OPT_BOOLEAN('a', "all", &show_all, "print all available commands"),
Expand Down
2 changes: 1 addition & 1 deletion trunk/tools/perf/builtin-lock.c
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,7 @@ static const char * const lock_usage[] = {

static const struct option lock_options[] = {
OPT_STRING('i', "input", &input_name, "file", "input file name"),
OPT_BOOLEAN('v', "verbose", &verbose, "be more verbose (show symbol address, etc)"),
OPT_INCR('v', "verbose", &verbose, "be more verbose (show symbol address, etc)"),
OPT_BOOLEAN('D', "dump-raw-trace", &dump_trace, "dump raw trace in ASCII"),
OPT_END()
};
Expand Down
2 changes: 1 addition & 1 deletion trunk/tools/perf/builtin-probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ static const char * const probe_usage[] = {
};

static const struct option options[] = {
OPT_BOOLEAN('v', "verbose", &verbose,
OPT_INCR('v', "verbose", &verbose,
"be more verbose (show parsed arguments, etc)"),
OPT_BOOLEAN('l', "list", &params.list_events,
"list up current probe events"),
Expand Down
24 changes: 12 additions & 12 deletions trunk/tools/perf/builtin-record.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,22 @@ static int output;
static const char *output_name = "perf.data";
static int group = 0;
static unsigned int realtime_prio = 0;
static int raw_samples = 0;
static int system_wide = 0;
static bool raw_samples = false;
static bool system_wide = false;
static int profile_cpu = -1;
static pid_t target_pid = -1;
static pid_t target_tid = -1;
static pid_t *all_tids = NULL;
static int thread_num = 0;
static pid_t child_pid = -1;
static int inherit = 1;
static int force = 0;
static int append_file = 0;
static int call_graph = 0;
static int inherit_stat = 0;
static int no_samples = 0;
static int sample_address = 0;
static int multiplex = 0;
static bool inherit = true;
static bool force = false;
static bool append_file = false;
static bool call_graph = false;
static bool inherit_stat = false;
static bool no_samples = false;
static bool sample_address = false;
static bool multiplex = false;
static int multiplex_fd = -1;

static long samples = 0;
Expand Down Expand Up @@ -465,7 +465,7 @@ static int __cmd_record(int argc, const char **argv)
rename(output_name, oldname);
}
} else {
append_file = 0;
append_file = false;
}

flags = O_CREAT|O_RDWR;
Expand Down Expand Up @@ -701,7 +701,7 @@ static const struct option options[] = {
"number of mmap data pages"),
OPT_BOOLEAN('g', "call-graph", &call_graph,
"do call-graph (stack chain/backtrace) recording"),
OPT_BOOLEAN('v', "verbose", &verbose,
OPT_INCR('v', "verbose", &verbose,
"be more verbose (show counter open errors, etc)"),
OPT_BOOLEAN('s', "stat", &inherit_stat,
"per thread counts"),
Expand Down
6 changes: 3 additions & 3 deletions trunk/tools/perf/builtin-report.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@

static char const *input_name = "perf.data";

static int force;
static bool force;
static bool hide_unresolved;
static bool dont_use_callchains;

static int show_threads;
static bool show_threads;
static struct perf_read_values show_threads_values;

static char default_pretty_printing_style[] = "normal";
Expand Down Expand Up @@ -418,7 +418,7 @@ static const char * const report_usage[] = {
static const struct option options[] = {
OPT_STRING('i', "input", &input_name, "file",
"input file name"),
OPT_BOOLEAN('v', "verbose", &verbose,
OPT_INCR('v', "verbose", &verbose,
"be more verbose (show symbol address, etc)"),
OPT_BOOLEAN('D', "dump-raw-trace", &dump_trace,
"dump raw trace in ASCII"),
Expand Down
6 changes: 3 additions & 3 deletions trunk/tools/perf/builtin-sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -1790,7 +1790,7 @@ static const char * const sched_usage[] = {
static const struct option sched_options[] = {
OPT_STRING('i', "input", &input_name, "file",
"input file name"),
OPT_BOOLEAN('v', "verbose", &verbose,
OPT_INCR('v', "verbose", &verbose,
"be more verbose (show symbol address, etc)"),
OPT_BOOLEAN('D', "dump-raw-trace", &dump_trace,
"dump raw trace in ASCII"),
Expand All @@ -1805,7 +1805,7 @@ static const char * const latency_usage[] = {
static const struct option latency_options[] = {
OPT_STRING('s', "sort", &sort_order, "key[,key2...]",
"sort by key(s): runtime, switch, avg, max"),
OPT_BOOLEAN('v', "verbose", &verbose,
OPT_INCR('v', "verbose", &verbose,
"be more verbose (show symbol address, etc)"),
OPT_INTEGER('C', "CPU", &profile_cpu,
"CPU to profile on"),
Expand All @@ -1822,7 +1822,7 @@ static const char * const replay_usage[] = {
static const struct option replay_options[] = {
OPT_INTEGER('r', "repeat", &replay_repeat,
"repeat the workload replay N times (-1: infinite)"),
OPT_BOOLEAN('v', "verbose", &verbose,
OPT_INCR('v', "verbose", &verbose,
"be more verbose (show symbol address, etc)"),
OPT_BOOLEAN('D', "dump-raw-trace", &dump_trace,
"dump raw trace in ASCII"),
Expand Down
10 changes: 5 additions & 5 deletions trunk/tools/perf/builtin-stat.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,19 @@ static struct perf_event_attr default_attrs[] = {

};

static int system_wide = 0;
static bool system_wide = false;
static unsigned int nr_cpus = 0;
static int run_idx = 0;

static int run_count = 1;
static int inherit = 1;
static int scale = 1;
static bool inherit = true;
static bool scale = true;
static pid_t target_pid = -1;
static pid_t target_tid = -1;
static pid_t *all_tids = NULL;
static int thread_num = 0;
static pid_t child_pid = -1;
static int null_run = 0;
static bool null_run = false;

static int *fd[MAX_NR_CPUS][MAX_COUNTERS];

Expand Down Expand Up @@ -528,7 +528,7 @@ static const struct option options[] = {
"system-wide collection from all CPUs"),
OPT_BOOLEAN('c', "scale", &scale,
"scale/normalize counters"),
OPT_BOOLEAN('v', "verbose", &verbose,
OPT_INCR('v', "verbose", &verbose,
"be more verbose (show counter open errors, etc)"),
OPT_INTEGER('r', "repeat", &run_count,
"repeat command and print average + stddev (max: 100)"),
Expand Down
2 changes: 1 addition & 1 deletion trunk/tools/perf/builtin-timechart.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ static u64 turbo_frequency;

static u64 first_time, last_time;

static int power_only;
static bool power_only;


struct per_pid;
Expand Down
14 changes: 7 additions & 7 deletions trunk/tools/perf/builtin-top.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@

static int *fd[MAX_NR_CPUS][MAX_COUNTERS];

static int system_wide = 0;
static bool system_wide = false;

static int default_interval = 0;

Expand All @@ -68,18 +68,18 @@ static int target_pid = -1;
static int target_tid = -1;
static pid_t *all_tids = NULL;
static int thread_num = 0;
static int inherit = 0;
static bool inherit = false;
static int profile_cpu = -1;
static int nr_cpus = 0;
static unsigned int realtime_prio = 0;
static int group = 0;
static bool group = false;
static unsigned int page_size;
static unsigned int mmap_pages = 16;
static int freq = 1000; /* 1 KHz */

static int delay_secs = 2;
static int zero = 0;
static int dump_symtab = 0;
static bool zero = false;
static bool dump_symtab = false;

static bool hide_kernel_symbols = false;
static bool hide_user_symbols = false;
Expand Down Expand Up @@ -854,7 +854,7 @@ static void handle_keypress(int c)
display_weighted = ~display_weighted;
break;
case 'z':
zero = ~zero;
zero = !zero;
break;
default:
break;
Expand Down Expand Up @@ -1335,7 +1335,7 @@ static const struct option options[] = {
"display this many functions"),
OPT_BOOLEAN('U', "hide_user_symbols", &hide_user_symbols,
"hide user symbols"),
OPT_BOOLEAN('v', "verbose", &verbose,
OPT_INCR('v', "verbose", &verbose,
"be more verbose (show counter open errors, etc)"),
OPT_END()
};
Expand Down
2 changes: 1 addition & 1 deletion trunk/tools/perf/builtin-trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ static const char * const trace_usage[] = {
static const struct option options[] = {
OPT_BOOLEAN('D', "dump-raw-trace", &dump_trace,
"dump raw trace in ASCII"),
OPT_BOOLEAN('v', "verbose", &verbose,
OPT_INCR('v', "verbose", &verbose,
"be more verbose (show symbol address, etc)"),
OPT_BOOLEAN('L', "Latency", &latency_format,
"show latency attributes (irqs/preemption disabled, etc)"),
Expand Down
2 changes: 1 addition & 1 deletion trunk/tools/perf/util/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "util.h"

int verbose = 0;
int dump_trace = 0;
bool dump_trace = false;

int eprintf(int level, const char *fmt, ...)
{
Expand Down
3 changes: 2 additions & 1 deletion trunk/tools/perf/util/debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
#ifndef __PERF_DEBUG_H
#define __PERF_DEBUG_H

#include <stdbool.h>
#include "event.h"

extern int verbose;
extern int dump_trace;
extern bool dump_trace;

int dump_printf(const char *fmt, ...) __attribute__((format(printf, 1, 2)));
void trace_event(event_t *event);
Expand Down
6 changes: 6 additions & 0 deletions trunk/tools/perf/util/parse-options.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ static int get_value(struct parse_opt_ctx_t *p,
break;
/* FALLTHROUGH */
case OPTION_BOOLEAN:
case OPTION_INCR:
case OPTION_BIT:
case OPTION_SET_INT:
case OPTION_SET_PTR:
Expand All @@ -73,6 +74,10 @@ static int get_value(struct parse_opt_ctx_t *p,
return 0;

case OPTION_BOOLEAN:
*(bool *)opt->value = unset ? false : true;
return 0;

case OPTION_INCR:
*(int *)opt->value = unset ? 0 : *(int *)opt->value + 1;
return 0;

Expand Down Expand Up @@ -478,6 +483,7 @@ int usage_with_options_internal(const char * const *usagestr,
case OPTION_GROUP:
case OPTION_BIT:
case OPTION_BOOLEAN:
case OPTION_INCR:
case OPTION_SET_INT:
case OPTION_SET_PTR:
case OPTION_LONG:
Expand Down
4 changes: 3 additions & 1 deletion trunk/tools/perf/util/parse-options.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ enum parse_opt_type {
OPTION_GROUP,
/* options with no arguments */
OPTION_BIT,
OPTION_BOOLEAN, /* _INCR would have been a better name */
OPTION_BOOLEAN,
OPTION_INCR,
OPTION_SET_INT,
OPTION_SET_PTR,
/* options with arguments (usually) */
Expand Down Expand Up @@ -95,6 +96,7 @@ struct option {
#define OPT_GROUP(h) { .type = OPTION_GROUP, .help = (h) }
#define OPT_BIT(s, l, v, h, b) { .type = OPTION_BIT, .short_name = (s), .long_name = (l), .value = (v), .help = (h), .defval = (b) }
#define OPT_BOOLEAN(s, l, v, h) { .type = OPTION_BOOLEAN, .short_name = (s), .long_name = (l), .value = (v), .help = (h) }
#define OPT_INCR(s, l, v, h) { .type = OPTION_INCR, .short_name = (s), .long_name = (l), .value = (v), .help = (h) }
#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) }
#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) }
#define OPT_INTEGER(s, l, v, h) { .type = OPTION_INTEGER, .short_name = (s), .long_name = (l), .value = (v), .help = (h) }
Expand Down
2 changes: 1 addition & 1 deletion trunk/tools/perf/util/trace-event-parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ int header_page_overwrite_size;
int header_page_data_offset;
int header_page_data_size;

int latency_format;
bool latency_format;

static char *input_buf;
static unsigned long long input_buf_ptr;
Expand Down
Loading

0 comments on commit be2a668

Please sign in to comment.