tools: rename bitmap_alloc() to bitmap_zalloc()
[linux-2.6-microblaze.git] / tools / perf / builtin-record.c
index 71efe65..f1b30ac 100644 (file)
@@ -891,11 +891,12 @@ static int record__open(struct record *rec)
        int rc = 0;
 
        /*
-        * For initial_delay or system wide, we need to add a dummy event so
-        * that we can track PERF_RECORD_MMAP to cover the delay of waiting or
-        * event synthesis.
+        * For initial_delay, system wide or a hybrid system, we need to add a
+        * dummy event so that we can track PERF_RECORD_MMAP to cover the delay
+        * of waiting or event synthesis.
         */
-       if (opts->initial_delay || target__has_cpu(&opts->target)) {
+       if (opts->initial_delay || target__has_cpu(&opts->target) ||
+           perf_pmu__has_hybrid()) {
                pos = evlist__get_tracking_event(evlist);
                if (!evsel__is_dummy_event(pos)) {
                        /* Set up dummy event. */
@@ -926,7 +927,7 @@ try_again:
                                goto try_again;
                        }
                        if ((errno == EINVAL || errno == EBADF) &&
-                           pos->leader != pos &&
+                           pos->core.leader != &pos->core &&
                            pos->weak_group) {
                                pos = evlist__reset_weak_group(evlist, pos, true);
                                goto try_again;
@@ -1776,7 +1777,7 @@ static int __cmd_record(struct record *rec, int argc, const char **argv)
                rec->tool.ordered_events = false;
        }
 
-       if (!rec->evlist->nr_groups)
+       if (!rec->evlist->core.nr_groups)
                perf_header__clear_feat(&session->header, HEADER_GROUP_DESC);
 
        if (data->is_pipe) {
@@ -2785,7 +2786,7 @@ int cmd_record(int argc, const char **argv)
 
        if (rec->opts.affinity != PERF_AFFINITY_SYS) {
                rec->affinity_mask.nbits = cpu__max_cpu();
-               rec->affinity_mask.bits = bitmap_alloc(rec->affinity_mask.nbits);
+               rec->affinity_mask.bits = bitmap_zalloc(rec->affinity_mask.nbits);
                if (!rec->affinity_mask.bits) {
                        pr_err("Failed to allocate thread mask for %zd cpus\n", rec->affinity_mask.nbits);
                        err = -ENOMEM;