On 11.07.2018 19:41, Steven Rostedt wrote:
+/** + * @brief Simple Pid matching function to be user for data requests. + * @param kshark_ctx: Input location for the session context pointer. + * @param e: kshark_entry to be checked. + * @param pid: Matching condition value. + * @returns True if the Pid of the entry matches the value of "pid". + * Else false.Is this going to be extended in the future? Why the kshark_ctx?
Yes, this is something we need to discuss. in the header we have /** Matching condition function type. To be user for data requests */ typedef bool (matching_condition_func)(struct kshark_context*, struct kshark_entry*, int);I wanted the type of the abstract condition function to be such that it can accommodate complicated logic in the future.
What do you think? Thanks! Yordan
+ */ +bool kshark_check_pid(struct kshark_context *kshark_ctx, + struct kshark_entry *e, int pid) +{ + if (e->pid == pid) + return true; + + return false; +} +