I have a tool that controls and monitors the hardware counters for a captured process. I have programmed a hardware counter so that when it overflows (ie. 0xffff -> 0x000) a SIGEMT signal is sent to the controlled process. The controlled process stops on the receipt of SIGEMT and allows me to do some measurements.
The problem: I cannot find the proper way to restart the hardware counter once they have stopped after receipt of the SIGEMT. cpc_request_preset() and cpc_set_restart() seemed promising but they fail because I can only execute them from the context of my tool, not the controlled process. I thought the function __pctx_cpc() from libpctx.c may be the solution. According to the documentation, this function "execute the private 'cpc' system call in the context of the controlled process." Thus I should be able to execute cpc_request_preset() and cpc_set_restart() from the context of the controlled process, ie. err = __pctx_cpc(pctx, cpc, CPC_PRESET, 0, (void *)ind1, (void *)preset, 0, 0); err = __pctx_cpc(pctx, cpc, CPC_RESTART, 0, 0, 0, 0, 0); However, they always fail with a return value of -1. I feel the reason they fail may be because I'm just not forming the __pctx_cpc() function call correctly. Any pointers or suggestions would be hugely appreciated. Thanks, James This message posted from opensolaris.org _______________________________________________ opensolaris-code mailing list [email protected] http://mail.opensolaris.org/mailman/listinfo/opensolaris-code
