/* * Any file that uses trace points, must include the header. * But only one file, must include the header by defining * CREATE_TRACE_POINTS first. This will make the C code that * creates the handles for the trace points.
*/ #define CREATE_TRACE_POINTS #include"trace-events-sample.h"
staticconstchar *random_strings[] = { "Mother Goose", "Snoopy", "Gandalf", "Frodo", "One ring to rule them all"
};
staticvoid do_simple_thread_func(int cnt, constchar *fmt, ...)
{ unsignedlong bitmask[1] = {0xdeadbeefUL};
va_list va; int array[6]; int len = cnt % 5; int i;
int foo_bar_reg(void)
{
mutex_lock(&thread_mutex); if (simple_thread_cnt++) goto out;
pr_info("Starting thread for foo_bar_fn\n"); /* * We shouldn't be able to start a trace when the module is * unloading (there's other locks to prevent that). But * for consistency sake, we still take the thread_mutex.
*/
simple_tsk_fn = kthread_run(simple_thread_fn, NULL, "event-sample-fn");
out:
mutex_unlock(&thread_mutex); return 0;
}
void foo_bar_unreg(void)
{
mutex_lock(&thread_mutex); if (--simple_thread_cnt) goto out;
pr_info("Killing thread for foo_bar_fn\n"); if (simple_tsk_fn)
kthread_stop(simple_tsk_fn);
simple_tsk_fn = NULL;
out:
mutex_unlock(&thread_mutex);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.