Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qbenchmarkmetric.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// Copyright (C) 2016 Intel Corporation.
3// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
4
5#include <QtTest/private/qbenchmarkmetric_p.h>
6
8
9namespace QTest {
10
12 int metric;
13 const char * name;
14 const char * unit;
15};
16
17static const QBenchmarkMetricKey entries[] = {
18 { FramesPerSecond, "FramesPerSecond", "fps" },
19 { BitsPerSecond, "BitsPerSecond", "bits/s" },
20 { BytesPerSecond, "BytesPerSecond", "bytes/s" },
21 { WalltimeMilliseconds, "WalltimeMilliseconds", "msecs" },
22 { CPUTicks, "CPUTicks", "CPU ticks" },
23 { InstructionReads, "InstructionReads", "instruction reads" },
24 { Events, "Events", "events" },
25 { WalltimeNanoseconds, "WalltimeNanoseconds", "nsecs" },
26 { BytesAllocated, "BytesAllocated", "bytes" },
27 { CPUMigrations, "CPUMigrations", "CPU migrations" },
28 { CPUCycles, "CPUCycles", "CPU cycles" },
29 { BusCycles, "BusCycles", "bus cycles" },
30 { StalledCycles, "StalledCycles", "stalled cycles" },
31 { Instructions, "Instructions", "instructions" },
32 { BranchInstructions, "BranchInstructions", "branch instructions" },
33 { BranchMisses, "BranchMisses", "branch misses" },
34 { CacheReferences, "CacheReferences", "cache references" },
35 { CacheReads, "CacheReads", "cache loads" },
36 { CacheWrites, "CacheWrites", "cache stores" },
37 { CachePrefetches, "CachePrefetches", "cache prefetches" },
38 { CacheMisses, "CacheMisses", "cache misses" },
39 { CacheReadMisses, "CacheReadMisses", "cache load misses" },
40 { CacheWriteMisses, "CacheWriteMisses", "cache store misses" },
41 { CachePrefetchMisses, "CachePrefetchMisses", "cache prefetch misses" },
42 { ContextSwitches, "ContextSwitches", "context switches" },
43 { PageFaults, "PageFaults", "page faults" },
44 { MinorPageFaults, "MinorPageFaults", "minor page faults" },
45 { MajorPageFaults, "MajorPageFaults", "major page faults" },
46 { AlignmentFaults, "AlignmentFaults", "alignment faults" },
47 { EmulationFaults, "EmulationFaults", "emulation faults" },
48 { RefCPUCycles, "RefCPUCycles", "Reference CPU cycles" },
49};
50static const int NumEntries = sizeof(entries) / sizeof(entries[0]);
51
52}
53
105{
106 if (unsigned(metric) < unsigned(QTest::NumEntries))
107 return entries[metric].name;
108
109 return "";
110}
111
117{
118 if (unsigned(metric) < unsigned(QTest::NumEntries))
119 return entries[metric].unit;
120
121 return "";
122}
123
Combined button and popup list for selecting options.
static const QBenchmarkMetricKey entries[]
const char * benchmarkMetricName(QBenchmarkMetric metric)
const char * benchmarkMetricUnit(QBenchmarkMetric metric)
static const int NumEntries
@ WalltimeNanoseconds
@ CachePrefetchMisses
@ WalltimeMilliseconds
@ BranchInstructions