<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>VG's blog</title>
  <id>http://zlonet.ru/</id>
  <updated>2026-06-10T19:34:15Z</updated>
  <author>
    <name>Veniamin Gvozdikov</name>
    <email>vg@FreeBSD.org</email>
  </author>
  <entry>
    <title>Quick introduction to Tarantool</title>
    <link href="http://zlonet.ru/page/quick-introduction-to-tarantool/"/>
    <id>http://zlonet.ru/page/quick-introduction-to-tarantool</id>
    <updated>2015-08-30T00:00:00Z</updated>
    <summary type="html">&lt;p&gt;Let&amp;#8217;s start to install [tarantool] on FreeBSD 10.X from ports tree.&lt;/p&gt;</summary>
    <content type="html">&lt;p&gt;Let&amp;#8217;s start to install &lt;a href="http://tarantool.org" title="The Tarantool project"&gt;tarantool&lt;/a&gt; on FreeBSD 10.X from ports tree.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://asciinema.org/a/3ns6vx5sijzqk4jggvkbdgdgf"&gt;&lt;img src="https://asciinema.org/a/3ns6vx5sijzqk4jggvkbdgdgf.png" alt="asciicast" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Getting started&lt;/p&gt;
&lt;p&gt;&lt;a href="https://asciinema.org/a/25723"&gt;&lt;img src="https://asciinema.org/a/25723.png" alt="asciicast" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Access to console&lt;/p&gt;
&lt;p&gt;&lt;a href="https://asciinema.org/a/25724"&gt;&lt;img src="https://asciinema.org/a/25724.png" alt="asciicast" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Connection between tarantools&lt;/p&gt;
&lt;p&gt;&lt;a href="https://asciinema.org/a/25725"&gt;&lt;img src="https://asciinema.org/a/25725.png" alt="asciicast" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Change delimiter&lt;/p&gt;
&lt;p&gt;&lt;a href="https://asciinema.org/a/25727"&gt;&lt;img src="https://asciinema.org/a/25727.png" alt="asciicast" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Python3 asyncio driver&lt;/p&gt;
&lt;p&gt;&lt;a href="https://asciinema.org/a/25733"&gt;&lt;img src="https://asciinema.org/a/25733.png" alt="asciicast" /&gt;&lt;/a&gt;&lt;/p&gt;</content>
  </entry>
  <entry>
    <title>DTrace integration features</title>
    <link href="http://zlonet.ru/page/dtrace-integration-features/"/>
    <id>http://zlonet.ru/page/dtrace-integration-features</id>
    <updated>2013-09-29T00:00:00Z</updated>
    <summary type="html">&lt;p&gt;This post explores my troubles with integrating DTrace in projects. I spent a few days searching for and fixing bugs in DTrace. I&amp;#8217;ll explain my troubles and approach to fixing bugs in [tarantool], a no-sql DB, with common instruments.&lt;/p&gt;</summary>
    <content type="html">&lt;p&gt;This post explores my troubles with integrating DTrace in projects. I spent a few days searching for and fixing bugs in DTrace. I&amp;#8217;ll explain my troubles and approach to fixing bugs in &lt;a href="http://tarantool.org" title="The Tarantool project"&gt;tarantool&lt;/a&gt;, a no-sql DB, with common instruments.&lt;/p&gt;
&lt;p&gt;This post isn&amp;#8217;t yet complete. I&amp;#8217;ll add new information after fix&amp;#47;found bugs.&lt;/p&gt;
&lt;h2 id="instruments-to-research"&gt;Instruments to research:&lt;/h2&gt;
&lt;p&gt;OSs:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;FreeBSD 9.1-RELEASE-p7&lt;/li&gt;
&lt;li&gt;Darwin 12.5.0&lt;/li&gt;
&lt;li&gt;Linux 3.8.13-16.el6uek.x86_64 (Oracle Linux)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Solaris based:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;OpenIndiana 151a8 (so old compilers)&lt;/li&gt;
&lt;li&gt;Oracle Linux 11.1 (so old compilers)&lt;/li&gt;
&lt;li&gt;SmartOS latest (all stuff got coredump)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;DTrace Versions:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;dtrace: Sun D 1.7 (FreeBSD)&lt;/li&gt;
&lt;li&gt;dtrace: Sun D 1.6.2 (Darwin)&lt;/li&gt;
&lt;li&gt;dtrace: Sun D 1.6.3 (Oracle Linux)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="generate-dtrace-object-twice"&gt;Generate DTrace object twice&lt;/h2&gt;
&lt;pre&gt;&lt;code class="language-sh"&gt;%&amp;#62; sudo dtrace -l -m tarantool_box
Password:
   ID   PROVIDER            MODULE                          FUNCTION NAME
dtrace: failed to match :tarantool_box::: No probe matches description
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If you have a modular application you&amp;#8217;ll try to generate many dtrace objects to link that with the application. You get static libraries and then link. This is a common approach to programming but if you use DTrace in more than one library you need run &lt;code&gt;dtrace -G&lt;/code&gt; to get one dtrace object which include all providers.&lt;/p&gt;
&lt;p&gt;After the first time you get a dtrace object with correct information but you would like to get object for all providers in different libs in one object. I&amp;#8217;ll explain the main issue with second generation with an example.&lt;/p&gt;
&lt;p&gt;This is an example with one library. You are able to do this on the command line for getting incorrect object because you did correct object before with information about one: ***&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-sh"&gt;%&amp;#62; dtrace -G -s ..&amp;#47;..&amp;#47;include&amp;#47;dtrace.d ..&amp;#47;CMakeFiles&amp;#47;cjson.dir&amp;#47;third_party&amp;#47;lua-cjson&amp;#47;lua_cjson.c.o -o cjson_dtrace_second.o

%&amp;#62; md5 cjson_dtrace.o
MD5 (cjson_dtrace.o) = 69cc9d1037f106e682464af05205458c
%&amp;#62; md5 cjson_dtrace_second.o
MD5 (cjson_dtrace_second.o) = a42c72ae540be068243936afe2d7b868
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;On above list you see mismatched md5 sums. When I found that I started fire to drill-down to object files and look at what&amp;#8217;s incorrect.&lt;/p&gt;
&lt;p&gt;I got 2 dtrace objects, Using the &lt;code&gt;strings&lt;/code&gt; command I found the differences:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-sh"&gt;%&amp;#62; strings -a cjson_dtrace_second.o &amp;#62; dtrace_second
%&amp;#62; strings -a cjson_dtrace.o &amp;#62; dtrace
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class="language-sh"&gt;%&amp;#62; diff -up dtrace dtrace_second
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I saw removed functions with dtrace defines for a trace.&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-diff"&gt;--- dtrace  2013-09-27 13:47:17.839671510 +0000
+++ dtrace_second   2013-09-27 13:47:08.717669720 +0000
@@ -117,15 +117,10 @@ vfprintf
 encode-done
 char *
 char *
-json_encode
-$dtrace140912.json_encode
 encode-start
 char *
 char *
-json_encode
-$dtrace140912.json_encode
 new-entry
-luaopen_cjson
 tick-start
 tick-stop
 tarantool
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In the next stage I looked inside &lt;code&gt;.SUNW_dof&lt;/code&gt; in section of dtrace object file.&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-sh"&gt;%&amp;#62; objdump -s -j .SUNW_dof cjson_dtrace.o
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This is correct hex output from dtrace object:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-text"&gt;cjson_dtrace.o:     file format elf64-x86-64-freebsd

Contents of section .SUNW_dof:
 0270 00000000 00000000 00000000 05000000  ................
 0280 01000000 00656e63 6f64652d 646f6e65  .....encode-done
 0290 00696e74 00636861 72202a00 696e7400  .int.char *.int.
 02a0 63686172 202a006a 736f6e5f 656e636f  char *.json_enco
 02b0 64650024 64747261 63653134 30393132  de.$dtrace140912
 02c0 2e6a736f 6e5f656e 636f6465 00656e63  .json_encode.enc
 02d0 6f64652d 73746172 7400696e 74006368  ode-start.int.ch
 02e0 6172202a 00696e74 00636861 72202a00  ar *.int.char *.
 02f0 6a736f6e 5f656e63 6f646500 24647472  json_encode.$dtr
 0300 61636531 34303931 322e6a73 6f6e5f65  ace140912.json_e
 0310 6e636f64 65006e65 772d656e 74727900  ncode.new-entry.
 0320 6c75616f 70656e5f 636a736f 6e007469  luaopen_cjson.ti
 0330 636b2d73 74617274 00696e74 00696e74  ck-start.int.int
 0340 00746963 6b2d7374 6f700069 6e740069  .tick-stop.int.i
 0350 6e740074 6172616e 746f6f6c 00000000  nt.tarantool....
 0360 53756e20 4420312e 37004672 65654253  Sun D 1.7.FreeBS
 0370 44000000 00000000 00000000 00000000  D...............
 0380 00000000 00000000 00000000 00000000  ................
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Drill-down to next &lt;code&gt;incorrect&lt;/code&gt; object:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-sh"&gt;%&amp;#62; objdump -s -j .SUNW_dof cjson_dtrace_second.o
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In &lt;code&gt;.SUNW_dof&lt;/code&gt; sect I saw empty dtrace providers for tracing function:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-text"&gt;cjson_dtrace_second.o:     file format elf64-x86-64-freebsd

Contents of section .SUNW_dof:
 0190 00000000 00000000 00000000 05000000  ................
 01a0 01000000 00656e63 6f64652d 646f6e65  .....encode-done
 01b0 00696e74 00636861 72202a00 696e7400  .int.char *.int.
 01c0 63686172 202a0065 6e636f64 652d7374  char *.encode-st
 01d0 61727400 696e7400 63686172 202a0069  art.int.char *.i
 01e0 6e740063 68617220 2a006e65 772d656e  nt.char *.new-en
 01f0 74727900 7469636b 2d737461 72740069  try.tick-start.i
 0200 6e740069 6e740074 69636b2d 73746f70  nt.int.tick-stop
 0210 00696e74 00696e74 00746172 616e746f  .int.int.taranto
 0220 6f6c0000 00000000 53756e20 4420312e  ol......Sun D 1.
 0230 37004672 65654253 44000000 00000000  7.FreeBSD.......
 0240 00000000 00000000 00000000 00000000  ................
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The next step is finding differences in library objects. After running &lt;code&gt;dtrace -G&lt;/code&gt; twice I get these changes in main library objects:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-sh"&gt;%&amp;#62; md5 lua_cjson.c.o
MD5 (lua_cjson.c.o) = bdc0afbb0869f7bee70c29a7ba538127
%&amp;#62; md5 lua_cjson.c.o.dtrace
MD5 (lua_cjson.c.o.dtrace) = 0d65212c87350dceb64f71429b72ce3b
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I looked at the &lt;code&gt;.text&lt;/code&gt; section of the object file in &lt;code&gt;objdump&lt;/code&gt; because this section contains the executible code.&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-sh"&gt;%&amp;#62; objdump -d -j .text lua_cjson.c.o.dtrace &amp;#62; dtrace
%&amp;#62; objdump -d -j .text lua_cjson.c.o &amp;#62; non-dtrace
````

I used the ```diff``` command to confirm that the changes are correct:


