1TRACE-CMD-RESTORE(1)           libtracefs Manual          TRACE-CMD-RESTORE(1)
2
3
4

NAME

6       trace-cmd-restore - restore a failed trace record
7

SYNOPSIS

9       trace-cmd restore [OPTIONS] [command] cpu-file [cpu-file ...]
10

DESCRIPTION

12       The trace-cmd(1) restore command will restore a crashed
13       trace-cmd-record(1) file. If for some reason a trace-cmd record fails,
14       it will leave a the per-cpu data files and not create the final
15       trace.dat file. The trace-cmd restore will append the files to create a
16       working trace.dat file that can be read with trace-cmd-report(1).
17
18       When trace-cmd record runs, it spawns off a process per CPU and writes
19       to a per cpu file usually called trace.dat.cpuX, where X represents the
20       CPU number that it is tracing. If the -o option was used in the
21       trace-cmd record, then the CPU data files will have that name instead
22       of the trace.dat name. If a unexpected crash occurs before the tracing
23       is finished, then the per CPU files will still exist but there will not
24       be any trace.dat file to read from. trace-cmd restore will allow you to
25       create a trace.dat file with the existing data files.
26

OPTIONS

28       -c
29           Create a partial trace.dat file from the machine, to be used with a
30           full trace-cmd restore at another time. This option is useful for
31           embedded devices. If a server contains the cpu files of a crashed
32           trace-cmd record (or trace-cmd listen), trace-cmd restore can be
33           executed on the embedded device with the -c option to get all the
34           stored information of that embedded device. Then the file created
35           could be copied to the server to run the trace-cmd restore there
36           with the cpu files.
37
38               If *-o* is not specified, then the file created will be called
39               'trace-partial.dat'. This is because the file is not a full version
40               of something that trace-cmd-report(1) could use.
41
42       -t tracing_dir
43           Used with -c, it overrides the location to read the events from. By
44           default, tracing information is read from the debugfs/tracing
45           directory.  -t will use that location instead. This can be useful
46           if the trace.dat file to create is from another machine. Just tar
47           -cvf events.tar debugfs/tracing and copy and untar that file
48           locally, and use that directory instead.
49
50       -k kallsyms
51           Used with -c, it overrides where to read the kallsyms file from. By
52           default, /proc/kallsyms is used.  -k will override the file to read
53           the kallsyms from. This can be useful if the trace.dat file to
54           create is from another machine. Just copy the /proc/kallsyms file
55           locally, and use -k to point to that file.
56
57       -o output'
58           By default, trace-cmd restore will create a trace.dat file (or
59           trace-partial.dat if -c is specified). You can specify a different
60           file to write to with the -o option.
61
62       -i input
63           By default, trace-cmd restore will read the information of the
64           current system to create the initial data stored in the trace.dat
65           file. If the crash was on another machine, then that machine should
66           have the trace-cmd restore run with the -c option to create the
67           trace.dat partial file. Then that file can be copied to the current
68           machine where trace-cmd restore will use -i to load that file
69           instead of reading from the current system.
70

EXAMPLES

72       If a crash happened on another box, you could run:
73
74           $ trace-cmd restore -c -o box-partial.dat
75
76       Then on the server that has the cpu files:
77
78           $ trace-cmd restore -i box-partial.dat trace.dat.cpu0 trace.dat.cpu1
79
80       This would create a trace.dat file for the embedded box.
81

SEE ALSO

83       trace-cmd(1), trace-cmd-record(1), trace-cmd-report(1),
84       trace-cmd-start(1), trace-cmd-stop(1), trace-cmd-extract(1),
85       trace-cmd-reset(1), trace-cmd-split(1), trace-cmd-list(1),
86       trace-cmd-listen(1)
87

AUTHOR

89       Written by Steven Rostedt, <rostedt@goodmis.org[1]>
90

RESOURCES

92       https://git.kernel.org/pub/scm/utils/trace-cmd/trace-cmd.git/
93

COPYING

95       Copyright (C) 2010 Red Hat, Inc. Free use of this software is granted
96       under the terms of the GNU Public License (GPL).
97

NOTES

99        1. rostedt@goodmis.org
100           mailto:rostedt@goodmis.org
101
102
103
104libtracefs                        10/11/2022              TRACE-CMD-RESTORE(1)
Impressum