diff options
-rw-r--r-- | tools/perf/util/evsel.c | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index 9b2e3e624efe..1d8f2bbd38a7 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c | |||
@@ -1389,8 +1389,11 @@ fallback_missing_features: | |||
1389 | if (perf_missing_features.lbr_flags) | 1389 | if (perf_missing_features.lbr_flags) |
1390 | evsel->attr.branch_sample_type &= ~(PERF_SAMPLE_BRANCH_NO_FLAGS | | 1390 | evsel->attr.branch_sample_type &= ~(PERF_SAMPLE_BRANCH_NO_FLAGS | |
1391 | PERF_SAMPLE_BRANCH_NO_CYCLES); | 1391 | PERF_SAMPLE_BRANCH_NO_CYCLES); |
1392 | if (perf_missing_features.write_backward) | 1392 | if (perf_missing_features.write_backward) { |
1393 | if (evsel->overwrite) | ||
1394 | return -EINVAL; | ||
1393 | evsel->attr.write_backward = false; | 1395 | evsel->attr.write_backward = false; |
1396 | } | ||
1394 | retry_sample_id: | 1397 | retry_sample_id: |
1395 | if (perf_missing_features.sample_id_all) | 1398 | if (perf_missing_features.sample_id_all) |
1396 | evsel->attr.sample_id_all = 0; | 1399 | evsel->attr.sample_id_all = 0; |
@@ -1453,12 +1456,6 @@ retry_open: | |||
1453 | err = -EINVAL; | 1456 | err = -EINVAL; |
1454 | goto out_close; | 1457 | goto out_close; |
1455 | } | 1458 | } |
1456 | |||
1457 | if (evsel->overwrite && | ||
1458 | perf_missing_features.write_backward) { | ||
1459 | err = -EINVAL; | ||
1460 | goto out_close; | ||
1461 | } | ||
1462 | } | 1459 | } |
1463 | } | 1460 | } |
1464 | 1461 | ||
@@ -1496,7 +1493,10 @@ try_fallback: | |||
1496 | * Must probe features in the order they were added to the | 1493 | * Must probe features in the order they were added to the |
1497 | * perf_event_attr interface. | 1494 | * perf_event_attr interface. |
1498 | */ | 1495 | */ |
1499 | if (!perf_missing_features.clockid_wrong && evsel->attr.use_clockid) { | 1496 | if (!perf_missing_features.write_backward && evsel->attr.write_backward) { |
1497 | perf_missing_features.write_backward = true; | ||
1498 | goto fallback_missing_features; | ||
1499 | } else if (!perf_missing_features.clockid_wrong && evsel->attr.use_clockid) { | ||
1500 | perf_missing_features.clockid_wrong = true; | 1500 | perf_missing_features.clockid_wrong = true; |
1501 | goto fallback_missing_features; | 1501 | goto fallback_missing_features; |
1502 | } else if (!perf_missing_features.clockid && evsel->attr.use_clockid) { | 1502 | } else if (!perf_missing_features.clockid && evsel->attr.use_clockid) { |
@@ -1521,12 +1521,7 @@ try_fallback: | |||
1521 | PERF_SAMPLE_BRANCH_NO_FLAGS))) { | 1521 | PERF_SAMPLE_BRANCH_NO_FLAGS))) { |
1522 | perf_missing_features.lbr_flags = true; | 1522 | perf_missing_features.lbr_flags = true; |
1523 | goto fallback_missing_features; | 1523 | goto fallback_missing_features; |
1524 | } else if (!perf_missing_features.write_backward && | ||
1525 | evsel->attr.write_backward) { | ||
1526 | perf_missing_features.write_backward = true; | ||
1527 | goto fallback_missing_features; | ||
1528 | } | 1524 | } |
1529 | |||
1530 | out_close: | 1525 | out_close: |
1531 | do { | 1526 | do { |
1532 | while (--thread >= 0) { | 1527 | while (--thread >= 0) { |
@@ -2409,6 +2404,8 @@ int perf_evsel__open_strerror(struct perf_evsel *evsel, struct target *target, | |||
2409 | "We found oprofile daemon running, please stop it and try again."); | 2404 | "We found oprofile daemon running, please stop it and try again."); |
2410 | break; | 2405 | break; |
2411 | case EINVAL: | 2406 | case EINVAL: |
2407 | if (evsel->overwrite && perf_missing_features.write_backward) | ||
2408 | return scnprintf(msg, size, "Reading from overwrite event is not supported by this kernel."); | ||
2412 | if (perf_missing_features.clockid) | 2409 | if (perf_missing_features.clockid) |
2413 | return scnprintf(msg, size, "clockid feature not supported."); | 2410 | return scnprintf(msg, size, "clockid feature not supported."); |
2414 | if (perf_missing_features.clockid_wrong) | 2411 | if (perf_missing_features.clockid_wrong) |