traced_probes: Add format files for 5.10.43 raven-userdebug

Catch up with a modern kernel.
Note this does NOT yet add any new kvm ftrace event
to the parsing list. It will be done by a follow-up
CL.

Bug: 222287725
Change-Id: I0b4d595e866b39050c590f6d9e7f17b6d38d1b79
diff --git a/tools/pull_ftrace_format_files.py b/tools/pull_ftrace_format_files.py
index 9f33df9..6926c01 100755
--- a/tools/pull_ftrace_format_files.py
+++ b/tools/pull_ftrace_format_files.py
@@ -34,7 +34,7 @@
   if serial:
     prefix += ['-s', serial]
   cmd = prefix + list(cmd)
-  output = subprocess.check_output(cmd).replace('\r', '')
+  output = subprocess.check_output(cmd, encoding='utf-8').replace('\r', '')
   return output
 
 
@@ -88,7 +88,7 @@
 def pull_format_files(serial, output_directory):
   # Pulling each file individually is 100x slower so we pipe all together then
   # split them on the host.
-  cmd = "find /sys/kernel/debug/tracing/ " \
+  cmd = "find /sys/kernel/tracing/ " \
       "-name available_events -o " \
       "-name format -o " \
       "-name header_event -o " \
@@ -97,14 +97,14 @@
       "while read f; do echo 'path:' $f; cat $f; done"
 
   output = adb('shell', cmd, serial=serial)
-  sections = output.split('path: /sys/kernel/debug/tracing/')
+  sections = output.split('path: /sys/kernel/tracing/')
   for section in sections:
     if not section:
       continue
     path, rest = section.split('\n', 1)
     path = os.path.join(output_directory, path)
     ensure_dir(os.path.dirname(path))
-    with open(path, 'wb') as f:
+    with open(path, 'w') as f:
       f.write(rest)
 
 
@@ -116,7 +116,8 @@
   parts = ['android', product, build_id, kernel]
   if prefix:
     parts = [prefix] + parts
-  return '_'.join(parts)
+  dir_name = '_'.join(parts)
+  return os.path.join(ROOT_DIR, 'src/traced/probes/ftrace/test/data', dir_name)
 
 
 def main():