Ian Rogers and Arnaldo Carvalho de Melo
84cb36da81
perf thread: Don't require machine to compute the e_machine
...
The machine can be calculated from a thread via its maps.
Don't require the machine argument to simplify callers and also to delay
computing the machine until a little later.
Signed-off-by: Ian Rogers <irogers@google.com >
Cc: Aditya Bodkhe <aditya.b1@linux.ibm.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Albert Ou <aou@eecs.berkeley.edu >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Alexandre Ghiti <alex@ghiti.fr >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Andrew Jones <ajones@ventanamicro.com >
Cc: Anubhav Shelat <ashelat@redhat.com >
Cc: Anup Patel <anup@brainfault.org >
Cc: Athira Rajeev <atrajeev@linux.ibm.com >
Cc: Blake Jones <blakejones@google.com >
Cc: Chun-Tse Shao <ctshao@google.com >
Cc: Dapeng Mi <dapeng1.mi@linux.intel.com >
Cc: Dmitriy Vyukov <dvyukov@google.com >
Cc: Howard Chu <howardchu95@gmail.com >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: James Clark <james.clark@linaro.org >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: John Garry <john.g.garry@oracle.com >
Cc: Leo Yan <leo.yan@linux.dev >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Palmer Dabbelt <palmer@dabbelt.com >
Cc: Paul Walmsley <pjw@kernel.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Quan Zhou <zhouquan@iscas.ac.cn >
Cc: Shimin Guo <shimin.guo@skydio.com >
Cc: Swapnil Sapkal <swapnil.sapkal@amd.com >
Cc: Thomas Falcon <thomas.falcon@intel.com >
Cc: Will Deacon <will@kernel.org >
Cc: Yunseong Kim <ysk@kzalloc.com >
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2026-02-03 18:01:27 -03:00
Ian Rogers and Arnaldo Carvalho de Melo
4e66527f88
perf thread: Add optional e_flags output argument to thread__e_machine
...
The e_flags are needed to accurately compute complete perf register
information for CSKY.
Add the ability to read and have this value associated with a thread.
This change doesn't wire up the use of the e_flags except in disasm
where use already exists but just wasn't set up yet.
Signed-off-by: Ian Rogers <irogers@google.com >
Cc: Aditya Bodkhe <aditya.b1@linux.ibm.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Athira Rajeev <atrajeev@linux.ibm.com >
Cc: Chun-Tse Shao <ctshao@google.com >
Cc: Guo Ren <guoren@kernel.org >
Cc: Howard Chu <howardchu95@gmail.com >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: James Clark <james.clark@linaro.org >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Sergei Trofimovich <slyich@gmail.com >
Cc: Shimin Guo <shimin.guo@skydio.com >
Cc: Stephen Brennan <stephen.s.brennan@oracle.com >
Cc: Swapnil Sapkal <swapnil.sapkal@amd.com >
Cc: Tianyou Li <tianyou.li@intel.com >
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2026-01-26 18:21:20 -03:00
Ian Rogers and Arnaldo Carvalho de Melo
7d0ebeb6c0
perf dso: Factor out e_machine reading for use in thread
...
Factor out the resilient e_machine reading code in dso so that it may
be used in thread.
As there is no dso in that case, make the dso optional.
This makes some minor other changes as the swap type from the dso cannot
be ascertained.
Signed-off-by: Ian Rogers <irogers@google.com >
Cc: Aditya Bodkhe <aditya.b1@linux.ibm.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Athira Rajeev <atrajeev@linux.ibm.com >
Cc: Chun-Tse Shao <ctshao@google.com >
Cc: Guo Ren <guoren@kernel.org >
Cc: Howard Chu <howardchu95@gmail.com >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: James Clark <james.clark@linaro.org >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Sergei Trofimovich <slyich@gmail.com >
Cc: Shimin Guo <shimin.guo@skydio.com >
Cc: Stephen Brennan <stephen.s.brennan@oracle.com >
Cc: Swapnil Sapkal <swapnil.sapkal@amd.com >
Cc: Tianyou Li <tianyou.li@intel.com >
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2026-01-26 18:21:20 -03:00
Ian Rogers and Namhyung Kim
ae0756933e
perf thread: Ensure comm_lock held for comm_list
...
Add thread safety annotations for comm_list and add locking for two
instances where the list is accessed without the lock held (in
contradiction to ____thread__set_comm()).
Signed-off-by: Ian Rogers <irogers@google.com >
Link: https://lore.kernel.org/r/20250529192206.971199-1-irogers@google.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
2025-06-11 13:40:31 -07:00
Ian Rogers and Arnaldo Carvalho de Melo
a913ef6fd8
perf callchain: Always populate the addr_location map when adding IP
...
Dropping symbols also meant the callchain maps wasn't populated, but
the callchain map is needed to find the DSO.
Plumb the symbols option better, falling back to thread__find_map()
rather than thread__find_symbol() when symbols are disabled.
Fixes: 02b2705017 ("perf callchain: Allow symbols to be optional when resolving a callchain")
Signed-off-by: Ian Rogers <irogers@google.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Athira Rajeev <atrajeev@linux.ibm.com >
Cc: Ben Gainey <ben.gainey@arm.com >
Cc: Chaitanya S Prakash <chaitanyas.prakash@arm.com >
Cc: Charlie Jenkins <charlie@rivosinc.com >
Cc: Chun-Tse Shao <ctshao@google.com >
Cc: Colin Ian King <colin.i.king@gmail.com >
Cc: Dmitriy Vyukov <dvyukov@google.com >
Cc: Dr. David Alan Gilbert <linux@treblig.org >
Cc: Graham Woodward <graham.woodward@arm.com >
Cc: Howard Chu <howardchu95@gmail.com >
Cc: Ilkka Koskinen <ilkka@os.amperecomputing.com >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: James Clark <james.clark@linaro.org >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: John Garry <john.g.garry@oracle.com >
Cc: Kajol Jain <kjain@linux.ibm.com >
Cc: Kan Liang <kan.liang@linux.intel.com >
Cc: Krzysztof Łopatowski <krzysztof.m.lopatowski@gmail.com >
Cc: Leo Yan <leo.yan@linux.dev >
Cc: Levi Yun <yeoreum.yun@arm.com >
Cc: Li Huafei <lihuafei1@huawei.com >
Cc: linux-arm-kernel@lists.infradead.org
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Martin Liška <martin.liska@hey.com >
Cc: Masami Hiramatsu <mhiramat@kernel.org >
Cc: Matt Fleming <matt@readmodwrite.com >
Cc: Mike Leach <mike.leach@linaro.org >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Ravi Bangoria <ravi.bangoria@amd.com >
Cc: Song Liu <song@kernel.org >
Cc: Steinar H. Gunderson <sesse@google.com >
Cc: Stephen Brennan <stephen.s.brennan@oracle.com >
Cc: Steve Clevenger <scclevenger@os.amperecomputing.com >
Cc: Thomas Falcon <thomas.falcon@intel.com >
Cc: Veronika Molnarova <vmolnaro@redhat.com >
Cc: Weilin Wang <weilin.wang@intel.com >
Cc: Will Deacon <will@kernel.org >
Cc: Yicong Yang <yangyicong@hisilicon.com >
Cc: Yujie Liu <yujie.liu@intel.com >
Cc: Zhongqiu Han <quic_zhonhan@quicinc.com >
Cc: Zixian Cai <fzczx123@gmail.com >
Link: https://lore.kernel.org/r/20250529044000.759937-2-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2025-05-31 08:58:30 -03:00
Arnaldo Carvalho de Melo
24bcc31fc7
Revert "perf thread: Ensure comm_lock held for comm_list"
...
This reverts commit 8f454c9581 .
'perf top' is freezing on exit sometimes, bisected to this one, revert.
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com >
Cc: Bill Wendling <morbo@google.com >
Cc: Chaitanya S Prakash <chaitanyas.prakash@arm.com >
Cc: Fei Lang <langfei@huawei.com >
Cc: Howard Chu <howardchu95@gmail.com >
Cc: Ian Rogers <irogers@google.com >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: James Clark <james.clark@linaro.org >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: Justin Stitt <justinstitt@google.com >
Cc: Kan Liang <kan.liang@linux.intel.com >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Nathan Chancellor <nathan@kernel.org >
Cc: Nick Desaulniers <nick.desaulniers+lkml@gmail.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Stephen Brennan <stephen.s.brennan@oracle.com >
Link: https://lore.kernel.org/r/aDcyvvOKZkRYbjul@x1
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2025-05-28 12:59:17 -03:00
Ian Rogers and Arnaldo Carvalho de Melo
8f454c9581
perf thread: Ensure comm_lock held for comm_list
...
Add thread safety annotations for comm_list and add locking for two
instances where the list is accessed without the lock held (in
contradiction to ____thread__set_comm()).
Signed-off-by: Ian Rogers <irogers@google.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com >
Cc: Bill Wendling <morbo@google.com >
Cc: Chaitanya S Prakash <chaitanyas.prakash@arm.com >
Cc: Fei Lang <langfei@huawei.com >
Cc: Howard Chu <howardchu95@gmail.com >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: James Clark <james.clark@linaro.org >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: Justin Stitt <justinstitt@google.com >
Cc: Kan Liang <kan.liang@linux.intel.com >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Nathan Chancellor <nathan@kernel.org >
Cc: Nick Desaulniers <nick.desaulniers+lkml@gmail.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Stephen Brennan <stephen.s.brennan@oracle.com >
Link: https://lore.kernel.org/r/20250519224645.1810891-3-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2025-05-21 15:07:13 -03:00
Ian Rogers and Arnaldo Carvalho de Melo
7900938850
perf trace: Add missing thread__put() in thread__e_machine()
...
Add missing thread__put() of the found parent thread in
thread__e_machine().
Reviewed-by: Howard Chu <howardchu95@gmail.com >
Signed-off-by: Ian Rogers <irogers@google.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: Kan Liang <kan.liang@linux.intel.com >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Link: https://lore.kernel.org/r/20250401202715.3493567-1-irogers@google.com
[ split from a larger patch ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2025-05-08 11:50:44 -03:00
Ian Rogers and Namhyung Kim
70351029b5
perf thread: Add support for reading the e_machine type for a thread
...
First try to read the e_machine from the dsos associated with the
thread's maps. If live use the executable from /proc/pid/exe and read
the e_machine from the ELF header. On failure use EM_HOST. Change
builtin-trace syscall functions to pass e_machine from the thread
rather than EM_HOST, so that in later patches when syscalltbl can use
the e_machine the system calls are specific to the architecture.
Signed-off-by: Ian Rogers <irogers@google.com >
Reviewed-by: Namhyung Kim <namhyung@kernel.org >
Acked-by: Arnaldo Carvalho de Melo <acme@kernel.org >
Link: https://lore.kernel.org/r/20250319050741.269828-8-irogers@google.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
2025-03-20 22:58:05 -07:00
Ian Rogers and Arnaldo Carvalho de Melo
599c19397b
perf callchain: Fix stitch LBR memory leaks
...
The 'struct callchain_cursor_node' has a 'struct map_symbol' whose maps
and map members are reference counted. Ensure these values use a _get
routine to increment the reference counts and use map_symbol__exit() to
release the reference counts.
Do similar for 'struct thread's prev_lbr_cursor, but save the size of
the prev_lbr_cursor array so that it may be iterated.
Ensure that when stitch_nodes are placed on the free list the
map_symbols are exited.
Fix resolve_lbr_callchain_sample() by replacing list_replace_init() to
list_splice_init(), so the whole list is moved and nodes aren't leaked.
A reproduction of the memory leaks is possible with a leak sanitizer
build in the perf report command of:
```
$ perf record -e cycles --call-graph lbr perf test -w thloop
$ perf report --stitch-lbr
```
Reviewed-by: Kan Liang <kan.liang@linux.intel.com >
Fixes: ff165628d7 ("perf callchain: Stitch LBR call stack")
Signed-off-by: Ian Rogers <irogers@google.com >
[ Basic tests after applying the patch, repeating the example above ]
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Anne Macedo <retpolanne@posteo.net >
Cc: Changbin Du <changbin.du@huawei.com >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Link: https://lore.kernel.org/r/20240808054644.1286065-1-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2024-08-08 17:30:27 -03:00
Ian Rogers and Arnaldo Carvalho de Melo
3536c2575e
perf thread: Fixes to thread__new() related to initializing comm
...
Freeing the thread on failure won't work with reference count checking,
use thread__delete().
Don't allocate the comm_str, use a stack allocation instead.
Fixes: f6005cafeb ("perf thread: Add reference count checking")
Signed-off-by: Ian Rogers <irogers@google.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: James Clark <james.clark@arm.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: Kan Liang <kan.liang@linux.intel.com >
Cc: Leo Yan <leo.yan@linux.dev >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Link: https://lore.kernel.org/r/20240508035301.1554434-5-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2024-05-09 18:15:25 -03:00
Ian Rogers and Arnaldo Carvalho de Melo
ee756ef749
perf dso: Add reference count checking and accessor functions
...
Add reference count checking to struct dso, this can help with
implementing correct reference counting discipline. To avoid
RC_CHK_ACCESS everywhere, add accessor functions for the variables in
struct dso.
The majority of the change is mechanical in nature and not easy to
split up.
Committer testing:
'perf test' up to this patch shows no regressions.
But:
util/symbol.c: In function ‘dso__load_bfd_symbols’:
util/symbol.c:1683:9: error: too few arguments to function ‘dso__set_adjust_symbols’
1683 | dso__set_adjust_symbols(dso);
| ^~~~~~~~~~~~~~~~~~~~~~~
In file included from util/symbol.c:21:
util/dso.h:268:20: note: declared here
268 | static inline void dso__set_adjust_symbols(struct dso *dso, bool val)
| ^~~~~~~~~~~~~~~~~~~~~~~
make[6]: *** [/home/acme/git/perf-tools-next/tools/build/Makefile.build:106: /tmp/tmp.ZWHbQftdN6/util/symbol.o] Error 1
MKDIR /tmp/tmp.ZWHbQftdN6/tests/workloads/
make[6]: *** Waiting for unfinished jobs....
This was updated:
- symbols__fixup_end(&dso->symbols, false);
- symbols__fixup_duplicate(&dso->symbols);
- dso->adjust_symbols = 1;
+ symbols__fixup_end(dso__symbols(dso), false);
+ symbols__fixup_duplicate(dso__symbols(dso));
+ dso__set_adjust_symbols(dso);
But not build tested with BUILD_NONDISTRO and libbfd devel files installed
(binutils-devel on fedora).
Add the missing argument:
symbols__fixup_end(dso__symbols(dso), false);
symbols__fixup_duplicate(dso__symbols(dso));
- dso__set_adjust_symbols(dso);
+ dso__set_adjust_symbols(dso, true);
Signed-off-by: Ian Rogers <irogers@google.com >
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com >
Cc: Ben Gainey <ben.gainey@arm.com >
Cc: Changbin Du <changbin.du@huawei.com >
Cc: Chengen Du <chengen.du@canonical.com >
Cc: Colin Ian King <colin.i.king@gmail.com >
Cc: Dima Kogan <dima@secretsauce.net >
Cc: Ilkka Koskinen <ilkka@os.amperecomputing.com >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: James Clark <james.clark@arm.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: K Prateek Nayak <kprateek.nayak@amd.com >
Cc: Kan Liang <kan.liang@linux.intel.com >
Cc: Leo Yan <leo.yan@linux.dev >
Cc: Li Dong <lidong@vivo.com >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Masami Hiramatsu <mhiramat@kernel.org >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Paran Lee <p4ranlee@gmail.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Song Liu <song@kernel.org >
Cc: Sun Haiyong <sunhaiyong@loongson.cn >
Cc: Thomas Richter <tmricht@linux.ibm.com >
Cc: Tiezhu Yang <yangtiezhu@loongson.cn >
Cc: Yanteng Si <siyanteng@loongson.cn >
Cc: zhaimingbing <zhaimingbing@cmss.chinamobile.com >
Link: https://lore.kernel.org/r/20240504213803.218974-6-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2024-05-06 15:28:49 -03:00
Ian Rogers and Namhyung Kim
d436f90a64
perf machine: Move machine's threads into its own abstraction
...
Move thread_rb_node into the machine.c file. This hides the
implementation of threads from the rest of the code allowing for it to
be refactored.
Locking discipline is tightened up in this change. As the lock is now
encapsulated in threads, the findnew function requires holding it (as
it already did in machine). Rather than do conditionals with locks
based on whether the thread should be created (which could potentially
be error prone with a read lock match with a write unlock), have a
separate threads__find that won't create the thread and only holds the
read lock. This effectively duplicates the findnew logic, with the
existing findnew logic only operating under a write lock assuming
creation is necessary as a previous find failed. The creation may
still fail with the write lock due to another thread. The duplication
is removed in a later next patch that delegates the implementation to
hashtable.
Signed-off-by: Ian Rogers <irogers@google.com >
Acked-by: Namhyung Kim <namhyung@kernel.org >
Cc: Yang Jihong <yangjihong1@huawei.com >
Cc: Oliver Upton <oliver.upton@linux.dev >
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
Link: https://lore.kernel.org/r/20240301053646.1449657-5-irogers@google.com
2024-03-03 22:51:44 -08:00
Ian Rogers and Namhyung Kim
ff0bd79980
perf maps: Hide maps internals
...
Move the struct into the C file. Add maps__equal to work around
exposing the struct for reference count checking. Add accessors for
the unwind_libunwind_ops. Move maps_list_node to its only use in
symbol.c.
Signed-off-by: Ian Rogers <irogers@google.com >
Acked-by: Namhyung Kim <namhyung@kernel.org >
Cc: K Prateek Nayak <kprateek.nayak@amd.com >
Cc: James Clark <james.clark@arm.com >
Cc: Vincent Whitchurch <vincent.whitchurch@axis.com >
Cc: Alexey Dobriyan <adobriyan@gmail.com >
Cc: Colin Ian King <colin.i.king@gmail.com >
Cc: Changbin Du <changbin.du@huawei.com >
Cc: Masami Hiramatsu <mhiramat@kernel.org >
Cc: Song Liu <song@kernel.org >
Cc: Leo Yan <leo.yan@linux.dev >
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com >
Cc: Liam Howlett <liam.howlett@oracle.com >
Cc: Artem Savkov <asavkov@redhat.com >
Cc: bpf@vger.kernel.org
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
Link: https://lore.kernel.org/r/20240210031746.4057262-6-irogers@google.com
2024-02-12 12:35:41 -08:00
Ian Rogers and Arnaldo Carvalho de Melo
9084952704
perf maps: Rename clone to copy from
...
Rename maps__clone() to maps__copy_from() to be more intention revealing
of its behavior. Pass the underlying maps rather than the thread.
Signed-off-by: Ian Rogers <irogers@google.com >
Acked-by: Namhyung Kim <namhyung@kernel.org >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com >
Cc: Changbin Du <changbin.du@huawei.com >
Cc: Colin Ian King <colin.i.king@gmail.com >
Cc: Dmitrii Dolgov <9erthalion6@gmail.com >
Cc: German Gomez <german.gomez@arm.com >
Cc: Guilherme Amadio <amadio@gentoo.org >
Cc: Huacai Chen <chenhuacai@kernel.org >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: James Clark <james.clark@arm.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: K Prateek Nayak <kprateek.nayak@amd.com >
Cc: Kajol Jain <kjain@linux.ibm.com >
Cc: Kan Liang <kan.liang@linux.intel.com >
Cc: Leo Yan <leo.yan@linaro.org >
Cc: Li Dong <lidong@vivo.com >
Cc: Liam Howlett <liam.howlett@oracle.com >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Masami Hiramatsu <mhiramat@kernel.org >
Cc: Miguel Ojeda <ojeda@kernel.org >
Cc: Ming Wang <wangming01@loongson.cn >
Cc: Nick Terrell <terrelln@fb.com >
Cc: Paolo Bonzini <pbonzini@redhat.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Ravi Bangoria <ravi.bangoria@amd.com >
Cc: Sandipan Das <sandipan.das@amd.com >
Cc: Sean Christopherson <seanjc@google.com >
Cc: Steinar H. Gunderson <sesse@google.com >
Cc: Vincent Whitchurch <vincent.whitchurch@axis.com >
Cc: Wenyu Liu <liuwenyu7@huawei.com >
Cc: Yang Jihong <yangjihong1@huawei.com >
Link: https://lore.kernel.org/r/20231207011722.1220634-19-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2023-12-20 14:55:30 -03:00
Ian Rogers and Arnaldo Carvalho de Melo
07ef14d50c
perf maps: Refactor maps__fixup_overlappings()
...
Rename to maps__fixup_overlap_and_insert() as the given mapping is
always inserted. Factor out first_ending_after() as a utility
function. Minor variable name changes. Switch to using debug_file()
rather than passing a debug FILE*.
Signed-off-by: Ian Rogers <irogers@google.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com >
Cc: Changbin Du <changbin.du@huawei.com >
Cc: Colin Ian King <colin.i.king@gmail.com >
Cc: Dmitrii Dolgov <9erthalion6@gmail.com >
Cc: German Gomez <german.gomez@arm.com >
Cc: Guilherme Amadio <amadio@gentoo.org >
Cc: Huacai Chen <chenhuacai@kernel.org >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: James Clark <james.clark@arm.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: K Prateek Nayak <kprateek.nayak@amd.com >
Cc: Kajol Jain <kjain@linux.ibm.com >
Cc: Kan Liang <kan.liang@linux.intel.com >
Cc: Leo Yan <leo.yan@linaro.org >
Cc: Li Dong <lidong@vivo.com >
Cc: Liam Howlett <liam.howlett@oracle.com >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Masami Hiramatsu <mhiramat@kernel.org >
Cc: Miguel Ojeda <ojeda@kernel.org >
Cc: Ming Wang <wangming01@loongson.cn >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Nick Terrell <terrelln@fb.com >
Cc: Paolo Bonzini <pbonzini@redhat.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Ravi Bangoria <ravi.bangoria@amd.com >
Cc: Sandipan Das <sandipan.das@amd.com >
Cc: Sean Christopherson <seanjc@google.com >
Cc: Steinar H. Gunderson <sesse@google.com >
Cc: Vincent Whitchurch <vincent.whitchurch@axis.com >
Cc: Wenyu Liu <liuwenyu7@huawei.com >
Cc: Yang Jihong <yangjihong1@huawei.com >
Link: https://lore.kernel.org/r/20231207011722.1220634-17-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2023-12-20 14:53:41 -03:00
Ian Rogers and Arnaldo Carvalho de Melo
71225af17f
perf thread: Use function to add missing maps lock
...
Switch thread__prepare_access from loop macro maps__for_each_entry
to maps__for_each_map function that takes a callback. The function
holds the maps lock, which should be held during iteration.
Signed-off-by: Ian Rogers <irogers@google.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com >
Cc: Changbin Du <changbin.du@huawei.com >
Cc: Colin Ian King <colin.i.king@gmail.com >
Cc: Dmitrii Dolgov <9erthalion6@gmail.com >
Cc: German Gomez <german.gomez@arm.com >
Cc: Guilherme Amadio <amadio@gentoo.org >
Cc: Huacai Chen <chenhuacai@kernel.org >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: James Clark <james.clark@arm.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: K Prateek Nayak <kprateek.nayak@amd.com >
Cc: Kajol Jain <kjain@linux.ibm.com >
Cc: Kan Liang <kan.liang@linux.intel.com >
Cc: Leo Yan <leo.yan@linaro.org >
Cc: Li Dong <lidong@vivo.com >
Cc: Liam Howlett <liam.howlett@oracle.com >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Masami Hiramatsu <mhiramat@kernel.org >
Cc: Miguel Ojeda <ojeda@kernel.org >
Cc: Ming Wang <wangming01@loongson.cn >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Nick Terrell <terrelln@fb.com >
Cc: Paolo Bonzini <pbonzini@redhat.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Ravi Bangoria <ravi.bangoria@amd.com >
Cc: Sandipan Das <sandipan.das@amd.com >
Cc: Sean Christopherson <seanjc@google.com >
Cc: Steinar H. Gunderson <sesse@google.com >
Cc: Vincent Whitchurch <vincent.whitchurch@axis.com >
Cc: Wenyu Liu <liuwenyu7@huawei.com >
Cc: Yang Jihong <yangjihong1@huawei.com >
Link: https://lore.kernel.org/r/20231207011722.1220634-11-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2023-12-18 21:35:16 -03:00
Ian Rogers and Arnaldo Carvalho de Melo
01261d8a0f
perf thread: Add missing RC_CHK_EQUAL
...
Comparing pointers without RC_CHK_ACCESS means the indirect object
will be compared rather than the underlying maps when REFCNT_CHECKING
is enabled. Fix by adding missing RC_CHK_EQUAL.
Signed-off-by: Ian Rogers <irogers@google.com >
Acked-by: Namhyung Kim <namhyung@kernel.org >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Athira Jajeev <atrajeev@linux.vnet.ibm.com >
Cc: Changbin Du <changbin.du@huawei.com >
Cc: Colin Ian King <colin.i.king@gmail.com >
Cc: Dmitrii Dolgov <9erthalion6@gmail.com >
Cc: German Gomez <german.gomez@arm.com >
Cc: Guilherme Amadio <amadio@gentoo.org >
Cc: Huacai Chen <chenhuacai@kernel.org >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: James Clark <james.clark@arm.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: K Prateek Nayak <kprateek.nayak@amd.com >
Cc: Kajol Jain <kjain@linux.ibm.com >
Cc: Kan Liang <kan.liang@linux.intel.com >
Cc: Leo Yan <leo.yan@linaro.org >
Cc: Li Dong <lidong@vivo.com >
Cc: Liam Howlett <liam.howlett@oracle.com >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Masami Hiramatsu (Google) <mhiramat@kernel.org >
Cc: Miguel Ojeda <ojeda@kernel.org >
Cc: Ming Wang <wangming01@loongson.cn >
Cc: Nick Terrell <terrelln@fb.com >
Cc: Paolo Bonzini <pbonzini@redhat.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Ravi Bangoria <ravi.bangoria@amd.com >
Cc: Sandipan Das <sandipan.das@amd.com >
Cc: Sean Christopherson <seanjc@google.com >
Cc: Steinar H. Gunderson <sesse@google.com >
Cc: Vincent Whitchurch <vincent.whitchurch@axis.com >
Cc: Wenyu Liu <liuwenyu7@huawei.com >
Cc: Yang Jihong <yangjihong1@huawei.com >
Link: https://lore.kernel.org/r/20231127220902.1315692-15-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2023-12-06 13:01:50 -03:00
Arnaldo Carvalho de Melo
04cb4fc4d4
perf thread: Allow tools to register a thread->priv destructor
...
So that when thread__delete() runs it can be called and free stuff tools
stashed into thread->priv, like 'perf trace' does and will use this
new facility to plug some leaks.
Added an assert(thread__priv_destructor == NULL) as suggested in Ian's
review.
Acked-by: Ian Rogers <irogers@google.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: Namhyung Kim <namhyung@kernel.org >
Link: https://lore.kernel.org/lkml/CAP-5=fV3Er=Ek8=iE=bSGbEBmM56_PJffMWot1g_5Bh8B5hO7A@mail.gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2023-07-20 11:22:46 -03:00
Ian Rogers and Arnaldo Carvalho de Melo
f6005cafeb
perf thread: Add reference count checking
...
Modify struct declaration and accessor functions for the reference
count checkers additional layer of indirection. Make sure pid_cmp in
builtin-sched.c uses the underlying/original struct in pointer
arithmetic, and not the temporary get/put indirection.
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-8-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2023-06-12 15:57:53 -03:00
Ian Rogers and Arnaldo Carvalho de Melo
0dd5041c9a
perf addr_location: Add init/exit/copy functions
...
struct addr_location holds references to multiple reference counted
objects. Add init/exit functions to make maintenance of those more
consistent with the rest of the code and to try to avoid
leaks. Modification of thread reference counts isn't included in this
change.
Committer notes:
I needed to initialize result to sample->ip to make sure is set to
something, fixing a compile time error, mostly keeping the previous
logic as build_alloc_func_list() already does debugging/error prints
about what went wrong if it takes the 'goto out'.
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-7-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2023-06-12 15:57:53 -03:00
Ian Rogers and Arnaldo Carvalho de Melo
ee84a3032b
perf thread: Add accessor functions for thread
...
Using accessors will make it easier to add reference count checking in
later patches.
Committer notes:
thread->nsinfo wasn't wrapped as it is used together with
nsinfo__zput(), where does a trick to set the field with a refcount
being dropped to NULL, and that doesn't work well with using
thread__nsinfo(thread), that loses the &thread->nsinfo pointer.
When refcount checking is added to 'struct thread', later in this
series, nsinfo__zput(RC_CHK_ACCESS(thread)->nsinfo) will be used to
check the thread pointer.
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-4-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2023-06-12 15:57:53 -03:00
Ian Rogers and Arnaldo Carvalho de Melo
7ee227f674
perf thread: Make threads rbtree non-invasive
...
Separate the rbtree out of thread and into a new struct
thread_rb_node. The refcnt is in thread and the rbtree is responsible
for a single count.
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-3-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2023-06-12 15:57:53 -03:00
Ian Rogers and Arnaldo Carvalho de Melo
40826c45eb
perf thread: Remove notion of dead threads
...
The dead thread list is best effort. Threads live on it until the
reference count hits zero and they are removed. With correct reference
counting this should never happen. It is, however, part of the 'perf
sched' output that is now removed. If this is an issue we should
implement tracking of dead threads in a robust not best-effort way.
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-2-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2023-06-12 15:57:53 -03:00
Ian Rogers and Arnaldo Carvalho de Melo
78a1f7cd90
perf map: Add helper for ->map_ip() and ->unmap_ip()
...
Later changes will add reference count checking for struct map, add a
helper function to invoke the map_ip and unmap_ip function pointers. The
helper allows the reference count check to be in fewer places.
Committer notes:
Add missing conversions to:
tools/perf/util/map.c
tools/perf/util/cs-etm.c
tools/perf/util/annotate.c
tools/perf/arch/powerpc/util/sym-handling.c
tools/perf/arch/s390/annotate/instructions.c
Signed-off-by: Ian Rogers <irogers@google.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Alexey Bayduraev <alexey.v.bayduraev@linux.intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Andrew Morton <akpm@linux-foundation.org >
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Cc: Darren Hart <dvhart@infradead.org >
Cc: Davidlohr Bueso <dave@stgolabs.net >
Cc: Dmitriy Vyukov <dvyukov@google.com >
Cc: Eric Dumazet <edumazet@google.com >
Cc: German Gomez <german.gomez@arm.com >
Cc: Hao Luo <haoluo@google.com >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: James Clark <james.clark@arm.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: John Garry <john.g.garry@oracle.com >
Cc: Kajol Jain <kjain@linux.ibm.com >
Cc: Kan Liang <kan.liang@linux.intel.com >
Cc: Leo Yan <leo.yan@linaro.org >
Cc: Madhavan Srinivasan <maddy@linux.ibm.com >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Masami Hiramatsu <mhiramat@kernel.org >
Cc: Miaoqian Lin <linmq006@gmail.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Riccardo Mancini <rickyman7@gmail.com >
Cc: Shunsuke Nakamura <nakamura.shun@fujitsu.com >
Cc: Song Liu <song@kernel.org >
Cc: Stephane Eranian <eranian@google.com >
Cc: Stephen Brennan <stephen.s.brennan@oracle.com >
Cc: Steven Rostedt (VMware) <rostedt@goodmis.org >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Thomas Richter <tmricht@linux.ibm.com >
Cc: Yury Norov <yury.norov@gmail.com >
Link: https://lore.kernel.org/r/20230404205954.2245628-2-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2023-04-06 22:10:17 -03:00