Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

cord(1) [osf1 man page]

cord(1) 						      General Commands Manual							   cord(1)

NAME
cord - Rearrange procedures in an executable file to facilitate better cache mapping SYNOPSIS
cord [-vV] [-o outfile] [-f] [-c cachesize] [-p maxphases] obj-file reorder-file OPTIONS
The cord command accepts the following options: Prints verbose information. This includes listing those procedures that are considered part of other procedures and that cannot be rearranged (that is, assembler procedures that may contain relative branches to other procedures instead of relocatable branches). The listing also lists those procedures in the flipped area (if any) and a mapping of old location to new. Displays the version of the cord command. Specifies the output file. If not specified, a.out is used. Flips the first cachepage size procedures. When cord was written, the assumption was that procedures would be reordered by procedure density (cycles/byte). This option ensures that the densest part of each page following the first cachepage would conflict with the least-dense part of the first cachepage. Specifies the cache size (in bytes) of the machine on which you want to execute. This only affects the -f option. If not speci- fied, 65536 is used. Specifies the maximum number phases allowed. The default is 20. DESCRIPTION
The cord command rearranges procedures in an executable object file to maximize efficiency in a machine's cache. By rearranging the proce- dures properly, you can reduce the instruction cache miss rates. The cord command does not attempt to determine the correct ordering; it must be given a reorder-file containing the desired procedure order. The reorder file is generated by the ftoc program, which in turn gen- erates a reorder file from a set of profile feedback files (see prof(1)). Processed lines in the reorder file are called procedure lines. Each procedure line must be on a separate source line. Each procedure line must contain the source name of the file, followed by a blank, followed by a qualified procedure name. Nested procedures must be qualified x.y, where x is the outer procedure. A newline or blank can follow the procedure name: foo.c bar (everything else following is ignored) Lines beginning with # are comments, lines beginning with $ are considered cord directive lines. The only directive currently understood is $phase. This directive will consider the rest of the file (until the end of file or next $phase) as a new phase of the program and will order the procedures accordingly. A procedure may appear in more than one phase, resulting in more than one copy of it in the final binary. First, cord will try to relocate procedure references to a copy of the procedure belonging to the requesting phase; otherwise, it will relocate the references to a random copy. Use the -cord option to a compiler driver like cc(1) rather than execute cord directly. The cord options can be specified with -Wc,cor- darg0,cordarg1,.... If you have to run cord by hand, you may want to run it once with the driver using the -v option on a simple program. This will enable you to see the exact passes and the arguments involved in using cord. Warning Since cord works from an input list of procedures generated from profile output, the resulting binary is data dependent. In other words, it may only perform well on the same input data that generated the profile information, and may perform worse than the original binary on other data. Furthermore, if the hot areas in the cache do not fit well into one cachepage, performance can degrade. SEE ALSO
Commands: cc(1), ftoc(1), ld(1), prof(1) Programmer's Guide cord(1)

Check Out this Related Man Page

cord(1) 						      General Commands Manual							   cord(1)

Name
       cord - rearranges procedures in an executable to facilitate better cache mapping.

Syntax
       cord [ -c cachesize ] [ -f ] [ -o outfile ] [ -p maxphases ] [ -v ] obj reorder

Description
       The  command rearranges procedures in an executable object to maximize efficiency in a machine's cache. By rearranging the procedures prop-
       erly, the instruction cache miss rate is reduced. The command does not attempt to determine the correct ordering, but is  given	a  reorder
       file containing the desired procedure order. The reorder file is generated by the program which in turn generates a reorder file from a set
       of profile feedback files (see ).

       Processed lines in the reorder file are called procedure lines.	Each procedure line must be on a separate source line. Each procedure line
       must  contain  the source name of the file, followed by a blank followed by a qualified procedure name (nested procedures need to be quali-
       fied x.y where x is the outer procedure). A newline or blank can follow the procedure name:
       foo.c bar >>i ignore this stuff<<

       Lines beginning with a pound sign (#) are comments.  Lines beginning with a dollar sign ($) are considered directive lines. The only direc-
       tive  currently	understood  is	$phase.  This directive will consider the rest of the file (until the end of file or next $phase) as a new
       phase of the program and will order the procedures accordingly. Procedures may appear in more than one phase, resulting in  more  than  one
       copy  of  it  in  the final binary.  The command will try to relocate references to a procedure to a copy in the requesting phase's list of
       procedures first and then a random copy if one is not found.

       You should use the -cord option to a compiler driver like rather than execute cord directly. Options to	can  be  specified  with  -Wz,cor-
       darg0,cordarg1,....   If  you have to run manually, you should run it once with the driver using the -v flag on a simple program to see the
       exact passes and their arguments involved in using

       The obj argument is an executable object with its relocation information intact. This can be achieved by passing the -r -z  -d  options	to
       the  linker, The -r linker option maintains relocation information in the object, but will not make it a ZMAGIC file (hence -z) nor will it
       allocate common variables (hence -d) as it would without the option.

Options
       -c cachesize   Specify the cachesize of the machine you want to execute on in bytes. This only affects the  -f  option.	If  not  specified
		      65536 is used.

       -f	      Flip  the  first cachepage size procedures. The assumption when was written was that procedures would be reordered by proce-
		      dure density (cycles/byte). This option ensures that the densest part of each page following the first cachepage would  con-
		      flict with least dense part of the first cachepage.

       -o outputfile  specifies the output file. If not specified, a.out is used.

       -p phasemax    Specifies the maximum number of phases allowed. The default is 20.

       -v	      Prints  verbose  information. This includes listing those procedures considered part of other procedures and cannot be rear-
		      ranged (these are basically assembler procedures that may contain relative branches to other procedures rather than relocat-
		      able ones). The listing also list those procedures in the flipped area (if any) and a mapping of old location to new.

Restrictions
       Since works from an input list of procedures generated from profile output, the resulting binary is data dependent.  In other words, it may
       only perform well on the same input data that generated the profile information and may perform worse than the  original  binary  on  other
       data.  Furthermore, if the hot areas in the cache don't fit well into one cachepage, performance can degrade.

See Also
       cc(1), ftoc(1), ld(1), prof(1)

								       RISC								   cord(1)
Man Page