[parsec-users] hooks and magic instruction

Christian Bienia cbienia at CS.Princeton.EDU
Wed Apr 23 13:06:28 EDT 2008

Hello Huan,

The hooks are technically just function calls which we added to all workloads 
at predefined locations. By default these function calls do nothing more than 
simply measuring the time spent in the ROI (Region of Interest) which we 
defined for each workload and allowing thread affinity control via 
environment variables on Linux. The ROI includes everything except 
initialization and cleanup. We provide the build configuration 'gcc-hooks' 
which enables the hooks by default. Have a look at file 
$PARSECDIR/config/gcc-hooks.bldconf to see how to do that.

You can use the hooks to conveniently insert code into all workloads by adding 
it to the correct functions in file hooks.c in the hooks package and 
rebuilding the benchmark suite. You can use this e.g. to insert magic 
instructions which are recognized by your simulator. In fact, we already did 
do that for Simics, but it is disabled by default. The only documentation 
which we currently provide are the comments in hooks.h. Have a look there to 
see how workloads call the hook functions.

- Chris

On Wednesday 23 April 2008 12:01 pm, Huan Fang wrote:
> Hi Chris,
> In the last mail you mentioned
> /"The hooks are special function calls that are made by all PARSEC programs
> at the defined locations. You can find the hook library and some basic
> documentation in the package "hooks" in the "libs" group. After you
> modified the package simply add your code and rebuild PARSEC. Your build
> configuration must explicitly enable the hooks, we provide one
> configuration which does that by default."
> /I am wondering what's the difference between hooks and Simics
> magic_instruction. Are they the same thing like a breakpoint?  BTW, I
> didn't find docs in the "hooks" in the "libs" group. But I found in some
> source code #if defined(ENABLE_PARSEC_HOOKS)
> 	__parsec_bench_begin(__parsec_bodytrack);
> #endif
> Is this what I should enable? and what else I should add to the code?
> Thank you!
> Regards,
> Huan
> _______________________________________________
> parsec-users mailing list
> parsec-users at lists.cs.princeton.edu
> https://lists.cs.princeton.edu/mailman/listinfo/parsec-users

More information about the parsec-users mailing list