Skip to content

Commit 8206de7

Browse files
mchehabJonathan Corbet
authored andcommitted
docs: trace: events.rst: convert some new stuff to ReST format
Some new chapters were added to the documentation. This caused Sphinx to complain, as the literal blocks there are not properly tagged as such. Also, a new note added there doesn't follow the ReST format. This fixes the following warnings: Documentation/trace/events.rst:589: WARNING: Definition list ends without a blank line; unexpected unindent. Documentation/trace/events.rst:620: WARNING: Inline emphasis start-string without end-string. Documentation/trace/events.rst:623: WARNING: Inline emphasis start-string without end-string. Documentation/trace/events.rst:626: WARNING: Inline emphasis start-string without end-string. Documentation/trace/events.rst:703: WARNING: Inline emphasis start-string without end-string. Documentation/trace/events.rst:697: WARNING: Inline emphasis start-string without end-string. Documentation/trace/events.rst:722: WARNING: Inline emphasis start-string without end-string. Documentation/trace/events.rst:775: WARNING: Definition list ends without a blank line; unexpected unindent. Documentation/trace/events.rst:814: WARNING: Inline emphasis start-string without end-string. Documentation/trace/events.rst:817: WARNING: Inline emphasis start-string without end-string. Documentation/trace/events.rst:820: WARNING: Inline emphasis start-string without end-string. Documentation/trace/events.rst:823: WARNING: Inline emphasis start-string without end-string. Documentation/trace/events.rst:826: WARNING: Inline emphasis start-string without end-string. Documentation/trace/events.rst:829: WARNING: Inline emphasis start-string without end-string. Documentation/trace/events.rst:832: WARNING: Inline emphasis start-string without end-string. Documentation/trace/events.rst:844: WARNING: Unexpected indentation. Documentation/trace/events.rst:845: WARNING: Block quote ends without a blank line; unexpected unindent. Documentation/trace/events.rst:849: WARNING: Unexpected indentation. Documentation/trace/events.rst:850: WARNING: Block quote ends without a blank line; unexpected unindent. Documentation/trace/events.rst:883: WARNING: Inline emphasis start-string without end-string. Documentation/trace/events.rst:886: WARNING: Inline emphasis start-string without end-string. Documentation/trace/events.rst:889: WARNING: Inline emphasis start-string without end-string. Documentation/trace/events.rst:895: WARNING: Bullet list ends without a blank line; unexpected unindent. Documentation/trace/events.rst:895: WARNING: Inline emphasis start-string without end-string. Documentation/trace/events.rst:968: WARNING: Inline emphasis start-string without end-string. Fixes: 34ed635 ("tracing: Documentation for in-kernel synthetic event API") Signed-off-by: Mauro Carvalho Chehab <[email protected]> Reviewed-by: Tom Zanussi <[email protected]> Acked-by: Steven Rostedt (VMware) <[email protected]> Link: https://lore.kernel.org/r/afbe367ccb7b9abcb9fab7bc5cb5e0686c105a53.1583250595.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet <[email protected]>
1 parent d1ce350 commit 8206de7

File tree

1 file changed

+32
-31
lines changed

1 file changed

+32
-31
lines changed

Documentation/trace/events.rst

Lines changed: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,8 @@ section of Documentation/trace/ftrace.rst), but there are major
342342
differences and the implementation isn't currently tied to it in any
343343
way, so beware about making generalizations between the two.
344344

345-
Note: Writing into trace_marker (See Documentation/trace/ftrace.rst)
345+
.. Note::
346+
Writing into trace_marker (See Documentation/trace/ftrace.rst)
346347
can also enable triggers that are written into
347348
/sys/kernel/tracing/events/ftrace/print/trigger
348349

@@ -569,14 +570,14 @@ The first creates the event in one step, using synth_event_create().
569570
In this method, the name of the event to create and an array defining
570571
the fields is supplied to synth_event_create(). If successful, a
571572
synthetic event with that name and fields will exist following that
572-
call. For example, to create a new "schedtest" synthetic event:
573+
call. For example, to create a new "schedtest" synthetic event::
573574

574575
ret = synth_event_create("schedtest", sched_fields,
575576
ARRAY_SIZE(sched_fields), THIS_MODULE);
576577

577578
The sched_fields param in this example points to an array of struct
578579
synth_field_desc, each of which describes an event field by type and
579-
name:
580+
name::
580581

581582
static struct synth_field_desc sched_fields[] = {
582583
{ .type = "pid_t", .name = "next_pid_field" },
@@ -615,7 +616,7 @@ synth_event_gen_cmd_array_start(), the user should create and
615616
initialize a dynevent_cmd object using synth_event_cmd_init().
616617

617618
For example, to create a new "schedtest" synthetic event with two
618-
fields:
619+
fields::
619620

620621
struct dynevent_cmd cmd;
621622
char *buf;
@@ -631,7 +632,7 @@ fields:
631632
"u64", "ts_ns");
632633

