<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/tools/perf/builtin-daemon.c, branch linux-6.2.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.2.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.2.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2022-11-03T12:35:44Z</updated>
<entry>
<title>perf daemon: Use sig_atomic_t to avoid UB</title>
<updated>2022-11-03T12:35:44Z</updated>
<author>
<name>Ian Rogers</name>
<email>irogers@google.com</email>
</author>
<published>2022-10-24T18:19:08Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=7f3374299f9762ba7946138bf0d5cfbd50da111b'/>
<id>urn:sha1:7f3374299f9762ba7946138bf0d5cfbd50da111b</id>
<content type='text'>
Use sig_atomic_t for a variable written to in a signal handler and
read elsewhere. This is undefined behavior as per:

  https://wiki.sei.cmu.edu/confluence/display/c/SIG31-C.+Do+not+access+shared+objects+in+signal+handlers

Signed-off-by: Ian Rogers &lt;irogers@google.com&gt;
Cc: Adrian Hunter &lt;adrian.hunter@intel.com&gt;
Cc: Alexander Shishkin &lt;alexander.shishkin@linux.intel.com&gt;
Cc: Alexey Bayduraev &lt;alexey.v.bayduraev@linux.intel.com&gt;
Cc: German Gomez &lt;german.gomez@arm.com&gt;
Cc: Ingo Molnar &lt;mingo@redhat.com&gt;
Cc: Jiri Olsa &lt;jolsa@kernel.org&gt;
Cc: Leo Yan &lt;leo.yan@linaro.org&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: Stephane Eranian &lt;eranian@google.com&gt;
Link: https://lore.kernel.org/r/20221024181913.630986-4-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>perf daemon: Complete list of supported subcommand in help message</title>
<updated>2022-10-27T19:37:26Z</updated>
<author>
<name>Yang Jihong</name>
<email>yangjihong1@huawei.com</email>
</author>
<published>2022-10-22T09:27:34Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=a87edbec35725ced484f6b8275f1246ed7194329'/>
<id>urn:sha1:a87edbec35725ced484f6b8275f1246ed7194329</id>
<content type='text'>
perf daemon supports start, signal, stop and ping subcommands, complete it

Before:

  # perf daemon -h
   Usage: perf daemon start [&lt;options&gt;]
      or: perf daemon [&lt;options&gt;]

      -v, --verbose         be more verbose
      -x, --field-separator[=&lt;field separator&gt;]
                            print counts with custom separator
          --base &lt;directory&gt;
                            base directory
          --config &lt;config file&gt;
                            config file path

After:

  # perf daemon -h

   Usage: perf daemon {start|signal|stop|ping} [&lt;options&gt;]
      or: perf daemon [&lt;options&gt;]

      -v, --verbose         be more verbose
      -x, --field-separator[=&lt;field separator&gt;]
                            print counts with custom separator
          --base &lt;directory&gt;
                            base directory
          --config &lt;config file&gt;
                            config file path

Signed-off-by: Yang Jihong &lt;yangjihong1@huawei.com&gt;
Cc: Adrian Hunter &lt;adrian.hunter@intel.com&gt;
Cc: Alexander Shishkin &lt;alexander.shishkin@linux.intel.com&gt;
Cc: Andi Kleen &lt;ak@linux.intel.com&gt;
Cc: Ingo Molnar &lt;mingo@redhat.com&gt;
Cc: Jiri Olsa &lt;jolsa@kernel.org&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;
Link: https://lore.kernel.org/r/20221022092735.114967-3-yangjihong1@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>perf daemon: Remove duplicate sys/file.h include</title>
<updated>2021-10-08T18:14:50Z</updated>
<author>
<name>Guo Zhengkui</name>
<email>guozhengkui@vivo.com</email>
</author>
<published>2021-10-06T06:22:34Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=c6c00900c751c2fab9e34ee27f5e883fc1a20fc6'/>
<id>urn:sha1:c6c00900c751c2fab9e34ee27f5e883fc1a20fc6</id>
<content type='text'>
There is a "#include &lt;sys/file.h&gt;" in line 10, so remove a duplicate
one in line 1124.

Signed-off-by: Guo Zhengkui &lt;guozhengkui@vivo.com&gt;
Cc: Alexander Shishkin &lt;alexander.shishkin@linux.intel.com&gt;
Cc: Jiri Olsa &lt;jolsa@redhat.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;
Link: http://lore.kernel.org/lkml/20211006062235.6364-1-guozhengkui@vivo.com
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>perf daemon: Avoid msan warnings on send_cmd</title>
<updated>2021-09-21T19:25:41Z</updated>
<author>
<name>Ian Rogers</name>
<email>irogers@google.com</email>
</author>
<published>2021-06-17T05:55:54Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=b28e5e439109fe6fd9fa047654ae99d0b7bc5ccc'/>
<id>urn:sha1:b28e5e439109fe6fd9fa047654ae99d0b7bc5ccc</id>
<content type='text'>
As a full union is always sent, ensure all bytes of the union are
initialized with memset to avoid msan warnings of use of uninitialized
memory.

An example warning from the daemon test:

Uninitialized bytes in __interceptor_write at offset 71 inside [0x7ffd98da6280, 72)
==11602==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x5597edccdbe4 in ion tools/lib/perf/lib.c:18:6
    #1 0x5597edccdbe4 in writen tools/lib/perf/lib.c:47:9
    #2 0x5597ed221d30 in send_cmd tools/perf/builtin-daemon.c:1376:22
    #3 0x5597ed21b48c in cmd_daemon tools/perf/builtin-daemon.c
    #4 0x5597ed1d6b67 in run_builtin tools/perf/perf.c:313:11
    #5 0x5597ed1d6036 in handle_internal_command tools/perf/perf.c:365:8
    #6 0x5597ed1d6036 in run_argv tools/perf/perf.c:409:2
    #7 0x5597ed1d6036 in main tools/perf/perf.c:539:3

SUMMARY: MemorySanitizer: use-of-uninitialized-value tools/lib/perf/lib.c:18:6 in ion
Exiting

Signed-off-by: Ian Rogers &lt;irogers@google.com&gt;
Cc: Alexander Shishkin &lt;alexander.shishkin@linux.intel.com&gt;
Cc: Jiri Olsa &lt;jolsa@redhat.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;
Link: http://lore.kernel.org/lkml/20210617055554.1917997-1-irogers@google.com
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>2021-03-29T13:39:10Z</updated>
<author>
<name>Arnaldo Carvalho de Melo</name>
<email>acme@redhat.com</email>
</author>
<published>2021-03-29T13:39:10Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=b0a752d43b1566451332bcb5b52b9694dfe7896c'/>
<id>urn:sha1:b0a752d43b1566451332bcb5b52b9694dfe7896c</id>
<content type='text'>
To pick up fixes sent via perf/urgent and in the BPF tools/ directories.

Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>perf daemon: Remove duplicate includes</title>
<updated>2021-03-25T12:58:08Z</updated>
<author>
<name>Wan Jiabing</name>
<email>wanjiabing@vivo.com</email>
</author>
<published>2021-03-23T05:01:39Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=463a7d5a9e6fd3f3b592e09c936d2d07ee0b65b9'/>
<id>urn:sha1:463a7d5a9e6fd3f3b592e09c936d2d07ee0b65b9</id>
<content type='text'>
sys/stat.h has been included at line 23, so remove the
duplicate one at line 27.

linux/string.h has been included at line 7, so remove the
duplicate one at line 9.

time.h has been included at line 14, so remove the
duplicate one at line 28.

Signed-off-by: Wan Jiabing &lt;wanjiabing@vivo.com&gt;
Cc: Alexander Shishkin &lt;alexander.shishkin@linux.intel.com&gt;
Cc: Jiri Olsa &lt;jolsa@redhat.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: kael_w@yeah.net
Link: http://lore.kernel.org/lkml/20210323050139.287461-1-wanjiabing@vivo.com
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>perf daemon: Return from kill functions</title>
<updated>2021-03-24T13:24:00Z</updated>
<author>
<name>Jiri Olsa</name>
<email>jolsa@kernel.org</email>
</author>
<published>2021-03-20T22:10:13Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=9f177fd8f20b46bbd76dbcc90184caf3b8548a9f'/>
<id>urn:sha1:9f177fd8f20b46bbd76dbcc90184caf3b8548a9f</id>
<content type='text'>
We should return correctly and warn in both daemon_session__kill() and
daemon__kill() after we tried everything to kill sessions.  The current
code will keep on looping and waiting.