``` sh
%&amp;#62; diff -up non-dtrace dtrace
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class="language-diff"&gt;--- non-dtrace  2013-09-27 13:42:05.811669039 +0000
+++ dtrace  2013-09-27 13:41:59.149669338 +0000
@@ -1,5 +1,5 @@

-lua_cjson.c.o:     file format elf64-x86-64-freebsd
+lua_cjson.c.o.dtrace:     file format elf64-x86-64-freebsd

 Disassembly of section .text:

@@ -11,7 +11,11 @@ Disassembly of section .text:
        c:  48 8b 7d f8             mov    -0x8(%rbp),%rdi
       10:  e8 1b 00 00 00          callq  30 &amp;#60;lua_cjson_new&amp;#62;
       15:  89 45 f4                mov    %eax,-0xc(%rbp)
-      18:  e8 00 00 00 00          callq  1d &amp;#60;luaopen_cjson+0x1d&amp;#62;
+      18:  90                      nop
+      19:  90                      nop
+      1a:  90                      nop
+      1b:  90                      nop
+      1c:  90                      nop
       1d:  b8 01 00 00 00          mov    $0x1,%eax
       22:  48 83 c4 10             add    $0x10,%rsp
       26:  5d                      pop    %rbp
@@ -217,7 +221,7 @@ Disassembly of section .text:
      34b:  c3                      retq
      34c:  0f 1f 40 00             nopl   0x0(%rax)

-0000000000000350 &amp;#60;json_encode&amp;#62;:
+0000000000000350 &amp;#60;$dtrace140912.json_encode&amp;#62;:
      350:  55                      push   %rbp
      351:  48 89 e5                mov    %rsp,%rbp
      354:  48 83 ec 50             sub    $0x50,%rsp
@@ -227,18 +231,22 @@ Disassembly of section .text:
      365:  48 89 45 f0             mov    %rax,-0x10(%rbp)
      369:  8b 7d bc                mov    -0x44(%rbp),%edi
      36c:  48 8b 75 c0             mov    -0x40(%rbp),%rsi
-     370:  e8 00 00 00 00          callq  375 &amp;#60;json_encode+0x25&amp;#62;
+     370:  90                      nop
+     371:  90                      nop
+     372:  90                      nop
+     373:  90                      nop
+     374:  90                      nop
      375:  48 8b 7d f8             mov    -0x8(%rbp),%rdi
-     379:  e8 00 00 00 00          callq  37e &amp;#60;json_encode+0x2e&amp;#62;
+     379:  e8 00 00 00 00          callq  37e &amp;#60;$dtrace140912.json_encode+0x2e&amp;#62;
      37e:  b1 01                   mov    $0x1,%cl
      380:  3d 01 00 00 00          cmp    $0x1,%eax
      385:  88 4d bb                mov    %cl,-0x45(%rbp)
-     388:  0f 84 21 00 00 00       je     3af &amp;#60;json_encode+0x5f&amp;#62;
+     388:  0f 84 21 00 00 00       je     3af &amp;#60;$dtrace140912.json_encode+0x5f&amp;#62;
      38e:  be 01 00 00 00          mov    $0x1,%esi
      393:  48 8d 14 25 00 00 00    lea    0x0,%rdx
      39a:  00
      39b:  48 8b 7d f8             mov    -0x8(%rbp),%rdi
-     39f:  e8 00 00 00 00          callq  3a4 &amp;#60;json_encode+0x54&amp;#62;
+     39f:  e8 00 00 00 00          callq  3a4 &amp;#60;$dtrace140912.json_encode+0x54&amp;#62;
      3a4:  3d 00 00 00 00          cmp    $0x0,%eax
      3a9:  0f 95 c1                setne  %cl
      3ac:  88 4d bb                mov    %cl,-0x45(%rbp)
@@ -247,13 +255,13 @@ Disassembly of section .text:
      3b6:  81 b9 38 05 00 00 00    cmpl   $0x0,0x538(%rcx)
      3bd:  00 00 00
      3c0:  88 45 ba                mov    %al,-0x46(%rbp)
-     3c3:  0f 85 1b 00 00 00       jne    3e4 &amp;#60;json_encode+0x94&amp;#62;
+     3c3:  0f 85 1b 00 00 00       jne    3e4 &amp;#60;$dtrace140912.json_encode+0x94&amp;#62;
      3c9:  be 00 00 00 00          mov    $0x0,%esi
      3ce:  48 8d 45 d0             lea    -0x30(%rbp),%rax
      3d2:  48 89 45 c8             mov    %rax,-0x38(%rbp)
      3d6:  48 8b 7d c8             mov    -0x38(%rbp),%rdi
-     3da:  e8 00 00 00 00          callq  3df &amp;#60;json_encode+0x8f&amp;#62;
-     3df:  e9 17 00 00 00          jmpq   3fb &amp;#60;json_encode+0xab&amp;#62;
+     3da:  e8 00 00 00 00          callq  3df &amp;#60;$dtrace140912.json_encode+0x8f&amp;#62;
+     3df:  e9 17 00 00 00          jmpq   3fb &amp;#60;$dtrace140912.json_encode+0xab&amp;#62;
      3e4:  48 8b 45 f0             mov    -0x10(%rbp),%rax
      3e8:  48 05 00 05 00 00       add    $0x500,%rax
      3ee:  48 89 45 c8             mov    %rax,-0x38(%rbp)
@@ -271,16 +279,20 @@ Disassembly of section .text:
      422:  48 8b 7d f8             mov    -0x8(%rbp),%rdi
      426:  48 8b 75 c0             mov    -0x40(%rbp),%rsi
      42a:  48 63 55 bc             movslq -0x44(%rbp),%rdx
-     42e:  e8 00 00 00 00          callq  433 &amp;#60;json_encode+0xe3&amp;#62;
+     42e:  e8 00 00 00 00          callq  433 &amp;#60;$dtrace140912.json_encode+0xe3&amp;#62;
      433:  48 8b 45 f0             mov    -0x10(%rbp),%rax
      437:  81 b8 38 05 00 00 00    cmpl   $0x0,0x538(%rax)
      43e:  00 00 00
-     441:  0f 85 09 00 00 00       jne    450 &amp;#60;json_encode+0x100&amp;#62;
+     441:  0f 85 09 00 00 00       jne    450 &amp;#60;$dtrace140912.json_encode+0x100&amp;#62;
      447:  48 8b 7d c8             mov    -0x38(%rbp),%rdi
-     44b:  e8 00 00 00 00          callq  450 &amp;#60;json_encode+0x100&amp;#62;
+     44b:  e8 00 00 00 00          callq  450 &amp;#60;$dtrace140912.json_encode+0x100&amp;#62;
      450:  8b 7d bc                mov    -0x44(%rbp),%edi
      453:  48 8b 75 c0             mov    -0x40(%rbp),%rsi
-     457:  e8 00 00 00 00          callq  45c &amp;#60;json_encode+0x10c&amp;#62;
+     457:  90                      nop
+     458:  90                      nop
+     459:  90                      nop
+     45a:  90                      nop
+     45b:  90                      nop
      45c:  b8 01 00 00 00          mov    $0x1,%eax
      461:  48 83 c4 50             add    $0x50,%rsp
      465:  5d                      pop    %rbp
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;As seen above, DTrace modifies an object file with use together dtrace and library objects.&lt;/p&gt;
&lt;h2 id="doesnt-work-multi-provider-in-module-"&gt;Doesn&amp;#8217;t work multi-PROVIDER in MODULE &lt;/h2&gt;
&lt;p&gt;This is the next main issue with integration. It doesn&amp;#8217;t work on anything providers in one module (application). I always got one working provider in application. The trouble related to many dtrace objects which I wanted use when I linked application. If you have a few dtrace objects I&amp;#8217;ll link its in binary but works only &lt;code&gt;first&lt;/code&gt; provider (depended by position object file in linking proccess).*****&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-sh"&gt;%&amp;#62; cat ..&amp;#47;include&amp;#47;dtrace.d
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Main providers from dtrace file:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-c"&gt;provider coro {
    probe new__entry();
};
provider ev {
    probe tick__start(int flags);
    probe tick__stop(int flags);
};
provider cjson {
    probe encode__start(int len, char *);
    probe encode__done(int len, char *);
    probe new__entry(void *);
};
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It doesn&amp;#8217;t work because we need to run DTrace twice. See &amp;#8220;Generate DTrace object twice&amp;#8221; for more details.&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-sh"&gt;%&amp;#62; dtrace -G  -x nolibs -s ..&amp;#47;include&amp;#47;dtrace.d  CMakeFiles&amp;#47;ev.dir&amp;#47;third_party&amp;#47;tarantool_ev.c.o CMakeFiles&amp;#47;coro.dir&amp;#47;third_party&amp;#47;coro&amp;#47;coro.c.o CMakeFiles&amp;#47;cjson.dir&amp;#47;third_party&amp;#47;lua-cjson&amp;#47;fpconv.c.o CMakeFiles&amp;#47;cjson.dir&amp;#47;third_party&amp;#47;lua-cjson&amp;#47;lua_cjson.c.o CMakeFiles&amp;#47;cjson.dir&amp;#47;third_party&amp;#47;lua-cjson&amp;#47;strbuf.c.o

%&amp;#62; dtrace -G  -s ..&amp;#47;include&amp;#47;dtrace.d  CMakeFiles&amp;#47;ev.dir&amp;#47;third_party&amp;#47;tarantool_ev.c.o CMakeFiles&amp;#47;coro.dir&amp;#47;third_party&amp;#47;coro&amp;#47;coro.c.o CMakeFiles&amp;#47;cjson.dir&amp;#47;third_party&amp;#47;lua-cjson&amp;#47;fpconv.c.o CMakeFiles&amp;#47;cjson.dir&amp;#47;third_party&amp;#47;lua-cjson&amp;#47;lua_cjson.c.o CMakeFiles&amp;#47;cjson.dir&amp;#47;third_party&amp;#47;lua-cjson&amp;#47;strbuf.c.o -o probes.o

%&amp;#62; md5 probes.o dtrace.o
MD5 (probes.o) = bc2c205b019c5e948cfba89ff098c7e8
MD5 (dtrace.o) = bc2c205b019c5e948cfba89ff098c7e8
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I split the dtrace file into several &lt;code&gt;.d&lt;/code&gt; files. After that I got a few dtrace objects from correct object files.&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-sh"&gt;%&amp;#62; dtrace -G  -s ..&amp;#47;include&amp;#47;dtrace.d  CMakeFiles&amp;#47;cjson.dir&amp;#47;third_party&amp;#47;lua-cjson&amp;#47;fpconv.c.o CMakeFiles&amp;#47;cjson.dir&amp;#47;third_party&amp;#47;lua-cjson&amp;#47;lua_cjson.c.o CMakeFiles&amp;#47;cjson.dir&amp;#47;third_party&amp;#47;lua-cjson&amp;#47;strbuf.c.o -o dtrace&amp;#47;cjson_dtrace.o

%&amp;#62; cat ..&amp;#47;third_party&amp;#47;lua-cjson&amp;#47;cjson_dtrace.d
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class="language-c"&gt;provider cjson {
    probe encode__start(int len, char *);
    probe encode__done(int len, char *);
    probe new__entry(void *);
};
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class="language-sh"&gt;%&amp;#62; dtrace -G  -s ..&amp;#47;third_party&amp;#47;libev&amp;#47;ev_dtrace.d  CMakeFiles&amp;#47;ev.dir&amp;#47;third_party&amp;#47;tarantool_ev.c.o -o dtrace&amp;#47;ev_dtrace.o

%&amp;#62; cat ..&amp;#47;third_party&amp;#47;libev&amp;#47;ev_dtrace.d
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class="language-c"&gt;provider ev {
    probe tick__start(int flags);
    probe tick__stop(int flags);
};
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class="language-sh"&gt;%&amp;#62; dtrace -G  -s ..&amp;#47;third_party&amp;#47;coro&amp;#47;coro_dtrace.d  CMakeFiles&amp;#47;coro.dir&amp;#47;third_party&amp;#47;coro&amp;#47;coro.c.o -o dtrace&amp;#47;coro_dtrace.o
%&amp;#62; cat ..&amp;#47;third_party&amp;#47;coro&amp;#47;coro_dtrace.d
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class="language-c"&gt;provider coro {
    probe new__entry();
};
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It worked when I linked one dtrace object at the end of line:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-sh"&gt;%&amp;#62; &amp;#47;usr&amp;#47;local&amp;#47;bin&amp;#47;clang++33    -fno-omit-frame-pointer -fno-stack-protector -fexceptions -funwind-tables -std=c++11 -fno-rtti -Wall -Wextra -Wno-sign-compare -Wno-strict-aliasing    CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;tuple.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;tuple_convert.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;tuple_update.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;key_def.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;index.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;hash_index.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;tree_index.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;bitset_index.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;space.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;port.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;request.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;txn.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;box.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;lua&amp;#47;box.lua.c.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;lua&amp;#47;box_net.lua.c.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;lua&amp;#47;misc.lua.c.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;lua&amp;#47;sql.lua.c.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;box_lua.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;box_lua_space.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;__&amp;#47;__&amp;#47;cfg&amp;#47;tarantool_box_cfg.c.o -o tarantool_box libltbox.a ..&amp;#47;..&amp;#47;cfg&amp;#47;libcfg.a ..&amp;#47;libcore.a ..&amp;#47;..&amp;#47;libev.a ..&amp;#47;..&amp;#47;libeio.a ..&amp;#47;..&amp;#47;libcoro.a ..&amp;#47;..&amp;#47;libgopt.a ..&amp;#47;..&amp;#47;libcjson.a ..&amp;#47;..&amp;#47;third_party&amp;#47;luajit&amp;#47;src&amp;#47;libluajit.a ..&amp;#47;..&amp;#47;libmisc.a -lpthread -lintl -lelf ..&amp;#47;lib&amp;#47;bitset&amp;#47;libbitset.a ..&amp;#47;lib&amp;#47;bit&amp;#47;libbit.a -L&amp;#47;usr&amp;#47;local&amp;#47;lib ..&amp;#47;..&amp;#47;dtrace&amp;#47;cjson_dtrace.o
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Providers works in module:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-sh"&gt;%&amp;#62; sudo dtrace -l -m tarantool_box
  ID   PROVIDER            MODULE                          FUNCTION NAME
56571 cjson43089     tarantool_box                       json_encode encode-done
56572 cjson43089     tarantool_box                       json_encode encode-start
56573 cjson43089     tarantool_box                     luaopen_cjson new-entry
56574 cjson43090     tarantool_box                       json_encode encode-done
56575 cjson43090     tarantool_box                       json_encode encode-start
56576 cjson43090     tarantool_box                     luaopen_cjson new-entry
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class="language-sh"&gt;%&amp;#62; &amp;#47;usr&amp;#47;local&amp;#47;bin&amp;#47;clang++33    -fno-omit-frame-pointer -fno-stack-protector -fexceptions -funwind-tables -std=c++11 -fno-rtti -Wall -Wextra -Wno-sign-compare -Wno-strict-aliasing    CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;tuple.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;tuple_convert.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;tuple_update.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;key_def.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;index.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;hash_index.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;tree_index.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;bitset_index.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;space.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;port.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;request.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;txn.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;box.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;lua&amp;#47;box.lua.c.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;lua&amp;#47;box_net.lua.c.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;lua&amp;#47;misc.lua.c.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;lua&amp;#47;sql.lua.c.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;box_lua.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;box_lua_space.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;__&amp;#47;__&amp;#47;cfg&amp;#47;tarantool_box_cfg.c.o -o tarantool_box libltbox.a ..&amp;#47;..&amp;#47;cfg&amp;#47;libcfg.a ..&amp;#47;libcore.a ..&amp;#47;..&amp;#47;libev.a ..&amp;#47;..&amp;#47;libeio.a ..&amp;#47;..&amp;#47;libcoro.a ..&amp;#47;..&amp;#47;libgopt.a ..&amp;#47;..&amp;#47;libcjson.a ..&amp;#47;..&amp;#47;third_party&amp;#47;luajit&amp;#47;src&amp;#47;libluajit.a ..&amp;#47;..&amp;#47;libmisc.a -lpthread -lintl -lelf ..&amp;#47;lib&amp;#47;bitset&amp;#47;libbitset.a ..&amp;#47;lib&amp;#47;bit&amp;#47;libbit.a -L&amp;#47;usr&amp;#47;local&amp;#47;lib ..&amp;#47;..&amp;#47;dtrace&amp;#47;ev_dtrace.o
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class="language-sh"&gt;%&amp;#62; sudo dtrace -l -m tarantool_box
  ID   PROVIDER            MODULE                          FUNCTION NAME
56571    ev42775     tarantool_box                            ev_run tick-start
56572    ev42775     tarantool_box                            ev_run tick-stop
56573    ev42776     tarantool_box                            ev_run tick-start
56574    ev42776     tarantool_box                            ev_run tick-stop
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class="language-sh"&gt;%&amp;#62; &amp;#47;usr&amp;#47;local&amp;#47;bin&amp;#47;clang++33    -fno-omit-frame-pointer -fno-stack-protector -fexceptions -funwind-tables -std=c++11 -fno-rtti -Wall -Wextra -Wno-sign-compare -Wno-strict-aliasing    CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;tuple.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;tuple_convert.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;tuple_update.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;key_def.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;index.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;hash_index.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;tree_index.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;bitset_index.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;space.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;port.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;request.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;txn.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;box.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;lua&amp;#47;box.lua.c.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;lua&amp;#47;box_net.lua.c.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;lua&amp;#47;misc.lua.c.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;lua&amp;#47;sql.lua.c.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;box_lua.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;box_lua_space.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;__&amp;#47;__&amp;#47;cfg&amp;#47;tarantool_box_cfg.c.o -o tarantool_box libltbox.a ..&amp;#47;..&amp;#47;cfg&amp;#47;libcfg.a ..&amp;#47;libcore.a ..&amp;#47;..&amp;#47;libev.a ..&amp;#47;..&amp;#47;libeio.a ..&amp;#47;..&amp;#47;libcoro.a ..&amp;#47;..&amp;#47;libgopt.a ..&amp;#47;..&amp;#47;libcjson.a ..&amp;#47;..&amp;#47;third_party&amp;#47;luajit&amp;#47;src&amp;#47;libluajit.a ..&amp;#47;..&amp;#47;libmisc.a -lpthread -lintl -lelf ..&amp;#47;lib&amp;#47;bitset&amp;#47;libbitset.a ..&amp;#47;lib&amp;#47;bit&amp;#47;libbit.a -L&amp;#47;usr&amp;#47;local&amp;#47;lib ..&amp;#47;..&amp;#47;dtrace&amp;#47;core_dtrace.o

``` sh
%&amp;#62; sudo dtrace -l -m tarantool_box
  ID   PROVIDER            MODULE                          FUNCTION NAME
56571  coro43386     tarantool_box                         coro_init new-entry
56572  coro43387     tarantool_box                         coro_init new-entry
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This shows the main issue with linking all &lt;code&gt;*.o&lt;/code&gt; dtrace objects. If want try that You&amp;#8217;ll get only one working provider because it is linked with  sorted objects and first is cjson alphabetically .&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-sh"&gt;%&amp;#62; &amp;#47;usr&amp;#47;local&amp;#47;bin&amp;#47;clang++33    -fno-omit-frame-pointer -fno-stack-protector -fexceptions -funwind-tables -std=c++11 -fno-rtti -Wall -Wextra -Wno-sign-compare -Wno-strict-aliasing    CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;tuple.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;tuple_convert.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;tuple_update.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;key_def.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;index.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;hash_index.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;tree_index.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;bitset_index.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;space.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;port.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;request.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;txn.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;box.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;lua&amp;#47;box.lua.c.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;lua&amp;#47;box_net.lua.c.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;lua&amp;#47;misc.lua.c.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;lua&amp;#47;sql.lua.c.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;box_lua.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;box_lua_space.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;__&amp;#47;__&amp;#47;cfg&amp;#47;tarantool_box_cfg.c.o -o tarantool_box libltbox.a ..&amp;#47;..&amp;#47;cfg&amp;#47;libcfg.a ..&amp;#47;libcore.a ..&amp;#47;..&amp;#47;libev.a ..&amp;#47;..&amp;#47;libeio.a ..&amp;#47;..&amp;#47;libcoro.a ..&amp;#47;..&amp;#47;libgopt.a ..&amp;#47;..&amp;#47;libcjson.a ..&amp;#47;..&amp;#47;third_party&amp;#47;luajit&amp;#47;src&amp;#47;libluajit.a ..&amp;#47;..&amp;#47;libmisc.a -lpthread -lintl -lelf ..&amp;#47;lib&amp;#47;bitset&amp;#47;libbitset.a ..&amp;#47;lib&amp;#47;bit&amp;#47;libbit.a -L&amp;#47;usr&amp;#47;local&amp;#47;lib ..&amp;#47;..&amp;#47;dtrace&amp;#47;*.o
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class="language-sh"&gt;%&amp;#62; sudo dtrace -l -m tarantool_box
  ID   PROVIDER            MODULE                          FUNCTION NAME
56571 cjson43681     tarantool_box                       json_encode encode-done
56572 cjson43681     tarantool_box                       json_encode encode-start
56573 cjson43681     tarantool_box                     luaopen_cjson new-entry
56574 cjson43682     tarantool_box                       json_encode encode-done
56575 cjson43682     tarantool_box                       json_encode encode-start
56576 cjson43682     tarantool_box                     luaopen_cjson new-entry
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class="language-sh"&gt;%&amp;#62; &amp;#47;usr&amp;#47;local&amp;#47;bin&amp;#47;clang++33    -fno-omit-frame-pointer -fno-stack-protector -fexceptions -funwind-tables -std=c++11 -fno-rtti -Wall -Wextra -Wno-sign-compare -Wno-strict-aliasing    CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;tuple.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;tuple_convert.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;tuple_update.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;key_def.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;index.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;hash_index.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;tree_index.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;bitset_index.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;space.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;port.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;request.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;txn.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;box.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;lua&amp;#47;box.lua.c.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;lua&amp;#47;box_net.lua.c.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;lua&amp;#47;misc.lua.c.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;lua&amp;#47;sql.lua.c.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;box_lua.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;box_lua_space.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;__&amp;#47;__&amp;#47;cfg&amp;#47;tarantool_box_cfg.c.o -o tarantool_box libltbox.a ..&amp;#47;..&amp;#47;cfg&amp;#47;libcfg.a ..&amp;#47;libcore.a ..&amp;#47;..&amp;#47;libev.a ..&amp;#47;..&amp;#47;libeio.a ..&amp;#47;..&amp;#47;libcoro.a ..&amp;#47;..&amp;#47;libgopt.a ..&amp;#47;..&amp;#47;libcjson.a ..&amp;#47;..&amp;#47;third_party&amp;#47;luajit&amp;#47;src&amp;#47;libluajit.a ..&amp;#47;..&amp;#47;libmisc.a -lpthread -lintl -lelf ..&amp;#47;lib&amp;#47;bitset&amp;#47;libbitset.a ..&amp;#47;lib&amp;#47;bit&amp;#47;libbit.a -L&amp;#47;usr&amp;#47;local&amp;#47;lib ..&amp;#47;..&amp;#47;dtrace&amp;#47;coro_dtrace.o ..&amp;#47;..&amp;#47;dtrace&amp;#47;ev_dtrace.o ..&amp;#47;..&amp;#47;dtrace&amp;#47;cjson_dtrace.o
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class="language-sh"&gt;%&amp;#62; sudo dtrace -l -m tarantool_box
  ID   PROVIDER            MODULE                          FUNCTION NAME
