prof(5) Standards, Environments, and Macros prof(5)NAME
prof - profile within a function
SYNOPSIS
#define MARK
#include <prof.h>
void MARK(name);
DESCRIPTION
MARK introduces a mark called name that is treated the same as a function entry point. Execution of the mark adds to a counter for that
mark, and program-counter time spent is accounted to the immediately preceding mark or to the function if there are no preceding marks
within the active function.
name may be any combination of letters, numbers, or underscores. Each name in a single compilation must be unique, but may be the same as
any ordinary program symbol.
For marks to be effective, the symbol MARK must be defined before the header prof.h is included, either by a preprocessor directive as in
the synopsis, or by a command line argument:
cc -p -DMARK work.c
If MARK is not defined, the MARK(name) statements may be left in the source files containing them and are ignored. prof -g must be used
to get information on all labels.
EXAMPLES
In this example, marks can be used to determine how much time is spent in each loop. Unless this example is compiled with MARK defined on
the command line, the marks are ignored.
#include <prof.h>
work( )
{
int i, j;
. . .
MARK(loop1);
for (i = 0; i < 2000; i++) {
. . .
}
MARK(loop2);
for (j = 0; j < 2000; j++) {
. . .
}
}
SEE ALSO profil(2), monitor(3C)SunOS 5.10 3 Jul 1990 prof(5)
Check Out this Related Man Page
PROF(1) General Commands Manual PROF(1)NAME
prof, kprof - display profiling data
SYNOPSIS
prof [ -dr ] [ program ] [ profile ]
kprof kernel kpdata
DESCRIPTION
Prof interprets files produced automatically by programs loaded using the -p option of 2l(1) or other loader. The symbol table in the
named program file by default) is read and correlated with the profile file by default). For each symbol, the percentage of time (in sec-
onds) spent executing between that symbol and the next is printed (in decreasing order), together with the time spent there and the number
of times that routine was called.
Under option -d, prof prints the dynamic call graph of the target program, annotating the calls with the time spent in each routine and
those it calls, recursively. The output is indented two spaces for each call, and is formatted as
symbol:time/ncall
where symbol is the entry point of the call, time is in milliseconds, and ncall is the number of times that entry point was called at that
point in the call graph. If ncall is one, the /ncall is elided. Normally recursive calls are compressed to keep the output brief; option
-r prints the full call graph.
The size of the buffer in program used to hold the profiling data, by default 2000 entries, may be controlled by setting the environment
variable profsize before running program. If the buffer fills, subsequent function calls may not be recorded.
Kprof is similar to prof, but presents the data accumulated by the kernel profiling device, kprof(3). The symbol table file, that of the
operating system kernel, and the data file, typically /dev/kpdata, must be provided. Kprof has no options and cannot present dynamic data.
SOURCE
/sys/src/cmd/prof.c
/sys/src/cmd/kprof.c
SEE ALSO 2l(1), kprof(3)PROF(1)
Some one plz help me how to sort an array of hashes .....
for e.g i have an array as
@AoH = (
{
ques => 10,
marks => 32,
},
{
ques => 32,
marks => 22,
},
{
ques => 2,
marks => 41,
},
);
now i want to sort this array with increasing value of "ques" ..... plz... (3 Replies)
HI,
In unix we can get profile on a c program like this ::
cc -g -p -o cpp_sw_gsmconverter_shailesh5 cpp_sw_gsmconverter_shailesh5.c
prof cpp_sw_gsmconverter_shailesh5
In the same manner how can I collect statistics in linux using gcc command.
Thanks in advance. (1 Reply)
Hello everyone
I want to use the standard Unix prof/gprof tool for my application but I cannot get through the compilation part. I have add the -xpg option in my makefile as specified in the cc man page but the linker gives me the following error:
***************************************... (3 Replies)
i have wipro netpower server with p4 and 256 ram.
i want share dot matrix printer installed on windows 2000 prof.
with sco openserver 5.0.5. plz help me to comeout from this trouble. (0 Replies)
Hi2all,
I have following command in IBM HMC console:
lssyscfg -r prof -m Server-9117-MMA-SN655D350 -F lpar_name,min_mem,desired_mem --header
which gives me the following output:
lpar_name,min_mem,desired_mem
lpar1,1024,2048
lpar2,1024,2048
lpar3,2048,4096
What I want is to add in... (3 Replies)
I've got a text file which has " marks where it there should be ' marks. I tried to do it with sed, but it won't allow me to escape the ' mark.
Here's what I tried to do:
sed 's/"/\\'/g' file.txt
How can this be done?
Thanks (3 Replies)
This is the coursework, in Technical University Sofia, Bulgaria prof. Koshmarov, sorry but the link to the course is broken. And this is the condition:
1. If the value of x is 5, and you have been set a new value as such
x="expr $x + 10", What would be the value of x?
What... (1 Reply)
I am struggling with one of my assignment questions, not sure how to go about coding it
question is
2. The fille ~eliwp/marks is a colon separated list of students and their
marks. Write a script to process this file printing out the id's of the
students that have failed the module.... (2 Replies)
Discussion started by: tina_2010
2 Replies
9. Post Here to Contact Site Administrators and Moderators
Why do you ask about prof info at homeworks forum..... do you contact to prof and tell him that this student asked for our help?
I asked that because some of them are very strickt and conseder that as cheating (4 Replies)