lisa.wa: Add collector for sysfs-extractor
Created by: vdonnefort
WA has a sysfs-extractor which copies the content of a folder before, after and generates a diff of it. The collector 'sysfs-extractor' leverages those artifacts.
Here's an example for the Pixel6 energy meters:
def pixel6_energy_meter(df): # Keep only CPU's meters df = df[df.value.str.contains('S4M_VDD_CPUCL0|S3M_VDD_CPUCL1|S2M_VDD_CPUCL2')] df[['variable', 'value']] = df.value.str.split(', ', expand=True) df['unit'] = "bogo-joules"
return df
df = WAOutput('pixel6/wa_output').get_collector( 'sysfs-extractor', path='/sys/bus/iio/devices/iio:device0/energy_value', df_postprocess=pixel6_energy_meter ).df