docs: cleanup: Rephrase and correct typos
[barectf.git] / docs / modules / how-barectf-works / pages / index.adoc
CommitLineData
016a4d97
PP
1= How barectf works
2
3barectf generates a CTF metadata stream and C{nbsp}source files
4from a xref:yaml:index.adoc[**configuration**].
5
6A barectf configuration specifies a xref:yaml:trace-type-obj.adoc[trace
7type], xref:yaml:clk-type-obj.adoc[clock types],
8xref:yaml:dst-obj.adoc[data stream types], xref:yaml:ert-obj.adoc[event
9record types], and other options to generate the files.
10
5a496a3d
EB
11With the `barectf` https://pypi.org/project/barectf/[Python package],
12you build the barectf configuration programatically by assembling
13configuration objects. This documentation is _not_ about the Python
14package.
016a4d97
PP
15
16The xref:cli:index.adoc[`barectf` CLI tool] can read a
17xref:yaml:index.adoc[YAML configuration file] and generate files out of
18it.
19
20[[generated-files]]
21== Generated files
22
23barectf generates the following files from a configuration:
24
25[%autowidth.stretch, cols="d,a"]
26|===
27|File name |Description
28
29|[[metadata]]`metadata`
30|The CTF metadata stream file.
31
32You'll need to place this file in a directory with the
33xref:how-barectf-works:ctf-primer.adoc#ds[data stream] files which your
34application will write through the generated tracer.
35
36See xref:how-barectf-works:index.adoc[] to learn more.
37
38|[[barectf.h]]`barectf.h`
39|The generated tracer's public C{nbsp}header file.
40
41This header contains the prototypes of the packet opening, packet
42closing, and xref:tracing-funcs:index.adoc[tracing functions].
43
44barectf generates one packet opening/closing function per configured
45xref:yaml:dst-obj.adoc[data stream type] and one tracing function per
46configured xref:yaml:ert-obj.adoc[event record type].
47
48Your application and xref:platform:index.adoc[platforms] need to
49include this file.
50
51|`barectf-bitfield.h`
52|Internal macros for the generated tracer (included by `barectf.c`).
53
54|[[barectf.c]]`barectf.c`
55|The generated tracer's C{nbsp}source code.
56|===
57
58Those file names assume that the configuration uses the default
59xref:yaml:cfg-obj.adoc#prefix-prop[prefixes].
60
61All C{nbsp}files are written in ANSI{nbsp}C.
62
63[[ctf-data-stream-file-creation]]
64== CTF data stream file creation
65
66Your application calls the xref:tracing-funcs:index.adoc[tracing
67functions] found in <<barectf.h,`barectf.h`>> to write
68xref:ctf-primer.adoc#er[event records] to CTF
69xref:ctf-primer.adoc#ds[data streams] of
70xref:ctf-primer.adoc#pkt[packets]. Those CTF data streams and the
71generated <<metadata,CTF metadata stream>> form a complete
72xref:ctf-primer.adoc#trace[CTF trace].
73
fdacbf1f
EB
74The specifics of how the event timestamps are sampled and how the CTF
75packets are appended to some file (or memory buffer) is controlled by
76the xref:platform:index.adoc[**platform**].
016a4d97
PP
77
78== Data flow
79
80The typical data flow with barectf is:
81
82[.width-80]
83image::barectf-data-flow.svg[]
84
85. barectf reads your xref:yaml:index.adoc[YAML configuration file].
86
87. barectf <<generated-files,generates>> the CTF metadata stream file.
88
89. barectf also generates the tracer's C{nbsp}files.
90
5a496a3d
EB
91. After adding calls to the generated tracing functions in your
92application code, you pass your application's C{nbsp}source file(s),
016a4d97
PP
93 xref:platform:index.adoc[platform]
94 C{nbsp}source files, and the generated tracer's C{nbsp}source file to
95 a xref:build:index.adoc[C{nbsp}compiler to create your final
96 application].
97
98. Your application <<ctf-data-stream-file-creation,creates CTF data
99 stream files>> during its execution.
100+
101Those data stream files and the metadata stream file of step{nbsp}2 form
102a complete xref:ctf-primer.adoc#trace[CTF trace].
This page took 0.026155 seconds and 4 git commands to generate.