56571  coro43978     tarantool_box                         coro_init new-entry
56572  coro43979     tarantool_box                         coro_init new-entry
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class="language-sh"&gt;%&amp;#62; &amp;#47;usr&amp;#47;local&amp;#47;bin&amp;#47;clang++33    -fno-omit-frame-pointer -fno-stack-protector -fexceptions -funwind-tables -std=c++11 -fno-rtti -Wall -Wextra -Wno-sign-compare -Wno-strict-aliasing    CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;tuple.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;tuple_convert.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;tuple_update.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;key_def.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;index.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;hash_index.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;tree_index.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;bitset_index.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;space.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;port.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;request.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;txn.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;box.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;lua&amp;#47;box.lua.c.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;lua&amp;#47;box_net.lua.c.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;lua&amp;#47;misc.lua.c.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;lua&amp;#47;sql.lua.c.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;box_lua.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;box_lua_space.cc.o CMakeFiles&amp;#47;tarantool_box.dir&amp;#47;__&amp;#47;__&amp;#47;cfg&amp;#47;tarantool_box_cfg.c.o -o tarantool_box libltbox.a ..&amp;#47;..&amp;#47;cfg&amp;#47;libcfg.a ..&amp;#47;libcore.a ..&amp;#47;..&amp;#47;libev.a ..&amp;#47;..&amp;#47;libeio.a ..&amp;#47;..&amp;#47;libcoro.a ..&amp;#47;..&amp;#47;libgopt.a ..&amp;#47;..&amp;#47;libcjson.a ..&amp;#47;..&amp;#47;third_party&amp;#47;luajit&amp;#47;src&amp;#47;libluajit.a ..&amp;#47;..&amp;#47;libmisc.a -lpthread -lintl -lelf ..&amp;#47;lib&amp;#47;bitset&amp;#47;libbitset.a ..&amp;#47;lib&amp;#47;bit&amp;#47;libbit.a -L&amp;#47;usr&amp;#47;local&amp;#47;lib ..&amp;#47;..&amp;#47;dtrace&amp;#47;ev_dtrace.o ..&amp;#47;..&amp;#47;dtrace&amp;#47;coro_dtrace.o ..&amp;#47;..&amp;#47;dtrace&amp;#47;cjson_dtrace.o
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class="language-sh"&gt;%&amp;#62; sudo dtrace -l -m tarantool_box
  ID   PROVIDER            MODULE                          FUNCTION NAME
56571    ev44268     tarantool_box                            ev_run tick-start
56572    ev44268     tarantool_box                            ev_run tick-stop
56573    ev44269     tarantool_box                            ev_run tick-start
56574    ev44269     tarantool_box                            ev_run tick-stop
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The issue is solved with use one common dtrace object for all libs. You need to run:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;dtrace -G -s file.d *.o -o common.o
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And then link libs, objects and common.o to the binary.&lt;/p&gt;
&lt;h2 id="wildcards-dont-work."&gt;Wildcards don&amp;#8217;t work.&lt;/h2&gt;
&lt;p&gt;I fixed first issue. Wildcards do not work for all providers. &lt;/p&gt;
&lt;p&gt;Ready to use providers in module:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-sh"&gt;%&amp;#62; sudo dtrace -l -m tarantool_box
   ID   PROVIDER            MODULE                          FUNCTION NAME
 2789  coro23800     tarantool_box                         coro_init new-entry
 2790    ev23800     tarantool_box                            ev_run tick-start
 2791    ev23800     tarantool_box                            ev_run tick-stop
 2792 cjson23800     tarantool_box                       json_encode encode-done
 2793 cjson23800     tarantool_box                       json_encode encode-start
 2893  coro23798     tarantool_box                         coro_init new-entry
 2894    ev23798     tarantool_box                            ev_run tick-start
 2895    ev23798     tarantool_box                            ev_run tick-stop
 2896 cjson23798     tarantool_box                       json_encode encode-done
 2897 cjson23798     tarantool_box                       json_encode encode-start
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If I had file.d which contained: &lt;/p&gt;
&lt;pre&gt;&lt;code class="language-c"&gt;provider cjson {
    probe new__entry();
    probe encode__start();
    probe encode__done(int len, char *);
};
provider coro {
    probe new__entry();
};
provider ev {
    probe tick__start(int flags);
    probe tick__stop(int flags);
};
````

I would got only one working ```cjson*:```:

``` sh
%&amp;#62; sudo dtrace -n &amp;#39;cjson*::json_encode:encode-done&amp;#39;
dtrace: description &amp;#39;cjson*::json_encode:encode-done&amp;#39; matched 2 probes
CPU     ID                    FUNCTION:NAME
 1      4          json_encode:encode-done
 0      4          json_encode:encode-done
 1      4          json_encode:encode-done
 1      4          json_encode:encode-done
^C
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Empty results for another provider in the module:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-sh"&gt;%&amp;#62; sudo dtrace -n coro*:::

^C
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The trouble relates to position providers in &lt;code&gt;file.d&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Not fixed in &lt;a href="http://FreeBSD.org" title="The main OS"&gt;FreeBSD&lt;/a&gt;, You have to use one name for all providers:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-sh"&gt;%&amp;#62; sudo dtrace -l -m tarantool_box
   ID   PROVIDER            MODULE                          FUNCTION NAME
56571 tarantool75366     tarantool_box                       json_encode encode-done
56572 tarantool75366     tarantool_box                       json_encode encode-start
56573 tarantool75366     tarantool_box                     luaopen_cjson new-entry
56574 tarantool75366     tarantool_box                         coro_init new-entry
56575 tarantool75366     tarantool_box                            ev_run tick-start
56576 tarantool75366     tarantool_box                            ev_run tick-stop
56577 tarantool75367     tarantool_box                       json_encode encode-done
56578 tarantool75367     tarantool_box                       json_encode encode-start
56579 tarantool75367     tarantool_box                     luaopen_cjson new-entry
56580 tarantool75367     tarantool_box                         coro_init new-entry
56581 tarantool75367     tarantool_box                            ev_run tick-start
56582 tarantool75367     tarantool_box                            ev_run tick-stop
````

All the providers must use the code
-----

If you defined a lot of providers in the D file, but some of providers doesn&amp;#39;t use the code, then all providers doesn&amp;#39;t work.

For example you have:

``` c
provider lua_cjson {
       probe start();
       probe end(int, char *);
};
provider coro {
       probe new__entry();
};
provider ev {
       probe tick__start(int flags);
       probe tick__stop(int flags);
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;But providers &lt;code&gt;lua_cjson&lt;/code&gt; and &lt;code&gt;coro&lt;/code&gt; doesn&amp;#8217;t use in code but defined in D file. You&amp;#8217;ll have:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-sh"&gt;%&amp;#62; sudo dtrace -l -m tarantool_box
Password:
   ID   PROVIDER            MODULE                          FUNCTION NAME
dtrace: failed to match :tarantool_box::: No probe matches description
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If you change file as below:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-c"&gt;provider ev {
       probe tick__start(int flags);
       probe tick__stop(int flags);
};
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Then run tarantool again you&amp;#8217;ll have:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-sh"&gt;%&amp;#62; sudo dtrace -l -m tarantool_box
   ID   PROVIDER            MODULE                          FUNCTION NAME
56642    ev32305     tarantool_box                            ev_run tick-start
56643    ev32305     tarantool_box                            ev_run tick-stop
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This is bug on &lt;a href="http://FreeBSD.org" title="The main OS"&gt;FreeBSD&lt;/a&gt; and &lt;a href="http://linux.oracle.com/RELEASE-NOTES-UEK3-BETA-en.html" title="Oracle Linux UEK3"&gt;Oracle Linux&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="kernel-panic-by-empty-module"&gt;Kernel panic by empty MODULE&lt;/h2&gt;
&lt;p&gt;If you run application You&amp;#8217;ll get access to providers:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-sh"&gt;%&amp;#62; sudo dtrace -l -m tarantool_box
  ID   PROVIDER            MODULE                          FUNCTION NAME
   4  cjson2015     tarantool_box                       json_encode encode-done
   5  cjson2015     tarantool_box                       json_encode encode-start
   6  cjson2015     tarantool_box                     luaopen_cjson new-entry
   7   coro2015     tarantool_box                         coro_init new-entry
   8     ev2015     tarantool_box                            ev_run tick-start
   9     ev2015     tarantool_box                            ev_run tick-stop
  10  cjson2016     tarantool_box                       json_encode encode-done
  11  cjson2016     tarantool_box                       json_encode encode-start
  12  cjson2016     tarantool_box                     luaopen_cjson new-entry
  13   coro2016     tarantool_box                         coro_init new-entry
  14     ev2016     tarantool_box                            ev_run tick-start
  15     ev2016     tarantool_box                            ev_run tick-stop
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;But If you run &lt;code&gt;dtrace -m tarantool_box&lt;/code&gt; and then shutdown tarantool_box You&amp;#8217;ll get a kernel panic:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-text"&gt;#&amp;#62;  kgdb kernel.debug &amp;#47;var&amp;#47;crash&amp;#47;vmcore.0
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and&amp;#47;or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "amd64-marcel-freebsd"...

Unread portion of the kernel message buffer:
kernel trap 12 with interrupts disabled


Fatal trap 12: page fault while in kernel mode
cpuid = 1; apic id = 01
fault virtual address   = 0xfffffdffd8ecf3e2
fault code      = supervisor read data, page not present
instruction pointer = 0x20:0xffffffff81a4a7fd
stack pointer           = 0x28:0xffffff80d53119d0
frame pointer           = 0x28:0xffffff80d53119f0
code segment        = base 0x0, limit 0xfffff, type 0x1b
            = DPL 0, pres 1, long 1, def32 0, gran 1
processor eflags    = resume, IOPL = 1
current process     = 2023 (tarantool_box)
trap number     = 12
panic: page fault
cpuid = 1
KDB: stack backtrace:
#0 0xffffffff809538a6 at kdb_backtrace+0x66
#1 0xffffffff8091ac8e at panic+0x1ce
#2 0xffffffff80c17990 at trap_fatal+0x290
#3 0xffffffff80c17cfc at trap_pfault+0x21c
#4 0xffffffff80c182f5 at trap+0x365
#5 0xffffffff80c025f3 at calltrap+0x8
#6 0xffffffff81cb15fd at fasttrap_fork+0x27d
#7 0xffffffff808eaea9 at fork1+0x1519
#8 0xffffffff808ebc12 at sys_fork+0x22
#9 0xffffffff80c1713a at amd64_syscall+0x5ea
#10 0xffffffff80c028d7 at Xfast_syscall+0xf7
Uptime: 5m12s
Dumping 356 out of 3001 MB:..5%..14%..23%..32%..41%..54%..63%..72%..81%..95%

.... Loading modules skipped ....

