<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Mary Marchini on Medium]]></title>
        <description><![CDATA[Stories by Mary Marchini on Medium]]></description>
        <link>https://medium.com/@mmarchini?source=rss-e0b83f06f82e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*yjLoSFWY_JjyHpS_rXC1Pw.jpeg</url>
            <title>Stories by Mary Marchini on Medium</title>
            <link>https://medium.com/@mmarchini?source=rss-e0b83f06f82e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 14 Nov 2026 15:21:29 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mmarchini/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Taming the dragon: using llnode to debug your Node.js application]]></title>
            <link>https://medium.com/sthima-insights/taming-the-dragon-using-llnode-to-debug-your-node-js-application-fc54c6efd0f1?source=rss-e0b83f06f82e------2</link>
            <guid isPermaLink="false">https://medium.com/p/fc54c6efd0f1</guid>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[debugging]]></category>
            <category><![CDATA[llnode]]></category>
            <dc:creator><![CDATA[Mary Marchini]]></dc:creator>
            <pubDate>Wed, 20 Jun 2018 19:55:06 GMT</pubDate>
            <atom:updated>2018-06-25T22:49:49.594Z</atom:updated>
            <content:encoded><![CDATA[<p>If you ever experienced memory leaks or infinite loops in your applications, you know how frustrating can be to find the source of those issues. Even though Node.js has a <a href="https://blog.risingstack.com/node-js-at-scale-node-js-garbage-collection/">Garbage Collector</a> powered by V8, it is still possible to have memory leaks (or infinite memory growth) if we keep unnecessary references to objects.</p><p>One technique available to investigate those kinds of issues is postmortem debugging. Developers of native languages (such as C++ and Go) might be familiar with it, especially postmortem debugging of <a href="https://wiki.archlinux.org/index.php/Core_dump">core dump</a> files — files with a copy of the process memory at a given time.</p><p>Fortunately, we can use this same technique with our Node.js applications! This is possible through llnode: a <a href="https://lldb.llvm.org/">LLDB</a> plugin which enables us to inspect Node.js core dumps. With llnode, we can inspect objects in the memory and look at the complete backtrace of the program, including native (C++) frames and JavaScript frames. It can be used on a running Node.js application or through a core dump.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_BomBPpubOTcArhvYR5BTA.png" /></figure><h3>It’s dangerous to go alone. Take this!</h3><p>llnode is available through npm and works on with active Node.js Release Lines (v6.x, v8.x, v9.x and v10.x by the time of this writing). Since it is a plugin for lldb, you&#39;ll need to install it first. llnode works best on LLDB 3.9 or later.</p><p>On Mac OS you get lldb by installing <a href="https://developer.apple.com/xcode/">Xcode</a>. If you’re using Ubuntu though, you can install LLDB by running:</p><pre>sudo apt install lldb-4.0 liblldb-4.0-dev</pre><p>After lldb is installed, you can use npm install -g llnode to install llnode globally. Please be aware that if you&#39;re not using Node.js through nvm or don&#39;t have a <a href="https://docs.npmjs.com/getting-started/fixing-npm-permissions#option-two-change-npms-default-directory">global prefix</a> set, you&#39;ll need to run sudo install -g llnode.</p><h4>Generating a core dump</h4><p>llnode can either attach to a process or read a core dump file. In this tutorial we&#39;ll focus on the latter, and because of that we need to first be able to generate core dumps.</p><p>There are two main methods to generate core dumps in Unix systems: you can either create a core dump from a running process or create one when the process crashes.</p><p>To generate a core dump of a running process, you can use gcore <strong>{PID}</strong>(Linux) or lldb --attach-pid <strong>{PID}</strong> -b -o &#39;process save-core &quot;core.<strong>{PID}</strong>&quot;&#39; (OS X), replacing <strong>{PID}</strong> with the PID of your application. Both methods will create a core dump file called core.$PID at the current working directory.</p><p>If, however, you want to generate a core dump when your process crashes (useful to debug your application when it dies by memory starvation, for example), you’ll need to set the ulimit of your system by running ulimit -c unlimited. This will set ulimit for the current terminal session, which means you&#39;ll need to set again if you open another terminal. Core dumps generated this way are saved in a file named core in the current working directory for Linux, while on OS X cores are stored in the /cores/ folder. Be careful on Mac OS, because core dumps can quickly fill your HD.</p><p>Another thing about generating core dumps when your process crashes: Node.js won’t crash when it terminates because of an uncaught exception. If you want to generate a core dump in those cases, you’ll need to run Node.js with --abort-on-uncaught-exception.</p><h3>Taming the Dragon</h3><p>Now that we have llnode installed and we know how to generate a core dump let&#39;s learn how to use them together. We&#39;ll be using a small Node.js HTTP server as an example:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0e3c24b215346832374b5914fc134345/href">https://medium.com/media/0e3c24b215346832374b5914fc134345/href</a></iframe><p>First, let’s run this server:</p><pre>$ node index.js<br>server is listening on 3000. Our PID is: <strong>74262</strong></pre><p>To make things interesting, let’s send some requests to this server with <a href="https://github.com/mcollina/autocannon">autocannon</a>:</p><pre>$ # Send requests to localhost:3000 during 10 seconds<br>$ npx autocannon -d 10 localhost:3000</pre><p>Now we’ll generate a core dump of the running process. In this case, the PID is <strong>74262</strong>. <strong><em>Remember to change the PID in the commands below with the PID of your Node.js process</em></strong>.</p><p>To generate a core dump on Linux, run the following:</p><pre>$ sudo gcore <strong>74262</strong> </pre><p>If you are on OS X, you can run the following:</p><pre>$ lldb --attach-pid <strong>74262</strong> -b -o &#39;process save-core &quot;core.74262&quot;&#39;</pre><p>Both commands will create a core dump in the current working directory with the name core.<strong>74262</strong>, and now we can use llnode to open it. llnode takes one required argument, which is the binary you want to debug (in this case, node) and a variety of optional arguments. Since we want to debug a core dump, we need to tell llnode where the core dump file is with -c <strong>{core-file}</strong>. The final command will look like:</p><pre>$ llnode node -c core.<strong>74262</strong><br>(llnode)</pre><p>Let’s start with a command that prints information about Node.js and its dependencies. This command will also help us understand the syntax of the commands for llnode. On the (llnode) prompt, type v8 nodeinfo and press Enter:</p><pre>(llnode) v8 nodeinfo<br>Information for process id 74262 (process=0x1ca4ddb89cb9)<br>Platform = darwin, Architecture = x64, <strong>Node Version = v8.11.2</strong><br>Component versions (process.versions=0x1ca4b45a0379):<br>    cldr = 32.0<br>    icu = 60.1<br>    tz = 2017c<br>    unicode = 10.0<br>Release Info (process.release=0x1ca4b45a0451):<br>Executable Path = /Users/mmarchini/.nvm/versions/node/v8.11.2/bin/node<br>Command line arguments (process.argv=0x1ca4b45a0411):<br>    [0] = &#39;/Users/mmarchini/.nvm/versions/node/v8.11.2/bin/node&#39;<br>    [1] = &#39;/Users/mmarchini/workspace/blog-posts/index.js&#39;<br>Node.js Comamnd line arguments (process.execArgv=0x1ca4b45a0579):</pre><p>llnode commands are prefixed by v8 + a space. This will help you distinguish between llnode and lldb commands. Speaking of help, v8 help will be your best friend from now on:</p><pre>(llnode) v8 help<br>     Node.js helpers</pre><pre>Syntax:</pre><pre>The following subcommands are supported:</pre><pre>      <strong>bt</strong>              -- Show a backtrace with node.js JavaScript <br>                         functions and their args. An optional <br>                         argument is accepted; if that argument is a <br>                         number, it specifies the number of frames <br>                         to display. Otherwise all frames will be <br>                         dumped.<br>                         Syntax: v8 bt [number]<br>      <strong>findjsinstances</strong> -- List every object with the specified type <br>                         name. Use -v or --verbose to display <br>                         detailed `v8 inspect` output for each <br>                         object. Accepts the same options as <br>                         `v8 inspect`<br>      <strong>findjsobjects</strong>   -- List all object types and instance counts     <br>                         grouped by type name and sorted by instance <br>                         count. Use -d or --detailed to get an <br>                         output grouped by type name, properties, <br>                         and array length, as well as more <br>                         information regarding each type.<br>      <strong>findrefs</strong>        -- Finds all the object properties which meet <br>                         the search criteria. The default is to list <br>                         all the object properties that reference <br>                         the specified value.<br>                         Flags:<br>                         * -v, --value expr     - all properties <br>                                                  that refer to the <br>                                                  specified <br>                                                  JavaScript object <br>                                                  (default)<br>                         * -n, --name  name     - all properties <br>                                                  with the specified     <br>                                                  name<br>                         * -s, --string string  - all properties <br>                                                  that refer to the <br>                                                  specified <br>                                                  JavaScript string <br>                                                  value<br>      <strong>inspect</strong>         -- Print detailed description and contents of <br>                         the JavaScript value.<br>                         Possible flags (all optional):<br>                         * -F, --full-string    - print whole string <br>                                                  without adding <br>                                                  ellipsis<br>                         * -m, --print-map      - print object&#39;s map <br>                                                  address<br>                         * -s, --print-source   - print source code <br>                                                  for function <br>                                                  objects<br>                         * -l num, --length num - print maximum of <br>                                                  `num` elements <br>                                                  from string/array<br>                         Syntax: v8 inspect [flags] expr<br>      <strong>nodeinfo</strong>        -- Print information about Node.js<br>      <strong>print</strong>           -- Print short description of the JavaScript <br>                         value.<br>                         Syntax: v8 print expr<br>      <strong>source</strong>          -- Source code information</pre><pre>For more help on any particular subcommand, type &#39;help &lt;command&gt; &lt;subcommand&gt;&#39;.</pre><p>Yes, there’s a lot of information there. But don’t worry, we’ll go through the interesting commands now.</p><h4>v8 findjsobjects</h4><p>v8 findjsobjects lists all object types alongside their sizes and quantities. This is useful to find out which object types are using most of your memory. The first time you run this command might take a few minutes to process, so don&#39;t worry if that happens.</p><pre>(llnode) v8 findjsobjects<br> Instances  Total Size Name<br> ---------- ---------- ----<br>          1         24 AssertionError<br>          1         24 AsyncResource<br>          1         24 Control<br>          1         24 FastBuffer<br>          1         24 Loader<br>          1         24 ModuleJob<br>          1         24 ModuleMap<br>          1         24 Performance<br>          1         24 PerformanceObserver<br>          1         24 SafeMap<br>          1         24 SafePromise<br>          1         24 SafeSet<br>          1         24 SocketListReceive<br>          1         24 SocketListSend<br>          1         24 TextDecoder<br>          1         24 TextEncoder<br>          1         24 URL<br>          1         24 URLContext<br>          1         24 URLSearchParams<br>          1         24 WebAssembly<br>          1         32 (Object)<br>          1         32 ContextifyScript<br>          1        104 ImmediateList<br>          1        104 Stack<br>          1        128 Server<br>          1        168 Agent<br>          2         48 (anonymous)<br>          2         48 process<br>          2         64 ChannelWrap<br>          2         64 Signal<br>          2        120 Resolver<br>          2        128 PerformanceNodeTiming<br>          2        136 NextTickQueue<br>          2        144 FreeList<br>          2        200 PerformanceObserverEntryList<br>          2        208 EventEmitter<br>          2        208 WriteStream<br>          2        224 Console<br>          2        272 Module<br>          3         72 NodeError<br>          3         96 TTY<br>          3        280 AsyncHook<br>          4        128 Timer<br>          6        432 TimersList<br>         10       2480 Socket<br>         11        352 HTTPParser<br>         11        352 WriteWrap<br>         12        384 TCP<br>         12       2688 WritableState<br>         15       1360 (ArrayBufferView)<br>         74       4736 NativeModule<br>       5715    1234440 IncomingMessage<br>       5744     781184 ServerResponse<br>       5747    1103424 ReadableState<br>       5748     275880 BufferList<br>      45980    2942680 TickObject<br>      69344    2219008 (Array)<br>     <strong>235515    9420584 Visit</strong><br>     293720   15437744 Object<br>     615411    3750984 (String)<br> ---------- ----------<br>    1283140   37182200</pre><p>If we look at the output, we&#39;ll see a lot of Visit objects generated by our autocannon run. We&#39;ll also see Visit is the third type using more memory. In a real case scenario, this information is the first step to track down memory leaks.</p><p>There’s also a detailed version of this command which can be called with v8 findjsobjects -d. The result will group types with the same attributes and number of elements, and will also provide the address to an example object of that type.</p><h4>v8 findjsinstances</h4><p>v8 findjsinstances gives you a list with all objects of a given type. It also has a detailed version which can be called with v8 findjsinstances -d. This will print all objects of a given type with their attributes and elements.</p><pre>(llnode) v8 findjsinstances -d Visit<br>0x0000176d04402201:&lt;Object: Visit properties {<br>    .visit_id=&lt;Smi: 82704&gt;,<br>    .headers=0x0000176d7d99f1c9:&lt;Object: Object&gt;}&gt;<br>0x0000176d04402229:&lt;Object: Visit properties {<br>    .visit_id=&lt;Smi: 82705&gt;,<br>    .headers=0x0000176d7d99f191:&lt;Object: Object&gt;}&gt;<br>0x0000176d04402251:&lt;Object: Visit properties {<br>    .visit_id=&lt;Smi: 82706&gt;,<br>    .headers=0x0000176d7d99f159:&lt;Object: Object&gt;}&gt;<br>0x0000176d04402279:&lt;Object: Visit properties {<br>    .visit_id=&lt;Smi: 82707&gt;,<br>    .headers=0x0000176d7d99f121:&lt;Object: Object&gt;}&gt;<br>0x0000176d044022a1:&lt;Object: Visit properties {<br>    .visit_id=&lt;Smi: 82708&gt;,<br>    .headers=0x0000176d7d99f0e9:&lt;Object: Object&gt;}&gt;<br>0x0000176d044022c9:&lt;Object: Visit properties {<br>    .visit_id=&lt;Smi: 82709&gt;,<br>    .headers=0x0000176d7d99f0b1:&lt;Object: Object&gt;}&gt;<br><em>// A thousand miles later...<br></em>0x0000176dffba62d9:&lt;Object: Visit properties {<br>    .visit_id=&lt;Smi: 156026&gt;,<br>    .headers=0x0000176dffbef559:&lt;Object: Object&gt;}&gt;<br>0x0000176dffba6301:&lt;Object: Visit properties {<br>    .visit_id=&lt;Smi: 156027&gt;,<br>    .headers=0x0000176dffbef8a9:&lt;Object: Object&gt;}&gt;<br><strong>0x0000176dffba6329</strong>:&lt;Object: Visit properties {<br>    .visit_id=&lt;Smi: 156028&gt;,<br>    .headers=0x0000176dffb82481:&lt;Object: Object&gt;}&gt;</pre><p>v8 findjsinstances -d accepts the same arguments you can pass to v8 inspect, which we will see next.</p><h4>v8 inspect</h4><p>v8 inspect prints all attributes and elements of a given object. It can also print additional information, such as the address to the object&#39;s map. If you want to see the object&#39;s map address, you should run v8 inspect -m. You can inspect the map like any other object by using v8 inspect.</p><pre>(llnode) v8 inspect -m <strong>0x0000176dffba6329</strong><br>0x0000176dffba6329(map=<strong><em>0x0000176d689cec29</em></strong>):&lt;Object: Visit properties {<br>    .visit_id=&lt;Smi: 156028&gt;,<br>    .headers=0x0000176dffb82481:&lt;Object: Object&gt;}&gt;<br>(llnode) v8 inspect <strong><em>0x0000176d689cec29</em></strong><br>0x0000176d689cec29:&lt;Map own_descriptors=2 in_object_size=2 <br>  instance_size=40 <br>  descriptors=0x0000176d7f284569:&lt;FixedArray, len=8 contents={<br>    [0]=&lt;Smi: 2&gt;,<br>    [1]=&lt;Smi: 0&gt;,<br>    [2]=0x0000176dd8566a11:&lt;String: &quot;visit_id&quot;&gt;,<br>    [3]=&lt;Smi: 320&gt;,<br>    [4]=&lt;Smi: 1&gt;,<br>    [5]=0x0000176dd8566a31:&lt;String: &quot;headers&quot;&gt;,<br>    [6]=&lt;Smi: 1050112&gt;,<br>    [7]=0x0000176d117509f9:&lt;unknown&gt;}&gt;&gt;</pre><h4>v8 findrefs</h4><p>Now we know how to find which types are using a huge amount of memory, how to find objects of those types and how to inspect attributes of those objects. But if we want to find memory leaks, we&#39;ll need to find what&#39;s keeping those objects in the memory. In other words, we need to find other objects referencing them. There&#39;s a command perfect for that: v8 findrefs. This command will return all objects referencing another object. Let&#39;s give it a try:</p><pre>(llnode) v8 findrefs <strong>0x0000176dffba6329<br></strong>0x176d1f4fac41: (Array)[156027]=0x176dffba6329</pre><p>The result shows us that there&#39;s an array holding a lot (156027) of objects, and is probably the reason we have so many Visit objects in memory (spoiler: it is, look at line 13 and 16 of our server). Unfortunately, llnode can&#39;t tell where this array is located <em>yet</em>, but there&#39;s an open <a href="https://github.com/nodejs/llnode/issues/195">issue</a> to add this feature in the future.</p><h3>Conclusion</h3><p>Even with a limited set of features, llnode is a powerful debugging tool to have on our Node.js Diagnostics arsenal. It’s ability to inspect the state of an application right after it crashed and the lightweight nature of core dumps can help us identify memory issues with less effort when compared to traditional tools. It also makes llnode and core dumps a good fit to be used on production environments.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fc54c6efd0f1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/sthima-insights/taming-the-dragon-using-llnode-to-debug-your-node-js-application-fc54c6efd0f1">Taming the dragon: using llnode to debug your Node.js application</a> was originally published in <a href="https://medium.com/sthima-insights">Sthima Insights</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[We just got a new super-power! Runtime USDT comes to Linux]]></title>
            <link>https://medium.com/sthima-insights/we-just-got-a-new-super-power-runtime-usdt-comes-to-linux-814dc47e909f?source=rss-e0b83f06f82e------2</link>
            <guid isPermaLink="false">https://medium.com/p/814dc47e909f</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[instrumentation]]></category>
            <category><![CDATA[nodejs]]></category>
            <dc:creator><![CDATA[Mary Marchini]]></dc:creator>
            <pubDate>Mon, 30 Oct 2017 13:39:35 GMT</pubDate>
            <atom:updated>2017-11-03T16:44:14.546Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MPXBeFOi-m-_oMvjzTX7Dw.png" /></figure><p>A new tracing capability has arrived in Linux: the ability to instrument user-level statically defined tracing (USDT) probes defined in dynamic languages such as Python and Node. Prior Linux USDT support has been limited to the static code, such as C or C++. Now, USDT probes can be defined in a Node.js program and used from there, allowing new analysis tools that combine custom Node.js tracepoints along with other library and kernel events. Dtrace-capable operating systems have libusdt, and now Linux has libstapsdt — a library to create USDT probes at runtime. Both have a similar API, as libstapsdt is inspired on libusdt, but they work very different internally.</p><p><a href="https://github.com/sthima/libstapsdt">Libstapsdt</a> uses the same structure provided by Systemtap SDT. Thus it should work with any tool able to trace SDT probes from Systemtap (for example, bcc’s tplist and trace tools). It is written in C, which makes it easy to be wrapped by many other languages. If you want to learn more about how libstapsdt works internally, you can look at our documentation <a href="http://libstapsdt.readthedocs.io/en/latest/">here</a>.</p><p>In this tutorial, we will show how to use <a href="https://github.com/iovisor/bcc">eBPF/bcc</a> to trace probes using Node and Python wrappers for libstapsdt. We assume a basic understanding of software instrumentation and tracing tools on this tutorial.</p><h4>Installing Dependencies</h4><p>To use either Node or Python wrappers, you first need to install libstapsdt on your system. On Ubuntu 16.04, you can install libstapsdt from a PPA. For other distributions, you can build it from source following the instructions <a href="https://github.com/sthima/libstapsdt">here</a>.</p><pre>sudo add-apt-repository ppa:sthima/oss<br>sudo apt-get update<br>sudo apt-get install libstapsdt0 libstapsdt-dev</pre><p>In this tutorial, we will use eBPF/bcc (version 0.4.0 or higher) to trace USDT probes. You can install the latest stable version by running:</p><pre>sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys D4284CDD<br>echo &quot;deb https://repo.iovisor.org/apt/xenial xenial main&quot; | sudo tee /etc/apt/sources.list.d/iovisor.list<br>sudo apt-get update<br>sudo apt-get install bcc-tools libbcc-examples linux-headers-$(uname -r)</pre><p>Now you can either try the <a href="#9121">NodeJS Example</a> or the <a href="#ce93">Python Example</a>.</p><h4>NodeJS Example</h4><p>You can install NodeJS’s wrapper by running:</p><pre>npm install usdt</pre><p>Copy the following code and paste it into a file named <strong>index.js</strong>:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a46efcae7c8b449677c67886f55f6502/href">https://medium.com/media/a46efcae7c8b449677c67886f55f6502/href</a></iframe><p>You can then run it with the following command. It will print “Trying to fire probe…” every 1 second.</p><pre>node index.js</pre><p>You can now use some tools to trace your program. For example, if you run the command below in another terminal, it will print the arguments returned on line 26 every time it fires a probe. You can also see that now your Node application is printing “Probe fired!” in the terminal.</p><pre># PID is the pid number for &quot;node index.js&quot;<br>sudo /usr/share/bcc/tools/trace -p [PID] &#39;u::firstProbe &quot;%d - %s&quot;, arg1, arg2&#39;</pre><p>Now you can use any tool from bcc which uses USDT probes to analyze your Node programs with USDT probes!</p><p>This example is also available as an ASCIICast:</p><p><a href="https://asciinema.org/a/144982">libstapsdt NodeJS Wrapper + eBPF/bcc trace</a></p><h4>Python Example</h4><p>You can install Python’s wrapper by running:</p><pre>pip install stapsdt</pre><p>Copy the following code and paste it into a file named <strong>demo.py</strong>:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/bb3b0ca774fff140e289a9b8a53d8e23/href">https://medium.com/media/bb3b0ca774fff140e289a9b8a53d8e23/href</a></iframe><p>You can then run it with the following command. It will print “Trying to fire probe…” every 1 second.</p><pre>python demo.py</pre><p>You can now use some tools to trace your program. For example, if you run the command below in another terminal, it will print the arguments passed on line 18 every time it fires a probe. You can also see that now your Python application is printing “Probe fired!” in the terminal.</p><pre># PID is the pid number for &quot;python demo.py&quot;<br>sudo /usr/share/bcc/tools/trace -p [PID]&#39;u::firstProbe &quot;%s - %d&quot;, arg1, arg2&#39;</pre><p>Now you can use any tool from bcc which uses USDT probes to analyze your Python programs with USDT probes!</p><p>This example is also available as an ASCIICast:</p><p><a href="https://asciinema.org/a/144984">libstapsdt Python Wrapper + eBPF/bcc trace</a></p><h4>Where to go from here</h4><p>Instrumentation on Linux is growing fast, especially with recent improvements to eBPF on the Kernel and the fantastic tools present on bcc. With libstapsdt, we’re taking another step by adding the ability to developers to instrument their code in dynamic languages.</p><p>There are still some refinements to be done on libstapsdt, but it works for most use cases. If you want to contribute to libstapsdt, you can find us on our <a href="https://github.com/sthima/libstapsdt">Github page</a>. If you decide to write a wrapper, please let us know (we’ll add it to the list of wrappers on the main page)!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=814dc47e909f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/sthima-insights/we-just-got-a-new-super-power-runtime-usdt-comes-to-linux-814dc47e909f">We just got a new super-power! Runtime USDT comes to Linux</a> was originally published in <a href="https://medium.com/sthima-insights">Sthima Insights</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pipelines: Integração Continua facilitada com Docker]]></title>
            <link>https://medium.com/sthima-insights/pipelines-integra%C3%A7%C3%A3o-continua-facilitada-com-docker-ffdb363ec56e?source=rss-e0b83f06f82e------2</link>
            <guid isPermaLink="false">https://medium.com/p/ffdb363ec56e</guid>
            <category><![CDATA[automated-testing]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[bitbucket]]></category>
            <category><![CDATA[continuous-integration]]></category>
            <dc:creator><![CDATA[Mary Marchini]]></dc:creator>
            <pubDate>Tue, 30 May 2017 15:05:45 GMT</pubDate>
            <atom:updated>2017-05-30T17:26:42.678Z</atom:updated>
            <content:encoded><![CDATA[<p>A Atlassian lançou no final do ano passado uma nova solução de integração continua: o Bitbucket Pipelines. Diferente do Bamboo— sua antiga solução de CI — o Pipelines é completamente na nuvem e possuí uma ótima — e exclusiva, pelo menos por enquanto ,— integração com o Bitbucket.</p><p>Mas com tantas soluções de CI existentes no mercado hoje, qual a vantagem de utilizar o Bitbucket Pipelines?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sEnesF2XkKXwNnSdfWTc-A.png" /></figure><p>Utilizando uma arquitetura baseada em Docker Containers, o Pipelines permite uma configuração simplificada e altamente customizada, duas características que dificilmente encontramos em conjunto em outras soluções. Além disso, é uma solução muito mais em conta do que os concorrentes!</p><h4>Customização</h4><p>As imagens padrões oferecidas pela equipe do Docker abrangem as principais linguagens, e configurar projetos simples — que não possuem dependências externas, de outras linguagens, etc — é extremamente rápido. Basta seguir os passos apresentados ao habilitar o Pipelines no seu projeto que você irá configurar a sua <em>build</em> em alguns minutos.</p><p>Mas e se você precisar instalar mais dependências externas? Você tem duas opções: você pode procurar no Docker Hub para ver se não existe alguma imagem que satisfaça suas dependências, ou você pode criar a sua própria imagem e utilizá-la no Bitbucket Pipelines. Isso permite um nível de customização muito grande e sem muito trabalho!</p><p>Para saber mais sobre como criar uma imagem customizada e enviá-la para o Docker Hub de uma forma automatizada, siga o tutorial abaixo:</p><p><a href="http://techfree.com.br/2015/04/criacao-automatizada-de-imagens-docker-github-e-docker-hub/">http://techfree.com.br/2015/04/criacao-automatizada-de-imagens-docker-github-e-docker-hub/</a></p><h4>Serviços</h4><p>O Pipelines possibilita conectar serviços ao seu <em>container</em> principal. Por exemplo, se a sua aplicação usa o PostgreSQL como banco de dados, você pode conectar o serviço de PostgreSQL (que também é um container) ao seu container principal, simplificando muito a configuração do mesmo. E como o Docker possui imagens oficiais dos principais bancos de dados utilizados hoje em dia, a escolha de qual banco integrar é muito fácil.</p><p>Outro exemplo de utilização de serviços é integrar com o Selenium para realizar testes funcionais. A SeleniumHQ disponibiliza imagens de Chrome e Firefox que podem ser utilizadas como serviços e acessados usando um WebDriver remoto, e a configuração é super fácil!</p><h4>Integrações</h4><p>Além de todos os recursos oferecidos pela utilização de Docker como estrutura para as builds, o Bitbucket Pipelines oferece uma lista variada de integrações com outros serviços, desde serviços de notificação até ferramentas para automatizar testes funcionais ou realizar <em>deploy</em> do projeto para a nuvem. Uma lista de todas as integrações pode ser encontrada <a href="https://confluence.atlassian.com/bitbucket/bitbucket-pipelines-integrations-826868162.html">aqui</a>.</p><h4>Conclusões</h4><p>Mesmo que o seu projeto não esteja utilizando Docker no momento, o Bitbucket Pipelines é uma ótima opção de ferramenta de integração contínua. A combinação da facilidade e versatilidade das configurações do container permitem que a maioria dos projetos possam ser executados com configurações muito semelhantes às utilizadas em ambientes de produção. Além disso, o preço acessível oferecido pelo serviço pode trazer uma boa economia para o seu projeto, sem prejudicar a qualidade do mesmo.</p><p>Um dos pontos negativos que identificamos foi a integração exclusiva com o Bitbucket, o que impossibilita a sua utilização com outros serviços de Git, como o GitHub e o GitLab, e esse cenário muito provavelmente não irá mudar, pois o Pipelines acaba virando um diferencial competitivo para o Bitbucket. Além disso, <a href="https://bitbucket.org/site/master/issues?status=new&amp;status=open&amp;kind=proposal&amp;component=Pipelines&amp;page=1">vários recursos</a> ainda não estão disponíveis, mas é bem provável que eles sejam oferecidos num futuro próximo, afinal de contas o Pipelines é um serviço recente e que já evoluiu muito em pouco tempo.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ffdb363ec56e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/sthima-insights/pipelines-integra%C3%A7%C3%A3o-continua-facilitada-com-docker-ffdb363ec56e">Pipelines: Integração Continua facilitada com Docker</a> was originally published in <a href="https://medium.com/sthima-insights">Sthima Insights</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>