qemu-cr16/include/qemu
Emilio G. Cota bf3afd5f41 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-11 23:10:19 +00:00
..
acl.h misc: move include files to include/qemu/ 2012-12-19 08:32:39 +01:00
atomic.h atomics: do not emit consume barrier for atomic_rcu_read 2016-05-29 09:11:11 +02:00
base64.h util: add base64 decoding function 2015-12-18 16:25:08 +00:00
bcd.h util: move declarations out of qemu-common.h 2016-03-22 22:20:17 +01:00
bitmap.h all: Remove unnecessary glib.h includes 2016-06-07 18:19:24 +03:00
bitops.h include: Clean up includes 2016-02-23 12:43:05 +00:00
bswap.h move const_le{16, 23} to qemu/bswap.h, add comment 2016-04-13 15:52:28 +02:00
buffer.h buffer: allow a buffer to shrink gracefully 2015-11-05 09:09:58 +01:00
compatfd.h include: Clean up includes 2016-02-23 12:43:05 +00:00
compiler.h compiler.h: add QEMU_ALIGNED() to enforce struct alignment 2016-06-11 22:59:33 +00:00
config-file.h include: Clean up includes 2016-02-23 12:43:05 +00:00
coroutine.h Use scripts/clean-includes to drop redundant qemu/typedefs.h 2016-03-22 22:20:16 +01:00
coroutine_int.h coroutine: move into libqemuutil.a library 2015-10-20 14:59:04 +01:00
crc32c.h include/qemu/crc32c.h: Rename include guards to match filename 2014-02-26 17:20:07 +00:00
cutils.h util: move declarations out of qemu-common.h 2016-03-22 22:20:17 +01:00
envlist.h misc: move include files to include/qemu/ 2012-12-19 08:32:39 +01:00
error-report.h include: Clean up includes 2016-02-23 12:43:05 +00:00
event_notifier.h event-notifier: Add "is_external" parameter 2016-04-22 16:43:56 +02:00
fifo8.h util/fifo8: implement push/pop of multiple bytes 2014-02-08 14:50:48 +00:00
fifo32.h hw: Clean up includes 2016-06-07 18:19:23 +03:00
fprintf-fn.h include: Clean up includes 2016-02-23 12:43:05 +00:00
hbitmap.h include: Clean up includes 2016-02-23 12:43:05 +00:00
help_option.h util: move declarations out of qemu-common.h 2016-03-22 22:20:17 +01:00
host-utils.h host-utils: Prefer 'false' for bool type 2016-06-07 18:19:24 +03:00
id.h util: move declarations out of qemu-common.h 2016-03-22 22:20:17 +01:00
int128.h include: Clean up includes 2016-02-23 12:43:05 +00:00
iov.h include/qemu/iov.h: Don't include qemu-common.h 2016-03-22 22:20:16 +01:00
log.h log: do not use CONFIG_USER_ONLY 2016-05-19 13:08:04 +02:00
main-loop.h iohandler: Introduce iohandler_get_aio_context 2016-04-22 16:43:42 +02:00
memfd.h include: Clean up includes 2016-02-23 12:43:05 +00:00
mmap-alloc.h util/mmap-alloc: fix hugetlb support on ppc64 2015-12-02 22:38:23 +02:00
module.h module: Rename machine_init() to opts_init() 2016-03-16 15:54:23 -03:00
notify.h notify: add NotiferWithReturn so notifier list can abort 2013-06-28 09:20:26 +02:00
option.h Use scripts/clean-includes to drop redundant qemu/typedefs.h 2016-03-22 22:20:16 +01:00
option_int.h QemuOpts: change opt->name|str from (const char *) to (char *) 2014-06-16 17:23:20 +08:00
osdep.h osdep: Move default qemu_hw_version() value to a macro 2016-05-23 13:19:36 -03:00
path.h util: move declarations out of qemu-common.h 2016-03-22 22:20:17 +01:00
processor.h include/processor.h: define cpu_relax() 2016-06-11 23:10:17 +00:00
qdist.h qdist: add module to represent frequency distributions of data 2016-06-11 23:10:19 +00:00
queue.h block: Remove bdrv_swap() 2015-10-16 15:34:30 +02:00
range.h Clean up includes some more 2016-03-22 22:20:16 +01:00
ratelimit.h aio / timers: Switch entire codebase to the new timer API 2013-08-22 19:14:24 +02:00
rcu.h all: Remove unnecessary glib.h includes 2016-06-07 18:19:24 +03:00
rcu_queue.h rcu: introduce RCU-enabled QLIST 2015-02-16 17:30:19 +01:00
readline.h readline: Add missing GCC_FMT_ATTR 2014-02-01 13:46:06 +04:00
rfifolock.h rfifolock: add recursive FIFO lock 2014-03-13 14:42:21 +01:00
seqlock.h seqlock: rename write_lock/unlock to write_begin/end 2016-06-11 22:59:34 +00:00
sockets.h osdep: add wrappers for socket functions 2016-03-10 17:19:07 +00:00
thread-posix.h qemu-thread: add QemuEvent 2013-10-17 17:30:55 +02:00
thread-win32.h qemu-thread: add a fast path to the Win32 QemuEvent 2015-09-24 20:52:28 +02:00
thread.h qemu-thread: add simple test-and-set spinlock 2016-06-11 23:10:18 +00:00
throttle.h include: Clean up includes 2016-02-23 12:43:05 +00:00
timed-average.h include: Clean up includes 2016-02-23 12:43:05 +00:00
timer.h include: move CPU-related definitions out of qemu-common.h 2016-05-19 13:08:04 +02:00
typedefs.h migration: delete QEMUSizedBuffer struct 2016-05-26 11:31:58 +05:30
unicode.h util: move declarations out of qemu-common.h 2016-03-22 22:20:17 +01:00
uri.h misc: move include files to include/qemu/ 2012-12-19 08:32:39 +01:00
xattr.h include: Clean up includes 2016-02-23 12:43:05 +00:00