Re: [PATCH] Add CTF support to GDB [4/4] doc

Hui Zhu
2013-01-14T12:26:13Z

[-- Attachment #1: Type: text/plain, Size: 933 bytes --]

Hi Eli,

To make the "target ctf" more clear. I add a small example for it in the doc.
Please help me review it.

Thanks,
Hui

2013-01-14 Hui Zhu <hui_zhu@mentor.com>

* gdb.texinfo (Trace Files): Add "tsave -ctf" and target ctf.

On Thu, Nov 29, 2012 at 1:39 AM, Eli Zaretskii <eliz@gnu.org> wrote:
>> From: Hui Zhu <teawater@gmail.com>
>> Date: Wed, 28 Nov 2012 13:51:15 +0800
>> Cc: Hui Zhu <hui_zhu@mentor.com>, Eli Zaretskii <eliz@gnu.org>, gdb-patches@sourceware.org
>>
>> I think that is better. Post a new version according to your comments.
>>
>> Thanks,
>> Hui
>>
>> News:
>> * GDB now has the ability to read and write trace buffer in common trace
>> format (CTF). To create a CTF trace file, use "tsave -ctf <filename>",
>> and to use it, type "target ctf <name>".
>>
>> 2012-11-28 Hui Zhu <hui_zhu@mentor.com>
>>
>> * gdb.texinfo (Trace Files): Add "tsave -ctf" and target ctf.
>
> This is OK, thanks.

[-- Attachment #2: ctf-doc.txt --]
[-- Type: text/plain, Size: 2453 bytes --]

--- a/doc/gdb.texinfo
+++ b/doc/gdb.texinfo
@@ -12069,6 +12069,7 @@ of trace data, via the @code{target tfil

@kindex tsave
@item tsave [ -r ] @var{filename}
+@itemx tsave [-ctf] @var{dirname}
Save the trace data to @var{filename}. By default, this command
assumes that @var{filename} refers to the host filesystem, so if
necessary @value{GDBN} will copy raw trace data up from the target and
@@ -12077,16 +12078,45 @@ optional argument @code{-r} (``remote'')
the data directly into @var{filename} in its own filesystem, which may be
more efficient if the trace buffer is very large. (Note, however, that
@code{target tfile} can only read from files accessible to the host.)
+By default, this command will save trace frame into tfile format.
+You can supply the optional argument @code{-ctf} to save date in CTF
+format. The @dfn{Common Trace Format} (CTF) is proposed as a trace format
+that suits the needs of the embedded, telecom, high-performance
+and kernel communities. Please goto @indicateurl{http://www.efficios.com/ctf}
+to get more information.

@kindex target tfile
@kindex tfile
@item target tfile @var{filename}
-Use the file named @var{filename} as a source of trace data. Commands
-that examine data work as they do with a live target, but it is not
-possible to run any new trace experiments. @code{tstatus} will report
-the state of the trace run at the moment the data was saved, as well
-as the current trace frame you are examining. @var{filename} must be
-on a filesystem accessible to the host.
+@kindex target ctf
+@kindex ctf
+@itemx target ctf @var{dirname}
+Use the file named @var{filename} or directory named @var{dirname} as
+a source of trace data. Commands that examine data work as they do with
+a live target, but it is not possible to run any new trace experiments.
+@code{tstatus} will report the state of the trace run at the moment
+the data was saved, as well as the current trace frame you are examining.
+@var{filename} or @var{dirname} must be on a filesystem accessible to
+the host.
+
+@smallexample
+(@value{GDBP}) target ctf ctf.ctf
+(@value{GDBP}) tfind
+warning: $d is not support.
+warning: $c is not support.
+warning: $d is not support.
+warning: $c is not support.
+Found trace frame 0, tracepoint 2
+../../../gdb/gdb/testsuite/gdb.trace/ctf.c:24
+(@value{GDBP}) tdump
+$d = void
+$c = void
+$b = 1
+$a = 0
+$i = 0
+(@value{GDBP}) p $b
+$1 = 1
+@end smallexample

@end table