diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2022-10-21 10:43:34 -0700 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2022-10-25 15:13:57 -0700 |
commit | 209adad078d5411cf7a0bfd6ddce8199570ea1bb (patch) | |
tree | bc37a2ff318b205fe9fb36987ef5a2c05419d6d3 /src/testlib | |
parent | e1089e0520482e62336a8d6efa40e064fd9796d8 (diff) |
QBenchlib/Perf: remove the handling of attributes in -perfcounter
I don't think I understood what this does when I coded it. It wasn't
needed with the Linux kernels of the era.
[ChangeLog][QtTest] Specifying attributes with the -perfcounter command-
line option for Linux performance counters is deprecated. QtTest will
ignore the colon and any attributes listed there, though future versions
of QtTest may reintroduce attributes if needed.
Change-Id: I3c79b7e08fa346988dfefffd17202684fc2cf650
Reviewed-by: David Faure <david.faure@kdab.com>
Diffstat (limited to 'src/testlib')
-rw-r--r-- | src/testlib/qbenchmarkperfevents.cpp | 35 |
1 files changed, 4 insertions, 31 deletions
diff --git a/src/testlib/qbenchmarkperfevents.cpp b/src/testlib/qbenchmarkperfevents.cpp index a284b86846..72318006c2 100644 --- a/src/testlib/qbenchmarkperfevents.cpp +++ b/src/testlib/qbenchmarkperfevents.cpp @@ -412,31 +412,12 @@ void QBenchmarkPerfEventsMeasurer::setCounter(const char *name) attr.type = ptr->type; attr.config = ptr->event_id; - // now parse the attributes + // We used to support attributes, but our code was the opposite of what + // perf(1) does, plus QBenchlib isn't exactly expected to be used to + // profile Linux kernel code or launch guest VMs as part of the workload. + // So we keep accepting the colon as a delimiter but ignore it. if (!colon) return; - while (*++colon) { - switch (*colon) { - case 'u': - attr.exclude_user = true; - break; - case 'k': - attr.exclude_kernel = true; - break; - case 'h': - attr.exclude_hv = true; - break; - case 'G': - attr.exclude_guest = true; - break; - case 'H': - attr.exclude_host = true; - break; - default: - fprintf(stderr, "ERROR: Unknown attribute '%c'\n", *colon); - exit(1); - } - } } void QBenchmarkPerfEventsMeasurer::listCounters() @@ -454,14 +435,6 @@ void QBenchmarkPerfEventsMeasurer::listCounters() ptr->type == PERF_TYPE_SOFTWARE ? "software" : ptr->type == PERF_TYPE_HW_CACHE ? "cache" : "other"); } - - printf("\nAttributes can be specified by adding a colon and the following:\n" - " u - exclude measuring in the userspace\n" - " k - exclude measuring in kernel mode\n" - " h - exclude measuring in the hypervisor\n" - " G - exclude measuring when running virtualized (guest VM)\n" - " H - exclude measuring when running non-virtualized (host system)\n" - "Attributes can be combined, for example: -perfcounter branch-mispredicts:kh\n"); } QBenchmarkPerfEventsMeasurer::QBenchmarkPerfEventsMeasurer() = default; |