<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
    <title> - fedora-planet</title>
    <link rel="self" type="application/atom+xml" href="https://blog.sergiodj.net/tags/fedora-planet/atom.xml"/>
    <link rel="alternate" type="text/html" href="https://blog.sergiodj.net"/>
    <generator uri="https://www.getzola.org/">Zola</generator>
    <updated>2019-05-06T00:00:00-05:00</updated>
    <id>https://blog.sergiodj.net/tags/fedora-planet/atom.xml</id>
    <entry xml:lang="en">
        <title>Improve gcore and support dumping ELF headers</title>
        <published>2019-05-06T00:00:00-05:00</published>
        <updated>2019-05-06T00:00:00-05:00</updated>
        
        <author>
          <name>
            
              Sergio Durigan Junior
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://blog.sergiodj.net/posts/improve-gcore-elf-headers/"/>
        <id>https://blog.sergiodj.net/posts/improve-gcore-elf-headers/</id>
        
        <content type="html" xml:base="https://blog.sergiodj.net/posts/improve-gcore-elf-headers/">&lt;p&gt;Back in 2016, when life was simpler, a Fedora GDB user
reported &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;bugzilla.redhat.com&#x2F;show_bug.cgi?id=1371380&quot;&gt;a bug&lt;&#x2F;a&gt;
(or a feature request, depending on how you interpret it) saying that
GDB&#x27;s &lt;code&gt;gcore&lt;&#x2F;code&gt; command did not respect the &lt;code&gt;COREFILTER_ELF_HEADERS&lt;&#x2F;code&gt;
flag, which instructs it to dump memory pages containing ELF headers.
As you may or may not remember, I have
already
&lt;a href=&quot;https:&#x2F;&#x2F;blog.sergiodj.net&#x2F;posts&#x2F;improve-gcore-elf-headers&#x2F;%7Bfilename%7D&#x2F;2015-04-05-linux-memory-mapping.md&quot;&gt;written about the broader topic of revamping GDB&#x27;s internal corefile dump algorithm&lt;&#x2F;a&gt;;
it&#x27;s an interesting read and I recommend it if you don&#x27;t know how
Linux (or GDB) decides which mappings to dump to a corefile.&lt;&#x2F;p&gt;
&lt;p&gt;Anyway, even though the bug was interesting and had to do with a work
I&#x27;d done before, I couldn&#x27;t really work on it at the time, so I
decided to put it in the TODO list.  Of course, the &quot;TODO list&quot; is
actually a crack where most things fall through and are usually never
seen again, so I was blissfully ignoring this request because I had
other major priorities to deal with.  That is, until a seemingly
unrelated problem forced me to face this once and for all!&lt;&#x2F;p&gt;
&lt;h2 id=&quot;what-a-regression-since-when&quot;&gt;What?  A regression?  Since when?&lt;&#x2F;h2&gt;
&lt;p&gt;As the Fedora GDB maintainer, I&#x27;m routinely preparing new releases for
Fedora Rawhide distribution, and sometimes for the stable versions of
the distro as well.  And I try to be very careful when dealing with
new releases, because a regression introduced now can come and bite us
(i.e., the Red Hat GDB team) back many years in the future, when it&#x27;s
sometimes too late or too difficult to fix things.  So, a mandatory
part of every release preparation is to actually run a regression test
against the previous release, and make sure that everything is working
correctly.&lt;&#x2F;p&gt;
&lt;p&gt;One of these days, some weeks ago, I had finished running the
regression check for the release I was preparing when I noticed
something strange: a specific, Fedora-only corefile test was FAILing.
That&#x27;s a no-no, so I started investigating and found that the
underlying reason was that, when the corefile was being generated,
the &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;fedoraproject.org&#x2F;wiki&#x2F;Releases&#x2F;FeatureBuildId&quot;&gt;build-id&lt;&#x2F;a&gt;
note from the executable was not being copied over.  Fedora GDB has a
local patch whose job is to, given a corefile with a build-id note,
locate the corresponding binary that generated it.  Without the
build-id note, no binary was being located.&lt;&#x2F;p&gt;
&lt;p&gt;Coincidentally or not, at the same I started noticing some users
reporting very similar build-id issues on the freenode&#x27;s &lt;code&gt;#gdb&lt;&#x2F;code&gt;
channel, and I thought that this bug had a potential to become a big
headache for us if nothing was done to fix it right now.&lt;&#x2F;p&gt;
&lt;p&gt;I asked for some help from the team, and we managed to discover that
the problem was also happening with upstream &lt;code&gt;gcore&lt;&#x2F;code&gt;, and that it was
probably something that &lt;strong&gt;binutils&lt;&#x2F;strong&gt; was doing, and not GDB.  Hmm...&lt;&#x2F;p&gt;
&lt;h2 id=&quot;ah-so-it-s-ld-s-fault-or-is-it&quot;&gt;Ah, so it&#x27;s &lt;code&gt;ld&lt;&#x2F;code&gt;&#x27;s fault.  Or is it?&lt;&#x2F;h2&gt;
&lt;p&gt;So there I went, trying to confirm that it was binutils&#x27;s fault, and
not GDB&#x27;s.  Of course, if I could confirm this, then I could also tell
the binutils guys to fix it, which meant less work for us :-).&lt;&#x2F;p&gt;
&lt;p&gt;With a lot of help from Keith Seitz, I was able to bisect the problem
and found that it started with the following commit:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E6EDF3; background-color: #0D1117;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;commit f6aec96dce1ddbd8961a3aa8a2925db2021719bb&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Author: H.J. Lu &amp;lt;hjl.tools@gmail.com&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Date:   Tue Feb 27 11:34:20 2018 -0800&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;	ld: Add --enable-separate-code&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This is a commit that touches the linker, which is part of binutils.
So that means this is not GDB&#x27;s problem, right?!?  Hmm.  No,
unfortunately not.&lt;&#x2F;p&gt;
&lt;p&gt;What the commit above does is to simply enable the use of
&lt;code&gt;--enable-separate-code&lt;&#x2F;code&gt; (or &lt;code&gt;-z separate-code&lt;&#x2F;code&gt;) by default when
linking an ELF program on x86_64 (more on that later).  On a first
glance, this change should not impact the corefile generation, and
indeed, if you tell the Linux kernel to generate a corefile (for
example, by doing &lt;code&gt;sleep 60 &amp;amp;&lt;&#x2F;code&gt; and then hitting &lt;code&gt;C-\&lt;&#x2F;code&gt;), you will
notice that the build-id note &lt;strong&gt;is&lt;&#x2F;strong&gt; included into it!  So GDB was
still a suspect here.  The investigation needed to continue.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;what-s-with-z-separate-code&quot;&gt;What&#x27;s with &lt;code&gt;-z separate-code&lt;&#x2F;code&gt;?&lt;&#x2F;h2&gt;
&lt;p&gt;The &lt;code&gt;-z separate-code&lt;&#x2F;code&gt; option makes the code segment in the ELF file
to put in a completely separated segment than data segment.  This was
done to increase the security of generated binaries.  Before it,
everything (code and data) was put together in the same memory
region.  What this means in practice is that, before, you would see
something like this when you examined &lt;code&gt;&#x2F;proc&#x2F;PID&#x2F;smaps&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E6EDF3; background-color: #0D1117;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;00400000-00401000 r-xp 00000000 fc:01 798593                             &#x2F;file&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Size:                  4 kB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;KernelPageSize:        4 kB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;MMUPageSize:           4 kB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Rss:                   4 kB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Pss:                   4 kB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Shared_Clean:          0 kB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Shared_Dirty:          0 kB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Private_Clean:         0 kB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Private_Dirty:         4 kB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Referenced:            4 kB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Anonymous:             4 kB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;LazyFree:              0 kB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;AnonHugePages:         0 kB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;ShmemPmdMapped:        0 kB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Shared_Hugetlb:        0 kB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Private_Hugetlb:       0 kB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Swap:                  0 kB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;SwapPss:               0 kB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Locked:                0 kB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;THPeligible:    0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;VmFlags: rd ex mr mw me dw sd&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;And now, you will see two memory regions instead, like this:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E6EDF3; background-color: #0D1117;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;00400000-00401000 r--p 00000000 fc:01 799548                             &#x2F;file&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Size:                  4 kB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;KernelPageSize:        4 kB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;MMUPageSize:           4 kB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Rss:                   4 kB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Pss:                   4 kB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Shared_Clean:          0 kB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Shared_Dirty:          0 kB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Private_Clean:         4 kB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Private_Dirty:         0 kB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Referenced:            4 kB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Anonymous:             0 kB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;LazyFree:              0 kB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;AnonHugePages:         0 kB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;ShmemPmdMapped:        0 kB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Shared_Hugetlb:        0 kB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Private_Hugetlb:       0 kB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Swap:                  0 kB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;SwapPss:               0 kB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Locked:                0 kB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;THPeligible:    0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;VmFlags: rd mr mw me dw sd&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;00401000-00402000 r-xp 00001000 fc:01 799548                             &#x2F;file&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Size:                  4 kB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;KernelPageSize:        4 kB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;MMUPageSize:           4 kB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Rss:                   4 kB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Pss:                   4 kB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Shared_Clean:          0 kB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Shared_Dirty:          0 kB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Private_Clean:         0 kB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Private_Dirty:         4 kB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Referenced:            4 kB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Anonymous:             4 kB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;LazyFree:              0 kB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;AnonHugePages:         0 kB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;ShmemPmdMapped:        0 kB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Shared_Hugetlb:        0 kB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Private_Hugetlb:       0 kB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Swap:                  0 kB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;SwapPss:               0 kB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Locked:                0 kB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;THPeligible:    0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;VmFlags: rd ex mr mw me dw sd&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;A few minor things have changed, but the most important of them is the
fact that, before, the whole memory region &lt;strong&gt;had&lt;&#x2F;strong&gt; anonymous data in
it, which means that it was considered an &lt;strong&gt;anonymous private
mapping&lt;&#x2F;strong&gt; (&lt;strong&gt;anonymous&lt;&#x2F;strong&gt; because of the non-zero Anonymous amount of
data; &lt;strong&gt;private&lt;&#x2F;strong&gt; because of the &lt;code&gt;p&lt;&#x2F;code&gt; in the &lt;code&gt;r-xp&lt;&#x2F;code&gt; permission bits).
After &lt;code&gt;-z separate-code&lt;&#x2F;code&gt; was made default, the first memory mapping
does &lt;strong&gt;not&lt;&#x2F;strong&gt; have Anonymous contents anymore, which means that it is
now considered to be a &lt;strong&gt;file-backed private&lt;&#x2F;strong&gt; mapping instead.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;gdb-corefile-and-coredump-filter&quot;&gt;GDB, corefile, and coredump_filter&lt;&#x2F;h2&gt;
&lt;p&gt;It is important to mention that, unlike the Linux kernel, GDB doesn&#x27;t
have all of the necessary information readily available to decide the
exact type of a memory mapping, so when I revamped this code back in
2015 I had to create some heuristics to try and determine this
information.  If you&#x27;re curious, take a look at the &lt;code&gt;linux-tdep.c&lt;&#x2F;code&gt;
file on GDB&#x27;s source tree, specifically at the
functions
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;sourceware.org&#x2F;git&#x2F;?p=binutils-gdb.git;a=blob;f=gdb&#x2F;linux-tdep.c;h=c1666d189ae009b594d906ca7a87091ea535e05f;hb=HEAD#l588&quot;&gt;&lt;code&gt;dump_mapping_p&lt;&#x2F;code&gt;&lt;&#x2F;a&gt; and
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;sourceware.org&#x2F;git&#x2F;?p=binutils-gdb.git;a=blob;f=gdb&#x2F;linux-tdep.c;h=c1666d189ae009b594d906ca7a87091ea535e05f;hb=HEAD#l1200&quot;&gt;&lt;code&gt;linux_find_memory_regions_full&lt;&#x2F;code&gt;&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;When GDB is deciding which memory regions should be dumped into the
corefile, it respects the value found at the
&lt;code&gt;&#x2F;proc&#x2F;PID&#x2F;coredump_filter&lt;&#x2F;code&gt; file.  The default value for this file is
&lt;code&gt;0x33&lt;&#x2F;code&gt;, which, according to &lt;code&gt;core(5)&lt;&#x2F;code&gt;, means:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E6EDF3; background-color: #0D1117;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Dump memory pages that are either anonymous private, anonymous&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;shared, ELF headers or HugeTLB.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;GDB had the support implemented to dump almost all of these pages,
except for the ELF headers variety.  And, as you can probably infer,
this means that, before the &lt;code&gt;-z separate-code&lt;&#x2F;code&gt; change, the very first
memory mapping of the executable &lt;strong&gt;was&lt;&#x2F;strong&gt; being dumped, because it was
marked as anonymous private.  However, after the change, the first
mapping (which contains only data, no code) wasn&#x27;t being dumped
anymore, because it was now considered by GDB to be a file-backed
private mapping!&lt;&#x2F;p&gt;
&lt;p&gt;Finally, that is the reason for the difference between corefiles
generated by GDB and Linux, and also the reason why the build-id note
was not being included in the corefile anymore!  You see, the first
memory mapping contains not only the program&#x27;s data, but also its ELF
headers, which in turn contain the build-id information.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;gcore-meet-elf-headers&quot;&gt;&lt;code&gt;gcore&lt;&#x2F;code&gt;, meet ELF headers&lt;&#x2F;h2&gt;
&lt;p&gt;The solution was &quot;simple&quot;: I needed to improve the current heuristics
and teach GDB how to determine if a mapping contains an ELF header or
not.  For that, I chose to follow the Linux kernel&#x27;s algorithm, which
basically checks the first 4 bytes of the mapping and compares them
against &lt;code&gt;\177ELF&lt;&#x2F;code&gt;, which is ELF&#x27;s magic number.  If the comparison
succeeds, then we just assume we&#x27;re dealing with a mapping that
contains an ELF header and dump it.&lt;&#x2F;p&gt;
&lt;p&gt;In all fairness, Linux just dumps the first page (4K) of the mapping,
in order to save space.  It would be possible to make GDB do the same,
but I chose the faster way and just dumped the whole mapping, which,
in most scenarios, shouldn&#x27;t be a big problem.&lt;&#x2F;p&gt;
&lt;p&gt;It&#x27;s also interesting to mention that GDB will just perform this check
if:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;The heuristic has decided &lt;em&gt;not&lt;&#x2F;em&gt; to dump the mapping so far, and;&lt;&#x2F;li&gt;
&lt;li&gt;The mapping is private, and;&lt;&#x2F;li&gt;
&lt;li&gt;The mapping&#x27;s offset is zero, and;&lt;&#x2F;li&gt;
&lt;li&gt;There is a request to dump mappings with ELF headers (i.e.,
&lt;code&gt;coredump_filter&lt;&#x2F;code&gt;).&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Linux also makes these checks, by the way.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;the-patch-finally&quot;&gt;The patch, finally&lt;&#x2F;h2&gt;
&lt;p&gt;I submitted &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;sourceware.org&#x2F;ml&#x2F;gdb-patches&#x2F;2019-04&#x2F;msg00479.html&quot;&gt;the
patch&lt;&#x2F;a&gt; to
the mailing list, and it was approved fairly quickly (with a few minor
nits).&lt;&#x2F;p&gt;
&lt;p&gt;The reason I&#x27;m writing this blog post is because I&#x27;m very happy and
proud with the whole process.  It wasn&#x27;t an easy task to investigate
the underlying reason for the build-id failures, and it was
interesting to come up with a solution that extended the work I did a
few years ago.  I was also able to close a few bug reports upstream,
as well as the one reported against Fedora GDB.&lt;&#x2F;p&gt;
&lt;p&gt;The patch has been
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;sourceware.org&#x2F;git&#x2F;?p=binutils-gdb.git;a=commit;h=57e5e645010430b3d73f8c6a757d09f48dc8f8d5&quot;&gt;pushed&lt;&#x2F;a&gt;,
and is also present at the latest version of Fedora GDB for Rawhide.
It wasn&#x27;t possible to write a self-contained testcase for this
problem, so I had to resort to using an external tool (&lt;code&gt;eu-unstrip&lt;&#x2F;code&gt;)
in order to guarantee that the build-id note is correctly present in
the corefile.  But that&#x27;s a small detail, of course.&lt;&#x2F;p&gt;
&lt;p&gt;Anyway, I hope this was an interesting (albeit large) read!&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Memory mappings, core dumps, GDB and Linux</title>
        <published>2015-04-05T00:00:00-05:00</published>
        <updated>2015-04-05T00:00:00-05:00</updated>
        
        <author>
          <name>
            
              Sergio Durigan Junior
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://blog.sergiodj.net/posts/linux-memory-mapping/"/>
        <id>https://blog.sergiodj.net/posts/linux-memory-mapping/</id>
        
        <content type="html" xml:base="https://blog.sergiodj.net/posts/linux-memory-mapping/">&lt;p&gt;After spending the last weeks struggling with this, I decided to write a
blog post. First, what is “this” that you are talking about? The answer
is: Linux kernel&#x27;s concept of memory mapping. I found it utterly
confused, beyond my expectations, and so I believe that a blog post is
the write way to (a) preserve and (b) share this knowledge. So, let&#x27;s do
it!&lt;&#x2F;p&gt;
&lt;h2 id=&quot;first-things-first&quot;&gt;First things first&lt;&#x2F;h2&gt;
&lt;p&gt;First, I cannot begin this post without a few acknowledgements and
“thank you&#x27;s”. The first goes to Oleg Nesterov (sorry, I could not find
his website), a Linux kernel guru who really helped me a lot through the
whole task. Another “thank you” goes to &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;www.jankratochvil.net&#x2F;&quot;&gt;Jan
Kratochvil&lt;&#x2F;a&gt;, who also provided valuable
feedback by commenting my GDB patch. Now, back to the point.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;the-task&quot;&gt;The task&lt;&#x2F;h2&gt;
&lt;p&gt;The task was requested
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;sourceware.org&#x2F;bugzilla&#x2F;show_bug.cgi?id=16092&quot;&gt;here&lt;&#x2F;a&gt;: GDB
needed to respect the &lt;code&gt;&#x2F;proc&#x2F;&amp;lt;PID&amp;gt;&#x2F;coredump_filter&lt;&#x2F;code&gt; file when generating
a coredump (i.e., when you use the &lt;code&gt;gcore&lt;&#x2F;code&gt; command).&lt;&#x2F;p&gt;
&lt;p&gt;Currently, GDB has his own coredump mechanism implemented which, despite
its limitations and bugs, has been around for quite some time. However,
and maybe you don&#x27;t know that, but the Linux kernel has its own
algorithm for generating the corefile of a process. And unfortunately,
GDB and Linux were not really following the same standards here...&lt;&#x2F;p&gt;
&lt;p&gt;So, in the end, the task was about synchronizing GDB and Linux. To do
that, I first had to decipher the contents of the &lt;code&gt;&#x2F;proc&#x2F;&amp;lt;PID&amp;gt;&#x2F;smaps&lt;&#x2F;code&gt;
file.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;the-proc-pid-smaps-file&quot;&gt;The &lt;code&gt;&#x2F;proc&#x2F;&amp;lt;PID&amp;gt;&#x2F;smaps&lt;&#x2F;code&gt; file&lt;&#x2F;h2&gt;
&lt;p&gt;This special file, generated by the Linux kernel when you read it,
contains detailed information about each memory mapping of a certain
process. Some of the fields on this file are documented in the &lt;code&gt;proc(5)&lt;&#x2F;code&gt;
manpage, but others are missing there (asking for a patch!). Here is an
explanation of everything I needed:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;The first line of each memory mapping has the following format:&lt;&#x2F;p&gt;
&lt;p&gt;The fields here are:&lt;&#x2F;p&gt;
&lt;p&gt;a)  &lt;em&gt;address&lt;&#x2F;em&gt; is the address range, in the process&#x27; address space,
that the mapping occupies. This part was already treated by GDB,
so I did not have to worry about it.&lt;&#x2F;p&gt;
&lt;p&gt;b)  &lt;em&gt;perms&lt;&#x2F;em&gt; is a set of permissions (&lt;strong&gt;r&lt;&#x2F;strong&gt; ead, &lt;strong&gt;w&lt;&#x2F;strong&gt; rite, e &lt;strong&gt;x&lt;&#x2F;strong&gt;
ecute, &lt;strong&gt;s&lt;&#x2F;strong&gt; hared, &lt;strong&gt;p&lt;&#x2F;strong&gt; rivate [COW -- copy-on-write])
applied to the memory mapping. GDB was already dealing with
&lt;code&gt;rwx&lt;&#x2F;code&gt; permissions, but I needed to include the &lt;code&gt;p&lt;&#x2F;code&gt; flag as well.
I also made GDB ignore the mappings that did not have the &lt;code&gt;r&lt;&#x2F;code&gt;
flag active, because it does not make sense to dump something
that you cannot read.&lt;&#x2F;p&gt;
&lt;p&gt;c)  &lt;em&gt;offset&lt;&#x2F;em&gt; is the offset into the applied to the file, if the
mapping is file-backed (see below). GDB already handled
this correctly.&lt;&#x2F;p&gt;
&lt;p&gt;d)  &lt;em&gt;dev&lt;&#x2F;em&gt; is the device (major:minor) related to the file, if there
is one. GDB already handled this correctly, though I was using
this field for more things (continue reading).&lt;&#x2F;p&gt;
&lt;p&gt;e)  &lt;em&gt;inode&lt;&#x2F;em&gt; is the inode on the device above. The value of zero
means that no inode is associated with the memory mapping.
Nothing to do here.&lt;&#x2F;p&gt;
&lt;p&gt;f)  &lt;em&gt;pathname&lt;&#x2F;em&gt; is the file associate with this mapping, if there
is one. This is one of the most important fields that I had to
use, and one of the most complicated to understand completely.
GDB now uses this to heuristically identify whether the mapping
is anonymous or not.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;GDB is now also interested in &lt;code&gt;Anonymous:&lt;&#x2F;code&gt; and &lt;code&gt;AnonHugePages:&lt;&#x2F;code&gt;
fields from the &lt;code&gt;smaps&lt;&#x2F;code&gt; file. Those fields represent the content of
anonymous data on the mapping; if GDB finds that this content is
greater than zero, this means that the mapping is anonymous.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;The last, but perhaps most important field, is the &lt;code&gt;VmFlags:&lt;&#x2F;code&gt; field.
It contains a series of two-letter flags that provide very useful
information about the mapping. A description of the fields is:
a)  &lt;code&gt;sh&lt;&#x2F;code&gt;: the mapping is shared (&lt;code&gt;VM_SHARED&lt;&#x2F;code&gt;)
b)  &lt;code&gt;dd&lt;&#x2F;code&gt;: this mapping should not be dumped in a corefile
(&lt;code&gt;VM_DONTDUMP&lt;&#x2F;code&gt;)
c)  &lt;code&gt;ht&lt;&#x2F;code&gt;: this is HugeTLB mapping&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;With that in hands, the following task was to be able to determine
whether a memory mapping is anonymous or file-backed, private or shared.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;types-of-memory-mappings&quot;&gt;Types of memory mappings&lt;&#x2F;h2&gt;
&lt;p&gt;There can be four types of memory mappings:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Anonymous private mapping&lt;&#x2F;li&gt;
&lt;li&gt;Anonymous shared mapping&lt;&#x2F;li&gt;
&lt;li&gt;File-backed private mapping&lt;&#x2F;li&gt;
&lt;li&gt;File-backed shared mapping&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;It should be possible to uniquely identify each mapping based on the
information provided by the &lt;code&gt;smaps&lt;&#x2F;code&gt; file; however, you will see that
this is not always the case. Below, I will explain how to determine each
of the four characteristics that define a mapping.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;anonymous&quot;&gt;&lt;code&gt;Anonymous&lt;&#x2F;code&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;A mapping is anonymous if one of these conditions apply:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;The &lt;code&gt;pathname&lt;&#x2F;code&gt; associated with it is either &lt;code&gt;&#x2F;dev&#x2F;zero (deleted)&lt;&#x2F;code&gt;,
&lt;code&gt;&#x2F;SYSV%08x (deleted)&lt;&#x2F;code&gt;, or &lt;code&gt;&amp;lt;filename&amp;gt; (deleted)&lt;&#x2F;code&gt; (see below).&lt;&#x2F;li&gt;
&lt;li&gt;There is content in the &lt;code&gt;Anonymous:&lt;&#x2F;code&gt; or in the &lt;code&gt;AnonHugePages:&lt;&#x2F;code&gt;
fields of the mapping in the &lt;code&gt;smaps&lt;&#x2F;code&gt; file.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;A special explanation is needed for the &lt;code&gt;&amp;lt;filename&amp;gt; (deleted)&lt;&#x2F;code&gt; case. It
is not always guaranteed that it identifies an anonymous mapping; in
fact, it is possible to have the &lt;code&gt;(deleted)&lt;&#x2F;code&gt; part for file-backed
mappings as well (say, when you are running a program that uses shared
libraries, and those shared libraries have been removed because of an
update, for example). However, we are trying to mimic the behavior of
the Linux kernel here, which checks to see if a file has no hard links
associated with it (and therefore is truly deleted).&lt;&#x2F;p&gt;
&lt;p&gt;Although it may be possible for the userspace to do an extensive check
(by &lt;code&gt;stat&lt;&#x2F;code&gt; ing the file, for example), the Linux kernel certainly could
give more information about this.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;file-backed&quot;&gt;&lt;code&gt;File-backed&lt;&#x2F;code&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;A mapping is file-backed (i.e., not anonymous) if:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;The &lt;code&gt;pathname&lt;&#x2F;code&gt; associated with it contains a &lt;code&gt;&amp;lt;filename&amp;gt;&lt;&#x2F;code&gt;, without
the &lt;code&gt;(deleted)&lt;&#x2F;code&gt; part.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;As has been explained above, a mapping whose &lt;code&gt;pathname&lt;&#x2F;code&gt; contains the
&lt;code&gt;(deleted)&lt;&#x2F;code&gt; string could still be file-backed, but we decide to consider
it anonymous.&lt;&#x2F;p&gt;
&lt;p&gt;It is also worth mentioning that a mapping can be simultaneously
anonymous and file-backed: this happens when the mapping contains a
valid &lt;code&gt;pathname&lt;&#x2F;code&gt; (without the &lt;code&gt;(deleted)&lt;&#x2F;code&gt; part), but &lt;strong&gt;also&lt;&#x2F;strong&gt; contains
&lt;code&gt;Anonymous:&lt;&#x2F;code&gt; or &lt;code&gt;AnonHugePages:&lt;&#x2F;code&gt; contents.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;private&quot;&gt;&lt;code&gt;Private&lt;&#x2F;code&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;A mapping is considered to be private (i.e., not shared) if:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;In the absence of the &lt;code&gt;VmFlags&lt;&#x2F;code&gt; field (in the &lt;code&gt;smaps&lt;&#x2F;code&gt; file), its
permission field has the flag &lt;code&gt;p&lt;&#x2F;code&gt;.&lt;&#x2F;li&gt;
&lt;li&gt;If the &lt;code&gt;VmFlags&lt;&#x2F;code&gt; field is present, then the mapping is private if
we do not find the &lt;code&gt;sh&lt;&#x2F;code&gt; flag there.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h3 id=&quot;shared&quot;&gt;&lt;code&gt;Shared&lt;&#x2F;code&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;A mapping is shared (i.e., not private) if:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;In the absence of &lt;code&gt;VmFlags&lt;&#x2F;code&gt; in the &lt;code&gt;smaps&lt;&#x2F;code&gt; file, the permission
field of the mapping does not have the &lt;code&gt;p&lt;&#x2F;code&gt; flag. Not having this
flag actually means &lt;code&gt;VM_MAYSHARE&lt;&#x2F;code&gt; and not necessarily &lt;code&gt;VM_SHARED&lt;&#x2F;code&gt;
(which is what we want), but it is the best approximation we have.&lt;&#x2F;li&gt;
&lt;li&gt;If the &lt;code&gt;VmFlags&lt;&#x2F;code&gt; field is present, then the mapping is shared if
we find the &lt;code&gt;sh&lt;&#x2F;code&gt; flag there.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h2 id=&quot;the-patch&quot;&gt;The patch&lt;&#x2F;h2&gt;
&lt;p&gt;With all that in mind, I hacked GDB to improve the coredump mechanism
for GNU&#x2F;Linux operating systems. The main function which decides the
memory mappings that will or will not be dumped on GNU&#x2F;Linux is
&lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;sourceware.org&#x2F;git&#x2F;?p=binutils-gdb.git;a=blob;f=gdb&#x2F;linux-tdep.c;h=4af1d01900256164a478a0159b0fcabe86d5549f;hb=HEAD#l1108&quot;&gt;linux_find_memory_regions_full&lt;&#x2F;a&gt;;
the Linux kernel obviously uses its own function,
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;git.kernel.org&#x2F;cgit&#x2F;linux&#x2F;kernel&#x2F;git&#x2F;torvalds&#x2F;linux.git&#x2F;tree&#x2F;fs&#x2F;binfmt_elf.c#n1229&quot;&gt;vma_dump_size&lt;&#x2F;a&gt;,
to do the same thing.&lt;&#x2F;p&gt;
&lt;p&gt;Linux has one advantage: it is a kernel, and therefore has much more
knowledge about processes&#x27; internals than a userspace program. For
example, inside Linux it is trivial to check if a file marked as
&quot;&lt;code&gt;(deleted)&lt;&#x2F;code&gt;&quot; in the output of the &lt;code&gt;smaps&lt;&#x2F;code&gt; file has no hard links
associated with it (and therefore is not really deleted); the same
operation on userspace, however, would require root access to inspect
the contents of the &lt;code&gt;&#x2F;proc&#x2F;&amp;lt;PID&amp;gt;&#x2F;map_files&#x2F;&lt;&#x2F;code&gt; directory.&lt;&#x2F;p&gt;
&lt;p&gt;The case described above, if you remember, is something that impacts the
ability to tell whether a mapping is anonymous or not. I am talking to
the Linux kernel guys to see if it is possible to export this
information directly via the &lt;code&gt;smaps&lt;&#x2F;code&gt; file, instead of having to do the
current heuristic.&lt;&#x2F;p&gt;
&lt;p&gt;While doing this work, some strange behaviors were found in the Linux
kernel. Oleg is working on them, along with other Linux hackers. From
our side, there is still room for improvement on this code. The first
thing I can think of is to improve the heuristics for finding anonymous
mappings. Another relatively easy thing to do would be to let the user
specify a value for &lt;code&gt;coredump_filter&lt;&#x2F;code&gt; on the command line, without
editing the &lt;code&gt;&#x2F;proc&lt;&#x2F;code&gt; file. And of course, keep this code always updated
with its counterpart in the Linux kernel.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;upstream-discussions-and-commit&quot;&gt;Upstream discussions and commit&lt;&#x2F;h2&gt;
&lt;p&gt;If you are interested, you can see the discussions that happened
upstream by going &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;sourceware.org&#x2F;ml&#x2F;gdb-patches&#x2F;2015-03&#x2F;msg00816.html&quot;&gt;to this
link&lt;&#x2F;a&gt;. This
is the fourth (and final) submission of the patch; you should be able to
find the other submissions &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;sourceware.org&#x2F;ml&#x2F;gdb-patches&#x2F;2015-03&#x2F;authors.html&quot;&gt;in the
archive&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;The final commit can be found &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;sourceware.org&#x2F;git&#x2F;?p=binutils-gdb.git;a=commit;h=df8411da087dc05481926f4c4a82deabc5bc3859&quot;&gt;in the official
repository&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Respectful Software</title>
        <published>2014-10-15T00:00:00-05:00</published>
        <updated>2014-10-15T00:00:00-05:00</updated>
        
        <author>
          <name>
            
              Sergio Durigan Junior
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://blog.sergiodj.net/posts/respectful-software/"/>
        <id>https://blog.sergiodj.net/posts/respectful-software/</id>
        
        <content type="html" xml:base="https://blog.sergiodj.net/posts/respectful-software/">&lt;p&gt;&lt;strong&gt;To what extent should Free Software respect its users?&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;The question, strange as it may sound, is not only valid but also
becoming more and more important these days. If you think that the &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;www.gnu.org&#x2F;philosophy&#x2F;free-sw.html&quot;&gt;four
freedoms&lt;&#x2F;a&gt; are enough to
guarantee that the Free Software will respect the user, you are probably
being oversimplistic. The four freedoms &lt;strong&gt;are&lt;&#x2F;strong&gt; essential, but they are
not sufficient. You need more. I need more. And this is why I think the
Free Software movement should have been called the &lt;strong&gt;Respectful
Software&lt;&#x2F;strong&gt; movement.&lt;&#x2F;p&gt;
&lt;p&gt;I know I will probably hear that I am too radical. And I know I will
hear it even from those who defend Free Software the way I do. But I
need to express this feeling I have, even though I may be wrong about
it.&lt;&#x2F;p&gt;
&lt;p&gt;It all began as an innocent comment. I make lots of presentations and
talks about Free Software, and, knowing that the word “Free” is
ambiguous in English, I started joking that Richard Stallman should have
named the movement “Respectful Software”, instead of “Free Software”. If
you think about it just a little, you will see that “respect” is a word
that brings different interpretations to different people, just as
“free” does. It is a subjective word. However, at least it does not have
the problem of referring to completely unrelated things such as “price”
and “freedom”. Respect is respect, and everybody knows it. What can
change (and often does) is &lt;em&gt;what&lt;&#x2F;em&gt; a person considers respectful or not.&lt;&#x2F;p&gt;
&lt;p&gt;(&lt;em&gt;I am obviously not considering the possible ambiguity that may exist
in another language with the word “respect”.&lt;&#x2F;em&gt;)&lt;&#x2F;p&gt;
&lt;p&gt;So, back to the software world. I want you to imagine a Free Software.
For example, let&#x27;s consider one that is used to connect to so-called
“social networks” like &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;gnu.io&#x2F;social&#x2F;&quot;&gt;GNU Social&lt;&#x2F;a&gt; or
&lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;pump.io&#x2F;&quot;&gt;pump.io&lt;&#x2F;a&gt;. I do not want to use a specific example
here; I am more interested in the consequences of a certain decision.
Which decision? Keep reading :-).&lt;&#x2F;p&gt;
&lt;p&gt;Now, let&#x27;s imagine that this Free Software is just beginning its life,
probably in some code repository under the control of its developer(s),
but most likely using some proprietary service like GitHub (which is an
issue by itself). And probably the developer is thinking: “&lt;em&gt;Which social
network should my software support first?&lt;&#x2F;em&gt;”. This is an extremely valid
and important question, but sometimes the developer comes up with an
answer that may not be satisfactory to its users. This is where the
“respect” comes into play.&lt;&#x2F;p&gt;
&lt;p&gt;In our case, this bad answer would be “Facebook”, “Twitter”, “Linkedin”,
or any other unethical social network. However, those are exactly the
easiest answers for many and many Free Software developers, either
because those “vampiric” services are popular among users, or because
the developer him&#x2F;herself uses them!!
By now, you should be able to see where I am getting at. My point, in a
simple question, is: “&lt;strong&gt;How far should we, Free Software developers,
allow users to go and harm themselves &lt;em&gt;and&lt;&#x2F;em&gt; the community?&lt;&#x2F;strong&gt;”. Yes, this
is not just a matter of self-inflicted restrictions, as when the user
chooses to use a non-free software to edit a text file, for example. It
is, in most cases, a matter of harming &lt;strong&gt;the community&lt;&#x2F;strong&gt; too. (I have
written a post related to this issue a while ago, called
“&lt;a href=&quot;https:&#x2F;&#x2F;blog.sergiodj.net&#x2F;posts&#x2F;respectful-software&#x2F;%7Bfilename%7D&#x2F;2014-05-15-privacy-collective-good.md&quot;&gt;Privacy as a Collective Good&lt;&#x2F;a&gt;”.)&lt;&#x2F;p&gt;
&lt;p&gt;It should be easy to see that it does not matter if I am using Facebook
through my shiny Free Software application on my computer or cellphone.
What &lt;strong&gt;really&lt;&#x2F;strong&gt; matters is that, when doing so, you are basically
supporting the use of those unethical social networks, to the point that
perhaps some of your friends are also using them &lt;strong&gt;because&lt;&#x2F;strong&gt; of you.
What does it matter if they are using Free Software to access them or
not? Is the benefit offered by the Free Software big enough to eliminate
(or even soften) the problems that exist when the user uses an unethical
service like Linkedin?&lt;&#x2F;p&gt;
&lt;p&gt;I wonder, though, what is the limit that we should obey. Where should we
draw the line and say “I will not pass beyond this point”? Should we
just “abandon” the users of those unethical services and social
networks, while we lock ourselves in our not-very-safe world? After all,
we &lt;strong&gt;need&lt;&#x2F;strong&gt; to communicate with them in order to bring them to our
cause, but it is hard doing so without getting our hands dirty. But that
is a discussion to another post, I believe.&lt;&#x2F;p&gt;
&lt;p&gt;Meanwhile, I could give plenty of examples of existing Free Softwares
that are doing a disservice to the community by allowing (and even
&lt;strong&gt;promoting&lt;&#x2F;strong&gt;) unethical services or solutions for their users. They are
&lt;strong&gt;disrespecting&lt;&#x2F;strong&gt; their users, sometimes exploiting the fact that many
users are not fully aware of privacy issues that come as a “gift” when
you use those services, without spending any kind of effort to &lt;strong&gt;teach&lt;&#x2F;strong&gt;
the users. However, I do not want this post to become a flamewar, so I
will not mention any software explicitly. I think it should be quite
easy for the reader to find examples out there.&lt;&#x2F;p&gt;
&lt;p&gt;Perhaps this post does not have a conclusion. I myself have not made my
mind completely about the subject, though I am obviously leaning towards
what most people would call the “radical” solution. But it is definitely
not an easy topic to discuss, or to argument about. Nonetheless, we are
closing our eyes to it, and we should not do so. The future of Free
Software depends also on what kinds of services we promote, and what
kinds of services we actually warn the users against. This is my
definition of &lt;strong&gt;respect&lt;&#x2F;strong&gt;, and this is why I think we should develop
Free &lt;strong&gt;and&lt;&#x2F;strong&gt; Respectful Software.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Fedora on an Acer C720P Chromebook</title>
        <published>2014-09-26T00:00:00-05:00</published>
        <updated>2014-09-26T00:00:00-05:00</updated>
        
        <author>
          <name>
            
              Sergio Durigan Junior
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://blog.sergiodj.net/posts/fedora-on-acer-c720p/"/>
        <id>https://blog.sergiodj.net/posts/fedora-on-acer-c720p/</id>
        
        <content type="html" xml:base="https://blog.sergiodj.net/posts/fedora-on-acer-c720p/">&lt;p&gt;Yes, you are reading correctly: I decided to buy a freacking Chromebook.
I really needed a lightweight notebook with me for my daily hackings
while waiting for my subway station, and this one seemed to be the best
option available when comparing models and prices. To be fair, and
before you throw me rocks, I visited the &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;shop.gluglug.org.uk&#x2F;product&#x2F;ibm-lenovo-thinkpad-x60-coreboot&#x2F;&quot;&gt;LibreBoot X60&#x27;s
website&lt;&#x2F;a&gt;
for some time, because I was strongly considering buying one (even
considering its weight); however, they did not have it in stock, and I
did not want to wait anymore, so...&lt;&#x2F;p&gt;
&lt;p&gt;Anyway, as one might expect, configuring GNU&#x2F;Linux on notebooks is
becoming harder as time goes by, either because the infamous &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Secure_boot&quot;&gt;Secure
Boot&lt;&#x2F;a&gt; (anti-)feature, or
because they come with more and more devices that demand proprietary
crap to be loaded. But fortunately, it is still possible to overcome
most of those problems and still get a GNU&#x2F;Linux distro running.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;references&quot;&gt;References&lt;&#x2F;h2&gt;
&lt;p&gt;For main reference, I used the following websites:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;bugzilla.redhat.com&#x2F;show_bug.cgi?id=1045821&quot;&gt;ACER Chromebook C720P: touchpad and touchscreen do not
work&lt;&#x2F;a&gt;, a bug
related to the Fedora support for the machine.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;pnmyers.blogspot.ca&#x2F;2014&#x2F;04&#x2F;fedora-20-lxde-livecd-on-my-acer-c720p.html&quot;&gt;Fedora 20 (LXDE LiveCD) on my Acer c720p
Chromebook&lt;&#x2F;a&gt;,
by Perry Myers.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;wiki.archlinux.org&#x2F;index.php&#x2F;Acer_C720_Chromebook&quot;&gt;Acer C720
Chromebook&lt;&#x2F;a&gt;,
a wiki page from Arch[GNU&#x2F;]Linux.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;wiki.archlinux.org&#x2F;index.php&#x2F;Chromebook&quot;&gt;Chromebook&lt;&#x2F;a&gt;, a
wiki page from Arch[GNU&#x2F;]Linux.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;I also used other references for small problems that I had during the
configuration, and I will list them when needed.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;backing-up-chromeos&quot;&gt;Backing up ChromeOS&lt;&#x2F;h2&gt;
&lt;p&gt;The first thing you will probably want to do is to make a recovery image
of the ChromeOS that comes pre-installed in the machine, in case things
go wrong. Unfortunately, to do that you need to have a Google account,
otherwise the system will fail to record the image. So, if you want to
let Google know that you bought a Chromebook, login into the system,
open Chrome, and go to the special URL &lt;code&gt;chrome:&#x2F;&#x2F;imageburner&lt;&#x2F;code&gt;. You will
need a 4 GiB pendrive&#x2F;sdcard. It should be pretty straightforward to do
the recording from there.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;screw-the-screw&quot;&gt;Screw the screw&lt;&#x2F;h2&gt;
&lt;p&gt;Now comes the hard part. This notebook comes with a &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;www.chromium.org&#x2F;chromium-os&#x2F;developer-information-for-chrome-os-devices&#x2F;acer-c720-chromebook&quot;&gt;write-protect
screw&lt;&#x2F;a&gt;.
You might be thinking: what is the purpose of this screw?&lt;&#x2F;p&gt;
&lt;p&gt;Well, the thing is: Chromebooks come with their own boot scheme, which
unfortunately doesn&#x27;t work to boot Linux. However, newer models also
offer a “legacy boot” option
(&lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;www.coreboot.org&#x2F;SeaBIOS&quot;&gt;SeaBIOS&lt;&#x2F;a&gt;), and &lt;strong&gt;this&lt;&#x2F;strong&gt; can boot
Linux. So far, so good, but...&lt;&#x2F;p&gt;
&lt;p&gt;When you switch to SeaBIOS (details below), the system will complain
that it cannot find ChromeOS, and will ask if you want to reinstall the
system. This will happen &lt;strong&gt;every time&lt;&#x2F;strong&gt; you boot the machine, because
the system is still entering the default BIOS. In order to activate
SeaBIOS, you have to press CTRL-L (Control + L) &lt;strong&gt;every time you boot&lt;&#x2F;strong&gt;!
And this is where the screw comes into play.&lt;&#x2F;p&gt;
&lt;p&gt;If you remove the write-protect screw, you will be able to make the
system use SeaBIOS by default, and therefore will not need to worry
about pressing CTRL-L every time. Sounds good? Maybe not so much...&lt;&#x2F;p&gt;
&lt;p&gt;The first thing to consider is that you will lose your warranty the
moment you open the notebook case. As I was not very concerned about it,
I decided to try to remove the screw, and guess what happened? I
stripped the screw! I am still not sure why that happened, because I was
using the correct screw driver for the job, but when I tried to remove
the screw, it seemed like butter and started to “decompose”!&lt;&#x2F;p&gt;
&lt;p&gt;Anyway, after spending many hours trying to figure out a way to remove
the screw, I gave up. My intention is to always suspend the system, so I
rarely need to press CTRL-L anyway...&lt;&#x2F;p&gt;
&lt;p&gt;Well, that&#x27;s all I have to say about this screwed screw. If you decide
to try removing it, keep in mind that I cannot help you in any way, and
that you are entirely responsible for what happens.&lt;&#x2F;p&gt;
&lt;p&gt;Now, let&#x27;s install the system :-).&lt;&#x2F;p&gt;
&lt;h2 id=&quot;enable-developer-mode&quot;&gt;Enable Developer Mode&lt;&#x2F;h2&gt;
&lt;p&gt;You need to enable the Developer Mode in order to be able to enable
SeaBIOS. To do that, follow &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;wiki.archlinux.org&#x2F;index.php&#x2F;Chromebook#Enabling_Developer_Mode&quot;&gt;these
steps&lt;&#x2F;a&gt;
from the Arch[GNU&#x2F;]Linux wiki page.&lt;&#x2F;p&gt;
&lt;p&gt;I don&#x27;t remember if this step works if you don&#x27;t have activated the
ChromeOS (i.e., if you don&#x27;t have a Google account associated with the
device). For my use, I just created a fake account to be able to
proceed.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;accessing-the-superuser-shell-inside-chromeos&quot;&gt;Accessing the superuser shell inside ChromeOS&lt;&#x2F;h2&gt;
&lt;p&gt;Now, you will need to access the superuser (&lt;code&gt;root&lt;&#x2F;code&gt;) shell inside
ChromeOS, to enable SeaBIOS. Follow &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;wiki.archlinux.org&#x2F;index.php&#x2F;Chromebook#Accessing_the_superuser_shell&quot;&gt;the steps described in the
Arch[GNU&#x2F;]Linux wiki page&lt;&#x2F;a&gt;.
For this specific step, you don&#x27;t need to login, which is good.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;enabling-seabios&quot;&gt;Enabling SeaBIOS&lt;&#x2F;h2&gt;
&lt;p&gt;We&#x27;re almost there! The last step before you boot your Fedora LiveUSB is
to actually enable SeaBIOS. Just go inside your superuser shell (from
the previous step) and type:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E6EDF3; background-color: #0D1117;&quot;&gt;&lt;code data-lang=&quot;shellsession&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&amp;gt; crossystem dev_boot_usb&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;1&lt;&#x2F;span&gt;&lt;span&gt; dev_boot_legacy&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;And that&#x27;s it!&lt;&#x2F;p&gt;
&lt;p&gt;If you managed to successfuly remove the write-protect screw, you may
also want to enable booting SeaBIOS by default. To do that, &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;wiki.archlinux.org&#x2F;index.php&#x2F;Chromebook#Boot_to_SeaBIOS_by_default&quot;&gt;there is a
guide&lt;&#x2F;a&gt;,
again on Arch[GNU&#x2F;]Linux wiki. &lt;strong&gt;DO NOT DO THAT IF YOU DID NOT REMOVE
THE WRITE-PROTECT SCREW!!!!&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;booting-fedora&quot;&gt;Booting Fedora&lt;&#x2F;h2&gt;
&lt;p&gt;Now, we should finally be able to boot Fedora! Remember, you will have
to press CTRL-L after you reboot (if you have not removed the
write-protect screw), otherwise the system will just complain and not
boot into SeaBIOS. So, press CTRL-L, choose the boot order (you will
probably want to boot from USB first, if your Fedora is on a USB stick),
choose to boot the live Fedora image, and... bum!! You will probably see
a message complaining that there was not enough memory to boot (the
message is “Not enough memory to load specified image”).&lt;&#x2F;p&gt;
&lt;p&gt;You can solve that by passing the &lt;code&gt;mem&lt;&#x2F;code&gt; parameter to Linux. So, when
GRUB complains that it was unable to load the specified image, it will
give you a command prompt (&lt;code&gt;boot:&lt;&#x2F;code&gt;), and you just need to type:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E6EDF3; background-color: #0D1117;&quot;&gt;&lt;code data-lang=&quot;shellsession&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;boot: linux mem=1980M&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;And that&#x27;s it, things should work.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;installing-the-system&quot;&gt;Installing the system&lt;&#x2F;h2&gt;
&lt;p&gt;I won&#x27;t guide you through the installation process; I just want to
remember you that you have a 32 GiB SSD drive, so think carefully before
you decide how you want to set up the partitions. What I did was to
reserve 1 GB for my swap, and take all the rest to the root partition
(i.e., I did not create a separate &lt;code&gt;&#x2F;home&lt;&#x2F;code&gt; partition).&lt;&#x2F;p&gt;
&lt;p&gt;You will also notice that the touchpad does not work (neither does the
touchscreen). So you will have to do the installation using a USB mouse
for now.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;getting-the-touchpad-to-work&quot;&gt;Getting the touchpad to work&lt;&#x2F;h2&gt;
&lt;p&gt;I strongly recommend you to read &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;bugzilla.redhat.com&#x2F;show_bug.cgi?id=1045821&quot;&gt;this Fedora
bug&lt;&#x2F;a&gt;, which is
mostly about the touchpad&#x2F;touchscreen support, but also covers other
interesting topics as well.&lt;&#x2F;p&gt;
&lt;p&gt;Anyway, the bug is still being constantly updated, because the proposed
patches to make the touchpad&#x2F;touchscreen work were not fully integrated
into Linux yet. So, depending on the version of Linux that you are
running, you will probably need to run a different version of the
scripts that are being kindly provided in the bug.&lt;&#x2F;p&gt;
&lt;p&gt;As of this writing, I am running Linux 3.16.2-201.fc20, and the script
that does the job for me is &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;bugzilla.redhat.com&#x2F;attachment.cgi?id=937274&quot;&gt;this
one&lt;&#x2F;a&gt;. If you are
like me, you will never run a script without looking at what it does, so
go there and do it, I will wait :-).&lt;&#x2F;p&gt;
&lt;p&gt;OK, now that you are confident, run the script (as &lt;code&gt;root&lt;&#x2F;code&gt;, of course),
and confirm that it actually installs the necessary drivers to make the
devices work. In my case, I only got the touchpad working, even though
the touchscreen is also covered by this script. However, since I don&#x27;t
want the touchscreen, I did not investigate this further.&lt;&#x2F;p&gt;
&lt;p&gt;After the installation, reboot your system and at least your touchpad
should be working :-). Or kind of...&lt;&#x2F;p&gt;
&lt;p&gt;What happened to me was that I was getting strange behaviors with the
touchpad. Sometimes (randomly), its sensitivity became weird, and it was
very hard to move the pointer or to click on things. Fortunately, I
found the solution in the same bug, in &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;bugzilla.redhat.com&#x2F;show_bug.cgi?id=1045821#c3&quot;&gt;this comment by Yannick
Defais&lt;&#x2F;a&gt;. After
creating this X11 configuration file, everything worked fine.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;getting-suspend-to-work&quot;&gt;Getting suspend to work&lt;&#x2F;h2&gt;
&lt;p&gt;Now comes the hard part. My next challenge was to get suspend to work,
because (as I said above) I don&#x27;t want to poweroff&#x2F;poweron every time.&lt;&#x2F;p&gt;
&lt;p&gt;My first obvious attempt was to try to suspend using the current
configuration that came with Fedora. The notebook actually suspended,
but then it resumed 1 second later, and the system froze (i.e., I had to
force the shutdown by holding the power button for a few seconds). Hmm,
it smelled like this would take some effort, and my nose was right.&lt;&#x2F;p&gt;
&lt;p&gt;After a lot of search (and &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;bugzilla.redhat.com&#x2F;show_bug.cgi?id=1045821#c63&quot;&gt;asking in the
bug&lt;&#x2F;a&gt;), I found
out about a few Linux flags that I could provide in boot time. To save
you time, this is what I have now in my &lt;code&gt;&#x2F;etc&#x2F;default&#x2F;grub&lt;&#x2F;code&gt; file:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E6EDF3; background-color: #0D1117;&quot;&gt;&lt;code data-lang=&quot;shellsession&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;GRUB_CMDLINE_LINUX=&amp;quot;tpm_tis.force=1 tpm_tis.interrupts=0 ...&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The final &lt;code&gt;...&lt;&#x2F;code&gt; means that you should keep whatever was there before you
included those parameters, of course. Also, after you edit this file,
you need to regenerate the GRUB configuration file on &lt;code&gt;&#x2F;boot&lt;&#x2F;code&gt;. Run the
following command as &lt;code&gt;root&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E6EDF3; background-color: #0D1117;&quot;&gt;&lt;code data-lang=&quot;shellsession&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&amp;gt; grub2-mkconfig -o &#x2F;boot&#x2F;grub2&#x2F;grub.cfg&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Then, after I rebooted the system, I found that only adding those flags
was still not enough. I saw a bunch of errors on &lt;code&gt;dmesg&lt;&#x2F;code&gt;, which showed
me that there was some problem with EHCI and xHCI. After a few more
research, I found the &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;bbs.archlinux.org&#x2F;viewtopic.php?pid=1364521#p1364521&quot;&gt;this
comment&lt;&#x2F;a&gt;
on an Arch[GNU&#x2F;]Linux forum. Just follow the steps there (i.e., create
the necessary files, especially the
&lt;code&gt;&#x2F;usr&#x2F;lib&#x2F;systemd&#x2F;system-sleep&#x2F;cros-sound-suspend.sh&lt;&#x2F;code&gt;), and things
should start to get better. But not yet...&lt;&#x2F;p&gt;
&lt;p&gt;Now, you will see that suspend&#x2F;resume work OK, but when you suspend, the
system will still resume after 1 second or so. Basically, this happens
because the system is using the touchpad and the touchscreen to
determine whether it should resume from suspend or not. So basically
what you have to do is to disable those sources of events:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E6EDF3; background-color: #0D1117;&quot;&gt;&lt;code data-lang=&quot;shellsession&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;echo TPAD &amp;gt; &#x2F;proc&#x2F;acpi&#x2F;wakeup&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;echo TSCR &amp;gt; &#x2F;proc&#x2F;acpi&#x2F;wakeup&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;And voilà! Now everything should work as expected :-). You might want to
issue those commands every time you boot the system, in order to get
suspend to work every time, of course. To do that, you can create a
&lt;code&gt;&#x2F;etc&#x2F;rc.d&#x2F;rc.local&lt;&#x2F;code&gt;, which gets executed when the system starts:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E6EDF3; background-color: #0D1117;&quot;&gt;&lt;code data-lang=&quot;shellsession&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&amp;gt; cat &#x2F;etc&#x2F;rc.d&#x2F;rc.local&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;#!&#x2F;bin&#x2F;bash&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;suspend_tricks()&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;{&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;  echo TPAD &amp;gt; &#x2F;proc&#x2F;acpi&#x2F;wakeup&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;  echo TSCR &amp;gt; &#x2F;proc&#x2F;acpi&#x2F;wakeup&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;suspend_tricks&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;exit 0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Don&#x27;t forget to make this file executable:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E6EDF3; background-color: #0D1117;&quot;&gt;&lt;code data-lang=&quot;shellsession&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&amp;gt; chmod +x &#x2F;etc&#x2F;rc.d&#x2F;rc.local&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;&#x2F;h2&gt;
&lt;p&gt;Overall, I am happy with the machine. I still haven&#x27;t tried installing
&lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;www.fsfla.org&#x2F;ikiwiki&#x2F;selibre&#x2F;linux-libre&#x2F;index.en.html&quot;&gt;Linux-libre&lt;&#x2F;a&gt;
on it, so I am not sure if it can work without binary blobs and
proprietary craps.&lt;&#x2F;p&gt;
&lt;p&gt;I found the keyboard comfortable, and the touchpad OK. The only extra
issue I had was using the Canadian&#x2F;French&#x2F;whatever keyboard that comes
with it, because it lacks some useful keys for me, like Page Up&#x2F;Down,
Insert, and a few others. So far, I am working around this issue by
using &lt;code&gt;xbindkeys&lt;&#x2F;code&gt; and &lt;code&gt;xvkdb&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;I do not recommend this machine if you are not tech-savvy enough to
follow the steps listed in this post. If that is the case, then consider
buying a machine that can easily run GNU&#x2F;Linux, because you feel much
more comfortable configuring it!&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Reflexões de um ativista -- Parte 02</title>
        <published>2013-11-14T00:00:00-05:00</published>
        <updated>2013-11-14T00:00:00-05:00</updated>
        
        <author>
          <name>
            
              Sergio Durigan Junior
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://blog.sergiodj.net/posts/reflexoes-de-um-ativista-parte-2/"/>
        <id>https://blog.sergiodj.net/posts/reflexoes-de-um-ativista-parte-2/</id>
        
        <content type="html" xml:base="https://blog.sergiodj.net/posts/reflexoes-de-um-ativista-parte-2/">&lt;p&gt;Ainda não sei se estou preparado pra enfrentar a segunda parte dessa
&quot;série&quot;, mas também não adianta fugir... O que eu sei é que essas
reflexões podem não ser condizentes com a realidade (ou com a &lt;strong&gt;sua&lt;&#x2F;strong&gt;
realidade), e que talvez eu esteja exagerando (ou aliviando) nas minhas
observações, mas em todo caso eu espero que seja possível para você,
querido leitor, traçar alguns paralelos com o seu modo de ver o mundo,
e, quem sabe, mudar algo na sua região.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;preguica&quot;&gt;Preguiça&lt;&#x2F;h2&gt;
&lt;p&gt;Este ponto relaciona-se mutuamente com os outros dois pontos (que também
relacionam-se mutuamente entre si). É claro, tudo está conectado nesse
mundo, até mesmo (e principalmente!) os motivos que levam alguém a se
&lt;strong&gt;des&lt;&#x2F;strong&gt;conectar de alguns valores morais e éticos.&lt;&#x2F;p&gt;
&lt;p&gt;Eu vejo pessoas preguiçosas o tempo todo. Às vezes, sou uma delas (por
mais que tente me afastar desse comportamento). Mas creio que existe uma
diferença entre alguém inerentemente preguiçoso, e alguém que se deixa
levar pela tentação da preguiça por conta de algum outro fator. A minha
reclamação, aqui, é com o primeiro tipo de pessoas.&lt;&#x2F;p&gt;
&lt;p&gt;O &quot;teste&quot; pra saber se você se encaixa nesse grupo é: quando você se
depara com algum problema difícil de ser resolvido, qual seu &lt;em&gt;modus
operandi&lt;&#x2F;em&gt;? Buscar soluções, ou desistir? Tentar você mesmo, ou pedir pra
alguém? Aprender com seus erros, ou repetí-los &lt;em&gt;ad eternum&lt;&#x2F;em&gt;? Se você não
quis nem pensar sobre esse teste, então acho a resposta é óbvia...&lt;&#x2F;p&gt;
&lt;p&gt;Mas o que isso tem a ver com ativismo? Tudo. Ser ativista é, por
definição, ter que enfrentar situações difíceis e desanimadoras,
platéias apáticas e desconfiadas, pessoas descrentes e alienadas. E isso
tudo é absurdamente frustrante, principalmente quando você acredita
naquilo que está falando, e sabe que as pessoas que estão ouvindo
&lt;strong&gt;precisam&lt;&#x2F;strong&gt; entender também! Afinal, como eu falei em outro post, a
privacidade (mas não só ela!) é um bem coletivo. A manutenção dela
&lt;strong&gt;depende&lt;&#x2F;strong&gt; da compreensão da comunidade sendo espionada.&lt;&#x2F;p&gt;
&lt;p&gt;Em outras palavras, as empresas, entidades e governos que estão lutando
para que você tenha cada vez menos direitos não dormem no ponto. Não vai
ser muito legal se nós dormirmos...&lt;&#x2F;p&gt;
&lt;p&gt;Só que esse ponto não se aplica somente aos ativistas em si. Obviamente,
encontramos (muitos!) preguiçosos (e preguiçosas) do outro lado, na
platéia. É sempre bom (e necessário) assumir que as pessoas pra quem
você está falando são ignorantes naquele assunto, e portanto precisam
ser instruídas minimamente para que possam tomar decisões maduras e
inteligentes. No entanto, mesmo &lt;strong&gt;depois&lt;&#x2F;strong&gt; de serem alertadas sobre
vários fatos e consequências dos seus atos, as pessoas &lt;strong&gt;ainda assim&lt;&#x2F;strong&gt;
preferem continuar na ignorância!! Existem vários nomes pra essa
&quot;teimosia&quot;, mas eu costumo achar que um dos fatores que contribui pra
isso é a preguiça.&lt;&#x2F;p&gt;
&lt;p&gt;Preguiça em levantar da cadeira e procurar soluções que respeitem você e
sua comunidade. Preguiça em continuar pensando (ou seja, &quot;sempre
alerta&quot;) sobre quais os riscos você está efetivamente correndo quando
usa aquela &quot;rede social&quot;. Preguiça em mudar os hábitos. Preguiça em
lutar por seus direitos virtuais. Enfim, preguiça.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;preconceito&quot;&gt;Preconceito&lt;&#x2F;h2&gt;
&lt;p&gt;Esse é um dos pontos mais problemáticos. O preconceito está enraizado
nas pessoas, sem exceção. E o preconceito contra ativistas, de qualquer
tipo, é evidente.&lt;&#x2F;p&gt;
&lt;p&gt;Ser ativista não é somente acreditar em algo. Ser ativista é
principalmente &lt;strong&gt;saber&lt;&#x2F;strong&gt; de algo, e querer levar essa sabedoria para as
pessoas. Obviamente, existem vários tipos de ativismo, mas quando olho
pro que eu faço, eu me vejo mais como alguém que sente ser sua obrigação
ensinar as pessoas sobre algo que é desconhecido da maioria. Apesar de
realmente esperar que as pessoas acreditem nos valores que eu tento
passar (e quem não espera?), acredito que meu objetivo principal seja o
de &quot;habilitar&quot; a sociedade a tomar decisões conscientes sobre os
assuntos que tento &quot;ensinar&quot;.&lt;&#x2F;p&gt;
&lt;p&gt;Algumas pessoas têm medo ou vergonha de me falar que usam Facebook,
Twitter, ou algum software não-livre. Mas eu noto que, na maior parte
dos casos, o medo delas decorre do fato de elas saberem que eu não
&quot;gosto&quot; de nenhum desses itens, e não do fato de elas saberem &lt;strong&gt;por
que&lt;&#x2F;strong&gt; eu não gosto deles. E nesse caso, eu não sinto raiva ou decepção
pela pessoa com quem estou conversando, mas sim uma necessidade de
realmente &lt;strong&gt;explicar&lt;&#x2F;strong&gt; o motivo de eu não concordar com a utilização
desses programas! Sei que se eu explicar, na verdade eu estarei dando
ferramentas pra que a pessoa consiga, ela mesma, decidir se quer
continuar usando-os. Essa é minha tarefa, no final das contas. Permitir
que o usuário de tecnologia consiga, de forma consciente e ética,
escolher o que quer e o que não quer. Mas aí entra o preconceito...&lt;&#x2F;p&gt;
&lt;p&gt;Quando começo a falar, é inevitável usar expressões como &quot;liberdade&quot;,
&quot;respeito&quot;, &quot;ética&quot;, &quot;comunidade&quot;, &quot;privacidade&quot;, &quot;questões sociais&quot;,
etc. Elas são o cimento pra que eu possa construir meus argumentos, e
não creio que palavras ou expressões por si só possam definir um liberal
de um conservador, por exemplo. No entanto, o que mais vejo são pessoas
que confundem ativistas de Software Livre com comunistas ou socialistas.
E como hoje a moda é o conservadorismo, às vezes as pessoas ignoram tudo
aquilo que falamos por conta desse preconceito idiota.&lt;&#x2F;p&gt;
&lt;p&gt;Meu objetivo não é discutir sobre se é bom ou ruim ser
socialista&#x2F;comunista (apesar de eu definitivamente não ser
&quot;conservador&quot;, e achar esse preconceito absurdo). Mas o que deve ficar
claro é que o Software Livre, apesar de ser um movimento político, &lt;strong&gt;não
é&lt;&#x2F;strong&gt; um movimento partidário. Defendemos valores bem definidos, que podem
ou não ter a ver com idéias comunistas&#x2F;socialistas, mas que não advogam
a favor desse movimento político. Também é importante mencionar que, por
ser um movimento social, é natural que muitas idéias e preceitos
defendidos pelos ativistas de Software Livre sejam simpáticos à causa
socialista&#x2F;comunista. Mas isso obviamente não faz com que Stallman seja
o novo Stalin (apesar da semelhança dos sobrenomes).&lt;&#x2F;p&gt;
&lt;p&gt;Enfim, o meu pedido para a comunidade em geral é: ouçam a mensagem,
independente do interlocutor, e pensem a respeito, independente da sua
orientação político-partidária. Aquilo pelo qual lutamos independe de
partido, religião, time de futebol, nacionalidade. Depende simplesmente
de seres humanos, de uma comunidade que não tem fronteiras, não tem uma
única cultura, mas que merece mais respeito. Só que, infelizmente, vamos
ter que exigir isso.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>About coherence, Twitter, and the Free Software Foundation</title>
        <published>2013-10-16T00:00:00-05:00</published>
        <updated>2013-10-16T00:00:00-05:00</updated>
        
        <author>
          <name>
            
              Sergio Durigan Junior
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://blog.sergiodj.net/posts/fsf-twitter-coherence/"/>
        <id>https://blog.sergiodj.net/posts/fsf-twitter-coherence/</id>
        
        <content type="html" xml:base="https://blog.sergiodj.net/posts/fsf-twitter-coherence/">&lt;p&gt;The &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;fsf.org&quot;&gt;Free Software Foundation&lt;&#x2F;a&gt; has a
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;twitter.com&quot;&gt;Twitter&lt;&#x2F;a&gt; &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;twitter.com&#x2F;fsf&quot;&gt;account&lt;&#x2F;a&gt;.
Surprised? So am I, in a negative way, of course. And I will explain why
on this post.&lt;&#x2F;p&gt;
&lt;p&gt;You may not agree with me on everything I write here, and I am honestly
expecting some opposition, but I would like to make it crystal clear
that my purpose is to raise awareness for the most important &quot;feature&quot;
an organization should have: &lt;strong&gt;coherence&lt;&#x2F;strong&gt;.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;the-shock&quot;&gt;The shock&lt;&#x2F;h2&gt;
&lt;p&gt;I first learned about the Twitter account on IRC. I was hanging around
in the &lt;code&gt;#fsf&lt;&#x2F;code&gt; channel on Freenode, when someone mentioned that &quot;&lt;em&gt;...
something has just been posted on FSF&#x27;s Twitter!&lt;&#x2F;em&gt;&quot; (yes, it was a happy
announcement, not a complaint). I thought it was a joke, but before
laughing I decided to confirm. And to my deepest sorrow, I was wrong.
&lt;strong&gt;The Free Software Foundation has a Twitter account&lt;&#x2F;strong&gt;. The implications
of this are mostly bad not only for the Foundation itself, but also for
us, Free Software users and advocates.&lt;&#x2F;p&gt;
&lt;p&gt;Twitter uses Free Software to run its services. So does Facebook, and I
would even bet that Microsoft runs some GNU&#x2F;Linux machines serving
intranet pages... But the thing is not about what a web service uses. It
is about endorsement. And I will explain.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;free-ads-anyone&quot;&gt;Free ads, anyone?&lt;&#x2F;h2&gt;
&lt;p&gt;I remember having this crazy thought some years ago, when I saw some
small company in Brazil putting the Facebook logo in their product&#x27;s
box. What surprised me was that the Facebook logo was actually bigger
than the company&#x27;s logo! What the heck?!?! This is &quot;Marketing 101&quot;: you
are drawing attention to &lt;em&gt;Facebook&lt;&#x2F;em&gt;, not to your company who actually
made the product. And from that moment on, every time I see Coca Cola
putting a &quot;Find us on &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;facebook.com&#x2F;cocacola&quot;&gt;http:&#x2F;&#x2F;facebook.com&#x2F;cocacola&lt;&#x2F;a&gt;&quot; (don&#x27;t know if the
URL is valid, it&#x27;s just an example) I have this strange feeling of how
an internet company can twist the rules of marketing and get free ads
everywhere...&lt;&#x2F;p&gt;
&lt;p&gt;My point is simple: when a company uses a web service, it is endorsing
the use of this same web service, even if in an indirect way. And the
same applies to organizations, or foundations, for that matter. So the
question I had in my mind when I saw FSF&#x27;s Twitter account was: do we
really want to endorse Twitter? So I sent them an e-mail...&lt;&#x2F;p&gt;
&lt;h2 id=&quot;talking-to-the-fsf-first-message&quot;&gt;Talking to the FSF - First message&lt;&#x2F;h2&gt;
&lt;p&gt;I have exchanged some interesting messages with Kyra, FSF&#x27;s Campaign
Organizer, and with John Sullivan, FSF&#x27;s Executive Director. I will not
post the messages here because I don&#x27;t have their permission to do so,
but I will try to summarize what we discussed, and the outcomings.&lt;&#x2F;p&gt;
&lt;p&gt;My first message was basically requiring some clarifications. I had read
this &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.fsf.org&#x2F;twitter&quot;&gt;interesting page about the presence of FSF on
Twitter&lt;&#x2F;a&gt;, and expressed my disagreement
about the arguments used there.&lt;&#x2F;p&gt;
&lt;p&gt;They explicitly say that Twitter uses nonfree JavaScript, and suggest
that the reader use a free client to access it. Yet, they still close
their eyes to the fact that a &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;benjaminmayo.co.uk&#x2F;how-many-people-use-twitter-s-own-apps&quot;&gt;big part of the Twitter
community&lt;&#x2F;a&gt;
use it through the browser, or through some proprietary application.&lt;&#x2F;p&gt;
&lt;p&gt;They also acknowledge that Twitter accounts have privacy issues. This is
obvious for anyone interested in privacy, and the FSF even provides a
link to an interesting story about subpoenas during the Occupy Wall
Street movement.&lt;&#x2F;p&gt;
&lt;p&gt;Nevertheless, the FSF still thinks it&#x27;s OK to have a Twitter account,
because it uses Twitter via a bridge which connects FSF&#x27;s &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;status.fsf.org&#x2F;fsf&quot;&gt;StatusNet
instance&lt;&#x2F;a&gt; to Twitter. Therefore, in their
vision, they are not really using Twitter (at least, they are not using
the proprietary JavaScript), and well, let the bridge do its job...&lt;&#x2F;p&gt;
&lt;p&gt;This is nonsense. Again: when a foundation uses a web service, it is
endorsing it, even if indirectly! And that was the main argument I have
used when I wrote to them. Let&#x27;s see how they replied...&lt;&#x2F;p&gt;
&lt;h2 id=&quot;fsf-answers&quot;&gt;FSF answers&lt;&#x2F;h2&gt;
&lt;p&gt;The answer I&#x27;ve got to my first message was not very good (very weak
arguments), so I won&#x27;t even bother talking about it here. I had to send
another message to make it clear that I was interested in real answers.&lt;&#x2F;p&gt;
&lt;p&gt;After the second reply, it became clear to me that the main point of the
FSF is to reach as many people as they can, and pass along the message
of software user freedom. I have the impression that it doesn&#x27;t really
matter the means they will use for that, as long as it is not Facebook
(more on that latter). So if it takes using a web service that
disrespects privacy and uses nonfree Javascript, so be it.&lt;&#x2F;p&gt;
&lt;p&gt;It also seems to me that the FSF believes in an illusion created by
themselves. In some messages, they said that they would try to do a
harder job at letting people know that using Twitter is not the
solution, but part of the problem (the irony is that they would do that
&lt;strong&gt;using&lt;&#x2F;strong&gt; Twitter). However, sometimes I look at FSF&#x27;s Twitter account,
and so far &lt;strong&gt;nothing has been posted&lt;&#x2F;strong&gt; about this topic. Regular people
just don&#x27;t know that there are alternatives to Twitter.&lt;&#x2F;p&gt;
&lt;p&gt;I will take the liberty to tell a little story now. I told the same
story to them, to no avail. Let&#x27;s imagine the following scenario: John
has just heard about Free Software and is beginning to study about it.
He does not have a Twitter account, but one of the first things he finds
when he looks for Free Software on the web is FSF&#x27;s Twitter. So, he
thinks: &quot;Hey, I would like to receive news about Free Software, and it&#x27;s
just a Twitter account away! Neat!&quot;. Then, he creates a Twitter account
and starts following FSF there.&lt;&#x2F;p&gt;
&lt;p&gt;Can you imagine this happening in the real world? I definitely can.&lt;&#x2F;p&gt;
&lt;p&gt;The FSF is also mistaken when they think that they should go to Twitter
in order to reach people. I wrote them, and I will say it again here,
that I think we should create ways to reach those users &quot;indirectly&quot;
(which, as it turns out, would be more direct!), trying to promote
events, conferences, talks, face-to-face gatherings, etc. The
LibrePlanet project, for example, is a &lt;em&gt;great&lt;&#x2F;em&gt; way of doing this job
through local communities, and the FSF should pay a lot more attention
to it in my opinion! These are &quot;offline&quot; alternatives, and I confess I
think we should discuss the &quot;online&quot; ones with extra care, because we
are in such a sad situation regarding the Internet now that I don&#x27;t even
know where to start...&lt;&#x2F;p&gt;
&lt;p&gt;And last, but definitely not least, the FSF is being &lt;strong&gt;incoherent&lt;&#x2F;strong&gt;.
When it says that &quot;it is OK to use Twitter through a bridge in a
StatusNet instance&quot;, then it should also be coherent and do the same
thing for Facebook. One can use Facebook through bridges connecting
privacy-friendly services such as
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;diaspora&#x2F;diaspora&quot;&gt;Diaspora&lt;&#x2F;a&gt; and
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;friendica&#x2F;friendica&#x2F;wiki&#x2F;How-to:-Friendica%E2%80%99s-Facebook-connector&quot;&gt;Friendica&lt;&#x2F;a&gt;
(the fact that Diaspora itself has a Facebook account for the project is
a topic I won&#x27;t even start to discuss). And through those bridges, the
FSF will be able to reach &lt;strong&gt;much&lt;&#x2F;strong&gt; more people than through Twitter.&lt;&#x2F;p&gt;
&lt;p&gt;I am not, in any way, comparing Twitter and Facebook. I am very much
aware that Facebook has its own set of problems, which are bigger and
worse than Twitter&#x27;s (in the most part). But last time I checked, we
were not trying to find the best between both. They are both bad in
their own ways, and the FSF should not be using either of them!&lt;&#x2F;p&gt;
&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;&#x2F;h2&gt;
&lt;p&gt;My conversation with the FSF ended after a few more messages. It was
clear to me that they would not change anything (despite their promises
to raise awareness to alternatives to Twitter, as I said above), and I
don&#x27;t believe in infinite discussions about some topic, so I decided to
step back. Now, this post is the only thing I can do to try to let
people know and think about this subject. It may seem a small problem to
solve, and I know that the Free Software community must be together in
order to promote the ideas we share and appreciate, but that is
&lt;em&gt;precisely&lt;&#x2F;em&gt; why I am writing this.&lt;&#x2F;p&gt;
&lt;p&gt;The Free Software movement was founded on top of ideas and coherence. In
order to be successful, we must remain coherent to what we believe. This
is not an option, there is no alternative. If we don&#x27;t defend our own
beliefs, no one will.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Reflexões de um ativista -- Parte 01</title>
        <published>2013-09-23T00:00:00-05:00</published>
        <updated>2013-09-23T00:00:00-05:00</updated>
        
        <author>
          <name>
            
              Sergio Durigan Junior
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://blog.sergiodj.net/posts/reflexoes-de-um-ativista-parte-1/"/>
        <id>https://blog.sergiodj.net/posts/reflexoes-de-um-ativista-parte-1/</id>
        
        <content type="html" xml:base="https://blog.sergiodj.net/posts/reflexoes-de-um-ativista-parte-1/">&lt;p&gt;Nesse último fim de semana, durante os dias 20 e 21 de Setembro
(sexta-feira e sábado, respectivamente), ocorreram dois eventos sobre
Software Livre na UNICAMP. Um deles, o
&lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;upstream.net.br&quot;&gt;Upstream&lt;&#x2F;a&gt;, foi um &quot;evento teste&quot; que ajudei a
organizar junto com o &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;cascardo.info&quot;&gt;Cascardo&lt;&#x2F;a&gt; e o Leonardo
Garcia, ambos do LTC&#x2F;IBM. O outro, o &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;libreplanet.org&#x2F;wiki&#x2F;LP-BR-SP&#x2F;Eventos&#x2F;SFD_Campinas_2013&quot;&gt;Software Freedom
Day&lt;&#x2F;a&gt;
(SFD), eu organizei em nome do &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;sp.libreplanetbr.org&quot;&gt;LibrePlanet São
Paulo&lt;&#x2F;a&gt;. Durante os dois eventos (e
principalmente durante o SFD) eu fiquei pensando e refletindo bastante
sobre vários assuntos relacionados (ou não) com o Software Livre.
Resolvi, então, aproveitar a oportunidade e escrever um pouco sobre
essas opiniões.&lt;&#x2F;p&gt;
&lt;p&gt;Antes, um breve relato dos dois eventos. Gostei parcialmente do
resultado que obtivemos com o Upstream. Acho que a qualidade dos
palestrantes foi ótima, e as discussões tiveram um nível muito bom. No
entanto, os workshops deixaram a desejar. Pelo pouco que pensei a
respeito, cheguei à conclusão de que faltou organização para definirmos
os assuntos que iriam ser abordados, e principalmente o melhor modo de
abordá-los. Assumo minha parcela de culpa nisso, afinal eu tentei ajudar
na organização do workshop de toolchain e ele não saiu do modo como
esperávamos. Problemas na infra-estrutura do local também atrapalharam
no resultado final. Mas, de modo geral, e levando em conta que essa foi
a primeira edição do evento, acho que conseguimos nos sair razoavelmente
bem. Certamente já temos muitas coisas pra pensar e melhorar para a
próxima edição!&lt;&#x2F;p&gt;
&lt;p&gt;Já sobre o SFD, apesar de várias pessoas muito boas terem participado do
evento, a minha impressão inicial (e forte) foi a de que fazer a
sociedade se interessar (ou ao menos ouvir, se bem que os dois conceitos
são intrinsecamente ligados) por assuntos que são de suma importância
para a manutenção (ou, no caso, a restauração) de um Estado que a
respeite é mais difícil do que eu pensava. E essa é também a primeira
reflexão do post.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;indignacao-x-ignorancia&quot;&gt;Indignação x Ignorância&lt;&#x2F;h2&gt;
&lt;p&gt;Há um conflito muito grande acontecendo com as pessoas. Provavelmente
ele não é &quot;de hoje&quot;, mas de qualquer modo ele existe e precisa ser
resolvido. O conflito, do modo que vejo, pode ser resumido da seguinte
forma: &quot;&lt;em&gt;até que ponto eu quero sentir indignação sobre um assunto, de
modo que eu não precise necessariamente tomar alguma atitude sobre
ele?&lt;&#x2F;em&gt;&quot;. Ou seja, a pessoa opta voluntariamente por permanecer na
ignorância parcial, para que ela não se sinta obrigada a tomar uma
posição sobre determinado problema que a atinge.&lt;&#x2F;p&gt;
&lt;p&gt;Tomemos o exemplo do Facebook. Alguém que tenha uma conta lá (i.e.,
&quot;quase todo mundo&quot;) prefere se manter na ignorância sobre os termos de
serviço e privacidade que o site possui. Não estou entrando no mérito de
operações clandestinas de espionagem; estou falando sobre os textos
disponíveis no site do Facebook e que explicam (talvez não de maneira
muito clara, mas isso já é outro problema) o que o site faz e não faz a
respeito dos seus dados. É uma opção. É mais fácil apenas usar o site,
compartilhar imagens engraçadas com seus mil &quot;amigos&quot;, e não olhar para
uma questão que deveria ser muito mais importante do que qualquer &quot;like&quot;
que possa ser dado.&lt;&#x2F;p&gt;
&lt;p&gt;Não sou sociólogo e estou longe de poder dar opiniões acadêmicas sobre
esse assunto, mas tenho a impressão de que o que acontece é um &quot;retardo
social&quot; na maioria dos cidadãos deste planeta. Não deixa de ser um
paradoxo o fato de que esse comportamento é exacerbado através de uma
&quot;rede social&quot;, que se traveste de facilitadora de comunicações entre
indivíduos para poder exercer a derradeira função de uma empresa: ganhar
dinheiro. É importante frisar que não sou contra &quot;ganhar dinheiro&quot;, mas
sou contra vários meios que são usados pra atingir esse objetivo.&lt;&#x2F;p&gt;
&lt;p&gt;No final, o produto somos nós, ou nossa privacidade. E quando eu digo
&quot;nós&quot; ao invés de &quot;eles&quot;, é porque eu fiz uma outra reflexão...&lt;&#x2F;p&gt;
&lt;h2 id=&quot;privacidade-e-um-bem-coletivo&quot;&gt;Privacidade é um &quot;bem&quot; coletivo&lt;&#x2F;h2&gt;
&lt;p&gt;Pode parecer paradoxal à primeira vista, mas pare e pense um pouco. A
privacidade é sim um direito do indivíduo, mas quando você opta por não
tê-la, você está fazendo essa opção em nome de todas as pessoas que se
comunicam com você. Afinal, se você não se importa se alguém está lendo
suas mensagens, então qualquer tipo de comunicação que chega até você
pode e vai ser lida. E se essa comunicação partir de alguém que preza
pela própria privacidade, não vai fazer diferença alguma: a mensagem
será lida de qualquer jeito, porque &lt;em&gt;você&lt;&#x2F;em&gt; escolheu isso.&lt;&#x2F;p&gt;
&lt;p&gt;Estou acostumado a ouvir pessoas dizerem que elas não são tão
importantes a ponto de despertarem interesse em algum governo para que
ele queira espioná-las. &quot;Portanto&quot;, dizem as pessoas, &quot;não preciso me
preocupar&quot;. Bem, acho que esse argumento não invalida de maneira alguma
o fato de que proteger a própria privacidade é importante. Não interessa
o quão público alguém é; se ele não preza pela sua privacidade, ele está
abrindo mão de algo que afeta direta ou indiretamente várias pessoas.&lt;&#x2F;p&gt;
&lt;p&gt;O meu ponto aqui é simples. Faça a sua parte e proteja a sua
privacidade. Ninguém vai fazer isso por você, mas todos precisam e podem
fazer suas respectivas partes. É um trabalho em conjunto, mas que
depende da cooperação de todos. Se alguém perto de você não se importar,
você provavelmente vai ser prejudicado.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Relato: FAD SP 2013</title>
        <published>2013-06-10T00:00:00-05:00</published>
        <updated>2013-06-10T00:00:00-05:00</updated>
        
        <author>
          <name>
            
              Sergio Durigan Junior
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://blog.sergiodj.net/posts/fad-sp-2013/"/>
        <id>https://blog.sergiodj.net/posts/fad-sp-2013/</id>
        
        <content type="html" xml:base="https://blog.sergiodj.net/posts/fad-sp-2013/">&lt;p&gt;Estava devendo este post há 1 semana pro meu amigo Leonardo Vaz!
Desculpaê, Leo :-).&lt;&#x2F;p&gt;
&lt;p&gt;Vou tentar fazer um (breve?) relato sobre o &lt;strong&gt;F&lt;&#x2F;strong&gt;edora &lt;strong&gt;A&lt;&#x2F;strong&gt;ctivity
&lt;strong&gt;D&lt;&#x2F;strong&gt;ay (ou simplesmente &lt;strong&gt;FAD&lt;&#x2F;strong&gt;), que aconteceu em São Paulo no dia 1
de Junho de 2013, mais conhecido como sábado retrasado :-). Se quiser
ver a página de organização do evento (em inglês), clique &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;fedoraproject.org&#x2F;wiki&#x2F;FAD_SP_2013&quot;&gt;neste link
aqui&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;chegada-em-sampa&quot;&gt;Chegada em Sampa&lt;&#x2F;h2&gt;
&lt;p&gt;Bem, como sou um ex-embaixador do Fedora novato, inexperiente, e que não
faz nada da vida (ao contrário de vários ex-colegas que participam há
anos como embaixadores contribuindo solidamente para o bem comum e sem
deixar a peteca cair), eu resolvi levar os DVDs do Fedora que estavam
comigo para que o Leo e o Itamar (e quem mais estivesse por lá!)
pudessem se encarregar de redistribuí-los antes que eles perdessem a
&quot;validade&quot;. Saí cedo de Campinas, e com uma São Paulo sem trânsito nem
problemas, consegui chegar no escritório da Red Hat às 9h e pouco.&lt;&#x2F;p&gt;
&lt;p&gt;Conheci (e reconheci!) algumas pessoas por lá, entre colegas de trabalho
da empresa, embaixadores&#x2F;contribuidores do Fedora, e entusiastas que
estavam lá pra conhecer melhor e ver qual era a do evento. Certamente
foi uma tarde&#x2F;noite proveitosa em termos de contatos pessoais!&lt;&#x2F;p&gt;
&lt;h2 id=&quot;palestras&quot;&gt;Palestras&lt;&#x2F;h2&gt;
&lt;p&gt;Depois de um atraso no início do evento, o Leo começou apresentando uma
palestra sobre o projeto Fedora (e seus sub-projetos, como o de
embaixadores, por exemplo). Mesmo com boa parte (senão todos!) dos
presentes já fazendo parte do projeto de algum jeito, ainda assim a
palestra foi um momento legal pra que algumas discussões e reflexões
acontecessem. Considero que a maior parte da &quot;nata&quot; da comunidade estava
naquela sala (com óbvias exceções como o Fábio Olivé, o Amador Pahim, e
outras pessoas cujos nomes não vou ficar citando porque estou com
preguiça de pensar em todos!). Portanto, acho que o plano do Leo (que é
o de revitalizar a comunidade Fedora no Brasil, principalmente a de
embaixadores) começou com os dois pés direitos (se é que isso é
possível!).&lt;&#x2F;p&gt;
&lt;p&gt;A idéia inicial era de que cada palestra durasse 1 hora, mas é claro que
com tanto assunto pra tratar a palestra do Leo durou muito mais que
isso! No fim das contas, quando a palestra terminou já era hora do
almoço :-). Como não poderia deixar de ser, o papo continou na cozinha,
e foi lá que pude conhecer melhor o pessoal que estava presente. Foi bem
legal :-).&lt;&#x2F;p&gt;
&lt;p&gt;Bem, com a bateria carregada, era hora do segundo ciclo de palestras! O
Leo pediu pra que eu apresentasse um pouco da minha experiência com o
&lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;www.gnu.org&#x2F;s&#x2F;gdb&quot;&gt;GDB&lt;&#x2F;a&gt;, tanto na parte de lidar com a
comunidade upstream, quanto na hora de focar no desenvolvimento de
funcionalidades para o Fedora (ou para o Red Hat Enterprise
(GNU&#x2F;)Linux). Eu não tinha preparado nenhum slide, e fui com a cara (de
pau) e a coragem tentar bater um papo com a galera ;-). Aqui está uma
foto na hora da palestra (reparem na pose, no garbo e na elegância do
palestrante):&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;&#x2F;images&#x2F;sergio-fad-2013.jpg&quot; alt=&quot;Apresentação do GDB&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Acho que consegui passar uma idéia de como é o meu dia-a-dia trabalhando
com o GDB e navegando entre os mares upstream e empresarial. Algumas
pessoas fizeram algumas perguntas (o Maurício Teixeira inclusive fez
perguntas técnicas!), e felizmente minha palestra durou bem menos do que
a do Leo! Eu certamente não tinha tanto assunto pra tratar :-P.&lt;&#x2F;p&gt;
&lt;p&gt;A última atividade do dia foi um &lt;em&gt;hands-on&lt;&#x2F;em&gt; que o Itamar fez sobre
empacotamento RPM. Foi legal, e acho que deu pro pessoal ter uma noção
de que empacotar pro Fedora não é um bicho de sete cabeças. Inclusive,
se você estiver interessado em saber mais, sugiro que dê uma olhada na
&lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;fedoraproject.org&#x2F;wiki&#x2F;How_to_create_an_RPM_package&quot;&gt;página wiki que ensina o básico
disso&lt;&#x2F;a&gt;, e
não se sinta envergonhado de enviar suas dúvidas pras listas de
desenvolvimento do Fedora!&lt;&#x2F;p&gt;
&lt;p&gt;Após esse &lt;em&gt;how-to&lt;&#x2F;em&gt; ao vivo, e levando em conta o horário avançado (mais
de 19h) e o cansaço do pessoal, decidimos finalizar o evento. Na
verdade, ainda ficamos discutindo bastante sobre vários pontos
importantes da comunidade, os problemas vivenciados (sim, existem
problemas, a não ser que você viva num mundo encantado ou não se envolva
o suficiente pra notá-los, mas aí é só pedir pra alguém traduzir o que
está acontecendo e talvez você entenda), e as possíveis soluções. Acabei
saindo de Sampa quase 20h30min, mas achei que valeu muito a pena ter
ido!&lt;&#x2F;p&gt;
&lt;h2 id=&quot;conclusoes&quot;&gt;Conclusões&lt;&#x2F;h2&gt;
&lt;p&gt;A conclusão pessoal é que eu estava mesmo precisando ir a eventos e
conhecer pessoas novas! Acho isso muito legal, é um combustível pra
fazer mais coisas e ter mais idéias.&lt;&#x2F;p&gt;
&lt;p&gt;A conclusão na parte da comunidade é a de que o Leo vai conseguindo aos
poucos mudar a mentalidade do Fedora Brasil. Não me arrependo de ter
dado um tempo no sub-projeto de embaixadores, e estou achando muito
legal ver as ações do Leo &amp;amp; cia. para mudar as coisas. Têm meu total
apoio!&lt;&#x2F;p&gt;
&lt;h2 id=&quot;agradecimentos&quot;&gt;Agradecimentos&lt;&#x2F;h2&gt;
&lt;p&gt;Esse evento certamente não teria acontecido sem o incansável Leonardo
Vaz. Ele merece todos os agradecimentos e toda a admiração da comunidade
(inter)nacional do Fedora por isso, sem dúvida. Se você estiver lendo
este post, tiver alguma relação com o Fedora, e for ao FISL este ano,
pague uma cerveja (ou suco!) a ele, porque ele merece.&lt;&#x2F;p&gt;
&lt;p&gt;Também queria agradecer ao pessoal que foi ao evento. É sempre bom ver
gente que se preocupa de verdade em melhorar algo, que não fecha os
olhos para os problemas que estão acontecendo, e principalmente que se
dispõe a aprender algo novo. Foi gratificante ter conhecido pessoas como
o Germán, um astrofísico argentino que mantém dois pacotes em Python no
Fedora sem querer nada em troca! Ou tipo o Hugo Cisneiros, envolvido no
mundo GNU&#x2F;Linux há tanto tempo quanto aquele cabelo dele levou pra
crescer :-P.&lt;&#x2F;p&gt;
&lt;p&gt;E vida longa ao Software Livre!&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>GDB and SystemTap integration improving linker-debugger interface</title>
        <published>2013-05-28T00:00:00-05:00</published>
        <updated>2013-05-28T00:00:00-05:00</updated>
        
        <author>
          <name>
            
              Sergio Durigan Junior
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://blog.sergiodj.net/posts/gdb-stap-linker-debugger/"/>
        <id>https://blog.sergiodj.net/posts/gdb-stap-linker-debugger/</id>
        
        <content type="html" xml:base="https://blog.sergiodj.net/posts/gdb-stap-linker-debugger/">&lt;p&gt;It is really nice to see something you did in a project influence in
future features and developments. I always feel happy and proud when I
notice such scenarios happening, and this time was no different. &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;gbenson.net&#x2F;&quot;&gt;Gary
Benson&lt;&#x2F;a&gt;, a colleague at Red Hat who works in the
GDB team as well, has implemented a way of improving the interface
between the linker and the debugger, and one of the things he used to
achieve this is the GDB &amp;lt;-&amp;gt; SystemTap integration that I
implemented with &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;tromey.com&#x2F;&quot;&gt;Tom Tromey&lt;&#x2F;a&gt; 2 years ago. Neat!&lt;&#x2F;p&gt;
&lt;h2 id=&quot;the-problem&quot;&gt;The problem&lt;&#x2F;h2&gt;
&lt;p&gt;You can read a detailed description of the problem in &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;sourceware.org&#x2F;ml&#x2F;gdb-patches&#x2F;2013-05&#x2F;msg00624.html&quot;&gt;the message Gary
sent to the gdb-patches mailing
list&lt;&#x2F;a&gt;, but
to summarize: GDB needs to interface with the linker in order to
identify which shared libraries were loaded during the inferior&#x27;s (i.e.,
program being debugged) life.&lt;&#x2F;p&gt;
&lt;p&gt;Nowadays, what GDB does is to put a breakpoint in &lt;code&gt;_dl_debug_state&lt;&#x2F;code&gt;,
which is an empty function called by the linker every time a shared
library is loaded (the linker calls it twice, once before modifying the
list of loaded shlibs, and once after). But GDB has no way to know what
has changed in the list of loaded shlibs, and therefore it needs to load
the entire list every time something happens. You can imagine how bad
this is for performance...&lt;&#x2F;p&gt;
&lt;h2 id=&quot;the-solution&quot;&gt;The solution&lt;&#x2F;h2&gt;
&lt;p&gt;What Gary did was to put SDT probes strategically on the linker, so that
GDB could make use of them when examining for changes in the list of
loaded shlibs. It improves performance a lot, because now GDB doesn&#x27;t
need to stop twice every time a shlib is loaded (it just needs to do
that when &lt;code&gt;stop-on-solib-events&lt;&#x2F;code&gt; is set); it just needs to stop at the
right probe, which will inform the address of the link-map entry of the
first newly added library. It means GDB also won&#x27;t need to walk through
the list of shlibs and identify what has changed: you get that for free
by examining the probe&#x27;s argument.&lt;&#x2F;p&gt;
&lt;p&gt;Gary also mentions a discrepancy that happened on Solaris libc, which
has also been solved by his patch.&lt;&#x2F;p&gt;
&lt;p&gt;And now, the most impressing thing: the numbers! Take a look at this
table, which displays the huge improvement in the performance when using
lots of shlibs (the time is in &lt;em&gt;seconds&lt;&#x2F;em&gt;):&lt;&#x2F;p&gt;
&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Number of shlibs&lt;&#x2F;th&gt;&lt;th&gt;128&lt;&#x2F;th&gt;&lt;th&gt;256&lt;&#x2F;th&gt;&lt;th&gt;512&lt;&#x2F;th&gt;&lt;th&gt;1024&lt;&#x2F;th&gt;&lt;th&gt;2048&lt;&#x2F;th&gt;&lt;th&gt;4096&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;Old interface&lt;&#x2F;td&gt;&lt;td&gt;&amp;gt; 0&lt;&#x2F;td&gt;&lt;td&gt;&amp;gt; 1&lt;&#x2F;td&gt;&lt;td&gt;&amp;gt; 4&lt;&#x2F;td&gt;&lt;td&gt;&amp;gt; 12&lt;&#x2F;td&gt;&lt;td&gt;&amp;gt; 47&lt;&#x2F;td&gt;&lt;td&gt;&amp;gt; 185&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;New interface&lt;&#x2F;td&gt;&lt;td&gt;&amp;gt; 0&lt;&#x2F;td&gt;&lt;td&gt;&amp;gt; 0&lt;&#x2F;td&gt;&lt;td&gt;&amp;gt; 2&lt;&#x2F;td&gt;&lt;td&gt;&amp;gt; 4&lt;&#x2F;td&gt;&lt;td&gt;&amp;gt; 10&lt;&#x2F;td&gt;&lt;td&gt;&amp;gt; 36&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;
&lt;p&gt;Impressive, isn&#x27;t it?&lt;&#x2F;p&gt;
&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;&#x2F;h2&gt;
&lt;p&gt;This is one the things I like most in Free Software projects: the
possibility of extending and improving things by using what others did
before. When I hacked GDB to implement the integration between itself
and SystemTap, I had absolutely no idea that this could be used for
improving the interface between the linker and the debugger (though I am
almost sure that Tom was already thinking ahead!). And I can say it is a
pleasure and I feel proud when I see such things happening. It just
makes me feel more and more certain that Free Software is the way to go
:-).&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>So long, Ambassadors...</title>
        <published>2013-05-16T00:00:00-05:00</published>
        <updated>2013-05-16T00:00:00-05:00</updated>
        
        <author>
          <name>
            
              Sergio Durigan Junior
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://blog.sergiodj.net/posts/so-long-ambassadors/"/>
        <id>https://blog.sergiodj.net/posts/so-long-ambassadors/</id>
        
        <content type="html" xml:base="https://blog.sergiodj.net/posts/so-long-ambassadors/">&lt;p&gt;No, I am &lt;strong&gt;not leaving the Fedora Project&lt;&#x2F;strong&gt;, I am just leaving (or
taking a break, depending on how you look) its
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;fedoraproject.org&#x2F;wiki&#x2F;Ambassadors&quot;&gt;Ambassadors&lt;&#x2F;a&gt; program. I am
still the co-maintainer of the &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;www.gnu.org&#x2F;s&#x2F;gdb&quot;&gt;GDB&lt;&#x2F;a&gt; package,
and will contribute to the development of the distribution since it is
also my job. However, after a few months trying to become more involved
with the Fedora community (specifically with the Brazilian&#x2F;LATAM
community), I became so disappointed that the only logical action for me
now is to step back.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;my-brief-history&quot;&gt;My brief history&lt;&#x2F;h2&gt;
&lt;p&gt;I joined the Ambassadors program on October, 2012. After having used the
system heavily for almost 3 years, I decided that it was about time to
pay something back to the community too. Since I live in Brazil, I
joined the the brazilian team of Ambassadors (which meant that I was
also part of the Latin America team). Thanks to my friend Leonardo Vaz
(from Red Hat), I talked to Daniel Bruno who then became responsible for
&quot;mentoring&quot; me.&lt;&#x2F;p&gt;
&lt;p&gt;The brazilian community was (and still is) very inactive (compared to
others, and to itself a few years ago), but I was very excited and
decided to try to revive it. And the first task that I assigned myself
was to regain control of the &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;www.projetofedora.org&quot;&gt;brazilian&lt;&#x2F;a&gt;
and &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;www.proyectofedora.org&quot;&gt;LATAM&lt;&#x2F;a&gt; domains.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;the-domains&quot;&gt;The domains&lt;&#x2F;h2&gt;
&lt;p&gt;Alejandro Perez, a very nice guy from Panamá responsible for LATAM&#x27;s
money, asked me to talk to Rodrigo Padula, an inactive Fedora Ambassador
from Brazil, about the domains. Padula was a very active member of the
brazilian community since 2006 if I&#x27;m not mistaken, but due to reasons
beyond my knowledge is inactive in the Fedora community for quite some
time now (he&#x27;s still very active in the Mozilla community, however). And
he owns both domains.&lt;&#x2F;p&gt;
&lt;p&gt;Alejandro was worried because the LATAM domain had suffered some sort of
outage during some days, which is obviously bad for the project. He was
also concerned (and I totally agreed with him on this) because those
domains shouldn&#x27;t be owned by a person (rather, it should be registered
on behalf of the Fedora Project or, ultimately, Red Hat), specially if
this person is now inactive.&lt;&#x2F;p&gt;
&lt;p&gt;To make a long story short, I spent more than 1 month doing the
indirection and talking to both guys about this issue. Padula initially
said he could transfer the domains without problem, but then changed his
mind and said he wouldn&#x27;t do it. On the other side, Alejandro was
getting upset because Padula did not want to make the transfer, and the
LATAM community was pressuring him. In the end, I totally gave up, and
the LATAM guys registered &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;fedora-latam.org&#x2F;&quot;&gt;yet another
domain&lt;&#x2F;a&gt;, but right now are still using the old
domain. Yes, a mess.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;working-with-latam&quot;&gt;Working with LATAM&lt;&#x2F;h2&gt;
&lt;p&gt;Anyway, after this episode, and after witnessing how active the LATAM
community was in contrast with the brazilian community, I decided to
work directly with them. I wanted to do something, and I was eager to
start working as a real ambassador, spreading the word about Fedora
everywhere. And my friends from Panamá, Argentina, México, Venezuela,
etc., seemed the right people to work with.&lt;&#x2F;p&gt;
&lt;p&gt;So I started attending the weekly meetings on &lt;code&gt;#fedora-latam&lt;&#x2F;code&gt;, at
Freenode, every Wednesday night. It is a well-organized meeting (run by
Alejandro), whose main goal is to vote tickets from LATAM ambassadors
(including brazilians). Tickets are basically requests made through a
&lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Trac&quot;&gt;Trac&lt;&#x2F;a&gt;
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;fedorahosted.org&#x2F;fedora-latam&#x2F;&quot;&gt;instance&lt;&#x2F;a&gt;, and are used to ask
for swags, media, sponsorship for travels, etc. The Fedora Project has a
budget, and the LATAM region gets a fraction of this budget for annual
expenses, so our job as ambassadors was to vote those tickets and decide
whether they deserve to be approved or not, according to &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;fedoraproject.org&#x2F;wiki&#x2F;Ambassadors&#x2F;LATAM&#x2F;Reimbursement&quot;&gt;some rules
inside the
project&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Keep in mind: &lt;strong&gt;we are dealing with money here&lt;&#x2F;strong&gt;. It&#x27;s not yours nor
mine, but it&#x27;s still money that should be used to promote a project that
embraces open source initiatives (unfortunately, I cannot say Fedora is
Free Software, but that is a topic for another post).&lt;&#x2F;p&gt;
&lt;p&gt;So, after some weeks working with the LATAM guys, I became the default
owner of Trac tickets from brazilian ambassadors. And a few more weeks
down the road Alejandro asked me to produce media (Fedora DVDs) and be
resposible for distributing them in Brazil. I spent a lot of time
ordering the medias (I had to travel to São Paulo in order to make sure
everything was OK), and every time an ambassador requests Fedora DVDs I
go through a &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;fedoraproject.org&#x2F;wiki&#x2F;Pt_BR&#x2F;Requisi%C3%A7%C3%A3o_M%C3%ADdia_2013_F18&quot;&gt;series of
steps&lt;&#x2F;a&gt;
(link in pt_br, portugues) to guarantee that she gets her media and I get my
reimbursement.&lt;&#x2F;p&gt;
&lt;p&gt;I also like to give talks and presentations about the project, and so
I&#x27;ve attended some events (or organized them) just to be able to do
that. I have posted some reports about them in this blog, you can find
them in the archives (if you can read in pt_BR).&lt;&#x2F;p&gt;
&lt;p&gt;So, enough of self-promotion: why I am leaving the ambassador&#x27;s program
after all?&lt;&#x2F;p&gt;
&lt;h2 id=&quot;disappointment&quot;&gt;Disappointment&lt;&#x2F;h2&gt;
&lt;p&gt;A few things started to happen:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;During the weekly LATAM meetings, it bothered me to see that the
tickets were being approved without any kind of serious discussion.
Everyone (including myself!) was just giving &quot;+1&quot; to everything!&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;fisl.org.br&quot;&gt;FISL&lt;&#x2F;a&gt;, the biggest open source (no, &lt;strong&gt;it is not
about Free Software&lt;&#x2F;strong&gt;!!) event in LATAM, is going to happen on July.
Suddenly, new brazilian ambassadors were popping out of nowhere, and
inactive ambassadors were pretending to do something.&lt;&#x2F;li&gt;
&lt;li&gt;As a consequence, we received 9 sponsorship requests in our Trac.
Some from active people, some not.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Something that I should have noticed before became crystal clear to me:
some people are there just to take advantages for their own. They are
not interested in the project, in the philosophy (yes, you can laugh at
my face now...), in the promotion of the ideals, etc. They just want
free lunch. And they get it...&lt;&#x2F;p&gt;
&lt;p&gt;During the last meeting I attended, two weeks ago, we were going to vote
the FISL tickets. A few days before the meeting, I sent the following
message to the LATAM Ambassadors list:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;Hi there,&lt;&#x2F;p&gt;
&lt;p&gt;This message is just to let you know that we will be discussing
several FISL tickets in our next meeting, May 8th. You can take a look
at the meeting agenda by going to:&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;fedorahosted.org&#x2F;fedora-latam&#x2F;report&#x2F;9&quot;&gt;https:&#x2F;&#x2F;fedorahosted.org&#x2F;fedora-latam&#x2F;report&#x2F;9&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;I would like to ask everyone to read the requests and make your
decision based on &lt;em&gt;merits&lt;&#x2F;em&gt;, please. In my opinion, only active
ambassadors should receive the honor of being sponsored by Fedora to
go to FISL14. Let&#x27;s not spend money unnecessarily, so try to avoid the
&quot;+1&quot; wave when voting for the tickets.&lt;&#x2F;p&gt;
&lt;p&gt;Thanks a lot,&lt;&#x2F;p&gt;
&lt;p&gt;--Sergio.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;As I said, some tickets were filed by inactive ambassadors, and I wanted
us to at least discuss the matter with him&#x2F;her, showing that we were not
happy with his&#x2F;her conduct. It is one thing when you have personal
problems and have to step away from the project for a while; it is
another different thing when you disappear without saying a word and
then comes back to request sponsorship for travel.&lt;&#x2F;p&gt;
&lt;p&gt;We began the meeting by discussing tickets filed by active members, and
approving them without thinking much about it. However, eventually we
got to the problematic ones. There is this specific guy, whose name I
will not mention here, who was very absent since I started in the
project, and I felt the need to point that out. I told him I hadn&#x27;t seen
him in quite a while, and explained that there were many ambassadors
doing things for Fedora. He&#x27;s a long term contributor to the project, as
he himself told me in a not-so-friendly tone during the meeting. But
that was not the subject of the discussion, and while he kept saying how
hard he worked for the project in the last 5 years, or how much he&#x27;s
done for this or that, I remained silent and began to think: &lt;em&gt;what the
hell am I doing? Why am I wasting my time in a Wednesday night to
convince a group that someone maybe doesn&#x27;t deserve the credit he&#x27;s
asking for?&lt;&#x2F;em&gt; Well, the only reasonable answer was: &lt;em&gt;because I feel it is
the right thing to do.&lt;&#x2F;em&gt; But nobody said a word during this discussion,
and I started to feel something else. I felt that people were &lt;strong&gt;not
interested&lt;&#x2F;strong&gt; in evaluating how much this guy (or anybody else, for that
matter) really did for the project! And the feeling was corroborated
when someone else said: &quot;&lt;em&gt;Hey, let&#x27;s just approve the ticket now, we can
continue the discussion later&lt;&#x2F;em&gt;&quot;. &lt;em&gt;&lt;strong&gt;WHAT????&lt;&#x2F;strong&gt;&lt;&#x2F;em&gt;. Let me see if I get it:
we are here to discuss, reach a consensus, and vote. You want to
approve, maybe discuss, fuck the consensus. Well...&lt;&#x2F;p&gt;
&lt;p&gt;I left before the end of the meeting, but I still managed to see this
behaviour explained by some people: there was enough money to approve
all tickets, so the meeting was just a formality needed to explain the
expenses later. I was at least fully convinced that I did not belong
there.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;not-my-place&quot;&gt;Not my place&lt;&#x2F;h2&gt;
&lt;p&gt;If you are part of a team and you disagree with its members, I believe
you have two choices most of the time: you can either (a) discuss with
them, try to understand their reasons for being different, try to
explain yours, see what you can do to overcome this, or (b) leave it.
Sometimes I choose one, sometimes another. This is the time for (b). I
don&#x27;t want to spend more time and energy into something that doesn&#x27;t
work the way I think it should. I don&#x27;t feel motivated to fight against
the tide, because I am not so strong and the tide keeps getting bigger
and bigger. And I also don&#x27;t want to stop people from doing what they
think is right, honestly. In the end of the day, I still want to believe
that everyone has a conscience and knows what&#x27;s correct...&lt;&#x2F;p&gt;
&lt;p&gt;But I am not going to cross my arms and sit. Some friends and I decided
to create our own group, called &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;libreplanet.org&#x2F;wiki&#x2F;LP-BR-SP&quot;&gt;LibrePlanet São
Paulo&lt;&#x2F;a&gt; (link in pt_br, portugues), and focus
on the real important thing: &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;www.gnu.org&#x2F;philosophy&#x2F;free-sw.html&quot;&gt;Free
Software&lt;&#x2F;a&gt;. I really hope we
can make a difference with our local community, and we have started with
the right foot already: we organized the Document Freedom Day in our
city this year!&lt;&#x2F;p&gt;
&lt;p&gt;As for Fedora, as I said, I still intend to continue contributing to it.
I&#x27;m still subscribed to the fedora-devel mailing list, and I still
follow the project&#x27;s decisions, partly because it is part of my job,
partly because I strongly believe you have to give back what you take
for free -- as in freedom -- from the community. I also have some DVDs
and I intend to distribute them. But my time as a Fedora Ambassador is
coming to an end. It was a good experience, I met good people, had a
great time doing talks and presentations, and most of all, did what I
felt right at the right time.&lt;&#x2F;p&gt;
&lt;p&gt;So, as Douglas Adams said, &quot;...thanks for all the fish!&quot;.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Document Freedom Day 2013 in Campinas -- São Paulo -- Brazil</title>
        <published>2013-04-12T00:00:00-05:00</published>
        <updated>2013-04-12T00:00:00-05:00</updated>
        
        <author>
          <name>
            
              Sergio Durigan Junior
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://blog.sergiodj.net/posts/dfd-2013-campinas/"/>
        <id>https://blog.sergiodj.net/posts/dfd-2013-campinas/</id>
        
        <content type="html" xml:base="https://blog.sergiodj.net/posts/dfd-2013-campinas/">&lt;p&gt;Hi, there! This is the report of the &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;documentfreedom.org&quot;&gt;Document Freedom
Day&lt;&#x2F;a&gt; event that took place in
&lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Campinas&quot;&gt;Campinas&lt;&#x2F;a&gt;, &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;S%C3%A3o_Paulo_(state)&quot;&gt;São Paulo
state&lt;&#x2F;a&gt;,
&lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Brazil&quot;&gt;Brazil&lt;&#x2F;a&gt;. I will talk a little bit
about how we (keep reading to know who &quot;we&quot; are!) organized it, and the
conclusions that can be drawn to help for the next edition.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;organization&quot;&gt;Organization&lt;&#x2F;h2&gt;
&lt;p&gt;The DFD (or &lt;em&gt;D&lt;&#x2F;em&gt;ocument &lt;em&gt;F&lt;&#x2F;em&gt;reedom &lt;em&gt;D&lt;&#x2F;em&gt;ay) 2013 in Campinas was organized
by the &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;libreplanet.org&#x2F;wiki&#x2F;Group:LibrePlanet_S%C3%A3o_Paulo&quot;&gt;LibrePlanet São
Paulo&lt;&#x2F;a&gt; (link in
pt_BR) group. If you follow this blog, and if you speak portuguese,
then you have probably read the &lt;a href=&quot;https:&#x2F;&#x2F;blog.sergiodj.net&#x2F;posts&#x2F;dfd-2013-campinas&#x2F;%7Bfilename%7D&#x2F;2012-12-15-criacao-libreplanet-sao-paulo.md&quot;&gt;announcement of the group&lt;&#x2F;a&gt; that I made last
year. If you haven&#x27;t: LibrePlanet São Paulo is part of the
&lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;libreplanet.org&#x2F;wiki&#x2F;Main_Page&quot;&gt;LibrePlanet&lt;&#x2F;a&gt; project (sponsored
by the &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;www.fsf.org&#x2F;&quot;&gt;Free Software Foundation&lt;&#x2F;a&gt;), and &lt;em&gt;&quot;... is a
global network of free software activists and teams working together to
help further the ideals of software freedom by advocating and
contributing to free software.&quot;&lt;&#x2F;em&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;The DFD 2013 was an important event to us because it was the first
serious event that we organized as a group. Despite some mistakes and
errors, I believe we did fine and were able to learn some great
lessons for the next events that we plan to do. By the way, if you
want to see the official page which we used to promote the event (and
organize it too), take a
look
&lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;libreplanet.org&#x2F;wiki&#x2F;LP-BR-SP&#x2F;Eventos&#x2F;DFD_Campinas_2013&quot;&gt;here&lt;&#x2F;a&gt;.
The page is in pt_br, portugues.&lt;&#x2F;p&gt;
&lt;p&gt;Basically, we should have: &lt;em&gt;(a)&lt;&#x2F;em&gt; focused more on defining the venue as
soon as possible, because that would have made it possible to &lt;em&gt;(b)&lt;&#x2F;em&gt;
start sending announcements about the event earlier. We also should have
contacted the Document Freedom organization and asked swags and banners
earlier, because when we did it was too late for the shipment to arrive
in time. And last but not least, we should really have taken pictures!!
Unfortunately, I have absolutely no pictures to post here, so you will
have to believe just in the words I write...&lt;&#x2F;p&gt;
&lt;p&gt;But well, nothing is perfect, and hey, the event &lt;strong&gt;happened&lt;&#x2F;strong&gt;!. So let&#x27;s
talk it :-).&lt;&#x2F;p&gt;
&lt;h2 id=&quot;the-event&quot;&gt;The Event&lt;&#x2F;h2&gt;
&lt;p&gt;DFD 2013 occurred on Wednesday, March 27th. After some discussion, we
decided to schedule the event from 13h (1 p.m.) to 17h (5 p.m.), with 4
presentations of 50 minutes each, approximately. The venue chosen was
&lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;www.ccuec.unicamp.br&#x2F;ccuec&#x2F;&quot;&gt;CCUEC&lt;&#x2F;a&gt;, the Center of Computing at
the University of Campinas, &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;www.unicamp.br&#x2F;unicamp&#x2F;&quot;&gt;UNICAMP&lt;&#x2F;a&gt;.
This center has some great people working on it who are involved with
Free Software since the beginning of the movement, particularly &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;dicas-l.com.br&#x2F;&quot;&gt;Rubens
Queiroz de Almeida&lt;&#x2F;a&gt;, a very nice guy (very
famous in the Brazilian Free Software scene) who helped us &lt;strong&gt;a lot&lt;&#x2F;strong&gt;
with the organization of this event.&lt;&#x2F;p&gt;
&lt;p&gt;We understand that doing the event on a Wednesday afternoon was
something that made it very hard for most people to attend, and that is
probably the main reason for the low attendance: only 8 people in the
audience. I have to say I was a little frustrated in the beginning, but
hey, what really matters is that we spread the word about Free Software
to 8 brave souls there, who will hopefully spread the word again to more
people, and so on :-). So, it was time for the show to begin!&lt;&#x2F;p&gt;
&lt;p&gt;Our schedule was (presentation titles translated):&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;&quot;&lt;strong&gt;What is Free Software?&lt;&#x2F;strong&gt;&quot;, by me&lt;&#x2F;li&gt;
&lt;li&gt;&quot;&lt;strong&gt;Free Documents or the End of the World&lt;&#x2F;strong&gt;&quot;, by Rubens Queiroz de
Almeida&lt;&#x2F;li&gt;
&lt;li&gt;&quot;&lt;strong&gt;HTML5: all the faces of the new standard&lt;&#x2F;strong&gt;&quot;, by Ricardo
Panaggio&lt;&#x2F;li&gt;
&lt;li&gt;&quot;&lt;strong&gt;EPUB3: The book in the XXI century&lt;&#x2F;strong&gt;&quot;, by Raniere Silva&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;So my presentation was scheduled to be the first one, and I really liked
it (surprise!). It was virtually the first time I gave a &quot;philosophical&quot;
talk, and a very important one: a general presentation about Free
Software, its history, the present, and a little bit of the future. In
my opinion, what I liked about my talk is that I focused less on the
&quot;freedom&quot; part, and more on the &quot;respect&quot; part of the philosophy. This
is something I did because I wanted to use a different argument that was
on my head for a long time: that the main thing behing the Free Software
is the respect towards others, and only with that one can achieve
freedom.&lt;&#x2F;p&gt;
&lt;p&gt;I watched Rubens too, who gave an excelent presentation about why we
need free documents and standards. Rubens is very talkative and warm,
which makes the audience feel relaxed. People liked his presentation a
lot, from what I noticed.&lt;&#x2F;p&gt;
&lt;p&gt;Unfortunately, Ricardo Panaggio had a problem with his computer before
his presentation, so we decided to switch: Raniere Silva would take his
place as the third presenter, while Ricardo tried to fix the problem. I
helped him with his problems, and because of this I was unable to watch
Raniere&#x27;s talk. In the end, we could not solve Ricardo&#x27;s problem and he
decided to give his presentation without any slides. In my opinion, he
managed to catch everyone&#x27;s attention (also because HTML5 is such a hot
topic today), so I guess the missing slides were not so important after
all!&lt;&#x2F;p&gt;
&lt;p&gt;At 17h o&#x27;clock, we declared DFD 2013 finished. I still had time to
distribute some Free Software stickers (from FSF), and talk a little
with two or three people there, who were satisfied with the
presentations! It made my day, of course :-). And just because of that I
now feel motivated to organized another DFD next year!&lt;&#x2F;p&gt;
&lt;h2 id=&quot;acknowledgements&quot;&gt;Acknowledgements&lt;&#x2F;h2&gt;
&lt;p&gt;I would like to thank Rubens Queiroz for helping with the promotion, the
location, and the presentation during the event. DFD 2013 would have
been impossible without his help. Thanks, Rubens!&lt;&#x2F;p&gt;
&lt;p&gt;The LibrePlanet São Paulo team, specially Ricardo Panaggio, were also
deeply involved with me in the organization. And I hope we manage to
make a bigger event next year!&lt;&#x2F;p&gt;
&lt;p&gt;Finally, I would like to thank everyone who attended the event, even for
watch only one talk. Your presence there was really, &lt;strong&gt;really&lt;&#x2F;strong&gt;
important to all of us. See you all next year!&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Relato dos Install Fests na UNESP de Rio Claro&#x2F;SP e na UNICAMP&#x2F;SP</title>
        <published>2013-04-01T00:00:00-05:00</published>
        <updated>2013-04-01T00:00:00-05:00</updated>
        
        <author>
          <name>
            
              Sergio Durigan Junior
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://blog.sergiodj.net/posts/relato-installfest-unesp-unicamp/"/>
        <id>https://blog.sergiodj.net/posts/relato-installfest-unesp-unicamp/</id>
        
        <content type="html" xml:base="https://blog.sergiodj.net/posts/relato-installfest-unesp-unicamp/">&lt;p&gt;E... Aqui estamos (estou?) com mais um relato sobre duas atividades
envolvendo o &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;fedoraproject.org&#x2F;pt_br&#x2F;&quot;&gt;Projeto Fedora&lt;&#x2F;a&gt;! Ele
contempla, respectivamente, os Install Fests ocorridos na &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;www.rc.unesp.br&#x2F;&quot;&gt;UNESP de Rio
Claro&#x2F;SP&lt;&#x2F;a&gt; e na
&lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;www.unicamp.br&quot;&gt;UNICAMP&lt;&#x2F;a&gt;. Foram atividades que envolveram
diversas pessoas, tiveram vitórias e derrotas, alegrias e tristezas, mas
acima de tudo um sentimento de impotência (principalmente no Install
Fest ocorrido na UNICAMP) em relação às novas &quot;tecnologias&quot; de boot,
principalemente ao &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Unified_Extensible_Firmware_Interface#Secure_boot&quot;&gt;Secure
Boot&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;install-fest-missao-unesp-de-rio-claro-sp&quot;&gt;Install Fest: missão UNESP de Rio Claro&#x2F;SP&lt;&#x2F;h2&gt;
&lt;p&gt;Este foi o Install Fest mais tranquilo. Ele começou a ser organizado
logo depois da
minha
&lt;a href=&quot;https:&#x2F;&#x2F;blog.sergiodj.net&#x2F;posts&#x2F;relato-installfest-unesp-unicamp&#x2F;%7Bfilename%7D&#x2F;2012-10-24-relato-apresentacao-fedora-unesp-rio-claro.md&quot;&gt;participação na Semana da Computação da UNESP de Rio Claro&lt;&#x2F;a&gt;,
e a intenção inicial era realizá-lo no dia da matrícula dos alunos
ingressantes na Universidade. No final das contas, decidimos postergar
a data, e isso foi uma boa escolha.&lt;&#x2F;p&gt;
&lt;p&gt;O Install Fest aconteceu no dia 06 de março de 2013, em um auditório da
Biblioteca do campus, e começou com uma palestra minha sobre o Projeto
Fedora. Foi basicamente a mesma palestra que eu havia apresentado na
Semana da Computação, mas de uma maneira mais sucinta porque tínhamos
pouco tempo. Creio que a palestra foi bem recebida, porque o público
demonstrou interesse em contribuir com o Projeto Fedora depois que eu
expliquei os meios para isso :-). Além disso, apesar do número pequeno
de pessoas (aproximadamente 12 participantes), todos estavam bastante
interessados no conteúdo, o que é uma motivação extra!&lt;&#x2F;p&gt;
&lt;p&gt;Bem, após a palestra era hora de começar a instalar os sistemas. Levei
vários DVDs do Fedora, em basicamente 2 versões: LiveDVDs, que permitem
o boot e a utilização de um sistema Fedora sem a necessidade de instalar
nada na máquina, e InstallDVDs, que não oferecem a opção de
&quot;experimentar&quot; o sistema, mas já possuem todos os pacotes necessários
para fazer uma instalação completa. Expliquei a todos os presentes
algumas regras básicas de todo Install Fest: é preciso reparticionar o
disco rígido caso se queira manter o Microsoft (R) Windows (R), quem
organiza o Install Fest não pode assumir responsabilidade por nenhuma
falha na instalação (apesar de elas serem raras), e também não pode
assumir responsabilidade caso o usuário torne-se viciado no GNU&#x2F;Linux
:-). Dito isso, começamos a colocar as mãos na GNU&#x2F;massa.&lt;&#x2F;p&gt;
&lt;p&gt;O primeiro desafio (e, até então, único!) dos Install Fests recentes é
imposto pelos próprios fabricantes de notebooks. Um disco rígido que
ainda utilize &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Master_boot_record&quot;&gt;MBR&lt;&#x2F;a&gt; (a
maioria) suporta apenas 4 partições primárias. Antigamente, os
fabricantes criavam apenas uma partição para o Microsoft (R) Windows
(R), e às vezes chegavam a criar outra partição de &quot;recuperação&quot;, mas
paravam por aí. Atualmente, não é raro encontrar computadores com 4
partições primárias já criadas. Eu inclusive já cheguei a ver notebooks
com discos de 1 TB com uma partição primária de pouco mais de 1 MB! É
uma prática totalmente absurda, e a meu ver é feita com má-fé, visando
dificultar a instalação de outros sistemas operacionais. Além disso, pra
piorar ainda mais, alguns fabricantes (HP me vem à cabeça, mas existem
outros) dão um jeito de &lt;strong&gt;invalidar&lt;&#x2F;strong&gt; a garantia caso o esquema de
particionamento seja alterado!!!&lt;&#x2F;p&gt;
&lt;p&gt;Felizmente, vários computadores no Install Fest possuíam apenas 3
partições (ou até menos!), e aqueles que possuíam 4 partições ou usavam
um outro &lt;em&gt;boot sector&lt;&#x2F;em&gt; (chamado
&lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;GUID_Partition_Table&quot;&gt;GPT&lt;&#x2F;a&gt;), ou já estavam
fora da garantia do fabricante e podiam ter seus esquemas de
particionamento alterados. O próprio Microsoft (R) Windows (R), a partir
da versão 7 (se não me engano), oferece uma ferramenta específica para
redimensionar e reparticionar o disco, portanto essa primeira etapa foi
concluída com sucesso em todas as máquinas (por favor, se você
participou do Install Fest e se lembra de alguma máquina na qual não foi
possível efetuar o reparticionamento, por favor contate-me
&amp;lt;about&amp;gt; para que eu corrija o post!).&lt;&#x2F;p&gt;
&lt;p&gt;Depois de reparticionar, era hora de começar a instalação. Quase todos
preferiram utilizar o InstallDVD, porque a instalação pela internet iria
demorar muito. Após o boot, deparamo-nos com a interface do instalador
do Fedora 18. Depois de ter lido diversas críticas sobre ele, pude
finalmente confirmar que, infelizmente, quase todas condizem. Confesso
que fiquei confuso no início, principalmente na tela de particionamento
e seleção de disco, que não é nem um pouco intuitiva. Sei que o
instalador foi reescrito, e que ele foi um dos principais motivos do
atraso no lançamento do Fedora 18, então espero muito que as melhorias
para o Fedora 19 contemplem, principalmente, essa parte de interface com
o usuário. Após apanhar um pouco, acabei me acostumando com ele e as
outras instalações foram mais tranquilas.&lt;&#x2F;p&gt;
&lt;p&gt;Conforme as instalações foram acabando, os sistemas começaram a ser
configurados. Se minha memória não falha, todos optaram por instalar o
GNOME 3, que é o desktop padrão do Fedora 18. Eu particularmente não
gosto dele, e também tive algumas dificuldades (principalmente ao tentar
encontrar modos de alterar opções mais avançadas), mas algumas pessoas
gostaram do visual.&lt;&#x2F;p&gt;
&lt;p&gt;No final, esqueci de contar quantas máquinas foram instaladas, mas creio
que chegamos perto de 11. Todas as instalações foram bem sucedidas, até
onde minha memória alcança :-). E novamente eu fiquei bastante
satisfeito com minha ida à UNESP de Rio Claro!&lt;&#x2F;p&gt;
&lt;p&gt;Entretanto, nuvens negras estavam se aproximando, e minha alegria
duraria pouco...&lt;&#x2F;p&gt;
&lt;h2 id=&quot;install-fest-missao-unicamp&quot;&gt;Install Fest: missão UNICAMP&lt;&#x2F;h2&gt;
&lt;p&gt;Há alguns anos começaram a surgir notícias sobre um novo sistema que
substituiria a &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;BIOS&quot;&gt;BIOS&lt;&#x2F;a&gt;, permitindo
muito mais flexibilidade durante o boot e inclusive adicionando camadas
de segurança que protegeriam o usuário de vírus e outras ameaças. Esse
sistema chama-se &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Uefi&quot;&gt;UEFI&lt;&#x2F;a&gt; (e uma das
tais &quot;camadas de segurança&quot; chama-se &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Unified_Extensible_Firmware_Interface#Secure_boot&quot;&gt;Secure
Boot&lt;&#x2F;a&gt;),
e no ano passado ele ganhou muita notoriedade porque a Microsoft (R)
anunciou que seu então novo sistema, o Windows (R) 8, só poderia ser
utilizado em máquinas com &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Uefi&quot;&gt;UEFI&lt;&#x2F;a&gt;.
Isso causou uma corrida dos fabricantes de computador para adaptar-se a
esse novo modelo (e ganhar o famigerado selo de compatibilidade da
Microsoft (R)), e gerou incoformismo em boa parte das comunidades
envolvidas com Software Livre e&#x2F;ou Open Source.&lt;&#x2F;p&gt;
&lt;p&gt;Resumindo, o grande problema desse novo esquema é a necessidade de uma
chave criptográfica assinada por uma autoridade certificadora para que o
sistema operacional seja iniciado. Essa é a segurança que o &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Unified_Extensible_Firmware_Interface#Secure_boot&quot;&gt;Secure
Boot&lt;&#x2F;a&gt;
provê, e o único jeito de obter uma chave assinada é... (tambores)...
pagando à Microsoft (R)!&lt;&#x2F;p&gt;
&lt;p&gt;Até onde eu sei, o Microsoft (R) Windows (R) 8 &lt;strong&gt;não funciona&lt;&#x2F;strong&gt; caso o
&lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Unified_Extensible_Firmware_Interface#Secure_boot&quot;&gt;Secure
Boot&lt;&#x2F;a&gt;
esteja desabilitado (um meio perfeitamente válido de instalar uma
distribuição GNU&#x2F;Linux que não possui a tal chave criptográfica), então
a distribuição é obrigada a compactuar com esse esquema caso queira
oferecer a opção de dual-boot ao usuário. E atualmente, as duas únicas
distribuições que oferecem isso são o Fedora e o Ubuntu.&lt;&#x2F;p&gt;
&lt;p&gt;Bem, depois dessa sucinta explicação, começa aqui meu relato sobre o que
aconteceu no Install Fest. No dia 13 de março de 2013, quarta-feira, nos
reunimos no &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;ic.unicamp.br&#x2F;&quot;&gt;Instituto de Computação&lt;&#x2F;a&gt; da UNICAMP
para realizarmos a instalação de distribuições GNU&#x2F;Linux. Novamente, eu
levei vários DVDs do Fedora para serem utilizados pelos alunos
ingressantes nos cursos de Ciência e Engenharia de Computação. Dessa vez
não houve palestra introdutória sobre o Projeto Fedora, mas eu resolvi
pegar 10 minutos e explicar as &quot;regras&quot; de um Install Fest. Também
comentei sobre a má prática que algumas fabricantes de notebooks têm
quando decidem entregar um disco rígido todo particionado e sem a
possibilidade de adição de novas partições primárias. Dito isso,
começamos a instalar.&lt;&#x2F;p&gt;
&lt;p&gt;Infelizmente, devido a diversos fatores como inexperiência, tempo curto
para organização do evento, e erro na estimativa de quantas pessoas
iriam ao evento, acabamos ficando com muita gente pra instalar e pouca
gente pra ajudar. Não chegamos a fazer uma contagem oficial, mas eu
suponho que pelo menos 20 pessoas estavam na sala querendo instalar o
Fedora. E a grande maioria delas estava com notebooks novos, com
Microsoft (R) Windows (R) 8, i.e., com UEFI e Secure Boot habilitados.&lt;&#x2F;p&gt;
&lt;p&gt;Conforme íamos reparticionando os discos e bootando os DVDs do Fedora,
começamos a perceber que havia algo errado. Depois de terminar a
instalação em algumas máquinas, notávamos que o sistema não iniciava. O
que tínhamos que fazer, em alguns casos, era desabilitar o Secure Boot
(mesmo assim, sem sucesso em alguns casos). E depois disso, o Fedora
finalmente era iniciado, mas o Microsoft (R) Windows (R) 8 não aparecia
na lista de sistemas operacionais do GRUB! Ou seja, era impossível fazer
com que os dois sistemas convivessem na mesma máquina.&lt;&#x2F;p&gt;
&lt;p&gt;Tivemos alguns casos um pouco mais graves, mas que no fim foram
resolvidos. E antes que você me pergunte qual foi a solução, eu
respondo: reabilitamos o Secure Boot, e praticamente desfizemos a
instalação do Fedora. Ou seja, a esmagadora maioria dos alunos presentes
no Install Fest voltou pra casa com uma máquina sem Fedora ou qualquer
outra distro GNU&#x2F;Linux. Eu pessoalmente vi apenas 2 instalações bem
sucedidas, apesar de que depois do Install Fest fiquei sabendo de mais.&lt;&#x2F;p&gt;
&lt;p&gt;Saí do evento bastante chateado, achando que a culpa havia sido nossa, e
que os alunos nunca mais iriam querer instalar GNU&#x2F;Linux nas suas
máquinas. Mas depois de um tempo, coloquei as idéias em ordem e resolvi
escrever este post. Não estou eximindo ninguém da culpa, creio que
devíamos ter planejado o Install Fest um pouco melhor, e com certeza
aprendemos com os erros que cometemos. Mas acho muito importante
&lt;strong&gt;apontar alguns dedos&lt;&#x2F;strong&gt; e dizer o que realmente aconteceu.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;conclusoes&quot;&gt;Conclusões&lt;&#x2F;h2&gt;
&lt;p&gt;A conclusão principal não poderia ser outra. &lt;strong&gt;É preciso tomar muito
cuidado com essas novas tecnologias de boot&lt;&#x2F;strong&gt;. Quando for comprar uma
máquina nova, é preciso prestar &lt;strong&gt;muita&lt;&#x2F;strong&gt; atenção a isso, pois essas
novas tecnologias nada mais são do que armadilhas para tirar a sua
liberdade de escolher o que quer executar na sua máquina. É preciso
lutar contra essas imposições que as empresas fazem (não seja inocente
pensando que é só a Microsoft (R) que está por trás disso...), e é
preciso tomar conta da sua liberdade. Se quiser demonstrar ainda mais
seu apoio contra essas imposições (e entender mais do porquê delas
existirem), &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;www.fsf.org&#x2F;campaigns&#x2F;secure-boot-vs-restricted-boot&#x2F;&quot;&gt;clique aqui e leia a página da Free Software Foundation
sobre o assunto (e assine a petição
também!)&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Conclusões secundárias: um Install Fest (ou qualquer evento, na verdade)
precisa ser organizado com antecedência, e precisa ter bastante gente
disposta a ajudar nas instalações. Só assim as coisas fluem.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;agradecimentos&quot;&gt;Agradecimentos&lt;&#x2F;h2&gt;
&lt;p&gt;Não posso deixar de agradecer o &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;twitter.com&#x2F;panaggio&quot;&gt;Ricardo
Panaggio&lt;&#x2F;a&gt; por me ajudar indo até a UNESP
de Rio Claro comigo! Ele também ajudou bastante no Install Fest da
UNICAMP.&lt;&#x2F;p&gt;
&lt;p&gt;Também gostaria de agradecer ao Marcel Godoy e ao Centro Acadêmico da
Computação da UNESP de Rio Claro pela organização e divulgação do
Install Fest lá. Muito obrigado!&lt;&#x2F;p&gt;
&lt;p&gt;O Install Fest da UNICAMP só foi possível com a ajuda do &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;gpsl.ic.unicamp.br&quot;&gt;Grupo
Pró-Software Livre&lt;&#x2F;a&gt; da UNICAMP, em especial
ao Gabriel Krisman. O &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;isf.sdf.org&#x2F;about.html&quot;&gt;Ivan S. Freitas&lt;&#x2F;a&gt; e
o &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;www.ime.unicamp.br&#x2F;~ra092767&#x2F;&quot;&gt;Raniere Gaia Silva&lt;&#x2F;a&gt; também
ajudaram no apoio logístico do Install Fest.&lt;&#x2F;p&gt;
&lt;p&gt;Por fim, gostaria de agradecer à comunidade Fedora pelo apoio com os
DVDs. Obrigado a todos!&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Misunderstanding the Free Software Philosophy</title>
        <published>2012-12-17T00:00:00-05:00</published>
        <updated>2012-12-17T00:00:00-05:00</updated>
        
        <author>
          <name>
            
              Sergio Durigan Junior
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://blog.sergiodj.net/posts/misunderstanding-free-software/"/>
        <id>https://blog.sergiodj.net/posts/misunderstanding-free-software/</id>
        
        <content type="html" xml:base="https://blog.sergiodj.net/posts/misunderstanding-free-software/">&lt;p&gt;This will probably be one of those controversial posts, but I really
cannot just be silent about a behaviour that I am constantly seeing
around me.&lt;&#x2F;p&gt;
&lt;p&gt;Since my childhood, I am fascinated by the power of the words. I always
liked reading a lot, and despite not knowing the grammar rules (either
in pt_BR or en_US, the former being my native language, the latter
being the only idiom I can consider myself fluent in), I am deeply
interested in what words (and their infinite meanings) can do to us. (If
you can read in portuguese, and if you also like to study or admire in
this subject, I strongly recommend a romance by José Saramago called &quot;&lt;em&gt;O
Homem Duplicado&lt;&#x2F;em&gt;&quot;). So now, what I am seeing everywhere is that people
are being as careless as ever with words, their meanings, and specially
their implications.&lt;&#x2F;p&gt;
&lt;p&gt;The problem I am seeing, and it is a serious problem in my opinion, is
the constant use of the term &quot;&lt;strong&gt;free software&lt;&#x2F;strong&gt;&quot; when &quot;&lt;strong&gt;open source&lt;&#x2F;strong&gt;&quot;
should be used. This is obviously not a recent problem, and I really
cannot recall when was the first time I noticed this happening. But
maybe because I am much more involved with (real) free software
movements now, I have the strong impression that this &quot;confusion&quot; is
starting to grow out of control. So here I am, trying to convince some
people to be a little more coherent.&lt;&#x2F;p&gt;
&lt;p&gt;When you create a group to talk about free software, or when you join a
group whose goal is to promote free software ideas, you should really
&lt;strong&gt;do that&lt;&#x2F;strong&gt;. First of all, you should understand &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;www.gnu.org&#x2F;philosophy&#x2F;free-sw.html&quot;&gt;what free software is
about&lt;&#x2F;a&gt;. It is &lt;strong&gt;not about&lt;&#x2F;strong&gt;
open source, for starters. It is also a political movement, not only a
technical one.&lt;&#x2F;p&gt;
&lt;p&gt;I was part of a group in my former university which had &quot;Free Software&quot;
in its name. For a long time, I believed the group really was about free
software, even after receiving e-mails with heavy negative critics about
my opinions when I defended something related to the free software
ideology (e.g., when I suggested that we should not have a Facebook
page, which had been created for the group by one of its members). Well,
when I really could not hide the truth from myself anymore, I packed my
things and left the group (this was actually the start of a new free
software group that I founded with other friends in Brazil).&lt;&#x2F;p&gt;
&lt;p&gt;I also like a lot to go to events. And not only because of the
presentations, but mostly because I really like to talk to people.
Brazilians are fortunately very warm and talkative, so events here are
really a fertile soil for my social skills :-). However, even when the
event has &quot;free software&quot; in its name and description, it is &lt;strong&gt;very&lt;&#x2F;strong&gt;
hard to find someone who really understands the philosophy behind the
term. And I&#x27;m not just talking about the attendees: the event staff is
also usually ignorant (and prefer to remain like this)! I feel really
depressed when I start to defend the (real) free software, and people
start looking at me and saying &quot;You&#x27;re radical.&quot;. It&#x27;s like going in a
&quot;Debugger Conference&quot; and feel ridicularized when you start talking
about GDB! I cannot understand this...&lt;&#x2F;p&gt;
&lt;p&gt;But the worst part of all this is that newcomers are learning that &quot;free
software&quot; is &quot;Linux&quot;, or something which is &lt;strong&gt;not&lt;&#x2F;strong&gt; free software. This
is definitely not a good thing, because people should be aware that the
world is not just about software development: there are serious issues,
including privacy and freedom menaces by Facebook&#x2F;Google&#x2F;Apple&#x2F;etc,
which we should fight against. Free software is about that as well.
Awareness should be raised, actions should be taken, and people should
refuse those impositions.&lt;&#x2F;p&gt;
&lt;p&gt;So, to finish what I want to say, if you do not consider yourself a free
software activist, please consider becoming one. And if, after giving it
a thought, you decided that you really do not want to be a free software
activist, then &lt;strong&gt;do not use the name &quot;free software&quot; in your
event&#x2F;group&#x2F;whatever&lt;&#x2F;strong&gt;, unless you really intend to talk about it and
not open source.. In other words, if you don&#x27;t want to help, please
don&#x27;t spread confusion.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>[ANÚNCIO] Criação do grupo LibrePlanet São Paulo!</title>
        <published>2012-12-15T00:00:00-05:00</published>
        <updated>2012-12-15T00:00:00-05:00</updated>
        
        <author>
          <name>
            
              Sergio Durigan Junior
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://blog.sergiodj.net/posts/criacao-libreplanet-sao-paulo/"/>
        <id>https://blog.sergiodj.net/posts/criacao-libreplanet-sao-paulo/</id>
        
        <content type="html" xml:base="https://blog.sergiodj.net/posts/criacao-libreplanet-sao-paulo/">&lt;p&gt;Olá a todos!&lt;&#x2F;p&gt;
&lt;p&gt;Finalmente consegui um pouco de tempo na minha agenda, e resolvi
escrever no blog para anunciar a criação do grupo &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;libreplanet.org&#x2F;wiki&#x2F;Group:LibrePlanet_S%C3%A3o_Paulo&quot;&gt;LibrePlanet São
Paulo&lt;&#x2F;a&gt;!&lt;&#x2F;p&gt;
&lt;h2 id=&quot;o-que-e-o-libreplanet&quot;&gt;O que é o LibrePlanet&lt;&#x2F;h2&gt;
&lt;p&gt;O projeto &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;libreplanet.org&quot;&gt;LibrePlanet&lt;&#x2F;a&gt; teve início em 2006,
durante a reunião de membros da &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;www.fsf.org&#x2F;&quot;&gt;FSF&lt;&#x2F;a&gt; (a Free
Software Foundation). Ele foi criado para ajudar a organizar maneiras de
levar o movimento de Software Livre ao conhecimento da população em
geral.&lt;&#x2F;p&gt;
&lt;p&gt;Os grupos são organizados geograficamente, e cada um é responsável por
definir metas e estratégias visando fomentar o Software Livre na região.
É importante deixar claro: o objetivo é trabalhar em prol do &lt;strong&gt;Software
Livre&lt;&#x2F;strong&gt;, e &lt;strong&gt;não&lt;&#x2F;strong&gt; do open source. Para saber mais a respeito da
definição de Software Livre, recomendo que leia &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;www.gnu.org&#x2F;philosophy&#x2F;free-sw.pt-br.html&quot;&gt;este
artigo&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;o-surgimento-do-libreplanet-sao-paulo&quot;&gt;O surgimento do LibrePlanet São Paulo&lt;&#x2F;h2&gt;
&lt;p&gt;Essa história é um pouco longa, mas vou tentar resumir :-).&lt;&#x2F;p&gt;
&lt;p&gt;Tudo começou quando eu, &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;twitter.com&#x2F;panaggio&quot;&gt;Ricardo
Panaggio&lt;&#x2F;a&gt;, &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;isf.sdf.org&#x2F;about.html&quot;&gt;Ivan S.
Freitas&lt;&#x2F;a&gt; e &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;www.ime.unicamp.br&#x2F;~ra092767&#x2F;&quot;&gt;Raniere Gaia
Silva&lt;&#x2F;a&gt; começamos a trocar alguns
e-mails sobre assuntos como privacidade, software livre, soluções e
serviços livres, etc. Eu e o Panaggio já estávamos nos sentindo muito
insatisfeitos com os rumos que um grupo local, teoricamente &quot;pró
software livre&quot;, estava tomando (como quase tudo hoje em dia, o nome
&quot;software livre&quot; está lá simplesmente porque ninguém se tocou de que
devia ser &quot;open source&quot; ainda...). E essa insatisfação já vinha nos
fazendo querer criar um novo grupo, fiel à ideologia do Software Livre,
no qual pudéssemos dar nossas opiniões sem medo de sermos esmagados por
uma maioria que não se importa com &quot;essas coisas&quot;.&lt;&#x2F;p&gt;
&lt;p&gt;Bem, começamos a conversar, e logo o Ivan e o Raniere deram sinais de
que eles topariam participar do grupo, sem problemas. Portanto, o solo
já estava fértil para novas idéias :-).&lt;&#x2F;p&gt;
&lt;p&gt;Um dia, eu acordei e vi na minha INBOX uma mensagem do Raniere dizendo
que havia encontrado algo sobre um projeto interessante, o LibrePlanet,
na Internet. Foi a faísca que faltava pra começar a movimentação!
Recordei-me de que eu já havia conversado com o &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;matt.lee.name&#x2F;&quot;&gt;Matt
Lee&lt;&#x2F;a&gt;, também da FSF, sobre o LibrePlanet, e
depois de uma rápida busca na wiki do projeto, vi que ainda não havia
nenhum grupo brasileiro. Então, depois de alguma conversa interna,
decidimos criar um grupo para o Estado de São Paulo.&lt;&#x2F;p&gt;
&lt;p&gt;Hoje, pouco mais de 2 semanas depois da criação, contamos com 10 membros
cadastrados na Wiki, e aproximadamente 7 membros ativos no nosso canal
de IRC. Também temos uma lista de discussão, e já estamos começando a
conversar sobre possíveis projetos para 2013.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;como-voce-pode-fazer-parte-do-grupo&quot;&gt;Como você pode fazer parte do grupo?&lt;&#x2F;h2&gt;
&lt;p&gt;É simples! Siga os seguintes passos:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Entre na nossa
&lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;libreplanet.org&#x2F;wiki&#x2F;Group:LibrePlanet_S%C3%A3o_Paulo&quot;&gt;Wiki&lt;&#x2F;a&gt;, e
leia todas as informações presentes lá antes de qualquer coisa!&lt;&#x2F;li&gt;
&lt;li&gt;Depois disso, efetue a criação de seu usuário na FSF, indo até
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;my.fsf.org&#x2F;associate&#x2F;join&#x2F;am_register_form1&quot;&gt;este link de
cadastro&lt;&#x2F;a&gt; e
preenchendo as informações. Repare que você &lt;strong&gt;não&lt;&#x2F;strong&gt; precisa
tornar-se membro da FSF (os membros são pessoas que contribuem
financeiramente com a Fundação), mas se você puder, iria ser bem
legal :-).&lt;&#x2F;li&gt;
&lt;li&gt;Ok, agora que você já possui um usuário, efetue o login na Wiki do
LibrePlanet, e crie sua página pessoal lá. Para isso, vá até &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;libreplanet.org&#x2F;wiki&#x2F;Special:MyPage&quot;&gt;este
link&lt;&#x2F;a&gt;, clique no link
&lt;strong&gt;Edit&lt;&#x2F;strong&gt;, e insira algumas informações sobre lá. Se quiser,
utilize &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;libreplanet.org&#x2F;wiki&#x2F;User:Sergiodj&quot;&gt;minha página
pessoal&lt;&#x2F;a&gt; como exemplo.
É importante que você insira, no final de todo o conteúdo, a
seguinte linha: &lt;code&gt;{% raw %}{{user SP}}{% endraw %}&lt;&#x2F;code&gt;. Ele faz com que você passe a
pertencer ao grupo LibrePlanet de São Paulo.&lt;&#x2F;li&gt;
&lt;li&gt;Agora, é importante que você também efetue sua inscrição na nossa
lista de discussão. Vá até &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;lists.libreplanet.org&#x2F;mailman&#x2F;listinfo&#x2F;libreplanet-br-sp&quot;&gt;esta página de
inscrição&lt;&#x2F;a&gt;
e preencha as informações necessárias! Também recomendamos
fortemente que você envie uma mensagem de apresentação para
a lista. Nada formal, só para termos uma idéia do tamanho do
grupo!&lt;&#x2F;li&gt;
&lt;li&gt;Ufa, último passo! Se você utiliza IRC e frequenta a rede
Freenode, entre no nosso canal: &lt;code&gt;#lp-br-sp&lt;&#x2F;code&gt;! É lá que a maior
parte das discussões acontece, então seria muito legal se você
também pudesse participar delas!&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;Acho que é isso :-). Se você ainda tiver alguma dúvida sobre qualquer
assunto tratado neste post (objetivos do grupo, inscrição, etc), ou se
quiser fazer algum comentário, sinta-se à vontade!&lt;&#x2F;p&gt;
&lt;p&gt;Saudações livres!&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Relato da Apresentação sobre o GDB no SoLiSC 2012</title>
        <published>2012-12-01T00:00:00-05:00</published>
        <updated>2012-12-01T00:00:00-05:00</updated>
        
        <author>
          <name>
            
              Sergio Durigan Junior
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://blog.sergiodj.net/posts/relato-apresentacao-gdb-solisc/"/>
        <id>https://blog.sergiodj.net/posts/relato-apresentacao-gdb-solisc/</id>
        
        <content type="html" xml:base="https://blog.sergiodj.net/posts/relato-apresentacao-gdb-solisc/">&lt;p&gt;Nesta última sexta-feira, dia 30&#x2F;11&#x2F;2012, estive presente na sétima
