Files
CoderSherlock.github.io/_site/archivers/some-of-my-previews-exper-work.html
T
2017-07-28 15:25:34 -04:00

251 lines
11 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Some of my previews experiment works: 2016 « Stop Talking, Start Doing - 停止空想,开始行动</title>
<meta name="description" content="This blog contains only some basic record of my works. For some details, I will write a unique blog just for some specific topics.">
<link rel="stylesheet" href="/css/main.css">
<link rel="canonical" href="https://codersherlock.github.com//archivers/some-of-my-previews-exper-work">
<link rel="alternate" type="application/rss+xml" title="Stop Talking, Start Doing - 停止空想,开始行动" href="https://codersherlock.github.com//feed.xml" />
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-82637164-1', 'auto');
ga('send', 'pageview');
</script>
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<script>
(adsbygoogle = window.adsbygoogle || []).push({
google_ad_client: "ca-pub-6651321038908478",
enable_page_level_ads: true
});
</script>
</head>
<body>
<header class="header">
<div class="wrapper">
<a class="site-title" href="/">Stop Talking, Start Doing - 停止空想,开始行动</a>
<nav class="site-nav">
<a class="page-link" href="/about/">About</a>
<a class="page-link" href="/category/">Category</a>
</nav>
</div>
</header>
<div class="page-content">
<div class="wrapper">
<div class="col-main">
<div class="post">
<header class="post-header">
<h1 class="post-title">Some of my previews experiment works: 2016</h1>
<p class="post-meta">Oct 28, 2016</p>
</header>
<article class="post-content">
<p>This blog contains only some basic record of my works. For some details, I will write a unique blog just for some specific topics.</p>
<h1 id="2016-10">2016-10</h1>
<h2 id="time-experiment-of-rsync">Time Experiment of rsync</h2>
<p>Patch is based on rsync with version 3.1.2. [<a href="https://download.samba.org/pub/rsync/rsync-3.1.2.tar.gz">Rsync</a>|<a href="/static/2016-10/rsync/rsync-3.1.2-time.patch">Patch</a>]</p>
<h3 id="how-to-collect-data">How to collect data</h3>
<p>Basically, everything of transmission time and computation time will be output with overall time will be printed on the console.
But we also need some bash script to collect data through different size of random size and with different modification through them.</p>
<ul>
<li>Start from 8K to 64M, modify at beginning, [<a href="/static/2016-10/rsync/small2Big_change_at_begin.sh">Bash script</a>]</li>
<li>Start from 8K to 64M, modify at last, [<a href="/static/2016-10/rsync/small2Big_change_at_last.sh">Bash script</a>]</li>
<li>Start from 8K to 64M, modify at random place with a (slow) python script, [<a href="/static/2016-10/rsync/small2Big_change_at_anyplace.sh">Bash script</a>|<a href="/static/2016-10/rsync/addbyte.py">Python program</a>]</li>
</ul>
<h2 id="time-experiment-of-seafile">Time Experiment of seafile</h2>
<p>Patch is based on seafile 5.1.4. You can find the release from <a href="https://github.com/haiwen/seafile/releases">seafile official repo</a>. You may follow official compile instructions from <a href="https://manual.seafile.com/build_seafile/linux.html">here</a>. [<a href="">Patch <strong>no longer avaiable, new version at following sections</strong></a>]</p>
<h3 id="how-to-collect-data-1">How to collect data</h3>
<p>We also need everything be done using scripting. But this time I only design added some distance between two increasing files sizes.</p>
<ul>
<li>Start from 8K to 16M, 4 times increasing, modify at beginning/ at 1024 different places with python script. [<a href="/static/2016-11/seafile/trans.sh">Bash Script</a>|<a href="/static/2016-11/seafile/addbyte.py">Python program</a>]</li>
<li>After using this auto testing script, everything of output will be marked in log files of seafile, which located in <strong>~/.ccnet/log/seafile.log</strong></li>
<li>We need to use this simple awk code and vim operation to extract data.</li>
</ul>
<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="c"># CDC: content defined chucks</span>
<span class="c"># HUT: Http upload traffic</span>
<span class="c"># ALL: overall time of one commit &amp; upload</span>
awk <span class="s1">'/CDC|HUT|ALL/ {print $4,$5}'</span> ~/.ccnet/log/seafile.log &gt; results.stat
</code></pre>
</div>
<h3 id="install-seafile-on-odroid-xu">Install Seafile on odroid xu</h3>
<p>Due to failure of my cross-compile to seafile on android. I used develop board as a replacement experiment platform for ARM-seafile testing. I used a <a href="http://www.hardkernel.com/main/products/prdt_info.php?g_code=G137510300620">odroid xu</a> as hardware standard. Because all I need is an ARM platform, only an ARM-Ubuntu is enough for me. But develop prototype on a board is much fun than coding, I wont address much this time. But Ill start a blog telling some really cool stuff I made for a strange aim.</p>
<p>To install a ubuntu with GUI is my all preparation work. I found to way to do this.</p>
<ul>
<li>
<p><a href="http://www.armhf.com/boards/odroid-xu/">armhf</a> is a website for arm-based ubuntu. It has a detailed instruction to follow at <a href="http://www.armhf.com/boards/odroid-xu/odroid-sd-install/">here</a>. They also provide ubuntu 12.04/ 14.04 and debian 7.5 to choose. But unfortunately odroid xus hdmi output doesnt supported by ubuntu native firmware. So install ubuntu-desktop might cant be boot up for video output.</p>
</li>
<li>
<p>Burn images is much easy to install a pre-complied ubuntu system. I found this on odroid xus forum, which contains xubuntu image [<a href="http://odroid.in/ubuntu_14.04lts/ubuntu-14.04lts-xubuntu-odroid-xu-20140714.img.xz">download</a>] for odroid xu. With this image, you just need to use dd command to write whole system mirror into sdcard.</p>
</li>
</ul>
<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="c"># If .img end with xz, use this command to uncompress first</span>
unxz ubuntu-14.04lts-xubuntu-odroid-xu-20140714.img.xz
<span class="c"># Burn image into SD-card</span>
sudo dd <span class="k">if</span><span class="o">=</span>ubuntu-14.04lts-xubuntu-odroid-xu-20140714.img <span class="nv">of</span><span class="o">=</span>/dev/sdb <span class="nv">bs</span><span class="o">=</span>1M <span class="nv">conv</span><span class="o">=</span>fsync
sync
</code></pre>
</div>
<h1 id="2016-11">2016-11</h1>
<h2 id="android-kernel">Android Kernel</h2>
<h3 id="how-to-build-an-android-kernel">How to build an Android Kernel?</h3>
<p>Generally, I wont tell anything in this parts, just mark some related links, and point out some mistakes or error solutions.</p>
<ul>
<li>
<p><a href="http://source.android.com/source/building-kernels.html#figuring-out-which-kernel-to-build">Google Official Guide</a>
If you dont have AOSP sources, you have to download prebuilt toolchains which recommended in this guide might not be correct. Use following links to choose your fitting tools.
<a href="https://android.googlesource.com/?format=HTML">ASOP git root</a>, under sub class “/platform/prebuilts/gcc”</p>
</li>
<li>
<p><a href="https://softwarebakery.com/building-the-android-kernel-on-linux">Packing and Flashing a Boot.img</a> <strong>[highly recommend]</strong></p>
</li>
</ul>
<h1 id="2016-12">2016-12</h1>
<h2 id="android-kernel-1">Android Kernel</h2>
<h3 id="how-to-compile-with-ftrace">How to compile with ftrace?</h3>
<p>If we want to debug under android, ftrace is a great tool for working. But, ftrace is not available in android if we used default configure file. Android kernel configuration is in <strong>arch/arm64/kernel/configs</strong>. We need to add few lines under that.</p>
<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="nv">CONFIG_STRICT_MEMORY_RWX</span><span class="o">=</span>y
<span class="nv">CONFIG_FUNCTION_TRACER</span><span class="o">=</span>y
<span class="nv">CONFIG_FUNCTION_GRAPH_TRACER</span><span class="o">=</span>y
<span class="nv">CONFIG_DYNAMIC_FTRACE</span><span class="o">=</span>y
<span class="nv">CONFIG_PERSISTENT_TRACER</span><span class="o">=</span>y
<span class="nv">CONFIG_IRQSOFF_TRACER</span><span class="o">=</span>y
<span class="nv">CONFIG_PREEMPT_TRACER</span><span class="o">=</span>y
<span class="nv">CONFIG_SCHED_TRACER</span><span class="o">=</span>y
<span class="nv">CONFIG_STACK_TRACER</span><span class="o">=</span>y
</code></pre>
</div>
<h3 id="how-to-extract-android-images-dump-an-image">How to extract android images: Dump an image</h3>
<p>If we want to hold a rooted status after flashing boot, we need to extract an image from android devices. We can first use following command to find which blocks belongs to. According to some references, <a href="http://forum.xda-developers.com/showthread.php?t=2450045">this article</a> provide three ways to dump an image, I picked one for easy using.</p>
<div class="language-bash highlighter-rouge"><pre class="highlight"><code>adb shell
ls -al /dev/block/platform/<span class="nv">$SOME</span><span class="se">\_</span>DEVICE../../by-name <span class="c"># {Partitions} -&gt; {Device Block}</span>
<span class="c"># dump file</span>
su
dd <span class="k">if</span><span class="o">=</span>/dev/block/mmcblk0p37 <span class="nv">of</span><span class="o">=</span>/sdcard/boot.img
</code></pre>
</div>
</article>
</div>
</div>
<div class="col-second">
<div class="col-box col-box-author">
<img class="avatar" src="/static/avatar.jpg" alt="Pengzhan Hao - 碾子">
<div class="col-box-title name">Pengzhan Hao - 碾子</div>
<p></p>
<p class="contact">
<a href="https://github.com/codersherlock">GitHub</a>
<a href="https://twitter.com/haopengzhan">Twitter</a>
<a href="mailto:haopengzhan@gmail.com">Email</a>
</p>
</div>
<div class="col-box">
<div class="col-box-title">Newest Posts</div>
<ul class="post-list">
<li><a class="post-link" href="/archivers/intro-xv6">Xv6 introduction</a></li>
<li><a class="post-link" href="/archivers/intro-unikernel">Short talk about Unikernels</a></li>
<li><a class="post-link" href="/archivers/some-of-my-previews-exper-work">Some of my previews experiment works: 2016</a></li>
<li><a class="post-link" href="/archivers/charles-is-not-a-good-tool">Using charles proxy to monitor mobile SSL traffics</a></li>
<li><a class="post-link" href="/archivers/hello">Stop Talking is the worst title of one blog</a></li>
</ul>
</div>
<div class="col-box post-toc hide">
<div class="col-box-title">TOC</div>
</div>
</div>
</div>
</div>
<footer class="footer">
<div class="wrapper">
&copy; 2016 Pengzhan Hao - 碾子
</div>
</footer>
<script src="/js/easybook.js"></script>
</body>
</html>