Ejemplo n.º 1
0
    def __init__(self):
        Ftrace.__init__(self)
        self.function_available_file = self.tracing_dir + "available_filter_functions"
        self.function_filter_file = self.tracing_dir + "set_ftrace_filter"
        self.tracer_name = "function"

        self.CONFIG_DYNAMIC_FTRACE = "CONFIG_DYNAMIC_FTRACE"
Ejemplo n.º 2
0
    def __init__(self, kprobe_filter=None):
        Ftrace.__init__(self)
        self.events_dir = self.tracing_dir + "/events/kprobes/"
        self.events_file = self.tracing_dir + "/kprobe_events"
        self.trace_enable_file = self.events_dir + "/enable"
        self.kprobe_filter = kprobe_filter

        self.required_config_options = ["CONFIG_KPROBE_EVENTS"]
        self.pre_flight_checks()
Ejemplo n.º 3
0
def parse_file(filepath):
    trace = Ftrace(filepath)
    return (filepath, trace)
Ejemplo n.º 4
0
    parser.add_argument('-f',
                        '--file',
                        dest='file',
                        help='File (systrace/ftrace log) to parse')

    args = parser.parse_args()

    # Multi-core usage
    sb_all = DataFrame(columns=ALL_CPUS)
    arrays = [['BIG'] * 5 + ['LITTLE'] * 5, range(5) + range(5)]
    multi_index = MultiIndex.from_tuples(list(zip(*arrays)),
                                         names=['cluster', 'num_cores'])
    sb_by_cluster = DataFrame(index=multi_index)

    trace = Ftrace(args.file)
    total_duration = trace.duration

    # Freq
    df_freq = DataFrame(index=ALL_CPUS)
    df_freq.fillna(0, inplace=True)

    # LPM
    LPM_states = {
        -1: 'Busy',
        0: 'WFI',
        1: 'Retention',
        2: 'SPC (GDHS)',
        3: 'PC'
    }
    df_lpm = DataFrame(index=ALL_CPUS, columns=LPM_states.values())
Ejemplo n.º 5
0
import ftrace
from ftrace import Ftrace
from pandas import DataFrame

LITTLE_CLUSTER_MASK = 0x0F
BIG_CLUSTER_MASK = 0xF0

FREQ_ALL_CORES = [
    0, 480000, 807000, 1018000, 1210000, 1306000, 1517000, 1805000, 2016000,
    2304000, 2515000
]

LITTLE_CPUS = ftrace.common.unpack_bitmap(LITTLE_CLUSTER_MASK)
BIG_CPUS = ftrace.common.unpack_bitmap(BIG_CLUSTER_MASK)
ALL_CPUS = LITTLE_CPUS.union(BIG_CPUS)

# processing scripts for each file in directory
trace = Ftrace(r'Z:\EAS\Mate8_Default\music1.html')

df_freq = DataFrame(index=ALL_CPUS, columns=FREQ_ALL_CORES)
df_freq.fillna(0, inplace=True)
for cpu in range(8):
    for busy_interval in trace.cpu.busy_intervals(cpu=cpu):
        print "busy: " + str(busy_interval)
        for freq in trace.cpu.frequency_intervals(
                cpu=cpu, interval=busy_interval.interval):
            print "freq: " + str(freq)
            df_freq.loc[cpu, freq.frequency] += freq.interval.duration
Ejemplo n.º 6
0
from pandas import DataFrame
from collections import defaultdict
import ftrace
from ftrace import Ftrace
from ftrace import Interval

#trace.gpu.busy_time(interval=it)/it.duration
#trace.gpu.idle_time(interval=it)/it.duration
#trace.gpu.lpm_time(interval=it, state=ftrace.gpu.BusyState.NAP)/it.duration
#trace.gpu.lpm_time(interval=it, state=ftrace.gpu.BusyState.SLUMBER)/it.duration

# processing scripts for each file in directory
trace = Ftrace(r'C:\Users\c00759961\Documents\systrace\Baidu_scroll.html')
#print trace.android.framerate()
#print trace.gpu.frequency_intervals(interval=it) # trace.clock.frequency_intervals(clock='oxili_gfx3d_clk', interval=it)
#trace.bus.bimc_aggregate_requests(interval=it)
#print trace.cpu.seen_tasks(cpu=0)
#print trace.android.event_intervals(name='VSYNC')
#ti = ftrace.Interval(0, 0.0005)
#print trace.thermal.
#print trace.cpu.task_intervals(cpu=4, interval=ti)
#print trace.cpu.runqueue_depth_intervals(cpu=4, interval=ti)
#print trace.cpu.task_intervals(task=tt)[0]
#print "Input Latency\n----------------\n"
#print trace.android.rendering_intervals() #'irq/13-fts_touc'
#print "Switch Camera Latency\n----------------\n"
#print trace.camera.switch_device_intervals()
#print trace.android.event_intervals('AndroidCamera.open')
#print "\n----------------\n"
#print "FPS: {}".format(trace.android.framerate())
##print trace.cpu.idle_intervals(cpu=0)
Ejemplo n.º 7
0
    #total_duration = trace.duration if not INTERVAL else INTERVAL.duration
    return Series(data=data.values(), index=data.keys(), name=trace.filename) / total_duration

