📄 profile.m
字号:
function ps = profile(cc,fmt,timeout)
%PROFILE Returns code execution profile information.
% PS = PROFILE(CC,OPT,TIMEOUT) returns code profile measurements from any
% defined statistics timing objects (STS) in the processor referenced by
% the CC object. STS objects are a service of the DSP/BIOS(tm) real-time
% kernel and can be used for code profiling and tracking. The OPT
% parameter defines the format of the returned data. TIMEOUT defines an
% upper limit (in seconds) on the time this method will wait for
% completion. If the specified timeout period is exceeded, this method
% will immediately return with a timeout error.
%
% OPT options:
%
% 'report' - Generate an HTML report summarizing STS object statistics
% and return the filename.
%
% For DSP/BIOS applications generated by the Embedded Target
% for Texas Instruments TMS320C6000(tm) DSP Platform, this
% HTML report can also show subsystem-based profiling details.
%
% 'tic' - Return a formatted list of timing objects. The 'tic'
% structure contains the following fields:
% PS.cpuload - Execution time spent out of the idle task (percent)
% PS.sts - Vector of defined STS objects
% PS.sts(n).name - User defined name given to the STS object
% PS.sts(n).avg - Average measured profile period (in seconds)
% PS.sts(n).max - Maximum measured profile period (in seconds)
% PS.sts(n).count - Count of STS measurements that were taken
% PS.sts(n).units - 'Hi Time' or 'Low Time' - String description
% of the timer applied by this STS object
%
% 'raw' - Return a raw undocumented list of STS information. Refer to
% Code Composer documentation for details of this format.
%
% PS = PROFILE(CC,TIMEOUT) returns the profile in 'tic' format.
% PS = PROFILE Same as above, except the default timeout
% from the CC object is applied.
%
% Note - For the reported time periods to be accurate, the CLK and
% STS objects in the DSP/BIOS project must be properly configured
% for the embedded target.
%
% See also CCSDSP.
% Copyright 2001-2002 The MathWorks, Inc.
% $Revision: 1.7 $ $Date: 2002/06/12 15:30:34 $
error(nargchk(1,3,nargin));
if ~ishandle(cc),
error('First Parameter must be a CCSDSP Handle');
end
if nargin==1,
dtimeout = double(get(cc,'timeout'));
fmt = 'tic';
elseif nargin==2,
if isnumeric(fmt) & ~isempty(fmt),
dtimeout = fmt;
fmt = 'tic';
elseif ischar(fmt),
dtimeout = double(get(cc,'timeout'));
else
error('Parameter format error, expecting either an OPT string or a TIMEOUT value');
end
elseif nargin==3,
if ~isempty(timeout),
dtimeout = timeout;
else
dtimeout = double(get(cc,'timeout'));
end
end
if ~isnumeric(dtimeout) | length(dtimeout) ~= 1,
error('TIMEOUT parameter must be a single numeric value.');
end
if( dtimeout < 0)
error(['Negative TIMEOUT value "' num2str(dtimeout) '" not permitted.']);
end
% Dispatch the requested action
if strcmp(fmt,'tic') | strcmp(fmt,'raw'),
ps = ccsmexswitchyard([50,cc.boardnum,cc.procnum,dtimeout,cc.eventwaitms],fmt);
else
ti_profreport('report',cc);
end
% [EOF] profile.m
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -