<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/tools/perf/util/event.c, branch linux-3.16.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.16.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.16.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2018-11-20T18:06:04Z</updated>
<entry>
<title>perf tools: Use readdir() instead of deprecated readdir_r()</title>
<updated>2018-11-20T18:06:04Z</updated>
<author>
<name>Arnaldo Carvalho de Melo</name>
</author>
<published>2016-04-08T14:32:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=18bb810577ead97d17a4c51705d53f88c19c93d7'/>
<id>urn:sha1:18bb810577ead97d17a4c51705d53f88c19c93d7</id>
<content type='text'>
commit 7093b4c963cc4e344e490c774924a180602a7092 upstream.

The readdir() function is thread safe as long as just one thread uses a
DIR, which is the case when synthesizing events for pre-existing threads
by traversing /proc, so, to avoid breaking the build with glibc-2.23.90
(upcoming 2.24), use it instead of readdir_r().

See: http://man7.org/linux/man-pages/man3/readdir.3.html

"However, in modern implementations (including the glibc implementation),
concurrent calls to readdir() that specify different directory streams
are thread-safe.  In cases where multiple threads must read from the
same directory stream, using readdir() with external synchronization is
still preferable to the use of the deprecated readdir_r(3) function."

Noticed while building on a Fedora Rawhide docker container.

   CC       /tmp/build/perf/util/event.o
  util/event.c: In function '__event__synthesize_thread':
  util/event.c:466:2: error: 'readdir_r' is deprecated [-Werror=deprecated-declarations]
    while (!readdir_r(tasks, &amp;dirent, &amp;next) &amp;&amp; next) {
    ^~~~~
  In file included from /usr/include/features.h:368:0,
                   from /usr/include/stdint.h:25,
                   from /usr/lib/gcc/x86_64-redhat-linux/6.0.0/include/stdint.h:9,
                   from /git/linux/tools/include/linux/types.h:6,
                   from util/event.c:1:
  /usr/include/dirent.h:189:12: note: declared here

Cc: Adrian Hunter &lt;adrian.hunter@intel.com&gt;
Cc: David Ahern &lt;dsahern@gmail.com&gt;
Cc: Jiri Olsa &lt;jolsa@kernel.org&gt;
Cc: Namhyung Kim &lt;namhyung@kernel.org&gt;
Cc: Wang Nan &lt;wangnan0@huawei.com&gt;
Link: http://lkml.kernel.org/n/tip-i1vj7nyjp2p750rirxgrfd3c@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
[bwh: Backported to 3.16: adjust context]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>perf tools: handle spaces in file names obtained from /proc/pid/maps</title>
<updated>2016-04-30T22:05:46Z</updated>
<author>
<name>Marcin Ślusarz</name>
</author>
<published>2016-01-19T19:03:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3a9b8bd0bc2147d5d3f31173f080a9ed589a10d4'/>
<id>urn:sha1:3a9b8bd0bc2147d5d3f31173f080a9ed589a10d4</id>
<content type='text'>
commit 89fee59b504f86925894fcc9ba79d5c933842f93 upstream.

Steam frequently puts game binaries in folders with spaces.

Note: "(deleted)" markers are now treated as part of the file name.

Signed-off-by: Marcin Ślusarz &lt;marcin.slusarz@gmail.com&gt;
Acked-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
Fixes: 6064803313ba ("perf tools: Use sscanf for parsing /proc/pid/maps")
Link: http://lkml.kernel.org/r/20160119190303.GA17579@marcin-Inspiron-7720
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>Revert "perf: Disable PERF_RECORD_MMAP2 support"</title>
<updated>2014-06-09T11:34:46Z</updated>
<author>
<name>Don Zickus</name>
</author>
<published>2014-05-30T14:49:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a5a5ba72843dd05f991184d6cb9a4471acce1005'/>
<id>urn:sha1:a5a5ba72843dd05f991184d6cb9a4471acce1005</id>
<content type='text'>
This reverts commit 3090ffb5a2515990182f3f55b0688a7817325488.

Re-enable the mmap2 interface as we will have a user soon.

Since things have changed since perf disabled mmap2, small tweaks
to the revert had to be done:

o commit 9d4ecc88 forced (n!=8) to become (n&lt;7)
o a new libunwind test needed updating to use mmap2 interface

Signed-off-by: Don Zickus &lt;dzickus@redhat.com&gt;
Link: http://lkml.kernel.org/r/1401461382-209586-1-git-send-email-dzickus@redhat.com
Signed-off-by: Jiri Olsa &lt;jolsa@kernel.org&gt;
</content>
</entry>
<entry>
<title>perf tools: Update mmap2 interface with protection and flag bits</title>
<updated>2014-06-09T11:34:45Z</updated>
<author>
<name>Don Zickus</name>
</author>
<published>2014-05-19T19:13:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7ef807034ef33f8afe33fa7957c73954e8e4f89c'/>
<id>urn:sha1:7ef807034ef33f8afe33fa7957c73954e8e4f89c</id>
<content type='text'>
The kernel piece passes more info now.  Update the perf tool to reflect
that and adjust the synthesized maps to play along.

Signed-off-by: Don Zickus &lt;dzickus@redhat.com&gt;
Link: http://lkml.kernel.org/r/1400526833-141779-4-git-send-email-dzickus@redhat.com
Signed-off-by: Jiri Olsa &lt;jolsa@kernel.org&gt;
</content>
</entry>
<entry>
<title>perf tools: Use tid for finding thread</title>
<updated>2014-05-12T09:09:50Z</updated>
<author>
<name>Namhyung Kim</name>
</author>
<published>2014-05-12T00:56:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=13ce34df11833482cd698331fdbb3f8ced06340d'/>
<id>urn:sha1:13ce34df11833482cd698331fdbb3f8ced06340d</id>
<content type='text'>
I believe that passing pid (instead of tid) as the 3rd arg of the
machine__find*_thread() was to find a main thread so that it can
search proper map group for symbols.  However with the map sharing
patch applied, it now can do it in any thread.

It fixes a bug when each thread has different name, it only reports a
main thread for samples in other threads.

Cc: Adrian Hunter &lt;adrian.hunter@intel.com&gt;
Acked-by: David Ahern &lt;dsahern@gmail.com&gt;
Acked-by: Stephane Eranian &lt;eranian@google.com&gt;
Signed-off-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
Link: http://lkml.kernel.org/r/1399856202-26221-1-git-send-email-namhyung@kernel.org
Signed-off-by: Jiri Olsa &lt;jolsa@kernel.org&gt;
</content>
</entry>
<entry>
<title>perf tools: Allocate thread map_groups's dynamically</title>
<updated>2014-04-28T11:43:20Z</updated>
<author>
<name>Arnaldo Carvalho de Melo</name>
</author>
<published>2014-03-21T20:57:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=93d5731dcb5b8cb7fa56ee11a5891f10c96c2a45'/>
<id>urn:sha1:93d5731dcb5b8cb7fa56ee11a5891f10c96c2a45</id>
<content type='text'>
Moving towards sharing map groups within a process threads.

Because of this we need the map groups to be dynamically allocated. No
other functional change is intended in here.

Based on a patch by Jiri Olsa, but this time _just_ making the
conversion from statically allocating thread-&gt;mg to turning it into a
pointer and instead of initializing it at thread's constructor,
introduce a constructor/destructor for the map_groups class and
call at thread creation time.

Later we will introduce the get/put methods when we move to sharing
those map_groups, when the get/put refcounting semantics will be needed.

Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@kernel.org&gt;
Acked-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
Cc: Adrian Hunter &lt;adrian.hunter@intel.com&gt;
Cc: Corey Ashford &lt;cjashfor@linux.vnet.ibm.com&gt;
Cc: David Ahern &lt;dsahern@gmail.com&gt;
Cc: Don Zickus &lt;dzickus@redhat.com&gt;
Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Ingo Molnar &lt;mingo@kernel.org&gt;
Cc: Mike Galbraith &lt;efault@gmx.de&gt;
Cc: Namhyung Kim &lt;namhyung@kernel.org&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Cc: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Cc: Stephane Eranian &lt;eranian@google.com&gt;
Link: http://lkml.kernel.org/r/1397490723-1992-3-git-send-email-jolsa@redhat.com
Signed-off-by: Jiri Olsa &lt;jolsa@kernel.org&gt;
</content>
</entry>
<entry>
<title>perf tools: Fix memory leak when synthesizing thread records</title>
<updated>2014-03-18T21:17:01Z</updated>
<author>
<name>Namhyung Kim</name>
</author>
<published>2014-03-17T01:45:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=574799bfdbc3a13e0b5e2f6af34b761bde743a9a'/>
<id>urn:sha1:574799bfdbc3a13e0b5e2f6af34b761bde743a9a</id>
<content type='text'>
Checking default guest machine should be done before allocating event
structures otherwise it'll leak memory.

Signed-off-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
Cc: Don Zickus &lt;dzickus@redhat.com&gt;
Cc: Jiri Olsa &lt;jolsa@redhat.com&gt;
Cc: Joe Mario &lt;jmario@redhat.com&gt;
Link: http://lkml.kernel.org/r/87ob15tx6a.fsf@sejong.aot.lge.com
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>perf symbols: Apply all filters to an addr_location</title>
<updated>2014-03-18T21:16:58Z</updated>
<author>
<name>Namhyung Kim</name>
</author>
<published>2014-03-17T20:12:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=466fa7647413665dcba46c4f7f2b4a9808426989'/>
<id>urn:sha1:466fa7647413665dcba46c4f7f2b4a9808426989</id>
<content type='text'>
Instead of bailing out as soon as we find a filter that applies, go on
checking all of them so that we can zoom in/out filters.

We also need to make sure we only update al-&gt;filtered after
thread__find_addr_map(), because there is where al-&gt;filtered gets
initialized to zero.

This will increase the cost of processing when all we don't need this
toggling, but will provide flexibility for the TUI and GTK+ interfaces,
that will incur in creating the hist_entries just once.

Signed-off-by: Namhyung Kim &lt;namhyung.kim@lge.com&gt;
Acked-by: Jiri Olsa &lt;jolsa@redhat.com&gt;
Cc: Andi Kleen &lt;andi@firstfloor.org&gt;
Cc: David Ahern &lt;dsahern@gmail.com&gt;
Cc: Ingo Molnar &lt;mingo@kernel.org&gt;
Cc: Jiri Olsa &lt;jolsa@redhat.com&gt;
Cc: Namhyung Kim &lt;namhyung.kim@lge.com&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Cc: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Link: http://lkml.kernel.org/n/tip-fhv9lhzdjxgp9w3w3668lsfw@git.kernel.org
[ yanked this out of a previous patch ]
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>perf symbols: Record the reason for filtering an address_location</title>
<updated>2014-03-18T21:16:57Z</updated>
<author>
<name>Namhyung Kim</name>
</author>
<published>2014-03-17T19:59:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b3cef7f60f17d953545f7069f6407fc24202a64d'/>
<id>urn:sha1:b3cef7f60f17d953545f7069f6407fc24202a64d</id>
<content type='text'>
By turning the addr_location-&gt;filtered member from a boolean to a u8
bitmap, reusing (and extending) the hist_filter enum for that.

This patch doesn't change the logic at all, as it keeps the meaning of
al-&gt;filtered !0 to mean that the entry _was_ filtered, so no change in
how this value is interpreted needs to be done at this point.

This will be soon used in upcoming patches.

Signed-off-by: Namhyung Kim &lt;namhyung.kim@lge.com&gt;
Acked-by: Jiri Olsa &lt;jolsa@redhat.com&gt;
Cc: Andi Kleen &lt;andi@firstfloor.org&gt;
Cc: David Ahern &lt;dsahern@gmail.com&gt;
Cc: Ingo Molnar &lt;mingo@kernel.org&gt;
Cc: Jiri Olsa &lt;jolsa@redhat.com&gt;
Cc: Namhyung Kim &lt;namhyung.kim@lge.com&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Cc: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Link: http://lkml.kernel.org/n/tip-89hmfgtr9t22sky1lyg7nw7l@git.kernel.org
[ yanked this out of a previous patch ]
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>perf tools: Speed up thread map generation</title>
<updated>2014-03-14T21:08:41Z</updated>
<author>
<name>Don Zickus</name>
</author>
<published>2014-03-14T14:43:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=363b785f3805a2632eb09a8b430842461c21a640'/>
<id>urn:sha1:363b785f3805a2632eb09a8b430842461c21a640</id>
<content type='text'>
When trying to capture perf data on a system running spejbb2013, perf
hung for about 15 minutes.  This is because it took that long to gather
about 10,000 thread maps and process them.

I don't think a user wants to wait that long.

Instead, recognize that thread maps are roughly equivalent to pid maps
and just quickly copy those instead.

To do this, I synthesize 'fork' events, this eventually calls
thread__fork() and copies the maps over.

The overhead goes from 15 minutes down to about a few seconds.

--
V2: based on Jiri's comments, moved malloc up a level
    and made sure the memory was freed

Signed-off-by: Don Zickus &lt;dzickus@redhat.com&gt;
Acked-by: Jiri Olsa &lt;jolsa@redhat.com&gt;
Cc: Jiri Olsa &lt;jolsa@redhat.com&gt;
Cc: Joe Mario &lt;jmario@redhat.com&gt;
Link: http://lkml.kernel.org/r/1394808224-113774-1-git-send-email-dzickus@redhat.com
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
</feed>
