tools/perf/util/map.h
Source file repositories/reference/linux-study-clean/tools/perf/util/map.h
File Facts
- System
- Linux kernel
- Corpus path
tools/perf/util/map.h- Extension
.h- Size
- 8242 bytes
- Lines
- 320
- 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
linux/refcount.hlinux/compiler.hlinux/list.hlinux/rbtree.hstdio.hstring.hstdbool.hlinux/types.hinternal/rc_check.h
Detected Declarations
struct dsostruct mapsstruct machinestruct kmapstruct symbolstruct threadstruct dso_idenum mapping_typefunction map__startfunction map__endfunction map__pgofffunction map__relocfunction map__flagsfunction map__protfunction map__privfunction map__hitfunction map__erange_warnedfunction map__sizefunction map__dso_map_ipfunction map__dso_unmap_ipfunction map__map_ipfunction map__unmap_ipfunction __map__zputfunction __map__is_kmodulefunction is_entry_trampolinefunction is_bpf_imagefunction is_anon_memoryfunction is_no_dso_memoryfunction map__set_startfunction map__set_endfunction map__set_pgofffunction map__add_pgofffunction map__set_relocfunction map__set_privfunction map__set_hitfunction map__set_erange_warnedfunction map__set_dsofunction map__set_mapping_typefunction map__mapping_type
Annotated Snippet
#ifndef __PERF_MAP_H
#define __PERF_MAP_H
#include <linux/refcount.h>
#include <linux/compiler.h>
#include <linux/list.h>
#include <linux/rbtree.h>
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <linux/types.h>
#include <internal/rc_check.h>
struct dso;
struct maps;
struct machine;
enum mapping_type {
/* map__map_ip/map__unmap_ip are given as offsets in the DSO. */
MAPPING_TYPE__DSO,
/* map__map_ip/map__unmap_ip are just the given ip value. */
MAPPING_TYPE__IDENTITY,
};
DECLARE_RC_STRUCT(map) {
u64 start;
u64 end;
u64 pgoff;
u64 reloc;
struct dso *dso;
refcount_t refcnt;
u32 prot;
u32 flags;
enum mapping_type mapping_type:8;
bool erange_warned;
bool priv;
bool hit;
};
struct kmap;
struct kmap *__map__kmap(struct map *map);
struct kmap *map__kmap(struct map *map);
struct maps *map__kmaps(struct map *map);
static inline struct dso *map__dso(const struct map *map)
{
return RC_CHK_ACCESS(map)->dso;
}
static inline u64 map__start(const struct map *map)
{
return RC_CHK_ACCESS(map)->start;
}
static inline u64 map__end(const struct map *map)
{
return RC_CHK_ACCESS(map)->end;
}
static inline u64 map__pgoff(const struct map *map)
{
return RC_CHK_ACCESS(map)->pgoff;
}
static inline u64 map__reloc(const struct map *map)
{
return RC_CHK_ACCESS(map)->reloc;
}
static inline u32 map__flags(const struct map *map)
{
return RC_CHK_ACCESS(map)->flags;
}
static inline u32 map__prot(const struct map *map)
{
return RC_CHK_ACCESS(map)->prot;
}
static inline bool map__priv(const struct map *map)
{
return RC_CHK_ACCESS(map)->priv;
}
static inline bool map__hit(const struct map *map)
{
return RC_CHK_ACCESS(map)->hit;
}
Annotation
- Immediate include surface: `linux/refcount.h`, `linux/compiler.h`, `linux/list.h`, `linux/rbtree.h`, `stdio.h`, `string.h`, `stdbool.h`, `linux/types.h`.
- Detected declarations: `struct dso`, `struct maps`, `struct machine`, `struct kmap`, `struct symbol`, `struct thread`, `struct dso_id`, `enum mapping_type`, `function map__start`, `function map__end`.
- 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.