lisa.wa.WASysfsExtractorCollector#

class lisa.wa.WASysfsExtractorCollector(wa_output, path, type='diff', **kwargs)[source]#

Bases: WAArtifactCollectorBase

WA collector for the syfs-extractor augmentation.

Example:

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)

    def _clean_variable(variable):
        if 'S4M_VDD_CPUCL0' in variable:
            return 'little-energy'
        if 'S3M_VDD_CPUCL1' in variable:
            return 'mid-energy'
        if 'S2M_VDD_CPUCL2' in variable:
            return 'big-energy'
        return ''

    df['variable'] = df['variable'].apply(_clean_variable)
    df['value'] = df['value'].astype(int)
    df['unit'] = "bogo-ujoules"

    # Add a total energy variable
    df = pd.concat([
        df,
        pd.DataFrame(data={
            'variable': 'total-energy',
            'value': [df['value'].sum()]
        })
    ])
    df.ffill(inplace=True)

    return df

df = WAOutput('.').get_collector(
        'sysfs-extractor',
        path='/sys/bus/iio/devices/iio:device0/energy_value',
        df_postprocess=pixel6_energy_meter
).df

Attributes

Properties

df inherited

pandas.DataFrame containing the data collected.

logger inherited

Convenience short-hand for self.get_logger().

stats inherited

Short-hand property equivalent to self.get_stats().

Methods

get_logger() inherited

Provides a logging.Logger named after cls.

get_stats() inherited

Returns a lisa.stats.Stats loaded with the result pandas.DataFrame.

log_locals() inherited

Debugging aid: log the local variables of the calling function.

Attributes#

WASysfsExtractorCollector.NAME = 'sysfs-extractor'#

Properties#

property WASysfsExtractorCollector.df#

Inherited property, see lisa.wa.WACollectorBase.df

pandas.DataFrame containing the data collected.

property WASysfsExtractorCollector.logger#

Inherited property, see lisa.utils.Loggable.logger

Convenience short-hand for self.get_logger().

property WASysfsExtractorCollector.stats#

Inherited property, see lisa.wa.StatsProp.stats

Short-hand property equivalent to self.get_stats().

Methods#

classmethod WASysfsExtractorCollector.get_logger(suffix=None)#

Inherited method, see lisa.utils.Loggable.get_logger()

Provides a logging.Logger named after cls.

WASysfsExtractorCollector.get_stats(ensure_default_groups=True, ref_group=None, agg_cols=None, **kwargs)#

Inherited method, see lisa.wa.StatsProp.get_stats()

Returns a lisa.stats.Stats loaded with the result pandas.DataFrame.

classmethod WASysfsExtractorCollector.log_locals(var_names=None, level='debug')#

Inherited method, see lisa.utils.Loggable.log_locals()

Debugging aid: log the local variables of the calling function.