From 53c850541e3198a33b34ae0079686dfe5a604c33 Mon Sep 17 00:00:00 2001 From: Yan Jun Date: Sat, 22 Jul 2017 14:27:55 +0800 Subject: [PATCH] common: dump field name of 'flag_point' and 'client_info' we used to open "type_data" section as a array (that's open_array_section), some key field names can not be dumped out. use open_object_section to dump them as following: before this change: ------------------ "description": "osd_op(client.4202.0:4958 3.28 3:163e8348:::rbd_data.10472ae8944a.0000000000000164:head [write 1691648~4096 [fadvise_sequential]] snapc 0=[] ondisk+write+known_if_redirected e24)", "initiated_at": "2017-07-22 14:22:13.469324", "age": 17.595664, "duration": 0.460406, "type_data": [ "commit sent; apply or cleanup", { "client": "client.4202", "client_addr": "-", "tid": 4958 }, ----------------- after: ----------------- "description": "osd_op(client.24123.0:328 3.36 3:6ec0d61b:::rbd_data.10472ae8944a.0000000000000289:head [write 4141056~4096 [fadvise_sequential]] snapc 0=[] ondisk+write+known_if_redirected e36)", "initiated_at": "2017-07-22 14:24:25.925633", "age": 4.893190, "duration": 0.272642, "type_data": { "flag_point": "commit sent; apply or cleanup", "client_info": { "client": "client.24123", "client_addr": "-", "tid": 328 }, ---------------- Signed-off-by: Yan Jun --- src/common/TrackedOp.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/TrackedOp.cc b/src/common/TrackedOp.cc index ecaa196afd989..63ca0d63da905 100644 --- a/src/common/TrackedOp.cc +++ b/src/common/TrackedOp.cc @@ -437,7 +437,7 @@ void TrackedOp::dump(utime_t now, Formatter *f) const f->dump_float("age", now - get_initiated()); f->dump_float("duration", get_duration()); { - f->open_array_section("type_data"); + f->open_object_section("type_data"); _dump(f); f->close_section(); } -- 2.39.5