#0  doadump (textdump=Variable "textdump" is not available.
) at pcpu.h:224
224     __asm("movq %%gs:0,%0" : "=r" (td));
(kgdb) list *0xffffffff81a4a7fd
0xffffffff81a4a7fd is in dtrace_assfail (&amp;#47;usr&amp;#47;src&amp;#47;sys&amp;#47;modules&amp;#47;dtrace&amp;#47;dtrace&amp;#47;..&amp;#47;..&amp;#47;..&amp;#47;cddl&amp;#47;contrib&amp;#47;opensolaris&amp;#47;uts&amp;#47;common&amp;#47;dtrace&amp;#47;dtrace.c:603).
598 }
599
600 int
601 dtrace_assfail(const char *a, const char *f, int l)
602 {
603     dtrace_panic("assertion failed: %s, file: %s, line: %d", a, f, l);
604
605     &amp;#47;*
606      * We just need something here that even the most clever compiler
607      * cannot optimize away.
(kgdb) backtrace
#0  doadump (textdump=Variable "textdump" is not available.
) at pcpu.h:224
#1  0xffffffff8091a771 in kern_reboot (howto=260) at &amp;#47;usr&amp;#47;src&amp;#47;sys&amp;#47;kern&amp;#47;kern_shutdown.c:448
#2  0xffffffff8091ac67 in panic (fmt=0x1 &amp;#60;Address 0x1 out of bounds&amp;#62;) at &amp;#47;usr&amp;#47;src&amp;#47;sys&amp;#47;kern&amp;#47;kern_shutdown.c:636
#3  0xffffffff80c17990 in trap_fatal (frame=0xc, eva=Variable "eva" is not available.
) at &amp;#47;usr&amp;#47;src&amp;#47;sys&amp;#47;amd64&amp;#47;amd64&amp;#47;trap.c:857
#4  0xffffffff80c17cfc in trap_pfault (frame=0xffffff80d5311920, usermode=0) at &amp;#47;usr&amp;#47;src&amp;#47;sys&amp;#47;amd64&amp;#47;amd64&amp;#47;trap.c:773
#5  0xffffffff80c182f5 in trap (frame=0xffffff80d5311920) at &amp;#47;usr&amp;#47;src&amp;#47;sys&amp;#47;amd64&amp;#47;amd64&amp;#47;trap.c:456
#6  0xffffffff80c025f3 in calltrap () at &amp;#47;usr&amp;#47;src&amp;#47;sys&amp;#47;amd64&amp;#47;amd64&amp;#47;exception.S:228
#7  0xffffffff81a4a7fd in dtrace_assfail (a=0xffffffff81cb4bc6 "cp-&amp;#62;p_dtrace_count == 0", f=0xfffffe005721a81c "coro*", l=Variable "l" is not available.
)
    at &amp;#47;usr&amp;#47;src&amp;#47;sys&amp;#47;modules&amp;#47;dtrace&amp;#47;dtrace&amp;#47;..&amp;#47;..&amp;#47;..&amp;#47;cddl&amp;#47;contrib&amp;#47;opensolaris&amp;#47;uts&amp;#47;common&amp;#47;dtrace&amp;#47;dtrace.c:603
#8  0xffffffff81cb15fd in fasttrap_fork (p=0xfffffe00a83b64a0, cp=0xfffffe005711d940)
    at &amp;#47;usr&amp;#47;src&amp;#47;sys&amp;#47;modules&amp;#47;dtrace&amp;#47;fasttrap&amp;#47;..&amp;#47;..&amp;#47;..&amp;#47;cddl&amp;#47;contrib&amp;#47;opensolaris&amp;#47;uts&amp;#47;common&amp;#47;dtrace&amp;#47;fasttrap.c:479
#9  0xffffffff808eaea9 in fork1 (td=0xfffffe002b730470, flags=20, pages=Variable "pages" is not available.
) at &amp;#47;usr&amp;#47;src&amp;#47;sys&amp;#47;kern&amp;#47;kern_fork.c:694
#10 0xffffffff808ebc12 in sys_fork (td=0xfffffe002b730470, uap=Variable "uap" is not available.
) at &amp;#47;usr&amp;#47;src&amp;#47;sys&amp;#47;kern&amp;#47;kern_fork.c:110
#11 0xffffffff80c1713a in amd64_syscall (td=0xfffffe002b730470, traced=0) at subr_syscall.c:135
#12 0xffffffff80c028d7 in Xfast_syscall () at &amp;#47;usr&amp;#47;src&amp;#47;sys&amp;#47;amd64&amp;#47;amd64&amp;#47;exception.S:387
#13 0x0000000801731a7c in ?? ()
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Mark Johnston send me &lt;a href="http://svnweb.freebsd.org/base/head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c?r1=254198&amp;amp;r2=254197&amp;amp;pathrev=254198" title="Fix panic"&gt;FIX&lt;/a&gt; panic. I am planing to try the patch.&lt;/p&gt;
&lt;h2 id="cmake-automation"&gt;CMake automation&lt;/h2&gt;
&lt;p&gt;Integration with CMake or another build tools is painful because you need do &lt;code&gt;dtrace -G&lt;/code&gt; for one or many objects.
But that is not needed on on OSX, this is the best way and more convenient. See example with full hack linking to library&amp;#47;binary:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-cmake"&gt;set(cjson_obj)
 
add_library(cjson_objs OBJECT lua_cjson.c strbuf.c ${FPCONV_SOURCES})
set_target_properties(cjson_objs PROPERTIES POSITION_INDEPENDENT_CODE ON)
set(cjson_obj ${cjson_obj} $&amp;#60;TARGET_OBJECTS:cjson_objs&amp;#62;)
 
if(ENABLE_DTRACE AND DTRACE)
    message(STATUS "DTrace found and enabled")
    add_definitions(-DENABLE_DTRACE)
    set(D_FILE ${PROJECT_SOURCE_DIR}&amp;#47;cjson_dtrace)
    execute_process(
       COMMAND ${DTRACE} -h -s ${D_FILE}.d -o ${D_FILE}.h
    )
    if(${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
        set(cjson_obj_2 ${CMAKE_CURRENT_BINARY_DIR}&amp;#47;CMakeFiles&amp;#47;cjson_objs.dir&amp;#47;lua_cjson.c.o)
        set(dtrace_obj ${CMAKE_CURRENT_BINARY_DIR}&amp;#47;dtrace.o)
        add_custom_command(OUTPUT ${dtrace_obj}
            COMMAND ${DTRACE} -G -s ${D_FILE}.d -o ${dtrace_obj} ${cjson_obj_2}
            DEPENDS ${cjson_obj_2}
        )
        set_source_files_properties(${dtrace_obj}
            PROPERTIES
            EXTERNAL_OBJECT true
            GENERATED true
        )
        set(cjson_obj ${cjson_obj} ${dtrace_obj})
        unset(cjson_obj_2)
        unset(dtrace_obj)
        unset(D_FILE)
    endif()
endif()
 
add_library(cjson MODULE ${cjson_obj})
set_target_properties(cjson PROPERTIES PREFIX "")
target_link_libraries(cjson ${_MODULE_LINK})
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id="dtrace-in-tarantool"&gt;DTrace in tarantool&lt;/h2&gt;
&lt;p&gt;A pre-release of DTrace is available in &lt;a href="http://tarantool.org" title="The Tarantool project"&gt;tarantool&lt;/a&gt;. If you run box.cjson.encode() function, You&amp;#8217;ll able to see data for encoding and len. &lt;/p&gt;
&lt;p&gt;Example commands in command line tarantool client: &lt;/p&gt;
&lt;pre&gt;&lt;code class="language-text"&gt;127.0.0.2&amp;#62; lua box.cjson.encode({test= &amp;#39;xzvfvzcvzx&amp;#39;})
---
 - {"test":"xzvfvzcvzx"}
...
127.0.0.2&amp;#62; lua box.cjson.encode({test= &amp;#39;xzvfvzcvzx&amp;#39;})
---
 - {"test":"xzvfvzcvzx"}
...
127.0.0.2&amp;#62; lua box.cjson.encode({test= &amp;#39;xzvfvzcvzx&amp;#39;})
---
 - {"test":"xzvfvzcvzx"}
...
127.0.0.2&amp;#62; lua box.cjson.encode({test= &amp;#39;xzvfvzsafzx&amp;#39;})
---
 - {"test":"xzvfvzsafzx"}
...
127.0.0.2&amp;#62; lua box.cjson.encode({test= &amp;#39;xx&amp;#39;})
---
 - {"test":"xx"}
...
127.0.0.2&amp;#62; lua box.cjson.encode({tmasfasdf= &amp;#39;xx&amp;#39;})
---
 - {"tmasfasdf":"xx"}
...
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;DTrace in action:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-sh"&gt;%&amp;#62; sudo dtrace -n &amp;#39;tarantool*:json_encode:encode-start { self-&amp;#62;ts = timestamp; } tarantool*:json_encode:encode-done { printf("%s time: %d", copyinstr(arg1),
 ((timestamp - self-&amp;#62;ts)&amp;#47;1000)); }&amp;#39;
dtrace: description &amp;#39;tarantool*:json_encode:encode-start &amp;#39; matched 4 probes
CPU     ID                    FUNCTION:NAME
  1  56611          json_encode:encode-done {"test":"xzvfvzcvzx"}x"} time: 10
  1  56611          json_encode:encode-done {"test":"xzvfvzcvzx"}x"} time: 10
  1  56611          json_encode:encode-done {"test":"xzvfvzcvzx"}x"} time: 7
  1  56611          json_encode:encode-done {"test":"xzvfvzsafzx"}"} time: 10
  1  56611          json_encode:encode-done {"test":"xx"}vzsafzx"}"} time: 9
  1  56611          json_encode:encode-done {"tmasfasdf":"xx"}zx"}"} time: 9
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Patched tarantool available in the repo &lt;a href="https://github.com/tarantool/tarantool/tree/dtrace" title="DTrace in tarantool"&gt;tarantool-dtrace&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="dtrace-probes-at-runtime"&gt;DTrace probes at runtime&lt;/h2&gt;
&lt;p&gt;This is very intersting task, I found &lt;a href="https://github.com/chrisa/libusdt" title="libusdt"&gt;libusdt&lt;/a&gt; with &lt;a href="https://github.com/chrisa/lua-usdt" title="lua-usdt"&gt;lua-usdt&lt;/a&gt; bindings and tried that in &lt;a href="https://github.com/tarantool/tarantool/tree/dtrace" title="DTrace in tarantool"&gt;tarantool-dtrace&lt;/a&gt;. I had great result on OSX and FreeBSD but on Oracle Linux doesn&amp;#8217;t work.&lt;/p&gt;
&lt;p&gt;Exaple of usage:&lt;/p&gt;
&lt;p&gt;After you run the application you have only static providers:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-sh"&gt;%&amp;#62; sudo dtrace -l -m tarantool_box
   ID   PROVIDER            MODULE                          FUNCTION NAME
 1578   lua54178     tarantool_box                               foo iprobe
 4031    ev54179     tarantool_box                            ev_run tick-start
 4032    ev54179     tarantool_box                            ev_run tick-stop
 4132    ev54178     tarantool_box                            ev_run tick-start
 4133    ev54178     tarantool_box                            ev_run tick-stop
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Then connect and try to use a USDT providers at realtime:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-sh"&gt;%&amp;#62; ~&amp;#47;tmp&amp;#47;tt-dtrace&amp;#47;bin&amp;#47;tarantool
localhost&amp;#62; usdt
---
- provider: &amp;#39;function: 0x094ca2b0&amp;#39;
...
localhost&amp;#62; provider = usdt.provider("lua", "tarantool_box")
---
...
localhost&amp;#62; iprobe = provider:probe("foo", "iprobe", "int")
---
...
localhost&amp;#62; provider:enable()
---
...
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If you run DTrace you&amp;#8217;ll see available probes at realtime:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-sh"&gt;%&amp;#62; sudo dtrace -n &amp;#39;lua*:tarantool_box:foo:iprobe { printf("%d", arg0)}&amp;#39;
dtrace: description &amp;#39;lua*:tarantool_box:foo:iprobe &amp;#39; matched 1 probe
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Time to fire!&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-sh"&gt;localhost&amp;#62; iprobe:fire(1)
---
...
localhost&amp;#62; iprobe:fire(2)
---
...
localhost&amp;#62; iprobe:fire(4)
---
...
localhost&amp;#62; iprobe:fire(200)
---
...
localhost&amp;#62;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You must see probes at realtime:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-sh"&gt;%&amp;#62; sudo dtrace -n &amp;#39;lua*:tarantool_box:foo:iprobe { printf("%d", arg0)}&amp;#39;
dtrace: description &amp;#39;lua*:tarantool_box:foo:iprobe &amp;#39; matched 1 probe
CPU     ID                    FUNCTION:NAME
  1   1578                       foo:iprobe 1
  0   1578                       foo:iprobe 2
  1   1578                       foo:iprobe 4
  1   1578                       foo:iprobe 200
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Unfortunately doesn&amp;#8217;t work on Oracle Linux. Also FreeBSD have a bug with USDT probes where probes more than 5 arguments.&lt;/p&gt;
&lt;h2 id="dtrace-on-freebsd"&gt;DTrace on FreeBSD&lt;/h2&gt;
&lt;p&gt;DTrace has a lot of bugs but it works with some limits.&lt;/p&gt;
&lt;p&gt;Bug list:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Wildcard bug&lt;/li&gt;
&lt;li&gt;USDT at runtime works only with probes with arguments less than 5&lt;/li&gt;
&lt;li&gt;USDT depended by base src because need &lt;code&gt;dtrace.h&lt;/code&gt; although It exists on OSX and Oracle Linux&lt;/li&gt;
&lt;li&gt;Bug with providers position in D file with multi link dtrace objects&lt;/li&gt;
&lt;li&gt;Bug with not used probes when all providers unavailable if doesn&amp;#8217;t use in code&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="dtrace-on-oracle-linux"&gt;DTrace on Oracle Linux&lt;/h2&gt;
&lt;p&gt;DTrace on &lt;a href="http://linux.oracle.com/RELEASE-NOTES-UEK3-BETA-en.html" title="Oracle Linux UEK3"&gt;Oracle Linux&lt;/a&gt; doesn&amp;#8217;t work well. I found a few bugs similar as on FreeBSD.&lt;/p&gt;
&lt;p&gt;Bug list:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;USDT doesn&amp;#8217;t work&lt;/li&gt;
&lt;li&gt;Bug with providers position in D file with multi link dtrace objects&lt;/li&gt;
&lt;li&gt;Bug with not used probes when all providers unavailable if doesn&amp;#8217;t use in code&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="dtrace-on-osx"&gt;DTrace on OSX&lt;/h2&gt;
&lt;p&gt;Bug list:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Not found&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="conclusions"&gt;Conclusions&lt;/h2&gt;
&lt;p&gt;The best platform for DTrace is OSX now. &lt;/p&gt;
&lt;p&gt;DTrace on OSX more convenient than FreeBSD&amp;#47;Linux&amp;#47;Solaris because it has a modified toolchain. You need only use:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;dtrace -h -s file.d -o header.h&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;And then include &lt;code&gt;header.h&lt;/code&gt; in C code and compile binary file. &lt;/p&gt;
&lt;h2 id="thanks-to"&gt;Thanks to&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://blog.eitanadler.com" title="Eitan Adler's blog"&gt;Eitan Adler&lt;/a&gt;, He corrected mistakes in English.&lt;/li&gt;
&lt;li&gt;Mark Johnston (markj@), He helped with various troubles in DTrace.&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry>
  <entry>
    <title>Installing a FusionInventory to FreeBSD</title>
    <link href="http://zlonet.ru/page/installing-a-fusioninventory-to-freebsd/"/>
    <id>http://zlonet.ru/page/installing-a-fusioninventory-to-freebsd</id>
    <updated>2011-02-18T00:00:00Z</updated>
    <summary type="html">&lt;p&gt;Hi everybody!
This is simple how to install fusioninventory to [FreeBSD]. I missed steps with install a DB.&lt;/p&gt;</summary>
    <content type="html">&lt;p&gt;Hi everybody!
This is simple how to install fusioninventory to &lt;a href="http://www.freebsd.org/"&gt;FreeBSD&lt;/a&gt;. I missed steps with install a DB.&lt;/p&gt;
&lt;p&gt;I have:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-bash"&gt;% uname -sr
FreeBSD 8.1-RELEASE
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I like ports tree :) We will install glpi and plugin from a ports tree &lt;/p&gt;
&lt;pre&gt;&lt;code class="language-bash"&gt;$portmaster www&amp;#47;nginx www&amp;#47;glpi
$echo nginx_enable=\"YES\"&amp;#62;&amp;#62;&amp;#47;etc&amp;#47;rc.conf
$echo php_fpm_enable=\"YES\"&amp;#62;&amp;#62;&amp;#47;etc&amp;#47;rc.conf
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You are can get a &lt;a href="http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/154867"&gt;port&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;And then try a few steps :-P&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-bash"&gt;$sh shar-1.sh
$make -C glpi-plugins-fusioninventory-server&amp;#47; install clean
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This is my configuration file for a &lt;a href="http://www.nginx.org/"&gt;nginx&lt;/a&gt; virtual host with glpi&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-nginx"&gt;server {
    listen       80;
    server_name  glpi;
    #    charset utf-8;
    #access_log  logs&amp;#47;host.access.log  main;
    access_log &amp;#47;var&amp;#47;log&amp;#47;nginx.glpi.log;
    error_log &amp;#47;var&amp;#47;log&amp;#47;nginx.error.glpi.log;
    location &amp;#47; {
        root   &amp;#47;usr&amp;#47;local&amp;#47;www&amp;#47;glpi;
        index  index.php index.html index.htm;
    }
    #error_page  404              &amp;#47;404.html;
    # redirect server error pages to the static page &amp;#47;50x.html
    #
    error_page   500 502 503 504  &amp;#47;50x.html;
    location = &amp;#47;50x.html {
        root   &amp;#47;usr&amp;#47;local&amp;#47;www&amp;#47;nginx-dist;
    }
    location ~* \.php$ {
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME &amp;#47;usr&amp;#47;local&amp;#47;www&amp;#47;glpi$fastcgi_script_name;
        include fastcgi_params;
    }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now need create a log files and then start services&amp;#8230;.&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-bash"&gt;$touch &amp;#47;var&amp;#47;log&amp;#47;nginx.glpi.log
$touch &amp;#47;var&amp;#47;log&amp;#47;nginx.error.glpi.log
$&amp;#47;usr&amp;#47;local&amp;#47;etc&amp;#47;rc.d&amp;#47;php-fpm start
$&amp;#47;usr&amp;#47;local&amp;#47;etc&amp;#47;rc.d&amp;#47;nginx start
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Done. go to your glpi and activate plugin.&lt;/p&gt;</content>
  </entry>
  <entry>
    <title>Nginx with Perl and OTRS</title>
    <link href="http://zlonet.ru/page/nginxperlotrs/"/>
    <id>http://zlonet.ru/page/nginx-with-perl-and-otrs</id>
    <updated>2011-02-18T00:00:00Z</updated>
    <summary type="html">&lt;p&gt;Hi everybody!
I like [nginx]. It&amp;#8217;s a fast web server! But I need using otrs, without apache and mod_perl. This is my configs for it:&lt;/p&gt;</summary>
    <content type="html">&lt;p&gt;Hi everybody!
I like &lt;a href="http://www.nginx.org/"&gt;nginx&lt;/a&gt;. It&amp;#8217;s a fast web server! But I need using otrs, without apache and mod_perl. This is my configs for it:&lt;/p&gt;
&lt;p&gt;You can install otrs from freebsd ports tree and then use my configs with perl wrapper :)&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-bash"&gt;$portmaster -d devel&amp;#47;otrs www&amp;#47;nginx www&amp;#47;p5-FastCGI
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;nginx.conf&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-nginx"&gt;
server {
    listen 80;
    server_name localhost;
    root &amp;#47;usr&amp;#47;local&amp;#47;otrs&amp;#47;var&amp;#47;httpd&amp;#47;htdocs;
    access_log  &amp;#47;var&amp;#47;log&amp;#47;nginx&amp;#47;otrs.nginx_access.log;
    index index.html;
    location &amp;#47;otrs-web {
        gzip on;
        alias &amp;#47;usr&amp;#47;local&amp;#47;otrs&amp;#47;var&amp;#47;httpd&amp;#47;htdocs;
    }
    location ~ ^&amp;#47;otrs&amp;#47;(.*\.pl)(&amp;#47;.*)?$ {
        gzip off; #gzip makes scripts feel slower since they have to complete before getting gzipped
        #    fastcgi_pass  unix:&amp;#47;.$1.sock;
        fastcgi_pass unix:&amp;#47;var&amp;#47;run&amp;#47;perl-fcgi.sock;
        #    fastcgi_pass  127.0.0.1:8999;
        fastcgi_index index.pl;
        fastcgi_param SCRIPT_FILENAME   &amp;#47;usr&amp;#47;local&amp;#47;otrs&amp;#47;bin&amp;#47;fcgi-bin&amp;#47;$1;
        fastcgi_param QUERY_STRING      $query_string;
        fastcgi_param REQUEST_METHOD    $request_method;
        fastcgi_param CONTENT_TYPE      $content_type;
        fastcgi_param CONTENT_LENGTH    $content_length;
        fastcgi_param GATEWAY_INTERFACE CGI&amp;#47;1.1;
        fastcgi_param SERVER_SOFTWARE   nginx;
        fastcgi_param SCRIPT_NAME       $fastcgi_script_name;
        fastcgi_param REQUEST_URI       $request_uri;
        fastcgi_param DOCUMENT_URI      $document_uri;
        fastcgi_param DOCUMENT_ROOT     $document_root;
        fastcgi_param SERVER_PROTOCOL   $server_protocol;
        fastcgi_param REMOTE_ADDR       $remote_addr;
        fastcgi_param REMOTE_PORT       $remote_port;
        fastcgi_param SERVER_ADDR       $server_addr;
        fastcgi_param SERVER_PORT       $server_port;
        fastcgi_param SERVER_NAME       $server_name;
    }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And you need a wrapper for use perl :) You can get it from:&lt;/p&gt;
