qemu-e2k/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
atomic.h atomics: do not emit consume barrier for atomic_rcu_read 2016-05-29 09:11:11 +02:00
base64.h
bcd.h
bitmap.h all: Remove unnecessary glib.h includes 2016-06-07 18:19:24 +03:00
bitops.h
bswap.h
buffer.h
compatfd.h
compiler.h compiler.h: add QEMU_ALIGNED() to enforce struct alignment 2016-06-11 22:59:33 +00:00
config-file.h
coroutine_int.h
coroutine.h
crc32c.h
cutils.h
envlist.h
error-report.h
event_notifier.h
fifo8.h
fifo32.h hw: Clean up includes 2016-06-07 18:19:23 +03:00
fprintf-fn.h
hbitmap.h
help_option.h
host-utils.h host-utils: Prefer 'false' for bool type 2016-06-07 18:19:24 +03:00
id.h
int128.h
iov.h
log.h log: do not use CONFIG_USER_ONLY 2016-05-19 13:08:04 +02:00
main-loop.h
memfd.h
mmap-alloc.h
module.h
notify.h
option_int.h
option.h
osdep.h osdep: Move default qemu_hw_version() value to a macro 2016-05-23 13:19:36 -03:00
path.h
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
range.h
ratelimit.h
rcu_queue.h
rcu.h all: Remove unnecessary glib.h includes 2016-06-07 18:19:24 +03:00
readline.h
rfifolock.h
seqlock.h seqlock: rename write_lock/unlock to write_begin/end 2016-06-11 22:59:34 +00:00
sockets.h
thread-posix.h
thread-win32.h
thread.h qemu-thread: add simple test-and-set spinlock 2016-06-11 23:10:18 +00:00
throttle.h
timed-average.h
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
uri.h
xattr.h