opd_anon.h revision cc2ee177dbb3befca43e36cfc56778b006c3d050
1/**
2 * @file opd_anon.h
3 * Anonymous region handling.
4 *
5 * @remark Copyright 2005 OProfile authors
6 * @remark Read the file COPYING
7 *
8 * @author John Levon
9 */
10
11#ifndef OPD_ANON_H
12#define OPD_ANON_H
13
14#include "op_types.h"
15#include "op_list.h"
16
17#include "opd_cookie.h"
18
19#include <sys/types.h>
20
21struct transient;
22
23/**
24 * Shift useful bits into play for VMA hashing.
25 */
26#define VMA_SHIFT 13
27
28struct anon_mapping {
29	/** start of the mapping */
30	vma_t start;
31	/** end of the mapping */
32	vma_t end;
33	/** tgid of the app */
34	pid_t tgid;
35	/** cookie of the app */
36	cookie_t app_cookie;
37	/** hash list */
38	struct list_head list;
39	/** lru list */
40	struct list_head lru_list;
41};
42
43/**
44 * Try to find an anonymous mapping for the given pc/tgid pair.
45 */
46struct anon_mapping * find_anon_mapping(struct transient *);
47
48void anon_init(void);
49
50#endif /* OPD_ANON_H */
51