-From 3c92a5f8cb1476885b98df31dd1385067ed9f228 Mon Sep 17 00:00:00 2001
+From e0e72d8326f72f671c5861efbf5349e4aa6c56d1 Mon Sep 17 00:00:00 2001
 From: Nicholas Fraser <nfraser@codeweavers.com>
-Date: Wed, 24 Mar 2021 08:55:02 -0400
+Date: Wed, 31 Mar 2021 06:10:00 -0400
 Subject: [PATCH] perf data: Add JSON export
 
-This adds a feature to export perf data to a bespoke JSON file. It uses
-a (very) minimal inline JSON encoding, no external dependencies.
-Currently it only outputs some sample metadata but it's easily
-extensible.
+This adds a feature to export perf data to JSON.
+
+This is included in the Linux 5.13 kernel. For earlier kernel versions,
+you have to patch the same version of perf as your kernel (the version
+of perf and the kernel must match.)
+
+Built on 8bcfdd7cad3dffdd340f9a79098cbf331eb2cd53; applied upstream as
+d0713d4ca3e94827de77f8758e3e8045a0d85215.
 
 Signed-off-by: Nicholas Fraser <nfraser@codeweavers.com>
 ---
  tools/perf/Documentation/perf-data.txt |   5 +-
- tools/perf/builtin-data.c              |  39 ++++-
+ tools/perf/builtin-data.c              |  26 +-
  tools/perf/util/Build                  |   1 +
- tools/perf/util/data-convert-json.c    | 228 +++++++++++++++++++++++++
- tools/perf/util/data-convert-json.h    |   9 +
- tools/perf/util/data-convert.h         |   2 +
- 6 files changed, 276 insertions(+), 8 deletions(-)
+ tools/perf/util/data-convert-bt.c      |   2 +-
+ tools/perf/util/data-convert-bt.h      |  11 -
+ tools/perf/util/data-convert-json.c    | 384 +++++++++++++++++++++++++
+ tools/perf/util/data-convert.h         |  10 +
+ 7 files changed, 418 insertions(+), 21 deletions(-)
+ delete mode 100644 tools/perf/util/data-convert-bt.h
  create mode 100644 tools/perf/util/data-convert-json.c
- create mode 100644 tools/perf/util/data-convert-json.h
 
 diff --git a/tools/perf/Documentation/perf-data.txt b/tools/perf/Documentation/perf-data.txt
 index 726b9bc9e1a7..417bf17e265c 100644

 	argc = parse_options(argc, argv, options,
 			     data_convert_usage, 0);
 	if (argc) {
@@ -84,11 +82,38 @@ static int cmd_data_convert(int argc, const char **argv)
 		return -1;
 	}
 

+ * Copyright (C) 2021, CodeWeavers Inc. <nfraser@codeweavers.com>
+ */
+
+#include "data-convert.h"
+
+#include <fcntl.h>
+#include <inttypes.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+#include "linux/compiler.h"
+#include "linux/err.h"