edição do &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;www.solisc.com.br&#x2F;&quot;&gt;SoLiSC 2012&lt;&#x2F;a&gt;, em Florianópolis,
para apresentar uma palestra introdutória sobre o
&lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;www.gnu.org&#x2F;software&#x2F;gdb&#x2F;&quot;&gt;GDB&lt;&#x2F;a&gt;. Este é um relato sobre minha
particição no evento :-).&lt;&#x2F;p&gt;
&lt;h2 id=&quot;impressoes-sobre-o-evento&quot;&gt;Impressões sobre o evento&lt;&#x2F;h2&gt;
&lt;p&gt;Foi a primeira vez que fui ao SoLiSC. Já tive vontade de ir em anos
anteriores, mas infelizmente sempre havia algo para atrapalhar. No
entanto, nesse ano felizmente tudo correu bem, e inclusive tive uma
palestra aceita! Ou seja, um ótimo motivo para visitar Floripa e rever o
mar :-D.&lt;&#x2F;p&gt;
&lt;p&gt;Peguei um vôo saindo às 6h de Campinas, e cheguei lá às 7h10min. Estava
bastante cansado, pois não havia dormido de quinta pra sexta, só que a
ansiedade estava conseguindo me deixar ligado :-).&lt;&#x2F;p&gt;
&lt;p&gt;O evento aconteceu &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;portal.estacio.br&#x2F;unidades&#x2F;universidade-estacio-de-sa&#x2F;polos&#x2F;sc&#x2F;florianopolis&#x2F;ead-florianopolis-sc.aspx&quot;&gt;Universidade Estácio de
Sá&lt;&#x2F;a&gt;,
que fica em São José. Cheguei por lá às 8h, e fui bem recebido pelo
pessoal do evento. Já tentei me enturmar, e conheci algumas pessoas que
também iam palestrar no evento. Como minha palestra estava marcada para
começar às 14h, resolvi ficar batendo papo e de olho na grade de
palestras.&lt;&#x2F;p&gt;
&lt;p&gt;Por coincidência (ou não!), acabei ficando na sala onde aconteceria o
primeiro &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;libreofficebrasil.blogspot.com.br&#x2F;2012&#x2F;11&#x2F;programacao-do-primeiro-hack-day-de.html&quot;&gt;LibreOffice Hack
Day&lt;&#x2F;a&gt;
no Brasil. Acabei ficando na sala o dia todo, ajudando o pessoal a
resolver alguns problemas chatos com o firewall da Universidade, e
depois com &lt;code&gt;git&lt;&#x2F;code&gt;. Foi uma experiência muito legal, nunca tinha
participado de um Hack Day antes, e foi uma honra poder presenciar e
ajudar no primeiro evento do tipo que o pessoal do
&lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;pt-br.libreoffice.org&#x2F;&quot;&gt;LibreOffice&lt;&#x2F;a&gt; fez no Brasil :-). Aliás,
foi muito interessante conhecer um pouco mais sobre um projeto tão
grande e complexo quanto o LibreOffice, e inclusive fiz um &quot;jabá&quot; sobre
o GDB para eles :-).&lt;&#x2F;p&gt;
&lt;p&gt;No final, também conheci algumas pessoas muito interessadas em
contribuir com projetos de software livre, o que é sempre bom! Isso me
ajuda a ter mais motivação para continuar a fazer esse trabalho de
divulgação. Você pode ler uma descrição mais detalhada sobre o
LibreOffice Hack Day (inclusive com fotos)
&lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;blog.pt-br.libreoffice.org&#x2F;2012&#x2F;12&#x2F;01&#x2F;nosso-primeiro-hackday-do-libreoffice-no-brasil&#x2F;&quot;&gt;aqui&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;apresentacao-gdb-crash-course&quot;&gt;Apresentação &quot;GDB Crash Course&quot;&lt;&#x2F;h2&gt;
&lt;p&gt;Eu já estava esperando pouca gente na palestra, até porque falar sobre o
GDB está ficando cada vez mais complicado... As pessoas em geral não
sabem (e nem se interessam) pelo software, então é normal ficar meio &quot;de
escanteio&quot; nesses eventos :-). Quem sabe um dia eu não escreva um post
sobre isso?&lt;&#x2F;p&gt;
&lt;p&gt;Bem, mas mesmo com pouco público, creio que palestra correu bem. Dessa
vez, meu amigo &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;twitter.com&#x2F;nottooamused&quot;&gt;Edjunior&lt;&#x2F;a&gt; não foi,
então levei a palestra sozinho :-). Existem vantagens e desvantagens
nisso, mas de modo geral acho que a palestra ficou um pouco mais rápida.&lt;&#x2F;p&gt;
&lt;p&gt;Adicionei alguns slides extras para falar sobre a Red Hat, e sobre o que
estamos fazendo pelas comunidades de software livre por aí -- não só na
do GDB, mas também em muitas outras. Essa parte da apresentação
realmente foi bacana, porque o orgulho de se trabalhar nessa empresa é
grande!&lt;&#x2F;p&gt;
&lt;p&gt;Depois que terminei minha palestra e voltei à sala do LibreOffice Hack
Day, alguns desenvolvedores que estavam por lá me perguntaram como foi,
e disseram que tinham se arrependido de não ter ido... Sabe como é,
preferiram ficar fazendo &lt;em&gt;patches&lt;&#x2F;em&gt;, então eu entendo :-P. Bem, pra não
deixar ninguém insatisfeito, acabei fazendo uma segunda rodada da
palestra dentro do Hack Day, e também foi muito bacana :-).&lt;&#x2F;p&gt;
&lt;p&gt;Várias pessoas me pediram os slides, então aqui estão eles:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;sergiodj&#x2F;gdb-unicamp2011&quot;&gt;https:&#x2F;&#x2F;github.com&#x2F;sergiodj&#x2F;gdb-unicamp2011&lt;&#x2F;a&gt; (fonte,
em Beamer&#x2F;LaTeX)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;fedorapeople.org&#x2F;~sergiodj&#x2F;presentations&#x2F;2012&#x2F;SoLiSC&#x2F;&quot;&gt;http:&#x2F;&#x2F;fedorapeople.org&#x2F;~sergiodj&#x2F;presentations&#x2F;2012&#x2F;SoLiSC&#x2F;&lt;&#x2F;a&gt; (PDF)&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;conclusao&quot;&gt;Conclusão&lt;&#x2F;h2&gt;
&lt;p&gt;Gostaria de agradecer especialmente à &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;twitter.com&#x2F;Eliane_Domingos&quot;&gt;Eliane
Domingos&lt;&#x2F;a&gt;, ao David Jourdain e ao
&lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;olivierhallot.blogspot.com.br&#x2F;&quot;&gt;Olivier Hallot&lt;&#x2F;a&gt;, todos membros
da &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;www.documentfoundation.org&#x2F;&quot;&gt;TDF&lt;&#x2F;a&gt; e contribuidores do
LibreOffice, pelos momentos prazerosos e pelas conversas divertidas que
tivemos durante todo o evento!&lt;&#x2F;p&gt;
&lt;p&gt;Também gostaria de agradecer à organização do SoLiSC pela oportunidade
de participar de um evento tão bacana! O &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;twitter.com&#x2F;klaibsonn&quot;&gt;Klaibson
Ribeiro&lt;&#x2F;a&gt; foi a pessoa com quem troquei
alguns e-mails antes do evento, então um &quot;muito obrigado&quot; a ele também
:-).&lt;&#x2F;p&gt;
&lt;p&gt;Nos vemos no próximo SoLiSC!&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>GDB and SystemTap Probes -- part 3</title>
        <published>2012-11-02T00:00:00-05:00</published>
        <updated>2012-11-02T00:00:00-05:00</updated>
        
        <author>
          <name>
            
              Sergio Durigan Junior
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://blog.sergiodj.net/posts/gdb-and-systemtap-probes-part-3/"/>
        <id>https://blog.sergiodj.net/posts/gdb-and-systemtap-probes-part-3/</id>
        
        <content type="html" xml:base="https://blog.sergiodj.net/posts/gdb-and-systemtap-probes-part-3/">&lt;p&gt;Hi everybody :-).&lt;&#x2F;p&gt;
