00001 00012 #ifndef OPD_SFILE_H 00013 #define OPD_SFILE_H 00014 00015 #include "opd_cookie.h" 00016 00017 #include "odb.h" 00018 #include "op_hw_config.h" 00019 #include "op_types.h" 00020 #include "op_list.h" 00021 00022 #include <sys/types.h> 00023 00024 struct kernel_image; 00025 struct transient; 00026 00027 #define CG_HASH_SIZE 16 00028 #define UNUSED_EMBEDDED_OFFSET ~0LLU 00029 00037 struct sfile { 00039 unsigned long hashval; 00041 cookie_t cookie; 00043 cookie_t app_cookie; 00045 pid_t tid; 00047 pid_t tgid; 00049 unsigned int cpu; 00051 struct kernel_image * kernel; 00053 struct anon_mapping * anon; 00055 uint64_t embedded_offset; 00056 00058 struct list_head hash; 00060 struct list_head lru; 00062 int ignored; 00064 odb_t files[OP_MAX_COUNTERS]; 00066 odb_t * ext_files; 00068 struct list_head cg_hash[CG_HASH_SIZE]; 00069 }; 00070 00072 struct cg_entry { 00074 struct sfile to; 00076 struct list_head hash; 00077 }; 00078 00080 void sfile_clear_kernel(void); 00081 00082 struct anon_mapping; 00083 00085 void sfile_clear_anon(struct anon_mapping *); 00086 00088 void sfile_sync_files(void); 00089 00091 void sfile_close_files(void); 00092 00095 int sfile_lru_clear(void); 00096 00098 void sfile_get(struct sfile * sf); 00099 00101 void sfile_put(struct sfile * sf); 00102 00107 struct sfile * sfile_find(struct transient const * trans); 00108 00110 void sfile_log_sample(struct transient const * trans); 00111 00113 void sfile_log_sample_count(struct transient const * trans, 00114 unsigned long int count); 00115 00117 void sfile_init(void); 00118 00119 #endif /* OPD_SFILE_H */