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.

Dependency Surface

Detected Declarations

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

Implementation Notes