summaryrefslogtreecommitdiff
path: root/qemu-log.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2013-02-11 16:41:21 +0000
committerBlue Swirl <blauwirbel@gmail.com>2013-02-16 10:44:11 +0000
commit59a6fa6e67d2335d867c66c59d992847e5b62879 (patch)
tree7cfe5ed1882e24a51b8eff859594c23a06423d3a /qemu-log.c
parent9a7e54242910d26d280589e1f5c7ec8814d02a6b (diff)
downloadqemu-59a6fa6e67d2335d867c66c59d992847e5b62879.tar.gz
qemu-log: Abstract out "print usage message about valid log categories"
Abstract out the "print a human readable list of all the valid log categories" functionality which is currently duplicated in three separate places. (We leave the monitor.c help_cmd() implementation as-is since it wants to send the message to the monitor and add its own information.) Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'qemu-log.c')
-rw-r--r--qemu-log.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/qemu-log.c b/qemu-log.c
index 9a7e5675a1..786d335893 100644
--- a/qemu-log.c
+++ b/qemu-log.c
@@ -170,3 +170,12 @@ int cpu_str_to_log_mask(const char *str)
}
return mask;
}
+
+void qemu_print_log_usage(FILE *f)
+{
+ const CPULogItem *item;
+ fprintf(f, "Log items (comma separated):\n");
+ for (item = cpu_log_items; item->mask != 0; item++) {
+ fprintf(f, "%-10s %s\n", item->name, item->help);
+ }
+}