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.
Thanks! Yordan
+ break; + case KS_SHOW_TASK_FILTER: + case KS_HIDE_TASK_FILTER: + kshark_filter_clear(kshark_ctx, KS_SHOW_TASK_FILTER); + kshark_filter_clear(kshark_ctx, KS_HIDE_TASK_FILTER); + break; + default: + return; + } + + for (auto &&pid: vec) + kshark_filter_add_id(kshark_ctx, filterId, pid); +