[PATCH 2/2] libtracefs: Documentation for tracefs_synth_set_instance

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The newly introduced API tracefs_synth_set_instance() should be
described in the man pages of the tracefs library.

Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@xxxxxxxxx>
---
 Documentation/libtracefs-synth2.txt | 15 +++++++++++----
 Documentation/libtracefs.txt        |  1 +
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/Documentation/libtracefs-synth2.txt b/Documentation/libtracefs-synth2.txt
index 7e8e6cc..d94fa7c 100644
--- a/Documentation/libtracefs-synth2.txt
+++ b/Documentation/libtracefs-synth2.txt
@@ -4,7 +4,7 @@ libtracefs(3)
 NAME
 ----
 tracefs_synth_create, tracefs_synth_destroy, tracefs_synth_complete,
-tracefs_synth_trace, tracefs_synth_snapshot, tracefs_synth_save
+tracefs_synth_trace, tracefs_synth_snapshot, tracefs_synth_save,tracefs_synth_set_instance,
 - Creation of synthetic events
 
 SYNOPSIS
@@ -17,6 +17,7 @@ int *tracefs_synth_create*(struct tracefs_synth pass:[*]_synth_);
 int *tracefs_synth_destroy*(struct tracefs_synth pass:[*]_synth_);
 bool *tracefs_synth_complete*(struct tracefs_synth pass:[*]_synth_);
 
+int *tracefs_synth_set_instance*(struct tracefs_synth pass:[*]_synth_, struct tracefs_instance pass:[*]_instance_);
 int *tracefs_synth_trace*(struct tracefs_synth pass:[*]_synth_,
 			enum tracefs_synth_handler _type_, const char pass:[*]_var_);
 int *tracefs_synth_snapshot*(struct tracefs_synth pass:[*]_synth_,
@@ -45,9 +46,11 @@ as a field for both events to calculate the delta in nanoseconds, or use
 *TRACEFS_TIMESTAMP_USECS* as the compare fields for both events to calculate the
 delta in microseconds. This is used as the example below.
 
-*tracefs_synth_create*() creates the synthetic event in the system. The synthetic events apply
-across all instances. A synthetic event must be created with *tracefs_synth_alloc*(3) before
-it can be created.
+*tracefs_synth_create*() creates the synthetic event in the system. By default, the synthetic
+events are created in the top trace instance and apply across all instances.
+The *tracefs_synth_set_instance()* API can be used to set a custom instance, where the synthetic
+event will be created. In that case the event operates only in that instance. A synthetic event
+must be created with *tracefs_synth_alloc*(3) before it can be created.
 
 *tracefs_synth_destroy*() destroys the synthetic event. It will attempt to stop the running of it in
 its instance (top by default), but if its running in another instance this may fail as busy.
@@ -74,6 +77,10 @@ then save the given _save_fields_ list. The fields will be stored in the histogr
 "hist" file of the event that can be retrieved with *tracefs_event_file_read*(3).
 _var_ must be one of the _name_ elements used in *tracefs_synth_add_end_field*(3).
 
+*tracefs_synth_set_instance()* Set the trace instance, where the synthetic event will be
+created. By default, the top instance is used. This API must be called before the call to
+*tracefs_synth_create()*, in order to use the new instance when creating the event.
+
 RETURN VALUE
 ------------
 All functions return zero on success or -1 on error.
diff --git a/Documentation/libtracefs.txt b/Documentation/libtracefs.txt
index c3f448d..daf044f 100644
--- a/Documentation/libtracefs.txt
+++ b/Documentation/libtracefs.txt
@@ -213,6 +213,7 @@ Synthetic events:
 	void *tracefs_synth_free*(struct tracefs_synth pass:[*]_synth_);
 	int *tracefs_synth_create*(struct tracefs_synth pass:[*]_synth_);
 	int *tracefs_synth_destroy*(struct tracefs_synth pass:[*]_synth_);
+	int *tracefs_synth_set_instance*(struct tracefs_synth pass:[*]_synth_, struct tracefs_instance pass:[*]_instance_);
 	int *tracefs_synth_echo_cmd*(struct trace_seq pass:[*]_seq_, struct tracefs_synth pass:[*]_synth_);
 	bool *tracefs_synth_complete*(struct tracefs_synth pass:[*]_synth_);
 	struct tracefs_hist pass:[*]*tracefs_synth_get_start_hist*(struct tracefs_synth pass:[*]_synth_);
-- 
2.39.2




[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux