X-Git-Url: http://git.samba.org/samba.git/?a=blobdiff_plain;f=tools%2Fperf%2Fperf.c;h=2282d41879a2b2ef0c1927f91856c21948e68f30;hb=19d402c1e75077e2bcfe17f7fe5bcfc8deb74991;hp=78f7b920e5483a1982dd4d164588b689e1b29e6d;hpb=4ed2ad38b3b4c45a5a5999454b02d3c21e75af5a;p=sfrench%2Fcifs-2.6.git diff --git a/tools/perf/perf.c b/tools/perf/perf.c index 78f7b920e548..2282d41879a2 100644 --- a/tools/perf/perf.c +++ b/tools/perf/perf.c @@ -13,11 +13,12 @@ #include "util/quote.h" #include "util/run-command.h" #include "util/parse-events.h" +#include "util/debug.h" #include #include const char perf_usage_string[] = - "perf [--version] [--help] COMMAND [ARGS]"; + "perf [--version] [--help] [OPTIONS] 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); @@ -458,6 +469,7 @@ int main(int argc, const char **argv) /* The page_size is placed in util object. */ page_size = sysconf(_SC_PAGE_SIZE); + cacheline_size = sysconf(_SC_LEVEL1_DCACHE_LINESIZE); cmd = perf_extract_argv0_path(argv[0]); if (!cmd)