HPUX-Pstat

 view release on metacpan or  search on metacpan

pack.c  view on Meta::CPAN

    PACK_IV(psd_last_pid);	/* last run process ID */
    PACK_IV(psd_rq);		/* run queue length */
    PACK_IV(psd_dw);		/* jobs in disk wait */
    PACK_IV(psd_pw);		/* jobs in page wait */
    PACK_IV(psd_sl);		/* jobs sleeping in core */
    PACK_IV(psd_sw);		/* swapped out runnable jobs */
    PACK_IV(psd_vm);		/* total virtual memory */
    PACK_IV(psd_avm);		/* active virtual memory */
    PACK_IV(psd_rm);		/* total real memory */
    PACK_IV(psd_arm);		/* active real memory */
    PACK_IV(psd_vmtxt);	        /* virt mem text */
    PACK_IV(psd_avmtxt);	/* active virt mem text */
    PACK_IV(psd_rmtxt);	        /* real mem text */
    PACK_IV(psd_armtxt);	/* active real mem text */
    PACK_IV(psd_free);	        /* free memory pages */
    PACK_NV(psd_avg_1_min);	/* global run queue lengths */
    PACK_NV(psd_avg_5_min);
    PACK_NV(psd_avg_15_min);
    PACK_IV(psd_openlv);	/* # of open Logical Volumes */
    PACK_IV(psd_openvg);	/* # of open LV Volume groups */
    PACK_IV(psd_allocpbuf);	/* # of allocated LV pvol buffers */
    PACK_IV(psd_usedpbuf);	/* # of LV pvol buffers in used */
    PACK_IV(psd_maxpbuf);	/* max # of LV pvol buffers avail. */
    PACK_IV(psd_activeprocs);   /* # of active proc  table entries */
    PACK_IV(psd_activeinodes);  /* # of active inode table entries */
    PACK_IV(psd_activefiles);   /* # of active file  table entries */
    PACK_IV(psd_mpdcnt);	/* # of (bad) memory pages deallocated */
    PACK_IV(psd_procovf);       /* # of times the proc table overflowed */
    PACK_IV(psd_inodeovf);      /* # of times the inode table overflowed */
    PACK_IV(psd_fileovf);       /* # of times the file table overflowed */
    PACK_IV(psd_global_virtual); /* Available global virt space (pages) */
    PACK_IV(psd_valid);	        /* This is a vector that will indicate
			         * if a certain field in is valid */

    { /* global cpu time/state */
        AV *av = newAV();
        int i;
        for (i=0; i<PST_MAX_CPUSTATES; i++) {
            av_push(av, newSViv(p->psd_cpu_time[i]));
        }
        PACK_AV(psd_cpu_time);
    }

    /* put ref to hv onto stack */
    sv = newSVrv(st, NULL);
    SvREFCNT_dec(sv);
    SvRV(st) = (SV*)hv;
}


/* pack struct pst_vminfo into a hash
 * and put a reference to this hash onto Perl stack
 */
