Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 156737
b: refs/heads/master
c: 0a5ac84
h: refs/heads/master
i:
  156735: af7a226
v: v3
  • Loading branch information
Jens Axboe authored and Ingo Molnar committed Aug 12, 2009
1 parent 7c2e78b commit 0aa6946
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 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: 1340e6bbaff7ff7f6f75eb4a5c34933efce84a84
refs/heads/master: 0a5ac84650fb7a7f226814103d95724e34b012ae
17 changes: 14 additions & 3 deletions trunk/tools/perf/builtin-record.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ static const char *output_name = "perf.data";
static int group = 0;
static unsigned int realtime_prio = 0;
static int system_wide = 0;
static int profile_cpu = -1;
static pid_t target_pid = -1;
static int inherit = 1;
static int force = 0;
Expand Down Expand Up @@ -431,6 +432,8 @@ static void create_counter(int counter, int cpu, pid_t pid)

if (err == EPERM)
die("Permission error - are you root?\n");
else if (err == ENODEV && profile_cpu != -1)
die("No such device - did you specify an out-of-range profile CPU?\n");

/*
* If it's cycles then fall back to hrtimer
Expand Down Expand Up @@ -564,9 +567,15 @@ static int __cmd_record(int argc, const char **argv)
if (pid == -1)
pid = getpid();

open_counters(-1, pid);
} else for (i = 0; i < nr_cpus; i++)
open_counters(i, target_pid);
open_counters(profile_cpu, pid);
} else {
if (profile_cpu != -1) {
open_counters(profile_cpu, target_pid);
} else {
for (i = 0; i < nr_cpus; i++)
open_counters(i, target_pid);
}
}

if (file_new)
perf_header__write(header, output);
Expand Down Expand Up @@ -645,6 +654,8 @@ static const struct option options[] = {
"system-wide collection from all CPUs"),
OPT_BOOLEAN('A', "append", &append_file,
"append to the output file to do incremental profiling"),
OPT_INTEGER('C', "profile_cpu", &profile_cpu,
"CPU to profile on"),
OPT_BOOLEAN('f', "force", &force,
"overwrite existing data file"),
OPT_LONG('c', "count", &default_interval,
Expand Down

0 comments on commit 0aa6946

Please sign in to comment.