tools/perf/util/addr_location.c
Source file repositories/reference/linux-study-clean/tools/perf/util/addr_location.c
File Facts
- System
- Linux kernel
- Corpus path
tools/perf/util/addr_location.c- Extension
.c- Size
- 980 bytes
- Lines
- 42
- Domain
- Support Tooling And Documentation
- Bucket
- tools
- Inferred role
- Support Tooling And Documentation: implementation source
- Status
- source implementation candidate
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
addr_location.hmap.hmaps.hthread.h
Detected Declarations
function addr_location__initfunction addr_location__exitfunction addr_location__copy
Annotated Snippet
// 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);
}
Annotation
- Immediate include surface: `addr_location.h`, `map.h`, `maps.h`, `thread.h`.
- Detected declarations: `function addr_location__init`, `function addr_location__exit`, `function addr_location__copy`.
- Atlas domain: Support Tooling And Documentation / tools.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.