mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-18 03:23:53 -04:00
maps may belong to >1 thread. In contexts like symbolization information from the thread may be useful, such as the ELF machine. As the maps can be gained from the thread switch from holding maps in struct map_symbol to holding the thread. Holding the maps in addr_location is also redundant, switch this to using thread__maps. Reviewed-by: James Clark <james.clark@linaro.org> 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: Athira Rajeev <atrajeev@linux.ibm.com> Cc: Bill Wendling <morbo@google.com> Cc: Dr. David Alan Gilbert <linux@treblig.org> Cc: Guo Ren <guoren@kernel.org> Cc: Howard Chu <howardchu95@gmail.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: John Garry <john.g.garry@oracle.com> Cc: Julia Lawall <Julia.Lawall@inria.fr> Cc: Justin Stitt <justinstitt@google.com> Cc: Krzysztof Łopatowski <krzysztof.m.lopatowski@gmail.com> Cc: Leo Yan <leo.yan@linux.dev> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Nathan Chancellor <nathan@kernel.org> Cc: Nick Desaulniers <nick.desaulniers+lkml@gmail.com> Cc: Palmer Dabbelt <palmer@dabbelt.com> Cc: Paul Walmsley <pjw@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Sergei Trofimovich <slyich@gmail.com> Cc: Shimin Guo <shimin.guo@skydio.com> Cc: Suchit Karunakaran <suchitkarunakaran@gmail.com> Cc: Thomas Falcon <thomas.falcon@intel.com> Cc: Tianyou Li <tianyou.li@intel.com> Cc: Will Deacon <will@kernel.org> Cc: Zecheng Li <zecheng@google.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
42 lines
980 B
C
42 lines
980 B
C
// SPDX-License-Identifier: GPL-2.0
|
|
#include "addr_location.h"
|
|
#include "map.h"
|
|
#include "maps.h"
|
|
#include "thread.h"
|
|
|
|
void addr_location__init(struct addr_location *al)
|
|
{
|
|
al->thread = NULL;
|
|
al->map = NULL;
|
|
al->sym = NULL;
|
|
al->srcline = NULL;
|
|
al->addr = 0;
|
|
al->level = 0;
|
|
al->filtered = 0;
|
|
al->cpumode = 0;
|
|
al->cpu = 0;
|
|
al->socket = 0;
|
|
al->parallelism = 1;
|
|
}
|
|
|
|
/*
|
|
* The preprocess_sample method will return with reference counts for the
|
|
* in it, when done using (and perhaps getting ref counts if needing to
|
|
* keep a pointer to one of those entries) it must be paired with
|
|
* addr_location__exit(), so that the refcounts can be decremented.
|
|
*/
|
|
void addr_location__exit(struct addr_location *al)
|
|
{
|
|
map__zput(al->map);
|
|
thread__zput(al->thread);
|
|
}
|
|
|
|
void addr_location__copy(struct addr_location *dst, struct addr_location *src)
|
|
{
|
|
thread__put(dst->thread);
|
|
map__put(dst->map);
|
|
*dst = *src;
|
|
dst->thread = thread__get(src->thread);
|
|
dst->map = map__get(src->map);
|
|
}
|