xref: /netbsd-src/external/gpl3/binutils/dist/gprofng/doc/gp-archive.texi (revision cb63e24e8d6aae7ddac1859a9015f48b1d8bd90e)
1*cb63e24eSchristos@c ----------------------------------------------------------------------------
2*cb63e24eSchristos@c This is the Texinfo source file for the gp-archive man page.
3*cb63e24eSchristos@c
4*cb63e24eSchristos@c Author: Ruud van der Pas
5*cb63e24eSchristos@c ----------------------------------------------------------------------------
6*cb63e24eSchristos@ifset man
7*cb63e24eSchristos\input texinfo @c -*-texinfo-*-
8*cb63e24eSchristos@setfilename gp-archive
9*cb63e24eSchristos@settitle Archive gprofng experiment data
10*cb63e24eSchristos@include gp-macros.texi
11*cb63e24eSchristos@end ifset
12*cb63e24eSchristos
13*cb63e24eSchristos@c ----------------------------------------------------------------------------
14*cb63e24eSchristos@c This is from the man-pages(7) man page
15*cb63e24eSchristos@c
16*cb63e24eSchristos@c "The list below shows conventional or suggested sections.  Most manual pages
17*cb63e24eSchristos@c  should include at least the highlighted sections.  Arrange a new manual
18*cb63e24eSchristos@c  page so that sections are placed in the order shown in the list."
19*cb63e24eSchristos@c
20*cb63e24eSchristos@c              NAME
21*cb63e24eSchristos@c              SYNOPSIS
22*cb63e24eSchristos@c              CONFIGURATION    [Normally only in Section 4]
23*cb63e24eSchristos@c              DESCRIPTION
24*cb63e24eSchristos@c              OPTIONS          [Normally only in Sections 1, 8]
25*cb63e24eSchristos@c              EXIT STATUS      [Normally only in Sections 1, 8]
26*cb63e24eSchristos@c              RETURN VALUE     [Normally only in Sections 2, 3]
27*cb63e24eSchristos@c              ERRORS           [Typically only in Sections 2, 3]
28*cb63e24eSchristos@c              ENVIRONMENT
29*cb63e24eSchristos@c              FILES
30*cb63e24eSchristos@c              VERSIONS         [Normally only in Sections 2, 3]
31*cb63e24eSchristos@c              ATTRIBUTES       [Normally only in Sections 2, 3]
32*cb63e24eSchristos@c              CONFORMING TO
33*cb63e24eSchristos@c              NOTES
34*cb63e24eSchristos@c              BUGS
35*cb63e24eSchristos@c              EXAMPLES
36*cb63e24eSchristos@c              AUTHORS          [Discouraged]
37*cb63e24eSchristos@c              REPORTING BUGS   [Not used in man-pages]
38*cb63e24eSchristos@c              COPYRIGHT        [Not used in man-pages]
39*cb63e24eSchristos@c              SEE ALSO
40*cb63e24eSchristos@c
41*cb63e24eSchristos@c This is what the texi2pod.pl tool recognizes:
42*cb63e24eSchristos@c
43*cb63e24eSchristos@c for $sect (qw(NAME SYNOPSIS TARGET DESCRIPTION OPTIONS ENVIRONMENT FILES
44*cb63e24eSchristos@c               BUGS NOTES FOOTNOTES SEEALSO AUTHOR COPYRIGHT)) {
45*cb63e24eSchristos@c
46*cb63e24eSchristos@c What is interesting is that it places "SEE ALSO" before "COPYRIGHT", which
47*cb63e24eSchristos@c makes sense and adhered to for the other formats.
48*cb63e24eSchristos@c ----------------------------------------------------------------------------
49*cb63e24eSchristos
50*cb63e24eSchristos@c ----------------------------------------------------------------------------
51*cb63e24eSchristos@c NAME section
52*cb63e24eSchristos@c ----------------------------------------------------------------------------
53*cb63e24eSchristos
54*cb63e24eSchristos@ManPageStart{NAME}
55*cb63e24eSchristos@c man begin NAME
56*cb63e24eSchristos
57*cb63e24eSchristosgp-archive - Archive the associated application binaries and sources for a
58*cb63e24eSchristosgprofng experiment
59*cb63e24eSchristos
60*cb63e24eSchristos@c man end
61*cb63e24eSchristos@ManPageEnd{}
62*cb63e24eSchristos
63*cb63e24eSchristos@c ----------------------------------------------------------------------------
64*cb63e24eSchristos@c SYNOPSIS section
65*cb63e24eSchristos@c ----------------------------------------------------------------------------
66*cb63e24eSchristos
67*cb63e24eSchristos@ManPageStart{SYNOPSIS}
68*cb63e24eSchristos@c man begin SYNOPSIS
69*cb63e24eSchristos
70*cb63e24eSchristos@command{gprofng archive} [@var{option(s)}] @var{experiment}
71*cb63e24eSchristos
72*cb63e24eSchristos@c man end
73*cb63e24eSchristos@ManPageEnd{}
74*cb63e24eSchristos
75*cb63e24eSchristos@c ----------------------------------------------------------------------------
76*cb63e24eSchristos@c DESCRIPTION section
77*cb63e24eSchristos@c ----------------------------------------------------------------------------
78*cb63e24eSchristos
79*cb63e24eSchristos@ManPageStart{DESCRIPTION}
80*cb63e24eSchristos@c man begin DESCRIPTION
81*cb63e24eSchristos
82*cb63e24eSchristosArchive the associated application binaries and source files in a gprofng
83*cb63e24eSchristosexperiment to make it self contained and portable.
84*cb63e24eSchristos
85*cb63e24eSchristosBy default, the binaries are archived as part of the data collection, but the
86*cb63e24eSchristosapplication source files are not archived.  Use this tool to change this and
87*cb63e24eSchristosafterwards archive additional components.
88*cb63e24eSchristos
89*cb63e24eSchristosThis tool has to be executed on the same system where the profiling data was
90*cb63e24eSchristosrecorded.
91*cb63e24eSchristos
92*cb63e24eSchristos@c man end
93*cb63e24eSchristos@ManPageEnd{}
94*cb63e24eSchristos
95*cb63e24eSchristos@c ----------------------------------------------------------------------------
96*cb63e24eSchristos@c OPTIONS section
97*cb63e24eSchristos@c ----------------------------------------------------------------------------
98*cb63e24eSchristos
99*cb63e24eSchristos@ManPageStart{OPTIONS}
100*cb63e24eSchristos@c man begin OPTIONS
101*cb63e24eSchristos
102*cb63e24eSchristos@table @gcctabopt
103*cb63e24eSchristos
104*cb63e24eSchristos@item --version
105*cb63e24eSchristos@ifclear man
106*cb63e24eSchristos@IndexSubentry{Options, @code{--version}}
107*cb63e24eSchristos@end ifclear
108*cb63e24eSchristos
109*cb63e24eSchristosPrint the version number and exit.
110*cb63e24eSchristos
111*cb63e24eSchristos@item --help
112*cb63e24eSchristos@ifclear man
113*cb63e24eSchristos@IndexSubentry{Options, @code{--help}}
114*cb63e24eSchristos@end ifclear
115*cb63e24eSchristos
116*cb63e24eSchristosPrint usage information and exit.
117*cb63e24eSchristos
118*cb63e24eSchristos@item -a @{off | on | ldobjects | src | usedldobjects | used[src]@}
119*cb63e24eSchristos@ifclear man
120*cb63e24eSchristos@IndexSubentry{Options, @code{-a}}
121*cb63e24eSchristos@end ifclear
122*cb63e24eSchristos
123*cb63e24eSchristosSpecify archiving of binaries and other files.  In addition to disable this
124*cb63e24eSchristosfeature (@samp{off}), or enable archiving of all loadobjects and sources
125*cb63e24eSchristos(@samp{on}), the other choices support a more refined selection.
126*cb63e24eSchristos
127*cb63e24eSchristosAll of these choices enable archiving, but the keyword controls what exactly
128*cb63e24eSchristosis selected: all load objects (@samp{ldobjects}), all source files
129*cb63e24eSchristos(@samp{src}), the loadobjects associated with a program counter
130*cb63e24eSchristos(@samp{usedldobjects}), or the source files associated with a program counter
131*cb63e24eSchristos(@samp{used[src]}).  The default is @samp{-a ldobjects}.
132*cb63e24eSchristos
133*cb63e24eSchristos@item -d @var{path}
134*cb63e24eSchristos@ifclear man
135*cb63e24eSchristos@IndexSubentry{Options, @code{-d}}
136*cb63e24eSchristos@end ifclear
137*cb63e24eSchristos
138*cb63e24eSchristosThe @var{path} is the absolute path to a common archive, which is a
139*cb63e24eSchristosdirectory that contains archived files.  If the directory does not
140*cb63e24eSchristosexist, then it will be created.  Files are saved in the common archive
141*cb63e24eSchristosdirectory, and a symbolic link is created in the experiment archive.
142*cb63e24eSchristos
143*cb63e24eSchristos@item -F
144*cb63e24eSchristos@ifclear man
145*cb63e24eSchristos@IndexSubentry{Options, @code{-F}}
146*cb63e24eSchristos@end ifclear
147*cb63e24eSchristos
148*cb63e24eSchristosForce writing, or rewriting of .archive files.  All archived files will be
149*cb63e24eSchristosremoved and recreated, except if the @samp{-n} or @samp{-m} option is used,
150*cb63e24eSchristosor if the experiment is a subexperiment.
151*cb63e24eSchristos
152*cb63e24eSchristos@item -m @var{regex}
153*cb63e24eSchristos@ifclear man
154*cb63e24eSchristos@IndexSubentry{Options, @code{-m}}
155*cb63e24eSchristos@end ifclear
156*cb63e24eSchristos
157*cb63e24eSchristosArchive only those source, object, and debug info files whose full path name
158*cb63e24eSchristosmatches the given POSIX compliant @var{regex} regular expression.
159*cb63e24eSchristos
160*cb63e24eSchristos@item -n
161*cb63e24eSchristos@ifclear man
162*cb63e24eSchristos@IndexSubentry{Options, @code{-n}}
163*cb63e24eSchristos@end ifclear
164*cb63e24eSchristos
165*cb63e24eSchristosArchive the named experiment only, not any of its descendants.
166*cb63e24eSchristos
167*cb63e24eSchristos@item -q
168*cb63e24eSchristos@ifclear man
169*cb63e24eSchristos@IndexSubentry{Options, @code{-q}}
170*cb63e24eSchristos@end ifclear
171*cb63e24eSchristos
172*cb63e24eSchristosDo not write any warnings to @file{stderr}.  Warnings are incorporated into
173*cb63e24eSchristosthe .archive file in the experiment directory.  They are shown in the output
174*cb63e24eSchristosof the @command{gprofng display text} command.
175*cb63e24eSchristos
176*cb63e24eSchristos@item -r @var{path}
177*cb63e24eSchristos@ifclear man
178*cb63e24eSchristos@IndexSubentry{Options, @code{-r}}
179*cb63e24eSchristos@end ifclear
180*cb63e24eSchristos
181*cb63e24eSchristosThis option specifies the location of a common archive.  The value is the
182*cb63e24eSchristosrelative path to a common archive, which is a directory that contains
183*cb63e24eSchristosarchived files.
184*cb63e24eSchristosIf the directory does not exist, then it will be created.  Files are saved
185*cb63e24eSchristosin the common archive directory, and a symbolic link is created in the
186*cb63e24eSchristosexperiment archive.
187*cb63e24eSchristos
188*cb63e24eSchristos@item -s @var{selection}
189*cb63e24eSchristos@ifclear man
190*cb63e24eSchristos@IndexSubentry{Options, @code{-s}}
191*cb63e24eSchristos@end ifclear
192*cb63e24eSchristos
193*cb63e24eSchristosSpecify archiving of source files.  The allowed values for @var{selection} are:
194*cb63e24eSchristos
195*cb63e24eSchristos@table @gcctabopt
196*cb63e24eSchristos
197*cb63e24eSchristos@item no
198*cb63e24eSchristos
199*cb63e24eSchristosDo not archive any source files.
200*cb63e24eSchristos
201*cb63e24eSchristos@item all
202*cb63e24eSchristos
203*cb63e24eSchristosArchive all source and object files that can be found.
204*cb63e24eSchristos
205*cb63e24eSchristos@item used[src]
206*cb63e24eSchristos
207*cb63e24eSchristosArchive source and object files for functions against which data was
208*cb63e24eSchristosrecorded in the experiment, and that can be found.
209*cb63e24eSchristos@end table
210*cb63e24eSchristos
211*cb63e24eSchristosBy default, application source files are not archived into the experiment.
212*cb63e24eSchristosIf the @samp{-s all}, or @samp{-s used} option is used, sources and object
213*cb63e24eSchristosfiles are archived.
214*cb63e24eSchristosThese options also ensure that source files are available in the experiment,
215*cb63e24eSchristoseven if the original source files have been modified, or are inaccessible
216*cb63e24eSchristosafterwards.
217*cb63e24eSchristos
218*cb63e24eSchristosIn case archive files cannot be found, use the @samp{addpath}, or
219*cb63e24eSchristos@samp{pathmap} command, or both, in an @file{.er.rc} file to specify the
220*cb63e24eSchristoslocation of the missing file(s).
221*cb63e24eSchristos
222*cb63e24eSchristos@end table
223*cb63e24eSchristos
224*cb63e24eSchristos@c man end
225*cb63e24eSchristos@ManPageEnd{}
226*cb63e24eSchristos
227*cb63e24eSchristos@c ----------------------------------------------------------------------------
228*cb63e24eSchristos@c NOTES section
229*cb63e24eSchristos@c ----------------------------------------------------------------------------
230*cb63e24eSchristos
231*cb63e24eSchristos@ManPageStart{NOTES}
232*cb63e24eSchristos@c man begin NOTES
233*cb63e24eSchristos
234*cb63e24eSchristos@itemize @minus
235*cb63e24eSchristos
236*cb63e24eSchristos@c ----------------------------------------------------------------------------
237*cb63e24eSchristos@item
238*cb63e24eSchristosArchiving of application binaries -
239*cb63e24eSchristosBy default, binaries are archived automatically when an experiment is
240*cb63e24eSchristoscreated.  However, archiving does not occur in one or more of the
241*cb63e24eSchristosfollowing circumstances:
242*cb63e24eSchristos
243*cb63e24eSchristos@itemize @bullet
244*cb63e24eSchristos
245*cb63e24eSchristos@item
246*cb63e24eSchristosIf the profiled application is terminated before it exits normally.
247*cb63e24eSchristos
248*cb63e24eSchristos@item
249*cb63e24eSchristosIf a running process is profiled.
250*cb63e24eSchristos
251*cb63e24eSchristos@item
252*cb63e24eSchristosIf archiving is explicitly disabled when profiling.  For example by using
253*cb63e24eSchristosthe @samp{-a off} option on @command{gprofng collect app}.
254*cb63e24eSchristos
255*cb63e24eSchristos@end itemize
256*cb63e24eSchristos
257*cb63e24eSchristosIn these cases, @command{gprofng archive} must be run manually and on the same
258*cb63e24eSchristosmachine where the profiling data was recorded.
259*cb63e24eSchristos
260*cb63e24eSchristosArchiving of experiment data during the data collection process can be quite
261*cb63e24eSchristosexpensive.  Especially if the experiment has many descendant processes.
262*cb63e24eSchristos@ifclear man
263*cb63e24eSchristos@IndexSubentry{Options, @code{-a}}
264*cb63e24eSchristos@end ifclear
265*cb63e24eSchristosIn such cases, a more efficient strategy is to use the @samp{-a off} option
266*cb63e24eSchristoswhen collecting the data.  Once the collection has completed, the data can be
267*cb63e24eSchristos@ifclear man
268*cb63e24eSchristos@IndexSubentry{Options, @code{-s}}
269*cb63e24eSchristos@end ifclear
270*cb63e24eSchristosarchived using the @samp{-s all} option.  This saves all executables and
271*cb63e24eSchristossource files in the experiment.
272*cb63e24eSchristos
273*cb63e24eSchristosIf during the archiving there is an error message that an executable, or
274*cb63e24eSchristos@ifclear man
275*cb63e24eSchristos@IndexSubentry{Commands, @code{addpath}}
276*cb63e24eSchristos@end ifclear
277*cb63e24eSchristossource file cannot be found, the @samp{addpath} command to add the path
278*cb63e24eSchristosto the missing file(s) can be included in the @file{.er.rc} file.
279*cb63e24eSchristosAfter this command has been added, archive the experiment again.  The
280*cb63e24eSchristosarchiving archiving can be repeated as many times as necessary to archive all
281*cb63e24eSchristosfiles.
282*cb63e24eSchristos
283*cb63e24eSchristosArchiving should be done on the same system as was used to collect the
284*cb63e24eSchristosexperiment.  If some files cannot be accessed from this system (e.g.  sources
285*cb63e24eSchristosor object files), then additional archiving can be done using another system
286*cb63e24eSchristosthat can access them.  For example, the system where the application was built.
287*cb63e24eSchristos
288*cb63e24eSchristosSome Java applications store shared objects in jar files.  By default, such
289*cb63e24eSchristosshared objects are not automatically archived.  To archive shared objects
290*cb63e24eSchristoscontained in jar files, make sure to include the @samp{addpath} command in
291*cb63e24eSchristosan @file{.er.rc} file.
292*cb63e24eSchristosThe @samp{addpath} command should give the path to the jar file, including
293*cb63e24eSchristosthe jar file itself.  The @file{.er.rc} file should be saved in the user home
294*cb63e24eSchristosdirectory, or experiment parent directory.
295*cb63e24eSchristos
296*cb63e24eSchristos@item
297*cb63e24eSchristosArchiving of application sources -
298*cb63e24eSchristosBy default, application source files are not archived in the experiment.
299*cb63e24eSchristosExecute the @command{gprofng archive} command with the @samp{-s all}, or
300*cb63e24eSchristos@samp{-s used} option on each experiment to store source files in the
301*cb63e24eSchristosexperiment.
302*cb63e24eSchristos
303*cb63e24eSchristos@item
304*cb63e24eSchristosAutomatic archiving of application sources -
305*cb63e24eSchristosEnvironment variable @samp{GPROFNG_ARCHIVE} may be set to automatically
306*cb63e24eSchristosarchive sources when the experiment has completed.  This environment
307*cb63e24eSchristosvariable can contain @samp{-s} and @samp{-m} arguments, as pairs of
308*cb63e24eSchristosargument and options, separated by one or more blanks.
309*cb63e24eSchristos@ifclear man
310*cb63e24eSchristos@IndexSubentry{Environment variables, @code{GPROFNG_ARCHIVE}}
311*cb63e24eSchristos@IndexSubentry{Options, @code{-a}}
312*cb63e24eSchristos@IndexSubentry{Options, @code{-m}}
313*cb63e24eSchristos@IndexSubentry{Options, @code{-s}}
314*cb63e24eSchristos@end ifclear
315*cb63e24eSchristos
316*cb63e24eSchristosIf more than one @samp{-s} argument appears on the command line, the
317*cb63e24eSchristoslast one prevails.  If @samp{-s} is both passed on the command line, and
318*cb63e24eSchristosset by the environment variable, the option from the environment variable
319*cb63e24eSchristosprevails.
320*cb63e24eSchristos
321*cb63e24eSchristosNote that in case automatic source archiving during data collection has
322*cb63e24eSchristosbeen enabled using either the @samp{GPROFNG_ARCHIVE} variable, or the
323*cb63e24eSchristos@samp{-a src}, or @samp{-a usedsrc} option, it is recommended to confirm that
324*cb63e24eSchristossource files have been correctly resolved by executing the
325*cb63e24eSchristos@command{gprofng archive -s all}, or @command{gprofng archive -s used}
326*cb63e24eSchristoscommand.
327*cb63e24eSchristos
328*cb63e24eSchristos@item
329*cb63e24eSchristosThe @samp{-d} and @samp{-r} options are mutually exclusive.
330*cb63e24eSchristos@ifclear man
331*cb63e24eSchristos@IndexSubentry{Options, @code{-d}}
332*cb63e24eSchristos@IndexSubentry{Options, @code{-r}}
333*cb63e24eSchristos@end ifclear
334*cb63e24eSchristos
335*cb63e24eSchristos@item
336*cb63e24eSchristosWhen using the @samp{-d} or @samp{-r} option, environment variable
337*cb63e24eSchristos@ifclear man
338*cb63e24eSchristos@IndexSubentry{Options, @code{-d}}
339*cb63e24eSchristos@IndexSubentry{Options, @code{-r}}
340*cb63e24eSchristos@IndexSubentry{Environment variables, @code{GPROFNG_ARCHIVE_COMMON_DIR}}
341*cb63e24eSchristos@end ifclear
342*cb63e24eSchristos@samp{GPROFNG_ARCHIVE_COMMON_DIR} can be used to specify the location of
343*cb63e24eSchristosthe common archive.  This can be very convenient when using a script to
344*cb63e24eSchristosprofile applications.
345*cb63e24eSchristos
346*cb63e24eSchristos@item
347*cb63e24eSchristosIf more than one @samp{-s} option is given on the command line, or
348*cb63e24eSchristosspecified in the environment variable, the specified option for all must
349*cb63e24eSchristosbe the same.  If not, @command{gprofng archive} exits with an error.
350*cb63e24eSchristos
351*cb63e24eSchristos@item
352*cb63e24eSchristosThis tool does not work on experiments recorded with earlier versions of
353*cb63e24eSchristosthe tools.  If invoked on such experiments, a warning is printed.  Use the
354*cb63e24eSchristosversion of @command{gprofng archive} from the same release with which the
355*cb63e24eSchristosexperiment was recorded.
356*cb63e24eSchristos
357*cb63e24eSchristos@end itemize
358*cb63e24eSchristos
359*cb63e24eSchristos@c man end
360*cb63e24eSchristos@ManPageEnd{}
361*cb63e24eSchristos
362*cb63e24eSchristos@c ----------------------------------------------------------------------------
363*cb63e24eSchristos@c SEEALSO section
364*cb63e24eSchristos@c ----------------------------------------------------------------------------
365*cb63e24eSchristos
366*cb63e24eSchristos@ManPageStart{SEE ALSO}
367*cb63e24eSchristos@c man begin SEEALSO
368*cb63e24eSchristos
369*cb63e24eSchristosgprofng(1),
370*cb63e24eSchristosgp-collect-app(1),
371*cb63e24eSchristosgp-display-gui(1),
372*cb63e24eSchristosgp-display-html(1),
373*cb63e24eSchristosgp-display-src(1),
374*cb63e24eSchristosgp-display-text(1)
375*cb63e24eSchristos
376*cb63e24eSchristos@iftex
377*cb63e24eSchristos@vspace{1}
378*cb63e24eSchristos@end iftex
379*cb63e24eSchristos
380*cb63e24eSchristosThe user guide for gprofng is maintained as a Texinfo manual.  If the info
381*cb63e24eSchristosand gprofng programs are correctly installed, the command
382*cb63e24eSchristos@command{info gprofng} should give access to this document.
383*cb63e24eSchristos
384*cb63e24eSchristos@c man end
385*cb63e24eSchristos@ManPageEnd{}
386*cb63e24eSchristos
387*cb63e24eSchristos@c ----------------------------------------------------------------------------
388*cb63e24eSchristos@c COPYRIGHT section
389*cb63e24eSchristos@c ----------------------------------------------------------------------------
390*cb63e24eSchristos
391*cb63e24eSchristos@ManPageStart{COPYRIGHT}
392*cb63e24eSchristos@c man begin COPYRIGHT
393*cb63e24eSchristos
394*cb63e24eSchristosCopyright @copyright{} 2022-2024 Free Software Foundation, Inc.
395*cb63e24eSchristos
396*cb63e24eSchristosPermission is granted to copy, distribute and/or modify this document
397*cb63e24eSchristosunder the terms of the GNU Free Documentation License, Version 1.3
398*cb63e24eSchristosor any later version published by the Free Software Foundation;
399*cb63e24eSchristoswith no Invariant Sections, with no Front-Cover Texts, and with no
400*cb63e24eSchristosBack-Cover Texts.  A copy of the license is included in the
401*cb63e24eSchristossection entitled ``GNU Free Documentation License''.
402*cb63e24eSchristos
403*cb63e24eSchristos@c man end
404*cb63e24eSchristos@ManPageEnd{}
405*cb63e24eSchristos
406*cb63e24eSchristos@c ----------------------------------------------------------------------------
407*cb63e24eSchristos@c If this text is used for a man page, exit.  Otherwise we need to continue.
408*cb63e24eSchristos@c ----------------------------------------------------------------------------
409*cb63e24eSchristos
410*cb63e24eSchristos@ifset man
411*cb63e24eSchristos@bye
412*cb63e24eSchristos@end ifset
413