Static Patch Space Allocation

TotalView can statically allocate patch space if you add a specially named array to your program. You can then specify the size of the patch space. When TotalView needs to use patch space, it uses this space created for this array.

To include a 1 MB statically allocated patch space in your program, add the TVDB_patch_base_address data object in a C module. Because this object must be 8-byte aligned, declare it as an array of doubles. For example:

                /* 1 megabyte == size TV expects */
#define PATCH_LEN 0x100000 
double TVDB_patch_base_address [PATCH_LEN / sizeof(double)]

If you need to use a static patch space size that differs from the 1 MB default, you must use assembler language. The following table shows sample assembler code for three platforms that support compiled patch points.

Platform
Assembler Code
Compaq Tru64 UNIX
    .data
    .align 3
    .globl TVDB_patch_base_address
    .globl TVDB_patch_end_address
TVDB_patch_base_address:
    .byte 0x00 : PATCH_SIZE
TVDB_patch_end_address:
IBM AIX
    .csect .data{RW}, 3
    .globl TVDB_patch_base_address
    .globl TVDB_patch_end_address
TVDB_patch_base_address:
    .space PATCH_SIZE
TVDB_patch_end_address:
SGI IRIX
    .data
    .align 3
    .globl TVDB_patch_base_address
    .globl TVDB_patch_end_address
TVDB_patch_base_address:
    .space PATCH_SIZE
TVDB_patch_end_address:

Here is how you would use the static patch space assembler code:

  1. Use an ASCII editor and place the assembler code into a file named tvdb_patch_space.s.
     
  2. Replace the PATCH_SPACE tag with the decimal number of bytes you want. This value must be a multiple of 8.
     
  3. Assemble the file into an object file by using a command such as:

        cc -c tvdb_patch_space.s

    On SGI IRIX, use -n32 or -64 to create the correct object file type.

  4. Link the resulting tvdb_patch_space.o into your program.
 
 
 
 
support@etnus.com
Copyright © 2001, Etnus, LLC. All rights reserved.
Version 5.0