linux-stable/tools
Ian Rogers 2c9f7bd795 perf report: Avoid 'parent_thread' thread leak on '--tasks' processing
Caught with address sanitizer and reference count checking.

Committer notes:

The command leading to this leak:

  # perf record -a sleep 2
  [ perf record: Woken up 1 times to write data ]
  [ perf record: Captured and wrote 2.516 MB perf.data (6422 samples) ]
  # perf report --tasks
  #      pid      tid     ppid  comm
           0        0       -1 |swapper
           1        1        0 | systemd
        1474     1474        1 |  systemd
        2816     2816     1474 |   gjs
        2816     2825     2816 |    gmain
        2816     2831     2816 |    gdbus
        2816     2861     2816 |    JS Helper
        2816     2862     2816 |    JS Helper
        2816     2863     2816 |    JS Helper
        2816     2864     2816 |    JS Helper
        2816     2865     2816 |    JS Helper
        2816     2866     2816 |    JS Helper
        2816     2867     2816 |    JS Helper
        2816     2868     2816 |    JS Helper
        3072     3072     1474 |   gsd-printer
        3072     3082     3072 |    gmain
        3072     3083     3072 |    gdbus
        2600     2600     1474 |   gnome-shell
       15621    15621     2600 |    firefox
       15771    15771    15621 |     WebExtensions
       15771    15872    15771 |      TaskCon~ller #6
       15771    15873    15771 |      TaskCon~ller #7
       15771    15778    15771 |      IPC I/O Child
       15771    15779    15771 |      Socket Thread
       15771    15780    15771 |      HTML5 Parser
       15771    15781    15771 |      JS Watchdog
  # <SNIP>

When it is going to exit a thread__put(parent_thread) was missed, add it
to have ASAN clean.

Signed-off-by: Ian Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ali Saidi <alisaidi@amazon.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
Cc: Brian Robbins <brianrob@linux.microsoft.com>
Cc: Changbin Du <changbin.du@huawei.com>
Cc: Dmitrii Dolgov <9erthalion6@gmail.com>
Cc: Fangrui Song <maskray@google.com>
Cc: German Gomez <german.gomez@arm.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Ivan Babrou <ivan@cloudflare.com>
Cc: James Clark <james.clark@arm.com>
Cc: Jing Zhang <renyu.zj@linux.alibaba.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: John Garry <john.g.garry@oracle.com>
Cc: K Prateek Nayak <kprateek.nayak@amd.com>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Leo Yan <leo.yan@linaro.org>
Cc: Liam Howlett <liam.howlett@oracle.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Miguel Ojeda <ojeda@kernel.org>
Cc: Mike Leach <mike.leach@linaro.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ravi Bangoria <ravi.bangoria@amd.com>
Cc: Sean Christopherson <seanjc@google.com>
Cc: Steinar H. Gunderson <sesse@google.com>
Cc: Suzuki Poulouse <suzuki.poulose@arm.com>
Cc: Wenyu Liu <liuwenyu7@huawei.com>
Cc: Will Deacon <will@kernel.org>
Cc: Yang Jihong <yangjihong1@huawei.com>
Cc: Ye Xingchen <ye.xingchen@zte.com.cn>
Cc: Yuan Can <yuancan@huawei.com>
Cc: coresight@lists.linaro.org
Cc: linux-arm-kernel@lists.infradead.org
Link: https://lore.kernel.org/r/20230608232823.4027869-10-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2023-06-12 15:57:53 -03:00
..
accounting delayacct: track delays from IRQ/SOFTIRQ 2023-04-18 16:39:34 -07:00
arch perf bench syscall: Fix __NR_execve undeclared build error 2023-05-19 12:08:00 -03:00
bootconfig
bpf Mainly singleton patches all over the place. Series of note are: 2023-04-27 19:57:00 -07:00
build tools build: Add a feature test for scandirat(), that is not implemented so far in musl and uclibc 2023-04-04 13:18:17 -03:00
certs
cgroup
counter
debugging
edid
firewire
firmware
gpio
hv
iio
include tools headers UAPI: Sync the linux/in.h with the kernel sources 2023-05-26 16:03:27 -03:00
io_uring
kvm/kvm_stat tools/kvm_stat: use canonical ftrace path 2023-03-29 06:52:08 -04:00
laptop
leds
lib libsubcmd: Avoid two path statics, removing 8192 bytes from .bss 2023-05-28 10:25:55 -03:00
memory-model LKMM scripting updates for v6.4 2023-04-24 12:02:25 -07:00
mm slab changes for 6.4 2023-04-25 13:00:41 -07:00
net/ynl tools: ynl: Rename ethtool to ethtool.py 2023-04-13 22:18:29 -07:00
objtool Objtool changes for v6.4: 2023-04-28 14:02:54 -07:00
pci
pcmcia
perf perf report: Avoid 'parent_thread' thread leak on '--tasks' processing 2023-06-12 15:57:53 -03:00
power cpupower: Make TSC read per CPU for Mperf monitor 2023-05-08 10:46:49 -06:00
rcu
scripts sh updates for v6.4 2023-04-27 17:41:23 -07:00
spi
testing bpf-for-netdev 2023-05-24 21:57:57 -07:00
thermal
time
tracing rtla/timerlat: Fix "Previous IRQ" auto analysis' line 2023-04-25 19:26:59 -04:00
usb
verification rv: Fix addition on an uninitialized variable 'run' 2023-04-25 17:02:13 -04:00
virtio tools/virtio: fix build caused by virtio_ring changes 2023-04-21 03:02:35 -04:00
wmi
Makefile tools/Makefile: do missed s/vm/mm/ 2023-04-18 14:22:12 -07:00