| | 2412 | | tm_tracer(tp, mp) | | | 2413 | | struct task *tp; | | | 2414 | | struct pmsg *mp; | | | 2415 | | { | | | 2416 | | int regme; | | | 2417 | | int tctx; | | | 2418 | | int ttag; | | | 2419 | | int octx; | | | 2420 | | int otag; | | | 2421 | | Pvmtmask tmask; | | | 2422 | | int tbuf; | | | 2423 | | int topt; | | | 2424 | | struct pmsg *mp2; | | | 2425 | | struct pmsg *mpd; | | | 2426 | | int slconf; | | | 2427 | | int hh; | | | 2428 | | struct hostd *hp; | | | 2429 | | char buf[512]; | | | 2430 | | | | | 2431 | | if (upkint(mp, ®me)) { | | | 2432 | | pvmlogerror("tm_tracer() bad msg format\n"); | | | 2433 | | return 0; | | | 2434 | | } | | | 2435 | | | | | 2436 | | mp2 = replymessage(mp); | | | 2437 | | | | | 2438 | | slconf = 0; | | | 2439 | | | | | 2440 | | if (regme) { | | | 2441 | | if (pvmtracer.trctid) { | | | 2442 | | pkint(mp2, PvmAlready);
| | | 2443 | | | | | 2444 | | } else { | | | 2445 | | tp->t_flag |= TF_ISTRACER;
| | | 2446 | | upkint(mp, &tctx); | | | 2447 | | upkint(mp, &ttag); | | | 2448 | | upkint(mp, &octx); | | | 2449 | | upkint(mp, &otag); | | | 2450 | | upkstr(mp, tmask, TEV_MASK_LENGTH);
| | | 2451 | | upkint(mp, &tbuf); | | | 2452 | | upkint(mp, &topt); | | | 2453 | | pvmtracer.trctid = tp->t_tid; | | | 2454 | | pvmtracer.trcctx = tctx; | | | 2455 | | pvmtracer.trctag = ttag; | | | 2456 | | pvmtracer.outtid = tp->t_tid; | | | 2457 | | pvmtracer.outctx = octx; | | | 2458 | | pvmtracer.outtag = otag; | | | 2459 | | BCOPY(tmask,pvmtracer.tmask,TEV_MASK_LENGTH);
| | | 2460 | | pvmtracer.trcbuf = tbuf; | | | 2461 | | pvmtracer.trcopt = topt; | | | 2462 | | slconf++; | | | 2463 | | if (pvmdebmask & PDMTRACE) {
| | | 2464 | | pvmlogprintf("tm_tracer() register t%x \n", tp->t_tid); | | | 2465 | | } | | | 2466 | | pkint(mp2, 0); | | | 2467 | | } | | | 2468 | | | | | 2469 | | } else { | | | 2470 | | if (pvmtracer.trctid == tp->t_tid) { | | | 2471 | | tp->t_flag &= ~TF_ISTRACER;
| | | 2472 | | pvmtracer.trctid = 0; | | | 2473 | | pvmtracer.trcctx = 0; | | | 2474 | | pvmtracer.trctag = 0; | | | 2475 | | pvmtracer.outtid = 0; | | | 2476 | | pvmtracer.outctx = 0; | | | | | ... | | | 2488 | | } else { | | | 2489 | | if (pvmdebmask & PDMTRACE) {
| | | 2490 | | pvmlogprintf("tm_tracer() t%x tries to unregister?\n", | | | 2491 | | tp->t_tid); | | | 2492 | | } | | | 2493 | | pkint(mp2, PvmNoTask);
| | | 2494 | | } | | | 2495 | | } | | | 2496 | | | | | 2497 | | | | | 2498 | | if ( slconf ) { | | | 2499 | | for (hh = hosts->ht_last; hh > 0; hh--) { | | | 2500 | | if (hp = hosts->ht_hosts[hh]) { |
| mpd <= 4095 | 2502 | | mpd->m_tag = DM_SLCONF;
| | | 2503 | | mpd->m_dst = hp->hd_hostpart | TIDPVMD;
| | | 2504 | | pkint(mpd, DM_SLCONF_TRACE);
| | | 2505 | | sprintf(buf, "%x %d %d %x %d %d %d %d %s", | | | 2506 | | pvmtracer.trctid, pvmtracer.trcctx, | | | 2507 | | pvmtracer.trctag, | | | 2508 | | pvmtracer.outtid, pvmtracer.outctx, | | | 2509 | | pvmtracer.outtag, | | | 2510 | | pvmtracer.trcbuf, pvmtracer.trcopt, | | | 2511 | | pvmtracer.tmask); | | | 2512 | | pkstr(mpd, buf); | | | 2513 | | sendmessage(mpd); |
|