&lt;p&gt;I finally got some time to finish this series of posts, and I hope you
like the overall result. For those of you who are reading this blog
for the first time, you can access the first
post
&lt;a href=&quot;https:&#x2F;&#x2F;blog.sergiodj.net&#x2F;posts&#x2F;gdb-and-systemtap-probes-part-3&#x2F;%7Bfilename%7D&#x2F;2012-03-29-gdb-and-systemtap-probes-part-1.md&quot;&gt;here&lt;&#x2F;a&gt;, and
the
second
&lt;a href=&quot;https:&#x2F;&#x2F;blog.sergiodj.net&#x2F;posts&#x2F;gdb-and-systemtap-probes-part-3&#x2F;%7Bfilename%7D&#x2F;2012-10-27-gdb-and-systemtap-probes-part-2.md&quot;&gt;here&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;My goal with this third post is to talk a little bit about how you can
use the &lt;code&gt;SDT&lt;&#x2F;code&gt; probes with &lt;code&gt;tracepoints&lt;&#x2F;code&gt; inside &lt;code&gt;GDB&lt;&#x2F;code&gt;. Maybe this
particular feature will not be so helpful to you, but I recommend
reading the post either way. I will also give a brief explanation about
how the &lt;code&gt;SDT&lt;&#x2F;code&gt; probes are laid out inside the binary. So, let&#x27;s start!&lt;&#x2F;p&gt;
&lt;h2 id=&quot;complementary-information&quot;&gt;Complementary information&lt;&#x2F;h2&gt;
&lt;p&gt;In my last post, I forgot to mention that the &lt;code&gt;SDT&lt;&#x2F;code&gt; probe support
present on older versions of Fedora &lt;code&gt;GDB&lt;&#x2F;code&gt; is not exactly as the way I
described here. This is because Fedora &lt;code&gt;GDB&lt;&#x2F;code&gt; adopted this feature much
earlier than upstream &lt;code&gt;GDB&lt;&#x2F;code&gt; itself, so while this has a great positive
aspect in terms of how the distro&#x27;s philosophy works (i.e., Fedora
contains leading-edge features, so if you want to know how to FLOSS
community will be in a few months, use it!), it also has the downside of
delivering older&#x2F;different versions of features in older Fedoras. But of
course, this &lt;code&gt;SDT&lt;&#x2F;code&gt; feature will be fully available on Fedora 18, to be
announced soon.&lt;&#x2F;p&gt;
&lt;p&gt;My suggestion is that if you use a not-so-recent Fedora (like Fedora 16,
15, etc), please upgrade it to the last version, or compile your own
version of &lt;code&gt;GDB&lt;&#x2F;code&gt; yourself (it&#x27;s not that hard, I will make a post about
it in the next days&#x2F;weeks!).&lt;&#x2F;p&gt;
&lt;p&gt;With that said, let&#x27;s move on to our main topic here.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;sdt-probes-and-tracepoint&quot;&gt;SDT Probes and Tracepoint&lt;&#x2F;h2&gt;
&lt;p&gt;Before anything else, let me explain what a &lt;code&gt;tracepoint&lt;&#x2F;code&gt; is. Think of it
as &lt;em&gt;a breakpoint which doesn&#x27;t stop the program&#x27;s execution
when it hits&lt;&#x2F;em&gt;. In fact, it&#x27;s a bit more than that: you can define
&lt;strong&gt;actions&lt;&#x2F;strong&gt; associated with a &lt;code&gt;tracepoint&lt;&#x2F;code&gt;, and those actions will be
performed when the &lt;code&gt;tracepoint&lt;&#x2F;code&gt; is hit. Neat, huh? :-)&lt;&#x2F;p&gt;
&lt;p&gt;There is a nice description of what a &lt;code&gt;tracepoint&lt;&#x2F;code&gt; in the &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;sourceware.org&#x2F;gdb&#x2F;current&#x2F;onlinedocs&#x2F;gdb&#x2F;Tracepoints.html#Tracepoints&quot;&gt;GDB
documentation&lt;&#x2F;a&gt;,
I recommend you give it a reading to understand the concept.&lt;&#x2F;p&gt;
&lt;p&gt;Ok, so now we have to learn how to put &lt;code&gt;tracepoints&lt;&#x2F;code&gt; in our code, and
how to define actions for them. But before that, let&#x27;s remember our
example program:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E6EDF3; background-color: #0D1117;&quot;&gt;&lt;code data-lang=&quot;c&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;#include&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt; &amp;lt;sys&#x2F;sdt.h&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;int&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #D2A8FF;&quot;&gt;main&lt;&#x2F;span&gt;&lt;span&gt; (&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;int&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFA657;&quot;&gt; argc&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt; char *&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFA657;&quot;&gt;argv&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;[]&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;{&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;	int&lt;&#x2F;span&gt;&lt;span&gt; a &lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt; 10&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #D2A8FF;&quot;&gt;    STAP_PROBE1&lt;&#x2F;span&gt;&lt;span&gt; (test_program, my_probe, a);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt; 	return&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt; 0&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Very simple, isn&#x27;t it? Ok, to the &lt;code&gt;tracepoints&lt;&#x2F;code&gt; now, my friends.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;using-tracepoints-inside-gdb&quot;&gt;Using &lt;code&gt;tracepoints&lt;&#x2F;code&gt; inside &lt;code&gt;GDB&lt;&#x2F;code&gt;&lt;&#x2F;h2&gt;
&lt;p&gt;In order to properly use &lt;code&gt;tracepoints&lt;&#x2F;code&gt; inside &lt;code&gt;GDB&lt;&#x2F;code&gt;, you will need to
use &lt;code&gt;gdbserver&lt;&#x2F;code&gt;, a tiny version of &lt;code&gt;GDB&lt;&#x2F;code&gt; suitable for debugging programs
remotely, over the net or serial line. In short, this is because &lt;code&gt;GDB&lt;&#x2F;code&gt;
cannot put tracepoints on a program running directly under it, so we
have to run it inside &lt;code&gt;gdbserver&lt;&#x2F;code&gt; and then connect &lt;code&gt;GDB&lt;&#x2F;code&gt; to it.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;running-our-program-inside-gdbserver&quot;&gt;Running our program inside &lt;code&gt;gdbserver&lt;&#x2F;code&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;In our case, we will just start &lt;code&gt;gdbserver&lt;&#x2F;code&gt; in our machine, order it to
listen to some high port, and connect to it through &lt;code&gt;localhost&lt;&#x2F;code&gt;, so
there will be no need to have access to another computer or device.&lt;&#x2F;p&gt;
&lt;p&gt;First of all, make sure you have &lt;code&gt;gdbserver&lt;&#x2F;code&gt; installed. If you use
Fedora, the package name you will have to install is &lt;code&gt;gdb-gdbserver&lt;&#x2F;code&gt;. If
you have it installed, you can do:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E6EDF3; background-color: #0D1117;&quot;&gt;&lt;code data-lang=&quot;shellsession&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;$ gdbserver :3001 .&#x2F;test_program&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;Process .&#x2F;test_program created; pid = 17793&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;Listening on port 3001&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The second argument passed to &lt;code&gt;gdbserver&lt;&#x2F;code&gt; instructs it to listen on the
port 3001 of your loopback interface, a.k.a. &lt;code&gt;localhost&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;You will notice that &lt;code&gt;gdbserver&lt;&#x2F;code&gt; will stay there indefinitely, waiting
for new connections to arrive. Don&#x27;t worry, we will connect to it soon!&lt;&#x2F;p&gt;
&lt;h3 id=&quot;connecting-an-instance-of-gdb-to-gdbserver&quot;&gt;Connecting an instance of &lt;code&gt;GDB&lt;&#x2F;code&gt; to &lt;code&gt;gdbserver&lt;&#x2F;code&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;Now, go to another terminal and start &lt;code&gt;GDB&lt;&#x2F;code&gt; with our program:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E6EDF3; background-color: #0D1117;&quot;&gt;&lt;code data-lang=&quot;shellsession&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;$ gdb .&#x2F;test_program&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;...&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;(gdb) target remote :3001&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;Remote debugging using :3001&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;Reading symbols from &#x2F;lib64&#x2F;ld-linux-x86-64.so.2...(no debugging symbols found)...done.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;Loaded symbols for &#x2F;lib64&#x2F;ld-linux-x86-64.so.2&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;0x0000003d60401530 in _start () from &#x2F;lib64&#x2F;ld-linux-x86-64.so.2&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The command you have to use inside &lt;code&gt;GDB&lt;&#x2F;code&gt; is &lt;code&gt;target remote&lt;&#x2F;code&gt;. It takes as
an argument the host and the port to which you want to connect. In our
case, we just want it to connect to &lt;code&gt;localhost&lt;&#x2F;code&gt;, port 3001. If you saw
an output like the above, great, things are working for you (&lt;em&gt;don&#x27;t pay
attention to the messages about
glibc debug information&lt;&#x2F;em&gt;). If you didn&#x27;t see it, please check to see if
you&#x27;re connecting to the right port, and if no other service is using
it.&lt;&#x2F;p&gt;
&lt;p&gt;Ok, so now it is time to start our &lt;em&gt;trace experiment&lt;&#x2F;em&gt;!&lt;&#x2F;p&gt;
&lt;h3 id=&quot;creating-the-tracepoints&quot;&gt;Creating the &lt;code&gt;tracepoints&lt;&#x2F;code&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;&lt;strong&gt;Every command should be issued on GDB, not on gdbserver!&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;In your &lt;code&gt;GDB&lt;&#x2F;code&gt; prompt, put a &lt;code&gt;tracepoint&lt;&#x2F;code&gt; in the probe named &lt;code&gt;my_probe&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E6EDF3; background-color: #0D1117;&quot;&gt;&lt;code data-lang=&quot;shellsession&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;(gdb) trace -probe-stap my_probe&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;Tracepoint 1 at 0x4005a9&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;As you can see, the &lt;code&gt;trace&lt;&#x2F;code&gt; command takes exactly the same arguments as
the &lt;code&gt;break&lt;&#x2F;code&gt; command. Thus, you need to use the &lt;code&gt;-probe-stap&lt;&#x2F;code&gt; modified in
order to instruct &lt;code&gt;GDB&lt;&#x2F;code&gt; to put the &lt;code&gt;tracepoint&lt;&#x2F;code&gt; in the probe.&lt;&#x2F;p&gt;
&lt;p&gt;And now, let&#x27;s define the &lt;strong&gt;actions&lt;&#x2F;strong&gt; associated with this &lt;code&gt;tracepoint&lt;&#x2F;code&gt;.
To do that, we use the &lt;code&gt;actions&lt;&#x2F;code&gt; command, which is an interactive
command inside &lt;code&gt;GDB&lt;&#x2F;code&gt;. It takes some specific keywords, and if you want
to learn more about it, please take a look at &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;sourceware.org&#x2F;gdb&#x2F;current&#x2F;onlinedocs&#x2F;gdb&#x2F;Tracepoint-Actions.html#Tracepoint-Actions&quot;&gt;this
link&lt;&#x2F;a&gt;.
For this example, we will use only the &lt;code&gt;collect&lt;&#x2F;code&gt; keyword, which tells
&lt;code&gt;GDB&lt;&#x2F;code&gt; to... hm... collect something :-). In our case, it will collect
the probe&#x27;s first argument, or &lt;code&gt;$_probe_arg0&lt;&#x2F;code&gt;, as you may remember.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E6EDF3; background-color: #0D1117;&quot;&gt;&lt;code data-lang=&quot;shellsession&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;(gdb) actions &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;Enter actions for tracepoint 1, one per line.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;End with a line saying just &amp;quot;end&amp;quot;.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;&amp;gt;collect $_probe_arg0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;&amp;gt;end&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;(gdb)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Simple as that. Finally, we have to define a &lt;code&gt;breakpoint&lt;&#x2F;code&gt; in the last
instruction of our program, because it is necessary to keep it running
on &lt;code&gt;gdbserver&lt;&#x2F;code&gt; in order to examine the &lt;code&gt;tracepoints&lt;&#x2F;code&gt; later. If we didn&#x27;t
put this &lt;code&gt;breakpoint&lt;&#x2F;code&gt;, our program would finish and &lt;code&gt;gdbserver&lt;&#x2F;code&gt; would
not be able to provide information about what happened with our
&lt;code&gt;tracepoints&lt;&#x2F;code&gt;. In our case, we will simply put a &lt;code&gt;breakpoint&lt;&#x2F;code&gt; on line
10, i.e., on the &lt;code&gt;return 0;&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;h3 id=&quot;running-the-trace-experiment&quot;&gt;Running the trace experiment&lt;&#x2F;h3&gt;
&lt;p&gt;Ok, time to run our trace experiment. First, we must issue a &lt;code&gt;tstart&lt;&#x2F;code&gt; to
tell &lt;code&gt;GDB&lt;&#x2F;code&gt; to start monitoring the &lt;code&gt;tracepoints&lt;&#x2F;code&gt;. And then, we can
continue our program normally.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E6EDF3; background-color: #0D1117;&quot;&gt;&lt;code data-lang=&quot;shellsession&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;(gdb) tstart &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;(gdb) continue&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;Continuing.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;Breakpoint 1, main (argc=1, argv=0x7fffffffde88) at &#x2F;tmp&#x2F;test_program.c:10&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;10        return 0;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;(gdb) tstop&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;(gdb)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Remember, &lt;code&gt;GDB&lt;&#x2F;code&gt; is &lt;strong&gt;not&lt;&#x2F;strong&gt; going to stop your program, because
&lt;code&gt;tracepoints&lt;&#x2F;code&gt; are designed to not interfere with the execution of it.
Also notice that we have also stopped the trace experiment after the
&lt;code&gt;breakpoint&lt;&#x2F;code&gt; hit, by using the &lt;code&gt;tstop&lt;&#x2F;code&gt; command.&lt;&#x2F;p&gt;
&lt;p&gt;Now, we will be able to examine what the &lt;code&gt;tracepoint&lt;&#x2F;code&gt; has collected.
First, we will the &lt;code&gt;tfind&lt;&#x2F;code&gt; command to make sure the &lt;code&gt;tracepoint&lt;&#x2F;code&gt; has
hit, and then we can inspect what we ordered it to collect:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E6EDF3; background-color: #0D1117;&quot;&gt;&lt;code data-lang=&quot;shellsession&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;(gdb) tfind start&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;Found trace frame 0, tracepoint 1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;8         STAP_PROBE1 (test_program, my_probe, a);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;(gdb) p $_probe_arg0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;$1 = 10&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;And it works! Notice that we are printing the probe argument using the
same notation as with &lt;code&gt;breakpoints&lt;&#x2F;code&gt;, even though we are not exactly
executing the &lt;code&gt;STAP_PROBE1&lt;&#x2F;code&gt; instruction. What does it mean? Well, with
the &lt;code&gt;tfind start&lt;&#x2F;code&gt; command we tell &lt;code&gt;GDB&lt;&#x2F;code&gt; to actually use the trace frame
collected during the program&#x27;s execution, which, in this case, is the
probe argument. If you know &lt;code&gt;GDB&lt;&#x2F;code&gt;, think of it as if we were using the
&lt;code&gt;frame&lt;&#x2F;code&gt; command to jump back to a specific frame, where we would have
access to its state.&lt;&#x2F;p&gt;
&lt;p&gt;This is a very simple example of how to use the &lt;code&gt;SDT&lt;&#x2F;code&gt; probe support in
&lt;code&gt;GDB&lt;&#x2F;code&gt; with &lt;code&gt;tracepoints&lt;&#x2F;code&gt;. There is much more you can do, but I hope I
could explain the basics so that you can start playing with this
feature.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;how-the-sdt-probe-is-laid-out-in-the-binary&quot;&gt;How the &lt;code&gt;SDT&lt;&#x2F;code&gt; probe is laid out in the binary&lt;&#x2F;h2&gt;
&lt;p&gt;You might be interested in learning how the probes are created inside
the binary. Other than reading the source code of
&lt;code&gt;&#x2F;usr&#x2F;include&#x2F;sys&#x2F;sdt.h&lt;&#x2F;code&gt;, which is the heart of the whole feature, I
also recommend &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;sourceware.org&#x2F;systemtap&#x2F;wiki&#x2F;UserSpaceProbeImplementation&quot;&gt;this
page&lt;&#x2F;a&gt;,
which explains in detail what&#x27;s going on under the hood. I also
recommend that you study a little about how the ELF format works,
specifically about notes in the ELF file.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;&#x2F;h2&gt;
&lt;p&gt;After this series of blog posts, I expect that you will now be able to
use the not-so-new feature of &lt;code&gt;SDT&lt;&#x2F;code&gt; probe support on &lt;code&gt;GDB&lt;&#x2F;code&gt;. Of course,
if you find some bug while using this, please feel free to report it
using &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;sourceware.org&#x2F;bugzilla&#x2F;&quot;&gt;our bugzilla&lt;&#x2F;a&gt;. And if you have
some question, use the comment system below and I will answer ASAP :-).&lt;&#x2F;p&gt;
&lt;p&gt;See ya, and thanks for reading!&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>GDB and SystemTap Probes -- part 2</title>
        <published>2012-10-27T00:00:00-05:00</published>
        <updated>2012-10-27T00:00:00-05:00</updated>
        
        <author>
          <name>
            
              Sergio Durigan Junior
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://blog.sergiodj.net/posts/gdb-and-systemtap-probes-part-2/"/>
        <id>https://blog.sergiodj.net/posts/gdb-and-systemtap-probes-part-2/</id>
        
        <content type="html" xml:base="https://blog.sergiodj.net/posts/gdb-and-systemtap-probes-part-2/">&lt;p&gt;I tell you this: it is depressing when you realize that you spent more
