<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/tools/perf/util/evlist.c, branch linux-5.10.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.10.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.10.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2021-03-04T10:38:09Z</updated>
<entry>
<title>perf record: Fix continue profiling after draining the buffer</title>
<updated>2021-03-04T10:38:09Z</updated>
<author>
<name>Yang Jihong</name>
</author>
<published>2021-02-05T06:50:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=47d32f8becec0fb4d8bb769064504582615b5b0c'/>
<id>urn:sha1:47d32f8becec0fb4d8bb769064504582615b5b0c</id>
<content type='text'>
[ Upstream commit e16c2ce7c5ed5de881066c1fd10ba5c09af69559 ]

Commit da231338ec9c0987 ("perf record: Use an eventfd to wakeup when
done") uses eventfd() to solve a rare race where the setting and
checking of 'done' which add done_fd to pollfd.  When draining buffer,
revents of done_fd is 0 and evlist__filter_pollfd function returns a
non-zero value.  As a result, perf record does not stop profiling.

The following simple scenarios can trigger this condition:

  # sleep 10 &amp;
  # perf record -p $!

After the sleep process exits, perf record should stop profiling and exit.
However, perf record keeps running.

If pollfd revents contains only POLLERR or POLLHUP, perf record
indicates that buffer is draining and need to stop profiling.  Use
fdarray_flag__nonfilterable() to set done eventfd to nonfilterable
objects, so that evlist__filter_pollfd() does not filter and check done
eventfd.

Fixes: da231338ec9c0987 ("perf record: Use an eventfd to wakeup when done")
Signed-off-by: Yang Jihong &lt;yangjihong1@huawei.com&gt;
Tested-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
Tested-by: Jiri Olsa &lt;jolsa@redhat.com&gt;
Cc: Adrian Hunter &lt;adrian.hunter@intel.com&gt;
Cc: Alexander Shishkin &lt;alexander.shishkin@linux.intel.com&gt;
Cc: Alexey Budankov &lt;alexey.budankov@linux.intel.com&gt;
Cc: Mark Rutland &lt;mark.rutland@arm.com&gt;
Cc: Namhyung Kim &lt;namhyung@kernel.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: zhangjinhao2@huawei.com
Link: http://lore.kernel.org/lkml/20210205065001.23252-1-yangjihong1@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>perf tools: Copy metric events properly when expand cgroups</title>
<updated>2020-09-28T12:16:21Z</updated>
<author>
<name>Namhyung Kim</name>
</author>
<published>2020-09-24T12:44:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b214ba8c4275d66029ad34ad222326dca43e7e26'/>
<id>urn:sha1:b214ba8c4275d66029ad34ad222326dca43e7e26</id>
<content type='text'>
The metricgroup__copy_metric_events() is to handle metrics events when
expanding event for cgroups.  As the metric events keep pointers to
evsel, it should be refreshed when events are cloned during the
operation.

The perf_stat__collect_metric_expr() is also called in case an event has
a metric directly.

During the copy, it references evsel by index as the evlist now has
cloned evsels for the given cgroup.

Also kernel test robot found an issue in the python module import so add
empty implementations of those two functions to fix it.

Reported-by: kernel test robot &lt;rong.a.chen@intel.com&gt;
Signed-off-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
Acked-by: Jiri Olsa &lt;jolsa@redhat.com&gt;
Cc: Alexander Shishkin &lt;alexander.shishkin@linux.intel.com&gt;
Cc: Andi Kleen &lt;ak@linux.intel.com&gt;
Cc: Ian Rogers &lt;irogers@google.com&gt;
Cc: John Garry &lt;john.garry@huawei.com&gt;
Cc: Kajol Jain &lt;kjain@linux.ibm.com&gt;
Cc: Mark Rutland &lt;mark.rutland@arm.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Stephane Eranian &lt;eranian@google.com&gt;
Link: http://lore.kernel.org/lkml/20200924124455.336326-4-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>Merge remote-tracking branch 'torvalds/master' into perf/core</title>
<updated>2020-09-17T18:45:05Z</updated>
<author>
<name>Arnaldo Carvalho de Melo</name>
</author>
<published>2020-09-17T18:45:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=056c1722014104b70d36fe71b683f71637f1a708'/>
<id>urn:sha1:056c1722014104b70d36fe71b683f71637f1a708</id>
<content type='text'>
To pick up fixes.

Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>perf evlist: Fix cpu/thread map leak</title>
<updated>2020-09-15T11:59:26Z</updated>
<author>
<name>Namhyung Kim</name>
</author>
<published>2020-09-15T03:18:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=bfd1b83d75e44a9f65de30accb3dd3b5940bd3ac'/>
<id>urn:sha1:bfd1b83d75e44a9f65de30accb3dd3b5940bd3ac</id>
<content type='text'>
Asan reported leak of cpu and thread maps as they have one more refcount
than released.  I found that after setting evlist maps it should release
it's refcount.

It seems to be broken from the beginning so I chose the original commit
as the culprit.  But not sure how it's applied to stable trees since
there are many changes in the code after that.

Fixes: 7e2ed097538c5 ("perf evlist: Store pointer to the cpu and thread maps")
Fixes: 4112eb1899c0e ("perf evlist: Default to syswide target when no thread/cpu maps set")
Signed-off-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
Acked-by: Jiri Olsa &lt;jolsa@redhat.com&gt;
Cc: Alexander Shishkin &lt;alexander.shishkin@linux.intel.com&gt;
Cc: Andi Kleen &lt;ak@linux.intel.com&gt;
Cc: Ian Rogers &lt;irogers@google.com&gt;
Cc: Mark Rutland &lt;mark.rutland@arm.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Stephane Eranian &lt;eranian@google.com&gt;
Link: http://lore.kernel.org/lkml/20200915031819.386559-4-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>perf tools: Consolidate close_control_option()'s into one function</title>
<updated>2020-09-04T19:11:16Z</updated>
<author>
<name>Adrian Hunter</name>
</author>
<published>2020-09-03T12:29:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ee7fe31e6e264d748bec5378c4d5417e14019666'/>
<id>urn:sha1:ee7fe31e6e264d748bec5378c4d5417e14019666</id>
<content type='text'>
Consolidate control option fifo closing into one function.

Signed-off-by: Adrian Hunter &lt;adrian.hunter@intel.com&gt;
Suggested-by: Alexey Budankov &lt;alexey.budankov@linux.intel.com&gt;
Cc: Andi Kleen &lt;ak@linux.intel.com&gt;
Cc: Jiri Olsa &lt;jolsa@redhat.com&gt;
Cc: Namhyung Kim &lt;namhyung@kernel.org&gt;
Link: http://lore.kernel.org/lkml/20200903122937.25691-1-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>perf record: Add 'snapshot' control command</title>
<updated>2020-09-04T17:38:15Z</updated>
<author>
<name>Adrian Hunter</name>
</author>
<published>2020-09-01T09:37:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d20aff1512f013fab79b8740427b7574569a9a2e'/>
<id>urn:sha1:d20aff1512f013fab79b8740427b7574569a9a2e</id>
<content type='text'>
Add 'snapshot' control command to create an AUX area tracing snapshot
the same as if sending SIGUSR2. The advantage of the FIFO is that access
is governed by access to the FIFO.

Example:

  $ mkfifo perf.control
  $ mkfifo perf.ack
  $ cat perf.ack &amp;
  [1] 15235
  $ sudo ~/bin/perf record --control fifo:perf.control,perf.ack -S -e intel_pt//u -- sleep 60 &amp;
  [2] 15243
  $ ps -e | grep perf
   15244 pts/1    00:00:00 perf
  $ kill -USR2 15244
  bash: kill: (15244) - Operation not permitted
  $ echo snapshot &gt; perf.control
  ack
  $

Signed-off-by: Adrian Hunter &lt;adrian.hunter@intel.com&gt;
Acked-by: Alexey Budankov &lt;alexey.budankov@linux.intel.com&gt;
Acked-by: Jiri Olsa &lt;jolsa@redhat.com&gt;
Tested-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
Cc: Andi Kleen &lt;ak@linux.intel.com&gt;
Cc: Namhyung Kim &lt;namhyung@kernel.org&gt;
Link: http://lore.kernel.org/lkml/20200901093758.32293-6-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>perf tools: Add FIFO file names as alternative options to --control</title>
<updated>2020-09-04T17:38:15Z</updated>
<author>
<name>Adrian Hunter</name>
</author>
<published>2020-09-02T10:57:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a8fcbd269b4340c36dbf99b4453bcbfe128d93fb'/>
<id>urn:sha1:a8fcbd269b4340c36dbf99b4453bcbfe128d93fb</id>
<content type='text'>
Enable the --control option to accept file names as an alternative to
file descriptors.

Example:

  $ mkfifo perf.control
  $ mkfifo perf.ack
  $ cat perf.ack &amp;
  [1] 6808
  $ perf record --control fifo:perf.control,perf.ack -- sleep 300 &amp;
  [2] 6810
  $ echo disable &gt; perf.control
  $ Events disabled
  ack

  $ echo enable &gt; perf.control
  $ Events enabled
  ack

  $ echo disable &gt; perf.control
  $ Events disabled
  ack

  $ kill %2
  [ perf record: Woken up 4 times to write data ]
  $ [ perf record: Captured and wrote 0.018 MB perf.data (7 samples) ]

  [1]-  Done                    cat perf.ack
  [2]+  Terminated              perf record --control fifo:perf.control,perf.ack -- sleep 300
  $

Signed-off-by: Adrian Hunter &lt;adrian.hunter@intel.com&gt;
Acked-by: Alexey Budankov &lt;alexey.budankov@linux.intel.com&gt;
Acked-by: Jiri Olsa &lt;jolsa@redhat.com&gt;
Tested-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
Cc: Andi Kleen &lt;ak@linux.intel.com&gt;
Cc: Namhyung Kim &lt;namhyung@kernel.org&gt;
Link: http://lore.kernel.org/lkml/20200902105707.11491-1-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>perf tools: Handle read errors from ctl_fd</title>
<updated>2020-09-04T17:38:15Z</updated>
<author>
<name>Adrian Hunter</name>
</author>
<published>2020-09-01T09:37:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=40db8ff59e75af108d695597bdbaa4828e129178'/>
<id>urn:sha1:40db8ff59e75af108d695597bdbaa4828e129178</id>
<content type='text'>
Handle read errors from ctl_fd such as EINTR, EAGAIN and EWOULDBLOCK.

Signed-off-by: Adrian Hunter &lt;adrian.hunter@intel.com&gt;
Acked-by: Alexey Budankov &lt;alexey.budankov@linux.intel.com&gt;
Acked-by: Jiri Olsa &lt;jolsa@redhat.com&gt;
Cc: Andi Kleen &lt;ak@linux.intel.com&gt;
Cc: Namhyung Kim &lt;namhyung@kernel.org&gt;
Link: http://lore.kernel.org/lkml/20200901093758.32293-3-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>perf tools: Consolidate --control option parsing into one function</title>
<updated>2020-09-04T17:38:15Z</updated>
<author>
<name>Adrian Hunter</name>
</author>
<published>2020-09-01T09:37:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9864a66defeb8df0ef1487e6d195278cf3e33666'/>
<id>urn:sha1:9864a66defeb8df0ef1487e6d195278cf3e33666</id>
<content type='text'>
Consolidate --control option parsing into one function, in preparation
for adding FIFO file name options.

Signed-off-by: Adrian Hunter &lt;adrian.hunter@intel.com&gt;
Acked-by: Alexey Budankov &lt;alexey.budankov@linux.intel.com&gt;
Acked-by: Jiri Olsa &lt;jolsa@redhat.com&gt;
Cc: Andi Kleen &lt;ak@linux.intel.com&gt;
Cc: Namhyung Kim &lt;namhyung@kernel.org&gt;
Link: http://lore.kernel.org/lkml/20200901093758.32293-2-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>perf evlist: Implement control command handling functions</title>
<updated>2020-07-22T12:28:04Z</updated>
<author>
<name>Alexey Budankov</name>
</author>
<published>2020-07-17T07:01:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ec886bf538f63934f98ef6d4f3c59bf7b5a8965c'/>
<id>urn:sha1:ec886bf538f63934f98ef6d4f3c59bf7b5a8965c</id>
<content type='text'>
Implement functions of initialization, finalization and processing of
control command messages coming from control file descriptors.

Allocate control file descriptor as descriptor at struct pollfd object
of evsel_list for atomic poll() operation.

Signed-off-by: Alexey Budankov &lt;alexey.budankov@linux.intel.com&gt;
Acked-by: Jiri Olsa &lt;jolsa@redhat.com&gt;
Acked-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
Cc: Alexander Shishkin &lt;alexander.shishkin@linux.intel.com&gt;
Cc: Andi Kleen &lt;ak@linux.intel.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Link: http://lore.kernel.org/lkml/62518ceb-1cc9-2aba-593b-55408d07c1bf@linux.intel.com
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
</feed>
