Dumping Profile Information

The _PGOPTI_Prof_Dump_All() function dumps the profile information collected by the instrumented application. The prototype of the function call is listed below.

Syntax

void _PGOPTI_Prof_Dump_All(void);

An older version of this function, _PGOPTI_Prof_Dump(), which will also dump profile information is still available; the older function operates much like _PGOPTI_Prof_Dump_All(), except on Linux* operating systems, when used in connection with shared libraries (.so) and _exit() function to terminate a program. When _PGOPTI_Prof_Dump_All() is called before _exit() function to terminate the program, the new function insures that a .dyn file is created for all shared libraries needing to create a .dyn file. Use _PGOPTI_Prof_Dump_All() on Linux OS to insure portability and correct functionality.

The profile information is generated in a .dyn file (generated in phase 2 of PGO).

The environment variables that affect the _PGOPTI_Prof_Dump_All() function are PROF_DIR and PROF_DPI. Set the PROF_DIR environment variable to specify the directory to which the .dyn file must be stored. Alternately, you could use the –prof_dir profmerge tool option to specify this directory without setting the PROF_DIR variable. Set the PROF_DPI environment variable to specify an alternative .dpi filename. The default filename is pgopti.dpi. Alternately, you could use the –prof_dpi profmerge tool option to specify the filename for the summary .dpi file.

Recommended usage

Insert a single call to this function in the body of the function which terminates the user application. Normally, _PGOPTI_Prof_Dump_All() should be called just once. It is also possible to use this function in conjunction with _PGOPTI_Prof_Reset() function to generate multiple .dyn files (presumably from multiple sets of input data).

Example

#include <pgouser.h>
void process_data(int foo) {}
int  get_input_data() { return 1; }
int  main(void)
{
// Selectively collect profile information for the portion
// of the application involved in processing input data.
  int input_data = get_input_data();
  while (input_data) {
    _PGOPTI_Prof_Reset();
    process_data(input_data);
    _PGOPTI_Prof_Dump_All();
    input_data = get_input_data();
  }
  return 0;
}

Submit feedback on this help topic

Copyright © 1996-2011, Intel Corporation. All rights reserved.