time struggling with blog engines than writing posts on your blog!&lt;&#x2F;p&gt;
&lt;p&gt;It&#x27;s been a long time since I wrote
the
&lt;a href=&quot;https:&#x2F;&#x2F;blog.sergiodj.net&#x2F;posts&#x2F;gdb-and-systemtap-probes-part-2&#x2F;%7Bfilename%7D&#x2F;2012-03-29-gdb-and-systemtap-probes-part-1.md&quot;&gt;first post&lt;&#x2F;a&gt; about
this subject, and since then the patches have been accepted upstream,
and &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;www.gnu.org&#x2F;software&#x2F;gdb&#x2F;download&#x2F;ANNOUNCEMENT&quot;&gt;GDB 7.5&lt;&#x2F;a&gt;
now has official support for userspace SystemTap probes :-). Yay!&lt;&#x2F;p&gt;
&lt;p&gt;Well, but enough of cheap talk, let&#x27;s get to the business!&lt;&#x2F;p&gt;
&lt;h2 id=&quot;errata-for-my-last-post&quot;&gt;Errata for my last post&lt;&#x2F;h2&gt;
&lt;p&gt;&lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;web.elastic.org&#x2F;~fche&#x2F;blog2&#x2F;&quot;&gt;Frank Ch. Eigler&lt;&#x2F;a&gt;, one of
SystemTap&#x27;s maintainers, kindly mentioned something that I should say
about SystemTap userspace probes.&lt;&#x2F;p&gt;
&lt;p&gt;Basically, it should be clear that &lt;code&gt;SDT&lt;&#x2F;code&gt; probes are not the only kind of
userspace probing one can do with SystemTap. There is yet another kind
of probe (maybe even more powerful, depending on the goals):
&lt;strong&gt;DWARF-based function&#x2F;statement probes&lt;&#x2F;strong&gt;. SystemTap supports this kind
of probing mechanism for quite a while now.&lt;&#x2F;p&gt;
&lt;p&gt;It is not the goal of this post to explain it in detail, but you might
want to give it a try by compiling your binary with debuginfo support
(use the &lt;code&gt;-g&lt;&#x2F;code&gt; flag on &lt;code&gt;GCC&lt;&#x2F;code&gt;), and do something like:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E6EDF3; background-color: #0D1117;&quot;&gt;&lt;code data-lang=&quot;shellsession&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;$ stap -e &lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;&amp;#39;probe process(&amp;quot;&#x2F;bin&#x2F;foo&amp;quot;).function(&amp;quot;name&amp;quot;) { log($$parms) }&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt; -c &#x2F;bin&#x2F;foo&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;$ stap -e &lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;&amp;#39;probe process(&amp;quot;&#x2F;bin&#x2F;foo&amp;quot;).statement(&amp;quot;*@file.c:443&amp;quot;) { log($$vars) }&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt; -c &#x2F;bin&#x2F;foo&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;And that&#x27;s it. You can read SystemTap&#x27;s documentation, or
&lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;sourceware.org&#x2F;systemtap&#x2F;wiki&#x2F;AddingUserSpaceProbingToApps&quot;&gt;this&lt;&#x2F;a&gt;
guide to learn how to add userspace probes.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;using-gdb-with-systemtap-sdt-probes&quot;&gt;Using GDB with SystemTap SDT Probes&lt;&#x2F;h2&gt;
&lt;p&gt;Well, now let&#x27;s get to the interesting part. It is time to make &lt;code&gt;GDB&lt;&#x2F;code&gt;
work with the &lt;code&gt;SDT&lt;&#x2F;code&gt; probe that we have put in our example code. Let&#x27;s
remember it:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E6EDF3; background-color: #0D1117;&quot;&gt;&lt;code data-lang=&quot;c&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;#include&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt; &amp;lt;sys&#x2F;sdt.h&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;int&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #D2A8FF;&quot;&gt;main&lt;&#x2F;span&gt;&lt;span&gt; (&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;int&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFA657;&quot;&gt; argc&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt; char *&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFA657;&quot;&gt;argv&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;[]&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;{&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;  int&lt;&#x2F;span&gt;&lt;span&gt; a &lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt; 10&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #D2A8FF;&quot;&gt;  STAP_PROBE1&lt;&#x2F;span&gt;&lt;span&gt; (test_program, my_probe, a);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;  return&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt; 0&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;It is a very simple example, and we will have to extend it later in
order to show more features. But for now, it will do.&lt;&#x2F;p&gt;
&lt;p&gt;The first thing to do is to open &lt;code&gt;GDB&lt;&#x2F;code&gt; (with SystemTap support, of
course!), and check to see if it can actually see probe inserted in our
example.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E6EDF3; background-color: #0D1117;&quot;&gt;&lt;code data-lang=&quot;shellsession&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;$ gdb .&#x2F;test_program&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;GNU gdb (GDB) 7.5.50.20121014-cvs&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;Copyright (C) 2012 Free Software Foundation, Inc.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;License GPLv3+: GNU GPL version 3 or later &amp;lt;http:&#x2F;&#x2F;gnu.org&#x2F;licenses&#x2F;gpl.html&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;...&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;(gdb) info probes&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;Provider     Name     Where              Semaphore Object&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;test_program my_probe 0x00000000004004ae           &#x2F;home&#x2F;sergio&#x2F;work&#x2F;src&#x2F;git&#x2F;build&#x2F;gdb&#x2F;test_program&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Wow, it actually works! :-)&lt;&#x2F;p&gt;
&lt;p&gt;If you have seen something like the above, it means your &lt;code&gt;GDB&lt;&#x2F;code&gt; is
correctly recognizing &lt;code&gt;SDT&lt;&#x2F;code&gt; probes. If you see an error, or if your
&lt;code&gt;GDB&lt;&#x2F;code&gt; doesn&#x27;t have the &lt;code&gt;info probes&lt;&#x2F;code&gt; command, then you&#x27;d better make
sure you have a recent version of &lt;code&gt;GDB&lt;&#x2F;code&gt; otherwise you won&#x27;t be able to
use the &lt;code&gt;SDT&lt;&#x2F;code&gt; support.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;putting-breakpoints-in-the-code&quot;&gt;Putting breakpoints in the code&lt;&#x2F;h3&gt;
&lt;p&gt;Anyway, now it is time to start using this support. The first thing I
want to show you is how to put a breakpoint in a probe.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E6EDF3; background-color: #0D1117;&quot;&gt;&lt;code data-lang=&quot;shellsession&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;(gdb) break -probe-stap my_probe&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;Breakpoint 1 at 0x4004ae&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;That&#x27;s all! We have chosen to extend the &lt;code&gt;break&lt;&#x2F;code&gt; command in order to
support the new &lt;code&gt;-probe-stap&lt;&#x2F;code&gt; parameter. If you&#x27;re wondering &lt;em&gt;... why
the -probe prefix?&lt;&#x2F;em&gt;, it is because I was asked to implement a complete
abstraction layer inside &lt;code&gt;GDB&lt;&#x2F;code&gt; in order to allow more types of probes to
be added in the future. So, for example, if someone implements support
for an hypothetical type of probe called &lt;code&gt;xyz&lt;&#x2F;code&gt;, you would have
&lt;code&gt;break -probe-xyz&lt;&#x2F;code&gt;. It took me a little more time to implement this
layer, but it is worth the effort.&lt;&#x2F;p&gt;
&lt;p&gt;Anyway, as you have see above, &lt;code&gt;GDB&lt;&#x2F;code&gt; recognize the probe&#x27;s name and
correctly put a breakpoint in it. You can also confirm that it has done
the right thing by matching the address reported by &lt;code&gt;info probes&lt;&#x2F;code&gt; with
the one reported by &lt;code&gt;break&lt;&#x2F;code&gt;: they should be the same.&lt;&#x2F;p&gt;
&lt;p&gt;Ok, so now, with our &lt;code&gt;breakpoint&lt;&#x2F;code&gt; in place, let&#x27;s run the program and
see what happens.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E6EDF3; background-color: #0D1117;&quot;&gt;&lt;code data-lang=&quot;shellsession&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;(gdb) run&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;Starting program: &#x2F;home&#x2F;sergio&#x2F;work&#x2F;src&#x2F;git&#x2F;build&#x2F;gdb&#x2F;test_program&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;Breakpoint 1, main (argc=1, argv=0x7fffffffdf68) at &#x2F;tmp&#x2F;example-stap.c:8&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;8  STAP_PROBE1 (test_program, my_probe, a);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;As you can see, &lt;code&gt;GDB&lt;&#x2F;code&gt; stopped at the exact location of the probe.
Therefore, you are now able to put marks (i.e., probes) in your source
code which are &lt;strong&gt;location-independent&lt;&#x2F;strong&gt;. It means that it doesn&#x27;t really
matter where in the source code your probe is, and it also doesn&#x27;t
matter if you change the code around it, changing the line numbers, or
even moving it to another file. &lt;code&gt;GDB&lt;&#x2F;code&gt; will always find your probe, and
always stop at the right location. Neat!&lt;&#x2F;p&gt;
&lt;h3 id=&quot;examining-probes-arguments&quot;&gt;Examining probes&#x27; arguments&lt;&#x2F;h3&gt;
&lt;p&gt;But wait, there&#x27;s more! Remember when I told you that you could also
inspect the probe&#x27;s arguments? Yes, let&#x27;s do it now!&lt;&#x2F;p&gt;
&lt;p&gt;Just remember that, in &lt;code&gt;SDT&lt;&#x2F;code&gt;&#x27;s parlance, the current probe&#x27;s argument is
&lt;code&gt;a&lt;&#x2F;code&gt;. So let&#x27;s print its value.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E6EDF3; background-color: #0D1117;&quot;&gt;&lt;code data-lang=&quot;shellsession&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;(gdb) p $_probe_arg0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;$1 = 10&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;(gdb) p a&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;$2 = 10&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;em&gt;&quot;Hey, captain, it seems the boat really floats!&quot;&lt;&#x2F;em&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Check the source code above, and convince yourself that &lt;code&gt;a&lt;&#x2F;code&gt;&#x27;s value is
&lt;code&gt;10&lt;&#x2F;code&gt; :-). As you might have seen, I have used a fairly strange way of
printing it. It is because the probe&#x27;s arguments are available inside
&lt;code&gt;GDB&lt;&#x2F;code&gt; by means of &lt;strong&gt;convenience variables&lt;&#x2F;strong&gt;. You can see a list of them
&lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;sourceware.org&#x2F;gdb&#x2F;current&#x2F;onlinedocs&#x2F;gdb&#x2F;Convenience-Vars.html#Convenience-Vars&quot;&gt;here&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Since &lt;code&gt;SDT&lt;&#x2F;code&gt; probes can have up to 12 arguments (i.e., you can use
&lt;code&gt;STAP_PROBE1&lt;&#x2F;code&gt; ... &lt;code&gt;STAP_PROBE12&lt;&#x2F;code&gt;), we have created inside &lt;code&gt;GDB&lt;&#x2F;code&gt; 12
convenience variables, named &lt;code&gt;$_probe_arg0&lt;&#x2F;code&gt; until &lt;code&gt;$_probe_arg11&lt;&#x2F;code&gt;. I
know, it is not an easy name to remember, and even the relation between
&lt;code&gt;SDT&lt;&#x2F;code&gt; naming and &lt;code&gt;GDB&lt;&#x2F;code&gt; naming is not direct (i.e., you have to subtract
1 from the &lt;code&gt;SDT&lt;&#x2F;code&gt; probe number). If you are not satisfied with this,
please open a bug in our &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;sourceware.org&#x2F;bugzilla&#x2F;&quot;&gt;bugzilla&lt;&#x2F;a&gt; and
I promise we will discuss other options.&lt;&#x2F;p&gt;
&lt;p&gt;I would like to emphasize something here: just as you don&#x27;t need
debuginfo support for dealing with probes inside &lt;code&gt;GDB&lt;&#x2F;code&gt;, you also don&#x27;t
need debuginfo support for dealing with their arguments as well. It
means that you can actually compile your code without debuginfo support,
but still have access to some important variables&#x2F;expressions when
debugging it. Depending on how &lt;code&gt;GCC&lt;&#x2F;code&gt; optimizes your code, you may
experience some difficulties with argument printing, but so far I
haven&#x27;t heard of anything like that.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;more-to-come&quot;&gt;More to come&lt;&#x2F;h2&gt;
&lt;p&gt;Ok, now we have covered more things about the &lt;code&gt;SDT&lt;&#x2F;code&gt; probe support inside
&lt;code&gt;GDB&lt;&#x2F;code&gt;, and I hope you understood all the concepts. It is not hard to get
things going with this, specially because you don&#x27;t need extra libraries
to make it work.&lt;&#x2F;p&gt;
&lt;p&gt;In the next post, I intend to finish this series by explaining how to
use &lt;code&gt;tracepoints&lt;&#x2F;code&gt; with &lt;code&gt;SDT&lt;&#x2F;code&gt; probes. Also, as I said in the previous
post of this series, maybe I will talk a little bit about how the &lt;code&gt;SDT&lt;&#x2F;code&gt;
probes are organized within the binary.&lt;&#x2F;p&gt;
&lt;p&gt;See you soon!&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Relato das Apresentações na UNESP de Rio Claro&#x2F;SP</title>
        <published>2012-10-24T00:00:00-05:00</published>
        <updated>2012-10-24T00:00:00-05:00</updated>
        
        <author>
          <name>
            
              Sergio Durigan Junior
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://blog.sergiodj.net/posts/relato-apresentacao-fedora-unesp-rio-claro/"/>
        <id>https://blog.sergiodj.net/posts/relato-apresentacao-fedora-unesp-rio-claro/</id>
        
        <content type="html" xml:base="https://blog.sergiodj.net/posts/relato-apresentacao-fedora-unesp-rio-claro/">&lt;p&gt;Conforme eu havia comentado
