提交 38dad9e5 编写于 作者: P Peter Maydell 提交者: Blue Swirl

qemu-log: Rename CPULogItem, cpu_log_items to QEMULogItem, qemu_log_items

Rename the typedef CPULogItem and the public array cpu_log_items
to names that better reflect the fact that the qemu_log functionality
isn't restricted to TCG CPU debug logs any more.
Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
Reviewed-by: NAndreas Färber <afaerber@suse.de>
Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
上级 b946bffa
...@@ -135,13 +135,13 @@ static inline void qemu_log_try_set_file(FILE *f) ...@@ -135,13 +135,13 @@ static inline void qemu_log_try_set_file(FILE *f)
} }
/* define log items */ /* define log items */
typedef struct CPULogItem { typedef struct QEMULogItem {
int mask; int mask;
const char *name; const char *name;
const char *help; const char *help;
} CPULogItem; } QEMULogItem;
extern const CPULogItem cpu_log_items[]; extern const QEMULogItem qemu_log_items[];
/* This is the function that actually does the work of /* This is the function that actually does the work of
* changing the log level; it should only be accessed via * changing the log level; it should only be accessed via
......
...@@ -721,10 +721,10 @@ static void help_cmd(Monitor *mon, const char *name) ...@@ -721,10 +721,10 @@ static void help_cmd(Monitor *mon, const char *name)
} else { } else {
help_cmd_dump(mon, mon_cmds, "", name); help_cmd_dump(mon, mon_cmds, "", name);
if (name && !strcmp(name, "log")) { if (name && !strcmp(name, "log")) {
const CPULogItem *item; const QEMULogItem *item;
monitor_printf(mon, "Log items (comma separated):\n"); monitor_printf(mon, "Log items (comma separated):\n");
monitor_printf(mon, "%-10s %s\n", "none", "remove all logs"); monitor_printf(mon, "%-10s %s\n", "none", "remove all logs");
for(item = cpu_log_items; item->mask != 0; item++) { for (item = qemu_log_items; item->mask != 0; item++) {
monitor_printf(mon, "%-10s %s\n", item->name, item->help); monitor_printf(mon, "%-10s %s\n", item->name, item->help);
} }
} }
......
...@@ -97,7 +97,7 @@ void qemu_set_log_filename(const char *filename) ...@@ -97,7 +97,7 @@ void qemu_set_log_filename(const char *filename)
qemu_set_log(qemu_loglevel); qemu_set_log(qemu_loglevel);
} }
const CPULogItem cpu_log_items[] = { const QEMULogItem qemu_log_items[] = {
{ CPU_LOG_TB_OUT_ASM, "out_asm", { CPU_LOG_TB_OUT_ASM, "out_asm",
"show generated host assembly code for each compiled TB" }, "show generated host assembly code for each compiled TB" },
{ CPU_LOG_TB_IN_ASM, "in_asm", { CPU_LOG_TB_IN_ASM, "in_asm",
...@@ -138,7 +138,7 @@ static int cmp1(const char *s1, int n, const char *s2) ...@@ -138,7 +138,7 @@ static int cmp1(const char *s1, int n, const char *s2)
/* takes a comma separated list of log masks. Return 0 if error. */ /* takes a comma separated list of log masks. Return 0 if error. */
int qemu_str_to_log_mask(const char *str) int qemu_str_to_log_mask(const char *str)
{ {
const CPULogItem *item; const QEMULogItem *item;
int mask; int mask;
const char *p, *p1; const char *p, *p1;
...@@ -150,11 +150,11 @@ int qemu_str_to_log_mask(const char *str) ...@@ -150,11 +150,11 @@ int qemu_str_to_log_mask(const char *str)
p1 = p + strlen(p); p1 = p + strlen(p);
} }
if (cmp1(p,p1-p,"all")) { if (cmp1(p,p1-p,"all")) {
for (item = cpu_log_items; item->mask != 0; item++) { for (item = qemu_log_items; item->mask != 0; item++) {
mask |= item->mask; mask |= item->mask;
} }
} else { } else {
for (item = cpu_log_items; item->mask != 0; item++) { for (item = qemu_log_items; item->mask != 0; item++) {
if (cmp1(p, p1 - p, item->name)) { if (cmp1(p, p1 - p, item->name)) {
goto found; goto found;
} }
...@@ -173,9 +173,9 @@ int qemu_str_to_log_mask(const char *str) ...@@ -173,9 +173,9 @@ int qemu_str_to_log_mask(const char *str)
void qemu_print_log_usage(FILE *f) void qemu_print_log_usage(FILE *f)
{ {
const CPULogItem *item; const QEMULogItem *item;
fprintf(f, "Log items (comma separated):\n"); fprintf(f, "Log items (comma separated):\n");
for (item = cpu_log_items; item->mask != 0; item++) { for (item = qemu_log_items; item->mask != 0; item++) {
fprintf(f, "%-10s %s\n", item->name, item->help); fprintf(f, "%-10s %s\n", item->name, item->help);
} }
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册