@@ -17,6 +17,7 @@ int tracefs_synth_destroy(struct tracefs_instance pass:[*]instance,
struct tracefs_synth pass:[*]synth);
int tracefs_synth_show(struct trace_seq pass:[*]seq, struct tracefs_instance pass:[*]instance,
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);
--
@@ -53,6 +54,9 @@ this may fail as busy.
the synthetic event in the given _instance_, it will write the echo commands to
manually create it in the _seq_ given.
+*tracefs_synth_complete*() returns true if the synthetic event _synth_ has both
+a starting and ending event.
+
*tracefs_synth_get_start_hist*() returns a struct tracefs_hist descriptor describing
the histogram used to create the synthetic event.
@@ -467,6 +467,7 @@ int tracefs_synth_append_end_filter(struct tracefs_synth *synth,
const char *field,
enum tracefs_compare compare,
const char *val);
+bool tracefs_synth_complete(struct tracefs_synth *synth);
struct tracefs_hist *tracefs_synth_get_start_hist(struct tracefs_synth *synth);
int tracefs_synth_create(struct tracefs_instance *instance,
struct tracefs_synth *synth);
@@ -1354,6 +1354,19 @@ static int verify_state(struct tracefs_synth *synth)
return 0;
}
+/**
+ * tracefs_synth_complete - tell if the tracefs_synth is complete or not
+ * @synth: The synthetic event to get the start hist from.
+ *
+ * Retruns true if the synthetic event @synth has both a start and
+ * end event (ie. a synthetic event, or just a histogram), and
+ * false otherwise.
+ */
+bool tracefs_synth_complete(struct tracefs_synth *synth)
+{
+ return synth && synth->start_event && synth->end_event;
+}
+
/**
* tracefs_synth_get_start_hist - Return the histogram of the start event
* @synth: The synthetic event to get the start hist from.