no
&lt;a href=&quot;https:&#x2F;&#x2F;blog.sergiodj.net&#x2F;posts&#x2F;relato-apresentacao-fedora-unesp-rio-claro&#x2F;%7Bfilename%7D&#x2F;2012-10-23-apresentacao-fedora-unesp-rio-claro.md&quot;&gt;post anterior&lt;&#x2F;a&gt;,
segue o relato sobre as apresentações que fiz
na
&lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;www.rc.unesp.br&#x2F;seccomp&#x2F;?p=Programacao&quot;&gt;Semana da Computação&lt;&#x2F;a&gt;
da &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;www.rc.unesp.br&#x2F;&quot;&gt;UNESP de Rio Claro&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;TL;DR:&lt;&#x2F;strong&gt; &lt;em&gt;Gostei de ter tido a oportunidade de dar as apresentações,
e principalmente de ter feito minha primeira palestra
como &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;fedoraproject.org&#x2F;wiki&#x2F;Ambassadors&quot;&gt;Embaixador&lt;&#x2F;a&gt;
do &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;projetofedora.org&#x2F;wiki&quot;&gt;Projeto Fedora&lt;&#x2F;a&gt; no Brasil. Sobre a
palestra a respeito do &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;www.gnu.org&#x2F;s&#x2F;gdb&quot;&gt;GDB&lt;&#x2F;a&gt;, também gostei
do jeito que ela foi conduzida. Notei algumas falhas que precisam ser
corrigidas, mas no geral a experiência foi muito boa.&lt;&#x2F;em&gt;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;apresentacao-o-projeto-fedora&quot;&gt;Apresentação &quot;O Projeto Fedora&quot;&lt;&#x2F;h2&gt;
&lt;p&gt;Foi a primeira apresentação da noite, de acordo com a grade de
programação. Começou meia hora atrasada, pois a organização pediu para
esperarmos mais pessoas chegarem (estava chovendo bastante no momento, o
que dificultou a locomoção).&lt;&#x2F;p&gt;
&lt;p&gt;Comecei a palestra falando um pouco sobre o Projeto Fedora. Acabei
passando rapidamente pelas origens do projeto, uma falha que pretendo
corrigir em próximas ocasiões. Dei muita ênfase na definição de
&lt;strong&gt;comunidade&lt;&#x2F;strong&gt; e no que isso significa quando lidamos com software
livre. Confesso que fiz algumas comparações com o Ubuntu, o que talvez
não tenha sido uma boa idéia (de acordo com os &lt;em&gt;guidelines&lt;&#x2F;em&gt; do Projeto
Fedora para Embaixadores). De qualquer modo, a mensagem foi passada e
notei que algumas pessoas se interessaram em conhecer mais a respeito do
projeto e da filosofia.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Pontos positivos&lt;&#x2F;strong&gt;: Creio ter conseguido informar as pessoas a
respeito do projeto, com a ajuda dos ótimos slides do &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;fedoraproject.org&#x2F;wiki&#x2F;User:Pfrields&quot;&gt;Paul W.
Frields&lt;&#x2F;a&gt;. É sempre
gratificante dar palestras, mesmo que apenas uma ou duas pessoas no
final acabem se interessando de verdade. Além disso, me senti bem por
estar divulgando um projeto que respeita as liberdades dos usuários (ou
pelo menos tenta fazer isso ao máximo), e que eu realmente uso e gosto.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Pontos a serem melhorados&lt;&#x2F;strong&gt;: Fazer uma palestra um pouco menos
&quot;pessoal&quot;. É muito difícil conseguir isso, mas tenho a forte impressão
de que minha orientação totalmente pró-software-livre acaba (às vezes)
afastando algumas pessoas, que vêem no entusiasta por software livre uma
pessoa &quot;radical&quot; e &quot;xiita&quot;. Preciso pensar um pouco a respeito do
assunto...&lt;&#x2F;p&gt;
&lt;p&gt;A conclusão é que fiquei bastante satisfeito com o resultado da
palestra. Percebi que, depois dela, algumas pessoas vieram comentar que
estavam utilizando Fedora, ou que já andavam pensando em trocar de
distribuição, que agora o Fedora era uma opção. O objetivo foi cumprido
:-).&lt;&#x2F;p&gt;
&lt;h2 id=&quot;apresentacao-gdb-crash-course&quot;&gt;Apresentação &quot;GDB Crash Course&quot;&lt;&#x2F;h2&gt;
&lt;p&gt;Creio que essa já é a quarta vez que apresento essa palestra, e a
terceira vez junto com meu amigo
&lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;twitter.com&#x2F;nottooamused&quot;&gt;Edjunior&lt;&#x2F;a&gt;. Sempre que ela termina,
fico(amos) com a impressão de que ainda não acertamos no ponto, e dessa
vez não foi diferente.&lt;&#x2F;p&gt;
&lt;p&gt;A palestra começou em ponto, às 21h, e decidimos tentar uma abordagem um
pouco diferente. A última vez que apresentamos a palestra foi no evento
da &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;www.semanaintegrada.com.br&#x2F;2012&#x2F;&quot;&gt;Semana Integrada&lt;&#x2F;a&gt; da &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;www.puc-campinas.edu.br&#x2F;&quot;&gt;PUC
Campinas&lt;&#x2F;a&gt;. Naquela ocasião, tínhamos
optado por começar falando mais sobre os comandos do &lt;code&gt;GDB&lt;&#x2F;code&gt;, e depois
mostrarmos como a coisa funciona, estilo &lt;em&gt;hands-on&lt;&#x2F;em&gt;. Dessa vez,
resolvemos ir mostrando a prática junto com a teoria. Ficou melhor, e
acho que a apresentação ficou mais fluida, mas ainda assim esbarramos no
velho problema da interdependência dos comandos: quando íamos falar
sobre &lt;code&gt;breakpoints&lt;&#x2F;code&gt;, precisávamos ter mostrado algum outro comando que
só iria ser explicado mais à frente, que por sua vez iria precisar de
outro comando, que iria precisar de &lt;code&gt;breakpoints&lt;&#x2F;code&gt;, etc. Enfim, no final
acabamos sendo obrigados a pular alguns comandos, e a adiantar a
explicação de outros, quebrando um pouco o fluxo dos slides.&lt;&#x2F;p&gt;
&lt;p&gt;Notei que algumas pessoas estavam bastante interessadas no &lt;code&gt;GDB&lt;&#x2F;code&gt;, talvez
por já programarem há algum tempo. As outras, aparentemente, ainda não
conseguiam ver muita utilidade para um depurador, mas mesmo assim
tentavam aprender algo que talvez fosse lhes servir no futuro.&lt;&#x2F;p&gt;
&lt;p&gt;Já era de se esperar, mas mesmo assim não deixo de me surpreender quando
vejo que uma palestra técnica consegue atrair muito mais atenção do que
uma palestra &quot;filosófica&quot;, como foi a do Projeto Fedora. Talvez seja
reflexo da sociedade em que vivemos, ou talvez seja apenas uma impressão
errônea da minha parte.&lt;&#x2F;p&gt;
&lt;p&gt;A conclusão, finalmente, é que a palestra parece ter sido útil para
algumas pessoas (mesmo que poucas), e isso nos dá ainda mais fôlego pra
continuarmos tentando divulgar esse projeto pouco conhecido (mas muito
útil) que é o &lt;code&gt;GDB&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;agradecimentos&quot;&gt;Agradecimentos&lt;&#x2F;h2&gt;
&lt;p&gt;Não poderia deixar de agradecer primeiramente à organização da SECCOMP
da UNESP de Rio Claro pelo ótimo evento. Fiquei surpreso com a
infra-estrutura e, principalmente, com a receptividade das pessoas.
Gostei muito do ambiente descontraído, e espero não ter decepcionado
muita gente por lá com meus comentários informais e caipiras durante as
palestras :-).&lt;&#x2F;p&gt;
&lt;p&gt;Também agradeço ao meu amigo Edjunior por ter me acompanhado até sua
&lt;em&gt;alma matter&lt;&#x2F;em&gt; para me ajudar na realização da palestra sobre o &lt;code&gt;GDB&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Até a próxima!&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Apresentação na UNESP de Rio Claro&#x2F;SP</title>
        <published>2012-10-23T00:00:00-05:00</published>
        <updated>2012-10-23T00:00:00-05:00</updated>
        
        <author>
          <name>
            
              Sergio Durigan Junior
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://blog.sergiodj.net/posts/apresentacao-fedora-unesp-rio-claro/"/>
        <id>https://blog.sergiodj.net/posts/apresentacao-fedora-unesp-rio-claro/</id>
        
        <content type="html" xml:base="https://blog.sergiodj.net/posts/apresentacao-fedora-unesp-rio-claro/">&lt;p&gt;Hoje, dia 23&#x2F;10&#x2F;2012, estarei na &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;www.rc.unesp.br&#x2F;&quot;&gt;UNESP de Rio
