  struct perf_data_convert_opts {
  	bool force;
  	bool all;
+ 	bool tod;
+ };
+ 
++#ifdef HAVE_LIBBABELTRACE_SUPPORT
++int bt_convert__perf2ctf(const char *input_name, const char *to_ctf,
++			 struct perf_data_convert_opts *opts);
++#endif /* HAVE_LIBBABELTRACE_SUPPORT */
++
++int bt_convert__perf2json(const char *input_name, const char *to_ctf,
++			 struct perf_data_convert_opts *opts);
++
+ #endif /* __DATA_CONVERT_H */
 -- 
-2.31.0
+2.31.1
 

 	Convert time to wall clock time.
 
diff --git a/tools/perf/builtin-data.c b/tools/perf/builtin-data.c
index 8d23b8d6ee8e..64546ba517a5 100644
--- a/tools/perf/builtin-data.c
+++ b/tools/perf/builtin-data.c
@@ -8,6 +8,7 @@
 #include <subcmd/parse-options.h>
 #include "data-convert.h"
 #include "data-convert-bt.h"
+#include "data-convert-json.h"
 
 typedef int (*data_cmd_fn_t)(int argc, const char **argv);
 
@@ -55,7 +56,8 @@ static const char * const data_convert_usage[] = {
 
 static int cmd_data_convert(int argc, const char **argv)
 {

+					cpumode = PERF_RECORD_MISC_USER;
+					break;
+				default:
+					pr_debug("invalid callchain context: %"
+							PRId64 "\n", (s64) ip);
+					break;
+				}
+				continue;
+			}
+
+			if (first_callchain)
+				first_callchain = false;
+			else
+				fputc(',', out);
+
+			ok = thread__find_symbol(al.thread, cpumode, ip, &tal);
+			output_sample_callchain_entry(tool, ip, ok ? &tal : NULL);
