Print this page
OS-1840 fmdump shall emit JSON

@@ -18,15 +18,17 @@
  *
  * CDDL HEADER END
  */
 /*
  * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
  */
 
 #include <fmdump.h>
 #include <stdio.h>
 #include <strings.h>
+#include <alloca.h>
 
 /*ARGSUSED*/
 static int
 flt_short(fmd_log_t *lp, const fmd_log_record_t *rp, FILE *fp)
 {

@@ -199,11 +201,10 @@
 flt_verb2(fmd_log_t *lp, const fmd_log_record_t *rp, FILE *fp)
 {
         return (flt_verb23_cmn(lp, rp, fp, NULL));
 }
 
-
 static int
 flt_pretty(fmd_log_t *lp, const fmd_log_record_t *rp, FILE *fp)
 {
         nvlist_prtctl_t pctl;
         int rc;

@@ -283,7 +284,10 @@
 "                                 SUNW-MSG-ID",
 (fmd_log_rec_f *)flt_pretty
 }, {
 NULL,
 (fmd_log_rec_f *)flt_msg
+}, {
+NULL,
+(fmd_log_rec_f *)fmdump_print_json
 } }
 };