]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common: dump field name of 'flag_point' and 'client_info'
authorYan Jun <yan.jun8@zte.com.cn>
Sat, 22 Jul 2017 06:27:55 +0000 (14:27 +0800)
committerYan Jun <yan.jun8@zte.com.cn>
Sat, 22 Jul 2017 06:27:55 +0000 (14:27 +0800)
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 <yan.jun8@zte.com.cn>
src/common/TrackedOp.cc

index ecaa196afd989a4dc395110964fe7de38e0bb612..63ca0d63da905a6d2d565e51e7c22dd0420b6959 100644 (file)
@@ -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();
   }