&lt;p&gt;copy &lt;a href="http://gitorious.org/zloidemon-freebsd-configs/trunk/blobs/master/scripts/perl-fcgi/fastcgi-wrapper"&gt;fcgi-wrapper&lt;/a&gt;  to &amp;#47;usr&amp;#47;local&amp;#47;sbin
copy &lt;a href="http://gitorious.org/zloidemon-freebsd-configs/trunk/blobs/master/scripts/perl-fcgi/perl-fcgi"&gt;perl-fcgi&lt;/a&gt; to &amp;#47;usr&amp;#47;local&amp;#47;sbin&lt;/p&gt;
&lt;p&gt;And rc.d script&lt;/p&gt;
&lt;p&gt;&lt;a href="http://gitorious.org/zloidemon-freebsd-configs/trunk/blobs/master/scripts/perl-fcgi/perl-fcgi.rc"&gt;perl-fcgi.rc&lt;/a&gt; to &amp;#47;usr&amp;#47;local&amp;#47;etc&amp;#47;rc.d&amp;#47;perl-fcgi&lt;/p&gt;
&lt;p&gt;then add&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-bash"&gt;$echo perl_fcgi_enable=\"YES\" &amp;#62;&amp;#62;&amp;#47;etc&amp;#47;rc.conf
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Thanks &lt;a href="http://technotes.1000lines.net/nginx-perl-fastcgi-how-to/"&gt;tech notes&lt;/a&gt;&lt;/p&gt;</content>
  </entry>
  <entry>
    <title>Upload a file from shell to file sharing hosting</title>
    <link href="http://zlonet.ru/page/upload-a-file-from-shell-to-file-sharing-hosting/"/>
    <id>http://zlonet.ru/page/upload-a-file-from-shell-to-file-sharing-hosting</id>
    <updated>2011-01-29T00:00:00Z</updated>
    <summary type="html">&lt;p&gt;I often sharing my files with use a file hosting. :) But I don&amp;#8217;t like use a browser for it. Now I&amp;#8217;ve wrote the function for my .zshrc.&lt;/p&gt;</summary>
    <content type="html">&lt;pre&gt;&lt;code class="language-bash"&gt;function zalil(){
    if [ -n "$1" -a -f "$1" ];then
        if  [ "`du -k $1|awk &amp;#39;{print $1}&amp;#39;`"  -lt "51200" ];then
            curl -s -i -F "file"=@"$1" -F "submit=%20%20Send%20%20" \
                http:&amp;#47;&amp;#47;zalil.ru&amp;#47;upload&amp;#47;|grep Location \
                | sed "s&amp;#47;Location: &amp;#47;http:&amp;#47;&amp;#47;zalil.ru&amp;#47;"
        else
            echo file $1 is large
        fi
    else
        echo file $1 is empty
    fi
}
&lt;/code&gt;&lt;/pre&gt;</content>
  </entry>
  <entry>
    <title>Pastebin in the ZSH</title>
    <link href="http://zlonet.ru/page/pastebin-in-the-zsh/"/>
    <id>http://zlonet.ru/page/pastebin-in-the-zsh</id>
    <updated>2011-01-24T00:00:00Z</updated>
    <summary type="html">&lt;p&gt;I&amp;#8217;ve wrote the pastebin function which I do use at the my .zshrc.&lt;/p&gt;</summary>
    <content type="html">&lt;p&gt;I&amp;#8217;ve wrote the pastebin function which I do use at the my .zshrc.&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-bash"&gt;function pastebin(){
    fload(){
        TFILE=`cat $1|sed &amp;#39;s|%|%25|g;s|&amp;#38;|%26|g;s|+|%2b|g;s|;|%3b|g&amp;#39;`
        curl -d &amp;#39;paste_code=&amp;#39;$TFILE&amp;#39;&amp;#39; &amp;#39;http:&amp;#47;&amp;#47;pastebin.com&amp;#47;api_public.php&amp;#39;
        echo
}

case $1 in
    -h)
    echo "Usage:"
    echo "        pastebin filename for paste a file"
    echo "        pastebin for edit&amp;#47;paste on fly";;
    *)
    if [ -n "$1" -a -f "$1" ];then
        if [ -s "$1" ];then
            fload $1
        else
            echo file $1 is empty
        fi
    else
        TEMPFILE=`mktemp -q &amp;#47;tmp&amp;#47;pastebin.XXXXXX`
        $EDITOR $TEMPFILE
        if [ -s "$TEMPFILE" ]; then
            fload $TEMPFILE
        fi
            rm ${TEMPFILE}*
    fi;;

esac
}
&lt;/code&gt;&lt;/pre&gt;</content>
  </entry>
  <entry>
    <title>The JunOS installation script</title>
    <link href="http://zlonet.ru/page/the-junos-installation-script/"/>
    <id>http://zlonet.ru/page/the-junos-installation-script</id>
    <updated>2011-01-08T00:00:00Z</updated>
    <summary type="html">&lt;p&gt;I don&amp;#8217;t like installing manually&amp;#8230; So I&amp;#8217;ve written a script for it. This is an autoamtic installation script for the JunOS olive for which you need to be using a version of [FreeBSD] &amp;#60; 8.  [FreeBSD] 8 is not supported.&lt;/p&gt;</summary>
    <content type="html">&lt;p&gt;I don&amp;#8217;t like installing manually&amp;#8230; So I&amp;#8217;ve written a script for it. This is an autoamtic installation script for the JunOS olive for which you need to be using a version of &lt;a href="http://www.freebsd.org/"&gt;FreeBSD&lt;/a&gt; &amp;#60; 8.  &lt;a href="http://www.freebsd.org/"&gt;FreeBSD&lt;/a&gt; 8 is not supported.&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-bash"&gt;#!&amp;#47;bin&amp;#47;sh
FILE=&amp;#39;jinstall-10.4R1.9-domestic-signed.tgz&amp;#39;
HASH=649006003c9773859882411246405a39
UNTAR=&amp;#39;tar zxf&amp;#39;
TAR=&amp;#39;tar zcf&amp;#39;
WORK=tmp

work (){
    if [ -d $WORK ]; then
        rm -fr $WORK
    fi
    mkdir -p $WORK
    cd $WORK
}

dwork (){
    cd ..&amp;#47;;rm -fr $WORK
}
if [ `sysctl kern.osreldate|awk &amp;#39;{print $2}&amp;#39;` -le 703000 ]; then
    if [ `md5 $FILE | awk &amp;#39;{print $4}&amp;#39;` = $HASH ]; then
            work
            $UNTAR ..&amp;#47;$FILE
            work
            $UNTAR `echo ..&amp;#47;$FILE|sed -e &amp;#39;s|-signed||g&amp;#39;`
            work
            $UNTAR ..&amp;#47;pkgtools.tgz
            cp -v &amp;#47;usr&amp;#47;bin&amp;#47;true bin&amp;#47;checkpic
            $TAR ..&amp;#47;pkgtools.tgz *
            dwork
            $TAR ..&amp;#47;..&amp;#47;`echo $FILE|sed -e &amp;#39;s|signed|olive|g&amp;#39;` *
            dwork;dwor
            pkg_add -f `echo $FILE|sed -e &amp;#39;s|signed|olive|g&amp;#39;`
            echo console=\"vidconsole\"&amp;#62;&amp;#62;&amp;#47;boot&amp;#47;loader.conf
            reboot
    else
        exit
    fi
else
    exit
fi
&lt;/code&gt;&lt;/pre&gt;</content>
  </entry>
  <entry>
    <title>Установка junos 10 на PC</title>
    <link href="http://zlonet.ru/page/ustanovka-junos-10-na-pc/"/>
    <id>http://zlonet.ru/page/junos-10-pc</id>
    <updated>2010-07-03T00:00:00Z</updated>
    <summary type="html">&lt;p&gt;Устанавливал JunOS я непосредственно в 7.3-RELEASE-i386-bootonly.iso.
Первое на что нужно обратить внимание, так это на разделение slice на partition. Если не создавать partition &amp;#47;tmp, то возникает ошибка об нехватке свободного места на носителе md1, который в свою очередь имеет объём 160Mb.&lt;/p&gt;</summary>
    <content type="html">&lt;p&gt;Устанавливал JunOS я непосредственно в 7.3-RELEASE-i386-bootonly.iso.
Первое на что нужно обратить внимание, так это на разделение slice на partition. Если не создавать partition &amp;#47;tmp, то возникает ошибка об нехватке свободного места на носителе md1, который в свою очередь имеет объём 160Mb.&lt;/p&gt;
&lt;p&gt;Нужно установить минимальную версию FreeBSD на носитель, и приступить к созданию модифицированного пакета.&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-bash"&gt;$cd &amp;#47;var&amp;#47;tmp
Кладем package сюда удобным для вас способом.... И приступаем к модификации.
$mkdir blah;cd blah;tar zxvf ..&amp;#47;jinstall-10.1R1.8-domestic-signed.tgz
$mkdir blah;cd blah;tar zxvf ..&amp;#47;jinstall-10.1R1.8-domestic.tgz

$mkdir blah;cd blah;tar zxvf ..&amp;#47;pkgtools.tgz
$cp -v &amp;#47;usr&amp;#47;bin&amp;#47;true bin&amp;#47;checkpic

$tar zcvf ..&amp;#47;pkgtools.tgz *
$cd ..&amp;#47;;rm -rf blah
$tar zcfv &amp;#47;var&amp;#47;tmp&amp;#47;jinstall-10.1R1.8-domestic.tgz *
Устанавливаем:
$pkg_add -f jinstall-10.1R1.8-domestic.tgz
$echo console=\"vidconsole\"&amp;#62;&amp;#62;&amp;#47;boot&amp;#47;loader.conf;reboot
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Ожидаем окончания установки и радуемся:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-bash"&gt;root@%cli
root&amp;#62;show version
Model: olive
JUNOS Base OS boot [10.1R1.8]
JUNOS Base OS Software Suite [10.1R1.8]
JUNOS Kernel Software Suite [10.1R1.8]
JUNOS Crypto Software Suite [10.1R1.8]
JUNOS Packet Forwarding Engine Support (M&amp;#47;T Common) [10.1R1.8]
JUNOS Packet Forwarding Engine Support (M20&amp;#47;M40) [10.1R1.8]
JUNOS Online Documentation [10.1R1.8]
JUNOS Voice Services Container package [10.1R1.8]
JUNOS Border Gateway Function package [10.1R1.8]
JUNOS Services AACL Container package [10.1R1.8]
JUNOS Services LL-PDF Container package [10.1R1.8]
JUNOS Services Stateful Firewall [10.1R1.8]
JUNOS AppId Services [10.1R1.8]
JUNOS IDP Services [10.1R1.8]
JUNOS Routing Software Suite [10.1R1.8]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;PS:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;В internet полно трактатов по установке olive на PC, но там старые версии, и для них не нужно создавать partition &amp;#47;tmp в slice.&lt;/li&gt;
&lt;li&gt;HDD обязательно должен иметь имя ad0[s]X, либо нужно делать symlinks.&lt;/li&gt;
&lt;li&gt;Минимальный объём оперативной памяти 512M, но потом можно вставить HDD после установки в другой системный блок. Я использую junos на 256M, но заметны проблемы при запуске cli и других команд.&lt;/li&gt;
&lt;/ol&gt;</content>
  </entry>
  <entry>
    <title>Kaspersky Rescue 10 PXE</title>
    <link href="http://zlonet.ru/page/kaspersky-rescue-10-pxe/"/>
    <id>http://zlonet.ru/page/kaspersky-rescue-10-pxe</id>
    <updated>2010-05-27T00:00:00Z</updated>
    <summary type="html">&lt;p&gt;&lt;strong&gt;Depends on squashfs-tools &amp;#62; 3!&lt;/strong&gt;&lt;/p&gt;</summary>
    <content type="html">&lt;p&gt;&lt;strong&gt;Depends on squashfs-tools &amp;#62; 3!&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Patch patch-PXE-kav&lt;em&gt;rescue&lt;/em&gt;10.iso.patch&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-diff"&gt;--- sbin&amp;#47;dmsquash-live-root.orig    2014-01-05 21:26:33.581580759 +0400
+++ sbin&amp;#47;dmsquash-live-root 2014-01-06 21:42:30.159646123 +0400
@@ -46,9 +46,7 @@ fi
 
 # determine filesystem type for a filesystem image
 det_img_fs() {
-    local _img="$1" _loop=$(losetup -f) _fs
-    losetup $_loop $_img; _fs=$(det_fs $_loop); losetup -d $_loop
-    echo $_fs
+    echo squashfs
 }
 
 for arg in $CMDLINE; do case $arg in ro|rw) liverw=$arg ;; esac; done
@@ -62,7 +60,6 @@ if [ -f $livedev ]; then
         auto) die "cannot mount live image (unknown filesystem type)" ;;
         *) FSIMG=$livedev ;;
     esac
-else
     mount -n -t $fstype -o ${liverw:-ro} $livedev &amp;#47;run&amp;#47;initramfs&amp;#47;live
     if [ "$?" != "0" ]; then
         die "Failed to mount block device of live image"
