2013-04-11 20:07:18 +04:00
|
|
|
util-obj-y = osdep.o cutils.o unicode.o qemu-timer-common.o
|
2016-08-29 21:46:12 +03:00
|
|
|
util-obj-y += bufferiszero.o
|
2017-01-12 21:07:52 +03:00
|
|
|
util-obj-y += lockcnt.o
|
2018-02-16 19:50:12 +03:00
|
|
|
util-obj-y += aiocb.o async.o aio-wait.o thread-pool.o qemu-timer.o
|
2019-07-12 20:34:35 +03:00
|
|
|
util-obj-y += main-loop.o
|
2018-09-11 02:27:42 +03:00
|
|
|
util-obj-$(call lnot,$(CONFIG_ATOMIC64)) += atomic64.o
|
2017-02-13 16:52:18 +03:00
|
|
|
util-obj-$(CONFIG_POSIX) += aio-posix.o
|
2020-03-05 20:08:02 +03:00
|
|
|
util-obj-$(CONFIG_POSIX) += fdmon-poll.o
|
|
|
|
util-obj-$(CONFIG_EPOLL_CREATE1) += fdmon-epoll.o
|
2020-03-05 20:08:04 +03:00
|
|
|
util-obj-$(CONFIG_LINUX_IO_URING) += fdmon-io_uring.o
|
2015-10-09 18:17:18 +03:00
|
|
|
util-obj-$(CONFIG_POSIX) += compatfd.o
|
|
|
|
util-obj-$(CONFIG_POSIX) += event_notifier-posix.o
|
2015-09-24 14:41:17 +03:00
|
|
|
util-obj-$(CONFIG_POSIX) += mmap-alloc.o
|
2015-10-09 18:17:18 +03:00
|
|
|
util-obj-$(CONFIG_POSIX) += oslib-posix.o
|
|
|
|
util-obj-$(CONFIG_POSIX) += qemu-openpty.o
|
|
|
|
util-obj-$(CONFIG_POSIX) += qemu-thread-posix.o
|
2015-10-09 18:17:19 +03:00
|
|
|
util-obj-$(CONFIG_POSIX) += memfd.o
|
2017-02-13 16:52:18 +03:00
|
|
|
util-obj-$(CONFIG_WIN32) += aio-win32.o
|
|
|
|
util-obj-$(CONFIG_WIN32) += event_notifier-win32.o
|
2015-10-09 18:17:18 +03:00
|
|
|
util-obj-$(CONFIG_WIN32) += oslib-win32.o
|
|
|
|
util-obj-$(CONFIG_WIN32) += qemu-thread-win32.o
|
2014-09-03 07:44:56 +04:00
|
|
|
util-obj-y += envlist.o path.o module.o
|
2017-01-10 05:10:08 +03:00
|
|
|
util-obj-y += host-utils.o
|
add hierarchical bitmap data type and test cases
HBitmaps provides an array of bits. The bits are stored as usual in an
array of unsigned longs, but HBitmap is also optimized to provide fast
iteration over set bits; going from one bit to the next is O(logB n)
worst case, with B = sizeof(long) * CHAR_BIT: the result is low enough
that the number of levels is in fact fixed.
In order to do this, it stacks multiple bitmaps with progressively coarser
granularity; in all levels except the last, bit N is set iff the N-th
unsigned long is nonzero in the immediately next level. When iteration
completes on the last level it can examine the 2nd-last level to quickly
skip entire words, and even do so recursively to skip blocks of 64 words or
powers thereof (32 on 32-bit machines).
Given an index in the bitmap, it can be split in group of bits like
this (for the 64-bit case):
bits 0-57 => word in the last bitmap | bits 58-63 => bit in the word
bits 0-51 => word in the 2nd-last bitmap | bits 52-57 => bit in the word
bits 0-45 => word in the 3rd-last bitmap | bits 46-51 => bit in the word
So it is easy to move up simply by shifting the index right by
log2(BITS_PER_LONG) bits. To move down, you shift the index left
similarly, and add the word index within the group. Iteration uses
ffs (find first set bit) to find the next word to examine; this
operation can be done in constant time in most current architectures.
Setting or clearing a range of m bits on all levels, the work to perform
is O(m + m/W + m/W^2 + ...), which is O(m) like on a regular bitmap.
When iterating on a bitmap, each bit (on any level) is only visited
once. Hence, The total cost of visiting a bitmap with m bits in it is
the number of bits that are set in all bitmaps. Unless the bitmap is
extremely sparse, this is also O(m + m/W + m/W^2 + ...), so the amortized
cost of advancing from one bit to the next is usually constant.
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-01-21 20:09:40 +04:00
|
|
|
util-obj-y += bitmap.o bitops.o hbitmap.o
|
2013-02-04 13:57:50 +04:00
|
|
|
util-obj-y += fifo8.o
|
2020-02-10 07:56:02 +03:00
|
|
|
util-obj-y += nvdimm-utils.o
|
2017-06-07 03:17:04 +03:00
|
|
|
util-obj-y += cacheinfo.o
|
2012-12-20 18:58:44 +04:00
|
|
|
util-obj-y += error.o qemu-error.o
|
2019-04-17 22:06:37 +03:00
|
|
|
util-obj-y += qemu-print.o
|
2014-09-30 15:59:30 +04:00
|
|
|
util-obj-y += id.o
|
2015-07-01 20:10:30 +03:00
|
|
|
util-obj-y += iov.o qemu-config.o qemu-sockets.o uri.o notify.o
|
2012-12-20 18:58:44 +04:00
|
|
|
util-obj-y += qemu-option.o qemu-progress.o
|
keyval: New keyval_parse()
keyval_parse() parses KEY=VALUE,... into a QDict. Works like
qemu_opts_parse(), except:
* Returns a QDict instead of a QemuOpts (d'oh).
* Supports nesting, unlike QemuOpts: a KEY is split into key
fragments at '.' (dotted key convention; the block layer does
something similar on top of QemuOpts). The key fragments are QDict
keys, and the last one's value is updated to VALUE.
* Each key fragment may be up to 127 bytes long. qemu_opts_parse()
limits the entire key to 127 bytes.
* Overlong key fragments are rejected. qemu_opts_parse() silently
truncates them.
* Empty key fragments are rejected. qemu_opts_parse() happily
accepts empty keys.
* It does not store the returned value. qemu_opts_parse() stores it
in the QemuOptsList.
* It does not treat parameter "id" specially. qemu_opts_parse()
ignores all but the first "id", and fails when its value isn't
id_wellformed(), or duplicate (a QemuOpts with the same ID is
already stored). It also screws up when a value contains ",id=".
* Implied value is not supported. qemu_opts_parse() desugars "foo" to
"foo=on", and "nofoo" to "foo=off".
* An implied key's value can't be empty, and can't contain ','.
I intend to grow this into a saner replacement for QemuOpts. It'll
take time, though.
Note: keyval_parse() provides no way to do lists, and its key syntax
is incompatible with the __RFQDN_ prefix convention for downstream
extensions, because it blindly splits at '.', even in __RFQDN_. Both
issues will be addressed later in the series.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <1488317230-26248-4-git-send-email-armbru@redhat.com>
2017-03-01 00:26:49 +03:00
|
|
|
util-obj-y += keyval.o
|
2013-03-15 20:41:58 +04:00
|
|
|
util-obj-y += hexdump.o
|
2013-04-29 22:48:16 +04:00
|
|
|
util-obj-y += crc32c.o
|
2016-09-21 07:27:14 +03:00
|
|
|
util-obj-y += uuid.o
|
2013-09-02 16:14:37 +04:00
|
|
|
util-obj-y += throttle.o
|
2013-06-04 22:24:49 +04:00
|
|
|
util-obj-y += getauxval.o
|
2013-11-14 14:54:15 +04:00
|
|
|
util-obj-y += readline.o
|
2013-05-13 15:29:47 +04:00
|
|
|
util-obj-y += rcu.o
|
2018-02-16 12:05:23 +03:00
|
|
|
util-obj-$(CONFIG_MEMBARRIER) += sys_membarrier.o
|
2015-09-01 16:48:02 +03:00
|
|
|
util-obj-y += qemu-coroutine.o qemu-coroutine-lock.o qemu-coroutine-io.o
|
|
|
|
util-obj-y += qemu-coroutine-sleep.o
|
2019-10-22 14:18:03 +03:00
|
|
|
util-obj-y += qemu-co-shared-resource.o
|
2015-09-01 16:48:02 +03:00
|
|
|
util-obj-y += coroutine-$(CONFIG_COROUTINE_BACKEND).o
|
2015-03-03 20:13:42 +03:00
|
|
|
util-obj-y += buffer.o
|
2015-10-28 18:33:01 +03:00
|
|
|
util-obj-y += timed-average.o
|
2015-11-23 18:24:50 +03:00
|
|
|
util-obj-y += base64.o
|
2016-01-07 16:55:29 +03:00
|
|
|
util-obj-y += log.o
|
2017-07-15 10:24:27 +03:00
|
|
|
util-obj-y += pagesize.o
|
qdist: add module to represent frequency distributions of data
Sometimes it is useful to have a quick histogram to represent a certain
distribution -- for example, when investigating a performance regression
in a hash table due to inadequate hashing.
The appended allows us to easily represent a distribution using Unicode
characters. Further, the data structure keeping track of the distribution
is so simple that obtaining its values for off-line processing is trivial.
Example, taking the last 10 commits to QEMU:
Characters in commit title Count
-----------------------------------
39 1
48 1
53 1
54 2
57 1
61 1
67 1
78 1
80 1
qdist_init(&dist);
qdist_inc(&dist, 39);
[...]
qdist_inc(&dist, 80);
char *str = qdist_pr(&dist, 9, QDIST_PR_LABELS);
// -> [39.0,43.6)▂▂ █▂ ▂ ▄[75.4,80.0]
g_free(str);
char *str = qdist_pr(&dist, 4, QDIST_PR_LABELS);
// -> [39.0,49.2)▁█▁▁[69.8,80.0]
g_free(str);
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Emilio G. Cota <cota@braap.org>
Message-Id: <1465412133-3029-9-git-send-email-cota@braap.org>
Signed-off-by: Richard Henderson <rth@twiddle.net>
2016-06-08 21:55:26 +03:00
|
|
|
util-obj-y += qdist.o
|
2016-06-08 21:55:28 +03:00
|
|
|
util-obj-y += qht.o
|
2017-08-08 20:53:15 +03:00
|
|
|
util-obj-y += qsp.o
|
2016-05-31 19:41:28 +03:00
|
|
|
util-obj-y += range.o
|
2017-06-05 15:38:59 +03:00
|
|
|
util-obj-y += stats64.o
|
2017-03-16 18:29:45 +03:00
|
|
|
util-obj-y += systemd.o
|
2018-05-18 10:25:16 +03:00
|
|
|
util-obj-y += iova-tree.o
|
2018-06-08 19:24:57 +03:00
|
|
|
util-obj-$(CONFIG_INOTIFY1) += filemonitor-inotify.o
|
2019-08-06 16:12:18 +03:00
|
|
|
util-obj-$(call lnot,$(CONFIG_INOTIFY1)) += filemonitor-stub.o
|
2018-01-16 09:08:54 +03:00
|
|
|
util-obj-$(CONFIG_LINUX) += vfio-helpers.o
|
2019-05-24 16:09:41 +03:00
|
|
|
util-obj-$(CONFIG_POSIX) += drm.o
|
2019-03-14 23:02:09 +03:00
|
|
|
util-obj-y += guest-random.o
|
2019-09-27 11:16:54 +03:00
|
|
|
util-obj-$(CONFIG_GIO) += dbus.o
|
|
|
|
dbus.o-cflags = $(GIO_CFLAGS)
|
|
|
|
dbus.o-libs = $(GIO_LIBS)
|