Signed-off-by: Jiri Olsa &lt;jolsa@kernel.org&gt;
Cc: Alexander Shishkin &lt;alexander.shishkin@linux.intel.com&gt;
Cc: Ian Rogers &lt;irogers@google.com&gt;
Cc: Mark Rutland &lt;mark.rutland@arm.com&gt;
Cc: Michael Petlan &lt;mpetlan@redhat.com&gt;
Cc: Namhyung Kim &lt;namhyung@kernel.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Link: http://lore.kernel.org/lkml/20210320221013.1619613-2-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>perf daemon: Force waipid for all session on SIGCHLD delivery</title>
<updated>2021-03-24T13:23:15Z</updated>
<author>
<name>Jiri Olsa</name>
<email>jolsa@kernel.org</email>
</author>
<published>2021-03-20T22:10:12Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=1833b64fee1032d1f48afaa3956bc0ea6b10d5e0'/>
<id>urn:sha1:1833b64fee1032d1f48afaa3956bc0ea6b10d5e0</id>
<content type='text'>
If we don't process SIGCHLD before another comes, we will see just one
SIGCHLD as a result. In this case current code will miss exit
notification for a session and wait forever.

Adding extra waitpid check for all sessions when SIGCHLD is received, to
make sure we don't miss any session exit.

Also fix close condition for signal_fd.

Reported-by: Ian Rogers &lt;irogers@google.com&gt;
Signed-off-by: Jiri Olsa &lt;jolsa@kernel.org&gt;
Cc: Alexander Shishkin &lt;alexander.shishkin@linux.intel.com&gt;
Cc: Mark Rutland &lt;mark.rutland@arm.com&gt;
Cc: Michael Petlan &lt;mpetlan@redhat.com&gt;
Cc: Namhyung Kim &lt;namhyung@kernel.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Link: http://lore.kernel.org/lkml/20210320221013.1619613-1-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>perf daemon: Fix compile error with Asan</title>
<updated>2021-03-06T19:54:31Z</updated>
<author>
<name>Namhyung Kim</name>
<email>namhyung@kernel.org</email>
</author>
<published>2021-02-24T07:14:38Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=bd57a9f33abc0adede5bafa06b2f1af3de03190d'/>
<id>urn:sha1:bd57a9f33abc0adede5bafa06b2f1af3de03190d</id>
<content type='text'>
I'm seeing a build failure when build with address sanitizer.  It seems
we could write to the name[100] if the var is longer.

  $ make EXTRA_CFLAGS=-fsanitize=address
  ...
    CC       builtin-daemon.o
  In function ‘get_session_name’,
    inlined from ‘session_config’ at builtin-daemon.c:164:6,
    inlined from ‘server_config’ at builtin-daemon.c:223:10:
  builtin-daemon.c:155:11: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=]
    155 |  *session = 0;
        |  ~~~~~~~~~^~~
  builtin-daemon.c: In function ‘server_config’:
  builtin-daemon.c:162:7: note: at offset 100 to object ‘name’ with size 100 declared here
    162 |  char name[100];
        |       ^~~~

Fixes: c0666261ff38 ("perf daemon: Add config file support")
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: Ian Rogers &lt;irogers@google.com&gt;
Cc: Ingo Molnar &lt;mingo@kernel.org&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: https://lore.kernel.org/r/20210224071438.686677-1-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>perf daemon: Fix control fifo permissions</title>
<updated>2021-03-06T19:54:26Z</updated>
<author>
<name>Jiri Olsa</name>
<email>jolsa@kernel.org</email>
</author>
<published>2021-03-01T12:25:09Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=31bf4e7cb61363b87f1606ec8efb71eebd6393cf'/>
<id>urn:sha1:31bf4e7cb61363b87f1606ec8efb71eebd6393cf</id>
<content type='text'>
Add proper mode for mkfifo calls to get read and write permissions for
user. We can't use O_RDWR in here, changing to standard permission
value.

Fixes: 6a6d1804a190 ("perf daemon: Set control fifo for session")
Signed-off-by: Jiri Olsa &lt;jolsa@kernel.org&gt;
Cc: Alexander Shishkin &lt;alexander.shishkin@linux.intel.com&gt;
Cc: Ian Rogers &lt;irogers@google.com&gt;
Cc: John Garry &lt;john.garry@huawei.com&gt;
Cc: Mark Rutland &lt;mark.rutland@arm.com&gt;
Cc: Michael Petlan &lt;mpetlan@redhat.com&gt;
Cc: Namhyung Kim &lt;namhyung@kernel.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Link: http://lore.kernel.org/lkml/20210301122510.64402-1-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
</feed>
