|
��������
monitor - ���������� ���������� ������� ���������
���������
#include <mon.h> void monitor (lowpc, highpc, buffer, bufsize, nfunc) int (*lowpc)( ), (*highpc)( ); WORD *buffer; int bufsize, nfunc;
��������
� ����������� ���������, ���������� � ������� �������
cc -p, ������������� ����������� ������ ������� monitor
� ���������������� ���������� ����������; ���� ���
������� ������� �������� ������ �����, ����� �����
����� ����������� ������� ���������� ���������������.
������� monitor ������������ ����� ��������� � ���������� ������ profil(2). ��������� lowpc � highpc �������� �������� ���� �������; buffer - ��� ����� (�����������������) ������� ��������� ���� WORD (��� ��������� �� ���������� ����� <mon.h>), ����� ������� �������� ���������� bufsize. ������� monitor ���������� ������ � ������ buffer ����������� �������� ������������ ������������� �������� ������, � ����� ��������� ����� ������� ��������� �������. �������� ����������� �������� �������� ������ ������������ �� lowpc (������ ������) �� highpc (�������� ��������� ����� ���� �������). ������ ������ lowpc ������ ���� ������� �� ����. ��������� ����� �� ����� nfunc ��������� �������; ����������� ������ ������ ��� �������, ������� ���� ��������������� � ������ �������������� -p ������� cc(1).
����� ���������� ��������� ������ ������������� � �������� ��������, �������� ����� ���� ���������, �� ����� ������������ �������, ����, ����� ������ ������� buffer ��� ��������� � ������������� ���������� �������.
��� ���������� ���������� ������� ���� ��������� ���������� ��������� �����������:
extern etext; ... monitor ((int (*)()) 2, &etext, buf, bufsize, nfunc);
������ etext ����� ��������������� �� ��������� ������ [��. end(3C)].
����� ���������� �������������� � �������� ����������, ������� ������������ ���������
monitor((int (*)()) 0, 0, 0, 0, 0);
����� ��� ��������� ����������� ����� ��������������� �������� prof(1).
� ������� ���������� ��������� PROFDIR ����� ��������� ������ ��������� ����� ������� monitor. ���� ����� ���������� ���, �� � ������� �������� ��������� ���� mon.out. ���� ���������� ����������, �� �������� � ��� ���, �� monitor �� ����������� ��������� � �� ������� �������� ����. � ��������� ������ ��������� �������� ���� � ������ $PROFDIR/�������������_��������.mon.out. ��� �������������� ������ ��������� monitor ����� ���������� �� ������� cc -p �������� ���� �������� ��� $PROFDIR/�������������_��������.���_���������.
�����
mon.out
��. �����
profil(2), end(3C).
cc(1), prof(1) � ����������� ������������.
��������
�����
$PROFDIR/�������������_��������.mon.out�� ��������. �������� �������������� �����
$PROFDIR/�������������_��������.���_���������
|