633634
Alternatively, using an array of struct synth_field_desc fields
634-
containing the same information:
635+
containing the same information::
635636

636637
ret = synth_event_gen_cmd_array_start(&cmd, "schedtest", THIS_MODULE,
637638
fields, n_fields);
@@ -640,7 +641,7 @@ Once the synthetic event object has been created, it can then be
640641
populated with more fields. Fields are added one by one using
641642
synth_event_add_field(), supplying the dynevent_cmd object, a field
642643
type, and a field name. For example, to add a new int field named
643-
"intfield", the following call should be made:
644+
"intfield", the following call should be made::
644645

645646
ret = synth_event_add_field(&cmd, "int", "intfield");
646647

@@ -649,7 +650,7 @@ the field is considered to be an array.
649650

650651
A group of fields can also be added all at once using an array of
651652
synth_field_desc with add_synth_fields(). For example, this would add
652-
just the first four sched_fields:
653+
just the first four sched_fields::
653654

654655
ret = synth_event_add_fields(&cmd, sched_fields, 4);
655656

@@ -658,7 +659,7 @@ synth_event_add_field_str() can be used to add it as-is; it will
658659
also automatically append a ';' to the string.
659660

660661
Once all the fields have been added, the event should be finalized and
661-
registered by calling the synth_event_gen_cmd_end() function:
662+
registered by calling the synth_event_gen_cmd_end() function::
662663

663664
ret = synth_event_gen_cmd_end(&cmd);
664665

@@ -691,7 +692,7 @@ trace array)), along with an variable number of u64 args, one for each
691692
synthetic event field, and the number of values being passed.
692693

693694
So, to trace an event corresponding to the synthetic event definition
694-
above, code like the following could be used:
695+
above, code like the following could be used::
695696

696697
ret = synth_event_trace(create_synth_test, 7, /* number of values */
697698
444, /* next_pid_field */
@@ -715,7 +716,7 @@ trace array)), along with an array of u64, one for each synthetic
715716
event field.
716717

717718
To trace an event corresponding to the synthetic event definition
718-
above, code like the following could be used:
719+
above, code like the following could be used::
719720

720721
u64 vals[7];
721722

@@ -739,7 +740,7 @@ In order to trace a synthetic event, a pointer to the trace event file
739740
is needed. The trace_get_event_file() function can be used to get
740741
it - it will find the file in the given trace instance (in this case
741742
NULL since the top trace array is being used) while at the same time
742-
preventing the instance containing it from going away:
743+
preventing the instance containing it from going away::
743744

744745
schedtest_event_file = trace_get_event_file(NULL, "synthetic",
745746
"schedtest");
@@ -751,31 +752,31 @@ To enable a synthetic event from the kernel, trace_array_set_clr_event()
751752
can be used (which is not specific to synthetic events, so does need
752753
the "synthetic" system name to be specified explicitly).
753754

754-
To enable the event, pass 'true' to it:
755+
To enable the event, pass 'true' to it::
755756

756757
trace_array_set_clr_event(schedtest_event_file->tr,
757758
"synthetic", "schedtest", true);
758759

759-
To disable it pass false:
760+
To disable it pass false::
760761

761762
trace_array_set_clr_event(schedtest_event_file->tr,
762763
"synthetic", "schedtest", false);
763764

764765
Finally, synth_event_trace_array() can be used to actually trace the
765-
event, which should be visible in the trace buffer afterwards:
766+
event, which should be visible in the trace buffer afterwards::
766767

767768
ret = synth_event_trace_array(schedtest_event_file, vals,
768769
ARRAY_SIZE(vals));
769770

770771
To remove the synthetic event, the event should be disabled, and the
771-
trace instance should be 'put' back using trace_put_event_file():
772+
trace instance should be 'put' back using trace_put_event_file()::
772773

773774
trace_array_set_clr_event(schedtest_event_file->tr,
774775
"synthetic", "schedtest", false);
775776
trace_put_event_file(schedtest_event_file);
776777

777778
If those have been successful, synth_event_delete() can be called to
778-
remove the event:
779+
remove the event::
779780

780781
ret = synth_event_delete("schedtest");
781782

@@ -784,7 +785,7 @@ remove the event:
784785

785786
To trace a synthetic using the piecewise method described above, the
786787
synth_event_trace_start() function is used to 'open' the synthetic
787-
event trace:
788+
event trace::
788789

789790
struct synth_trace_state trace_state;
790791

@@ -809,7 +810,7 @@ along with the value to set the next field in the event. After each
809810
field is set, the 'cursor' points to the next field, which will be set
810811
by the subsequent call, continuing until all the fields have been set
811812
in order. The same sequence of calls as in the above examples using
812-
this method would be (without error-handling code):
813+
this method would be (without error-handling code)::
813814

814815
/* next_pid_field */
815816
ret = synth_event_add_next_val(777, &trace_state);
@@ -837,7 +838,7 @@ used. Each call is passed the same synth_trace_state object used in
837838
the synth_event_trace_start(), along with the field name of the field
838839
to set and the value to set it to. The same sequence of calls as in
839840
the above examples using this method would be (without error-handling
840-
code):
841+
code)::
841842

842843
ret = synth_event_add_val("next_pid_field", 777, &trace_state);
843844
ret = synth_event_add_val("next_comm_field", (u64)"silly putty",
@@ -855,7 +856,7 @@ can be used but not both at the same time.
855856

856857
Finally, the event won't be actually traced until it's 'closed',
857858
which is done using synth_event_trace_end(), which takes only the
858-
struct synth_trace_state object used in the previous calls:
859+
struct synth_trace_state object used in the previous calls::
859860

860861
ret = synth_event_trace_end(&trace_state);
861862

@@ -878,7 +879,7 @@ function. Before calling kprobe_event_gen_cmd_start(), the user
878879
should create and initialize a dynevent_cmd object using
879880
kprobe_event_cmd_init().
880881

881-
For example, to create a new "schedtest" kprobe event with two fields:
882+
For example, to create a new "schedtest" kprobe event with two fields::
882883

883884
struct dynevent_cmd cmd;
884885
char *buf;
@@ -900,18 +901,18 @@ Once the kprobe event object has been created, it can then be
900901
populated with more fields. Fields can be added using
901902
kprobe_event_add_fields(), supplying the dynevent_cmd object along
902903
with a variable arg list of probe fields. For example, to add a
903-
couple additional fields, the following call could be made:
904+
couple additional fields, the following call could be made::
904905

905906
ret = kprobe_event_add_fields(&cmd, "flags=%cx", "mode=+4($stack)");
906907

907908
Once all the fields have been added, the event should be finalized and
908909
registered by calling the kprobe_event_gen_cmd_end() or
909910
kretprobe_event_gen_cmd_end() functions, depending on whether a kprobe
910-
or kretprobe command was started:
911+
or kretprobe command was started::
911912

912913
ret = kprobe_event_gen_cmd_end(&cmd);
913914

914-
or
915+
or::
915916

916917
ret = kretprobe_event_gen_cmd_end(&cmd);
917918

@@ -920,21 +921,21 @@ events.
920921

921922
Similarly, a kretprobe event can be created using
922923
kretprobe_event_gen_cmd_start() with a probe name and location and
923-
additional params such as $retval:
924+
additional params such as $retval::
924925

925926
ret = kretprobe_event_gen_cmd_start(&cmd, "gen_kretprobe_test",
926927
"do_sys_open", "$retval");
927928

928929
Similar to the synthetic event case, code like the following can be
929-
used to enable the newly created kprobe event:
930+
used to enable the newly created kprobe event::
930931

931932
gen_kprobe_test = trace_get_event_file(NULL, "kprobes", "gen_kprobe_test");
932933

933934
ret = trace_array_set_clr_event(gen_kprobe_test->tr,
934935
"kprobes", "gen_kprobe_test", true);
935936

936937
Finally, also similar to synthetic events, the following code can be
937-
used to give the kprobe event file back and delete the event:
938+
used to give the kprobe event file back and delete the event::
938939

939940
trace_put_event_file(gen_kprobe_test);
940941

@@ -963,7 +964,7 @@ are described below.
963964

964965
The first step in building a new command string is to create and
965966
initialize an instance of a dynevent_cmd. Here, for instance, we
966-
create a dynevent_cmd on the stack and initialize it:
967+
create a dynevent_cmd on the stack and initialize it::
967968

968969
struct dynevent_cmd cmd;
969970
char *buf;
@@ -989,7 +990,7 @@ calls to argument-adding functions.
989990
To add a single argument, define and initialize a struct dynevent_arg
990991
or struct dynevent_arg_pair object. Here's an example of the simplest
991992
possible arg addition, which is simply to append the given string as
992-
a whitespace-separated argument to the command:
993+
a whitespace-separated argument to the command::
993994

994995
struct dynevent_arg arg;
995996

@@ -1007,7 +1008,7 @@ the arg.
10071008
Here's another more complicated example using an 'arg pair', which is
10081009
used to create an argument that consists of a couple components added
10091010
together as a unit, for example, a 'type field_name;' arg or a simple
1010-
expression arg e.g. 'flags=%cx':
1011+
expression arg e.g. 'flags=%cx'::
10111012

10121013
struct dynevent_arg_pair arg_pair;
10131014

@@ -1031,7 +1032,7 @@ Any number of dynevent_*_add() calls can be made to build up the string
10311032
(until its length surpasses cmd->maxlen). When all the arguments have
10321033
been added and the command string is complete, the only thing left to
10331034
do is run the command, which happens by simply calling
1034-
dynevent_create():
1035+
dynevent_create()::
10351036

10361037
ret = dynevent_create(&cmd);
10371038

0 commit comments

Comments
 (0)