<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Productivity Sync</title>
	<atom:link href="http://thegnar.org/sync/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://thegnar.org/sync</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Sun, 05 May 2013 23:09:02 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Random things this weekend&#8230;</title>
		<link>http://thegnar.org/sync/?p=314</link>
		<comments>http://thegnar.org/sync/?p=314#comments</comments>
		<pubDate>Sun, 05 May 2013 22:18:57 +0000</pubDate>
		<dc:creator>markgross</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://thegnar.org/sync/?p=314</guid>
		<description><![CDATA[Find tricks: find /sys/devices/ -name driver -exec file &#8220;{}&#8221; \; &#124; sed &#8220;s&#124;^.*\.\.&#124;&#124;&#8221; &#124; sort -u &#124; wc &#160; Building mobi&#8217;s from XML files: I was trying to convert a docbook based document from xml to mobi. http://files.kroah.com/lkn/lkn_xml.tar.gz  to mobi. The steps are:run dbtoepub after getting the xml / docbook stuff, and any dtd files (say [...]]]></description>
				<content:encoded><![CDATA[<h2>Find tricks:</h2>
<p>find /sys/devices/ -name driver -exec file &#8220;{}&#8221; \; | sed &#8220;s|^.*\.\.||&#8221; | sort -u | wc</p>
<p>&nbsp;</p>
<h2>Building mobi&#8217;s from XML files:</h2>
<p>I was trying to convert a docbook based document from xml to mobi. http://files.kroah.com/lkn/lkn_xml.tar.gz  to mobi.</p>
<p>The steps are:run dbtoepub after getting the xml / docbook stuff, and any dtd files (say the safary_future.dtd files needed) Then run the kindlegen program <a href="http://www.amazon.com/gp/feature.html?ie=UTF8&amp;docId=1000234621">http://www.amazon.com/gp/feature.html?ie=UTF8&amp;docId=1000234621</a> on the ebub file.</p>
<p>FWIW I ended up getting the dtd file by cloning a repo on git hub git://github.com/sebastianbergmann/phpunit-documentation.git and copying its dblite directory to my /opt/tools/docbook/ directory.</p>
<p>Then I still had problems with a few missing xml files so I deleted their reference (metadata.xml, cyprt.xml)  from the book.xml The resulting mobi file looks to work fine on my tablet running the kindle reader apk.</p>
<p>&nbsp;</p>
<h2>Linux kernel spelunking of the /sys directory</h2>
<p>The sysf directory has a lot of interesting data in it.  I&#8217;m looking to identify all the drivers and modules and devices my system thinks it has in it.  To this end I&#8217;ve been using grep and find and now setting up to implement a python program to extract the &#8220;drivers&#8221; the running kernel thinks it has access too as well as the &#8220;device&#8221;s  it knows about, and the set of &#8220;modules&#8221; it has (even if they are not loaded).  I should be able to map the drivers in use to devices and kernel config settings.  I should also be able to identify devices that are missing drivers.  I should be able to identify drivers that really are unneeded.</p>
<p>At least thats what I &#8220;feel&#8221; I should be able to do.  The reality is there are things happening to complicate my simple assumptions.  As I get into this exploration I&#8217;ll fill in the details.  But, by running a few find commands I can identify all the drivers the system thinks it has access too at runtime (by searching for bind in the /sysfs tree using find).  I can also know all the modules the system knows about by listing the /sys/module/ directory.  I can identify all the drivers associated with devices by searching for &#8220;driver&#8221; using find.  I can find all the devices and drivers that have issues a udev envent by finding all instances of  &#8221;modalias&#8221; using find.</p>
<p>The problems I have is that the numbers don&#8217;t add up yet:</p>
<pre>Linux mgross-MOBL 3.9.0 #8 SMP Sun May 5 12:30:05 PDT 2013 x86_64 x86_64 x86_64 GNU/Linux
mgross@mgross-MOBL:~$ find /sys/ -name device -exec file "{}" \; | sed "s|^.*\.\.||" | sort -u | wc
 124 172 2795
mgross@mgross-MOBL:~$ find /sys/ -name driver -exec file "{}" \; | sed "s|^.*\.\.||" | sort -u | wc
 42 44 1121
mgross@mgross-MOBL:~$ find /sys/ -name unbind | wc
 60 63 2226</pre>
<pre>mgross@mgross-MOBL:~$ find /sys/ -name bind | wc
 62 65 2192

mgross@mgross-MOBL:~$ find /sys/ -name refcnt -exec cat "{}" \; | wc

<em> 101 101 225</em></pre>
<pre><em id="__mceDel"><em>mgross@mgross-MOBL:~$ find /sys/ -name refcnt -exec cat "{}" \; | grep -v 0 | wc
 67 67 138
mgross@mgross-MOBL:~$ lsmod | wc
 102 361 4543
mgross@mgross-MOBL:~$ find /sys/ -name modalias | wc
 135 135 8093
</em></em></pre>
<pre>mgross@mgross-MOBL:~$ find /sys/ -name module | wc
 33 33 1198</pre>
<pre>mgross@mgross-MOBL:~$ ls /sys/module/ | wc
 144 144 1332</pre>
<pre><em id="__mceDel"> </em></pre>
<p>So I have 101 modules loaded and 43 drivers (modules tend to be drivers and I feel the 43 &#8220;drivers&#8221; should include drivers that are loaded a modules. Yet I can bind/unbind only 62(or 60) drivers from devices and the system thinks there are 144 modules going on.</p>
<p>Something isn&#8217;t adding up for me just yet.  Clearly my definition of device, driver, and module I am assuming does not match up with reality here.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://thegnar.org/sync/?feed=rss2&#038;p=314</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up mod_wsgi to host flaskr</title>
		<link>http://thegnar.org/sync/?p=301</link>
		<comments>http://thegnar.org/sync/?p=301#comments</comments>
		<pubDate>Mon, 15 Apr 2013 00:47:56 +0000</pubDate>
		<dc:creator>markgross</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://thegnar.org/sync/?p=301</guid>
		<description><![CDATA[Problems and gotchas: &#160; I spent a bunch of time today getting apache2 with mod_wsgi to share up the Flask sample application: &#8220;flaskr&#8221;  this is posting to capture the issues and solutions so when I look at this again I won&#8217;t be starting from scratch. Setting up the virtual env within the *.wsgi file failed. [...]]]></description>
				<content:encoded><![CDATA[<h2>Problems and gotchas:</h2>
<p>&nbsp;</p>
<p>I spent a bunch of time today getting apache2 with mod_wsgi to share up the <a title="flask" href="http://flask.pocoo.org/">Flask</a> sample application: &#8220;flaskr&#8221;  this is posting to capture the issues and solutions so when I look at this again I won&#8217;t be starting from scratch.</p>
<p>Setting up the virtual env within the *.wsgi file failed. I tried the activate_this.py thing but it never worked.</p>
<p>I kept getting a syntax error form mod_wsgi in the /var/FLASK/flaskr/flaskr.wsgi file on the line &#8220; import sys&#8221;!!!! I eventually worked around it by setting the WSGIPythonPath in the apache2.conf file. (no clue on why it failed or why changing the apache2.conf fixed it)</p>
<p>I forgot to turn my flask app into a &#8220;module&#8221; the from flaskr import app line of the flaskr.wsgi file was failing because my app was a program an not a module that could be imported. Then I needed to fix up the import path to work with the sys.path I set up.</p>
<p>Finally the search path to the sqlite3 data base was path relative in my flask.py. It needs to be absolute for mod_wsgi to work ok.</p>
<p>yup it was a pain in the butt.</p>
<h2>Ref URLs</h2>
<div><a href="http://www.subdimension.co.uk/2012/04/24/Deploying_Flask_to_Apache.html">http://www.subdimension.co.uk/2012/04/24/Deploying_Flask_to_Apache.html</a></div>
<div><a href="https://code.google.com/p/modwsgi/wiki/VirtualEnvironments">https://code.google.com/p/modwsgi/wiki/VirtualEnvironments</a></div>
<div><a href="http://flask.pocoo.org/docs/deploying/mod_wsgi/">http://flask.pocoo.org/docs/deploying/mod_wsgi/</a></div>
<div><a href="http://thegnar.org/sync/?p=1">http://thegnar.org/sync/?p=1</a></div>
<div><a href="http://thegnar.org/sync/?p=299">http://thegnar.org/sync/?p=299</a></div>
<div></div>
<h2>Configurations:</h2>
<h3>wsgi user account:</h3>
<pre>useradd -M flask
usermod -s /bin/false flask
usermod -L flask
adduser flask www-dat</pre>
<h3>/etc/apache2/apache2.config:</h3>
<p>add the following to the end of the file:</p>
<pre>WSGIPythonHome /var/FLASK/venv</pre>
<h3>/etc/apache2/sites-available/default:</h3>
<p>put the following in the &lt;VirtualHost *:80&gt; section</p>
<pre> WSGIDaemonProcess flaskr user=flask group=www-data threads=5 home=/var/FLASK
 WSGIScriptAlias /flaskr /var/FLASK/flaskr/flaskr.wsgi
 &lt;Directory "/var/FLASK/flaskr"&gt;
   WSGIProcessGroup flaskr
   WSGIApplicationGroup %{GLOBAL}
   WSGIScriptReloading On
   Order deny,allow
   Allow from all
 &lt;/Directory&gt;</pre>
<h3>Set up working directory and virtualenv to use (do as root):</h3>
<pre>mkdir /var/FLASK/
 cd /var/FLASK
 virtualenv --no-site-packages venv
 . venv/bin/activate
 pip install Flask
 cp -r /home/&lt;username&gt;/dev/flaskr .
 chown -R flask:flask /var/FLASK</pre>
<h3>/var/FLASK/flaskr/flaskr.wsgi:</h3>
<pre>import sys
sys.path.insert(0, '/var/FLASK')
from flaskr.flaskr import app as application</pre>
]]></content:encoded>
			<wfw:commentRss>http://thegnar.org/sync/?feed=rss2&#038;p=301</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Virtual Box bridge interface and ProxyChains</title>
		<link>http://thegnar.org/sync/?p=299</link>
		<comments>http://thegnar.org/sync/?p=299#comments</comments>
		<pubDate>Mon, 15 Apr 2013 00:27:21 +0000</pubDate>
		<dc:creator>markgross</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://thegnar.org/sync/?p=299</guid>
		<description><![CDATA[How to experiment with apache2-mod_wsgi using virtual box: I wanted to figure out how to deploy Flask applications on my work computer without screwing it up too much with experimentation and hacking around in crazy ass ways.  So I decided to deploy it on a Virtual box ubuntu guest OS.  But to make it work I need [...]]]></description>
				<content:encoded><![CDATA[<h1>How to experiment with apache2-mod_wsgi using virtual box:</h1>
<p>I wanted to figure out how to deploy Flask applications on my work computer without screwing it up too much with experimentation and hacking around in crazy ass ways.  So I decided to deploy it on a Virtual box ubuntu guest OS.  But to make it work I need the VBox guest to open up port 80 that my host could somehow send http requets too.</p>
<p>This post is basically a SOCKS enhanced version of the bridging information I posted about in 2009 <a href="http://thegnar.org/sync/?p=1">http://thegnar.org/sync/?p=1</a></p>
<p>The steps are:</p>
<ul>
<li>HOST:
<ul>
<li>
<pre>sudo apt-get install bridge-utils uml-utilities ssh</pre>
</li>
<li>
<pre>add to /etc/ssh/sshd_config: AllowTcpForwarding yes</pre>
</li>
<li>create a vboxbridge.sh scrip:</li>
</ul>
</li>
</ul>
<pre># create a tap
sudo tunctl -t tap1 -u &lt;username&gt;
sudo ip link set up dev tap1</pre>
<pre># create the bridge
sudo brctl addbr br0
sudo brctl addif br0 tap1</pre>
<pre># set the IP address and routing
sudo ip link set up dev br0
sudo ip addr add 10.1.1.1/24 dev br0
sudo ip route add 10.1.1.0/24 dev br0</pre>
<ul>
<ul>
<li>Install VirtualBox</li>
<li>build a ubuntu guest VM from an ISO file.</li>
<li>After settup and installations are finished you will Configure it to use bridged networking on the tap1 interface</li>
<li>For initial setup you will use NAT to because of proxy issues with bridging to tap1.</li>
</ul>
<li>Guest
<ul>
<li><span style="text-align: justify;">apt-get install tmux apache2 vim  ssh pyflakes pep8 python-setuptools python-virtualenv proxychains libapache2-mod-wsgi</span></li>
<li><span style="text-align: justify;">/etc/proxychains.conf: [ProxyList] socks5 127.0.0.1 9999</span></li>
<li><span style="text-align: justify;">Firefox: about:config (in addressbar):  network.prox.sock_remote_dns true</span></li>
<li><span style="text-align: justify;">Firefox manual proxy setting:  localhost Port 9999, SOCKSv5</span></li>
<li><span style="text-align: justify;">ssh -C &lt;host_username&gt;@10.1.1.1 -D 9999 -N</span></li>
</ul>
</li>
</ul>
<p>&nbsp;</p>
<p>with this configuration / set up the Vbox guest is now able to host a web server to 10.1.1.2:80 to the host OS.  Also, the guest web browser works ok and I can use &#8220;proxychains apt-get&#8221; and proxify other non proxy aware applications using proxychains.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://thegnar.org/sync/?feed=rss2&#038;p=299</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>tmux is the bomb</title>
		<link>http://thegnar.org/sync/?p=291</link>
		<comments>http://thegnar.org/sync/?p=291#comments</comments>
		<pubDate>Fri, 22 Mar 2013 21:35:14 +0000</pubDate>
		<dc:creator>markgross</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://thegnar.org/sync/?p=291</guid>
		<description><![CDATA[I&#8217;ve been a screen user for a few years and just stumbled across tmux and I&#8217;m switching. tmux handles paned windows and resizing so much better and its currently under active development where screen has been stagnant since 2005 (I think). Getting going with tmux I only really need a handful of commands and for [...]]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve been a screen user for a few years and just stumbled across tmux and I&#8217;m switching.</p>
<p>tmux handles paned windows and resizing so much better and its currently under active development where screen has been stagnant since 2005 (I think).</p>
<p>Getting going with tmux I only really need a handful of commands and for me it seems less cryptic than screen.  BTW I&#8217;m sticking with the ctrl-b as the command prefix key because I use minicom and with tmux I can have a minicom session in a screen pane.  yay!</p>
<p>TMUX commands I use:</p>
<ul>
<li>^b %  &#8212; vertical split</li>
<li>^b &#8220;  &#8212; horizontal split</li>
<li>^b &lt;arrow key&gt; &#8212; move between panes.</li>
<li>^b &lt;alt&gt;+&lt;arrow&gt;  &#8212; adjust size of current pane</li>
<li>^b &lt;pg-up&gt;  &#8212; scroll up the history buffer
<ul>
<li>when in copy mode ^s for search down (will wrap in buffer)</li>
<li>when in search mode n will go to next and N will search the opposite direction</li>
<li>q exist page up / copy mode</li>
</ul>
</li>
<li>^b ,   &#8212; rename current window tab</li>
<li>^b n &#8212; cycle to next window tab</li>
<li>^b p &#8212; cycle to previous window tab</li>
<li>^b d  &#8212; detach from session</li>
<li>tmux att -t &lt;session name&gt;  &#8212; attach to session by name</li>
<li>tmux ls  &#8212; list sessions</li>
<li>^b :break-pane  &#8212; move current pane to a tab&#8217;ed window</li>
<li>^b :join-pane -t dest-wind  &#8212; move current window to dest-wind as a pane.</li>
<li>^b ? brings up a help page of key bindings</li>
</ul>
<p>&nbsp;</p>
<p>There are copy and past things but I will use my host to do those outside of tmux so I have not bothered figuring that out.</p>
<p>&nbsp;</p>
<p>.tmux.conf file:</p>
<pre>set -g history-limit 50000                                                                                                                             │
set -g default-terminal screen-256color                                                                                                                │
setw -g aggressive-resize on</pre>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://thegnar.org/sync/?feed=rss2&#038;p=291</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Memory and Power tuning of my HP Envy-17 laptop running ubutnu 12.04</title>
		<link>http://thegnar.org/sync/?p=286</link>
		<comments>http://thegnar.org/sync/?p=286#comments</comments>
		<pubDate>Sat, 23 Feb 2013 22:56:43 +0000</pubDate>
		<dc:creator>markgross</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://thegnar.org/sync/?p=286</guid>
		<description><![CDATA[About the box:  home is on an SSD and so is the root.  There is a spinning drive as well.  It has 16GB of 1600MHz RAM. &#160; http://youtu.be/XloTXFgNL7s installed laptop-mode-tools changed my sysctl.conf to set &#8220;vm.swappieness=2&#8243; set my fstab to use ramdisks for temp directories tmpfs /tmp       tmpfs noatime,mode=1777,size=1350m 0 0 tmpfs /var/tmp   tmpfs noatime,mode=1777,size=1350m [...]]]></description>
				<content:encoded><![CDATA[<p>About the box:  home is on an SSD and so is the root.  There is a spinning drive as well.  It has 16GB of 1600MHz RAM.</p>
<p>&nbsp;</p>
<ul>
<li><a href="http://youtu.be/XloTXFgNL7s">http://youtu.be/XloTXFgNL7s</a></li>
<li>installed laptop-mode-tools</li>
<li>changed my sysctl.conf to set &#8220;vm.swappieness=2&#8243;</li>
<li>set my fstab to use ramdisks for temp directories
<ul>
<li>tmpfs /tmp       tmpfs noatime,mode=1777,size=1350m 0 0<br />
tmpfs /var/tmp   tmpfs noatime,mode=1777,size=1350m 0 0<br />
tmpfs /var/spool tmpfs noatime,mode=1777,size=1350m 0 0<br />
tmpfs /var/log   tmpfs noatime,mode=0755,size=1350m 0 0</li>
</ul>
</li>
<li>mounted my root using &#8220;noatime,nodiratime,discard,errors=remount-ro&#8221;</li>
<li>turned off the discrete graphics in my rc.local ! <strong> This dropped my burn rate from 45W to 13W!!</strong>
<ul>
<li>echo &#8216;OFF&#8217; &gt; /sys/kernel/debug/vgaswitcheroo/switch</li>
</ul>
</li>
<li></li>
<li> lastly I put the following into my rc.local to avoid some latencies in the file system.  It may be overkill:</li>
<li>
<pre>for dev in sda sdb sdc
do
QSZ=1024
  DEV=/sys/block/$dev/queue/nr_requests
  if [ -r $DEV ]; then
    echo $QSZ &gt; $DEV
  fi

QSZ=1024
  DEV=/sys/block/$dev/queue/read_ahead_kb
  if [ -r $DEV ]; then
    echo $QSZ &gt; $DEV
  fi
done

</pre>
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://thegnar.org/sync/?feed=rss2&#038;p=286</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>man dpkg example worth remembering</title>
		<link>http://thegnar.org/sync/?p=280</link>
		<comments>http://thegnar.org/sync/?p=280#comments</comments>
		<pubDate>Sat, 23 Feb 2013 14:51:46 +0000</pubDate>
		<dc:creator>markgross</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://thegnar.org/sync/?p=280</guid>
		<description><![CDATA[copy and paste from the man page for dpkg(1): To make a local copy of the package selection states: dpkg --get-selections &#62;myselections You might transfer this file to another computer, and install it there with: dpkg --clear-selections dpkg --set-selections &#60;myselections Note that this will not actually install or remove anything, but just set the selection [...]]]></description>
				<content:encoded><![CDATA[<p>copy and paste from the man page for dpkg(1):</p>
<p>To make a local copy of the package selection states:</p>
<pre>dpkg --get-selections &gt;myselections</pre>
<p>You might transfer this file to another computer, and install it there with:</p>
<pre>dpkg --clear-selections</pre>
<pre>dpkg --set-selections &lt;myselections</pre>
<p>Note that this will not actually install or remove anything, but just set the selection state on the requested packages. You will need some other application to actually<br />
download and install the requested packages. For example, run</p>
<pre>apt-get dselect-upgrade.</pre>
]]></content:encoded>
			<wfw:commentRss>http://thegnar.org/sync/?feed=rss2&#038;p=280</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Android Power HAL</title>
		<link>http://thegnar.org/sync/?p=275</link>
		<comments>http://thegnar.org/sync/?p=275#comments</comments>
		<pubDate>Sun, 03 Feb 2013 15:42:45 +0000</pubDate>
		<dc:creator>markgross</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://thegnar.org/sync/?p=275</guid>
		<description><![CDATA[A brief overview: The power HAL came to AOSP in the Jelly Bean release.  Its reason for being was to end of life the early suspend notification call chains in the kernel that Android power management was dependent on.  It has since then expanded to become the user mode agent for boosting the platform performance [...]]]></description>
				<content:encoded><![CDATA[<h2>A brief overview:</h2>
<p>The power HAL came to AOSP in the Jelly Bean release.  Its reason for being was to end of life the early suspend notification call chains in the kernel that Android power management was dependent on.  It has since then expanded to become the user mode agent for boosting the platform performance when user interactivity is important.  This blog posts documents its current implementation in the AOSP master branch as of Feb 2, 2013.</p>
<h3>Important files:</h3>
<ul>
<li>Interface spec for power HAL plug in power.$(TARGET_BOARD_PLATFORM).so:
<ul>
<li>hardware/libhardware/include/hardware/power.h</li>
<li>The comments are very useful and pretty much explain the powerHAL design in use.</li>
</ul>
</li>
<li>Sample implementations of power HAL power.$(TARGET_BOARD_PLATFORM).so file can be found (hint: look at the Android.mk&#8217;s for these as well as the c code):
<ul>
<li>hardware/qcom/power</li>
<li>device/asus/grouper/power</li>
<li>device/samsung/manta/power</li>
<li>device/samsung/tuna/power</li>
<li>device/generic/goldfish/power</li>
</ul>
</li>
<li>Callers of setInteractive powerHAL entry point:
<ul>
<li>frameworks/base/services/jni/com_android_server_power_PowerManagerService.cpp</li>
</ul>
</li>
<li>Callers of powerHint powerHAL entry point:
<ul>
<li>frameworks/base/services/jni/com_android_server_power_PowerManagerService.cpp</li>
<li>frameworks/native/services/surfaceflinger/DisplayHardware/PowerHAL.cpp</li>
</ul>
</li>
</ul>
<p>Pretty simple.  setInteractive is basically called when the screen is turned on and off with different parrameters with the expectation that the powerHAL .so file will poke the kernel interfaces to notify whatever is needed to be notified that the screen is off or on.  powerHint is used for busting the performance on user interactivity or graphics activity going on (UI / UX animations)</p>
<p>There isn&#8217;t much more to say other than you should look a the example implementations of powerHAL&#8217;s available to get an idea on how people have implemented it for specific hardware and mimic them for yours.  When ready you simply add &#8220;power.&lt;your target board platform name&gt;&#8221; to the PRODUCT_PACKAGES list in your device&#8217;s AndroidProducts.mk (or a mk file that AndroidProducts includes) and you have a Power HAL.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://thegnar.org/sync/?feed=rss2&#038;p=275</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AOSP master branch build times.</title>
		<link>http://thegnar.org/sync/?p=260</link>
		<comments>http://thegnar.org/sync/?p=260#comments</comments>
		<pubDate>Tue, 29 Jan 2013 04:43:49 +0000</pubDate>
		<dc:creator>markgross</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://thegnar.org/sync/?p=260</guid>
		<description><![CDATA[building asop master branch as of Jan 28, 2013 system build time comparisons: lunch full_x86; Dual Socket workstation 2 Intel(R) Xeon(R) CPU E5-2680 0 @ 2.70GHz cpu&#8217;s (each cpu has 8 cores with HT) 32GB 1333MHz ram 7200RPM HD no ccache time nohup make -j 32 mgross@mtgdev:~/work/master$ time nohup make -j 32 nohup: ignoring input [...]]]></description>
				<content:encoded><![CDATA[<p>building asop master branch as of Jan 28, 2013 system build time comparisons:</p>
<p>lunch full_x86;</p>
<p><strong>Dual Socket workstation 2 Intel(R) Xeon(R) CPU E5-2680 0 @ 2.70GHz cpu&#8217;s (each cpu has 8 cores with HT) 32GB 1333MHz ram 7200RPM HD</strong></p>
<p>no ccache time nohup make -j 32</p>
<p>mgross@mtgdev:~/work/master$ time nohup make -j 32<br />
nohup: ignoring input and appending output to `nohup.out&#8217;</p>
<p>real    17m12.243s<br />
user    392m0.962s<br />
sys    14m10.229s</p>
<p>with a primed ccache on SSD:</p>
<p>time nohup make -j 32<br />
nohup: ignoring input and appending output to `nohup.out&#8217;</p>
<p>real    8m27.191s<br />
user    66m11.256s<br />
sys    4m43.330s</p>
<p>mgross@mtgdev:~/work/master$ ccache -s<br />
cache directory                     /mnt/ssd/home/mgross/work/master/ccache<br />
cache hit (direct)                     0<br />
cache hit (preprocessed)           15346<br />
cache miss                         15400<br />
called for link                      944<br />
unsupported source language          680<br />
unsupported compiler option          180<br />
files in cache                     30800<br />
cache size                           4.1 Gbytes<br />
max files                       10000000<br />
max cache size                      16.0 Gbytes</p>
<p>&nbsp;</p>
<p><strong>HP Envy 17: i7 quad Intel(R) Core(TM) i7-2760QM CPU @ 2.40GHz 16GB 1600Mhz DDR3 7200RPM HD</strong></p>
<p>no ccache: time nohup make -j 8</p>
<p><em id="__mceDel">nohup: ignoring input and appending output to `nohup.out&#8217;</em></p>
<p>real 63m0.631s<br />
user 440m56.765s<br />
sys 13m22.894s</p>
<p>After priming the ccache (is on SSD, build on 7200RPM HD) and then rebuilding (after a reboot):</p>
<p>time nohup make -j 8<br />
nohup: ignoring input and appending output to `nohup.out&#8217;</p>
<p>real 17m44.246s<br />
user 76m37.079s<br />
sys 4m51.046s<br />
mgross@mgross-MOBL:~/work/master$ ccache -s<br />
cache directory /mnt/ssd/home/mgross/work/master/ccache<br />
cache hit (direct) 0<br />
cache hit (preprocessed) 15345<br />
cache miss 15401<br />
called for link 944<br />
can&#8217;t use precompiled header 961<br />
unsupported source language 680<br />
compiler check failed 329<br />
unsupported compiler option 180<br />
files in cache 30802<br />
cache size 4.1 Gbytes<br />
max files 500000<br />
max cache size 8.0 Gbytes<br />
mgross@mgross-MOBL:~/work/master$</p>
<p><strong>Lenovo ThinkPad X220 : i5 dual core  Intel(R) Core(TM) i5-2520M CPU @ 2.50GHz 8GB 1600Mhz DDR3 SSD</strong></p>
<p>no ccache: time nohup make -j 4nohup:</p>
<p>ignoring input and appending output to `nohup.out&#8217;</p>
<p>real    111m1.760s<br />
user    412m5.845s<br />
sys    13m2.241s</p>
<p>Building with a primed ccache (build + ccache on same SSD) time nohup make -j 4<br />
nohup: ignoring input and appending output to `nohup.out&#8217;</p>
<p>real    24m13.602s<br />
user    77m27.790s<br />
sys    5m4.503s</p>
<p>mgross@MGROSS-X220VM:~/work/master$ ccache -s<br />
cache directory                     /mnt/ssd/home/mgross/work/master/ccache<br />
cache hit (direct)                     0<br />
cache hit (preprocessed)           15345<br />
cache miss                         15401<br />
called for link                      944<br />
unsupported source language          680<br />
unsupported compiler option          180<br />
files in cache                     30802<br />
cache size                           4.1 Gbytes<br />
max files                       10000000<br />
max cache size                      16.0 Gbytes</p>
<p>&nbsp;</p>
<p><strong>HP G62 : i3 dual core Intel(R) Core(TM) i3 CPU       M 330  @ 2.13GHz 8GB 1066Mhz DDR3 7200RPM HD</strong></p>
<p>no ccache: time nohup make -j 4</p>
<p>nohup: ignoring input and appending output to `nohup.out&#8217;</p>
<p>real    176m56.178s<br />
user    638m14.293s<br />
sys    19m45.450s</p>
<p><strong> using primed ccache : time nohup make -j 4</strong><br />
nohup: ignoring input and appending output to `nohup.out&#8217;<br />
real    45m38.374s<br />
user    122m15.186s<br />
sys    7m46.397s</p>
<p>mgross@G62-mgross:~/Work/master$ ccache -s<br />
cache directory                     /home/mgross/Work/master/ccache<br />
cache hit (direct)                     0<br />
cache hit (preprocessed)           15344<br />
cache miss                         15402<br />
called for link                      944<br />
unsupported source language          680<br />
unsupported compiler option          180<br />
files in cache                     30804<br />
cache size                           4.1 Gbytes<br />
max files                        1000000<br />
max cache size                      10.0 Gbytes<br />
mgross@G62-mgross:~/Work/master$</p>
<p><strong>HP Mini 210:  Intel(R) Atom(TM) CPU N455   @ 1.66GHz 2GB ram SSD</strong></p>
<p>time nohup make -j 1<br />
nohup: ignoring input and appending output to `nohup.out&#8217;</p>
<p>real    1311m52.342s<br />
user    1337m23.875s<br />
sys    55m11.231s</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://thegnar.org/sync/?feed=rss2&#038;p=260</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>building mame on ubutnu 11.04</title>
		<link>http://thegnar.org/sync/?p=224</link>
		<comments>http://thegnar.org/sync/?p=224#comments</comments>
		<pubDate>Mon, 30 Jul 2012 01:35:31 +0000</pubDate>
		<dc:creator>markgross</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://thegnar.org/sync/?p=224</guid>
		<description><![CDATA[http://maxolasersquad.blogspot.com/2010/12/how-to-compile-mame-in-ubuntu-1004.html mostly worked but I was missing a package at build time libsdl-ttf2.0-dev apt-get install build-essential libgtk2.0-dev libgnome2-dev libsdl1.2-dev libsdl-ttf2.0-dev this works to build version mame0146s : http://mamedev.org/downloader.php?file=releases/mame0146s.zip on 64 bit ubuntu 11.04]]></description>
				<content:encoded><![CDATA[<p><a href="http://maxolasersquad.blogspot.com/2010/12/how-to-compile-mame-in-ubuntu-1004.html">http://maxolasersquad.blogspot.com/2010/12/how-to-compile-mame-in-ubuntu-1004.html</a></p>
<p>mostly worked but I was missing a package at build time libsdl-ttf2.0-dev</p>
<p>apt-get install build-essential libgtk2.0-dev libgnome2-dev libsdl1.2-dev libsdl-ttf2.0-dev</p>
<p>this works to build version mame0146s : <a href="http://mamedev.org/downloader.php?file=releases/mame0146s.zip">http://mamedev.org/downloader.php?file=releases/mame0146s.zip</a> on 64 bit ubuntu 11.04</p>
]]></content:encoded>
			<wfw:commentRss>http://thegnar.org/sync/?feed=rss2&#038;p=224</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Building old versions of AOSP on ubuntu 12.04</title>
		<link>http://thegnar.org/sync/?p=236</link>
		<comments>http://thegnar.org/sync/?p=236#comments</comments>
		<pubDate>Sun, 29 Apr 2012 19:21:17 +0000</pubDate>
		<dc:creator>markgross</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://thegnar.org/sync/?p=236</guid>
		<description><![CDATA[this is a slightly more detailed/complete and a terse version of the following blog post that was forwarded to the android-builders mailing list. http://blog.decat.org/aosp-step-by-step-instructions-for-setting-up-a-chrooted-ubuntu-10-04-64bit-build-environment-on-ubuntu-11-10-and-12-04-hosts Starting from the 12.04 command line do the following things (mostly in order) sudo apt-get update sudo apt-get upgrade sudo apt-get install dchroot debootstrap sudo tee -a /etc/schroot/schroot.conf &#60;&#60;EOF [lucid] description=Ubuntu [...]]]></description>
				<content:encoded><![CDATA[<p>this is a slightly more detailed/complete and a terse version of the following blog post that was forwarded to the android-builders mailing list.</p>
<p><a href="http://blog.decat.org/aosp-step-by-step-instructions-for-setting-up-a-chrooted-ubuntu-10-04-64bit-build-environment-on-ubuntu-11-10-and-12-04-hosts">http://blog.decat.org/aosp-step-by-step-instructions-for-setting-up-a-chrooted-ubuntu-10-04-64bit-build-environment-on-ubuntu-11-10-and-12-04-hosts</a></p>
<p>Starting from the 12.04 command line do the following things (mostly in order)</p>
<ul>
<li>sudo apt-get update</li>
<li>sudo apt-get upgrade</li>
<li>sudo apt-get install dchroot debootstrap</li>
</ul>
<pre>sudo tee -a /etc/schroot/schroot.conf &lt;&lt;EOF
 [lucid]
 description=Ubuntu 10.04 LTS (Lucid Lynx)
 location=/var/chroot/lucid
 priority=3
 users=&lt;&lt;your user name here&gt;&gt;
 groups=&lt;&lt;your user name here&gt;&gt;
 root-groups=root
 EOF</pre>
<pre>sudo debootstrap --variant=buildd --arch amd64 lucid /var/chroot/lucid <a title="http://archive.ubuntu.com/ubuntu/" href="http://archive.ubuntu.com/ubuntu/" rel="nofollow">http://archive.ubuntu.com/ubuntu/</a></pre>
<pre> </pre>
<pre>sudo tee -a /var/chroot/lucid/etc/debian_chroot &lt;&lt;EOF
 $HOSTNAME-chroot-lucid)
EOF</pre>
<ul>
<li>sudo cp /etc/resolv.conf /var/chroot/lucid/etc/</li>
<li>sudo cp /etc/passwd /var/chroot/lucid/etc/</li>
<li>sudo cp /etc/group /var/chroot/lucid/etc/</li>
<li>FSTAB changes: (to host 12.04 /etc/fstab)</li>
</ul>
<pre>#bind mount for lucid
/proc /var/chroot/lucid/proc bind defaults,bind 0 0
/home /var/chroot/lucid/home bind defaults,bind 0 0</pre>
<ul>
<li>sudo chroot /var/chroot/lucid/</li>
<li>sources.list changes:  (the chroot /etc/apt/sources.list)</li>
</ul>
<pre> #make sure the following 2 lines are in the sources.list
 deb http://archive.ubuntu.com/ubuntu lucid main
 deb http://archive.ubuntu.com/ubuntu lucid universe</pre>
<ul>
<li>now install the android build dependencies;</li>
<li>apt-get update</li>
</ul>
<pre>  sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl \
               zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev \
               ia32-libs x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev \
               tofrodos gawk mkisofs

Feel free to add whatever else you may need (vim, ctags, cscope ccache, etc...)</pre>
<ul>
<li>Now you may want to have a script &#8220;lucid.sh&#8221; to log in into the chroot and as the correct user:</li>
<li>note: if you installed Java the way you are *supposed to* in $HOME/bin/ and set up the paths in your .profile then the java support &#8220;just works&#8221; otherwise you deserve what you get.</li>
</ul>
<pre>#!/bin/sh
sudo chroot /var/chroot/lucid/ su - `whoami`</pre>
<p>Seems to work.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://thegnar.org/sync/?feed=rss2&#038;p=236</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
