Re: [PATCH v2 2/3] kernel-shark-qt: Add I/O for configuration data.

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

 



Hi Steven,

On 15.08.2018 05:46, Steven Rostedt wrote:
+/**
+ * @brief Record the current configuration of the advanced filter into a
+ *	  Configuration document.
+ *
+ * @param kshark_ctx: Input location for session context pointer.
+ * @param conf: Input location for the kshark_config_doc instance. Currently
+ *		only Json format is supported. If NULL, a new Adv. Filter
+ *		Configuration document will be created.
We should have a format parameter here, where they can specify what
type to create (currently only KS_JSON_CONFIG is supported). Otherwise,
how would one pass something else in when if we support something else?


The idea here is that the user is expected to provide an instance of kshark_config_doc and this instance already has a format.

A new instance will be created only in the case of passing conf = NULL.
In this case the new instance will have the default format (Json).

I agree that it looks peculiar, because we support only one format for the moment. ;-)

Thanks!
Yordan


+ */
+void kshark_export_adv_filters(struct kshark_context *kshark_ctx,
+			       struct kshark_config_doc **conf)
+{
+	if (!*conf)
+		*conf = kshark_filter_config_new(KS_JSON_CONFIG);
+
+	if ((*conf)->format == KS_JSON_CONFIG)
+		kshark_adv_filters_to_json(kshark_ctx, (*conf)->conf_doc);
+}



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

  Powered by Linux