--- init.orig   2014-01-05 21:26:33.571246205 +0400
+++ init    2014-01-06 19:55:26.324595021 +0400
@@ -288,7 +288,7 @@ unset main_loop
 unset RDRETRY
 
 if  ! ismounted "&amp;#47;run&amp;#47;initramfs&amp;#47;live"; then
-    CDROM_DEVICES="&amp;#47;dev&amp;#47;sr*"
+    CDROM_DEVICES="&amp;#47;image.squashfs"
     for i in $CDROM_DEVICES
     do
         &amp;#47;sbin&amp;#47;dmsquash-live-root $i
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Build instructions:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-bash"&gt;$mdconfig -f kav_rescue_10.iso
$mountcd_9660 &amp;#47;dev&amp;#47;md0 &amp;#47;cdrom
$cp -v &amp;#47;cdrom&amp;#47;boot&amp;#47;rescue .
$mkdir image &amp;#38;&amp;#38; cd image
$lzcat -S lz &amp;#47;cdrom&amp;#47;boot&amp;#47;rescue.igz | cpio -id
$patch -p0&amp;#60;..&amp;#47;..&amp;#47;patch-PXE-kav_rescue_10.iso.patch
$mkdir cdrom &amp;#38;&amp;#38; cp -R &amp;#47;cdrom&amp;#47;rescue cdrom&amp;#47;
$mksquashfs cdrom image.squashfs &amp;#38;&amp;#38; rm -fr cdrom
$find . -print | cpio -o -H newc | lzma -c &amp;#62; &amp;#47;usr&amp;#47;local&amp;#47;tftp&amp;#47;rescue.igz &amp;#38;&amp;#38; cd ..&amp;#47; &amp;#38;&amp;#38; rm -fr image&amp;#47;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Example config pxe:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-ini"&gt;label kav
kernel &amp;#47;rescue
append initrd=&amp;#47;rescue.igz root=live rootfstype=auto vga=791 init=&amp;#47;init kav_lang=ru udev liveimg doscsi nomodeset

label kav_text
kernel &amp;#47;rescue
append initrd=&amp;#47;rescue.igz root=live rootfstype=auto vga=791 init=&amp;#47;init kav_lang=ru udev liveimg nox kavshell noresume doscsi nomodeset
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Files: &lt;a href="http://storage.zlonet.ru/kav/20140106/rescue"&gt;kernel&lt;/a&gt; and &lt;a href="http://storage.zlonet.ru/kav/20140106/rescue.igz"&gt;initrd&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;DEPRECATED&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Patch patch-PXE&lt;em&gt;kav&lt;/em&gt;rescue_2010.iso.patch&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-diff"&gt;--- init.orig   2010-05-24 21:40:35.000000000 +0800
+++ init    2010-05-25 16:07:38.000000000 +0800
@@ -399,7 +399,7 @@ fi
 
 # Determine root device
 good_msg &amp;#39;Determining root device...&amp;#39;
-while true
+while false
 do
    while [ "${got_good_root}" != &amp;#39;1&amp;#39; ]
    do
@@ -462,6 +462,8 @@ do
        fi
    done
 
+REAL_ROOT=&amp;#47;image.squashfs
+REAL_ROOT_TYPE=squashfs
 
    if [ "${CDROOT}" = 1 -a "${got_good_root}" = &amp;#39;1&amp;#39; -a "${REAL_ROOT}" != "&amp;#47;dev&amp;#47;nfs" ]
    then
@@ -521,7 +523,6 @@ then
    [ -z "${LOOP}" ] &amp;#38;&amp;#38; find_loop
    [ -z "${LOOPTYPE}" ] &amp;#38;&amp;#38; find_looptype
 
-   cache_cd_contents
 
    # If encrypted, find key and mount, otherwise mount as usual
    if [ -n "${CRYPT_ROOT}" ]
@@ -557,7 +558,8 @@ then
        elif [ "${LOOPTYPE}" = &amp;#39;squashfs&amp;#39; ]
        then
            good_msg &amp;#39;Mounting squashfs filesystem&amp;#39;
-           mount -t squashfs -o loop,ro "${NEW_ROOT}&amp;#47;mnt&amp;#47;cdrom&amp;#47;${LOOPEXT}${LOOP}" "${NEW_ROOT}&amp;#47;mnt&amp;#47;livecd"
+           mount -t squashfs -o loop,ro &amp;#47;${LOOP} ${NEW_ROOT}&amp;#47;mnt&amp;#47;livecd
+           mount -t squashfs -o loop,rw &amp;#47;cdrom.squashfs ${NEW_ROOT}&amp;#47;mnt&amp;#47;cdrom
            test_success &amp;#39;Mount filesystem&amp;#39;
            FS_LOCATION=&amp;#39;mnt&amp;#47;livecd&amp;#39;
        elif [ "${LOOPTYPE}" = &amp;#39;gcloop&amp;#39; ]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Build instructions:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-bash"&gt;# Downloading files....
$wget -c http:&amp;#47;&amp;#47;devbuilds.kaspersky-labs.com&amp;#47;devbuilds&amp;#47;RescueDisk10&amp;#47;kavrescue10.iso
# Installing needed stuff
$sudo make -C &amp;#47;usr&amp;#47;ports&amp;#47;archivers&amp;#47;gcpio install clean
$sudo make -C &amp;#47;usr&amp;#47;ports&amp;#47;sysutils&amp;#47;squashfs-tools install clean
# Building image
$mdconfig -f kavrescue10.iso
$mountcd_9660 &amp;#47;dev&amp;#47;md0 &amp;#47;cdrom
$cp -v &amp;#47;cdrom&amp;#47;boot&amp;#47;rescue .&amp;#47;
$mkdir image &amp;#38;&amp;#38; cd image
$zcat &amp;#47;cdrom&amp;#47;boot&amp;#47;rescue.igz |gcpio -id
$patch -p0 &amp;#60; ..&amp;#47;patch-PXE_kav_rescue_2010.iso.patch
$mkdir cdrom &amp;#38;&amp;#38; cp -R &amp;#47;cdrom&amp;#47;rescue cdrom&amp;#47;
$mksquashfs cdrom cdrom.squashfs &amp;#38;&amp;#38; rm -fr cdrom
$sudo cp &amp;#47;cdrom&amp;#47;image.squashfs .&amp;#47;
$sudo chmod 644 image.squashfs
$find . -print | gcpio -o -H newc &amp;#62; ..&amp;#47;rescue.igz &amp;#38;&amp;#38; cd ..&amp;#47; &amp;#38;&amp;#38; rm -fr image&amp;#47;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Example config pxe:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-ini"&gt;label KAV10 rescue RUS
kernel data&amp;#47;antivir&amp;#47;kav10&amp;#47;rescue
append initrd=data&amp;#47;antivir&amp;#47;kav10&amp;#47;rescue.igz root=&amp;#47;dev&amp;#47;ram0 cdroot=1 kavlang=ru loop=image.squashfs looptype=squashfs realroot=&amp;#47;

label KAV10 rescue ENG
kernel data&amp;#47;antivir&amp;#47;kav10&amp;#47;rescue
append initrd=data&amp;#47;antivir&amp;#47;kav10&amp;#47;rescue.igz root=&amp;#47;dav&amp;#47;ram0 cdroot=1 kavlang=en loop=image.squashfs looptype=squashfs realroot=&amp;#47;

label KAV10 rescue text mode
kernel data&amp;#47;antivir&amp;#47;kav10&amp;#47;rescue
append initrd=data&amp;#47;antivir&amp;#47;kav10&amp;#47;rescue.igz root=&amp;#47;dev&amp;#47;ram0 cdroot=1 kavlang=en loop=image.squashfs looptype=squashfs real_root=&amp;#47; nox kavshell
&lt;/code&gt;&lt;/pre&gt;
&lt;section class="downloads"&gt;&lt;h2&gt;Downloadable bits&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://zlonet.ru/assets/posts/kaspersky/patch-PXE-kav_rescue_10.iso.patch"&gt;patch-PXE-kav_rescue_10.iso.patch&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://zlonet.ru/assets/posts/kaspersky/patch-PXE_kav_rescue_2010.iso.patch"&gt;patch-PXE_kav_rescue_2010.iso.patch&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://zlonet.ru/assets/posts/kaspersky/pxeboot_kav_rescue_10.cfg"&gt;pxeboot_kav_rescue_10.cfg&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://zlonet.ru/assets/posts/kaspersky/pxeboot_kavrescue10.cfg"&gt;pxeboot_kavrescue10.cfg&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/section&gt;</content>
  </entry>
  <entry>
    <title>Kaspersky update server</title>
    <link href="http://zlonet.ru/page/kaspersky-update-server/"/>
    <id>http://zlonet.ru/page/kaspersky-update-server</id>
    <updated>2010-05-27T00:00:00Z</updated>
    <summary type="html">&lt;p&gt;Устанавливаем порт retranslator:&lt;/p&gt;</summary>
    <content type="html">&lt;p&gt;Устанавливаем порт retranslator:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-bash"&gt;$sudo make -C &amp;#47;usr&amp;#47;ports&amp;#47;security&amp;#47;retranslator install clean (Пока только PR 147116)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;В файле &lt;strong&gt;&amp;#47;usr&amp;#47;local&amp;#47;etc&amp;#47;retranslator.conf&lt;/strong&gt; указываем пути для хранения баз, и продукты для которых нужно получать обновления. Дополнительную информацию можно получить тут.&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-ini"&gt;[path]
RetranslationPath=&amp;#47;path&amp;#47;to&amp;#47;kav.local&amp;#47;bases
TempPath=&amp;#47;tmp

[locale]
DateFormat=%d-%m-%Y
TimeFormat=%H:%M:%S

[updater.path]
BackUpPath=&amp;#47;path&amp;#47;to&amp;#47;kav.local&amp;#47;backup
PidFile=&amp;#47;var&amp;#47;run&amp;#47;kav-retranslator.pid

[updater.options]
RetranslateComponentsList=KDB, KDBI386, CORE, ARK, BSS, ADBU, ADB, AH, AH2I386, AH2X64, APU, AP, AS, BB, BB2, BLST, BLST2, KAV9EXEC, KAV8EXEC, INFO, RT, WMUF, WA, WAVI386, VLNS, EMU, PAS4, PAS, PARCTL, SSA, ASTRM, HIPS, HIPS2, KSN, QSCAN, UPDATER

Index=u0607g.xml
IndexRelativeServerPath=index
UseUpdateServerUrl=no
UseUpdateServerUrlOnly=no
UpdateServerUrl=
RegionSettings=ru
ConnectTimeout=20
KeepSilent=no
UseProxy=no
ProxyAddress=
PassiveFtp=no
PostRetranslateCmd=

[updater.report]
Append=no
ReportFileName=&amp;#47;var&amp;#47;log&amp;#47;retranslator.log
ReportLevel=0
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Добавляем строку с заданием в cron для обновления каждые полчаса:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-bash"&gt;1,31 * * * * root &amp;#47;usr&amp;#47;local&amp;#47;bin&amp;#47;retranslator -q -c &amp;#47;usr&amp;#47;local&amp;#47;etc&amp;#47;retranslator.conf
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Часть конфига для nginx:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-nginx"&gt;server {
    listen 80;
    servername kav.local;

    accesslog &amp;#47;var&amp;#47;log&amp;#47;webserver&amp;#47;kav.local_access.log;

    location &amp;#47; {
        root &amp;#47;path&amp;#47;to&amp;#47;www&amp;#47;kav.local&amp;#47;bases;
        autoindex on;
    }
}
&lt;/code&gt;&lt;/pre&gt;</content>
  </entry>
</feed>
