Print this page
OS-1840 fmdump shall emit JSON

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/fm/fmdump/common/fmdump.h
          +++ new/usr/src/cmd/fm/fmdump/common/fmdump.h
↓ open down ↓ 12 lines elided ↑ open up ↑
  13   13   * When distributing Covered Code, include this CDDL HEADER in each
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*
  22   22   * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
       23 + * Copyright (c) 2013, Joyent, Inc. All rights reserved.
  23   24   */
  24   25  
  25   26  #ifndef _FMDUMP_H
  26   27  #define _FMDUMP_H
  27   28  
  28   29  #ifdef  __cplusplus
  29   30  extern "C" {
  30   31  #endif
  31   32  
  32   33  #include <assert.h>
↓ open down ↓ 13 lines elided ↑ open up ↑
  46   47  #else
  47   48  #define ASSERT(x)
  48   49  #endif
  49   50  
  50   51  enum {
  51   52          FMDUMP_SHORT,
  52   53          FMDUMP_VERB1,
  53   54          FMDUMP_VERB2,
  54   55          FMDUMP_PRETTY,
  55   56          FMDUMP_MSG,
       57 +        FMDUMP_JSON,
  56   58          FMDUMP_NFMTS
  57   59  };
  58   60  
  59   61  typedef struct fmdump_ops {
  60   62          const char *do_label;
  61   63          struct fmdump_fmt {
  62   64                  const char *do_hdr;
  63   65                  fmd_log_rec_f *do_func;
  64   66          } do_formats[FMDUMP_NFMTS];
  65   67  } fmdump_ops_t;
↓ open down ↓ 28 lines elided ↑ open up ↑
  94   96  extern void fmdump_warn(const char *, ...);
  95   97  extern void fmdump_vwarn(const char *, va_list);
  96   98  
  97   99  extern char *fmdump_date(char *, size_t, const fmd_log_record_t *);
  98  100  extern char *fmdump_year(char *, size_t, const fmd_log_record_t *);
  99  101  extern char *fmdump_nvl2str(nvlist_t *nvl);
 100  102  
 101  103  extern int fmdump_render_nvlist(nvlist_prtctl_t, void *, nvlist_t *,
 102  104      const char *, nvlist_t *);
 103  105  
      106 +extern int fmdump_print_json(fmd_log_t *, const fmd_log_record_t *, FILE *);
      107 +
 104  108  #ifdef  __cplusplus
 105  109  }
 106  110  #endif
 107  111  
 108  112  #endif  /* _FMDUMP_H */
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX