[prev in list] [next in list] [prev in thread] [next in thread] 

List:       opensolaris-code
Subject:    [osol-code] resetting hardware counters in the pctx context
From:       James Lang <gercz () hotmail ! com>
Date:       2007-10-15 10:58:28
Message-ID: 17842355.1192471353915.JavaMail.Twebapp () oss-app1
[Download RAW message or body]

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
opensolaris-code@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic