Re: [PATCH 2/4] kernel-shark-qt: Add KernalShark Utils

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

 





On 10.10.2018 18:22, Steven Rostedt wrote:
On Wed, 10 Oct 2018 17:12:40 +0300
Yordan Karadzhov <ykaradzhov@xxxxxxxxxx> wrote:

On  9.10.2018 19:34, Steven Rostedt wrote:
+	if (!kshark_instance(&kshark_ctx))
+		return;
+
+	switch (filterId) {
+		case KS_SHOW_EVENT_FILTER:
+		case KS_HIDE_EVENT_FILTER:
+			kshark_filter_clear(kshark_ctx, KS_SHOW_EVENT_FILTER);
+			kshark_filter_clear(kshark_ctx, KS_HIDE_EVENT_FILTER);
Hmm, I'm curious to why you clear both SHOW/HIDE filters if the
filterId is one of SHOW or HIDE?

Perhaps a comment should be here explaining it too.


This enforces that we cannot have both SHOW and HIDE filters being set.
I think that, having SHOW and HIDE filters set in the same time can be
useful in very limited number of cases. On the other hand this is an
easy way to confuse yourself.

Note that this restriction is at the level of the GUI code. The C API
allows for having both SHOW and HIDE filters in the same time.


Actually, there are real uses to do both. You may want to show a
specific kind of event, and then you may want to filter a subset of
that event.


But if you want to filter a subset of one event you have to use the advanced filtering, while the logic in the "switch" is only for the "Id filters".

Thanks!
Yordan


-- Steve




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

  Powered by Linux