aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/probe-finder.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2015-05-11 18:13:14 -0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2015-05-12 09:59:52 -0300
commit8b00f46951bed1edd9c5cb9d9adb62d28bbe7623 (patch)
treef7ae41325783ce7d2c3182aa54c65316067fb8a7 /tools/perf/util/probe-finder.c
parentperf machine: No need to keep a refcnt for last_match (diff)
downloadlinux-dev-8b00f46951bed1edd9c5cb9d9adb62d28bbe7623.tar.xz
linux-dev-8b00f46951bed1edd9c5cb9d9adb62d28bbe7623.zip
perf tests: Fix map_groups refcount test
When introducing reference counting for struct thread instances I forgot to remove the synthetic threads from the machine's rbtree so that it then the threads would have just one reference and thus the thread__put() replacing the thread__delete() really turns into a thread__delete() (thread->refcnt == 1 at thread__put() time) and thus drop the thread->mg refcount, as expected by the this test. Fix it by calling machine__remove_thread() (the counterpart of machine__findnew_thread()) on all the synthetic threads after the checks that involves the rbtree were done. Before: # perf test -v mg 30: Test thread mg sharing : --- start --- test child forked, pid 26995 FAILED tests/thread-mg-share.c:68 wrong refcnt (4 != 3) test child finished with -1 ---- end ---- Test thread mg sharing: FAILED! # After: # perf test mg 30: Test thread mg sharing: Ok # Fixes: b91fc39f4ad7 ("perf machine: Protect the machine->threads with a rwlock") Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Borislav Petkov <bp@suse.de> Cc: David Ahern <dsahern@gmail.com> Cc: Don Zickus <dzickus@redhat.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-uoqq0fjei90ohhhcboz6ay33@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/probe-finder.c')
0 files changed, 0 insertions, 0 deletions