'\" t .\" Title: trace-cmd-restore .\" Author: [see the "AUTHOR" section] .\" Generator: DocBook XSL Stylesheets vsnapshot .\" Date: 02/10/2024 .\" Manual: libtracefs Manual .\" Source: libtracefs .\" Language: English .\" .TH "TRACE\-CMD\-RESTORE" "1" "02/10/2024" "libtracefs" "libtracefs Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" trace-cmd-restore \- restore a failed trace record .SH "SYNOPSIS" .sp \fBtrace\-cmd restore\fR [\fIOPTIONS\fR] [\fIcommand\fR] cpu\-file [cpu\-file \&...] .SH "DESCRIPTION" .sp The trace\-cmd(1) restore command will restore a crashed trace\-cmd\-record(1) file\&. If for some reason a trace\-cmd record fails, it will leave a the per\-cpu data files and not create the final trace\&.dat file\&. The trace\-cmd restore will append the files to create a working trace\&.dat file that can be read with trace\-cmd\-report(1)\&. .sp When trace\-cmd record runs, it spawns off a process per CPU and writes to a per cpu file usually called \fItrace\&.dat\&.cpuX\fR, where X represents the CPU number that it is tracing\&. If the \-o option was used in the trace\-cmd record, then the CPU data files will have that name instead of the \fItrace\&.dat\fR name\&. If a unexpected crash occurs before the tracing is finished, then the per CPU files will still exist but there will not be any trace\&.dat file to read from\&. trace\-cmd restore will allow you to create a trace\&.dat file with the existing data files\&. .SH "OPTIONS" .PP \fB\-c\fR .RS 4 Create a partial trace\&.dat file from the machine, to be used with a full trace\-cmd restore at another time\&. This option is useful for embedded devices\&. If a server contains the cpu files of a crashed trace\-cmd record (or trace\-cmd listen), trace\-cmd restore can be executed on the embedded device with the \-c option to get all the stored information of that embedded device\&. Then the file created could be copied to the server to run the trace\-cmd restore there with the cpu files\&. .sp .if n \{\ .RS 4 .\} .nf If *\-o* is not specified, then the file created will be called \*(Aqtrace\-partial\&.dat\*(Aq\&. This is because the file is not a full version of something that trace\-cmd\-report(1) could use\&. .fi .if n \{\ .RE .\} .RE .PP \fB\-t\fR tracing_dir .RS 4 Used with \fB\-c\fR, it overrides the location to read the events from\&. By default, tracing information is read from the debugfs/tracing directory\&. \fB\-t\fR will use that location instead\&. This can be useful if the trace\&.dat file to create is from another machine\&. Just tar \-cvf events\&.tar debugfs/tracing and copy and untar that file locally, and use that directory instead\&. .RE .PP \fB\-k\fR kallsyms .RS 4 Used with \fB\-c\fR, it overrides where to read the kallsyms file from\&. By default, /proc/kallsyms is used\&. \fB\-k\fR will override the file to read the kallsyms from\&. This can be useful if the trace\&.dat file to create is from another machine\&. Just copy the /proc/kallsyms file locally, and use \fB\-k\fR to point to that file\&. .RE .PP \fB\-o\fR output\*(Aq .RS 4 By default, trace\-cmd restore will create a \fItrace\&.dat\fR file (or \fItrace\-partial\&.dat\fR if \fB\-c\fR is specified)\&. You can specify a different file to write to with the \fB\-o\fR option\&. .RE .PP \fB\-i\fR input .RS 4 By default, trace\-cmd restore will read the information of the current system to create the initial data stored in the \fItrace\&.dat\fR file\&. If the crash was on another machine, then that machine should have the trace\-cmd restore run with the \fB\-c\fR option to create the trace\&.dat partial file\&. Then that file can be copied to the current machine where trace\-cmd restore will use \fB\-i\fR to load that file instead of reading from the current system\&. .RE .SH "EXAMPLES" .sp If a crash happened on another box, you could run: .sp .if n \{\ .RS 4 .\} .nf $ trace\-cmd restore \-c \-o box\-partial\&.dat .fi .if n \{\ .RE .\} .sp Then on the server that has the cpu files: .sp .if n \{\ .RS 4 .\} .nf $ trace\-cmd restore \-i box\-partial\&.dat trace\&.dat\&.cpu0 trace\&.dat\&.cpu1 .fi .if n \{\ .RE .\} .sp This would create a trace\&.dat file for the embedded box\&. .SH "SEE ALSO" .sp trace\-cmd(1), trace\-cmd\-record(1), trace\-cmd\-report(1), trace\-cmd\-start(1), trace\-cmd\-stop(1), trace\-cmd\-extract(1), trace\-cmd\-reset(1), trace\-cmd\-split(1), trace\-cmd\-list(1), trace\-cmd\-listen(1) .SH "AUTHOR" .sp Written by Steven Rostedt, <\m[blue]\fBrostedt@goodmis\&.org\fR\m[]\&\s-2\u[1]\d\s+2> .SH "RESOURCES" .sp \m[blue]\fBhttps://git\&.kernel\&.org/pub/scm/utils/trace\-cmd/trace\-cmd\&.git/\fR\m[] .SH "COPYING" .sp Copyright (C) 2010 Red Hat, Inc\&. Free use of this software is granted under the terms of the GNU Public License (GPL)\&. .SH "NOTES" .IP " 1." 4 rostedt@goodmis.org .RS 4 \%mailto:rostedt@goodmis.org .RE