1#!/bin/bash 2# Copyright 2021 Google Inc. 3# 4# Use of this source code is governed by a BSD-style license that can be 5# found in the LICENSE file. 6 7# Create a file /tmp/alljobs.csv by parsing jobs.json. 8 9set -e 10 11# Write the starting set of headers. 12echo Type,os,compiler,model,cpu_or_gpu,cpu_or_gpu_value,arch,configuration,test_filter,extra > /tmp/alljobs.csv 13 14# Extract the CSV values from the jobs.json file. 15# The seds parse up the job names into columns, ensuring that every column has a value. 16cat ../jobs.json | jq .[] -r | grep "^[Perf|Test]" | sed "s#-#,#g" | sed "s#All\$#All,none#g" >> /tmp/alljobs.csv 17 18# Add the vulkan column. 19mlr --csv -I put '$vulkan=$extra =~ "Vulkan"' /tmp/alljobs.csv 20 21# Add the metal column. 22mlr --csv -I put '$metal=$extra =~ "Metal"' /tmp/alljobs.csv 23 24# Add the skpbench column. 25mlr --csv -I put '$skpbench=$extra =~ "Skpbench"' /tmp/alljobs.csv 26 27# Validate the output file is a valid CSV file. 28mlr --icsv check /tmp/alljobs.csv 29