void XS_pack_pst_vminfoPtr(SV* st, pst_vminfo* p)
{
    HV *hv = newHV();
    SV *sv;

    PACK_IV(psv_rdfree);	/* rate:	 pages freed by daemon */
    PACK_IV(psv_rintr);	        /* device interrupts */
    PACK_IV(psv_rpgpgin);	/* pages paged in */
    PACK_IV(psv_rpgpgout);	/* pages paged out */
    PACK_IV(psv_rpgrec);	/* total page reclaims */
    PACK_IV(psv_rpgtlb);	/* tlb flushes - 800 only */
    PACK_IV(psv_rscan);	        /* scans in pageout daemon */
    PACK_IV(psv_rswtch);	/* context switches */
    PACK_IV(psv_rsyscall);	/* calls to syscall() */
    PACK_IV(psv_rxifrec);	/* found in freelist rather than in filesys */
    PACK_IV(psv_rxsfrec);	/* found in freelist rather than on swapdev */
    PACK_IV(psv_cfree);	        /* cnt:		free memory pages */
    PACK_IV(psv_sswpin);	/* sum:		swapins */
    PACK_IV(psv_sswpout);	/* swapouts */
    PACK_IV(psv_sdfree);	/* pages freed by daemon */
    PACK_IV(psv_sexfod);	/* pages filled on demand from executables */
    PACK_IV(psv_sfaults);	/* total faults taken */
    PACK_IV(psv_sintr);	        /* device interrupts */
    PACK_IV(psv_sintrans);	/* intransit blocking page faults */
    PACK_IV(psv_snexfod);	/* number of exfod's created */
    PACK_IV(psv_snzfod);	/* number of zero filled on demand */
    PACK_IV(psv_spgfrec);	/* page reclaims from free list */
    PACK_IV(psv_spgin);	        /* pageins */
    PACK_IV(psv_spgout);	/* pageouts */
    PACK_IV(psv_spgpgin);	/* pages paged in */
    PACK_IV(psv_spgpgout);	/* pages paged out */
    PACK_IV(psv_spswpin);	/* pages swapped in */
    PACK_IV(psv_spswpout);	/* pages swapped out */
    PACK_IV(psv_srev);	        /* revolutions of the hand */
    PACK_IV(psv_sseqfree);	/* pages taken from sequential programs */
    PACK_IV(psv_sswtch);	/* context switches */
    PACK_IV(psv_ssyscall);	/* calls to syscall() */
    PACK_IV(psv_strap);	        /* calls to trap */
    PACK_IV(psv_sxifrec);	/* found in free list rather than in filesys */
    PACK_IV(psv_sxsfrec);	/* found on free list rather than on swapdev*/
    PACK_IV(psv_szfod);	        /* pages zero filled on demand */
    PACK_IV(psv_sscan);	        /* scans in pageout daemon */
    PACK_IV(psv_spgrec);	/* total page reclaims */
    PACK_IV(psv_deficit);	/* estimate of needs of new swapped-in procs */
    PACK_IV(psv_tknin);	        /* number of characters read from ttys */
    PACK_IV(psv_tknout);	/* number of characters written to ttys */
    PACK_IV(psv_cntfork);	/* number of forks */
    PACK_IV(psv_sizfork);	/* number of pages forked */
    PACK_IV(psv_lreads);	/* number of disk blk reads issued */
    PACK_IV(psv_lwrites);	/* number of disk blk writes issued */
    PACK_IV(psv_swpocc);	/* # of times swrq occ'd since boot */
    PACK_IV(psv_swpque);	/* cumulative len of swrq since boot */
    PACK_IV(psv_paging_thold);  /* paging threshold, moves between pst_desfree & pst_lotsfree */
    PACK_IV(psv_sysmem);        /* pages of memory unavailable for in-memory backing store */
    PACK_IV(psv_swapspc_cnt);   /* pages of on-disk backing store */
    PACK_IV(psv_swapspc_max);   /* max pages of on-disk backing store */
    PACK_IV(psv_swapmem_cnt);   /* pages of in-memory backing store */
    PACK_IV(psv_swapmem_max);   /* max pages of in-memory backing store */
    PACK_IV(psv_swapper_mem);   /* pages of backing store management */
    PACK_IV(psv_lreadsize);     /* # of char xfer'd by bread */
    PACK_IV(psv_lwritesize);    /* # of char xfer'd by bwrite */
    PACK_IV(psv_swapmem_on);	/* in-memory backing store enabled */

    { /* success by page size of LP fault page size selection  */
        AV *av = newAV();
        int i;
        for (i=0; i<PST_N_PG_SIZES; i++) {
            av_push(av, newSViv(p->psv_select_success[i]));
        }
        PACK_AV(psv_select_success);
    }

    { /* failure by page size of LP fault page size selection */
        AV *av = newAV();
        int i;
        for (i=0; i<PST_N_PG_SIZES; i++) {
            av_push(av, newSViv(p->psv_select_failure[i]));
        }
        PACK_AV(psv_select_failure);
    }

    { /* success by page size of LP allocation */
        AV *av = newAV();
        int i;
        for (i=0; i<PST_N_PG_SIZES; i++) {
            av_push(av, newSViv(p->psv_pgalloc_success[i]));
        }
        PACK_AV(psv_pgalloc_success);
    }

    { /* failure by page size of LP allocation */



( run in 1.819 second using v1.01-cache-2.11-cpan-e1769b4cff6 )