Another example script that collects the trace and converts it to json at the same time.