Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 349909
b: refs/heads/master
c: c5ff78c
h: refs/heads/master
i:
  349907: 263e9e5
v: v3
  • Loading branch information
Arnaldo Carvalho de Melo committed Dec 11, 2012
1 parent 290d018 commit 68bb75d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 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: c79a439338f3a021f5a5ff6ea165b0d19d2eb0aa
refs/heads/master: c5ff78c3092d0e7d14c82d2949e16fee063a83f1
24 changes: 11 additions & 13 deletions trunk/tools/perf/builtin-record.c
Original file line number Diff line number Diff line change
Expand Up @@ -868,11 +868,9 @@ static int get_stack_size(char *str, unsigned long *_size)
}
#endif /* LIBUNWIND_SUPPORT */

static int
parse_callchain_opt(const struct option *opt __maybe_unused, const char *arg,
int unset)
static int parse_callchain_opt(const struct option *opt, const char *arg, int unset)
{
struct perf_record *rec = (struct perf_record *)opt->value;
struct perf_record_opts *opts = opt->value;
char *tok, *name, *saveptr = NULL;
char *buf;
int ret = -1;
Expand All @@ -898,7 +896,7 @@ parse_callchain_opt(const struct option *opt __maybe_unused, const char *arg,
/* Framepointer style */
if (!strncmp(name, "fp", sizeof("fp"))) {
if (!strtok_r(NULL, ",", &saveptr)) {
rec->opts.call_graph = CALLCHAIN_FP;
opts->call_graph = CALLCHAIN_FP;
ret = 0;
} else
pr_err("callchain: No more arguments "
Expand All @@ -911,20 +909,20 @@ parse_callchain_opt(const struct option *opt __maybe_unused, const char *arg,
const unsigned long default_stack_dump_size = 8192;

ret = 0;
rec->opts.call_graph = CALLCHAIN_DWARF;
rec->opts.stack_dump_size = default_stack_dump_size;
opts->call_graph = CALLCHAIN_DWARF;
opts->stack_dump_size = default_stack_dump_size;

tok = strtok_r(NULL, ",", &saveptr);
if (tok) {
unsigned long size = 0;

ret = get_stack_size(tok, &size);
rec->opts.stack_dump_size = size;
opts->stack_dump_size = size;
}

if (!ret)
pr_debug("callchain: stack dump size %d\n",
rec->opts.stack_dump_size);
opts->stack_dump_size);
#endif /* LIBUNWIND_SUPPORT */
} else {
pr_err("callchain: Unknown -g option "
Expand All @@ -937,7 +935,7 @@ parse_callchain_opt(const struct option *opt __maybe_unused, const char *arg,
free(buf);

if (!ret)
pr_debug("callchain: type %d\n", rec->opts.call_graph);
pr_debug("callchain: type %d\n", opts->call_graph);

return ret;
}
Expand Down Expand Up @@ -1021,9 +1019,9 @@ const struct option record_options[] = {
"number of mmap data pages"),
OPT_BOOLEAN(0, "group", &record.opts.group,
"put the counters into a counter group"),
OPT_CALLBACK_DEFAULT('g', "call-graph", &record, "mode[,dump_size]",
callchain_help, &parse_callchain_opt,
"fp"),
OPT_CALLBACK_DEFAULT('g', "call-graph", &record.opts,
"mode[,dump_size]", callchain_help,
&parse_callchain_opt, "fp"),
OPT_INCR('v', "verbose", &verbose,
"be more verbose (show counter open errors, etc)"),
OPT_BOOLEAN('q', "quiet", &quiet, "don't print any message"),
Expand Down

0 comments on commit 68bb75d

Please sign in to comment.