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 21 struct transient; 22 23 /** 24 * Shift useful bits into play for VMA hashing. 25 */ 26 #define VMA_SHIFT 13 27 28 /* Maximum size of the image name considered */ 29 #define MAX_IMAGE_NAME_SIZE 20 30 31 struct anon_mapping { 32 /** start of the mapping */ 33 vma_t start; 34 /** end of the mapping */ 35 vma_t end; 36 /** tgid of the app */ 37 pid_t tgid; 38 /** cookie of the app */ 39 cookie_t app_cookie; 40 /** hash list */ 41 struct list_head list; 42 /** lru list */ 43 struct list_head lru_list; 44 char name[MAX_IMAGE_NAME_SIZE+1]; 45 }; 46 47 /** 48 * Try to find an anonymous mapping for the given pc/tgid pair. 49 */ 50 struct anon_mapping * find_anon_mapping(struct transient *); 51 52 void anon_init(void); 53 54 #endif /* OPD_ANON_H */ 55