Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 321417
b: refs/heads/master
c: 56e6f60
h: refs/heads/master
i:
  321415: c7f81a0
v: v3
  • Loading branch information
David Ahern authored and Arnaldo Carvalho de Melo committed Aug 3, 2012
1 parent 4542a94 commit 7a2dc0e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 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: 1a31fc904f1c897e4aaf7c3176e6aafa49f5d395
refs/heads/master: 56e6f602aa4432f7fe90a0d9ba379b2735b07b6b
2 changes: 0 additions & 2 deletions trunk/tools/perf/builtin-record.c
Original file line number Diff line number Diff line change
Expand Up @@ -844,8 +844,6 @@ int cmd_record(int argc, const char **argv, const char *prefix __used)
struct perf_record *rec = &record;
char errbuf[BUFSIZ];

perf_header__set_cmdline(argc, argv);

evsel_list = perf_evlist__new(NULL, NULL);
if (evsel_list == NULL)
return -ENOMEM;
Expand Down
9 changes: 9 additions & 0 deletions trunk/tools/perf/util/header.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,15 @@ perf_header__set_cmdline(int argc, const char **argv)
{
int i;

/*
* If header_argv has already been set, do not override it.
* This allows a command to set the cmdline, parse args and
* then call another builtin function that implements a
* command -- e.g, cmd_kvm calling cmd_record.
*/
if (header_argv)
return 0;

header_argc = (u32)argc;

/* do not include NULL termination */
Expand Down
3 changes: 3 additions & 0 deletions trunk/tools/perf/util/parse-options.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "util.h"
#include "parse-options.h"
#include "cache.h"
#include "header.h"

#define OPT_SHORT 1
#define OPT_UNSET 2
Expand Down Expand Up @@ -413,6 +414,8 @@ int parse_options(int argc, const char **argv, const struct option *options,
{
struct parse_opt_ctx_t ctx;

perf_header__set_cmdline(argc, argv);

parse_options_start(&ctx, argc, argv, flags);
switch (parse_options_step(&ctx, options, usagestr)) {
case PARSE_OPT_HELP:
Expand Down

0 comments on commit 7a2dc0e

Please sign in to comment.