Claro&lt;&#x2F;a&gt; para dar duas apresentações na &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;www.rc.unesp.br&#x2F;seccomp&#x2F;?p=Programacao&quot;&gt;Semana
da Computação&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;A primeira palestra será sobre o &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;projetofedora.org&#x2F;wiki&quot;&gt;Projeto
Fedora&lt;&#x2F;a&gt;. Vai ser a primeira vez que
falarei sobre o projeto depois de ter me tornado
&lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;fedoraproject.org&#x2F;wiki&#x2F;Ambassadors&quot;&gt;Embaixador&lt;&#x2F;a&gt; do Fedora no
Brasil. Confesso que estou um pouco apreensivo, mas escolhi slides muito
bons feitos pelo &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;fedoraproject.org&#x2F;wiki&#x2F;User:Pfrields&quot;&gt;Paul W.
Frields&lt;&#x2F;a&gt;, ex-líder do
Projeto e bastante competente em suas apresentações. Pretendo fazer um
relato sobre a palestra na quarta-feira.&lt;&#x2F;p&gt;
&lt;p&gt;A segunda apresentação será sobre o &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;www.gnu.org&#x2F;s&#x2F;gdb&quot;&gt;GDB&lt;&#x2F;a&gt;.
Essa apresentação vai ser mais um &lt;em&gt;crash course&lt;&#x2F;em&gt; sobre como utilizar a
ferramenta, e os slides estão disponíveis em
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;sergiodj&#x2F;gdb-unicamp2011&quot;&gt;https:&#x2F;&#x2F;github.com&#x2F;sergiodj&#x2F;gdb-unicamp2011&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Espero que ambas as palestras sejam bem recebidas pelo público! Volto
depois pra contar como foi :-).&lt;&#x2F;p&gt;
&lt;p&gt;Abraços.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>GDB and SystemTap probes -- part 1</title>
        <published>2012-03-29T00:00:00-05:00</published>
        <updated>2012-03-29T00:00:00-05:00</updated>
        
        <author>
          <name>
            
              Sergio Durigan Junior
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://blog.sergiodj.net/posts/gdb-and-systemtap-probes-part-1/"/>
        <id>https://blog.sergiodj.net/posts/gdb-and-systemtap-probes-part-1/</id>
        
        <content type="html" xml:base="https://blog.sergiodj.net/posts/gdb-and-systemtap-probes-part-1/">&lt;p&gt;After a long time, here we are again :-).&lt;&#x2F;p&gt;
