00001 /** 00002 * @file opd_extended.h 00003 * OProfile Extended Feature 00004 * 00005 * @remark Copyright 2007-2009 OProfile authors 00006 * @remark Read the file COPYING 00007 * 00008 * @author Suravee Suthikulpanit <suravee.suthikulpanit@amd.com> 00009 * Copyright (c) 2009 Advanced Micro Devices, Inc. 00010 */ 00011 00012 #ifndef OPD_EXTENDED_H 00013 #define OPD_EXTENDED_H 00014 00015 #include "opd_trans.h" 00016 #include "odb.h" 00017 00018 #include <stdlib.h> 00019 #include <stdint.h> 00020 00021 00022 /** 00023 * OProfile Extended Feature Table Entry 00024 */ 00025 struct opd_ext_feature { 00026 // Feature name 00027 const char* feature; 00028 // Feature handlers 00029 struct opd_ext_handlers * handlers; 00030 }; 00031 00032 /** 00033 * OProfile Extended handlers 00034 */ 00035 struct opd_ext_handlers { 00036 // Extended init 00037 int (*ext_init)(char const *); 00038 // Extended deinit 00039 int (*ext_deinit)(); 00040 // Extended statistics 00041 int (*ext_print_stats)(); 00042 // Extended sfile handlers 00043 struct opd_ext_sfile_handlers * ext_sfile; 00044 }; 00045 00046 /** 00047 * OProfile Extended sub-handlers (sfile) 00048 */ 00049 struct opd_ext_sfile_handlers { 00050 int (*create)(struct sfile *); 00051 int (*dup)(struct sfile *, struct sfile *); 00052 int (*close)(struct sfile *); 00053 int (*sync)(struct sfile *); 00054 odb_t * (*get)(struct transient const *, int); 00055 struct opd_event * (*find_counter_event)(unsigned long); 00056 }; 00057 00058 /** 00059 * @param value: commandline input option string 00060 * 00061 * Parse the specified extended feature 00062 */ 00063 extern int opd_ext_initialize(char const * value); 00064 00065 /** 00066 * @param value: commandline input option string 00067 * 00068 * Deinitialize 00069 */ 00070 extern int opd_ext_deinitialize(); 00071 00072 /** 00073 * Print out extended feature statistics in oprofiled.log file 00074 */ 00075 extern void opd_ext_print_stats(); 00076 00077 /** 00078 * opd_sfile extended sfile handling functions 00079 */ 00080 extern void opd_ext_sfile_create(struct sfile * sf); 00081 extern void opd_ext_sfile_dup (struct sfile * to, struct sfile * from); 00082 extern void opd_ext_sfile_close(struct sfile * sf); 00083 extern void opd_ext_sfile_sync(struct sfile * sf); 00084 extern odb_t * opd_ext_sfile_get(struct transient const * trans, int is_cg); 00085 00086 /** 00087 * @param counter: counter index 00088 * 00089 * Get event struct opd_event from the counter index value. 00090 */ 00091 extern struct opd_event * opd_ext_find_counter_event(unsigned long counter); 00092 00093 00094 #endif
1.6.1