@@ -1364,6 +1364,7 @@ static int record__open(struct record *rec)
struct perf_session *session = rec->session;
struct record_opts *opts = &rec->opts;
int rc = 0;
+ bool skipped = false;
evlist__for_each_entry(evlist, pos) {
try_again:
@@ -1379,15 +1380,26 @@ static int record__open(struct record *rec)
pos = evlist__reset_weak_group(evlist, pos, true);
goto try_again;
}
- rc = -errno;
evsel__open_strerror(pos, &opts->target, errno, msg, sizeof(msg));
- ui__error("%s\n", msg);
- goto out;
+ ui__error("Failure to open event '%s' on PMU '%s' which will be removed.\n%s\n",
+ evsel__name(pos), evsel__pmu_name(pos), msg);
+ pos->skippable = true;
+ skipped = true;
+ } else {
+ pos->supported = true;
}
-
- pos->supported = true;
}
+ if (skipped) {
+ struct evsel *tmp;
+ int idx = 0;
+
+ evlist__for_each_entry_safe(evlist, tmp, pos) {
+ if (pos->skippable)
+ evlist__remove(evlist, pos);
+ pos->core.idx = idx++;
+ }
+ }
if (symbol_conf.kptr_restrict && !evlist__exclude_kernel(evlist)) {
pr_warning(
"WARNING: Kernel address maps (/proc/{kallsyms,modules}) are restricted,\n"