]> git.baikalelectronics.ru Git - kernel.git/commit
perf thread: Generalize function to copy from thread addr space from intel-bts code
authorAndi Kleen <ak@linux.intel.com>
Wed, 6 Mar 2019 20:55:35 +0000 (17:55 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 6 Mar 2019 20:55:35 +0000 (17:55 -0300)
commit0f6deb6f3ab84c52c46cc15c5c76c161defd8548
treec75d2f8984cac64f4be484957a54510c7e165500
parentf2bc138b9c217ce7c99ca462700666986b55a7d7
perf thread: Generalize function to copy from thread addr space from intel-bts code

Add a utility function to fetch executable code. Convert one
user over to it. There are more places doing that, but they
do significantly different actions, so they are not
easy to fit into a single library function.

Committer changes:

. No need to cast around, make 'buf' be a void pointer.

. Rename it to thread__memcpy() to reflect the fact it is about copying
  a chunk of memory from a thread, i.e. from its address space.

. No need to have it in a separate object file, move it to thread.[ch]

. Check the return of map__load(), the original code didn't do it, but
  since we're moving this around, check that as well.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lkml.kernel.org/r/20190305144758.12397-2-andi@firstfloor.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/intel-bts.c
tools/perf/util/thread.c
tools/perf/util/thread.h