On 25.06.2018 21:30, Steven Rostedt wrote:
+/** Linked list of tasks. */Note, the Linux kernel doc way of doing these types of comments is like this: /** * kshark_task_list - Linked list of tasks * @next: Pointer to the text task's PID * @pid: PID of a task. */
If we want to be able to produce Doxygen documentation for the code we have to stick to the Doxygen syntax for comments.
+struct kshark_task_list { + /** Pointer to the next task's PID. */ + struct kshark_task_list *next; + + /** PID of a task. */ + int pid; +}; + +/** Structure representing a kshark session. */ +struct kshark_context { + /** Input handle for the trace data file. */ + struct tracecmd_input *handle; + + /** Page event used to parse the page. */ + struct pevent *pevt; + + /** List of task's PIDs. */ + struct kshark_task_list *tasks; + + /** A mutex, used to protect the access to the input file. */ + pthread_mutex_t input_mutex; +}; + +/** + * @brief Initialize a kshark session. This function must be called before calling any + * other kshark function. If the session has been initialized, this function can be used + * to obtain the session's context. + * @param kshark_ctx: Optional input/output location for context pointer. Only valid on + * return true. + * @returns true on success, or false on failure.Looks like you have a different set of commands for the doxygen comments than the kernel uses. Of course, the kernel may be using "kernel doc" format. I'm not an expert on this. But I would prefer to keep it more like what the kernel does. How hard would it be to switch over?
I have no experience with "kernel doc", so I have no idea if it will be easy or hard. I can try to investigate, but this will take some time.
I this the way to go? Thanks! Yordan
![]() |