Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

prof(5) [ultrix man page]

prof(5) 							File Formats Manual							   prof(5)

Name
       prof - profile within a function

Syntax
       #define MARK
       #include <prof.h>

       void MARK (name)

Description
       The  symbol  produces  a mark called name that is treated the same as a function entry point.  Execution of the mark increments the counter
       for that mark, and the program-counter time spent is accounted to the preceding mark or to the function if a preceding mark is  not  within
       the active function.

       The  name argument can be any combination of numbers or underscores.  Each name in a single compilation must be unique, but can be the same
       as any ordinary program symbol.

       For marks to be effective, the symbol must be defined before the header file is included.  This may be defined by a preprocessor  directive
       as in the synopsis, or by a command line argument.  For example:
       cc -p -DMARK foo.c
       If is not defined, the statements may remain in the source files, but they will be ignored.

Examples
       In  the following example, marks are used to determine how much time is spent in each loop.  Unless the example is compiled with defined on
       the command line, the marks are ignored:
       #include <prof.h>
       foo( )
       {
	    int i, j;
	    .
	    .
	    .
	    MARK(loop1);
	    for (i = 0; i < 2000; i++) {
		 . . .
	    }
	    MARK(loop2);
	    for (j = 0; j < 2000; j++) {
		 . . .
	    }
       }

See Also
       prof(1), profil(2), monitor(3c)

								       RISC								   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)
Man Page

8 More Discussions You Might Find Interesting

1. Programming

Gettting statistics/profile of c program in linux

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)
Discussion started by: chprvkmr
1 Replies

2. UNIX for Advanced & Expert Users

Issue with dispaly of special character like 'TM'

Hi, I've an xml file with special characetr 'TM' (trade mark sign). The issue is that I am not able to get the symbol 'TM'(trade mark sign) on unix. It displays '?' instead. I've searched the solution on net. Wht I've found is that the symbol 'TM' does not come under ISO-8859-1 char set. So I... (0 Replies)
Discussion started by: vbehal
0 Replies

3. Programming

How to the prof/gprof tool

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)
Discussion started by: amatsaka
3 Replies

4. Shell Programming and Scripting

Add text before lines in command output

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)
Discussion started by: UsRb
3 Replies

5. Shell Programming and Scripting

sed: how to replace regex with a ' (quote) mark

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)
Discussion started by: CraigMoore
3 Replies

6. Shell Programming and Scripting

finding * in command line argument

I have to write a script to determine whether given command line argument ($1) contains "*" symbol or not, if $1 does not contains "*" symbol add it to $1, otherwise show message "Symbol is not required". For e.g. If we called this script q5 then after giving , $ q5 /bin Here $1 is /bin, it... (5 Replies)
Discussion started by: cynosure2009
5 Replies

7. Homework & Coursework Questions

Can anybody help me with coursework

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)
Discussion started by: astralito
1 Replies

8. Post Here to Contact Site Administrators and Moderators

Homework rules !

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)
Discussion started by: fwrlfo
4 Replies