{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "YouTube per-CPU CGroup residency analysis (with new fbt changes)\n", "=======================\n", "This is a run of experiments/run_youtube.py with the cgroups module enabled.\n", "This notebook parses and plots the trace.html\n", "\n", "Following are the additional commits included:\n", "```\n", "b1d860bc1222 (HEAD) eas tprints\n", "17023f8cc8fc sched/fair: run eas sync only if cpu about to idle\n", "3e20aa321989 sched/fair: increase chances to use energy_diff\n", "ca40b21b8554 events: add tracepoint for find_best_target\n", "c62979a17401 sched/fair: streamline find_best_target heuristics\n", "6755077a1cde build touch screen in\n", "```" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Populating the interactive namespace from numpy and matplotlib\n" ] } ], "source": [ "#!/usr/bin/env python\n", "%pylab inline\n", "import trappy\n", "from trace import Trace\n", "import logging\n", "import pandas as pd\n", "import numpy as np\n", "import os\n", "\n", "from conf import LisaLogging\n", "LisaLogging.setup(level=logging.ERROR)\n", "logging.info('#### Setup FTrace')\n", "path_to_html = \"/home/joelaf/repo/lisa-aosp/external/lisa/results/YouTube_eas_fbt_4.4.56-g931b784e1a3f-29952-gb1d860bc1222_trial2/trace.html\"" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": false }, "outputs": [], "source": [ "tr = Trace(None, path_to_html,\n", " cgroup_info = { \n", " 'cgroups': ['foreground', 'background', 'system-background', 'top-app', 'rt'],\n", " 'controller_ids': { 4: 'cpuset', 2: 'schedtune' }\n", " },\n", " events=[ 'sched_switch', 'cgroup_attach_task_devlib', 'cgroup_attach_task', 'sched_process_fork' ],\n", " normalize_time=False)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Total amount of time spent per Cgroup (schedtune)\n", "===========================\n", "(NaN is the idle task)" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": false, "scrolled": false }, "outputs": [ { "data": { "text/html": [ "
\n", " | cpu_0 | \n", "cpu_1 | \n", "cpu_2 | \n", "cpu_3 | \n", "cpu_4 | \n", "cpu_5 | \n", "cpu_6 | \n", "cpu_7 | \n", "total | \n", "
---|---|---|---|---|---|---|---|---|---|
schedtune | \n", "\n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " |
background | \n", "0.078974 | \n", "0.952785 | \n", "0.011557 | \n", "0.008316 | \n", "0.000000 | \n", "0.000000 | \n", "0.186345 | \n", "0.533103 | \n", "1.771080 | \n", "
foreground | \n", "3.405653 | \n", "3.143571 | \n", "1.418475 | \n", "0.896985 | \n", "0.662223 | \n", "0.166403 | \n", "0.241597 | \n", "0.317459 | \n", "10.252366 | \n", "
root | \n", "5.070404 | \n", "3.199380 | \n", "3.641579 | \n", "2.610207 | \n", "0.280362 | \n", "0.144083 | \n", "0.971765 | \n", "0.331811 | \n", "16.249591 | \n", "
top-app | \n", "0.430083 | \n", "0.273317 | \n", "0.131131 | \n", "0.091833 | \n", "4.176073 | \n", "2.836142 | \n", "1.130956 | \n", "0.297066 | \n", "9.366601 | \n", "
NaN | \n", "23.383548 | \n", "25.605660 | \n", "27.159864 | \n", "28.756723 | \n", "27.244724 | \n", "29.208070 | \n", "29.829145 | \n", "30.881370 | \n", "222.069104 | \n", "