1 @c ----------------------------------------------------------------------------
2 @c This is the Texinfo source file for the gp-archive man page.
4 @c Author: Ruud van der Pas
5 @c ----------------------------------------------------------------------------
7 \input texinfo @c -*-texinfo-*-
8 @setfilename gp-archive
9 @settitle Archive gprofng experiment data
10 @include gp-macros.texi
13 @c ----------------------------------------------------------------------------
14 @c This is from the man-pages(7) man page
16 @c "The list below shows conventional or suggested sections. Most manual pages
17 @c should include at least the highlighted sections. Arrange a new manual
18 @c page so that sections are placed in the order shown in the list."
22 @c CONFIGURATION [Normally only in Section 4]
24 @c OPTIONS [Normally only in Sections 1, 8]
25 @c EXIT STATUS [Normally only in Sections 1, 8]
26 @c RETURN VALUE [Normally only in Sections 2, 3]
27 @c ERRORS [Typically only in Sections 2, 3]
30 @c VERSIONS [Normally only in Sections 2, 3]
31 @c ATTRIBUTES [Normally only in Sections 2, 3]
36 @c AUTHORS [Discouraged]
37 @c REPORTING BUGS [Not used in man-pages]
38 @c COPYRIGHT [Not used in man-pages]
41 @c This is what the texi2pod.pl tool recognizes:
43 @c for $sect (qw(NAME SYNOPSIS TARGET DESCRIPTION OPTIONS ENVIRONMENT FILES
44 @c BUGS NOTES FOOTNOTES SEEALSO AUTHOR COPYRIGHT)) {
46 @c What is interesting is that it places "SEE ALSO" before "COPYRIGHT", which
47 @c makes sense and adhered to for the other formats.
48 @c ----------------------------------------------------------------------------
50 @c ----------------------------------------------------------------------------
52 @c ----------------------------------------------------------------------------
57 gp-archive - Archive the associated application binaries and sources for a
63 @c ----------------------------------------------------------------------------
65 @c ----------------------------------------------------------------------------
67 @ManPageStart{SYNOPSIS}
70 @command{gprofng archive} [@var{option(s)}] @var{experiment}
75 @c ----------------------------------------------------------------------------
76 @c DESCRIPTION section
77 @c ----------------------------------------------------------------------------
79 @ManPageStart{DESCRIPTION}
80 @c man begin DESCRIPTION
82 Archive the associated application binaries and source files in a gprofng
83 experiment to make it self contained and portable.
85 By default, the binaries are archived as part of the data collection, but the
86 application source files are not archived. Use this tool to change this and
87 afterwards archive additional components.
89 This tool has to be executed on the same system where the profiling data was
95 @c ----------------------------------------------------------------------------
97 @c ----------------------------------------------------------------------------
99 @ManPageStart{OPTIONS}
106 @IndexSubentry{Options, @code{--version}}
109 Print the version number and exit.
113 @IndexSubentry{Options, @code{--help}}
116 Print usage information and exit.
118 @item -a @{off | on | ldobjects | src | usedldobjects | used[src]@}
120 @IndexSubentry{Options, @code{-a}}
123 Specify archiving of binaries and other files. In addition to disable this
124 feature (@samp{off}), or enable archiving of all loadobjects and sources
125 (@samp{on}), the other choices support a more refined selection.
127 All of these choices enable archiving, but the keyword controls what exactly
128 is selected: all load objects (@samp{ldobjects}), all source files
129 (@samp{src}), the loadobjects associated with a program counter
130 (@samp{usedldobjects}), or the source files associated with a program counter
131 (@samp{used[src]}). The default is @samp{-a ldobjects}.
135 @IndexSubentry{Options, @code{-d}}
138 The @var{path} is the absolute path to a common archive, which is a
139 directory that contains archived files. If the directory does not
140 exist, then it will be created. Files are saved in the common archive
141 directory, and a symbolic link is created in the experiment archive.
145 @IndexSubentry{Options, @code{-F}}
148 Force writing, or rewriting of .archive files. All archived files will be
149 removed and recreated, except if the @samp{-n} or @samp{-m} option is used,
150 or if the experiment is a subexperiment.
154 @IndexSubentry{Options, @code{-m}}
157 Archive only those source, object, and debug info files whose full path name
158 matches the given POSIX compliant @var{regex} regular expression.
162 @IndexSubentry{Options, @code{-n}}
165 Archive the named experiment only, not any of its descendants.
169 @IndexSubentry{Options, @code{-q}}
172 Do not write any warnings to @file{stderr}. Warnings are incorporated into
173 the .archive file in the experiment directory. They are shown in the output
174 of the @command{gprofng display text} command.
178 @IndexSubentry{Options, @code{-r}}
181 This option specifies the location of a common archive. The value is the
182 relative path to a common archive, which is a directory that contains
184 If the directory does not exist, then it will be created. Files are saved
185 in the common archive directory, and a symbolic link is created in the
188 @item -s @var{selection}
190 @IndexSubentry{Options, @code{-s}}
193 Specify archiving of source files. The allowed values for @var{selection} are:
199 Do not archive any source files.
203 Archive all source and object files that can be found.
207 Archive source and object files for functions against which data was
208 recorded in the experiment, and that can be found.
211 By default, application source files are not archived into the experiment.
212 If the @samp{-s all}, or @samp{-s used} option is used, sources and object
214 These options also ensure that source files are available in the experiment,
215 even if the original source files have been modified, or are inaccessible
218 In case archive files cannot be found, use the @samp{addpath}, or
219 @samp{pathmap} command, or both, in an @file{.er.rc} file to specify the
220 location of the missing file(s).
227 @c ----------------------------------------------------------------------------
229 @c ----------------------------------------------------------------------------
236 @c ----------------------------------------------------------------------------
238 Archiving of application binaries -
239 By default, binaries are archived automatically when an experiment is
240 created. However, archiving does not occur in one or more of the
241 following circumstances:
246 If the profiled application is terminated before it exits normally.
249 If a running process is profiled.
252 If archiving is explicitly disabled when profiling. For example by using
253 the @samp{-a off} option on @command{gprofng collect app}.
257 In these cases, @command{gprofng archive} must be run manually and on the same
258 machine where the profiling data was recorded.
260 Archiving of experiment data during the data collection process can be quite
261 expensive. Especially if the experiment has many descendant processes.
263 @IndexSubentry{Options, @code{-a}}
265 In such cases, a more efficient strategy is to use the @samp{-a off} option
266 when collecting the data. Once the collection has completed, the data can be
268 @IndexSubentry{Options, @code{-s}}
270 archived using the @samp{-s all} option. This saves all executables and
271 source files in the experiment.
273 If during the archiving there is an error message that an executable, or
275 @IndexSubentry{Commands, @code{addpath}}
277 source file cannot be found, the @samp{addpath} command to add the path
278 to the missing file(s) can be included in the @file{.er.rc} file.
279 After this command has been added, archive the experiment again. The
280 archiving archiving can be repeated as many times as necessary to archive all
283 Archiving should be done on the same system as was used to collect the
284 experiment. If some files cannot be accessed from this system (e.g. sources
285 or object files), then additional archiving can be done using another system
286 that can access them. For example, the system where the application was built.
288 Some Java applications store shared objects in jar files. By default, such
289 shared objects are not automatically archived. To archive shared objects
290 contained in jar files, make sure to include the @samp{addpath} command in
291 an @file{.er.rc} file.
292 The @samp{addpath} command should give the path to the jar file, including
293 the jar file itself. The @file{.er.rc} file should be saved in the user home
294 directory, or experiment parent directory.
297 Archiving of application sources -
298 By default, application source files are not archived in the experiment.
299 Execute the @command{gprofng archive} command with the @samp{-s all}, or
300 @samp{-s used} option on each experiment to store source files in the
304 Automatic archiving of application sources -
305 Environment variable @samp{GPROFNG_ARCHIVE} may be set to automatically
306 archive sources when the experiment has completed. This environment
307 variable can contain @samp{-s} and @samp{-m} arguments, as pairs of
308 argument and options, separated by one or more blanks.
310 @IndexSubentry{Environment variables, @code{GPROFNG_ARCHIVE}}
311 @IndexSubentry{Options, @code{-a}}
312 @IndexSubentry{Options, @code{-m}}
313 @IndexSubentry{Options, @code{-s}}
316 If more than one @samp{-s} argument appears on the command line, the
317 last one prevails. If @samp{-s} is both passed on the command line, and
318 set by the environment variable, the option from the environment variable
321 Note that in case automatic source archiving during data collection has
322 been enabled using either the @samp{GPROFNG_ARCHIVE} variable, or the
323 @samp{-a src}, or @samp{-a usedsrc} option, it is recommended to confirm that
324 source files have been correctly resolved by executing the
325 @command{gprofng archive -s all}, or @command{gprofng archive -s used}
329 The @samp{-d} and @samp{-r} options are mutually exclusive.
331 @IndexSubentry{Options, @code{-d}}
332 @IndexSubentry{Options, @code{-r}}
336 When using the @samp{-d} or @samp{-r} option, environment variable
338 @IndexSubentry{Options, @code{-d}}
339 @IndexSubentry{Options, @code{-r}}
340 @IndexSubentry{Environment variables, @code{GPROFNG_ARCHIVE_COMMON_DIR}}
342 @samp{GPROFNG_ARCHIVE_COMMON_DIR} can be used to specify the location of
343 the common archive. This can be very convenient when using a script to
344 profile applications.
347 If more than one @samp{-s} option is given on the command line, or
348 specified in the environment variable, the specified option for all must
349 be the same. If not, @command{gprofng archive} exits with an error.
352 This tool does not work on experiments recorded with earlier versions of
353 the tools. If invoked on such experiments, a warning is printed. Use the
354 version of @command{gprofng archive} from the same release with which the
355 experiment was recorded.
362 @c ----------------------------------------------------------------------------
364 @c ----------------------------------------------------------------------------
366 @ManPageStart{SEE ALSO}
380 The user guide for gprofng is maintained as a Texinfo manual. If the info
381 and gprofng programs are correctly installed, the command
382 @command{info gprofng} should give access to this document.
387 @c ----------------------------------------------------------------------------
389 @c ----------------------------------------------------------------------------
391 @ManPageStart{COPYRIGHT}
392 @c man begin COPYRIGHT
394 Copyright @copyright{} 2022-2024 Free Software Foundation, Inc.
396 Permission is granted to copy, distribute and/or modify this document
397 under the terms of the GNU Free Documentation License, Version 1.3
398 or any later version published by the Free Software Foundation;
399 with no Invariant Sections, with no Front-Cover Texts, and with no
400 Back-Cover Texts. A copy of the license is included in the
401 section entitled ``GNU Free Documentation License''.
406 @c ----------------------------------------------------------------------------
407 @c If this text is used for a man page, exit. Otherwise we need to continue.
408 @c ----------------------------------------------------------------------------