How to Enable Intel® SoC Watch on Nexus (fugu) Player

<h3>For more detailed information coming from Intel Developer Forum 2015, go here:</h3>

<p><a href="https://software.intel.com/en-us/articles/idf2015-lab-notes-getting-your... Lab Notes: Getting your Nexus Player from shrink-wrap to Performance and Energy Analysis</a></p>

<h3><span style="line-height: 1.4;">SoCWatch Introduction</span></h3>

<p>Intel® SoC Watch is a command line tool for monitoring system behaviors related to power consumption on Intel® architecture-based platforms. It monitors power states, frequencies, bus activity, wakeups, and various other metrics that provide insight into the system’s energy efficiency.</p>

<p>After data collection, a summary file and raw data are produced by default on target system. The raw data (sw1) can be import to Intel Energy Profiler which is the same GUI as VTune Amplifier to correlate and visualize the system behavior over time. The summary file (csv) can be opened by Excel and make difference metric into graph for easier analysis.</p>

<h3>Grant root permission from Nexus player</h3>

<p>Nexus player is already release to market. The analysis tool need to grant the root permission performance data through kernel driver. You can follow this video tutorial steps: <a href="https://www.youtube.com/watch?v=7EWKbzqltGk&amp;feature=youtu.be">Nexus Player – How to Root Android* TV</a> in order to grant root permission. Once you have root permission, the device can recognize the su command in adb shell.&nbsp;</p>

<h3>Rebuild kernel and kernel configuration for Nexus player</h3>

<p>Google* disabled the module upload function in kernel configuration. For this reason, we need to download the kernel source from Google official website and rebuild the kernel only based on our customize config after modifying modify the kernel configuration.</p>

<p>Step1. Download the kernel source from Google official website</p>

<p>Step2. The kernel configuration must be configured with enabling the following options.</p>

<pre class="brush:bash;">export ARCH=x86

make fugu_defconfig

make menuconfig</pre>

<ul>
<li>CONFIG_MODULES=y</li>
<li>CONFIG_MODULE_UNLOAD=y</li>
<li>CONFIG_TRACEPOINTS=y</li>
<li>CONFIG_FRAME_POINTER=y</li>
<li>CONFIG_COMPAT=y</li>
<li>CONFIG_TIMER_STATS=y</li>
<li>CONFIG_X86_ACPI_CPUFREQ=m&nbsp;(or&nbsp;CONFIG_X86_ACPI_CPUFREQ=y)</li>
<li>CONFIG_INTEL_IDLE=y</li>
</ul>

<p>Step3. After build the kernel, the kernel file will be found under &lt; INSTALLATION_DIR_PATH &gt;\x86_64\arch\x86\boot\bzImage</p>

<pre class="brush:bash;">make –j4</pre>

<p>Step4. Build boot image with pre-built kernel</p>

<p>For Intel platform device, sometimes only flash kernel partition will be failed. Therefore, we will build one boot image with our pre-built favorite kernel inside. For this purpose, we can put the pre-built kernel inside the Android source tree and build the boot image only.</p>

<p>For a quick solution, we use the unpack/repack boot image script to build the boot image which is <a href="http://forum.xda-developers.com/showthread.php?t=2073775">Android Image Kitchen</a>. First you can download the factory image from <a href="https://developers.google.com/android/nexus/images#volantislrx21l">Google developers</a>. After use unpackimg.bat to extract the boot.img and the replace the &lt; INSTALLATION_DIR_PATH &gt;\split_img\boot.img-zImage with the bzImage you built before. At the end, using repackimg.bat to repack the new boot.img.</p>

<p>NOTE: Once your device can’t reboot anymore due to wrong flash instruction, you can plug off and on the power and long-press the hard key to make it run into fastboot mode. And then, using flash-all.bat script which is include in the factory image you download from Google developers to flash all images and recovery it.</p>

<p>Step5. Flash the new boot.img to the device.</p>

<pre class="brush:bash;">adb reboot bootloader

fastboot flash boot boot.img

fastboot reboot</pre>

<p>Now, you can check the kernel version to see if the flash is success or not. If so, we can start to build the Intel® SoC Watch driver based on this kernel source.</p>

<h3>Build the SoCWatch driver</h3>

<p>The driver source is included in the Intel® SoC Watch package which you can download from <a href="https://software.intel.com/en-us/intel-system-studio">Intel® System Studio</a>. The Intel® SoC Watch is one of the components in Intel® System Studio.</p>

<p>Step1. Build socperf1_2.ko via build driver script in &lt; INSTALLATION_DIR_PATH &gt;\soc_perf_driver\src\</p>

<pre class="brush:bash;">sh ./build-driver</pre>

<p>Step2. Build SOCWATCH1_5.ko via build driver script &lt; INSTALLATION_DIR_PATH &gt;\socwatch_driver\lxkernel\</p>

<pre class="brush:bash;">sh ./build-driver –k &lt;KERNEl_BUILD_DIR&gt; -s &lt;KERNEl_BUILD_DIR&gt;</pre>

<h3>Setup SoCWatch environment</h3>

<p>You can execute the installation file (socwatch_android_install.bat) after granting root permission via adb root command. However, we can’t easily make adb run in root default. For this situation, we set up the Intel®&nbsp; SoC Watch environment step by step.</p>

<p>The first step is to navigate to the Intel® SoC Watch directory and copy the necessary files into device. For this device, we only can push those files to sdcard location and then copy to /data/socwatch</p>

<pre class="brush:bash;">tools\os2unix.exe setup_socwatch_env.sh

tools\dos2unix.exe SOCWatchConfig.txt

adb push socwatch /sdcard/socwatch/

adb push setup_socwatch_env.sh /sdcard/socwatch/

adb push libs /sdcard/socwatch/libs/

adb push valleyview_soc /sdcard/socwatch/valleyview_soc/

adb push tangier_soc /sdcard/socwatch/tangier_soc/

adb push anniedale_soc /sdcard/socwatch/anniedale_soc/

adb push socperf1_2.ko /sdcard/socwatch/

adb push SOCWATCH1_5.ko /sdcard/socwatch/

adb shell

su

cp –r /sdcard/socwatch /data/

cd /data/socwatch

chmod 766 socwatch</pre>

<p>At the end you can refer the User Guide (see in attachment) for instructions to collect data. Once you got your output data after the data collection, you can pull the result file and have insight/analysis the target system with collected performance data in the host system.</p>

<p>[[{"fid":"457934","view_mode":"default","fields":{"format":"default","field_file_image_alt_text[und][0][value]":false,"field_file_image_title_text[und][0][value]":false,"field_tags[und]":""},"type":"media","link_text":null,"field_deltas":{"1":{"format":"default","field_file_image_alt_text[und][0][value]":false,"field_file_image_title_text[und][0][value]":false,"field_tags[und]":""}},"attributes":{"height":287,"width":624,"class":"media-element file-default"}}]]</p>
<p style="text-align: center;"><a class="button-blue-reg" href="https://software.intel.com/en-us/iot/home">Learn More</a>

For more complete information about compiler optimizations, see our Optimization Notice.
AttachmentSize
PDF icon SoCWatchForAndroid_v1_5_1.pdf1.21 MB

2 comments

Top
ASHISH G.'s picture

THANXXXXXXXXXXXXXXXXXXXX.........

Add a Comment

Have a technical question? Visit our forums. Have site or software product issues? Contact support.