]> Pileus Git - ~andy/linux/blobdiff - tools/perf/builtin-record.c
Merge branch 'next' of git://git.monstr.eu/linux-2.6-microblaze
[~andy/linux] / tools / perf / builtin-record.c
index de76008fbaa2d31c21710476b75e57d56112de90..89a5ddcd1ded753e6835c39935989d4c96ac2fdd 100644 (file)
@@ -34,6 +34,7 @@ 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 int                     profile_cpu                     = -1;
 static pid_t                   target_pid                      = -1;
@@ -218,7 +219,7 @@ static pid_t pid_synthesize_comm_event(pid_t pid, int full)
        snprintf(filename, sizeof(filename), "/proc/%d/status", pid);
 
        fp = fopen(filename, "r");
-       if (fd == NULL) {
+       if (fp == NULL) {
                /*
                 * We raced with a task exiting - just return:
                 */
@@ -398,7 +399,7 @@ static void create_counter(int counter, int cpu, pid_t pid)
                                  PERF_FORMAT_TOTAL_TIME_RUNNING |
                                  PERF_FORMAT_ID;
 
-       attr->sample_type       = PERF_SAMPLE_IP | PERF_SAMPLE_TID;
+       attr->sample_type       |= PERF_SAMPLE_IP | PERF_SAMPLE_TID;
 
        if (freq) {
                attr->sample_type       |= PERF_SAMPLE_PERIOD;
@@ -418,6 +419,8 @@ static void create_counter(int counter, int cpu, pid_t pid)
        if (call_graph)
                attr->sample_type       |= PERF_SAMPLE_CALLCHAIN;
 
+       if (raw_samples)
+               attr->sample_type       |= PERF_SAMPLE_RAW;
 
        attr->mmap              = track;
        attr->comm              = track;
@@ -650,6 +653,8 @@ static const struct option options[] = {
                    "record events on existing pid"),
        OPT_INTEGER('r', "realtime", &realtime_prio,
                    "collect data with this RT SCHED_FIFO priority"),
+       OPT_BOOLEAN('R', "raw-samples", &raw_samples,
+                   "collect raw sample records from all opened counters"),
        OPT_BOOLEAN('a', "all-cpus", &system_wide,
                            "system-wide collection from all CPUs"),
        OPT_BOOLEAN('A', "append", &append_file,