From: <jj...@nu...> - 2010-01-09 00:47:58
|
Rick, Thanks for your suggestion! Regards, Jie >From: Rick Kufrin <rk...@il...> >Reply-To: >To: jj...@nu... >Subject: Re: [PerfSuite-users] On hacking perfsuite >Date:Fri, 08 Jan 2010 14:53:40 -0600 > >Jie Jiang wrote: > > Hi Rick, > > > > I'd like to hack Perfsuite to record some special information about the > > target application along with the performance data collected by > > perfsuite (such as profile, hardware PMU data, etc.) > > > > We have hacked OS kernel to provide a new syscall to collect such > > desired information. And I wish this syscall be called in libperfsuite, > > collect information and write the results in perfsuite's output files, > > together with perfsuite's performance data. > > > > Where should I start? > > > > Regards, > > Jie Jiang > > > > > > > > > > > > Jie, > > That sounds interesting and shouldn't be too difficult to do. Here is > the way to go about it: > > - additions to the data collected (your new syscall) belong in the > library libpshwpc, not libperfsuite. > > - C structures that hold the data are #define'd in the file hwpc.h. > Assuming that the data you want to add is on a per-thread basis, it > should be added to the structure call ps_hwpc_values_t > > - the code that actually does the collection is contained in the file > hwpc.c. This is basically the top-level entry point to the collection > library. I am guessing you will want to call your new system call once, > at the end of execution. If that is the case, then the appropriate > function to do that in is ps_hwpc_stop(), where you would execute your > syscall and store the results in the existing structure "values" (the > type is as above) > > - finally, you will want the new item written out to the XML output > document. To do that, you will need to add additional code to the > output routine in hwpc-xml.c. That file should be pretty > straightforward to understand. You will probably want to define a new > XML element tag (a name of your choice) for your data. It's up to you > where you want it placed within the document. This will now become an > invalid document (from the XML perspective), but that shouldn't matter > as validation is not done in post-processing. > > Next, if you want the psprocess utility to be able to parse out and > display the new data you have added, you will need to modify its > implementation as well. There are now two versions of psprocess (Tcl > and Java), and the default is Tcl. The appropriate file to modify to > add the new data is called hwpcreport.tcl. I do not know if you are > familiar with Tcl, but perhaps basing changes on the existing code in > there is the way to go. If you intend to work with the Java version of > psprocess, let us know and we can try to assist you with that. > > Hope that helps, > > Rick > > |