1 #ifndef _PERFORMANCE_EXTRACTION_H
2 #define _PERFORMANCE_EXTRACTION_H
8 #define SYS_OVERHEAD 1400 //what should be exact vale
9 #define HOST_FREQUENCY 3 //Ghz
11 typedef struct COMP_ENTRY {
14 double total_computation_time;
19 typedef struct CURRENT_TIME {
23 extern int get_current_time(CURRENT_TIME *current_time_ptr);
24 extern double sub_time(CURRENT_TIME *start_time_ptr, CURRENT_TIME *end_time_ptr);
26 class Process_Performance
29 char _process_name[NAME_LENGTH];
34 Process_Performance(const char *process_name);
35 ~Process_Performance();
37 const char *get_name();
38 COMP_ENTRY * add_entry(int start_line, int end_line);
39 int set_entry(int start_line, int end_line, CURRENT_TIME *start_time_ptr,
40 CURRENT_TIME *end_time_ptr);
41 COMP_ENTRY *get_entry(int start_line, int end_line);
42 COMP_ENTRY *get_head_entry();
45 class Performance_Extraction
48 char _processor_type[NAME_LENGTH];
49 char _chr_file_name[NAME_LENGTH];
50 list<Process_Performance *> _list_process_performance;
51 list<Process_Performance *>::iterator _iter_process_performance;
54 Performance_Extraction(const char *chr_file_name);
55 ~Performance_Extraction();
57 int add_computation_performance(const char *process_name, int start_line,
58 int end_line, CURRENT_TIME *start_time_ptr,
59 CURRENT_TIME *end_time_ptr);
60 Process_Performance *get_process_performance(const char *process_name);
61 int write_to_xml_file(const char *chr_file_name);
62 int add_to_xml_file(const char *chr_file_name);
65 extern Performance_Extraction performance_extraction;