also only time-limit if a value is provided.
R=rsc
DELTA=9 (4 added, 2 deleted, 3 changed)
OCL=18917
CL=18920
Map *map;
Map *symmap;
struct Ureg ureg;
-int total_sec = 10;
+int total_sec = 0;
int delta_msec = 100;
int collapse = 1; // collapse histogram trace points in same function
static int n;
n++;
- ctlproc(pid, "stop");
for(i = 0; i < sizeof ureg; i+=8) {
if(get8(map, (uvlong)i, &((uvlong*)&ureg)[i/8]) < 0) {
if(n == 1)
return 0;
}
}
- ctlproc(pid, "start");
return 1;
}
{
int h;
PC *x;
-
+
h = pc % Ncounters;
for(x = counters[h]; x != NULL; x = x->next) {
if(x->pc == pc) {
req.tv_sec = delta_msec/1000;
req.tv_nsec = 1000000*(delta_msec % 1000);
- for(msec = 0; msec < 1000*total_sec; msec += delta_msec) {
- if(!sample())
+ for(msec = 0; total_sec <= 0 || msec < 1000*total_sec; msec += delta_msec) {
+ ctlproc(pid, "stop");
+ if(!sample()) {
+ ctlproc(pid, "start");
break;
+ }
printpc(ureg.ip, ureg.sp);
+ ctlproc(pid, "start");
nanosleep(&req, NULL);
}
}