qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v7] tcg: dump op count into qemu log
@ 2014-08-18  7:58 zhanghailiang
  2014-08-18 11:32 ` [Qemu-devel] [Qemu-trivial] " Michael Tokarev
  0 siblings, 1 reply; 2+ messages in thread
From: zhanghailiang @ 2014-08-18  7:58 UTC (permalink / raw)
  To: qemu-devel
  Cc: zhanghailiang, qemu-trivial, mjt, luonengjun, peter.huangpeng,
	Li Liu, rth

fopen() may fail and it does not check its return vaule here,
it is better to dump op count to the normal log file.

Signed-off-by: Li Liu <john.liuli@huawei.com>
Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
---
 tcg/tcg.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/tcg/tcg.c b/tcg/tcg.c
index c068990..7a84b87 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -2404,12 +2404,10 @@ static int64_t tcg_table_op_count[NB_OPS];
 static void dump_op_count(void)
 {
     int i;
-    FILE *f;
-    f = fopen("/tmp/op.log", "w");
+
     for(i = INDEX_op_end; i < NB_OPS; i++) {
-        fprintf(f, "%s %" PRId64 "\n", tcg_op_defs[i].name, tcg_table_op_count[i]);
+        qemu_log("%s %" PRId64 "\n", tcg_op_defs[i].name, tcg_table_op_count[i]);
     }
-    fclose(f);
 }
 #endif
 
-- 
1.7.12.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [Qemu-trivial] [PATCH v7] tcg: dump op count into qemu log
  2014-08-18  7:58 [Qemu-devel] [PATCH v7] tcg: dump op count into qemu log zhanghailiang
@ 2014-08-18 11:32 ` Michael Tokarev
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Tokarev @ 2014-08-18 11:32 UTC (permalink / raw)
  To: zhanghailiang, qemu-devel
  Cc: qemu-trivial, Li Liu, luonengjun, peter.huangpeng, rth

18.08.2014 11:58, zhanghailiang wrote:
> fopen() may fail and it does not check its return vaule here,
> it is better to dump op count to the normal log file.

Applied to -trivial, thank you!

/mjt

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-08-18 11:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-18  7:58 [Qemu-devel] [PATCH v7] tcg: dump op count into qemu log zhanghailiang
2014-08-18 11:32 ` [Qemu-devel] [Qemu-trivial] " Michael Tokarev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).