&lt;p&gt;With this post I will start to talk about the integration between GDB
and SystemTap. This is something that &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;tromey.com&#x2F;blog&#x2F;&quot;&gt;Tom
Tromey&lt;&#x2F;a&gt; and I did during the last year. The
patch is being reviewed as I write this post, and I expect to see it
checked-in in the next few days&#x2F;weeks. But let&#x27;s get our hands dirty...&lt;&#x2F;p&gt;
&lt;h2 id=&quot;systemtap-userspace-probes&quot;&gt;SystemTap Userspace Probes&lt;&#x2F;h2&gt;
&lt;p&gt;You probably use (or have at least heard of) SystemTap, and maybe you
think the tool is only useful for kernel inspections. If that&#x27;s your
case, I have a good news: you&#x27;re wrong! You can actually use SystemTap
to inspect userspace applications too, by using what we call &lt;strong&gt;SDT
probes&lt;&#x2F;strong&gt;, or &lt;em&gt;S&lt;&#x2F;em&gt;tatic &lt;em&gt;D&lt;&#x2F;em&gt;efined &lt;em&gt;T&lt;&#x2F;em&gt;racing probes. This is a very cheap
and easy way to include probes in your application, and you can even
specify arguments to those probes.&lt;&#x2F;p&gt;
&lt;p&gt;In order to use the probes (see an example below), you must include the
&lt;code&gt;&amp;lt;sys&#x2F;sdt.h&amp;gt;&lt;&#x2F;code&gt; header file in your source code. If you are using Fedora
systems, you can obtain this header file by installing the package
&lt;code&gt;systemtap-sdt-devel&lt;&#x2F;code&gt;, version equal or greater than &lt;code&gt;1.4&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Here&#x27;s a simple example of an application with a one-argument probe:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E6EDF3; background-color: #0D1117;&quot;&gt;&lt;code data-lang=&quot;c&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;#include&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt; &amp;lt;sys&#x2F;sdt.h&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;int&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #D2A8FF;&quot;&gt;main&lt;&#x2F;span&gt;&lt;span&gt; (&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;int&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFA657;&quot;&gt; argc&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt; char *&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFA657;&quot;&gt;argv&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;[]&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;{&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;  int&lt;&#x2F;span&gt;&lt;span&gt; a &lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt; 10&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #D2A8FF;&quot;&gt;  STAP_PROBE1&lt;&#x2F;span&gt;&lt;span&gt; (test_program, my_probe, a);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF7B72;&quot;&gt;  return&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt; 0&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;As you can see, this is a very simple program with one probe, which
contains one argument. You can now compile the program:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E6EDF3; background-color: #0D1117;&quot;&gt;&lt;code data-lang=&quot;shellsession&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;$ gcc test_program.c -o test_program&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Now you must be thinking: &quot;&lt;em&gt;Wait, wait... Didn&#x27;t you just forget to link
this program against some SystemTap-specific library or something?&lt;&#x2F;em&gt;&quot; And
my answer is &lt;strong&gt;no&lt;&#x2F;strong&gt;. One of the spetacular things about this
&lt;code&gt;&amp;lt;sys&#x2F;sdt.h&amp;gt;&lt;&#x2F;code&gt; header is that it does not have any dependencies at all!
As Tom said in &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;tromey.com&#x2F;blog&#x2F;?p=687&quot;&gt;his blog post&lt;&#x2F;a&gt;, this is
&quot;&lt;em&gt;a virtuoso display of ELF and GCC asm wizardy&lt;&#x2F;em&gt;&quot;.&lt;&#x2F;p&gt;
&lt;p&gt;If you want to make sure your probe was inserted in the binary, you can
use &lt;code&gt;readelf&lt;&#x2F;code&gt; command:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E6EDF3; background-color: #0D1117;&quot;&gt;&lt;code data-lang=&quot;shellsession&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;$ readelf -x .note.stapsdt .&#x2F;test_program&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;Hex dump of section &amp;#39;.note.stapsdt&amp;#39;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;  0x00000000 08000000 3a000000 03000000 73746170 ....:.......stap&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;  0x00000010 73647400 86044000 00000000 88054000 sdt...@.......@.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;  0x00000020 00000000 00000000 00000000 74657374 ............test&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;  0x00000030 5f70726f 6772616d 006d795f 70726f62 _program.my_prob&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;  0x00000040 65002d34 402d3428 25726270 29000000 e.-4@-4(%rbp)...&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;em&gt;(I will think about writing an explanation on how the probes are laid
out on the binary, but for now you just have to care if you actually
see an output from this&lt;&#x2F;em&gt; &lt;code&gt;readelf&lt;&#x2F;code&gt; &lt;em&gt;command.)&lt;&#x2F;em&gt;&lt;&#x2F;p&gt;
&lt;p&gt;You can also use SystemTap to perform this verification:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E6EDF3; background-color: #0D1117;&quot;&gt;&lt;code data-lang=&quot;shellsession&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;$ stap -L &lt;&#x2F;span&gt;&lt;span style=&quot;color: #A5D6FF;&quot;&gt;&amp;#39;process(&amp;quot;.&#x2F;test_program&amp;quot;).mark(&amp;quot;*&amp;quot;)&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79C0FF;&quot;&gt;process(&amp;quot;.&#x2F;test_program&amp;quot;).mark(&amp;quot;my_probe&amp;quot;) $arg1:long&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;So far, so good. If you see an output like the one above, it means your
probe is correctly inserted. You could obviously use SystemTap to
inspect this probe, but I won&#x27;t do this right now because this is not
the purpose of this post.&lt;&#x2F;p&gt;
&lt;p&gt;For now, we have learned how to:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Include an &lt;code&gt;SDT probe&lt;&#x2F;code&gt; in our source code, and compile it;&lt;&#x2F;li&gt;
&lt;li&gt;Verify if the probe was correctly inserted.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;In the next post, I will talk about the GDB support that allows you to
inspect, print arguments, and gather other information about
&lt;code&gt;SDT probes&lt;&#x2F;code&gt;. I hope you like it!&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>My workflow with GDB and git -- part 1</title>
        <published>2011-11-29T00:00:00-05:00</published>
        <updated>2011-11-29T00:00:00-05:00</updated>
        
        <author>
          <name>
            
              Sergio Durigan Junior
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://blog.sergiodj.net/posts/my-workflow-with-gdb-and-git-part-1/"/>
        <id>https://blog.sergiodj.net/posts/my-workflow-with-gdb-and-git-part-1/</id>
        
        <content type="html" xml:base="https://blog.sergiodj.net/posts/my-workflow-with-gdb-and-git-part-1/">&lt;p&gt;This post is actually a &quot;reply&quot; to Gary Benson&#x27;s &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;gbenson.net&#x2F;?p=292&quot;&gt;Working on
gdb&lt;&#x2F;a&gt; post.&lt;&#x2F;p&gt;
&lt;p&gt;I have been working with &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;www.gnu.org&#x2F;s&#x2F;gdb&#x2F;&quot;&gt;GDB&lt;&#x2F;a&gt; for quite some
time now, and even though the project officially uses
&lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Concurrent_Versions_System&quot;&gt;CVS&lt;&#x2F;a&gt; (yes, you
read it correctly, it is &lt;strong&gt;CVS&lt;&#x2F;strong&gt; indeed!) as its version control system,
fortunately we also have a
&lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Git_%28software%29&quot;&gt;git&lt;&#x2F;a&gt; mirror. In the
end, what happens is that almost every developer uses the git mirror and
just goes to CVS to commit something. But this is another discussion.
Aside of this git mirror, we also have the
&lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;sourceware.org&#x2F;gdb&#x2F;wiki&#x2F;ProjectArcher&quot;&gt;Archer&lt;&#x2F;a&gt; repository (which
uses git by default).&lt;&#x2F;p&gt;
&lt;p&gt;My plan here is to show you how I do my daily work with GDB. The
workflow is pretty simple, but maybe you will see something here that
might help you.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;checking-out-the-code&quot;&gt;Checking out the code&lt;&#x2F;h2&gt;
&lt;p&gt;The first thing to do is to check out the code. I only have one GDB
repository here, and I make branches out of it whenever I want to hack.
So, to check out (or &lt;em&gt;clone&lt;&#x2F;em&gt;, in git&#x27;s parlance) the code, I do (or
did):&lt;&#x2F;p&gt;
&lt;p&gt;With this, we have just cloned the GDB repository, and also added
another remote (i.e., repository). This is useful because we might want
to hack on a branch which is on Archer, but use GDB&#x27;s &lt;strong&gt;master&lt;&#x2F;strong&gt; branch
as a base.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;create-a-new-branch-for-your-work&quot;&gt;Create a new branch for your work&lt;&#x2F;h2&gt;
&lt;p&gt;So, now it&#x27;s time to create a new branch for you. Here I use one of my
little &quot;tricks&quot; (taught to me by my friend
&lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;dodji.seketeli.net&#x2F;&quot;&gt;Dodji&lt;&#x2F;a&gt;), which is the command
&lt;code&gt;git-new-workdir&lt;&#x2F;code&gt;. This is a nice command because it creates a new
working directory for your project!&lt;&#x2F;p&gt;
&lt;p&gt;Maybe you&#x27;re wondering why this is so cool. Well, if you ever worked
with git, and more specifically, if you ever used more than one branch
at a time, then maybe you will understand my excitement. In this
scenario, having to constantly switch between the branches is not
something rare. When you have uncommited work in your tree you can
always use &lt;code&gt;git stash&lt;&#x2F;code&gt;, but that is not the ideal solution (for me).
Sometimes I would forget what was on the stash, and later when I checked
it, it was full of crap. Also, I like to have a separate directory for
every project I am working on.&lt;&#x2F;p&gt;
&lt;p&gt;It is also important to mention that &lt;code&gt;git-new-workdir&lt;&#x2F;code&gt; is under the
directory &lt;code&gt;&#x2F;usr&#x2F;share&#x2F;doc&#x2F;git-VERSION&#x2F;contrib&#x2F;workdir&#x2F;&lt;&#x2F;code&gt;, so I created an
alias that will automagically call the script for me:&lt;&#x2F;p&gt;
&lt;p&gt;So, after setting up the script, here is what I do:&lt;&#x2F;p&gt;
&lt;h2 id=&quot;build-gdb&quot;&gt;Build GDB&lt;&#x2F;h2&gt;
&lt;p&gt;In order to build the project, I create a &lt;code&gt;build-64&lt;&#x2F;code&gt; directory inside my
project directory (which, in the example above, is
&lt;code&gt;work&#x2F;lazy-debuginfo-reading&lt;&#x2F;code&gt;).&lt;&#x2F;p&gt;
&lt;p&gt;GDB fortunately supports VPATH building (i.e., build the project outside
of the source tree). I strongly recommend you to use it.&lt;&#x2F;p&gt;
&lt;p&gt;As you may have noticed, I use &lt;code&gt;-g3&lt;&#x2F;code&gt; (include debuginfo) and &lt;code&gt;-O0&lt;&#x2F;code&gt; (do
not optimize the code) in &lt;code&gt;CFLAGS&lt;&#x2F;code&gt;. Also, since some of the features I
work on may affect code in other architectures, I use
&lt;code&gt;--enable-targets=all&lt;&#x2F;code&gt;. It will tell configure to compile everything
related to all architectures (not only &lt;code&gt;x86_64&lt;&#x2F;code&gt;, for example). At last,
I specify a separate debug directory which GDB should use to search for
debuginfo files.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;finalizing-for-now&quot;&gt;Finalizing (for now)&lt;&#x2F;h2&gt;
&lt;p&gt;After that, you will have a fresh GDB binary compiled in the &lt;code&gt;build-64&lt;&#x2F;code&gt;
directory. But that is not enough yet, since you will also want to test
GDB and make sure you didn&#x27;t insert a bug while hacking on it. In my
next post, I will explain what is my &quot;testflow&quot;. I hope it will be
useful for someone :-).&lt;&#x2F;p&gt;
&lt;p&gt;Stay tuned!&lt;&#x2F;p&gt;
</content>
        
    </entry>
</feed>