if __name__ == '__main__':
    parser = argparse.ArgumentParser(description='Power/Performance analysis of HMP platforms!')

    parser.add_argument('-t', '--time', dest='time',
                        help='hope to capture how long logs')

    args = parser.parse_args()

    #get all logs for analysis
    os.system('python getPhoneLogs.py -t ' + args.time)

    if os.path.exists(get_out_systrace_path()):
        trace = Ftrace(get_out_systrace_path())
    else:
        print 'error'
        exit(1)

    total_duration = trace.duration
    print 'trace.duration is ' + str(trace.duration)

    #get config from phone
    CLUSTER_CFG = get_cluster_config()
    CLUSTER_RELATED_CPUS = get_cluster_related_cpus()
    CLUSTER_AVAILABLE_FREQS = get_available_freqs()
    ALL_CPUS = get_all_cpus()

    # Multi-core usage
    sb_all = DataFrame(columns=ALL_CPUS)
Ejemplo n.º 8
0
 def __init__(self):
     Ftrace.__init__(self)
     self.events_dir = self.tracing_dir + "/events/block"
     self.filter_file = self.tracing_dir + "/events/block/filter"
     self.trace_enable_file = self.events_dir + "/enable"
Ejemplo n.º 9
0
def parse_file(filepath):
    trace = Ftrace(filepath, ['tsens_threshold_hit', 'tsens_read', 'tsens_threshold_clear', 'clock_set_rate'])
    return (filepath, trace)
Ejemplo n.º 10
0
    "tsens_tz_sensor2": "pop_mem",
    "tsens_tz_sensor6": "cpu7",
    "tsens_tz_sensor7": "cpu0",
    "tsens_tz_sensor8": "cpu1",
    "tsens_tz_sensor9": "cpu2",
    "tsens_tz_sensor10": "cpu3",
    "tsens_tz_sensor12": "gpu",
    "tsens_tz_sensor13": "cpu4",
    "tsens_tz_sensor14": "cpu5",
    "tsens_tz_sensor15": "cpu6",
}

CLKS =['a57_clk', 'a53_clk', 'oxili_gfx3d_clk']

trace = Ftrace(r'C:\Users\c00759961\Documents\temp\nina-MDA35B-camera-UHD-recording-after.html', 
               ['tsens_read', 'tsens_threshold_clear', 'tsens_threshold_hit', 
                'clock_set_rate', 'clock_enable', 'clock_disable'])
   
start = Timestamp('1/1/1970')
#end = start + Second(trace.duration)

NAMES = [TSENS_ALIAS[tsens] for tsens in trace.thermal.names if tsens in TSENS_ALIAS] + CLKS
df_therm = DataFrame(columns=NAMES)
#index=period_range(start=start, end=end, freq='1U')
for tsens in trace.thermal.names:
    for therm in trace.thermal.temp_intervals(tsens=tsens):
        df_therm.loc[start + Micro(therm.interval.end*1e6), TSENS_ALIAS[tsens]] = therm.temp

# lets look at clocks.
for clk in CLKS:
    for freq_event in trace.clock.frequency_intervals(clock=clk):
Ejemplo n.º 11
0
    "tsens_tz_sensor9": "cpu2",
    "tsens_tz_sensor10": "cpu3",
    "tsens_tz_sensor12": "gpu",
    "tsens_tz_sensor13": "cpu4",
    "tsens_tz_sensor14": "cpu5",
    "tsens_tz_sensor15": "cpu6",
}

CLKS = ['a57_clk', 'a53_clk', 'oxili_gfx3d_clk']

start = Timestamp('1/1/1970')

if __name__ == '__main__':

    trace = Ftrace(filepath, [
        'tsens_threshold_hit', 'tsens_read', 'tsens_threshold_clear',
        'clock_set_rate'
    ])

    # duration
    total_duration = trace.duration

    # Thermal
    NAMES = [
        TSENS_ALIAS[tsens]
        for tsens in trace.thermal.names if tsens in TSENS_ALIAS
    ] + CLKS
    df_therm = DataFrame(columns=NAMES)
    for tsens in trace.thermal.names:
        for therm in trace.thermal.temp_intervals(tsens=tsens, interval=None):
            df_therm.loc[start + Micro(therm.interval.start * 1e6),
                         TSENS_ALIAS[tsens]] = therm.temp
Ejemplo n.º 12
0
def parse_file(filepath):
    trace = Ftrace(filepath, tracepoints='sched_hmp_migrate')
    return (filepath, trace)