﻿define('DISALLOW_FILE_EDIT', true);
define('DISALLOW_FILE_MODS', true);<?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>/dev/head &#187; kernel</title>
	<atom:link href="http://devhead.ru/cat/kernel/feed" rel="self" type="application/rss+xml" />
	<link>http://devhead.ru</link>
	<description>Статьи и видео уроки</description>
	<lastBuildDate>Mon, 30 Jan 2017 11:12:34 +0000</lastBuildDate>
	<language>ru-RU</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.1.37</generator>
	<item>
		<title>Linux kernel space application profiling</title>
		<link>http://devhead.ru/read/linux-kernel-space-application-profiling</link>
		<comments>http://devhead.ru/read/linux-kernel-space-application-profiling#comments</comments>
		<pubDate>Tue, 27 Oct 2015 13:20:56 +0000</pubDate>
		<dc:creator><![CDATA[andreykyz]]></dc:creator>
				<category><![CDATA[Статьи]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[perf]]></category>

		<guid isPermaLink="false">http://devhead.ru/?p=2132</guid>
		<description><![CDATA[Для того чтобы узнать природу загрузки приложения которую выводит htop можно воспользоваться утилитой perf входящей в состав ядра Соберем инструмент отладки: $ cd linux-source/tools/perfl $ make Теперь запустим интересующее нас приложение и запустим профайлер(на 10 секунд): $ sudo ./perf record -F 99 -a -g -- sleep 10 Далее можно посмотреть результат при помощи утилиты perf [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Для того чтобы узнать природу загрузки приложения которую выводит htop можно воспользоваться утилитой perf входящей в состав ядра<br />
<span id="more-2132"></span><br />
Соберем инструмент отладки:</p>
<blockquote><p>$ cd linux-source/tools/perfl<br />
$ make</p></blockquote>
<p>Теперь запустим интересующее нас приложение и запустим профайлер(на 10 секунд):</p>
<blockquote><p>$ sudo ./perf record -F 99 -a -g -- sleep 10</p></blockquote>
<p>Далее можно посмотреть результат при помощи утилиты perf report. Если в утитите perf record не увазывать опцию -o то отчет по умолчанию будет сохранен в perf.data:</p>
<blockquote><p>sudo ./perf report -i ./perf.data</p></blockquote>
<p>будет получен подобный отчет</p>
<div id="attachment_2136" style="width: 310px" class="wp-caption aligncenter"><a href="http://devhead.ru/wp-content/uploads/2015/10/Snimok-ekrana-ot-2015-10-27-154651.png"><img class="size-medium wp-image-2136" src="http://devhead.ru/wp-content/uploads/2015/10/Snimok-ekrana-ot-2015-10-27-154651-300x154.png" alt="perf report -i ./perf.data" width="300" height="154" /></a><p class="wp-caption-text">perf report -i ./perf.data</p></div>
<p>ещё можно воспользовавшись специальными скриптами построить так называемы flame graph. качаем скрипты:</p>
<blockquote><p>$ git clone https://github.com/brendangregg/FlameGraph ~/fg</p></blockquote>
<p>Конвертируем наш отчет в текстовый вид и пропускаем чере flame graph:</p>
<blockquote><p>sudo ./perf script &gt; perf.script<br />
~/fg/stackcollapse-perf.pl perf.script &gt; perf.folded<br />
~/FlameGraph/flamegraph.pl perf.folded &gt; perf.svg</p></blockquote>
<p>результат:<br />
<a href="http://devhead.ru/wp-content/uploads/2015/10/Snimok-ekrana-ot-2015-10-27-161659.png"><img class="aligncenter size-medium wp-image-2138" src="http://devhead.ru/wp-content/uploads/2015/10/Snimok-ekrana-ot-2015-10-27-161659-300x143.png" alt="Снимок экрана от 2015-10-27 16:16:59" width="300" height="143" /></a></p>
<h1>Ссылки</h1>
<p><a href="https://perf.wiki.kernel.org/index.php/Tutorial">Linux kernel profiling with perf</a><br />
<a href="http://www.brendangregg.com/flamegraphs.html">Flame Graphs</a><br />
<a href="http://www.brendangregg.com/perf.htm">lperf Examples</a></p>
]]></content:encoded>
			<wfw:commentRss>http://devhead.ru/read/linux-kernel-space-application-profiling/feed</wfw:commentRss>
		<slash:comments>39</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->