From: Maynard J. <may...@us...> - 2009-03-18 21:02:05
|
Suravee Suthikulpanit wrote: > Design Summary: Suravee, Thanks -- I think we're getting real close to having it right. When we come to agreement on the extended feature interface and we've got the first implementation of it accepted (i.e., IBS), we'll want to have the OProfile internals doc (http://oprofile.sourceforge.net/doc/internals/index.html) updated to explain how to use this interface to support extended sample information. The information below is a good start, but it will need a few words around it to describe its use in real life. > > * New oprofiled command line interface > -x|--ext-feature=<extended feature type>:<args> This option enable a specific extended feature, and arguments. Please be consistent with terminology. You use "Feature name" below. I personally like that better than "feature type". > > * "opd_ext_feature" structure contains information for each extended feature including type name, and a structure containing handlers function. > > struct opd_ext_feature { > const char* feature; // Feature name > struct opd_ext_handlers *handlers; // Feature handlers > }; > > * "opd_ext_handlers" structure contains handlers for each extended feature. > o ext_init: handle the initialization of the feature at the beginning when oprofiled parsing the command line options (oprofiled.c). > o ext_print_stats: will print out the statistics summary in the oprofiled.log file at the end of the run (daemon/opd_stat.c). > o ext_sfle: a pointer to structure containing handlers for the operations necessary to extend opd_sfile (daemon/opd_sfile.c) > > struct opd_ext_handlers { > int (*ext_init)(char const * ); // Extended init > int (*ext_print_stats)(); // Extended statistics > struct opd_ext_sfile_handlers *ext_sfile; // Extended sfile handlers (optional) > }; > > struct opd_ext_sfile_handlers { > void (*create)(struct sfile *, struct transient const *); > void (*dup)(struct sfile *, struct sfile * ); > void (*close)(struct sfile *); > void (*sync)(struct sfile *); > odb_t * (*get)(struct transient const * , int ); > struct opd_event * (*find_counter_event)(unsigned long); > }; > > * Extended Feature Table: This is a global table of "struct opd_ext_feature" described above. Each extended feature must be listed here. > > struct opd_ext_feature ext_feature_table[] = { > {"feature1", &feature1_handlers}, > {"feature2", &feature2_handlers}, > {"feature3", &feature3_handlers}, > {....}, > {NULL, NULL} > }; > > * Extend the "struct sfile" in opd_sfile.h by adding "odb_t * ext_file". > > * Typically, opcontrol uses ophelp to determine how to program a set of performance counters with the specified events. To handle the new extended events: > o A new tag "ext" will be used by extended events, which does not use the actual performance counter. > o Added new CML option "--check-ext", which will return the value of the "ext" tag in the events file. > > - Traditional events > event:0x76 counters:0,1,2,3 um:zero minimum:5000 name:CPU_CLK_UNHALTED : Cpu unhalted clock cycle */ > ophelp --check-events=CPU_CLK_UNHALTED:100000 ---> 0 > > - Extended events > event:0xf00 ext:ibs_fetch um:zero minimum:100000 name:IBS_FETCH_ALL : All IBS fetch samples */ > ophelp --check-ext=IBS_FETCH_ALL:100000 ---> ibs_fetch How/where would this be used? The --check-events option is used by opcontrol to ensure we have the necessary hardware counter resources to count the selected events. But at this time, I don't see the need for a --check-ext option. Or am I missing something? > > Nice work! -Maynard > > ------------------------------------------------------------------------------ > Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are > powering Web 2.0 with engaging, cross-platform capabilities. Quickly and > easily build your RIAs with Flex Builder, the Eclipse(TM)based development > software that enables intelligent coding and step-through debugging. > Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com > _______________________________________________ > oprofile-list mailing list > opr...@li... > https://lists.sourceforge.net/lists/listinfo/oprofile-list |