4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 only,
8 * as published by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License version 2 for more details (a copy is included
14 * in the LICENSE file that accompanied this code).
16 * You should have received a copy of the GNU General Public License
17 * version 2 along with this program; If not, see
18 * http://www.gnu.org/licenses/gpl-2.0.html
23 * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
24 * Use is subject to license terms.
26 * Copyright (c) 2011, 2017, Intel Corporation.
29 * This file is part of Lustre, http://www.lustre.org/
30 * Lustre is a trademark of Sun Microsystems, Inc.
32 /** \defgroup llog_reader Lustre Log Reader
34 * Interpret llogs used for storing configuration and changelog data
45 #include <sys/types.h>
53 #include <linux/magic.h>
56 #include <linux/lnet/nidstr.h>
57 #include <linux/lustre/lustre_cfg.h>
58 #include <linux/lustre/lustre_fid.h>
59 #include <linux/lustre/lustre_ostid.h>
60 #include <linux/lustre/lustre_log_user.h>
61 #include <lustre/lustreapi.h>
63 static inline int ext2_test_bit(int nr, const void *addr)
65 #if __BYTE_ORDER == __BIG_ENDIAN
66 const unsigned char *tmp = addr;
67 return (tmp[nr >> 3] >> (nr & 7)) & 1;
69 const unsigned long *tmp = addr;
70 return ((1UL << (nr & (__WORDSIZE - 1))) &
71 ((tmp)[nr / __WORDSIZE])) != 0;
75 int llog_pack_buffer(int fd, struct llog_log_hdr **llog_buf,
76 struct llog_rec_hdr ***recs, int *recs_number);
78 void print_llog_header(struct llog_log_hdr *llog_buf);
79 static void print_records(struct llog_rec_hdr **recs_buf,
80 int rec_number, int is_ext);
81 void llog_unpack_buffer(int fd, struct llog_log_hdr *llog_buf,
82 struct llog_rec_hdr **recs_buf);
84 #define CANCELLED 0x678
86 #define PTL_CMD_BASE 100
87 char* portals_command[17]=
108 int is_fstype_ext(int fd)
113 rc = fstatfs(fd, &st);
115 llapi_error(LLAPI_MSG_ERROR, rc, "Got statfs error.");
119 return (st.f_type == EXT4_SUPER_MAGIC);
124 * Attempt to display a path to the object (file) containing changelog entries,
125 * referred to by this changelog_catalog record.
127 * This path depends on the implementation of the OSD device; zfs-osd and
128 * ldiskfs-osd are different.
130 * Assumes that if the file system containing the changelog_catalog is
131 * ext{2,3,4}, the backend is ldiskfs-osd; otherwise it is either zfs-osd or at
132 * least names objects based on FID and the zfs-osd path (which includes the
133 * FID) will be sufficient.
135 * The Object ID stored in the record is also displayed untranslated.
137 #define OSD_OI_FID_NR (1UL << 7)
138 static void print_log_path(struct llog_logid_rec *lid, int is_ext)
141 char object_path[255];
142 struct lu_fid fid_from_logid;
144 logid_to_fid(&lid->lid_id, &fid_from_logid);
147 snprintf(object_path, sizeof(object_path),
148 "O/%ju/d%u/%u", (uintmax_t)fid_from_logid.f_seq,
149 fid_from_logid.f_oid % 32,
150 fid_from_logid.f_oid);
152 snprintf(object_path, sizeof(object_path),
153 "oi.%ju/"DFID_NOBRACE,
154 (uintmax_t)(fid_from_logid.f_seq & (OSD_OI_FID_NR - 1)),
155 PFID(&fid_from_logid));
157 printf("id="DFID":%x path=%s\n",
158 PFID(&lid->lid_id.lgl_oi.oi_fid), lid->lid_id.lgl_ogen,
162 int main(int argc, char **argv)
167 struct llog_log_hdr *llog_buf = NULL;
168 struct llog_rec_hdr **recs_buf = NULL;
173 printf("Usage: llog_reader filename\n");
177 fd = open(argv[1], O_RDONLY);
180 llapi_error(LLAPI_MSG_ERROR, rc, "Could not open the file %s.",
185 is_ext = is_fstype_ext(fd);
188 printf("Unable to determine type of filesystem containing %s\n",
193 rc = llog_pack_buffer(fd, &llog_buf, &recs_buf, &rec_number);
195 llapi_error(LLAPI_MSG_ERROR, rc, "Could not pack buffer.");
199 print_llog_header(llog_buf);
200 print_records(recs_buf, rec_number, is_ext);
201 llog_unpack_buffer(fd, llog_buf, recs_buf);
211 int llog_pack_buffer(int fd, struct llog_log_hdr **llog,
212 struct llog_rec_hdr ***recs,
215 int rc = 0, recs_num, rd = 0;
218 char *file_buf = NULL, *recs_buf = NULL;
219 struct llog_rec_hdr **recs_pr = NULL;
226 llapi_error(LLAPI_MSG_ERROR, rc, "Got file stat error.");
230 file_size = st.st_size;
231 if (file_size < sizeof(**llog)) {
232 llapi_error(LLAPI_MSG_ERROR, rc,
233 "File too small for llog header: "
234 "need %zd, size %lld\n",
235 sizeof(**llog), file_size);
240 file_buf = malloc(file_size);
241 if (file_buf == NULL) {
243 llapi_error(LLAPI_MSG_ERROR, rc, "Memory Alloc for file_buf.");
246 *llog = (struct llog_log_hdr *)file_buf;
249 rc = read(fd, file_buf + rd, file_size - rd);
252 } while (rc > 0 && rd < file_size);
254 if (rd < file_size) {
255 rc = rc < 0 ? -errno : -EIO;
256 llapi_error(LLAPI_MSG_ERROR, rc,
257 "Error reading llog header: need %zd, got %d",
262 /* the llog header not countable here.*/
263 recs_num = __le32_to_cpu((*llog)->llh_count) - 1;
265 recs_buf = malloc(recs_num * sizeof(**recs_pr));
266 if (recs_buf == NULL) {
268 llapi_error(LLAPI_MSG_ERROR, rc,
269 "Error allocating %zd bytes for recs_buf",
270 recs_num * sizeof(**recs_pr));
273 recs_pr = (struct llog_rec_hdr **)recs_buf;
275 ptr = file_buf + __le32_to_cpu((*llog)->llh_hdr.lrh_len);
279 while (ptr < (file_buf + file_size)) {
280 struct llog_rec_hdr *cur_rec;
282 unsigned long offset;
284 if (ptr + sizeof(**recs_pr) > file_buf + file_size) {
286 llapi_error(LLAPI_MSG_ERROR, rc,
287 "The log is corrupt (too big at %d)", i);
291 cur_rec = (struct llog_rec_hdr *)ptr;
292 idx = __le32_to_cpu(cur_rec->lrh_index);
293 recs_pr[i] = cur_rec;
294 offset = (unsigned long)ptr - (unsigned long)file_buf;
295 if (cur_rec->lrh_len == 0 ||
296 cur_rec->lrh_len > (*llog)->llh_hdr.lrh_len) {
297 cur_rec->lrh_len = (*llog)->llh_hdr.lrh_len -
298 offset % (*llog)->llh_hdr.lrh_len;
299 printf("off %lu skip %u to next chunk.\n", offset,
302 } else if (ext2_test_bit(idx, LLOG_HDR_BITMAP(*llog))) {
303 printf("rec #%d type=%x len=%u offset %lu\n", idx,
304 cur_rec->lrh_type, cur_rec->lrh_len, offset);
306 cur_rec->lrh_id = CANCELLED;
307 if (cur_rec->lrh_type == LLOG_PAD_MAGIC &&
308 ((offset + cur_rec->lrh_len) & 0x7) != 0)
309 printf("rec #%d wrong padding len=%u offset %lu to 0x%lx\n",
310 idx, cur_rec->lrh_len, offset,
311 offset + cur_rec->lrh_len);
312 /* The header counts only set records */
315 if (last_idx + 1 != idx) {
316 printf("Previous index is %d, current %d, offset %lu\n",
317 last_idx, idx, offset);
321 ptr += __le32_to_cpu(cur_rec->lrh_len);
322 if ((ptr - file_buf) > file_size) {
323 printf("The log is corrupt (too big at %d)\n", i);
331 *recs_number = recs_num;
346 void llog_unpack_buffer(int fd, struct llog_log_hdr *llog_buf,
347 struct llog_rec_hdr **recs_buf)
354 void print_llog_header(struct llog_log_hdr *llog_buf)
357 unsigned int lrh_len = __le32_to_cpu(llog_buf->llh_hdr.lrh_len);
358 struct llog_rec_tail *tail = ((struct llog_rec_tail *)((char *)llog_buf+
359 lrh_len - sizeof(llog_buf->llh_tail)));
361 printf("Header size : %u\t llh_size : %u\n", lrh_len,
362 __le32_to_cpu(llog_buf->llh_size));
364 t = __le64_to_cpu(llog_buf->llh_timestamp);
365 printf("Time : %s", ctime(&t));
367 printf("Number of records: %u\tcat_idx: %u\tlast_idx: %u\n",
368 __le32_to_cpu(llog_buf->llh_count)-1,
369 __le32_to_cpu(llog_buf->llh_cat_idx),
370 __le32_to_cpu(tail->lrt_index));
372 printf("Target uuid : %s\n",
373 (char *)(&llog_buf->llh_tgtuuid));
375 /* Add the other info you want to view here */
377 printf("-----------------------\n");
381 static void print_1_cfg(struct lustre_cfg *lcfg)
386 printf("nid=%s(%#jx) ", libcfs_nid2str(lcfg->lcfg_nid),
387 (uintmax_t)lcfg->lcfg_nid);
389 printf("nal=%d ", lcfg->lcfg_nal);
390 for (i = 0; i < lcfg->lcfg_bufcount; i++)
391 printf("%d:%.*s ", i, lcfg->lcfg_buflens[i],
392 (char*)lustre_cfg_buf(lcfg, i));
396 static char *lustre_cfg_string(struct lustre_cfg *lcfg, __u32 index)
400 if (lcfg->lcfg_buflens[index] == 0)
403 s = lustre_cfg_buf(lcfg, index);
408 * make sure it's NULL terminated, even if this kills a char
409 * of data. Try to use the padding first though.
411 if (s[lcfg->lcfg_buflens[index] - 1] != '\0') {
412 size_t last = __ALIGN_KERNEL(lcfg->lcfg_buflens[index], 8) - 1;
415 /* Use the smaller value */
416 if (last > lcfg->lcfg_buflens[index])
417 last = lcfg->lcfg_buflens[index];
422 fprintf(stderr, "Truncated buf %d to '%s' (lost '%c'...)\n",
429 static void print_setup_cfg(struct lustre_cfg *lcfg)
431 struct lov_desc *desc;
433 if ((lcfg->lcfg_bufcount == 2) &&
434 (lcfg->lcfg_buflens[1] == sizeof(*desc))) {
435 printf("lov_setup ");
436 printf("0:%s ", lustre_cfg_string(lcfg, 0));
437 printf("1:(struct lov_desc)\n");
438 desc = (struct lov_desc*)(lustre_cfg_string(lcfg, 1));
439 printf("\t\tuuid=%s ", (char*)desc->ld_uuid.uuid);
440 printf("stripe:cnt=%u ", desc->ld_default_stripe_count);
441 printf("size=%ju ", (uintmax_t)desc->ld_default_stripe_size);
442 printf("offset=%ju ",
443 (uintmax_t)desc->ld_default_stripe_offset);
444 printf("pattern=%#x", desc->ld_pattern);
453 void print_lustre_cfg(struct lustre_cfg *lcfg, int *skip)
455 enum lcfg_command_type cmd = __le32_to_cpu(lcfg->lcfg_command);
467 print_setup_cfg(lcfg);
480 case(LCFG_ADD_UUID):{
485 case(LCFG_DEL_UUID):{
490 case(LCFG_ADD_CONN):{
495 case(LCFG_DEL_CONN):{
500 case(LCFG_LOV_ADD_OBD):{
501 printf("lov_modify_tgts add ");
505 case(LCFG_LOV_DEL_OBD):{
506 printf("lov_modify_tgts del ");
511 printf("modify_mdc_tgts add ");
516 printf("modify_mdc_tgts del ");
520 case(LCFG_MOUNTOPT):{
521 printf("mount_option ");
525 case(LCFG_DEL_MOUNTOPT):{
526 printf("del_mount_option ");
530 case(LCFG_SET_TIMEOUT):{
531 printf("set_timeout=%d ", lcfg->lcfg_num);
534 case(LCFG_SET_LDLM_TIMEOUT):{
535 printf("set_ldlm_timeout=%d ", lcfg->lcfg_num);
538 case(LCFG_SET_UPCALL):{
539 printf("set_lustre_upcall ");
548 case(LCFG_SET_PARAM):{
549 printf("set_param ");
553 case(LCFG_SPTLRPC_CONF):{
554 printf("sptlrpc_conf ");
559 struct cfg_marker *marker = lustre_cfg_buf(lcfg, 1);
560 char createtime[26], canceltime[26] = "";
563 if (marker->cm_flags & CM_START &&
564 marker->cm_flags & CM_SKIP) {
565 printf("SKIP START ");
567 } else if (marker->cm_flags & CM_END) {
572 if (marker->cm_flags & CM_EXCLUDE) {
573 if (marker->cm_flags & CM_START)
574 printf("EXCLUDE START ");
576 printf("EXCLUDE END ");
579 /* Handle overflow of 32-bit time_t gracefully.
580 * The copy to time_tmp is needed in any case to
581 * keep the pointer happy, even on 64-bit systems. */
582 time_tmp = marker->cm_createtime;
583 if (time_tmp == marker->cm_createtime) {
584 ctime_r(&time_tmp, createtime);
585 createtime[strlen(createtime) - 1] = 0;
587 strcpy(createtime, "in the distant future");
590 if (marker->cm_canceltime) {
591 /* Like cm_createtime, we try to handle overflow of
592 * 32-bit time_t gracefully. The copy to time_tmp
593 * is also needed on 64-bit systems to keep the
594 * pointer happy, see bug 16771 */
595 time_tmp = marker->cm_canceltime;
596 if (time_tmp == marker->cm_canceltime) {
597 ctime_r(&time_tmp, canceltime);
598 canceltime[strlen(canceltime) - 1] = 0;
600 strcpy(canceltime, "in the distant future");
604 printf("marker %3d (flags=%#04x, v%d.%d.%d.%d) %-15s '%s' %s-%s",
605 marker->cm_step, marker->cm_flags,
606 OBD_OCD_VERSION_MAJOR(marker->cm_vers),
607 OBD_OCD_VERSION_MINOR(marker->cm_vers),
608 OBD_OCD_VERSION_PATCH(marker->cm_vers),
609 OBD_OCD_VERSION_FIX(marker->cm_vers),
610 marker->cm_tgtname, marker->cm_comment,
611 createtime, canceltime);
614 case(LCFG_POOL_NEW):{
619 case(LCFG_POOL_ADD):{
624 case(LCFG_POOL_REM):{
625 printf("pool remove ");
629 case(LCFG_POOL_DEL):{
630 printf("pool destroy ");
635 printf("unsupported cmd_code = %x\n",cmd);
641 static void print_hsm_action(struct llog_agent_req_rec *larr)
646 sz = larr->arr_hai.hai_len - sizeof(larr->arr_hai);
647 printf("lrh=[type=%X len=%d idx=%d] fid="DFID
648 " compound/cookie=%#llx/%#llx"
649 " status=%s action=%s archive#=%d flags=%#llx"
650 " create=%llu change=%llu"
651 " extent=%#llx-%#llx gid=%#llx datalen=%d"
653 larr->arr_hdr.lrh_type,
654 larr->arr_hdr.lrh_len, larr->arr_hdr.lrh_index,
655 PFID(&larr->arr_hai.hai_fid),
656 (unsigned long long)larr->arr_compound_id,
657 (unsigned long long)larr->arr_hai.hai_cookie,
658 agent_req_status2name(larr->arr_status),
659 hsm_copytool_action2name(larr->arr_hai.hai_action),
660 larr->arr_archive_id,
661 (unsigned long long)larr->arr_flags,
662 (unsigned long long)larr->arr_req_create,
663 (unsigned long long)larr->arr_req_change,
664 (unsigned long long)larr->arr_hai.hai_extent.offset,
665 (unsigned long long)larr->arr_hai.hai_extent.length,
666 (unsigned long long)larr->arr_hai.hai_gid, sz,
667 hai_dump_data_field(&larr->arr_hai, buf, sizeof(buf)));
670 void print_changelog_rec(struct llog_changelog_rec *rec)
675 secs = __le64_to_cpu(rec->cr.cr_time) >> 30;
676 gmtime_r(&secs, &ts);
677 printf("changelog record id:0x%x index:%llu cr_flags:0x%x "
678 "cr_type:%s(0x%x) date:'%02d:%02d:%02d.%09d %04d.%02d.%02d' "
679 "target:"DFID, __le32_to_cpu(rec->cr_hdr.lrh_id),
680 (unsigned long long)__le64_to_cpu(rec->cr.cr_index),
681 __le32_to_cpu(rec->cr.cr_flags),
682 changelog_type2str(__le32_to_cpu(rec->cr.cr_type)),
683 __le32_to_cpu(rec->cr.cr_type),
684 ts.tm_hour, ts.tm_min, ts.tm_sec,
685 (int)(__le64_to_cpu(rec->cr.cr_time) & ((1 << 30) - 1)),
686 ts.tm_year + 1900, ts.tm_mon + 1, ts.tm_mday,
687 PFID(&rec->cr.cr_tfid));
689 if (rec->cr.cr_flags & CLF_JOBID) {
690 struct changelog_ext_jobid *jid =
691 changelog_rec_jobid(&rec->cr);
693 if (jid->cr_jobid[0] != '\0')
694 printf(" jobid:%s", jid->cr_jobid);
697 if (rec->cr.cr_flags & CLF_EXTRA_FLAGS) {
698 struct changelog_ext_extra_flags *ef =
699 changelog_rec_extra_flags(&rec->cr);
701 printf(" cr_extra_flags:0x%llx",
702 (unsigned long long)__le64_to_cpu(ef->cr_extra_flags));
704 if (ef->cr_extra_flags & CLFE_UIDGID) {
705 struct changelog_ext_uidgid *uidgid =
706 changelog_rec_uidgid(&rec->cr);
708 printf(" user:%u:%u",
709 __le32_to_cpu(uidgid->cr_uid),
710 __le32_to_cpu(uidgid->cr_gid));
712 if (ef->cr_extra_flags & CLFE_NID) {
713 struct changelog_ext_nid *nid =
714 changelog_rec_nid(&rec->cr);
717 libcfs_nid2str(nid->cr_nid));
720 if (ef->cr_extra_flags & CLFE_OPEN) {
721 struct changelog_ext_openmode *omd =
722 changelog_rec_openmode(&rec->cr);
725 /* exec mode must be exclusive */
726 if (__le32_to_cpu(omd->cr_openflags) & MDS_FMODE_EXEC) {
729 if (__le32_to_cpu(omd->cr_openflags) &
732 if (__le32_to_cpu(omd->cr_openflags) &
733 (MDS_FMODE_WRITE | MDS_OPEN_TRUNC | MDS_OPEN_APPEND))
737 if (strcmp(mode, "---") != 0)
738 printf(" mode:%s", mode);
742 if (ef->cr_extra_flags & CLFE_XATTR) {
743 struct changelog_ext_xattr *xattr =
744 changelog_rec_xattr(&rec->cr);
746 if (xattr->cr_xattr[0] != '\0')
747 printf(" xattr:%s", xattr->cr_xattr);
751 if (rec->cr.cr_namelen)
752 printf(" parent:"DFID" name:%.*s", PFID(&rec->cr.cr_pfid),
753 __le32_to_cpu(rec->cr.cr_namelen),
754 changelog_rec_name(&rec->cr));
756 if (rec->cr.cr_flags & CLF_RENAME) {
757 struct changelog_ext_rename *rnm =
758 changelog_rec_rename(&rec->cr);
760 if (!fid_is_zero(&rnm->cr_sfid))
761 printf(" source_fid:"DFID" source_parent_fid:"DFID
764 PFID(&rnm->cr_spfid),
766 changelog_rec_snamelen(&rec->cr)),
767 changelog_rec_sname(&rec->cr));
772 static void lustre_swab_lu_fid(struct lu_fid *fid)
774 __swab64s(&fid->f_seq);
775 __swab32s(&fid->f_oid);
776 __swab32s(&fid->f_ver);
780 update_op_size(unsigned int param_count)
782 return offsetof(struct update_op, uop_params_off[param_count]);
786 static inline struct update_op *
787 update_op_next_op(const struct update_op *uop)
789 return (struct update_op *)((char *)uop +
790 update_op_size(uop->uop_param_count));
793 static void lustre_swab_update_ops(struct update_ops *uops,
794 unsigned int op_count)
799 struct update_op *op =
800 (struct update_op *)((char *)&uops->uops_op[0]);
802 for (i = 0; i < op_count; i++, op = update_op_next_op(op)) {
803 lustre_swab_lu_fid(&op->uop_fid);
804 __swab16s(&op->uop_type);
805 __swab16s(&op->uop_param_count);
806 for (j = 0; j < op->uop_param_count; j++)
807 __swab16s(&op->uop_params_off[j]);
810 static const char *update_op_str(__u16 opc)
812 static const char *opc_str[] = {
813 [OUT_START] = "start",
814 [OUT_CREATE] = "create",
815 [OUT_DESTROY] = "destroy",
816 [OUT_REF_ADD] = "ref_add",
817 [OUT_REF_DEL] = "ref_del",
818 [OUT_ATTR_SET] = "attr_set",
819 [OUT_ATTR_GET] = "attr_get",
820 [OUT_XATTR_SET] = "xattr_set",
821 [OUT_XATTR_GET] = "xattr_get",
822 [OUT_XATTR_LIST] = "xattr_list",
823 [OUT_INDEX_LOOKUP] = "lookup",
824 [OUT_INDEX_INSERT] = "insert",
825 [OUT_INDEX_DELETE] = "delete",
826 [OUT_WRITE] = "write",
827 [OUT_XATTR_DEL] = "xattr_del",
828 [OUT_PUNCH] = "punch",
833 if (opc < (sizeof(opc_str) / sizeof((opc_str)[0])) &&
834 opc_str[opc] != NULL)
840 char *buf2str(void *buf, unsigned int size)
842 const char *hex = "0123456789ABCDEF";
844 static char string[128];
846 bool format_hex = false;
848 if (size > 0 && buf_c[size - 1] == 0)
850 for (i = 0; i < size; i++) {
851 if (buf_c[i] >= 0x20 && buf_c[i] <= 0x7E) {
852 string[j++] = buf_c[i];
854 } else if (j < sizeof(string) - 6) {
860 string[j++] = hex[(buf_c[i] >> 4) & 0xF];
861 string[j++] = hex[buf_c[i] & 0xF];
865 if (j == sizeof(string) - 2)
872 void print_update_rec(struct llog_update_record *lur)
874 struct update_records *rec = &lur->lur_update_rec;
875 unsigned int i, j, up_count, pm_count;
876 struct update_op *op;
877 struct object_update_param *pm;
879 up_count = __le32_to_cpu(rec->ur_update_count);
880 pm_count = __le32_to_cpu(rec->ur_param_count);
881 printf("updatelog record master_transno:%llu batchid:%llu flags:0x%x u_index:%d u_count:%d p_count:%d\n",
882 __le64_to_cpu(rec->ur_master_transno),
883 __le64_to_cpu(rec->ur_batchid),
884 __le32_to_cpu(rec->ur_flags),
885 __le32_to_cpu(rec->ur_index),
889 op = (struct update_op *)((char *)&rec->ur_ops.uops_op[0] + 0);
890 if (op->uop_type != __le16_to_cpu(op->uop_type))
891 lustre_swab_update_ops(&rec->ur_ops, up_count);
893 for (i = 0; i < up_count; i++, op = update_op_next_op(op)) {
894 printf("\t"DFID" type:%s/%d params:%d ",
895 PFID(&op->uop_fid), update_op_str(op->uop_type),
896 op->uop_type, op->uop_param_count);
897 for (j = 0; j < op->uop_param_count; j++)
898 printf("p_%d:%d ", j, op->uop_params_off[j]);
901 pm = (struct object_update_param *) op;
902 for (i = 0; i < pm_count; i++) {
903 printf("\tp_%d - %d/%s\n", i, pm->oup_len,
904 buf2str(pm->oup_buf, pm->oup_len));
905 pm = (struct object_update_param *)((char *)(pm + 1) +
912 static void print_records(struct llog_rec_hdr **recs,
913 int rec_number, int is_ext)
918 for (i = 0; i < rec_number; i++) {
919 printf("#%.2d (%.3d)", __le32_to_cpu(recs[i]->lrh_index),
920 __le32_to_cpu(recs[i]->lrh_len));
922 lopt = __le32_to_cpu(recs[i]->lrh_type);
924 if (recs[i]->lrh_id == CANCELLED)
930 (struct lustre_cfg *)((char *)(recs[i]) +
931 sizeof(struct llog_rec_hdr)), &skip);
936 case LLOG_LOGID_MAGIC:
937 print_log_path((struct llog_logid_rec *)recs[i],
941 print_hsm_action((struct llog_agent_req_rec *)recs[i]);
944 print_changelog_rec((struct llog_changelog_rec *)
947 case CHANGELOG_USER_REC:
948 printf("changelog_user record id:0x%x\n",
949 __le32_to_cpu(recs[i]->lrh_id));
952 print_update_rec((struct llog_update_record *)recs[i]);
955 printf("unknown type %x\n", lopt);
961 /** @} llog_reader */